@siberiacancode/reactuse 0.0.35 → 0.0.36

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 (166) hide show
  1. package/dist/cjs/{_rollupPluginBabelHelpers-KdNaXDbY.js → _rollupPluginBabelHelpers-2fiaYRBt.js} +2 -2
  2. package/dist/cjs/_rollupPluginBabelHelpers-2fiaYRBt.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/useBrowserLanguage/useBrowserLanguage.js +1 -1
  7. package/dist/cjs/hooks/useClickOutside/useClickOutside.js +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/useDebounceCallback/useDebounceCallback.js +1 -1
  11. package/dist/cjs/hooks/useDebounceValue/useDebounceValue.js +2 -2
  12. package/dist/cjs/hooks/useDefault/useDefault.js +2 -2
  13. package/dist/cjs/hooks/useDidUpdate/useDidUpdate.js +1 -1
  14. package/dist/cjs/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
  15. package/dist/cjs/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  16. package/dist/cjs/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  17. package/dist/cjs/hooks/useEvent/useEvent.js +1 -1
  18. package/dist/cjs/hooks/useEventListener/useEventListener.js +1 -1
  19. package/dist/cjs/hooks/useEyeDropper/useEyeDropper.js +2 -2
  20. package/dist/cjs/hooks/useFavicon/useFavicon.js +2 -2
  21. package/dist/cjs/hooks/useField/useField.js +2 -2
  22. package/dist/cjs/hooks/useFps/useFps.js +2 -2
  23. package/dist/cjs/hooks/useFullscreen/useFullscreen.js +2 -2
  24. package/dist/cjs/hooks/useFullscreen/useFullscreen.js.map +1 -1
  25. package/dist/cjs/hooks/useHash/useHash.js +2 -2
  26. package/dist/cjs/hooks/useHotkeys/useHotkeys.js +2 -2
  27. package/dist/cjs/hooks/useHover/useHover.js +2 -2
  28. package/dist/cjs/hooks/useIdle/useIdle.js +2 -2
  29. package/dist/cjs/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  30. package/dist/cjs/hooks/useInterval/useInterval.js +2 -2
  31. package/dist/cjs/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  32. package/dist/cjs/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  33. package/dist/cjs/hooks/useKeyPress/useKeyPress.js +2 -2
  34. package/dist/cjs/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  35. package/dist/cjs/hooks/useKeyboard/useKeyboard.js +1 -1
  36. package/dist/cjs/hooks/useKeysPressed/useKeysPressed.js +2 -2
  37. package/dist/cjs/hooks/useList/useList.js +2 -2
  38. package/dist/cjs/hooks/useLocalStorage/useLocalStorage.js +2 -2
  39. package/dist/cjs/hooks/useLogger/useLogger.js +2 -2
  40. package/dist/cjs/hooks/useLongPress/useLongPress.js +2 -2
  41. package/dist/cjs/hooks/useMediaQuery/useMediaQuery.js +1 -1
  42. package/dist/cjs/hooks/useMount/useMount.js +1 -1
  43. package/dist/cjs/hooks/useMouse/useMouse.js +2 -2
  44. package/dist/cjs/hooks/useMutation/useMutation.js +2 -2
  45. package/dist/cjs/hooks/useMutationObserver.js +1 -1
  46. package/dist/cjs/hooks/useNetwork/useNetwork.js +2 -2
  47. package/dist/cjs/hooks/useOnline/useOnline.js +1 -1
  48. package/dist/cjs/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  49. package/dist/cjs/hooks/useOrientation/useOrientation.js +2 -2
  50. package/dist/cjs/hooks/usePageLeave/usePageLeave.js +2 -2
  51. package/dist/cjs/hooks/usePaint/usePaint.js +2 -2
  52. package/dist/cjs/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  53. package/dist/cjs/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
  54. package/dist/cjs/hooks/usePrevious/usePrevious.js +1 -1
  55. package/dist/cjs/hooks/useQRCode/useQRCode.js +2 -2
  56. package/dist/cjs/hooks/useQRCode/useQRCode.js.map +1 -1
  57. package/dist/cjs/hooks/useQuery/useQuery.js +2 -2
  58. package/dist/cjs/hooks/useQueue/useQueue.js +2 -2
  59. package/dist/cjs/hooks/useRenderCount/useRenderCount.js +1 -1
  60. package/dist/cjs/hooks/useRenderInfo/useRenderInfo.js +1 -1
  61. package/dist/cjs/hooks/useRerender/useRerender.js +2 -2
  62. package/dist/cjs/hooks/useScript/useScript.js +2 -2
  63. package/dist/cjs/hooks/useSessionStorage/useSessionStorage.js +2 -2
  64. package/dist/cjs/hooks/useSet/useSet.js +2 -2
  65. package/dist/cjs/hooks/useStep/useStep.js +2 -2
  66. package/dist/cjs/hooks/useStorage/useStorage.js +2 -2
  67. package/dist/cjs/hooks/useTextSelection/useTextSelection.js +2 -2
  68. package/dist/cjs/hooks/useTime/useTime.js +2 -2
  69. package/dist/cjs/hooks/useTimeout/useTimeout.js +2 -2
  70. package/dist/cjs/hooks/useToggle/useToggle.js +2 -2
  71. package/dist/cjs/hooks/useUnmount/useUnmount.js +1 -1
  72. package/dist/cjs/hooks/useWebSocket/useWebSocket.js +2 -2
  73. package/dist/cjs/hooks/useWindowEvent/useWindowEvent.js +1 -1
  74. package/dist/cjs/hooks/useWindowSize/useWindowSize.js +2 -2
  75. package/dist/cjs/index.js +2 -2
  76. package/dist/cjs/utils/helpers/debounce.js +1 -1
  77. package/dist/cjs/utils/helpers/getRetry.js +1 -1
  78. package/dist/cjs/utils/helpers/index.js +1 -1
  79. package/dist/cjs/utils/helpers/isClient.js +1 -1
  80. package/dist/cjs/utils/helpers/throttle.js +1 -1
  81. package/dist/cjs/utils/helpers/time/getDate.js +1 -1
  82. package/dist/esm/{_rollupPluginBabelHelpers-CEUGrTA3.js → _rollupPluginBabelHelpers-y7qx6l7m.js} +2 -2
  83. package/dist/esm/_rollupPluginBabelHelpers-y7qx6l7m.js.map +1 -0
  84. package/dist/esm/hooks/index.js +2 -2
  85. package/dist/esm/hooks/useBattery/useBattery.js +2 -2
  86. package/dist/esm/hooks/useBoolean/useBoolean.js +2 -2
  87. package/dist/esm/hooks/useBrowserLanguage/useBrowserLanguage.js +1 -1
  88. package/dist/esm/hooks/useClickOutside/useClickOutside.js +1 -1
  89. package/dist/esm/hooks/useCopyToClipboard/useCopyToClipboard.js +2 -2
  90. package/dist/esm/hooks/useCounter/useCounter.js +2 -2
  91. package/dist/esm/hooks/useDebounceCallback/useDebounceCallback.js +1 -1
  92. package/dist/esm/hooks/useDebounceValue/useDebounceValue.js +2 -2
  93. package/dist/esm/hooks/useDefault/useDefault.js +2 -2
  94. package/dist/esm/hooks/useDidUpdate/useDidUpdate.js +1 -1
  95. package/dist/esm/hooks/useDocumentEvent/useDocumentEvent.js +1 -1
  96. package/dist/esm/hooks/useDocumentTitle/useDocumentTitle.js +2 -2
  97. package/dist/esm/hooks/useDocumentVisibility/useDocumentVisibility.js +1 -1
  98. package/dist/esm/hooks/useEvent/useEvent.js +1 -1
  99. package/dist/esm/hooks/useEventListener/useEventListener.js +1 -1
  100. package/dist/esm/hooks/useEyeDropper/useEyeDropper.js +2 -2
  101. package/dist/esm/hooks/useFavicon/useFavicon.js +2 -2
  102. package/dist/esm/hooks/useField/useField.js +2 -2
  103. package/dist/esm/hooks/useFps/useFps.js +2 -2
  104. package/dist/esm/hooks/useFullscreen/useFullscreen.js +2 -2
  105. package/dist/esm/hooks/useFullscreen/useFullscreen.js.map +1 -1
  106. package/dist/esm/hooks/useHash/useHash.js +2 -2
  107. package/dist/esm/hooks/useHotkeys/useHotkeys.js +2 -2
  108. package/dist/esm/hooks/useHover/useHover.js +2 -2
  109. package/dist/esm/hooks/useIdle/useIdle.js +2 -2
  110. package/dist/esm/hooks/useIntersectionObserver/useIntersectionObserver.js +2 -2
  111. package/dist/esm/hooks/useInterval/useInterval.js +2 -2
  112. package/dist/esm/hooks/useIsFirstRender/useIsFirstRender.js +1 -1
  113. package/dist/esm/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +1 -1
  114. package/dist/esm/hooks/useKeyPress/useKeyPress.js +2 -2
  115. package/dist/esm/hooks/useKeyPressEvent/useKeyPressEvent.js +1 -1
  116. package/dist/esm/hooks/useKeyboard/useKeyboard.js +1 -1
  117. package/dist/esm/hooks/useKeysPressed/useKeysPressed.js +2 -2
  118. package/dist/esm/hooks/useList/useList.js +2 -2
  119. package/dist/esm/hooks/useLocalStorage/useLocalStorage.js +2 -2
  120. package/dist/esm/hooks/useLogger/useLogger.js +2 -2
  121. package/dist/esm/hooks/useLongPress/useLongPress.js +2 -2
  122. package/dist/esm/hooks/useMediaQuery/useMediaQuery.js +1 -1
  123. package/dist/esm/hooks/useMount/useMount.js +1 -1
  124. package/dist/esm/hooks/useMouse/useMouse.js +2 -2
  125. package/dist/esm/hooks/useMutation/useMutation.js +2 -2
  126. package/dist/esm/hooks/useMutationObserver.js +1 -1
  127. package/dist/esm/hooks/useNetwork/useNetwork.js +2 -2
  128. package/dist/esm/hooks/useOnline/useOnline.js +1 -1
  129. package/dist/esm/hooks/useOperatingSystem/useOperatingSystem.js +1 -1
  130. package/dist/esm/hooks/useOrientation/useOrientation.js +2 -2
  131. package/dist/esm/hooks/usePageLeave/usePageLeave.js +2 -2
  132. package/dist/esm/hooks/usePaint/usePaint.js +2 -2
  133. package/dist/esm/hooks/usePreferredColorScheme/usePreferredColorScheme.js +1 -1
  134. package/dist/esm/hooks/usePreferredLanguages/usePreferredLanguages.js +1 -1
  135. package/dist/esm/hooks/usePrevious/usePrevious.js +1 -1
  136. package/dist/esm/hooks/useQRCode/useQRCode.js +2 -2
  137. package/dist/esm/hooks/useQRCode/useQRCode.js.map +1 -1
  138. package/dist/esm/hooks/useQuery/useQuery.js +2 -2
  139. package/dist/esm/hooks/useQueue/useQueue.js +2 -2
  140. package/dist/esm/hooks/useRenderCount/useRenderCount.js +1 -1
  141. package/dist/esm/hooks/useRenderInfo/useRenderInfo.js +1 -1
  142. package/dist/esm/hooks/useRerender/useRerender.js +2 -2
  143. package/dist/esm/hooks/useScript/useScript.js +2 -2
  144. package/dist/esm/hooks/useSessionStorage/useSessionStorage.js +2 -2
  145. package/dist/esm/hooks/useSet/useSet.js +2 -2
  146. package/dist/esm/hooks/useStep/useStep.js +2 -2
  147. package/dist/esm/hooks/useStorage/useStorage.js +2 -2
  148. package/dist/esm/hooks/useTextSelection/useTextSelection.js +2 -2
  149. package/dist/esm/hooks/useTime/useTime.js +2 -2
  150. package/dist/esm/hooks/useTimeout/useTimeout.js +2 -2
  151. package/dist/esm/hooks/useToggle/useToggle.js +2 -2
  152. package/dist/esm/hooks/useUnmount/useUnmount.js +1 -1
  153. package/dist/esm/hooks/useWebSocket/useWebSocket.js +2 -2
  154. package/dist/esm/hooks/useWindowEvent/useWindowEvent.js +1 -1
  155. package/dist/esm/hooks/useWindowSize/useWindowSize.js +2 -2
  156. package/dist/esm/index.js +2 -2
  157. package/dist/esm/utils/helpers/debounce.js +1 -1
  158. package/dist/esm/utils/helpers/getRetry.js +1 -1
  159. package/dist/esm/utils/helpers/index.js +1 -1
  160. package/dist/esm/utils/helpers/isClient.js +1 -1
  161. package/dist/esm/utils/helpers/throttle.js +1 -1
  162. package/dist/esm/utils/helpers/time/getDate.js +1 -1
  163. package/dist/index.d.ts +1 -49
  164. package/package.json +3 -5
  165. package/dist/cjs/_rollupPluginBabelHelpers-KdNaXDbY.js.map +0 -1
  166. package/dist/esm/_rollupPluginBabelHelpers-CEUGrTA3.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"useFullscreen.js","sources":["../../../../node_modules/screenfull/index.js","../../../../src/hooks/useFullscreen/useFullscreen.ts"],"sourcesContent":["/* eslint-disable promise/prefer-await-to-then */\n\nconst methodMap = [\n\t[\n\t\t'requestFullscreen',\n\t\t'exitFullscreen',\n\t\t'fullscreenElement',\n\t\t'fullscreenEnabled',\n\t\t'fullscreenchange',\n\t\t'fullscreenerror',\n\t],\n\t// New WebKit\n\t[\n\t\t'webkitRequestFullscreen',\n\t\t'webkitExitFullscreen',\n\t\t'webkitFullscreenElement',\n\t\t'webkitFullscreenEnabled',\n\t\t'webkitfullscreenchange',\n\t\t'webkitfullscreenerror',\n\n\t],\n\t// Old WebKit\n\t[\n\t\t'webkitRequestFullScreen',\n\t\t'webkitCancelFullScreen',\n\t\t'webkitCurrentFullScreenElement',\n\t\t'webkitCancelFullScreen',\n\t\t'webkitfullscreenchange',\n\t\t'webkitfullscreenerror',\n\n\t],\n\t[\n\t\t'mozRequestFullScreen',\n\t\t'mozCancelFullScreen',\n\t\t'mozFullScreenElement',\n\t\t'mozFullScreenEnabled',\n\t\t'mozfullscreenchange',\n\t\t'mozfullscreenerror',\n\t],\n\t[\n\t\t'msRequestFullscreen',\n\t\t'msExitFullscreen',\n\t\t'msFullscreenElement',\n\t\t'msFullscreenEnabled',\n\t\t'MSFullscreenChange',\n\t\t'MSFullscreenError',\n\t],\n];\n\nconst nativeAPI = (() => {\n\tif (typeof document === 'undefined') {\n\t\treturn false;\n\t}\n\n\tconst unprefixedMethods = methodMap[0];\n\tconst returnValue = {};\n\n\tfor (const methodList of methodMap) {\n\t\tconst exitFullscreenMethod = methodList?.[1];\n\t\tif (exitFullscreenMethod in document) {\n\t\t\tfor (const [index, method] of methodList.entries()) {\n\t\t\t\treturnValue[unprefixedMethods[index]] = method;\n\t\t\t}\n\n\t\t\treturn returnValue;\n\t\t}\n\t}\n\n\treturn false;\n})();\n\nconst eventNameMap = {\n\tchange: nativeAPI.fullscreenchange,\n\terror: nativeAPI.fullscreenerror,\n};\n\n// eslint-disable-next-line import/no-mutable-exports\nlet screenfull = {\n\t// eslint-disable-next-line default-param-last\n\trequest(element = document.documentElement, options) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst onFullScreenEntered = () => {\n\t\t\t\tscreenfull.off('change', onFullScreenEntered);\n\t\t\t\tresolve();\n\t\t\t};\n\n\t\t\tscreenfull.on('change', onFullScreenEntered);\n\n\t\t\tconst returnPromise = element[nativeAPI.requestFullscreen](options);\n\n\t\t\tif (returnPromise instanceof Promise) {\n\t\t\t\treturnPromise.then(onFullScreenEntered).catch(reject);\n\t\t\t}\n\t\t});\n\t},\n\texit() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif (!screenfull.isFullscreen) {\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst onFullScreenExit = () => {\n\t\t\t\tscreenfull.off('change', onFullScreenExit);\n\t\t\t\tresolve();\n\t\t\t};\n\n\t\t\tscreenfull.on('change', onFullScreenExit);\n\n\t\t\tconst returnPromise = document[nativeAPI.exitFullscreen]();\n\n\t\t\tif (returnPromise instanceof Promise) {\n\t\t\t\treturnPromise.then(onFullScreenExit).catch(reject);\n\t\t\t}\n\t\t});\n\t},\n\ttoggle(element, options) {\n\t\treturn screenfull.isFullscreen ? screenfull.exit() : screenfull.request(element, options);\n\t},\n\tonchange(callback) {\n\t\tscreenfull.on('change', callback);\n\t},\n\tonerror(callback) {\n\t\tscreenfull.on('error', callback);\n\t},\n\ton(event, callback) {\n\t\tconst eventName = eventNameMap[event];\n\t\tif (eventName) {\n\t\t\tdocument.addEventListener(eventName, callback, false);\n\t\t}\n\t},\n\toff(event, callback) {\n\t\tconst eventName = eventNameMap[event];\n\t\tif (eventName) {\n\t\t\tdocument.removeEventListener(eventName, callback, false);\n\t\t}\n\t},\n\traw: nativeAPI,\n};\n\nObject.defineProperties(screenfull, {\n\tisFullscreen: {\n\t\tget: () => Boolean(document[nativeAPI.fullscreenElement]),\n\t},\n\telement: {\n\t\tenumerable: true,\n\t\tget: () => document[nativeAPI.fullscreenElement] ?? undefined,\n\t},\n\tisEnabled: {\n\t\tenumerable: true,\n\t\t// Coerce to boolean in case of old WebKit.\n\t\tget: () => Boolean(document[nativeAPI.fullscreenEnabled]),\n\t},\n});\n\nif (!nativeAPI) {\n\tscreenfull = {isEnabled: false};\n}\n\nexport default screenfull;\n","import type { RefObject } from 'react';\nimport { useRef, useState } from 'react';\nimport screenfull from 'screenfull';\n\nimport { useUnmount } from '../useUnmount/useUnmount';\n\n/** The use fullscreen target element type */\ntype UseFullScreenTarget = RefObject<Element | null> | (() => Element) | Element;\n\n/** Function to get target element based on its type */\nconst getElement = (target: UseFullScreenTarget) => {\n if (typeof target === 'function') {\n return target();\n }\n\n if (target instanceof Element) {\n return target;\n }\n\n return target.current;\n};\n\n/** The use fullscreen options type */\nexport interface UseFullScreenOptions {\n /** initial value */\n initialValue?: boolean;\n /** on enter fullscreen */\n onEnter?: () => void;\n /** on exit fullscreen */\n onExit?: () => void;\n}\n\n/** The use click outside return type */\nexport interface UseFullScreenReturn {\n enter: () => void;\n exit: () => void;\n toggle: () => void;\n value: boolean;\n}\n\nexport type UseFullScreen = {\n <Target extends UseFullScreenTarget>(\n target: Target,\n options?: UseFullScreenOptions\n ): UseFullScreenReturn;\n\n <Target extends UseFullScreenTarget>(\n options?: UseFullScreenOptions,\n target?: never\n ): UseFullScreenReturn & { ref: RefObject<Target> };\n};\n\n/**\n * @name useFullscreen\n * @description - Hook to handle fullscreen events\n *\n * @overload\n * @template Target The target element for fullscreen\n * @param {Target} target The target element for fullscreen\n * @param {boolean} [options.initialValue=false] initial value of fullscreen\n * @param {() => void} [options.onEnter] on enter fullscreen\n * @param {() => void} [options.onExit] on exit fullscreen\n * @returns {UseFullScreenReturn} An object with the fullscreen state and methods\n *\n * @example\n * const { enter, exit, toggle, value } = useFullscreen(ref);\n *\n * @overload\n * @template Target The target element for fullscreen\n * @param {boolean} [options.initialValue=false] initial value of fullscreen\n * @param {() => void} [options.onEnter] on enter fullscreen\n * @param {() => void} [options.onExit] on exit fullscreen\n * @returns {UseFullScreenReturn & { ref: RefObject<Target> }} An object with the fullscreen state and methods\n *\n * @example\n * const { ref, enter, exit, toggle, value } = useFullscreen();\n */\nexport const useFullscreen = ((...params: any[]) => {\n const target = (typeof params[1] === 'undefined' ? undefined : params[0]) as\n | UseFullScreenTarget\n | undefined;\n const options = (target ? params[1] : params[0]) as UseFullScreenOptions | undefined;\n\n const internalRef = useRef<Element>(null);\n const [value, setValue] = useState(options?.initialValue ?? false);\n\n const onChange = () => {\n if (!screenfull.isEnabled) return;\n\n if (screenfull.isFullscreen) {\n options?.onEnter?.();\n } else {\n screenfull.off('change', onChange);\n options?.onExit?.();\n }\n\n setValue(screenfull.isFullscreen);\n };\n\n const enter = () => {\n const element = target ? getElement(target) : internalRef.current;\n if (!element) return;\n\n if (screenfull.isEnabled) {\n try {\n screenfull.request(element);\n screenfull.on('change', onChange);\n } catch (error) {\n console.error(error);\n }\n }\n };\n\n const exit = () => {\n if (screenfull.isEnabled) screenfull.exit();\n };\n\n const toggle = () => {\n if (value) return exit();\n enter();\n };\n\n useUnmount(() => {\n if (screenfull.isEnabled) screenfull.off('change', onChange);\n });\n\n return {\n ...(!target && { ref: internalRef }),\n enter,\n exit,\n toggle,\n value\n };\n}) as UseFullScreen;\n"],"names":["methodMap","nativeAPI","document","unprefixedMethods","returnValue","methodList","exitFullscreenMethod","index","method","entries","eventNameMap","change","fullscreenchange","error","fullscreenerror","screenfull","request","element","documentElement","options","Promise","resolve","reject","onFullScreenEntered","off","on","returnPromise","requestFullscreen","then","catch","exit","isFullscreen","onFullScreenExit","exitFullscreen","toggle","onchange","callback","onerror","event","eventName","addEventListener","removeEventListener","raw","Object","defineProperties","get","Boolean","fullscreenElement","enumerable","undefined","isEnabled","fullscreenEnabled","screenfull$1","useFullscreen","_options$initialValue","target","arguments","length","internalRef","useRef","_useState","useState","initialValue","_useState2","_slicedToArray","value","setValue","onChange","_options$onEnter","_options$onExit","onEnter","call","onExit","enter","Element","current","getElement","console","useUnmount","_objectSpread","ref"],"mappings":";6KAEA,MAAMA,EAAY,CACjB,CACC,oBACA,iBACA,oBACA,oBACA,mBACA,mBAGD,CACC,0BACA,uBACA,0BACA,0BACA,yBACA,yBAID,CACC,0BACA,yBACA,iCACA,yBACA,yBACA,yBAGD,CACC,uBACA,sBACA,uBACA,uBACA,sBACA,sBAED,CACC,sBACA,mBACA,sBACA,sBACA,qBACA,sBAIIC,EAAY,MACjB,GAAwB,oBAAbC,SACV,OAAO,EAGR,MAAMC,EAAoBH,EAAU,GAC9BI,EAAc,CAAA,EAEpB,IAAK,MAAMC,KAAcL,EAAW,CACnC,MAAMM,EAAuBD,IAAa,GAC1C,GAAIC,KAAwBJ,SAAU,CACrC,IAAK,MAAOK,EAAOC,KAAWH,EAAWI,UACxCL,EAAYD,EAAkBI,IAAUC,EAGzC,OAAOJ,CACP,CACD,CAED,OAAO,CACP,EApBiB,GAsBZM,EAAe,CACpBC,OAAQV,EAAUW,iBAClBC,MAAOZ,EAAUa,iBAIlB,IAAIC,EAAa,CAEhBC,QAAO,CAACC,EAAUf,SAASgB,gBAAiBC,IACpC,IAAIC,SAAQ,CAACC,EAASC,KAC5B,MAAMC,EAAsB,KAC3BR,EAAWS,IAAI,SAAUD,GACzBF,GAAS,EAGVN,EAAWU,GAAG,SAAUF,GAExB,MAAMG,EAAgBT,EAAQhB,EAAU0B,mBAAmBR,GAEvDO,aAAyBN,SAC5BM,EAAcE,KAAKL,GAAqBM,MAAMP,EAC9C,IAGHQ,KAAI,IACI,IAAIV,SAAQ,CAACC,EAASC,KAC5B,IAAKP,EAAWgB,aAEf,YADAV,IAID,MAAMW,EAAmB,KACxBjB,EAAWS,IAAI,SAAUQ,GACzBX,GAAS,EAGVN,EAAWU,GAAG,SAAUO,GAExB,MAAMN,EAAgBxB,SAASD,EAAUgC,kBAErCP,aAAyBN,SAC5BM,EAAcE,KAAKI,GAAkBH,MAAMP,EAC3C,IAGHY,OAAM,CAACjB,EAASE,IACRJ,EAAWgB,aAAehB,EAAWe,OAASf,EAAWC,QAAQC,EAASE,GAElF,QAAAgB,CAASC,GACRrB,EAAWU,GAAG,SAAUW,EACxB,EACD,OAAAC,CAAQD,GACPrB,EAAWU,GAAG,QAASW,EACvB,EACD,EAAAX,CAAGa,EAAOF,GACT,MAAMG,EAAY7B,EAAa4B,GAC3BC,GACHrC,SAASsC,iBAAiBD,EAAWH,GAAU,EAEhD,EACD,GAAAZ,CAAIc,EAAOF,GACV,MAAMG,EAAY7B,EAAa4B,GAC3BC,GACHrC,SAASuC,oBAAoBF,EAAWH,GAAU,EAEnD,EACDM,IAAKzC,GAGN0C,OAAOC,iBAAiB7B,EAAY,CACnCgB,aAAc,CACbc,IAAK,IAAMC,QAAQ5C,SAASD,EAAU8C,qBAEvC9B,QAAS,CACR+B,YAAY,EACZH,IAAK,IAAM3C,SAASD,EAAU8C,yBAAsBE,GAErDC,UAAW,CACVF,YAAY,EAEZH,IAAK,IAAMC,QAAQ5C,SAASD,EAAUkD,uBAInClD,IACJc,EAAa,CAACmC,WAAW,IAG1B,IAAAE,EAAerC,EClFFsC,EAAiB,WAAsB,IAAAC,EAC5CC,OAA+B,KAArBC,UAAAC,QAAA,OAAAR,EAAAO,UAAA,KAA4CA,UAAAC,QAAAR,OAATA,EAASO,UAE/C,GACPrC,EAAWoC,EAAMC,UAAAC,QAAAR,OAAAA,EAAAO,UAAA,GAAAA,UAAAC,eAAAR,EAAAO,UAA6D,GAE9EE,EAAcC,EAAgB,MACpCC,EAA0BC,EAA8BP,QAAtBA,EAACnC,eAAAA,EAAS2C,wBAAYR,GAAAA,GAAUS,EAAAC,EAAAJ,EAAA,GAA3DK,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAEhBI,EAAW,SAAXA,IACJ,GAAKpD,EAAWmC,UAAhB,CAE6B,IAAAkB,EAEtBC,EAFP,GAAItD,EAAWgB,aACbZ,SAAgBiD,QAATA,EAAPjD,EAASmD,mBAAOF,GAAhBA,EAAAG,KAAApD,QAEAJ,EAAWS,IAAI,SAAU2C,GACzBhD,SAAekD,QAARA,EAAPlD,EAASqD,kBAAMH,GAAfA,EAAAE,KAAApD,GAGF+C,EAASnD,EAAWgB,aATO,GAYvB0C,EAAQ,WACZ,IAAMxD,EAAUsC,EA1FD,SAACA,GAClB,MAAsB,mBAAXA,EACFA,IAGLA,aAAkBmB,QACbnB,EAGFA,EAAOoB,OAChB,CAgF6BC,CAAWrB,GAAUG,EAAYiB,QAC1D,GAAK1D,GAEDF,EAAWmC,UACb,IACEnC,EAAWC,QAAQC,GACnBF,EAAWU,GAAG,SAAU0C,EACzB,CAAC,MAAOtD,GACPgE,QAAQhE,MAAMA,EAChB,GAIEiB,EAAO,WACPf,EAAWmC,WAAWnC,EAAWe,QAYvC,OAJAgD,GAAW,WACL/D,EAAWmC,WAAWnC,EAAWS,IAAI,SAAU2C,EACrD,IAEAY,EAAAA,EACM,CAAA,GAACxB,GAAU,CAAEyB,IAAKtB,IAAa,CAAA,EAAA,CACnCe,MAAAA,EACA3C,KAAAA,EACAI,OAba,WACb,GAAI+B,EAAO,OAAOnC,IAClB2C,KAYAR,MAAAA,GAEJ","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"useFullscreen.js","sources":["../../../../src/hooks/useFullscreen/useFullscreen.ts"],"sourcesContent":["import type { RefObject } from 'react';\nimport { useRef, useState } from 'react';\nimport screenfull from 'screenfull';\n\nimport { useUnmount } from '../useUnmount/useUnmount';\n\n/** The use fullscreen target element type */\ntype UseFullScreenTarget = RefObject<Element | null> | (() => Element) | Element;\n\n/** Function to get target element based on its type */\nconst getElement = (target: UseFullScreenTarget) => {\n if (typeof target === 'function') {\n return target();\n }\n\n if (target instanceof Element) {\n return target;\n }\n\n return target.current;\n};\n\n/** The use fullscreen options type */\nexport interface UseFullScreenOptions {\n /** initial value */\n initialValue?: boolean;\n /** on enter fullscreen */\n onEnter?: () => void;\n /** on exit fullscreen */\n onExit?: () => void;\n}\n\n/** The use click outside return type */\nexport interface UseFullScreenReturn {\n enter: () => void;\n exit: () => void;\n toggle: () => void;\n value: boolean;\n}\n\nexport type UseFullScreen = {\n <Target extends UseFullScreenTarget>(\n target: Target,\n options?: UseFullScreenOptions\n ): UseFullScreenReturn;\n\n <Target extends UseFullScreenTarget>(\n options?: UseFullScreenOptions,\n target?: never\n ): UseFullScreenReturn & { ref: RefObject<Target> };\n};\n\n/**\n * @name useFullscreen\n * @description - Hook to handle fullscreen events\n *\n * @overload\n * @template Target The target element for fullscreen\n * @param {Target} target The target element for fullscreen\n * @param {boolean} [options.initialValue=false] initial value of fullscreen\n * @param {() => void} [options.onEnter] on enter fullscreen\n * @param {() => void} [options.onExit] on exit fullscreen\n * @returns {UseFullScreenReturn} An object with the fullscreen state and methods\n *\n * @example\n * const { enter, exit, toggle, value } = useFullscreen(ref);\n *\n * @overload\n * @template Target The target element for fullscreen\n * @param {boolean} [options.initialValue=false] initial value of fullscreen\n * @param {() => void} [options.onEnter] on enter fullscreen\n * @param {() => void} [options.onExit] on exit fullscreen\n * @returns {UseFullScreenReturn & { ref: RefObject<Target> }} An object with the fullscreen state and methods\n *\n * @example\n * const { ref, enter, exit, toggle, value } = useFullscreen();\n */\nexport const useFullscreen = ((...params: any[]) => {\n const target = (typeof params[1] === 'undefined' ? undefined : params[0]) as\n | UseFullScreenTarget\n | undefined;\n const options = (target ? params[1] : params[0]) as UseFullScreenOptions | undefined;\n\n const internalRef = useRef<Element>(null);\n const [value, setValue] = useState(options?.initialValue ?? false);\n\n const onChange = () => {\n if (!screenfull.isEnabled) return;\n\n if (screenfull.isFullscreen) {\n options?.onEnter?.();\n } else {\n screenfull.off('change', onChange);\n options?.onExit?.();\n }\n\n setValue(screenfull.isFullscreen);\n };\n\n const enter = () => {\n const element = target ? getElement(target) : internalRef.current;\n if (!element) return;\n\n if (screenfull.isEnabled) {\n try {\n screenfull.request(element);\n screenfull.on('change', onChange);\n } catch (error) {\n console.error(error);\n }\n }\n };\n\n const exit = () => {\n if (screenfull.isEnabled) screenfull.exit();\n };\n\n const toggle = () => {\n if (value) return exit();\n enter();\n };\n\n useUnmount(() => {\n if (screenfull.isEnabled) screenfull.off('change', onChange);\n });\n\n return {\n ...(!target && { ref: internalRef }),\n enter,\n exit,\n toggle,\n value\n };\n}) as UseFullScreen;\n"],"names":["useFullscreen","_options$initialValue","target","arguments","length","undefined","options","internalRef","useRef","_useState","useState","initialValue","_useState2","_slicedToArray","value","setValue","onChange","screenfull","isEnabled","_options$onEnter","_options$onExit","isFullscreen","onEnter","call","off","onExit","enter","element","Element","current","getElement","request","on","error","console","exit","useUnmount","_objectSpread","ref","toggle"],"mappings":";uMAUA,IAmEaA,EAAiB,WAAsB,IAAAC,EAC5CC,OAA+B,KAArBC,UAAAC,QAAA,OAAAC,EAAAF,UAAA,KAA4CA,UAAAC,QAAAC,OAATA,EAASF,UAE/C,GACPG,EAAWJ,EAAMC,UAAAC,QAAAC,OAAAA,EAAAF,UAAA,GAAAA,UAAAC,eAAAC,EAAAF,UAA6D,GAE9EI,EAAcC,EAAgB,MACpCC,EAA0BC,EAA8BT,QAAtBA,EAACK,eAAAA,EAASK,wBAAYV,GAAAA,GAAUW,EAAAC,EAAAJ,EAAA,GAA3DK,EAAKF,EAAA,GAAEG,EAAQH,EAAA,GAEhBI,EAAW,SAAXA,IACJ,GAAKC,EAAWC,UAAhB,CAE6B,IAAAC,EAEtBC,EAFP,GAAIH,EAAWI,aACbf,SAAgBa,QAATA,EAAPb,EAASgB,mBAAOH,GAAhBA,EAAAI,KAAAjB,QAEAW,EAAWO,IAAI,SAAUR,GACzBV,SAAec,QAARA,EAAPd,EAASmB,kBAAML,GAAfA,EAAAG,KAAAjB,GAGFS,EAASE,EAAWI,aATO,GAYvBK,EAAQ,WACZ,IAAMC,EAAUzB,EA1FD,SAACA,GAClB,MAAsB,mBAAXA,EACFA,IAGLA,aAAkB0B,QACb1B,EAGFA,EAAO2B,OAChB,CAgF6BC,CAAW5B,GAAUK,EAAYsB,QAC1D,GAAKF,GAEDV,EAAWC,UACb,IACED,EAAWc,QAAQJ,GACnBV,EAAWe,GAAG,SAAUhB,EACzB,CAAC,MAAOiB,GACPC,QAAQD,MAAMA,EAChB,GAIEE,EAAO,WACPlB,EAAWC,WAAWD,EAAWkB,QAYvC,OAJAC,GAAW,WACLnB,EAAWC,WAAWD,EAAWO,IAAI,SAAUR,EACrD,IAEAqB,EAAAA,EACM,CAAA,GAACnC,GAAU,CAAEoC,IAAK/B,IAAa,CAAA,EAAA,CACnCmB,MAAAA,EACAS,KAAAA,EACAI,OAba,WACb,GAAIzB,EAAO,OAAOqB,IAClBT,KAYAZ,MAAAA,GAEJ"}
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as n}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as o,useEffect as e}from"react";var r=function(){return decodeURIComponent(window.location.hash.replace("#",""))},t=function(){var t=o(window?r():""),i=n(t,2),a=i[0],c=i[1];return e((function(){var n=function(){return c(r())};return window.addEventListener("hashchange",n),function(){window.removeEventListener("hashchange",n)}})),[a,function(n){window.location.hash=n,c(n)}]};export{t as useHash};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as n}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as o,useEffect as e}from"react";var r=function(){return decodeURIComponent(window.location.hash.replace("#",""))},t=function(){var t=o(window?r():""),i=n(t,2),a=i[0],c=i[1];return e((function(){var n=function(){return c(r())};return window.addEventListener("hashchange",n),function(){window.removeEventListener("hashchange",n)}})),[a,function(n){window.location.hash=n,c(n)}]};export{t as useHash};
3
3
  //# sourceMappingURL=useHash.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as e,c as o}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as n}from"react";import{useDidUpdate as t}from"../useDidUpdate/useDidUpdate.js";import{useEventListener as r}from"../useEventListener/useEventListener.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";import"../useEvent/useEvent.js";var i=function(e,o){return e.toLowerCase().split(/[+_-]/g).map((function(e){return e.trim()})).every((function(e){return o.find((function(o){return e===o.code.toLocaleLowerCase()||e===o.key.toLocaleLowerCase()||e===o.alias.toLocaleLowerCase()}))}))},u=function(u,l,a){var s,c,d,f,v=null===(s=null==a?void 0:a.enabled)||void 0===s||s,p=null===(c=null==a?void 0:a.preventDefault)||void 0===c||c,m=n([]),y=e(m,2)[1];t((function(){y([])}),[v]),r(null!==(d=null==a?void 0:a.target)&&void 0!==d?d:window,"keydown",(function(e){p&&e.preventDefault(),v&&y((function(n){var t,r,s,c;if(n.some((function(o){return o.code===e.code})))return n;var d=null!==(t=null!==(r=null==a||null===(s=a.aliasMap)||void 0===s?void 0:s[e.key])&&void 0!==r?r:null==a||null===(c=a.aliasMap)||void 0===c?void 0:c[e.key])&&void 0!==t?t:e.code,f=[].concat(o(n),[{key:e.key,code:e.code,alias:d}]);Array.isArray(u)?u.forEach((function(o){i(o,f)&&l(e)})):i(u,f)&&l(e);return f}))})),r(null!==(f=null==a?void 0:a.target)&&void 0!==f?f:window,"keyup",(function(e){v&&y((function(o){return o.filter((function(o){return o.code!==e.code}))}))}))};export{i as isHotkeyMatch,u as useHotkeys};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as e,c as o}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as n}from"react";import{useDidUpdate as t}from"../useDidUpdate/useDidUpdate.js";import{useEventListener as r}from"../useEventListener/useEventListener.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";import"../useEvent/useEvent.js";var i=function(e,o){return e.toLowerCase().split(/[+_-]/g).map((function(e){return e.trim()})).every((function(e){return o.find((function(o){return e===o.code.toLocaleLowerCase()||e===o.key.toLocaleLowerCase()||e===o.alias.toLocaleLowerCase()}))}))},u=function(u,l,a){var s,c,d,f,v=null===(s=null==a?void 0:a.enabled)||void 0===s||s,p=null===(c=null==a?void 0:a.preventDefault)||void 0===c||c,m=n([]),y=e(m,2)[1];t((function(){y([])}),[v]),r(null!==(d=null==a?void 0:a.target)&&void 0!==d?d:window,"keydown",(function(e){p&&e.preventDefault(),v&&y((function(n){var t,r,s,c;if(n.some((function(o){return o.code===e.code})))return n;var d=null!==(t=null!==(r=null==a||null===(s=a.aliasMap)||void 0===s?void 0:s[e.key])&&void 0!==r?r:null==a||null===(c=a.aliasMap)||void 0===c?void 0:c[e.key])&&void 0!==t?t:e.code,f=[].concat(o(n),[{key:e.key,code:e.code,alias:d}]);Array.isArray(u)?u.forEach((function(o){i(o,f)&&l(e)})):i(u,f)&&l(e);return f}))})),r(null!==(f=null==a?void 0:a.target)&&void 0!==f?f:window,"keyup",(function(e){v&&y((function(o){return o.filter((function(o){return o.code!==e.code}))}))}))};export{i as isHotkeyMatch,u as useHotkeys};
