@anoki/fse-ui
Version:
FSE UI components library
3 lines (2 loc) • 2.89 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(){return typeof window<"u"}function u(t){return w(t)?(t.nodeName||"").toLowerCase():"#document"}function r(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function S(t){var e;return(e=(w(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function w(t){return s()?t instanceof Node||t instanceof r(t).Node:!1}function p(t){return s()?t instanceof Element||t instanceof r(t).Element:!1}function g(t){return s()?t instanceof HTMLElement||t instanceof r(t).HTMLElement:!1}function d(t){return!s()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof r(t).ShadowRoot}function N(t){const{overflow:e,overflowX:i,overflowY:c,display:n}=b(t);return/auto|scroll|overlay|hidden|clip/.test(e+c+i)&&n!=="inline"&&n!=="contents"}function k(t){return/^(table|td|th)$/.test(u(t))}function T(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const O=/transform|translate|scale|rotate|perspective|filter/,R=/paint|layout|strict|content/,o=t=>!!t&&t!=="none";let a;function v(t){const e=p(t)?b(t):t;return o(e.transform)||o(e.translate)||o(e.scale)||o(e.rotate)||o(e.perspective)||!L()&&(o(e.backdropFilter)||o(e.filter))||O.test(e.willChange||"")||R.test(e.contain||"")}function W(t){let e=l(t);for(;g(e)&&!y(e);){if(v(e))return e;if(T(e))return null;e=l(e)}return null}function L(){return a==null&&(a=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),a}function y(t){return/^(html|body|#document)$/.test(u(t))}function b(t){return r(t).getComputedStyle(t)}function A(t){return p(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function l(t){if(u(t)==="html")return t;const e=t.assignedSlot||t.parentNode||d(t)&&t.host||S(t);return d(e)?e.host:e}function h(t){const e=l(t);return y(e)?t.ownerDocument?t.ownerDocument.body:t.body:g(e)&&N(e)?e:h(e)}function m(t,e,i){var c;e===void 0&&(e=[]),i===void 0&&(i=!0);const n=h(t),D=n===((c=t.ownerDocument)==null?void 0:c.body),f=r(n);if(D){const E=C(f);return e.concat(f,f.visualViewport||[],N(n)?n:[],E&&i?m(E):[])}else return e.concat(n,m(n,[],i))}function C(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}exports.getComputedStyle=b;exports.getContainingBlock=W;exports.getDocumentElement=S;exports.getFrameElement=C;exports.getNearestOverflowAncestor=h;exports.getNodeName=u;exports.getNodeScroll=A;exports.getOverflowAncestors=m;exports.getParentNode=l;exports.getWindow=r;exports.isContainingBlock=v;exports.isElement=p;exports.isHTMLElement=g;exports.isLastTraversableNode=y;exports.isNode=w;exports.isOverflowElement=N;exports.isShadowRoot=d;exports.isTableElement=k;exports.isTopLayer=T;exports.isWebKit=L;
//# sourceMappingURL=index.cjs804.js.map