mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-17 00:46:19 +00:00
2 lines
200 KiB
JavaScript
2 lines
200 KiB
JavaScript
|
|
import{q as V,r as ie,Q as fo,I as Je,a6 as mo,a7 as vo,a8 as Gt,u as i,B as Ue,a9 as cr,aa as Bt,a0 as Be,j as $e,ab as ze,i as Ee,J as Ha,ac as po,ad as ho,ae as Vn,o as je,Z as Ge,V as jt,c as te,f as F,b as He,w as be,af as oe,ag as et,ah as dt,a as we,k as da,d as re,s as tt,n as ye,ai as yo,aj as go,a3 as sa,F as Se,t as Ke,l as xn,P as wo,R as Ie,ak as vt,e as At,al as bo,m as Wa,am as Ia,H as ko}from"./index-DYYtDSji.js";import{o as _o,u as Yt,a as Do}from"./index-DPa-4xgI.js";const la=Math.min,It=Math.max,qa=Math.round,Va=Math.floor,kt=e=>({x:e,y:e}),xo={left:"right",right:"left",bottom:"top",top:"bottom"},Mo={start:"end",end:"start"};function hn(e,t,n){return It(e,la(t,n))}function Ma(e,t){return typeof e=="function"?e(t):e}function qt(e){return e.split("-")[0]}function Pa(e){return e.split("-")[1]}function dr(e){return e==="x"?"y":"x"}function Mn(e){return e==="y"?"height":"width"}const Po=new Set(["top","bottom"]);function Rt(e){return Po.has(qt(e))?"y":"x"}function Pn(e){return dr(Rt(e))}function Ao(e,t,n){n===void 0&&(n=!1);const a=Pa(e),r=Pn(e),o=Mn(r);let s=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=Ua(s)),[s,Ua(s)]}function To(e){const t=Ua(e);return[yn(e),t,yn(t)]}function yn(e){return e.replace(/start|end/g,t=>Mo[t])}const Ln=["left","right"],Wn=["right","left"],Oo=["top","bottom"],Co=["bottom","top"];function So(e,t,n){switch(e){case"top":case"bottom":return n?t?Wn:Ln:t?Ln:Wn;case"left":case"right":return t?Oo:Co;default:return[]}}function Yo(e,t,n,a){const r=Pa(e);let o=So(qt(e),n==="start",a);return r&&(o=o.map(s=>s+"-"+r),t&&(o=o.concat(o.map(yn)))),o}function Ua(e){return e.replace(/left|right|bottom|top/g,t=>xo[t])}function Ro(e){return{top:0,right:0,bottom:0,left:0,...e}}function fr(e){return typeof e!="number"?Ro(e):{top:e,right:e,bottom:e,left:e}}function ja(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}function In(e,t,n){let{reference:a,floating:r}=e;const o=Rt(t),s=Pn(t),l=Mn(s),u=qt(t),h=o==="y",p=a.x+a.width/2-r.width/2,g=a.y+a.height/2-r.height/2,w=a[l]/2-r[l]/2;let c;switch(u){case"top":c={x:p,y:a.y-r.height};break;case"bottom":c={x:p,y:a.y+a.height};break;case"right":c={x:a.x+a.width,y:g};break;case"left":c={x:a.x-r.width,y:g};break;default:c={x:a.x,y:a.y}}switch(Pa(t)){case"start":c[s]-=w*(n&&h?-1:1);break;case"end":c[s]+=w*(n&&h?-1:1);break}return c}const $o=async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let h=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:p,y:g}=In(h,a,u),w=a,c={},y=0;for(let b=0;b<l.length;b++){const{name:_,fn:d}=l[b],{x:m,y:v,data:M,reset:O}=await d({x:p,y:g,initialPlacement:a,placement:w,strategy:r,middlewareData:c,rects:h,platform:s,elements:{reference:e,floating:t}});p=m??p,g=v??g,c={...c,[_]:{...c[_],...M}},O&&y<=50&&(y++,typeof O=="object"&&(O.placement&&(w=O.placement),O.rects&&(h=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):O.rects),{x:p,y:g}=In(h,w,u)),b=-1)}return{x:p,y:g,placement:w,strategy:r,middlewareData:c}};async function mr(e,t){var n;t===void 0&&(t={});const{x:a,y:r,platform:o,rects:s,elements:l,strategy:u}=e,{boundary:h="clippingAncestors",rootBoundary:p="viewport",elementContext:g="floating",altBoundary:w=!1,padding:c=0}=Ma(t,e),y=fr(c),_=l[w?g==="floating"?"reference":"floating":g],d=ja(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(_)))==null||n?_:_.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:h,rootBoundary:p,strategy:u})),m=g==="floating"?{x:a,y:r,width:s.floating.width,height:s.floating.height}:s.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),M=await(o.isElement==null?void 0:o.isElement(v))?await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1}:{x:1,y:1},O=ja(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelati
|