@siberiacancode/reactuse 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/dist/cjs/{_rollupPluginBabelHelpers-Cva0m6Ep.js → _rollupPluginBabelHelpers-BvBejAnn.js} +3 -3
  2. package/dist/cjs/_rollupPluginBabelHelpers-BvBejAnn.js.map +1 -0
  3. package/dist/cjs/hooks/index.js +2 -2
  4. package/dist/cjs/hooks/useBattery/useBattery.js +2 -2
  5. package/dist/cjs/hooks/useBoolean/useBoolean.js +2 -2
  6. package/dist/cjs/hooks/useClickOutside/useClickOutside.js +2 -2
  7. package/dist/cjs/hooks/useClickOutside/useClickOutside.js.map +1 -1
  8. package/dist/cjs/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  9. package/dist/cjs/hooks/useCounter/useCounter.js +2 -2
  10. package/dist/cjs/hooks/useCounter/useCounter.js.map +1 -1
  11. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  12. package/dist/cjs/hooks/useDebouncedValue/useDebouncedValue.js.map +1 -1
  13. package/dist/cjs/hooks/useDefault/useDefault.js +3 -0
  14. package/dist/cjs/hooks/useDefault/useDefault.js.map +1 -0
  15. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +3 -0
  16. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js.map +1 -0
  17. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  18. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js.map +1 -1
  19. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +2 -2
  20. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js.map +1 -1
  21. package/dist/cjs/hooks/useEvent/useEvent.js +3 -0
  22. package/dist/cjs/hooks/useEvent/useEvent.js.map +1 -0
  23. package/dist/cjs/hooks/useEventListener/useEventListener.js +1 -1
  24. package/dist/cjs/hooks/useEventListener/useEventListener.js.map +1 -1
  25. package/dist/cjs/hooks/useFavicon/useFavicon.js +3 -0
  26. package/dist/cjs/hooks/useFavicon/useFavicon.js.map +1 -0
  27. package/dist/cjs/hooks/useHash/useHash.js +3 -0
  28. package/dist/cjs/hooks/useHash/useHash.js.map +1 -0
  29. package/dist/cjs/hooks/useHotkeys/useHotkeys.js +3 -0
  30. package/dist/cjs/hooks/useHotkeys/useHotkeys.js.map +1 -0
  31. package/dist/cjs/hooks/useHover/useHover.js +2 -2
  32. package/dist/cjs/hooks/useHover/useHover.js.map +1 -1
  33. package/dist/cjs/hooks/useIdle/useIdle.js +3 -0
  34. package/dist/cjs/hooks/useIdle/useIdle.js.map +1 -0
  35. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +3 -0
  36. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -0
  37. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +3 -0
  38. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js.map +1 -0
  39. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  40. package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
  41. package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  42. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
  43. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
  44. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
  45. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js.map +1 -1
  46. package/dist/cjs/hooks/useLogger/useLogger.js +3 -0
  47. package/dist/cjs/hooks/useLogger/useLogger.js.map +1 -0
  48. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +3 -0
  49. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js.map +1 -0
  50. package/dist/cjs/hooks/useMount/useMount.js +1 -1
  51. package/dist/cjs/hooks/useMount/useMount.js.map +1 -1
  52. package/dist/cjs/hooks/useMutationObserver.js +1 -1
  53. package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
  54. package/dist/cjs/hooks/useNetwork/useNetwork.js.map +1 -1
  55. package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
  56. package/dist/cjs/hooks/useOnline/useOnline.js.map +1 -1
  57. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +3 -0
  58. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js.map +1 -0
  59. package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
  60. package/dist/cjs/hooks/useOrientation/useOrientation.js.map +1 -1
  61. package/dist/cjs/hooks/usePrevious/usePrevious.js +3 -0
  62. package/dist/cjs/hooks/usePrevious/usePrevious.js.map +1 -0
  63. package/dist/cjs/hooks/useQueue/useQueue.js +3 -0
  64. package/dist/cjs/hooks/useQueue/useQueue.js.map +1 -0
  65. package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
  66. package/dist/cjs/hooks/useRerender/useRerender.js +3 -0
  67. package/dist/cjs/hooks/useRerender/useRerender.js.map +1 -0
  68. package/dist/cjs/hooks/useScript/useScript.js +3 -0
  69. package/dist/cjs/hooks/useScript/useScript.js.map +1 -0
  70. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
  71. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js.map +1 -1
  72. package/dist/cjs/hooks/useSet/useSet.js +3 -0
  73. package/dist/cjs/hooks/useSet/useSet.js.map +1 -0
  74. package/dist/cjs/hooks/useStep/useStep.js +2 -2
  75. package/dist/cjs/hooks/useStep/useStep.js.map +1 -1
  76. package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
  77. package/dist/cjs/hooks/useStorage/useStorage.js.map +1 -1
  78. package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
  79. package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
  80. package/dist/cjs/hooks/useToggle/useToggle.js.map +1 -1
  81. package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
  82. package/dist/cjs/hooks/useUnmount/useUnmount.js.map +1 -1
  83. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +1 -1
  84. package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
  85. package/dist/cjs/index.js +2 -2
  86. package/dist/cjs/utils/helpers/debounce.js +1 -1
  87. package/dist/cjs/utils/helpers/index.js +2 -2
  88. package/dist/cjs/utils/helpers/isClient.js +1 -1
  89. package/dist/cjs/utils/helpers/isShallowEqual.js +1 -1
  90. package/dist/cjs/utils/helpers/throttle.js +3 -0
  91. package/dist/cjs/utils/helpers/throttle.js.map +1 -0
  92. package/dist/esm/{_rollupPluginBabelHelpers-8YyPIzj_.js → _rollupPluginBabelHelpers-D5_r4iwW.js} +3 -3
  93. package/dist/esm/_rollupPluginBabelHelpers-D5_r4iwW.js.map +1 -0
  94. package/dist/esm/hooks/index.js +2 -2
  95. package/dist/esm/hooks/useBattery/useBattery.js +2 -2
  96. package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
  97. package/dist/esm/hooks/useClickOutside/useClickOutside.js +2 -2
  98. package/dist/esm/hooks/useClickOutside/useClickOutside.js.map +1 -1
  99. package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  100. package/dist/esm/hooks/useCounter/useCounter.js +2 -2
  101. package/dist/esm/hooks/useCounter/useCounter.js.map +1 -1
  102. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js +2 -2
  103. package/dist/esm/hooks/useDebouncedValue/useDebouncedValue.js.map +1 -1
  104. package/dist/esm/hooks/useDefault/useDefault.js +3 -0
  105. package/dist/esm/hooks/useDefault/useDefault.js.map +1 -0
  106. package/dist/esm/hooks/{useNonInitialEffect/useNonInitialEffect.js → useDidUpdate/useDidUpdate.js} +3 -3
  107. package/dist/esm/hooks/useDidUpdate/useDidUpdate.js.map +1 -0
  108. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  109. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js.map +1 -1
  110. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +2 -2
  111. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js.map +1 -1
  112. package/dist/esm/hooks/useEvent/useEvent.js +3 -0
  113. package/dist/esm/hooks/useEvent/useEvent.js.map +1 -0
  114. package/dist/esm/hooks/useEventListener/useEventListener.js +1 -1
  115. package/dist/esm/hooks/useEventListener/useEventListener.js.map +1 -1
  116. package/dist/esm/hooks/useFavicon/useFavicon.js +3 -0
  117. package/dist/esm/hooks/useFavicon/useFavicon.js.map +1 -0
  118. package/dist/esm/hooks/useHash/useHash.js +3 -0
  119. package/dist/esm/hooks/useHash/useHash.js.map +1 -0
  120. package/dist/esm/hooks/useHotkeys/useHotkeys.js +3 -0
  121. package/dist/esm/hooks/useHotkeys/useHotkeys.js.map +1 -0
  122. package/dist/esm/hooks/useHover/useHover.js +2 -2
  123. package/dist/esm/hooks/useHover/useHover.js.map +1 -1
  124. package/dist/esm/hooks/useIdle/useIdle.js +3 -0
  125. package/dist/esm/hooks/useIdle/useIdle.js.map +1 -0
  126. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +3 -0
  127. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js.map +1 -0
  128. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +3 -0
  129. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js.map +1 -0
  130. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  131. package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
  132. package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  133. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
  134. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js.map +1 -1
  135. package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
  136. package/dist/esm/hooks/useLocalStorage/useLocalStorage.js.map +1 -1
  137. package/dist/esm/hooks/useLogger/useLogger.js +3 -0
  138. package/dist/esm/hooks/useLogger/useLogger.js.map +1 -0
  139. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +3 -0
  140. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js.map +1 -0
  141. package/dist/esm/hooks/useMount/useMount.js +1 -1
  142. package/dist/esm/hooks/useMount/useMount.js.map +1 -1
  143. package/dist/esm/hooks/useMutationObserver.js +1 -1
  144. package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
  145. package/dist/esm/hooks/useNetwork/useNetwork.js.map +1 -1
  146. package/dist/esm/hooks/useOnline/useOnline.js +1 -1
  147. package/dist/esm/hooks/useOnline/useOnline.js.map +1 -1
  148. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +3 -0
  149. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js.map +1 -0
  150. package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
  151. package/dist/esm/hooks/useOrientation/useOrientation.js.map +1 -1
  152. package/dist/esm/hooks/usePrevious/usePrevious.js +3 -0
  153. package/dist/esm/hooks/usePrevious/usePrevious.js.map +1 -0
  154. package/dist/esm/hooks/useQueue/useQueue.js +3 -0
  155. package/dist/esm/hooks/useQueue/useQueue.js.map +1 -0
  156. package/dist/esm/hooks/useRenderCount/useRenderCount.js +1 -1
  157. package/dist/esm/hooks/useRerender/useRerender.js +3 -0
  158. package/dist/esm/hooks/useRerender/useRerender.js.map +1 -0
  159. package/dist/esm/hooks/useScript/useScript.js +3 -0
  160. package/dist/esm/hooks/useScript/useScript.js.map +1 -0
  161. package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
  162. package/dist/esm/hooks/useSessionStorage/useSessionStorage.js.map +1 -1
  163. package/dist/esm/hooks/useSet/useSet.js +3 -0
  164. package/dist/esm/hooks/useSet/useSet.js.map +1 -0
  165. package/dist/esm/hooks/useStep/useStep.js +2 -2
  166. package/dist/esm/hooks/useStep/useStep.js.map +1 -1
  167. package/dist/esm/hooks/useStorage/useStorage.js +2 -2
  168. package/dist/esm/hooks/useStorage/useStorage.js.map +1 -1
  169. package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
  170. package/dist/esm/hooks/useToggle/useToggle.js +2 -2
  171. package/dist/esm/hooks/useToggle/useToggle.js.map +1 -1
  172. package/dist/esm/hooks/useUnmount/useUnmount.js +1 -1
  173. package/dist/esm/hooks/useUnmount/useUnmount.js.map +1 -1
  174. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +1 -1
  175. package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
  176. package/dist/esm/index.js +2 -2
  177. package/dist/esm/utils/helpers/debounce.js +1 -1
  178. package/dist/esm/utils/helpers/index.js +2 -2
  179. package/dist/esm/utils/helpers/isClient.js +1 -1
  180. package/dist/esm/utils/helpers/isShallowEqual.js +1 -1
  181. package/dist/esm/utils/helpers/throttle.js +3 -0
  182. package/dist/esm/utils/helpers/throttle.js.map +1 -0
  183. package/dist/index.d.ts +347 -33
  184. package/package.json +2 -1
  185. package/dist/cjs/_rollupPluginBabelHelpers-Cva0m6Ep.js.map +0 -1
  186. package/dist/cjs/hooks/useNonInitialEffect/useNonInitialEffect.js +0 -3
  187. package/dist/cjs/hooks/useNonInitialEffect/useNonInitialEffect.js.map +0 -1
  188. package/dist/esm/_rollupPluginBabelHelpers-8YyPIzj_.js.map +0 -1
  189. package/dist/esm/hooks/useNonInitialEffect/useNonInitialEffect.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import n from"react";var i=function(){if("undefined"==typeof window)return"undetermined";var n=window.navigator.userAgent;return/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i.test(n)?"macos":/(iPhone)|(iPad)|(iPod)/i.test(n)?"ios":/(Win32)|(Win64)|(Windows)|(WinCE)/i.test(n)?"windows":/Android/i.test(n)?"android":/Linux/i.test(n)?"linux":"undetermined"},e=function(){return n.useRef(i()).current};export{i as getOperatingSystem,e as useOperatingSystem};