3
3
  //# sourceMappingURL=useHotkeys.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{a as e,_ as n}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as t,useRef as o}from"react";import{useEventListener as l}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(){var i=(arguments.length<=0?void 0:arguments[0])instanceof Function||!("current"in(arguments.length<=0?void 0:arguments[0]))||arguments.length<=0?void 0:arguments[0],r=i?"object"===e(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:{onEntry:arguments.length<=1?void 0:arguments[1]}:"object"===e(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:{onEntry:arguments.length<=0?void 0:arguments[0]},u=t(!1),s=n(u,2),v=s[0],a=s[1],c=o(null);return l(null!=i?i:c,"mouseenter",(function(){var e;null==r||null===(e=r.onEntry)||void 0===e||e.call(r),a(!0)})),l(null!=i?i:c,"mouseleave",(function(){var e;null==r||null===(e=r.onLeave)||void 0===e||e.call(r),a(!1)})),i?v:[c,v]};export{i as useHover};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{a as e,_ as n}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as t,useRef as o}from"react";import{useEventListener as l}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(){var i=(arguments.length<=0?void 0:arguments[0])instanceof Function||!("current"in(arguments.length<=0?void 0:arguments[0]))||arguments.length<=0?void 0:arguments[0],r=i?"object"===e(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:{onEntry:arguments.length<=1?void 0:arguments[1]}:"object"===e(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:{onEntry:arguments.length<=0?void 0:arguments[0]},u=t(!1),s=n(u,2),v=s[0],a=s[1],c=o(null);return l(null!=i?i:c,"mouseenter",(function(){var e;null==r||null===(e=r.onEntry)||void 0===e||e.call(r),a(!0)})),l(null!=i?i:c,"mouseleave",(function(){var e;null==r||null===(e=r.onLeave)||void 0===e||e.call(r),a(!1)})),i?v:[c,v]};export{i as useHover};
