Outlook_Addin_LLM/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs

2 lines
8.9 KiB
JavaScript
Raw Normal View History

import{rectToClientRect as t,detectOverflow as e,offset as n,autoPlacement as o,shift as i,flip as r,size as c,hide as l,arrow as s,inline as f,limitShift as u,computePosition as a}from"@floating-ui/core";const d=Math.min,h=Math.max,p=Math.round,m=Math.floor,g=t=>({x:t,y:t});function y(t){return x(t)?(t.nodeName||"").toLowerCase():"#document"}function w(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function v(t){var e;return null==(e=(x(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function x(t){return t instanceof Node||t instanceof w(t).Node}function b(t){return t instanceof Element||t instanceof w(t).Element}function L(t){return t instanceof HTMLElement||t instanceof w(t).HTMLElement}function T(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof w(t).ShadowRoot)}function R(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=D(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function E(t){return["table","td","th"].includes(y(t))}function S(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function C(t){const e=F(),n=b(t)?D(t):t;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function F(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function O(t){return["html","body","#document"].includes(y(t))}function D(t){return w(t).getComputedStyle(t)}function H(t){return b(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function W(t){if("html"===y(t))return t;const e=t.assignedSlot||t.parentNode||T(t)&&t.host||v(t);return T(e)?e.host:e}function M(t){const e=W(t);return O(e)?t.ownerDocument?t.ownerDocument.body:t.body:L(e)&&R(e)?e:M(e)}function P(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=M(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),c=w(i);if(r){const t=z(c);return e.concat(c,c.visualViewport||[],R(i)?i:[],t&&n?P(t):[])}return e.concat(i,P(i,[],n))}function z(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function V(t){const e=D(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=L(t),r=i?t.offsetWidth:n,c=i?t.offsetHeight:o,l=p(n)!==r||p(o)!==c;return l&&(n=r,o=c),{width:n,height:o,$:l}}function A(t){return b(t)?t:t.contextElement}function N(t){const e=A(t);if(!L(e))return g(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=V(e);let c=(r?p(n.width):n.width)/o,l=(r?p(n.height):n.height)/i;return c&&Number.isFinite(c)||(c=1),l&&Number.isFinite(l)||(l=1),{x:c,y:l}}const B=g(0);function k(t){const e=w(t);return F()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:B}function I(e,n,o,i){void 0===n&&(n=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),c=A(e);let l=g(1);n&&(i?b(i)&&(l=N(i)):l=N(e));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==w(t))&&e}(c,o,i)?k(c):g(0);let f=(r.left+s.x)/l.x,u=(r.top+s.y)/l.y,a=r.width/l.x,d=r.height/l.y;if(c){const t=w(c),e=i&&b(i)?w(i):i;let n=t,o=z(n);for(;o&&i&&e!==n;){const t=N(o),e=o.getBoundingClientRect(),i=D(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,c=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;f*=t.x,u*=t.y,a*=t.x,d*=t.y,f+=r,u+=c,n=w(o),o=z(n)}}return t({width:a,height:d,x:f,y:u})}function q(t){return I(v(t)).left+H(t).scrollLeft}function X(e,n,o){let i;if("viewport"===n)i=function(t,e){const n=w(t),o=v(t),i=n.visualViewport;let r=o.clientWidth,c=o.clientHeight,l=0,s=0;if(i){r=i.width,c=i.height;const t=F();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,s=i.offsetTop)}return{width:r,height:c,x:l,y:s}}(e,o);else if("document"===n)i=function(t){const e=v(t),n=H(t),o=t.ownerDocument.body,i=h(e.scrollWi