3
+ //# sourceMappingURL=useOperatingSystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOperatingSystem.js","sources":["../../../../src/hooks/useOperatingSystem/useOperatingSystem.ts"],"sourcesContent":["import React from 'react';\n\nexport type OperatingSystem = 'undetermined' | 'macos' | 'ios' | 'windows' | 'android' | 'linux';\n\nexport const getOperatingSystem = (): OperatingSystem => {\n if (typeof window === 'undefined') return 'undetermined';\n\n const { userAgent } = window.navigator;\n\n if (/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i.test(userAgent)) return 'macos';\n if (/(iPhone)|(iPad)|(iPod)/i.test(userAgent)) return 'ios';\n if (/(Win32)|(Win64)|(Windows)|(WinCE)/i.test(userAgent)) return 'windows';\n if (/Android/i.test(userAgent)) return 'android';\n if (/Linux/i.test(userAgent)) return 'linux';\n\n return 'undetermined';\n};\n\n/**\n * @name useOperatingSystem\n * @description - Hook that returns the operating system of the current browser\n *\n * @returns {OperatingSystem} The operating system\n *\n * @example\n * const operatingSystem = useOperatingSystem();\n */\nexport const useOperatingSystem = () => {\n const osOperatingSystemRef = React.useRef<OperatingSystem>(getOperatingSystem());\n return osOperatingSystemRef.current;\n};\n"],"names":["getOperatingSystem","window","userAgent","navigator","test","useOperatingSystem","React","useRef","current"],"mappings":";yBAIaA,EAAqB,WAChC,GAAsB,oBAAXC,OAAwB,MAAO,eAE1C,IAAQC,EAAcD,OAAOE,UAArBD,UAER,MAAI,4CAA4CE,KAAKF,GAAmB,QACpE,0BAA0BE,KAAKF,GAAmB,MAClD,qCAAqCE,KAAKF,GAAmB,UAC7D,WAAWE,KAAKF,GAAmB,UACnC,SAASE,KAAKF,GAAmB,QAE9B,cACT,EAWaG,EAAqB,WAEhC,OAD6BC,EAAMC,OAAwBP,KAC/BQ,OAC9B"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-8YyPIzj_.js";import{useState as n}from"react";import{useIsomorphicLayoutEffect as r}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){var o=n({angle:0,type:"landscape-primary"}),t=e(o,2),i=t[0],a=t[1];return r((function(){var e,n=function(){var e=window.screen.orientation,n=e.angle,r=e.type;a({angle:n,type:r})};return null===(e=window.screen.orientation)||void 0===e||e.addEventListener("change",n),function(){var e;return null===(e=window.screen.orientation)||void 0===e?void 0:e.removeEventListener("change",n)}}),[]),i};export{o as useOrientation};
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import{useState as n}from"react";import{useIsomorphicLayoutEffect as r}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){var o=n({angle:0,type:"landscape-primary"}),t=e(o,2),i=t[0],a=t[1];return r((function(){var e,n=function(){var e=window.screen.orientation,n=e.angle,r=e.type;a({angle:n,type:r})};return null===(e=window.screen.orientation)||void 0===e||e.addEventListener("change",n),function(){var e;return null===(e=window.screen.orientation)||void 0===e?void 0:e.removeEventListener("change",n)}}),[]),i};export{o as useOrientation};
3
3
  //# sourceMappingURL=useOrientation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOrientation.js","sources":["../../../../src/hooks/useOrientation/useOrientation.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';\n\nexport const useOrientation = () => {\n const [orientation, setOrientation] = useState<{\n angle: number;\n type: OrientationType;\n }>({ angle: 0, type: 'landscape-primary' });\n\n useIsomorphicLayoutEffect(() => {\n const onChange = () => {\n const { angle, type } = window.screen.orientation;\n setOrientation({\n angle,\n type\n });\n };\n\n window.screen.orientation?.addEventListener('change', onChange);\n return () => window.screen.orientation?.removeEventListener('change', onChange);\n }, []);\n\n return orientation;\n};\n"],"names":["useOrientation","_useState","useState","angle","type","_useState2","_slicedToArray","orientation","setOrientation","useIsomorphicLayoutEffect","_window$screen$orient2","onChange","_window$screen$orient","window","screen","addEventListener","_window$screen$orient3","removeEventListener"],"mappings":";mPAIaA,EAAiB,WAC5B,IAAAC,EAAsCC,EAGnC,CAAEC,MAAO,EAAGC,KAAM,sBAAsBC,EAAAC,EAAAL,EAAA,GAHpCM,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAkBlC,OAbAI,GAA0B,WAAM,IAAAC,EACxBC,EAAW,WACf,IAAAC,EAAwBC,OAAOC,OAAOP,YAA9BJ,EAAKS,EAALT,MAAOC,EAAIQ,EAAJR,KACfI,EAAe,CACbL,MAAAA,EACAC,KAAAA,KAKJ,OADyB,QAAzBM,EAAAG,OAAOC,OAAOP,mBAAW,IAAAG,GAAzBA,EAA2BK,iBAAiB,SAAUJ,GAC/C,WAAA,IAAAK,EAAA,OAA+B,QAA/BA,EAAMH,OAAOC,OAAOP,mBAAW,IAAAS,OAAA,EAAzBA,EAA2BC,oBAAoB,SAAUN,EAAS,CAChF,GAAE,IAEIJ,CACT"}
1
+ {"version":3,"file":"useOrientation.js","sources":["../../../../src/hooks/useOrientation/useOrientation.ts"],"sourcesContent":["import { useState } from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';\n\n/** The use orientation return type */\nexport interface UseOrientationReturn {\n /** The current screen orientation angle */\n angle: number;\n /** The screen orientation type */\n type: OrientationType;\n}\n\n/**\n * @name useOrientation\n * @description - Hook that returns the current screen orientation\n *\n * @returns {UseOrientationReturn} An object containing the current screen orientation\n *\n * @example\n * const { angle, type } = useOrientation();\n */\nexport const useOrientation = (): UseOrientationReturn => {\n const [orientation, setOrientation] = useState<{\n angle: number;\n type: OrientationType;\n }>({ angle: 0, type: 'landscape-primary' });\n\n useIsomorphicLayoutEffect(() => {\n const onChange = () => {\n const { angle, type } = window.screen.orientation;\n setOrientation({\n angle,\n type\n });\n };\n\n window.screen.orientation?.addEventListener('change', onChange);\n return () => window.screen.orientation?.removeEventListener('change', onChange);\n }, []);\n\n return orientation;\n};\n"],"names":["useOrientation","_useState","useState","angle","type","_useState2","_slicedToArray","orientation","setOrientation","useIsomorphicLayoutEffect","_window$screen$orient2","onChange","_window$screen$orient","window","screen","addEventListener","_window$screen$orient3","removeEventListener"],"mappings":";mPAqBaA,EAAiB,WAC5B,IAAAC,EAAsCC,EAGnC,CAAEC,MAAO,EAAGC,KAAM,sBAAsBC,EAAAC,EAAAL,EAAA,GAHpCM,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAkBlC,OAbAI,GAA0B,WAAM,IAAAC,EACxBC,EAAW,WACf,IAAAC,EAAwBC,OAAOC,OAAOP,YAA9BJ,EAAKS,EAALT,MAAOC,EAAIQ,EAAJR,KACfI,EAAe,CACbL,MAAAA,EACAC,KAAAA,KAKJ,OADyB,QAAzBM,EAAAG,OAAOC,OAAOP,mBAAW,IAAAG,GAAzBA,EAA2BK,iBAAiB,SAAUJ,GAC/C,WAAA,IAAAK,EAAA,OAA+B,QAA/BA,EAAMH,OAAOC,OAAOP,mBAAW,IAAAS,OAAA,EAAzBA,EAA2BC,oBAAoB,SAAUN,EAAS,CAChF,GAAE,IAEIJ,CACT"}
@@ -0,0 +1,3 @@
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import r from"react";var e=function(e){var t=r.useRef();return r.useEffect((function(){t.current=e})),t.current};export{e as usePrevious};
3
+ //# sourceMappingURL=usePrevious.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePrevious.js","sources":["../../../../src/hooks/usePrevious/usePrevious.ts"],"sourcesContent":["import React from 'react';\n\n/**\n * @name usePrevious\n * @description - Hook that returns the previous value\n *\n * @template Value The type of the value\n * @param {Value} value The value to get the previous value\n * @returns {Value} The previous value\n *\n * @example\n * const prevValue = usePrevious(value);\n */\nexport const usePrevious = <Value>(value: Value) => {\n const ref = React.useRef<Value>();\n\n React.useEffect(() => {\n ref.current = value;\n });\n\n return ref.current;\n};\n"],"names":["usePrevious","value","ref","React","useRef","useEffect","current"],"mappings":";yBAaaA,EAAc,SAAQC,GACjC,IAAMC,EAAMC,EAAMC,SAMlB,OAJAD,EAAME,WAAU,WACdH,EAAII,QAAUL,CAChB,IAEOC,EAAII,OACb"}
@@ -0,0 +1,3 @@
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{_ as r,c as t,d as e}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import n from"react";var u=function(){var u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=n.useState(u),a=r(o,2),i=a[0],c=a[1];return{add:function(r){return c((function(e){return[].concat(t(e),[r])}))},remove:function(){var r;return c((function(t){var n=e(t),u=n[0],o=n.slice(1);return r=u,o})),r},clear:function(){return c([])},first:i[0],last:i[i.length-1],size:i.length,queue:i}};export{u as useQueue};
3
+ //# sourceMappingURL=useQueue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useQueue.js","sources":["../../../../src/hooks/useQueue/useQueue.ts"],"sourcesContent":["import React from 'react';\n\n/** The use queue return type */\nexport interface UseQueueReturn<Value> {\n /** The current queue */\n queue: Value[];\n /** Add an element to the queue */\n add: (element: Value) => void;\n /** Remove an element from the queue */\n remove: () => Value;\n /** Clear the queue */\n clear: () => void;\n /** Get the first element of the queue */\n first: Value;\n /** Get the last element of the queue */\n last: Value;\n /** Get the size of the queue */\n size: number;\n}\n\n/**\n * @name useQueue\n * @description - Hook that manages a queue\n *\n * @template Value The type of the value\n * @param {Value[]} [initialValue=[]] The initial value of the queue\n * @returns {UseQueueReturn} An object containing the current queue and functions to interact with the queue\n *\n * @example\n * const { queue, add, remove, clear, first, last, size } = useQueue([1, 2, 3]);\n */\nexport const useQueue = <Value>(initialValue: Value[] = []): UseQueueReturn<Value> => {\n const [queue, setQueue] = React.useState(initialValue);\n\n const add = (element: Value) => setQueue((queue) => [...queue, element]);\n const clear = () => setQueue([]);\n const remove = () => {\n let removed;\n setQueue(([first, ...rest]) => {\n removed = first;\n return rest;\n });\n return removed as Value;\n };\n\n return {\n add,\n remove,\n clear,\n first: queue[0],\n last: queue[queue.length - 1],\n size: queue.length,\n queue\n };\n};\n"],"names":["useQueue","initialValue","arguments","length","undefined","_React$useState","React","useState","_React$useState2","_slicedToArray","queue","setQueue","add","element","concat","_toConsumableArray","remove","removed","_ref","_ref2","_toArray","first","rest","slice","clear","last","size"],"mappings":";uGA+BaA,EAAW,WAA8D,IAAtDC,EAAqBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GACtDG,EAA0BC,EAAMC,SAASN,GAAaO,EAAAC,EAAAJ,EAAA,GAA/CK,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAatB,MAAO,CACLI,IAZU,SAACC,GAAc,OAAKF,GAAS,SAACD,GAAK,MAAA,GAAAI,OAAAC,EAASL,IAAOG,GAAO,GAAE,EAatEG,OAXa,WACb,IAAIC,EAKJ,OAJAN,GAAS,SAAAO,GAAsB,IAAAC,EAAAC,EAAAF,GAApBG,EAAKF,EAAA,GAAKG,EAAIH,EAAAI,MAAA,GAEvB,OADAN,EAAUI,EACHC,CACT,IACOL,GAMPO,MAbY,WAAH,OAASb,EAAS,GAAG,EAc9BU,MAAOX,EAAM,GACbe,KAAMf,EAAMA,EAAMP,OAAS,GAC3BuB,KAAMhB,EAAMP,OACZO,MAAAA,EAEJ"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
2
  import r from"react";var e=function(){var e=r.useRef(0);return r.useEffect((function(){e.current+=1})),e.current};export{e as useRenderCount};
