import{u as m,i as O,o as k,c as T,r as w,a as x,b as N,d as L,w as R,g as C,p as A,e as M,n as P,f as B,h as D}from"./@vue-DuIk5FiX.js";var f=typeof window<"u";function E(n){return f?requestAnimationFrame(n):-1}function z(n){E(()=>E(n))}var W=n=>n===window,y=(n,e)=>({top:0,left:0,right:n,bottom:e,width:n,height:e}),q=n=>{const e=m(n);if(W(e)){const t=e.innerWidth,i=e.innerHeight;return y(t,i)}return e!=null&&e.getBoundingClientRect?e.getBoundingClientRect():y(0,0)};function F(n){const e=O(n,null);if(e){const t=C(),{link:i,unlink:r,internalChildren:o}=e;i(t),k(()=>r(t));const s=T(()=>o.indexOf(t));return{parent:e,index:s}}return{parent:null,index:w(-1)}}function _(n){const e=[],t=i=>{Array.isArray(i)&&i.forEach(r=>{var o;D(r)&&(e.push(r),(o=r.component)!=null&&o.subTree&&(e.push(r.component.subTree),t(r.component.subTree.children)),r.children&&t(r.children))})};return t(n),e}var b=(n,e)=>{const t=n.indexOf(e);return t===-1?n.findIndex(i=>e.key!==void 0&&e.key!==null&&i.type===e.type&&i.key===e.key):t};function S(n,e,t){const i=_(n.subTree.children);t.sort((o,s)=>b(i,o.vnode)-b(i,s.vnode));const r=t.map(o=>o.proxy);e.sort((o,s)=>{const u=r.indexOf(o),a=r.indexOf(s);return u-a})}function U(n){const e=x([]),t=x([]),i=C();return{children:e,linkChildren:o=>{A(n,Object.assign({link:a=>{a.proxy&&(t.push(a),e.push(a.proxy),S(i,e,t))},unlink:a=>{const d=t.indexOf(a);e.splice(d,1),t.splice(d,1)},children:e,internalChildren:t},o))}}}function V(n){let e;M(()=>{n(),P(()=>{e=!0})}),B(()=>{e&&n()})}function G(n,e,t={}){if(!f)return;const{target:i=window,passive:r=!1,capture:o=!1}=t;let s=!1,u;const a=l=>{if(s)return;const c=m(l);c&&!u&&(c.addEventListener(n,e,{capture:o,passive:r}),u=!0)},d=l=>{if(s)return;const c=m(l);c&&u&&(c.removeEventListener(n,e,o),u=!1)};k(()=>d(i)),N(()=>d(i)),V(()=>a(i));let h;return L(i)&&(h=R(i,(l,c)=>{d(c),a(l)})),()=>{h==null||h(),d(i),s=!0}}var v,g;function J(){if(!v&&(v=w(0),g=w(0),f)){const n=()=>{v.value=window.innerWidth,g.value=window.innerHeight};n(),window.addEventListener("resize",n,{passive:!0}),window.addEventListener("orientationchange",n,{passive:!0})}return{width:v,height:g}}var Y=/scroll|auto|overlay/i,H=f?window:void 0;function I(n){return n.tagName!=="HTML"&&n.tagName!=="BODY"&&n.nodeType===1}function K(n,e=H){let t=n;for(;t&&t!==e&&I(t);){const{overflowY:i}=window.getComputedStyle(t);if(Y.test(i))return t;t=t.parentNode}return e}var p;function Q(){if(!p&&(p=w("visible"),f)){const n=()=>{p.value=document.hidden?"hidden":"visible"};n(),window.addEventListener("visibilitychange",n)}return p}export{U as a,Q as b,G as c,z as d,F as e,q as f,K as g,f as i,J as u};
