"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../_util/supportsPassive.js"),f=require("../vc-util/Dom/addEventListener.js");function a(i){return i!==window?i.getBoundingClientRect():{top:0,bottom:window.innerHeight}}function c(i,o,e){if(e!==void 0&&o.top>i.top-e)return`${e+o.top}px`}function l(i,o,e){if(e!==void 0&&o.bottom<i.bottom+e){const t=window.innerHeight-o.bottom;return`${e+t}px`}}const s=["resize","scroll","touchstart","touchmove","touchend","pageshow","load"];let n=[];function v(i,o){if(!i)return;let e=n.find(t=>t.target===i);e?e.affixList.push(o):(e={target:i,affixList:[o],eventHandlers:{}},n.push(e),s.forEach(t=>{e.eventHandlers[t]=f.default(i,t,()=>{e.affixList.forEach(r=>{const{lazyUpdatePosition:d}=r.exposed;d()},(t==="touchstart"||t==="touchmove")&&u.default?{passive:!0}:!1)})}))}function g(i){const o=n.find(e=>{const t=e.affixList.includes(i);return t&&(e.affixList=e.affixList.filter(r=>r!==i)),t});o&&o.affixList.length===0&&(n=n.filter(e=>e!==o),s.forEach(e=>{const t=o.eventHandlers[e];t&&t.remove&&t.remove()}))}exports.addObserveTarget=v;exports.getFixedBottom=l;exports.getFixedTop=c;exports.getTargetRect=a;exports.removeObserveTarget=g;
