{"version":3,"sources":["jsdelivr-header.js","/npm/use-lifecycle@1.0.0/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAEA,OAAO,eAAe,QAAS,aAAc,CAAE,OAAO,IAEtD,IAAI,MAAQ,QAAQ,SAOpB,SAAS,YAAY,GACnB,MAAM,WAAU,WACd,OAAO,GACT,GAAG,GACL,CAQA,SAAS,aAAa,EAAU,GAC9B,IAAI,EAAU,MAAM,OAAO,CACzB,KAAM,EACN,IAAK,IAEH,EAAc,MAAM,OAAO,GAC/B,MAAM,WAAU,WACd,EAAY,QAAU,CACxB,GAAG,CAAC,IACJ,MAAM,WAAU,WAEd,OADA,EAAQ,QAAQ,IAAM,EACf,WACL,EAAQ,QAAQ,KAAO,CACzB,CACF,GAAG,CAAC,IACJ,MAAM,WAAU,WACV,EAAQ,QAAQ,MAAQ,EAAQ,QAAQ,MAC1C,EAAY,QAAQ,EAAQ,QAAQ,KAExC,GAAG,CAAC,GACN,CAMA,SAAS,eAAe,GACtB,IAAI,EAAM,MAAM,OAAO,GACvB,MAAM,WAAU,WACd,EAAI,QAAU,CAChB,GAAG,CAAC,IACJ,MAAM,WAAU,WACd,OAAO,WACL,OAAO,EAAI,SACb,CACF,GAAG,GACL,CAEA,QAAQ,YAAc,YACtB,QAAQ,aAAe,aACvB,QAAQ,eAAiB","file":"/npm/use-lifecycle@1.0.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/use-lifecycle@1.0.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar react = require('react');\n\n/**\n * A custom hook that triggers a callback when the component first mounts\n * @param {Function} callback The callback that will be triggered on mount\n */\n\nfunction useDidMount(callback) {\n  react.useEffect(function () {\n    return callback();\n  }, []);\n}\n/**\n * A custom hook that triggers a callback passing to it the old value whenever a\n * change is detected\n * @param {Function} callback The callback triggered on change\n * @param {Any} prop The prop to watch for updates\n */\n\nfunction useDidUpdate(callback, prop) {\n  var propRef = react.useRef({\n    prev: prop,\n    now: prop\n  });\n  var callbackRef = react.useRef(callback);\n  react.useEffect(function () {\n    callbackRef.current = callback;\n  }, [callback]);\n  react.useEffect(function () {\n    propRef.current.now = prop;\n    return function () {\n      propRef.current.prev = prop;\n    };\n  }, [prop]);\n  react.useEffect(function () {\n    if (propRef.current.now !== propRef.current.prev) {\n      callbackRef.current(propRef.current.prev);\n    }\n  }, [prop]);\n}\n/**\n * Custom hook that triggers a callback whenever a component is about to unmount\n * @param {Function} callback The callback triggered when unmounting\n */\n\nfunction useWillUnmount(callback) {\n  var ref = react.useRef(callback);\n  react.useEffect(function () {\n    ref.current = callback;\n  }, [callback]);\n  react.useEffect(function () {\n    return function () {\n      return ref.current();\n    };\n  }, []);\n}\n\nexports.useDidMount = useDidMount;\nexports.useDidUpdate = useDidUpdate;\nexports.useWillUnmount = useWillUnmount;\n"]}