Files
SnowCatQQ/release-tools/webui-static/assets/chunk-WQVQ7P2I-BJd1EiqP.js
T
2026-11-12 06:29:38 +08:00

2 lines
14 KiB
JavaScript

import{t as se,f as ce,V as F,aQ as de,a5 as pe,ao as V,ah as fe}from"./index-DiaaLdUu.js";import{r as S}from"./react-vendor-jWT2yUdV.js";var Te=se({slots:{base:["z-0","relative","bg-transparent","before:content-['']","before:hidden","before:z-[-1]","before:absolute","before:rotate-45","before:w-2.5","before:h-2.5","before:rounded-sm","data-[arrow=true]:before:block","data-[placement=top]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top]:before:left-1/2","data-[placement=top]:before:-translate-x-1/2","data-[placement=top-start]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-start]:before:left-3","data-[placement=top-end]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-end]:before:right-3","data-[placement=bottom]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom]:before:left-1/2","data-[placement=bottom]:before:-translate-x-1/2","data-[placement=bottom-start]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-start]:before:left-3","data-[placement=bottom-end]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-end]:before:right-3","data-[placement=left]:before:-right-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=left]:before:top-1/2","data-[placement=left]:before:-translate-y-1/2","data-[placement=left-start]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-start]:before:top-1/4","data-[placement=left-end]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-end]:before:bottom-1/4","data-[placement=right]:before:-left-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=right]:before:top-1/2","data-[placement=right]:before:-translate-y-1/2","data-[placement=right-start]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-start]:before:top-1/4","data-[placement=right-end]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-end]:before:bottom-1/4",...ce],content:["z-10","px-2.5","py-1","w-full","inline-flex","flex-col","items-center","justify-center","box-border","subpixel-antialiased","outline-none","box-border"],trigger:["z-10"],backdrop:["hidden"],arrow:[]},variants:{size:{sm:{content:"text-tiny"},md:{content:"text-small"},lg:{content:"text-medium"}},color:{default:{base:"before:bg-content1 before:shadow-small",content:"bg-content1"},foreground:{base:"before:bg-foreground",content:F.solid.foreground},primary:{base:"before:bg-primary",content:F.solid.primary},secondary:{base:"before:bg-secondary",content:F.solid.secondary},success:{base:"before:bg-success",content:F.solid.success},warning:{base:"before:bg-warning",content:F.solid.warning},danger:{base:"before:bg-danger",content:F.solid.danger}},radius:{none:{content:"rounded-none"},sm:{content:"rounded-small"},md:{content:"rounded-medium"},lg:{content:"rounded-large"},full:{content:"rounded-full"}},shadow:{none:{content:"shadow-none"},sm:{content:"shadow-small"},md:{content:"shadow-medium"},lg:{content:"shadow-large"}},backdrop:{transparent:{},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-sm backdrop-saturate-150 bg-overlay/30"}},triggerScaleOnOpen:{true:{trigger:["aria-expanded:scale-[0.97]","aria-expanded:opacity-70","subpixel-antialiased"]},false:{}},disableAnimation:{true:{base:"animate-none"}},isTriggerDisabled:{true:{trigger:"opacity-disabled pointer-events-none"},false:{}}},defaultVariants:{color:"default",radius:"lg",size:"md",shadow:"md",backdrop:"transparent",triggerScaleOnOpen:!0},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"block w-full h-full fixed inset-0 -z-30"}}]});function ue(){return typeof window.ResizeObserver<"u"}function J(t){const{ref:e,box:o,onResize:n}=t;S.useEffect(()=>{let l=e==null?void 0:e.current;if(l)if(ue()){const a=new window.ResizeObserver(s=>{s.length&&n()});return a.observe(l,{box:o}),()=>{l&&a.unobserve(l)}}else return window.addEventListener("resize",n,!1),()=>{window.removeEventListener("resize",n,!1)}},[n,e,o])}function G(t,e=-1/0,o=1/0){return Math.min(Math.max(t,e),o)}const M={top:"top",bottom:"top",left:"left",right:"left"},U={top:"bottom",bottom:"top",left:"right",right:"left"},me={top:"left",left:"top"},Q={top:"height",left:"width"},le={width:"totalWidth",height:"totalHeight"},B={};let E=typeof document<"u"?window.visualViewport:null;function K(t){let e=0,o=0,n=0,l=0,a=0,s=0,r={};var v;let d=((v=E==null?void 0:E.scale)!==null&&v!==void 0?v:1)>1;if(t.tagName==="BODY"){let p=document.documentElement;n=p.clientWidth,l=p.clientHeight;var f;e=(f=E==null?void 0:E.width)!==null&&f!==void 0?f:n;var b;o=(b=E==null?void 0:E.height)!==null&&b!==void 0?b:l,r.top=p.scrollTop||t.scrollTop,r.left=p.scrollLeft||t.scrollLeft,E&&(a=E.offsetTop,s=E.offsetLeft)}else({width:e,height:o,top:a,left:s}=N(t)),r.top=t.scrollTop,r.left=t.scrollLeft,n=e,l=o;if(de()&&(t.tagName==="BODY"||t.tagName==="HTML")&&d){r.top=0,r.left=0;var u;a=(u=E==null?void 0:E.pageTop)!==null&&u!==void 0?u:0;var i;s=(i=E==null?void 0:E.pageLeft)!==null&&i!==void 0?i:0}return{width:e,height:o,totalWidth:n,totalHeight:l,scroll:r,top:a,left:s}}function ge(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function W(t,e,o,n,l,a,s){var r;let v=(r=l.scroll[t])!==null&&r!==void 0?r:0,d=n[Q[t]],f=n.scroll[M[t]]+a,b=d+n.scroll[M[t]]-a,u=e-v+s[t]-n[M[t]],i=e-v+o+s[t]-n[M[t]];return u<f?f-u:i>b?Math.max(b-i,f-u):0}function be(t){let e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function D(t){if(B[t])return B[t];let[e,o]=t.split(" "),n=M[e]||"right",l=me[n];M[o]||(o="center");let a=Q[n],s=Q[l];return B[t]={placement:e,crossPlacement:o,axis:n,crossAxis:l,size:a,crossSize:s},B[t]}function q(t,e,o,n,l,a,s,r,v,d){let{placement:f,crossPlacement:b,axis:u,crossAxis:i,size:p,crossSize:h}=n,c={};var m;c[i]=(m=t[i])!==null&&m!==void 0?m:0;var g,_,L,P;b==="center"?c[i]+=(((g=t[h])!==null&&g!==void 0?g:0)-((_=o[h])!==null&&_!==void 0?_:0))/2:b!==i&&(c[i]+=((L=t[h])!==null&&L!==void 0?L:0)-((P=o[h])!==null&&P!==void 0?P:0)),c[i]+=a;const $=t[i]-o[h]+v+d,H=t[i]+t[h]-v-d;if(c[i]=G(c[i],$,H),f===u){const k=r?s[p]:e[le[p]];c[U[u]]=Math.floor(k-t[u]+l)}else c[u]=Math.floor(t[u]+t[p]+l);return c}function ve(t,e,o,n,l,a,s,r){const v=n?o.height:e[le.height];var d;let f=t.top!=null?o.top+t.top:o.top+(v-((d=t.bottom)!==null&&d!==void 0?d:0)-s);var b,u,i,p,h,c;let m=r!=="top"?Math.max(0,e.height+e.top+((b=e.scroll.top)!==null&&b!==void 0?b:0)-f-(((u=l.top)!==null&&u!==void 0?u:0)+((i=l.bottom)!==null&&i!==void 0?i:0)+a)):Math.max(0,f+s-(e.top+((p=e.scroll.top)!==null&&p!==void 0?p:0))-(((h=l.top)!==null&&h!==void 0?h:0)+((c=l.bottom)!==null&&c!==void 0?c:0)+a));return Math.min(e.height-a*2,m)}function ee(t,e,o,n,l,a){let{placement:s,axis:r,size:v}=a;var d,f;if(s===r)return Math.max(0,o[r]-t[r]-((d=t.scroll[r])!==null&&d!==void 0?d:0)+e[r]-((f=n[r])!==null&&f!==void 0?f:0)-n[U[r]]-l);var b;return Math.max(0,t[v]+t[r]+t.scroll[r]-e[r]-o[r]-o[v]-((b=n[r])!==null&&b!==void 0?b:0)-n[U[r]]-l)}function he(t,e,o,n,l,a,s,r,v,d,f,b,u,i,p,h){let c=D(t),{size:m,crossAxis:g,crossSize:_,placement:L,crossPlacement:P}=c,$=q(e,r,o,c,f,b,d,u,p,h),H=f,k=ee(r,d,e,l,a+f,c);if(s&&n[m]>k){let j=D(`${U[L]} ${P}`),ie=q(e,r,o,j,f,b,d,u,p,h);ee(r,d,e,l,a+f,j)>k&&(c=j,$=ie,H=f)}let y="bottom";c.axis==="top"?c.placement==="top"?y="top":c.placement==="bottom"&&(y="bottom"):c.crossAxis==="top"&&(c.crossPlacement==="top"?y="bottom":c.crossPlacement==="bottom"&&(y="top"));let w=W(g,$[g],o[_],r,v,a,d);$[g]+=w;let z=ve($,r,d,u,l,a,o.height,y);i&&i<z&&(z=i),o.height=Math.min(o.height,z),$=q(e,r,o,c,H,b,d,u,p,h),w=W(g,$[g],o[_],r,v,a,d),$[g]+=w;let T={},A=e[g]+.5*e[_]-$[g]-l[M[g]];const R=p/2+h;var O,Y,I,C;const X=M[g]==="left"?((O=l.left)!==null&&O!==void 0?O:0)+((Y=l.right)!==null&&Y!==void 0?Y:0):((I=l.top)!==null&&I!==void 0?I:0)+((C=l.bottom)!==null&&C!==void 0?C:0),Z=o[_]-X-p/2-h,ne=e[g]+p/2-($[g]+l[M[g]]),re=e[g]+e[_]-p/2-($[g]+l[M[g]]),ae=G(A,ne,re);return T[g]=G(ae,R,Z),{position:$,maxHeight:z,arrowOffsetLeft:T.left,arrowOffsetTop:T.top,placement:c.placement}}function $e(t){let{placement:e,targetNode:o,overlayNode:n,scrollNode:l,padding:a,shouldFlip:s,boundaryElement:r,offset:v,crossOffset:d,maxHeight:f,arrowSize:b=0,arrowBoundaryOffset:u=0}=t,i=n instanceof HTMLElement?xe(n):document.documentElement,p=i===document.documentElement;const h=window.getComputedStyle(i).position;let c=!!h&&h!=="static",m=p?N(o):te(o,i);if(!p){let{marginTop:T,marginLeft:A}=window.getComputedStyle(o);m.top+=parseInt(T,10)||0,m.left+=parseInt(A,10)||0}let g=N(n),_=be(n);var L,P;g.width+=((L=_.left)!==null&&L!==void 0?L:0)+((P=_.right)!==null&&P!==void 0?P:0);var $,H;g.height+=(($=_.top)!==null&&$!==void 0?$:0)+((H=_.bottom)!==null&&H!==void 0?H:0);let k=ge(l),y=K(r),w=K(i),z=r.tagName==="BODY"?N(i):te(i,r);return i.tagName==="HTML"&&r.tagName==="BODY"&&(w.scroll.top=0,w.scroll.left=0),he(e,m,g,k,_,a,s,y,w,z,v,d,c,f,b,u)}function N(t){let{top:e,left:o,width:n,height:l}=t.getBoundingClientRect(),{scrollTop:a,scrollLeft:s,clientTop:r,clientLeft:v}=document.documentElement;return{top:e+a-r,left:o+s-v,width:n,height:l}}function te(t,e){let o=window.getComputedStyle(t),n;if(o.position==="fixed"){let{top:l,left:a,width:s,height:r}=t.getBoundingClientRect();n={top:l,left:a,width:s,height:r}}else{n=N(t);let l=N(e),a=window.getComputedStyle(e);l.top+=(parseInt(a.borderTopWidth,10)||0)-e.scrollTop,l.left+=(parseInt(a.borderLeftWidth,10)||0)-e.scrollLeft,n.top-=l.top,n.left-=l.left}return n.top-=parseInt(o.marginTop,10)||0,n.left-=parseInt(o.marginLeft,10)||0,n}function xe(t){let e=t.offsetParent;if(e&&e===document.body&&window.getComputedStyle(e).position==="static"&&!oe(e)&&(e=document.documentElement),e==null)for(e=t.parentElement;e&&!oe(e);)e=e.parentElement;return e||document.documentElement}function oe(t){let e=window.getComputedStyle(t);return e.transform!=="none"||/transform|perspective/.test(e.willChange)||e.filter!=="none"||e.contain==="paint"||"backdropFilter"in e&&e.backdropFilter!=="none"||"WebkitBackdropFilter"in e&&e.WebkitBackdropFilter!=="none"}const we=new WeakMap;function _e(t){let{triggerRef:e,isOpen:o,onClose:n}=t;S.useEffect(()=>{if(!o||n===null)return;let l=a=>{let s=a.target;if(!e.current||s instanceof Node&&!s.contains(e.current)||a.target instanceof HTMLInputElement||a.target instanceof HTMLTextAreaElement)return;let r=n||we.get(e.current);r&&r()};return window.addEventListener("scroll",l,!0),()=>{window.removeEventListener("scroll",l,!0)}},[o,n,e])}let x=typeof document<"u"?window.visualViewport:null;function ye(t){let{direction:e}=pe(),{arrowSize:o=0,targetRef:n,overlayRef:l,scrollRef:a=l,placement:s="bottom",containerPadding:r=12,shouldFlip:v=!0,boundaryElement:d=typeof document<"u"?document.body:null,offset:f=0,crossOffset:b=0,shouldUpdatePosition:u=!0,isOpen:i=!0,onClose:p,maxHeight:h,arrowBoundaryOffset:c=0}=t,[m,g]=S.useState(null),_=[u,s,l.current,n.current,a.current,r,v,d,f,b,i,e,h,c,o],L=S.useRef(x==null?void 0:x.scale);S.useEffect(()=>{i&&(L.current=x==null?void 0:x.scale)},[i]);let P=S.useCallback(()=>{if(u===!1||!i||!l.current||!n.current||!d||(x==null?void 0:x.scale)!==L.current)return;let w=null;if(a.current&&a.current.contains(document.activeElement)){var z;let C=(z=document.activeElement)===null||z===void 0?void 0:z.getBoundingClientRect(),X=a.current.getBoundingClientRect();var T;if(w={type:"top",offset:((T=C==null?void 0:C.top)!==null&&T!==void 0?T:0)-X.top},w.offset>X.height/2){w.type="bottom";var A;w.offset=((A=C==null?void 0:C.bottom)!==null&&A!==void 0?A:0)-X.bottom}}let R=l.current;if(!h&&l.current){var O;R.style.top="0px",R.style.bottom="";var Y;R.style.maxHeight=((Y=(O=window.visualViewport)===null||O===void 0?void 0:O.height)!==null&&Y!==void 0?Y:window.innerHeight)+"px"}let I=$e({placement:Pe(s,e),overlayNode:l.current,targetNode:n.current,scrollNode:a.current||l.current,padding:r,shouldFlip:v,boundaryElement:d,offset:f,crossOffset:b,maxHeight:h,arrowSize:o,arrowBoundaryOffset:c});if(I.position){if(R.style.top="",R.style.bottom="",R.style.left="",R.style.right="",Object.keys(I.position).forEach(C=>R.style[C]=I.position[C]+"px"),R.style.maxHeight=I.maxHeight!=null?I.maxHeight+"px":"",w&&document.activeElement&&a.current){let C=document.activeElement.getBoundingClientRect(),X=a.current.getBoundingClientRect(),Z=C[w.type]-X[w.type];a.current.scrollTop+=Z-w.offset}g(I)}},_);V(P,_),Ee(P),J({ref:l,onResize:P}),J({ref:n,onResize:P});let $=S.useRef(!1);V(()=>{let w,z=()=>{$.current=!0,clearTimeout(w),w=setTimeout(()=>{$.current=!1},500),P()},T=()=>{$.current&&z()};return x==null||x.addEventListener("resize",z),x==null||x.addEventListener("scroll",T),()=>{x==null||x.removeEventListener("resize",z),x==null||x.removeEventListener("scroll",T)}},[P]);let H=S.useCallback(()=>{$.current||p==null||p()},[p,$]);_e({triggerRef:n,isOpen:i,onClose:p&&H});var k,y;return{overlayProps:{style:{position:"absolute",zIndex:1e5,...m==null?void 0:m.position,maxHeight:(k=m==null?void 0:m.maxHeight)!==null&&k!==void 0?k:"100vh"}},placement:(y=m==null?void 0:m.placement)!==null&&y!==void 0?y:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:m==null?void 0:m.arrowOffsetLeft,top:m==null?void 0:m.arrowOffsetTop}},updatePosition:P}}function Ee(t){V(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function Pe(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}function Re(t){let[e,o]=fe(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const n=S.useCallback(()=>{o(!0)},[o]),l=S.useCallback(()=>{o(!1)},[o]),a=S.useCallback(()=>{o(!e)},[o,e]);return{isOpen:e,setOpen:o,open:n,close:l,toggle:a}}var Se=t=>{const e={top:{originY:1},bottom:{originY:0},left:{originX:1},right:{originX:0},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1}};return(e==null?void 0:e[t])||{}},He=t=>({top:"top",bottom:"bottom",left:"left",right:"right","top-start":"top start","top-end":"top end","bottom-start":"bottom start","bottom-end":"bottom end","left-start":"left top","left-end":"left bottom","right-start":"right top","right-end":"right bottom"})[t],ke=(t,e)=>{if(e.includes("-")){const[o]=e.split("-");if(o.includes(t))return!1}return!0},Ie=(t,e)=>{if(e.includes("-")){const[,o]=e.split("-");return`${t}-${o}`}return t};export{we as $,ye as a,ke as b,Ie as c,Re as d,Se as g,Te as p,He as t};