3
3
  //# sourceMappingURL=useRenderCount.js.map
@@ -0,0 +1,3 @@
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{_ as r}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import t from"react";var e=function(){var e=t.useId(),o=t.useState(e),a=r(o,2),n=a[0],u=a[1];return{id:n,update:function(){return u(Math.random().toString())}}};export{e as useRerender};
3
+ //# sourceMappingURL=useRerender.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRerender.js","sources":["../../../../src/hooks/useRerender/useRerender.ts"],"sourcesContent":["import React from 'react';\n\n/** The use rerender return type */\ninterface UseRerenderReturns {\n /** The id of the rerender */\n id: string;\n /** Function to rerender the component */\n update: () => void;\n}\n\n/**\n * @name useRerender\n * @description - Hook that defines the logic to force rerender a component\n *\n * @returns {UseRerenderReturns} An object containing the id and update function\n *\n * @example\n * const { id, update } = useRerender();\n */\nexport const useRerender = (): UseRerenderReturns => {\n const id = React.useId();\n const [value, setValue] = React.useState(id);\n return { id: value, update: () => setValue(Math.random().toString()) };\n};\n"],"names":["useRerender","id","React","useId","_React$useState","useState","_React$useState2","_slicedToArray","value","setValue","update","Math","random","toString"],"mappings":";yFAmBaA,EAAc,WACzB,IAAMC,EAAKC,EAAMC,QACjBC,EAA0BF,EAAMG,SAASJ,GAAGK,EAAAC,EAAAH,EAAA,GAArCI,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GACtB,MAAO,CAAEL,GAAIO,EAAOE,OAAQ,WAAA,OAAMD,EAASE,KAAKC,SAASC,WAAW,EACtE"}
@@ -0,0 +1,3 @@
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import t from"react";var r="script-status",n=function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.useState((function(){var e=document.querySelector('script[src="'.concat(n,'"]')),t=null==e?void 0:e.getAttribute(r);return t||(e?"unknown":"loading")})),u=e(i,2),c=u[0],a=u[1],s=o.removeOnUnmount,d=void 0===s||s,v=o.async,l=void 0===v||v;return t.useEffect((function(){var t=document.querySelector('script[src="'.concat(n,'"]')),i=null==t?void 0:t.getAttribute(r);if(i)return a(i);if(t)return a("unknown");var u=document.createElement("script");u.src=n,u.async=l;for(var c=0,s=Object.entries(o);c<s.length;c++){var v=e(s[c],2),m=v[0],f=v[1];u.setAttribute(m,String(f))}u.setAttribute(r,"loading"),document.body.appendChild(u);var p=function(){u.setAttribute(r,"ready"),a("ready")},b=function(){u.setAttribute(r,"error"),a("error")};return u.addEventListener("load",p),u.addEventListener("error",b),function(){d&&(u.remove(),u.removeEventListener("load",p),u.removeEventListener("error",b))}}),[n,d]),c};export{r as SCRIPT_STATUS_ATTRIBUTE_NAME,n as useScript};
3
+ //# sourceMappingURL=useScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useScript.js","sources":["../../../../src/hooks/useScript/useScript.ts"],"sourcesContent":["import React from 'react';\n\n/** The use script status */\nexport type UseScriptStatus = 'loading' | 'ready' | 'error' | 'unknown';\nexport const SCRIPT_STATUS_ATTRIBUTE_NAME = 'script-status';\n\n/** The use script options extends from attributes script tag */\nexport interface UseScriptOptions extends React.ComponentProps<'script'> {\n /** Whether to remove the script on unmount */\n removeOnUnmount?: boolean;\n}\n\n/**\n * @name useScript\n * @description - Hook that manages a script with onLoad, onError, and removeOnUnmount functionalities\n *\n * @param {string} src The source of the script\n * @param {UseScriptOptions} [options] The options of the script extends from attributes script tag\n * @param {boolean} [options.removeOnUnmount=true] Whether to remove the script on unmount\n * @param {boolean} [options.async=true] Whether to load the script asynchronously\n * @returns {UseScriptStatus} The status of the script\n *\n * @example\n * const status = useScript('https://example.com/script.js');\n */\nexport const useScript = (src: string, options: UseScriptOptions = {}) => {\n const [status, setStatus] = React.useState<UseScriptStatus>(() => {\n const script = document.querySelector(`script[src=\"${src}\"]`) as HTMLScriptElement;\n const scriptStatus = script?.getAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME) as UseScriptStatus;\n if (scriptStatus) return scriptStatus;\n if (script) return 'unknown';\n\n return 'loading';\n });\n const { removeOnUnmount = true, async = true } = options;\n\n React.useEffect(() => {\n const existedScript = document.querySelector(`script[src=\"${src}\"]`) as HTMLScriptElement;\n const scriptStatus = existedScript?.getAttribute(\n SCRIPT_STATUS_ATTRIBUTE_NAME\n ) as UseScriptStatus;\n if (scriptStatus) return setStatus(scriptStatus);\n if (existedScript) return setStatus('unknown');\n\n const script = document.createElement('script');\n script.src = src;\n script.async = async;\n\n for (const [key, value] of Object.entries(options)) {\n script.setAttribute(key, String(value));\n }\n\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'loading');\n document.body.appendChild(script);\n\n const onLoad = () => {\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'ready');\n setStatus('ready');\n };\n\n const onError = () => {\n script.setAttribute(SCRIPT_STATUS_ATTRIBUTE_NAME, 'error');\n setStatus('error');\n };\n\n const removeEventListeners = () => {\n script.removeEventListener('load', onLoad);\n script.removeEventListener('error', onError);\n };\n\n script.addEventListener('load', onLoad);\n script.addEventListener('error', onError);\n\n return () => {\n if (removeOnUnmount) {\n script.remove();\n removeEventListeners();\n }\n };\n }, [src, removeOnUnmount]);\n\n return status;\n};\n"],"names":["SCRIPT_STATUS_ATTRIBUTE_NAME","useScript","src","options","arguments","length","undefined","_React$useState","React","useState","script","document","querySelector","concat","scriptStatus","getAttribute","_React$useState2","_slicedToArray","status","setStatus","_options$removeOnUnmo","removeOnUnmount","_options$async","async","useEffect","existedScript","createElement","_i","_Object$entries","Object","entries","_Object$entries$_i","key","value","setAttribute","String","body","appendChild","onLoad","onError","addEventListener","remove","removeEventListener"],"mappings":";qFAIO,IAAMA,EAA+B,gBAqB/BC,EAAY,SAACC,GAAgD,IAAnCC,EAAyBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAA,EACjEG,EAA4BC,EAAMC,UAA0B,WAC1D,IAAMC,EAASC,SAASC,6BAAaC,OAAgBX,EAAG,OAClDY,EAAeJ,aAAAA,EAAAA,EAAQK,aAAaf,GAC1C,OAAIc,IACAJ,EAAe,UAEZ,UACT,IAAEM,EAAAC,EAAAV,EAAA,GAPKW,EAAMF,EAAA,GAAEG,EAASH,EAAA,GAQxBI,EAAiDjB,EAAzCkB,gBAAAA,OAAkB,IAAHD,GAAOA,EAAAE,EAAmBnB,EAAjBoB,MAAAA,OAAQ,IAAHD,GAAOA,EA+C5C,OA7CAd,EAAMgB,WAAU,WACd,IAAMC,EAAgBd,SAASC,6BAAaC,OAAgBX,EAAG,OACzDY,EAAeW,aAAAA,EAAAA,EAAeV,aAClCf,GAEF,GAAIc,EAAc,OAAOK,EAAUL,GACnC,GAAIW,EAAe,OAAON,EAAU,WAEpC,IAAMT,EAASC,SAASe,cAAc,UACtChB,EAAOR,IAAMA,EACbQ,EAAOa,MAAQA,EAEf,IAAA,IAAAI,EAAAC,EAAAA,EAA2BC,OAAOC,QAAQ3B,GAAQwB,EAAAC,EAAAvB,OAAAsB,IAAE,CAA/C,IAAAI,EAAAd,EAAAW,EAAAD,GAAA,GAAOK,EAAGD,EAAA,GAAEE,EAAKF,EAAA,GACpBrB,EAAOwB,aAAaF,EAAKG,OAAOF,GAClC,CAEAvB,EAAOwB,aAAalC,EAA8B,WAClDW,SAASyB,KAAKC,YAAY3B,GAE1B,IAAM4B,EAAS,WACb5B,EAAOwB,aAAalC,EAA8B,SAClDmB,EAAU,UAGNoB,EAAU,WACd7B,EAAOwB,aAAalC,EAA8B,SAClDmB,EAAU,UAWZ,OAHAT,EAAO8B,iBAAiB,OAAQF,GAChC5B,EAAO8B,iBAAiB,QAASD,GAE1B,WACDlB,IACFX,EAAO+B,SATT/B,EAAOgC,oBAAoB,OAAQJ,GACnC5B,EAAOgC,oBAAoB,QAASH,IAYxC,GAAG,CAACrC,EAAKmB,IAEFH,CACT"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- import{b as r}from"../../_rollupPluginBabelHelpers-8YyPIzj_.js";import{useStorage as e}from"../useStorage/useStorage.js";import"react";var o=function(o,t,a){return e(o,r({initialValue:t,storage:window.sessionStorage},a))};export{o as useSessionStorage};
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{b as o}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import{useStorage as e}from"../useStorage/useStorage.js";import"react";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var r=function(r,t,s){return e(r,o({initialValue:t,storage:window.sessionStorage},s))};export{r as useSessionStorage};
3
3
  //# sourceMappingURL=useSessionStorage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSessionStorage.js","sources":["../../../../src/hooks/useSessionStorage/useSessionStorage.ts"],"sourcesContent":["import type { UseStorageInitialValue, UseStorageOptions } from '../useStorage/useStorage';\nimport { useStorage } from '../useStorage/useStorage';\n\nexport const useSessionStorage = <Value>(\n key: string,\n initialValue?: UseStorageInitialValue<Value>,\n options?: UseStorageOptions<Value>\n) => useStorage(key, { initialValue, storage: window.sessionStorage, ...options });\n"],"names":["useSessionStorage","key","initialValue","options","useStorage","_objectSpread","storage","window","sessionStorage"],"mappings":";uIAGO,IAAMA,EAAoB,SAC/BC,EACAC,EACAC,GAAkC,OAC/BC,EAAWH,EAAGI,EAAA,CAAIH,aAAAA,EAAcI,QAASC,OAAOC,gBAAmBL,GAAU"}
