{"version":3,"file":"index-CnhA8i0D.mjs","sources":["../../node_modules/.pnpm/@thednp+position-observer@1.0.7/node_modules/@thednp/position-observer/dist/index.mjs"],"sourcesContent":["const p = (e) => e != null && typeof e == \"object\" || !1, d = (e) => p(e) && typeof e.nodeType == \"number\" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some(\n  (t) => e.nodeType === t\n) || !1, a = (e) => d(e) && e.nodeType === 1 || !1, k = (e) => typeof e == \"function\" || !1, v = \"1.0.7\", u = \"PositionObserver Error\";\nclass y {\n  entries;\n  static version = v;\n  _tick;\n  _root;\n  _callback;\n  /**\n   * The constructor takes two arguments, a `callback`, which is called\n   * whenever the position of an observed element changes and an `options` object.\n   * The callback function should take an array of `PositionObserverEntry` objects\n   * as its only argument, but it's not required.\n   *\n   * @param callback the callback that applies to all targets of this observer\n   * @param options the options of this observer\n   */\n  constructor(t, i) {\n    if (!k(t))\n      throw new Error(`${u}: ${t} is not a function.`);\n    this.entries = /* @__PURE__ */ new Map(), this._callback = t, this._root = a(i?.root) ? i.root : document?.documentElement, this._tick = 0;\n  }\n  /**\n   * Start observing the position of the specified element.\n   * If the element is not currently attached to the DOM,\n   * it will NOT be added to the entries.\n   *\n   * @param target an `Element` target\n   */\n  observe = (t) => {\n    if (!a(t))\n      throw new Error(\n        `${u}: ${t} is not an instance of Element.`\n      );\n    this._root.contains(t) && this._new(t).then(({ boundingClientRect: i }) => {\n      if (i && !this.getEntry(t)) {\n        const { clientWidth: s, clientHeight: n } = this._root;\n        this.entries.set(t, {\n          target: t,\n          boundingClientRect: i,\n          clientWidth: s,\n          clientHeight: n\n        });\n      }\n      this._tick || (this._tick = requestAnimationFrame(this._runCallback));\n    });\n  };\n  /**\n   * Stop observing the position of the specified element.\n   *\n   * @param target an `Element` target\n   */\n  unobserve = (t) => {\n    this.entries.has(t) && this.entries.delete(t);\n  };\n  /**\n   * Private method responsible for all the heavy duty,\n   * the observer's runtime.\n   */\n  _runCallback = () => {\n    if (!this.entries.size) return;\n    const { clientWidth: t, clientHeight: i } = this._root, s = new Promise((n) => {\n      const o = [];\n      this.entries.forEach(\n        ({\n          target: r,\n          boundingClientRect: c,\n          clientWidth: _,\n          clientHeight: f\n        }) => {\n          this._root.contains(r) && this._new(r).then(({ boundingClientRect: h, isIntersecting: m }) => {\n            if (!m) return;\n            const { left: b, top: w } = h;\n            if (c.top !== w || c.left !== b || _ !== t || f !== i) {\n              const l = {\n                target: r,\n                boundingClientRect: h,\n                clientHeight: i,\n                clientWidth: t\n              };\n              this.entries.set(r, l), o.push(l);\n            }\n          });\n        }\n      ), n(o);\n    });\n    this._tick = requestAnimationFrame(async () => {\n      const n = await s;\n      n.length && this._callback(n, this), this._runCallback();\n    });\n  };\n  /**\n   * Check intersection status and resolve it\n   * right away.\n   *\n   * @param target an `Element` target\n   */\n  _new = (t) => new Promise((i) => {\n    new IntersectionObserver(\n      ([n], o) => {\n        o.disconnect(), i(n);\n      }\n    ).observe(t);\n  });\n  /**\n   * Find the entry for a given target.\n   *\n   * @param target an `HTMLElement` target\n   */\n  getEntry = (t) => this.entries.get(t);\n  /**\n   * Immediately stop observing all elements.\n   */\n  disconnect = () => {\n    cancelAnimationFrame(this._tick), this.entries.clear(), this._tick = 0;\n  };\n}\nexport {\n  y as default\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["p","d","k","v","o","r","f","m","b","w","n"],"mappings":"AAAA,MAAMA,IAAI,CAAC,MAAM,KAAK,QAAQ,OAAO,KAAK,YAAY,IAAIC,IAAI,CAAC,MAAMD,EAAE,CAAC,KAAK,OAAO,EAAE,YAAY,YAAY,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,EAAE,EAAE;AAAA,EAChJ,CAAC,MAAM,EAAE,aAAa;AACxB,KAAK,IAAI,IAAI,CAAC,MAAMC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAIC,IAAI,CAAC,MAAM,OAAO,KAAK,cAAc,IAAIC,IA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