{"version":3,"sources":["jsdelivr-header.js","/npm/@raddix/use-scroll-spy@0.1.2/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aACA,IAAI,UAAY,OAAO,eACnB,iBAAmB,OAAO,yBAC1B,kBAAoB,OAAO,oBAC3B,aAAe,OAAO,UAAU,eAChC,SAAW,CAAC,EAAQ,KACtB,IAAK,IAAI,KAAQ,EACf,UAAU,EAAQ,EAAM,CAAE,IAAK,EAAI,GAAO,YAAY,GAAO,EAE7D,YAAc,CAAC,EAAI,EAAM,EAAQ,KACnC,GAAI,GAAwB,iBAAT,GAAqC,mBAAT,EAC7C,IAAK,IAAI,KAAO,kBAAkB,GAC3B,aAAa,KAAK,EAAI,IAAQ,IAAQ,GACzC,UAAU,EAAI,EAAK,CAAE,IAAK,IAAM,EAAK,GAAM,aAAc,EAAO,iBAAiB,EAAM,KAAS,EAAK,aAE3G,OAAO,CAAE,EAEP,aAAgB,GAAQ,YAAY,UAAU,CAAC,EAAG,aAAc,CAAE,OAAO,IAAS,GAGlF,YAAc,CAAC,EACnB,SAAS,YAAa,CACpB,aAAc,IAAM,eAEtB,OAAO,QAAU,aAAa,aAC9B,IAAI,aAAe,QAAQ,SACvB,aAAe,CAAC,EAAO,KACzB,MAAO,EAAU,IAAe,EAAI,aAAa,UAAU,IAgB3D,OAfA,EAAI,aAAa,YAAW,KAC1B,MAAM,EAAW,IAAI,sBAAsB,IACzC,EAAQ,SAAS,GAAM,EAAE,gBAAkB,EAAY,EAAE,OAAO,KAAI,GACnE,GAUH,OATA,EAAM,SAAS,IACb,IAAK,EACH,OAEF,MAAM,EAAU,SAAS,eAAe,GACpC,GACF,EAAS,QAAQ,EACnB,IAEK,IAAM,EAAS,YAAY,GACjC,CAAC,EAAO,IACJ,CAAQ","file":"/npm/@raddix/use-scroll-spy@0.1.2/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/@raddix/use-scroll-spy@0.1.2/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\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n  for (var name in all)\n    __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n  if (from && typeof from === \"object\" || typeof from === \"function\") {\n    for (let key of __getOwnPropNames(from))\n      if (!__hasOwnProp.call(to, key) && key !== except)\n        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n  }\n  return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n  useScrollSpy: () => useScrollSpy\n});\nmodule.exports = __toCommonJS(src_exports);\nvar import_react = require(\"react\");\nvar useScrollSpy = (items, options) => {\n  const [activeId, setActiveId] = (0, import_react.useState)(\"\");\n  (0, import_react.useEffect)(() => {\n    const observer = new IntersectionObserver((entries) => {\n      entries.forEach((e) => e.isIntersecting && setActiveId(e.target.id));\n    }, options);\n    items.forEach((id) => {\n      if (!id) {\n        return;\n      }\n      const element = document.getElementById(id);\n      if (element) {\n        observer.observe(element);\n      }\n    });\n    return () => observer.disconnect();\n  }, [items, options]);\n  return activeId;\n};\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  useScrollSpy\n});\n"]}