v-float 0.5.0 → 0.6.0

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.
Files changed (27) hide show
  1. package/dist/composables/index.d.ts +0 -1
  2. package/dist/composables/index.d.ts.map +1 -1
  3. package/dist/composables/interactions/index.d.ts +1 -1
  4. package/dist/composables/interactions/index.d.ts.map +1 -1
  5. package/dist/composables/interactions/polygon.d.ts +1 -1
  6. package/dist/composables/interactions/polygon.d.ts.map +1 -1
  7. package/dist/composables/interactions/use-click.d.ts +1 -1
  8. package/dist/composables/interactions/use-click.d.ts.map +1 -1
  9. package/dist/composables/interactions/use-client-point.d.ts +180 -20
  10. package/dist/composables/interactions/use-client-point.d.ts.map +1 -1
  11. package/dist/composables/interactions/use-escape-key.d.ts +37 -4
  12. package/dist/composables/interactions/use-escape-key.d.ts.map +1 -1
  13. package/dist/composables/interactions/use-focus.d.ts +1 -1
  14. package/dist/composables/interactions/use-focus.d.ts.map +1 -1
  15. package/dist/composables/interactions/use-hover.d.ts +1 -1
  16. package/dist/composables/interactions/use-hover.d.ts.map +1 -1
  17. package/dist/composables/interactions/utils/tree-context.d.ts +1 -1
  18. package/dist/composables/interactions/utils/tree-context.d.ts.map +1 -1
  19. package/dist/composables/use-floating-tree.d.ts +72 -10
  20. package/dist/composables/use-floating-tree.d.ts.map +1 -1
  21. package/dist/composables/use-floating.d.ts +1 -1
  22. package/dist/composables/use-floating.d.ts.map +1 -1
  23. package/dist/v-float.es.js +1476 -1329
  24. package/dist/v-float.umd.js +1 -1
  25. package/package.json +2 -2
  26. package/dist/composables/use-tree.d.ts +0 -144
  27. package/dist/composables/use-tree.d.ts.map +0 -1
