v-float 0.2.0 → 0.2.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 +5 -30
- package/dist/composables/interactions/polygon.d.ts +28 -0
- package/dist/composables/interactions/polygon.d.ts.map +1 -0
- package/dist/composables/interactions/use-hover.d.ts +11 -15
- package/dist/composables/interactions/use-hover.d.ts.map +1 -1
- package/dist/composables/use-floating.d.ts +7 -22
- package/dist/composables/use-floating.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 +1226 -997
- package/dist/v-float.umd.js +1 -1
- package/package.json +9 -3
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(x,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(x=typeof globalThis<"u"?globalThis:x||self,f(x.VFloat={},x.Vue))})(this,function(x,f){"use strict";var jn=Object.defineProperty;var Ct=x=>{throw TypeError(x)};var _n=(x,f,V)=>f in x?jn(x,f,{enumerable:!0,configurable:!0,writable:!0,value:V}):x[f]=V;var oe=(x,f,V)=>_n(x,typeof f!="symbol"?f+"":f,V),Ye=(x,f,V)=>f.has(x)||Ct("Cannot "+V);var Xe=(x,f,V)=>(Ye(x,f,"read from private field"),V?V.call(x):f.get(x)),Oe=(x,f,V)=>f.has(x)?Ct("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(x):f.set(x,V),je=(x,f,V,J)=>(Ye(x,f,"write to private field"),J?J.call(x,V):f.set(x,V),V),_e=(x,f,V)=>(Ye(x,f,"access private method"),V);var de,he,pe,Ke;const V=["top","right","bottom","left"],J=Math.min,Z=Math.max,ve=Math.round,we=Math.floor,K=e=>({x:e,y:e}),Mt={left:"right",right:"left",bottom:"top",top:"bottom"},At={start:"end",end:"start"};function Ce(e,t,n){return Z(e,J(t,n))}function ie(e,t){return typeof e=="function"?e(t):e}function z(e){return e.split("-")[0]}function ue(e){return e.split("-")[1]}function qe(e){return e==="x"?"y":"x"}function Me(e){return e==="y"?"height":"width"}function se(e){return["top","bottom"].includes(z(e))?"y":"x"}function Ae(e){return qe(se(e))}function Dt(e,t,n){n===void 0&&(n=!1);const o=ue(e),i=Ae(e),r=Me(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=ye(s)),[s,ye(s)]}function St(e){const t=ye(e);return[De(e),t,De(t)]}function De(e){return e.replace(/start|end/g,t=>At[t])}function Rt(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:s;default:return[]}}function Vt(e,t,n,o){const i=ue(e);let r=Rt(z(e),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),t&&(r=r.concat(r.map(De)))),r}function ye(e){return e.replace(/left|right|bottom|top/g,t=>Mt[t])}function Nt(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ue(e){return typeof e!="number"?Nt(e):{top:e,right:e,bottom:e,left:e}}function be(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 Ge(e,t,n){let{reference:o,floating:i}=e;const r=se(t),s=Ae(t),c=Me(s),d=z(t),a=r==="y",p=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,v=o[c]/2-i[c]/2;let u;switch(d){case"top":u={x:p,y:o.y-i.height};break;case"bottom":u={x:p,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:h};break;case"left":u={x:o.x-i.width,y:h};break;default:u={x:o.x,y:o.y}}switch(ue(t)){case"start":u[s]-=v*(n&&a?-1:1);break;case"end":u[s]+=v*(n&&a?-1:1);break}return u}const kt=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:h}=Ge(a,o,d),v=o,u={},w=0;for(let m=0;m<c.length;m++){const{name:g,fn:b}=c[m],{x:L,y:P,data:y,reset:O}=await b({x:p,y:h,initialPlacement:o,placement:v,strategy:i,middlewareData:u,rects:a,platform:s,elements:{reference:e,floating:t}});p=L??p,h=P??h,u={...u,[g]:{...u[g],...y}},O&&w<=50&&(w++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(a=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:p,y:h}=Ge(a,v,d)),m=-1)}return{x:p,y:h,placement:v,strategy:i,middlewareData:u}};async function Ee(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:d}=e,{boundary:a="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=ie(t,e),w=Ue(u),g=c[v?h==="floating"?"reference":"floating":h],b=be(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:p,strategy:d})),L=h==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),y=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},O=be(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:L,offsetParent:P,strategy:d}):L);return{top:(b.top-O.top+w.top)/y.y,bottom:(O.bottom-b.bottom+w.bottom)/y.y,left:(b.left-O.left+w.left)/y.x,right:(O.right-b.right+w.right)/y.x}}const Ft=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:d}=t,{element:a,padding:p=0}=ie(e,t)||{};if(a==null)return{};const h=Ue(p),v={x:n,y:o},u=Ae(i),w=Me(u),m=await s.getDimensions(a),g=u==="y",b=g?"top":"left",L=g?"bottom":"right",P=g?"clientHeight":"clientWidth",y=r.reference[w]+r.reference[u]-v[u]-r.floating[w],O=v[u]-r.reference[u],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let A=C?C[P]:0;(!A||!await(s.isElement==null?void 0:s.isElement(C)))&&(A=c.floating[P]||r.floating[w]);const F=y/2-O/2,E=A/2-m[w]/2-1,l=J(h[b],E),k=J(h[L],E),S=l,I=A-m[w]-k,M=A/2-m[w]/2+F,D=Ce(S,M,I),T=!d.arrow&&ue(i)!=null&&M!==D&&r.reference[w]/2-(M<S?l:k)-m[w]/2<0,R=T?M<S?M-S:M-I:0;return{[u]:v[u]+R,data:{[u]:D,centerOffset:M-D-R,...T&&{alignmentOffset:R}},reset:T}}}),Ht=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:d,elements:a}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...g}=ie(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const b=z(i),L=se(c),P=z(c)===c,y=await(d.isRTL==null?void 0:d.isRTL(a.floating)),O=v||(P||!m?[ye(c)]:St(c)),C=w!=="none";!v&&C&&O.push(...Vt(c,m,w,y));const A=[c,...O],F=await Ee(t,g),E=[];let l=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&E.push(F[b]),h){const M=Dt(i,s,y);E.push(F[M[0]],F[M[1]])}if(l=[...l,{placement:i,overflows:E}],!E.every(M=>M<=0)){var k,S;const M=(((k=r.flip)==null?void 0:k.index)||0)+1,D=A[M];if(D)return{data:{index:M,overflows:l},reset:{placement:D}};let T=(S=l.filter(R=>R.overflows[0]<=0).sort((R,H)=>R.overflows[1]-H.overflows[1])[0])==null?void 0:S.placement;if(!T)switch(u){case"bestFit":{var I;const R=(I=l.filter(H=>{if(C){const W=se(H.placement);return W===L||W==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(W=>W>0).reduce((W,G)=>W+G,0)]).sort((H,W)=>H[1]-W[1])[0])==null?void 0:I[0];R&&(T=R);break}case"initialPlacement":T=c;break}if(i!==T)return{reset:{placement:T}}}return{}}}};function Je(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qe(e){return V.some(t=>e[t]>=0)}const Wt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ie(e,t);switch(o){case"referenceHidden":{const r=await Ee(t,{...i,elementContext:"reference"}),s=Je(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Qe(s)}}}case"escaped":{const r=await Ee(t,{...i,altBoundary:!0}),s=Je(r,n.floating);return{data:{escapedOffsets:s,escaped:Qe(s)}}}default:return{}}}}};async function $t(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=z(n),c=ue(n),d=se(n)==="y",a=["left","top"].includes(s)?-1:1,p=r&&d?-1:1,h=ie(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(u=c==="end"?w*-1:w),d?{x:u*p,y:v*a}:{x:v*a,y:u*p}}const It=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=t,d=await $t(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:s}}}}},Yt=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:s=!1,limiter:c={fn:g=>{let{x:b,y:L}=g;return{x:b,y:L}}},...d}=ie(e,t),a={x:n,y:o},p=await Ee(t,d),h=se(z(i)),v=qe(h);let u=a[v],w=a[h];if(r){const g=v==="y"?"top":"left",b=v==="y"?"bottom":"right",L=u+p[g],P=u-p[b];u=Ce(L,u,P)}if(s){const g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",L=w+p[g],P=w-p[b];w=Ce(L,w,P)}const m=c.fn({...t,[v]:u,[h]:w});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[v]:r,[h]:s}}}}}};function Te(){return typeof window<"u"}function re(e){return Ze(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){var t;return(t=(Ze(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ze(e){return Te()?e instanceof Node||e instanceof Y(e).Node:!1}function X(e){return Te()?e instanceof Element||e instanceof Y(e).Element:!1}function U(e){return Te()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function ze(e){return!Te()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=j(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Xt(e){return["table","td","th"].includes(re(e))}function Pe(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Se(e){const t=Re(),n=X(e)?j(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 jt(e){let t=Q(e);for(;U(t)&&!le(t);){if(Se(t))return t;if(Pe(t))return null;t=Q(t)}return null}function Re(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function le(e){return["html","body","#document"].includes(re(e))}function j(e){return Y(e).getComputedStyle(e)}function Le(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if(re(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ze(e)&&e.host||q(e);return ze(t)?t.host:t}function Be(e){const t=Q(e);return le(t)?e.ownerDocument?e.ownerDocument.body:e.body:U(t)&&fe(t)?t:Be(t)}function B(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Be(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),s=Y(i);if(r){const c=Ve(s);return t.concat(s,s.visualViewport||[],fe(i)?i:[],c&&n?B(c):[])}return t.concat(i,B(i,[],n))}function Ve(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function et(e){const t=j(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=U(e),r=i?e.offsetWidth:n,s=i?e.offsetHeight:o,c=ve(n)!==r||ve(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Ne(e){return X(e)?e:e.contextElement}function ae(e){const t=Ne(e);if(!U(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=et(t);let s=(r?ve(n.width):n.width)/o,c=(r?ve(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const _t=K(0);function tt(e){const t=Y(e);return!Re()||!t.visualViewport?_t:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Y(e)?!1:t}function ee(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=Ne(e);let s=K(1);t&&(o?X(o)&&(s=ae(o)):s=ae(e));const c=Kt(r,n,o)?tt(r):K(0);let d=(i.left+c.x)/s.x,a=(i.top+c.y)/s.y,p=i.width/s.x,h=i.height/s.y;if(r){const v=Y(r),u=o&&X(o)?Y(o):o;let w=v,m=Ve(w);for(;m&&o&&u!==w;){const g=ae(m),b=m.getBoundingClientRect(),L=j(m),P=b.left+(m.clientLeft+parseFloat(L.paddingLeft))*g.x,y=b.top+(m.clientTop+parseFloat(L.paddingTop))*g.y;d*=g.x,a*=g.y,p*=g.x,h*=g.y,d+=P,a+=y,w=Y(m),m=Ve(w)}}return be({width:p,height:h,x:d,y:a})}function ke(e,t){const n=Le(e).scrollLeft;return t?t.left+n:ee(q(e)).left+n}function nt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:ke(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function qt(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",s=q(o),c=t?Pe(t.floating):!1;if(o===s||c&&r)return n;let d={scrollLeft:0,scrollTop:0},a=K(1);const p=K(0),h=U(o);if((h||!h&&!r)&&((re(o)!=="body"||fe(s))&&(d=Le(o)),U(o))){const u=ee(o);a=ae(o),p.x=u.x+o.clientLeft,p.y=u.y+o.clientTop}const v=s&&!h&&!r?nt(s,d,!0):K(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-d.scrollLeft*a.x+p.x+v.x,y:n.y*a.y-d.scrollTop*a.y+p.y+v.y}}function Ut(e){return Array.from(e.getClientRects())}function Gt(e){const t=q(e),n=Le(e),o=e.ownerDocument.body,i=Z(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Z(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ke(e);const c=-n.scrollTop;return j(o).direction==="rtl"&&(s+=Z(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function Jt(e,t){const n=Y(e),o=q(e),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,d=0;if(i){r=i.width,s=i.height;const a=Re();(!a||a&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}return{width:r,height:s,x:c,y:d}}function Qt(e,t){const n=ee(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=U(e)?ae(e):K(1),s=e.clientWidth*r.x,c=e.clientHeight*r.y,d=i*r.x,a=o*r.y;return{width:s,height:c,x:d,y:a}}function ot(e,t,n){let o;if(t==="viewport")o=Jt(e,n);else if(t==="document")o=Gt(q(e));else if(X(t))o=Qt(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 be(o)}function it(e,t){const n=Q(e);return n===t||!X(n)||le(n)?!1:j(n).position==="fixed"||it(n,t)}function Zt(e,t){const n=t.get(e);if(n)return n;let o=B(e,[],!1).filter(c=>X(c)&&re(c)!=="body"),i=null;const r=j(e).position==="fixed";let s=r?Q(e):e;for(;X(s)&&!le(s);){const c=j(s),d=Se(s);!d&&c.position==="fixed"&&(i=null),(r?!d&&!i:!d&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||fe(s)&&!d&&it(e,s))?o=o.filter(p=>p!==s):i=c,s=Q(s)}return t.set(e,o),o}function zt(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[...n==="clippingAncestors"?Pe(t)?[]:Zt(t,this._c):[].concat(n),o],c=s[0],d=s.reduce((a,p)=>{const h=ot(t,p,i);return a.top=Z(h.top,a.top),a.right=J(h.right,a.right),a.bottom=J(h.bottom,a.bottom),a.left=Z(h.left,a.left),a},ot(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Bt(e){const{width:t,height:n}=et(e);return{width:t,height:n}}function en(e,t,n){const o=U(t),i=q(t),r=n==="fixed",s=ee(e,!0,r,t);let c={scrollLeft:0,scrollTop:0};const d=K(0);if(o||!o&&!r)if((re(t)!=="body"||fe(i))&&(c=Le(t)),o){const v=ee(t,!0,r,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else i&&(d.x=ke(i));const a=i&&!o&&!r?nt(i,c):K(0),p=s.left+c.scrollLeft-d.x-a.x,h=s.top+c.scrollTop-d.y-a.y;return{x:p,y:h,width:s.width,height:s.height}}function Fe(e){return j(e).position==="static"}function st(e,t){if(!U(e)||j(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function rt(e,t){const n=Y(e);if(Pe(e))return n;if(!U(e)){let i=Q(e);for(;i&&!le(i);){if(X(i)&&!Fe(i))return i;i=Q(i)}return n}let o=st(e,t);for(;o&&Xt(o)&&Fe(o);)o=st(o,t);return o&&le(o)&&Fe(o)&&!Se(o)?n:o||jt(e)||n}const tn=async function(e){const t=this.getOffsetParent||rt,n=this.getDimensions,o=await n(e.floating);return{reference:en(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function nn(e){return j(e).direction==="rtl"}const on={convertOffsetParentRelativeRectToViewportRelativeRect:qt,getDocumentElement:q,getClippingRect:zt,getOffsetParent:rt,getElementRects:tn,getClientRects:Ut,getDimensions:Bt,getScale:ae,isElement:X,isRTL:nn};function lt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sn(e,t){let n=null,o;const i=q(e);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),r();const a=e.getBoundingClientRect(),{left:p,top:h,width:v,height:u}=a;if(c||t(),!v||!u)return;const w=we(h),m=we(i.clientWidth-(p+v)),g=we(i.clientHeight-(h+u)),b=we(p),P={rootMargin:-w+"px "+-m+"px "+-g+"px "+-b+"px",threshold:Z(0,J(1,d))||1};let y=!0;function O(C){const A=C[0].intersectionRatio;if(A!==d){if(!y)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!lt(a,e.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(O,{...P,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,P)}n.observe(e)}return s(!0),r}function rn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,a=Ne(e),p=i||r?[...a?B(a):[],...B(t)]:[];p.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),r&&b.addEventListener("resize",n)});const h=a&&c?sn(a,n):null;let v=-1,u=null;s&&(u=new ResizeObserver(b=>{let[L]=b;L&&L.target===a&&u&&(u.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(t)})),n()}),a&&!d&&u.observe(a),u.observe(t));let w,m=d?ee(e):null;d&&g();function g(){const b=ee(e);m&&!lt(m,b)&&n(),m=b,w=requestAnimationFrame(g)}return n(),()=>{var b;p.forEach(L=>{i&&L.removeEventListener("scroll",n),r&&L.removeEventListener("resize",n)}),h==null||h(),(b=u)==null||b.disconnect(),u=null,d&&cancelAnimationFrame(w)}}const ln=It,an=Yt,cn=Ht,un=Wt,fn=Ft,dn=(e,t,n)=>{const o=new Map,i={platform:on,...n},r={...i.platform,_c:o};return kt(e,t,{...i,platform:r})};function hn(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:r=!0,open:s=f.ref(!1)}=n,c=P=>{s.value=P},d=f.computed(()=>f.toValue(n.placement)??"bottom"),a=f.computed(()=>f.toValue(n.strategy)??"absolute"),p=f.ref(0),h=f.ref(0),v=f.ref(d.value),u=f.ref(a.value),w=f.shallowRef({}),m=f.ref(!1),g=async()=>{if(!e.value||!t.value)return;const P=await dn(e.value,t.value,{placement:d.value,strategy:a.value,middleware:i});p.value=P.x,h.value=P.y,v.value=P.placement,u.value=P.strategy,w.value=P.middlewareData,m.value=s.value};f.watch([d,a],()=>{s.value&&g()});let b;f.watch([e,t,s],([P,y,O])=>{!O||!P||!y||(r&&(b=rn(P,y,g,typeof r=="object"?r:void 0)),f.onWatcherCleanup(()=>{b==null||b(),b=void 0}))},{immediate:!0}),f.onScopeDispose(()=>b==null?void 0:b()),f.watch(s,P=>{P||(m.value=!1)});const L=f.ref({position:a.value,left:"0",top:"0"});return f.watch([p,h,()=>f.toValue(o)],([P,y,O])=>{const C=t.value;if(!C)return;const A={position:u.value,left:"0",top:"0"},F=at(C,P),E=at(C,y);O?L.value={...A,transform:`translate(${F}px, ${E}px)`,...ct(C)>=1.5&&{"will-change":"transform"}}:L.value={...A,left:`${F}px`,top:`${E}px`}},{immediate:!0}),{x:p,y:h,strategy:u,placement:v,middlewareData:w,isPositioned:m,floatingStyles:L,update:g,refs:{anchorEl:e,floatingEl:t},open:s,setOpen:c}}function at(e,t){const n=ct(e);return Math.round(t*n)/n}function ct(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pn(e,t={}){const{middlewareData:n,placement:o}=e,{offset:i="-4px"}=t,r=f.computed(()=>{var d;return((d=n.value.arrow)==null?void 0:d.x)??0}),s=f.computed(()=>{var d;return((d=n.value.arrow)==null?void 0:d.y)??0}),c=f.computed(()=>{const d=f.toValue(o).split("-")[0],a=r.value,p=s.value;return d==="bottom"?{"inset-inline-start":`${a}px`,"inset-block-start":i}:d==="top"?{"inset-inline-start":`${a}px`,"inset-block-end":i}:d==="right"?{"inset-block-start":`${p}px`,"inset-inline-start":i}:d==="left"?{"inset-block-start":`${p}px`,"inset-inline-end":i}:{}});return{arrowX:r,arrowY:s,arrowStyles:c}}let mn=0;function gn(){return`vfloat-id-${mn++}`}function ut(e){return typeof e=="object"&&e instanceof HTMLElement}function He(e,t){return e.contains(t)}function vn(e){return e.target}function ft(e,t){const[n,o]=e;let i=!1;const r=t.length;for(let s=0,c=r-1;s<r;c=s++){const[d,a]=t[s]||[0,0],[p,h]=t[c]||[0,0];a>=o!=h>=o&&n<=(p-d)*(o-a)/(h-a)+d&&(i=!i)}return i}function wn(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function yn(e={}){const{requireIntent:t=!0}=e;let n,o=!1,i=null,r=null,s=performance.now();function c(d,a){const p=performance.now(),h=p-s;if(i===null||r===null||h===0)return i=d,r=a,s=p,null;const v=d-i,u=a-r,m=Math.sqrt(v*v+u*u)/h;return i=d,r=a,s=p,m}return function({x:a,y:p,placement:h,elements:v,buffer:u,onClose:w}){const m=f.computed(()=>{const g=v.domReference;return ut(g)?g:(g==null?void 0:g.contextElement)??null});return function(b){var ge,Et,Tt,Pt,Lt,xt,Ot;function L(){clearTimeout(n),w()}if(clearTimeout(n),!v.domReference||!v.floating||h==null||a==null||p==null)return;const{clientX:P,clientY:y}=b,O=vn(b),C=b.type==="mouseleave",A=v.floating&&He(v.floating,O),F=m.value&&He(m.value,O),E=(ge=m.value)==null?void 0:ge.getBoundingClientRect(),l=(Et=v.floating)==null?void 0:Et.getBoundingClientRect(),k=h.split("-")[0],S=a>((l==null?void 0:l.right)??0)-((l==null?void 0:l.width)??0)/2,I=p>((l==null?void 0:l.bottom)??0)-((l==null?void 0:l.height)??0)/2,M=((l==null?void 0:l.width)??0)>((E==null?void 0:E.width)??0),D=((l==null?void 0:l.height)??0)>((E==null?void 0:E.height)??0),T=((Tt=M?E:l)==null?void 0:Tt.left)??0,R=((Pt=M?E:l)==null?void 0:Pt.right)??0,H=((Lt=D?E:l)==null?void 0:Lt.top)??0,W=((xt=D?E:l)==null?void 0:xt.bottom)??0;if(A&&(o=!0,!C))return;if(F&&(o=!1),F&&!C){o=!0;return}if(C&&ut(b.relatedTarget)&&v.floating&&He(v.floating,b.relatedTarget))return;if(k==="top"&&p>=((E==null?void 0:E.bottom)??0)-1||k==="bottom"&&p<=((E==null?void 0:E.top)??0)+1||k==="left"&&a>=((E==null?void 0:E.right)??0)-1||k==="right"&&a<=((E==null?void 0:E.left)??0)+1)return L();let G=[];switch(k){case"top":G=[[T,((E==null?void 0:E.top)??0)+1],[T,((l==null?void 0:l.bottom)??0)-1],[R,((l==null?void 0:l.bottom)??0)-1],[R,((E==null?void 0:E.top)??0)+1]];break;case"bottom":G=[[T,((l==null?void 0:l.top)??0)+1],[T,((E==null?void 0:E.bottom)??0)-1],[R,((E==null?void 0:E.bottom)??0)-1],[R,((l==null?void 0:l.top)??0)+1]];break;case"left":G=[[((l==null?void 0:l.right)??0)-1,W],[((l==null?void 0:l.right)??0)-1,H],[((E==null?void 0:E.left)??0)+1,H],[((E==null?void 0:E.left)??0)+1,W]];break;case"right":G=[[((E==null?void 0:E.right)??0)-1,W],[((E==null?void 0:E.right)??0)-1,H],[((l==null?void 0:l.left)??0)+1,H],[((l==null?void 0:l.left)??0)+1,W]];break}function xe([N,$]){switch(k){case"top":{const te=[M?N+u/2:S?N+u*4:N-u*4,$+u+1],ne=[M?N-u/2:S?N+u*4:N-u*4,$+u+1],ce=[[(l==null?void 0:l.left)??0,S||M?((l==null?void 0:l.bottom)??0)-u:(l==null?void 0:l.top)??0],[(l==null?void 0:l.right)??0,S?M?((l==null?void 0:l.bottom)??0)-u:(l==null?void 0:l.top)??0:((l==null?void 0:l.bottom)??0)-u]];return[te,ne,...ce]}case"bottom":{const te=[M?N+u/2:S?N+u*4:N-u*4,$-u],ne=[M?N-u/2:S?N+u*4:N-u*4,$-u],ce=[[(l==null?void 0:l.left)??0,S||M?((l==null?void 0:l.top)??0)+u:(l==null?void 0:l.bottom)??0],[(l==null?void 0:l.right)??0,S?M?((l==null?void 0:l.top)??0)+u:(l==null?void 0:l.bottom)??0:((l==null?void 0:l.top)??0)+u]];return[te,ne,...ce]}case"left":{const te=[N+u+1,D?$+u/2:I?$+u*4:$-u*4],ne=[N+u+1,D?$-u/2:I?$+u*4:$-u*4];return[...[[I||D?((l==null?void 0:l.right)??0)-u:(l==null?void 0:l.left)??0,(l==null?void 0:l.top)??0],[I?D?((l==null?void 0:l.right)??0)-u:(l==null?void 0:l.left)??0:((l==null?void 0:l.right)??0)-u,(l==null?void 0:l.bottom)??0]],te,ne]}case"right":{const te=[N-u,D?$+u/2:I?$+u*4:$-u*4],ne=[N-u,D?$-u/2:I?$+u*4:$-u*4],ce=[[I||D?((l==null?void 0:l.left)??0)+u:(l==null?void 0:l.right)??0,(l==null?void 0:l.top)??0],[I?D?((l==null?void 0:l.left)??0)+u:(l==null?void 0:l.right)??0:((l==null?void 0:l.left)??0)+u,(l==null?void 0:l.bottom)??0]];return[te,ne,...ce]}}}if(ft([P,y],G))return;if(o&&E&&!wn([P,y],E))return L();if(!C&&t){const N=c(b.clientX,b.clientY);if(N!==null&&N<.1)return L()}const me=xe([a,p]);(Ot=e.onPolygonChange)==null||Ot.call(e,me),ft([P,y],me)?!o&&t&&(n=window.setTimeout(L,40)):L()}}}const dt=10;function bn(e){return e==="mouse"||e==="pen"}function En(e,t,n){const{delay:o}=n,i=f.computed(()=>{const a=f.toValue(o);return(typeof a=="number"?a:a.open)??0}),r=f.computed(()=>{const a=f.toValue(o);return(typeof a=="number"?a:a.close)??0});let s,c;const d=()=>{clearTimeout(s),clearTimeout(c)};return f.onScopeDispose(d),{show:a=>{d();const p=a??i.value;p===0?e():s=setTimeout(e,p)},hide:a=>{d();const p=a??r.value;p===0?t():c=setTimeout(t,p)},showDelay:i,hideDelay:r,clearTimeouts:d}}function Tn(e,t={}){const{open:n,setOpen:o,refs:{anchorEl:i,floatingEl:r}}=e,{enabled:s=!0,delay:c=0,restMs:d=0,mouseOnly:a=!1,safePolygon:p=!1}=t,h=f.computed(()=>f.toValue(s)),v=f.computed(()=>f.toValue(d)),u=f.computed(()=>{const T=i.value;return!T||T instanceof HTMLElement?T:T.contextElement??null}),{hide:w,show:m,showDelay:g,clearTimeouts:b}=En(()=>{n.value||o(!0)},()=>{n.value&&o(!1)},{delay:c});let L=null,P;const y=f.computed(()=>g.value===0&&v.value>0);function O(T){if(!h.value||!F(T)||!y.value||!L)return;const R={x:T.clientX,y:T.clientY},H=Math.abs(R.x-L.x),W=Math.abs(R.y-L.y);(H>dt||W>dt)&&(L=R,clearTimeout(P),P=setTimeout(()=>{m(0)},v.value))}function C(T){!h.value||!F(T)||!y.value||(L={x:T.clientX,y:T.clientY},P=setTimeout(()=>{m(0)},v.value))}function A(){clearTimeout(P),L=null}f.watchPostEffect(()=>{const T=u.value;!T||!h.value||!y.value||(T.addEventListener("pointerenter",C),T.addEventListener("pointermove",O),T.addEventListener("pointerleave",A),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",C),T.removeEventListener("pointermove",O),T.removeEventListener("pointerleave",A)}))}),f.onScopeDispose(()=>{clearTimeout(P)});function F(T){return!(f.toValue(a)&&!bn(T.pointerType))}function E(T){!h.value||!F(T)||y.value||m()}function l(T){!h.value||!F(T)||(b(),S())}let k=null;function S(){k&&(document.removeEventListener("pointermove",k),k=null)}const I=f.computed(()=>!!f.toValue(p)),M=f.computed(()=>{const T=f.toValue(p);if(typeof T=="object"&&T)return T;if(T===!0)return{}});function D(T){var G;if(!h.value||!F(T))return;const{clientX:R,clientY:H}=T,W=T.relatedTarget;I.value?setTimeout(()=>{var ge;S();const xe=u.value,me=r.value;if(!xe||!me){w();return}k=yn(M.value)({x:R,y:H,placement:e.placement.value,elements:{domReference:xe,floating:me},buffer:((ge=M.value)==null?void 0:ge.buffer)??1,onClose:()=>{S(),w()}}),document.addEventListener("pointermove",k)},0):(G=r.value)!=null&&G.contains(W)||w()}f.watchPostEffect(()=>{const T=u.value;!T||!h.value||(T.addEventListener("pointerenter",E),T.addEventListener("pointerleave",D),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",E),T.removeEventListener("pointerleave",D)}))}),f.watchPostEffect(()=>{const T=r.value;!T||!h.value||(T.addEventListener("pointerenter",l),T.addEventListener("pointerleave",D),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",l),T.removeEventListener("pointerleave",D)}))}),f.onScopeDispose(()=>{S()})}function Pn(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}const Ln=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const xn=Object.prototype.toString,On=e=>xn.call(e)==="[object Object]";function We(e){return Array.isArray(e)?e:[e]}function Cn(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Mn=Ln?window:void 0;function An(e){var t;const n=f.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function _(...e){const t=[],n=()=>{t.forEach(c=>c()),t.length=0},o=(c,d,a,p)=>(c.addEventListener(d,a,p),()=>c.removeEventListener(d,a,p)),i=f.computed(()=>{const c=We(f.toValue(e[0])).filter(d=>d!=null);return c.every(d=>typeof d!="string")?c:void 0}),r=Cn(()=>{var c,d;return[(d=(c=i.value)==null?void 0:c.map(a=>An(a)))!=null?d:[Mn].filter(a=>a!=null),We(f.toValue(i.value?e[1]:e[0])),We(f.unref(i.value?e[2]:e[1])),f.toValue(i.value?e[3]:e[2])]},([c,d,a,p])=>{if(n(),!(c!=null&&c.length)||!(d!=null&&d.length)||!(a!=null&&a.length))return;const h=On(p)?{...p}:p;t.push(...c.flatMap(v=>d.flatMap(u=>a.map(w=>o(v,u,w,h)))))},{flush:"post"}),s=()=>{r(),n()};return Pn(n),s}function Dn(e,t={}){const{open:n,setOpen:o,refs:{floatingEl:i,anchorEl:r}}=e,{enabled:s=!0,requireFocusVisible:c=!0}=t,d=f.computed(()=>r.value?r.value instanceof HTMLElement?r.value:r.value.contextElement:null);let a=!1,p=!0,h;_(window,"blur",()=>{!n.value&&d.value&&d.value===document.activeElement&&(a=!0)}),_(window,"focus",()=>{a=!1}),f.onMounted(()=>{ht()&&pt()&&(_(window,"keydown",()=>{p=!0},{capture:!0}),_(window,"pointerdown",()=>{p=!1},{capture:!0}))});function v(w){if(a){a=!1;return}const m=w.target;if(f.toValue(c)&&m){if(ht()&&pt()&&!w.relatedTarget){if(!p&&!Sn(m))return}else if(!Rn(m))return}o(!0)}function u(w){clearTimeout(h),h=window.setTimeout(()=>{var b;const g=(((b=d.value)==null?void 0:b.ownerDocument)??document).activeElement;!w.relatedTarget&&g===d.value||i.value&&g&&i.value.contains(g)||o(!1)},0)}f.watchPostEffect(()=>{if(!f.toValue(s))return;const w=d.value;!w||!(w instanceof HTMLElement)||(w.addEventListener("focus",v),w.addEventListener("blur",u),f.onWatcherCleanup(()=>{w.removeEventListener("focus",v),w.removeEventListener("blur",u)}))}),f.onScopeDispose(()=>{clearTimeout(h)})}function ht(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function pt(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Sn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}function Rn(e){return e.matches(":focus-visible")}function Vn(e,t={}){const{open:n,setOpen:o,refs:i}=e,{enabled:r=!0,event:s="click",toggle:c=!0,ignoreMouse:d=!1,keyboardHandlers:a=!0}=t;let p,h=!1;const v=f.computed(()=>f.toValue(r)),u=f.computed(()=>i.anchorEl.value instanceof HTMLElement?i.anchorEl.value:null);function w(){n.value?f.toValue(c)&&o(!1):o(!0)}function m(y){p=y.pointerType}function g(y){if(y.button!==0||f.toValue(s)==="click"||mt(p)&&f.toValue(d))return;const O=y.target;!n.value&&O===u.value&&y.preventDefault(),w()}function b(){if(f.toValue(s)==="mousedown"&&p){p=void 0;return}if(mt(p)&&f.toValue(d)){p=void 0;return}w(),p=void 0}function L(y){if(p=void 0,y.defaultPrevented||!f.toValue(a)||gt(y))return;const O=u.value;O&&(y.key===" "&&!vt(O)&&(y.preventDefault(),h=!0),y.key==="Enter"&&w())}function P(y){const O=u.value;O&&(y.defaultPrevented||!f.toValue(a)||gt(y)||vt(O)||y.key===" "&&h&&(h=!1,w()))}f.watchPostEffect(()=>{const y=u.value;!v.value||!y||(y.addEventListener("pointerdown",m),y.addEventListener("mousedown",g),y.addEventListener("click",b),y.addEventListener("keydown",L),y.addEventListener("keyup",P),f.onWatcherCleanup(()=>{y.removeEventListener("pointerdown",m),y.removeEventListener("mousedown",g),y.removeEventListener("click",b),y.removeEventListener("keydown",L),y.removeEventListener("keyup",P)}))})}function mt(e,t){return e===void 0?!1:e==="mouse"}function gt(e){return e.target instanceof HTMLElement&&e.target.tagName==="BUTTON"}function Nn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function vt(e){return Nn(e)}function kn(e,t={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:i=!0,outsidePressEvent:r="pointerdown",anchorPress:s=!1,anchorPressEvent:c="pointerdown",ancestorScroll:d=!1,capture:a}=t,p=f.computed(()=>f.toValue(n)),h=e.refs.floatingEl,v=f.computed(()=>{const y=e.refs.anchorEl.value;return y?y instanceof HTMLElement?y:y.contextElement instanceof HTMLElement?y.contextElement:null:null}),{isComposing:u}=Wn(),{escapeKey:w,outsidePress:m}=Fn(a);let g=!1;const b=y=>{!p.value||!e.open.value||!f.toValue(o)||y.key!=="Escape"||u()||e.setOpen(!1)},L=y=>{if(!p.value||!e.open.value)return;if(r==="click"&&g){g=!1;return}const O=f.toValue(i);if(!O||typeof O=="function"&&!O(y))return;const C=y.target;C&&($e(C)&&h.value&&Hn(y,C)||wt(y,v.value)||wt(y,h.value)||e.setOpen(!1))},P=()=>{p.value&&e.open.value&&f.toValue(s)&&e.setOpen(!1)};f.watchEffect(y=>{if(!p.value||!e.open.value||!f.toValue(d))return;const O=()=>{e.open.value&&e.setOpen(!1)},C=[];v.value&&C.push(...B(v.value).filter($e)),h.value&&C.push(...B(h.value).filter($e));for(const A of C)A.addEventListener("scroll",O,{passive:!0});y(()=>{for(const A of C)A.removeEventListener("scroll",O)})}),_(document,"keydown",b,f.toValue(w)),_(document,r,L,f.toValue(m)),_(v,c,P),_(h,"mousedown",()=>{g=!0},{capture:!0}),_(h,"mouseup",()=>{g=!0},{capture:!0})}function Fn(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 $e(e){return e instanceof Element&&e instanceof HTMLElement}function wt(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function Hn(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 Wn(){const e=f.ref(!1);return _(document,"compositionstart",()=>{e.value=!0}),_(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function $n(e,t,n={}){const{open:o,refs:i}=t;let r;const s=f.ref({x:null,y:null}),c=f.computed(()=>f.toValue(n.axis??"both")),d=f.computed(()=>f.toValue(n.enabled??!0)),a=f.computed(()=>f.toValue(n.x??null)),p=f.computed(()=>f.toValue(n.y??null)),h=(m,g)=>{s.value={x:m,y:g},o.value&&(i.anchorEl.value=In(e.value,c.value,s.value))};f.watchEffect(()=>{const m=a.value,g=p.value;d.value&&m!=null&&g!=null&&h(m,g)});const v=m=>{r=m.pointerType,h(m.clientX,m.clientY)},u=m=>{r=m.pointerType,!o.value&&yt(r,!0)&&h(m.clientX,m.clientY)},w=m=>{o.value&&yt(r,!0)&&h(m.clientX,m.clientY)};return f.watchEffect(()=>{if(a.value!=null||p.value!=null)return;const m=e.value;!m||!d.value||(m.addEventListener("pointerenter",u),m.addEventListener("pointerdown",v),m.addEventListener("pointermove",w),f.onWatcherCleanup(()=>{m==null||m.removeEventListener("pointerenter",u),m==null||m.removeEventListener("pointerdown",v),m==null||m.removeEventListener("pointermove",w)}))}),{coordinates:f.readonly(s),updatePosition:h}}function In(e,t,n){let o=null,i=null;const r=e;return{contextElement:r||void 0,getBoundingClientRect:()=>{const s=(r==null?void 0:r.getBoundingClientRect())??{width:0,height:0,x:0,y:0},c=t==="x"||t==="both",d=t==="y"||t==="both";let a=0,p=0,h=s.x,v=s.y;return r&&(o==null&&n.x!=null&&c&&(o=s.x-n.x),i==null&&n.y!=null&&d&&(i=s.y-n.y),h-=o||0,v-=i||0),c&&n.x!=null?h=n.x:(o=null,a=s.width),d&&n.y!=null?v=n.y:(i=null,p=s.height),t==="both"&&(a=0,p=0),{width:a,height:p,x:h,y:v,top:v,right:h+a,bottom:v+p,left:h}}}}function yt(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=f.toValue(e.element);return n==null?{}:fn({element:n,padding:e.padding}).fn(t)}}}class Ie{constructor(t,n=null,o={},i=!1){oe(this,"id");oe(this,"data");oe(this,"parent");oe(this,"children");Oe(this,de);this.id=o.id??gn(),this.data=t,this.parent=f.shallowRef(n),this.children=f.shallowRef([]),je(this,de,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 Xe(this,de)}get isLeaf(){return this.children.value.length===0}}de=new WeakMap;class bt{constructor(t,n){Oe(this,pe);oe(this,"root");oe(this,"nodeMap");Oe(this,he);je(this,he,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=f.shallowReactive(new Map),this.root=new Ie(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 Ie(t,i,o);return this.nodeMap.set(r.id,r),i.addChild(r),r}removeNode(t,n){const o=n??Xe(this,he),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")_e(this,pe,Ke).call(this,i);else{for(const s of i.children.value)s.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 s=r.children.value.length-1;s>=0;s--)i.push(r.children.value[s])}}else{const i=[n];for(;i.length>0;){const r=i.shift();o.push(r);for(const s of r.children.value)i.push(s)}}return o}dispose(){this.nodeMap.clear()}}he=new WeakMap,pe=new WeakSet,Ke=function(t){const n=[...t.children.value];for(const o of n)_e(this,pe,Ke).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function Xn(e,t={}){const n=new bt(e,t);return{get nodeMap(){return n.nodeMap},get root(){return n.root},findNodeById:s=>n.findNodeById(s),moveNode:(s,c)=>n.moveNode(s,c),dispose:()=>n.dispose(),addNode:(s,c)=>n.addNode(s,c),removeNode:(s,c)=>n.removeNode(s,c),traverse:(s,c)=>n.traverse(s,c),isTopmost:s=>{const c=n.findNodeById(s);if(!c||!c.data.open.value)return!1;let d=c.parent.value;for(;d;){if(d.data.open.value)return!1;d=d.parent.value}return!0},getAllOpenNodes:()=>{const s=[];for(const c of n.nodeMap.values())c.data.open.value&&s.push(c);return s},forEach:(s,c,d={})=>{const{relationship:a="self-and-children",applyToMatching:p=!0}=d,h=n.findNodeById(s);if(!h)return;const v=[],u=new Set,w=g=>{g&&!u.has(g.id)&&(v.push(g),u.add(g.id))},m=g=>{for(const b of g)w(b)};if(a==="ancestors-only")for(const g of h.getPath())g.id!==h.id&&w(g);else if(a==="siblings-only"){if(h.parent.value)for(const g of h.parent.value.children.value)g.id!==h.id&&w(g)}else if(a==="descendants-only")for(const g of n.traverse("dfs",h))g.id!==h.id&&w(g);else if(a==="children-only")m(h.children.value);else if(a==="self-and-ancestors")m(h.getPath());else if(a==="self-and-children")w(h),m(h.children.value);else if(a==="self-and-descendants")m(n.traverse("dfs",h));else if(a==="self-and-siblings")w(h),h.parent.value&&m(h.parent.value.children.value);else if(a==="self-ancestors-and-children")m(h.getPath()),m(h.children.value);else if(a==="full-branch")m(h.getPath()),m(n.traverse("dfs",h));else if(a==="all-except-branch"){const g=new Set;for(const b of h.getPath())g.add(b.id);for(const b of n.traverse("dfs",h))g.add(b.id);for(const b of n.nodeMap.values())!g.has(b.id)===p&&c(b);return}else{console.warn(`forEach: Unknown relationship "${a}".`);return}if(p)for(const g of v)c(g);else for(const g of n.nodeMap.values())u.has(g.id)||c(g)}}}x.Tree=bt,x.TreeNode=Ie,x.arrow=Yn,x.flip=cn,x.hide=un,x.offset=ln,x.shift=an,x.useArrow=pn,x.useClick=Vn,x.useClientPoint=$n,x.useDismiss=kn,x.useFloating=hn,x.useFloatingTree=Xn,x.useFocus=Dn,x.useHover=Tn,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v-float",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Vue 3 port of Floating UI - a library for positioning floating elements",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -20,10 +20,12 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@floating-ui/dom": "^1.6.13",
|
|
22
22
|
"@vueuse/core": "^13.0.0",
|
|
23
|
+
"vitepress-plugin-demo": "^0.8.0",
|
|
23
24
|
"vue": "^3.5.13"
|
|
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",
|
|
28
30
|
"@testing-library/vue": "^8.1.0",
|
|
29
31
|
"@tsconfig/node22": "^22.0.1",
|
|
@@ -37,6 +39,7 @@
|
|
|
37
39
|
"@vue/test-utils": "^2.4.6",
|
|
38
40
|
"@vue/tsconfig": "^0.7.0",
|
|
39
41
|
"jsdom": "^26.0.0",
|
|
42
|
+
"lucide-vue-next": "^0.513.0",
|
|
40
43
|
"npm-run-all2": "^7.0.2",
|
|
41
44
|
"playwright": "^1.51.1",
|
|
42
45
|
"prettier": "^3.5.3",
|
|
@@ -58,6 +61,9 @@
|
|
|
58
61
|
"build-only": "vite build",
|
|
59
62
|
"type-check": "vue-tsc --build tsconfig.build.json",
|
|
60
63
|
"lint": "biome check --apply --write",
|
|
61
|
-
"test:browser": "vitest --workspace=vitest.workspace.ts"
|
|
64
|
+
"test:browser": "vitest --workspace=vitest.workspace.ts",
|
|
65
|
+
"docs:dev": "vitepress dev docs",
|
|
66
|
+
"docs:build": "vitepress build docs",
|
|
67
|
+
"docs:preview": "vitepress preview docs"
|
|
62
68
|
}
|
|
63
69
|
}
|