import{viewport as t}from"../enums.js";import o from"./getViewportRect.js";import e from"./getDocumentRect.js";import r from"./listScrollParents.js";import i from"./getOffsetParent.js";import n from"./getDocumentElement.js";import m from"./getComputedStyle.js";import{isHTMLElement as f,isElement as p}from"./instanceOf.js";import c from"./getBoundingClientRect.js";import l from"./getParentNode.js";import s from"./contains.js";import a from"./getNodeName.js";import u from"../utils/rectToClientRect.js";function g(r,i){return i===t?u(o(r)):f(i)?function(t){var o=c(t);return o.top=o.top+t.clientTop,o.left=o.left+t.clientLeft,o.bottom=o.top+t.clientHeight,o.right=o.left+t.clientWidth,o.width=t.clientWidth,o.height=t.clientHeight,o.x=o.left,o.y=o.top,o}(i):u(e(n(r)))}function h(t,o,e){var n="clippingParents"===o?function(t){var o=r(l(t)),e=["absolute","fixed"].indexOf(m(t).position)>=0&&f(t)?i(t):t;return p(e)?o.filter((function(t){return p(t)&&s(t,e)&&"body"!==a(t)})):[]}(t):[].concat(o),c=[].concat(n,[e]),u=c[0],h=c.reduce((function(o,e){var r=g(t,e);return o.top=Math.max(r.top,o.top),o.right=Math.min(r.right,o.right),o.bottom=Math.min(r.bottom,o.bottom),o.left=Math.max(r.left,o.left),o}),g(t,u));return h.width=h.right-h.left,h.height=h.bottom-h.top,h.x=h.left,h.y=h.top,h}export default h;
//# sourceMappingURL=getClippingRect.js.map
