import{u as F,c as N,r as S,C as Wt,B as rt,N as Ht,O as _t,P as j,F as ht,b as at,e as yt,h as zt,j as Nt,y as xt,Q as jt,R as Xt,M as Yt,n as qt,f as Qt,m as Gt}from"./app-afc25dff.js";function K(t){return t.split("-")[1]}function mt(t){return t==="y"?"height":"width"}function _(t){return t.split("-")[0]}function U(t){return["top","bottom"].includes(_(t))?"x":"y"}function vt(t,e,n){let{reference:o,floating:a}=t;const r=o.x+o.width/2-a.width/2,i=o.y+o.height/2-a.height/2,l=U(e),f=mt(l),s=o[f]/2-a[f]/2,u=l==="x";let c;switch(_(e)){case"top":c={x:r,y:o.y-a.height};break;case"bottom":c={x:r,y:o.y+o.height};break;case"right":c={x:o.x+o.width,y:i};break;case"left":c={x:o.x-a.width,y:i};break;default:c={x:o.x,y:o.y}}switch(K(e)){case"start":c[l]-=s*(n&&u?-1:1);break;case"end":c[l]+=s*(n&&u?-1:1)}return c}const It=async(t,e,n)=>{const{placement:o="bottom",strategy:a="absolute",middleware:r=[],platform:i}=n,l=r.filter(Boolean),f=await(i.isRTL==null?void 0:i.isRTL(e));let s=await i.getElementRects({reference:t,floating:e,strategy:a}),{x:u,y:c}=vt(s,o,f),m=o,d={},h=0;for(let p=0;p({name:"arrow",options:t,async fn(e){const{element:n,padding:o=0}=t||{},{x:a,y:r,placement:i,rects:l,platform:f,elements:s}=e;if(n==null)return{};const u=Tt(o),c={x:a,y:r},m=U(i),d=mt(m),h=await f.getDimensions(n),p=m==="y",g=p?"top":"left",y=p?"bottom":"right",x=p?"clientHeight":"clientWidth",w=l.reference[d]+l.reference[m]-c[m]-l.floating[d],R=c[m]-l.reference[m],v=await(f.getOffsetParent==null?void 0:f.getOffsetParent(n));let C=v?v[x]:0;C&&await(f.isElement==null?void 0:f.isElement(v))||(C=s.floating[x]||l.floating[d]);const V=w/2-R/2,W=u[g],q=C-h[d]-u[y],D=C/2-h[d]/2+V,b=ct(W,D,q),$=K(i)!=null&&D!=b&&l.reference[d]/2-(Dt.concat(e,e+"-start",e+"-end"),[]);const te={left:"right",right:"left",bottom:"top",top:"bottom"};function et(t){return t.replace(/left|right|bottom|top/g,e=>te[e])}function ee(t,e,n){n===void 0&&(n=!1);const o=K(t),a=U(t),r=mt(a);let i=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(i=et(i)),{main:i,cross:et(i)}}const ne={start:"end",end:"start"};function st(t){return t.replace(/start|end/g,e=>ne[e])}const oe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:o,middlewareData:a,rects:r,initialPlacement:i,platform:l,elements:f}=e,{mainAxis:s=!0,crossAxis:u=!0,fallbackPlacements:c,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:h=!0,...p}=t,g=_(o),y=_(i)===i,x=await(l.isRTL==null?void 0:l.isRTL(f.floating)),w=c||(y||!h?[et(i)]:function(b){const $=et(b);return[st(b),$,st($)]}(i));c||d==="none"||w.push(...function(b,$,H,O){const P=K(b);let T=function(Q,lt,Bt){const pt=["left","right"],gt=["right","left"],Mt=["top","bottom"],Vt=["bottom","top"];switch(Q){case"top":case"bottom":return Bt?lt?gt:pt:lt?pt:gt;case"left":case"right":return lt?Mt:Vt;default:return[]}}(_(b),H==="start",O);return P&&(T=T.map(Q=>Q+"-"+P),$&&(T=T.concat(T.map(st)))),T}(i,h,d,x));const R=[i,...w],v=await $t(e,p),C=[];let V=((n=a.flip)==null?void 0:n.overflows)||[];if(s&&C.push(v[g]),u){const{main:b,cross:$}=ee(o,r,x);C.push(v[b],v[$])}if(V=[...V,{placement:o,overflows:C}],!C.every(b=>b<=0)){var W,q;const b=(((W=a.flip)==null?void 0:W.index)||0)+1,$=R[b];if($)return{data:{index:b,overflows:V},reset:{placement:$}};let H=(q=V.filter(O=>O.overflows[0]<=0).sort((O,P)=>O.overflows[1]-P.overflows[1])[0])==null?void 0:q.placement;if(!H)switch(m){case"bestFit":{var D;const O=(D=V.map(P=>[P.placement,P.overflows.filter(T=>T>0).reduce((T,Q)=>T+Q,0)]).sort((P,T)=>P[1]-T[1])[0])==null?void 0:D[0];O&&(H=O);break}case"initialPlacement":H=i}if(o!==H)return{reset:{placement:H}}}return{}}}},ie=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,a=await async function(r,i){const{placement:l,platform:f,elements:s}=r,u=await(f.isRTL==null?void 0:f.isRTL(s.floating)),c=_(l),m=K(l),d=U(l)==="x",h=["left","top"].includes(c)?-1:1,p=u&&d?-1:1,g=typeof i=="function"?i(r):i;let{mainAxis:y,crossAxis:x,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return m&&typeof w=="number"&&(x=m==="end"?-1*w:w),d?{x:x*p,y:y*h}:{x:y*h,y:x*p}}(e,t);return{x:n+a.x,y:o+a.y,data:a}}}};function le(t){return t==="x"?"y":"x"}const re=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:a}=e,{mainAxis:r=!0,crossAxis:i=!1,limiter:l={fn:g=>{let{x:y,y:x}=g;return{x:y,y:x}}},...f}=t,s={x:n,y:o},u=await $t(e,f),c=U(_(a)),m=le(c);let d=s[c],h=s[m];if(r){const g=c==="y"?"bottom":"right";d=ct(d+u[c==="y"?"top":"left"],d,d-u[g])}if(i){const g=m==="y"?"bottom":"right";h=ct(h+u[m==="y"?"top":"left"],h,h-u[g])}const p=l.fn({...e,[c]:d,[m]:h});return{...p,data:{x:p.x-n,y:p.y-o}}}}};function E(t){var e;return((e=t.ownerDocument)==null?void 0:e.defaultView)||window}function A(t){return E(t).getComputedStyle(t)}function At(t){return t instanceof E(t).Node}function M(t){return At(t)?(t.nodeName||"").toLowerCase():""}let Z;function kt(){if(Z)return Z;const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?(Z=t.brands.map(e=>e.brand+"/"+e.version).join(" "),Z):navigator.userAgent}function k(t){return t instanceof E(t).HTMLElement}function L(t){return t instanceof E(t).Element}function wt(t){return typeof ShadowRoot>"u"?!1:t instanceof E(t).ShadowRoot||t instanceof ShadowRoot}function J(t){const{overflow:e,overflowX:n,overflowY:o,display:a}=A(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(a)}function ae(t){return["table","td","th"].includes(M(t))}function ft(t){const e=/firefox/i.test(kt()),n=A(t),o=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!=="none"||n.perspective!=="none"||!!o&&o!=="none"||e&&n.willChange==="filter"||e&&!!n.filter&&n.filter!=="none"||["transform","perspective"].some(a=>n.willChange.includes(a))||["paint","layout","strict","content"].some(a=>{const r=n.contain;return r!=null&&r.includes(a)})}function ut(){return/^((?!chrome|android).)*safari/i.test(kt())}function ot(t){return["html","body","#document"].includes(M(t))}const bt=Math.min,G=Math.max,nt=Math.round;function Dt(t){const e=A(t);let n=parseFloat(e.width),o=parseFloat(e.height);const a=k(t),r=a?t.offsetWidth:n,i=a?t.offsetHeight:o,l=nt(n)!==r||nt(o)!==i;return l&&(n=r,o=i),{width:n,height:o,fallback:l}}function Ct(t){return L(t)?t:t.contextElement}const Pt={x:1,y:1};function X(t){const e=Ct(t);if(!k(e))return Pt;const n=e.getBoundingClientRect(),{width:o,height:a,fallback:r}=Dt(e);let i=(r?nt(n.width):n.width)/o,l=(r?nt(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),l&&Number.isFinite(l)||(l=1),{x:i,y:l}}function z(t,e,n,o){var a,r;e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=Ct(t);let f=Pt;e&&(o?L(o)&&(f=X(o)):f=X(t));const s=l?E(l):window,u=ut()&&n;let c=(i.left+(u&&((a=s.visualViewport)==null?void 0:a.offsetLeft)||0))/f.x,m=(i.top+(u&&((r=s.visualViewport)==null?void 0:r.offsetTop)||0))/f.y,d=i.width/f.x,h=i.height/f.y;if(l){const p=E(l),g=o&&L(o)?E(o):o;let y=p.frameElement;for(;y&&o&&g!==p;){const x=X(y),w=y.getBoundingClientRect(),R=getComputedStyle(y);w.x+=(y.clientLeft+parseFloat(R.paddingLeft))*x.x,w.y+=(y.clientTop+parseFloat(R.paddingTop))*x.y,c*=x.x,m*=x.y,d*=x.x,h*=x.y,c+=w.x,m+=w.y,y=E(y).frameElement}}return tt({width:d,height:h,x:c,y:m})}function B(t){return((At(t)?t.ownerDocument:t.document)||window.document).documentElement}function it(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function St(t){return z(B(t)).left+it(t).scrollLeft}function Y(t){if(M(t)==="html")return t;const e=t.assignedSlot||t.parentNode||wt(t)&&t.host||B(t);return wt(e)?e.host:e}function Ot(t){const e=Y(t);return ot(e)?e.ownerDocument.body:k(e)&&J(e)?e:Ot(e)}function I(t,e){var n;e===void 0&&(e=[]);const o=Ot(t),a=o===((n=t.ownerDocument)==null?void 0:n.body),r=E(o);return a?e.concat(r,r.visualViewport||[],J(o)?o:[]):e.concat(o,I(o))}function Rt(t,e,n){let o;if(e==="viewport")o=function(i,l){const f=E(i),s=B(i),u=f.visualViewport;let c=s.clientWidth,m=s.clientHeight,d=0,h=0;if(u){c=u.width,m=u.height;const p=ut();(!p||p&&l==="fixed")&&(d=u.offsetLeft,h=u.offsetTop)}return{width:c,height:m,x:d,y:h}}(t,n);else if(e==="document")o=function(i){const l=B(i),f=it(i),s=i.ownerDocument.body,u=G(l.scrollWidth,l.clientWidth,s.scrollWidth,s.clientWidth),c=G(l.scrollHeight,l.clientHeight,s.scrollHeight,s.clientHeight);let m=-f.scrollLeft+St(i);const d=-f.scrollTop;return A(s).direction==="rtl"&&(m+=G(l.clientWidth,s.clientWidth)-u),{width:u,height:c,x:m,y:d}}(B(t));else if(L(e))o=function(i,l){const f=z(i,!0,l==="fixed"),s=f.top+i.clientTop,u=f.left+i.clientLeft,c=k(i)?X(i):{x:1,y:1};return{width:i.clientWidth*c.x,height:i.clientHeight*c.y,x:u*c.x,y:s*c.y}}(e,n);else{const i={...e};if(ut()){var a,r;const l=E(t);i.x-=((a=l.visualViewport)==null?void 0:a.offsetLeft)||0,i.y-=((r=l.visualViewport)==null?void 0:r.offsetTop)||0}o=i}return tt(o)}function Ft(t,e){const n=Y(t);return!(n===e||!L(n)||ot(n))&&(A(n).position==="fixed"||Ft(n,e))}function Et(t,e){return k(t)&&A(t).position!=="fixed"?e?e(t):t.offsetParent:null}function Lt(t,e){const n=E(t);if(!k(t))return n;let o=Et(t,e);for(;o&&ae(o)&&A(o).position==="static";)o=Et(o,e);return o&&(M(o)==="html"||M(o)==="body"&&A(o).position==="static"&&!ft(o))?n:o||function(a){let r=Y(a);for(;k(r)&&!ot(r);){if(ft(r))return r;r=Y(r)}return null}(t)||n}function se(t,e,n){const o=k(e),a=B(e),r=z(t,!0,n==="fixed",e);let i={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(o||!o&&n!=="fixed")if((M(e)!=="body"||J(a))&&(i=it(e)),k(e)){const f=z(e,!0);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else a&&(l.x=St(a));return{x:r.left+i.scrollLeft-l.x,y:r.top+i.scrollTop-l.y,width:r.width,height:r.height}}const ce={getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:a}=t;const r=n==="clippingAncestors"?function(s,u){const c=u.get(s);if(c)return c;let m=I(s).filter(g=>L(g)&&M(g)!=="body"),d=null;const h=A(s).position==="fixed";let p=h?Y(s):s;for(;L(p)&&!ot(p);){const g=A(p),y=ft(p);y||g.position!=="fixed"||(d=null),(h?!y&&!d:!y&&g.position==="static"&&d&&["absolute","fixed"].includes(d.position)||J(p)&&!y&&Ft(s,p))?m=m.filter(x=>x!==p):d=g,p=Y(p)}return u.set(s,m),m}(e,this._c):[].concat(n),i=[...r,o],l=i[0],f=i.reduce((s,u)=>{const c=Rt(e,u,a);return s.top=G(c.top,s.top),s.right=bt(c.right,s.right),s.bottom=bt(c.bottom,s.bottom),s.left=G(c.left,s.left),s},Rt(e,l,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:n,strategy:o}=t;const a=k(n),r=B(n);if(n===r)return e;let i={scrollLeft:0,scrollTop:0},l={x:1,y:1};const f={x:0,y:0};if((a||!a&&o!=="fixed")&&((M(n)!=="body"||J(r))&&(i=it(n)),k(n))){const s=z(n);l=X(n),f.x=s.x+n.clientLeft,f.y=s.y+n.clientTop}return{width:e.width*l.x,height:e.height*l.y,x:e.x*l.x-i.scrollLeft*l.x+f.x,y:e.y*l.y-i.scrollTop*l.y+f.y}},isElement:L,getDimensions:function(t){return Dt(t)},getOffsetParent:Lt,getDocumentElement:B,getScale:X,async getElementRects(t){let{reference:e,floating:n,strategy:o}=t;const a=this.getOffsetParent||Lt,r=this.getDimensions;return{reference:se(e,await a(n),o),floating:{x:0,y:0,...await r(n)}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>A(t).direction==="rtl"};function fe(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:a=!0,ancestorResize:r=!0,elementResize:i=!0,animationFrame:l=!1}=o,f=a||r?[...L(t)?I(t):t.contextElement?I(t.contextElement):[],...I(e)]:[];f.forEach(m=>{const d=!L(m)&&m.toString().includes("V");!a||l&&!d||m.addEventListener("scroll",n,{passive:!0}),r&&m.addEventListener("resize",n)});let s,u=null;i&&(u=new ResizeObserver(()=>{n()}),L(t)&&!l&&u.observe(t),L(t)||!t.contextElement||l||u.observe(t.contextElement),u.observe(e));let c=l?z(t):null;return l&&function m(){const d=z(t);!c||d.x===c.x&&d.y===c.y&&d.width===c.width&&d.height===c.height||n(),c=d,s=requestAnimationFrame(m)}(),n(),()=>{var m;f.forEach(d=>{a&&d.removeEventListener("scroll",n),r&&d.removeEventListener("resize",n)}),(m=u)==null||m.disconnect(),u=null,l&&cancelAnimationFrame(s)}}const ue=(t,e,n)=>{const o=new Map,a={platform:ce,...n},r={...a.platform,_c:o};return It(t,e,{...a,platform:r})};function dt(t){var e;return(e=t==null?void 0:t.$el)!=null?e:t}function de(t){return{name:"arrow",options:t,fn(e){const n=dt(F(t.element));return n==null?{}:Ut({element:n,padding:t.padding}).fn(e)}}}function me(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,a=N(()=>{var v;return(v=F(n.open))!=null?v:!0}),r=N(()=>F(n.middleware)),i=N(()=>{var v;return(v=F(n.placement))!=null?v:"bottom"}),l=N(()=>{var v;return(v=F(n.strategy))!=null?v:"absolute"}),f=N(()=>dt(t.value)),s=N(()=>dt(e.value)),u=S(null),c=S(null),m=S(l.value),d=S(i.value),h=Wt({}),p=S(!1);let g;function y(){f.value==null||s.value==null||ue(f.value,s.value,{middleware:r.value,placement:i.value,strategy:l.value}).then(v=>{u.value=v.x,c.value=v.y,m.value=v.strategy,d.value=v.placement,h.value=v.middlewareData,p.value=!0})}function x(){typeof g=="function"&&(g(),g=void 0)}function w(){if(x(),o===void 0){y();return}if(f.value!=null&&s.value!=null){g=o(f.value,s.value,y);return}}function R(){a.value||(p.value=!1)}return rt([r,i,l],y,{flush:"sync"}),rt([f,s],w,{flush:"sync"}),rt(a,R,{flush:"sync"}),Ht()&&_t(x),{x:j(u),y:j(c),strategy:j(m),placement:j(d),middlewareData:j(h),isPositioned:j(p),update:y}}const ge={__name:"Tooltip",props:{as:{type:String,default:ht},placement:{type:String,default:"top"},tooltipClass:{type:String,default:"origin-center rounded px-3 py-1.5 text-xs font-medium text-gray-900 bg-white shadow-lg"}},setup(t){const e=t,n=S(!1),o=S(null),a=S(null),r=S(null),{x:i,y:l,strategy:f}=me(o,a,{placement:e.placement,strategy:"fixed",middleware:[re(),de({element:r}),ie(7),oe()],whileElementsMounted:fe});return(s,u)=>(at(),yt(ht,null,[(at(),zt(Xt(t.as),jt({ref_key:"reference",ref:o,onMouseenter:u[0]||(u[0]=c=>n.value=!n.value),onMouseleave:u[1]||(u[1]=c=>n.value=!n.value)},s.$attrs),{default:Nt(()=>[xt(s.$slots,"default")]),_:3},16)),n.value?(at(),yt("div",{key:0,style:Yt({position:F(f),top:`${F(l)??0}px`,left:`${F(i)??0}px`,width:"max-content"}),ref_key:"floating",ref:a,class:qt([t.tooltipClass,"tooltip",t.placement])},[Qt("div",{class:"arrow",ref_key:"arrowRef",ref:r},null,512),xt(s.$slots,"tooltip")],6)):Gt("",!0)],64))}};export{ge as default};