3
3
  //# sourceMappingURL=useHover.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as t,useEffect as n}from"react";import"../../utils/helpers/isClient.js";import{throttle as i}from"../../utils/helpers/throttle.js";var o=["mousemove","mousedown","keydown","touchstart","wheel","resize"],r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e4,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=u.initialValue,l=void 0!==s&&s,a=u.events,c=void 0===a?o:a,d=t(l),m=e(d,2),v=m[0],f=m[1],h=t(Date.now()),p=e(h,2),w=p[0],E=p[1];return n((function(){var e,t=function(){return f(!0)},n=i((function(){f(!1),E(Date.now()),clearTimeout(e),e=setTimeout(t,r)}),500),o=function(){document.hidden||n()};return e=setTimeout(t,r),c.forEach((function(e){return window.addEventListener(e,n)})),document.addEventListener("visibilitychange",o),function(){c.forEach((function(e){return window.addEventListener(e,n)})),document.removeEventListener("visibilitychange",o),clearTimeout(e)}}),[r,c]),{idle:v,lastActive:w}};export{r as useIdle};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as t,useEffect as n}from"react";import"../../utils/helpers/isClient.js";import{throttle as i}from"../../utils/helpers/throttle.js";var o=["mousemove","mousedown","keydown","touchstart","wheel","resize"],r=function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6e4,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=u.initialValue,l=void 0!==s&&s,a=u.events,c=void 0===a?o:a,d=t(l),m=e(d,2),v=m[0],f=m[1],h=t(Date.now()),p=e(h,2),w=p[0],E=p[1];return n((function(){var e,t=function(){return f(!0)},n=i((function(){f(!1),E(Date.now()),clearTimeout(e),e=setTimeout(t,r)}),500),o=function(){document.hidden||n()};return e=setTimeout(t,r),c.forEach((function(e){return window.addEventListener(e,n)})),document.addEventListener("visibilitychange",o),function(){c.forEach((function(e){return window.addEventListener(e,n)})),document.removeEventListener("visibilitychange",o),clearTimeout(e)}}),[r,c]),{idle:v,lastActive:w}};export{r as useIdle};
3
3
  //# sourceMappingURL=useIdle.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{a as n,_ as e,b as t}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as r,useRef as o,useEffect as i}from"react";var l=function(){var l,u="object"!==n(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,c=u?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],v=null===(l=null==c?void 0:c.enabled)||void 0===l||l,a=r(),d=e(a,2),s=d[0],f=d[1],g=o(null),h=o();return h.current=null==c?void 0:c.onChange,i((function(){if(v){var n,r=u?function(n){return"function"==typeof n?n():n instanceof Element?n:n.current}(u):g.current,o=new IntersectionObserver((function(n){var t,r=e(n,1)[0];f(r),null===(t=h.current)||void 0===t||t.call(h,r)}),t(t({},c),{},{root:(n=null==c?void 0:c.root,n?n instanceof Element||n instanceof Document?n:n.current:document)}));return o.observe(r),function(){o.disconnect()}}}),[u,null==c?void 0:c.rootMargin,null==c?void 0:c.threshold,v]),u?{entry:s,inView:!(null==s||!s.isIntersecting)}:{ref:g,entry:s,inView:!(null==s||!s.isIntersecting)}};export{l as useIntersectionObserver};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{a as n,_ as e,b as t}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as r,useRef as o,useEffect as i}from"react";var l=function(){var l,u="object"!==n(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,c=u?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],v=null===(l=null==c?void 0:c.enabled)||void 0===l||l,a=r(),d=e(a,2),s=d[0],f=d[1],g=o(null),h=o();return h.current=null==c?void 0:c.onChange,i((function(){if(v){var n,r=u?function(n){return"function"==typeof n?n():n instanceof Element?n:n.current}(u):g.current,o=new IntersectionObserver((function(n){var t,r=e(n,1)[0];f(r),null===(t=h.current)||void 0===t||t.call(h,r)}),t(t({},c),{},{root:(n=null==c?void 0:c.root,n?n instanceof Element||n instanceof Document?n:n.current:document)}));return o.observe(r),function(){o.disconnect()}}}),[u,null==c?void 0:c.rootMargin,null==c?void 0:c.threshold,v]),u?{entry:s,inView:!(null==s||!s.isIntersecting)}:{ref:g,entry:s,inView:!(null==s||!s.isIntersecting)}};export{l as useIntersectionObserver};
3
3
  //# sourceMappingURL=useIntersectionObserver.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{a as e,_ as r}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as t,useRef as n,useEffect as u}from"react";import{useEvent as l}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){for(var o,i,a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];var f=s[0],v=null!==(o="number"==typeof s[1]?s[1]:s[1].interval)&&void 0!==o?o:1e3,p="object"===e(s[1])?s[1]:s[2],m=null===(i=null==p?void 0:p.enabled)||void 0===i||i,I=t(null==m||m),j=r(I,2),b=j[0],d=j[1],h=n(),y=l(f);u((function(){if(m)return h.current=setInterval(y,v),function(){clearInterval(h.current)}}),[m,v]);return{isActive:b,pause:function(){d(!1),clearInterval(h.current)},resume:function(){v<=0||(d(!0),clearInterval(h.current),h.current=setInterval(y,v))}}};export{o as useInterval};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{a as e,_ as r}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as t,useRef as n,useEffect as u}from"react";import{useEvent as l}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){for(var o,i,a=arguments.length,s=new Array(a),c=0;c<a;c++)s[c]=arguments[c];var f=s[0],v=null!==(o="number"==typeof s[1]?s[1]:s[1].interval)&&void 0!==o?o:1e3,p="object"===e(s[1])?s[1]:s[2],m=null===(i=null==p?void 0:p.enabled)||void 0===i||i,I=t(null==m||m),j=r(I,2),b=j[0],d=j[1],h=n(),y=l(f);u((function(){if(m)return h.current=setInterval(y,v),function(){clearInterval(h.current)}}),[m,v]);return{isActive:b,pause:function(){d(!1),clearInterval(h.current)},resume:function(){v<=0||(d(!0),clearInterval(h.current),h.current=setInterval(y,v))}}};export{o as useInterval};
3
3
  //# sourceMappingURL=useInterval.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useRef as r}from"react";var t=function(){var t=r(!0);return!0===t.current?(t.current=!1,!0):t.current};export{t as useIsFirstRender};
3
3
  //# sourceMappingURL=useIsFirstRender.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useLayoutEffect as r,useEffect as t}from"react";import{isClient as e}from"../../utils/helpers/isClient.js";var i=e?r:t;export{i as useIsomorphicLayoutEffect};
3
3
  //# sourceMappingURL=useIsomorphicLayoutEffect.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as r}from"react";import{useEventListener as t}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(i,o){var n,s,u=r(!1),l=e(u,2),a=l[0],p=l[1];return t(null!==(n=null==o?void 0:o.target)&&void 0!==n?n:window,"keydown",(function(e){(Array.isArray(i)?i.includes(e.key):e.key===i)&&p(!0)})),t(null!==(s=null==o?void 0:o.target)&&void 0!==s?s:window,"keyup",(function(e){(Array.isArray(i)?i.includes(e.key):e.key===i)&&p(!1)})),a};export{i as useKeyPress};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as r}from"react";import{useEventListener as t}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(i,o){var n,s,u=r(!1),l=e(u,2),a=l[0],p=l[1];return t(null!==(n=null==o?void 0:o.target)&&void 0!==n?n:window,"keydown",(function(e){(Array.isArray(i)?i.includes(e.key):e.key===i)&&p(!0)})),t(null!==(s=null==o?void 0:o.target)&&void 0!==s?s:window,"keyup",(function(e){(Array.isArray(i)?i.includes(e.key):e.key===i)&&p(!1)})),a};export{i as useKeyPress};
