();\n const boxStyle = useMemo(() => {\n return {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '500px', \n height: '500px',\n background: '#439966',\n fontSize: '2rem',\n color: '#fff',\n }\n }, []);\n\n return (\n <>\n \n \ub9c8\uc6b0\uc2a4\ub97c \uc6c0\uc9c1\uc5ec\ubcf4\uc138\uc694.\n
\n \uc0ac\uc6a9\uc790 \ubaa8\ub2c8\ud130 \ub0b4 X\uc88c\ud45c: {position.screenX}
\n \uc0ac\uc6a9\uc790 \ubaa8\ub2c8\ud130 \ub0b4 Y\uc88c\ud45c: {position.screenY}
\n \uc2a4\ud06c\ub9b0 \uc601\uc5ed \ub0b4 X\uc88c\ud45c: {position.clientX}
\n \uc2a4\ud06c\ub9b0 \uc601\uc5ed \ub0b4 Y\uc88c\ud45c: {position.clientY}
\n \uc804\uccb4 \ubb38\uc11c \uae30\uc900 X\uc88c\ud45c: {position.pageX}
\n \uc804\uccb4 \ubb38\uc11c \uae30\uc900 Y\uc88c\ud45c: {position.pageY}
\n \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8 \uae30\uc900 X\uc88c\ud45c: {position.elementRelativeX}
\n \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8 \uae30\uc900 Y\uc88c\ud45c: {position.elementRelativeY}
\n \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\uc758 X\uc88c\ud45c : {position.elementPositionX}
\n \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\uc758 Y\uc88c\ud45c : {position.elementPositionY}
\n \n );\n};\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(s.Z,{children:()=>(0,i.jsx)(f,{})})]})}function w(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(p,{...e})}):p(e)}},5549:(e,t,n)=>{n.d(t,{Z:()=>o});n(7800);var i=n(4798),r=n(1986);function o(e){let{children:t,fallback:n}=e;return(0,i.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>be,Cf:()=>Se,D9:()=>He,FS:()=>ct,GN:()=>Ce,Hk:()=>ye,KS:()=>ot,LN:()=>Ve,Mm:()=>xe,Nr:()=>oe,OR:()=>we,Pr:()=>Ze,S1:()=>se,VP:()=>ke,XI:()=>Me,Xs:()=>nt,Yz:()=>Ne,_:()=>$e,a9:()=>ue,ac:()=>Ae,cM:()=>lt,df:()=>fe,fB:()=>rt,g4:()=>Ee,iP:()=>dt,ii:()=>qe,jr:()=>Te,my:()=>he,nA:()=>ge,oM:()=>d,oz:()=>De,qQ:()=>Ke,qx:()=>b,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ve,yU:()=>We,yn:()=>Oe,z$:()=>je});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function f(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const b=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>f()?(0,i.jsx)(i.Fragment,{children:t}):e;var p="object"==typeof global&&global&&global.Object===Object&&global,w="object"==typeof self&&self&&self.Object===Object&&self,m=p||w||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",j=h?h.toStringTag:void 0;var C="[object Symbol]",O=/\s/,T=/^\s+/;function M(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=NaN,R=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,I=/^0o[0-7]+$/i,P=parseInt;function X(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:j&&j in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return N;if(M(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=M(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(T,""):e}(e);var n=_.test(e);return n||I.test(e)?P(e.slice(2),n?2:8):R.test(e)?N:+e}var Y=function(){return m.Date.now()},z="Expected a function",$=Math.max,L=Math.min;function A(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(z);function b(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function p(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function w(){var e=Y();if(p(e))return m(e);s=setTimeout(w,function(e){var n=t-(e-c);return d?L(n,o-(e-l)):n}(e))}function m(e){return s=void 0,f&&i?b(e):(i=r=void 0,a)}function h(){var e=Y(),n=p(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(w,t),u?b(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(w,t),b(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=X(t)||0,M(n)&&(u=!!n.leading,o=(d="maxWait"in n)?$(X(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(Y())},h}var F="Expected a function";function q(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const B={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},U=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function D(){return!V()}function H(e){return q(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const W=e=>q(void 0,0,void 0,(function*(){const t=yield fetch(e);return H(yield t.text())}));const Z=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!G(e[o],t[o],n))return!1;return!0},G=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(K(e)&&K(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return Z(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!G(r,t.get(i),n))return!1;return!0}return Z(e,t,n)};function J(e,t){return G(e,t,new WeakMap)}function K(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=J){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>A(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{K(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),f=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:f,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,f=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[b,p]=(0,r.useState)(!1),w=!b,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:w?0:1,transition:`opacity ${u}`},l)),[w,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),p(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[w&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},f))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},fe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:f}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,f)},d,{children:e.children}))}));fe.displayName="InView";const be=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},pe=D()?r.useLayoutEffect:r.useEffect;function we(e,t,n,i={}){const r=re(i),o=ne(n);pe((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return we(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ve=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(be,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ge=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield H(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return q(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return W(e);if(!("write"in window.navigator.clipboard))return W(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return W(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>q(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield U(e,B[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return q(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return q(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function Ee({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=K(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),f=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),b=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),p=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:f,goToPrevStep:b,resetStep:p}}function je(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=Ee({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ce(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Oe(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ce("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Te(e,{preserveTitleOnUnmount:t=!1}={}){pe((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Me({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Ne(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Re="modern-kit-local-storage",_e="modern-kit-session-storage",Ie={localStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}},sessionStorage:{key:_e,subscribe:e=>{window.addEventListener(_e,e)},unsubscribe:e=>{window.removeEventListener(_e,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(_e))}}},Pe=e=>Ie[e],Xe=Pe("localStorage"),Ye=e=>window.localStorage.getItem(e),ze=e=>(Xe.subscribe(e),()=>{Xe.unsubscribe(e)});function $e(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(K(n)?n():n),o=(0,r.useSyncExternalStore)(ze,(()=>Ye(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Ye(t),r=n?te(n):i,o=K(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Xe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Xe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Le=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function Ae(e,t){const[n,i]=(0,r.useState)(Le(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return we(window.matchMedia(e),"change",o),n}const Fe={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function qe(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(Fe),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,f=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,f=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:f})}),[]);return we(window.document,"mousemove",i),{ref:e,position:t}}const Be=()=>navigator.onLine,Ue=()=>!0;function Ve({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Be,Ue)}}function De(){return Ae("(prefers-color-scheme: dark)")?"dark":"light"}function He(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function We(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ze({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return pe((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Ge=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Je=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Ge(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Ge(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Ge(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Ge(c.width,i.width,s)}};function Ke(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Je(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=Pe("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(K(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=K(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=K(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=K(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},Ee(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(F);return M(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),A(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",f="vendor",b="version",p="architecture",w="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",j="Browser",C="Chrome",O="Firefox",T="Google",M="Huawei",N="LG",R="Microsoft",_="Motorola",I="Opera",P="Samsung",X="Sharp",Y="Sony",z="Xiaomi",$="Zebra",L="Facebook",A="Chromium OS",F="Mac OS",q=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},H=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[b]=i,D.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[b]=i,D.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,A).replace(/macos/i,F)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};G.VERSION="1.0.38",G.BROWSER=q([u,b,c]),G.CPU=q([p]),G.DEVICE=q([l,f,d,w,m,v,h,g,y]),G.ENGINE=G.OS=q([u,b]),e.exports&&(t=e.exports=G),t.UAParser=G;var J=typeof n!==o&&(n.jQuery||n.Zepto);if(J&&!J.ua){var K=new G;J.ua=K.getResult(),J.ua.get=function(){return K.getUA()},J.ua.set=function(e){K.setUA(e);var t=K.getResult();for(var n in t)J.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,r.useState)(null);return pe((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){pe((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,r.useState)((()=>V()?ut:{width:window.innerWidth,height:window.innerHeight})),i=oe(n,e),o=(0,r.useCallback)((()=>{(e?i:n)({width:window.innerWidth,height:window.innerHeight})}),[e,i]);return we(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/225c6dfe.abb4e92d.js.LICENSE.txt b/assets/js/225c6dfe.5643584e.js.LICENSE.txt
similarity index 100%
rename from assets/js/225c6dfe.abb4e92d.js.LICENSE.txt
rename to assets/js/225c6dfe.5643584e.js.LICENSE.txt
diff --git a/assets/js/225c6dfe.abb4e92d.js b/assets/js/225c6dfe.abb4e92d.js
deleted file mode 100644
index 6215fdb7e..000000000
--- a/assets/js/225c6dfe.abb4e92d.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 225c6dfe.abb4e92d.js.LICENSE.txt */
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[9287],{2870:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>d,assets:()=>u,contentTitle:()=>c,default:()=>p,frontMatter:()=>s,metadata:()=>l,toc:()=>f});var i=n(1986),r=n(9937),o=n(7800),a=n(384);const s={},c="useMouse",l={id:"react/hooks/useMouse",title:"useMouse",description:"\ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\ub97c \uae30\uc900\uc73c\ub85c \ub9c8\uc6b0\uc2a4\uc758 \uc704\uce58\ub97c \ucd94\uc801\ud558\ub294 Hook\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useMouse.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useMouse",permalink:"/modern-kit/docs/react/hooks/useMouse",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useMergeRefs",permalink:"/modern-kit/docs/react/hooks/useMergeRefs"},next:{title:"useNetwork",permalink:"/modern-kit/docs/react/hooks/useNetwork"}},u={},d=()=>{const e={div:"div",p:"p",...(0,r.a)()},{ref:t,position:n}=(0,a.ii)(),s=(0,o.useMemo)((()=>({display:"flex",alignItems:"center",justifyContent:"center",width:"500px",height:"500px",background:"#439966",fontSize:"2rem",color:"#fff"})),[]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.div,{ref:t,style:s,children:"\ub9c8\uc6b0\uc2a4\ub97c \uc6c0\uc9c1\uc5ec\ubcf4\uc138\uc694."}),(0,i.jsxs)(e.p,{children:["\uc0ac\uc6a9\uc790 \ubaa8\ub2c8\ud130 \ub0b4 X\uc88c\ud45c: ",n.screenX]}),(0,i.jsxs)(e.p,{children:["\uc0ac\uc6a9\uc790 \ubaa8\ub2c8\ud130 \ub0b4 Y\uc88c\ud45c: ",n.screenY]}),(0,i.jsxs)(e.p,{children:["\uc2a4\ud06c\ub9b0 \uc601\uc5ed \ub0b4 X\uc88c\ud45c: ",n.clientX]}),(0,i.jsxs)(e.p,{children:["\uc2a4\ud06c\ub9b0 \uc601\uc5ed \ub0b4 Y\uc88c\ud45c: ",n.clientY]}),(0,i.jsxs)(e.p,{children:["\uc804\uccb4 \ubb38\uc11c \uae30\uc900 X\uc88c\ud45c: ",n.pageX]}),(0,i.jsxs)(e.p,{children:["\uc804\uccb4 \ubb38\uc11c \uae30\uc900 Y\uc88c\ud45c: ",n.pageY]}),(0,i.jsxs)(e.p,{children:["\ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8 \uae30\uc900 X\uc88c\ud45c: ",n.elementRelativeX]}),(0,i.jsxs)(e.p,{children:["\ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8 \uae30\uc900 Y\uc88c\ud45c: ",n.elementRelativeY]}),(0,i.jsxs)(e.p,{children:["\ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\uc758 X\uc88c\ud45c : ",n.elementPositionX]}),(0,i.jsxs)(e.p,{children:["\ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\uc758 Y\uc88c\ud45c : ",n.elementPositionY]})]})},f=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"usemouse",children:"useMouse"})}),"\n",(0,i.jsx)(t.p,{children:"\ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\ub97c \uae30\uc900\uc73c\ub85c \ub9c8\uc6b0\uc2a4\uc758 \uc704\uce58\ub97c \ucd94\uc801\ud558\ub294 Hook\uc785\ub2c8\ub2e4."}),"\n",(0,i.jsx)(t.p,{children:"\ud604\uc7ac \uc2a4\ud06c\ub9b0\uc5d0\uc11c\uc758 \uc704\uce58, \uc2a4\ud06c\ub9b0 \uc601\uc5ed \ub0b4\uc758 \uc704\uce58, \uc804\uccb4 \ubb38\uc11c\uc5d0\uc11c\uc758 \uc704\uce58, \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8 \uae30\uc900 \uc704\uce58, \ud574\ub2f9 \uc5d8\ub9ac\uba3c\ud2b8\uc758 \uc704\uce58\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4."}),"\n",(0,i.jsx)(t.p,{children:"\ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\uac00 \uc5c6\ub294 \uacbd\uc6b0 \uc0c1\ub300\uc801\uc778 \uc704\uce58\uc640 \ud574\ub2f9 \uc5d8\ub9ac\uba3c\ud2b8\uc758 \uc704\uce58\ub294 \uc81c\uacf5\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useMouse/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"\ninterface CursorPosition {\n screenX?: number;\n screenY?: number;\n clientX?: number;\n clientY?: number;\n pageX?: number;\n pageY?: number;\n elementRelativeX?: number;\n elementRelativeY?: number;\n elementPositionX?: number;\n elementPositionY?: number;\n}\n\nconst useMouse: () => {\n targetRef: T,\n position: CursorPosition:\n}\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useMouse } from '@modern-kit/react';\n\nconst Example = () => {\n const { ref, position } = useMouse();\n const boxStyle = useMemo(() => {\n return {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '500px', \n height: '500px',\n background: '#439966',\n fontSize: '2rem',\n color: '#fff',\n }\n }, []);\n\n return (\n <>\n \n \ub9c8\uc6b0\uc2a4\ub97c \uc6c0\uc9c1\uc5ec\ubcf4\uc138\uc694.\n
\n \uc0ac\uc6a9\uc790 \ubaa8\ub2c8\ud130 \ub0b4 X\uc88c\ud45c: {position.screenX}
\n \uc0ac\uc6a9\uc790 \ubaa8\ub2c8\ud130 \ub0b4 Y\uc88c\ud45c: {position.screenY}
\n \uc2a4\ud06c\ub9b0 \uc601\uc5ed \ub0b4 X\uc88c\ud45c: {position.clientX}
\n \uc2a4\ud06c\ub9b0 \uc601\uc5ed \ub0b4 Y\uc88c\ud45c: {position.clientY}
\n \uc804\uccb4 \ubb38\uc11c \uae30\uc900 X\uc88c\ud45c: {position.pageX}
\n \uc804\uccb4 \ubb38\uc11c \uae30\uc900 Y\uc88c\ud45c: {position.pageY}
\n \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8 \uae30\uc900 X\uc88c\ud45c: {position.elementRelativeX}
\n \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8 \uae30\uc900 Y\uc88c\ud45c: {position.elementRelativeY}
\n \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\uc758 X\uc88c\ud45c : {position.elementPositionX}
\n \ub300\uc0c1 \uc5d8\ub9ac\uba3c\ud2b8\uc758 Y\uc88c\ud45c : {position.elementPositionY}
\n \n );\n};\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(d,{})]})}function p(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>et,Bg:()=>be,Cf:()=>xe,D9:()=>Ue,FS:()=>ot,GN:()=>Ee,Hk:()=>ve,KS:()=>nt,LN:()=>qe,Mm:()=>ge,Nr:()=>oe,Pr:()=>De,S1:()=>se,VP:()=>ye,XI:()=>Oe,Xs:()=>Qe,Yz:()=>Te,_:()=>ze,a9:()=>ue,ac:()=>Le,cM:()=>at,df:()=>fe,fB:()=>tt,g4:()=>ke,iP:()=>st,ii:()=>$e,jr:()=>Ce,my:()=>pe,nA:()=>he,oM:()=>d,oz:()=>Be,qQ:()=>Ge,qx:()=>b,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>me,yU:()=>Ve,yn:()=>je,z$:()=>Se});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function f(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const b=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>f()?(0,i.jsx)(i.Fragment,{children:t}):e;var p="object"==typeof global&&global&&global.Object===Object&&global,w="object"==typeof self&&self&&self.Object===Object&&self,m=p||w||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",j=h?h.toStringTag:void 0;var C="[object Symbol]",O=/\s/,T=/^\s+/;function M(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=NaN,R=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,I=/^0o[0-7]+$/i,P=parseInt;function X(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:j&&j in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return N;if(M(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=M(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(T,""):e}(e);var n=_.test(e);return n||I.test(e)?P(e.slice(2),n?2:8):R.test(e)?N:+e}var z=function(){return m.Date.now()},Y="Expected a function",L=Math.max,$=Math.min;function A(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(Y);function b(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function p(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function w(){var e=z();if(p(e))return m(e);s=setTimeout(w,function(e){var n=t-(e-c);return d?$(n,o-(e-l)):n}(e))}function m(e){return s=void 0,f&&i?b(e):(i=r=void 0,a)}function h(){var e=z(),n=p(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(w,t),u?b(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(w,t),b(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=X(t)||0,M(n)&&(u=!!n.leading,o=(d="maxWait"in n)?L(X(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(z())},h}var F="Expected a function";function q(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const B={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},U=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function D(){return!V()}function H(e){return q(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const W=e=>q(void 0,0,void 0,(function*(){const t=yield fetch(e);return H(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>A(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),f=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:f,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,f=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[b,p]=(0,r.useState)(!1),w=!b,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:w?0:1,transition:`opacity ${u}`},l)),[w,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),p(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[w&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},f))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},fe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:f}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,f)},d,{children:e.children}))}));fe.displayName="InView";const be=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})};const pe=(0,r.forwardRef)(((e,t)=>{var{as:n,children:a,callback:s}=e,c=o(e,["as","children","callback"]);const{ref:l}=function(e){const t=(0,r.useRef)(null),n=ne(e);return(0,r.useEffect)((()=>{const e=function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown",i=({target:e})=>{const i=t.current;i&&!i.contains(e)&&n(i)};return document.addEventListener(e,i),()=>{document.removeEventListener(e,i)}}),[n]),{ref:t}}(s);return(0,i.jsx)(n||"div",Object.assign({ref:ce(l,t)},c,{children:a}))})),we=D()?r.useLayoutEffect:r.useEffect;(0,r.createContext)({parentPortalElement:null});const me=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(be,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},he=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ve=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function ge(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ye(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield H(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return q(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return W(e);if(!("write"in window.navigator.clipboard))return W(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return W(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>q(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield U(e,B[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return q(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return q(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function xe(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function ke({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),f=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),b=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),p=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:f,goToPrevStep:b,resetStep:p}}function Se(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=ke({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ee(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function je(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ee("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Ce(e,{preserveTitleOnUnmount:t=!1}={}){we((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Oe({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Te(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Me="modern-kit-local-storage",Ne="modern-kit-session-storage",Re={localStorage:{key:Me,subscribe:e=>{window.addEventListener(Me,e)},unsubscribe:e=>{window.removeEventListener(Me,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Me))}},sessionStorage:{key:Ne,subscribe:e=>{window.addEventListener(Ne,e)},unsubscribe:e=>{window.removeEventListener(Ne,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ne))}}},_e=e=>Re[e],Ie=_e("localStorage"),Pe=e=>window.localStorage.getItem(e),Xe=e=>(Ie.subscribe(e),()=>{Ie.unsubscribe(e)});function ze(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Xe,(()=>Pe(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Pe(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Ie.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Ie.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Ye=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function Le(e,t){const[n,i]=(0,r.useState)(Ye(e,t));return(0,r.useEffect)((()=>{const t=window.matchMedia(e),n=e=>i(e.matches);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),[e]),n}function $e(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)({screenX:void 0,screenY:void 0,clientX:void 0,clientY:void 0,pageX:void 0,pageY:void 0,elementRelativeX:void 0,elementRelativeY:void 0,elementPositionX:void 0,elementPositionY:void 0});return we((()=>{const t=t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t,l={},u={};if(e.current){const t=e.current.getBoundingClientRect(),n=o-t.left,i=a-t.top,r=t.left+window.scrollX,s=t.top+window.scrollY;l.elementRelativeX=n,l.elementRelativeY=i,u.elementPositionX=r,u.elementPositionY=s}n(Object.assign(Object.assign({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c},l),u))};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}}),[]),{ref:e,position:t}}const Ae=()=>navigator.onLine,Fe=()=>!0;function qe({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Ae,Fe)}}function Be(){return Le("(prefers-color-scheme: dark)")?"dark":"light"}function Ue(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function Ve(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function De({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return we((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const He=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,We=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+He(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+He(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+He(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+He(c.width,i.width,s)}};function Ge(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=We(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Je=_e("sessionStorage"),Ke=e=>window.sessionStorage.getItem(e),Ze=e=>(Je.subscribe(e),()=>{Je.unsubscribe(e)});function Qe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ze,(()=>Ke(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Ke(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Je.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Je.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function et(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},ke(e))}function tt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(F);return M(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),A(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function nt(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var it={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",f="vendor",b="version",p="architecture",w="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",j="Browser",C="Chrome",O="Firefox",T="Google",M="Huawei",N="LG",R="Microsoft",_="Motorola",I="Opera",P="Samsung",X="Sharp",z="Sony",Y="Xiaomi",L="Zebra",$="Facebook",A="Chromium OS",F="Mac OS",q=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},H=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[b]=i,D.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[b]=i,D.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,A).replace(/macos/i,F)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=q([u,b,c]),J.CPU=q([p]),J.DEVICE=q([l,f,d,w,m,v,h,g,y]),J.ENGINE=J.OS=q([u,b]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(it,it.exports);var rt=it.exports;function ot(){const[e,t]=(0,r.useState)(null);return we((()=>{const e=new rt.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function at({name:e="vh",enabledResize:t=!1}={}){we((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}function st(e={}){const{isDebounce:t=!1,wait:n=300}=e,[i,o]=(0,r.useState)({width:null,height:null}),a=(0,r.useCallback)((()=>{o({width:window.innerWidth,height:window.innerHeight})}),[]),s=ne(oe(a,n)),c=(0,r.useMemo)((()=>t?s:a),[a,t,s]);return we((()=>(a(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[a,c]),i}}}]);
\ No newline at end of file
diff --git a/assets/js/24c74d07.0164b733.js b/assets/js/24c74d07.0164b733.js
new file mode 100644
index 000000000..6aa55ca46
--- /dev/null
+++ b/assets/js/24c74d07.0164b733.js
@@ -0,0 +1,2 @@
+/*! For license information please see 24c74d07.0164b733.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[39],{172:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>u,assets:()=>l,contentTitle:()=>s,default:()=>f,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var i=n(1986),r=n(9937),o=n(384);const a={},s="FallbackLazyImage",c={id:"react/components/FallbackLazyImage",title:"FallbackLazyImage",description:"LazyImage \ucef4\ud3ec\ub10c\ud2b8 \ub97c \ud655\uc7a5\ud574 \uc774\ubbf8\uc9c0 load \uc5ec\ubd80\uc5d0 \ub530\ub978 Fallback \ucef4\ud3ec\ub10c\ud2b8\ub97c \ub80c\ub354\ub9c1 \ud558\ub294 \ucef4\ud3ec\ub10c\ud2b8 \uc785\ub2c8\ub2e4.",source:"@site/docs/react/components/FallbackLazyImage.mdx",sourceDirName:"react/components",slug:"/react/components/FallbackLazyImage",permalink:"/modern-kit/docs/react/components/FallbackLazyImage",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"DebounceWrapper",permalink:"/modern-kit/docs/react/components/DebounceWrapper"},next:{title:"IfElse",permalink:"/modern-kit/docs/react/components/IfElse"}},l={},u=()=>{const e={div:"div",...(0,r.a)()},t={width:"500px",height:"500px",backgroundColor:"green"};return(0,i.jsxs)(e.div,{style:{background:"#f8f8f8",width:"500px"},children:[(0,i.jsx)(e.div,{style:{height:"500px",textAlign:"center",fontSize:"2rem"},children:"\uc2a4\ud06c\ub864 \ud574\uc8fc\uc138\uc694."}),(0,i.jsx)(o.a9,{fallback:(0,i.jsx)(e.div,{style:t}),src:"https://github.com/Team-Grace/devgrace/assets/64779472/b5640bec-2abc-4205-afbf-ccfd9876a90b",alt:"img1",width:500,height:500}),(0,i.jsx)(e.div,{style:{width:"100%",height:"150px"}}),(0,i.jsx)(o.a9,{fallback:(0,i.jsx)(e.div,{style:t}),src:"https://github.com/Team-Grace/devgrace/assets/64779472/207743a7-b29f-4826-bc08-8df0d67e568b",alt:"img2",width:500,height:500}),(0,i.jsx)(e.div,{style:{width:"100%",height:"150px"}}),(0,i.jsx)(o.a9,{fallback:(0,i.jsx)(e.div,{style:t}),src:"https://github.com/Team-Grace/devgrace/assets/64779472/d1957ec8-fe87-406e-bfda-fb4ee505b152",alt:"img3",width:500,height:500})]})},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Default",id:"default",level:3},{value:"Wrapper Styling: css",id:"wrapper-styling-css",level:3},{value:"Wrapper Styling: css-in-js",id:"wrapper-styling-css-in-js",level:3},{value:"Example",id:"example",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"fallbacklazyimage",children:"FallbackLazyImage"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.a,{href:"https://modern-agile-team.github.io/modern-kit/docs/react/components/LazyImage",children:"LazyImage \ucef4\ud3ec\ub10c\ud2b8"})})," \ub97c \ud655\uc7a5\ud574 \uc774\ubbf8\uc9c0 ",(0,i.jsx)(t.code,{children:"load \uc5ec\ubd80"}),"\uc5d0 \ub530\ub978 ",(0,i.jsx)(t.code,{children:"Fallback \ucef4\ud3ec\ub10c\ud2b8"}),"\ub97c \ub80c\ub354\ub9c1 \ud558\ub294 \ucef4\ud3ec\ub10c\ud2b8 \uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"src"}),"\uc640 \ub354\ubd88\uc5b4 ",(0,i.jsx)(t.code,{children:"width"}),", ",(0,i.jsx)(t.code,{children:"height"}),", ",(0,i.jsx)(t.code,{children:"fallback"})," props\ub97c \ud544\uc218\ub85c \ub118\uaca8\uc918\uc57c \ud558\uba70, fallback\uc758 \ud06c\uae30\ub294 \ud574\ub2f9 width, height\uc640 \ub3d9\uc77c\ud558\uac8c \ub9de\ucd94\ub294 \uac83\uc744 \uad8c\uc7a5\ud569\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"duration"})," props\ub294 \uc2e4\uc81c \uc774\ubbf8\uc9c0\uac00 load \ub41c \ud6c4, fallback \ucef4\ud3ec\ub10c\ud2b8\uc5d0\uc11c \uc2e4\uc81c \uc774\ubbf8\uc9c0\ub85c \uc804\ud658 \ub420 \ub54c \uc0ac\uc6a9\ud558\ub294 ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/transition-duration",children:"transition-duration"})})," \uac12\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/components/FallbackLazyImage/index.tsx",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"interface IntersectionObserverInit {\n root?: Element | Document | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface LazyImageProps\n extends React.ComponentProps<'img'>,\n IntersectionObserverInit {\n src: string;\n}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescrpt"',children:"interface FallbackLazyImageProps extends LazyImageProps {\n fallback: JSX.Element;\n width: string | number;\n height: string | number;\n duration?: CSSProperties['transitionDuration']; // default: 0.2s\n}\n\nconst FallbackLazyImage: React.ForwardRefExoticComponent<\n Omit & React.RefAttributes\n>;\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.h3,{id:"default",children:"Default"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { FallbackLazyImage } from '@modern-kit/react';\nimport img1 from '../assets/img1.png';\n\nconst Example = () => {\n const skeletonStyle = useMemo(\n () => ({\n width: '400px', // \uc2e4\uc81c img \ud06c\uae30\uc640 \ub3d9\uc77c\ud558\uac8c \ub9de\ucdb0\uc8fc\uc138\uc694.\n height: '400px', // \uc2e4\uc81c img \ud06c\uae30\uc640 \ub3d9\uc77c\ud558\uac8c \ub9de\ucdb0\uc8fc\uc138\uc694.\n backgroundColor: 'green',\n }),\n []\n );\n return (\n \n }\n width={400}\n height={400}\n src={img1}\n alt=\"img1\"\n />\n
\n );\n};\n"})}),"\n",(0,i.jsx)(t.h3,{id:"wrapper-styling-css",children:"Wrapper Styling: css"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["FallbackLazyImage \ucef4\ud3ec\ub10c\ud2b8 \ub0b4 ",(0,i.jsx)(t.code,{children:"Image Wrapper"}),"\ub294 \uae30\ubcf8\uc801\uc73c\ub85c ",(0,i.jsx)(t.code,{children:"lazy-image-wrapper"})," \ud074\ub798\uc2a4\ub97c \uac16\uc2b5\ub2c8\ub2e4. \ud574\ub2f9 \ud074\ub798\uc2a4\ub97c \ud65c\uc6a9\ud558\uc5ec \uc2a4\ud0c0\uc77c\uc744 \uc81c\uc5b4 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-css",children:"/* css stylesheet */\n.lazy-image-wrapper {\n border-radius: 12px;\n overflow: hidden;\n}\n\n.lazy-image-wrapper > img {\n /* image styling */\n}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",children:"\n"})}),"\n",(0,i.jsx)(t.h3,{id:"wrapper-styling-css-in-js",children:"Wrapper Styling: css-in-js"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"css-in-js"}),"\uc758 ",(0,i.jsx)(t.code,{children:"\uc0c1\uc18d"}),"\uae30\ub2a5\uc744 \ud65c\uc6a9\ud558\uc5ec \uc0c8\ub85c\uc6b4 \ucef4\ud3ec\ub10c\ud2b8\ub97c \uc791\uc131 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",children:"const Image = styled(FallbackLazyImage)`\n border-radius: 12px;\n overflow: hidden;\n\n & > img {\n /* image styling */\n }\n`;\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",children:"\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(u,{})]})}function f(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>fe,Cf:()=>Se,D9:()=>Ye,FS:()=>ct,GN:()=>Ce,Hk:()=>ye,KS:()=>ot,LN:()=>We,Mm:()=>xe,Nr:()=>oe,OR:()=>we,Pr:()=>Ge,S1:()=>se,VP:()=>ke,XI:()=>Te,Xs:()=>nt,Yz:()=>ze,_:()=>Ae,a9:()=>ue,ac:()=>qe,cM:()=>lt,df:()=>be,fB:()=>rt,g4:()=>je,iP:()=>dt,ii:()=>Be,jr:()=>Oe,my:()=>he,nA:()=>ve,oM:()=>d,oz:()=>Ve,qQ:()=>Ze,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ge,yU:()=>He,yn:()=>Ie,z$:()=>Ee});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function b(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>b()?(0,i.jsx)(i.Fragment,{children:t}):e;var p="object"==typeof global&&global&&global.Object===Object&&global,w="object"==typeof self&&self&&self.Object===Object&&self,m=p||w||Function("return this")(),h=m.Symbol,g=Object.prototype,v=g.hasOwnProperty,y=g.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",j="[object Undefined]",E=h?h.toStringTag:void 0;var C="[object Symbol]",I=/\s/,O=/^\s+/;function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var z=NaN,N=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,L=/^0o[0-7]+$/i,_=parseInt;function F(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?j:S:E&&E in Object(e)?function(e){var t=v.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return z;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&I.test(e.charAt(t)););return t}(e)+1).replace(O,""):e}(e);var n=R.test(e);return n||L.test(e)?_(e.slice(2),n?2:8):N.test(e)?z:+e}var M=function(){return m.Date.now()},P="Expected a function",A=Math.max,$=Math.min;function q(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError(P);function f(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function p(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function w(){var e=M();if(p(e))return m(e);s=setTimeout(w,function(e){var n=t-(e-c);return d?$(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&i?f(e):(i=r=void 0,a)}function h(){var e=M(),n=p(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(w,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(w,t),f(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=F(t)||0,T(n)&&(u=!!n.leading,o=(d="maxWait"in n)?A(F(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(M())},h}var X="Expected a function";function B(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const U={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},D=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function W(){return"undefined"==typeof window}function V(){return!W()}function Y(e){return B(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>B(void 0,0,void 0,(function*(){const t=yield fetch(e);return Y(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>q(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,p]=(0,r.useState)(!1),w=!f,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:w?0:1,transition:`opacity ${u}`},l)),[w,u,l]),g=(0,r.useCallback)((e=>{d&&d(e),p(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[w&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:g},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},be=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},pe=V()?r.useLayoutEffect:r.useEffect;function we(e,t,n,i={}){const r=re(i),o=ne(n);pe((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(W())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return we(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ge=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ve=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield Y(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return B(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>B(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield D(e,U[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function je({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),b=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),p=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:p}}function Ee(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=je({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ce(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Ie(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ce("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Oe(e,{preserveTitleOnUnmount:t=!1}={}){pe((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Te({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function ze(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Ne="modern-kit-local-storage",Re="modern-kit-session-storage",Le={localStorage:{key:Ne,subscribe:e=>{window.addEventListener(Ne,e)},unsubscribe:e=>{window.removeEventListener(Ne,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ne))}},sessionStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}}},_e=e=>Le[e],Fe=_e("localStorage"),Me=e=>window.localStorage.getItem(e),Pe=e=>(Fe.subscribe(e),()=>{Fe.unsubscribe(e)});function Ae(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Pe,(()=>Me(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Me(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Fe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Fe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const $e=(e,t)=>V()?window.matchMedia(e).matches:null!=t&&t;function qe(e,t){const[n,i]=(0,r.useState)($e(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return we(window.matchMedia(e),"change",o),n}const Xe={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function Be(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(Xe),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,b=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,b=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:b})}),[]);return we(window.document,"mousemove",i),{ref:e,position:t}}const Ue=()=>navigator.onLine,De=()=>!0;function We({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Ue,De)}}function Ve(){return qe("(prefers-color-scheme: dark)")?"dark":"light"}function Ye(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function He(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ge({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return pe((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Je=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ke=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Je(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Je(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Je(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Je(c.width,i.width,s)}};function Ze(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ke(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=_e("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},je(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(X);return T(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),q(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",p="architecture",w="console",m="mobile",h="tablet",g="smarttv",v="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",j="BlackBerry",E="Browser",C="Chrome",I="Firefox",O="Google",T="Huawei",z="LG",N="Microsoft",R="Motorola",L="Opera",_="Samsung",F="Sharp",M="Sony",P="Xiaomi",A="Zebra",$="Facebook",q="Chromium OS",X="Mac OS",B=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},Y=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[f]=i,V.call(e,g,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[f]=i,V.call(e,g,y.os),x&&!e[u]&&v&&v.platform&&"Unknown"!=v.platform&&(e[u]=v.platform.replace(/chrome os/i,q).replace(/macos/i,X)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===s&&e.length>500?W(e,500):e,this},this.setUA(g),this};J.VERSION="1.0.38",J.BROWSER=B([u,f,c]),J.CPU=B([p]),J.DEVICE=B([l,b,d,w,m,g,h,v,y]),J.ENGINE=J.OS=B([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,r.useState)(null);return pe((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){pe((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,r.useState)((()=>W()?ut:{width:window.innerWidth,height:window.innerHeight})),i=oe(n,e),o=(0,r.useCallback)((()=>{(e?i:n)({width:window.innerWidth,height:window.innerHeight})}),[e,i]);return we(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/24c74d07.270bb37d.js.LICENSE.txt b/assets/js/24c74d07.0164b733.js.LICENSE.txt
similarity index 100%
rename from assets/js/24c74d07.270bb37d.js.LICENSE.txt
rename to assets/js/24c74d07.0164b733.js.LICENSE.txt
diff --git a/assets/js/24c74d07.270bb37d.js b/assets/js/24c74d07.270bb37d.js
deleted file mode 100644
index 3f4563d52..000000000
--- a/assets/js/24c74d07.270bb37d.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 24c74d07.270bb37d.js.LICENSE.txt */
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[39],{172:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>u,assets:()=>l,contentTitle:()=>s,default:()=>f,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var i=n(1986),r=n(9937),o=n(384);const a={},s="FallbackLazyImage",c={id:"react/components/FallbackLazyImage",title:"FallbackLazyImage",description:"LazyImage \ucef4\ud3ec\ub10c\ud2b8 \ub97c \ud655\uc7a5\ud574 \uc774\ubbf8\uc9c0 load \uc5ec\ubd80\uc5d0 \ub530\ub978 Fallback \ucef4\ud3ec\ub10c\ud2b8\ub97c \ub80c\ub354\ub9c1 \ud558\ub294 \ucef4\ud3ec\ub10c\ud2b8 \uc785\ub2c8\ub2e4.",source:"@site/docs/react/components/FallbackLazyImage.mdx",sourceDirName:"react/components",slug:"/react/components/FallbackLazyImage",permalink:"/modern-kit/docs/react/components/FallbackLazyImage",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"DebounceWrapper",permalink:"/modern-kit/docs/react/components/DebounceWrapper"},next:{title:"IfElse",permalink:"/modern-kit/docs/react/components/IfElse"}},l={},u=()=>{const e={div:"div",...(0,r.a)()},t={width:"500px",height:"500px",backgroundColor:"green"};return(0,i.jsxs)(e.div,{style:{background:"#f8f8f8",width:"500px"},children:[(0,i.jsx)(e.div,{style:{height:"500px",textAlign:"center",fontSize:"2rem"},children:"\uc2a4\ud06c\ub864 \ud574\uc8fc\uc138\uc694."}),(0,i.jsx)(o.a9,{fallback:(0,i.jsx)(e.div,{style:t}),src:"https://github.com/Team-Grace/devgrace/assets/64779472/b5640bec-2abc-4205-afbf-ccfd9876a90b",alt:"img1",width:500,height:500}),(0,i.jsx)(e.div,{style:{width:"100%",height:"150px"}}),(0,i.jsx)(o.a9,{fallback:(0,i.jsx)(e.div,{style:t}),src:"https://github.com/Team-Grace/devgrace/assets/64779472/207743a7-b29f-4826-bc08-8df0d67e568b",alt:"img2",width:500,height:500}),(0,i.jsx)(e.div,{style:{width:"100%",height:"150px"}}),(0,i.jsx)(o.a9,{fallback:(0,i.jsx)(e.div,{style:t}),src:"https://github.com/Team-Grace/devgrace/assets/64779472/d1957ec8-fe87-406e-bfda-fb4ee505b152",alt:"img3",width:500,height:500})]})},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Default",id:"default",level:3},{value:"Wrapper Styling: css",id:"wrapper-styling-css",level:3},{value:"Wrapper Styling: css-in-js",id:"wrapper-styling-css-in-js",level:3},{value:"Example",id:"example",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"fallbacklazyimage",children:"FallbackLazyImage"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.a,{href:"https://modern-agile-team.github.io/modern-kit/docs/react/components/LazyImage",children:"LazyImage \ucef4\ud3ec\ub10c\ud2b8"})})," \ub97c \ud655\uc7a5\ud574 \uc774\ubbf8\uc9c0 ",(0,i.jsx)(t.code,{children:"load \uc5ec\ubd80"}),"\uc5d0 \ub530\ub978 ",(0,i.jsx)(t.code,{children:"Fallback \ucef4\ud3ec\ub10c\ud2b8"}),"\ub97c \ub80c\ub354\ub9c1 \ud558\ub294 \ucef4\ud3ec\ub10c\ud2b8 \uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"src"}),"\uc640 \ub354\ubd88\uc5b4 ",(0,i.jsx)(t.code,{children:"width"}),", ",(0,i.jsx)(t.code,{children:"height"}),", ",(0,i.jsx)(t.code,{children:"fallback"})," props\ub97c \ud544\uc218\ub85c \ub118\uaca8\uc918\uc57c \ud558\uba70, fallback\uc758 \ud06c\uae30\ub294 \ud574\ub2f9 width, height\uc640 \ub3d9\uc77c\ud558\uac8c \ub9de\ucd94\ub294 \uac83\uc744 \uad8c\uc7a5\ud569\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"duration"})," props\ub294 \uc2e4\uc81c \uc774\ubbf8\uc9c0\uac00 load \ub41c \ud6c4, fallback \ucef4\ud3ec\ub10c\ud2b8\uc5d0\uc11c \uc2e4\uc81c \uc774\ubbf8\uc9c0\ub85c \uc804\ud658 \ub420 \ub54c \uc0ac\uc6a9\ud558\ub294 ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/CSS/transition-duration",children:"transition-duration"})})," \uac12\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/components/FallbackLazyImage/index.tsx",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"interface IntersectionObserverInit {\n root?: Element | Document | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface LazyImageProps\n extends React.ComponentProps<'img'>,\n IntersectionObserverInit {\n src: string;\n}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescrpt"',children:"interface FallbackLazyImageProps extends LazyImageProps {\n fallback: JSX.Element;\n width: string | number;\n height: string | number;\n duration?: CSSProperties['transitionDuration']; // default: 0.2s\n}\n\nconst FallbackLazyImage: React.ForwardRefExoticComponent<\n Omit & React.RefAttributes\n>;\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.h3,{id:"default",children:"Default"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { FallbackLazyImage } from '@modern-kit/react';\nimport img1 from '../assets/img1.png';\n\nconst Example = () => {\n const skeletonStyle = useMemo(\n () => ({\n width: '400px', // \uc2e4\uc81c img \ud06c\uae30\uc640 \ub3d9\uc77c\ud558\uac8c \ub9de\ucdb0\uc8fc\uc138\uc694.\n height: '400px', // \uc2e4\uc81c img \ud06c\uae30\uc640 \ub3d9\uc77c\ud558\uac8c \ub9de\ucdb0\uc8fc\uc138\uc694.\n backgroundColor: 'green',\n }),\n []\n );\n return (\n \n }\n width={400}\n height={400}\n src={img1}\n alt=\"img1\"\n />\n
\n );\n};\n"})}),"\n",(0,i.jsx)(t.h3,{id:"wrapper-styling-css",children:"Wrapper Styling: css"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["FallbackLazyImage \ucef4\ud3ec\ub10c\ud2b8 \ub0b4 ",(0,i.jsx)(t.code,{children:"Image Wrapper"}),"\ub294 \uae30\ubcf8\uc801\uc73c\ub85c ",(0,i.jsx)(t.code,{children:"lazy-image-wrapper"})," \ud074\ub798\uc2a4\ub97c \uac16\uc2b5\ub2c8\ub2e4. \ud574\ub2f9 \ud074\ub798\uc2a4\ub97c \ud65c\uc6a9\ud558\uc5ec \uc2a4\ud0c0\uc77c\uc744 \uc81c\uc5b4 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-css",children:"/* css stylesheet */\n.lazy-image-wrapper {\n border-radius: 12px;\n overflow: hidden;\n}\n\n.lazy-image-wrapper > img {\n /* image styling */\n}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",children:"\n"})}),"\n",(0,i.jsx)(t.h3,{id:"wrapper-styling-css-in-js",children:"Wrapper Styling: css-in-js"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:[(0,i.jsx)(t.code,{children:"css-in-js"}),"\uc758 ",(0,i.jsx)(t.code,{children:"\uc0c1\uc18d"}),"\uae30\ub2a5\uc744 \ud65c\uc6a9\ud558\uc5ec \uc0c8\ub85c\uc6b4 \ucef4\ud3ec\ub10c\ud2b8\ub97c \uc791\uc131 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n"]}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",children:"const Image = styled(FallbackLazyImage)`\n border-radius: 12px;\n overflow: hidden;\n\n & > img {\n /* image styling */\n }\n`;\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",children:"\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(u,{})]})}function f(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>et,Bg:()=>fe,Cf:()=>xe,D9:()=>De,FS:()=>ot,GN:()=>je,Hk:()=>ge,KS:()=>nt,LN:()=>Ue,Mm:()=>ve,Nr:()=>oe,Pr:()=>Ye,S1:()=>se,VP:()=>ye,XI:()=>Ie,Xs:()=>Qe,Yz:()=>Oe,_:()=>Me,a9:()=>ue,ac:()=>Ae,cM:()=>at,df:()=>be,fB:()=>tt,g4:()=>ke,iP:()=>st,ii:()=>$e,jr:()=>Ce,my:()=>pe,nA:()=>he,oM:()=>d,oz:()=>Be,qQ:()=>He,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>me,yU:()=>Ve,yn:()=>Ee,z$:()=>Se});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function b(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>b()?(0,i.jsx)(i.Fragment,{children:t}):e;var p="object"==typeof global&&global&&global.Object===Object&&global,w="object"==typeof self&&self&&self.Object===Object&&self,m=p||w||Function("return this")(),h=m.Symbol,g=Object.prototype,v=g.hasOwnProperty,y=g.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",j="[object Undefined]",E=h?h.toStringTag:void 0;var C="[object Symbol]",I=/\s/,O=/^\s+/;function z(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var T=NaN,N=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,R=/^0o[0-7]+$/i,_=parseInt;function F(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?j:S:E&&E in Object(e)?function(e){var t=v.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return T;if(z(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=z(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&I.test(e.charAt(t)););return t}(e)+1).replace(O,""):e}(e);var n=L.test(e);return n||R.test(e)?_(e.slice(2),n?2:8):N.test(e)?T:+e}var M=function(){return m.Date.now()},P="Expected a function",A=Math.max,$=Math.min;function q(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError(P);function f(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function p(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function w(){var e=M();if(p(e))return m(e);s=setTimeout(w,function(e){var n=t-(e-c);return d?$(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&i?f(e):(i=r=void 0,a)}function h(){var e=M(),n=p(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(w,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(w,t),f(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=F(t)||0,z(n)&&(u=!!n.leading,o=(d="maxWait"in n)?A(F(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(M())},h}var X="Expected a function";function U(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const B={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},D=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function Y(){return!V()}function W(e){return U(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const G=e=>U(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const H=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return H(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return H(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>q(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,p]=(0,r.useState)(!1),w=!f,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:w?0:1,transition:`opacity ${u}`},l)),[w,u,l]),g=(0,r.useCallback)((e=>{d&&d(e),p(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[w&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:g},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},be=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})};const pe=(0,r.forwardRef)(((e,t)=>{var{as:n,children:a,callback:s}=e,c=o(e,["as","children","callback"]);const{ref:l}=function(e){const t=(0,r.useRef)(null),n=ne(e);return(0,r.useEffect)((()=>{const e=function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown",i=({target:e})=>{const i=t.current;i&&!i.contains(e)&&n(i)};return document.addEventListener(e,i),()=>{document.removeEventListener(e,i)}}),[n]),{ref:t}}(s);return(0,i.jsx)(n||"div",Object.assign({ref:ce(l,t)},c,{children:a}))})),we=Y()?r.useLayoutEffect:r.useEffect;(0,r.createContext)({parentPortalElement:null});const me=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},he=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ge=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function ve(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ye(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return U(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return G(e);if(!("write"in window.navigator.clipboard))return G(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return G(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>U(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield D(e,B[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return U(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return U(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function xe(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function ke({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),b=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),p=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:p}}function Se(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=ke({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function je(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Ee(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=je("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Ce(e,{preserveTitleOnUnmount:t=!1}={}){we((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Ie({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Oe(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const ze="modern-kit-local-storage",Te="modern-kit-session-storage",Ne={localStorage:{key:ze,subscribe:e=>{window.addEventListener(ze,e)},unsubscribe:e=>{window.removeEventListener(ze,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(ze))}},sessionStorage:{key:Te,subscribe:e=>{window.addEventListener(Te,e)},unsubscribe:e=>{window.removeEventListener(Te,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Te))}}},Le=e=>Ne[e],Re=Le("localStorage"),_e=e=>window.localStorage.getItem(e),Fe=e=>(Re.subscribe(e),()=>{Re.unsubscribe(e)});function Me(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Fe,(()=>_e(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=_e(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Re.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Re.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Pe=(e,t)=>Y()?window.matchMedia(e).matches:null!=t&&t;function Ae(e,t){const[n,i]=(0,r.useState)(Pe(e,t));return(0,r.useEffect)((()=>{const t=window.matchMedia(e),n=e=>i(e.matches);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),[e]),n}function $e(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)({screenX:void 0,screenY:void 0,clientX:void 0,clientY:void 0,pageX:void 0,pageY:void 0,elementRelativeX:void 0,elementRelativeY:void 0,elementPositionX:void 0,elementPositionY:void 0});return we((()=>{const t=t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t,l={},u={};if(e.current){const t=e.current.getBoundingClientRect(),n=o-t.left,i=a-t.top,r=t.left+window.scrollX,s=t.top+window.scrollY;l.elementRelativeX=n,l.elementRelativeY=i,u.elementPositionX=r,u.elementPositionY=s}n(Object.assign(Object.assign({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c},l),u))};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}}),[]),{ref:e,position:t}}const qe=()=>navigator.onLine,Xe=()=>!0;function Ue({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,qe,Xe)}}function Be(){return Ae("(prefers-color-scheme: dark)")?"dark":"light"}function De(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function Ve(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ye({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return we((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const We=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ge=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+We(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+We(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+We(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+We(c.width,i.width,s)}};function He(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ge(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Je=Le("sessionStorage"),Ke=e=>window.sessionStorage.getItem(e),Ze=e=>(Je.subscribe(e),()=>{Je.unsubscribe(e)});function Qe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ze,(()=>Ke(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Ke(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Je.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Je.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function et(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},ke(e))}function tt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(X);return z(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),q(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function nt(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var it={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",p="architecture",w="console",m="mobile",h="tablet",g="smarttv",v="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",j="BlackBerry",E="Browser",C="Chrome",I="Firefox",O="Google",z="Huawei",T="LG",N="Microsoft",L="Motorola",R="Opera",_="Samsung",F="Sharp",M="Sony",P="Xiaomi",A="Zebra",$="Facebook",q="Chromium OS",X="Mac OS",U=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[f]=i,Y.call(e,g,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[f]=i,Y.call(e,g,y.os),x&&!e[u]&&v&&v.platform&&"Unknown"!=v.platform&&(e[u]=v.platform.replace(/chrome os/i,q).replace(/macos/i,X)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(g),this};J.VERSION="1.0.38",J.BROWSER=U([u,f,c]),J.CPU=U([p]),J.DEVICE=U([l,b,d,w,m,g,h,v,y]),J.ENGINE=J.OS=U([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(it,it.exports);var rt=it.exports;function ot(){const[e,t]=(0,r.useState)(null);return we((()=>{const e=new rt.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function at({name:e="vh",enabledResize:t=!1}={}){we((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}function st(e={}){const{isDebounce:t=!1,wait:n=300}=e,[i,o]=(0,r.useState)({width:null,height:null}),a=(0,r.useCallback)((()=>{o({width:window.innerWidth,height:window.innerHeight})}),[]),s=ne(oe(a,n)),c=(0,r.useMemo)((()=>t?s:a),[a,t,s]);return we((()=>(a(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[a,c]),i}}}]);
\ No newline at end of file
diff --git a/assets/js/295f1714.2d5aeeae.js b/assets/js/295f1714.2d5aeeae.js
deleted file mode 100644
index 689b91b88..000000000
--- a/assets/js/295f1714.2d5aeeae.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 295f1714.2d5aeeae.js.LICENSE.txt */
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[4549],{7543:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>d,assets:()=>u,contentTitle:()=>c,default:()=>w,frontMatter:()=>s,metadata:()=>l,toc:()=>f});var i=n(1986),r=n(9937),o=n(384),a=n(7800);const s={},c="useHover",l={id:"react/hooks/useHover",title:"useHover",description:"\ub300\uc0c1 \ucef4\ud3ec\ub10c\ud2b8\ub97c \uae30\uc900\uc73c\ub85c \ub9c8\uc6b0\uc2a4\uac00 \uc62c\ub77c\uac00\uac70\ub098 \ub0b4\ub824\uac14\uc744 \ub54c\uc758 \uc0c1\ud0dc\ub97c \ubc18\ud658\ud558\uace0, \ub9c8\uc6b0\uc2a4\uac00 \uc62c\ub77c\uac00\uac70\ub098 \ub0b4\ub824\uac14\uc744 \ub54c\uc758 \uc561\uc158\uc744 \uc815\uc758\ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useHover.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useHover",permalink:"/modern-kit/docs/react/hooks/useHover",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useForceUpdate",permalink:"/modern-kit/docs/react/hooks/useForceUpdate"},next:{title:"useImageStatus",permalink:"/modern-kit/docs/react/hooks/useImageStatus"}},u={},d=()=>{const e={div:"div",...(0,r.a)()},[t,n]=(0,a.useState)(0),{ref:s,isHovered:c}=(0,o.XI)({onEnter:()=>n((e=>e+1)),onLeave:()=>n((e=>e-1))});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.div,{ref:s,style:{width:"200px",height:"200px",backgroundColor:"skyBlue"},children:c?"hover":"leave"}),(0,i.jsx)(e.div,{children:t})]})},f=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"usehover",children:"useHover"})}),"\n",(0,i.jsx)(t.p,{children:"\ub300\uc0c1 \ucef4\ud3ec\ub10c\ud2b8\ub97c \uae30\uc900\uc73c\ub85c \ub9c8\uc6b0\uc2a4\uac00 \uc62c\ub77c\uac00\uac70\ub098 \ub0b4\ub824\uac14\uc744 \ub54c\uc758 \uc0c1\ud0dc\ub97c \ubc18\ud658\ud558\uace0, \ub9c8\uc6b0\uc2a4\uac00 \uc62c\ub77c\uac00\uac70\ub098 \ub0b4\ub824\uac14\uc744 \ub54c\uc758 \uc561\uc158\uc744 \uc815\uc758\ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useHover/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"const useHover: ({\n onEnter?: (event: MouseEvent) => void,\n onLeave?: (event: MouseEvent) => void,\n}) => {\n ref: T,\n isHovered: boolean\n}\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useHover } from '@modern-kit/react';\n\nconst Example = () => {\n const [counter, setCounter] = useState(0);\n\n const { ref, isHovered } = useHover({\n onEnter: () => setCounter((count) => count + 1),\n onLeave: () => setCounter((count) => count - 1)\n });\n\n const style = {\n width: '200px',\n height: '200px',\n backgroundColor: 'skyBlue'\n };\n\n return (\n <>\n {isHovered ? 'hover' : 'leave'}
\n {counter}
\n >\n );\n};\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(d,{})]})}function w(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>et,Bg:()=>be,Cf:()=>xe,D9:()=>Ue,FS:()=>ot,GN:()=>Ee,Hk:()=>ve,KS:()=>nt,LN:()=>Xe,Mm:()=>ge,Nr:()=>oe,Pr:()=>Ye,S1:()=>se,VP:()=>ye,XI:()=>Oe,Xs:()=>Qe,Yz:()=>Te,_:()=>ze,a9:()=>ue,ac:()=>Ae,cM:()=>at,df:()=>fe,fB:()=>tt,g4:()=>ke,iP:()=>st,ii:()=>Fe,jr:()=>je,my:()=>we,nA:()=>he,oM:()=>d,oz:()=>Be,qQ:()=>Ge,qx:()=>b,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>me,yU:()=>Ve,yn:()=>Ce,z$:()=>Se});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function f(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const b=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>f()?(0,i.jsx)(i.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",C=h?h.toStringTag:void 0;var j="[object Symbol]",O=/\s/,T=/^\s+/;function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var _=NaN,I=/^[-+]0x[0-9a-f]+$/i,M=/^0b[01]+$/i,R=/^0o[0-7]+$/i,L=parseInt;function P(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:C&&C in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==j}(e))return _;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(T,""):e}(e);var n=M.test(e);return n||R.test(e)?L(e.slice(2),n?2:8):I.test(e)?_:+e}var z=function(){return m.Date.now()},$="Expected a function",A=Math.max,F=Math.min;function q(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError($);function b(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=z();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,f&&i?b(e):(i=r=void 0,a)}function h(){var e=z(),n=w(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?b(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),b(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=P(t)||0,N(n)&&(u=!!n.leading,o=(d="maxWait"in n)?A(P(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(z())},h}var H="Expected a function";function X(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const B={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},U=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function Y(){return!V()}function D(e){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const W=e=>X(void 0,0,void 0,(function*(){const t=yield fetch(e);return D(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>q(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),f=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:f,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,f=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[b,w]=(0,r.useState)(!1),p=!b,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},f))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},fe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:f}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,f)},d,{children:e.children}))}));fe.displayName="InView";const be=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})};const we=(0,r.forwardRef)(((e,t)=>{var{as:n,children:a,callback:s}=e,c=o(e,["as","children","callback"]);const{ref:l}=function(e){const t=(0,r.useRef)(null),n=ne(e);return(0,r.useEffect)((()=>{const e=function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown",i=({target:e})=>{const i=t.current;i&&!i.contains(e)&&n(i)};return document.addEventListener(e,i),()=>{document.removeEventListener(e,i)}}),[n]),{ref:t}}(s);return(0,i.jsx)(n||"div",Object.assign({ref:ce(l,t)},c,{children:a}))})),pe=Y()?r.useLayoutEffect:r.useEffect;(0,r.createContext)({parentPortalElement:null});const me=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(be,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},he=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ve=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function ge(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ye(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield D(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return W(e);if(!("write"in window.navigator.clipboard))return W(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return W(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>X(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield U(e,B[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function xe(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function ke({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),f=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),b=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:f,goToPrevStep:b,resetStep:w}}function Se(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=ke({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ee(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Ce(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ee("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function je(e,{preserveTitleOnUnmount:t=!1}={}){pe((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Oe({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Te(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Ne="modern-kit-local-storage",_e="modern-kit-session-storage",Ie={localStorage:{key:Ne,subscribe:e=>{window.addEventListener(Ne,e)},unsubscribe:e=>{window.removeEventListener(Ne,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ne))}},sessionStorage:{key:_e,subscribe:e=>{window.addEventListener(_e,e)},unsubscribe:e=>{window.removeEventListener(_e,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(_e))}}},Me=e=>Ie[e],Re=Me("localStorage"),Le=e=>window.localStorage.getItem(e),Pe=e=>(Re.subscribe(e),()=>{Re.unsubscribe(e)});function ze(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Pe,(()=>Le(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Le(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Re.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Re.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const $e=(e,t)=>Y()?window.matchMedia(e).matches:null!=t&&t;function Ae(e,t){const[n,i]=(0,r.useState)($e(e,t));return(0,r.useEffect)((()=>{const t=window.matchMedia(e),n=e=>i(e.matches);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),[e]),n}function Fe(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)({screenX:void 0,screenY:void 0,clientX:void 0,clientY:void 0,pageX:void 0,pageY:void 0,elementRelativeX:void 0,elementRelativeY:void 0,elementPositionX:void 0,elementPositionY:void 0});return pe((()=>{const t=t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t,l={},u={};if(e.current){const t=e.current.getBoundingClientRect(),n=o-t.left,i=a-t.top,r=t.left+window.scrollX,s=t.top+window.scrollY;l.elementRelativeX=n,l.elementRelativeY=i,u.elementPositionX=r,u.elementPositionY=s}n(Object.assign(Object.assign({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c},l),u))};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}}),[]),{ref:e,position:t}}const qe=()=>navigator.onLine,He=()=>!0;function Xe({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,qe,He)}}function Be(){return Ae("(prefers-color-scheme: dark)")?"dark":"light"}function Ue(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function Ve(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ye({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return pe((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const De=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,We=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+De(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+De(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+De(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+De(c.width,i.width,s)}};function Ge(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=We(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Je=Me("sessionStorage"),Ke=e=>window.sessionStorage.getItem(e),Ze=e=>(Je.subscribe(e),()=>{Je.unsubscribe(e)});function Qe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ze,(()=>Ke(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Ke(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Je.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Je.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function et(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},ke(e))}function tt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(H);return N(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),q(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function nt(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var it={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",f="vendor",b="version",w="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",C="Browser",j="Chrome",O="Firefox",T="Google",N="Huawei",_="LG",I="Microsoft",M="Motorola",R="Opera",L="Samsung",P="Sharp",z="Sony",$="Xiaomi",A="Zebra",F="Facebook",q="Chromium OS",H="Mac OS",X=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},D=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[b]=i,Y.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[b]=i,Y.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,q).replace(/macos/i,H)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=X([u,b,c]),J.CPU=X([w]),J.DEVICE=X([l,f,d,p,m,v,h,g,y]),J.ENGINE=J.OS=X([u,b]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(it,it.exports);var rt=it.exports;function ot(){const[e,t]=(0,r.useState)(null);return pe((()=>{const e=new rt.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function at({name:e="vh",enabledResize:t=!1}={}){pe((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}function st(e={}){const{isDebounce:t=!1,wait:n=300}=e,[i,o]=(0,r.useState)({width:null,height:null}),a=(0,r.useCallback)((()=>{o({width:window.innerWidth,height:window.innerHeight})}),[]),s=ne(oe(a,n)),c=(0,r.useMemo)((()=>t?s:a),[a,t,s]);return pe((()=>(a(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[a,c]),i}}}]);
\ No newline at end of file
diff --git a/assets/js/295f1714.7029a697.js b/assets/js/295f1714.7029a697.js
new file mode 100644
index 000000000..4a7abc1e6
--- /dev/null
+++ b/assets/js/295f1714.7029a697.js
@@ -0,0 +1,2 @@
+/*! For license information please see 295f1714.7029a697.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[4549],{7543:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>d,assets:()=>u,contentTitle:()=>c,default:()=>w,frontMatter:()=>s,metadata:()=>l,toc:()=>f});var i=n(1986),r=n(9937),o=n(384),a=n(7800);const s={},c="useHover",l={id:"react/hooks/useHover",title:"useHover",description:"\ub300\uc0c1 \ucef4\ud3ec\ub10c\ud2b8\ub97c \uae30\uc900\uc73c\ub85c \ub9c8\uc6b0\uc2a4\uac00 \uc62c\ub77c\uac00\uac70\ub098 \ub0b4\ub824\uac14\uc744 \ub54c\uc758 \uc0c1\ud0dc\ub97c \ubc18\ud658\ud558\uace0, \ub9c8\uc6b0\uc2a4\uac00 \uc62c\ub77c\uac00\uac70\ub098 \ub0b4\ub824\uac14\uc744 \ub54c\uc758 \uc561\uc158\uc744 \uc815\uc758\ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useHover.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useHover",permalink:"/modern-kit/docs/react/hooks/useHover",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useForceUpdate",permalink:"/modern-kit/docs/react/hooks/useForceUpdate"},next:{title:"useImageStatus",permalink:"/modern-kit/docs/react/hooks/useImageStatus"}},u={},d=()=>{const e={div:"div",...(0,r.a)()},[t,n]=(0,a.useState)(0),{ref:s,isHovered:c}=(0,o.XI)({onEnter:()=>n((e=>e+1)),onLeave:()=>n((e=>e-1))});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.div,{ref:s,style:{width:"200px",height:"200px",backgroundColor:"skyBlue"},children:c?"hover":"leave"}),(0,i.jsx)(e.div,{children:t})]})},f=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"usehover",children:"useHover"})}),"\n",(0,i.jsx)(t.p,{children:"\ub300\uc0c1 \ucef4\ud3ec\ub10c\ud2b8\ub97c \uae30\uc900\uc73c\ub85c \ub9c8\uc6b0\uc2a4\uac00 \uc62c\ub77c\uac00\uac70\ub098 \ub0b4\ub824\uac14\uc744 \ub54c\uc758 \uc0c1\ud0dc\ub97c \ubc18\ud658\ud558\uace0, \ub9c8\uc6b0\uc2a4\uac00 \uc62c\ub77c\uac00\uac70\ub098 \ub0b4\ub824\uac14\uc744 \ub54c\uc758 \uc561\uc158\uc744 \uc815\uc758\ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useHover/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"const useHover: ({\n onEnter?: (event: MouseEvent) => void,\n onLeave?: (event: MouseEvent) => void,\n}) => {\n ref: T,\n isHovered: boolean\n}\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useHover } from '@modern-kit/react';\n\nconst Example = () => {\n const [counter, setCounter] = useState(0);\n\n const { ref, isHovered } = useHover({\n onEnter: () => setCounter((count) => count + 1),\n onLeave: () => setCounter((count) => count - 1)\n });\n\n const style = {\n width: '200px',\n height: '200px',\n backgroundColor: 'skyBlue'\n };\n\n return (\n <>\n {isHovered ? 'hover' : 'leave'}
\n {counter}
\n >\n );\n};\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(d,{})]})}function w(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>be,Cf:()=>Se,D9:()=>De,FS:()=>ct,GN:()=>je,Hk:()=>ye,KS:()=>ot,LN:()=>Ve,Mm:()=>xe,Nr:()=>oe,OR:()=>pe,Pr:()=>Ge,S1:()=>se,VP:()=>ke,XI:()=>Ne,Xs:()=>nt,Yz:()=>_e,_:()=>Ae,a9:()=>ue,ac:()=>He,cM:()=>lt,df:()=>fe,fB:()=>rt,g4:()=>Ee,iP:()=>dt,ii:()=>Be,jr:()=>Te,my:()=>he,nA:()=>ge,oM:()=>d,oz:()=>Ye,qQ:()=>Ze,qx:()=>b,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ve,yU:()=>We,yn:()=>Oe,z$:()=>Ce});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function f(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const b=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>f()?(0,i.jsx)(i.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",C=h?h.toStringTag:void 0;var j="[object Symbol]",O=/\s/,T=/^\s+/;function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var _=NaN,I=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,M=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:C&&C in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==j}(e))return _;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(T,""):e}(e);var n=R.test(e);return n||M.test(e)?P(e.slice(2),n?2:8):I.test(e)?_:+e}var L=function(){return m.Date.now()},$="Expected a function",A=Math.max,F=Math.min;function H(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError($);function b(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=L();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,f&&i?b(e):(i=r=void 0,a)}function h(){var e=L(),n=w(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?b(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),b(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,N(n)&&(u=!!n.leading,o=(d="maxWait"in n)?A(z(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(L())},h}var q="Expected a function";function B(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const X={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},U=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function Y(){return!V()}function D(e){return B(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const W=e=>B(void 0,0,void 0,(function*(){const t=yield fetch(e);return D(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>H(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),f=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:f,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,f=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[b,w]=(0,r.useState)(!1),p=!b,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},f))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},fe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:f}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,f)},d,{children:e.children}))}));fe.displayName="InView";const be=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},we=Y()?r.useLayoutEffect:r.useEffect;function pe(e,t,n,i={}){const r=re(i),o=ne(n);we((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return pe(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ve=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(be,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ge=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield D(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return B(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return W(e);if(!("write"in window.navigator.clipboard))return W(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return W(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>B(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield U(e,X[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function Ee({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),f=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),b=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:f,goToPrevStep:b,resetStep:w}}function Ce(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=Ee({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function je(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Oe(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=je("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Te(e,{preserveTitleOnUnmount:t=!1}={}){we((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Ne({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function _e(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Ie="modern-kit-local-storage",Re="modern-kit-session-storage",Me={localStorage:{key:Ie,subscribe:e=>{window.addEventListener(Ie,e)},unsubscribe:e=>{window.removeEventListener(Ie,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ie))}},sessionStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}}},Pe=e=>Me[e],ze=Pe("localStorage"),Le=e=>window.localStorage.getItem(e),$e=e=>(ze.subscribe(e),()=>{ze.unsubscribe(e)});function Ae(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)($e,(()=>Le(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Le(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),ze.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),ze.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Fe=(e,t)=>Y()?window.matchMedia(e).matches:null!=t&&t;function He(e,t){const[n,i]=(0,r.useState)(Fe(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return pe(window.matchMedia(e),"change",o),n}const qe={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function Be(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(qe),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,f=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,f=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:f})}),[]);return pe(window.document,"mousemove",i),{ref:e,position:t}}const Xe=()=>navigator.onLine,Ue=()=>!0;function Ve({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Xe,Ue)}}function Ye(){return He("(prefers-color-scheme: dark)")?"dark":"light"}function De(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function We(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ge({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return we((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Je=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ke=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Je(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Je(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Je(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Je(c.width,i.width,s)}};function Ze(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ke(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=Pe("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},Ee(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(q);return N(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),H(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",f="vendor",b="version",w="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",C="Browser",j="Chrome",O="Firefox",T="Google",N="Huawei",_="LG",I="Microsoft",R="Motorola",M="Opera",P="Samsung",z="Sharp",L="Sony",$="Xiaomi",A="Zebra",F="Facebook",H="Chromium OS",q="Mac OS",B=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},D=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[b]=i,Y.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[b]=i,Y.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,H).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=B([u,b,c]),J.CPU=B([w]),J.DEVICE=B([l,f,d,p,m,v,h,g,y]),J.ENGINE=J.OS=B([u,b]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,r.useState)(null);return we((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){we((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,r.useState)((()=>V()?ut:{width:window.innerWidth,height:window.innerHeight})),i=oe(n,e),o=(0,r.useCallback)((()=>{(e?i:n)({width:window.innerWidth,height:window.innerHeight})}),[e,i]);return pe(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/295f1714.2d5aeeae.js.LICENSE.txt b/assets/js/295f1714.7029a697.js.LICENSE.txt
similarity index 100%
rename from assets/js/295f1714.2d5aeeae.js.LICENSE.txt
rename to assets/js/295f1714.7029a697.js.LICENSE.txt
diff --git a/assets/js/308b5f81.65c494c1.js b/assets/js/308b5f81.65c494c1.js
new file mode 100644
index 000000000..e20186f69
--- /dev/null
+++ b/assets/js/308b5f81.65c494c1.js
@@ -0,0 +1,2 @@
+/*! For license information please see 308b5f81.65c494c1.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[4580],{1956:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>u,assets:()=>l,contentTitle:()=>s,default:()=>f,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var r=n(1986),i=n(9937),o=n(384);const a={},s="useIntersectionObserver",c={id:"react/hooks/useIntersectionObserver",title:"useIntersectionObserver",description:"ref\ub97c \ud560\ub2f9\ud55c \ud0c0\uac9f \uc5d8\ub9ac\uba3c\ud2b8\uac00 Viewport\uc5d0 \ub178\ucd9c\ub420 \ub54c(onIntersectStart) \ud639\uc740 \ub098\uac08 \ub54c(onIntersectEnd) \ud2b9\uc815 action \ud568\uc218\ub97c \ud638\ucd9c \ud560 \uc218 \uc788\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useIntersectionObserver.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useIntersectionObserver",permalink:"/modern-kit/docs/react/hooks/useIntersectionObserver",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useImageStatus",permalink:"/modern-kit/docs/react/hooks/useImageStatus"},next:{title:"useInterval",permalink:"/modern-kit/docs/react/hooks/useInterval"}},l={},u=()=>{const e={br:"br",div:"div",...(0,i.a)()},{ref:t}=(0,o.S1)({onIntersectStart:e=>{console.log("onIntersectStart: ",e)},onIntersectEnd:e=>{console.log("onIntersectEnd: ",e)}}),n={height:"800px",backgroundColor:"teal"};return(0,r.jsxs)(e.div,{children:[(0,r.jsx)(e.div,{style:n}),(0,r.jsxs)(e.div,{ref:t,style:{color:"white",fontSize:"24px",backgroundColor:"blue"},children:["\ud0c0\uac9f \uc694\uc18c",(0,r.jsx)(e.br,{}),"\uac1c\ubc1c\uc790 \ub3c4\uad6c \ucf58\uc194\uc744 \ud655\uc778\ud574\uc8fc\uc138\uc694."]}),(0,r.jsx)(e.div,{style:n})]})},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Exmaple",id:"exmaple",level:2},{value:"Note",id:"note",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"useintersectionobserver",children:"useIntersectionObserver"})}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"ref"}),"\ub97c \ud560\ub2f9\ud55c \ud0c0\uac9f \uc5d8\ub9ac\uba3c\ud2b8\uac00 ",(0,r.jsx)(t.code,{children:"Viewport"}),"\uc5d0 \ub178\ucd9c\ub420 \ub54c(",(0,r.jsx)(t.code,{children:"onIntersectStart"}),") \ud639\uc740 \ub098\uac08 \ub54c(",(0,r.jsx)(t.code,{children:"onIntersectEnd"}),") \ud2b9\uc815 action \ud568\uc218\ub97c \ud638\ucd9c \ud560 \uc218 \uc788\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"calledOnce"}),"\uc635\uc158\uc744 ",(0,r.jsx)(t.code,{children:"true"}),"\ub85c \uc124\uc815\ud558\uba74 ",(0,r.jsx)(t.code,{children:"onIntersectStart"}),"\uc640 ",(0,r.jsx)(t.code,{children:"onIntersectEnd"}),"\ub97c \uac01\uac01 \ud55c\ubc88\uc529 \ud638\ucd9c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"enabled"}),"\uc635\uc158\uc744 \ud1b5\ud574 ",(0,r.jsx)(t.code,{children:"onIntersect*"})," \ucf5c\ubc31 \ud568\uc218\ub4e4\uc758 \ud638\ucd9c\uc744 \uc81c\uc5b4 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. ",(0,r.jsx)(t.code,{children:"false"}),"\ub77c\uba74 \ud0c0\uac9f \uc5d8\ub9ac\uba3c\ud2b8\uac00 Viewport\uc5d0 \ub178\ucd9c\ud558\ub354\ub77c\ub3c4 \uc2e4\ud589\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."]}),"\n",(0,r.jsxs)(t.p,{children:["Intersection Observer Option\uc744 \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.(\ud558\ub2e8 ",(0,r.jsx)(t.code,{children:"Note"})," \ucc38\uace0)"]}),"\n",(0,r.jsx)("br",{}),"\n",(0,r.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useIntersectionObserver/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,r.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"interface IntersectionObserverInit {\n root?: Element | Document | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface UseIntersectionObserverProps extends IntersectionObserverInit {\n onIntersectStart?: (entry: IntersectionObserverEntry) => void;\n onIntersectEnd?: (entry: IntersectionObserverEntry) => void;\n calledOnce?: boolean;\n enabled?: boolean;\n}\n"})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"const useIntersectionObserver: ({\n onIntersectStart,\n onIntersectEnd,\n enabled, // default: true\n calledOnce, // default: false\n root, // default: null\n threshold, // default: 0\n rootMargin, // default: '0px 0px 0px 0px'\n}: UseIntersectionObserverProps) => { \n ref: React.RefCallback \n};\n"})}),"\n",(0,r.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:'import { useIntersectionObserver } from \'@modern-kit/react\';\n\nconst Example = () => {\n const { ref: targetRef } = useIntersectionObserver({\n onIntersectStart: (entry) => {\n console.log("onIntersectStart: ", entry);\n },\n onIntersectEnd: (entry) => {\n console.log("onIntersectEnd: ", entry);\n },\n });\n \n const boxStyle = {\n height: "800px", \n backgroundColor: "teal"\n }\n\n return (\n \n
\n
\n \ud0c0\uac9f \uc694\uc18c
\n \uac1c\ubc1c\uc790 \ub3c4\uad6c \ucf58\uc194\uc744 \ud655\uc778\ud574\uc8fc\uc138\uc694.\n
\n
\n
\n );\n};\n'})}),"\n",(0,r.jsx)(t.h2,{id:"exmaple",children:"Exmaple"}),"\n","\n",(0,r.jsx)(u,{}),"\n",(0,r.jsx)(t.h2,{id:"note",children:"Note"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"https://developer.mozilla.org/ko/docs/Web/API/IntersectionObserver",children:"Intersection Observer API"})}),"\n"]})]})}function f(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var r=n(7800);const i={},o=r.createContext(i);function a(e){const t=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>rt,B1:()=>me,Bg:()=>fe,Cf:()=>Se,D9:()=>We,FS:()=>ct,GN:()=>Ce,Hk:()=>ye,KS:()=>ot,LN:()=>Ye,Mm:()=>xe,Nr:()=>oe,OR:()=>pe,Pr:()=>Ge,S1:()=>se,VP:()=>ke,XI:()=>Te,Xs:()=>nt,Yz:()=>Ne,_:()=>Le,a9:()=>ue,ac:()=>qe,cM:()=>lt,df:()=>be,fB:()=>it,g4:()=>Ee,iP:()=>dt,ii:()=>Xe,jr:()=>Oe,my:()=>he,nA:()=>ge,oM:()=>d,oz:()=>De,qQ:()=>Ze,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ve,yU:()=>He,yn:()=>Ie,z$:()=>je});var r=n(1986),i=n(7800);n(4041);function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,i.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,i.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(i.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,r.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:i.Children.only(a)}))}));function b(){const[e,t]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,r.jsx)(r.Fragment,{}),children:t})=>b()?(0,r.jsx)(r.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",j=h?h.toStringTag:void 0;var C="[object Symbol]",I=/\s/,O=/^\s+/;function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=NaN,R=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,M=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:j&&j in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var r=!0}catch(e){}var i=y.call(e);return r&&(t?e[x]=n:delete e[x]),i}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return N;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&I.test(e.charAt(t)););return t}(e)+1).replace(O,""):e}(e);var n=_.test(e);return n||M.test(e)?P(e.slice(2),n?2:8):R.test(e)?N:+e}var A=function(){return m.Date.now()},$="Expected a function",L=Math.max,F=Math.min;function q(e,t,n){var r,i,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError($);function f(t){var n=r,o=i;return r=i=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=A();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&r?f(e):(r=i=void 0,a)}function h(){var e=A(),n=w(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),f(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,T(n)&&(u=!!n.leading,o=(d="maxWait"in n)?L(z(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},h.flush=function(){return void 0===s?a:m(A())},h}var U="Expected a function";function X(e,t,n,r){return new(n||(n=Promise))((function(t,i){function o(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(o,a)}s((r=r.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const B={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},V=(e,t)=>new Promise(((n,r)=>{e.toBlob((e=>{e?n(e):r(new Error(`Failed to create blob with format ${t}`))}),t)}));function Y(){return"undefined"==typeof window}function D(){return!Y()}function W(e){return X(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>X(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const G=(e,t,n)=>{const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const o of r)if(!i.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const r=[...e],i=[...t];return G(r,i,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!t.has(r)||!J(i,t.get(r),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,i.useRef)(e);return t.current=e,(0,i.useCallback)(((...e)=>t.current(...e)),[])}function re(e){const t=ne(e);(0,i.useEffect)((()=>()=>t()),[t])}function ie(e,t=K){const[n,r]=(0,i.useState)(e),o=ne(t);return(0,i.useEffect)((()=>{o(n,e)||r(e)}),[o,n,e]),n}function oe(e,t,n={}){const r=ne(e),o=ie(n),a=(0,i.useMemo)((()=>q(r,t,o)),[r,t,o]);return re((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:r})=>{const o=i.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,r);return(0,i.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:r=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,i.useRef)(0),l=(0,i.useRef)(!1),u=(0,i.useRef)(null),d=ne((([i],o)=>{if(!n||!i)return;const a=i.target;i.isIntersecting?(l.current=!0,c.current+=1,e(i)):l.current&&(l.current=!1,c.current+=1,t(i)),r&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,i.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,i.forwardRef)(((e,t)=>{var{src:n,threshold:i,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:i,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,r.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,i.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,w]=(0,i.useState)(!1),p=!f,m=(0,i.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,i.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,i.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,r.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,r.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,r.jsx)(i.Fragment,{children:o?t:n})},be=(0,i.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:i,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:i,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,r.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,i.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(r=e)&&r.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var r}),[t]);return(0,r.jsx)(r.Fragment,{children:e.map(((e,t)=>(0,r.jsx)(i.Fragment,{children:n(e,t)},o(e,t))))})},we=D()?i.useLayoutEffect:i.useEffect;function pe(e,t,n,r={}){const i=ie(r),o=ne(n);we((()=>{if(e)return e.addEventListener(t,o,i),()=>{e.removeEventListener(t,o,i)}}),[t,e,i,o])}function me(e){const t=(0,i.useRef)(null),n=(0,i.useMemo)((()=>function(){if(Y())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),r=(0,i.useCallback)((({target:n})=>{const r=t.current;r&&!r.contains(n)&&e(r)}),[e]);return pe(window.document,n,r),t}const he=(0,i.forwardRef)(((e,t)=>{var{as:n,children:i,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,r.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:i}))}));(0,i.createContext)({parentPortalElement:null});const ve=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,i.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,r.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,r.jsxs)(r.Fragment,{children:[o(e,t),c(t)&&n]})})},ge=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,r.jsx)(i.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,r.jsx)(i.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,i.useState)(!1),n=(0,i.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)(null);return{copiedData:e,readData:n,copyText:(0,i.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,i.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var r;const i=null!==(r=null==n?void 0:n.toText)&&void 0!==r&&r;try{const n=yield function(e,t){var n;return X(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const r=yield function(e,t="png"){return new Promise(((n,r)=>{const i=new Image;i.onload=()=>X(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=i.width,e.height=i.height;try{const r=e.getContext("2d");if(!r)throw new Error("Failed to get 2d context");r.drawImage(i,0,0);const o=yield V(e,B[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),r(e)}})),i.onerror=()=>{r(new Error("Failed to load image"))},i.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[r.type]:r})]),r}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:i});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,i.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return r(e),!0}catch(e){return r(null),!1}}))),[]),readContents:(0,i.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return r(e),!0}catch(e){return r(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,i.useState)(e),r=(0,i.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,i.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,i.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:r,decrement:o,reset:a}}function Ee({maxStep:e,initialStep:t=0,infinite:n=!1}){const[r,o]=(0,i.useState)(t),a=(0,i.useMemo)((()=>rr>0),[r]),c=(0,i.useCallback)(((t,n)=>{const i=Z(t)?t(r):t;if(i>=0&&i<=e)return n&&n({prev:r,next:i}),void o(t);throw new Error("Step not valid")}),[r,e]),l=(0,i.useCallback)(((t,n)=>{const i="nextStep"===t;return n?i?0:e:i?r+1:r-1}),[e,r]),u=(0,i.useCallback)(((e,t)=>{if(!n)return;const i=l(e,!0);t&&t({prev:r,next:i}),o(i)}),[n,r,l]),d=(0,i.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:r,next:n}),o(n)}),[r,l]),b=(0,i.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,i.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,i.useCallback)((e=>{e&&e({prev:r,next:t}),o(t)}),[r,t]);return{currentStep:r,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:w}}function je(e,t=0){const{currentStep:n,goToNextStep:r,goToPrevStep:o,setStep:a}=Ee({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,i.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:r,prevIndex:o,setIndex:s}}function Ce(e,t,n={}){const[r,o]=(0,i.useState)(e);return[r,oe(o,t,n)]}function Ie(e,t={}){const[n,r]=(0,i.useState)(""),[o,a]=Ce("",e,t);return{value:n,debouncedValue:o,onChange:(0,i.useCallback)((e=>{const{value:t}=e.target;r(t),a(t)}),[a]),onReset:(0,i.useCallback)((()=>{r(""),a("")}),[a])}}function Oe(e,{preserveTitleOnUnmount:t=!1}={}){we((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Te({onEnter:e=ee,onLeave:t=ee}={}){const[n,r]=(0,i.useState)(!1),o=(0,i.useRef)(null),a=ne((t=>{r(!0),e(t)})),s=ne((e=>{r(!1),t(e)}));return(0,i.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Ne(e,t){const n=(0,i.useRef)(),r=ne(e),o=ie(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,i.useCallback)((()=>{n.current=window.setInterval(r,a)}),[r,a]),l=(0,i.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,i.useCallback)((()=>{l(),c()}),[l,c]);return(0,i.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Re="modern-kit-local-storage",_e="modern-kit-session-storage",Me={localStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}},sessionStorage:{key:_e,subscribe:e=>{window.addEventListener(_e,e)},unsubscribe:e=>{window.removeEventListener(_e,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(_e))}}},Pe=e=>Me[e],ze=Pe("localStorage"),Ae=e=>window.localStorage.getItem(e),$e=e=>(ze.subscribe(e),()=>{ze.unsubscribe(e)});function Le(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,r=ie(Z(n)?n():n),o=(0,i.useSyncExternalStore)($e,(()=>Ae(t)),(()=>(e=>JSON.stringify(e))(r)));return{state:(0,i.useMemo)((()=>o?te(o):r),[o,r]),setState:(0,i.useCallback)((e=>{try{const n=Ae(t),i=n?te(n):r,o=Z(e)?e(i):e;window.localStorage.setItem(t,JSON.stringify(o)),ze.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,r]),removeState:(0,i.useCallback)((()=>{try{window.localStorage.removeItem(t),ze.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Fe=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function qe(e,t){const[n,r]=(0,i.useState)(Fe(e,t)),o=(0,i.useCallback)((e=>r(e.matches)),[]);return pe(window.matchMedia(e),"change",o),n}const Ue={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function Xe(){const e=(0,i.useRef)(null),[t,n]=(0,i.useState)(Ue),r=(0,i.useCallback)((t=>{const{screenX:r,screenY:i,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,b=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,b=t.top+window.scrollY}n({screenX:r,screenY:i,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:b})}),[]);return pe(window.document,"mousemove",r),{ref:e,position:t}}const Be=()=>navigator.onLine,Ve=()=>!0;function Ye({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const r=n=>(t(n),e()),i=t=>(n(t),e());return window.addEventListener("online",r),window.addEventListener("offline",i),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}})(n,e,t)));return{isOnline:(0,i.useSyncExternalStore)(n,Be,Ve)}}function De(){return qe("(prefers-color-scheme: dark)")?"dark":"light"}function We(e){const t=(0,i.useRef)(e);return(0,i.useEffect)((()=>{t.current=e}),[e]),t.current}function He(e){const[t,n]=(0,i.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),r=(0,i.useRef)(null),o=ne(e),a=(0,i.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,i.useEffect)((()=>{const e=r.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:r,contentRect:t}}function Ge({autoLock:e=!0}={}){const t=(0,i.useRef)(null),n=(0,i.useRef)(null),r=(0,i.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,i.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return we((()=>(t.current||(t.current=document.body),e&&r(),()=>o())),[e,r,o]),{ref:t,lock:r,unlock:o}}const Je=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ke=(e,t,n)=>{const r=t.getBoundingClientRect(),{offsetX:i=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:r.top+window.scrollY+o+Je(window.innerHeight,r.height,a),left:r.left+window.scrollX+i+Je(window.innerWidth,r.width,s)};const c=e.getBoundingClientRect();return{top:r.top-c.top+e.scrollTop+o+Je(c.height,r.height,a),left:r.left-c.left+e.scrollLeft+i+Je(c.width,r.width,s)}};function Ze(){const e=(0,i.useRef)(null),t=(0,i.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:r=0,behavior:i="auto"}=t;e.current.scrollTo({left:n,top:r,behavior:i})}),[]),n=(0,i.useCallback)(((t,n={})=>{if(!t||!e.current)return;const r=e.current,{behavior:i="auto"}=n,{left:o,top:a}=Ke(r,t,n);r.scrollTo({top:a,left:o,behavior:i})}),[]);return(0,i.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=Pe("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,r=ie(Z(n)?n():n),o=(0,i.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(r)));return{state:(0,i.useMemo)((()=>o?te(o):r),[o,r]),setState:(0,i.useCallback)((e=>{try{const n=et(t),i=n?te(n):r,o=Z(e)?e(i):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,r]),removeState:(0,i.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function rt(e){const t="initialState"in e?e.initialState:null,n=ie(e.storageOptions),r=ie(t),[o,a]=(0,i.useState)(r),s=(0,i.useCallback)((e=>{a((t=>{const r=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const r=window[e],i=Z(n)?n():n;r.setItem(t,JSON.stringify(i))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,r)}return r}))}),[n]),c=(0,i.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},Ee(e))}function it(e,t,n={}){const r=ne(e),o=ie(n),a=(0,i.useMemo)((()=>function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError(U);return T(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),q(e,t,{leading:r,maxWait:t,trailing:i})}(r,t,o)),[r,t,o]);return re((()=>a.cancel())),a}function ot(e,t){const n=(0,i.useRef)(),r=ne(e),o=ie(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,i.useCallback)((()=>{n.current=setTimeout(r,a)}),[r,a]),l=(0,i.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,i.useCallback)((()=>{l(),c()}),[l,c]);return(0,i.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,r){var i="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",w="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",j="Browser",C="Chrome",I="Firefox",O="Google",T="Huawei",N="LG",R="Microsoft",_="Motorola",M="Opera",P="Samsung",z="Sharp",A="Sony",$="Xiaomi",L="Zebra",F="Facebook",q="Chromium OS",U="Mac OS",X=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==i?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==i||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):r:this[c[0]]=u?c[1].call(this,u,c[2]):r:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):r):this[c]=u||r;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var i=0;i2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=r,e[f]=r,D.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=r,e[f]=r,D.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,q).replace(/macos/i,U)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?Y(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=X([u,f,c]),J.CPU=X([w]),J.DEVICE=X([l,b,d,p,m,v,h,g,y]),J.ENGINE=J.OS=X([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,i.useState)(null);return we((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){we((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,i.useState)((()=>Y()?ut:{width:window.innerWidth,height:window.innerHeight})),r=oe(n,e),o=(0,i.useCallback)((()=>{(e?r:n)({width:window.innerWidth,height:window.innerHeight})}),[e,r]);return pe(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/308b5f81.d41202fb.js.LICENSE.txt b/assets/js/308b5f81.65c494c1.js.LICENSE.txt
similarity index 100%
rename from assets/js/308b5f81.d41202fb.js.LICENSE.txt
rename to assets/js/308b5f81.65c494c1.js.LICENSE.txt
diff --git a/assets/js/308b5f81.d41202fb.js b/assets/js/308b5f81.d41202fb.js
deleted file mode 100644
index fc07b850f..000000000
--- a/assets/js/308b5f81.d41202fb.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 308b5f81.d41202fb.js.LICENSE.txt */
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[4580],{1956:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>u,assets:()=>l,contentTitle:()=>s,default:()=>f,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var r=n(1986),i=n(9937),o=n(384);const a={},s="useIntersectionObserver",c={id:"react/hooks/useIntersectionObserver",title:"useIntersectionObserver",description:"ref\ub97c \ud560\ub2f9\ud55c \ud0c0\uac9f \uc5d8\ub9ac\uba3c\ud2b8\uac00 Viewport\uc5d0 \ub178\ucd9c\ub420 \ub54c(onIntersectStart) \ud639\uc740 \ub098\uac08 \ub54c(onIntersectEnd) \ud2b9\uc815 action \ud568\uc218\ub97c \ud638\ucd9c \ud560 \uc218 \uc788\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useIntersectionObserver.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useIntersectionObserver",permalink:"/modern-kit/docs/react/hooks/useIntersectionObserver",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useImageStatus",permalink:"/modern-kit/docs/react/hooks/useImageStatus"},next:{title:"useInterval",permalink:"/modern-kit/docs/react/hooks/useInterval"}},l={},u=()=>{const e={br:"br",div:"div",...(0,i.a)()},{ref:t}=(0,o.S1)({onIntersectStart:e=>{console.log("onIntersectStart: ",e)},onIntersectEnd:e=>{console.log("onIntersectEnd: ",e)}}),n={height:"800px",backgroundColor:"teal"};return(0,r.jsxs)(e.div,{children:[(0,r.jsx)(e.div,{style:n}),(0,r.jsxs)(e.div,{ref:t,style:{color:"white",fontSize:"24px",backgroundColor:"blue"},children:["\ud0c0\uac9f \uc694\uc18c",(0,r.jsx)(e.br,{}),"\uac1c\ubc1c\uc790 \ub3c4\uad6c \ucf58\uc194\uc744 \ud655\uc778\ud574\uc8fc\uc138\uc694."]}),(0,r.jsx)(e.div,{style:n})]})},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Exmaple",id:"exmaple",level:2},{value:"Note",id:"note",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.header,{children:(0,r.jsx)(t.h1,{id:"useintersectionobserver",children:"useIntersectionObserver"})}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"ref"}),"\ub97c \ud560\ub2f9\ud55c \ud0c0\uac9f \uc5d8\ub9ac\uba3c\ud2b8\uac00 ",(0,r.jsx)(t.code,{children:"Viewport"}),"\uc5d0 \ub178\ucd9c\ub420 \ub54c(",(0,r.jsx)(t.code,{children:"onIntersectStart"}),") \ud639\uc740 \ub098\uac08 \ub54c(",(0,r.jsx)(t.code,{children:"onIntersectEnd"}),") \ud2b9\uc815 action \ud568\uc218\ub97c \ud638\ucd9c \ud560 \uc218 \uc788\ub294 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"calledOnce"}),"\uc635\uc158\uc744 ",(0,r.jsx)(t.code,{children:"true"}),"\ub85c \uc124\uc815\ud558\uba74 ",(0,r.jsx)(t.code,{children:"onIntersectStart"}),"\uc640 ",(0,r.jsx)(t.code,{children:"onIntersectEnd"}),"\ub97c \uac01\uac01 \ud55c\ubc88\uc529 \ud638\ucd9c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.code,{children:"enabled"}),"\uc635\uc158\uc744 \ud1b5\ud574 ",(0,r.jsx)(t.code,{children:"onIntersect*"})," \ucf5c\ubc31 \ud568\uc218\ub4e4\uc758 \ud638\ucd9c\uc744 \uc81c\uc5b4 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. ",(0,r.jsx)(t.code,{children:"false"}),"\ub77c\uba74 \ud0c0\uac9f \uc5d8\ub9ac\uba3c\ud2b8\uac00 Viewport\uc5d0 \ub178\ucd9c\ud558\ub354\ub77c\ub3c4 \uc2e4\ud589\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."]}),"\n",(0,r.jsxs)(t.p,{children:["Intersection Observer Option\uc744 \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.(\ud558\ub2e8 ",(0,r.jsx)(t.code,{children:"Note"})," \ucc38\uace0)"]}),"\n",(0,r.jsx)("br",{}),"\n",(0,r.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useIntersectionObserver/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,r.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"interface IntersectionObserverInit {\n root?: Element | Document | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface UseIntersectionObserverProps extends IntersectionObserverInit {\n onIntersectStart?: (entry: IntersectionObserverEntry) => void;\n onIntersectEnd?: (entry: IntersectionObserverEntry) => void;\n calledOnce?: boolean;\n enabled?: boolean;\n}\n"})}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"const useIntersectionObserver: ({\n onIntersectStart,\n onIntersectEnd,\n enabled, // default: true\n calledOnce, // default: false\n root, // default: null\n threshold, // default: 0\n rootMargin, // default: '0px 0px 0px 0px'\n}: UseIntersectionObserverProps) => { \n ref: React.RefCallback \n};\n"})}),"\n",(0,r.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(t.pre,{children:(0,r.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:'import { useIntersectionObserver } from \'@modern-kit/react\';\n\nconst Example = () => {\n const { ref: targetRef } = useIntersectionObserver({\n onIntersectStart: (entry) => {\n console.log("onIntersectStart: ", entry);\n },\n onIntersectEnd: (entry) => {\n console.log("onIntersectEnd: ", entry);\n },\n });\n \n const boxStyle = {\n height: "800px", \n backgroundColor: "teal"\n }\n\n return (\n \n
\n
\n \ud0c0\uac9f \uc694\uc18c
\n \uac1c\ubc1c\uc790 \ub3c4\uad6c \ucf58\uc194\uc744 \ud655\uc778\ud574\uc8fc\uc138\uc694.\n
\n
\n
\n );\n};\n'})}),"\n",(0,r.jsx)(t.h2,{id:"exmaple",children:"Exmaple"}),"\n","\n",(0,r.jsx)(u,{}),"\n",(0,r.jsx)(t.h2,{id:"note",children:"Note"}),"\n",(0,r.jsxs)(t.ul,{children:["\n",(0,r.jsx)(t.li,{children:(0,r.jsx)(t.a,{href:"https://developer.mozilla.org/ko/docs/Web/API/IntersectionObserver",children:"Intersection Observer API"})}),"\n"]})]})}function f(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var r=n(7800);const i={},o=r.createContext(i);function a(e){const t=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:a(e.components),r.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>et,Bg:()=>fe,Cf:()=>xe,D9:()=>Be,FS:()=>ot,GN:()=>Ee,Hk:()=>ve,KS:()=>nt,LN:()=>Xe,Mm:()=>ge,Nr:()=>oe,Pr:()=>De,S1:()=>se,VP:()=>ye,XI:()=>Ie,Xs:()=>Qe,Yz:()=>Oe,_:()=>Le,a9:()=>ue,ac:()=>$e,cM:()=>at,df:()=>be,fB:()=>tt,g4:()=>ke,iP:()=>st,ii:()=>Fe,jr:()=>Ce,my:()=>we,nA:()=>he,oM:()=>d,oz:()=>Ve,qQ:()=>Ge,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>me,yU:()=>Ye,yn:()=>je,z$:()=>Se});var r=n(1986),i=n(7800);n(4041);function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,i.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,i.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(i.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,r.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:i.Children.only(a)}))}));function b(){const[e,t]=(0,i.useState)(!1);return(0,i.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,r.jsx)(r.Fragment,{}),children:t})=>b()?(0,r.jsx)(r.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",j=h?h.toStringTag:void 0;var C="[object Symbol]",I=/\s/,O=/^\s+/;function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=NaN,R=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,M=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:j&&j in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var r=!0}catch(e){}var i=y.call(e);return r&&(t?e[x]=n:delete e[x]),i}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return N;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&I.test(e.charAt(t)););return t}(e)+1).replace(O,""):e}(e);var n=_.test(e);return n||M.test(e)?P(e.slice(2),n?2:8):R.test(e)?N:+e}var L=function(){return m.Date.now()},A="Expected a function",$=Math.max,F=Math.min;function q(e,t,n){var r,i,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError(A);function f(t){var n=r,o=i;return r=i=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=L();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&r?f(e):(r=i=void 0,a)}function h(){var e=L(),n=w(e);if(r=arguments,i=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),f(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,T(n)&&(u=!!n.leading,o=(d="maxWait"in n)?$(z(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=i=s=void 0},h.flush=function(){return void 0===s?a:m(L())},h}var U="Expected a function";function X(e,t,n,r){return new(n||(n=Promise))((function(t,i){function o(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(o,a)}s((r=r.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const V={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},B=(e,t)=>new Promise(((n,r)=>{e.toBlob((e=>{e?n(e):r(new Error(`Failed to create blob with format ${t}`))}),t)}));function Y(){return"undefined"==typeof window}function D(){return!Y()}function W(e){return X(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>X(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const G=(e,t,n)=>{const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const o of r)if(!i.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const r=[...e],i=[...t];return G(r,i,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!t.has(r)||!J(i,t.get(r),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,i.useRef)(e);return t.current=e,(0,i.useCallback)(((...e)=>t.current(...e)),[])}function re(e){const t=ne(e);(0,i.useEffect)((()=>()=>t()),[t])}function ie(e,t=K){const[n,r]=(0,i.useState)(e),o=ne(t);return(0,i.useEffect)((()=>{o(n,e)||r(e)}),[o,n,e]),n}function oe(e,t,n={}){const r=ne(e),o=ie(n),a=(0,i.useMemo)((()=>q(r,t,o)),[r,t,o]);return re((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:r})=>{const o=i.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,r);return(0,i.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:r=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,i.useRef)(0),l=(0,i.useRef)(!1),u=(0,i.useRef)(null),d=ne((([i],o)=>{if(!n||!i)return;const a=i.target;i.isIntersecting?(l.current=!0,c.current+=1,e(i)):l.current&&(l.current=!1,c.current+=1,t(i)),r&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,i.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,i.forwardRef)(((e,t)=>{var{src:n,threshold:i,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:i,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,r.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,i.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,w]=(0,i.useState)(!1),p=!f,m=(0,i.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,i.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,i.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,r.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,r.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,r.jsx)(i.Fragment,{children:o?t:n})},be=(0,i.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:i,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:i,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,r.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,i.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(r=e)&&r.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var r}),[t]);return(0,r.jsx)(r.Fragment,{children:e.map(((e,t)=>(0,r.jsx)(i.Fragment,{children:n(e,t)},o(e,t))))})};const we=(0,i.forwardRef)(((e,t)=>{var{as:n,children:a,callback:s}=e,c=o(e,["as","children","callback"]);const{ref:l}=function(e){const t=(0,i.useRef)(null),n=ne(e);return(0,i.useEffect)((()=>{const e=function(){if(Y())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown",r=({target:e})=>{const r=t.current;r&&!r.contains(e)&&n(r)};return document.addEventListener(e,r),()=>{document.removeEventListener(e,r)}}),[n]),{ref:t}}(s);return(0,r.jsx)(n||"div",Object.assign({ref:ce(l,t)},c,{children:a}))})),pe=D()?i.useLayoutEffect:i.useEffect;(0,i.createContext)({parentPortalElement:null});const me=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,i.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,r.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,r.jsxs)(r.Fragment,{children:[o(e,t),c(t)&&n]})})},he=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,r.jsx)(i.Fragment,o?{children:e}:{children:n})},ve=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,r.jsx)(i.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function ge(){const[e,t]=(0,i.useState)(!1),n=(0,i.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ye(){const[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)(null);return{copiedData:e,readData:n,copyText:(0,i.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,i.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var r;const i=null!==(r=null==n?void 0:n.toText)&&void 0!==r&&r;try{const n=yield function(e,t){var n;return X(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const r=yield function(e,t="png"){return new Promise(((n,r)=>{const i=new Image;i.onload=()=>X(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=i.width,e.height=i.height;try{const r=e.getContext("2d");if(!r)throw new Error("Failed to get 2d context");r.drawImage(i,0,0);const o=yield B(e,V[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),r(e)}})),i.onerror=()=>{r(new Error("Failed to load image"))},i.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[r.type]:r})]),r}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:i});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,i.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return r(e),!0}catch(e){return r(null),!1}}))),[]),readContents:(0,i.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return r(e),!0}catch(e){return r(null),!1}}))),[])}}function xe(e=0){const[t,n]=(0,i.useState)(e),r=(0,i.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,i.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,i.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:r,decrement:o,reset:a}}function ke({maxStep:e,initialStep:t=0,infinite:n=!1}){const[r,o]=(0,i.useState)(t),a=(0,i.useMemo)((()=>rr>0),[r]),c=(0,i.useCallback)(((t,n)=>{const i=Z(t)?t(r):t;if(i>=0&&i<=e)return n&&n({prev:r,next:i}),void o(t);throw new Error("Step not valid")}),[r,e]),l=(0,i.useCallback)(((t,n)=>{const i="nextStep"===t;return n?i?0:e:i?r+1:r-1}),[e,r]),u=(0,i.useCallback)(((e,t)=>{if(!n)return;const i=l(e,!0);t&&t({prev:r,next:i}),o(i)}),[n,r,l]),d=(0,i.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:r,next:n}),o(n)}),[r,l]),b=(0,i.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,i.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,i.useCallback)((e=>{e&&e({prev:r,next:t}),o(t)}),[r,t]);return{currentStep:r,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:w}}function Se(e,t=0){const{currentStep:n,goToNextStep:r,goToPrevStep:o,setStep:a}=ke({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,i.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:r,prevIndex:o,setIndex:s}}function Ee(e,t,n={}){const[r,o]=(0,i.useState)(e);return[r,oe(o,t,n)]}function je(e,t={}){const[n,r]=(0,i.useState)(""),[o,a]=Ee("",e,t);return{value:n,debouncedValue:o,onChange:(0,i.useCallback)((e=>{const{value:t}=e.target;r(t),a(t)}),[a]),onReset:(0,i.useCallback)((()=>{r(""),a("")}),[a])}}function Ce(e,{preserveTitleOnUnmount:t=!1}={}){pe((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Ie({onEnter:e=ee,onLeave:t=ee}={}){const[n,r]=(0,i.useState)(!1),o=(0,i.useRef)(null),a=ne((t=>{r(!0),e(t)})),s=ne((e=>{r(!1),t(e)}));return(0,i.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Oe(e,t){const n=(0,i.useRef)(),r=ne(e),o=ie(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,i.useCallback)((()=>{n.current=window.setInterval(r,a)}),[r,a]),l=(0,i.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,i.useCallback)((()=>{l(),c()}),[l,c]);return(0,i.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Te="modern-kit-local-storage",Ne="modern-kit-session-storage",Re={localStorage:{key:Te,subscribe:e=>{window.addEventListener(Te,e)},unsubscribe:e=>{window.removeEventListener(Te,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Te))}},sessionStorage:{key:Ne,subscribe:e=>{window.addEventListener(Ne,e)},unsubscribe:e=>{window.removeEventListener(Ne,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ne))}}},_e=e=>Re[e],Me=_e("localStorage"),Pe=e=>window.localStorage.getItem(e),ze=e=>(Me.subscribe(e),()=>{Me.unsubscribe(e)});function Le(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,r=ie(Z(n)?n():n),o=(0,i.useSyncExternalStore)(ze,(()=>Pe(t)),(()=>(e=>JSON.stringify(e))(r)));return{state:(0,i.useMemo)((()=>o?te(o):r),[o,r]),setState:(0,i.useCallback)((e=>{try{const n=Pe(t),i=n?te(n):r,o=Z(e)?e(i):e;window.localStorage.setItem(t,JSON.stringify(o)),Me.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,r]),removeState:(0,i.useCallback)((()=>{try{window.localStorage.removeItem(t),Me.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Ae=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function $e(e,t){const[n,r]=(0,i.useState)(Ae(e,t));return(0,i.useEffect)((()=>{const t=window.matchMedia(e),n=e=>r(e.matches);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),[e]),n}function Fe(){const e=(0,i.useRef)(null),[t,n]=(0,i.useState)({screenX:void 0,screenY:void 0,clientX:void 0,clientY:void 0,pageX:void 0,pageY:void 0,elementRelativeX:void 0,elementRelativeY:void 0,elementPositionX:void 0,elementPositionY:void 0});return pe((()=>{const t=t=>{const{screenX:r,screenY:i,clientX:o,clientY:a,pageX:s,pageY:c}=t,l={},u={};if(e.current){const t=e.current.getBoundingClientRect(),n=o-t.left,r=a-t.top,i=t.left+window.scrollX,s=t.top+window.scrollY;l.elementRelativeX=n,l.elementRelativeY=r,u.elementPositionX=i,u.elementPositionY=s}n(Object.assign(Object.assign({screenX:r,screenY:i,clientX:o,clientY:a,pageX:s,pageY:c},l),u))};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}}),[]),{ref:e,position:t}}const qe=()=>navigator.onLine,Ue=()=>!0;function Xe({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const r=n=>(t(n),e()),i=t=>(n(t),e());return window.addEventListener("online",r),window.addEventListener("offline",i),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}})(n,e,t)));return{isOnline:(0,i.useSyncExternalStore)(n,qe,Ue)}}function Ve(){return $e("(prefers-color-scheme: dark)")?"dark":"light"}function Be(e){const t=(0,i.useRef)(e);return(0,i.useEffect)((()=>{t.current=e}),[e]),t.current}function Ye(e){const[t,n]=(0,i.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),r=(0,i.useRef)(null),o=ne(e),a=(0,i.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,i.useEffect)((()=>{const e=r.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:r,contentRect:t}}function De({autoLock:e=!0}={}){const t=(0,i.useRef)(null),n=(0,i.useRef)(null),r=(0,i.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,i.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return pe((()=>(t.current||(t.current=document.body),e&&r(),()=>o())),[e,r,o]),{ref:t,lock:r,unlock:o}}const We=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,He=(e,t,n)=>{const r=t.getBoundingClientRect(),{offsetX:i=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:r.top+window.scrollY+o+We(window.innerHeight,r.height,a),left:r.left+window.scrollX+i+We(window.innerWidth,r.width,s)};const c=e.getBoundingClientRect();return{top:r.top-c.top+e.scrollTop+o+We(c.height,r.height,a),left:r.left-c.left+e.scrollLeft+i+We(c.width,r.width,s)}};function Ge(){const e=(0,i.useRef)(null),t=(0,i.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:r=0,behavior:i="auto"}=t;e.current.scrollTo({left:n,top:r,behavior:i})}),[]),n=(0,i.useCallback)(((t,n={})=>{if(!t||!e.current)return;const r=e.current,{behavior:i="auto"}=n,{left:o,top:a}=He(r,t,n);r.scrollTo({top:a,left:o,behavior:i})}),[]);return(0,i.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Je=_e("sessionStorage"),Ke=e=>window.sessionStorage.getItem(e),Ze=e=>(Je.subscribe(e),()=>{Je.unsubscribe(e)});function Qe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,r=ie(Z(n)?n():n),o=(0,i.useSyncExternalStore)(Ze,(()=>Ke(t)),(()=>(e=>JSON.stringify(e))(r)));return{state:(0,i.useMemo)((()=>o?te(o):r),[o,r]),setState:(0,i.useCallback)((e=>{try{const n=Ke(t),i=n?te(n):r,o=Z(e)?e(i):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Je.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,r]),removeState:(0,i.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Je.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function et(e){const t="initialState"in e?e.initialState:null,n=ie(e.storageOptions),r=ie(t),[o,a]=(0,i.useState)(r),s=(0,i.useCallback)((e=>{a((t=>{const r=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const r=window[e],i=Z(n)?n():n;r.setItem(t,JSON.stringify(i))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,r)}return r}))}),[n]),c=(0,i.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},ke(e))}function tt(e,t,n={}){const r=ne(e),o=ie(n),a=(0,i.useMemo)((()=>function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError(U);return T(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),q(e,t,{leading:r,maxWait:t,trailing:i})}(r,t,o)),[r,t,o]);return re((()=>a.cancel())),a}function nt(e,t){const n=(0,i.useRef)(),r=ne(e),o=ie(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,i.useCallback)((()=>{n.current=setTimeout(r,a)}),[r,a]),l=(0,i.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,i.useCallback)((()=>{l(),c()}),[l,c]);return(0,i.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var rt={exports:{}};!function(e,t){!function(n,r){var i="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",w="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",j="Browser",C="Chrome",I="Firefox",O="Google",T="Huawei",N="LG",R="Microsoft",_="Motorola",M="Opera",P="Samsung",z="Sharp",L="Sony",A="Xiaomi",$="Zebra",F="Facebook",q="Chromium OS",U="Mac OS",X=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==i?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==i||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):r:this[c[0]]=u?c[1].call(this,u,c[2]):r:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):r):this[c]=u||r;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var i=0;i2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=r,e[f]=r,D.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=r,e[f]=r,D.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,q).replace(/macos/i,U)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?Y(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=X([u,f,c]),J.CPU=X([w]),J.DEVICE=X([l,b,d,p,m,v,h,g,y]),J.ENGINE=J.OS=X([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(rt,rt.exports);var it=rt.exports;function ot(){const[e,t]=(0,i.useState)(null);return pe((()=>{const e=new it.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function at({name:e="vh",enabledResize:t=!1}={}){pe((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}function st(e={}){const{isDebounce:t=!1,wait:n=300}=e,[r,o]=(0,i.useState)({width:null,height:null}),a=(0,i.useCallback)((()=>{o({width:window.innerWidth,height:window.innerHeight})}),[]),s=ne(oe(a,n)),c=(0,i.useMemo)((()=>t?s:a),[a,t,s]);return pe((()=>(a(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[a,c]),r}}}]);
\ No newline at end of file
diff --git a/assets/js/3842c52b.025b1d76.js b/assets/js/3842c52b.12dc062c.js
similarity index 62%
rename from assets/js/3842c52b.025b1d76.js
rename to assets/js/3842c52b.12dc062c.js
index 955814d1c..167a1e44a 100644
--- a/assets/js/3842c52b.025b1d76.js
+++ b/assets/js/3842c52b.12dc062c.js
@@ -1 +1 @@
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[8852],{8021:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>o,contentTitle:()=>c,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>d});var n=s(1986),r=s(9937);const a={},c="usePreservedCallback",l={id:"react/hooks/usePreservedCallback",title:"usePreservedCallback",description:"\uc8fc\uc5b4\uc9c4 \ucf5c\ubc31 \ud568\uc218\uc758 \ucc38\uc870\ub97c \uc720\uc9c0\ud558\uace0, \ucef4\ud3ec\ub10c\ud2b8 \ub80c\ub354\ub9c1 \uc0ac\uc774\uc5d0 \uc7ac\uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc8fc\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/usePreservedCallback.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/usePreservedCallback",permalink:"/modern-kit/docs/react/hooks/usePreservedCallback",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"usePreferredColorScheme",permalink:"/modern-kit/docs/react/hooks/usePreferredColorScheme"},next:{title:"usePreservedState",permalink:"/modern-kit/docs/react/hooks/usePreservedState"}},o={},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"as-is",id:"as-is",level:3},{value:"to-be (usePreservedCallback)",id:"to-be-usepreservedcallback",level:3}];function i(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"usepreservedcallback",children:"usePreservedCallback"})}),"\n",(0,n.jsxs)(t.p,{children:["\uc8fc\uc5b4\uc9c4 \ucf5c\ubc31 \ud568\uc218\uc758 ",(0,n.jsx)(t.code,{children:"\ucc38\uc870\ub97c \uc720\uc9c0"}),"\ud558\uace0, \ucef4\ud3ec\ub10c\ud2b8 \ub80c\ub354\ub9c1 \uc0ac\uc774\uc5d0 \uc7ac\uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc8fc\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,n.jsx)(t.p,{children:"\uc774 \ud6c5\uc740 \ud2b9\ud788 \ucf5c\ubc31 \ud568\uc218\uac00 \ub80c\ub354\ub9c1 \uc911\uc5d0 \ubcc0\uacbd\ub420 \ub54c \uc720\uc6a9\ud569\ub2c8\ub2e4. \ubd88\ud544\uc694\ud55c \ud568\uc218 \uc0dd\uc131\uc744 \ubc29\uc9c0\ud558\uace0 \ucd5c\uc801\ud654\ud558\uba70, \ucd5c\uc2e0 \ubc84\uc804\uc758 \ucf5c\ubc31 \ud568\uc218\ub97c \uc0ac\uc6a9 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."}),"\n",(0,n.jsx)("br",{}),"\n",(0,n.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/usePreservedCallback/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,n.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"function usePreservedCallback any>(\n callback?: T\n): T;\n"})}),"\n",(0,n.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,n.jsx)(t.h3,{id:"as-is",children:"as-is"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:'import React, { useEffect, useState } from "react";\n\nconst Example = () => {\n const [state, setState] = useState(0);\n\n const callback = () => {\n setState(state + 1);\n };\n\n useEffect(() => {\n callback(); // \ubb34\ud55c \ud638\ucd9c\n }, [callback]);\n\n return (\n <>{/* ... */}>\n );\n}\n'})}),"\n",(0,n.jsx)(t.h3,{id:"to-be-usepreservedcallback",children:"to-be (usePreservedCallback)"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import React, { useEffect, useState } from \"react\";\nimport { usePreservedCallback } from '@modern-kit/react';\n\nconst Example = () => {\n const [state, setState] = useState(0);\n\n const callback = usePreservedCallback(() => {\n setState(state + 1);\n });\n\n useEffect(() => {\n callback(); // 1\ud68c\ub9cc \ud638\ucd9c\n }, [callback]);\n\n return (\n <>{/* ... */}>\n );\n}\n"})})]})}function u(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(i,{...e})}):i(e)}},9937:(e,t,s)=>{s.d(t,{Z:()=>l,a:()=>c});var n=s(7800);const r={},a=n.createContext(r);function c(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[8852],{8021:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>o,contentTitle:()=>c,default:()=>u,frontMatter:()=>a,metadata:()=>l,toc:()=>d});var n=s(1986),r=s(9937);const a={},c="usePreservedCallback",l={id:"react/hooks/usePreservedCallback",title:"usePreservedCallback",description:"\uc8fc\uc5b4\uc9c4 \ucf5c\ubc31 \ud568\uc218\uc758 \ucc38\uc870\ub97c \uc720\uc9c0\ud558\uace0, \ucef4\ud3ec\ub10c\ud2b8 \ub80c\ub354\ub9c1 \uc0ac\uc774\uc5d0 \uc7ac\uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc8fc\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/usePreservedCallback.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/usePreservedCallback",permalink:"/modern-kit/docs/react/hooks/usePreservedCallback",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"usePreferredColorScheme",permalink:"/modern-kit/docs/react/hooks/usePreferredColorScheme"},next:{title:"usePreservedState",permalink:"/modern-kit/docs/react/hooks/usePreservedState"}},o={},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"as-is",id:"as-is",level:3},{value:"to-be (usePreservedCallback)",id:"to-be-usepreservedcallback",level:3}];function i(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.header,{children:(0,n.jsx)(t.h1,{id:"usepreservedcallback",children:"usePreservedCallback"})}),"\n",(0,n.jsxs)(t.p,{children:["\uc8fc\uc5b4\uc9c4 \ucf5c\ubc31 \ud568\uc218\uc758 ",(0,n.jsx)(t.code,{children:"\ucc38\uc870\ub97c \uc720\uc9c0"}),"\ud558\uace0, \ucef4\ud3ec\ub10c\ud2b8 \ub80c\ub354\ub9c1 \uc0ac\uc774\uc5d0 \uc7ac\uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \ub3c4\uc640\uc8fc\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,n.jsx)(t.p,{children:"\uc774 \ud6c5\uc740 \ud2b9\ud788 \ucf5c\ubc31 \ud568\uc218\uac00 \ub80c\ub354\ub9c1 \uc911\uc5d0 \ubcc0\uacbd\ub420 \ub54c \uc720\uc6a9\ud569\ub2c8\ub2e4. \ubd88\ud544\uc694\ud55c \ud568\uc218 \uc0dd\uc131\uc744 \ubc29\uc9c0\ud558\uace0 \ucd5c\uc801\ud654\ud558\uba70, \ucd5c\uc2e0 \ubc84\uc804\uc758 \ucf5c\ubc31 \ud568\uc218\ub97c \uc0ac\uc6a9 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."}),"\n",(0,n.jsx)("br",{}),"\n",(0,n.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/usePreservedCallback/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,n.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"function usePreservedCallback any>(\n callback?: T // default: noop\n): T;\n"})}),"\n",(0,n.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,n.jsx)(t.h3,{id:"as-is",children:"as-is"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:'import React, { useEffect, useState } from "react";\n\nconst Example = () => {\n const [state, setState] = useState(0);\n\n const callback = () => {\n setState(state + 1);\n };\n\n useEffect(() => {\n callback(); // \ubb34\ud55c \ud638\ucd9c\n }, [callback]);\n\n return (\n <>{/* ... */}>\n );\n}\n'})}),"\n",(0,n.jsx)(t.h3,{id:"to-be-usepreservedcallback",children:"to-be (usePreservedCallback)"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import React, { useEffect, useState } from \"react\";\nimport { usePreservedCallback } from '@modern-kit/react';\n\nconst Example = () => {\n const [state, setState] = useState(0);\n\n const callback = usePreservedCallback(() => {\n setState(state + 1);\n });\n\n useEffect(() => {\n callback(); // 1\ud68c\ub9cc \ud638\ucd9c\n }, [callback]);\n\n return (\n <>{/* ... */}>\n );\n}\n"})})]})}function u(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(i,{...e})}):i(e)}},9937:(e,t,s)=>{s.d(t,{Z:()=>l,a:()=>c});var n=s(7800);const r={},a=n.createContext(r);function c(e){const t=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:c(e.components),n.createElement(a.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/3bdef6d7.0ac8d617.js b/assets/js/3bdef6d7.0ac8d617.js
new file mode 100644
index 000000000..04f45721f
--- /dev/null
+++ b/assets/js/3bdef6d7.0ac8d617.js
@@ -0,0 +1,2 @@
+/*! For license information please see 3bdef6d7.0ac8d617.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[8090],{7201:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>u,assets:()=>l,contentTitle:()=>s,default:()=>f,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var i=n(1986),r=n(9937),o=(n(7800),n(384));const a={},s="useDebouncedState",c={id:"react/hooks/useDebouncedState",title:"useDebouncedState",description:"useState\uc758 \ub514\ubc14\uc6b4\uc2a4 \ubc84\uc804\uc758 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useDebouncedState.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useDebouncedState",permalink:"/modern-kit/docs/react/hooks/useDebouncedState",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useDebouncedInputValue",permalink:"/modern-kit/docs/react/hooks/useDebouncedInputValue"},next:{title:"useDocumentTitle",permalink:"/modern-kit/docs/react/hooks/useDocumentTitle"}},l={},u=()=>{const e={div:"div",input:"input",p:"p",...(0,r.a)()},[t,n]=(0,o.GN)("",500);return(0,i.jsxs)(e.div,{children:[(0,i.jsxs)(e.p,{children:["\ub514\ubc14\uc6b4\uc2f1 \uc0c1\ud0dc: ",t]}),(0,i.jsx)(e.div,{children:(0,i.jsx)(e.input,{type:"text",onChange:e=>n(e.target.value)})})]})},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"usedebouncedstate",children:"useDebouncedState"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"useState"}),"\uc758 \ub514\ubc14\uc6b4\uc2a4 \ubc84\uc804\uc758 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useDebouncedState/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"type DebounceParameters = Parameters;\ntype DebounceReturnType = ReturnType<\n typeof debounce\n>;\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"function useDebouncedState(\n initialState: T,\n wait: DebounceParameters[1],\n options?: DebounceParameters[2]\n): [T, DebounceReturnType>>];\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useState } from 'react';\nimport { useDebouncedState } from '@modern-kit/react';\n\nconst Example = () => {\n const [debouncedState, setDebouncedState] = useDebouncedState(\"\", 500);\n\n return (\n \n
\ub514\ubc14\uc6b4\uc2f1 \uc0c1\ud0dc: {debouncedValue}
\n
\n setDebouncedState(e.target.value)} />\n
\n
\n );\n};\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(u,{})]})}function f(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>fe,Cf:()=>Se,D9:()=>We,FS:()=>ct,GN:()=>je,Hk:()=>ye,KS:()=>ot,LN:()=>Ue,Mm:()=>xe,Nr:()=>oe,OR:()=>pe,Pr:()=>Ge,S1:()=>se,VP:()=>ke,XI:()=>Ne,Xs:()=>nt,Yz:()=>Re,_:()=>Ae,a9:()=>ue,ac:()=>Fe,cM:()=>lt,df:()=>be,fB:()=>rt,g4:()=>Ee,iP:()=>dt,ii:()=>Xe,jr:()=>Oe,my:()=>he,nA:()=>ge,oM:()=>d,oz:()=>Ye,qQ:()=>Ze,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ve,yU:()=>He,yn:()=>Te,z$:()=>Ce});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function b(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>b()?(0,i.jsx)(i.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",C=h?h.toStringTag:void 0;var j="[object Symbol]",T=/\s/,O=/^\s+/;function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var R=NaN,_=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,P=/^0o[0-7]+$/i,M=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:C&&C in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==j}(e))return R;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&T.test(e.charAt(t)););return t}(e)+1).replace(O,""):e}(e);var n=I.test(e);return n||P.test(e)?M(e.slice(2),n?2:8):_.test(e)?R:+e}var D=function(){return m.Date.now()},$="Expected a function",A=Math.max,L=Math.min;function F(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError($);function f(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=D();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?L(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&i?f(e):(i=r=void 0,a)}function h(){var e=D(),n=w(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),f(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,N(n)&&(u=!!n.leading,o=(d="maxWait"in n)?A(z(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(D())},h}var q="Expected a function";function X(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const B={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},V=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function U(){return"undefined"==typeof window}function Y(){return!U()}function W(e){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>X(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>F(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,w]=(0,r.useState)(!1),p=!f,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},be=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},we=Y()?r.useLayoutEffect:r.useEffect;function pe(e,t,n,i={}){const r=re(i),o=ne(n);we((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(U())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return pe(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ve=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ge=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>X(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield V(e,B[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function Ee({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),b=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:w}}function Ce(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=Ee({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function je(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Te(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=je("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Oe(e,{preserveTitleOnUnmount:t=!1}={}){we((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Ne({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Re(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const _e="modern-kit-local-storage",Ie="modern-kit-session-storage",Pe={localStorage:{key:_e,subscribe:e=>{window.addEventListener(_e,e)},unsubscribe:e=>{window.removeEventListener(_e,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(_e))}},sessionStorage:{key:Ie,subscribe:e=>{window.addEventListener(Ie,e)},unsubscribe:e=>{window.removeEventListener(Ie,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ie))}}},Me=e=>Pe[e],ze=Me("localStorage"),De=e=>window.localStorage.getItem(e),$e=e=>(ze.subscribe(e),()=>{ze.unsubscribe(e)});function Ae(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)($e,(()=>De(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=De(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),ze.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),ze.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Le=(e,t)=>Y()?window.matchMedia(e).matches:null!=t&&t;function Fe(e,t){const[n,i]=(0,r.useState)(Le(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return pe(window.matchMedia(e),"change",o),n}const qe={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function Xe(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(qe),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,b=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,b=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:b})}),[]);return pe(window.document,"mousemove",i),{ref:e,position:t}}const Be=()=>navigator.onLine,Ve=()=>!0;function Ue({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Be,Ve)}}function Ye(){return Fe("(prefers-color-scheme: dark)")?"dark":"light"}function We(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function He(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ge({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return we((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Je=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ke=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Je(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Je(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Je(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Je(c.width,i.width,s)}};function Ze(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ke(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=Me("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},Ee(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(q);return N(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),F(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",w="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",C="Browser",j="Chrome",T="Firefox",O="Google",N="Huawei",R="LG",_="Microsoft",I="Motorola",P="Opera",M="Samsung",z="Sharp",D="Sony",$="Xiaomi",A="Zebra",L="Facebook",F="Chromium OS",q="Mac OS",X=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[f]=i,Y.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[f]=i,Y.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,F).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?U(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=X([u,f,c]),J.CPU=X([w]),J.DEVICE=X([l,b,d,p,m,v,h,g,y]),J.ENGINE=J.OS=X([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,r.useState)(null);return we((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){we((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,r.useState)((()=>U()?ut:{width:window.innerWidth,height:window.innerHeight})),i=oe(n,e),o=(0,r.useCallback)((()=>{(e?i:n)({width:window.innerWidth,height:window.innerHeight})}),[e,i]);return pe(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/3bdef6d7.b82041d0.js.LICENSE.txt b/assets/js/3bdef6d7.0ac8d617.js.LICENSE.txt
similarity index 100%
rename from assets/js/3bdef6d7.b82041d0.js.LICENSE.txt
rename to assets/js/3bdef6d7.0ac8d617.js.LICENSE.txt
diff --git a/assets/js/3bdef6d7.b82041d0.js b/assets/js/3bdef6d7.b82041d0.js
deleted file mode 100644
index 3b066e599..000000000
--- a/assets/js/3bdef6d7.b82041d0.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 3bdef6d7.b82041d0.js.LICENSE.txt */
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[8090],{7201:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>u,assets:()=>l,contentTitle:()=>s,default:()=>f,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var i=n(1986),r=n(9937),o=(n(7800),n(384));const a={},s="useDebouncedState",c={id:"react/hooks/useDebouncedState",title:"useDebouncedState",description:"useState\uc758 \ub514\ubc14\uc6b4\uc2a4 \ubc84\uc804\uc758 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useDebouncedState.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useDebouncedState",permalink:"/modern-kit/docs/react/hooks/useDebouncedState",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useDebouncedInputValue",permalink:"/modern-kit/docs/react/hooks/useDebouncedInputValue"},next:{title:"useDocumentTitle",permalink:"/modern-kit/docs/react/hooks/useDocumentTitle"}},l={},u=()=>{const e={div:"div",input:"input",p:"p",...(0,r.a)()},[t,n]=(0,o.GN)("",500);return(0,i.jsxs)(e.div,{children:[(0,i.jsxs)(e.p,{children:["\ub514\ubc14\uc6b4\uc2f1 \uc0c1\ud0dc: ",t]}),(0,i.jsx)(e.div,{children:(0,i.jsx)(e.input,{type:"text",onChange:e=>n(e.target.value)})})]})},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"usedebouncedstate",children:"useDebouncedState"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"useState"}),"\uc758 \ub514\ubc14\uc6b4\uc2a4 \ubc84\uc804\uc758 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useDebouncedState/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"type DebounceParameters = Parameters;\ntype DebounceReturnType = ReturnType<\n typeof debounce\n>;\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"function useDebouncedState(\n initialState: T,\n wait: DebounceParameters[1],\n options?: DebounceParameters[2]\n): [T, DebounceReturnType>>];\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useState } from 'react';\nimport { useDebouncedState } from '@modern-kit/react';\n\nconst Example = () => {\n const [debouncedState, setDebouncedState] = useDebouncedState(\"\", 500);\n\n return (\n \n
\ub514\ubc14\uc6b4\uc2f1 \uc0c1\ud0dc: {debouncedValue}
\n
\n setDebouncedState(e.target.value)} />\n
\n
\n );\n};\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(u,{})]})}function f(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>et,Bg:()=>fe,Cf:()=>xe,D9:()=>Be,FS:()=>ot,GN:()=>Ee,Hk:()=>ve,KS:()=>nt,LN:()=>Xe,Mm:()=>ge,Nr:()=>oe,Pr:()=>Ye,S1:()=>se,VP:()=>ye,XI:()=>Te,Xs:()=>Qe,Yz:()=>Oe,_:()=>Le,a9:()=>ue,ac:()=>$e,cM:()=>at,df:()=>be,fB:()=>tt,g4:()=>ke,iP:()=>st,ii:()=>Ae,jr:()=>je,my:()=>we,nA:()=>he,oM:()=>d,oz:()=>Ve,qQ:()=>Ge,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>me,yU:()=>Ue,yn:()=>Ce,z$:()=>Se});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function b(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>b()?(0,i.jsx)(i.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",C=h?h.toStringTag:void 0;var j="[object Symbol]",T=/\s/,O=/^\s+/;function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var R=NaN,_=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,P=/^0o[0-7]+$/i,M=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:C&&C in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==j}(e))return R;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&T.test(e.charAt(t)););return t}(e)+1).replace(O,""):e}(e);var n=I.test(e);return n||P.test(e)?M(e.slice(2),n?2:8):_.test(e)?R:+e}var L=function(){return m.Date.now()},D="Expected a function",$=Math.max,A=Math.min;function F(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError(D);function f(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=L();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?A(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&i?f(e):(i=r=void 0,a)}function h(){var e=L(),n=w(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),f(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,N(n)&&(u=!!n.leading,o=(d="maxWait"in n)?$(z(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(L())},h}var q="Expected a function";function X(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const V={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},B=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function U(){return"undefined"==typeof window}function Y(){return!U()}function W(e){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>X(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>F(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,w]=(0,r.useState)(!1),p=!f,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},be=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})};const we=(0,r.forwardRef)(((e,t)=>{var{as:n,children:a,callback:s}=e,c=o(e,["as","children","callback"]);const{ref:l}=function(e){const t=(0,r.useRef)(null),n=ne(e);return(0,r.useEffect)((()=>{const e=function(){if(U())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown",i=({target:e})=>{const i=t.current;i&&!i.contains(e)&&n(i)};return document.addEventListener(e,i),()=>{document.removeEventListener(e,i)}}),[n]),{ref:t}}(s);return(0,i.jsx)(n||"div",Object.assign({ref:ce(l,t)},c,{children:a}))})),pe=Y()?r.useLayoutEffect:r.useEffect;(0,r.createContext)({parentPortalElement:null});const me=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},he=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ve=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function ge(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ye(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>X(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield B(e,V[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return X(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function xe(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function ke({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),b=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:w}}function Se(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=ke({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ee(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Ce(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ee("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function je(e,{preserveTitleOnUnmount:t=!1}={}){pe((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Te({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Oe(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Ne="modern-kit-local-storage",Re="modern-kit-session-storage",_e={localStorage:{key:Ne,subscribe:e=>{window.addEventListener(Ne,e)},unsubscribe:e=>{window.removeEventListener(Ne,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ne))}},sessionStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}}},Ie=e=>_e[e],Pe=Ie("localStorage"),Me=e=>window.localStorage.getItem(e),ze=e=>(Pe.subscribe(e),()=>{Pe.unsubscribe(e)});function Le(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(ze,(()=>Me(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Me(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Pe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Pe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const De=(e,t)=>Y()?window.matchMedia(e).matches:null!=t&&t;function $e(e,t){const[n,i]=(0,r.useState)(De(e,t));return(0,r.useEffect)((()=>{const t=window.matchMedia(e),n=e=>i(e.matches);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),[e]),n}function Ae(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)({screenX:void 0,screenY:void 0,clientX:void 0,clientY:void 0,pageX:void 0,pageY:void 0,elementRelativeX:void 0,elementRelativeY:void 0,elementPositionX:void 0,elementPositionY:void 0});return pe((()=>{const t=t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t,l={},u={};if(e.current){const t=e.current.getBoundingClientRect(),n=o-t.left,i=a-t.top,r=t.left+window.scrollX,s=t.top+window.scrollY;l.elementRelativeX=n,l.elementRelativeY=i,u.elementPositionX=r,u.elementPositionY=s}n(Object.assign(Object.assign({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c},l),u))};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}}),[]),{ref:e,position:t}}const Fe=()=>navigator.onLine,qe=()=>!0;function Xe({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Fe,qe)}}function Ve(){return $e("(prefers-color-scheme: dark)")?"dark":"light"}function Be(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function Ue(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ye({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return pe((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const We=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,He=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+We(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+We(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+We(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+We(c.width,i.width,s)}};function Ge(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=He(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Je=Ie("sessionStorage"),Ke=e=>window.sessionStorage.getItem(e),Ze=e=>(Je.subscribe(e),()=>{Je.unsubscribe(e)});function Qe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ze,(()=>Ke(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Ke(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Je.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Je.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function et(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},ke(e))}function tt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(q);return N(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),F(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function nt(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var it={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",w="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",C="Browser",j="Chrome",T="Firefox",O="Google",N="Huawei",R="LG",_="Microsoft",I="Motorola",P="Opera",M="Samsung",z="Sharp",L="Sony",D="Xiaomi",$="Zebra",A="Facebook",F="Chromium OS",q="Mac OS",X=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[f]=i,Y.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[f]=i,Y.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,F).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?U(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=X([u,f,c]),J.CPU=X([w]),J.DEVICE=X([l,b,d,p,m,v,h,g,y]),J.ENGINE=J.OS=X([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(it,it.exports);var rt=it.exports;function ot(){const[e,t]=(0,r.useState)(null);return pe((()=>{const e=new rt.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function at({name:e="vh",enabledResize:t=!1}={}){pe((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}function st(e={}){const{isDebounce:t=!1,wait:n=300}=e,[i,o]=(0,r.useState)({width:null,height:null}),a=(0,r.useCallback)((()=>{o({width:window.innerWidth,height:window.innerHeight})}),[]),s=ne(oe(a,n)),c=(0,r.useMemo)((()=>t?s:a),[a,t,s]);return pe((()=>(a(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[a,c]),i}}}]);
\ No newline at end of file
diff --git a/assets/js/3ffd14c6.5b59016a.js b/assets/js/3ffd14c6.5b59016a.js
deleted file mode 100644
index 27b211021..000000000
--- a/assets/js/3ffd14c6.5b59016a.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[2014],{111:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>c,toc:()=>a});var r=t(1986),s=t(9937);const o={},i="useOnClickOutside",c={id:"react/hooks/useOnClickOutside",title:"useOnClickOutside",description:"ref\ub97c \ud560\ub2f9\ud55c \ud0c0\uac9f \uc5d8\ub9ac\uba3c\ud2b8 \uc678\ubd80 \uc694\uc18c\ub97c \ud074\ub9ad \ud560 \uacbd\uc6b0 \ucf5c\ubc31 \ud568\uc218\ub97c \ud638\ucd9c\ud558\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useOnClickOutside.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useOnClickOutside",permalink:"/modern-kit/docs/react/hooks/useOnClickOutside",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useNetwork",permalink:"/modern-kit/docs/react/hooks/useNetwork"},next:{title:"usePreferredColorScheme",permalink:"/modern-kit/docs/react/hooks/usePreferredColorScheme"}},d={},a=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2}];function l(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,s.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"useonclickoutside",children:"useOnClickOutside"})}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"ref"}),"\ub97c \ud560\ub2f9\ud55c \ud0c0\uac9f \uc5d8\ub9ac\uba3c\ud2b8 \uc678\ubd80 \uc694\uc18c\ub97c \ud074\ub9ad \ud560 \uacbd\uc6b0 \ucf5c\ubc31 \ud568\uc218\ub97c \ud638\ucd9c\ud558\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,r.jsx)("br",{}),"\n",(0,r.jsx)(n.h2,{id:"code",children:"Code"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useOnClickOutside/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,r.jsx)(n.h2,{id:"interface",children:"Interface"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",metastring:'title="typescript"',children:"const useOnClickOutside: (\n action: (targetElement: T) => void\n) => {\n ref: React.RefObject;\n};\n"})}),"\n",(0,r.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useMemo } from 'react';\nimport { useOnClickOutside } from '@modern-kit/react';\n\nconst Example = () => {\n const { ref } = useOnClickOutside(() => {\n window.alert('outside click')\n });\n \n const boxStyle = useMemo(() => {\n return {\n width: '400px',\n height: '400px',\n background: '#439966',\n fontSize: '1.5rem',\n color: '#fff',\n };\n }, []);\n\n return (\n \n Target Box\n
\n );\n};\n"})})]})}function u(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},9937:(e,n,t)=>{t.d(n,{Z:()=>c,a:()=>i});var r=t(7800);const s={},o=r.createContext(s);function i(e){const n=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),r.createElement(o.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/42a77533.437ec114.js b/assets/js/42a77533.437ec114.js
new file mode 100644
index 000000000..7a0321d15
--- /dev/null
+++ b/assets/js/42a77533.437ec114.js
@@ -0,0 +1,2 @@
+/*! For license information please see 42a77533.437ec114.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[3142],{4601:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>f,assets:()=>d,contentTitle:()=>l,default:()=>p,frontMatter:()=>c,metadata:()=>u,toc:()=>w});var i=n(1986),r=n(9937),o=n(7800),a=n(384),s=n(5549);const c={},l="useOutsidePointerDown",u={id:"react/hooks/useOutsidePointerDown",title:"useOutsidePointerDown",description:"\ud2b9\uc815 \uc694\uc18c \uc678\ubd80\uc5d0\uc11c \ub9c8\uc6b0\uc2a4 \ub610\ub294 \ud130\uce58 \uc774\ubca4\ud2b8\uac00 \ubc1c\uc0dd\ud560 \ub54c \ud638\ucd9c\ub418\ub294 \ucf5c\ubc31\uc744 \ub4f1\ub85d\ud558\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useOutsidePointerDown.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useOutsidePointerDown",permalink:"/modern-kit/docs/react/hooks/useOutsidePointerDown",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useNetwork",permalink:"/modern-kit/docs/react/hooks/useNetwork"},next:{title:"usePreferredColorScheme",permalink:"/modern-kit/docs/react/hooks/usePreferredColorScheme"}},d={},f=()=>{const e={div:"div",h3:"h3",p:"p",...(0,r.a)()},[t,n]=(0,o.useState)(0),s=(0,a.B1)((()=>{n(t+1)})),c=(0,o.useMemo)((()=>({width:"400px",height:"400px",background:"#439966",color:"#fff"})),[]),l=(0,o.useMemo)((()=>({width:"400px",height:"400px",background:"#439966",color:"#fff"})),[]);return(0,i.jsxs)(e.div,{style:c,children:[(0,i.jsx)(e.h3,{children:"Inner Box \uc678\ubd80\ub97c \ud074\ub9ad\ud574\ubcf4\uc138\uc694!"}),(0,i.jsxs)(e.p,{children:["number: ",t]}),(0,i.jsx)(e.div,{ref:s,style:l,children:(0,i.jsx)(e.h3,{children:"Inner Box"})})]})},w=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Note",id:"note",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"useoutsidepointerdown",children:"useOutsidePointerDown"})}),"\n",(0,i.jsx)(t.p,{children:"\ud2b9\uc815 \uc694\uc18c \uc678\ubd80\uc5d0\uc11c \ub9c8\uc6b0\uc2a4 \ub610\ub294 \ud130\uce58 \uc774\ubca4\ud2b8\uac00 \ubc1c\uc0dd\ud560 \ub54c \ud638\ucd9c\ub418\ub294 \ucf5c\ubc31\uc744 \ub4f1\ub85d\ud558\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."}),"\n",(0,i.jsxs)(t.p,{children:["\uc9c0\uc815\ub41c \uc694\uc18c(",(0,i.jsx)(t.code,{children:"ref"}),"\ub85c \uc9c0\uc815\ub41c \uc694\uc18c) \uc678\ubd80\uc5d0\uc11c \uc0ac\uc6a9\uc790\uac00 \ub9c8\uc6b0\uc2a4\ub97c \ud074\ub9ad\ud558\uac70\ub098, \ud130\uce58 \uc774\ubca4\ud2b8\uac00 \ubc1c\uc0dd\ud560 \ub54c\ub9c8\ub2e4 \uc81c\uacf5\ub41c ",(0,i.jsx)(t.code,{children:"callback"})," \ud568\uc218\ub97c \ud638\ucd9c\ud569\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:["\ubaa8\ubc14\uc77c \ud658\uacbd\uc5d0\uc11c\ub294 ",(0,i.jsx)(t.code,{children:"touchstart"}),", \ub370\uc2a4\ud06c\ud0d1 \ud658\uacbd\uc5d0\uc11c\ub294 ",(0,i.jsx)(t.code,{children:"mousedown"})," \uc774\ubca4\ud2b8\ub97c \uac10\uc9c0\ud569\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useOutsidePointerDown/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"function useOutsidePointerDown(\n callback: (targetElement: T) => void\n): React.RefObject;\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useMemo, useState } from 'react';\nimport { useOutsidePointerDown } from '@modern-kit/react';\n\nconst Example = () => {\n const [number, setNumber] = useState(0);\n const targetRef = useOutsidePointerDown(() => {\n setNumber(number + 1);\n });\n \n const outerBoxStyle = useMemo(() => {\n return {\n width: '400px',\n height: '400px',\n background: '#439966',\n color: '#fff',\n };\n }, []);\n\n const InnerBoxStyle = useMemo(() => {\n return {\n width: '400px',\n height: '400px',\n background: '#439966',\n color: '#fff',\n };\n }, []);\n\n return (\n \n
Inner Box \uc678\ubd80\ub97c \ud074\ub9ad\ud574\ubcf4\uc138\uc694!
\n
number: {number}
\n\n
\n
Inner Box
\n \n
\n );\n};\n"})}),"\n","\n",(0,i.jsx)(s.Z,{children:()=>(0,i.jsx)(f,{})}),"\n",(0,i.jsx)(t.h2,{id:"note",children:"Note"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent",children:"PointerEvent"})}),"\n"]})]})}function p(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},5549:(e,t,n)=>{n.d(t,{Z:()=>o});n(7800);var i=n(4798),r=n(1986);function o(e){let{children:t,fallback:n}=e;return(0,i.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>we,Cf:()=>Se,D9:()=>We,FS:()=>ct,GN:()=>Ce,Hk:()=>ye,KS:()=>ot,LN:()=>Ve,Mm:()=>xe,Nr:()=>oe,OR:()=>pe,Pr:()=>Ze,S1:()=>se,VP:()=>ke,XI:()=>Ne,Xs:()=>nt,Yz:()=>Pe,_:()=>Le,a9:()=>ue,ac:()=>Be,cM:()=>lt,df:()=>fe,fB:()=>rt,g4:()=>Ee,iP:()=>dt,ii:()=>De,jr:()=>Te,my:()=>he,nA:()=>ge,oM:()=>d,oz:()=>Ye,qQ:()=>Ke,qx:()=>w,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ve,yU:()=>He,yn:()=>Oe,z$:()=>je});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function f(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const w=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>f()?(0,i.jsx)(i.Fragment,{children:t}):e;var b="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=b||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",j=h?h.toStringTag:void 0;var C="[object Symbol]",O=/\s/,T=/^\s+/;function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var P=NaN,I=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,M=/^0o[0-7]+$/i,_=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:j&&j in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return P;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(T,""):e}(e);var n=R.test(e);return n||M.test(e)?_(e.slice(2),n?2:8):I.test(e)?P:+e}var $=function(){return m.Date.now()},A="Expected a function",L=Math.max,F=Math.min;function B(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(A);function w(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function b(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=$();if(b(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,f&&i?w(e):(i=r=void 0,a)}function h(){var e=$(),n=b(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?w(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),w(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,N(n)&&(u=!!n.leading,o=(d="maxWait"in n)?L(z(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m($())},h}var q="Expected a function";function D(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const X={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},U=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function Y(){return!V()}function W(e){return D(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>D(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const Z=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!G(e[o],t[o],n))return!1;return!0},G=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(K(e)&&K(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return Z(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!G(r,t.get(i),n))return!1;return!0}return Z(e,t,n)};function J(e,t){return G(e,t,new WeakMap)}function K(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=J){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>B(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{K(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),f=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:f,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,f=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[w,b]=(0,r.useState)(!1),p=!w,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),b(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},f))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},fe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:f}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,f)},d,{children:e.children}))}));fe.displayName="InView";const we=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},be=Y()?r.useLayoutEffect:r.useEffect;function pe(e,t,n,i={}){const r=re(i),o=ne(n);be((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return pe(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ve=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(we,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ge=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return D(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>D(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield U(e,X[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return D(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return D(this,0,void 0,(function*(){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function Ee({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=K(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),f=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),w=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),b=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:f,goToPrevStep:w,resetStep:b}}function je(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=Ee({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ce(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Oe(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ce("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Te(e,{preserveTitleOnUnmount:t=!1}={}){be((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Ne({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Pe(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Ie="modern-kit-local-storage",Re="modern-kit-session-storage",Me={localStorage:{key:Ie,subscribe:e=>{window.addEventListener(Ie,e)},unsubscribe:e=>{window.removeEventListener(Ie,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ie))}},sessionStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}}},_e=e=>Me[e],ze=_e("localStorage"),$e=e=>window.localStorage.getItem(e),Ae=e=>(ze.subscribe(e),()=>{ze.unsubscribe(e)});function Le(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(K(n)?n():n),o=(0,r.useSyncExternalStore)(Ae,(()=>$e(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=$e(t),r=n?te(n):i,o=K(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),ze.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),ze.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Fe=(e,t)=>Y()?window.matchMedia(e).matches:null!=t&&t;function Be(e,t){const[n,i]=(0,r.useState)(Fe(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return pe(window.matchMedia(e),"change",o),n}const qe={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function De(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(qe),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,f=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,f=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:f})}),[]);return pe(window.document,"mousemove",i),{ref:e,position:t}}const Xe=()=>navigator.onLine,Ue=()=>!0;function Ve({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Xe,Ue)}}function Ye(){return Be("(prefers-color-scheme: dark)")?"dark":"light"}function We(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function He(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ze({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return be((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Ge=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Je=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Ge(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Ge(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Ge(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Ge(c.width,i.width,s)}};function Ke(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Je(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=_e("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(K(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=K(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=K(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=K(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!Y())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},Ee(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(q);return N(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),B(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",f="vendor",w="version",b="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",j="Browser",C="Chrome",O="Firefox",T="Google",N="Huawei",P="LG",I="Microsoft",R="Motorola",M="Opera",_="Samsung",z="Sharp",$="Sony",A="Xiaomi",L="Zebra",F="Facebook",B="Chromium OS",q="Mac OS",D=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[w]=i,Y.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[w]=i,Y.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,B).replace(/macos/i,q)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};G.VERSION="1.0.38",G.BROWSER=D([u,w,c]),G.CPU=D([b]),G.DEVICE=D([l,f,d,p,m,v,h,g,y]),G.ENGINE=G.OS=D([u,w]),e.exports&&(t=e.exports=G),t.UAParser=G;var J=typeof n!==o&&(n.jQuery||n.Zepto);if(J&&!J.ua){var K=new G;J.ua=K.getResult(),J.ua.get=function(){return K.getUA()},J.ua.set=function(e){K.setUA(e);var t=K.getResult();for(var n in t)J.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,r.useState)(null);return be((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){be((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,r.useState)((()=>V()?ut:{width:window.innerWidth,height:window.innerHeight})),i=oe(n,e),o=(0,r.useCallback)((()=>{(e?i:n)({width:window.innerWidth,height:window.innerHeight})}),[e,i]);return pe(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/47a95eb2.0f206a9e.js.LICENSE.txt b/assets/js/42a77533.437ec114.js.LICENSE.txt
similarity index 100%
rename from assets/js/47a95eb2.0f206a9e.js.LICENSE.txt
rename to assets/js/42a77533.437ec114.js.LICENSE.txt
diff --git a/assets/js/42f2960f.45b2ab07.js b/assets/js/42f2960f.6a9d4a0e.js
similarity index 97%
rename from assets/js/42f2960f.45b2ab07.js
rename to assets/js/42f2960f.6a9d4a0e.js
index d07f00183..236fa0629 100644
--- a/assets/js/42f2960f.45b2ab07.js
+++ b/assets/js/42f2960f.6a9d4a0e.js
@@ -1 +1 @@
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[8469],{4959:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>d,toc:()=>l});var r=t(1986),a=t(9937);const s={},i="useFileReader",d={id:"react/hooks/useFileReader",title:"useFileReader",description:"File \uac1d\uccb4\ub97c \uc6d0\ud558\ub294 \uc77d\uae30 \uba54\uc11c\ub4dc(readAsText,readAsDataURL,readAsArrayBuffer)\ub85c \uc77d\uace0, \uc77d\uc740 \ud30c\uc77c \ucee8\ud150\uce20\ub97c \ubc18\ud658\ud558\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useFileReader.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useFileReader",permalink:"/modern-kit/docs/react/hooks/useFileReader",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useDocumentTitle",permalink:"/modern-kit/docs/react/hooks/useDocumentTitle"},next:{title:"useForceUpdate",permalink:"/modern-kit/docs/react/hooks/useForceUpdate"}},o={},l=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,a.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"usefilereader",children:"useFileReader"})}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"File"})," \uac1d\uccb4\ub97c \uc6d0\ud558\ub294 \uc77d\uae30 \uba54\uc11c\ub4dc(",(0,r.jsx)(n.code,{children:"readAsText"}),",",(0,r.jsx)(n.code,{children:"readAsDataURL"}),",",(0,r.jsx)(n.code,{children:"readAsArrayBuffer"}),")\ub85c \uc77d\uace0, \uc77d\uc740 \ud30c\uc77c \ucee8\ud150\uce20\ub97c \ubc18\ud658\ud558\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,r.jsx)("br",{}),"\n",(0,r.jsx)(n.h2,{id:"code",children:"Code"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useFileReader/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,r.jsx)(n.h2,{id:"interface",children:"Interface"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",metastring:'title="typescript"',children:"type ReadType = 'readAsText' | 'readAsDataURL' | 'readAsArrayBuffer';\n\ninterface FileContent {\n status: 'fulfilled' | 'rejected';\n readValue: string | ArrayBuffer;\n originFile: Nullable;\n}\n\ninterface ReadFileOptions {\n file: FileList | File;\n readType: ReadType;\n accepts?: string[];\n}\n\nconst useFileReader: () => {\n readFile: ({\n file,\n readType,\n accepts,\n }: ReadFileOptions) => Promise;\n fileContents: FileContent[];\n isLoading: boolean;\n};\n"})}),"\n",(0,r.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-tsx",metastring:'title="typescript"',children:"import React, { useState } from 'react';\nimport { useFileReader } from '@modern-kit/react';\n\nconst Example = () => {\n const { readFile, fileContents, loading } = useFileReader()\n\n const handleChange = (e: React.ChangeEvent) => {\n if(!e.target.files) return;\n\n readFile({ file: e.target.files, readType: 'readAsText' }); \n /*\n * 1. readFile\uc740 Promise \ubc18\ud658\ud569\ub2c8\ub2e4. \ud574\ub2f9 \uac12\uc740 fileContents\uc640 \ub3d9\uc77c\ud569\ub2c8\ub2e4.\n * ex) const data = await readFile(e.target.files, 'readAsDataURL'); \n * \n * 2. accepts\ub85c \uc6d0\ud558\ub294 \ud30c\uc77c \ud0c0\uc785\ub9cc \uc77d\uc5b4\uc62c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n * accepts\uc635\uc158\uc744 \ub118\uaca8\uc8fc\uc9c0 \uc54a\uc73c\uba74 \ubaa8\ub4e0 \ud30c\uc77c \ud0c0\uc785\uc744 \ud5c8\uc6a9\ud569\ub2c8\ub2e4.\n * ex) readFile({ file: e.target.files, readType: 'readAsText', accepts: ['text/plain'] }); \n */\n }\n\n return (\n \n \n
\n );\n};\n"})})]})}function u(e={}){const{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9937:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>i});var r=t(7800);const a={},s=r.createContext(a);function i(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[8469],{4959:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>d,toc:()=>l});var r=t(1986),a=t(9937);const s={},i="useFileReader",d={id:"react/hooks/useFileReader",title:"useFileReader",description:"File \uac1d\uccb4\ub97c \uc6d0\ud558\ub294 \uc77d\uae30 \uba54\uc11c\ub4dc(readAsText,readAsDataURL,readAsArrayBuffer)\ub85c \uc77d\uace0, \uc77d\uc740 \ud30c\uc77c \ucee8\ud150\uce20\ub97c \ubc18\ud658\ud558\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useFileReader.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useFileReader",permalink:"/modern-kit/docs/react/hooks/useFileReader",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useEventListener",permalink:"/modern-kit/docs/react/hooks/useEventListener"},next:{title:"useForceUpdate",permalink:"/modern-kit/docs/react/hooks/useForceUpdate"}},o={},l=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,a.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"usefilereader",children:"useFileReader"})}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"File"})," \uac1d\uccb4\ub97c \uc6d0\ud558\ub294 \uc77d\uae30 \uba54\uc11c\ub4dc(",(0,r.jsx)(n.code,{children:"readAsText"}),",",(0,r.jsx)(n.code,{children:"readAsDataURL"}),",",(0,r.jsx)(n.code,{children:"readAsArrayBuffer"}),")\ub85c \uc77d\uace0, \uc77d\uc740 \ud30c\uc77c \ucee8\ud150\uce20\ub97c \ubc18\ud658\ud558\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,r.jsx)("br",{}),"\n",(0,r.jsx)(n.h2,{id:"code",children:"Code"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useFileReader/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,r.jsx)(n.h2,{id:"interface",children:"Interface"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-ts",metastring:'title="typescript"',children:"type ReadType = 'readAsText' | 'readAsDataURL' | 'readAsArrayBuffer';\n\ninterface FileContent {\n status: 'fulfilled' | 'rejected';\n readValue: string | ArrayBuffer;\n originFile: Nullable;\n}\n\ninterface ReadFileOptions {\n file: FileList | File;\n readType: ReadType;\n accepts?: string[];\n}\n\nconst useFileReader: () => {\n readFile: ({\n file,\n readType,\n accepts,\n }: ReadFileOptions) => Promise;\n fileContents: FileContent[];\n isLoading: boolean;\n};\n"})}),"\n",(0,r.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-tsx",metastring:'title="typescript"',children:"import React, { useState } from 'react';\nimport { useFileReader } from '@modern-kit/react';\n\nconst Example = () => {\n const { readFile, fileContents, loading } = useFileReader()\n\n const handleChange = (e: React.ChangeEvent) => {\n if(!e.target.files) return;\n\n readFile({ file: e.target.files, readType: 'readAsText' }); \n /*\n * 1. readFile\uc740 Promise \ubc18\ud658\ud569\ub2c8\ub2e4. \ud574\ub2f9 \uac12\uc740 fileContents\uc640 \ub3d9\uc77c\ud569\ub2c8\ub2e4.\n * ex) const data = await readFile(e.target.files, 'readAsDataURL'); \n * \n * 2. accepts\ub85c \uc6d0\ud558\ub294 \ud30c\uc77c \ud0c0\uc785\ub9cc \uc77d\uc5b4\uc62c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n * accepts\uc635\uc158\uc744 \ub118\uaca8\uc8fc\uc9c0 \uc54a\uc73c\uba74 \ubaa8\ub4e0 \ud30c\uc77c \ud0c0\uc785\uc744 \ud5c8\uc6a9\ud569\ub2c8\ub2e4.\n * ex) readFile({ file: e.target.files, readType: 'readAsText', accepts: ['text/plain'] }); \n */\n }\n\n return (\n \n \n
\n );\n};\n"})})]})}function u(e={}){const{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},9937:(e,n,t)=>{t.d(n,{Z:()=>d,a:()=>i});var r=t(7800);const a={},s=r.createContext(a);function i(e){const n=r.useContext(s);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),r.createElement(s.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/47a95eb2.0f206a9e.js b/assets/js/47a95eb2.0f206a9e.js
deleted file mode 100644
index ff313e7c6..000000000
--- a/assets/js/47a95eb2.0f206a9e.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 47a95eb2.0f206a9e.js.LICENSE.txt */
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[410],{183:(e,t,n)=>{n.r(t),n.d(t,{Input:()=>d,InputExample:()=>p,assets:()=>u,contentTitle:()=>c,default:()=>w,frontMatter:()=>s,metadata:()=>l,toc:()=>b});var i=n(1986),r=n(9937),o=n(7800),a=n(384);const s={},c="DebounceWrapper",l={id:"react/components/DebounceWrapper",title:"DebounceWrapper",description:"\uc790\uc2dd \uc694\uc18c\uc5d0\uc11c \ubc1c\uc0dd\ud558\ub294 \uc774\ubca4\ud2b8(ex: Click Event)\ub97c debounce\ud574\uc8fc\ub294 \uc720\ud2f8 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4.",source:"@site/docs/react/components/DebounceWrapper.mdx",sourceDirName:"react/components",slug:"/react/components/DebounceWrapper",permalink:"/modern-kit/docs/react/components/DebounceWrapper",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"ClientOnly",permalink:"/modern-kit/docs/react/components/ClientOnly"},next:{title:"FallbackLazyImage",permalink:"/modern-kit/docs/react/components/FallbackLazyImage"}},u={},d=({onChange:e})=>{const t={input:"input",...(0,r.a)()},[n,a]=(0,o.useState)("");return(0,i.jsx)(t.input,{type:"text",onChange:t=>{a(t.target.value),e(t.target.value)},value:n})},p=()=>{const e={p:"p",...(0,r.a)()},[t,n]=(0,o.useState)("");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.uM,{capture:"onChange",wait:500,children:(0,i.jsx)(d,{onChange:e=>{n(e)}})}),(0,i.jsxs)(e.p,{children:["Text: ",t]})]})},b=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Button Click Case",id:"button-click-case",level:3},{value:"Input Change Case",id:"input-change-case",level:3},{value:"Example",id:"example",level:2},{value:"Button Click Case",id:"button-click-case-1",level:3},{value:"Input Change Case",id:"input-change-case-1",level:3}];function f(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"debouncewrapper",children:"DebounceWrapper"})}),"\n",(0,i.jsxs)(t.p,{children:["\uc790\uc2dd \uc694\uc18c\uc5d0\uc11c \ubc1c\uc0dd\ud558\ub294 \uc774\ubca4\ud2b8",(0,i.jsx)(t.code,{children:"(ex: Click Event)"}),"\ub97c debounce\ud574\uc8fc\ub294 \uc720\ud2f8 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/components/DebounceWrapper/index.tsx",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"type DebounceParameters = Parameters;\n\ninterface DebounceWrapperProps {\n children: JSX.Element; // \ud558\ub098\uc758 \uc694\uc18c\ub9cc children prop\uc73c\ub85c \ub118\uaca8\uc904 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n capture: string;\n wait: DebounceParameters[1]; // number\n options?: DebounceParameters[2]; // DebounceSettings\n}\n\nconst DebounceWrapper: ({\n children,\n capture,\n wait,\n options,\n}: DebounceWrapperProps) => React.FunctionComponentElement;\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.h3,{id:"button-click-case",children:"Button Click Case"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { DebounceWrapper } from '@modern-kit/react'\n\nconst Example = () => {\n const onClick = () => {\n console.log('debounce');\n };\n \n return (\n \n \n \n );\n};\n"})}),"\n",(0,i.jsx)(t.h3,{id:"input-change-case",children:"Input Change Case"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"const Input = ({ onChange }: { onChange: (value: string) => void }) => {\n const [value, setValue] = useState('');\n\n const handleChange = (e: ChangeEvent) => {\n setValue(e.target.value);\n onChange(e.target.value);\n };\n\n return ;\n};\n\nconst Example = () => {\n const [text, setText] = useState('');\n\n const onChange = (value: string) => {\n setText(value);\n };\n\n return (\n <>\n \n \n \n {text}
\n >\n );\n}\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(t.h3,{id:"button-click-case-1",children:"Button Click Case"}),"\n",(0,i.jsx)("p",{style:{marginBottom:"4px"},children:"\ube0c\ub77c\uc6b0\uc800\uc758 \uac1c\ubc1c\uc790 \ub3c4\uad6c\uc758 \ucf58\uc194\uc5d0\uc11c \ub3d9\uc791\uc744 \ud655\uc778\ud558\uc138\uc694."}),"\n",(0,i.jsx)(a.uM,{capture:"onClick",wait:500,children:(0,i.jsx)("button",{onClick:()=>{console.log("debounce")},children:"Button"})}),"\n",(0,i.jsx)("br",{}),"\n","\n","\n",(0,i.jsx)(t.h3,{id:"input-change-case-1",children:"Input Change Case"}),"\n",(0,i.jsx)(p,{})]})}function w(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(f,{...e})}):f(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>et,Bg:()=>be,Cf:()=>xe,D9:()=>Xe,FS:()=>ot,GN:()=>Ce,Hk:()=>ve,KS:()=>nt,LN:()=>qe,Mm:()=>ge,Nr:()=>oe,Pr:()=>Ve,S1:()=>se,VP:()=>ye,XI:()=>Oe,Xs:()=>Qe,Yz:()=>Te,_:()=>Le,a9:()=>ue,ac:()=>Fe,cM:()=>at,df:()=>pe,fB:()=>tt,g4:()=>ke,iP:()=>st,ii:()=>Ae,jr:()=>je,my:()=>fe,nA:()=>he,oM:()=>d,oz:()=>We,qQ:()=>Ge,qx:()=>b,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>me,yU:()=>Ue,yn:()=>Ee,z$:()=>Se});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function p(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const b=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>p()?(0,i.jsx)(i.Fragment,{children:t}):e;var f="object"==typeof global&&global&&global.Object===Object&&global,w="object"==typeof self&&self&&self.Object===Object&&self,m=f||w||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",C="[object Undefined]",E=h?h.toStringTag:void 0;var j="[object Symbol]",O=/\s/,T=/^\s+/;function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var I=NaN,_=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,M=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?C:S:E&&E in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==j}(e))return I;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(T,""):e}(e);var n=R.test(e);return n||M.test(e)?P(e.slice(2),n?2:8):_.test(e)?I:+e}var L=function(){return m.Date.now()},$="Expected a function",F=Math.max,A=Math.min;function D(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError($);function b(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function f(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function w(){var e=L();if(f(e))return m(e);s=setTimeout(w,function(e){var n=t-(e-c);return d?A(n,o-(e-l)):n}(e))}function m(e){return s=void 0,p&&i?b(e):(i=r=void 0,a)}function h(){var e=L(),n=f(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(w,t),u?b(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(w,t),b(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=z(t)||0,N(n)&&(u=!!n.leading,o=(d="maxWait"in n)?F(z(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(L())},h}var B="Expected a function";function q(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const W={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},X=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function U(){return"undefined"==typeof window}function V(){return!U()}function Y(e){return q(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>q(void 0,0,void 0,(function*(){const t=yield fetch(e);return Y(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>D(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),p=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:p,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,p=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[b,f]=(0,r.useState)(!1),w=!b,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:w?0:1,transition:`opacity ${u}`},l)),[w,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),f(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[w&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},p))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},pe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:p}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,p)},d,{children:e.children}))}));pe.displayName="InView";const be=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})};const fe=(0,r.forwardRef)(((e,t)=>{var{as:n,children:a,callback:s}=e,c=o(e,["as","children","callback"]);const{ref:l}=function(e){const t=(0,r.useRef)(null),n=ne(e);return(0,r.useEffect)((()=>{const e=function(){if(U())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown",i=({target:e})=>{const i=t.current;i&&!i.contains(e)&&n(i)};return document.addEventListener(e,i),()=>{document.removeEventListener(e,i)}}),[n]),{ref:t}}(s);return(0,i.jsx)(n||"div",Object.assign({ref:ce(l,t)},c,{children:a}))})),we=V()?r.useLayoutEffect:r.useEffect;(0,r.createContext)({parentPortalElement:null});const me=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(be,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},he=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ve=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function ge(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ye(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield Y(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return q(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>q(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield X(e,W[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return q(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return q(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function xe(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function ke({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),p=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),b=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),f=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:p,goToPrevStep:b,resetStep:f}}function Se(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=ke({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ce(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Ee(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ce("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function je(e,{preserveTitleOnUnmount:t=!1}={}){we((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Oe({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Te(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Ne="modern-kit-local-storage",Ie="modern-kit-session-storage",_e={localStorage:{key:Ne,subscribe:e=>{window.addEventListener(Ne,e)},unsubscribe:e=>{window.removeEventListener(Ne,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ne))}},sessionStorage:{key:Ie,subscribe:e=>{window.addEventListener(Ie,e)},unsubscribe:e=>{window.removeEventListener(Ie,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ie))}}},Re=e=>_e[e],Me=Re("localStorage"),Pe=e=>window.localStorage.getItem(e),ze=e=>(Me.subscribe(e),()=>{Me.unsubscribe(e)});function Le(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(ze,(()=>Pe(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Pe(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Me.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Me.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const $e=(e,t)=>V()?window.matchMedia(e).matches:null!=t&&t;function Fe(e,t){const[n,i]=(0,r.useState)($e(e,t));return(0,r.useEffect)((()=>{const t=window.matchMedia(e),n=e=>i(e.matches);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),[e]),n}function Ae(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)({screenX:void 0,screenY:void 0,clientX:void 0,clientY:void 0,pageX:void 0,pageY:void 0,elementRelativeX:void 0,elementRelativeY:void 0,elementPositionX:void 0,elementPositionY:void 0});return we((()=>{const t=t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t,l={},u={};if(e.current){const t=e.current.getBoundingClientRect(),n=o-t.left,i=a-t.top,r=t.left+window.scrollX,s=t.top+window.scrollY;l.elementRelativeX=n,l.elementRelativeY=i,u.elementPositionX=r,u.elementPositionY=s}n(Object.assign(Object.assign({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c},l),u))};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}}),[]),{ref:e,position:t}}const De=()=>navigator.onLine,Be=()=>!0;function qe({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,De,Be)}}function We(){return Fe("(prefers-color-scheme: dark)")?"dark":"light"}function Xe(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function Ue(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ve({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return we((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Ye=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,He=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Ye(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Ye(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Ye(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Ye(c.width,i.width,s)}};function Ge(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=He(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Je=Re("sessionStorage"),Ke=e=>window.sessionStorage.getItem(e),Ze=e=>(Je.subscribe(e),()=>{Je.unsubscribe(e)});function Qe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ze,(()=>Ke(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Ke(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Je.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Je.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function et(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},ke(e))}function tt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(B);return N(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),D(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function nt(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var it={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",p="vendor",b="version",f="architecture",w="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",C="BlackBerry",E="Browser",j="Chrome",O="Firefox",T="Google",N="Huawei",I="LG",_="Microsoft",R="Motorola",M="Opera",P="Samsung",z="Sharp",L="Sony",$="Xiaomi",F="Zebra",A="Facebook",D="Chromium OS",B="Mac OS",q=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},Y=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[b]=i,V.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[b]=i,V.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,D).replace(/macos/i,B)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?U(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=q([u,b,c]),J.CPU=q([f]),J.DEVICE=q([l,p,d,w,m,v,h,g,y]),J.ENGINE=J.OS=q([u,b]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(it,it.exports);var rt=it.exports;function ot(){const[e,t]=(0,r.useState)(null);return we((()=>{const e=new rt.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function at({name:e="vh",enabledResize:t=!1}={}){we((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}function st(e={}){const{isDebounce:t=!1,wait:n=300}=e,[i,o]=(0,r.useState)({width:null,height:null}),a=(0,r.useCallback)((()=>{o({width:window.innerWidth,height:window.innerHeight})}),[]),s=ne(oe(a,n)),c=(0,r.useMemo)((()=>t?s:a),[a,t,s]);return we((()=>(a(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[a,c]),i}}}]);
\ No newline at end of file
diff --git a/assets/js/47a95eb2.467da0b7.js b/assets/js/47a95eb2.467da0b7.js
new file mode 100644
index 000000000..00f5fc8dc
--- /dev/null
+++ b/assets/js/47a95eb2.467da0b7.js
@@ -0,0 +1,2 @@
+/*! For license information please see 47a95eb2.467da0b7.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[410],{183:(e,t,n)=>{n.r(t),n.d(t,{Input:()=>d,InputExample:()=>p,assets:()=>u,contentTitle:()=>c,default:()=>w,frontMatter:()=>s,metadata:()=>l,toc:()=>b});var i=n(1986),r=n(9937),o=n(7800),a=n(384);const s={},c="DebounceWrapper",l={id:"react/components/DebounceWrapper",title:"DebounceWrapper",description:"\uc790\uc2dd \uc694\uc18c\uc5d0\uc11c \ubc1c\uc0dd\ud558\ub294 \uc774\ubca4\ud2b8(ex: Click Event)\ub97c debounce\ud574\uc8fc\ub294 \uc720\ud2f8 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4.",source:"@site/docs/react/components/DebounceWrapper.mdx",sourceDirName:"react/components",slug:"/react/components/DebounceWrapper",permalink:"/modern-kit/docs/react/components/DebounceWrapper",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"ClientOnly",permalink:"/modern-kit/docs/react/components/ClientOnly"},next:{title:"FallbackLazyImage",permalink:"/modern-kit/docs/react/components/FallbackLazyImage"}},u={},d=({onChange:e})=>{const t={input:"input",...(0,r.a)()},[n,a]=(0,o.useState)("");return(0,i.jsx)(t.input,{type:"text",onChange:t=>{a(t.target.value),e(t.target.value)},value:n})},p=()=>{const e={p:"p",...(0,r.a)()},[t,n]=(0,o.useState)("");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.uM,{capture:"onChange",wait:500,children:(0,i.jsx)(d,{onChange:e=>{n(e)}})}),(0,i.jsxs)(e.p,{children:["Text: ",t]})]})},b=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Button Click Case",id:"button-click-case",level:3},{value:"Input Change Case",id:"input-change-case",level:3},{value:"Example",id:"example",level:2},{value:"Button Click Case",id:"button-click-case-1",level:3},{value:"Input Change Case",id:"input-change-case-1",level:3}];function f(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"debouncewrapper",children:"DebounceWrapper"})}),"\n",(0,i.jsxs)(t.p,{children:["\uc790\uc2dd \uc694\uc18c\uc5d0\uc11c \ubc1c\uc0dd\ud558\ub294 \uc774\ubca4\ud2b8",(0,i.jsx)(t.code,{children:"(ex: Click Event)"}),"\ub97c debounce\ud574\uc8fc\ub294 \uc720\ud2f8 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/components/DebounceWrapper/index.tsx",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"type DebounceParameters = Parameters;\n\ninterface DebounceWrapperProps {\n children: JSX.Element; // \ud558\ub098\uc758 \uc694\uc18c\ub9cc children prop\uc73c\ub85c \ub118\uaca8\uc904 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n capture: string;\n wait: DebounceParameters[1]; // number\n options?: DebounceParameters[2]; // DebounceSettings\n}\n\nconst DebounceWrapper: ({\n children,\n capture,\n wait,\n options,\n}: DebounceWrapperProps) => React.FunctionComponentElement;\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.h3,{id:"button-click-case",children:"Button Click Case"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { DebounceWrapper } from '@modern-kit/react'\n\nconst Example = () => {\n const onClick = () => {\n console.log('debounce');\n };\n \n return (\n \n \n \n );\n};\n"})}),"\n",(0,i.jsx)(t.h3,{id:"input-change-case",children:"Input Change Case"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"const Input = ({ onChange }: { onChange: (value: string) => void }) => {\n const [value, setValue] = useState('');\n\n const handleChange = (e: ChangeEvent) => {\n setValue(e.target.value);\n onChange(e.target.value);\n };\n\n return ;\n};\n\nconst Example = () => {\n const [text, setText] = useState('');\n\n const onChange = (value: string) => {\n setText(value);\n };\n\n return (\n <>\n \n \n \n {text}
\n >\n );\n}\n"})}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n",(0,i.jsx)(t.h3,{id:"button-click-case-1",children:"Button Click Case"}),"\n",(0,i.jsx)("p",{style:{marginBottom:"4px"},children:"\ube0c\ub77c\uc6b0\uc800\uc758 \uac1c\ubc1c\uc790 \ub3c4\uad6c\uc758 \ucf58\uc194\uc5d0\uc11c \ub3d9\uc791\uc744 \ud655\uc778\ud558\uc138\uc694."}),"\n",(0,i.jsx)(a.uM,{capture:"onClick",wait:500,children:(0,i.jsx)("button",{onClick:()=>{console.log("debounce")},children:"Button"})}),"\n",(0,i.jsx)("br",{}),"\n","\n","\n",(0,i.jsx)(t.h3,{id:"input-change-case-1",children:"Input Change Case"}),"\n",(0,i.jsx)(p,{})]})}function w(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(f,{...e})}):f(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>be,Cf:()=>Se,D9:()=>Ye,FS:()=>ct,GN:()=>je,Hk:()=>ye,KS:()=>ot,LN:()=>Ue,Mm:()=>xe,Nr:()=>oe,OR:()=>we,Pr:()=>Ge,S1:()=>se,VP:()=>ke,XI:()=>Ne,Xs:()=>nt,Yz:()=>Ie,_:()=>Fe,a9:()=>ue,ac:()=>De,cM:()=>lt,df:()=>pe,fB:()=>rt,g4:()=>Ce,iP:()=>dt,ii:()=>We,jr:()=>Te,my:()=>he,nA:()=>ve,oM:()=>d,oz:()=>Ve,qQ:()=>Ze,qx:()=>b,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ge,yU:()=>He,yn:()=>Oe,z$:()=>Ee});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function p(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const b=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>p()?(0,i.jsx)(i.Fragment,{children:t}):e;var f="object"==typeof global&&global&&global.Object===Object&&global,w="object"==typeof self&&self&&self.Object===Object&&self,m=f||w||Function("return this")(),h=m.Symbol,g=Object.prototype,v=g.hasOwnProperty,y=g.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",C="[object Undefined]",E=h?h.toStringTag:void 0;var j="[object Symbol]",O=/\s/,T=/^\s+/;function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var I=NaN,_=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,M=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?C:S:E&&E in Object(e)?function(e){var t=v.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==j}(e))return I;if(N(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=N(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(T,""):e}(e);var n=R.test(e);return n||M.test(e)?P(e.slice(2),n?2:8):_.test(e)?I:+e}var L=function(){return m.Date.now()},$="Expected a function",F=Math.max,A=Math.min;function D(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError($);function b(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function f(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function w(){var e=L();if(f(e))return m(e);s=setTimeout(w,function(e){var n=t-(e-c);return d?A(n,o-(e-l)):n}(e))}function m(e){return s=void 0,p&&i?b(e):(i=r=void 0,a)}function h(){var e=L(),n=f(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(w,t),u?b(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(w,t),b(c)}return void 0===s&&(s=setTimeout(w,t)),a}return t=z(t)||0,N(n)&&(u=!!n.leading,o=(d="maxWait"in n)?F(z(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(L())},h}var B="Expected a function";function W(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const q={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},X=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function U(){return"undefined"==typeof window}function V(){return!U()}function Y(e){return W(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>W(void 0,0,void 0,(function*(){const t=yield fetch(e);return Y(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>D(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),p=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:p,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,p=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[b,f]=(0,r.useState)(!1),w=!b,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:w?0:1,transition:`opacity ${u}`},l)),[w,u,l]),g=(0,r.useCallback)((e=>{d&&d(e),f(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[w&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:g},p))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},pe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:p}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,p)},d,{children:e.children}))}));pe.displayName="InView";const be=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},fe=V()?r.useLayoutEffect:r.useEffect;function we(e,t,n,i={}){const r=re(i),o=ne(n);fe((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(U())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return we(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ge=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(be,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ve=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield Y(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return W(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>W(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield X(e,q[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return W(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return W(this,0,void 0,(function*(){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function Ce({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),p=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),b=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),f=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:p,goToPrevStep:b,resetStep:f}}function Ee(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=Ce({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function je(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Oe(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=je("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Te(e,{preserveTitleOnUnmount:t=!1}={}){fe((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Ne({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Ie(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const _e="modern-kit-local-storage",Re="modern-kit-session-storage",Me={localStorage:{key:_e,subscribe:e=>{window.addEventListener(_e,e)},unsubscribe:e=>{window.removeEventListener(_e,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(_e))}},sessionStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}}},Pe=e=>Me[e],ze=Pe("localStorage"),Le=e=>window.localStorage.getItem(e),$e=e=>(ze.subscribe(e),()=>{ze.unsubscribe(e)});function Fe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)($e,(()=>Le(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Le(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),ze.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),ze.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Ae=(e,t)=>V()?window.matchMedia(e).matches:null!=t&&t;function De(e,t){const[n,i]=(0,r.useState)(Ae(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return we(window.matchMedia(e),"change",o),n}const Be={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function We(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(Be),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,p=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,p=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:p})}),[]);return we(window.document,"mousemove",i),{ref:e,position:t}}const qe=()=>navigator.onLine,Xe=()=>!0;function Ue({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,qe,Xe)}}function Ve(){return De("(prefers-color-scheme: dark)")?"dark":"light"}function Ye(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function He(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ge({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return fe((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Je=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ke=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Je(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Je(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Je(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Je(c.width,i.width,s)}};function Ze(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ke(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=Pe("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!V())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},Ce(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(B);return N(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),D(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",p="vendor",b="version",f="architecture",w="console",m="mobile",h="tablet",g="smarttv",v="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",C="BlackBerry",E="Browser",j="Chrome",O="Firefox",T="Google",N="Huawei",I="LG",_="Microsoft",R="Motorola",M="Opera",P="Samsung",z="Sharp",L="Sony",$="Xiaomi",F="Zebra",A="Facebook",D="Chromium OS",B="Mac OS",W=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},Y=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[b]=i,V.call(e,g,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[b]=i,V.call(e,g,y.os),x&&!e[u]&&v&&v.platform&&"Unknown"!=v.platform&&(e[u]=v.platform.replace(/chrome os/i,D).replace(/macos/i,B)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===s&&e.length>500?U(e,500):e,this},this.setUA(g),this};J.VERSION="1.0.38",J.BROWSER=W([u,b,c]),J.CPU=W([f]),J.DEVICE=W([l,p,d,w,m,g,h,v,y]),J.ENGINE=J.OS=W([u,b]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,r.useState)(null);return fe((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){fe((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,r.useState)((()=>U()?ut:{width:window.innerWidth,height:window.innerHeight})),i=oe(n,e),o=(0,r.useCallback)((()=>{(e?i:n)({width:window.innerWidth,height:window.innerHeight})}),[e,i]);return we(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/54102c04.d6db603d.js.LICENSE.txt b/assets/js/47a95eb2.467da0b7.js.LICENSE.txt
similarity index 100%
rename from assets/js/54102c04.d6db603d.js.LICENSE.txt
rename to assets/js/47a95eb2.467da0b7.js.LICENSE.txt
diff --git a/assets/js/54102c04.7c9e1c75.js b/assets/js/54102c04.7c9e1c75.js
new file mode 100644
index 000000000..1fa903621
--- /dev/null
+++ b/assets/js/54102c04.7c9e1c75.js
@@ -0,0 +1,2 @@
+/*! For license information please see 54102c04.7c9e1c75.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[2269],{4871:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>u,assets:()=>l,contentTitle:()=>s,default:()=>f,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var i=n(1986),r=n(9937),o=n(384);const a={},s="LazyImage",c={id:"react/components/LazyImage",title:"LazyImage",description:"useIntersectionObserver \ub97c \ud65c\uc6a9\ud574 Viewport\uc5d0 \ub178\ucd9c\ub420 \ub54c \ud560\ub2f9\ub41c \uc774\ubbf8\uc9c0\ub97c Lazy Loading \ud558\ub294 \uc774\ubbf8\uc9c0 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4.",source:"@site/docs/react/components/LazyImage.mdx",sourceDirName:"react/components",slug:"/react/components/LazyImage",permalink:"/modern-kit/docs/react/components/LazyImage",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Iterator",permalink:"/modern-kit/docs/react/components/Iterator"},next:{title:"OutsideClick",permalink:"/modern-kit/docs/react/components/OutsideClick"}},l={},u=()=>{const e={div:"div",...(0,r.a)()};return(0,i.jsxs)(e.div,{style:{background:"#f8f8f8",width:"500px"},children:[(0,i.jsx)(e.div,{style:{height:"500px",textAlign:"center",fontSize:"2rem"},children:"\uc2a4\ud06c\ub864 \ud574\uc8fc\uc138\uc694."}),(0,i.jsx)(o.wY,{src:"https://github.com/Team-Grace/devgrace/assets/64779472/b5640bec-2abc-4205-afbf-ccfd9876a90b",alt:"img1",width:500,height:500}),(0,i.jsx)(e.div,{style:{width:"100%",height:"150px"}}),(0,i.jsx)(o.wY,{src:"https://github.com/Team-Grace/devgrace/assets/64779472/207743a7-b29f-4826-bc08-8df0d67e568b",alt:"img2",width:500,height:500}),(0,i.jsx)(e.div,{style:{width:"100%",height:"150px"}}),(0,i.jsx)(o.wY,{src:"https://github.com/Team-Grace/devgrace/assets/64779472/d1957ec8-fe87-406e-bfda-fb4ee505b152",alt:"img3",width:500,height:500})]})},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2},{value:"Note",id:"note",level:2}];function b(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"lazyimage",children:"LazyImage"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.a,{href:"https://modern-agile-team.github.io/modern-kit/docs/react/hooks/useIntersectionObserver",children:"useIntersectionObserver"})})," \ub97c \ud65c\uc6a9\ud574 ",(0,i.jsx)(t.code,{children:"Viewport"}),"\uc5d0 \ub178\ucd9c\ub420 \ub54c \ud560\ub2f9\ub41c \uc774\ubbf8\uc9c0\ub97c ",(0,i.jsx)(t.code,{children:"Lazy Loading"})," \ud558\ub294 \uc774\ubbf8\uc9c0 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:["Intersection Observer Option\uc744 \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.(\ud558\ub2e8 ",(0,i.jsx)(t.code,{children:"Note"})," \ucc38\uace0)"]}),"\n",(0,i.jsxs)(t.p,{children:["\ub9cc\uc57d, \uc774\ubbf8\uc9c0 ",(0,i.jsx)(t.code,{children:"load"})," \uc911\uc5d0 ",(0,i.jsx)(t.code,{children:"\ud2b9\uc815 Fallback \ucef4\ud3ec\ub10c\ud2b8"}),"\ub97c \ub178\ucd9c\ud558\uace0 \uc2f6\ub2e4\uba74, \uc774\ub97c \uc120\uc5b8\uc801\uc73c\ub85c \ud65c\uc6a9\ud558\uae30 \uc704\ud574 ",(0,i.jsx)(t.code,{children:"LazyImage\ub97c \ud655\uc7a5"}),"\ud574\uc11c \ub9cc\ub4e0 ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.a,{href:"https://modern-agile-team.github.io/modern-kit/docs/react/components/FallbackLazyImage",children:"FallbackLazyImage \ucef4\ud3ec\ub10c\ud2b8"})})," \uac00 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/components/LazyImage/index.tsx",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"interface IntersectionObserverInit {\n root?: Element | Document | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"interface LazyImageProps\n extends React.ComponentProps<'img'>,\n IntersectionObserverInit {\n src: string;\n}\n\nconst LazyImage: React.ForwardRefExoticComponent<\n Omit & React.RefAttributes\n>;\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { LazyImage } from '@modern-kit/react';\nimport img1 from '../assets/img1.png';\nimport img2 from '../assets/img2.png';\n\nconst Example = () => {\n return (\n \n {/* ... */}\n \n {/* ... */}\n \n {/* ... */}\n
\n );\n}; \n"})}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(u,{}),"\n",(0,i.jsx)(t.h2,{id:"note",children:"Note"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/ko/docs/Web/API/IntersectionObserver",children:"Intersection Observer API"})}),"\n"]})]})}function f(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(b,{...e})}):b(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>fe,Cf:()=>Se,D9:()=>We,FS:()=>ct,GN:()=>Ce,Hk:()=>ye,KS:()=>ot,LN:()=>Ve,Mm:()=>xe,Nr:()=>oe,OR:()=>pe,Pr:()=>Ge,S1:()=>se,VP:()=>ke,XI:()=>Te,Xs:()=>nt,Yz:()=>Ne,_:()=>$e,a9:()=>ue,ac:()=>qe,cM:()=>lt,df:()=>be,fB:()=>rt,g4:()=>je,iP:()=>dt,ii:()=>Be,jr:()=>Ie,my:()=>he,nA:()=>ve,oM:()=>d,oz:()=>De,qQ:()=>Ze,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ge,yU:()=>He,yn:()=>Oe,z$:()=>Ee});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function b(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>b()?(0,i.jsx)(i.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,g=Object.prototype,v=g.hasOwnProperty,y=g.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",j="[object Undefined]",E=h?h.toStringTag:void 0;var C="[object Symbol]",O=/\s/,I=/^\s+/;function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=NaN,z=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,L=/^0o[0-7]+$/i,_=parseInt;function M(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?j:S:E&&E in Object(e)?function(e){var t=v.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return N;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(I,""):e}(e);var n=R.test(e);return n||L.test(e)?_(e.slice(2),n?2:8):z.test(e)?N:+e}var P=function(){return m.Date.now()},A="Expected a function",$=Math.max,F=Math.min;function q(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError(A);function f(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=P();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&i?f(e):(i=r=void 0,a)}function h(){var e=P(),n=w(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),f(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=M(t)||0,T(n)&&(u=!!n.leading,o=(d="maxWait"in n)?$(M(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(P())},h}var X="Expected a function";function B(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Y={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},U=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function D(){return!V()}function W(e){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>B(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>q(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,w]=(0,r.useState)(!1),p=!f,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),g=(0,r.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:g},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},be=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},we=D()?r.useLayoutEffect:r.useEffect;function pe(e,t,n,i={}){const r=re(i),o=ne(n);we((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return pe(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ge=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ve=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>B(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield U(e,Y[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function je({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),b=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:w}}function Ee(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=je({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ce(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Oe(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ce("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Ie(e,{preserveTitleOnUnmount:t=!1}={}){we((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Te({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Ne(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const ze="modern-kit-local-storage",Re="modern-kit-session-storage",Le={localStorage:{key:ze,subscribe:e=>{window.addEventListener(ze,e)},unsubscribe:e=>{window.removeEventListener(ze,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(ze))}},sessionStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}}},_e=e=>Le[e],Me=_e("localStorage"),Pe=e=>window.localStorage.getItem(e),Ae=e=>(Me.subscribe(e),()=>{Me.unsubscribe(e)});function $e(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ae,(()=>Pe(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Pe(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Me.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Me.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Fe=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function qe(e,t){const[n,i]=(0,r.useState)(Fe(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return pe(window.matchMedia(e),"change",o),n}const Xe={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function Be(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(Xe),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,b=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,b=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:b})}),[]);return pe(window.document,"mousemove",i),{ref:e,position:t}}const Ye=()=>navigator.onLine,Ue=()=>!0;function Ve({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Ye,Ue)}}function De(){return qe("(prefers-color-scheme: dark)")?"dark":"light"}function We(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function He(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ge({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return we((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Je=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ke=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Je(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Je(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Je(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Je(c.width,i.width,s)}};function Ze(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ke(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=_e("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},je(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(X);return T(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),q(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",w="architecture",p="console",m="mobile",h="tablet",g="smarttv",v="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",j="BlackBerry",E="Browser",C="Chrome",O="Firefox",I="Google",T="Huawei",N="LG",z="Microsoft",R="Motorola",L="Opera",_="Samsung",M="Sharp",P="Sony",A="Xiaomi",$="Zebra",F="Facebook",q="Chromium OS",X="Mac OS",B=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[f]=i,D.call(e,g,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[f]=i,D.call(e,g,y.os),x&&!e[u]&&v&&v.platform&&"Unknown"!=v.platform&&(e[u]=v.platform.replace(/chrome os/i,q).replace(/macos/i,X)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(g),this};J.VERSION="1.0.38",J.BROWSER=B([u,f,c]),J.CPU=B([w]),J.DEVICE=B([l,b,d,p,m,g,h,v,y]),J.ENGINE=J.OS=B([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,r.useState)(null);return we((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){we((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,r.useState)((()=>V()?ut:{width:window.innerWidth,height:window.innerHeight})),i=oe(n,e),o=(0,r.useCallback)((()=>{(e?i:n)({width:window.innerWidth,height:window.innerHeight})}),[e,i]);return pe(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/5d610355.ce5e9f7c.js.LICENSE.txt b/assets/js/54102c04.7c9e1c75.js.LICENSE.txt
similarity index 100%
rename from assets/js/5d610355.ce5e9f7c.js.LICENSE.txt
rename to assets/js/54102c04.7c9e1c75.js.LICENSE.txt
diff --git a/assets/js/54102c04.d6db603d.js b/assets/js/54102c04.d6db603d.js
deleted file mode 100644
index 0403b5dec..000000000
--- a/assets/js/54102c04.d6db603d.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 54102c04.d6db603d.js.LICENSE.txt */
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[2269],{4871:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>u,assets:()=>l,contentTitle:()=>s,default:()=>b,frontMatter:()=>a,metadata:()=>c,toc:()=>d});var i=n(1986),r=n(9937),o=n(384);const a={},s="LazyImage",c={id:"react/components/LazyImage",title:"LazyImage",description:"useIntersectionObserver \ub97c \ud65c\uc6a9\ud574 Viewport\uc5d0 \ub178\ucd9c\ub420 \ub54c \ud560\ub2f9\ub41c \uc774\ubbf8\uc9c0\ub97c Lazy Loading \ud558\ub294 \uc774\ubbf8\uc9c0 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4.",source:"@site/docs/react/components/LazyImage.mdx",sourceDirName:"react/components",slug:"/react/components/LazyImage",permalink:"/modern-kit/docs/react/components/LazyImage",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"Iterator",permalink:"/modern-kit/docs/react/components/Iterator"},next:{title:"OutsideClick",permalink:"/modern-kit/docs/react/components/OutsideClick"}},l={},u=()=>{const e={div:"div",...(0,r.a)()};return(0,i.jsxs)(e.div,{style:{background:"#f8f8f8",width:"500px"},children:[(0,i.jsx)(e.div,{style:{height:"500px",textAlign:"center",fontSize:"2rem"},children:"\uc2a4\ud06c\ub864 \ud574\uc8fc\uc138\uc694."}),(0,i.jsx)(o.wY,{src:"https://github.com/Team-Grace/devgrace/assets/64779472/b5640bec-2abc-4205-afbf-ccfd9876a90b",alt:"img1",width:500,height:500}),(0,i.jsx)(e.div,{style:{width:"100%",height:"150px"}}),(0,i.jsx)(o.wY,{src:"https://github.com/Team-Grace/devgrace/assets/64779472/207743a7-b29f-4826-bc08-8df0d67e568b",alt:"img2",width:500,height:500}),(0,i.jsx)(e.div,{style:{width:"100%",height:"150px"}}),(0,i.jsx)(o.wY,{src:"https://github.com/Team-Grace/devgrace/assets/64779472/d1957ec8-fe87-406e-bfda-fb4ee505b152",alt:"img3",width:500,height:500})]})},d=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2},{value:"Example",id:"example",level:2},{value:"Note",id:"note",level:2}];function f(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"lazyimage",children:"LazyImage"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.a,{href:"https://modern-agile-team.github.io/modern-kit/docs/react/hooks/useIntersectionObserver",children:"useIntersectionObserver"})})," \ub97c \ud65c\uc6a9\ud574 ",(0,i.jsx)(t.code,{children:"Viewport"}),"\uc5d0 \ub178\ucd9c\ub420 \ub54c \ud560\ub2f9\ub41c \uc774\ubbf8\uc9c0\ub97c ",(0,i.jsx)(t.code,{children:"Lazy Loading"})," \ud558\ub294 \uc774\ubbf8\uc9c0 \ucef4\ud3ec\ub10c\ud2b8\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:["Intersection Observer Option\uc744 \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.(\ud558\ub2e8 ",(0,i.jsx)(t.code,{children:"Note"})," \ucc38\uace0)"]}),"\n",(0,i.jsxs)(t.p,{children:["\ub9cc\uc57d, \uc774\ubbf8\uc9c0 ",(0,i.jsx)(t.code,{children:"load"})," \uc911\uc5d0 ",(0,i.jsx)(t.code,{children:"\ud2b9\uc815 Fallback \ucef4\ud3ec\ub10c\ud2b8"}),"\ub97c \ub178\ucd9c\ud558\uace0 \uc2f6\ub2e4\uba74, \uc774\ub97c \uc120\uc5b8\uc801\uc73c\ub85c \ud65c\uc6a9\ud558\uae30 \uc704\ud574 ",(0,i.jsx)(t.code,{children:"LazyImage\ub97c \ud655\uc7a5"}),"\ud574\uc11c \ub9cc\ub4e0 ",(0,i.jsx)(t.strong,{children:(0,i.jsx)(t.a,{href:"https://modern-agile-team.github.io/modern-kit/docs/react/components/FallbackLazyImage",children:"FallbackLazyImage \ucef4\ud3ec\ub10c\ud2b8"})})," \uac00 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/components/LazyImage/index.tsx",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"interface IntersectionObserverInit {\n root?: Element | Document | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"interface LazyImageProps\n extends React.ComponentProps<'img'>,\n IntersectionObserverInit {\n src: string;\n}\n\nconst LazyImage: React.ForwardRefExoticComponent<\n Omit & React.RefAttributes\n>;\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { LazyImage } from '@modern-kit/react';\nimport img1 from '../assets/img1.png';\nimport img2 from '../assets/img2.png';\n\nconst Example = () => {\n return (\n \n {/* ... */}\n \n {/* ... */}\n \n {/* ... */}\n
\n );\n}; \n"})}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"example",children:"Example"}),"\n","\n",(0,i.jsx)(u,{}),"\n",(0,i.jsx)(t.h2,{id:"note",children:"Note"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:(0,i.jsx)(t.a,{href:"https://developer.mozilla.org/ko/docs/Web/API/IntersectionObserver",children:"Intersection Observer API"})}),"\n"]})]})}function b(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(f,{...e})}):f(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>et,Bg:()=>be,Cf:()=>xe,D9:()=>Ue,FS:()=>ot,GN:()=>Ee,Hk:()=>ge,KS:()=>nt,LN:()=>Ye,Mm:()=>ve,Nr:()=>oe,Pr:()=>De,S1:()=>se,VP:()=>ye,XI:()=>Oe,Xs:()=>Qe,Yz:()=>Ie,_:()=>Pe,a9:()=>ue,ac:()=>$e,cM:()=>at,df:()=>fe,fB:()=>tt,g4:()=>ke,iP:()=>st,ii:()=>Fe,jr:()=>Ce,my:()=>we,nA:()=>he,oM:()=>d,oz:()=>Be,qQ:()=>He,qx:()=>b,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>pe,yU:()=>Ve,yn:()=>je,z$:()=>Se});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function f(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const b=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>f()?(0,i.jsx)(i.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,m="object"==typeof self&&self&&self.Object===Object&&self,p=w||m||Function("return this")(),h=p.Symbol,g=Object.prototype,v=g.hasOwnProperty,y=g.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",j=h?h.toStringTag:void 0;var C="[object Symbol]",O=/\s/,I=/^\s+/;function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var z=NaN,N=/^[-+]0x[0-9a-f]+$/i,L=/^0b[01]+$/i,R=/^0o[0-7]+$/i,_=parseInt;function M(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:j&&j in Object(e)?function(e){var t=v.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return z;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(I,""):e}(e);var n=L.test(e);return n||R.test(e)?_(e.slice(2),n?2:8):N.test(e)?z:+e}var P=function(){return p.Date.now()},A="Expected a function",$=Math.max,F=Math.min;function q(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(A);function b(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function m(){var e=P();if(w(e))return p(e);s=setTimeout(m,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function p(e){return s=void 0,f&&i?b(e):(i=r=void 0,a)}function h(){var e=P(),n=w(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(m,t),u?b(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(m,t),b(c)}return void 0===s&&(s=setTimeout(m,t)),a}return t=M(t)||0,T(n)&&(u=!!n.leading,o=(d="maxWait"in n)?$(M(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:p(P())},h}var X="Expected a function";function Y(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const B={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},U=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function D(){return!V()}function W(e){return Y(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const G=e=>Y(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const H=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return H(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return H(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>q(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),f=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:f,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,f=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[b,w]=(0,r.useState)(!1),m=!b,p=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:m?0:1,transition:`opacity ${u}`},l)),[m,u,l]),g=(0,r.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:p,children:[m&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:g},f))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},fe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:f}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,f)},d,{children:e.children}))}));fe.displayName="InView";const be=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})};const we=(0,r.forwardRef)(((e,t)=>{var{as:n,children:a,callback:s}=e,c=o(e,["as","children","callback"]);const{ref:l}=function(e){const t=(0,r.useRef)(null),n=ne(e);return(0,r.useEffect)((()=>{const e=function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown",i=({target:e})=>{const i=t.current;i&&!i.contains(e)&&n(i)};return document.addEventListener(e,i),()=>{document.removeEventListener(e,i)}}),[n]),{ref:t}}(s);return(0,i.jsx)(n||"div",Object.assign({ref:ce(l,t)},c,{children:a}))})),me=D()?r.useLayoutEffect:r.useEffect;(0,r.createContext)({parentPortalElement:null});const pe=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(be,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},he=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ge=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function ve(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ye(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return Y(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return G(e);if(!("write"in window.navigator.clipboard))return G(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return G(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>Y(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield U(e,B[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return Y(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return Y(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function xe(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function ke({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),f=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),b=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:f,goToPrevStep:b,resetStep:w}}function Se(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=ke({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ee(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function je(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ee("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Ce(e,{preserveTitleOnUnmount:t=!1}={}){me((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Oe({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Ie(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Te="modern-kit-local-storage",ze="modern-kit-session-storage",Ne={localStorage:{key:Te,subscribe:e=>{window.addEventListener(Te,e)},unsubscribe:e=>{window.removeEventListener(Te,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Te))}},sessionStorage:{key:ze,subscribe:e=>{window.addEventListener(ze,e)},unsubscribe:e=>{window.removeEventListener(ze,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(ze))}}},Le=e=>Ne[e],Re=Le("localStorage"),_e=e=>window.localStorage.getItem(e),Me=e=>(Re.subscribe(e),()=>{Re.unsubscribe(e)});function Pe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Me,(()=>_e(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=_e(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Re.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Re.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Ae=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function $e(e,t){const[n,i]=(0,r.useState)(Ae(e,t));return(0,r.useEffect)((()=>{const t=window.matchMedia(e),n=e=>i(e.matches);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),[e]),n}function Fe(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)({screenX:void 0,screenY:void 0,clientX:void 0,clientY:void 0,pageX:void 0,pageY:void 0,elementRelativeX:void 0,elementRelativeY:void 0,elementPositionX:void 0,elementPositionY:void 0});return me((()=>{const t=t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t,l={},u={};if(e.current){const t=e.current.getBoundingClientRect(),n=o-t.left,i=a-t.top,r=t.left+window.scrollX,s=t.top+window.scrollY;l.elementRelativeX=n,l.elementRelativeY=i,u.elementPositionX=r,u.elementPositionY=s}n(Object.assign(Object.assign({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c},l),u))};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}}),[]),{ref:e,position:t}}const qe=()=>navigator.onLine,Xe=()=>!0;function Ye({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,qe,Xe)}}function Be(){return $e("(prefers-color-scheme: dark)")?"dark":"light"}function Ue(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function Ve(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function De({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return me((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const We=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ge=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+We(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+We(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+We(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+We(c.width,i.width,s)}};function He(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ge(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Je=Le("sessionStorage"),Ke=e=>window.sessionStorage.getItem(e),Ze=e=>(Je.subscribe(e),()=>{Je.unsubscribe(e)});function Qe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ze,(()=>Ke(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Ke(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Je.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Je.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function et(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},ke(e))}function tt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(X);return T(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),q(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function nt(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var it={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",f="vendor",b="version",w="architecture",m="console",p="mobile",h="tablet",g="smarttv",v="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",j="Browser",C="Chrome",O="Firefox",I="Google",T="Huawei",z="LG",N="Microsoft",L="Motorola",R="Opera",_="Samsung",M="Sharp",P="Sony",A="Xiaomi",$="Zebra",F="Facebook",q="Chromium OS",X="Mac OS",Y=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[b]=i,D.call(e,g,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[b]=i,D.call(e,g,y.os),x&&!e[u]&&v&&v.platform&&"Unknown"!=v.platform&&(e[u]=v.platform.replace(/chrome os/i,q).replace(/macos/i,X)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return g},this.setUA=function(e){return g=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(g),this};J.VERSION="1.0.38",J.BROWSER=Y([u,b,c]),J.CPU=Y([w]),J.DEVICE=Y([l,f,d,m,p,g,h,v,y]),J.ENGINE=J.OS=Y([u,b]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(it,it.exports);var rt=it.exports;function ot(){const[e,t]=(0,r.useState)(null);return me((()=>{const e=new rt.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function at({name:e="vh",enabledResize:t=!1}={}){me((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}function st(e={}){const{isDebounce:t=!1,wait:n=300}=e,[i,o]=(0,r.useState)({width:null,height:null}),a=(0,r.useCallback)((()=>{o({width:window.innerWidth,height:window.innerHeight})}),[]),s=ne(oe(a,n)),c=(0,r.useMemo)((()=>t?s:a),[a,t,s]);return me((()=>(a(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[a,c]),i}}}]);
\ No newline at end of file
diff --git a/assets/js/5d610355.ce5e9f7c.js b/assets/js/5d610355.ce5e9f7c.js
deleted file mode 100644
index 0af7cdc26..000000000
--- a/assets/js/5d610355.ce5e9f7c.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! For license information please see 5d610355.ce5e9f7c.js.LICENSE.txt */
-"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[1958],{4126:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>d,assets:()=>u,contentTitle:()=>c,default:()=>w,frontMatter:()=>s,metadata:()=>l,toc:()=>b});var i=n(1986),r=n(9937),o=n(384),a=n(7800);const s={},c="useInterval",l={id:"react/hooks/useInterval",title:"useInterval",description:"window.setInterval\uc744 \ud3b8\ub9ac\ud558\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useInterval.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useInterval",permalink:"/modern-kit/docs/react/hooks/useInterval",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useIntersectionObserver",permalink:"/modern-kit/docs/react/hooks/useIntersectionObserver"},next:{title:"useIsMounted",permalink:"/modern-kit/docs/react/hooks/useIsMounted"}},u={},d=()=>{const e={button:"button",div:"div",p:"p",...(0,r.a)()},[t,n]=(0,a.useState)(0),{set:s,clear:c,reset:l}=(0,o.Yz)((()=>n(t+1)),{delay:1e3,enabled:!1});return(0,i.jsxs)(e.div,{children:[(0,i.jsx)(e.p,{children:t}),(0,i.jsx)(e.button,{onClick:s,children:"set"}),(0,i.jsx)(e.button,{onClick:c,children:"clear"}),(0,i.jsx)(e.button,{onClick:l,children:"reset"})]})},b=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2}];function f(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"useinterval",children:"useInterval"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"window.setInterval"}),"\uc744 \ud3b8\ub9ac\ud558\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:["2\ubc88\uc9f8 \uc778\uc790 options\ub294 ",(0,i.jsx)(t.code,{children:"number"})," \ud639\uc740 ",(0,i.jsx)(t.code,{children:"{ delay: SetIntervalParameters[1]; enabled?: boolean }"})," \ud0c0\uc785\uc758 \uac1d\uccb4\ub97c \ub118\uaca8 \uc904 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:["options\uac00 ",(0,i.jsx)(t.code,{children:"number"})," \ud0c0\uc785\uc774\uba74 \ud574\ub2f9 \uac12\uc740 ",(0,i.jsx)(t.code,{children:"setInterval"}),"\uc758 ",(0,i.jsx)(t.code,{children:"delay"})," \uac12\uc774 \ub418\uba70, \uac1d\uccb4 \ud0c0\uc785\uc77c \uacbd\uc6b0 delay\uc640 \ub354\ubd88\uc5b4 ",(0,i.jsx)(t.code,{children:"setInterval\uc758 \ub3d9\uc791 \uc5ec\ubd80"}),"\ub97c \uacb0\uc815\ud558\ub294 ",(0,i.jsx)(t.code,{children:"enabled"})," \uc635\uc158\uc744 \ucd94\uac00\ub85c \ub2e4\ub8f0 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\ud83d\udca1 options\uac00 number \ud0c0\uc785\uc758 \uacbd\uc6b0 enabled\ub294 \uae30\ubcf8\uc801\uc73c\ub85c ",(0,i.jsx)(t.code,{children:"true"}),"\uc785\ub2c8\ub2e4."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["interval\uc744 \uc9c1\uc811 \ud578\ub4e4\ub9c1 \ud560 \uc218 \uc788\ub294 ",(0,i.jsx)(t.code,{children:"set"}),", ",(0,i.jsx)(t.code,{children:"reset"}),", ",(0,i.jsx)(t.code,{children:"clear"})," \ud568\uc218\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useInterval/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"interface IntervalOptions {\n delay: number;\n enabled?: boolean;\n}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"// \ud568\uc218 \uc624\ubc84\ub85c\ub529\nfunction useInterval(\n callback: () => void,\n options: number\n): {\n set: () => void;\n clear: () => void;\n reset: () => void;\n};\n\nfunction useInterval(\n callback: () => void,\n options: IntervalOptions\n): {\n set: () => void;\n clear: () => void;\n reset: () => void;\n};\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useInterval } from '@modern-kit/react';\n\nconst Example = () => {\n const [number, setNumber] = useState(0);\n\n const { set, clear, reset } = useInterval(\n () => setNumber(number + 1),\n { delay: 1000, enabled: false } // \uc790\ub3d9 \uc2e4\ud589 X\n );\n\n /*\n * useInterval(() => {\n * setNumber(number + 1);\n * }, 1000); // \uc790\ub3d9 \uc2e4\ud589\n */\n\n return (\n \n
{number}
\n
\n
\n
\n
\n );\n};\n"})}),"\n","\n",(0,i.jsx)(d,{})]})}function w(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(f,{...e})}):f(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>et,Bg:()=>fe,Cf:()=>xe,D9:()=>Ye,FS:()=>ot,GN:()=>je,Hk:()=>ve,KS:()=>nt,LN:()=>Be,Mm:()=>ge,Nr:()=>oe,Pr:()=>De,S1:()=>se,VP:()=>ye,XI:()=>Oe,Xs:()=>Qe,Yz:()=>Ie,_:()=>Le,a9:()=>ue,ac:()=>Ae,cM:()=>at,df:()=>be,fB:()=>tt,g4:()=>ke,iP:()=>st,ii:()=>Fe,jr:()=>Ce,my:()=>we,nA:()=>he,oM:()=>d,oz:()=>Ue,qQ:()=>Ge,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>me,yU:()=>Ve,yn:()=>Ee,z$:()=>Se});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function b(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>b()?(0,i.jsx)(i.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",j="[object Undefined]",E=h?h.toStringTag:void 0;var C="[object Symbol]",O=/\s/,I=/^\s+/;function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=NaN,_=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,M=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?j:S:E&&E in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==C}(e))return N;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(I,""):e}(e);var n=R.test(e);return n||M.test(e)?P(e.slice(2),n?2:8):_.test(e)?N:+e}var L=function(){return m.Date.now()},$="Expected a function",A=Math.max,F=Math.min;function q(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError($);function f(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=L();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&i?f(e):(i=r=void 0,a)}function h(){var e=L(),n=w(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),f(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,T(n)&&(u=!!n.leading,o=(d="maxWait"in n)?A(z(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m(L())},h}var X="Expected a function";function B(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const U={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},Y=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function D(){return!V()}function W(e){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>B(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>q(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,w]=(0,r.useState)(!1),p=!f,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},be=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})};const we=(0,r.forwardRef)(((e,t)=>{var{as:n,children:a,callback:s}=e,c=o(e,["as","children","callback"]);const{ref:l}=function(e){const t=(0,r.useRef)(null),n=ne(e);return(0,r.useEffect)((()=>{const e=function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown",i=({target:e})=>{const i=t.current;i&&!i.contains(e)&&n(i)};return document.addEventListener(e,i),()=>{document.removeEventListener(e,i)}}),[n]),{ref:t}}(s);return(0,i.jsx)(n||"div",Object.assign({ref:ce(l,t)},c,{children:a}))})),pe=D()?r.useLayoutEffect:r.useEffect;(0,r.createContext)({parentPortalElement:null});const me=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},he=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ve=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function ge(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ye(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>B(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield Y(e,U[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function xe(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function ke({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),b=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:w}}function Se(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=ke({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function je(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Ee(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=je("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Ce(e,{preserveTitleOnUnmount:t=!1}={}){pe((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Oe({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Ie(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Te="modern-kit-local-storage",Ne="modern-kit-session-storage",_e={localStorage:{key:Te,subscribe:e=>{window.addEventListener(Te,e)},unsubscribe:e=>{window.removeEventListener(Te,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Te))}},sessionStorage:{key:Ne,subscribe:e=>{window.addEventListener(Ne,e)},unsubscribe:e=>{window.removeEventListener(Ne,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Ne))}}},Re=e=>_e[e],Me=Re("localStorage"),Pe=e=>window.localStorage.getItem(e),ze=e=>(Me.subscribe(e),()=>{Me.unsubscribe(e)});function Le(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(ze,(()=>Pe(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Pe(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),Me.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),Me.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const $e=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function Ae(e,t){const[n,i]=(0,r.useState)($e(e,t));return(0,r.useEffect)((()=>{const t=window.matchMedia(e),n=e=>i(e.matches);return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}),[e]),n}function Fe(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)({screenX:void 0,screenY:void 0,clientX:void 0,clientY:void 0,pageX:void 0,pageY:void 0,elementRelativeX:void 0,elementRelativeY:void 0,elementPositionX:void 0,elementPositionY:void 0});return pe((()=>{const t=t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t,l={},u={};if(e.current){const t=e.current.getBoundingClientRect(),n=o-t.left,i=a-t.top,r=t.left+window.scrollX,s=t.top+window.scrollY;l.elementRelativeX=n,l.elementRelativeY=i,u.elementPositionX=r,u.elementPositionY=s}n(Object.assign(Object.assign({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c},l),u))};return document.addEventListener("mousemove",t),()=>{document.removeEventListener("mousemove",t)}}),[]),{ref:e,position:t}}const qe=()=>navigator.onLine,Xe=()=>!0;function Be({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,qe,Xe)}}function Ue(){return Ae("(prefers-color-scheme: dark)")?"dark":"light"}function Ye(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function Ve(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function De({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return pe((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const We=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,He=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+We(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+We(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+We(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+We(c.width,i.width,s)}};function Ge(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=He(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Je=Re("sessionStorage"),Ke=e=>window.sessionStorage.getItem(e),Ze=e=>(Je.subscribe(e),()=>{Je.unsubscribe(e)});function Qe(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ze,(()=>Ke(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=Ke(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Je.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Je.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function et(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},ke(e))}function tt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(X);return T(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),q(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function nt(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var it={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",w="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",j="BlackBerry",E="Browser",C="Chrome",O="Firefox",I="Google",T="Huawei",N="LG",_="Microsoft",R="Motorola",M="Opera",P="Samsung",z="Sharp",L="Sony",$="Xiaomi",A="Zebra",F="Facebook",q="Chromium OS",X="Mac OS",B=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[f]=i,D.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[f]=i,D.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,q).replace(/macos/i,X)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=B([u,f,c]),J.CPU=B([w]),J.DEVICE=B([l,b,d,p,m,v,h,g,y]),J.ENGINE=J.OS=B([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(it,it.exports);var rt=it.exports;function ot(){const[e,t]=(0,r.useState)(null);return pe((()=>{const e=new rt.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function at({name:e="vh",enabledResize:t=!1}={}){pe((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}function st(e={}){const{isDebounce:t=!1,wait:n=300}=e,[i,o]=(0,r.useState)({width:null,height:null}),a=(0,r.useCallback)((()=>{o({width:window.innerWidth,height:window.innerHeight})}),[]),s=ne(oe(a,n)),c=(0,r.useMemo)((()=>t?s:a),[a,t,s]);return pe((()=>(a(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[a,c]),i}}}]);
\ No newline at end of file
diff --git a/assets/js/5d610355.e6858672.js b/assets/js/5d610355.e6858672.js
new file mode 100644
index 000000000..33d872696
--- /dev/null
+++ b/assets/js/5d610355.e6858672.js
@@ -0,0 +1,2 @@
+/*! For license information please see 5d610355.e6858672.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[1958],{4126:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>d,assets:()=>u,contentTitle:()=>c,default:()=>w,frontMatter:()=>s,metadata:()=>l,toc:()=>b});var i=n(1986),r=n(9937),o=n(384),a=n(7800);const s={},c="useInterval",l={id:"react/hooks/useInterval",title:"useInterval",description:"window.setInterval\uc744 \ud3b8\ub9ac\ud558\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useInterval.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useInterval",permalink:"/modern-kit/docs/react/hooks/useInterval",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useIntersectionObserver",permalink:"/modern-kit/docs/react/hooks/useIntersectionObserver"},next:{title:"useIsMounted",permalink:"/modern-kit/docs/react/hooks/useIsMounted"}},u={},d=()=>{const e={button:"button",div:"div",p:"p",...(0,r.a)()},[t,n]=(0,a.useState)(0),{set:s,clear:c,reset:l}=(0,o.Yz)((()=>n(t+1)),{delay:1e3,enabled:!1});return(0,i.jsxs)(e.div,{children:[(0,i.jsx)(e.p,{children:t}),(0,i.jsx)(e.button,{onClick:s,children:"set"}),(0,i.jsx)(e.button,{onClick:c,children:"clear"}),(0,i.jsx)(e.button,{onClick:l,children:"reset"})]})},b=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2}];function f(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"useinterval",children:"useInterval"})}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.code,{children:"window.setInterval"}),"\uc744 \ud3b8\ub9ac\ud558\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:["2\ubc88\uc9f8 \uc778\uc790 options\ub294 ",(0,i.jsx)(t.code,{children:"number"})," \ud639\uc740 ",(0,i.jsx)(t.code,{children:"{ delay: SetIntervalParameters[1]; enabled?: boolean }"})," \ud0c0\uc785\uc758 \uac1d\uccb4\ub97c \ub118\uaca8 \uc904 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.p,{children:["options\uac00 ",(0,i.jsx)(t.code,{children:"number"})," \ud0c0\uc785\uc774\uba74 \ud574\ub2f9 \uac12\uc740 ",(0,i.jsx)(t.code,{children:"setInterval"}),"\uc758 ",(0,i.jsx)(t.code,{children:"delay"})," \uac12\uc774 \ub418\uba70, \uac1d\uccb4 \ud0c0\uc785\uc77c \uacbd\uc6b0 delay\uc640 \ub354\ubd88\uc5b4 ",(0,i.jsx)(t.code,{children:"setInterval\uc758 \ub3d9\uc791 \uc5ec\ubd80"}),"\ub97c \uacb0\uc815\ud558\ub294 ",(0,i.jsx)(t.code,{children:"enabled"})," \uc635\uc158\uc744 \ucd94\uac00\ub85c \ub2e4\ub8f0 \uc218 \uc788\uc2b5\ub2c8\ub2e4."]}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsxs)(t.li,{children:["\ud83d\udca1 options\uac00 number \ud0c0\uc785\uc758 \uacbd\uc6b0 enabled\ub294 \uae30\ubcf8\uc801\uc73c\ub85c ",(0,i.jsx)(t.code,{children:"true"}),"\uc785\ub2c8\ub2e4."]}),"\n"]}),"\n",(0,i.jsxs)(t.p,{children:["interval\uc744 \uc9c1\uc811 \ud578\ub4e4\ub9c1 \ud560 \uc218 \uc788\ub294 ",(0,i.jsx)(t.code,{children:"set"}),", ",(0,i.jsx)(t.code,{children:"reset"}),", ",(0,i.jsx)(t.code,{children:"clear"})," \ud568\uc218\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4."]}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useInterval/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"interface IntervalOptions {\n delay: number;\n enabled?: boolean;\n}\n"})}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"// \ud568\uc218 \uc624\ubc84\ub85c\ub529\nfunction useInterval(\n callback: () => void,\n options: number\n): {\n set: () => void;\n clear: () => void;\n reset: () => void;\n};\n\nfunction useInterval(\n callback: () => void,\n options: IntervalOptions\n): {\n set: () => void;\n clear: () => void;\n reset: () => void;\n};\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useInterval } from '@modern-kit/react';\n\nconst Example = () => {\n const [number, setNumber] = useState(0);\n\n const { set, clear, reset } = useInterval(\n () => setNumber(number + 1),\n { delay: 1000, enabled: false } // \uc790\ub3d9 \uc2e4\ud589 X\n );\n\n /*\n * useInterval(() => {\n * setNumber(number + 1);\n * }, 1000); // \uc790\ub3d9 \uc2e4\ud589\n */\n\n return (\n \n
{number}
\n
\n
\n
\n
\n );\n};\n"})}),"\n","\n",(0,i.jsx)(d,{})]})}function w(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(f,{...e})}):f(e)}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>fe,Cf:()=>Se,D9:()=>We,FS:()=>ct,GN:()=>Ee,Hk:()=>ye,KS:()=>ot,LN:()=>Ve,Mm:()=>xe,Nr:()=>oe,OR:()=>pe,Pr:()=>Ge,S1:()=>se,VP:()=>ke,XI:()=>Te,Xs:()=>nt,Yz:()=>Ne,_:()=>Le,a9:()=>ue,ac:()=>qe,cM:()=>lt,df:()=>be,fB:()=>rt,g4:()=>je,iP:()=>dt,ii:()=>Be,jr:()=>Ie,my:()=>he,nA:()=>ge,oM:()=>d,oz:()=>De,qQ:()=>Ze,qx:()=>f,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ve,yU:()=>He,yn:()=>Oe,z$:()=>Ce});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function b(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const f=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>b()?(0,i.jsx)(i.Fragment,{children:t}):e;var w="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=w||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",j="[object Undefined]",C=h?h.toStringTag:void 0;var E="[object Symbol]",O=/\s/,I=/^\s+/;function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=NaN,_=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,M=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?j:S:C&&C in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==E}(e))return N;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(I,""):e}(e);var n=R.test(e);return n||M.test(e)?P(e.slice(2),n?2:8):_.test(e)?N:+e}var $=function(){return m.Date.now()},A="Expected a function",L=Math.max,F=Math.min;function q(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,b=!0;if("function"!=typeof e)throw new TypeError(A);function f(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function w(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=$();if(w(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,b&&i?f(e):(i=r=void 0,a)}function h(){var e=$(),n=w(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?f(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),f(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,T(n)&&(u=!!n.leading,o=(d="maxWait"in n)?L(z(n.maxWait)||0,t):o,b="trailing"in n?!!n.trailing:b),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m($())},h}var X="Expected a function";function B(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const U={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},Y=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function V(){return"undefined"==typeof window}function D(){return!V()}function W(e){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const H=e=>B(void 0,0,void 0,(function*(){const t=yield fetch(e);return W(yield t.text())}));const G=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!J(e[o],t[o],n))return!1;return!0},J=(e,t,n)=>{if(e===t)return!0;if(Q(e)&&Q(t)&&isNaN(e)&&isNaN(t))return!0;if(Z(e)&&Z(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return G(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!J(r,t.get(i),n))return!1;return!0}return G(e,t,n)};function K(e,t){return J(e,t,new WeakMap)}function Z(e){return"function"==typeof e}function Q(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=K){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>q(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{Z(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),b=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:b,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,b=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[f,w]=(0,r.useState)(!1),p=!f,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),w(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},b))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},be=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:b}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,b)},d,{children:e.children}))}));be.displayName="InView";const fe=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},we=D()?r.useLayoutEffect:r.useEffect;function pe(e,t,n,i={}){const r=re(i),o=ne(n);we((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(V())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return pe(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ve=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(fe,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ge=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield W(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return H(e);if(!("write"in window.navigator.clipboard))return H(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return H(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>B(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield Y(e,U[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function je({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=Z(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),b=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),f=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),w=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:b,goToPrevStep:f,resetStep:w}}function Ce(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=je({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function Ee(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Oe(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=Ee("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Ie(e,{preserveTitleOnUnmount:t=!1}={}){we((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Te({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Ne(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const _e="modern-kit-local-storage",Re="modern-kit-session-storage",Me={localStorage:{key:_e,subscribe:e=>{window.addEventListener(_e,e)},unsubscribe:e=>{window.removeEventListener(_e,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(_e))}},sessionStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}}},Pe=e=>Me[e],ze=Pe("localStorage"),$e=e=>window.localStorage.getItem(e),Ae=e=>(ze.subscribe(e),()=>{ze.unsubscribe(e)});function Le(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(Ae,(()=>$e(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=$e(t),r=n?te(n):i,o=Z(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),ze.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),ze.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Fe=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function qe(e,t){const[n,i]=(0,r.useState)(Fe(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return pe(window.matchMedia(e),"change",o),n}const Xe={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function Be(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(Xe),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,b=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,b=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:b})}),[]);return pe(window.document,"mousemove",i),{ref:e,position:t}}const Ue=()=>navigator.onLine,Ye=()=>!0;function Ve({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Ue,Ye)}}function De(){return qe("(prefers-color-scheme: dark)")?"dark":"light"}function We(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function He(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function Ge({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return we((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Je=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ke=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Je(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Je(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Je(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Je(c.width,i.width,s)}};function Ze(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ke(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Qe=Pe("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Qe.subscribe(e),()=>{Qe.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(Z(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=Z(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Qe.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=Z(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=Z(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},je(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(X);return T(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),q(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return Q(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",b="vendor",f="version",w="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",j="BlackBerry",C="Browser",E="Chrome",O="Firefox",I="Google",T="Huawei",N="LG",_="Microsoft",R="Motorola",M="Opera",P="Samsung",z="Sharp",$="Sony",A="Xiaomi",L="Zebra",F="Facebook",q="Chromium OS",X="Mac OS",B=function(e){for(var t={},n=0;n0?2===c.length?typeof c[1]==r?this[c[0]]=c[1].call(this,u):this[c[0]]=c[1]:3===c.length?typeof c[1]!==r||c[1].exec&&c[1].test?this[c[0]]=u?u.replace(c[1],c[2]):i:this[c[0]]=u?c[1].call(this,u,c[2]):i:4===c.length&&(this[c[0]]=u?c[3].call(this,u.replace(c[1],c[2])):i):this[c]=u||i;d+=2}},W=function(e,t){for(var n in t)if(typeof t[n]===a&&t[n].length>0){for(var r=0;r2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[u]=i,e[f]=i,D.call(e,v,y.engine),e},this.getOS=function(){var e={};return e[u]=i,e[f]=i,D.call(e,v,y.os),x&&!e[u]&&g&&g.platform&&"Unknown"!=g.platform&&(e[u]=g.platform.replace(/chrome os/i,q).replace(/macos/i,X)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return v},this.setUA=function(e){return v=typeof e===s&&e.length>500?V(e,500):e,this},this.setUA(v),this};J.VERSION="1.0.38",J.BROWSER=B([u,f,c]),J.CPU=B([w]),J.DEVICE=B([l,b,d,p,m,v,h,g,y]),J.ENGINE=J.OS=B([u,f]),e.exports&&(t=e.exports=J),t.UAParser=J;var K=typeof n!==o&&(n.jQuery||n.Zepto);if(K&&!K.ua){var Z=new J;K.ua=Z.getResult(),K.ua.get=function(){return Z.getUA()},K.ua.set=function(e){Z.setUA(e);var t=Z.getResult();for(var n in t)K.ua[n]=t[n]}}}("object"==typeof window?window:s)}(at,at.exports);var st=at.exports;function ct(){const[e,t]=(0,r.useState)(null);return we((()=>{const e=new st.UAParser(window.navigator.userAgent);t(e.getResult())}),[]),e}function lt({name:e="vh",enabledResize:t=!1}={}){we((()=>{const n=()=>{const t=.01*window.innerHeight;document.documentElement.style.setProperty(`--${e}`,`${t}px`)};return n(),t&&window.addEventListener("resize",n),()=>{t&&window.removeEventListener("resize",n)}}),[e,t])}const ut={width:null,height:null};function dt({debounceWait:e}={}){const[t,n]=(0,r.useState)((()=>V()?ut:{width:window.innerWidth,height:window.innerHeight})),i=oe(n,e),o=(0,r.useCallback)((()=>{(e?i:n)({width:window.innerWidth,height:window.innerHeight})}),[e,i]);return pe(window,"resize",o),t}}}]);
\ No newline at end of file
diff --git a/assets/js/61a35b61.ad78099b.js.LICENSE.txt b/assets/js/5d610355.e6858672.js.LICENSE.txt
similarity index 100%
rename from assets/js/61a35b61.ad78099b.js.LICENSE.txt
rename to assets/js/5d610355.e6858672.js.LICENSE.txt
diff --git a/assets/js/61a35b61.82ede79f.js b/assets/js/61a35b61.82ede79f.js
new file mode 100644
index 000000000..e4128f903
--- /dev/null
+++ b/assets/js/61a35b61.82ede79f.js
@@ -0,0 +1,2 @@
+/*! For license information please see 61a35b61.82ede79f.js.LICENSE.txt */
+"use strict";(self.webpackChunk_modern_kit_docs=self.webpackChunk_modern_kit_docs||[]).push([[9034],{1982:(e,t,n)=>{n.r(t),n.d(t,{Example:()=>d,assets:()=>u,contentTitle:()=>c,default:()=>b,frontMatter:()=>s,metadata:()=>l,toc:()=>f});var i=n(1986),r=n(9937),o=n(384),a=n(5549);const s={},c="useMediaQuery",l={id:"react/hooks/useMediaQuery",title:"useMediaQuery",description:"\ubbf8\ub514\uc5b4 \ucffc\ub9ac \ubb38\uc790\uc5f4\uc758 \ubd84\uc11d \uacb0\uacfc\ub97c \uc27d\uac8c \ud655\uc778 \ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4.",source:"@site/docs/react/hooks/useMediaQuery.mdx",sourceDirName:"react/hooks",slug:"/react/hooks/useMediaQuery",permalink:"/modern-kit/docs/react/hooks/useMediaQuery",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{},sidebar:"tutorialSidebar",previous:{title:"useLocalStorage",permalink:"/modern-kit/docs/react/hooks/useLocalStorage"},next:{title:"useMergeRefs",permalink:"/modern-kit/docs/react/hooks/useMergeRefs"}},u={},d=()=>{const e={div:"div",p:"p",...(0,r.a)()},t=(0,o.ac)("(min-width: 768px)");return(0,i.jsxs)(e.div,{children:[(0,i.jsx)(e.p,{children:"\ube0c\ub77c\uc6b0\uc800 \ub108\ube44\ub97c \uc218\uc815\ud574\ubcf4\uc138\uc694!"}),(0,i.jsx)(e.p,{children:t?"viewport \ub108\ube44\uac00 768px \uc774\uc0c1\uc785\ub2c8\ub2e4.":"viewport \ub108\ube44\uac00 768px \ubbf8\ub9cc\uc785\ub2c8\ub2e4."})]})},f=[{value:"Code",id:"code",level:2},{value:"Interface",id:"interface",level:2},{value:"Usage",id:"usage",level:2}];function w(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.header,{children:(0,i.jsx)(t.h1,{id:"usemediaquery",children:"useMediaQuery"})}),"\n",(0,i.jsx)(t.p,{children:"\ubbf8\ub514\uc5b4 \ucffc\ub9ac \ubb38\uc790\uc5f4\uc758 \ubd84\uc11d \uacb0\uacfc\ub97c \uc27d\uac8c \ud655\uc778 \ud560 \uc218 \uc788\ub294 \ucee4\uc2a4\ud140 \ud6c5\uc785\ub2c8\ub2e4."}),"\n",(0,i.jsx)("br",{}),"\n",(0,i.jsx)(t.h2,{id:"code",children:"Code"}),"\n",(0,i.jsx)(t.p,{children:(0,i.jsx)(t.a,{href:"https://github.com/modern-agile-team/modern-kit/blob/main/packages/react/src/hooks/useMediaQuery/index.ts",children:"\ud83d\udd17 \uc2e4\uc81c \uad6c\ud604 \ucf54\ub4dc \ud655\uc778"})}),"\n",(0,i.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-ts",metastring:'title="typescript"',children:"function useMediaQuery(mediaQueryString: string, defaultValue?: boolean): boolean\n"})}),"\n",(0,i.jsx)(t.h2,{id:"usage",children:"Usage"}),"\n",(0,i.jsx)(t.pre,{children:(0,i.jsx)(t.code,{className:"language-tsx",metastring:'title="typescript"',children:"import { useMediaQuery } from '@modern-kit/react';\n\nconst Example = () => {\n const isMatch = useMediaQuery('(min-width: 768px)');\n\n return (\n \n
\n {isMatch\n ? 'viewport \ub108\ube44\uac00 768px \uc774\uc0c1\uc785\ub2c8\ub2e4.'\n : 'viewport \ub108\ube44\uac00 768px \ubbf8\ub9cc\uc785\ub2c8\ub2e4.'}\n
\n
\n );\n};\n"})}),"\n","\n",(0,i.jsx)(a.Z,{children:()=>(0,i.jsx)(d,{})})]})}function b(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(w,{...e})}):w(e)}},5549:(e,t,n)=>{n.d(t,{Z:()=>o});n(7800);var i=n(4798),r=n(1986);function o(e){let{children:t,fallback:n}=e;return(0,i.Z)()?(0,r.jsx)(r.Fragment,{children:t?.()}):n??null}},9937:(e,t,n)=>{n.d(t,{Z:()=>s,a:()=>a});var i=n(7800);const r={},o=i.createContext(r);function a(e){const t=i.useContext(o);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function s(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),i.createElement(o.Provider,{value:t},e.children)}},384:(e,t,n)=>{n.d(t,{A:()=>it,B1:()=>me,Bg:()=>we,Cf:()=>Se,D9:()=>Qe,FS:()=>ct,GN:()=>je,Hk:()=>ye,KS:()=>ot,LN:()=>Ye,Mm:()=>xe,Nr:()=>oe,OR:()=>pe,Pr:()=>He,S1:()=>se,VP:()=>ke,XI:()=>Me,Xs:()=>nt,Yz:()=>Ne,_:()=>Ae,a9:()=>ue,ac:()=>qe,cM:()=>lt,df:()=>fe,fB:()=>rt,g4:()=>Ee,iP:()=>dt,ii:()=>Be,jr:()=>Te,my:()=>he,nA:()=>ge,oM:()=>d,oz:()=>De,qQ:()=>Je,qx:()=>w,uM:()=>ae,wY:()=>le,xX:()=>de,xu:()=>ve,yU:()=>We,yn:()=>Oe,z$:()=>Ce});var i=n(1986),r=n(7800);n(4041);function o(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r*{height:100%;left:0;position:absolute;top:0;width:100%}");const d=(0,r.forwardRef)(((e,t)=>{var{ratio:n,children:a,className:s,style:c}=e,l=o(e,["ratio","children","className","style"]);const d=(0,r.useMemo)((()=>Object.assign({paddingTop:`calc(100% * (1 / ${n}))`},c)),[n,c]);if(r.Children.count(a)>1)throw new Error("AspectRatio component expects exactly one child element.");return(0,i.jsx)("div",Object.assign({ref:t,className:u("AspectRatio-module_wrapper__xn3Vo",s),style:d},l,{children:r.Children.only(a)}))}));function f(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!0)}),[]),e}d.displayName="AspectRatio";const w=({fallback:e=(0,i.jsx)(i.Fragment,{}),children:t})=>f()?(0,i.jsx)(i.Fragment,{children:t}):e;var b="object"==typeof global&&global&&global.Object===Object&&global,p="object"==typeof self&&self&&self.Object===Object&&self,m=b||p||Function("return this")(),h=m.Symbol,v=Object.prototype,g=v.hasOwnProperty,y=v.toString,x=h?h.toStringTag:void 0,k=Object.prototype.toString,S="[object Null]",E="[object Undefined]",C=h?h.toStringTag:void 0;var j="[object Symbol]",O=/\s/,T=/^\s+/;function M(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=NaN,R=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,I=/^0o[0-7]+$/i,P=parseInt;function z(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&function(e){return null==e?void 0===e?E:S:C&&C in Object(e)?function(e){var t=g.call(e,x),n=e[x];try{e[x]=void 0;var i=!0}catch(e){}var r=y.call(e);return i&&(t?e[x]=n:delete e[x]),r}(e):function(e){return k.call(e)}(e)}(e)==j}(e))return N;if(M(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=M(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&O.test(e.charAt(t)););return t}(e)+1).replace(T,""):e}(e);var n=_.test(e);return n||I.test(e)?P(e.slice(2),n?2:8):R.test(e)?N:+e}var $=function(){return m.Date.now()},L="Expected a function",A=Math.max,F=Math.min;function q(e,t,n){var i,r,o,a,s,c,l=0,u=!1,d=!1,f=!0;if("function"!=typeof e)throw new TypeError(L);function w(t){var n=i,o=r;return i=r=void 0,l=t,a=e.apply(o,n)}function b(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-l>=o}function p(){var e=$();if(b(e))return m(e);s=setTimeout(p,function(e){var n=t-(e-c);return d?F(n,o-(e-l)):n}(e))}function m(e){return s=void 0,f&&i?w(e):(i=r=void 0,a)}function h(){var e=$(),n=b(e);if(i=arguments,r=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(p,t),u?w(e):a}(c);if(d)return clearTimeout(s),s=setTimeout(p,t),w(c)}return void 0===s&&(s=setTimeout(p,t)),a}return t=z(t)||0,M(n)&&(u=!!n.leading,o=(d="maxWait"in n)?A(z(n.maxWait)||0,t):o,f="trailing"in n?!!n.trailing:f),h.cancel=function(){void 0!==s&&clearTimeout(s),l=0,i=c=r=s=void 0},h.flush=function(){return void 0===s?a:m($())},h}var X="Expected a function";function B(e,t,n,i){return new(n||(n=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function a(e){try{s(i.throw(e))}catch(e){r(e)}}function s(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(e){e(i)}))).then(o,a)}s((i=i.apply(e,[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const U={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"},V=(e,t)=>new Promise(((n,i)=>{e.toBlob((e=>{e?n(e):i(new Error(`Failed to create blob with format ${t}`))}),t)}));function Y(){return"undefined"==typeof window}function D(){return!Y()}function Q(e){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return"clipboard"in window.navigator?(yield navigator.clipboard.writeText(e),e):function(e){const t=document.createElement("textarea");t.value=e,t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy"),e}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}finally{document.body.removeChild(t)}}(e)}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}const W=e=>B(void 0,0,void 0,(function*(){const t=yield fetch(e);return Q(yield t.text())}));const H=(e,t,n)=>{const i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(const o of i)if(!r.includes(o)||!Z(e[o],t[o],n))return!1;return!0},Z=(e,t,n)=>{if(e===t)return!0;if(K(e)&&K(t)&&isNaN(e)&&isNaN(t))return!0;if(J(e)&&J(t))return e.toString()===t.toString();if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if(n.has(e)&&n.get(e)===t)return!0;if(n.set(e,t),e.constructor!==t.constructor)return!1;if(e instanceof Set){if(e.size!==t.size)return!1;const i=[...e],r=[...t];return H(i,r,n)}if(e instanceof Map){if(e.size!==t.size)return!1;for(const[i,r]of e)if(!t.has(i)||!Z(r,t.get(i),n))return!1;return!0}return H(e,t,n)};function G(e,t){return Z(e,t,new WeakMap)}function J(e){return"function"==typeof e}function K(e){return"number"==typeof e}function ee(){}function te(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(e){throw new Error(`Failed to parse data: ${e}`)}}function ne(e=ee){const t=(0,r.useRef)(e);return t.current=e,(0,r.useCallback)(((...e)=>t.current(...e)),[])}function ie(e){const t=ne(e);(0,r.useEffect)((()=>()=>t()),[t])}function re(e,t=G){const[n,i]=(0,r.useState)(e),o=ne(t);return(0,r.useEffect)((()=>{o(n,e)||i(e)}),[o,n,e]),n}function oe(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>q(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}const ae=({children:e,capture:t,wait:n,options:i})=>{const o=r.Children.only(e),a=oe(((...e)=>{const n=null==o?void 0:o.props;if(n)return"function"==typeof n[t]?n[t](...e):void 0}),n,i);return(0,r.cloneElement)(o,{[t]:a})};function se({onIntersectStart:e=ee,onIntersectEnd:t=ee,enabled:n=!0,calledOnce:i=!1,root:o=null,threshold:a=0,rootMargin:s="0px 0px 0px 0px"}){const c=(0,r.useRef)(0),l=(0,r.useRef)(!1),u=(0,r.useRef)(null),d=ne((([r],o)=>{if(!n||!r)return;const a=r.target;r.isIntersecting?(l.current=!0,c.current+=1,e(r)):l.current&&(l.current=!1,c.current+=1,t(r)),i&&c.current>1&&o.unobserve(a)}));return{ref:e=>{u.current&&u.current.disconnect(),u.current=new IntersectionObserver(d,{threshold:a,root:o,rootMargin:s}),e&&u.current.observe(e)}}}function ce(...e){return(0,r.useCallback)(((...e)=>t=>e.forEach((e=>{J(e)?e(t):null!=e&&(e.current=t)})))(...e),e)}const le=(0,r.forwardRef)(((e,t)=>{var{src:n,threshold:r,root:a,rootMargin:s,alt:c,className:l}=e,u=o(e,["src","threshold","root","rootMargin","alt","className"]);const{ref:d}=se({onIntersectStart:e=>{e.target.src=n},calledOnce:!0,threshold:r,root:a,rootMargin:s}),f=l?`lazy-image ${l}`:"lazy-image";return(0,i.jsx)("img",Object.assign({className:f,ref:ce(t,d),alt:c},u))}));le.displayName="LazyImage";const ue=(0,r.forwardRef)(((e,t)=>{var{width:n,height:a,fallback:s,className:c,style:l,duration:u="0.2s",onLoad:d}=e,f=o(e,["width","height","fallback","className","style","duration","onLoad"]);const[w,b]=(0,r.useState)(!1),p=!w,m=(0,r.useMemo)((()=>({position:"relative",width:n,height:a})),[n,a]),h=(0,r.useMemo)((()=>Object.assign({position:"absolute",top:0,left:0,opacity:p?0:1,transition:`opacity ${u}`},l)),[p,u,l]),v=(0,r.useCallback)((e=>{d&&d(e),b(!0)}),[d]);return(0,i.jsxs)("div",{className:c?`lazy-image-wrapper ${c}`:"lazy-image-wrapper",style:m,children:[p&&s,(0,i.jsx)(le,Object.assign({ref:t,width:n,height:a,style:h,onLoad:v},f))]})}));ue.displayName="FallbackLazyImage";const de=({condition:e,trueComponent:t,falseComponent:n})=>{const o=(e=>"function"==typeof e?e():e)(e);return(0,i.jsx)(r.Fragment,{children:o?t:n})},fe=(0,r.forwardRef)(((e,t)=>{const{onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u}=e,d=o(e,["onIntersectStart","onIntersectEnd","calledOnce","threshold","root","rootMargin","enabled"]),{ref:f}=se({onIntersectStart:n,onIntersectEnd:r,calledOnce:a,threshold:s,root:c,rootMargin:l,enabled:u});return(0,i.jsx)("div",Object.assign({ref:ce(t,f)},d,{children:e.children}))}));fe.displayName="InView";const we=({items:e=[],itemKey:t,renderItem:n})=>{const o=(0,r.useCallback)(((e,n)=>{return function(e){return!function(e){return Object(e)!==e}(e)}(i=e)&&i.constructor===Object?(null==e?void 0:e[t])||n:`${n}_${e}`;var i}),[t]);return(0,i.jsx)(i.Fragment,{children:e.map(((e,t)=>(0,i.jsx)(r.Fragment,{children:n(e,t)},o(e,t))))})},be=D()?r.useLayoutEffect:r.useEffect;function pe(e,t,n,i={}){const r=re(i),o=ne(n);be((()=>{if(e)return e.addEventListener(t,o,r),()=>{e.removeEventListener(t,o,r)}}),[t,e,r,o])}function me(e){const t=(0,r.useRef)(null),n=(0,r.useMemo)((()=>function(){if(Y())return!1;const e=window.navigator.userAgent;return/Android|webOS|iPhone|iPad|iPod|Windows Phone|BlackBerry|IEMobile|Opera Mini/i.test(e)}()?"touchstart":"mousedown"),[]),i=(0,r.useCallback)((({target:n})=>{const i=t.current;i&&!i.contains(n)&&e(i)}),[e]);return pe(window.document,n,i),t}const he=(0,r.forwardRef)(((e,t)=>{var{as:n,children:r,callback:a}=e,s=o(e,["as","children","callback"]);const c=me(a);return(0,i.jsx)(n||"div",Object.assign({ref:ce(c,t)},s,{children:r}))}));(0,r.createContext)({parentPortalElement:null});const ve=({itemKey:e,items:t=[],separator:n,renderItem:o,separatorInterval:a=1,includeLastSeparator:s=!1})=>{const c=(0,r.useCallback)((e=>e===t.length-1?s:(e+1)%a==0),[s,a,t.length]);return(0,i.jsx)(we,{items:t,itemKey:e,renderItem:(e,t)=>(0,i.jsxs)(i.Fragment,{children:[o(e,t),c(t)&&n]})})},ge=({children:e,condition:t,fallback:n=null})=>{const o=(e=>"function"==typeof e?e():e)(t);return(0,i.jsx)(r.Fragment,o?{children:e}:{children:n})},ye=({condition:e,cases:t,defaultCaseComponent:n=null})=>{var o;return(0,i.jsx)(r.Fragment,null==e?{children:n}:{children:null!==(o=t[e])&&void 0!==o?o:n})};function xe(){const[e,t]=(0,r.useState)(!1),n=(0,r.useRef)(!1);return{isLoading:e,blockMultipleClick:e=>a(this,void 0,void 0,(function*(){n.current||(n.current=!0,t(!0),yield e(),n.current=!1,t(!1))}))}}function ke(){const[e,t]=(0,r.useState)(null),[n,i]=(0,r.useState)(null);return{copiedData:e,readData:n,copyText:(0,r.useCallback)((e=>a(this,void 0,void 0,(function*(){try{const n=yield Q(e);return t(n),!0}catch(e){return t(null),!1}}))),[]),copyImage:(0,r.useCallback)(((e,n)=>a(this,void 0,void 0,(function*(){var i;const r=null!==(i=null==n?void 0:n.toText)&&void 0!==i&&i;try{const n=yield function(e,t){var n;return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{if(!("clipboard"in window.navigator))return W(e);if(!("write"in window.navigator.clipboard))return W(e);if(null!==(n=null==t?void 0:t.toText)&&void 0!==n&&n)return W(e);const i=yield function(e,t="png"){return new Promise(((n,i)=>{const r=new Image;r.onload=()=>B(this,0,void 0,(function*(){const e=document.createElement("canvas");e.width=r.width,e.height=r.height;try{const i=e.getContext("2d");if(!i)throw new Error("Failed to get 2d context");i.drawImage(r,0,0);const o=yield V(e,U[t]);n(o)}catch(e){console.error(`Failed to load image. message: ${e.mesaage}`),i(e)}})),r.onerror=()=>{i(new Error("Failed to load image"))},r.src=e}))}(e,"png");return yield navigator.clipboard.write([new ClipboardItem({[i.type]:i})]),i}catch(e){throw console.error(`Failed to copy to clipboard. message: ${e.message}`),e}}))}(e,{toText:r});return t(n),!0}catch(e){return t(null),!1}}))),[]),readText:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.readText()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[]),readContents:(0,r.useCallback)((()=>a(this,void 0,void 0,(function*(){try{const e=yield function(){return B(this,0,void 0,(function*(){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{return yield navigator.clipboard.read()}catch(e){throw console.error(`Failed to read clipboard. message: ${e.message}`),e}}))}();return i(e),!0}catch(e){return i(null),!1}}))),[])}}function Se(e=0){const[t,n]=(0,r.useState)(e),i=(0,r.useCallback)((()=>{n((e=>e+1))}),[]),o=(0,r.useCallback)((()=>{n((e=>e-1))}),[]),a=(0,r.useCallback)((()=>{n(e)}),[e]);return{counter:t,setCounter:n,increment:i,decrement:o,reset:a}}function Ee({maxStep:e,initialStep:t=0,infinite:n=!1}){const[i,o]=(0,r.useState)(t),a=(0,r.useMemo)((()=>ii>0),[i]),c=(0,r.useCallback)(((t,n)=>{const r=J(t)?t(i):t;if(r>=0&&r<=e)return n&&n({prev:i,next:r}),void o(t);throw new Error("Step not valid")}),[i,e]),l=(0,r.useCallback)(((t,n)=>{const r="nextStep"===t;return n?r?0:e:r?i+1:i-1}),[e,i]),u=(0,r.useCallback)(((e,t)=>{if(!n)return;const r=l(e,!0);t&&t({prev:i,next:r}),o(r)}),[n,i,l]),d=(0,r.useCallback)(((e,t)=>{const n=l(e,!1);t&&t({prev:i,next:n}),o(n)}),[i,l]),f=(0,r.useCallback)((e=>{a?d("nextStep",e):u("nextStep",e)}),[a,d,u]),w=(0,r.useCallback)((e=>{s?d("prevStep",e):u("prevStep",e)}),[s,d,u]),b=(0,r.useCallback)((e=>{e&&e({prev:i,next:t}),o(t)}),[i,t]);return{currentStep:i,hasNextStep:a,hasPrevStep:s,setStep:c,goToNextStep:f,goToPrevStep:w,resetStep:b}}function Ce(e,t=0){const{currentStep:n,goToNextStep:i,goToPrevStep:o,setStep:a}=Ee({maxStep:e.length-1,initialStep:t,infinite:!0}),s=(0,r.useCallback)(((e,t)=>{a(e,t)}),[a]);return{currentItem:e[n],nextIndex:i,prevIndex:o,setIndex:s}}function je(e,t,n={}){const[i,o]=(0,r.useState)(e);return[i,oe(o,t,n)]}function Oe(e,t={}){const[n,i]=(0,r.useState)(""),[o,a]=je("",e,t);return{value:n,debouncedValue:o,onChange:(0,r.useCallback)((e=>{const{value:t}=e.target;i(t),a(t)}),[a]),onReset:(0,r.useCallback)((()=>{i(""),a("")}),[a])}}function Te(e,{preserveTitleOnUnmount:t=!1}={}){be((()=>{const n=document.title;return document.title=e,()=>{t||(document.title=n)}}),[e,t])}function Me({onEnter:e=ee,onLeave:t=ee}={}){const[n,i]=(0,r.useState)(!1),o=(0,r.useRef)(null),a=ne((t=>{i(!0),e(t)})),s=ne((e=>{i(!1),t(e)}));return(0,r.useEffect)((()=>{const e=o.current;if(e)return e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",s),()=>{e.removeEventListener("mouseenter",a),e.removeEventListener("mouseleave",s)}}),[a,s]),{ref:o,isHovered:n}}function Ne(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return K(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=window.setInterval(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearInterval(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[l,c,s,a]),{set:c,reset:u,clear:l}}const Re="modern-kit-local-storage",_e="modern-kit-session-storage",Ie={localStorage:{key:Re,subscribe:e=>{window.addEventListener(Re,e)},unsubscribe:e=>{window.removeEventListener(Re,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(Re))}},sessionStorage:{key:_e,subscribe:e=>{window.addEventListener(_e,e)},unsubscribe:e=>{window.removeEventListener(_e,e)},dispatchEvent:()=>{window.dispatchEvent(new StorageEvent(_e))}}},Pe=e=>Ie[e],ze=Pe("localStorage"),$e=e=>window.localStorage.getItem(e),Le=e=>(ze.subscribe(e),()=>{ze.unsubscribe(e)});function Ae(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(J(n)?n():n),o=(0,r.useSyncExternalStore)(Le,(()=>$e(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=$e(t),r=n?te(n):i,o=J(e)?e(r):e;window.localStorage.setItem(t,JSON.stringify(o)),ze.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in localStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.localStorage.removeItem(t),ze.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from localStorage: ${e}`)}}),[t])}}const Fe=(e,t)=>D()?window.matchMedia(e).matches:null!=t&&t;function qe(e,t){const[n,i]=(0,r.useState)(Fe(e,t)),o=(0,r.useCallback)((e=>i(e.matches)),[]);return pe(window.matchMedia(e),"change",o),n}const Xe={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,elementRelativeX:null,elementRelativeY:null,elementPositionX:null,elementPositionY:null};function Be(){const e=(0,r.useRef)(null),[t,n]=(0,r.useState)(Xe),i=(0,r.useCallback)((t=>{const{screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c}=t;let l=null,u=null,d=null,f=null;if(e.current){const t=e.current.getBoundingClientRect();l=o-t.left,u=a-t.top,d=t.left+window.scrollX,f=t.top+window.scrollY}n({screenX:i,screenY:r,clientX:o,clientY:a,pageX:s,pageY:c,elementRelativeX:l,elementRelativeY:u,elementPositionX:d,elementPositionY:f})}),[]);return pe(window.document,"mousemove",i),{ref:e,position:t}}const Ue=()=>navigator.onLine,Ve=()=>!0;function Ye({onlineCallback:e=ee,offlineCallback:t=ee}={}){const n=ne((n=>((e,t,n)=>{const i=n=>(t(n),e()),r=t=>(n(t),e());return window.addEventListener("online",i),window.addEventListener("offline",r),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",r)}})(n,e,t)));return{isOnline:(0,r.useSyncExternalStore)(n,Ue,Ve)}}function De(){return qe("(prefers-color-scheme: dark)")?"dark":"light"}function Qe(e){const t=(0,r.useRef)(e);return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current}function We(e){const[t,n]=(0,r.useState)({bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0}),i=(0,r.useRef)(null),o=ne(e),a=(0,r.useCallback)((([e])=>{e&&(o(e),n(e.contentRect))}),[o]);return(0,r.useEffect)((()=>{const e=i.current;if(!e)return;const t=new ResizeObserver(a);return t.observe(e),()=>{t.unobserve(e)}}),[a]),{ref:i,contentRect:t}}function He({autoLock:e=!0}={}){const t=(0,r.useRef)(null),n=(0,r.useRef)(null),i=(0,r.useCallback)((()=>{const e=t.current;n.current=window.getComputedStyle(e).overflow,e.style.overflow="hidden"}),[]),o=(0,r.useCallback)((()=>{n.current&&(t.current.style.overflow=n.current)}),[]);return be((()=>(t.current||(t.current=document.body),e&&i(),()=>o())),[e,i,o]),{ref:t,lock:i,unlock:o}}const Ze=(e,t,n)=>"start"===n?0:"center"===n?-e/2+t/2:-e+t,Ge=(e,t,n)=>{const i=t.getBoundingClientRect(),{offsetX:r=0,offsetY:o=0,alignY:a="start",alignX:s="start"}=n;if(e===window)return{top:i.top+window.scrollY+o+Ze(window.innerHeight,i.height,a),left:i.left+window.scrollX+r+Ze(window.innerWidth,i.width,s)};const c=e.getBoundingClientRect();return{top:i.top-c.top+e.scrollTop+o+Ze(c.height,i.height,a),left:i.left-c.left+e.scrollLeft+r+Ze(c.width,i.width,s)}};function Je(){const e=(0,r.useRef)(null),t=(0,r.useCallback)(((t={})=>{if(!e.current)return;const{left:n=0,top:i=0,behavior:r="auto"}=t;e.current.scrollTo({left:n,top:i,behavior:r})}),[]),n=(0,r.useCallback)(((t,n={})=>{if(!t||!e.current)return;const i=e.current,{behavior:r="auto"}=n,{left:o,top:a}=Ge(i,t,n);i.scrollTo({top:a,left:o,behavior:r})}),[]);return(0,r.useEffect)((()=>{e.current||(e.current=window)}),[]),{containerRef:e,scrollToPosition:t,scrollToElement:n}}const Ke=Pe("sessionStorage"),et=e=>window.sessionStorage.getItem(e),tt=e=>(Ke.subscribe(e),()=>{Ke.unsubscribe(e)});function nt(e){const{key:t}=e,n="initialValue"in e?e.initialValue:null,i=re(J(n)?n():n),o=(0,r.useSyncExternalStore)(tt,(()=>et(t)),(()=>(e=>JSON.stringify(e))(i)));return{state:(0,r.useMemo)((()=>o?te(o):i),[o,i]),setState:(0,r.useCallback)((e=>{try{const n=et(t),r=n?te(n):i,o=J(e)?e(r):e;window.sessionStorage.setItem(t,JSON.stringify(o)),Ke.dispatchEvent()}catch(e){throw new Error(`Failed to store data for key "${t}" in sessionStorage: ${e}`)}}),[t,i]),removeState:(0,r.useCallback)((()=>{try{window.sessionStorage.removeItem(t),Ke.dispatchEvent()}catch(e){throw new Error(`Failed to remove key "${t}" from sessionStorage: ${e}`)}}),[t])}}function it(e){const t="initialState"in e?e.initialState:null,n=re(e.storageOptions),i=re(t),[o,a]=(0,r.useState)(i),s=(0,r.useCallback)((e=>{a((t=>{const i=J(e)?e(t):e;if(n){const{type:e,key:t}=n;!function(e,t,n){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{const i=window[e],r=J(n)?n():n;i.setItem(t,JSON.stringify(r))}catch(n){throw new Error(`Failed to store data for key "${t}" in ${e}: ${n}`)}}(e,t,i)}return i}))}),[n]),c=(0,r.useCallback)((()=>{if(n){const{type:e,key:t}=n;!function(e,t){if(!D())throw new Error("Cannot be executed unless it is a client environment.");try{window[e].removeItem(t)}catch(n){throw new Error(`Failed to remove key "${t}" from ${e}: ${n}`)}}(e,t)}a(null)}),[n]);return Object.assign({state:o,setState:s,clearState:c},Ee(e))}function rt(e,t,n={}){const i=ne(e),o=re(n),a=(0,r.useMemo)((()=>function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError(X);return M(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),q(e,t,{leading:i,maxWait:t,trailing:r})}(i,t,o)),[i,t,o]);return ie((()=>a.cancel())),a}function ot(e,t){const n=(0,r.useRef)(),i=ne(e),o=re(t),{delay:a,enabled:s}=(e=>{var t;return K(e)?{delay:e,enabled:!0}:{delay:e.delay,enabled:null===(t=null==e?void 0:e.enabled)||void 0===t||t}})(o),c=(0,r.useCallback)((()=>{n.current=setTimeout(i,a)}),[i,a]),l=(0,r.useCallback)((()=>{n.current&&(clearTimeout(n.current),n.current=null)}),[]),u=(0,r.useCallback)((()=>{l(),c()}),[l,c]);return(0,r.useEffect)((()=>{if(!(a<0)&&s)return c(),()=>l()}),[c,l,a,s]),{set:c,reset:u,clear:l}}var at={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",a="object",s="string",c="major",l="model",u="name",d="type",f="vendor",w="version",b="architecture",p="console",m="mobile",h="tablet",v="smarttv",g="wearable",y="embedded",x="Amazon",k="Apple",S="ASUS",E="BlackBerry",C="Browser",j="Chrome",O="Firefox",T="Google",M="Huawei",N="LG",R="Microsoft",_="Motorola",I="Opera",P="Samsung",z="Sharp",$="Sony",L="Xiaomi",A="Zebra",F="Facebook",q="Chromium OS",X="Mac OS",B=function(e){for(var t={},n=0;n