wiki.techinc.nl/resources/lib/codex/modules/floating-ui.dom.js
Eric Gardner af7df71542 Update Codex from 1.7.0 to 1.8.0
Also adds @size-tooltip and @background-color-inverted to
mediawiki.skin.defaults.less.

Bug: T308520
Bug: T340456
Bug: T349793
Bug: T364306
Bug: T366129
Bug: T366541
Bug: T366861
Bug: T367098
Bug: T367100
Bug: T367101
Change-Id: Ie06bf3e15e55272f0ebecfebe4baa9564fa804df
2024-06-25 14:27:50 -07:00

1 line
18 KiB
JavaScript

"use strict";var Ht=Object.defineProperty,Vt=Object.defineProperties;var zt=Object.getOwnPropertyDescriptors;var nt=Object.getOwnPropertySymbols;var xt=Object.prototype.hasOwnProperty,yt=Object.prototype.propertyIsEnumerable;var wt=(t,e,n)=>e in t?Ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e)=>{for(var n in e||(e={}))xt.call(e,n)&&wt(t,n,e[n]);if(nt)for(var n of nt(e))yt.call(e,n)&&wt(t,n,e[n]);return t},R=(t,e)=>Vt(t,zt(e));var G=(t,e)=>{var n={};for(var o in t)xt.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&nt)for(var o of nt(t))e.indexOf(o)<0&&yt.call(t,o)&&(n[o]=t[o]);return n};var T=(t,e,n)=>new Promise((o,i)=>{var r=l=>{try{f(n.next(l))}catch(c){i(c)}},s=l=>{try{f(n.throw(l))}catch(c){i(c)}},f=l=>l.done?o(l.value):Promise.resolve(l.value).then(r,s);f((n=n.apply(t,e)).next())});const $t=["top","right","bottom","left"],I=Math.min,C=Math.max,it=Math.round,ot=Math.floor,P=t=>({x:t,y:t}),_t={left:"right",right:"left",bottom:"top",top:"bottom"},It={start:"end",end:"start"};function vt(t,e,n){return C(t,I(e,n))}function Y(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function Lt(t){return t==="x"?"y":"x"}function Tt(t){return t==="y"?"height":"width"}function tt(t){return["top","bottom"].includes(W(t))?"y":"x"}function St(t){return Lt(tt(t))}function Xt(t,e,n){n===void 0&&(n=!1);const o=Z(t),i=St(t),r=Tt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=st(s)),[s,st(s)]}function Yt(t){const e=st(t);return[ft(t),e,ft(e)]}function ft(t){return t.replace(/start|end/g,e=>It[e])}function jt(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}function Ut(t,e,n,o){const i=Z(t);let r=jt(W(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(ft)))),r}function st(t){return t.replace(/left|right|bottom|top/g,e=>_t[e])}function qt(t){return A({top:0,right:0,bottom:0,left:0},t)}function Kt(t){return typeof t!="number"?qt(t):{top:t,right:t,bottom:t,left:t}}function rt(t){return R(A({},t),{top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height})}function bt(t,e,n){let{reference:o,floating:i}=t;const r=tt(e),s=St(e),f=Tt(s),l=W(e),c=r==="y",d=o.x+o.width/2-i.width/2,a=o.y+o.height/2-i.height/2,h=o[f]/2-i[f]/2;let u;switch(l){case"top":u={x:d,y:o.y-i.height};break;case"bottom":u={x:d,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:a};break;case"left":u={x:o.x-i.width,y:a};break;default:u={x:o.x,y:o.y}}switch(Z(e)){case"start":u[s]-=h*(n&&c?-1:1);break;case"end":u[s]+=h*(n&&c?-1:1);break}return u}const Gt=(t,e,n)=>T(exports,null,function*(){const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,f=r.filter(Boolean),l=yield s.isRTL==null?void 0:s.isRTL(e);let c=yield s.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:a}=bt(c,o,l),h=o,u={},g=0;for(let m=0;m<f.length;m++){const{name:w,fn:p}=f[m],{x,y,data:b,reset:v}=yield p({x:d,y:a,initialPlacement:o,placement:h,strategy:i,middlewareData:u,rects:c,platform:s,elements:{reference:t,floating:e}});d=x!=null?x:d,a=y!=null?y:a,u=R(A({},u),{[w]:A(A({},u[w]),b)}),v&&g<=50&&(g++,typeof v=="object"&&(v.placement&&(h=v.placement),v.rects&&(c=v.rects===!0?yield s.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:d,y:a}=bt(c,h,l)),m=-1)}return{x:d,y:a,placement:h,strategy:i,middlewareData:u}});function J(t,e){return T(this,null,function*(){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:f,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:a="floating",altBoundary:h=!1,padding:u=0}=Y(e,t),g=Kt(u),w=f[h?a==="floating"?"reference":"floating":a],p=rt(yield r.getClippingRect({element:(n=yield r.isElement==null?void 0:r.isElement(w))==null||n?w:w.contextElement||(yield r.getDocumentElement==null?void 0:r.getDocumentElement(f.floating)),boundary:c,rootBoundary:d,strategy:l})),x=a==="floating"?R(A({},s.floating),{x:o,y:i}):s.reference,y=yield r.getOffsetParent==null?void 0:r.getOffsetParent(f.floating),b=(yield r.isElement==null?void 0:r.isElement(y))?(yield r.getScale==null?void 0:r.getScale(y))||{x:1,y:1}:{x:1,y:1},v=rt(r.convertOffsetParentRelativeRectToViewportRelativeRect?yield r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:x,offsetParent:y,strategy:l}):x);return{top:(p.top-v.top+g.top)/b.y,bottom:(v.bottom-p.bottom+g.bottom)/b.y,left:(p.left-v.left+g.left)/b.x,right:(v.right-p.right+g.right)/b.x}})}const Jt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,fn(n){return T(this,null,function*(){var o,i;const{placement:r,middlewareData:s,rects:f,initialPlacement:l,platform:c,elements:d}=n,gt=Y(t,n),{mainAxis:a=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:w=!0}=gt,p=G(gt,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const x=W(r),y=W(l)===l,b=yield c.isRTL==null?void 0:c.isRTL(d.floating),v=u||(y||!w?[st(l)]:Yt(l));!u&&m!=="none"&&v.push(...Ut(l,w,m,b));const M=[l,...v],V=yield J(n,p),O=[];let N=((i=s.flip)==null?void 0:i.overflows)||[];if(a&&O.push(V[x]),h){const B=Xt(r,f,b);O.push(V[B[0]],V[B[1]])}if(N=[...N,{placement:r,overflows:O}],!O.every(B=>B<=0)){var j,U;const B=(((j=s.flip)==null?void 0:j.index)||0)+1,pt=M[B];if(pt)return{data:{index:B,overflows:N},reset:{placement:pt}};let q=(U=N.filter(z=>z.overflows[0]<=0).sort((z,$)=>z.overflows[1]-$.overflows[1])[0])==null?void 0:U.placement;if(!q)switch(g){case"bestFit":{var ht;const z=(ht=N.map($=>[$.placement,$.overflows.filter(K=>K>0).reduce((K,Bt)=>K+Bt,0)]).sort(($,K)=>$[1]-K[1])[0])==null?void 0:ht[0];z&&(q=z);break}case"initialPlacement":q=l;break}if(r!==q)return{reset:{placement:q}}}return{}})}}};function At(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Rt(t){return $t.some(e=>t[e]>=0)}const Qt=function(t){return t===void 0&&(t={}),{name:"hide",options:t,fn(n){return T(this,null,function*(){const{rects:o}=n,s=Y(t,n),{strategy:i="referenceHidden"}=s,r=G(s,["strategy"]);switch(i){case"referenceHidden":{const f=yield J(n,R(A({},r),{elementContext:"reference"})),l=At(f,o.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Rt(l)}}}case"escaped":{const f=yield J(n,R(A({},r),{altBoundary:!0})),l=At(f,o.floating);return{data:{escapedOffsets:l,escaped:Rt(l)}}}default:return{}}})}}};function Zt(t,e){return T(this,null,function*(){const{placement:n,platform:o,elements:i}=t,r=yield o.isRTL==null?void 0:o.isRTL(i.floating),s=W(n),f=Z(n),l=tt(n)==="y",c=["left","top"].includes(s)?-1:1,d=r&&l?-1:1,a=Y(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:g}=typeof a=="number"?{mainAxis:a,crossAxis:0,alignmentAxis:null}:A({mainAxis:0,crossAxis:0,alignmentAxis:null},a);return f&&typeof g=="number"&&(u=f==="end"?g*-1:g),l?{x:u*d,y:h*c}:{x:h*c,y:u*d}})}const te=function(t){return t===void 0&&(t=0),{name:"offset",options:t,fn(n){return T(this,null,function*(){var o,i;const{x:r,y:s,placement:f,middlewareData:l}=n,c=yield Zt(n,t);return f===((o=l.offset)==null?void 0:o.placement)&&(i=l.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:R(A({},c),{placement:f})}})}}},ee=function(t){return t===void 0&&(t={}),{name:"shift",options:t,fn(n){return T(this,null,function*(){const{x:o,y:i,placement:r}=n,p=Y(t,n),{mainAxis:s=!0,crossAxis:f=!1,limiter:l={fn:x=>{let{x:y,y:b}=x;return{x:y,y:b}}}}=p,c=G(p,["mainAxis","crossAxis","limiter"]),d={x:o,y:i},a=yield J(n,c),h=tt(W(r)),u=Lt(h);let g=d[u],m=d[h];if(s){const x=u==="y"?"top":"left",y=u==="y"?"bottom":"right",b=g+a[x],v=g-a[y];g=vt(b,g,v)}if(f){const x=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=m+a[x],v=m-a[y];m=vt(b,m,v)}const w=l.fn(R(A({},n),{[u]:g,[h]:m}));return R(A({},w),{data:{x:w.x-o,y:w.y-i}})})}}},ne=function(t){return t===void 0&&(t={}),{name:"size",options:t,fn(n){return T(this,null,function*(){const{placement:o,rects:i,platform:r,elements:s}=n,V=Y(t,n),{apply:f=()=>{}}=V,l=G(V,["apply"]),c=yield J(n,l),d=W(o),a=Z(o),h=tt(o)==="y",{width:u,height:g}=i.floating;let m,w;d==="top"||d==="bottom"?(m=d,w=a===((yield r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,m=a==="end"?"top":"bottom");const p=g-c[m],x=u-c[w],y=!n.middlewareData.shift;let b=p,v=x;if(h){const O=u-c.left-c.right;v=a||y?I(x,O):O}else{const O=g-c.top-c.bottom;b=a||y?I(p,O):O}if(y&&!a){const O=C(c.left,0),N=C(c.right,0),j=C(c.top,0),U=C(c.bottom,0);h?v=u-2*(O!==0||N!==0?O+N:C(c.left,c.right)):b=g-2*(j!==0||U!==0?j+U:C(c.top,c.bottom))}yield f(R(A({},n),{availableWidth:v,availableHeight:b}));const M=yield r.getDimensions(s.floating);return u!==M.width||g!==M.height?{reset:{rects:!0}}:{}})}}};function D(t){return at(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function F(t){var e;return(e=(at(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function at(t){return t instanceof Node||t instanceof E(t).Node}function k(t){return t instanceof Element||t instanceof E(t).Element}function S(t){return t instanceof HTMLElement||t instanceof E(t).HTMLElement}function Ot(t){return typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function et(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=L(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function oe(t){return["table","td","th"].includes(D(t))}function ut(t){const e=dt(),n=L(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function ie(t){let e=X(t);for(;S(e)&&!ct(e);){if(ut(e))return e;e=X(e)}return null}function dt(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ct(t){return["html","body","#document"].includes(D(t))}function L(t){return E(t).getComputedStyle(t)}function lt(t){return k(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function X(t){if(D(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ot(t)&&t.host||F(t);return Ot(e)?e.host:e}function Dt(t){const e=X(t);return ct(e)?t.ownerDocument?t.ownerDocument.body:t.body:S(e)&&et(e)?e:Dt(e)}function Q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Dt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=E(i);return r?e.concat(s,s.visualViewport||[],et(i)?i:[],s.frameElement&&n?Q(s.frameElement):[]):e.concat(i,Q(i,[],n))}function kt(t){const e=L(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=S(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,f=it(n)!==r||it(o)!==s;return f&&(n=r,o=s),{width:n,height:o,$:f}}function mt(t){return k(t)?t:t.contextElement}function _(t){const e=mt(t);if(!S(e))return P(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=kt(e);let s=(r?it(n.width):n.width)/o,f=(r?it(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!f||!Number.isFinite(f))&&(f=1),{x:s,y:f}}const se=P(0);function Ft(t){const e=E(t);return!dt()||!e.visualViewport?se:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function re(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(t)?!1:e}function H(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=mt(t);let s=P(1);e&&(o?k(o)&&(s=_(o)):s=_(t));const f=re(r,n,o)?Ft(r):P(0);let l=(i.left+f.x)/s.x,c=(i.top+f.y)/s.y,d=i.width/s.x,a=i.height/s.y;if(r){const h=E(r),u=o&&k(o)?E(o):o;let g=h,m=g.frameElement;for(;m&&o&&u!==g;){const w=_(m),p=m.getBoundingClientRect(),x=L(m),y=p.left+(m.clientLeft+parseFloat(x.paddingLeft))*w.x,b=p.top+(m.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,c*=w.y,d*=w.x,a*=w.y,l+=y,c+=b,g=E(m),m=g.frameElement}}return rt({width:d,height:a,x:l,y:c})}const ce=[":popover-open",":modal"];function Mt(t){return ce.some(e=>{try{return t.matches(e)}catch(n){return!1}})}function le(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=F(o),f=e?Mt(e.floating):!1;if(o===s||f&&r)return n;let l={scrollLeft:0,scrollTop:0},c=P(1);const d=P(0),a=S(o);if((a||!a&&!r)&&((D(o)!=="body"||et(s))&&(l=lt(o)),S(o))){const h=H(o);c=_(o),d.x=h.x+o.clientLeft,d.y=h.y+o.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}}function fe(t){return Array.from(t.getClientRects())}function Nt(t){return H(F(t)).left+lt(t).scrollLeft}function ae(t){const e=F(t),n=lt(t),o=t.ownerDocument.body,i=C(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=C(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Nt(t);const f=-n.scrollTop;return L(o).direction==="rtl"&&(s+=C(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:f}}function ue(t,e){const n=E(t),o=F(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,f=0,l=0;if(i){r=i.width,s=i.height;const c=dt();(!c||c&&e==="fixed")&&(f=i.offsetLeft,l=i.offsetTop)}return{width:r,height:s,x:f,y:l}}function de(t,e){const n=H(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=S(t)?_(t):P(1),s=t.clientWidth*r.x,f=t.clientHeight*r.y,l=i*r.x,c=o*r.y;return{width:s,height:f,x:l,y:c}}function Ct(t,e,n){let o;if(e==="viewport")o=ue(t,n);else if(e==="document")o=ae(F(t));else if(k(e))o=de(e,n);else{const i=Ft(t);o=R(A({},e),{x:e.x-i.x,y:e.y-i.y})}return rt(o)}function Pt(t,e){const n=X(t);return n===e||!k(n)||ct(n)?!1:L(n).position==="fixed"||Pt(n,e)}function me(t,e){const n=e.get(t);if(n)return n;let o=Q(t,[],!1).filter(f=>k(f)&&D(f)!=="body"),i=null;const r=L(t).position==="fixed";let s=r?X(t):t;for(;k(s)&&!ct(s);){const f=L(s),l=ut(s);!l&&f.position==="fixed"&&(i=null),(r?!l&&!i:!l&&f.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||et(s)&&!l&&Pt(t,s))?o=o.filter(d=>d!==s):i=f,s=X(s)}return e.set(t,o),o}function he(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?me(e,this._c):[].concat(n),o],f=s[0],l=s.reduce((c,d)=>{const a=Ct(e,d,i);return c.top=C(a.top,c.top),c.right=I(a.right,c.right),c.bottom=I(a.bottom,c.bottom),c.left=C(a.left,c.left),c},Ct(e,f,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ge(t){const{width:e,height:n}=kt(t);return{width:e,height:n}}function pe(t,e,n){const o=S(e),i=F(e),r=n==="fixed",s=H(t,!0,r,e);let f={scrollLeft:0,scrollTop:0};const l=P(0);if(o||!o&&!r)if((D(e)!=="body"||et(i))&&(f=lt(e)),o){const a=H(e,!0,r,e);l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}else i&&(l.x=Nt(i));const c=s.left+f.scrollLeft-l.x,d=s.top+f.scrollTop-l.y;return{x:c,y:d,width:s.width,height:s.height}}function Et(t,e){return!S(t)||L(t).position==="fixed"?null:e?e(t):t.offsetParent}function Wt(t,e){const n=E(t);if(!S(t)||Mt(t))return n;let o=Et(t,e);for(;o&&oe(o)&&L(o).position==="static";)o=Et(o,e);return o&&(D(o)==="html"||D(o)==="body"&&L(o).position==="static"&&!ut(o))?n:o||ie(t)||n}const we=function(t){return T(this,null,function*(){const e=this.getOffsetParent||Wt,n=this.getDimensions;return{reference:pe(t.reference,yield e(t.floating),t.strategy),floating:A({x:0,y:0},yield n(t.floating))}})};function xe(t){return L(t).direction==="rtl"}const ye={convertOffsetParentRelativeRectToViewportRelativeRect:le,getDocumentElement:F,getClippingRect:he,getOffsetParent:Wt,getElementRects:we,getClientRects:fe,getDimensions:ge,getScale:_,isElement:k,isRTL:xe};function ve(t,e){let n=null,o;const i=F(t);function r(){var f;clearTimeout(o),(f=n)==null||f.disconnect(),n=null}function s(f,l){f===void 0&&(f=!1),l===void 0&&(l=1),r();const{left:c,top:d,width:a,height:h}=t.getBoundingClientRect();if(f||e(),!a||!h)return;const u=ot(d),g=ot(i.clientWidth-(c+a)),m=ot(i.clientHeight-(d+h)),w=ot(c),x={rootMargin:-u+"px "+-g+"px "+-m+"px "+-w+"px",threshold:C(0,I(1,l))||1};let y=!0;function b(v){const M=v[0].intersectionRatio;if(M!==l){if(!y)return s();M?s(!1,M):o=setTimeout(()=>{s(!1,1e-7)},100)}y=!1}try{n=new IntersectionObserver(b,R(A({},x),{root:i.ownerDocument}))}catch(v){n=new IntersectionObserver(b,x)}n.observe(t)}return s(!0),r}function be(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=mt(t),d=i||r?[...c?Q(c):[],...Q(e)]:[];d.forEach(p=>{i&&p.addEventListener("scroll",n,{passive:!0}),r&&p.addEventListener("resize",n)});const a=c&&f?ve(c,n):null;let h=-1,u=null;s&&(u=new ResizeObserver(p=>{let[x]=p;x&&x.target===c&&u&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=u)==null||y.observe(e)})),n()}),c&&!l&&u.observe(c),u.observe(e));let g,m=l?H(t):null;l&&w();function w(){const p=H(t);m&&(p.x!==m.x||p.y!==m.y||p.width!==m.width||p.height!==m.height)&&n(),m=p,g=requestAnimationFrame(w)}return n(),()=>{var p;d.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),a==null||a(),(p=u)==null||p.disconnect(),u=null,l&&cancelAnimationFrame(g)}}const Ae=ee,Re=Jt,Oe=ne,Ce=Qt,Ee=(t,e,n)=>{const o=new Map,i=A({platform:ye},n),r=R(A({},i.platform),{_c:o});return Gt(t,e,R(A({},i),{platform:r}))};exports.autoUpdate=be;exports.computePosition=Ee;exports.flip=Re;exports.getNodeName=D;exports.hide=Ce;exports.isNode=at;exports.offset=te;exports.shift=Ae;exports.size=Oe;