UNPKG

@devopness/ui-react

Version:

Devopness Design System React Components - Painless essential DevOps to everyone

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