3
3
  //# sourceMappingURL=useKeyPress.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useEventListener as e}from"../useEventListener/useEventListener.js";import"react";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var t=function(){var t=Array.isArray(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:[arguments.length<=0?void 0:arguments[0]],n=(arguments.length<=1?void 0:arguments[1])instanceof Function?null:arguments.length<=1?void 0:arguments[1],i=n?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1];e(null!=n?n:window,"keydown",(function(e){t.includes(e.key)&&i(e)}),n?arguments.length<=3?void 0:arguments[3]:arguments.length<=2?void 0:arguments[2])};export{t as useKeyPressEvent};
3
3
  //# sourceMappingURL=useKeyPressEvent.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useEventListener as o}from"../useEventListener/useEventListener.js";import"react";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var e=function(e){var n,t;o(null!==(n=null==e?void 0:e.target)&&void 0!==n?n:window,"keydown",(function(o){var n;return null==e||null===(n=e.onKeyDown)||void 0===n?void 0:n.call(e,o)})),o(null!==(t=null==e?void 0:e.target)&&void 0!==t?t:window,"keyup",(function(o){var n;return null==e||null===(n=e.onKeyUp)||void 0===n?void 0:n.call(e,o)}))};export{e as useKeyboard};
3
3
  //# sourceMappingURL=useKeyboard.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as e,c as o}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as t}from"react";import{useDidUpdate as n}from"../useDidUpdate/useDidUpdate.js";import{useEventListener as r}from"../useEventListener/useEventListener.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";import"../useEvent/useEvent.js";var i=function(i){var u,s,c,l=null===(u=null==i?void 0:i.enabled)||void 0===u||u,d=t([]),f=e(d,2),p=f[0],a=f[1];return n((function(){a([])}),[l]),r(null!==(s=null==i?void 0:i.target)&&void 0!==s?s:window,"keydown",(function(e){l&&a((function(t){return t.some((function(o){return o.code===e.code}))?t:[].concat(o(t),[{key:e.key,code:e.code}])}))})),r(null!==(c=null==i?void 0:i.target)&&void 0!==c?c:window,"keyup",(function(e){l&&a((function(o){return o.filter((function(o){return o.code!==e.code}))}))})),p};export{i as useKeysPressed};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as e,c as o}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as t}from"react";import{useDidUpdate as n}from"../useDidUpdate/useDidUpdate.js";import{useEventListener as r}from"../useEventListener/useEventListener.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";import"../useEvent/useEvent.js";var i=function(i){var u,s,c,l=null===(u=null==i?void 0:i.enabled)||void 0===u||u,d=t([]),f=e(d,2),p=f[0],a=f[1];return n((function(){a([])}),[l]),r(null!==(s=null==i?void 0:i.target)&&void 0!==s?s:window,"keydown",(function(e){l&&a((function(t){return t.some((function(o){return o.code===e.code}))?t:[].concat(o(t),[{key:e.key,code:e.code}])}))})),r(null!==(c=null==i?void 0:i.target)&&void 0!==c?c:window,"keyup",(function(e){l&&a((function(o){return o.filter((function(o){return o.code!==e.code}))}))})),p};export{i as useKeysPressed};
3
3
  //# sourceMappingURL=useKeysPressed.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as n,c as t}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as r}from"react";var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=r(e),c=n(u,2),o=c[0],i=c[1];return{value:o,set:function(n){return i(n)},push:function(n){return i((function(r){return[].concat(t(r),[n])}))},removeAt:function(n){return i((function(r){return[].concat(t(r.slice(0,n)),t(r.slice(n+1)))}))},insertAt:function(n,r){return i((function(e){return[].concat(t(e.slice(0,n)),[r],t(e.slice(n)))}))},updateAt:function(n,t){return i((function(r){return r.map((function(r,e){return e===n?t:r}))}))},clear:function(){return i([])},reset:function(){return i(e)}}};export{e as useList};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as n,c as t}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as r}from"react";var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=r(e),c=n(u,2),o=c[0],i=c[1];return{value:o,set:function(n){return i(n)},push:function(n){return i((function(r){return[].concat(t(r),[n])}))},removeAt:function(n){return i((function(r){return[].concat(t(r.slice(0,n)),t(r.slice(n+1)))}))},insertAt:function(n,r){return i((function(e){return[].concat(t(e.slice(0,n)),[r],t(e.slice(n)))}))},updateAt:function(n,t){return i((function(r){return r.map((function(r,e){return e===n?t:r}))}))},clear:function(){return i([])},reset:function(){return i(e)}}};export{e as useList};
3
3
  //# sourceMappingURL=useList.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{b as o}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useStorage as r}from"../useStorage/useStorage.js";import"react";import"../../utils/helpers/isClient.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var e=function(e,t,i){return r(e,o({initialValue:t,storage:window.localStorage},i))};export{e as useLocalStorage};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{b as o}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useStorage as r}from"../useStorage/useStorage.js";import"react";import"../../utils/helpers/isClient.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";var e=function(e,t,i){return r(e,o({initialValue:t,storage:window.localStorage},i))};export{e as useLocalStorage};
3
3
  //# sourceMappingURL=useLocalStorage.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{c as o}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useEffect as t}from"react";import{useDidUpdate as e}from"../useDidUpdate/useDidUpdate.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var c=function(c,n){t((function(){var t;return(t=console).log.apply(t,["".concat(c," mounted")].concat(o(n))),function(){return console.log("".concat(c," unmounted"))}}),[]),e((function(){var t;(t=console).log.apply(t,["".concat(c," updated")].concat(o(n)))}),n)};export{c as useLogger};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{c as o}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useEffect as t}from"react";import{useDidUpdate as e}from"../useDidUpdate/useDidUpdate.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var c=function(c,n){t((function(){var t;return(t=console).log.apply(t,["".concat(c," mounted")].concat(o(n))),function(){return console.log("".concat(c," unmounted"))}}),[]),e((function(){var t;(t=console).log.apply(t,["".concat(c," updated")].concat(o(n)))}),n)};export{c as useLogger};
3
3
  //# sourceMappingURL=useLogger.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as n}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as e,useRef as l}from"react";import{useEventListener as t}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){var o=(arguments.length<=0?void 0:arguments[0])instanceof Function||!("current"in(arguments.length<=0?void 0:arguments[0]))||arguments.length<=0?void 0:arguments[0],u=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],r=o?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],i=e(!1),s=n(i,2),c=s[0],v=s[1],a=l(null),d=l(),h=l(!1),m=function(n){var e,l;null==r||null===(e=r.onStart)||void 0===e||e.call(r,n),h.current=!0,d.current=setTimeout((function(){u(n),v(!0)}),null!==(l=null==r?void 0:r.threshold)&&void 0!==l?l:400)},f=function(n){var e;if(c)null==r||null===(e=r.onFinish)||void 0===e||e.call(r,n);else if(h.current){var l;null==r||null===(l=r.onCancel)||void 0===l||l.call(r,n)}v(!1),h.current=!1,d.current&&clearTimeout(d.current)};return t(null!=o?o:a,"mousedown",m),t(null!=o?o:a,"touchstart",m),t(null!=o?o:a,"mouseup",f),t(null!=o?o:a,"touchend",f),o?c:[a,c]};export{o as useLongPress};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as n}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as e,useRef as l}from"react";import{useEventListener as t}from"../useEventListener/useEventListener.js";import"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(){var o=(arguments.length<=0?void 0:arguments[0])instanceof Function||!("current"in(arguments.length<=0?void 0:arguments[0]))||arguments.length<=0?void 0:arguments[0],u=o?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],r=o?arguments.length<=2?void 0:arguments[2]:arguments.length<=1?void 0:arguments[1],i=e(!1),s=n(i,2),c=s[0],v=s[1],a=l(null),d=l(),h=l(!1),m=function(n){var e,l;null==r||null===(e=r.onStart)||void 0===e||e.call(r,n),h.current=!0,d.current=setTimeout((function(){u(n),v(!0)}),null!==(l=null==r?void 0:r.threshold)&&void 0!==l?l:400)},f=function(n){var e;if(c)null==r||null===(e=r.onFinish)||void 0===e||e.call(r,n);else if(h.current){var l;null==r||null===(l=r.onCancel)||void 0===l||l.call(r,n)}v(!1),h.current=!1,d.current&&clearTimeout(d.current)};return t(null!=o?o:a,"mousedown",m),t(null!=o?o:a,"touchstart",m),t(null!=o?o:a,"mouseup",f),t(null!=o?o:a,"touchend",f),o?c:[a,c]};export{o as useLongPress};
3
3
  //# sourceMappingURL=useLongPress.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useCallback as n,useSyncExternalStore as e}from"react";var t=function(){return!1},r=function(r){var a=n((function(n){var e=window.matchMedia(r);return e.addEventListener("change",n),function(){e.removeEventListener("change",n)}}),[r]);return e(a,(function(){return window.matchMedia(r).matches}),t)};export{r as useMediaQuery};
3
3
  //# sourceMappingURL=useMediaQuery.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useEffect as r}from"react";var t=function(t){return r(t,[])};export{t as useMount};
3
3
  //# sourceMappingURL=useMount.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as e,b as t}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as n,useRef as o}from"react";import{useIsomorphicLayoutEffect as r}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(){for(var i=arguments.length,l=new Array(i),u=0;u<i;u++)l[u]=arguments[u];var m=l[0],s=n({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),c=e(s,2),f=c[0],a=c[1],p=o(null);return r((function(){var e=function(e){var n=m?function(e){return"function"==typeof e?e():e instanceof Element?e:e.current}(m):p.current;if(n){var o={x:e.pageX,y:e.pageY},r=n.getBoundingClientRect(),i=r.left,l=r.top,u=i+window.scrollX,s=l+window.scrollY,c=e.pageX-u,f=e.pageY-s;o.elementX=c,o.elementY=f,o.elementPositionX=u,o.elementPositionY=s,a((function(e){return t(t({},e),o)}))}};return document.addEventListener("mousemove",e),function(){document.removeEventListener("mousemove",e)}}),[]),m?f:t(t({},f),{},{ref:p})};export{i as useMouse};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as e,b as t}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as n,useRef as o}from"react";import{useIsomorphicLayoutEffect as r}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var i=function(){for(var i=arguments.length,l=new Array(i),u=0;u<i;u++)l[u]=arguments[u];var m=l[0],s=n({x:0,y:0,elementX:0,elementY:0,elementPositionX:0,elementPositionY:0}),c=e(s,2),f=c[0],a=c[1],p=o(null);return r((function(){var e=function(e){var n=m?function(e){return"function"==typeof e?e():e instanceof Element?e:e.current}(m):p.current;if(n){var o={x:e.pageX,y:e.pageY},r=n.getBoundingClientRect(),i=r.left,l=r.top,u=i+window.scrollX,s=l+window.scrollY,c=e.pageX-u,f=e.pageY-s;o.elementX=c,o.elementY=f,o.elementPositionX=u,o.elementPositionY=s,a((function(e){return t(t({},e),o)}))}};return document.addEventListener("mousemove",e),function(){document.removeEventListener("mousemove",e)}}),[]),m?f:t(t({},f),{},{ref:p})};export{i as useMouse};
3
3
  //# sourceMappingURL=useMouse.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as r,e as n,f as t}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useRef as e,useState as u}from"react";import{getRetry as l}from"../../utils/helpers/getRetry.js";import"../../utils/helpers/isClient.js";var o=function(o,i){var c=e(null!=i&&i.retry?l(i.retry):0),s=u(!1),a=r(s,2),f=a[0],p=a[1],m=u(!1),v=r(m,2),y=v[0],h=v[1],d=u(!1),g=r(d,2),j=g[0],b=g[1],w=u(null),x=r(w,2),E=x[0],S=x[1],_=u(null),k=r(_,2),A=k[0],B=k[1],C=function r(n){return p(!0),o(n).then((function(r){var n;return null==i||null===(n=i.onSuccess)||void 0===n||n.call(i,r),B(r),b(!0),p(!1),S(null),h(!1),r})).catch((function(t){var e;if(c.current>0)return c.current-=1,r(n);null==i||null===(e=i.onError)||void 0===e||e.call(i,t),B(null),b(!1),p(!1),S(t),h(!0),c.current=null!=i&&i.retry?l(i.retry):0}))},H=function(){var r=n(t().mark((function r(n){return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",C(n));case 1:case"end":return r.stop()}}),r)})));return function(n){return r.apply(this,arguments)}}();return{data:A,error:E,mutate:function(r){C(r)},mutateAsync:H,isLoading:f,isError:y,isSuccess:j}};export{o as useMutation};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as r,e as n,f as t}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useRef as e,useState as u}from"react";import{getRetry as l}from"../../utils/helpers/getRetry.js";import"../../utils/helpers/isClient.js";var o=function(o,i){var c=e(null!=i&&i.retry?l(i.retry):0),s=u(!1),a=r(s,2),f=a[0],p=a[1],m=u(!1),v=r(m,2),y=v[0],h=v[1],d=u(!1),g=r(d,2),j=g[0],b=g[1],w=u(null),x=r(w,2),E=x[0],S=x[1],_=u(null),k=r(_,2),A=k[0],B=k[1],C=function r(n){return p(!0),o(n).then((function(r){var n;return null==i||null===(n=i.onSuccess)||void 0===n||n.call(i,r),B(r),b(!0),p(!1),S(null),h(!1),r})).catch((function(t){var e;if(c.current>0)return c.current-=1,r(n);null==i||null===(e=i.onError)||void 0===e||e.call(i,t),B(null),b(!1),p(!1),S(t),h(!0),c.current=null!=i&&i.retry?l(i.retry):0}))},H=function(){var r=n(t().mark((function r(n){return t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",C(n));case 1:case"end":return r.stop()}}),r)})));return function(n){return r.apply(this,arguments)}}();return{data:A,error:E,mutate:function(r){C(r)},mutateAsync:H,isLoading:f,isError:y,isSuccess:j}};export{o as useMutation};
3
3
  //# sourceMappingURL=useMutation.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useRef as r,useEffect as n}from"react";function t(t,e,u){var c=r(),o=r(null);return n((function(){var r="function"==typeof u?u():u;return(r||o.current)&&(c.current=new MutationObserver(t),c.current.observe(r||o.current,e)),function(){var r;null===(r=c.current)||void 0===r||r.disconnect()}}),[t,e]),o}export{t as useMutationObserver};
3
3
  //# sourceMappingURL=useMutationObserver.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as n}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as e,useEffect as i}from"react";import{isClient as o}from"../../utils/helpers/isClient.js";var t=function(){var n,e,i;return(null===(n=navigator)||void 0===n?void 0:n.connection)||(null===(e=navigator)||void 0===e?void 0:e.mozConnection)||(null===(i=navigator)||void 0===i?void 0:i.webkitConnection)},l=function(){var l=e((function(){if(!o)return{online:!1,type:void 0,effectiveType:void 0,saveData:!1,downlink:0,downlinkMax:0,rtt:0};var n=navigator.onLine,e=t();return{online:n,downlink:null==e?void 0:e.downlink,downlinkMax:null==e?void 0:e.downlinkMax,effectiveType:null==e?void 0:e.effectiveType,rtt:null==e?void 0:e.rtt,saveData:null==e?void 0:e.saveData,type:null==e?void 0:e.type}})),v=n(l,2),a=v[0],r=v[1];return i((function(){var n=function(){var n=navigator.onLine,e=t();r({online:n,downlink:null==e?void 0:e.downlink,downlinkMax:null==e?void 0:e.downlinkMax,effectiveType:null==e?void 0:e.effectiveType,rtt:null==e?void 0:e.rtt,saveData:null==e?void 0:e.saveData,type:null==e?void 0:e.type})};window.addEventListener("online",n,{passive:!0}),window.addEventListener("offline",n,{passive:!0});var e=t();return e&&e.addEventListener("change",n,{passive:!0}),function(){window.removeEventListener("online",n),window.removeEventListener("offline",n),e&&e.removeEventListener("change",n)}})),a};export{t as getConnection,l as useNetwork};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as n}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as e,useEffect as i}from"react";import{isClient as o}from"../../utils/helpers/isClient.js";var t=function(){var n,e,i;return(null===(n=navigator)||void 0===n?void 0:n.connection)||(null===(e=navigator)||void 0===e?void 0:e.mozConnection)||(null===(i=navigator)||void 0===i?void 0:i.webkitConnection)},l=function(){var l=e((function(){if(!o)return{online:!1,type:void 0,effectiveType:void 0,saveData:!1,downlink:0,downlinkMax:0,rtt:0};var n=navigator.onLine,e=t();return{online:n,downlink:null==e?void 0:e.downlink,downlinkMax:null==e?void 0:e.downlinkMax,effectiveType:null==e?void 0:e.effectiveType,rtt:null==e?void 0:e.rtt,saveData:null==e?void 0:e.saveData,type:null==e?void 0:e.type}})),v=n(l,2),a=v[0],r=v[1];return i((function(){var n=function(){var n=navigator.onLine,e=t();r({online:n,downlink:null==e?void 0:e.downlink,downlinkMax:null==e?void 0:e.downlinkMax,effectiveType:null==e?void 0:e.effectiveType,rtt:null==e?void 0:e.rtt,saveData:null==e?void 0:e.saveData,type:null==e?void 0:e.type})};window.addEventListener("online",n,{passive:!0}),window.addEventListener("offline",n,{passive:!0});var e=t();return e&&e.addEventListener("change",n,{passive:!0}),function(){window.removeEventListener("online",n),window.removeEventListener("offline",n),e&&e.removeEventListener("change",n)}})),a};export{t as getConnection,l as useNetwork};
