1import{r as s,j as E}from"./index-DmJY3Tg5.js";import{M as A,i as D,u as b,P as H,a as K,b as U,L as B}from"./proxy-BSHTePuK.js";function I(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function F(...e){return r=>{let t=!1;const i=e.map(u=>{const n=I(u,r);return!t&&typeof n=="function"&&(t=!0),n});if(t)return()=>{for(let u=0;u<i.length;u++){const n=i[u];typeof n=="function"?n():I(e[u],null)}}}}function G(...e){return s.useCallback(F(...e),e)}class T extends s.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(t&&r.isPresent&&!this.props.isPresent){const i=t.offsetParent,u=D(i)&&i.offsetWidth||0,n=this.props.sizeRef.current;n.height=t.offsetHeight||0,n.width=t.offsetWidth||0,n.top=t.offsetTop,n.left=t.offsetLeft,n.right=u-n.width-n.left}return null}componentDidUpdate(){}render(){return this.props.children}}function V({children:e,isPresent:r,anchorX:t,root:i}){var h;const u=s.useId(),n=s.useRef(null),d=s.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:y}=s.useContext(A),P=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),c=G(n,P);return s.useInsertionEffect(()=>{const{width:f,height:l,top:a,left:m,right:C}=d.current;if(r||!n.current||!f||!l)return;const w=t==="left"?`left: ${m}`:`right: ${C}`;n.current.dataset.motionPopId=u;const x=document.createElement("style");y&&(x.nonce=y);const M=i??document.head;return M.appendChild(x),x.sheet&&x.sheet.insertRule(` 2 [data-motion-pop-id="${u}"] { 3 position: absolute !important; 4 width: ${f}px !important; 5 height: ${l}px !important; 6 ${w}px !important; 7 top: ${a}px !important; 8 } 9 `),()=>{M.contains(x)&&M.removeChild(x)}},[r]),E.jsx(T,{isPresent:r,childRef:n,sizeRef:d,children:s.cloneElement(e,{ref:c})})}const X=({children:e,initial:r,isPresent:t,onExitComplete:i,custom:u,presenceAffectsLayout:n,mode:d,anchorX:y,root:P})=>{const c=b(_),h=s.useId();let f=!0,l=s.useMemo(()=>(f=!1,{id:h,initial:r,isPresent:t,custom:u,onExitComplete:a=>{c.set(a,!0);for(const m of c.values())if(!m)return;i&&i()},register:a=>(c.set(a,!1),()=>c.delete(a))}),[t,c,i]);return n&&f&&(l={...l}),s.useMemo(()=>{c.forEach((a,m)=>c.set(m,!1))},[t]),s.useEffect(()=>{!t&&!c.size&&i&&i()},[t]),d==="popLayout"&&(e=E.jsx(V,{isPresent:t,anchorX:y,root:P,children:e})),E.jsx(H.Provider,{value:l,children:e})};function _(){return new Map}const j=e=>e.key||"";function S(e){const r=[];return s.Children.forEach(e,t=>{s.isValidElement(t)&&r.push(t)}),r}const N=({children:e,custom:r,initial:t=!0,onExitComplete:i,presenceAffectsLayout:u=!0,mode:n="sync",propagate:d=!1,anchorX:y="left",root:P})=>{const[c,h]=K(d),f=s.useMemo(()=>S(e),[e]),l=d&&!c?[]:f.map(j),a=s.useRef(!0),m=s.useRef(f),C=b(()=>new Map),w=s.useRef(new Set),[x,M]=s.useState(f),[g,v]=s.useState(f);U(()=>{a.current=!1,m.current=f;for(let p=0;p<g.length;p++){const o=j(g[p]);l.includes(o)?(C.delete(o),w.current.delete(o)):C.get(o)!==!0&&C.set(o,!1)}},[g,l.length,l.join("-")]);const $=[];if(f!==x){let p=[...f];for(let o=0;o<g.length;o++){const R=g[o],k=j(R);l.includes(k)||(p.splice(o,0,R),$.push(R))}return n==="wait"&&$.length&&(p=$),v(S(p)),M(f),null}const{forceRender:L}=s.useContext(B);return E.jsx(E.Fragment,{children:g.map(p=>{const o=j(p),R=d&&!c?!1:f===g||l.includes(o),k=()=>{if(w.current.has(o))return;if(w.current.add(o),C.has(o))C.set(o,!0);else return;let z=!0;C.forEach(W=>{W||(z=!1)}),z&&(L==null||L(),v(m.current),d&&(h==null||h()),i&&i())};return E.jsx(X,{isPresent:R,initial:!a.current||t?void 0:!1,custom:r,presenceAffectsLayout:u,mode:n,root:P,onExitComplete:R?void 0:k,anchorX:y,children:p},o)})})};export{N as A};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.