1
+ {"version":3,"file":"useSessionStorage.js","sources":["../../../../src/hooks/useSessionStorage/useSessionStorage.ts"],"sourcesContent":["import type { UseStorageInitialValue, UseStorageOptions } from '../useStorage/useStorage';\nimport { useStorage } from '../useStorage/useStorage';\n\n/**\n * @name useSessionStorage\n * @description - Hook that manages session storage value\n *\n * @template Value The type of the value\n * @param {string} key The key of the storage\n * @param {UseStorageInitialValue<Value>} [initialValue] The initial value of the storage\n * @param {UseStorageOptions<Value>} [options] The options of the storage\n *\n * @example\n * const [value, setValue, removeValue] = useSessionStorage('key', 'value');\n */\nexport const useSessionStorage = <Value>(\n key: string,\n initialValue?: UseStorageInitialValue<Value>,\n options?: UseStorageOptions<Value>\n) => useStorage(key, { initialValue, storage: window.sessionStorage, ...options });\n"],"names":["useSessionStorage","key","initialValue","options","useStorage","_objectSpread","storage","window","sessionStorage"],"mappings":";iPAeO,IAAMA,EAAoB,SAC/BC,EACAC,EACAC,GAAkC,OAC/BC,EAAWH,EAAGI,EAAA,CAAIH,aAAAA,EAAcI,QAASC,OAAOC,gBAAmBL,GAAU"}
@@ -0,0 +1,3 @@
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import r from"react";import{useRerender as e}from"../useRerender/useRerender.js";import"../../_rollupPluginBabelHelpers-D5_r4iwW.js";var t=function(t){var n=r.useRef(new Set(t)),a=e();return n.current.add=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var u=Set.prototype.add.apply(n.current,e);return a.update(),u},n.current.clear=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];Set.prototype.clear.apply(n.current,e),a.update()},n.current.delete=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var u=Set.prototype.delete.apply(n.current,e);return a.update(),u},n.current};export{t as useSet};
3
+ //# sourceMappingURL=useSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSet.js","sources":["../../../../src/hooks/useSet/useSet.ts"],"sourcesContent":["import React from 'react';\n\nimport { useRerender } from '../useRerender/useRerender';\n\n/**\n * @name useSet\n * @description - Hook that manages a set structure\n *\n * @template Value The type of the value\n * @param {Value[]} values The initial array of the set\n * @returns {Set<Value>} A set structure\n *\n * @example\n * const set = useSet([1, 2, 3]);\n */\nexport const useSet = <Value>(values: Value[]) => {\n const setRef = React.useRef(new Set(values));\n const rerender = useRerender();\n\n setRef.current.add = (...args) => {\n const result = Set.prototype.add.apply(setRef.current, args);\n rerender.update();\n return result;\n };\n\n setRef.current.clear = (...args) => {\n Set.prototype.clear.apply(setRef.current, args);\n rerender.update();\n };\n\n setRef.current.delete = (...args) => {\n const result = Set.prototype.delete.apply(setRef.current, args);\n rerender.update();\n return result;\n };\n\n return setRef.current;\n};\n"],"names":["useSet","values","setRef","React","useRef","Set","rerender","useRerender","current","add","_len","arguments","length","args","Array","_key","result","prototype","apply","update","clear","_len2","_key2","_len3","_key3"],"mappings":";yIAeaA,EAAS,SAAQC,GAC5B,IAAMC,EAASC,EAAMC,OAAO,IAAIC,IAAIJ,IAC9BK,EAAWC,IAmBjB,OAjBAL,EAAOM,QAAQC,IAAM,WAAa,IAAA,IAAAC,EAAAC,UAAAC,OAATC,EAAIC,IAAAA,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAJF,EAAIE,GAAAJ,UAAAI,GAC3B,IAAMC,EAASX,IAAIY,UAAUR,IAAIS,MAAMhB,EAAOM,QAASK,GAEvD,OADAP,EAASa,SACFH,GAGTd,EAAOM,QAAQY,MAAQ,WAAa,IAAA,IAAAC,EAAAV,UAAAC,OAATC,EAAIC,IAAAA,MAAAO,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,IAAJT,EAAIS,GAAAX,UAAAW,GAC7BjB,IAAIY,UAAUG,MAAMF,MAAMhB,EAAOM,QAASK,GAC1CP,EAASa,UAGXjB,EAAOM,QAAc,OAAG,WAAa,IAAA,IAAAe,EAAAZ,UAAAC,OAATC,EAAIC,IAAAA,MAAAS,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,IAAJX,EAAIW,GAAAb,UAAAa,GAC9B,IAAMR,EAASX,IAAIY,UAAgB,OAACC,MAAMhB,EAAOM,QAASK,GAE1D,OADAP,EAASa,SACFH,GAGFd,EAAOM,OAChB"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- import{a as t,_ as r}from"../../_rollupPluginBabelHelpers-8YyPIzj_.js";import n from"react";var e=function(e){var u="object"===t(e)?e.max:e,i="object"===t(e)?e.initial:1,o=n.useRef(i>u||i<1?1:i),c=n.useState(i),s=r(c,2),a=s[0],f=s[1],l=1===a,p=a===u;return{counts:u,currentStep:a,isFirst:l,isLast:p,next:function(){p||f((function(t){return t+1}))},back:function(){l||f((function(t){return t-1}))},reset:function(){return f(o.current)},set:function(t){return"first"===t?f(o.current):"last"===t||t>=u?f(u):t<=1?f(1):void f(t)}}};export{e as useStep};
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{a as t,_ as r}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import n from"react";var e=function(e){var u="object"===t(e)?e.max:e,i="object"===t(e)?e.initial:1,o=n.useRef(i>u||i<1?1:i),c=n.useState(i),s=r(c,2),a=s[0],f=s[1],l=1===a,p=a===u;return{counts:u,currentStep:a,isFirst:l,isLast:p,next:function(){p||f((function(t){return t+1}))},back:function(){l||f((function(t){return t-1}))},reset:function(){return f(o.current)},set:function(t){return"first"===t?f(o.current):"last"===t||t>=u?f(u):t<=1?f(1):void f(t)}}};export{e as useStep};
3
3
  //# sourceMappingURL=useStep.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStep.js","sources":["../../../../src/hooks/useStep/useStep.ts"],"sourcesContent":["import React from 'react';\n\n/** The use step params */\ninterface UseStepParams {\n /** Initial value for step */\n initial: number;\n /** Maximum value for step */\n max: number;\n}\n\n/** The use step return type */\ninterface UseStepReturn {\n /** Counts of steps */\n counts: number;\n /** Current value of step */\n currentStep: number;\n /** Boolean value if current step is first */\n isFirst: boolean;\n /** Boolean value if current step is last */\n isLast: boolean;\n /** Go to next step */\n next: () => void;\n /** Go to back step */\n back: () => void;\n /** Reset current step to initial value */\n reset: () => void;\n /** Go to custom step */\n set: (value: number | 'last' | 'first') => void;\n}\n\nconst FIRST_STEP_VALUE = 1;\n\n/**\n * @name useStep\n * @description - Hook that create stepper\n *\n * @overload\n * @param {number} max Maximum number of steps\n * @returns {UseStepReturn} An object contains variables and functions to change the step\n *\n * @overload\n * @param {number} params.max Maximum number of steps\n * @param {number} params.initial Initial value for step\n * @returns {UseStepReturn} An object contains variables and functions to change the step\n *\n * @example\n * const step = useStep(5);\n * @example\n * const stepper = useStep({ initial: 2, max: 5 });\n */\nexport const useStep = (params: number | UseStepParams): UseStepReturn => {\n const max = typeof params === 'object' ? params.max : params;\n const initial = typeof params === 'object' ? params.initial : FIRST_STEP_VALUE;\n\n const initialStep = React.useRef(\n initial > max || initial < FIRST_STEP_VALUE ? FIRST_STEP_VALUE : initial\n );\n const [currentStep, setCurrentStep] = React.useState(initial);\n\n const isFirst = currentStep === FIRST_STEP_VALUE;\n const isLast = currentStep === max;\n\n const next = () => {\n if (isLast) return;\n setCurrentStep((prevStep) => prevStep + 1);\n };\n\n const back = () => {\n if (isFirst) return;\n setCurrentStep((prevStep) => prevStep - 1);\n };\n\n const reset = () => setCurrentStep(initialStep.current);\n\n const set = (value: number | 'last' | 'first') => {\n if (value === 'first') return setCurrentStep(initialStep.current);\n if (value === 'last') return setCurrentStep(max);\n if (value >= max) return setCurrentStep(max);\n if (value <= FIRST_STEP_VALUE) return setCurrentStep(FIRST_STEP_VALUE);\n setCurrentStep(value);\n };\n\n return {\n counts: max,\n currentStep,\n isFirst,\n isLast,\n next,\n back,\n reset,\n set\n };\n};\n"],"names":["useStep","params","max","_typeof","initial","initialStep","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","currentStep","setCurrentStep","isFirst","isLast","counts","next","prevStep","back","reset","current","set","value"],"mappings":";4FA8BA,IAoBaA,EAAU,SAACC,GACtB,IAAMC,EAAwB,WAAlBC,EAAOF,GAAsBA,EAAOC,IAAMD,EAChDG,EAA4B,WAAlBD,EAAOF,GAAsBA,EAAOG,QAtB7B,EAwBjBC,EAAcC,EAAMC,OACxBH,EAAUF,GAAOE,EAzBI,IAyB4CA,GAEnEI,EAAsCF,EAAMG,SAASL,GAAQM,EAAAC,EAAAH,EAAA,GAAtDI,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAE5BI,EA7BiB,IA6BPF,EACVG,EAASH,IAAgBV,EAsB/B,MAAO,CACLc,OAAQd,EACRU,YAAAA,EACAE,QAAAA,EACAC,OAAAA,EACAE,KAzBW,WACPF,GACJF,GAAe,SAACK,GAAQ,OAAKA,EAAW,MAwBxCC,KArBW,WACPL,GACJD,GAAe,SAACK,GAAQ,OAAKA,EAAW,MAoBxCE,MAjBY,WAAH,OAASP,EAAeR,EAAYgB,QAAQ,EAkBrDC,IAhBU,SAACC,GACX,MAAc,UAAVA,EAA0BV,EAAeR,EAAYgB,SAC3C,SAAVE,GACAA,GAASrB,EADgBW,EAAeX,GAExCqB,GAhDiB,EAgDiBV,EAhDjB,QAiDrBA,EAAeU,IAanB"}