3
3
  //# sourceMappingURL=useNetwork.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useSyncExternalStore as n}from"react";var e=function(){return navigator.onLine},t=function(){return!1},i=function(n){return window.addEventListener("online",n),window.addEventListener("offline",n),function(){window.removeEventListener("online",n),window.removeEventListener("offline",n)}},o=function(){return n(i,e,t)};export{o as useOnline};
3
3
  //# sourceMappingURL=useOnline.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useRef as 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"},t=function(){return n(i()).current};export{i as getOperatingSystem,t as useOperatingSystem};
3
3
  //# sourceMappingURL=useOperatingSystem.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-CEUGrTA3.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.36 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-y7qx6l7m.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,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as e}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as t,useEffect as r}from"react";import{useEvent as n}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(o){var s=t(!1),u=e(s,2),i=u[0],m=u[1],v=n((function(){if(i)return m(!1);null==o||o(),m(!0)}));return r((function(){return document.addEventListener("mouseleave",v,{passive:!0}),document.addEventListener("mouseenter",v,{passive:!0}),function(){document.removeEventListener("mouseenter",v),document.removeEventListener("mouseleave",v)}}),[]),i};export{o as usePageLeave};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as e}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as t,useEffect as r}from"react";import{useEvent as n}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var o=function(o){var s=t(!1),u=e(s,2),i=u[0],m=u[1],v=n((function(){if(i)return m(!1);null==o||o(),m(!0)}));return r((function(){return document.addEventListener("mouseleave",v,{passive:!0}),document.addEventListener("mouseenter",v,{passive:!0}),function(){document.removeEventListener("mouseenter",v),document.removeEventListener("mouseleave",v)}}),[]),i};export{o as usePageLeave};
3
3
  //# sourceMappingURL=usePageLeave.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{a as e,_ as t,b as n}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as r,useRef as o,useEffect as i}from"react";import{useEvent as u}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var c=function(e){return"function"==typeof e?e():e instanceof Element?e:e.current},l=function(){var l,s,d,v="object"!==e(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,f=v?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],a=r(!1),m=t(a,2),p=m[0],h=m[1],E=o(null),g=o(null),w=r({width:null!==(l=null==f?void 0:f.width)&&void 0!==l?l:5,color:null!==(s=null==f?void 0:f.color)&&void 0!==s?s:"black",opacity:null!==(d=null==f?void 0:f.opacity)&&void 0!==d?d:.1}),L=t(w,2),y=L[0],b=L[1],j=u((function(e){p&&g.current&&(g.current.lineTo(e.offsetX,e.offsetY),g.current.stroke())}));return i((function(){var e=v?c(v):E.current;if(e){g.current=e.getContext("2d");var t=function(e){g.current&&(g.current.beginPath(),g.current.moveTo(e.offsetX,e.offsetY),h(!0))},n=function(){g.current&&(g.current.closePath(),h(!1))};return e.addEventListener("mousedown",t),e.addEventListener("mousemove",j),e.addEventListener("mouseup",n),function(){e&&(e.removeEventListener("mousedown",t),e.removeEventListener("mousemove",j),e.removeEventListener("mouseup",n))}}}),[]),i((function(){g.current&&(g.current.strokeStyle=y.color,g.current.lineWidth=y.width,g.current.lineCap="round",g.current.lineJoin="round")}),[y.color,y.width,y.opacity]),v?{pencil:n(n({},y),{},{set:b}),drawing:p}:{pencil:n(n({},y),{},{set:b}),ref:E,drawing:p}};export{c as getTargetElement,l as usePaint};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{a as e,_ as t,b as n}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as r,useRef as o,useEffect as i}from"react";import{useEvent as u}from"../useEvent/useEvent.js";import"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var c=function(e){return"function"==typeof e?e():e instanceof Element?e:e.current},l=function(){var l,s,d,v="object"!==e(arguments.length<=0?void 0:arguments[0])||"current"in(arguments.length<=0?void 0:arguments[0])?arguments.length<=0?void 0:arguments[0]:void 0,f=v?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0],a=r(!1),m=t(a,2),p=m[0],h=m[1],E=o(null),g=o(null),w=r({width:null!==(l=null==f?void 0:f.width)&&void 0!==l?l:5,color:null!==(s=null==f?void 0:f.color)&&void 0!==s?s:"black",opacity:null!==(d=null==f?void 0:f.opacity)&&void 0!==d?d:.1}),L=t(w,2),y=L[0],b=L[1],j=u((function(e){p&&g.current&&(g.current.lineTo(e.offsetX,e.offsetY),g.current.stroke())}));return i((function(){var e=v?c(v):E.current;if(e){g.current=e.getContext("2d");var t=function(e){g.current&&(g.current.beginPath(),g.current.moveTo(e.offsetX,e.offsetY),h(!0))},n=function(){g.current&&(g.current.closePath(),h(!1))};return e.addEventListener("mousedown",t),e.addEventListener("mousemove",j),e.addEventListener("mouseup",n),function(){e&&(e.removeEventListener("mousedown",t),e.removeEventListener("mousemove",j),e.removeEventListener("mouseup",n))}}}),[]),i((function(){g.current&&(g.current.strokeStyle=y.color,g.current.lineWidth=y.width,g.current.lineCap="round",g.current.lineJoin="round")}),[y.color,y.width,y.opacity]),v?{pencil:n(n({},y),{},{set:b}),drawing:p}:{pencil:n(n({},y),{},{set:b}),ref:E,drawing:p}};export{c as getTargetElement,l as usePaint};
3
3
  //# sourceMappingURL=usePaint.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useMediaQuery as e}from"../useMediaQuery/useMediaQuery.js";import"react";var r=function(){var r=e("(prefers-color-scheme: light)"),o=e("(prefers-color-scheme: dark)");return r?"light":o?"dark":"no-preference"};export{r as usePreferredColorScheme};
3
3
  //# sourceMappingURL=usePreferredColorScheme.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useSyncExternalStore as n}from"react";var e=function(){return window.navigator.languages},r=function(){return[]},t=function(n){return window.addEventListener("languagechange",n),function(){window.removeEventListener("languagechange",n)}},a=function(){return n(t,e,r)};export{a as usePreferredLanguages};
3
3
  //# sourceMappingURL=usePreferredLanguages.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
2
  import{useRef as r,useEffect as t}from"react";var n=function(n){var c=r();return t((function(){c.current=n})),c.current};export{n as usePrevious};
3
3
  //# sourceMappingURL=usePrevious.js.map
