v-float 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +249 -109
- package/dist/composables/interactions/index.d.ts +2 -1
- package/dist/composables/interactions/index.d.ts.map +1 -1
- package/dist/composables/interactions/polygon.d.ts +38 -0
- package/dist/composables/interactions/polygon.d.ts.map +1 -0
- package/dist/composables/interactions/use-click.d.ts +78 -10
- package/dist/composables/interactions/use-click.d.ts.map +1 -1
- package/dist/composables/interactions/use-client-point.d.ts +1 -1
- package/dist/composables/interactions/use-client-point.d.ts.map +1 -1
- package/dist/composables/interactions/use-escape-key.d.ts +24 -0
- package/dist/composables/interactions/use-escape-key.d.ts.map +1 -0
- package/dist/composables/interactions/use-focus.d.ts +28 -3
- package/dist/composables/interactions/use-focus.d.ts.map +1 -1
- package/dist/composables/interactions/use-hover.d.ts +32 -18
- package/dist/composables/interactions/use-hover.d.ts.map +1 -1
- package/dist/composables/interactions/utils/browser-detection.d.ts +23 -0
- package/dist/composables/interactions/utils/browser-detection.d.ts.map +1 -0
- package/dist/composables/interactions/utils/element-detection.d.ts +53 -0
- package/dist/composables/interactions/utils/element-detection.d.ts.map +1 -0
- package/dist/composables/interactions/utils/event-utils.d.ts +30 -0
- package/dist/composables/interactions/utils/event-utils.d.ts.map +1 -0
- package/dist/composables/interactions/utils/index.d.ts +11 -0
- package/dist/composables/interactions/utils/index.d.ts.map +1 -0
- package/dist/composables/interactions/utils/tree-context.d.ts +32 -0
- package/dist/composables/interactions/utils/tree-context.d.ts.map +1 -0
- package/dist/composables/middlewares/index.d.ts +0 -1
- package/dist/composables/middlewares/index.d.ts.map +1 -1
- package/dist/composables/use-arrow.d.ts +10 -3
- package/dist/composables/use-arrow.d.ts.map +1 -1
- package/dist/composables/use-floating-tree.d.ts +13 -13
- package/dist/composables/use-floating-tree.d.ts.map +1 -1
- package/dist/composables/use-floating.d.ts +12 -20
- package/dist/composables/use-floating.d.ts.map +1 -1
- package/dist/composables/use-tree.d.ts.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/v-float.es.js +1457 -1061
- package/dist/v-float.umd.js +1 -1
- package/package.json +34 -21
- package/dist/composables/interactions/use-dismiss.d.ts +0 -68
- package/dist/composables/interactions/use-dismiss.d.ts.map +0 -1
package/dist/v-float.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(E,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(E=typeof globalThis<"u"?globalThis:E||self,a(E.VFloat={},E.Vue))})(this,function(E,a){"use strict";var Ln=Object.defineProperty;var ut=E=>{throw TypeError(E)};var Pn=(E,a,O)=>a in E?Ln(E,a,{enumerable:!0,configurable:!0,writable:!0,value:O}):E[a]=O;var Z=(E,a,O)=>Pn(E,typeof a!="symbol"?a+"":a,O),De=(E,a,O)=>a.has(E)||ut("Cannot "+O);var Se=(E,a,O)=>(De(E,a,"read from private field"),O?O.call(E):a.get(E)),ge=(E,a,O)=>a.has(E)?ut("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(E):a.set(E,O),Ve=(E,a,O,$)=>(De(E,a,"write to private field"),$?$.call(E,O):a.set(E,O),O),Ne=(E,a,O)=>(De(E,a,"access private method"),O);var se,le,ce,ke;const O=["top","right","bottom","left"],$=Math.min,q=Math.max,ae=Math.round,ue=Math.floor,k=e=>({x:e,y:e}),ft={left:"right",right:"left",bottom:"top",top:"bottom"},dt={start:"end",end:"start"};function we(e,t,n){return q(e,$(t,n))}function z(e,t){return typeof e=="function"?e(t):e}function G(e){return e.split("-")[0]}function ie(e){return e.split("-")[1]}function Fe(e){return e==="x"?"y":"x"}function ye(e){return e==="y"?"height":"width"}function ee(e){return["top","bottom"].includes(G(e))?"y":"x"}function xe(e){return Fe(ee(e))}function ht(e,t,n){n===void 0&&(n=!1);const o=ie(e),i=xe(e),s=ye(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=fe(r)),[r,fe(r)]}function pt(e){const t=fe(e);return[be(e),t,be(t)]}function be(e){return e.replace(/start|end/g,t=>dt[t])}function mt(e,t,n){const o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?s:r;default:return[]}}function vt(e,t,n,o){const i=ie(e);let s=mt(G(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(be)))),s}function fe(e){return e.replace(/left|right|bottom|top/g,t=>ft[t])}function gt(e){return{top:0,right:0,bottom:0,left:0,...e}}function He(e){return typeof e!="number"?gt(e):{top:e,right:e,bottom:e,left:e}}function de(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Be(e,t,n){let{reference:o,floating:i}=e;const s=ee(t),r=xe(t),l=ye(r),u=G(t),c=s==="y",d=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,g=o[l]/2-i[l]/2;let p;switch(u){case"top":p={x:d,y:o.y-i.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-i.width,y:f};break;default:p={x:o.x,y:o.y}}switch(ie(t)){case"start":p[r]-=g*(n&&c?-1:1);break;case"end":p[r]+=g*(n&&c?-1:1);break}return p}const wt=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),u=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:f}=Be(c,o,u),g=o,p={},v=0;for(let h=0;h<l.length;h++){const{name:m,fn:y}=l[h],{x:L,y:b,data:w,reset:T}=await y({x:d,y:f,initialPlacement:o,placement:g,strategy:i,middlewareData:p,rects:c,platform:r,elements:{reference:e,floating:t}});d=L??d,f=b??f,p={...p,[m]:{...p[m],...w}},T&&v<=50&&(v++,typeof T=="object"&&(T.placement&&(g=T.placement),T.rects&&(c=T.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):T.rects),{x:d,y:f}=Be(c,g,u)),h=-1)}return{x:d,y:f,placement:g,strategy:i,middlewareData:p}};async function he(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=z(t,e),v=He(p),m=l[g?f==="floating"?"reference":"floating":f],y=de(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(m)))==null||n?m:m.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:u})),L=f==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(b))?await(s.getScale==null?void 0:s.getScale(b))||{x:1,y:1}:{x:1,y:1},T=de(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:L,offsetParent:b,strategy:u}):L);return{top:(y.top-T.top+v.top)/w.y,bottom:(T.bottom-y.bottom+v.bottom)/w.y,left:(y.left-T.left+v.left)/w.x,right:(T.right-y.right+v.right)/w.x}}const yt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:l,middlewareData:u}=t,{element:c,padding:d=0}=z(e,t)||{};if(c==null)return{};const f=He(d),g={x:n,y:o},p=xe(i),v=ye(p),h=await r.getDimensions(c),m=p==="y",y=m?"top":"left",L=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=s.reference[v]+s.reference[p]-g[p]-s.floating[v],T=g[p]-s.reference[p],C=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let P=C?C[b]:0;(!P||!await(r.isElement==null?void 0:r.isElement(C)))&&(P=l.floating[b]||s.floating[v]);const X=w/2-T/2,B=P/2-h[v]/2-1,N=$(f[y],B),j=$(f[L],B),x=N,M=P-h[v]-j,R=P/2-h[v]/2+X,_=we(x,R,M),I=!u.arrow&&ie(i)!=null&&R!==_&&s.reference[v]/2-(R<x?N:j)-h[v]/2<0,W=I?R<x?R-x:R-M:0;return{[p]:g[p]+W,data:{[p]:_,centerOffset:R-_-W,...I&&{alignmentOffset:W}},reset:I}}}),xt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:l,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...m}=z(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=G(i),L=ee(l),b=G(l)===l,w=await(u.isRTL==null?void 0:u.isRTL(c.floating)),T=g||(b||!h?[fe(l)]:pt(l)),C=v!=="none";!g&&C&&T.push(...vt(l,h,v,w));const P=[l,...T],X=await he(t,m),B=[];let N=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&B.push(X[y]),f){const R=ht(i,r,w);B.push(X[R[0]],X[R[1]])}if(N=[...N,{placement:i,overflows:B}],!B.every(R=>R<=0)){var j,x;const R=(((j=s.flip)==null?void 0:j.index)||0)+1,_=P[R];if(_)return{data:{index:R,overflows:N},reset:{placement:_}};let I=(x=N.filter(W=>W.overflows[0]<=0).sort((W,K)=>W.overflows[1]-K.overflows[1])[0])==null?void 0:x.placement;if(!I)switch(p){case"bestFit":{var M;const W=(M=N.filter(K=>{if(C){const U=ee(K.placement);return U===L||U==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(U=>U>0).reduce((U,Tn)=>U+Tn,0)]).sort((K,U)=>K[1]-U[1])[0])==null?void 0:M[0];W&&(I=W);break}case"initialPlacement":I=l;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function We(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $e(e){return O.some(t=>e[t]>=0)}const bt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=z(e,t);switch(o){case"referenceHidden":{const s=await he(t,{...i,elementContext:"reference"}),r=We(s,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:$e(r)}}}case"escaped":{const s=await he(t,{...i,altBoundary:!0}),r=We(s,n.floating);return{data:{escapedOffsets:r,escaped:$e(r)}}}default:return{}}}}};async function Et(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=G(n),l=ie(n),u=ee(n)==="y",c=["left","top"].includes(r)?-1:1,d=s&&u?-1:1,f=z(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(p=l==="end"?v*-1:v),u?{x:p*d,y:g*c}:{x:g*c,y:p*d}}const Tt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:l}=t,u=await Et(t,e);return r===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:s+u.y,data:{...u,placement:r}}}}},Lt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:m=>{let{x:y,y:L}=m;return{x:y,y:L}}},...u}=z(e,t),c={x:n,y:o},d=await he(t,u),f=ee(G(i)),g=Fe(f);let p=c[g],v=c[f];if(s){const m=g==="y"?"top":"left",y=g==="y"?"bottom":"right",L=p+d[m],b=p-d[y];p=we(L,p,b)}if(r){const m=f==="y"?"top":"left",y=f==="y"?"bottom":"right",L=v+d[m],b=v-d[y];v=we(L,v,b)}const h=l.fn({...t,[g]:p,[f]:v});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[g]:s,[f]:r}}}}}};function pe(){return typeof window<"u"}function te(e){return Ie(e)?(e.nodeName||"").toLowerCase():"#document"}function A(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function F(e){var t;return(t=(Ie(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ie(e){return pe()?e instanceof Node||e instanceof A(e).Node:!1}function D(e){return pe()?e instanceof Element||e instanceof A(e).Element:!1}function H(e){return pe()?e instanceof HTMLElement||e instanceof A(e).HTMLElement:!1}function Ye(e){return!pe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof A(e).ShadowRoot}function re(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=S(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Pt(e){return["table","td","th"].includes(te(e))}function me(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Ee(e){const t=Te(),n=D(e)?S(e):e;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Ct(e){let t=Y(e);for(;H(t)&&!ne(t);){if(Ee(t))return t;if(me(t))return null;t=Y(t)}return null}function Te(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ne(e){return["html","body","#document"].includes(te(e))}function S(e){return A(e).getComputedStyle(e)}function ve(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(te(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ye(e)&&e.host||F(e);return Ye(t)?t.host:t}function Xe(e){const t=Y(e);return ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:H(t)&&re(t)?t:Xe(t)}function J(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Xe(e),s=i===((o=e.ownerDocument)==null?void 0:o.body),r=A(i);if(s){const l=Le(r);return t.concat(r,r.visualViewport||[],re(i)?i:[],l&&n?J(l):[])}return t.concat(i,J(i,[],n))}function Le(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function je(e){const t=S(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=H(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,l=ae(n)!==s||ae(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function Pe(e){return D(e)?e:e.contextElement}function oe(e){const t=Pe(e);if(!H(t))return k(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=je(t);let r=(s?ae(n.width):n.width)/o,l=(s?ae(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Ot=k(0);function _e(e){const t=A(e);return!Te()||!t.visualViewport?Ot:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==A(e)?!1:t}function Q(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Pe(e);let r=k(1);t&&(o?D(o)&&(r=oe(o)):r=oe(e));const l=Rt(s,n,o)?_e(s):k(0);let u=(i.left+l.x)/r.x,c=(i.top+l.y)/r.y,d=i.width/r.x,f=i.height/r.y;if(s){const g=A(s),p=o&&D(o)?A(o):o;let v=g,h=Le(v);for(;h&&o&&p!==v;){const m=oe(h),y=h.getBoundingClientRect(),L=S(h),b=y.left+(h.clientLeft+parseFloat(L.paddingLeft))*m.x,w=y.top+(h.clientTop+parseFloat(L.paddingTop))*m.y;u*=m.x,c*=m.y,d*=m.x,f*=m.y,u+=b,c+=w,v=A(h),h=Le(v)}}return de({width:d,height:f,x:u,y:c})}function Ce(e,t){const n=ve(e).scrollLeft;return t?t.left+n:Q(F(e)).left+n}function Ke(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:Ce(e,o)),s=o.top+t.scrollTop;return{x:i,y:s}}function Mt(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=F(o),l=t?me(t.floating):!1;if(o===r||l&&s)return n;let u={scrollLeft:0,scrollTop:0},c=k(1);const d=k(0),f=H(o);if((f||!f&&!s)&&((te(o)!=="body"||re(r))&&(u=ve(o)),H(o))){const p=Q(o);c=oe(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const g=r&&!f&&!s?Ke(r,u,!0):k(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+d.x+g.x,y:n.y*c.y-u.scrollTop*c.y+d.y+g.y}}function At(e){return Array.from(e.getClientRects())}function Dt(e){const t=F(e),n=ve(e),o=e.ownerDocument.body,i=q(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=q(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ce(e);const l=-n.scrollTop;return S(o).direction==="rtl"&&(r+=q(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:l}}function St(e,t){const n=A(e),o=F(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,u=0;if(i){s=i.width,r=i.height;const c=Te();(!c||c&&t==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:r,x:l,y:u}}function Vt(e,t){const n=Q(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=H(e)?oe(e):k(1),r=e.clientWidth*s.x,l=e.clientHeight*s.y,u=i*s.x,c=o*s.y;return{width:r,height:l,x:u,y:c}}function Ue(e,t,n){let o;if(t==="viewport")o=St(e,n);else if(t==="document")o=Dt(F(e));else if(D(t))o=Vt(t,n);else{const i=_e(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return de(o)}function qe(e,t){const n=Y(e);return n===t||!D(n)||ne(n)?!1:S(n).position==="fixed"||qe(n,t)}function Nt(e,t){const n=t.get(e);if(n)return n;let o=J(e,[],!1).filter(l=>D(l)&&te(l)!=="body"),i=null;const s=S(e).position==="fixed";let r=s?Y(e):e;for(;D(r)&&!ne(r);){const l=S(r),u=Ee(r);!u&&l.position==="fixed"&&(i=null),(s?!u&&!i:!u&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||re(r)&&!u&&qe(e,r))?o=o.filter(d=>d!==r):i=l,r=Y(r)}return t.set(e,o),o}function kt(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?me(t)?[]:Nt(t,this._c):[].concat(n),o],l=r[0],u=r.reduce((c,d)=>{const f=Ue(t,d,i);return c.top=q(f.top,c.top),c.right=$(f.right,c.right),c.bottom=$(f.bottom,c.bottom),c.left=q(f.left,c.left),c},Ue(t,l,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ft(e){const{width:t,height:n}=je(e);return{width:t,height:n}}function Ht(e,t,n){const o=H(t),i=F(t),s=n==="fixed",r=Q(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const u=k(0);if(o||!o&&!s)if((te(t)!=="body"||re(i))&&(l=ve(t)),o){const g=Q(t,!0,s,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}else i&&(u.x=Ce(i));const c=i&&!o&&!s?Ke(i,l):k(0),d=r.left+l.scrollLeft-u.x-c.x,f=r.top+l.scrollTop-u.y-c.y;return{x:d,y:f,width:r.width,height:r.height}}function Oe(e){return S(e).position==="static"}function Ge(e,t){if(!H(e)||S(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return F(e)===n&&(n=n.ownerDocument.body),n}function Je(e,t){const n=A(e);if(me(e))return n;if(!H(e)){let i=Y(e);for(;i&&!ne(i);){if(D(i)&&!Oe(i))return i;i=Y(i)}return n}let o=Ge(e,t);for(;o&&Pt(o)&&Oe(o);)o=Ge(o,t);return o&&ne(o)&&Oe(o)&&!Ee(o)?n:o||Ct(e)||n}const Bt=async function(e){const t=this.getOffsetParent||Je,n=this.getDimensions,o=await n(e.floating);return{reference:Ht(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Wt(e){return S(e).direction==="rtl"}const $t={convertOffsetParentRelativeRectToViewportRelativeRect:Mt,getDocumentElement:F,getClippingRect:kt,getOffsetParent:Je,getElementRects:Bt,getClientRects:At,getDimensions:Ft,getScale:oe,isElement:D,isRTL:Wt};function Qe(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function It(e,t){let n=null,o;const i=F(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function r(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),s();const c=e.getBoundingClientRect(),{left:d,top:f,width:g,height:p}=c;if(l||t(),!g||!p)return;const v=ue(f),h=ue(i.clientWidth-(d+g)),m=ue(i.clientHeight-(f+p)),y=ue(d),b={rootMargin:-v+"px "+-h+"px "+-m+"px "+-y+"px",threshold:q(0,$(1,u))||1};let w=!0;function T(C){const P=C[0].intersectionRatio;if(P!==u){if(!w)return r();P?r(!1,P):o=setTimeout(()=>{r(!1,1e-7)},1e3)}P===1&&!Qe(c,e.getBoundingClientRect())&&r(),w=!1}try{n=new IntersectionObserver(T,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,b)}n.observe(e)}return r(!0),s}function Ze(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,c=Pe(e),d=i||s?[...c?J(c):[],...J(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=c&&l?It(c,n):null;let g=-1,p=null;r&&(p=new ResizeObserver(y=>{let[L]=y;L&&L.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var b;(b=p)==null||b.observe(t)})),n()}),c&&!u&&p.observe(c),p.observe(t));let v,h=u?Q(e):null;u&&m();function m(){const y=Q(e);h&&!Qe(h,y)&&n(),h=y,v=requestAnimationFrame(m)}return n(),()=>{var y;d.forEach(L=>{i&&L.removeEventListener("scroll",n),s&&L.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,u&&cancelAnimationFrame(v)}}const Yt=Tt,Xt=Lt,jt=xt,_t=bt,Kt=yt,Ut=(e,t,n)=>{const o=new Map,i={platform:$t,...n},s={...i.platform,_c:o};return wt(e,t,{...i,platform:s})};function qt(e,t,n={}){const{transform:o=!0,middlewares:i,whileElementsMounted:s,open:r=a.ref(!1),setOpen:l=b=>{r.value=b}}=n,u=a.computed(()=>a.toValue(n.placement)??"bottom"),c=a.computed(()=>a.toValue(n.strategy)??"absolute"),d=a.ref(0),f=a.ref(0),g=a.ref(u.value),p=a.ref(c.value),v=a.shallowRef({}),h=a.ref(!1),m=async()=>{if(!e.value||!t.value)return;const b=await Ut(e.value,t.value,{placement:u.value,strategy:c.value,middleware:i});d.value=b.x,f.value=b.y,g.value=b.placement,p.value=b.strategy,v.value=b.middlewareData,h.value=r.value};a.watch([u,c],()=>{r.value&&m()});let y;a.watch([e,t,r],([b,w,T])=>{!T||!b||!w||(s?y=s(b,w,m):y=Ze(b,w,m),a.onWatcherCleanup(()=>{y==null||y(),y=void 0}))},{immediate:!0}),a.onScopeDispose(()=>y==null?void 0:y()),a.watch(r,b=>{b||(h.value=!1)});const L=a.computed(()=>{const b={position:p.value,left:"0",top:"0"};if(!h.value||!t.value)return b;const w=ze(t.value,d.value),T=ze(t.value,f.value);return a.toValue(o)?{...b,transform:`translate(${w}px, ${T}px)`,...et(t.value)>=1.5&&{willChange:"transform"}}:{...b,left:`${w}px`,top:`${T}px`}});return{x:d,y:f,strategy:p,placement:g,middlewareData:v,isPositioned:h,floatingStyles:L,update:m,refs:{anchorEl:e,floatingEl:t},open:r,setOpen:l}}function ze(e,t){const n=et(e);return Math.round(t*n)/n}function et(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gt(e,t,n,o={}){return Ze(e,t,n,o)}function Jt(e,t={}){const{middlewareData:n,placement:o}=e,{offset:i="-4px"}=t,s=a.computed(()=>{var u;return((u=n.value.arrow)==null?void 0:u.x)??0}),r=a.computed(()=>{var u;return((u=n.value.arrow)==null?void 0:u.y)??0}),l=a.computed(()=>{const u=a.toValue(o).split("-")[0],c=s.value,d=r.value;return u==="bottom"?{"inset-inline-start":`${c}px`,"inset-block-start":i}:u==="top"?{"inset-inline-start":`${c}px`,"inset-block-end":i}:u==="right"?{"inset-block-start":`${d}px`,"inset-inline-start":i}:u==="left"?{"inset-block-start":`${d}px`,"inset-inline-end":i}:{}});return{arrowX:s,arrowY:r,arrowStyles:l}}const tt=10;function Qt(e){return e==="mouse"||e==="pen"}function Zt(e,t,n){const{delay:o}=n,i=a.computed(()=>{const c=a.toValue(o);return(typeof c=="number"?c:c.open)??0}),s=a.computed(()=>{const c=a.toValue(o);return(typeof c=="number"?c:c.close)??0});let r,l;const u=()=>{clearTimeout(r),clearTimeout(l)};return a.onScopeDispose(u),{show:c=>{u();const d=c??i.value;d===0?e():r=setTimeout(e,d)},hide:c=>{u();const d=c??s.value;d===0?t():l=setTimeout(t,d)},showDelay:i,hideDelay:s,clearTimeouts:u}}function zt(e,t={}){const{open:n,setOpen:o,refs:{anchorEl:i,floatingEl:s}}=e,{enabled:r=!0,delay:l=0,restMs:u=0,mouseOnly:c=!1}=t,d=a.computed(()=>a.toValue(r)),f=a.computed(()=>a.toValue(u)),g=a.computed(()=>{const x=i.value;return!x||x instanceof HTMLElement?x:x.contextElement??null}),{hide:p,show:v,showDelay:h,clearTimeouts:m}=Zt(()=>{n.value||o(!0)},()=>{n.value&&o(!1)},{delay:l});let y=null,L;const b=a.computed(()=>h.value===0&&f.value>0);function w(x){if(!d.value||!P(x)||!b.value||!y)return;const M={x:x.clientX,y:x.clientY},R=Math.abs(M.x-y.x),_=Math.abs(M.y-y.y);(R>tt||_>tt)&&(y=M,clearTimeout(L),L=setTimeout(()=>{v(0)},f.value))}function T(x){!d.value||!P(x)||!b.value||(y={x:x.clientX,y:x.clientY},L=setTimeout(()=>{v(0)},f.value))}function C(){clearTimeout(L),y=null}a.watchPostEffect(()=>{const x=g.value;!x||!d.value||!b.value||(x.addEventListener("pointerenter",T),x.addEventListener("pointermove",w),x.addEventListener("pointerleave",C),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",T),x.removeEventListener("pointermove",w),x.removeEventListener("pointerleave",C)}))}),a.onScopeDispose(()=>{clearTimeout(L)});function P(x){return!(a.toValue(c)&&!Qt(x.pointerType))}function X(x){!d.value||!P(x)||b.value||v()}function B(x){!d.value||!P(x)||m()}function N(x){var M;!d.value||!P(x)||(M=s.value)!=null&&M.contains(x.relatedTarget)||p()}function j(x){var M;!d.value||!P(x)||(M=g.value)!=null&&M.contains(x.relatedTarget)||p()}a.watchPostEffect(()=>{const x=g.value;!x||!d.value||(x.addEventListener("pointerenter",X),x.addEventListener("pointerleave",N),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",X),x.removeEventListener("pointerleave",N)}))}),a.watchPostEffect(()=>{const x=s.value;!x||!d.value||(x.addEventListener("pointerenter",B),x.addEventListener("pointerleave",j),a.onWatcherCleanup(()=>{x.removeEventListener("pointerenter",B),x.removeEventListener("pointerleave",j)}))})}function en(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}const tn=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const nn=Object.prototype.toString,on=e=>nn.call(e)==="[object Object]";function Re(e){return Array.isArray(e)?e:[e]}function rn(e,t,n){return a.watch(e,t,{...n,immediate:!0})}const sn=tn?window:void 0;function ln(e){var t;const n=a.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function V(...e){const t=[],n=()=>{t.forEach(l=>l()),t.length=0},o=(l,u,c,d)=>(l.addEventListener(u,c,d),()=>l.removeEventListener(u,c,d)),i=a.computed(()=>{const l=Re(a.toValue(e[0])).filter(u=>u!=null);return l.every(u=>typeof u!="string")?l:void 0}),s=rn(()=>{var l,u;return[(u=(l=i.value)==null?void 0:l.map(c=>ln(c)))!=null?u:[sn].filter(c=>c!=null),Re(a.toValue(i.value?e[1]:e[0])),Re(a.unref(i.value?e[2]:e[1])),a.toValue(i.value?e[3]:e[2])]},([l,u,c,d])=>{if(n(),!(l!=null&&l.length)||!(u!=null&&u.length)||!(c!=null&&c.length))return;const f=on(d)?{...d}:d;t.push(...l.flatMap(g=>u.flatMap(p=>c.map(v=>o(g,p,v,f)))))},{flush:"post"}),r=()=>{s(),n()};return en(n),r}function cn(e,t={}){const{open:n,setOpen:o,refs:{floatingEl:i,anchorEl:s}}=e,{enabled:r=!0,requireFocusVisible:l=!0}=t,u=a.computed(()=>s.value?s.value instanceof HTMLElement?s.value:s.value.contextElement:null);let c=!1,d=!0,f;V(window,"blur",()=>{!n.value&&u.value&&u.value===document.activeElement&&(c=!0)}),V(window,"focus",()=>{c=!1}),a.onMounted(()=>{nt()&&ot()&&(V(window,"keydown",()=>{d=!0},{capture:!0}),V(window,"pointerdown",()=>{d=!1},{capture:!0}))});function g(v){if(c){c=!1;return}const h=v.target;if(a.toValue(l)&&h){if(nt()&&ot()&&!v.relatedTarget){if(!d&&!an(h))return}else if(!un(h))return}o(!0)}function p(v){clearTimeout(f),f=window.setTimeout(()=>{var y;const m=(((y=u.value)==null?void 0:y.ownerDocument)??document).activeElement;!v.relatedTarget&&m===u.value||i.value&&m&&i.value.contains(m)||o(!1)},0)}a.watchPostEffect(()=>{if(!a.toValue(r))return;const v=u.value;!v||!(v instanceof HTMLElement)||(v.addEventListener("focus",g),v.addEventListener("blur",p),a.onWatcherCleanup(()=>{v.removeEventListener("focus",g),v.removeEventListener("blur",p)}))}),a.onScopeDispose(()=>{clearTimeout(f)})}function nt(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function ot(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function an(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}function un(e){return e.matches(":focus-visible")}function fn(e,t={}){const{open:n,setOpen:o,refs:i}=e,{enabled:s=!0,event:r="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0}=t;let d,f=!1;const g=a.computed(()=>a.toValue(s)),p=a.computed(()=>i.anchorEl.value instanceof HTMLElement?i.anchorEl.value:null);function v(){n.value?a.toValue(l)&&o(!1):o(!0)}function h(w){d=w.pointerType}function m(w){if(w.button!==0||a.toValue(r)==="click"||it(d)&&a.toValue(u))return;const T=w.target;!n.value&&T===p.value&&w.preventDefault(),v()}function y(){if(a.toValue(r)==="mousedown"&&d){d=void 0;return}if(it(d)&&a.toValue(u)){d=void 0;return}v(),d=void 0}function L(w){if(d=void 0,w.defaultPrevented||!a.toValue(c)||rt(w))return;const T=p.value;T&&(w.key===" "&&!st(T)&&(w.preventDefault(),f=!0),w.key==="Enter"&&v())}function b(w){const T=p.value;T&&(w.defaultPrevented||!a.toValue(c)||rt(w)||st(T)||w.key===" "&&f&&(f=!1,v()))}a.watchPostEffect(()=>{const w=p.value;!g.value||!w||(w.addEventListener("pointerdown",h),w.addEventListener("mousedown",m),w.addEventListener("click",y),w.addEventListener("keydown",L),w.addEventListener("keyup",b),a.onWatcherCleanup(()=>{w.removeEventListener("pointerdown",h),w.removeEventListener("mousedown",m),w.removeEventListener("click",y),w.removeEventListener("keydown",L),w.removeEventListener("keyup",b)}))})}function it(e,t){return e===void 0?!1:e==="mouse"}function rt(e){return e.target instanceof HTMLElement&&e.target.tagName==="BUTTON"}function dn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function st(e){return dn(e)}function hn(e,t={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:i=!0,outsidePressEvent:s="pointerdown",anchorPress:r=!1,anchorPressEvent:l="pointerdown",ancestorScroll:u=!1,capture:c}=t,d=a.computed(()=>a.toValue(n)),f=e.refs.floatingEl,g=a.computed(()=>{const w=e.refs.anchorEl.value;return w?w instanceof HTMLElement?w:w.contextElement instanceof HTMLElement?w.contextElement:null:null}),{isComposing:p}=vn(),{escapeKey:v,outsidePress:h}=pn(c);let m=!1;const y=w=>{!d.value||!e.open.value||!a.toValue(o)||w.key!=="Escape"||p()||e.setOpen(!1)},L=w=>{if(!d.value||!e.open.value)return;if(s==="click"&&m){m=!1;return}const T=a.toValue(i);if(!T||typeof T=="function"&&!T(w))return;const C=w.target;C&&(Me(C)&&f.value&&mn(w,C)||lt(w,g.value)||lt(w,f.value)||e.setOpen(!1))},b=()=>{d.value&&e.open.value&&a.toValue(r)&&e.setOpen(!1)};a.watchEffect(w=>{if(!d.value||!e.open.value||!a.toValue(u))return;const T=()=>{e.open.value&&e.setOpen(!1)},C=[];g.value&&C.push(...J(g.value).filter(Me)),f.value&&C.push(...J(f.value).filter(Me));for(const P of C)P.addEventListener("scroll",T,{passive:!0});w(()=>{for(const P of C)P.removeEventListener("scroll",T)})}),V(document,"keydown",y,a.toValue(v)),V(document,s,L,a.toValue(h)),V(g,l,b),V(f,"mousedown",()=>{m=!0},{capture:!0}),V(f,"mouseup",()=>{m=!0},{capture:!0})}function pn(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function Me(e){return e instanceof Element&&e instanceof HTMLElement}function lt(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function mn(e,t){const n=t.offsetWidth-t.clientWidth,o=t.offsetHeight-t.clientHeight;return n>0&&e.clientX>t.clientWidth||o>0&&e.clientY>t.clientHeight}function vn(){const e=a.ref(!1);return V(document,"compositionstart",()=>{e.value=!0}),V(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function gn(e,t,n={}){const{open:o,refs:i}=t;let s;const r=a.ref({x:null,y:null}),l=a.computed(()=>a.toValue(n.axis??"both")),u=a.computed(()=>a.toValue(n.enabled??!0)),c=a.computed(()=>a.toValue(n.x??null)),d=a.computed(()=>a.toValue(n.y??null)),f=(h,m)=>{r.value={x:h,y:m},o.value&&(i.anchorEl.value=wn(e.value,l.value,r.value))};a.watchEffect(()=>{const h=c.value,m=d.value;u.value&&h!=null&&m!=null&&f(h,m)});const g=h=>{s=h.pointerType,f(h.clientX,h.clientY)},p=h=>{s=h.pointerType,!o.value&&ct(s,!0)&&f(h.clientX,h.clientY)},v=h=>{o.value&&ct(s,!0)&&f(h.clientX,h.clientY)};return a.watchEffect(()=>{if(c.value!=null||d.value!=null)return;const h=e.value;!h||!u.value||(h.addEventListener("pointerenter",p),h.addEventListener("pointerdown",g),h.addEventListener("pointermove",v),a.onWatcherCleanup(()=>{h==null||h.removeEventListener("pointerenter",p),h==null||h.removeEventListener("pointerdown",g),h==null||h.removeEventListener("pointermove",v)}))}),{coordinates:a.readonly(r),updatePosition:f}}function wn(e,t,n){let o=null,i=null;const s=e;return{contextElement:s||void 0,getBoundingClientRect:()=>{const r=(s==null?void 0:s.getBoundingClientRect())??{width:0,height:0,x:0,y:0},l=t==="x"||t==="both",u=t==="y"||t==="both";let c=0,d=0,f=r.x,g=r.y;return s&&(o==null&&n.x!=null&&l&&(o=r.x-n.x),i==null&&n.y!=null&&u&&(i=r.y-n.y),f-=o||0,g-=i||0),l&&n.x!=null?f=n.x:(o=null,c=r.width),u&&n.y!=null?g=n.y:(i=null,d=r.height),t==="both"&&(c=0,d=0),{width:c,height:d,x:f,y:g,top:g,right:f+c,bottom:g+d,left:f}}}}function ct(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function yn(e){return{name:"arrow",options:e,fn(t){const n=a.toValue(e.element);return n==null?{}:Kt({element:n,padding:e.padding}).fn(t)}}}let xn=0;function bn(){return`vfloat-id-${xn++}`}class Ae{constructor(t,n=null,o={},i=!1){Z(this,"id");Z(this,"data");Z(this,"parent");Z(this,"children");ge(this,se);this.id=o.id??bn(),this.data=t,this.parent=a.shallowRef(n),this.children=a.shallowRef([]),Ve(this,se,i)}addChild(t){this.children.value=[...this.children.value,t]}_removeChildInstance(t){return this.children.value.includes(t)?(this.children.value=this.children.value.filter(n=>n.id!==t.id),t.parent.value=null,!0):!1}findChild(t){return this.children.value.find(t)??null}findDescendant(t){const n=[this];for(;n.length>0;){const o=n.pop();if(t(o))return o;for(let i=o.children.value.length-1;i>=0;i--)n.push(o.children.value[i])}return null}isDescendantOf(t){let n=this.parent.value;for(;n;){if(n.id===t.id)return!0;n=n.parent.value}return!1}getPath(){const t=[];let n=this;for(;n;)t.push(n),n=n.parent.value;return t.reverse()}get isRoot(){return Se(this,se)}get isLeaf(){return this.children.value.length===0}}se=new WeakMap;class at{constructor(t,n){ge(this,ce);Z(this,"root");Z(this,"nodeMap");ge(this,le);Ve(this,le,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=a.shallowReactive(new Map),this.root=new Ae(t,null,{},!0),this.nodeMap.set(this.root.id,this.root)}findNodeById(t){return this.nodeMap.get(t)??null}addNode(t,n=null,o={}){const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree addNode: Parent node with ID ${n} not found.`),null;o.id&&this.nodeMap.has(o.id)&&(o.id=void 0);const s=new Ae(t,i,o);return this.nodeMap.set(s.id,s),i.addChild(s),s}removeNode(t,n){const o=n??Se(this,le),i=this.findNodeById(t);if(!i)return!1;if(i.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const s=i.parent.value;if(o==="recursive")Ne(this,ce,ke).call(this,i);else{for(const r of i.children.value)r.parent.value=null;i.children.value=[],this.nodeMap.delete(i.id)}return s._removeChildInstance(i)}moveNode(t,n){const o=this.findNodeById(t);if(!o)return console.error(`Tree moveNode: Node with ID ${t} not found.`),!1;if(o.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(t===n)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree moveNode: New parent node with ID ${n} not found.`),!1;if(i.isDescendantOf(o))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const s=o.parent.value;if(s){if(!s._removeChildInstance(o))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(o.isRoot){if(o.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return i.addChild(o),o.parent.value=i,!0}traverse(t="dfs",n=this.root){const o=[];if(!n)return console.warn("Tree traverse: Start node is null, returning empty array."),o;if(t==="dfs"){const i=[n];for(;i.length>0;){const s=i.pop();o.push(s);for(let r=s.children.value.length-1;r>=0;r--)i.push(s.children.value[r])}}else{const i=[n];for(;i.length>0;){const s=i.shift();o.push(s);for(const r of s.children.value)i.push(r)}}return o}dispose(){this.nodeMap.clear()}}le=new WeakMap,ce=new WeakSet,ke=function(t){const n=[...t.children.value];for(const o of n)Ne(this,ce,ke).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function En(e,t={}){const n=new at(e,t);return{get nodeMap(){return n.nodeMap},get root(){return n.root},findNodeById:r=>n.findNodeById(r),moveNode:(r,l)=>n.moveNode(r,l),dispose:()=>n.dispose(),addNode:(r,l)=>n.addNode(r,l),removeNode:(r,l)=>n.removeNode(r,l),traverse:(r,l)=>n.traverse(r,l),isTopmost:r=>{const l=n.findNodeById(r);if(!l||!l.data.open.value)return!1;let u=l.parent.value;for(;u;){if(u.data.open.value)return!1;u=u.parent.value}return!0},getAllOpenNodes:()=>{const r=[];for(const l of n.nodeMap.values())l.data.open.value&&r.push(l);return r},forEach:(r,l,u={})=>{const{relationship:c="self-and-children",applyToMatching:d=!0}=u,f=n.findNodeById(r);if(!f)return;const g=[],p=new Set,v=m=>{m&&!p.has(m.id)&&(g.push(m),p.add(m.id))},h=m=>{for(const y of m)v(y)};if(c==="ancestors-only")for(const m of f.getPath())m.id!==f.id&&v(m);else if(c==="siblings-only"){if(f.parent.value)for(const m of f.parent.value.children.value)m.id!==f.id&&v(m)}else if(c==="descendants-only")for(const m of n.traverse("dfs",f))m.id!==f.id&&v(m);else if(c==="children-only")h(f.children.value);else if(c==="self-and-ancestors")h(f.getPath());else if(c==="self-and-children")v(f),h(f.children.value);else if(c==="self-and-descendants")h(n.traverse("dfs",f));else if(c==="self-and-siblings")v(f),f.parent.value&&h(f.parent.value.children.value);else if(c==="self-ancestors-and-children")h(f.getPath()),h(f.children.value);else if(c==="full-branch")h(f.getPath()),h(n.traverse("dfs",f));else if(c==="all-except-branch"){const m=new Set;for(const y of f.getPath())m.add(y.id);for(const y of n.traverse("dfs",f))m.add(y.id);for(const y of n.nodeMap.values())!m.has(y.id)===d&&l(y);return}else{console.warn(`forEach: Unknown relationship "${c}".`);return}if(d)for(const m of g)l(m);else for(const m of n.nodeMap.values())p.has(m.id)||l(m)}}}E.Tree=at,E.TreeNode=Ae,E.arrow=yn,E.autoUpdate=Gt,E.flip=jt,E.hide=_t,E.offset=Yt,E.shift=Xt,E.useArrow=Jt,E.useClick=fn,E.useClientPoint=gn,E.useDismiss=hn,E.useFloating=qt,E.useFloatingTree=En,E.useFocus=cn,E.useHover=zt,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(T,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(T=typeof globalThis<"u"?globalThis:T||self,c(T.VFloat={},T.Vue))})(this,(function(T,c){"use strict";var xo=Object.defineProperty;var Qt=T=>{throw TypeError(T)};var To=(T,c,$)=>c in T?xo(T,c,{enumerable:!0,configurable:!0,writable:!0,value:$}):T[c]=$;var he=(T,c,$)=>To(T,typeof c!="symbol"?c+"":c,$),lt=(T,c,$)=>c.has(T)||Qt("Cannot "+$);var at=(T,c,$)=>(lt(T,c,"read from private field"),$?$.call(T):c.get(T)),We=(T,c,$)=>c.has(T)?Qt("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(T):c.set(T,$),ct=(T,c,$,Z)=>(lt(T,c,"write to private field"),Z?Z.call(T,$):c.set(T,$),$),ut=(T,c,$)=>(lt(T,c,"access private method"),$);var xe,Te,Ce,ft;const $=["top","right","bottom","left"],Z=Math.min,re=Math.max,Le=Math.round,Oe=Math.floor,K=e=>({x:e,y:e}),Zt={left:"right",right:"left",bottom:"top",top:"bottom"},en={start:"end",end:"start"};function $e(e,t,n){return re(e,Z(t,n))}function me(e,t){return typeof e=="function"?e(t):e}function se(e){return e.split("-")[0]}function ye(e){return e.split("-")[1]}function dt(e){return e==="x"?"y":"x"}function Xe(e){return e==="y"?"height":"width"}const tn=new Set(["top","bottom"]);function ne(e){return tn.has(se(e))?"y":"x"}function Ye(e){return dt(ne(e))}function nn(e,t,n){n===void 0&&(n=!1);const o=ye(e),i=Ye(e),r=Xe(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=Se(l)),[l,Se(l)]}function on(e){const t=Se(e);return[je(e),t,je(t)]}function je(e){return e.replace(/start|end/g,t=>en[t])}const ht=["left","right"],mt=["right","left"],rn=["top","bottom"],sn=["bottom","top"];function ln(e,t,n){switch(e){case"top":case"bottom":return n?t?mt:ht:t?ht:mt;case"left":case"right":return t?rn:sn;default:return[]}}function an(e,t,n,o){const i=ye(e);let r=ln(se(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(je)))),r}function Se(e){return e.replace(/left|right|bottom|top/g,t=>Zt[t])}function cn(e){return{top:0,right:0,bottom:0,left:0,...e}}function pt(e){return typeof e!="number"?cn(e):{top:e,right:e,bottom:e,left:e}}function Me(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function gt(e,t,n){let{reference:o,floating:i}=e;const r=ne(t),l=Ye(t),a=Xe(l),f=se(t),u=r==="y",m=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,g=o[a]/2-i[a]/2;let h;switch(f){case"top":h={x:m,y:o.y-i.height};break;case"bottom":h={x:m,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-i.width,y:d};break;default:h={x:o.x,y:o.y}}switch(ye(t)){case"start":h[l]-=g*(n&&u?-1:1);break;case"end":h[l]+=g*(n&&u?-1:1);break}return h}const un=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,a=r.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:d}=gt(u,o,f),g=o,h={},w=0;for(let p=0;p<a.length;p++){const{name:E,fn:y}=a[p],{x:b,y:L,data:S,reset:C}=await y({x:m,y:d,initialPlacement:o,placement:g,strategy:i,middlewareData:h,rects:u,platform:l,elements:{reference:e,floating:t}});m=b??m,d=L??d,h={...h,[E]:{...h[E],...S}},C&&w<=50&&(w++,typeof C=="object"&&(C.placement&&(g=C.placement),C.rects&&(u=C.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:m,y:d}=gt(u,g,f)),p=-1)}return{x:m,y:d,placement:g,strategy:i,middlewareData:h}};async function Ae(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:a,strategy:f}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:d="floating",altBoundary:g=!1,padding:h=0}=me(t,e),w=pt(h),E=a[g?d==="floating"?"reference":"floating":d],y=Me(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(E)))==null||n?E:E.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:u,rootBoundary:m,strategy:f})),b=d==="floating"?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),S=await(r.isElement==null?void 0:r.isElement(L))?await(r.getScale==null?void 0:r.getScale(L))||{x:1,y:1}:{x:1,y:1},C=Me(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:L,strategy:f}):b);return{top:(y.top-C.top+w.top)/S.y,bottom:(C.bottom-y.bottom+w.bottom)/S.y,left:(y.left-C.left+w.left)/S.x,right:(C.right-y.right+w.right)/S.x}}const fn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:a,middlewareData:f}=t,{element:u,padding:m=0}=me(e,t)||{};if(u==null)return{};const d=pt(m),g={x:n,y:o},h=Ye(i),w=Xe(h),p=await l.getDimensions(u),E=h==="y",y=E?"top":"left",b=E?"bottom":"right",L=E?"clientHeight":"clientWidth",S=r.reference[w]+r.reference[h]-g[h]-r.floating[w],C=g[h]-r.reference[h],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let N=P?P[L]:0;(!N||!await(l.isElement==null?void 0:l.isElement(P)))&&(N=a.floating[L]||r.floating[w]);const V=S/2-C/2,R=N/2-p[w]/2-1,D=Z(d[y],R),A=Z(d[b],R),k=D,W=N-p[w]-A,F=N/2-p[w]/2+V,j=$e(k,F,W),x=!f.arrow&&ye(i)!=null&&F!==j&&r.reference[w]/2-(F<k?D:A)-p[w]/2<0,s=x?F<k?F-k:F-W:0;return{[h]:g[h]+s,data:{[h]:j,centerOffset:F-j-s,...x&&{alignmentOffset:s}},reset:x}}}),dn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:a,platform:f,elements:u}=t,{mainAxis:m=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:p=!0,...E}=me(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const y=se(i),b=ne(a),L=se(a)===a,S=await(f.isRTL==null?void 0:f.isRTL(u.floating)),C=g||(L||!p?[Se(a)]:on(a)),P=w!=="none";!g&&P&&C.push(...an(a,p,w,S));const N=[a,...C],V=await Ae(t,E),R=[];let D=((o=r.flip)==null?void 0:o.overflows)||[];if(m&&R.push(V[y]),d){const F=nn(i,l,S);R.push(V[F[0]],V[F[1]])}if(D=[...D,{placement:i,overflows:R}],!R.every(F=>F<=0)){var A,k;const F=(((A=r.flip)==null?void 0:A.index)||0)+1,j=N[F];if(j&&(!(d==="alignment"?b!==ne(j):!1)||D.every(v=>ne(v.placement)===b?v.overflows[0]>0:!0)))return{data:{index:F,overflows:D},reset:{placement:j}};let x=(k=D.filter(s=>s.overflows[0]<=0).sort((s,v)=>s.overflows[1]-v.overflows[1])[0])==null?void 0:k.placement;if(!x)switch(h){case"bestFit":{var W;const s=(W=D.filter(v=>{if(P){const H=ne(v.placement);return H===b||H==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(H=>H>0).reduce((H,Y)=>H+Y,0)]).sort((v,H)=>v[1]-H[1])[0])==null?void 0:W[0];s&&(x=s);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function vt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wt(e){return $.some(t=>e[t]>=0)}const hn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=me(e,t);switch(o){case"referenceHidden":{const r=await Ae(t,{...i,elementContext:"reference"}),l=vt(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:wt(l)}}}case"escaped":{const r=await Ae(t,{...i,altBoundary:!0}),l=vt(r,n.floating);return{data:{escapedOffsets:l,escaped:wt(l)}}}default:return{}}}}},mn=new Set(["left","top"]);async function pn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=se(n),a=ye(n),f=ne(n)==="y",u=mn.has(l)?-1:1,m=r&&f?-1:1,d=me(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof w=="number"&&(h=a==="end"?w*-1:w),f?{x:h*m,y:g*u}:{x:g*u,y:h*m}}const gn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:a}=t,f=await pn(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:l}}}}},vn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:E=>{let{x:y,y:b}=E;return{x:y,y:b}}},...f}=me(e,t),u={x:n,y:o},m=await Ae(t,f),d=ne(se(i)),g=dt(d);let h=u[g],w=u[d];if(r){const E=g==="y"?"top":"left",y=g==="y"?"bottom":"right",b=h+m[E],L=h-m[y];h=$e(b,h,L)}if(l){const E=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=w+m[E],L=w-m[y];w=$e(b,w,L)}const p=a.fn({...t,[g]:h,[d]:w});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[g]:r,[d]:l}}}}}};function Ne(){return typeof window<"u"}function pe(e){return yt(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){var t;return(t=(yt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yt(e){return Ne()?e instanceof Node||e instanceof _(e).Node:!1}function z(e){return Ne()?e instanceof Element||e instanceof _(e).Element:!1}function J(e){return Ne()?e instanceof HTMLElement||e instanceof _(e).HTMLElement:!1}function bt(e){return!Ne()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _(e).ShadowRoot}const wn=new Set(["inline","contents"]);function be(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!wn.has(i)}const yn=new Set(["table","td","th"]);function bn(e){return yn.has(pe(e))}const En=[":popover-open",":modal"];function De(e){return En.some(t=>{try{return e.matches(t)}catch{return!1}})}const xn=["transform","translate","scale","rotate","perspective"],Tn=["transform","translate","scale","rotate","perspective","filter"],Cn=["paint","layout","strict","content"];function _e(e){const t=ze(),n=z(e)?U(e):e;return xn.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Tn.some(o=>(n.willChange||"").includes(o))||Cn.some(o=>(n.contain||"").includes(o))}function Pn(e){let t=oe(e);for(;J(t)&&!ge(t);){if(_e(t))return t;if(De(t))return null;t=oe(t)}return null}function ze(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ln=new Set(["html","body","#document"]);function ge(e){return Ln.has(pe(e))}function U(e){return _(e).getComputedStyle(e)}function Ve(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oe(e){if(pe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bt(e)&&e.host||G(e);return bt(t)?t.host:t}function Et(e){const t=oe(e);return ge(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&be(t)?t:Et(t)}function Ee(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Et(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=_(i);if(r){const a=Ue(l);return t.concat(l,l.visualViewport||[],be(i)?i:[],a&&n?Ee(a):[])}return t.concat(i,Ee(i,[],n))}function Ue(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xt(e){const t=U(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,a=Le(n)!==r||Le(o)!==l;return a&&(n=r,o=l),{width:n,height:o,$:a}}function qe(e){return z(e)?e:e.contextElement}function ve(e){const t=qe(e);if(!J(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=xt(t);let l=(r?Le(n.width):n.width)/o,a=(r?Le(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const On=K(0);function Tt(e){const t=_(e);return!ze()||!t.visualViewport?On:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_(e)?!1:t}function le(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=qe(e);let l=K(1);t&&(o?z(o)&&(l=ve(o)):l=ve(e));const a=Sn(r,n,o)?Tt(r):K(0);let f=(i.left+a.x)/l.x,u=(i.top+a.y)/l.y,m=i.width/l.x,d=i.height/l.y;if(r){const g=_(r),h=o&&z(o)?_(o):o;let w=g,p=Ue(w);for(;p&&o&&h!==w;){const E=ve(p),y=p.getBoundingClientRect(),b=U(p),L=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*E.x,S=y.top+(p.clientTop+parseFloat(b.paddingTop))*E.y;f*=E.x,u*=E.y,m*=E.x,d*=E.y,f+=L,u+=S,w=_(p),p=Ue(w)}}return Me({width:m,height:d,x:f,y:u})}function Re(e,t){const n=Ve(e).scrollLeft;return t?t.left+n:le(G(e)).left+n}function Ct(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Re(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Mn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=G(o),a=t?De(t.floating):!1;if(o===l||a&&r)return n;let f={scrollLeft:0,scrollTop:0},u=K(1);const m=K(0),d=J(o);if((d||!d&&!r)&&((pe(o)!=="body"||be(l))&&(f=Ve(o)),J(o))){const h=le(o);u=ve(o),m.x=h.x+o.clientLeft,m.y=h.y+o.clientTop}const g=l&&!d&&!r?Ct(l,f):K(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-f.scrollLeft*u.x+m.x+g.x,y:n.y*u.y-f.scrollTop*u.y+m.y+g.y}}function An(e){return Array.from(e.getClientRects())}function Nn(e){const t=G(e),n=Ve(e),o=e.ownerDocument.body,i=re(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=re(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Re(e);const a=-n.scrollTop;return U(o).direction==="rtl"&&(l+=re(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:a}}const Pt=25;function Dn(e,t){const n=_(e),o=G(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,a=0,f=0;if(i){r=i.width,l=i.height;const m=ze();(!m||m&&t==="fixed")&&(a=i.offsetLeft,f=i.offsetTop)}const u=Re(o);if(u<=0){const m=o.ownerDocument,d=m.body,g=getComputedStyle(d),h=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,w=Math.abs(o.clientWidth-d.clientWidth-h);w<=Pt&&(r-=w)}else u<=Pt&&(r+=u);return{width:r,height:l,x:a,y:f}}const Vn=new Set(["absolute","fixed"]);function Rn(e,t){const n=le(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?ve(e):K(1),l=e.clientWidth*r.x,a=e.clientHeight*r.y,f=i*r.x,u=o*r.y;return{width:l,height:a,x:f,y:u}}function Lt(e,t,n){let o;if(t==="viewport")o=Dn(e,n);else if(t==="document")o=Nn(G(e));else if(z(t))o=Rn(t,n);else{const i=Tt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Me(o)}function Ot(e,t){const n=oe(e);return n===t||!z(n)||ge(n)?!1:U(n).position==="fixed"||Ot(n,t)}function kn(e,t){const n=t.get(e);if(n)return n;let o=Ee(e,[],!1).filter(a=>z(a)&&pe(a)!=="body"),i=null;const r=U(e).position==="fixed";let l=r?oe(e):e;for(;z(l)&&!ge(l);){const a=U(l),f=_e(l);!f&&a.position==="fixed"&&(i=null),(r?!f&&!i:!f&&a.position==="static"&&!!i&&Vn.has(i.position)||be(l)&&!f&&Ot(e,l))?o=o.filter(m=>m!==l):i=a,l=oe(l)}return t.set(e,o),o}function Fn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?De(t)?[]:kn(t,this._c):[].concat(n),o],a=l[0],f=l.reduce((u,m)=>{const d=Lt(t,m,i);return u.top=re(d.top,u.top),u.right=Z(d.right,u.right),u.bottom=Z(d.bottom,u.bottom),u.left=re(d.left,u.left),u},Lt(t,a,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Hn(e){const{width:t,height:n}=xt(e);return{width:t,height:n}}function Bn(e,t,n){const o=J(t),i=G(t),r=n==="fixed",l=le(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const f=K(0);function u(){f.x=Re(i)}if(o||!o&&!r)if((pe(t)!=="body"||be(i))&&(a=Ve(t)),o){const h=le(t,!0,r,t);f.x=h.x+t.clientLeft,f.y=h.y+t.clientTop}else i&&u();r&&!o&&i&&u();const m=i&&!o&&!r?Ct(i,a):K(0),d=l.left+a.scrollLeft-f.x-m.x,g=l.top+a.scrollTop-f.y-m.y;return{x:d,y:g,width:l.width,height:l.height}}function Ke(e){return U(e).position==="static"}function St(e,t){if(!J(e)||U(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function Mt(e,t){const n=_(e);if(De(e))return n;if(!J(e)){let i=oe(e);for(;i&&!ge(i);){if(z(i)&&!Ke(i))return i;i=oe(i)}return n}let o=St(e,t);for(;o&&bn(o)&&Ke(o);)o=St(o,t);return o&&ge(o)&&Ke(o)&&!_e(o)?n:o||Pn(e)||n}const In=async function(e){const t=this.getOffsetParent||Mt,n=this.getDimensions,o=await n(e.floating);return{reference:Bn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Wn(e){return U(e).direction==="rtl"}const $n={convertOffsetParentRelativeRectToViewportRelativeRect:Mn,getDocumentElement:G,getClippingRect:Fn,getOffsetParent:Mt,getElementRects:In,getClientRects:An,getDimensions:Hn,getScale:ve,isElement:z,isRTL:Wn};function At(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Xn(e,t){let n=null,o;const i=G(e);function r(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function l(a,f){a===void 0&&(a=!1),f===void 0&&(f=1),r();const u=e.getBoundingClientRect(),{left:m,top:d,width:g,height:h}=u;if(a||t(),!g||!h)return;const w=Oe(d),p=Oe(i.clientWidth-(m+g)),E=Oe(i.clientHeight-(d+h)),y=Oe(m),L={rootMargin:-w+"px "+-p+"px "+-E+"px "+-y+"px",threshold:re(0,Z(1,f))||1};let S=!0;function C(P){const N=P[0].intersectionRatio;if(N!==f){if(!S)return l();N?l(!1,N):o=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!At(u,e.getBoundingClientRect())&&l(),S=!1}try{n=new IntersectionObserver(C,{...L,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,L)}n.observe(e)}return l(!0),r}function Yn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,u=qe(e),m=i||r?[...u?Ee(u):[],...Ee(t)]:[];m.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const d=u&&a?Xn(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var L;(L=h)==null||L.observe(t)})),n()}),u&&!f&&h.observe(u),h.observe(t));let w,p=f?le(e):null;f&&E();function E(){const y=le(e);p&&!At(p,y)&&n(),p=y,w=requestAnimationFrame(E)}return n(),()=>{var y;m.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,f&&cancelAnimationFrame(w)}}const jn=gn,_n=vn,zn=dn,Un=hn,qn=fn,Kn=(e,t,n)=>{const o=new Map,i={platform:$n,...n},r={...i.platform,_c:o};return un(e,t,{...i,platform:r})};function Gn(e){return{name:"arrow",options:e,fn(t){const n=c.toValue(e.element);return n==null?{}:qn({element:n,padding:e.padding}).fn(t)}}}function Ge(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:r=!0,open:l=c.ref(!1)}=n,a=C=>{l.value=C},f=c.computed(()=>c.toValue(n.placement)??"bottom"),u=c.computed(()=>c.toValue(n.strategy)??"absolute"),m=c.ref(0),d=c.ref(0),g=c.ref(f.value),h=c.ref(u.value),w=c.shallowRef({}),p=c.ref(!1),E=c.ref(null),y=c.computed(()=>{const C=i||[];return E.value&&!C.some(N=>N.name==="arrow")?[...C,Gn({element:E})]:C}),b=async()=>{if(!e.value||!t.value)return;const C=await Kn(e.value,t.value,{placement:f.value,strategy:u.value,middleware:y.value});m.value=C.x,d.value=C.y,g.value=C.placement,h.value=C.strategy,w.value=C.middlewareData,p.value=l.value};c.watch([f,u],()=>{l.value&&b()});let L;c.watch([e,t,l],([C,P,N])=>{!N||!C||!P||(r&&(L=Yn(C,P,b,typeof r=="object"?r:void 0)),c.onWatcherCleanup(()=>{L==null||L(),L=void 0}))},{immediate:!0}),c.onScopeDispose(()=>L==null?void 0:L()),c.watch(l,C=>{C||(p.value=!1)});const S=c.ref({position:u.value,left:"0",top:"0"});return c.watch([m,d,()=>c.toValue(o)],([C,P,N])=>{const V=t.value;if(!V)return;const R={position:h.value,left:"0",top:"0"},D=Nt(V,C),A=Nt(V,P);N?S.value={...R,transform:`translate(${D}px, ${A}px)`,...Dt(V)>=1.5&&{"will-change":"transform"}}:S.value={...R,left:`${D}px`,top:`${A}px`}},{immediate:!0}),{x:m,y:d,strategy:h,placement:g,middlewareData:w,isPositioned:p,floatingStyles:S,update:b,refs:{anchorEl:e,floatingEl:t,arrowEl:E},open:l,setOpen:a}}function Nt(e,t){const n=Dt(e);return Math.round(t*n)/n}function Dt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jn(e,t,n={}){const{offset:o="-4px",padding:i}=n,{middlewareData:r,placement:l,refs:a}=t;c.watch(e,d=>{a.arrowEl.value=d});const f=c.computed(()=>{var d;return((d=r.value.arrow)==null?void 0:d.x)??0}),u=c.computed(()=>{var d;return((d=r.value.arrow)==null?void 0:d.y)??0}),m=c.computed(()=>{if(!(e.value||a.arrowEl.value)||!r.value.arrow)return{};const g=c.toValue(l).split("-")[0],h=f.value,w=u.value;return g==="bottom"?{"inset-inline-start":`${h}px`,"inset-block-start":o}:g==="top"?{"inset-inline-start":`${h}px`,"inset-block-end":o}:g==="right"?{"inset-block-start":`${w}px`,"inset-inline-start":o}:g==="left"?{"inset-block-start":`${w}px`,"inset-inline-end":o}:{}});return{arrowX:f,arrowY:u,arrowStyles:m}}let Qn=0;function Zn(){return`vfloat-id-${Qn++}`}function Vt(e){return typeof e=="object"&&e instanceof HTMLElement}function Rt(e){return e!==null&&typeof e=="object"&&"data"in e&&"id"in e&&"children"in e&&"parent"in e}function ke(e){return Rt(e)?{floatingContext:e.data,treeContext:e}:{floatingContext:e,treeContext:null}}function q(e,t){if(!t)return!1;if(typeof t=="object"&&t!==null&&"contextElement"in t){const n=t.contextElement;return n instanceof Element?n.contains(e):!1}return t instanceof Element?t.contains(e):!1}function Fe(e,t){for(const n of e.children.value)if(n.data.open.value){if(q(t,n.data.refs.anchorEl.value)||q(t,n.data.refs.floatingEl.value))return n;const o=Fe(n,t);if(o)return o}return null}function He(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function Je(e){return!e||!(e instanceof HTMLElement)?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable&&e.contentEditable!=="false"}function Qe(e){const t=e.target;return t instanceof HTMLElement?t.tagName==="BUTTON"||t.tagName==="INPUT"&&t.getAttribute("type")==="button"||t.getAttribute("role")==="button":!1}function Ze(e){return Je(e)}function kt(e){return e instanceof Element&&e instanceof HTMLElement}function Ft(e){return typeof e=="object"&&e!==null&&"contextElement"in e}function et(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function Ht(e,t){const n=t.getBoundingClientRect(),o=t.offsetWidth-t.clientWidth,i=t.offsetHeight-t.clientHeight,r=e.clientX-n.left,l=e.clientY-n.top;if(o>0){const a=t.clientWidth;if(r>=a&&r<=t.offsetWidth)return!0}if(i>0){const a=t.clientHeight;if(l>=a&&l<=t.offsetHeight)return!0}return!1}function tt(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function nt(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Bt(e){return typeof(e==null?void 0:e.matches)!="function"?!1:e.matches(":focus-visible")}function Be(e,t){return e.contains(t)}function It(e){return e.target}function ot(){return typeof performance<"u"?performance.now():Date.now()}function it(e){e!==-1&&clearTimeout(e)}function Wt(e){return e.children.value.some(t=>t.data.open.value||Wt(t))}function eo(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function $t(e,t){const[n,o]=e;let i=!1;const r=t.length;for(let l=0,a=r-1;l<r;a=l++){const[f,u]=t[l]||[0,0],[m,d]=t[a]||[0,0];u>=o!=d>=o&&n<=(m-f)*(o-u)/(d-u)+f&&(i=!i)}return i}function to(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let i=-1,r=!1;function l(f,u,m,d,g){const h=ot(),w=h-g;if(m===null||d===null||w===0)return{speed:null,lastX:f,lastY:u,lastCursorTime:h};const p=f-m,E=u-d;return{speed:Math.sqrt(p*p+E*E)/w,lastX:f,lastY:u,lastCursorTime:h}}const a=function(u){const{x:m,y:d,placement:g,elements:h,buffer:w,onClose:p,nodeId:E,tree:y}=u,b=c.computed(()=>{const P=h.domReference;return Vt(P)?P:(P==null?void 0:P.contextElement)??null});let L=null,S=null,C=ot();return function(N){var _t,zt,Ut,qt,Kt,Gt,Jt;function V(){it(i),i=-1,p()}if(it(i),i=-1,!h.domReference||!h.floating||g==null||m==null||d==null)return;const{clientX:R,clientY:D}=N,A=[R,D],k=It(N),W=N.type==="mouseleave",F=h.floating&&Be(h.floating,k),j=b.value&&Be(b.value,k),x=(_t=b.value)==null?void 0:_t.getBoundingClientRect(),s=(zt=h.floating)==null?void 0:zt.getBoundingClientRect(),v=g.split("-")[0],H=m>((s==null?void 0:s.right)??0)-((s==null?void 0:s.width)??0)/2,Y=d>((s==null?void 0:s.bottom)??0)-((s==null?void 0:s.height)??0)/2,ee=x?eo(A,x):!1,O=((s==null?void 0:s.width)??0)>((x==null?void 0:x.width)??0),I=((s==null?void 0:s.height)??0)>((x==null?void 0:x.height)??0),ae=((Ut=O?x:s)==null?void 0:Ut.left)??0,te=((qt=O?x:s)==null?void 0:qt.right)??0,ce=((Kt=I?x:s)==null?void 0:Kt.top)??0,ue=((Gt=I?x:s)==null?void 0:Gt.bottom)??0;if(F&&(r=!0,!W))return;if(j&&(r=!1),j&&!W){r=!0;return}if(W&&Vt(N.relatedTarget)&&h.floating&&Be(h.floating,N.relatedTarget))return;if(y&&E){const B=y.nodes.get(E);if(B&&Wt(B))return}if(v==="top"&&d>=((x==null?void 0:x.bottom)??0)-1||v==="bottom"&&d<=((x==null?void 0:x.top)??0)+1||v==="left"&&m>=((x==null?void 0:x.right)??0)-1||v==="right"&&m<=((x==null?void 0:x.left)??0)+1)return V();let ie=[];switch(v){case"top":ie=[[ae,((x==null?void 0:x.top)??0)+1],[ae,((s==null?void 0:s.bottom)??0)-1],[te,((s==null?void 0:s.bottom)??0)-1],[te,((x==null?void 0:x.top)??0)+1]];break;case"bottom":ie=[[ae,((s==null?void 0:s.top)??0)+1],[ae,((x==null?void 0:x.bottom)??0)-1],[te,((x==null?void 0:x.bottom)??0)-1],[te,((s==null?void 0:s.top)??0)+1]];break;case"left":ie=[[((s==null?void 0:s.right)??0)-1,ue],[((s==null?void 0:s.right)??0)-1,ce],[((x==null?void 0:x.left)??0)+1,ce],[((x==null?void 0:x.left)??0)+1,ue]];break;case"right":ie=[[((x==null?void 0:x.right)??0)-1,ue],[((x==null?void 0:x.right)??0)-1,ce],[((s==null?void 0:s.left)??0)+1,ce],[((s==null?void 0:s.left)??0)+1,ue]];break}function Pe([B,X]){const M=w;switch(v){case"top":{const fe=[O?B+M/2:H?B+M*4:B-M*4,X+M+1],de=[O?B-M/2:H?B+M*4:B-M*4,X+M+1],we=[[(s==null?void 0:s.left)??0,H||O?((s==null?void 0:s.bottom)??0)-M:(s==null?void 0:s.top)??0],[(s==null?void 0:s.right)??0,H?O?((s==null?void 0:s.bottom)??0)-M:(s==null?void 0:s.top)??0:((s==null?void 0:s.bottom)??0)-M]];return[fe,de,...we]}case"bottom":{const fe=[O?B+M/2:H?B+M*4:B-M*4,X-M],de=[O?B-M/2:H?B+M*4:B-M*4,X-M],we=[[(s==null?void 0:s.left)??0,H||O?((s==null?void 0:s.top)??0)+M:(s==null?void 0:s.bottom)??0],[(s==null?void 0:s.right)??0,H?O?((s==null?void 0:s.top)??0)+M:(s==null?void 0:s.bottom)??0:((s==null?void 0:s.top)??0)+M]];return[fe,de,...we]}case"left":{const fe=[B+M+1,I?X+M/2:Y?X+M*4:X-M*4],de=[B+M+1,I?X-M/2:Y?X+M*4:X-M*4];return[...[[Y||I?((s==null?void 0:s.right)??0)-M:(s==null?void 0:s.left)??0,(s==null?void 0:s.top)??0],[Y?I?((s==null?void 0:s.right)??0)-M:(s==null?void 0:s.left)??0:((s==null?void 0:s.right)??0)-M,(s==null?void 0:s.bottom)??0]],fe,de]}case"right":{const fe=[B-M,I?X+M/2:Y?X+M*4:X-M*4],de=[B-M,I?X-M/2:Y?X+M*4:X-M*4],we=[[Y||I?((s==null?void 0:s.left)??0)+M:(s==null?void 0:s.right)??0,(s==null?void 0:s.top)??0],[Y?I?((s==null?void 0:s.left)??0)+M:(s==null?void 0:s.right)??0:((s==null?void 0:s.left)??0)+M,(s==null?void 0:s.bottom)??0]];return[fe,de,...we]}}}const Ie=Pe([m,d]);if((Jt=e.onPolygonChange)==null||Jt.call(e,Ie),!$t(A,ie)){if($t(A,Ie)){if(!r&&o){const B=l(N.clientX,N.clientY,L,S,C);L=B.lastX,S=B.lastY,C=B.lastCursorTime,B.speed!==null&&B.speed<.1&&(i=window.setTimeout(V,40))}return}if(r&&!ee)return V();V()}}};return a.__options={blockPointerEvents:n},a}const Xt=10;function no(e,t,n){const{delay:o}=n,i=c.computed(()=>{const u=c.toValue(o);return(typeof u=="number"?u:u.open)??0}),r=c.computed(()=>{const u=c.toValue(o);return(typeof u=="number"?u:u.close)??0});let l,a;const f=()=>{clearTimeout(l),clearTimeout(a)};return c.onScopeDispose(f),{show:u=>{f();const m=u??i.value;m===0?e():l=setTimeout(e,m)},hide:u=>{f();const m=u??r.value;m===0?t():a=setTimeout(t,m)},showDelay:i,hideDelay:r,clearTimeouts:f}}function oo(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:{anchorEl:l,floatingEl:a}}=n,{enabled:f=!0,delay:u=0,restMs:m=0,mouseOnly:d=!1,safePolygon:g=!1}=t,h=c.computed(()=>c.toValue(f)),w=c.computed(()=>c.toValue(m)),p=c.computed(()=>{const v=l.value;return!v||v instanceof HTMLElement?v:v.contextElement??null}),{hide:E,show:y,showDelay:b,clearTimeouts:L}=no(()=>{i.value||r(!0)},()=>{i.value&&r(!1)},{delay:u});let S=null,C;const P=c.computed(()=>b.value===0&&w.value>0);function N(v){if(!h.value||!D(v)||!P.value||!S)return;const H={x:v.clientX,y:v.clientY},Y=Math.abs(H.x-S.x),ee=Math.abs(H.y-S.y);(Y>Xt||ee>Xt)&&(S=H,clearTimeout(C),C=setTimeout(()=>{y(0)},w.value))}function V(v){!h.value||!D(v)||!P.value||(S={x:v.clientX,y:v.clientY},C=setTimeout(()=>{y(0)},w.value))}function R(){clearTimeout(C),S=null}c.watchPostEffect(()=>{const v=p.value;!v||!h.value||!P.value||(v.addEventListener("pointerenter",V),v.addEventListener("pointermove",N),v.addEventListener("pointerleave",R),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",V),v.removeEventListener("pointermove",N),v.removeEventListener("pointerleave",R)}))}),c.onScopeDispose(()=>{clearTimeout(C)});function D(v){return c.toValue(d)?v.pointerType==="mouse":!0}function A(v){!h.value||!D(v)||P.value||(F(),y())}function k(v){!h.value||!D(v)||(L(),F())}let W=null;function F(){W&&(document.removeEventListener("pointermove",W),W=null);const v=x.value;v!=null&&v.onPolygonChange&&v.onPolygonChange([])}const j=c.computed(()=>!!c.toValue(g)),x=c.computed(()=>{const v=c.toValue(g);if(typeof v=="object"&&v)return v;if(v===!0)return{}});function s(v){var O;if(!h.value||!D(v))return;const{clientX:H,clientY:Y}=v,ee=v.relatedTarget;if(j.value)setTimeout(()=>{var ue;F();const I=p.value,ae=a.value;if(!I||!ae){E();return}let te,ce;if(o){te=new Map;const ie=Pe=>{te.set(Pe.id,Pe);for(const Ie of Pe.children.value)ie(Ie)};ie(o),ce=o.id}W=to(x.value)({x:H,y:Y,placement:n.placement.value,elements:{domReference:I,floating:ae},buffer:((ue=x.value)==null?void 0:ue.buffer)??1,onClose:()=>{F(),E()},nodeId:ce,tree:te?{nodes:te}:void 0}),W&&document.addEventListener("pointermove",W)},0);else{if(o){if(!io(o,ee))return}else if((O=a.value)!=null&&O.contains(ee))return;E()}}c.watchPostEffect(()=>{const v=p.value;!v||!h.value||(v.addEventListener("pointerenter",A),v.addEventListener("pointerleave",s),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",A),v.removeEventListener("pointerleave",s)}))}),c.watchPostEffect(()=>{const v=a.value;!v||!h.value||(v.addEventListener("pointerenter",k),v.addEventListener("pointerleave",s),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",k),v.removeEventListener("pointerleave",s)}))}),c.onScopeDispose(()=>{F()})}function io(e,t){return t?!(q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)||Fe(e,t)):!0}function ro(e){return c.getCurrentScope()?(c.onScopeDispose(e),!0):!1}const so=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const lo=Object.prototype.toString,ao=e=>lo.call(e)==="[object Object]";function rt(e){return Array.isArray(e)?e:[e]}function co(e,t,n){return c.watch(e,t,{...n,immediate:!0})}const uo=so?window:void 0;function fo(e){var t;const n=c.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Q(...e){const t=[],n=()=>{t.forEach(a=>a()),t.length=0},o=(a,f,u,m)=>(a.addEventListener(f,u,m),()=>a.removeEventListener(f,u,m)),i=c.computed(()=>{const a=rt(c.toValue(e[0])).filter(f=>f!=null);return a.every(f=>typeof f!="string")?a:void 0}),r=co(()=>{var a,f;return[(f=(a=i.value)==null?void 0:a.map(u=>fo(u)))!=null?f:[uo].filter(u=>u!=null),rt(c.toValue(i.value?e[1]:e[0])),rt(c.unref(i.value?e[2]:e[1])),c.toValue(i.value?e[3]:e[2])]},([a,f,u,m])=>{if(n(),!(a!=null&&a.length)||!(f!=null&&f.length)||!(u!=null&&u.length))return;const d=ao(m)?{...m}:m;t.push(...a.flatMap(g=>f.flatMap(h=>u.map(w=>o(g,h,w,d)))))},{flush:"post"}),l=()=>{r(),n()};return ro(n),l}function ho(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:{floatingEl:l,anchorEl:a}}=n,{enabled:f=!0,requireFocusVisible:u=!0}=t,m=c.computed(()=>a.value?a.value instanceof HTMLElement?a.value:a.value.contextElement:null);let d=!1,g=!0,h;Q(window,"blur",()=>{!i.value&&m.value&&m.value===document.activeElement&&(d=!0)}),Q(window,"focus",()=>{d=!1}),c.onMounted(()=>{tt()&&nt()&&(Q(window,"keydown",()=>{g=!0},{capture:!0}),Q(window,"pointerdown",()=>{g=!1},{capture:!0}))});function w(E){if(d){d=!1;return}const y=E.target;if(c.toValue(u)&&y){if(tt()&&nt()&&!E.relatedTarget){if(!g&&!Je(y))return}else if(!Bt(y))return}r(!0)}function p(E){clearTimeout(h),h=window.setTimeout(()=>{var L;const b=(((L=m.value)==null?void 0:L.ownerDocument)??document).activeElement;if(!(!E.relatedTarget&&b===m.value)){if(o){if(b&&mo(o,b))return}else if(l.value&&b&&l.value.contains(b))return;r(!1)}},0)}c.watchPostEffect(()=>{if(!c.toValue(f))return;const E=m.value;!E||!(E instanceof HTMLElement)||(E.addEventListener("focus",w),E.addEventListener("blur",p),c.onWatcherCleanup(()=>{E.removeEventListener("focus",w),E.removeEventListener("blur",p)}))}),c.onScopeDispose(()=>{clearTimeout(h)})}function mo(e,t){return q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)?!0:Yt(e,t)!==null}function Yt(e,t){for(const n of e.children.value)if(n.data.open.value){if(q(t,n.data.refs.anchorEl.value)||q(t,n.data.refs.floatingEl.value))return n;const o=Yt(n,t);if(o)return o}return null}function po(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:l}=n,{enabled:a=!0,event:f="click",toggle:u=!0,ignoreMouse:m=!1,ignoreKeyboard:d=!1,ignoreTouch:g=!1,outsideClick:h=!1,outsideEvent:w="pointerdown",outsideCapture:p=!0,onOutsideClick:E,preventScrollbarClick:y=!0,handleDragEvents:b=!0}=t;let L,S=!1,C=!1,P=!1;const N=c.computed(()=>c.toValue(a)),V=c.computed(()=>c.toValue(h)),R=c.computed(()=>{const O=l.anchorEl.value;return O?O instanceof HTMLElement?O:Ft(O)&&O.contextElement instanceof HTMLElement?O.contextElement:null:null}),D=c.computed(()=>l.floatingEl.value);function A(){P=!0;try{i.value?c.toValue(u)&&r(!1):r(!0)}finally{Promise.resolve().then(()=>{P=!1})}}function k(){L=void 0,S=!1,C=!1}function W(O){L=O.pointerType}function F(O){O.button===0&&c.toValue(f)!=="click"&&(ee(L)||A())}function j(){if(c.toValue(f)==="mousedown"&&L){k();return}if(ee(L)){k();return}A(),k()}function x(O){if(L=void 0,O.defaultPrevented||c.toValue(d)||Qe(O))return;const I=R.value;I&&(O.key===" "&&!Ze(I)&&(O.preventDefault(),S=!0),O.key==="Enter"&&A())}function s(O){const I=R.value;I&&(O.defaultPrevented||c.toValue(d)||Qe(O)||Ze(I)||O.key===" "&&S&&(S=!1,A()))}function v(O){if(!N.value||!V.value||!i.value)return;if(c.toValue(w)==="click"&&c.toValue(b)&&C){C=!1;return}if(P)return;const I=O.target;if(I&&!(c.toValue(y)&&kt(I)&&D.value&&Ht(O,I))){if(o){if(!go(o,I))return}else if(et(O,R.value)||et(O,D.value))return;E?E(O,n):r(!1)}}function H(){C=!0}function Y(){setTimeout(()=>{C=!1},0)}function ee(O){return!!(He(O,!0)&&c.toValue(m)||O==="touch"&&c.toValue(g))}c.watchPostEffect(()=>{const O=R.value;!N.value||!O||(O.addEventListener("pointerdown",W),O.addEventListener("mousedown",F),O.addEventListener("click",j),O.addEventListener("keydown",x),O.addEventListener("keyup",s),c.onWatcherCleanup(()=>{O.removeEventListener("pointerdown",W),O.removeEventListener("mousedown",F),O.removeEventListener("click",j),O.removeEventListener("keydown",x),O.removeEventListener("keyup",s),k()}))}),Q(()=>N.value&&V.value?document:null,()=>c.toValue(w),v,{capture:c.toValue(p)}),Q(()=>N.value&&V.value&&c.toValue(b)?D.value:null,"mousedown",H,{capture:!0}),Q(()=>N.value&&V.value&&c.toValue(b)?D.value:null,"mouseup",Y,{capture:!0})}function go(e,t){return!(q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)||Fe(e,t))}function vo(e,t,n={}){const{open:o,refs:i}=t;let r;const l=c.ref({x:null,y:null}),a=c.computed(()=>c.toValue(n.axis??"both")),f=c.computed(()=>c.toValue(n.enabled??!0)),u=c.computed(()=>c.toValue(n.x??null)),m=c.computed(()=>c.toValue(n.y??null)),d=(p,E)=>{l.value={x:p,y:E},o.value&&(i.anchorEl.value=wo(e.value,a.value,l.value))};c.watchEffect(()=>{const p=u.value,E=m.value;f.value&&p!=null&&E!=null&&d(p,E)});const g=p=>{r=p.pointerType,d(p.clientX,p.clientY)},h=p=>{r=p.pointerType,!o.value&&He(r,!0)&&d(p.clientX,p.clientY)},w=p=>{o.value&&He(r,!0)&&d(p.clientX,p.clientY)};return c.watchEffect(()=>{if(u.value!=null||m.value!=null)return;const p=e.value;!p||!f.value||(p.addEventListener("pointerenter",h),p.addEventListener("pointerdown",g),p.addEventListener("pointermove",w),c.onWatcherCleanup(()=>{p==null||p.removeEventListener("pointerenter",h),p==null||p.removeEventListener("pointerdown",g),p==null||p.removeEventListener("pointermove",w)}))}),{coordinates:c.readonly(l),updatePosition:d}}function wo(e,t,n){let o=null,i=null;const r=e;return{contextElement:r||void 0,getBoundingClientRect:()=>{const l=(r==null?void 0:r.getBoundingClientRect())??{width:0,height:0,x:0,y:0},a=t==="x"||t==="both",f=t==="y"||t==="both";let u=0,m=0,d=l.x,g=l.y;return r&&(o==null&&n.x!=null&&a&&(o=l.x-n.x),i==null&&n.y!=null&&f&&(i=l.y-n.y),d-=o||0,g-=i||0),a&&n.x!=null?d=n.x:(o=null,u=l.width),f&&n.y!=null?g=n.y:(i=null,m=l.height),t==="both"&&(u=0,m=0),{width:u,height:m,x:d,y:g,top:g,right:d+u,bottom:g+m,left:d}}}}function yo(e){const{enabled:t=!0,onEscape:n,capture:o}=e,{isComposing:i}=bo();Q(document,"keydown",r=>{r.key!=="Escape"||!c.toValue(t)||i()||n(r)},o)}function bo(){const e=c.ref(!1);return Q(document,"compositionstart",()=>{e.value=!0}),Q(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}class st{constructor(t,n=null,o={},i=!1){he(this,"id");he(this,"data");he(this,"parent");he(this,"children");We(this,xe);this.id=o.id??Zn(),this.data=t,this.parent=c.shallowRef(n),this.children=c.shallowRef([]),ct(this,xe,i)}addChild(t){this.children.value=[...this.children.value,t]}_removeChildInstance(t){return this.children.value.includes(t)?(this.children.value=this.children.value.filter(n=>n.id!==t.id),t.parent.value=null,!0):!1}findChild(t){return this.children.value.find(t)??null}findDescendant(t){const n=[this];for(;n.length>0;){const o=n.pop();if(t(o))return o;for(let i=o.children.value.length-1;i>=0;i--)n.push(o.children.value[i])}return null}isDescendantOf(t){let n=this.parent.value;for(;n;){if(n.id===t.id)return!0;n=n.parent.value}return!1}getPath(){const t=[];let n=this;for(;n;)t.push(n),n=n.parent.value;return t.reverse()}get isRoot(){return at(this,xe)}get isLeaf(){return this.children.value.length===0}}xe=new WeakMap;class jt{constructor(t,n){We(this,Ce);he(this,"root");he(this,"nodeMap");We(this,Te);ct(this,Te,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=c.shallowReactive(new Map),this.root=new st(t,null,{},!0),this.nodeMap.set(this.root.id,this.root)}findNodeById(t){return this.nodeMap.get(t)??null}addNode(t,n=null,o={}){const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree addNode: Parent node with ID ${n} not found.`),null;o.id&&this.nodeMap.has(o.id)&&(o.id=void 0);const r=new st(t,i,o);return this.nodeMap.set(r.id,r),i.addChild(r),r}removeNode(t,n){const o=n??at(this,Te),i=this.findNodeById(t);if(!i)return!1;if(i.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const r=i.parent.value;if(o==="recursive")ut(this,Ce,ft).call(this,i);else{for(const l of i.children.value)l.parent.value=null;i.children.value=[],this.nodeMap.delete(i.id)}return r._removeChildInstance(i)}moveNode(t,n){const o=this.findNodeById(t);if(!o)return console.error(`Tree moveNode: Node with ID ${t} not found.`),!1;if(o.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(t===n)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree moveNode: New parent node with ID ${n} not found.`),!1;if(i.isDescendantOf(o))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const r=o.parent.value;if(r){if(!r._removeChildInstance(o))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(o.isRoot){if(o.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return i.addChild(o),o.parent.value=i,!0}traverse(t="dfs",n=this.root){const o=[];if(!n)return console.warn("Tree traverse: Start node is null, returning empty array."),o;if(t==="dfs"){const i=[n];for(;i.length>0;){const r=i.pop();o.push(r);for(let l=r.children.value.length-1;l>=0;l--)i.push(r.children.value[l])}}else{const i=[n];for(;i.length>0;){const r=i.shift();o.push(r);for(const l of r.children.value)i.push(l)}}return o}dispose(){this.nodeMap.clear()}}Te=new WeakMap,Ce=new WeakSet,ft=function(t){const n=[...t.children.value];for(const o of n)ut(this,Ce,ft).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function Eo(e,t,n={},o={}){const{parentId:i,...r}=n,l=Ge(e,t,r),a=new jt(l,o);return{get nodeMap(){return a.nodeMap},get root(){return a.root},findNodeById:y=>a.findNodeById(y),moveNode:(y,b)=>a.moveNode(y,b),dispose:()=>{a.dispose()},addNode:(y,b,L={})=>{const{parentId:S,...C}=L,P=Ge(y,b,C);return a.addNode(P,S)},removeNode:(y,b)=>a.removeNode(y,b),traverse:(y,b)=>a.traverse(y,b),getAllOpenNodes:()=>{const y=[];for(const b of a.nodeMap.values())b.data.open.value&&y.push(b);return y},getTopmostOpenNode:()=>{let y=null,b=-1;for(const L of a.nodeMap.values())if(L.data.open.value){const S=L.getPath().length;S>b&&(b=S,y=L)}return y},forEach:(y,b,L={})=>{const{relationship:S="self-and-children",applyToMatching:C=!0}=L,P=a.findNodeById(y);if(!P)return;const N=[],V=new Set,R=A=>{A&&!V.has(A.id)&&(N.push(A),V.add(A.id))},D=A=>{for(const k of A)R(k)};if(S==="ancestors-only")for(const A of P.getPath())A.id!==P.id&&R(A);else if(S==="siblings-only"){if(P.parent.value)for(const A of P.parent.value.children.value)A.id!==P.id&&R(A)}else if(S==="descendants-only")for(const A of a.traverse("dfs",P))A.id!==P.id&&R(A);else if(S==="children-only")D(P.children.value);else if(S==="self-and-ancestors")D(P.getPath());else if(S==="self-and-children")R(P),D(P.children.value);else if(S==="self-and-descendants")D(a.traverse("dfs",P));else if(S==="self-and-siblings")R(P),P.parent.value&&D(P.parent.value.children.value);else if(S==="self-ancestors-and-children")D(P.getPath()),D(P.children.value);else if(S==="full-branch")D(P.getPath()),D(a.traverse("dfs",P));else if(S==="all-except-branch"){const A=new Set;for(const k of P.getPath())A.add(k.id);for(const k of a.traverse("dfs",P))A.add(k.id);for(const k of a.nodeMap.values())!A.has(k.id)===C&&b(k);return}else{console.warn(`forEach: Unknown relationship "${S}".`);return}if(C)for(const A of N)b(A);else for(const A of a.nodeMap.values())V.has(A.id)||b(A)}}}T.Tree=jt,T.TreeNode=st,T.clearTimeoutIfSet=it,T.contains=Be,T.findDescendantContainingTarget=Fe,T.flip=zn,T.getContextFromParameter=ke,T.getCurrentTime=ot,T.getTarget=It,T.hide=Un,T.isButtonTarget=Qe,T.isClickOnScrollbar=Ht,T.isEventTargetWithin=et,T.isHTMLElement=kt,T.isMac=tt,T.isMouseLikePointerType=He,T.isSafari=nt,T.isSpaceIgnored=Ze,T.isTargetWithinElement=q,T.isTreeNode=Rt,T.isTypeableElement=Je,T.isVirtualElement=Ft,T.matchesFocusVisible=Bt,T.offset=jn,T.shift=_n,T.useArrow=Jn,T.useClick=po,T.useClientPoint=vo,T.useEscapeKey=yo,T.useFloating=Ge,T.useFloatingTree=Eo,T.useFocus=ho,T.useHover=oo,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v-float",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Vue 3 port of Floating UI - a library for positioning floating elements",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -18,46 +18,59 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@floating-ui/dom": "^1.
|
|
22
|
-
"@vueuse/core": "^13.
|
|
23
|
-
"
|
|
21
|
+
"@floating-ui/dom": "^1.7.4",
|
|
22
|
+
"@vueuse/core": "^13.7.0",
|
|
23
|
+
"vitepress-plugin-demo": "^0.8.1",
|
|
24
|
+
"vue": "^3.5.20"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"
|
|
27
|
+
"@21st-extension/toolbar-vue": "^0.5.14",
|
|
28
|
+
"@21st-extension/vue": "^0.5.14",
|
|
27
29
|
"@biomejs/biome": "1.9.4",
|
|
30
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
28
31
|
"@testing-library/vue": "^8.1.0",
|
|
29
|
-
"@tsconfig/node22": "^22.0.
|
|
32
|
+
"@tsconfig/node22": "^22.0.2",
|
|
30
33
|
"@types/jsdom": "^21.1.7",
|
|
31
|
-
"@types/node": "^22.
|
|
34
|
+
"@types/node": "^22.18.0",
|
|
32
35
|
"@unocss/reset": "66.1.0-beta.7",
|
|
33
|
-
"@vitejs/plugin-vue": "^5.2.
|
|
34
|
-
"@vitest/browser": "^3.
|
|
35
|
-
"@vitest/coverage-v8": "^3.
|
|
36
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
37
|
+
"@vitest/browser": "^3.2.4",
|
|
38
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
36
39
|
"@vitest/ui": "3.0.8",
|
|
37
40
|
"@vue/test-utils": "^2.4.6",
|
|
38
41
|
"@vue/tsconfig": "^0.7.0",
|
|
39
|
-
"jsdom": "^26.
|
|
42
|
+
"jsdom": "^26.1.0",
|
|
43
|
+
"lucide-vue-next": "^0.513.0",
|
|
40
44
|
"npm-run-all2": "^7.0.2",
|
|
41
|
-
"playwright": "^1.
|
|
42
|
-
"prettier": "^3.
|
|
45
|
+
"playwright": "^1.55.0",
|
|
46
|
+
"prettier": "^3.6.2",
|
|
47
|
+
"release-it": "^19.0.4",
|
|
48
|
+
"release-it-pnpm": "^4.6.6",
|
|
43
49
|
"typescript": "~5.7.3",
|
|
44
50
|
"unocss": "66.1.0-beta.7",
|
|
45
|
-
"vite": "^6.
|
|
46
|
-
"vite-plugin-dts": "^4.5.
|
|
47
|
-
"vite-plugin-vue-devtools": "^7.7.
|
|
48
|
-
"vitepress": "^1.6.
|
|
49
|
-
"vitest": "^3.
|
|
51
|
+
"vite": "^6.3.5",
|
|
52
|
+
"vite-plugin-dts": "^4.5.4",
|
|
53
|
+
"vite-plugin-vue-devtools": "^7.7.7",
|
|
54
|
+
"vitepress": "^1.6.4",
|
|
55
|
+
"vitest": "^3.2.4",
|
|
50
56
|
"vitest-browser-vue": "^0.2.0",
|
|
51
|
-
"vue-tsc": "^2.2.
|
|
57
|
+
"vue-tsc": "^2.2.12"
|
|
52
58
|
},
|
|
53
59
|
"scripts": {
|
|
54
60
|
"dev": "vite",
|
|
55
61
|
"build": "run-p type-check \"build-only {@}\" --",
|
|
56
62
|
"preview": "vite preview",
|
|
57
|
-
"test:unit": "vitest --no-watch",
|
|
58
63
|
"build-only": "vite build",
|
|
59
64
|
"type-check": "vue-tsc --build tsconfig.build.json",
|
|
60
65
|
"lint": "biome check --apply --write",
|
|
61
|
-
"test
|
|
66
|
+
"test": "vitest --workspace=vitest.workspace.ts",
|
|
67
|
+
"docs:dev": "vitepress dev docs",
|
|
68
|
+
"docs:build": "vitepress build docs",
|
|
69
|
+
"docs:preview": "vitepress preview docs",
|
|
70
|
+
"release": "release-it",
|
|
71
|
+
"release:patch": "release-it patch",
|
|
72
|
+
"release:minor": "release-it minor",
|
|
73
|
+
"release:major": "release-it major",
|
|
74
|
+
"release:dry": "release-it --dry-run"
|
|
62
75
|
}
|
|
63
76
|
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import { FloatingContext } from '../use-floating';
|
|
3
|
-
export type DismissReason = "escape-key" | "outside-press" | "anchor-press" | "ancestor-scroll";
|
|
4
|
-
export interface UseDismissProps {
|
|
5
|
-
/**
|
|
6
|
-
* Whether dismiss event listeners are enabled.
|
|
7
|
-
* @default true
|
|
8
|
-
*/
|
|
9
|
-
enabled?: MaybeRefOrGetter<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* Whether to dismiss when the escape key is pressed.
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
escapeKey?: MaybeRefOrGetter<boolean>;
|
|
15
|
-
/**
|
|
16
|
-
* Whether to dismiss when the anchor element is pressed.
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
anchorPress?: MaybeRefOrGetter<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Whether to dismiss when clicking outside the floating and anchor element.
|
|
22
|
-
* Can be a function to allow custom logic.
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
outsidePress?: MaybeRefOrGetter<boolean | ((event: MouseEvent) => boolean)>;
|
|
26
|
-
/**
|
|
27
|
-
* Whether to dismiss when a scrollable ancestor of the floating element is scrolled.
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
ancestorScroll?: MaybeRefOrGetter<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* Whether to use capture phase for document event listeners.
|
|
33
|
-
* @default { escapeKey: false, outsidePress: true }
|
|
34
|
-
*/
|
|
35
|
-
capture?: boolean | {
|
|
36
|
-
escapeKey?: boolean;
|
|
37
|
-
outsidePress?: boolean;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* The event name to use for anchor press.
|
|
41
|
-
* @default 'pointerdown'
|
|
42
|
-
*/
|
|
43
|
-
anchorPressEvent?: "pointerdown" | "mousedown" | "click";
|
|
44
|
-
/**
|
|
45
|
-
* The event name to use for outside press.
|
|
46
|
-
* @default 'pointerdown'
|
|
47
|
-
*/
|
|
48
|
-
outsidePressEvent?: "pointerdown" | "mousedown" | "click";
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Closes the floating element when a dismissal is requested.
|
|
52
|
-
*
|
|
53
|
-
* This composable provides event handlers for dismissal behaviors including
|
|
54
|
-
* outside clicks, escape key press, anchor element press, and ancestor scroll.
|
|
55
|
-
*
|
|
56
|
-
* @param context - The floating context with open state and change handler.
|
|
57
|
-
* @param options - Configuration options for dismissal behavior.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
61
|
-
* useDismiss(context, {
|
|
62
|
-
* escapeKey: true,
|
|
63
|
-
* outsidePress: (event) => !event.target.closest('.toast'),
|
|
64
|
-
* })
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
export declare function useDismiss(context: FloatingContext, options?: UseDismissProps): void;
|
|
68
|
-
//# sourceMappingURL=use-dismiss.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-dismiss.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-dismiss.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAuD,MAAM,KAAK,CAAA;AAChG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAMtD,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,iBAAiB,CAAA;AAE/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEnC;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAErC;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEvC;;;;OAIG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAA;IAE3E;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAEnE;;;OAGG;IACH,gBAAgB,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,OAAO,CAAA;IAExD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,OAAO,CAAA;CAC1D;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI,CAqIxF"}
|