1
+ {"version":3,"file":"useStep.js","sources":["../../../../src/hooks/useStep/useStep.ts"],"sourcesContent":["import React from 'react';\n\n/** The use step params */\ninterface UseStepParams {\n /** Initial value for step */\n initial: number;\n /** Maximum value for step */\n max: number;\n}\n\n/** The use step return type */\ninterface UseStepReturn {\n /** Counts of steps */\n counts: number;\n /** Current value of step */\n currentStep: number;\n /** Boolean value if current step is first */\n isFirst: boolean;\n /** Boolean value if current step is last */\n isLast: boolean;\n /** Go to next step */\n next: () => void;\n /** Go to back step */\n back: () => void;\n /** Reset current step to initial value */\n reset: () => void;\n /** Go to custom step */\n set: (value: number | 'last' | 'first') => void;\n}\n\nconst FIRST_STEP_VALUE = 1;\n\n/**\n * @name useStep\n * @description - Hook that create stepper\n *\n * @overload\n * @param {number} max Maximum number of steps\n * @returns {UseStepReturn} An object contains variables and functions to change the step\n *\n * @overload\n * @param {number} params.max Maximum number of steps\n * @param {number} params.initial Initial value for step\n * @returns {UseStepReturn} An object contains variables and functions to change the step\n *\n * @example\n * const step = useStep(5);\n *\n * @example\n * const stepper = useStep({ initial: 2, max: 5 });\n */\nexport const useStep = (params: number | UseStepParams): UseStepReturn => {\n const max = typeof params === 'object' ? params.max : params;\n const initial = typeof params === 'object' ? params.initial : FIRST_STEP_VALUE;\n\n const initialStep = React.useRef(\n initial > max || initial < FIRST_STEP_VALUE ? FIRST_STEP_VALUE : initial\n );\n const [currentStep, setCurrentStep] = React.useState(initial);\n\n const isFirst = currentStep === FIRST_STEP_VALUE;\n const isLast = currentStep === max;\n\n const next = () => {\n if (isLast) return;\n setCurrentStep((prevStep) => prevStep + 1);\n };\n\n const back = () => {\n if (isFirst) return;\n setCurrentStep((prevStep) => prevStep - 1);\n };\n\n const reset = () => setCurrentStep(initialStep.current);\n\n const set = (value: number | 'last' | 'first') => {\n if (value === 'first') return setCurrentStep(initialStep.current);\n if (value === 'last') return setCurrentStep(max);\n if (value >= max) return setCurrentStep(max);\n if (value <= FIRST_STEP_VALUE) return setCurrentStep(FIRST_STEP_VALUE);\n setCurrentStep(value);\n };\n\n return {\n counts: max,\n currentStep,\n isFirst,\n isLast,\n next,\n back,\n reset,\n set\n };\n};\n"],"names":["useStep","params","max","_typeof","initial","initialStep","React","useRef","_React$useState","useState","_React$useState2","_slicedToArray","currentStep","setCurrentStep","isFirst","isLast","counts","next","prevStep","back","reset","current","set","value"],"mappings":";4FA8BA,IAqBaA,EAAU,SAACC,GACtB,IAAMC,EAAwB,WAAlBC,EAAOF,GAAsBA,EAAOC,IAAMD,EAChDG,EAA4B,WAAlBD,EAAOF,GAAsBA,EAAOG,QAvB7B,EAyBjBC,EAAcC,EAAMC,OACxBH,EAAUF,GAAOE,EA1BI,IA0B4CA,GAEnEI,EAAsCF,EAAMG,SAASL,GAAQM,EAAAC,EAAAH,EAAA,GAAtDI,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAE5BI,EA9BiB,IA8BPF,EACVG,EAASH,IAAgBV,EAsB/B,MAAO,CACLc,OAAQd,EACRU,YAAAA,EACAE,QAAAA,EACAC,OAAAA,EACAE,KAzBW,WACPF,GACJF,GAAe,SAACK,GAAQ,OAAKA,EAAW,MAwBxCC,KArBW,WACPL,GACJD,GAAe,SAACK,GAAQ,OAAKA,EAAW,MAoBxCE,MAjBY,WAAH,OAASP,EAAeR,EAAYgB,QAAQ,EAkBrDC,IAhBU,SAACC,GACX,MAAc,UAAVA,EAA0BV,EAAeR,EAAYgB,SAC3C,SAAVE,GACAA,GAASrB,EADgBW,EAAeX,GAExCqB,GAjDiB,EAiDiBV,EAjDjB,QAkDrBA,EAAeU,IAanB"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- import{a as e}from"../../_rollupPluginBabelHelpers-8YyPIzj_.js";import n from"react";var r=function(e){return window.dispatchEvent(new StorageEvent("storage",e))},t=function(e,n,t){var i=e.getItem(n);e.setItem(n,t),r({key:n,oldValue:i,newValue:t,storageArea:e})},i=function(e,n){var t=e.getItem(n);e.removeItem(n),r({key:n,oldValue:t,newValue:null,storageArea:e})},o=function(e,n,r){var t=e.getItem(n);if(t)return r(t)},u=function(e){return window.addEventListener("storage",e),function(){return window.removeEventListener("storage",e)}},a=function(r,a){var l,f="object"===e(a)?a:void 0,c=f?null==f?void 0:f.initialValue:a,s=null!==(l=null==f?void 0:f.storage)&&void 0!==l?l:window.localStorage,d=function(e){return null!=f&&f.serializer?f.serializer(e):JSON.stringify(e)},v=function(e){if(null!=f&&f.deserializer)return f.deserializer(e);if("undefined"!==e)try{return JSON.parse(e)}catch(n){return e}},g=n.useSyncExternalStore(u,(function(){return o(s,r,v)}),(function(){return function(e){return e instanceof Function?e():e}(c)}));n.useEffect((function(){if(void 0===o(s,r,v)&&c){var e=c instanceof Function?c():c;t(s,r,d(e))}}),[r]);return[g,function(e){if(null===e)return i(s,r);t(s,r,d(e))},function(){return i(s,r)}]};export{r as dispatchStorageEvent,a as useStorage};
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{a as e}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import n from"react";import{useIsomorphicLayoutEffect as t}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var r=function(e){return window.dispatchEvent(new StorageEvent("storage",e))},i=function(e,n,t){var i=e.getItem(n);e.setItem(n,t),r({key:n,oldValue:i,newValue:t,storageArea:e})},o=function(e,n){var t=e.getItem(n);e.removeItem(n),r({key:n,oldValue:t,newValue:null,storageArea:e})},u=function(e,n,t){var r=e.getItem(n);if(r)return t(r)},a=function(e){return window.addEventListener("storage",e),function(){return window.removeEventListener("storage",e)}},l=function(r,l){var s,c="object"===e(l)?l:void 0,f=c?null==c?void 0:c.initialValue:l,d=null!==(s=null==c?void 0:c.storage)&&void 0!==s?s:window.localStorage,m=function(e){return null!=c&&c.serializer?c.serializer(e):JSON.stringify(e)},v=function(e){if(null!=c&&c.deserializer)return c.deserializer(e);if("undefined"!==e)try{return JSON.parse(e)}catch(n){return e}},g=n.useSyncExternalStore(a,(function(){return u(d,r,v)}),(function(){return function(e){return e instanceof Function?e():e}(f)}));t((function(){(void 0===u(d,r,v)||f)&&i(d,r,m(f instanceof Function?f():f))}),[r]);return[g,function(e){if(null===e)return o(d,r);i(d,r,m(e))},function(){return o(d,r)}]};export{r as dispatchStorageEvent,l as useStorage};
3
3
  //# sourceMappingURL=useStorage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStorage.js","sources":["../../../../src/hooks/useStorage/useStorage.ts"],"sourcesContent":["import React from 'react';\n\nexport type UseStorageInitialValue<Value> = Value | (() => Value);\nexport interface UseStorageOptions<Value> {\n serializer?: (value: Value) => string;\n deserializer?: (value: string) => Value;\n storage?: Storage;\n initialValue?: UseStorageInitialValue<Value>;\n}\n\nexport type UseStorageReturn<Value> = [\n value: Value,\n set: (value: Value) => void,\n remove: () => void\n];\n\nexport const dispatchStorageEvent = (params: Partial<StorageEvent>) =>\n window.dispatchEvent(new StorageEvent('storage', params));\n\nconst setStorageItem = (storage: Storage, key: string, value: string) => {\n const oldValue = storage.getItem(key);\n\n storage.setItem(key, value);\n dispatchStorageEvent({ key, oldValue, newValue: value, storageArea: storage });\n};\n\nconst removeStorageItem = (storage: Storage, key: string) => {\n const oldValue = storage.getItem(key);\n\n storage.removeItem(key);\n dispatchStorageEvent({ key, oldValue, newValue: null, storageArea: storage });\n};\n\nconst getStorageItem = <Value>(\n storage: Storage,\n key: string,\n deserializer: (value: string) => Value\n) => {\n const value = storage.getItem(key);\n if (!value) return undefined;\n return deserializer(value);\n};\n\nconst storageSubscribe = (callback: () => void) => {\n window.addEventListener('storage', callback);\n return () => window.removeEventListener('storage', callback);\n};\n\nconst getStorageServerSnapshot = <Value>(initialValue: UseStorageInitialValue<Value>) =>\n initialValue instanceof Function ? initialValue() : initialValue;\n\n/**\n * @name useStorage\n * @description - Hook that manages a counter with increment, decrement, reset, and set functionalities\n *\n * @example\n * text\n */\nexport const useStorage = <Value>(\n key: string,\n params?: UseStorageInitialValue<Value> | UseStorageOptions<Value>\n) => {\n const options = (typeof params === 'object' ? params : undefined) as UseStorageOptions<Value>;\n const initialValue = (options ? options?.initialValue : params) as UseStorageInitialValue<Value>;\n\n const storage = options?.storage ?? window.localStorage;\n const serializer = (value: Value) => {\n if (options?.serializer) return options.serializer(value);\n return JSON.stringify(value);\n };\n\n const deserializer = (value: string) => {\n if (options?.deserializer) return options.deserializer(value);\n\n if (value === 'undefined') {\n return undefined as unknown as Value;\n }\n\n try {\n return JSON.parse(value) as Value;\n } catch (error) {\n return value as Value;\n }\n };\n\n const getSnapshot = () => getStorageItem<Value>(storage, key, deserializer);\n const getServerSnapshot = () => getStorageServerSnapshot(initialValue);\n const store = React.useSyncExternalStore(storageSubscribe, getSnapshot, getServerSnapshot);\n\n const set = (value: Value) => {\n if (value === null) return removeStorageItem(storage, key);\n setStorageItem(storage, key, serializer(value));\n };\n\n React.useEffect(() => {\n const value = getStorageItem<Value>(storage, key, deserializer);\n if (value !== undefined || !initialValue) return;\n\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n\n setStorageItem(storage, key, serializer(defaultValue));\n }, [key]);\n\n const remove = () => removeStorageItem(storage, key);\n\n return [store, set, remove] as const;\n};\n"],"names":["dispatchStorageEvent","params","window","dispatchEvent","StorageEvent","setStorageItem","storage","key","value","oldValue","getItem","setItem","newValue","storageArea","removeStorageItem","removeItem","getStorageItem","deserializer","storageSubscribe","callback","addEventListener","removeEventListener","useStorage","_options$storage","options","_typeof","undefined","initialValue","localStorage","serializer","JSON","stringify","parse","error","store","React","useSyncExternalStore","Function","getStorageServerSnapshot","useEffect","defaultValue"],"mappings":";yFAgBaA,EAAuB,SAACC,GAA6B,OAChEC,OAAOC,cAAc,IAAIC,aAAa,UAAWH,GAAQ,EAErDI,EAAiB,SAACC,EAAkBC,EAAaC,GACrD,IAAMC,EAAWH,EAAQI,QAAQH,GAEjCD,EAAQK,QAAQJ,EAAKC,GACrBR,EAAqB,CAAEO,IAAAA,EAAKE,SAAAA,EAAUG,SAAUJ,EAAOK,YAAaP,GACtE,EAEMQ,EAAoB,SAACR,EAAkBC,GAC3C,IAAME,EAAWH,EAAQI,QAAQH,GAEjCD,EAAQS,WAAWR,GACnBP,EAAqB,CAAEO,IAAAA,EAAKE,SAAAA,EAAUG,SAAU,KAAMC,YAAaP,GACrE,EAEMU,EAAiB,SACrBV,EACAC,EACAU,GAEA,IAAMT,EAAQF,EAAQI,QAAQH,GAC9B,GAAKC,EACL,OAAOS,EAAaT,EACtB,EAEMU,EAAmB,SAACC,GAExB,OADAjB,OAAOkB,iBAAiB,UAAWD,GAC5B,WAAA,OAAMjB,OAAOmB,oBAAoB,UAAWF,EAAS,CAC9D,EAYaG,EAAa,SACxBf,EACAN,GACG,IAAAsB,EACGC,EAA6B,WAAlBC,EAAOxB,GAAsBA,OAASyB,EACjDC,EAAgBH,EAAUA,aAAO,EAAPA,EAASG,aAAe1B,EAElDK,UAAOiB,EAAGC,aAAAA,EAAAA,EAASlB,eAAO,IAAAiB,EAAAA,EAAIrB,OAAO0B,aACrCC,EAAa,SAACrB,GAClB,OAAIgB,SAAAA,EAASK,WAAmBL,EAAQK,WAAWrB,GAC5CsB,KAAKC,UAAUvB,IAGlBS,EAAe,SAACT,GACpB,GAAIgB,SAAAA,EAASP,aAAc,OAAOO,EAAQP,aAAaT,GAEvD,GAAc,cAAVA,EAIJ,IACE,OAAOsB,KAAKE,MAAMxB,EACnB,CAAC,MAAOyB,GACP,OAAOzB,CACT,GAKI0B,EAAQC,EAAMC,qBAAqBlB,GAFrB,WAAH,OAASF,EAAsBV,EAASC,EAAKU,EAAa,IACjD,WAAH,OAtCQ,SAAQU,GAA2C,OAClFA,aAAwBU,SAAWV,IAAiBA,CAAY,CAqChCW,CAAyBX,EAAa,IAQtEQ,EAAMI,WAAU,WAEd,QAAcb,IADAV,EAAsBV,EAASC,EAAKU,IACtBU,EAA5B,CAEA,IAAMa,EAAeb,aAAwBU,SAAWV,IAAiBA,EAEzEtB,EAAeC,EAASC,EAAKsB,EAAWW,GAJE,CAK5C,GAAG,CAACjC,IAIJ,MAAO,CAAC2B,EAhBI,SAAC1B,GACX,GAAc,OAAVA,EAAgB,OAAOM,EAAkBR,EAASC,GACtDF,EAAeC,EAASC,EAAKsB,EAAWrB,KAY3B,WAAH,OAASM,EAAkBR,EAASC,EAAI,EAGtD"}
1
+ {"version":3,"file":"useStorage.js","sources":["../../../../src/hooks/useStorage/useStorage.ts"],"sourcesContent":["import React from 'react';\n\nimport { useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect';\n\nexport type UseStorageInitialValue<Value> = Value | (() => Value);\nexport interface UseStorageOptions<Value> {\n serializer?: (value: Value) => string;\n deserializer?: (value: string) => Value;\n storage?: Storage;\n initialValue?: UseStorageInitialValue<Value>;\n}\n\nexport type UseStorageReturn<Value> = [\n value: Value,\n set: (value: Value) => void,\n remove: () => void\n];\n\nexport const dispatchStorageEvent = (params: Partial<StorageEvent>) =>\n window.dispatchEvent(new StorageEvent('storage', params));\n\nconst setStorageItem = (storage: Storage, key: string, value: string) => {\n const oldValue = storage.getItem(key);\n\n storage.setItem(key, value);\n dispatchStorageEvent({ key, oldValue, newValue: value, storageArea: storage });\n};\n\nconst removeStorageItem = (storage: Storage, key: string) => {\n const oldValue = storage.getItem(key);\n\n storage.removeItem(key);\n dispatchStorageEvent({ key, oldValue, newValue: null, storageArea: storage });\n};\n\nconst getStorageItem = <Value>(\n storage: Storage,\n key: string,\n deserializer: (value: string) => Value\n) => {\n const value = storage.getItem(key);\n if (!value) return undefined;\n return deserializer(value);\n};\n\nconst storageSubscribe = (callback: () => void) => {\n window.addEventListener('storage', callback);\n return () => window.removeEventListener('storage', callback);\n};\n\nconst getStorageServerSnapshot = <Value>(initialValue: UseStorageInitialValue<Value>) =>\n initialValue instanceof Function ? initialValue() : initialValue;\n\nexport const useStorage = <Value>(\n key: string,\n params?: UseStorageInitialValue<Value> | UseStorageOptions<Value>\n) => {\n const options = (typeof params === 'object' ? params : undefined) as UseStorageOptions<Value>;\n const initialValue = (options ? options?.initialValue : params) as UseStorageInitialValue<Value>;\n\n const storage = options?.storage ?? window.localStorage;\n const serializer = (value: Value) => {\n if (options?.serializer) return options.serializer(value);\n return JSON.stringify(value);\n };\n\n const deserializer = (value: string) => {\n if (options?.deserializer) return options.deserializer(value);\n\n if (value === 'undefined') {\n return undefined as unknown as Value;\n }\n\n try {\n return JSON.parse(value) as Value;\n } catch (error) {\n return value as Value;\n }\n };\n\n const getSnapshot = () => getStorageItem<Value>(storage, key, deserializer) as Value;\n const getServerSnapshot = () => getStorageServerSnapshot(initialValue);\n const store = React.useSyncExternalStore(storageSubscribe, getSnapshot, getServerSnapshot);\n\n const set = (value: Value) => {\n if (value === null) return removeStorageItem(storage, key);\n setStorageItem(storage, key, serializer(value));\n };\n\n useIsomorphicLayoutEffect(() => {\n const value = getStorageItem<Value>(storage, key, deserializer);\n if (value !== undefined && !initialValue) return;\n\n setStorageItem(\n storage,\n key,\n serializer(initialValue instanceof Function ? initialValue() : initialValue)\n );\n }, [key]);\n\n const remove = () => removeStorageItem(storage, key);\n\n return [store, set, remove] as const;\n};\n"],"names":["dispatchStorageEvent","params","window","dispatchEvent","StorageEvent","setStorageItem","storage","key","value","oldValue","getItem","setItem","newValue","storageArea","removeStorageItem","removeItem","getStorageItem","deserializer","storageSubscribe","callback","addEventListener","removeEventListener","useStorage","_options$storage","options","_typeof","undefined","initialValue","localStorage","serializer","JSON","stringify","parse","error","store","React","useSyncExternalStore","Function","getStorageServerSnapshot","useIsomorphicLayoutEffect"],"mappings":";uOAkBaA,EAAuB,SAACC,GAA6B,OAChEC,OAAOC,cAAc,IAAIC,aAAa,UAAWH,GAAQ,EAErDI,EAAiB,SAACC,EAAkBC,EAAaC,GACrD,IAAMC,EAAWH,EAAQI,QAAQH,GAEjCD,EAAQK,QAAQJ,EAAKC,GACrBR,EAAqB,CAAEO,IAAAA,EAAKE,SAAAA,EAAUG,SAAUJ,EAAOK,YAAaP,GACtE,EAEMQ,EAAoB,SAACR,EAAkBC,GAC3C,IAAME,EAAWH,EAAQI,QAAQH,GAEjCD,EAAQS,WAAWR,GACnBP,EAAqB,CAAEO,IAAAA,EAAKE,SAAAA,EAAUG,SAAU,KAAMC,YAAaP,GACrE,EAEMU,EAAiB,SACrBV,EACAC,EACAU,GAEA,IAAMT,EAAQF,EAAQI,QAAQH,GAC9B,GAAKC,EACL,OAAOS,EAAaT,EACtB,EAEMU,EAAmB,SAACC,GAExB,OADAjB,OAAOkB,iBAAiB,UAAWD,GAC5B,WAAA,OAAMjB,OAAOmB,oBAAoB,UAAWF,EAAS,CAC9D,EAKaG,EAAa,SACxBf,EACAN,GACG,IAAAsB,EACGC,EAA6B,WAAlBC,EAAOxB,GAAsBA,OAASyB,EACjDC,EAAgBH,EAAUA,aAAO,EAAPA,EAASG,aAAe1B,EAElDK,UAAOiB,EAAGC,aAAAA,EAAAA,EAASlB,eAAO,IAAAiB,EAAAA,EAAIrB,OAAO0B,aACrCC,EAAa,SAACrB,GAClB,OAAIgB,SAAAA,EAASK,WAAmBL,EAAQK,WAAWrB,GAC5CsB,KAAKC,UAAUvB,IAGlBS,EAAe,SAACT,GACpB,GAAIgB,SAAAA,EAASP,aAAc,OAAOO,EAAQP,aAAaT,GAEvD,GAAc,cAAVA,EAIJ,IACE,OAAOsB,KAAKE,MAAMxB,EACnB,CAAC,MAAOyB,GACP,OAAOzB,CACT,GAKI0B,EAAQC,EAAMC,qBAAqBlB,GAFrB,WAAH,OAASF,EAAsBV,EAASC,EAAKU,MACpC,WAAH,OA/BQ,SAAQU,GAA2C,OAClFA,aAAwBU,SAAWV,IAAiBA,CAAY,CA8BhCW,CAAyBX,EAAa,IAQtEY,GAA0B,iBAEVb,IADAV,EAAsBV,EAASC,EAAKU,IACtBU,IAE5BtB,EACEC,EACAC,EACAsB,EAAWF,aAAwBU,SAAWV,IAAiBA,GAEnE,GAAG,CAACpB,IAIJ,MAAO,CAAC2B,EAlBI,SAAC1B,GACX,GAAc,OAAVA,EAAgB,OAAOM,EAAkBR,EAASC,GACtDF,EAAeC,EAASC,EAAKsB,EAAWrB,KAc3B,WAAH,OAASM,EAAkBR,EAASC,EAAI,EAGtD"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-8YyPIzj_.js";import r from"react";import{useIsomorphicLayoutEffect as t}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";function u(u,o){var n=r.useState(!1),c=e(n,2),i=c[0],f=c[1],s=r.useRef(u),m=r.useRef();t((function(){s.current=u}),[u]),r.useEffect((function(){return m.current=setTimeout((function(){s.current(),f(!0)}),o),function(){clearTimeout(m.current)}}),[o]);return{ready:i,clear:function(){clearTimeout(m.current),f(!0)}}}export{u as useTimeout};
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import r from"react";import{useIsomorphicLayoutEffect as t}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";function u(u,o){var n=r.useState(!1),c=e(n,2),i=c[0],f=c[1],s=r.useRef(u),m=r.useRef();t((function(){s.current=u}),[u]),r.useEffect((function(){return m.current=setTimeout((function(){s.current(),f(!0)}),o),function(){clearTimeout(m.current)}}),[o]);return{ready:i,clear:function(){clearTimeout(m.current),f(!0)}}}export{u as useTimeout};
3
3
  //# sourceMappingURL=useTimeout.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- import{_ as r}from"../../_rollupPluginBabelHelpers-8YyPIzj_.js";import e from"react";var n=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[!1,!0],t=e.useReducer((function(r,e){var n=e instanceof Function?e(r[0]):e,t=Math.abs(r.indexOf(n));return r.slice(t).concat(r.slice(0,t))}),n),o=r(t,2);return[r(o[0],1)[0],o[1]]};export{n as useToggle};
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{_ as r}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import e from"react";var n=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[!1,!0],t=e.useReducer((function(r,e){var n=e instanceof Function?e(r[0]):e,t=Math.abs(r.indexOf(n));return r.slice(t).concat(r.slice(0,t))}),n),o=r(t,2);return[r(o[0],1)[0],o[1]]};export{n as useToggle};
3
3
  //# sourceMappingURL=useToggle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useToggle.js","sources":["../../../../src/hooks/useToggle/useToggle.ts"],"sourcesContent":["import React from 'react';\n\nexport type UseToggleReturn<Value> = readonly [Value, (value?: Value) => void];\n\nexport const useToggle = <Value = boolean>(values: readonly Value[] = [false, true] as any) => {\n const [[option], toggle] = React.useReducer(\n (state: Value[], action: React.SetStateAction<Value>) => {\n const value = action instanceof Function ? action(state[0]) : action;\n const index = Math.abs(state.indexOf(value));\n return state.slice(index).concat(state.slice(0, index));\n },\n values as Value[]\n );\n\n return [option, toggle as (value?: Value) => void] as const;\n};\n"],"names":["useToggle","values","arguments","length","undefined","_React$useReducer","React","useReducer","state","action","value","Function","index","Math","abs","indexOf","slice","concat","_React$useReducer2","_slicedToArray"],"mappings":";yFAIaA,EAAY,WAAsE,IAApDC,EAAwBC,UAAAC,eAAAC,IAAAF,UAAA,GAAAA,UAAG,GAAA,EAAC,GAAO,GAC5EG,EAA2BC,EAAMC,YAC/B,SAACC,EAAgBC,GACf,IAAMC,EAAQD,aAAkBE,SAAWF,EAAOD,EAAM,IAAMC,EACxDG,EAAQC,KAAKC,IAAIN,EAAMO,QAAQL,IACrC,OAAOF,EAAMQ,MAAMJ,GAAOK,OAAOT,EAAMQ,MAAM,EAAGJ,GACjD,GACDX,GACDiB,EAAAC,EAAAd,EAAA,GAED,MAAO,CAFNc,EAAAD,EAAA,GAAA,GAPa,GAASA,EAAA,GAUzB"}
1
+ {"version":3,"file":"useToggle.js","sources":["../../../../src/hooks/useToggle/useToggle.ts"],"sourcesContent":["import React from 'react';\n\n/** The use toggle return type */\nexport type UseToggleReturn<Value> = readonly [Value, (value?: Value) => void];\n\n/**\n * @name useToggle\n * @description - Hook that create toggle\n *\n * @template Value The type of the value\n * @param {Value[]} [values=[false, true]] The values to toggle\n *\n * @example\n * const [on, toggle] = useToggle();\n *\n * @example\n * const [value, toggle] = useToggle(['light', 'dark'] as const);\n */\nexport const useToggle = <Value = boolean>(values: readonly Value[] = [false, true] as any) => {\n const [[option], toggle] = React.useReducer(\n (state: Value[], action: React.SetStateAction<Value>) => {\n const value = action instanceof Function ? action(state[0]) : action;\n const index = Math.abs(state.indexOf(value));\n return state.slice(index).concat(state.slice(0, index));\n },\n values as Value[]\n );\n\n return [option, toggle as (value?: Value) => void] as const;\n};\n"],"names":["useToggle","values","arguments","length","undefined","_React$useReducer","React","useReducer","state","action","value","Function","index","Math","abs","indexOf","slice","concat","_React$useReducer2","_slicedToArray"],"mappings":";yFAkBaA,EAAY,WAAsE,IAApDC,EAAwBC,UAAAC,eAAAC,IAAAF,UAAA,GAAAA,UAAG,GAAA,EAAC,GAAO,GAC5EG,EAA2BC,EAAMC,YAC/B,SAACC,EAAgBC,GACf,IAAMC,EAAQD,aAAkBE,SAAWF,EAAOD,EAAM,IAAMC,EACxDG,EAAQC,KAAKC,IAAIN,EAAMO,QAAQL,IACrC,OAAOF,EAAMQ,MAAMJ,GAAOK,OAAOT,EAAMQ,MAAM,EAAGJ,GACjD,GACDX,GACDiB,EAAAC,EAAAd,EAAA,GAED,MAAO,CAFNc,EAAAD,EAAA,GAAA,GAPa,GAASA,EAAA,GAUzB"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
2
  import r from"react";var t=function(t){var e=r.useRef(t);e.current=t,r.useEffect((function(){return function(){e.current()}}),[])};export{t as useUnmount};
3
3
  //# sourceMappingURL=useUnmount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useUnmount.js","sources":["../../../../src/hooks/useUnmount/useUnmount.ts"],"sourcesContent":["import React from 'react';\n\n/**\n * @name useUnmount\n * @description - Hook that defines the logic when unmounting a component\n *\n * @param {() => void} callback The callback function to be invoked on component unmount\n * @returns {void}\n *\n * @example\n * useUnmount(() => console.log('Component unmounted'));\n */\n\nexport const useUnmount = (callback: () => void) => {\n const callbackRef = React.useRef(callback);\n callbackRef.current = callback;\n\n React.useEffect(\n () => () => {\n callbackRef.current();\n },\n []\n );\n};\n"],"names":["useUnmount","callback","callbackRef","React","useRef","current","useEffect"],"mappings":";yBAaaA,EAAa,SAACC,GACzB,IAAMC,EAAcC,EAAMC,OAAOH,GACjCC,EAAYG,QAAUJ,EAEtBE,EAAMG,WACJ,WAAA,OAAM,WACJJ,EAAYG,UACb,GACD,GAEJ"}
1
+ {"version":3,"file":"useUnmount.js","sources":["../../../../src/hooks/useUnmount/useUnmount.ts"],"sourcesContent":["import React from 'react';\n\n/**\n * @name useUnmount\n * @description - Hook that defines the logic when unmounting a component\n *\n * @param {() => void} callback The callback function to be invoked on component unmount\n * @returns {void}\n *\n * @example\n * useUnmount(() => console.log('This effect runs on component unmount'));\n */\n\nexport const useUnmount = (callback: () => void) => {\n const callbackRef = React.useRef(callback);\n callbackRef.current = callback;\n\n React.useEffect(\n () => () => {\n callbackRef.current();\n },\n []\n );\n};\n"],"names":["useUnmount","callback","callbackRef","React","useRef","current","useEffect"],"mappings":";yBAaaA,EAAa,SAACC,GACzB,IAAMC,EAAcC,EAAMC,OAAOH,GACjCC,EAAYG,QAAUJ,EAEtBE,EAAMG,WACJ,WAAA,OAAM,WACJJ,EAAYG,UACb,GACD,GAEJ"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
2
  import{useEventListener as e}from"../useEventListener/useEventListener.js";import"react";var r=function(r,t,n){return e(window,r,t,n)};export{r as useWindowEvent};
3
3
  //# sourceMappingURL=useWindowEvent.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- import{_ as i}from"../../_rollupPluginBabelHelpers-8YyPIzj_.js";import{useState as n}from"react";import{isClient as e}from"../../utils/helpers/isClient.js";import{useEventListener as t}from"../useEventListener/useEventListener.js";var r=function(r){var o,l,d=n({width:e?window.innerWidth:null!==(o=null==r?void 0:r.initialWidth)&&void 0!==o?o:Number.POSITIVE_INFINITY,height:e?window.innerHeight:null!==(l=null==r?void 0:r.initialWidth)&&void 0!==l?l:Number.POSITIVE_INFINITY}),u=i(d,2),h=u[0],s=u[1];return t(window,"resize",(function(){s({width:window.innerWidth,height:window.innerHeight})})),h};export{r as useWindowSize};
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ import{_ as i}from"../../_rollupPluginBabelHelpers-D5_r4iwW.js";import{useState as n}from"react";import{isClient as e}from"../../utils/helpers/isClient.js";import{useEventListener as t}from"../useEventListener/useEventListener.js";var r=function(r){var o,l,d=n({width:e?window.innerWidth:null!==(o=null==r?void 0:r.initialWidth)&&void 0!==o?o:Number.POSITIVE_INFINITY,height:e?window.innerHeight:null!==(l=null==r?void 0:r.initialWidth)&&void 0!==l?l:Number.POSITIVE_INFINITY}),u=i(d,2),h=u[0],s=u[1];return t(window,"resize",(function(){s({width:window.innerWidth,height:window.innerHeight})})),h};export{r as useWindowSize};
3
3
  //# sourceMappingURL=useWindowSize.js.map
package/dist/esm/index.js CHANGED
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- export{useBattery}from"./hooks/useBattery/useBattery.js";export{useBoolean}from"./hooks/useBoolean/useBoolean.js";export{useClickOutside}from"./hooks/useClickOutside/useClickOutside.js";export{legacyCopyToClipboard,useCopyToClipboard}from"./hooks/useCopyToClipboard/useCopyToClipboard.js";export{useCounter}from"./hooks/useCounter/useCounter.js";export{useDebouncedValue}from"./hooks/useDebouncedValue/useDebouncedValue.js";export{useDocumentTitle}from"./hooks/useDocumentTitle/useDocumentTitle.js";export{useDocumentVisibility}from"./hooks/useDocumentVisibility/useDocumentVisibility.js";export{useEventListener}from"./hooks/useEventListener/useEventListener.js";export{useHover}from"./hooks/useHover/useHover.js";export{useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";export{useKeyPress}from"./hooks/useKeyPress/useKeyPress.js";export{useKeyPressEvent}from"./hooks/useKeyPressEvent/useKeyPressEvent.js";export{useKeysPressed}from"./hooks/useKeysPressed/useKeysPressed.js";export{useLocalStorage}from"./hooks/useLocalStorage/useLocalStorage.js";export{useMount}from"./hooks/useMount/useMount.js";export{getConnection,useNetwork}from"./hooks/useNetwork/useNetwork.js";export{useNonInitialEffect}from"./hooks/useNonInitialEffect/useNonInitialEffect.js";export{useOnline}from"./hooks/useOnline/useOnline.js";export{useOrientation}from"./hooks/useOrientation/useOrientation.js";export{useRenderCount}from"./hooks/useRenderCount/useRenderCount.js";export{useSessionStorage}from"./hooks/useSessionStorage/useSessionStorage.js";export{useStep}from"./hooks/useStep/useStep.js";export{dispatchStorageEvent,useStorage}from"./hooks/useStorage/useStorage.js";export{useTimeout}from"./hooks/useTimeout/useTimeout.js";export{useToggle}from"./hooks/useToggle/useToggle.js";export{useUnmount}from"./hooks/useUnmount/useUnmount.js";export{useWindowEvent}from"./hooks/useWindowEvent/useWindowEvent.js";export{useWindowSize}from"./hooks/useWindowSize/useWindowSize.js";import"./_rollupPluginBabelHelpers-8YyPIzj_.js";import"react";import"./utils/helpers/debounce.js";import"./utils/helpers/isClient.js";import"./hooks/useMutationObserver.js";import"./utils/helpers/isShallowEqual.js";
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ export{useBattery}from"./hooks/useBattery/useBattery.js";export{useBoolean}from"./hooks/useBoolean/useBoolean.js";export{useClickOutside}from"./hooks/useClickOutside/useClickOutside.js";export{legacyCopyToClipboard,useCopyToClipboard}from"./hooks/useCopyToClipboard/useCopyToClipboard.js";export{useCounter}from"./hooks/useCounter/useCounter.js";export{useDebouncedValue}from"./hooks/useDebouncedValue/useDebouncedValue.js";export{useDefault}from"./hooks/useDefault/useDefault.js";export{useDidUpdate}from"./hooks/useDidUpdate/useDidUpdate.js";export{useDocumentTitle}from"./hooks/useDocumentTitle/useDocumentTitle.js";export{useDocumentVisibility}from"./hooks/useDocumentVisibility/useDocumentVisibility.js";export{useEvent}from"./hooks/useEvent/useEvent.js";export{useEventListener}from"./hooks/useEventListener/useEventListener.js";export{useFavicon}from"./hooks/useFavicon/useFavicon.js";export{useHash}from"./hooks/useHash/useHash.js";export{isHotkeyMatch,useHotkeys}from"./hooks/useHotkeys/useHotkeys.js";export{useHover}from"./hooks/useHover/useHover.js";export{useIdle}from"./hooks/useIdle/useIdle.js";export{useIntersectionObserver}from"./hooks/useIntersectionObserver/useIntersectionObserver.js";export{useIsomorphicLayoutEffect}from"./hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";export{useKeyPress}from"./hooks/useKeyPress/useKeyPress.js";export{useKeyPressEvent}from"./hooks/useKeyPressEvent/useKeyPressEvent.js";export{useKeysPressed}from"./hooks/useKeysPressed/useKeysPressed.js";export{useLocalStorage}from"./hooks/useLocalStorage/useLocalStorage.js";export{useLogger}from"./hooks/useLogger/useLogger.js";export{useMediaQuery}from"./hooks/useMediaQuery/useMediaQuery.js";export{useMount}from"./hooks/useMount/useMount.js";export{getConnection,useNetwork}from"./hooks/useNetwork/useNetwork.js";export{useOnline}from"./hooks/useOnline/useOnline.js";export{getOperatingSystem,useOperatingSystem}from"./hooks/useOperatingSystem/useOperatingSystem.js";export{useOrientation}from"./hooks/useOrientation/useOrientation.js";export{usePrevious}from"./hooks/usePrevious/usePrevious.js";export{useQueue}from"./hooks/useQueue/useQueue.js";export{useRenderCount}from"./hooks/useRenderCount/useRenderCount.js";export{useRerender}from"./hooks/useRerender/useRerender.js";export{SCRIPT_STATUS_ATTRIBUTE_NAME,useScript}from"./hooks/useScript/useScript.js";export{useSessionStorage}from"./hooks/useSessionStorage/useSessionStorage.js";export{useSet}from"./hooks/useSet/useSet.js";export{useStep}from"./hooks/useStep/useStep.js";export{dispatchStorageEvent,useStorage}from"./hooks/useStorage/useStorage.js";export{useTimeout}from"./hooks/useTimeout/useTimeout.js";export{useToggle}from"./hooks/useToggle/useToggle.js";export{useUnmount}from"./hooks/useUnmount/useUnmount.js";export{useWindowEvent}from"./hooks/useWindowEvent/useWindowEvent.js";export{useWindowSize}from"./hooks/useWindowSize/useWindowSize.js";import"./_rollupPluginBabelHelpers-D5_r4iwW.js";import"react";import"./utils/helpers/debounce.js";import"./utils/helpers/isClient.js";import"./hooks/useMutationObserver.js";import"./utils/helpers/throttle.js";import"./utils/helpers/isShallowEqual.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
2
  var r=function(r,n){var t;return function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];clearTimeout(t),t=setTimeout((function(){return r.apply(void 0,o)}),n)}};export{r as debounce};
3
3
  //# sourceMappingURL=debounce.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
2
- export{debounce}from"./debounce.js";export{isClient}from"./isClient.js";export{isShallowEqual}from"./isShallowEqual.js";
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ export{debounce}from"./debounce.js";export{isClient}from"./isClient.js";export{isShallowEqual}from"./isShallowEqual.js";export{throttle}from"./throttle.js";
3
3
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
2
  var n,d,e=!("undefined"==typeof window||null===(n=window)||void 0===n||!n.document||null===(d=window)||void 0===d||null===(d=d.document)||void 0===d||!d.createElement);export{e as isClient};
3
3
  //# sourceMappingURL=isClient.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.5 */
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
2
  var r=function(r,e){var t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;for(var a=0,f=t;a<f.length;a++){var u=f[a];if(r[u]!==e[u])return!1}return!0};export{r as isShallowEqual};
3
3
  //# sourceMappingURL=isShallowEqual.js.map
@@ -0,0 +1,3 @@
1
+ /* @license @siberiacancode/reactuse v0.0.9 */
2
+ var n=function(n,t){var o=!1;return function(){o||(n.apply(void 0,arguments),o=!0,setTimeout((function(){o=!1}),t))}};export{n as throttle};
3
+ //# sourceMappingURL=throttle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throttle.js","sources":["../../../../src/utils/helpers/throttle.ts"],"sourcesContent":["export const throttle = <Params extends any[]>(\n callback: (...args: Params) => void,\n delay: number\n): ((...args: Params) => void) => {\n let isCalled = false;\n\n return function (...args) {\n if (!isCalled) {\n callback(...args);\n isCalled = true;\n setTimeout(function () {\n isCalled = false;\n }, delay);\n }\n };\n};\n"],"names":["throttle","callback","delay","isCalled","apply","arguments","setTimeout"],"mappings":";AAAO,IAAMA,EAAW,SACtBC,EACAC,GAEA,IAAIC,GAAW,EAEf,OAAO,WACAA,IACHF,EAAQG,WAAAC,EAAAA,WACRF,GAAW,EACXG,YAAW,WACTH,GAAW,CACZ,GAAED,IAGT"}