@@ -1,3 +1,3 @@
1
- /* @license @siberiacancode/reactuse v0.0.35 */
2
- import{_ as t,e,f as n}from"../../_rollupPluginBabelHelpers-CEUGrTA3.js";import{useState as r}from"react";import i from"fs";import o from"util";import s from"stream";import a from"zlib";import h from"assert";import l from"buffer";import{useIsomorphicLayoutEffect as u}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var c={},d=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},p={},g={};let _;const m=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];g.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},g.getSymbolTotalCodewords=function(t){return m[t]},g.getBCHDigit=function(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},g.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');_=t},g.isKanjiModeEnabled=function(){return void 0!==_},g.toSJIS=function(t){return _(t)};var w,y={};function E(){this.buffer=[],this.length=0}(w=y).L={bit:1},w.M={bit:0},w.Q={bit:3},w.H={bit:2},w.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},w.from=function(t,e){if(w.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return w.L;case"m":case"medium":return w.M;case"q":case"quartile":return w.Q;case"h":case"high":return w.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return e}},E.prototype={get:function(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(let n=0;n<e;n++)this.putBit(1==(t>>>e-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var b=E;function T(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}T.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)},T.prototype.get=function(t,e){return this.data[t*this.size+e]},T.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n},T.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var C=T,A={};!function(t){const e=g.getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,r=e(t),i=145===r?26:2*Math.ceil((r-13)/(2*n-2)),o=[r-7];for(let t=1;t<n-1;t++)o[t]=o[t-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),i=r.length;for(let t=0;t<i;t++)for(let e=0;e<i;e++)0===t&&0===e||0===t&&e===i-1||t===i-1&&0===e||n.push([r[t],r[e]]);return n}}(A);var I={};const P=g.getSymbolSize;I.getPositions=function(t){const e=P(t);return[[0,0],[e-7,0],[0,e-7]]};var L={};!function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e=3,n=3,r=40,i=10;function o(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,i=0,o=0,s=null,a=null;for(let h=0;h<n;h++){i=o=0,s=a=null;for(let l=0;l<n;l++){let n=t.get(h,l);n===s?i++:(i>=5&&(r+=e+(i-5)),s=n,i=1),n=t.get(l,h),n===a?o++:(o>=5&&(r+=e+(o-5)),a=n,o=1)}i>=5&&(r+=e+(i-5)),o>=5&&(r+=e+(o-5))}return r},t.getPenaltyN2=function(t){const e=t.size;let r=0;for(let n=0;n<e-1;n++)for(let i=0;i<e-1;i++){const e=t.get(n,i)+t.get(n,i+1)+t.get(n+1,i)+t.get(n+1,i+1);4!==e&&0!==e||r++}return r*n},t.getPenaltyN3=function(t){const e=t.size;let n=0,i=0,o=0;for(let r=0;r<e;r++){i=o=0;for(let s=0;s<e;s++)i=i<<1&2047|t.get(r,s),s>=10&&(1488===i||93===i)&&n++,o=o<<1&2047|t.get(s,r),s>=10&&(1488===o||93===o)&&n++}return n*r},t.getPenaltyN4=function(t){let e=0;const n=t.data.length;for(let r=0;r<n;r++)e+=t.data[r];return Math.abs(Math.ceil(100*e/n/5)-10)*i},t.applyMask=function(t,e){const n=e.size;for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.isReserved(i,r)||e.xor(i,r,o(t,i,r))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let i=0,o=1/0;for(let s=0;s<r;s++){n(s),t.applyMask(s,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(s,e),r<o&&(o=r,i=s)}return i}}(L);var v={};const B=y,R=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],O=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];v.getBlocksCount=function(t,e){switch(e){case B.L:return R[4*(t-1)+0];case B.M:return R[4*(t-1)+1];case B.Q:return R[4*(t-1)+2];case B.H:return R[4*(t-1)+3];default:return}},v.getTotalCodewordsCount=function(t,e){switch(e){case B.L:return O[4*(t-1)+0];case B.M:return O[4*(t-1)+1];case B.Q:return O[4*(t-1)+2];case B.H:return O[4*(t-1)+3];default:return}};var M={},k={};const x=new Uint8Array(512),N=new Uint8Array(256);!function(){let t=1;for(let e=0;e<255;e++)x[e]=t,N[t]=e,t<<=1,256&t&&(t^=285);for(let t=255;t<512;t++)x[t]=x[t-255]}(),k.log=function(t){if(t<1)throw new Error("log("+t+")");return N[t]},k.exp=function(t){return x[t]},k.mul=function(t,e){return 0===t||0===e?0:x[N[t]+N[e]]},function(t){const e=k;t.mul=function(t,n){const r=new Uint8Array(t.length+n.length-1);for(let i=0;i<t.length;i++)for(let o=0;o<n.length;o++)r[i+o]^=e.mul(t[i],n[o]);return r},t.mod=function(t,n){let r=new Uint8Array(t);for(;r.length-n.length>=0;){const t=r[0];for(let i=0;i<n.length;i++)r[i]^=e.mul(n[i],t);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},t.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=t.mul(r,new Uint8Array([1,e.exp(i)]));return r}}(M);const D=M;function S(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}S.prototype.initialize=function(t){this.degree=t,this.genPoly=D.generateECPolynomial(this.degree)},S.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(t.length+this.degree);e.set(t);const n=D.mod(e,this.genPoly),r=this.degree-n.length;if(r>0){const t=new Uint8Array(this.degree);return t.set(n,r),t}return n};var U=S,Y={},H={},F={isValid:function(t){return!isNaN(t)&&t>=1&&t<=40}},z={};const G="[0-9]+";let j="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";j=j.replace(/u/g,"\\u");const W="(?:(?![A-Z0-9 $%*+\\-./:]|"+j+")(?:.|[\r\n]))+";z.KANJI=new RegExp(j,"g"),z.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),z.BYTE=new RegExp(W,"g"),z.NUMERIC=new RegExp(G,"g"),z.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const K=new RegExp("^"+j+"$"),J=new RegExp("^"+G+"$"),V=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");z.testKanji=function(t){return K.test(t)},z.testNumeric=function(t){return J.test(t)},z.testAlphanumeric=function(t){return V.test(t)},function(t){const e=F,n=z;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,n){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!e.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?t.ccBits[0]:n<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(e){return n.testNumeric(e)?t.NUMERIC:n.testAlphanumeric(e)?t.ALPHANUMERIC:n.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(t){return n}}}(H),function(t){const e=g,n=v,r=y,i=H,o=F,s=e.getBCHDigit(7973);function a(t,e){return i.getCharCountIndicator(t,e)+4}function h(t,e){let n=0;return t.forEach((function(t){const r=a(t.mode,e);n+=r+t.getBitsLength()})),n}t.from=function(t,e){return o.isValid(t)?parseInt(t,10):e},t.getCapacity=function(t,r,s){if(!o.isValid(t))throw new Error("Invalid QR Code version");void 0===s&&(s=i.BYTE);const h=8*(e.getSymbolTotalCodewords(t)-n.getTotalCodewordsCount(t,r));if(s===i.MIXED)return h;const l=h-a(s,t);switch(s){case i.NUMERIC:return Math.floor(l/10*3);case i.ALPHANUMERIC:return Math.floor(l/11*2);case i.KANJI:return Math.floor(l/13);case i.BYTE:default:return Math.floor(l/8)}},t.getBestVersionForData=function(e,n){let o;const s=r.from(n,r.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(h(e,r)<=t.getCapacity(r,n,i.MIXED))return r}(e,s);if(0===e.length)return 1;o=e[0]}else o=e;return function(e,n,r){for(let i=1;i<=40;i++)if(n<=t.getCapacity(i,r,e))return i}(o.mode,o.getLength(),s)},t.getEncodedBits=function(t){if(!o.isValid(t)||t<7)throw new Error("Invalid QR Code version");let n=t<<12;for(;e.getBCHDigit(n)-s>=0;)n^=7973<<e.getBCHDigit(n)-s;return t<<12|n}}(Y);var q={};const Q=g,Z=Q.getBCHDigit(1335);q.getEncodedBits=function(t,e){const n=t.bit<<3|e;let r=n<<10;for(;Q.getBCHDigit(r)-Z>=0;)r^=1335<<Q.getBCHDigit(r)-Z;return 21522^(n<<10|r)};var $={};const X=H;function tt(t){this.mode=X.NUMERIC,this.data=t.toString()}tt.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},tt.prototype.getLength=function(){return this.data.length},tt.prototype.getBitsLength=function(){return tt.getBitsLength(this.data.length)},tt.prototype.write=function(t){let e,n,r;for(e=0;e+3<=this.data.length;e+=3)n=this.data.substr(e,3),r=parseInt(n,10),t.put(r,10);const i=this.data.length-e;i>0&&(n=this.data.substr(e),r=parseInt(n,10),t.put(r,3*i+1))};var et=tt;const nt=H,rt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function it(t){this.mode=nt.ALPHANUMERIC,this.data=t}it.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},it.prototype.getLength=function(){return this.data.length},it.prototype.getBitsLength=function(){return it.getBitsLength(this.data.length)},it.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let n=45*rt.indexOf(this.data[e]);n+=rt.indexOf(this.data[e+1]),t.put(n,11)}this.data.length%2&&t.put(rt.indexOf(this.data[e]),6)};var ot=it;const st=function(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t.charCodeAt(r);if(i>=55296&&i<=56319&&n>r+1){var o=t.charCodeAt(r+1);o>=56320&&o<=57343&&(i=1024*(i-55296)+o-56320+65536,r+=1)}i<128?e.push(i):i<2048?(e.push(i>>6|192),e.push(63&i|128)):i<55296||i>=57344&&i<65536?(e.push(i>>12|224),e.push(i>>6&63|128),e.push(63&i|128)):i>=65536&&i<=1114111?(e.push(i>>18|240),e.push(i>>12&63|128),e.push(i>>6&63|128),e.push(63&i|128)):e.push(239,191,189)}return new Uint8Array(e).buffer},at=H;function ht(t){this.mode=at.BYTE,"string"==typeof t&&(t=st(t)),this.data=new Uint8Array(t)}ht.getBitsLength=function(t){return 8*t},ht.prototype.getLength=function(){return this.data.length},ht.prototype.getBitsLength=function(){return ht.getBitsLength(this.data.length)},ht.prototype.write=function(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data[e],8)};var lt=ht;const ut=H,ft=g;function ct(t){this.mode=ut.KANJI,this.data=t}ct.getBitsLength=function(t){return 13*t},ct.prototype.getLength=function(){return this.data.length},ct.prototype.getBitsLength=function(){return ct.getBitsLength(this.data.length)},ct.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let n=ft.toSJIS(this.data[e]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),t.put(n,13)}};var dt=ct,pt={exports:{}};!function(t){var e={single_source_shortest_paths:function(t,n,r){var i={},o={};o[n]=0;var s,a,h,l,u,f,c,d=e.PriorityQueue.make();for(d.push(n,0);!d.empty();)for(h in a=(s=d.pop()).value,l=s.cost,u=t[a]||{})u.hasOwnProperty(h)&&(f=l+u[h],c=o[h],(void 0===o[h]||c>f)&&(o[h]=f,d.push(h,f),i[h]=a));if(void 0!==r&&void 0===o[r]){var p=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(p)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var n=[],r=e;r;)n.push(r),t[r],r=t[r];return n.reverse(),n},find_path:function(t,n,r){var i=e.single_source_shortest_paths(t,n,r);return e.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var n,r=e.PriorityQueue,i={};for(n in t=t||{},r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var n={value:t,cost:e};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=e}(pt);var gt=pt.exports;!function(t){const e=H,n=et,r=ot,i=lt,o=dt,s=z,a=g,h=gt;function l(t){return unescape(encodeURIComponent(t)).length}function u(t,e,n){const r=[];let i;for(;null!==(i=t.exec(n));)r.push({data:i[0],index:i.index,mode:e,length:i[0].length});return r}function f(t){const n=u(s.NUMERIC,e.NUMERIC,t),r=u(s.ALPHANUMERIC,e.ALPHANUMERIC,t);let i,o;a.isKanjiModeEnabled()?(i=u(s.BYTE,e.BYTE,t),o=u(s.KANJI,e.KANJI,t)):(i=u(s.BYTE_KANJI,e.BYTE,t),o=[]);return n.concat(r,i,o).sort((function(t,e){return t.index-e.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function c(t,s){switch(s){case e.NUMERIC:return n.getBitsLength(t);case e.ALPHANUMERIC:return r.getBitsLength(t);case e.KANJI:return o.getBitsLength(t);case e.BYTE:return i.getBitsLength(t)}}function d(t,s){let h;const l=e.getBestModeForData(t);if(h=e.from(s,l),h!==e.BYTE&&h.bit<l.bit)throw new Error('"'+t+'" cannot be encoded with mode '+e.toString(h)+".\n Suggested mode is: "+e.toString(l));switch(h!==e.KANJI||a.isKanjiModeEnabled()||(h=e.BYTE),h){case e.NUMERIC:return new n(t);case e.ALPHANUMERIC:return new r(t);case e.KANJI:return new o(t);case e.BYTE:return new i(t)}}t.fromArray=function(t){return t.reduce((function(t,e){return"string"==typeof e?t.push(d(e,null)):e.data&&t.push(d(e.data,e.mode)),t}),[])},t.fromString=function(n,r){const i=function(t){const n=[];for(let r=0;r<t.length;r++){const i=t[r];switch(i.mode){case e.NUMERIC:n.push([i,{data:i.data,mode:e.ALPHANUMERIC,length:i.length},{data:i.data,mode:e.BYTE,length:i.length}]);break;case e.ALPHANUMERIC:n.push([i,{data:i.data,mode:e.BYTE,length:i.length}]);break;case e.KANJI:n.push([i,{data:i.data,mode:e.BYTE,length:l(i.data)}]);break;case e.BYTE:n.push([{data:i.data,mode:e.BYTE,length:l(i.data)}])}}return n}(f(n,a.isKanjiModeEnabled())),o=function(t,n){const r={},i={start:{}};let o=["start"];for(let s=0;s<t.length;s++){const a=t[s],h=[];for(let t=0;t<a.length;t++){const l=a[t],u=""+s+t;h.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let t=0;t<o.length;t++){const s=o[t];r[s]&&r[s].node.mode===l.mode?(i[s][u]=c(r[s].lastCount+l.length,l.mode)-c(r[s].lastCount,l.mode),r[s].lastCount+=l.length):(r[s]&&(r[s].lastCount=l.length),i[s][u]=c(l.length,l.mode)+4+e.getCharCountIndicator(l.mode,n))}}o=h}for(let t=0;t<o.length;t++)i[o[t]].end=0;return{map:i,table:r}}(i,r),s=h.find_path(o.map,"start","end"),u=[];for(let t=1;t<s.length-1;t++)u.push(o.table[s[t]].node);return t.fromArray(function(t){return t.reduce((function(t,e){const n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)}),[])}(u))},t.rawSplit=function(e){return t.fromArray(f(e,a.isKanjiModeEnabled()))}}($);const _t=g,mt=y,wt=b,yt=C,Et=A,bt=I,Tt=L,Ct=v,At=U,It=Y,Pt=q,Lt=H,vt=$;function Bt(t,e,n){const r=t.size,i=Pt.getEncodedBits(e,n);let o,s;for(o=0;o<15;o++)s=1==(i>>o&1),o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(r-15+o,8,s,!0),o<8?t.set(8,r-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(r-8,8,1,!0)}function Rt(t,e,n){const r=new wt;n.forEach((function(e){r.put(e.mode.bit,4),r.put(e.getLength(),Lt.getCharCountIndicator(e.mode,t)),e.write(r)}));const i=8*(_t.getSymbolTotalCodewords(t)-Ct.getTotalCodewordsCount(t,e));for(r.getLengthInBits()+4<=i&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(0);const o=(i-r.getLengthInBits())/8;for(let t=0;t<o;t++)r.put(t%2?17:236,8);return function(t,e,n){const r=_t.getSymbolTotalCodewords(e),i=Ct.getTotalCodewordsCount(e,n),o=r-i,s=Ct.getBlocksCount(e,n),a=r%s,h=s-a,l=Math.floor(r/s),u=Math.floor(o/s),f=u+1,c=l-u,d=new At(c);let p=0;const g=new Array(s),_=new Array(s);let m=0;const w=new Uint8Array(t.buffer);for(let t=0;t<s;t++){const e=t<h?u:f;g[t]=w.slice(p,p+e),_[t]=d.encode(g[t]),p+=e,m=Math.max(m,e)}const y=new Uint8Array(r);let E,b,T=0;for(E=0;E<m;E++)for(b=0;b<s;b++)E<g[b].length&&(y[T++]=g[b][E]);for(E=0;E<c;E++)for(b=0;b<s;b++)y[T++]=_[b][E];return y}(r,t,e)}function Ot(t,e,n,r){let i;if(Array.isArray(t))i=vt.fromArray(t);else{if("string"!=typeof t)throw new Error("Invalid data");{let r=e;if(!r){const e=vt.rawSplit(t);r=It.getBestVersionForData(e,n)}i=vt.fromString(t,r||40)}}const o=It.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(e){if(e<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else e=o;const s=Rt(e,n,i),a=_t.getSymbolSize(e),h=new yt(a);return function(t,e){const n=t.size,r=bt.getPositions(e);for(let e=0;e<r.length;e++){const i=r[e][0],o=r[e][1];for(let e=-1;e<=7;e++)if(!(i+e<=-1||n<=i+e))for(let r=-1;r<=7;r++)o+r<=-1||n<=o+r||(e>=0&&e<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===e||6===e)||e>=2&&e<=4&&r>=2&&r<=4?t.set(i+e,o+r,!0,!0):t.set(i+e,o+r,!1,!0))}}(h,e),function(t){const e=t.size;for(let n=8;n<e-8;n++){const e=n%2==0;t.set(n,6,e,!0),t.set(6,n,e,!0)}}(h),function(t,e){const n=Et.getPositions(e);for(let e=0;e<n.length;e++){const r=n[e][0],i=n[e][1];for(let e=-2;e<=2;e++)for(let n=-2;n<=2;n++)-2===e||2===e||-2===n||2===n||0===e&&0===n?t.set(r+e,i+n,!0,!0):t.set(r+e,i+n,!1,!0)}}(h,e),Bt(h,n,0),e>=7&&function(t,e){const n=t.size,r=It.getEncodedBits(e);let i,o,s;for(let e=0;e<18;e++)i=Math.floor(e/3),o=e%3+n-8-3,s=1==(r>>e&1),t.set(i,o,s,!0),t.set(o,i,s,!0)}(h,e),function(t,e){const n=t.size;let r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(6===a&&a--;;){for(let n=0;n<2;n++)if(!t.isReserved(i,a-n)){let r=!1;s<e.length&&(r=1==(e[s]>>>o&1)),t.set(i,a-n,r),o--,-1===o&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}(h,s),isNaN(r)&&(r=Tt.getBestMask(h,Bt.bind(null,h,n))),Tt.applyMask(r,h),Bt(h,n,r),{modules:h,version:e,errorCorrectionLevel:n,maskPattern:r,segments:i}}p.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");let n,r,i=mt.M;return void 0!==e&&(i=mt.from(e.errorCorrectionLevel,mt.M),n=It.from(e.version),r=Tt.from(e.maskPattern),e.toSJISFunc&&_t.setToSJISFunction(e.toSJISFunc)),Ot(t,n,i,r)};var Mt={},kt={},xt={exports:{}},Nt={exports:{}};let Dt=o,St=s,Ut=Nt.exports=function(){St.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};Dt.inherits(Ut,St),Ut.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},Ut.prototype.write=function(t,e){if(!this.writable)return this.emit("error",new Error("Stream not writable")),!1;let n;return n=Buffer.isBuffer(t)?t:Buffer.from(t,e||this._encoding),this._buffers.push(n),this._buffered+=n.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused},Ut.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},Ut.prototype.destroySoon=Ut.prototype.end,Ut.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},Ut.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},Ut.prototype._processReadAllowingLess=function(t){this._reads.shift();let e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},Ut.prototype._processRead=function(t){this._reads.shift();let e=0,n=0,r=Buffer.alloc(t.length);for(;e<t.length;){let i=this._buffers[n++],o=Math.min(i.length,t.length-e);i.copy(r,e,0,o),e+=o,o!==i.length&&(this._buffers[--n]=i.slice(o))}n>0&&this._buffers.splice(0,n),this._buffered-=t.length,t.func.call(this,r)},Ut.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){let t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}};var Yt=Nt.exports,Ht={exports:{}},Ft={exports:{}},zt={};let Gt=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];zt.getImagePasses=function(t,e){let n=[],r=t%8,i=e%8,o=(t-r)/8,s=(e-i)/8;for(let t=0;t<Gt.length;t++){let e=Gt[t],a=o*e.x.length,h=s*e.y.length;for(let t=0;t<e.x.length&&e.x[t]<r;t++)a++;for(let t=0;t<e.y.length&&e.y[t]<i;t++)h++;a>0&&h>0&&n.push({width:a,height:h,index:t})}return n},zt.getInterlaceIterator=function(t){return function(e,n,r){let i=e%Gt[r].x.length,o=(e-i)/Gt[r].x.length*8+Gt[r].x[i],s=n%Gt[r].y.length;return 4*o+((n-s)/Gt[r].y.length*8+Gt[r].y[s])*t*4}};var jt=function(t,e,n){let r=t+e-n,i=Math.abs(r-t),o=Math.abs(r-e),s=Math.abs(r-n);return i<=o&&i<=s?t:o<=s?e:n};let Wt=zt,Kt=jt;function Jt(t,e,n){let r=t*e;return 8!==n&&(r=Math.ceil(r/(8/n))),r}let Vt=Ft.exports=function(t,e){let n=t.width,r=t.height,i=t.interlace,o=t.bpp,s=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],i){let t=Wt.getImagePasses(n,r);for(let e=0;e<t.length;e++)this._images.push({byteWidth:Jt(t[e].width,o,s),height:t[e].height,lineIndex:0})}else this._images.push({byteWidth:Jt(n,o,s),height:r,lineIndex:0});this._xComparison=8===s?o:16===s?2*o:1};Vt.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},Vt.prototype._unFilterType1=function(t,e,n){let r=this._xComparison,i=r-1;for(let o=0;o<n;o++){let n=t[1+o],s=o>i?e[o-r]:0;e[o]=n+s}},Vt.prototype._unFilterType2=function(t,e,n){let r=this._lastLine;for(let i=0;i<n;i++){let n=t[1+i],o=r?r[i]:0;e[i]=n+o}},Vt.prototype._unFilterType3=function(t,e,n){let r=this._xComparison,i=r-1,o=this._lastLine;for(let s=0;s<n;s++){let n=t[1+s],a=o?o[s]:0,h=s>i?e[s-r]:0,l=Math.floor((h+a)/2);e[s]=n+l}},Vt.prototype._unFilterType4=function(t,e,n){let r=this._xComparison,i=r-1,o=this._lastLine;for(let s=0;s<n;s++){let n=t[1+s],a=o?o[s]:0,h=s>i?e[s-r]:0,l=s>i&&o?o[s-r]:0,u=Kt(h,a,l);e[s]=n+u}},Vt.prototype._reverseFilterLine=function(t){let e,n=t[0],r=this._images[this._imageIndex],i=r.byteWidth;if(0===n)e=t.slice(1,i+1);else switch(e=Buffer.alloc(i),n){case 1:this._unFilterType1(t,e,i);break;case 2:this._unFilterType2(t,e,i);break;case 3:this._unFilterType3(t,e,i);break;case 4:this._unFilterType4(t,e,i);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(e),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=e,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())};var qt=Ft.exports;let Qt=o,Zt=Yt,$t=qt,Xt=Ht.exports=function(t){Zt.call(this);let e=[],n=this;this._filter=new $t(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){n.emit("complete",Buffer.concat(e))}}),this._filter.start()};Qt.inherits(Xt,Zt);var te=Ht.exports,ee={exports:{}},ne={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5},re={exports:{}};let ie=[];!function(){for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;ie[t]=e}}();let oe=re.exports=function(){this._crc=-1};oe.prototype.write=function(t){for(let e=0;e<t.length;e++)this._crc=ie[255&(this._crc^t[e])]^this._crc>>>8;return!0},oe.prototype.crc32=function(){return-1^this._crc},oe.crc32=function(t){let e=-1;for(let n=0;n<t.length;n++)e=ie[255&(e^t[n])]^e>>>8;return-1^e};var se=re.exports;let ae=ne,he=se,le=ee.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[ae.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[ae.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[ae.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[ae.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[ae.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[ae.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};le.prototype.start=function(){this.read(ae.PNG_SIGNATURE.length,this._parseSignature.bind(this))},le.prototype._parseSignature=function(t){let e=ae.PNG_SIGNATURE;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},le.prototype._parseChunkBegin=function(t){let e=t.readUInt32BE(0),n=t.readUInt32BE(4),r="";for(let e=4;e<8;e++)r+=String.fromCharCode(t[e]);let i=Boolean(32&t[4]);if(this._hasIHDR||n===ae.TYPE_IHDR){if(this._crc=new he,this._crc.write(Buffer.from(r)),this._chunks[n])return this._chunks[n](e);i?this.read(e+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+r))}else this.error(new Error("Expected IHDR on beggining"))},le.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},le.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},le.prototype._parseChunkEnd=function(t){let e=t.readInt32BE(0),n=this._crc.crc32();this._options.checkCRC&&n!==e?this.error(new Error("Crc error - "+e+" - "+n)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},le.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},le.prototype._parseIHDR=function(t){this._crc.write(t);let e=t.readUInt32BE(0),n=t.readUInt32BE(4),r=t[8],i=t[9],o=t[10],s=t[11],a=t[12];if(8!==r&&4!==r&&2!==r&&1!==r&&16!==r)return void this.error(new Error("Unsupported bit depth "+r));if(!(i in ae.COLORTYPE_TO_BPP_MAP))return void this.error(new Error("Unsupported color type"));if(0!==o)return void this.error(new Error("Unsupported compression method"));if(0!==s)return void this.error(new Error("Unsupported filter method"));if(0!==a&&1!==a)return void this.error(new Error("Unsupported interlace method"));this._colorType=i;let h=ae.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:n,depth:r,interlace:Boolean(a),palette:Boolean(i&ae.COLORTYPE_PALETTE),color:Boolean(i&ae.COLORTYPE_COLOR),alpha:Boolean(i&ae.COLORTYPE_ALPHA),bpp:h,colorType:i}),this._handleChunkEnd()},le.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},le.prototype._parsePLTE=function(t){this._crc.write(t);let e=Math.floor(t.length/3);for(let n=0;n<e;n++)this._palette.push([t[3*n],t[3*n+1],t[3*n+2],255]);this.palette(this._palette),this._handleChunkEnd()},le.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},le.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===ae.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(t.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(let e=0;e<t.length;e++)this._palette[e][3]=t[e];this.palette(this._palette)}this._colorType===ae.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===ae.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()},le.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},le.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/ae.GAMMA_DIVISION),this._handleChunkEnd()},le.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},le.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===ae.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(e);let n=t-e.length;n>0?this._handleIDAT(n):this._handleChunkEnd()},le.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},le.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()};var ue=ee.exports,fe={};let ce=zt,de=[function(){},function(t,e,n,r){if(r===e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=255},function(t,e,n,r){if(r+1>=e.length)throw new Error("Ran out of data");let i=e[r];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=e[r+1]},function(t,e,n,r){if(r+2>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=255},function(t,e,n,r){if(r+3>=e.length)throw new Error("Ran out of data");t[n]=e[r],t[n+1]=e[r+1],t[n+2]=e[r+2],t[n+3]=e[r+3]}],pe=[function(){},function(t,e,n,r){let i=e[0];t[n]=i,t[n+1]=i,t[n+2]=i,t[n+3]=r},function(t,e,n){let r=e[0];t[n]=r,t[n+1]=r,t[n+2]=r,t[n+3]=e[1]},function(t,e,n,r){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=r},function(t,e,n){t[n]=e[0],t[n+1]=e[1],t[n+2]=e[2],t[n+3]=e[3]}];function ge(t,e,n,r,i,o){let s=t.width,a=t.height,h=t.index;for(let t=0;t<a;t++)for(let a=0;a<s;a++){let s=n(a,t,h);de[r](e,i,s,o),o+=r}return o}function _e(t,e,n,r,i,o){let s=t.width,a=t.height,h=t.index;for(let t=0;t<a;t++){for(let a=0;a<s;a++){let s=i.get(r),l=n(a,t,h);pe[r](e,s,l,o)}i.resetAfterLine()}}fe.dataToBitMap=function(t,e){let n,r,i=e.width,o=e.height,s=e.depth,a=e.bpp,h=e.interlace;8!==s&&(n=function(t,e){let n=[],r=0;function i(){if(r===t.length)throw new Error("Ran out of data");let i,o,s,a,h,l,u,f,c=t[r];switch(r++,e){default:throw new Error("unrecognised depth");case 16:u=t[r],r++,n.push((c<<8)+u);break;case 4:u=15&c,f=c>>4,n.push(f,u);break;case 2:h=3&c,l=c>>2&3,u=c>>4&3,f=c>>6&3,n.push(f,u,l,h);break;case 1:i=1&c,o=c>>1&1,s=c>>2&1,a=c>>3&1,h=c>>4&1,l=c>>5&1,u=c>>6&1,f=c>>7&1,n.push(f,u,l,h,a,s,o,i)}}return{get:function(t){for(;n.length<t;)i();let e=n.slice(0,t);return n=n.slice(t),e},resetAfterLine:function(){n.length=0},end:function(){if(r!==t.length)throw new Error("extra data found")}}}(t,s)),r=s<=8?Buffer.alloc(i*o*4):new Uint16Array(i*o*4);let l,u,f=Math.pow(2,s)-1,c=0;if(h)l=ce.getImagePasses(i,o),u=ce.getInterlaceIterator(i,o);else{let t=0;u=function(){let e=t;return t+=4,e},l=[{width:i,height:o}]}for(let e=0;e<l.length;e++)8===s?c=ge(l[e],r,u,a,t,c):_e(l[e],r,u,a,n,f);if(8===s){if(c!==t.length)throw new Error("extra data found")}else n.end();return r};var me=function(t,e){let n=e.depth,r=e.width,i=e.height,o=e.colorType,s=e.transColor,a=e.palette,h=t;return 3===o?function(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let r=0;r<n;r++){let n=i[t[o]];if(!n)throw new Error("index "+t[o]+" not in palette");for(let t=0;t<4;t++)e[o+t]=n[t];o+=4}}(t,h,r,i,a):(s&&function(t,e,n,r,i){let o=0;for(let s=0;s<r;s++)for(let r=0;r<n;r++){let n=!1;if(1===i.length?i[0]===t[o]&&(n=!0):i[0]===t[o]&&i[1]===t[o+1]&&i[2]===t[o+2]&&(n=!0),n)for(let t=0;t<4;t++)e[o+t]=0;o+=4}}(t,h,r,i,s),8!==n&&(16===n&&(h=Buffer.alloc(r*i*4)),function(t,e,n,r,i){let o=Math.pow(2,i)-1,s=0;for(let i=0;i<r;i++)for(let r=0;r<n;r++){for(let n=0;n<4;n++)e[s+n]=Math.floor(255*t[s+n]/o+.5);s+=4}}(t,h,r,i,n))),h};let we=o,ye=a,Ee=Yt,be=te,Te=ue,Ce=fe,Ae=me,Ie=xt.exports=function(t){Ee.call(this),this._parser=new Te(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};we.inherits(Ie,Ee),Ie.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},Ie.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=ye.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{let t=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,e=Math.max(t,ye.Z_MIN_CHUNK);this._inflate=ye.createInflate({chunkSize:e});let n=t,r=this.emit.bind(this,"error");this._inflate.on("error",(function(t){n&&r(t)})),this._filter.on("complete",this._complete.bind(this));let i=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){n&&(t.length>n&&(t=t.slice(0,n)),n-=t.length,i(t))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},Ie.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new be(this._bitmapInfo)},Ie.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},Ie.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},Ie.prototype._simpleTransparency=function(){this._metaData.alpha=!0},Ie.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},Ie.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"))},Ie.prototype._complete=function(t){if(this.errord)return;let e;try{let n=Ce.dataToBitMap(t,this._bitmapInfo);e=Ae(n,this._bitmapInfo),n=null}catch(t){return void this._handleError(t)}this.emit("parsed",e)};var Pe=xt.exports,Le={exports:{}},ve={exports:{}};let Be=ne;let Re=jt;let Oe={0:function(t,e,n,r,i){for(let o=0;o<n;o++)r[i+o]=t[e+o]},1:function(t,e,n,r,i,o){for(let s=0;s<n;s++){let n=s>=o?t[e+s-o]:0,a=t[e+s]-n;r[i+s]=a}},2:function(t,e,n,r,i){for(let o=0;o<n;o++){let s=e>0?t[e+o-n]:0,a=t[e+o]-s;r[i+o]=a}},3:function(t,e,n,r,i,o){for(let s=0;s<n;s++){let a=s>=o?t[e+s-o]:0,h=e>0?t[e+s-n]:0,l=t[e+s]-(a+h>>1);r[i+s]=l}},4:function(t,e,n,r,i,o){for(let s=0;s<n;s++){let a=s>=o?t[e+s-o]:0,h=e>0?t[e+s-n]:0,l=e>0&&s>=o?t[e+s-(n+o)]:0,u=t[e+s]-Re(a,h,l);r[i+s]=u}}},Me={0:function(t,e,n){let r=0,i=e+n;for(let n=e;n<i;n++)r+=Math.abs(t[n]);return r},1:function(t,e,n,r){let i=0;for(let o=0;o<n;o++){let n=o>=r?t[e+o-r]:0,s=t[e+o]-n;i+=Math.abs(s)}return i},2:function(t,e,n){let r=0,i=e+n;for(let o=e;o<i;o++){let i=e>0?t[o-n]:0,s=t[o]-i;r+=Math.abs(s)}return r},3:function(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,a=e>0?t[e+o-n]:0,h=t[e+o]-(s+a>>1);i+=Math.abs(h)}return i},4:function(t,e,n,r){let i=0;for(let o=0;o<n;o++){let s=o>=r?t[e+o-r]:0,a=e>0?t[e+o-n]:0,h=e>0&&o>=r?t[e+o-(n+r)]:0,l=t[e+o]-Re(s,a,h);i+=Math.abs(l)}return i}};let ke=ne,xe=se,Ne=function(t,e,n,r){let i=-1!==[Be.COLORTYPE_COLOR_ALPHA,Be.COLORTYPE_ALPHA].indexOf(r.colorType);if(r.colorType===r.inputColorType){let e=function(){let t=new ArrayBuffer(2);return new DataView(t).setInt16(0,256,!0),256!==new Int16Array(t)[0]}();if(8===r.bitDepth||16===r.bitDepth&&e)return t}let o=16!==r.bitDepth?t:new Uint16Array(t.buffer),s=255,a=Be.COLORTYPE_TO_BPP_MAP[r.inputColorType];4!==a||r.inputHasAlpha||(a=3);let h=Be.COLORTYPE_TO_BPP_MAP[r.colorType];16===r.bitDepth&&(s=65535,h*=2);let l=Buffer.alloc(e*n*h),u=0,f=0,c=r.bgColor||{};function d(){let t,e,n,a=s;switch(r.inputColorType){case Be.COLORTYPE_COLOR_ALPHA:a=o[u+3],t=o[u],e=o[u+1],n=o[u+2];break;case Be.COLORTYPE_COLOR:t=o[u],e=o[u+1],n=o[u+2];break;case Be.COLORTYPE_ALPHA:a=o[u+1],t=o[u],e=t,n=t;break;case Be.COLORTYPE_GRAYSCALE:t=o[u],e=t,n=t;break;default:throw new Error("input color type:"+r.inputColorType+" is not supported at present")}return r.inputHasAlpha&&(i||(a/=s,t=Math.min(Math.max(Math.round((1-a)*c.red+a*t),0),s),e=Math.min(Math.max(Math.round((1-a)*c.green+a*e),0),s),n=Math.min(Math.max(Math.round((1-a)*c.blue+a*n),0),s))),{red:t,green:e,blue:n,alpha:a}}void 0===c.red&&(c.red=s),void 0===c.green&&(c.green=s),void 0===c.blue&&(c.blue=s);for(let t=0;t<n;t++)for(let t=0;t<e;t++){let t=d();switch(r.colorType){case Be.COLORTYPE_COLOR_ALPHA:case Be.COLORTYPE_COLOR:8===r.bitDepth?(l[f]=t.red,l[f+1]=t.green,l[f+2]=t.blue,i&&(l[f+3]=t.alpha)):(l.writeUInt16BE(t.red,f),l.writeUInt16BE(t.green,f+2),l.writeUInt16BE(t.blue,f+4),i&&l.writeUInt16BE(t.alpha,f+6));break;case Be.COLORTYPE_ALPHA:case Be.COLORTYPE_GRAYSCALE:{let e=(t.red+t.green+t.blue)/3;8===r.bitDepth?(l[f]=e,i&&(l[f+1]=t.alpha)):(l.writeUInt16BE(e,f),i&&l.writeUInt16BE(t.alpha,f+2));break}default:throw new Error("unrecognised color Type "+r.colorType)}u+=a,f+=h}return l},De=function(t,e,n,r,i){let o;if("filterType"in r&&-1!==r.filterType){if("number"!=typeof r.filterType)throw new Error("unrecognised filter types");o=[r.filterType]}else o=[0,1,2,3,4];16===r.bitDepth&&(i*=2);let s=e*i,a=0,h=0,l=Buffer.alloc((s+1)*n),u=o[0];for(let e=0;e<n;e++){if(o.length>1){let e=1/0;for(let n=0;n<o.length;n++){let r=Me[o[n]](t,h,s,i);r<e&&(u=o[n],e=r)}}l[a]=u,a++,Oe[u](t,h,s,l,a,i),a+=s,h+=s}return l},Se=a,Ue=ve.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||Se.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:ke.COLORTYPE_COLOR_ALPHA,t.inputColorType="number"==typeof t.inputColorType?t.inputColorType:ke.COLORTYPE_COLOR_ALPHA,-1===[ke.COLORTYPE_GRAYSCALE,ke.COLORTYPE_COLOR,ke.COLORTYPE_COLOR_ALPHA,ke.COLORTYPE_ALPHA].indexOf(t.colorType))throw new Error("option color type:"+t.colorType+" is not supported at present");if(-1===[ke.COLORTYPE_GRAYSCALE,ke.COLORTYPE_COLOR,ke.COLORTYPE_COLOR_ALPHA,ke.COLORTYPE_ALPHA].indexOf(t.inputColorType))throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(8!==t.bitDepth&&16!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};Ue.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},Ue.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},Ue.prototype.filterData=function(t,e,n){let r=Ne(t,e,n,this._options),i=ke.COLORTYPE_TO_BPP_MAP[this._options.colorType];return De(r,e,n,this._options,i)},Ue.prototype._packChunk=function(t,e){let n=e?e.length:0,r=Buffer.alloc(n+12);return r.writeUInt32BE(n,0),r.writeUInt32BE(t,4),e&&e.copy(r,8),r.writeInt32BE(xe.crc32(r.slice(4,r.length-4)),r.length-4),r},Ue.prototype.packGAMA=function(t){let e=Buffer.alloc(4);return e.writeUInt32BE(Math.floor(t*ke.GAMMA_DIVISION),0),this._packChunk(ke.TYPE_gAMA,e)},Ue.prototype.packIHDR=function(t,e){let n=Buffer.alloc(13);return n.writeUInt32BE(t,0),n.writeUInt32BE(e,4),n[8]=this._options.bitDepth,n[9]=this._options.colorType,n[10]=0,n[11]=0,n[12]=0,this._packChunk(ke.TYPE_IHDR,n)},Ue.prototype.packIDAT=function(t){return this._packChunk(ke.TYPE_IDAT,t)},Ue.prototype.packIEND=function(){return this._packChunk(ke.TYPE_IEND,null)};var Ye=ve.exports;let He=o,Fe=s,ze=ne,Ge=Ye,je=Le.exports=function(t){Fe.call(this);let e=t||{};this._packer=new Ge(e),this._deflate=this._packer.createDeflate(),this.readable=!0};He.inherits(je,Fe),je.prototype.pack=function(t,e,n,r){this.emit("data",Buffer.from(ze.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,n)),r&&this.emit("data",this._packer.packGAMA(r));let i=this._packer.filterData(t,e,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(i)};var We=Le.exports,Ke={},Je={exports:{}};!function(t,e){let n=h.ok,r=a,i=o,s=l.kMaxLength;function u(t){if(!(this instanceof u))return new u(t);t&&t.chunkSize<r.Z_MIN_CHUNK&&(t.chunkSize=r.Z_MIN_CHUNK),r.Inflate.call(this,t),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&null!=t.maxLength&&(this._maxLength=t.maxLength)}function f(t,e){t._handle&&(t._handle.close(),t._handle=null)}function c(t,e){return function(t,e){if("string"==typeof e&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");let n=t._finishFlushFlag;return null==n&&(n=r.Z_FINISH),t._processChunk(e,n)}(new u(e),t)}u.prototype._processChunk=function(t,e,i){if("function"==typeof i)return r.Inflate._processChunk.call(this,t,e,i);let o,a,h=this,l=t&&t.length,u=this._chunkSize-this._offset,c=this._maxLength,d=0,p=[],g=0;function _(t,e){if(h._hadError)return;let r=u-e;if(n(r>=0,"have should not go down"),r>0){let t=h._buffer.slice(h._offset,h._offset+r);if(h._offset+=r,t.length>c&&(t=t.slice(0,c)),p.push(t),g+=t.length,c-=t.length,0===c)return!1}return(0===e||h._offset>=h._chunkSize)&&(u=h._chunkSize,h._offset=0,h._buffer=Buffer.allocUnsafe(h._chunkSize)),0===e&&(d+=l-t,l=t,!0)}this.on("error",(function(t){o=t})),n(this._handle,"zlib binding closed");do{a=this._handle.writeSync(e,t,d,l,this._buffer,this._offset,u),a=a||this._writeState}while(!this._hadError&&_(a[0],a[1]));if(this._hadError)throw o;if(g>=s)throw f(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+s.toString(16)+" bytes");let m=Buffer.concat(p,g);return f(this),m},i.inherits(u,r.Inflate),t.exports=e=c,e.Inflate=u,e.createInflate=function(t){return new u(t)},e.inflateSync=c}(Je,Je.exports);var Ve=Je.exports,qe={exports:{}};let Qe=qe.exports=function(t){this._buffer=t,this._reads=[]};Qe.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},Qe.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){let t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;{this._reads.shift();let e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0};var Ze=qe.exports,$e={};let Xe=Ze,tn=qt;$e.process=function(t,e){let n=[],r=new Xe(t);return new tn(e,{read:r.read.bind(r),write:function(t){n.push(t)},complete:function(){}}).start(),r.process(),Buffer.concat(n)};let en=!0,nn=a,rn=Ve;nn.deflateSync||(en=!1);let on=Ze,sn=$e,an=ue,hn=fe,ln=me;let un=!0,fn=a;fn.deflateSync||(un=!1);let cn=ne,dn=Ye;let pn=function(t,e){if(!en)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let n,r,i;let o=[];let s=new on(t),a=new an(e,{read:s.read.bind(s),error:function(t){n=t},metadata:function(t){r=t},gamma:function(t){i=t},palette:function(t){r.palette=t},transColor:function(t){r.transColor=t},inflateData:function(t){o.push(t)},simpleTransparency:function(){r.alpha=!0}});if(a.start(),s.process(),n)throw n;let h,l=Buffer.concat(o);if(o.length=0,r.interlace)h=nn.inflateSync(l);else{let t=(1+(r.width*r.bpp*r.depth+7>>3))*r.height;h=rn(l,{chunkSize:t,maxLength:t})}if(l=null,!h||!h.length)throw new Error("bad png - invalid inflate data response");let u=sn.process(h,r);l=null;let f=hn.dataToBitMap(u,r);u=null;let c=ln(f,r);return r.data=c,r.gamma=i||0,r},gn=function(t,e){if(!un)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");let n=new dn(e||{}),r=[];r.push(Buffer.from(cn.PNG_SIGNATURE)),r.push(n.packIHDR(t.width,t.height)),t.gamma&&r.push(n.packGAMA(t.gamma));let i=n.filterData(t.data,t.width,t.height),o=fn.deflateSync(i,n.getDeflateOptions());if(i=null,!o||!o.length)throw new Error("bad png - invalid compressed data response");return r.push(n.packIDAT(o)),r.push(n.packIEND()),Buffer.concat(r)};Ke.read=function(t,e){return pn(t,e||{})},Ke.write=function(t,e){return gn(t,e)};let _n=o,mn=s,wn=Pe,yn=We,En=Ke,bn=kt.PNG=function(t){mn.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?Buffer.alloc(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new wn(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new yn(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};_n.inherits(bn,mn),bn.sync=En,bn.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},bn.prototype.parse=function(t,e){if(e){let t,n;t=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this),n=function(n){this.removeListener("parsed",t),e(n,null)}.bind(this),this.once("parsed",t),this.once("error",n)}return this.end(t),this},bn.prototype.write=function(t){return this._parser.write(t),!0},bn.prototype.end=function(t){this._parser.end(t)},bn.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},bn.prototype._gamma=function(t){this.gamma=t},bn.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},bn.bitblt=function(t,e,n,r,i,o,s,a){if(r|=0,i|=0,o|=0,s|=0,a|=0,(n|=0)>t.width||r>t.height||n+i>t.width||r+o>t.height)throw new Error("bitblt reading outside image");if(s>e.width||a>e.height||s+i>e.width||a+o>e.height)throw new Error("bitblt writing outside image");for(let h=0;h<o;h++)t.data.copy(e.data,(a+h)*e.width+s<<2,(r+h)*t.width+n<<2,(r+h)*t.width+n+i<<2)},bn.prototype.bitblt=function(t,e,n,r,i,o,s){return bn.bitblt(this,t,e,n,r,i,o,s),this},bn.adjustGamma=function(t){if(t.gamma){for(let e=0;e<t.height;e++)for(let n=0;n<t.width;n++){let r=t.width*e+n<<2;for(let e=0;e<3;e++){let n=t.data[r+e]/255;n=Math.pow(n,1/2.2/t.gamma),t.data[r+e]=Math.round(255*n)}}t.gamma=0}},bn.prototype.adjustGamma=function(){bn.adjustGamma(this)};var Tn={};!function(t){function e(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map((function(t){return[t,t]})))),6===e.length&&e.push("F","F");const n=parseInt(e.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+e.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const n=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:e(t.color.dark||"#000000ff"),light:e(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const i=n.modules.size,o=n.modules.data,s=t.getScale(i,r),a=Math.floor((i+2*r.margin)*s),h=r.margin*s,l=[r.color.light,r.color.dark];for(let t=0;t<a;t++)for(let n=0;n<a;n++){let u=4*(t*a+n),f=r.color.light;if(t>=h&&n>=h&&t<a-h&&n<a-h){f=l[o[Math.floor((t-h)/s)*i+Math.floor((n-h)/s)]?1:0]}e[u++]=f.r,e[u++]=f.g,e[u++]=f.b,e[u]=f.a}}}(Tn),function(t){const e=i,n=kt.PNG,r=Tn;t.render=function(t,e){const i=r.getOptions(e),o=i.rendererOpts,s=r.getImageWidth(t.modules.size,i);o.width=s,o.height=s;const a=new n(o);return r.qrToImageData(a.data,t,i),a},t.renderToDataURL=function(e,n,r){void 0===r&&(r=n,n=void 0),t.renderToBuffer(e,n,(function(t,e){t&&r(t);let n="data:image/png;base64,";n+=e.toString("base64"),r(null,n)}))},t.renderToBuffer=function(e,n,r){void 0===r&&(r=n,n=void 0);const i=t.render(e,n),o=[];i.on("error",r),i.on("data",(function(t){o.push(t)})),i.on("end",(function(){r(null,Buffer.concat(o))})),i.pack()},t.renderToFile=function(n,r,i,o){void 0===o&&(o=i,i=void 0);let s=!1;const a=(...t)=>{s||(s=!0,o.apply(null,t))},h=e.createWriteStream(n);h.on("error",a),h.on("close",a),t.renderToFileStream(h,r,i)},t.renderToFileStream=function(e,n,r){t.render(n,r).pack().pipe(e)}}(Mt);var Cn={};!function(t){const e=Tn,n={WW:" ",WB:"▄",BB:"█",BW:"▀"},r={BB:" ",BW:"▄",WW:"█",WB:"▀"};function o(t,e,n){return t&&e?n.BB:t&&!e?n.BW:!t&&e?n.WB:n.WW}t.render=function(t,i,s){const a=e.getOptions(i);let h=n;"#ffffff"!==a.color.dark.hex&&"#000000"!==a.color.light.hex||(h=r);const l=t.modules.size,u=t.modules.data;let f="",c=Array(l+2*a.margin+1).join(h.WW);c=Array(a.margin/2+1).join(c+"\n");const d=Array(a.margin+1).join(h.WW);f+=c;for(let t=0;t<l;t+=2){f+=d;for(let e=0;e<l;e++){f+=o(u[t*l+e],u[(t+1)*l+e],h)}f+=d+"\n"}return f+=c.slice(0,-1),"function"==typeof s&&s(null,f),f},t.renderToFile=function(e,n,r,o){void 0===o&&(o=r,r=void 0);const s=i,a=t.render(n,r);s.writeFile(e,a,o)}}(Cn);var An={},In={render:function(t,e,n){const r=t.modules.size,i=t.modules.data,o=" ";let s="";const a=Array(r+3).join(o),h=Array(2).join(o);s+=a+"\n";for(let t=0;t<r;++t){s+=o;for(let e=0;e<r;e++)s+=i[t*r+e]?" ":o;s+=h+"\n"}return s+=a+"\n","function"==typeof n&&n(null,s),s}},Pn={};const Ln="",vn="",Bn="",Rn=""+vn,On=""+Ln,Mn=function(t,e,n,r){const i=e+1;if(n>=i||r>=i||r<-1||n<-1)return"0";if(n>=e||r>=e||r<0||n<0)return"1";return t[r*e+n]?"2":"1"},kn=function(t,e,n,r){return Mn(t,e,n,r)+Mn(t,e,n,r+1)};Pn.render=function(t,e,n){const r=t.modules.size,i=t.modules.data,o=!(!e||!e.inverse),s=e&&e.inverse?On:Rn,a=function(t,e,n){return{"00":Bn+" "+t,"01":Bn+e+"▄"+t,"02":Bn+n+"▄"+t,10:Bn+e+"▀"+t,11:" ",12:"▄",20:Bn+n+"▀"+t,21:"▀",22:"█"}}(s,o?vn:Ln,o?Ln:vn),h=Bn+"\n"+s;let l=s;for(let t=-1;t<r+1;t+=2){for(let e=-1;e<r;e++)l+=a[kn(i,r,e,t)];l+=a[kn(i,r,r,t)]+h}return l+=Bn,"function"==typeof n&&n(null,l),l};const xn=In,Nn=Pn;An.render=function(t,e,n){return e&&e.small?Nn.render(t,e,n):xn.render(t,e,n)};var Dn,Sn={},Un={};function Yn(){if(Dn)return Un;Dn=1;const t=Tn;function e(t,e){const n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function n(t,e,n){let r=t+e;return void 0!==n&&(r+=" "+n),r}return Un.render=function(r,i,o){const s=t.getOptions(i),a=r.modules.size,h=r.modules.data,l=a+2*s.margin,u=s.color.light.a?"<path "+e(s.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",f="<path "+e(s.color.dark,"stroke")+' d="'+function(t,e,r){let i="",o=0,s=!1,a=0;for(let h=0;h<t.length;h++){const l=Math.floor(h%e),u=Math.floor(h/e);l||s||(s=!0),t[h]?(a++,h>0&&l>0&&t[h-1]||(i+=s?n("M",l+r,.5+u+r):n("m",o,0),o=0,s=!1),l+1<e&&t[h+1]||(i+=n("h",a),a=0)):o++}return i}(h,a,s.margin)+'"/>',c='viewBox="0 0 '+l+" "+l+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+c+' shape-rendering="crispEdges">'+u+f+"</svg>\n";return"function"==typeof o&&o(null,d),d},Un}!function(t){const e=Yn();t.render=e.render,t.renderToFile=function(e,n,r,o){void 0===o&&(o=r,r=void 0);const s=i,a='<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+t.render(n,r);s.writeFile(e,a,o)}}(Sn);var Hn,Fn,zn={},Gn={};function jn(){return Hn||(Hn=1,function(t){const e=Tn;t.render=function(t,n,r){let i=r,o=n;void 0!==i||n&&n.getContext||(i=n,n=void 0),n||(o=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),i=e.getOptions(i);const s=e.getImageWidth(t.modules.size,i),a=o.getContext("2d"),h=a.createImageData(s,s);return e.qrToImageData(h.data,t,i),function(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+"px",e.style.width=n+"px"}(a,o,s),a.putImageData(h,0,0),o},t.renderToDataURL=function(e,n,r){let i=r;void 0!==i||n&&n.getContext||(i=n,n=void 0),i||(i={});const o=t.render(e,n,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}}(Gn)),Gn}const Wn=d,Kn=p,Jn=Mt,Vn=Cn,qn=An,Qn=Sn;function Zn(t,e,n){if(void 0===t)throw new Error("String required as first argument");if(void 0===n&&(n=e,e={}),"function"!=typeof n){if(!Wn())throw new Error("Callback required as last argument");e=n||{},n=null}return{opts:e,cb:n}}function $n(t){switch(t){case"svg":return Qn;case"txt":case"utf8":return Vn;default:return Jn}}function Xn(t,e,n){if(!n.cb)return new Promise((function(r,i){try{const o=Kn.create(e,n.opts);return t(o,n.opts,(function(t,e){return t?i(t):r(e)}))}catch(t){i(t)}}));try{const r=Kn.create(e,n.opts);return t(r,n.opts,n.cb)}catch(t){n.cb(t)}}c.create=Kn.create,c.toCanvas=function(){if(Fn)return zn;Fn=1;const t=d,e=p,n=jn(),r=Yn();function i(n,r,i,o,s){const a=[].slice.call(arguments,1),h=a.length,l="function"==typeof a[h-1];if(!l&&!t())throw new Error("Callback required as last argument");if(!l){if(h<1)throw new Error("Too few arguments provided");return 1===h?(i=r,r=o=void 0):2!==h||r.getContext||(o=i,i=r,r=void 0),new Promise((function(t,s){try{const s=e.create(i,o);t(n(s,r,o))}catch(t){s(t)}}))}if(h<2)throw new Error("Too few arguments provided");2===h?(s=i,i=r,r=o=void 0):3===h&&(r.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=i,i=r,r=void 0));try{const t=e.create(i,o);s(null,n(t,r,o))}catch(t){s(t)}}return zn.create=e.create,zn.toCanvas=i.bind(null,n.render),zn.toDataURL=i.bind(null,n.renderToDataURL),zn.toString=i.bind(null,(function(t,e,n){return r.render(t,n)})),zn}().toCanvas,c.toString=function(t,e,n){const r=Zn(t,e,n),i=function(t){switch(t){case"svg":return Qn;case"terminal":return qn;default:return Vn}}(r.opts?r.opts.type:void 0);return Xn(i.render,t,r)},c.toDataURL=function(t,e,n){const r=Zn(t,e,n);return Xn($n(r.opts.type).renderToDataURL,t,r)},c.toBuffer=function(t,e,n){const r=Zn(t,e,n);return Xn($n(r.opts.type).renderToBuffer,t,r)},c.toFile=function(t,e,n,r){if("string"!=typeof t||"string"!=typeof e&&"object"!=typeof e)throw new Error("Invalid argument");if(arguments.length<3&&!Wn())throw new Error("Too few arguments provided");const i=Zn(e,n,r),o=i.opts.type||function(t){return t.slice(2+(t.lastIndexOf(".")-1>>>0)).toLowerCase()}(t);return Xn($n(o).renderToFile.bind(null,t),e,i)},c.toFileStream=function(t,e,n){if(arguments.length<2)throw new Error("Too few arguments provided");const r=Zn(e,n,t.emit.bind(t,"error"));Xn($n("png").renderToFileStream.bind(null,t),e,r)};var tr=f(c),er=function(i,o){var s=r(!1),a=t(s,2),h=a[0],l=a[1],f=r(),c=t(f,2),d=c[0],p=c[1],g=function(){var t=e(n().mark((function t(e){var r;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l(!0),t.next=3,tr.toDataURL(e,o);case 3:r=t.sent,p(r);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();u((function(){i&&g(i)}),[]);return{value:d,set:function(t){return g(t)},isLoading:h}};export{er as useQRCode};
1
+ /* @license @siberiacancode/reactuse v0.0.36 */
2
+ import{_ as r,e as t,f as e}from"../../_rollupPluginBabelHelpers-y7qx6l7m.js";import{useState as o}from"react";import n from"qrcode";import{useIsomorphicLayoutEffect as s}from"../useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";import"../../utils/helpers/isClient.js";var a=function(a,i){var u=o(!1),c=r(u,2),f=c[0],p=c[1],m=o(),l=r(m,2),v=l[0],h=l[1],L=function(){var r=t(e().mark((function r(t){var o;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return p(!0),r.next=3,n.toDataURL(t,i);case 3:o=r.sent,h(o);case 5:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}();s((function(){a&&L(a)}),[]);return{value:v,set:function(r){return L(r)},isLoading:f}};export{a as useQRCode};
3
3
  //# sourceMappingURL=useQRCode.js.map