@@ -1 +1 @@
1
- (function(T,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(T=typeof globalThis<"u"?globalThis:T||self,a(T.VFloat={},T.Vue))})(this,(function(T,a){"use strict";var Eo=Object.defineProperty;var Qt=T=>{throw TypeError(T)};var xo=(T,a,I)=>a in T?Eo(T,a,{enumerable:!0,configurable:!0,writable:!0,value:I}):T[a]=I;var fe=(T,a,I)=>xo(T,typeof a!="symbol"?a+"":a,I),at=(T,a,I)=>a.has(T)||Qt("Cannot "+I);var ct=(T,a,I)=>(at(T,a,"read from private field"),I?I.call(T):a.get(T)),$e=(T,a,I)=>a.has(T)?Qt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(T):a.set(T,I),ut=(T,a,I,Pe)=>(at(T,a,"write to private field"),Pe?Pe.call(T,I):a.set(T,I),I),ft=(T,a,I)=>(at(T,a,"access private method"),I);var xe,Te,Ce,dt;function I(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}const Pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Zt=Object.prototype.toString,en=e=>Zt.call(e)==="[object Object]";function Xe(e){return Array.isArray(e)?e:[e]}function tn(e,t,n){return a.watch(e,t,{...n,immediate:!0})}const nn=Pe?window:void 0;function on(e){var t;const n=a.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function G(...e){const t=[],n=()=>{t.forEach(c=>c()),t.length=0},o=(c,f,u,d)=>(c.addEventListener(f,u,d),()=>c.removeEventListener(f,u,d)),i=a.computed(()=>{const c=Xe(a.toValue(e[0])).filter(f=>f!=null);return c.every(f=>typeof f!="string")?c:void 0}),s=tn(()=>{var c,f;return[(f=(c=i.value)==null?void 0:c.map(u=>on(u)))!=null?f:[nn].filter(u=>u!=null),Xe(a.toValue(i.value?e[1]:e[0])),Xe(a.unref(i.value?e[2]:e[1])),a.toValue(i.value?e[3]:e[2])]},([c,f,u,d])=>{if(n(),!(c!=null&&c.length)||!(f!=null&&f.length)||!(u!=null&&u.length))return;const h=en(d)?{...d}:d;t.push(...c.flatMap(g=>f.flatMap(m=>u.map(E=>o(g,m,E,h)))))},{flush:"post"}),r=()=>{s(),n()};return I(n),r}function Ye(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function je(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ht(e){return typeof(e==null?void 0:e.matches)!="function"?!1:e.matches(":focus-visible")}function Le(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function _e(e){return!e||!(e instanceof HTMLElement)?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable&&e.contentEditable!=="false"}function ze(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 Ue(e){return _e(e)}function mt(e){return e instanceof Element&&e instanceof HTMLElement}function pt(e){return typeof e=="object"&&e!==null&&"contextElement"in e}function qe(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function gt(e,t){const n=t.getBoundingClientRect(),o=t.offsetWidth-t.clientWidth,i=t.offsetHeight-t.clientHeight,s=e.clientX-n.left,r=e.clientY-n.top;if(o>0){const c=t.clientWidth;if(s>=c&&s<=t.offsetWidth)return!0}if(i>0){const c=t.clientHeight;if(r>=c&&r<=t.offsetHeight)return!0}return!1}function Oe(e,t){return e.contains(t)}function vt(e){return e.target}function Ke(){return typeof performance<"u"?performance.now():Date.now()}function Ge(e){e!==-1&&clearTimeout(e)}function wt(e){return e!==null&&typeof e=="object"&&"data"in e&&"id"in e&&"children"in e&&"parent"in e}function Se(e){return wt(e)?{floatingContext:e.data,treeContext:e}:{floatingContext:e,treeContext:null}}function z(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 Me(e,t){for(const n of e.children.value)if(n.data.open.value){if(z(t,n.data.refs.anchorEl.value)||z(t,n.data.refs.floatingEl.value))return n;const o=Me(n,t);if(o)return o}return null}function rn(e,t={}){const{floatingContext:n,treeContext:o}=Se(e),{open:i,setOpen:s,refs:r}=n,{enabled:c=!0,event:f="click",toggle:u=!0,ignoreMouse:d=!1,ignoreKeyboard:h=!1,ignoreTouch:g=!1,outsideClick:m=!1,outsideEvent:E="pointerdown",outsideCapture:v=!0,onOutsideClick:w,preventScrollbarClick:b=!0,handleDragEvents:L=!0}=t;let x,M=!1,p=!1,N=!1;const A=a.computed(()=>a.toValue(c)),R=a.computed(()=>a.toValue(m)),D=a.computed(()=>{const P=r.anchorEl.value;return P?P instanceof HTMLElement?P:pt(P)&&P.contextElement instanceof HTMLElement?P.contextElement:null:null}),O=a.computed(()=>r.floatingEl.value);function V(){N=!0;try{i.value?a.toValue(u)&&s(!1):s(!0)}finally{Promise.resolve().then(()=>{N=!1})}}function W(){x=void 0,M=!1,p=!1}function Y(P){x=P.pointerType}function k(P){P.button===0&&a.toValue(f)!=="click"&&($(x)||V())}function C(){if(a.toValue(f)==="mousedown"&&x){W();return}if($(x)){W();return}V(),W()}function l(P){if(x=void 0,P.defaultPrevented||a.toValue(h)||ze(P))return;const X=D.value;X&&(P.key===" "&&!Ue(X)&&(P.preventDefault(),M=!0),P.key==="Enter"&&V())}function F(P){const X=D.value;X&&(P.defaultPrevented||a.toValue(h)||ze(P)||Ue(X)||P.key===" "&&M&&(M=!1,V()))}function y(P){if(!A.value||!R.value||!i.value)return;if(a.toValue(E)==="click"&&a.toValue(L)&&p){p=!1;return}if(N)return;const X=P.target;if(X&&!(a.toValue(b)&&mt(X)&&O.value&&gt(P,X))){if(o){if(!sn(o,X))return}else if(qe(P,D.value)||qe(P,O.value))return;w?w(P,n):s(!1)}}function H(){p=!0}function ee(){setTimeout(()=>{p=!1},0)}function $(P){return!!(Le(P,!0)&&a.toValue(d)||P==="touch"&&a.toValue(g))}a.watchPostEffect(()=>{const P=D.value;!A.value||!P||(P.addEventListener("pointerdown",Y),P.addEventListener("mousedown",k),P.addEventListener("click",C),P.addEventListener("keydown",l),P.addEventListener("keyup",F),a.onWatcherCleanup(()=>{P.removeEventListener("pointerdown",Y),P.removeEventListener("mousedown",k),P.removeEventListener("click",C),P.removeEventListener("keydown",l),P.removeEventListener("keyup",F),W()}))}),G(()=>A.value&&R.value?document:null,()=>a.toValue(E),y,{capture:a.toValue(v)}),G(()=>A.value&&R.value&&a.toValue(L)?O.value:null,"mousedown",H,{capture:!0}),G(()=>A.value&&R.value&&a.toValue(L)?O.value:null,"mouseup",ee,{capture:!0})}function sn(e,t){return!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Me(e,t))}function ln(e,t,n={}){const{open:o,refs:i}=t;let s;const r=a.ref({x:null,y:null}),c=a.computed(()=>a.toValue(n.axis??"both")),f=a.computed(()=>a.toValue(n.enabled??!0)),u=a.computed(()=>a.toValue(n.x??null)),d=a.computed(()=>a.toValue(n.y??null)),h=(v,w)=>{r.value={x:v,y:w},o.value&&(i.anchorEl.value=an(e.value,c.value,r.value))};a.watchEffect(()=>{const v=u.value,w=d.value;f.value&&v!=null&&w!=null&&h(v,w)});const g=v=>{s=v.pointerType,h(v.clientX,v.clientY)},m=v=>{s=v.pointerType,!o.value&&Le(s,!0)&&h(v.clientX,v.clientY)},E=v=>{o.value&&Le(s,!0)&&h(v.clientX,v.clientY)};return a.watchEffect(()=>{if(u.value!=null||d.value!=null)return;const v=e.value;!v||!f.value||(v.addEventListener("pointerenter",m),v.addEventListener("pointerdown",g),v.addEventListener("pointermove",E),a.onWatcherCleanup(()=>{v==null||v.removeEventListener("pointerenter",m),v==null||v.removeEventListener("pointerdown",g),v==null||v.removeEventListener("pointermove",E)}))}),{coordinates:a.readonly(r),updatePosition:h}}function an(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},c=t==="x"||t==="both",f=t==="y"||t==="both";let u=0,d=0,h=r.x,g=r.y;return s&&(o==null&&n.x!=null&&c&&(o=r.x-n.x),i==null&&n.y!=null&&f&&(i=r.y-n.y),h-=o||0,g-=i||0),c&&n.x!=null?h=n.x:(o=null,u=r.width),f&&n.y!=null?g=n.y:(i=null,d=r.height),t==="both"&&(u=0,d=0),{width:u,height:d,x:h,y:g,top:g,right:h+u,bottom:g+d,left:h}}}}function cn(e){const{enabled:t=!0,onEscape:n,capture:o}=e,{isComposing:i}=un();G(document,"keydown",s=>{s.key!=="Escape"||!a.toValue(t)||i()||n(s)},o)}function un(){const e=a.ref(!1);return G(document,"compositionstart",()=>{e.value=!0}),G(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function fn(e,t={}){const{floatingContext:n,treeContext:o}=Se(e),{open:i,setOpen:s,refs:{floatingEl:r,anchorEl:c}}=n,{enabled:f=!0,requireFocusVisible:u=!0}=t,d=a.computed(()=>c.value?c.value instanceof HTMLElement?c.value:c.value.contextElement:null);let h=!1,g=!0,m;G(window,"blur",()=>{!i.value&&d.value&&d.value===document.activeElement&&(h=!0)}),G(window,"focus",()=>{h=!1}),a.onMounted(()=>{Ye()&&je()&&(G(window,"keydown",()=>{g=!0},{capture:!0}),G(window,"pointerdown",()=>{g=!1},{capture:!0}))});function E(w){if(h){h=!1;return}const b=w.target;if(a.toValue(u)&&b){if(Ye()&&je()&&!w.relatedTarget){if(!g&&!_e(b))return}else if(!ht(b))return}s(!0)}function v(w){clearTimeout(m),m=window.setTimeout(()=>{var x;const L=(((x=d.value)==null?void 0:x.ownerDocument)??document).activeElement;if(!(!w.relatedTarget&&L===d.value)){if(o){if(L&&dn(o,L))return}else if(r.value&&L&&r.value.contains(L))return;s(!1)}},0)}a.watchPostEffect(()=>{if(!a.toValue(f))return;const w=d.value;!w||!(w instanceof HTMLElement)||(w.addEventListener("focus",E),w.addEventListener("blur",v),a.onWatcherCleanup(()=>{w.removeEventListener("focus",E),w.removeEventListener("blur",v)}))}),a.onScopeDispose(()=>{clearTimeout(m)})}function dn(e,t){return z(t,e.data.refs.anchorEl.value)||z(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(z(t,n.data.refs.anchorEl.value)||z(t,n.data.refs.floatingEl.value))return n;const o=yt(n,t);if(o)return o}return null}let hn=0;function mn(){return`vfloat-id-${hn++}`}function bt(e){return typeof e=="object"&&e instanceof HTMLElement}function Et(e){return e.children.value.some(t=>t.data.open.value||Et(t))}function pn(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function xt(e,t){const[n,o]=e;let i=!1;const s=t.length;for(let r=0,c=s-1;r<s;c=r++){const[f,u]=t[r]||[0,0],[d,h]=t[c]||[0,0];u>=o!=h>=o&&n<=(d-f)*(o-u)/(h-u)+f&&(i=!i)}return i}function gn(e={}){const{blockPointerEvents:t=!1,requireIntent:n=!0}=e;let o=-1,i=!1;function s(c,f,u,d,h){const g=Ke(),m=g-h;if(u===null||d===null||m===0)return{speed:null,lastX:c,lastY:f,lastCursorTime:g};const E=c-u,v=f-d;return{speed:Math.sqrt(E*E+v*v)/m,lastX:c,lastY:f,lastCursorTime:g}}const r=function(f){const{x:u,y:d,placement:h,elements:g,buffer:m,onClose:E,nodeId:v,tree:w}=f,b=a.computed(()=>{const p=g.domReference;return bt(p)?p:(p==null?void 0:p.contextElement)??null});let L=null,x=null,M=Ke();return function(N){var Ie,zt,Ut,qt,Kt,Gt,Jt;function A(){Ge(o),o=-1,E()}if(Ge(o),o=-1,!g.domReference||!g.floating||h==null||u==null||d==null)return;const{clientX:R,clientY:D}=N,O=[R,D],V=vt(N),W=N.type==="mouseleave",Y=g.floating&&Oe(g.floating,V),k=b.value&&Oe(b.value,V),C=(Ie=b.value)==null?void 0:Ie.getBoundingClientRect(),l=(zt=g.floating)==null?void 0:zt.getBoundingClientRect(),F=h.split("-")[0],y=u>((l==null?void 0:l.right)??0)-((l==null?void 0:l.width)??0)/2,H=d>((l==null?void 0:l.bottom)??0)-((l==null?void 0:l.height)??0)/2,ee=C?pn(O,C):!1,$=((l==null?void 0:l.width)??0)>((C==null?void 0:C.width)??0),P=((l==null?void 0:l.height)??0)>((C==null?void 0:C.height)??0),X=((Ut=$?C:l)==null?void 0:Ut.left)??0,le=((qt=$?C:l)==null?void 0:qt.right)??0,K=((Kt=P?C:l)==null?void 0:Kt.top)??0,ae=((Gt=P?C:l)==null?void 0:Gt.bottom)??0;if(Y&&(i=!0,!W))return;if(k&&(i=!1),k&&!W){i=!0;return}if(W&&bt(N.relatedTarget)&&g.floating&&Oe(g.floating,N.relatedTarget))return;if(w&&v){const B=w.nodes.get(v);if(B&&Et(B))return}if(F==="top"&&d>=((C==null?void 0:C.bottom)??0)-1||F==="bottom"&&d<=((C==null?void 0:C.top)??0)+1||F==="left"&&u>=((C==null?void 0:C.right)??0)-1||F==="right"&&u<=((C==null?void 0:C.left)??0)+1)return A();let oe=[];switch(F){case"top":oe=[[X,((C==null?void 0:C.top)??0)+1],[X,((l==null?void 0:l.bottom)??0)-1],[le,((l==null?void 0:l.bottom)??0)-1],[le,((C==null?void 0:C.top)??0)+1]];break;case"bottom":oe=[[X,((l==null?void 0:l.top)??0)+1],[X,((C==null?void 0:C.bottom)??0)-1],[le,((C==null?void 0:C.bottom)??0)-1],[le,((l==null?void 0:l.top)??0)+1]];break;case"left":oe=[[((l==null?void 0:l.right)??0)-1,ae],[((l==null?void 0:l.right)??0)-1,K],[((C==null?void 0:C.left)??0)+1,K],[((C==null?void 0:C.left)??0)+1,ae]];break;case"right":oe=[[((C==null?void 0:C.right)??0)-1,ae],[((C==null?void 0:C.right)??0)-1,K],[((l==null?void 0:l.left)??0)+1,K],[((l==null?void 0:l.left)??0)+1,ae]];break}function We([B,j]){const S=m;switch(F){case"top":{const ce=[$?B+S/2:y?B+S*4:B-S*4,j+S+1],ue=[$?B-S/2:y?B+S*4:B-S*4,j+S+1],we=[[(l==null?void 0:l.left)??0,y||$?((l==null?void 0:l.bottom)??0)-S:(l==null?void 0:l.top)??0],[(l==null?void 0:l.right)??0,y?$?((l==null?void 0:l.bottom)??0)-S:(l==null?void 0:l.top)??0:((l==null?void 0:l.bottom)??0)-S]];return[ce,ue,...we]}case"bottom":{const ce=[$?B+S/2:y?B+S*4:B-S*4,j-S],ue=[$?B-S/2:y?B+S*4:B-S*4,j-S],we=[[(l==null?void 0:l.left)??0,y||$?((l==null?void 0:l.top)??0)+S:(l==null?void 0:l.bottom)??0],[(l==null?void 0:l.right)??0,y?$?((l==null?void 0:l.top)??0)+S:(l==null?void 0:l.bottom)??0:((l==null?void 0:l.top)??0)+S]];return[ce,ue,...we]}case"left":{const ce=[B+S+1,P?j+S/2:H?j+S*4:j-S*4],ue=[B+S+1,P?j-S/2:H?j+S*4:j-S*4];return[...[[H||P?((l==null?void 0:l.right)??0)-S:(l==null?void 0:l.left)??0,(l==null?void 0:l.top)??0],[H?P?((l==null?void 0:l.right)??0)-S:(l==null?void 0:l.left)??0:((l==null?void 0:l.right)??0)-S,(l==null?void 0:l.bottom)??0]],ce,ue]}case"right":{const ce=[B-S,P?j+S/2:H?j+S*4:j-S*4],ue=[B-S,P?j-S/2:H?j+S*4:j-S*4],we=[[H||P?((l==null?void 0:l.left)??0)+S:(l==null?void 0:l.right)??0,(l==null?void 0:l.top)??0],[H?P?((l==null?void 0:l.left)??0)+S:(l==null?void 0:l.right)??0:((l==null?void 0:l.left)??0)+S,(l==null?void 0:l.bottom)??0]];return[ce,ue,...we]}}}const ve=We([u,d]);if((Jt=e.onPolygonChange)==null||Jt.call(e,ve),!xt(O,oe)){if(xt(O,ve)){if(!i&&n){const B=s(N.clientX,N.clientY,L,x,M);L=B.lastX,x=B.lastY,M=B.lastCursorTime,B.speed!==null&&B.speed<.1&&(o=window.setTimeout(A,40))}return}if(i&&!ee)return A();A()}}};return r.__options={blockPointerEvents:t},r}const Tt=10;function vn(e,t,n){const{delay:o}=n,i=a.computed(()=>{const u=a.toValue(o);return(typeof u=="number"?u:u.open)??0}),s=a.computed(()=>{const u=a.toValue(o);return(typeof u=="number"?u:u.close)??0});let r,c;const f=()=>{clearTimeout(r),clearTimeout(c)};return a.onScopeDispose(f),{show:u=>{f();const d=u??i.value;d===0?e():r=setTimeout(e,d)},hide:u=>{f();const d=u??s.value;d===0?t():c=setTimeout(t,d)},showDelay:i,hideDelay:s,clearTimeouts:f}}function wn(e,t={}){const{floatingContext:n,treeContext:o}=Se(e),{open:i,setOpen:s,refs:{anchorEl:r,floatingEl:c}}=n,{enabled:f=!0,delay:u=0,restMs:d=0,mouseOnly:h=!1,safePolygon:g=!1}=t,m=a.computed(()=>a.toValue(f)),E=a.computed(()=>a.toValue(d)),v=a.computed(()=>{const y=r.value;return!y||y instanceof HTMLElement?y:y.contextElement??null}),{hide:w,show:b,showDelay:L,clearTimeouts:x}=vn(()=>{i.value||s(!0)},()=>{i.value&&s(!1)},{delay:u});let M=null,p;const N=a.computed(()=>L.value===0&&E.value>0);function A(y){if(!m.value||!O(y)||!N.value||!M)return;const H={x:y.clientX,y:y.clientY},ee=Math.abs(H.x-M.x),$=Math.abs(H.y-M.y);(ee>Tt||$>Tt)&&(M=H,clearTimeout(p),p=setTimeout(()=>{b(0)},E.value))}function R(y){!m.value||!O(y)||!N.value||(M={x:y.clientX,y:y.clientY},p=setTimeout(()=>{b(0)},E.value))}function D(){clearTimeout(p),M=null}a.watchPostEffect(()=>{const y=v.value;!y||!m.value||!N.value||(y.addEventListener("pointerenter",R),y.addEventListener("pointermove",A),y.addEventListener("pointerleave",D),a.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",R),y.removeEventListener("pointermove",A),y.removeEventListener("pointerleave",D)}))}),a.onScopeDispose(()=>{clearTimeout(p)});function O(y){return a.toValue(h)?y.pointerType==="mouse":!0}function V(y){!m.value||!O(y)||N.value||(k(),b())}function W(y){!m.value||!O(y)||(x(),k())}let Y=null;function k(){Y&&(document.removeEventListener("pointermove",Y),Y=null);const y=l.value;y!=null&&y.onPolygonChange&&y.onPolygonChange([])}const C=a.computed(()=>!!a.toValue(g)),l=a.computed(()=>{const y=a.toValue(g);if(typeof y=="object"&&y)return y;if(y===!0)return{}});function F(y){var P;if(!m.value||!O(y))return;const{clientX:H,clientY:ee}=y,$=y.relatedTarget;if(C.value)setTimeout(()=>{var oe;k();const X=v.value,le=c.value;if(!X||!le){w();return}let K,ae;if(o){K=new Map;const We=ve=>{K==null||K.set(ve.id,ve);for(const Ie of ve.children.value)We(Ie)};We(o),ae=o.id}Y=gn(l.value)({x:H,y:ee,placement:n.placement.value,elements:{domReference:X,floating:le},buffer:((oe=l.value)==null?void 0:oe.buffer)??1,onClose:()=>{k(),w()},nodeId:ae,tree:K?{nodes:K}:void 0}),Y&&document.addEventListener("pointermove",Y)},0);else{if(o){if(!yn(o,$))return}else if((P=c.value)!=null&&P.contains($))return;w()}}a.watchPostEffect(()=>{const y=v.value;!y||!m.value||(y.addEventListener("pointerenter",V),y.addEventListener("pointerleave",F),a.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",V),y.removeEventListener("pointerleave",F)}))}),a.watchPostEffect(()=>{const y=c.value;!y||!m.value||(y.addEventListener("pointerenter",W),y.addEventListener("pointerleave",F),a.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",W),y.removeEventListener("pointerleave",F)}))}),a.onScopeDispose(()=>{k()})}function yn(e,t){return t?!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Me(e,t)):!0}const bn=["top","right","bottom","left"],de=Math.min,ie=Math.max,Ae=Math.round,Ne=Math.floor,J=e=>({x:e,y:e}),En={left:"right",right:"left",bottom:"top",top:"bottom"},xn={start:"end",end:"start"};function Je(e,t,n){return ie(e,de(t,n))}function he(e,t){return typeof e=="function"?e(t):e}function re(e){return e.split("-")[0]}function ye(e){return e.split("-")[1]}function Ct(e){return e==="x"?"y":"x"}function Qe(e){return e==="y"?"height":"width"}const Tn=new Set(["top","bottom"]);function te(e){return Tn.has(re(e))?"y":"x"}function Ze(e){return Ct(te(e))}function Cn(e,t,n){n===void 0&&(n=!1);const o=ye(e),i=Ze(e),s=Qe(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=De(r)),[r,De(r)]}function Pn(e){const t=De(e);return[et(e),t,et(t)]}function et(e){return e.replace(/start|end/g,t=>xn[t])}const Pt=["left","right"],Lt=["right","left"],Ln=["top","bottom"],On=["bottom","top"];function Sn(e,t,n){switch(e){case"top":case"bottom":return n?t?Lt:Pt:t?Pt:Lt;case"left":case"right":return t?Ln:On;default:return[]}}function Mn(e,t,n,o){const i=ye(e);let s=Sn(re(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(et)))),s}function De(e){return e.replace(/left|right|bottom|top/g,t=>En[t])}function An(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ot(e){return typeof e!="number"?An(e):{top:e,right:e,bottom:e,left:e}}function Ve(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 St(e,t,n){let{reference:o,floating:i}=e;const s=te(t),r=Ze(t),c=Qe(r),f=re(t),u=s==="y",d=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,g=o[c]/2-i[c]/2;let m;switch(f){case"top":m={x:d,y:o.y-i.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:h};break;case"left":m={x:o.x-i.width,y:h};break;default:m={x:o.x,y:o.y}}switch(ye(t)){case"start":m[r]-=g*(n&&u?-1:1);break;case"end":m[r]+=g*(n&&u?-1:1);break}return m}const Nn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=St(u,o,f),g=o,m={},E=0;for(let v=0;v<c.length;v++){const{name:w,fn:b}=c[v],{x:L,y:x,data:M,reset:p}=await b({x:d,y:h,initialPlacement:o,placement:g,strategy:i,middlewareData:m,rects:u,platform:r,elements:{reference:e,floating:t}});d=L??d,h=x??h,m={...m,[w]:{...m[w],...M}},p&&E<=50&&(E++,typeof p=="object"&&(p.placement&&(g=p.placement),p.rects&&(u=p.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):p.rects),{x:d,y:h}=St(u,g,f)),v=-1)}return{x:d,y:h,placement:g,strategy:i,middlewareData:m}};async function Re(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:f}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:g=!1,padding:m=0}=he(t,e),E=Ot(m),w=c[g?h==="floating"?"reference":"floating":h],b=Ve(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:f})),L=h==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),M=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},p=Ve(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:L,offsetParent:x,strategy:f}):L);return{top:(b.top-p.top+E.top)/M.y,bottom:(p.bottom-b.bottom+E.bottom)/M.y,left:(b.left-p.left+E.left)/M.x,right:(p.right-b.right+E.right)/M.x}}const Dn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:c,middlewareData:f}=t,{element:u,padding:d=0}=he(e,t)||{};if(u==null)return{};const h=Ot(d),g={x:n,y:o},m=Ze(i),E=Qe(m),v=await r.getDimensions(u),w=m==="y",b=w?"top":"left",L=w?"bottom":"right",x=w?"clientHeight":"clientWidth",M=s.reference[E]+s.reference[m]-g[m]-s.floating[E],p=g[m]-s.reference[m],N=await(r.getOffsetParent==null?void 0:r.getOffsetParent(u));let A=N?N[x]:0;(!A||!await(r.isElement==null?void 0:r.isElement(N)))&&(A=c.floating[x]||s.floating[E]);const R=M/2-p/2,D=A/2-v[E]/2-1,O=de(h[b],D),V=de(h[L],D),W=O,Y=A-v[E]-V,k=A/2-v[E]/2+R,C=Je(W,k,Y),l=!f.arrow&&ye(i)!=null&&k!==C&&s.reference[E]/2-(k<W?O:V)-v[E]/2<0,F=l?k<W?k-W:k-Y:0;return{[m]:g[m]+F,data:{[m]:C,centerOffset:k-C-F,...l&&{alignmentOffset:F}},reset:l}}}),Vn=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:c,platform:f,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:v=!0,...w}=he(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=re(i),L=te(c),x=re(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(u.floating)),p=g||(x||!v?[De(c)]:Pn(c)),N=E!=="none";!g&&N&&p.push(...Mn(c,v,E,M));const A=[c,...p],R=await Re(t,w),D=[];let O=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&D.push(R[b]),h){const k=Cn(i,r,M);D.push(R[k[0]],R[k[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(k=>k<=0)){var V,W;const k=(((V=s.flip)==null?void 0:V.index)||0)+1,C=A[k];if(C&&(!(h==="alignment"?L!==te(C):!1)||O.every(y=>te(y.placement)===L?y.overflows[0]>0:!0)))return{data:{index:k,overflows:O},reset:{placement:C}};let l=(W=O.filter(F=>F.overflows[0]<=0).sort((F,y)=>F.overflows[1]-y.overflows[1])[0])==null?void 0:W.placement;if(!l)switch(m){case"bestFit":{var Y;const F=(Y=O.filter(y=>{if(N){const H=te(y.placement);return H===L||H==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(H=>H>0).reduce((H,ee)=>H+ee,0)]).sort((y,H)=>y[1]-H[1])[0])==null?void 0:Y[0];F&&(l=F);break}case"initialPlacement":l=c;break}if(i!==l)return{reset:{placement:l}}}return{}}}};function Mt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function At(e){return bn.some(t=>e[t]>=0)}const Rn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=he(e,t);switch(o){case"referenceHidden":{const s=await Re(t,{...i,elementContext:"reference"}),r=Mt(s,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:At(r)}}}case"escaped":{const s=await Re(t,{...i,altBoundary:!0}),r=Mt(s,n.floating);return{data:{escapedOffsets:r,escaped:At(r)}}}default:return{}}}}},kn=new Set(["left","top"]);async function Fn(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=re(n),c=ye(n),f=te(n)==="y",u=kn.has(r)?-1:1,d=s&&f?-1:1,h=he(t,e);let{mainAxis:g,crossAxis:m,alignmentAxis:E}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof E=="number"&&(m=c==="end"?E*-1:E),f?{x:m*d,y:g*u}:{x:g*u,y:m*d}}const Hn=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:c}=t,f=await Fn(t,e);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:r}}}}},Bn=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:c={fn:w=>{let{x:b,y:L}=w;return{x:b,y:L}}},...f}=he(e,t),u={x:n,y:o},d=await Re(t,f),h=te(re(i)),g=Ct(h);let m=u[g],E=u[h];if(s){const w=g==="y"?"top":"left",b=g==="y"?"bottom":"right",L=m+d[w],x=m-d[b];m=Je(L,m,x)}if(r){const w=h==="y"?"top":"left",b=h==="y"?"bottom":"right",L=E+d[w],x=E-d[b];E=Je(L,E,x)}const v=c.fn({...t,[g]:m,[h]:E});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[g]:s,[h]:r}}}}}};function ke(){return typeof window<"u"}function me(e){return Nt(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Q(e){var t;return(t=(Nt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nt(e){return ke()?e instanceof Node||e instanceof _(e).Node:!1}function U(e){return ke()?e instanceof Element||e instanceof _(e).Element:!1}function Z(e){return ke()?e instanceof HTMLElement||e instanceof _(e).HTMLElement:!1}function Dt(e){return!ke()||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}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Wn.has(i)}const In=new Set(["table","td","th"]);function $n(e){return In.has(me(e))}const Xn=[":popover-open",":modal"];function Fe(e){return Xn.some(t=>{try{return e.matches(t)}catch{return!1}})}const Yn=["transform","translate","scale","rotate","perspective"],jn=["transform","translate","scale","rotate","perspective","filter"],_n=["paint","layout","strict","content"];function tt(e){const t=nt(),n=U(e)?q(e):e;return Yn.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)||jn.some(o=>(n.willChange||"").includes(o))||_n.some(o=>(n.contain||"").includes(o))}function zn(e){let t=ne(e);for(;Z(t)&&!pe(t);){if(tt(t))return t;if(Fe(t))return null;t=ne(t)}return null}function nt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Un=new Set(["html","body","#document"]);function pe(e){return Un.has(me(e))}function q(e){return _(e).getComputedStyle(e)}function He(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ne(e){if(me(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dt(e)&&e.host||Q(e);return Dt(t)?t.host:t}function Vt(e){const t=ne(e);return pe(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&be(t)?t:Vt(t)}function Ee(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Vt(e),s=i===((o=e.ownerDocument)==null?void 0:o.body),r=_(i);if(s){const c=ot(r);return t.concat(r,r.visualViewport||[],be(i)?i:[],c&&n?Ee(c):[])}return t.concat(i,Ee(i,[],n))}function ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rt(e){const t=q(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=Z(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,c=Ae(n)!==s||Ae(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function it(e){return U(e)?e:e.contextElement}function ge(e){const t=it(e);if(!Z(t))return J(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=Rt(t);let r=(s?Ae(n.width):n.width)/o,c=(s?Ae(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const qn=J(0);function kt(e){const t=_(e);return!nt()||!t.visualViewport?qn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_(e)?!1:t}function se(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=it(e);let r=J(1);t&&(o?U(o)&&(r=ge(o)):r=ge(e));const c=Kn(s,n,o)?kt(s):J(0);let f=(i.left+c.x)/r.x,u=(i.top+c.y)/r.y,d=i.width/r.x,h=i.height/r.y;if(s){const g=_(s),m=o&&U(o)?_(o):o;let E=g,v=ot(E);for(;v&&o&&m!==E;){const w=ge(v),b=v.getBoundingClientRect(),L=q(v),x=b.left+(v.clientLeft+parseFloat(L.paddingLeft))*w.x,M=b.top+(v.clientTop+parseFloat(L.paddingTop))*w.y;f*=w.x,u*=w.y,d*=w.x,h*=w.y,f+=x,u+=M,E=_(v),v=ot(E)}}return Ve({width:d,height:h,x:f,y:u})}function Be(e,t){const n=He(e).scrollLeft;return t?t.left+n:se(Q(e)).left+n}function Ft(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Be(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Gn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=Q(o),c=t?Fe(t.floating):!1;if(o===r||c&&s)return n;let f={scrollLeft:0,scrollTop:0},u=J(1);const d=J(0),h=Z(o);if((h||!h&&!s)&&((me(o)!=="body"||be(r))&&(f=He(o)),Z(o))){const m=se(o);u=ge(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const g=r&&!h&&!s?Ft(r,f):J(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-f.scrollLeft*u.x+d.x+g.x,y:n.y*u.y-f.scrollTop*u.y+d.y+g.y}}function Jn(e){return Array.from(e.getClientRects())}function Qn(e){const t=Q(e),n=He(e),o=e.ownerDocument.body,i=ie(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=ie(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Be(e);const c=-n.scrollTop;return q(o).direction==="rtl"&&(r+=ie(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:c}}const Ht=25;function Zn(e,t){const n=_(e),o=Q(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,c=0,f=0;if(i){s=i.width,r=i.height;const d=nt();(!d||d&&t==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}const u=Be(o);if(u<=0){const d=o.ownerDocument,h=d.body,g=getComputedStyle(h),m=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,E=Math.abs(o.clientWidth-h.clientWidth-m);E<=Ht&&(s-=E)}else u<=Ht&&(s+=u);return{width:s,height:r,x:c,y:f}}const eo=new Set(["absolute","fixed"]);function to(e,t){const n=se(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=Z(e)?ge(e):J(1),r=e.clientWidth*s.x,c=e.clientHeight*s.y,f=i*s.x,u=o*s.y;return{width:r,height:c,x:f,y:u}}function Bt(e,t,n){let o;if(t==="viewport")o=Zn(e,n);else if(t==="document")o=Qn(Q(e));else if(U(t))o=to(t,n);else{const i=kt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ve(o)}function Wt(e,t){const n=ne(e);return n===t||!U(n)||pe(n)?!1:q(n).position==="fixed"||Wt(n,t)}function no(e,t){const n=t.get(e);if(n)return n;let o=Ee(e,[],!1).filter(c=>U(c)&&me(c)!=="body"),i=null;const s=q(e).position==="fixed";let r=s?ne(e):e;for(;U(r)&&!pe(r);){const c=q(r),f=tt(r);!f&&c.position==="fixed"&&(i=null),(s?!f&&!i:!f&&c.position==="static"&&!!i&&eo.has(i.position)||be(r)&&!f&&Wt(e,r))?o=o.filter(d=>d!==r):i=c,r=ne(r)}return t.set(e,o),o}function oo(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?Fe(t)?[]:no(t,this._c):[].concat(n),o],c=r[0],f=r.reduce((u,d)=>{const h=Bt(t,d,i);return u.top=ie(h.top,u.top),u.right=de(h.right,u.right),u.bottom=de(h.bottom,u.bottom),u.left=ie(h.left,u.left),u},Bt(t,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function io(e){const{width:t,height:n}=Rt(e);return{width:t,height:n}}function ro(e,t,n){const o=Z(t),i=Q(t),s=n==="fixed",r=se(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const f=J(0);function u(){f.x=Be(i)}if(o||!o&&!s)if((me(t)!=="body"||be(i))&&(c=He(t)),o){const m=se(t,!0,s,t);f.x=m.x+t.clientLeft,f.y=m.y+t.clientTop}else i&&u();s&&!o&&i&&u();const d=i&&!o&&!s?Ft(i,c):J(0),h=r.left+c.scrollLeft-f.x-d.x,g=r.top+c.scrollTop-f.y-d.y;return{x:h,y:g,width:r.width,height:r.height}}function rt(e){return q(e).position==="static"}function It(e,t){if(!Z(e)||q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Q(e)===n&&(n=n.ownerDocument.body),n}function $t(e,t){const n=_(e);if(Fe(e))return n;if(!Z(e)){let i=ne(e);for(;i&&!pe(i);){if(U(i)&&!rt(i))return i;i=ne(i)}return n}let o=It(e,t);for(;o&&$n(o)&&rt(o);)o=It(o,t);return o&&pe(o)&&rt(o)&&!tt(o)?n:o||zn(e)||n}const so=async function(e){const t=this.getOffsetParent||$t,n=this.getDimensions,o=await n(e.floating);return{reference:ro(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function lo(e){return q(e).direction==="rtl"}const ao={convertOffsetParentRelativeRectToViewportRelativeRect:Gn,getDocumentElement:Q,getClippingRect:oo,getOffsetParent:$t,getElementRects:so,getClientRects:Jn,getDimensions:io,getScale:ge,isElement:U,isRTL:lo};function Xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function co(e,t){let n=null,o;const i=Q(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:g,height:m}=u;if(c||t(),!g||!m)return;const E=Ne(h),v=Ne(i.clientWidth-(d+g)),w=Ne(i.clientHeight-(h+m)),b=Ne(d),x={rootMargin:-E+"px "+-v+"px "+-w+"px "+-b+"px",threshold:ie(0,de(1,f))||1};let M=!0;function p(N){const A=N[0].intersectionRatio;if(A!==f){if(!M)return r();A?r(!1,A):o=setTimeout(()=>{r(!1,1e-7)},1e3)}A===1&&!Xt(u,e.getBoundingClientRect())&&r(),M=!1}try{n=new IntersectionObserver(p,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(p,x)}n.observe(e)}return r(!0),s}function uo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,u=it(e),d=i||s?[...u?Ee(u):[],...Ee(t)]:[];d.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const h=u&&c?co(u,n):null;let g=-1,m=null;r&&(m=new ResizeObserver(b=>{let[L]=b;L&&L.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!f&&m.observe(u),m.observe(t));let E,v=f?se(e):null;f&&w();function w(){const b=se(e);v&&!Xt(v,b)&&n(),v=b,E=requestAnimationFrame(w)}return n(),()=>{var b;d.forEach(L=>{i&&L.removeEventListener("scroll",n),s&&L.removeEventListener("resize",n)}),h==null||h(),(b=m)==null||b.disconnect(),m=null,f&&cancelAnimationFrame(E)}}const fo=Hn,ho=Bn,mo=Vn,po=Rn,go=Dn,vo=(e,t,n)=>{const o=new Map,i={platform:ao,...n},s={...i.platform,_c:o};return Nn(e,t,{...i,platform:s})};function wo(e,t,n={}){const{offset:o="-4px"}=n,{middlewareData:i,placement:s,refs:r}=t;a.watch(e,d=>{r.arrowEl.value=d});const c=a.computed(()=>{var d;return((d=i.value.arrow)==null?void 0:d.x)??0}),f=a.computed(()=>{var d;return((d=i.value.arrow)==null?void 0:d.y)??0}),u=a.computed(()=>{if(!(e.value||r.arrowEl.value)||!i.value.arrow)return{};const h=a.toValue(s).split("-")[0],g=c.value,m=f.value;return h==="bottom"?{"inset-inline-start":`${g}px`,"inset-block-start":o}:h==="top"?{"inset-inline-start":`${g}px`,"inset-block-end":o}:h==="right"?{"inset-block-start":`${m}px`,"inset-inline-start":o}:h==="left"?{"inset-block-start":`${m}px`,"inset-inline-end":o}:{}});return{arrowX:c,arrowY:f,arrowStyles:u}}function yo(e){return{name:"arrow",options:e,fn(t){const n=a.toValue(e.element);return n==null?{}:go({element:n,padding:e.padding}).fn(t)}}}function st(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:s=!0,open:r=a.ref(!1)}=n,c=p=>{r.value=p},f=a.computed(()=>a.toValue(n.placement)??"bottom"),u=a.computed(()=>a.toValue(n.strategy)??"absolute"),d=a.ref(0),h=a.ref(0),g=a.ref(f.value),m=a.ref(u.value),E=a.shallowRef({}),v=a.ref(!1),w=a.ref(null),b=a.computed(()=>{const p=i||[];return w.value&&!p.some(A=>A.name==="arrow")?[...p,yo({element:w})]:p}),L=async()=>{if(!e.value||!t.value)return;const p=await vo(e.value,t.value,{placement:f.value,strategy:u.value,middleware:b.value});d.value=p.x,h.value=p.y,g.value=p.placement,m.value=p.strategy,E.value=p.middlewareData,v.value=r.value};a.watch([f,u],()=>{r.value&&L()});let x;a.watch([e,t,r],([p,N,A])=>{!A||!p||!N||(s&&(x=uo(p,N,L,typeof s=="object"?s:void 0)),a.onWatcherCleanup(()=>{x==null||x(),x=void 0}))},{immediate:!0}),a.onScopeDispose(()=>x==null?void 0:x()),a.watch(r,p=>{p||(v.value=!1)});const M=a.ref({position:u.value,left:"0",top:"0"});return a.watch([d,h,()=>a.toValue(o)],([p,N,A])=>{const R=t.value;if(!R)return;const D={position:m.value,left:"0",top:"0"},O=Yt(R,p),V=Yt(R,N);A?M.value={...D,transform:`translate(${O}px, ${V}px)`,...jt(R)>=1.5&&{"will-change":"transform"}}:M.value={...D,left:`${O}px`,top:`${V}px`}},{immediate:!0}),{x:d,y:h,strategy:m,placement:g,middlewareData:E,isPositioned:v,floatingStyles:M,update:L,refs:{anchorEl:e,floatingEl:t,arrowEl:w},open:r,setOpen:c}}function Yt(e,t){const n=jt(e);return Math.round(t*n)/n}function jt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}class lt{constructor(t,n=null,o={},i=!1){fe(this,"id");fe(this,"data");fe(this,"parent");fe(this,"children");$e(this,xe);this.id=o.id??mn(),this.data=t,this.parent=a.shallowRef(n),this.children=a.shallowRef([]),ut(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 ct(this,xe)}get isLeaf(){return this.children.value.length===0}}xe=new WeakMap;class _t{constructor(t,n){$e(this,Ce);fe(this,"root");fe(this,"nodeMap");$e(this,Te);ut(this,Te,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=a.shallowReactive(new Map),this.root=new lt(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 lt(t,i,o);return this.nodeMap.set(s.id,s),i.addChild(s),s}removeNode(t,n){const o=n??ct(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 s=i.parent.value;if(o==="recursive")ft(this,Ce,dt).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()}}Te=new WeakMap,Ce=new WeakSet,dt=function(t){const n=[...t.children.value];for(const o of n)ft(this,Ce,dt).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function bo(e,t,n={},o={}){const{...i}=n,s=st(e,t,i),r=new _t(s,o);return{get nodeMap(){return r.nodeMap},get root(){return r.root},findNodeById:w=>r.findNodeById(w),moveNode:(w,b)=>r.moveNode(w,b),dispose:()=>{r.dispose()},addNode:(w,b,L={})=>{const{parentId:x,...M}=L,p=st(w,b,M);return r.addNode(p,x)},removeNode:(w,b)=>r.removeNode(w,b),traverse:(w,b)=>r.traverse(w,b),getAllOpenNodes:()=>{const w=[];for(const b of r.nodeMap.values())b.data.open.value&&w.push(b);return w},getTopmostOpenNode:()=>{let w=null,b=-1;for(const L of r.nodeMap.values())if(L.data.open.value){const x=L.getPath().length;x>b&&(b=x,w=L)}return w},forEach:(w,b,L={})=>{const{relationship:x="self-and-children",applyToMatching:M=!0}=L,p=r.findNodeById(w);if(!p)return;const N=[],A=new Set,R=O=>{O&&!A.has(O.id)&&(N.push(O),A.add(O.id))},D=O=>{for(const V of O)R(V)};if(x==="ancestors-only")for(const O of p.getPath())O.id!==p.id&&R(O);else if(x==="siblings-only"){if(p.parent.value)for(const O of p.parent.value.children.value)O.id!==p.id&&R(O)}else if(x==="descendants-only")for(const O of r.traverse("dfs",p))O.id!==p.id&&R(O);else if(x==="children-only")D(p.children.value);else if(x==="self-and-ancestors")D(p.getPath());else if(x==="self-and-children")R(p),D(p.children.value);else if(x==="self-and-descendants")D(r.traverse("dfs",p));else if(x==="self-and-siblings")R(p),p.parent.value&&D(p.parent.value.children.value);else if(x==="self-ancestors-and-children")D(p.getPath()),D(p.children.value);else if(x==="full-branch")D(p.getPath()),D(r.traverse("dfs",p));else if(x==="all-except-branch"){const O=new Set;for(const V of p.getPath())O.add(V.id);for(const V of r.traverse("dfs",p))O.add(V.id);for(const V of r.nodeMap.values())!O.has(V.id)===M&&b(V);return}else{console.warn(`forEach: Unknown relationship "${x}".`);return}if(M)for(const O of N)b(O);else for(const O of r.nodeMap.values())A.has(O.id)||b(O)}}}T.Tree=_t,T.TreeNode=lt,T.clearTimeoutIfSet=Ge,T.contains=Oe,T.findDescendantContainingTarget=Me,T.flip=mo,T.getContextFromParameter=Se,T.getCurrentTime=Ke,T.getTarget=vt,T.hide=po,T.isButtonTarget=ze,T.isClickOnScrollbar=gt,T.isEventTargetWithin=qe,T.isHTMLElement=mt,T.isMac=Ye,T.isMouseLikePointerType=Le,T.isSafari=je,T.isSpaceIgnored=Ue,T.isTargetWithinElement=z,T.isTreeNode=wt,T.isTypeableElement=_e,T.isVirtualElement=pt,T.matchesFocusVisible=ht,T.offset=fo,T.shift=ho,T.useArrow=wo,T.useClick=rn,T.useClientPoint=ln,T.useEscapeKey=cn,T.useFloating=st,T.useFloatingTree=bo,T.useFocus=fn,T.useHover=wn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(M,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],u):(M=typeof globalThis<"u"?globalThis:M||self,u(M.VFloat={},M.Vue))})(this,(function(M,u){"use strict";var vo=Object.defineProperty;var wo=(M,u,fe)=>u in M?vo(M,u,{enumerable:!0,configurable:!0,writable:!0,value:fe}):M[u]=fe;var ye=(M,u,fe)=>wo(M,typeof u!="symbol"?u+"":u,fe);function fe(e){return u.getCurrentScope()?(u.onScopeDispose(e),!0):!1}const zt=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const _t=Object.prototype.toString,Ut=e=>_t.call(e)==="[object Object]";function Ie(e){return Array.isArray(e)?e:[e]}function Kt(e,t,n){return u.watch(e,t,{...n,immediate:!0})}const qt=zt?window:void 0;function Gt(e){var t;const n=u.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,d,c,f)=>(a.addEventListener(d,c,f),()=>a.removeEventListener(d,c,f)),i=u.computed(()=>{const a=Ie(u.toValue(e[0])).filter(d=>d!=null);return a.every(d=>typeof d!="string")?a:void 0}),l=Kt(()=>{var a,d;return[(d=(a=i.value)==null?void 0:a.map(c=>Gt(c)))!=null?d:[qt].filter(c=>c!=null),Ie(u.toValue(i.value?e[1]:e[0])),Ie(u.unref(i.value?e[2]:e[1])),u.toValue(i.value?e[3]:e[2])]},([a,d,c,f])=>{if(n(),!(a!=null&&a.length)||!(d!=null&&d.length)||!(c!=null&&c.length))return;const g=Ut(f)?{...f}:f;t.push(...a.flatMap(m=>d.flatMap(h=>c.map(p=>o(m,h,p,g)))))},{flush:"post"}),r=()=>{l(),n()};return fe(n),r}function We(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function Be(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function st(e){return typeof(e==null?void 0:e.matches)!="function"?!1:e.matches(":focus-visible")}function $e(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 Xe(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 Ye(e){return je(e)}function lt(e){return e instanceof Element&&e instanceof HTMLElement}function Jt(e){return typeof e=="object"&&e!==null&&"contextElement"in e}function ze(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function at(e,t){const n=t.getBoundingClientRect(),o=t.offsetWidth-t.clientWidth,i=t.offsetHeight-t.clientHeight,l=e.clientX-n.left,r=e.clientY-n.top;if(o>0){const a=t.clientWidth;if(l>=a&&l<=t.offsetWidth)return!0}if(i>0){const a=t.clientHeight;if(r>=a&&r<=t.offsetHeight)return!0}return!1}function Te(e,t){return e.contains(t)}function ct(e){return e.target}function _e(){return typeof performance<"u"?performance.now():Date.now()}function Ue(e){e!==-1&&clearTimeout(e)}function ut(e){return e!==null&&typeof e=="object"&&"data"in e&&"id"in e&&"children"in e&&"parent"in e}function be(e){return ut(e)?{floatingContext:e.data,treeContext:e}:{floatingContext:e,treeContext:null}}function z(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 Oe(e,t){for(const n of e.children.value)if(n.data.open.value){if(z(t,n.data.refs.anchorEl.value)||z(t,n.data.refs.floatingEl.value))return n;const o=Oe(n,t);if(o)return o}return null}function Qt(e,t={}){const{floatingContext:n,treeContext:o}=be(e),{open:i,setOpen:l,refs:r}=n,{enabled:a=!0,event:d="click",toggle:c=!0,ignoreMouse:f=!1,ignoreKeyboard:g=!1,ignoreTouch:m=!1,outsideClick:h=!1,outsideEvent:p="pointerdown",outsideCapture:w=!0,onOutsideClick:v,preventScrollbarClick:E=!0,handleDragEvents:O=!0}=t;let T,A=!1,y=!1,x=!1;const L=u.computed(()=>u.toValue(a)),V=u.computed(()=>u.toValue(h)),N=u.computed(()=>{const P=r.anchorEl.value;return P instanceof HTMLElement?P:null}),D=u.computed(()=>r.floatingEl.value);function I(){x=!0;try{i.value?u.toValue(c)&&l(!1):l(!0)}finally{Promise.resolve().then(()=>{x=!1})}}function W(){T=void 0,A=!1,y=!1}function j(P){T=P.pointerType}function R(P){P.button===0&&u.toValue(d)!=="click"&&(B(T)||I())}function C(){if(u.toValue(d)==="mousedown"&&T){W();return}if(B(T)){W();return}I(),W()}function s(P){if(T=void 0,P.defaultPrevented||u.toValue(g)||Xe(P))return;const $=N.value;$&&(P.key===" "&&!Ye($)&&(P.preventDefault(),A=!0),P.key==="Enter"&&I())}function k(P){const $=N.value;$&&(P.defaultPrevented||u.toValue(g)||Xe(P)||Ye($)||P.key===" "&&A&&(A=!1,I()))}function b(P){if(!L.value||!V.value||!i.value)return;if(u.toValue(p)==="click"&&u.toValue(O)&&y){y=!1;return}if(x)return;const $=P.target;if($&&!(u.toValue(E)&&lt($)&&D.value&&at(P,$))){if(o){if(!Zt(o,$))return}else if(ze(P,N.value)||ze(P,D.value))return;v?v(P,n):l(!1)}}function F(){y=!0}function Z(){setTimeout(()=>{y=!1},0)}function B(P){return!!($e(P,!0)&&u.toValue(f)||P==="touch"&&u.toValue(m))}u.watchPostEffect(()=>{const P=N.value;!L.value||!P||(P.addEventListener("pointerdown",j),P.addEventListener("mousedown",R),P.addEventListener("click",C),P.addEventListener("keydown",s),P.addEventListener("keyup",k),u.onWatcherCleanup(()=>{P.removeEventListener("pointerdown",j),P.removeEventListener("mousedown",R),P.removeEventListener("click",C),P.removeEventListener("keydown",s),P.removeEventListener("keyup",k),W()}))}),q(()=>L.value&&V.value?document:null,()=>u.toValue(p),b,{capture:u.toValue(w)}),q(()=>L.value&&V.value&&u.toValue(O)?D.value:null,"mousedown",F,{capture:!0}),q(()=>L.value&&V.value&&u.toValue(O)?D.value:null,"mouseup",Z,{capture:!0})}function Zt(e,t){return!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Oe(e,t))}const Pe=e=>typeof e=="number"&&Number.isFinite(e)?e:null,se=class se{create(t){const n=this.buildConfiguration(t);return{contextElement:n.referenceElement||void 0,getBoundingClientRect:()=>this.buildBoundingRect(n)}}buildConfiguration(t){return{coordinates:t.coordinates,referenceElement:t.referenceElement??null,baselineCoordinates:t.baselineCoordinates??null,axis:t.axis??"both"}}buildBoundingRect(t){const n=this.getReferenceRect(t.referenceElement),o=this.resolvePosition(t,n),i=this.calculateSize(t.axis,n);return this.buildDOMRect({x:o.x,y:o.y,width:i.width,height:i.height})}getReferenceRect(t){if(t)try{return t.getBoundingClientRect()}catch(n){console.warn("VirtualElementFactory: Failed to get element bounds",{element:t,error:n})}return this.buildDOMRect({x:0,y:0,width:se.DEFAULT_DIMENSIONS.width,height:se.DEFAULT_DIMENSIONS.height})}resolvePosition(t,n){var o,i;return{x:this.resolveAxisCoordinate({current:t.coordinates.x,baseline:((o=t.baselineCoordinates)==null?void 0:o.x)??null,fallback:n.x,isAxisEnabled:t.axis==="x"||t.axis==="both"}),y:this.resolveAxisCoordinate({current:t.coordinates.y,baseline:((i=t.baselineCoordinates)==null?void 0:i.y)??null,fallback:n.y,isAxisEnabled:t.axis==="y"||t.axis==="both"})}}resolveAxisCoordinate(t){const{current:n,baseline:o,fallback:i,isAxisEnabled:l}=t;return l&&n!==null?n:o!==null?o:i}calculateSize(t,n){const o=(i,l)=>Math.max(0,i||l);switch(t){case"both":return{width:0,height:0};case"x":return{width:o(n.width,se.DEFAULT_DIMENSIONS.width),height:0};case"y":return{width:0,height:o(n.height,se.DEFAULT_DIMENSIONS.height)}}}buildDOMRect(t){const{x:n,y:o,width:i,height:l}=t,r=Math.max(0,i),a=Math.max(0,l);return{x:n,y:o,width:r,height:a,top:o,right:n+r,bottom:o+a,left:n,toJSON:()=>({x:n,y:o,width:r,height:a})}}};ye(se,"DEFAULT_DIMENSIONS",{width:100,height:30});let Ke=se;class ft{constructor(){ye(this,"lastKnownCoordinates",null)}getCoordinatesForOpening(){return this.lastKnownCoordinates}onClose(){this.lastKnownCoordinates=null}reset(){this.lastKnownCoordinates=null}}class en extends ft{constructor(){super(...arguments);ye(this,"name","follow")}getRequiredEvents(){return["pointerdown","pointermove","pointerenter"]}process(n,o){const i=n.coordinates;switch(this.lastKnownCoordinates=i,n.type){case"pointerdown":return i;case"pointermove":return o.isOpen&&$e(n.originalEvent.pointerType,!0)?i:null;case"pointerenter":return i;default:return null}}}class tn extends ft{constructor(){super(...arguments);ye(this,"name","static");ye(this,"triggerCoordinates",null)}getRequiredEvents(){return["pointerdown"]}process(n,o){const i=n.coordinates;return this.triggerCoordinates=i,this.lastKnownCoordinates=i,o.isOpen?i:null}getCoordinatesForOpening(){return this.triggerCoordinates?this.triggerCoordinates:this.lastKnownCoordinates}reset(){super.reset(),this.triggerCoordinates=null}onClose(){this.triggerCoordinates=null}}function nn(e,t,n={}){const{open:o,refs:i}=t,l=new Ke,r=u.ref({x:null,y:null}),a=u.ref(null),d=u.computed(()=>u.toValue(n.axis??"both")),c=u.computed(()=>u.toValue(n.enabled??!0)),f=u.computed(()=>Pe(u.toValue(n.x??null))),g=u.computed(()=>Pe(u.toValue(n.y??null))),m=u.computed(()=>f.value!==null&&g.value!==null),h=u.computed(()=>m.value?{x:f.value,y:g.value}:r.value),p=u.computed(()=>{const x=h.value;switch(d.value){case"x":return{x:x.x,y:null};case"y":return{x:null,y:x.y};case"both":return x}}),w=(n.trackingMode??"follow")==="follow"?new en:new tn,v=(x,L)=>{m.value||(r.value={x:Pe(x),y:Pe(L)})},E=()=>{m.value||(r.value={x:null,y:null})},O=(x,L)=>{const V={type:L,coordinates:{x:x.clientX,y:x.clientY},originalEvent:x},N=w.process(V,{isOpen:o.value});N&&v(N.x,N.y)};u.watch([p,a,d,e],()=>{i.anchorEl.value=l.create({coordinates:p.value,referenceElement:e.value,baselineCoordinates:a.value,axis:d.value})},{immediate:!0}),u.watch(o,x=>{if(!(!c.value||m.value))if(x){const L=w.getCoordinatesForOpening();L?(v(L.x,L.y),a.value={...L}):a.value={...r.value}}else w.onClose(),E(),a.value=null});const T=x=>{O(x,"pointerdown")},A=x=>{O(x,"pointerenter")},y=x=>{O(x,"pointermove")};return u.watchEffect(()=>{if(m.value||!c.value)return;const x=e.value;if(!x)return;const L=w.getRequiredEvents(),V={pointerenter:A,pointerdown:T,pointermove:y};L.forEach(N=>{const D=V[N];D&&x.addEventListener(N,D)}),u.onWatcherCleanup(()=>{L.forEach(N=>{const D=V[N];D&&x.removeEventListener(N,D)})})}),{coordinates:u.readonly(p),updatePosition:(x,L)=>v(x,L)}}function on(e,t={}){const{floatingContext:n,treeContext:o}=be(e),{enabled:i=!0,capture:l=!1,onEscape:r}=t,{isComposing:a}=sn();q(document,"keydown",c=>{if(!(c.key!=="Escape"||!u.toValue(i)||a())){if(r){r(c);return}if(o){const f=rn(o);f&&f.data.setOpen(!1)}else n.setOpen(!1)}},l)}function rn(e){let t=e;for(;t.parent.value&&!t.isRoot;)t=t.parent.value;let n=null,o=-1;const i=l=>{if(l.data.open.value){const r=l.getPath().length;r>o&&(o=r,n=l)}for(const r of l.children.value)i(r)};return i(t),n}function sn(){const e=u.ref(!1);return q(document,"compositionstart",()=>{e.value=!0}),q(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function ln(e,t={}){const{floatingContext:n,treeContext:o}=be(e),{open:i,setOpen:l,refs:{floatingEl:r,anchorEl:a}}=n,{enabled:d=!0,requireFocusVisible:c=!0}=t,f=u.computed(()=>a.value?a.value instanceof HTMLElement?a.value:a.value.contextElement:null);let g=!1,m=!0,h;q(window,"blur",()=>{!i.value&&f.value&&f.value===document.activeElement&&(g=!0)}),q(window,"focus",()=>{g=!1}),u.onMounted(()=>{We()&&Be()&&(q(window,"keydown",()=>{m=!0},{capture:!0}),q(window,"pointerdown",()=>{m=!1},{capture:!0}))});function p(v){if(g){g=!1;return}const E=v.target;if(u.toValue(c)&&E){if(We()&&Be()&&!v.relatedTarget){if(!m&&!je(E))return}else if(!st(E))return}l(!0)}function w(v){clearTimeout(h),h=window.setTimeout(()=>{var T;const O=(((T=f.value)==null?void 0:T.ownerDocument)??document).activeElement;if(!(!v.relatedTarget&&O===f.value)){if(o){if(O&&an(o,O))return}else if(r.value&&O&&r.value.contains(O))return;l(!1)}},0)}u.watchPostEffect(()=>{if(!u.toValue(d))return;const v=f.value;!v||!(v instanceof HTMLElement)||(v.addEventListener("focus",p),v.addEventListener("blur",w),u.onWatcherCleanup(()=>{v.removeEventListener("focus",p),v.removeEventListener("blur",w)}))}),u.onScopeDispose(()=>{clearTimeout(h)})}function an(e,t){return z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)?!0:dt(e,t)!==null}function dt(e,t){for(const n of e.children.value)if(n.data.open.value){if(z(t,n.data.refs.anchorEl.value)||z(t,n.data.refs.floatingEl.value))return n;const o=dt(n,t);if(o)return o}return null}let cn=0;function un(){return`vfloat-id-${cn++}`}function ht(e){return typeof e=="object"&&e instanceof HTMLElement}function mt(e){return e.children.value.some(t=>t.data.open.value||mt(t))}function fn(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function pt(e,t){const[n,o]=e;let i=!1;const l=t.length;for(let r=0,a=l-1;r<l;a=r++){const[d,c]=t[r]||[0,0],[f,g]=t[a]||[0,0];c>=o!=g>=o&&n<=(f-d)*(o-c)/(g-c)+d&&(i=!i)}return i}function dn(e={}){const{blockPointerEvents:t=!1,requireIntent:n=!0}=e;let o=-1,i=!1;function l(a,d,c,f,g){const m=_e(),h=m-g;if(c===null||f===null||h===0)return{speed:null,lastX:a,lastY:d,lastCursorTime:m};const p=a-c,w=d-f;return{speed:Math.sqrt(p*p+w*w)/h,lastX:a,lastY:d,lastCursorTime:m}}const r=function(d){const{x:c,y:f,placement:g,elements:m,buffer:h,onClose:p,nodeId:w,tree:v}=d,E=u.computed(()=>{const y=m.domReference;return ht(y)?y:(y==null?void 0:y.contextElement)??null});let O=null,T=null,A=_e();return function(x){var He,Wt,Bt,$t,jt,Xt,Yt;function L(){Ue(o),o=-1,p()}if(Ue(o),o=-1,!m.domReference||!m.floating||g==null||c==null||f==null)return;const{clientX:V,clientY:N}=x,D=[V,N],I=ct(x),W=x.type==="mouseleave",j=m.floating&&Te(m.floating,I),R=E.value&&Te(E.value,I),C=(He=E.value)==null?void 0:He.getBoundingClientRect(),s=(Wt=m.floating)==null?void 0:Wt.getBoundingClientRect(),k=g.split("-")[0],b=c>((s==null?void 0:s.right)??0)-((s==null?void 0:s.width)??0)/2,F=f>((s==null?void 0:s.bottom)??0)-((s==null?void 0:s.height)??0)/2,Z=C?fn(D,C):!1,B=((s==null?void 0:s.width)??0)>((C==null?void 0:C.width)??0),P=((s==null?void 0:s.height)??0)>((C==null?void 0:C.height)??0),$=((Bt=B?C:s)==null?void 0:Bt.left)??0,le=(($t=B?C:s)==null?void 0:$t.right)??0,K=((jt=P?C:s)==null?void 0:jt.top)??0,ae=((Xt=P?C:s)==null?void 0:Xt.bottom)??0;if(j&&(i=!0,!W))return;if(R&&(i=!1),R&&!W){i=!0;return}if(W&&ht(x.relatedTarget)&&m.floating&&Te(m.floating,x.relatedTarget))return;if(v&&w){const H=v.nodes.get(w);if(H&&mt(H))return}if(k==="top"&&f>=((C==null?void 0:C.bottom)??0)-1||k==="bottom"&&f<=((C==null?void 0:C.top)??0)+1||k==="left"&&c>=((C==null?void 0:C.right)??0)-1||k==="right"&&c<=((C==null?void 0:C.left)??0)+1)return L();let ne=[];switch(k){case"top":ne=[[$,((C==null?void 0:C.top)??0)+1],[$,((s==null?void 0:s.bottom)??0)-1],[le,((s==null?void 0:s.bottom)??0)-1],[le,((C==null?void 0:C.top)??0)+1]];break;case"bottom":ne=[[$,((s==null?void 0:s.top)??0)+1],[$,((C==null?void 0:C.bottom)??0)-1],[le,((C==null?void 0:C.bottom)??0)-1],[le,((s==null?void 0:s.top)??0)+1]];break;case"left":ne=[[((s==null?void 0:s.right)??0)-1,ae],[((s==null?void 0:s.right)??0)-1,K],[((C==null?void 0:C.left)??0)+1,K],[((C==null?void 0:C.left)??0)+1,ae]];break;case"right":ne=[[((C==null?void 0:C.right)??0)-1,ae],[((C==null?void 0:C.right)??0)-1,K],[((s==null?void 0:s.left)??0)+1,K],[((s==null?void 0:s.left)??0)+1,ae]];break}function Fe([H,X]){const S=h;switch(k){case"top":{const ce=[B?H+S/2:b?H+S*4:H-S*4,X+S+1],ue=[B?H-S/2:b?H+S*4:H-S*4,X+S+1],we=[[(s==null?void 0:s.left)??0,b||B?((s==null?void 0:s.bottom)??0)-S:(s==null?void 0:s.top)??0],[(s==null?void 0:s.right)??0,b?B?((s==null?void 0:s.bottom)??0)-S:(s==null?void 0:s.top)??0:((s==null?void 0:s.bottom)??0)-S]];return[ce,ue,...we]}case"bottom":{const ce=[B?H+S/2:b?H+S*4:H-S*4,X-S],ue=[B?H-S/2:b?H+S*4:H-S*4,X-S],we=[[(s==null?void 0:s.left)??0,b||B?((s==null?void 0:s.top)??0)+S:(s==null?void 0:s.bottom)??0],[(s==null?void 0:s.right)??0,b?B?((s==null?void 0:s.top)??0)+S:(s==null?void 0:s.bottom)??0:((s==null?void 0:s.top)??0)+S]];return[ce,ue,...we]}case"left":{const ce=[H+S+1,P?X+S/2:F?X+S*4:X-S*4],ue=[H+S+1,P?X-S/2:F?X+S*4:X-S*4];return[...[[F||P?((s==null?void 0:s.right)??0)-S:(s==null?void 0:s.left)??0,(s==null?void 0:s.top)??0],[F?P?((s==null?void 0:s.right)??0)-S:(s==null?void 0:s.left)??0:((s==null?void 0:s.right)??0)-S,(s==null?void 0:s.bottom)??0]],ce,ue]}case"right":{const ce=[H-S,P?X+S/2:F?X+S*4:X-S*4],ue=[H-S,P?X-S/2:F?X+S*4:X-S*4],we=[[F||P?((s==null?void 0:s.left)??0)+S:(s==null?void 0:s.right)??0,(s==null?void 0:s.top)??0],[F?P?((s==null?void 0:s.left)??0)+S:(s==null?void 0:s.right)??0:((s==null?void 0:s.left)??0)+S,(s==null?void 0:s.bottom)??0]];return[ce,ue,...we]}}}const ve=Fe([c,f]);if((Yt=e.onPolygonChange)==null||Yt.call(e,ve),!pt(D,ne)){if(pt(D,ve)){if(!i&&n){const H=l(x.clientX,x.clientY,O,T,A);O=H.lastX,T=H.lastY,A=H.lastCursorTime,H.speed!==null&&H.speed<.1&&(o=window.setTimeout(L,40))}return}if(i&&!Z)return L();L()}}};return r.__options={blockPointerEvents:t},r}const gt=10;function hn(e,t,n){const{delay:o}=n,i=u.computed(()=>{const c=u.toValue(o);return(typeof c=="number"?c:c.open)??0}),l=u.computed(()=>{const c=u.toValue(o);return(typeof c=="number"?c:c.close)??0});let r,a;const d=()=>{clearTimeout(r),clearTimeout(a)};return u.onScopeDispose(d),{show:c=>{d();const f=c??i.value;f===0?e():r=setTimeout(e,f)},hide:c=>{d();const f=c??l.value;f===0?t():a=setTimeout(t,f)},showDelay:i,hideDelay:l,clearTimeouts:d}}function mn(e,t={}){const{floatingContext:n,treeContext:o}=be(e),{open:i,setOpen:l,refs:{anchorEl:r,floatingEl:a}}=n,{enabled:d=!0,delay:c=0,restMs:f=0,mouseOnly:g=!1,safePolygon:m=!1}=t,h=u.computed(()=>u.toValue(d)),p=u.computed(()=>u.toValue(f)),w=u.computed(()=>{const b=r.value;return!b||b instanceof HTMLElement?b:b.contextElement??null}),{hide:v,show:E,showDelay:O,clearTimeouts:T}=hn(()=>{i.value||l(!0)},()=>{i.value&&l(!1)},{delay:c});let A=null,y;const x=u.computed(()=>O.value===0&&p.value>0);function L(b){if(!h.value||!D(b)||!x.value||!A)return;const F={x:b.clientX,y:b.clientY},Z=Math.abs(F.x-A.x),B=Math.abs(F.y-A.y);(Z>gt||B>gt)&&(A=F,clearTimeout(y),y=setTimeout(()=>{E(0)},p.value))}function V(b){!h.value||!D(b)||!x.value||(A={x:b.clientX,y:b.clientY},y=setTimeout(()=>{E(0)},p.value))}function N(){clearTimeout(y),A=null}u.watchPostEffect(()=>{const b=w.value;!b||!h.value||!x.value||(b.addEventListener("pointerenter",V),b.addEventListener("pointermove",L),b.addEventListener("pointerleave",N),u.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",V),b.removeEventListener("pointermove",L),b.removeEventListener("pointerleave",N)}))}),u.onScopeDispose(()=>{clearTimeout(y)});function D(b){return u.toValue(g)?b.pointerType==="mouse":!0}function I(b){!h.value||!D(b)||x.value||(R(),E())}function W(b){!h.value||!D(b)||(T(),R())}let j=null;function R(){j&&(document.removeEventListener("pointermove",j),j=null);const b=s.value;b!=null&&b.onPolygonChange&&b.onPolygonChange([])}const C=u.computed(()=>!!u.toValue(m)),s=u.computed(()=>{const b=u.toValue(m);if(typeof b=="object"&&b)return b;if(b===!0)return{}});function k(b){var P;if(!h.value||!D(b))return;const{clientX:F,clientY:Z}=b,B=b.relatedTarget;if(C.value)setTimeout(()=>{var ne;R();const $=w.value,le=a.value;if(!$||!le){v();return}let K,ae;if(o){K=new Map;const Fe=ve=>{K==null||K.set(ve.id,ve);for(const He of ve.children.value)Fe(He)};Fe(o),ae=o.id}j=dn(s.value)({x:F,y:Z,placement:n.placement.value,elements:{domReference:$,floating:le},buffer:((ne=s.value)==null?void 0:ne.buffer)??1,onClose:()=>{R(),v()},nodeId:ae,tree:K?{nodes:K}:void 0}),j&&document.addEventListener("pointermove",j)},0);else{if(o){if(!pn(o,B))return}else if((P=a.value)!=null&&P.contains(B))return;v()}}u.watchPostEffect(()=>{const b=w.value;!b||!h.value||(b.addEventListener("pointerenter",I),b.addEventListener("pointerleave",k),u.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",I),b.removeEventListener("pointerleave",k)}))}),u.watchPostEffect(()=>{const b=a.value;!b||!h.value||(b.addEventListener("pointerenter",W),b.addEventListener("pointerleave",k),u.onWatcherCleanup(()=>{b.removeEventListener("pointerenter",W),b.removeEventListener("pointerleave",k)}))}),u.onScopeDispose(()=>{R()})}function pn(e,t){return t?!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Oe(e,t)):!0}const gn=["top","right","bottom","left"],de=Math.min,oe=Math.max,Le=Math.round,Se=Math.floor,G=e=>({x:e,y:e}),vn={left:"right",right:"left",bottom:"top",top:"bottom"},wn={start:"end",end:"start"};function qe(e,t,n){return oe(e,de(t,n))}function he(e,t){return typeof e=="function"?e(t):e}function ie(e){return e.split("-")[0]}function xe(e){return e.split("-")[1]}function vt(e){return e==="x"?"y":"x"}function Ge(e){return e==="y"?"height":"width"}const yn=new Set(["top","bottom"]);function ee(e){return yn.has(ie(e))?"y":"x"}function Je(e){return vt(ee(e))}function bn(e,t,n){n===void 0&&(n=!1);const o=xe(e),i=Je(e),l=Ge(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(r=Ae(r)),[r,Ae(r)]}function xn(e){const t=Ae(e);return[Qe(e),t,Qe(t)]}function Qe(e){return e.replace(/start|end/g,t=>wn[t])}const wt=["left","right"],yt=["right","left"],En=["top","bottom"],Cn=["bottom","top"];function Tn(e,t,n){switch(e){case"top":case"bottom":return n?t?yt:wt:t?wt:yt;case"left":case"right":return t?En:Cn;default:return[]}}function On(e,t,n,o){const i=xe(e);let l=Tn(ie(e),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),t&&(l=l.concat(l.map(Qe)))),l}function Ae(e){return e.replace(/left|right|bottom|top/g,t=>vn[t])}function Pn(e){return{top:0,right:0,bottom:0,left:0,...e}}function bt(e){return typeof e!="number"?Pn(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 xt(e,t,n){let{reference:o,floating:i}=e;const l=ee(t),r=Je(t),a=Ge(r),d=ie(t),c=l==="y",f=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,m=o[a]/2-i[a]/2;let h;switch(d){case"top":h={x:f,y:o.y-i.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:g};break;case"left":h={x:o.x-i.width,y:g};break;default:h={x:o.x,y:o.y}}switch(xe(t)){case"start":h[r]-=m*(n&&c?-1:1);break;case"end":h[r]+=m*(n&&c?-1:1);break}return h}const Ln=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:r}=n,a=l.filter(Boolean),d=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:g}=xt(c,o,d),m=o,h={},p=0;for(let w=0;w<a.length;w++){const{name:v,fn:E}=a[w],{x:O,y:T,data:A,reset:y}=await E({x:f,y:g,initialPlacement:o,placement:m,strategy:i,middlewareData:h,rects:c,platform:r,elements:{reference:e,floating:t}});f=O??f,g=T??g,h={...h,[v]:{...h[v],...A}},y&&p<=50&&(p++,typeof y=="object"&&(y.placement&&(m=y.placement),y.rects&&(c=y.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:f,y:g}=xt(c,m,d)),w=-1)}return{x:f,y:g,placement:m,strategy:i,middlewareData:h}};async function De(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:l,rects:r,elements:a,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:m=!1,padding:h=0}=he(t,e),p=bt(h),v=a[m?g==="floating"?"reference":"floating":g],E=Me(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(v)))==null||n?v:v.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:d})),O=g==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(a.floating)),A=await(l.isElement==null?void 0:l.isElement(T))?await(l.getScale==null?void 0:l.getScale(T))||{x:1,y:1}:{x:1,y:1},y=Me(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:T,strategy:d}):O);return{top:(E.top-y.top+p.top)/A.y,bottom:(y.bottom-E.bottom+p.bottom)/A.y,left:(E.left-y.left+p.left)/A.x,right:(y.right-E.right+p.right)/A.x}}const Sn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:l,platform:r,elements:a,middlewareData:d}=t,{element:c,padding:f=0}=he(e,t)||{};if(c==null)return{};const g=bt(f),m={x:n,y:o},h=Je(i),p=Ge(h),w=await r.getDimensions(c),v=h==="y",E=v?"top":"left",O=v?"bottom":"right",T=v?"clientHeight":"clientWidth",A=l.reference[p]+l.reference[h]-m[h]-l.floating[p],y=m[h]-l.reference[h],x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let L=x?x[T]:0;(!L||!await(r.isElement==null?void 0:r.isElement(x)))&&(L=a.floating[T]||l.floating[p]);const V=A/2-y/2,N=L/2-w[p]/2-1,D=de(g[E],N),I=de(g[O],N),W=D,j=L-w[p]-I,R=L/2-w[p]/2+V,C=qe(W,R,j),s=!d.arrow&&xe(i)!=null&&R!==C&&l.reference[p]/2-(R<W?D:I)-w[p]/2<0,k=s?R<W?R-W:R-j:0;return{[h]:m[h]+k,data:{[h]:C,centerOffset:R-C-k,...s&&{alignmentOffset:k}},reset:s}}}),An=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:l,rects:r,initialPlacement:a,platform:d,elements:c}=t,{mainAxis:f=!0,crossAxis:g=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:w=!0,...v}=he(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const E=ie(i),O=ee(a),T=ie(a)===a,A=await(d.isRTL==null?void 0:d.isRTL(c.floating)),y=m||(T||!w?[Ae(a)]:xn(a)),x=p!=="none";!m&&x&&y.push(...On(a,w,p,A));const L=[a,...y],V=await De(t,v),N=[];let D=((o=l.flip)==null?void 0:o.overflows)||[];if(f&&N.push(V[E]),g){const R=bn(i,r,A);N.push(V[R[0]],V[R[1]])}if(D=[...D,{placement:i,overflows:N}],!N.every(R=>R<=0)){var I,W;const R=(((I=l.flip)==null?void 0:I.index)||0)+1,C=L[R];if(C&&(!(g==="alignment"?O!==ee(C):!1)||D.every(b=>ee(b.placement)===O?b.overflows[0]>0:!0)))return{data:{index:R,overflows:D},reset:{placement:C}};let s=(W=D.filter(k=>k.overflows[0]<=0).sort((k,b)=>k.overflows[1]-b.overflows[1])[0])==null?void 0:W.placement;if(!s)switch(h){case"bestFit":{var j;const k=(j=D.filter(b=>{if(x){const F=ee(b.placement);return F===O||F==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(F=>F>0).reduce((F,Z)=>F+Z,0)]).sort((b,F)=>b[1]-F[1])[0])==null?void 0:j[0];k&&(s=k);break}case"initialPlacement":s=a;break}if(i!==s)return{reset:{placement:s}}}return{}}}};function Et(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ct(e){return gn.some(t=>e[t]>=0)}const Mn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=he(e,t);switch(o){case"referenceHidden":{const l=await De(t,{...i,elementContext:"reference"}),r=Et(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Ct(r)}}}case"escaped":{const l=await De(t,{...i,altBoundary:!0}),r=Et(l,n.floating);return{data:{escapedOffsets:r,escaped:Ct(r)}}}default:return{}}}}},Dn=new Set(["left","top"]);async function Nn(e,t){const{placement:n,platform:o,elements:i}=e,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=ie(n),a=xe(n),d=ee(n)==="y",c=Dn.has(r)?-1:1,f=l&&d?-1:1,g=he(t,e);let{mainAxis:m,crossAxis:h,alignmentAxis:p}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),d?{x:h*f,y:m*c}:{x:m*c,y:h*f}}const Rn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:l,placement:r,middlewareData:a}=t,d=await Nn(t,e);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:l+d.y,data:{...d,placement:r}}}}},kn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:v=>{let{x:E,y:O}=v;return{x:E,y:O}}},...d}=he(e,t),c={x:n,y:o},f=await De(t,d),g=ee(ie(i)),m=vt(g);let h=c[m],p=c[g];if(l){const v=m==="y"?"top":"left",E=m==="y"?"bottom":"right",O=h+f[v],T=h-f[E];h=qe(O,h,T)}if(r){const v=g==="y"?"top":"left",E=g==="y"?"bottom":"right",O=p+f[v],T=p-f[E];p=qe(O,p,T)}const w=a.fn({...t,[m]:h,[g]:p});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[m]:l,[g]:r}}}}}};function Ne(){return typeof window<"u"}function me(e){return Tt(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function J(e){var t;return(t=(Tt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Tt(e){return Ne()?e instanceof Node||e instanceof Y(e).Node:!1}function _(e){return Ne()?e instanceof Element||e instanceof Y(e).Element:!1}function Q(e){return Ne()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function Ot(e){return!Ne()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}const Vn=new Set(["inline","contents"]);function Ee(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Vn.has(i)}const Fn=new Set(["table","td","th"]);function Hn(e){return Fn.has(me(e))}const In=[":popover-open",":modal"];function Re(e){return In.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wn=["transform","translate","scale","rotate","perspective"],Bn=["transform","translate","scale","rotate","perspective","filter"],$n=["paint","layout","strict","content"];function Ze(e){const t=et(),n=_(e)?U(e):e;return Wn.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)||Bn.some(o=>(n.willChange||"").includes(o))||$n.some(o=>(n.contain||"").includes(o))}function jn(e){let t=te(e);for(;Q(t)&&!pe(t);){if(Ze(t))return t;if(Re(t))return null;t=te(t)}return null}function et(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xn=new Set(["html","body","#document"]);function pe(e){return Xn.has(me(e))}function U(e){return Y(e).getComputedStyle(e)}function ke(e){return _(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function te(e){if(me(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ot(e)&&e.host||J(e);return Ot(t)?t.host:t}function Pt(e){const t=te(e);return pe(t)?e.ownerDocument?e.ownerDocument.body:e.body:Q(t)&&Ee(t)?t:Pt(t)}function Ce(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Pt(e),l=i===((o=e.ownerDocument)==null?void 0:o.body),r=Y(i);if(l){const a=tt(r);return t.concat(r,r.visualViewport||[],Ee(i)?i:[],a&&n?Ce(a):[])}return t.concat(i,Ce(i,[],n))}function tt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lt(e){const t=U(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=Q(e),l=i?e.offsetWidth:n,r=i?e.offsetHeight:o,a=Le(n)!==l||Le(o)!==r;return a&&(n=l,o=r),{width:n,height:o,$:a}}function nt(e){return _(e)?e:e.contextElement}function ge(e){const t=nt(e);if(!Q(t))return G(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:l}=Lt(t);let r=(l?Le(n.width):n.width)/o,a=(l?Le(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Yn=G(0);function St(e){const t=Y(e);return!et()||!t.visualViewport?Yn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Y(e)?!1:t}function re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),l=nt(e);let r=G(1);t&&(o?_(o)&&(r=ge(o)):r=ge(e));const a=zn(l,n,o)?St(l):G(0);let d=(i.left+a.x)/r.x,c=(i.top+a.y)/r.y,f=i.width/r.x,g=i.height/r.y;if(l){const m=Y(l),h=o&&_(o)?Y(o):o;let p=m,w=tt(p);for(;w&&o&&h!==p;){const v=ge(w),E=w.getBoundingClientRect(),O=U(w),T=E.left+(w.clientLeft+parseFloat(O.paddingLeft))*v.x,A=E.top+(w.clientTop+parseFloat(O.paddingTop))*v.y;d*=v.x,c*=v.y,f*=v.x,g*=v.y,d+=T,c+=A,p=Y(w),w=tt(p)}}return Me({width:f,height:g,x:d,y:c})}function Ve(e,t){const n=ke(e).scrollLeft;return t?t.left+n:re(J(e)).left+n}function At(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ve(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function _n(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const l=i==="fixed",r=J(o),a=t?Re(t.floating):!1;if(o===r||a&&l)return n;let d={scrollLeft:0,scrollTop:0},c=G(1);const f=G(0),g=Q(o);if((g||!g&&!l)&&((me(o)!=="body"||Ee(r))&&(d=ke(o)),Q(o))){const h=re(o);c=ge(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const m=r&&!g&&!l?At(r,d):G(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-d.scrollLeft*c.x+f.x+m.x,y:n.y*c.y-d.scrollTop*c.y+f.y+m.y}}function Un(e){return Array.from(e.getClientRects())}function Kn(e){const t=J(e),n=ke(e),o=e.ownerDocument.body,i=oe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=oe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ve(e);const a=-n.scrollTop;return U(o).direction==="rtl"&&(r+=oe(t.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}const Mt=25;function qn(e,t){const n=Y(e),o=J(e),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,d=0;if(i){l=i.width,r=i.height;const f=et();(!f||f&&t==="fixed")&&(a=i.offsetLeft,d=i.offsetTop)}const c=Ve(o);if(c<=0){const f=o.ownerDocument,g=f.body,m=getComputedStyle(g),h=f.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(o.clientWidth-g.clientWidth-h);p<=Mt&&(l-=p)}else c<=Mt&&(l+=c);return{width:l,height:r,x:a,y:d}}const Gn=new Set(["absolute","fixed"]);function Jn(e,t){const n=re(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,l=Q(e)?ge(e):G(1),r=e.clientWidth*l.x,a=e.clientHeight*l.y,d=i*l.x,c=o*l.y;return{width:r,height:a,x:d,y:c}}function Dt(e,t,n){let o;if(t==="viewport")o=qn(e,n);else if(t==="document")o=Kn(J(e));else if(_(t))o=Jn(t,n);else{const i=St(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Me(o)}function Nt(e,t){const n=te(e);return n===t||!_(n)||pe(n)?!1:U(n).position==="fixed"||Nt(n,t)}function Qn(e,t){const n=t.get(e);if(n)return n;let o=Ce(e,[],!1).filter(a=>_(a)&&me(a)!=="body"),i=null;const l=U(e).position==="fixed";let r=l?te(e):e;for(;_(r)&&!pe(r);){const a=U(r),d=Ze(r);!d&&a.position==="fixed"&&(i=null),(l?!d&&!i:!d&&a.position==="static"&&!!i&&Gn.has(i.position)||Ee(r)&&!d&&Nt(e,r))?o=o.filter(f=>f!==r):i=a,r=te(r)}return t.set(e,o),o}function Zn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?Re(t)?[]:Qn(t,this._c):[].concat(n),o],a=r[0],d=r.reduce((c,f)=>{const g=Dt(t,f,i);return c.top=oe(g.top,c.top),c.right=de(g.right,c.right),c.bottom=de(g.bottom,c.bottom),c.left=oe(g.left,c.left),c},Dt(t,a,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function eo(e){const{width:t,height:n}=Lt(e);return{width:t,height:n}}function to(e,t,n){const o=Q(t),i=J(t),l=n==="fixed",r=re(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const d=G(0);function c(){d.x=Ve(i)}if(o||!o&&!l)if((me(t)!=="body"||Ee(i))&&(a=ke(t)),o){const h=re(t,!0,l,t);d.x=h.x+t.clientLeft,d.y=h.y+t.clientTop}else i&&c();l&&!o&&i&&c();const f=i&&!o&&!l?At(i,a):G(0),g=r.left+a.scrollLeft-d.x-f.x,m=r.top+a.scrollTop-d.y-f.y;return{x:g,y:m,width:r.width,height:r.height}}function ot(e){return U(e).position==="static"}function Rt(e,t){if(!Q(e)||U(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function kt(e,t){const n=Y(e);if(Re(e))return n;if(!Q(e)){let i=te(e);for(;i&&!pe(i);){if(_(i)&&!ot(i))return i;i=te(i)}return n}let o=Rt(e,t);for(;o&&Hn(o)&&ot(o);)o=Rt(o,t);return o&&pe(o)&&ot(o)&&!Ze(o)?n:o||jn(e)||n}const no=async function(e){const t=this.getOffsetParent||kt,n=this.getDimensions,o=await n(e.floating);return{reference:to(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function oo(e){return U(e).direction==="rtl"}const io={convertOffsetParentRelativeRectToViewportRelativeRect:_n,getDocumentElement:J,getClippingRect:Zn,getOffsetParent:kt,getElementRects:no,getClientRects:Un,getDimensions:eo,getScale:ge,isElement:_,isRTL:oo};function Vt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ro(e,t){let n=null,o;const i=J(e);function l(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,d){a===void 0&&(a=!1),d===void 0&&(d=1),l();const c=e.getBoundingClientRect(),{left:f,top:g,width:m,height:h}=c;if(a||t(),!m||!h)return;const p=Se(g),w=Se(i.clientWidth-(f+m)),v=Se(i.clientHeight-(g+h)),E=Se(f),T={rootMargin:-p+"px "+-w+"px "+-v+"px "+-E+"px",threshold:oe(0,de(1,d))||1};let A=!0;function y(x){const L=x[0].intersectionRatio;if(L!==d){if(!A)return r();L?r(!1,L):o=setTimeout(()=>{r(!1,1e-7)},1e3)}L===1&&!Vt(c,e.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(y,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(y,T)}n.observe(e)}return r(!0),l}function so(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,c=nt(e),f=i||l?[...c?Ce(c):[],...Ce(t)]:[];f.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),l&&E.addEventListener("resize",n)});const g=c&&a?ro(c,n):null;let m=-1,h=null;r&&(h=new ResizeObserver(E=>{let[O]=E;O&&O.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var T;(T=h)==null||T.observe(t)})),n()}),c&&!d&&h.observe(c),h.observe(t));let p,w=d?re(e):null;d&&v();function v(){const E=re(e);w&&!Vt(w,E)&&n(),w=E,p=requestAnimationFrame(v)}return n(),()=>{var E;f.forEach(O=>{i&&O.removeEventListener("scroll",n),l&&O.removeEventListener("resize",n)}),g==null||g(),(E=h)==null||E.disconnect(),h=null,d&&cancelAnimationFrame(p)}}const lo=Rn,ao=kn,co=An,uo=Mn,fo=Sn,ho=(e,t,n)=>{const o=new Map,i={platform:io,...n},l={...i.platform,_c:o};return Ln(e,t,{...i,platform:l})};function mo(e,t,n={}){const{offset:o="-4px"}=n,{middlewareData:i,placement:l,refs:r}=t;u.watch(e,f=>{r.arrowEl.value=f});const a=u.computed(()=>{var f;return((f=i.value.arrow)==null?void 0:f.x)??0}),d=u.computed(()=>{var f;return((f=i.value.arrow)==null?void 0:f.y)??0}),c=u.computed(()=>{if(!(e.value||r.arrowEl.value)||!i.value.arrow)return{};const g=u.toValue(l).split("-")[0],m=a.value,h=d.value;return g==="bottom"?{"inset-inline-start":`${m}px`,"inset-block-start":o}:g==="top"?{"inset-inline-start":`${m}px`,"inset-block-end":o}:g==="right"?{"inset-block-start":`${h}px`,"inset-inline-start":o}:g==="left"?{"inset-block-start":`${h}px`,"inset-inline-end":o}:{}});return{arrowX:a,arrowY:d,arrowStyles:c}}function po(e){return{name:"arrow",options:e,fn(t){const n=u.toValue(e.element);return n==null?{}:fo({element:n,padding:e.padding}).fn(t)}}}function it(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:l=!0,open:r=u.ref(!1)}=n,a=y=>{r.value=y},d=u.computed(()=>u.toValue(n.placement)??"bottom"),c=u.computed(()=>u.toValue(n.strategy)??"absolute"),f=u.ref(0),g=u.ref(0),m=u.ref(d.value),h=u.ref(c.value),p=u.shallowRef({}),w=u.ref(!1),v=u.ref(null),E=u.computed(()=>{const y=u.toValue(i)||[];return v.value&&!y.some(L=>L.name==="arrow")?[...y,po({element:v})]:y}),O=async()=>{if(!e.value||!t.value)return;const y=await ho(e.value,t.value,{placement:d.value,strategy:c.value,middleware:E.value});f.value=y.x,g.value=y.y,m.value=y.placement,h.value=y.strategy,p.value=y.middlewareData,w.value=r.value};u.watch([d,c,E],()=>{r.value&&O()});let T;u.watch([e,t,r],([y,x,L])=>{!L||!y||!x||(l&&(T=so(y,x,O,typeof l=="object"?l:void 0)),u.onWatcherCleanup(()=>{T==null||T(),T=void 0}))},{immediate:!0}),u.onScopeDispose(()=>T==null?void 0:T()),u.watch(r,y=>{y||(w.value=!1)});const A=u.ref({position:c.value,left:"0",top:"0"});return u.watch([f,g,()=>u.toValue(o)],([y,x,L])=>{const V=t.value;if(!V)return;const N={position:h.value,left:"0",top:"0"},D=Ft(V,y),I=Ft(V,x);L?A.value={...N,transform:`translate(${D}px, ${I}px)`,...Ht(V)>=1.5&&{"will-change":"transform"}}:A.value={...N,left:`${D}px`,top:`${I}px`}},{immediate:!0}),{x:f,y:g,strategy:h,placement:m,middlewareData:p,isPositioned:w,floatingStyles:A,update:O,refs:{anchorEl:e,floatingEl:t,arrowEl:v},open:r,setOpen:a}}function Ft(e,t){const n=Ht(e);return Math.round(t*n)/n}function Ht(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function go(e,t,n={},o={}){const{...i}=n,l=it(e,t,i),r=It(l,o);return{...r,addNode:(g,m,h={})=>{const{parentId:p,...w}=h,v=it(g,m,w);return r.addNode(v,p)},getAllOpenNodes:()=>{const g=[];for(const m of r.nodeMap.values())m.data.open.value&&g.push(m);return g},getTopmostOpenNode:()=>{let g=null,m=-1;for(const h of r.nodeMap.values())if(h.data.open.value){const p=h.getPath().length;p>m&&(m=p,g=h)}return g},applyToNodes:(g,m,h={})=>{const{relationship:p="self-and-children",applyToMatching:w=!0}=h,v=r.findNodeById(g);if(!v)return;const E=[],O=new Set,T=y=>{y&&!O.has(y.id)&&(E.push(y),O.add(y.id))},A=y=>{for(const x of y)T(x)};if(p==="ancestors-only")for(const y of v.getPath())y.id!==v.id&&T(y);else if(p==="siblings-only"){if(v.parent.value)for(const y of v.parent.value.children.value)y.id!==v.id&&T(y)}else if(p==="descendants-only")for(const y of r.traverse("dfs",v))y.id!==v.id&&T(y);else if(p==="children-only")A(v.children.value);else if(p==="self-and-ancestors")A(v.getPath());else if(p==="self-and-children")T(v),A(v.children.value);else if(p==="self-and-descendants")A(r.traverse("dfs",v));else if(p==="self-and-siblings")T(v),v.parent.value&&A(v.parent.value.children.value);else if(p==="self-ancestors-and-children")A(v.getPath()),A(v.children.value);else if(p==="full-branch")A(v.getPath()),A(r.traverse("dfs",v));else if(p==="all-except-branch"){const y=new Set;for(const x of v.getPath())y.add(x.id);for(const x of r.traverse("dfs",v))y.add(x.id);for(const x of r.nodeMap.values())!y.has(x.id)===w&&m(x);return}else{console.warn(`applyToNodes: Unknown relationship "${p}".`);return}if(w)for(const y of E)m(y);else for(const y of r.nodeMap.values())O.has(y.id)||m(y)}}}function rt(e,t=null,n={},o=!1){const i=n.id??un(),l=u.shallowRef(t),r=u.shallowRef([]),a=u.computed(()=>r.value.length===0),d={id:i,data:e,parent:l,children:r,isRoot:o,isLeaf:a,addChild:c=>{r.value=[...r.value,c]},_removeChildInstance:c=>r.value.includes(c)?(r.value=r.value.filter(f=>f.id!==c.id),c.parent.value=null,!0):!1,findChild:c=>r.value.find(c)??null,findDescendant:c=>{const f=[d];for(;f.length>0;){const g=f.pop();if(c(g))return g;for(let m=g.children.value.length-1;m>=0;m--)f.push(g.children.value[m])}return null},isDescendantOf:c=>{let f=l.value;for(;f;){if(f.id===c.id)return!0;f=f.parent.value}return!1},getPath:()=>{const c=[];let f=d;for(;f;)c.push(f),f=f.parent.value;return c.reverse()}};return Object.freeze(d)}function It(e,t){const n=(t==null?void 0:t.deleteStrategy)??"recursive",o=u.shallowReactive(new Map),i=rt(e,null,{},!0);o.set(i.id,i);const l=m=>o.get(m)??null,r=(m,h=null,p={})=>{const w=h?l(h):i;if(!w)return console.error(`Tree addNode: Parent node with ID ${h} not found.`),null;p.id&&o.has(p.id)&&(p.id=void 0);const v=rt(m,w,p);return o.set(v.id,v),w.addChild(v),v},a=(m,h)=>{const p=h??n,w=l(m);if(!w)return!1;if(w.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const v=w.parent.value;if(p==="recursive")g(w);else{for(const E of w.children.value)E.parent.value=null;w.children.value=[],o.delete(w.id)}return v._removeChildInstance(w)},d=(m,h)=>{const p=l(m);if(!p)return console.error(`Tree moveNode: Node with ID ${m} not found.`),!1;if(p.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(m===h)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const w=h?l(h):i;if(!w)return console.error(`Tree moveNode: New parent node with ID ${h} not found.`),!1;if(w.isDescendantOf(p))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const v=p.parent.value;if(v){if(!v._removeChildInstance(p))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(p.isRoot){if(p.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return w.addChild(p),p.parent.value=w,!0},c=(m="dfs",h=i)=>{const p=[];if(!h)return console.warn("Tree traverse: Start node is null, returning empty array."),p;if(m==="dfs"){const w=[h];for(;w.length>0;){const v=w.pop();p.push(v);for(let E=v.children.value.length-1;E>=0;E--)w.push(v.children.value[E])}}else{const w=[h];for(;w.length>0;){const v=w.shift();p.push(v);for(const E of v.children.value)w.push(E)}}return p},f=()=>{o.clear()},g=m=>{const h=[...m.children.value];for(const p of h)g(p);o.delete(m.id),m.children.value=[]};return Object.freeze({get root(){return i},get nodeMap(){return o},findNodeById:l,addNode:r,removeNode:a,moveNode:d,traverse:c,dispose:f})}M.clearTimeoutIfSet=Ue,M.contains=Te,M.createTree=It,M.createTreeNode=rt,M.findDescendantContainingTarget=Oe,M.flip=co,M.getContextFromParameter=be,M.getCurrentTime=_e,M.getTarget=ct,M.hide=uo,M.isButtonTarget=Xe,M.isClickOnScrollbar=at,M.isEventTargetWithin=ze,M.isHTMLElement=lt,M.isMac=We,M.isMouseLikePointerType=$e,M.isSafari=Be,M.isSpaceIgnored=Ye,M.isTargetWithinElement=z,M.isTreeNode=ut,M.isTypeableElement=je,M.isVirtualElement=Jt,M.matchesFocusVisible=st,M.offset=lo,M.shift=ao,M.useArrow=mo,M.useClick=Qt,M.useClientPoint=nn,M.useEscapeKey=on,M.useFloating=it,M.useFloatingTree=go,M.useFocus=ln,M.useHover=mn,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-float",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Vue 3 port of Floating UI - a library for positioning floating elements",
5
5
  "private": false,
6
6
  "type": "module",
@@ -63,7 +63,7 @@
63
63
  "build-only": "vite build",
64
64
  "type-check": "vue-tsc --build tsconfig.build.json",
65
65
  "lint": "biome check --write",
66
- "test": "vitest --workspace=vitest.workspace.ts",
66
+ "test": "vitest",
67
67
  "docs:dev": "vitepress dev docs",
68
68
  "docs:build": "vitepress build docs",
69
69
  "docs:preview": "vitepress preview docs",
@@ -1,144 +0,0 @@
1
- import { Ref } from 'vue';
2
- /**
3
- * Options for creating a TreeNode
4
- */
5
- export interface TreeNodeOptions {
6
- /** Optional ID for the node. If not provided, one will be generated. */
7
- id?: string;
8
- }
9
- /**
10
- * Options for configuring tree behavior
11
- */
12
- export interface TreeOptions {
13
- /** Strategy for deleting child nodes when a parent is deleted.
14
- * - 'orphan': Children are detached from the tree (parent becomes null).
15
- * - 'recursive': Children are also deleted recursively.
16
- * @default 'recursive'
17
- */
18
- deleteStrategy?: "orphan" | "recursive";
19
- }
20
- /**
21
- * Represents a node in a reactive tree structure.
22
- * Each node contains data, parent reference, and children references.
23
- */
24
- export declare class TreeNode<T> {
25
- #private;
26
- readonly id: string;
27
- data: T;
28
- parent: Ref<TreeNode<T> | null>;
29
- children: Ref<TreeNode<T>[]>;
30
- constructor(data: T, parent?: TreeNode<T> | null, options?: TreeNodeOptions, isRoot?: boolean);
31
- /**
32
- * Adds an existing node instance to this node's children array.
33
- * @internal
34
- * @param childNode The TreeNode instance to add.
35
- */
36
- addChild(childNode: TreeNode<T>): void;
37
- /**
38
- * Removes a specific child node instance from this node's children.
39
- * @internal
40
- * Note: This only removes the direct child link. Use the Tree's `removeNode` method for full removal including map updates and recursive deletion.
41
- * @param childNode The child node instance to remove.
42
- * @returns True if the child was found and removed, false otherwise.
43
- */
44
- _removeChildInstance(childNode: TreeNode<T>): boolean;
45
- /**
46
- * Finds the first direct child matching the predicate.
47
- * @param predicate Function to test each child node.
48
- * @returns The matching child node or null if not found.
49
- */
50
- findChild(predicate: (node: TreeNode<T>) => boolean): TreeNode<T> | null;
51
- /**
52
- * Finds the first descendant node (including self) matching the predicate using DFS.
53
- * @param predicate Function to test each node.
54
- * @returns The matching descendant node or null if not found.
55
- */
56
- findDescendant(predicate: (node: TreeNode<T>) => boolean): TreeNode<T> | null;
57
- /**
58
- * Checks if this node is a descendant of the potential ancestor.
59
- * @param potentialAncestor The node to check against.
60
- * @returns True if this node is a descendant, false otherwise.
61
- */
62
- isDescendantOf(potentialAncestor: TreeNode<T>): boolean;
63
- /**
64
- * Gets the path of nodes from the root to this node.
65
- * @returns An array of nodes starting with the root and ending with this node.
66
- */
67
- getPath(): TreeNode<T>[];
68
- /** Checks if the node is the true root of the tree, distinct from an orphaned node. */
69
- get isRoot(): boolean;
70
- /** Checks if the node is a leaf node (has no children). */
71
- get isLeaf(): boolean;
72
- }
73
- /**
74
- * Manages a reactive tree structure.
75
- *
76
- * This class provides a complete tree data structure with reactive nodes,
77
- * supporting operations like adding, removing, and moving nodes, as well as
78
- * traversal and search functionality.
79
- *
80
- * @template T The type of data stored in the tree nodes.
81
- */
82
- export declare class Tree<T> {
83
- #private;
84
- /** The root node of the tree. */
85
- readonly root: TreeNode<T>;
86
- /** Readonly reactive map of node IDs to TreeNode instances for quick lookups. */
87
- readonly nodeMap: Readonly<Map<string, TreeNode<T>>>;
88
- /**
89
- * Creates a new Tree instance.
90
- * @param initialRootData Data for the root node.
91
- * @param options Configuration options for the tree behavior.
92
- *
93
- * @example
94
- * ```ts
95
- * const myTree = new Tree({ name: 'Root' });
96
- * const childNode = myTree.addNode({ name: 'Child' }, myTree.root.id);
97
- * ```
98
- */
99
- constructor(initialRootData: T, options?: TreeOptions);
100
- /**
101
- * Finds a node anywhere in the tree by its ID.
102
- * @param id The ID of the node to find.
103
- * @returns The node if found, otherwise null.
104
- */
105
- findNodeById(id: string): TreeNode<T> | null;
106
- /**
107
- * Adds a new node to the tree.
108
- * @param data The data for the new node.
109
- * @param parentId The ID of the parent node. If null or undefined, adds to the root.
110
- * @param nodeOptions Optional configuration for the new node (e.g., custom ID).
111
- * @returns The newly created TreeNode, or null if the parent was not found.
112
- */
113
- addNode(data: T, parentId?: string | null, nodeOptions?: TreeNodeOptions): TreeNode<T> | null;
114
- /**
115
- * Removes a node from the tree by its ID.
116
- * Handles deletion of descendants based on the provided strategy or the tree's default.
117
- * @param nodeId The ID of the node to remove.
118
- * @param deleteStrategy Optional strategy override. If not provided, uses the tree's default strategy.
119
- * @returns True if the node was successfully removed, false otherwise.
120
- */
121
- removeNode(nodeId: string, deleteStrategy?: "orphan" | "recursive"): boolean;
122
- /**
123
- * Moves a node to become a child of a new parent.
124
- * @param nodeId The ID of the node to move.
125
- * @param newParentId The ID of the new parent node. Set to null to move to the root level.
126
- * @returns True if the node was successfully moved, false otherwise.
127
- */
128
- moveNode(nodeId: string, newParentId: string | null): boolean;
129
- /**
130
- * Traverses the tree using either Depth-First Search (DFS) or Breadth-First Search (BFS).
131
- * @param strategy The traversal strategy ('dfs' or 'bfs'). Defaults to 'dfs'.
132
- * @param startNode The node to start traversal from. Defaults to the root node.
133
- * @returns An array of nodes in the order they were visited.
134
- */
135
- traverse(strategy?: "dfs" | "bfs", startNode?: TreeNode<T> | null): TreeNode<T>[];
136
- /**
137
- * Clears the internal node map. This is crucial for allowing garbage collection
138
- * when the Tree instance is no longer needed, especially in scenarios like
139
- * Vue components where the instance might be tied to the component lifecycle.
140
- * Call this method when you are finished with the Tree instance (e.g., in `onScopeDispose`).
141
- */
142
- dispose(): void;
143
- }
144
- //# sourceMappingURL=use-tree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["../../src/composables/use-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAA+B,MAAM,KAAK,CAAA;AAO3D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAE1B;;;;OAIG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;CACxC;AAQD;;;GAGG;AACH,qBAAa,QAAQ,CAAC,CAAC;;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC/B,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;gBAI1B,IAAI,EAAE,CAAC,EACP,MAAM,GAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAW,EACjC,OAAO,GAAE,eAAoB,EAC7B,MAAM,UAAQ;IAShB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAKtC;;;;;;OAMG;IACH,oBAAoB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO;IAQrD;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAIxE;;;;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAiB7E;;;;OAIG;IACH,cAAc,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO;IAWvD;;;OAGG;IACH,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE;IAUxB,uFAAuF;IACvF,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,2DAA2D;IAC3D,IAAI,MAAM,IAAI,OAAO,CAEpB;CACF;AAMD;;;;;;;;GAQG;AACH,qBAAa,IAAI,CAAC,CAAC;;IACjB,iCAAiC;IACjC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAIpD;;;;;;;;;;OAUG;gBACS,eAAe,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,WAAW;IAQrD;;;;OAIG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAI5C;;;;;;OAMG;IACH,OAAO,CACL,IAAI,EAAE,CAAC,EACP,QAAQ,GAAE,MAAM,GAAG,IAAW,EAC9B,WAAW,GAAE,eAAoB,GAChC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAqBrB;;;;;;OAMG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO;IAkC5E;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;IAqD7D;;;;;OAKG;IACH,QAAQ,CACN,QAAQ,GAAE,KAAK,GAAG,KAAa,EAC/B,SAAS,GAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAgB,GACxC,QAAQ,CAAC,CAAC,CAAC,EAAE;IAkChB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAiBhB"}