"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../utils/is-svg-element.mjs.js"),t=require("../utils/resolve-elements.mjs.js");const s=new WeakMap;let r;const n=(t,s,r)=>(n,i)=>i&&i[0]?i[0][t+"Size"]:e.isSVGElement(n)&&"getBBox"in n?n.getBBox()[s]:n[r],i=n("inline","width","offsetWidth"),o=n("block","height","offsetHeight");function l(e){let{target:t,borderBoxSize:r}=e;s.get(t)?.forEach((e=>{e(t,{get width(){return i(t,r)},get height(){return o(t,r)}})}))}function u(e){e.forEach(l)}exports.resizeElement=function(e,n){r||"undefined"!=typeof ResizeObserver&&(r=new ResizeObserver(u));const i=t.resolveElements(e);return i.forEach((e=>{let t=s.get(e);t||(t=new Set,s.set(e,t)),t.add(n),r?.observe(e)})),()=>{i.forEach((e=>{const t=s.get(e);t?.delete(n),t?.size||r?.unobserve(e)}))}};
//# sourceMappingURL=handle-element.mjs.js.map
