1import{r as n,j as w}from"./vendor-react-CT5JKzvF.js";import{M as T,a as S,u as A,P as D,b as K,c as U,L as W}from"./proxy-Dz7iWkqj.js";function z(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function B(...e){return r=>{let t=!1;const o=e.map(f=>{const c=z(f,r);return!t&&typeof c=="function"&&(t=!0),c});if(t)return()=>{for(let f=0;f<o.length;f++){const c=o[f];typeof c=="function"?c():z(e[f],null)}}}}function G(...e){return n.useCallback(B(...e),e)}class V extends n.Component{getSnapshotBeforeUpdate(r){const t=this.props.childRef.current;if(S(t)&&r.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const o=t.offsetParent,f=S(o)&&o.offsetWidth||0,c=S(o)&&o.offsetHeight||0,p=getComputedStyle(t),s=this.props.sizeRef.current;s.height=parseFloat(p.height),s.width=parseFloat(p.width),s.top=t.offsetTop,s.left=t.offsetLeft,s.right=f-s.width-s.left,s.bottom=c-s.height-s.top}return null}componentDidUpdate(){}render(){return this.props.children}}function X({children:e,isPresent:r,anchorX:t,anchorY:o,root:f,pop:c}){const p=n.useId(),s=n.useRef(null),g=n.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:R}=n.useContext(T),a=e.props?.ref??e?.ref,P=G(s,a);return n.useInsertionEffect(()=>{const{width:u,height:d,top:h,left:C,right:x,bottom:M}=g.current;if(r||c===!1||!s.current||!u||!d)return;const $=t==="left"?`left: ${C}`:`right: ${x}`,j=o==="bottom"?`bottom: ${M}`:`top: ${h}`;s.current.dataset.motionPopId=p;const l=document.createElement("style");R&&(l.nonce=R);const y=f??document.head;return y.appendChild(l),l.sheet&&l.sheet.insertRule(` 2 [data-motion-pop-id="${p}"] { 3 position: absolute !important; 4 width: ${u}px !important; 5 height: ${d}px !important; 6 ${$}px !important; 7 ${j}px !important; 8 } 9 `),()=>{s.current?.removeAttribute("data-motion-pop-id"),y.contains(l)&&y.removeChild(l)}},[r]),w.jsx(V,{isPresent:r,childRef:s,sizeRef:g,pop:c,children:c===!1?e:n.cloneElement(e,{ref:P})})}const Y=({children:e,initial:r,isPresent:t,onExitComplete:o,custom:f,presenceAffectsLayout:c,mode:p,anchorX:s,anchorY:g,root:R})=>{const a=A(_),P=n.useId();let u=!0,d=n.useMemo(()=>(u=!1,{id:P,initial:r,isPresent:t,custom:f,onExitComplete:h=>{a.set(h,!0);for(const C of a.values())if(!C)return;o&&o()},register:h=>(a.set(h,!1),()=>a.delete(h))}),[t,a,o]);return c&&u&&(d={...d}),n.useMemo(()=>{a.forEach((h,C)=>a.set(C,!1))},[t]),n.useEffect(()=>{!t&&!a.size&&o&&o()},[t]),e=w.jsx(X,{pop:p==="popLayout",isPresent:t,anchorX:s,anchorY:g,root:R,children:e}),w.jsx(D.Provider,{value:d,children:e})};function _(){return new Map}const b=e=>e.key||"";function I(e){const r=[];return n.Children.forEach(e,t=>{n.isValidElement(t)&&r.push(t)}),r}const N=({children:e,custom:r,initial:t=!0,onExitComplete:o,presenceAffectsLayout:f=!0,mode:c="sync",propagate:p=!1,anchorX:s="left",anchorY:g="top",root:R})=>{const[a,P]=K(p),u=n.useMemo(()=>I(e),[e]),d=p&&!a?[]:u.map(b),h=n.useRef(!0),C=n.useRef(u),x=A(()=>new Map),M=n.useRef(new Set),[$,j]=n.useState(u),[l,y]=n.useState(u);U(()=>{h.current=!1,C.current=u;for(let m=0;m<l.length;m++){const i=b(l[m]);d.includes(i)?(x.delete(i),M.current.delete(i)):x.get(i)!==!0&&x.set(i,!1)}},[l,d.length,d.join("-")]);const v=[];if(u!==$){let m=[...u];for(let i=0;i<l.length;i++){const E=l[i],L=b(E);d.includes(L)||(m.splice(i,0,E),v.push(E))}return c==="wait"&&v.length&&(m=v),y(I(m)),j(u),null}const{forceRender:F}=n.useContext(W);return w.jsx(w.Fragment,{children:l.map(m=>{const i=b(m),E=p&&!a?!1:u===l||d.includes(i),L=()=>
9{if(M.current.has(i))return;if(x.has(i))M.current.add(i),x.set(i,!0);else return;let k=!0;x.forEach(H=>{H||(k=!1)}),k&&(F?.(),y(C.current),p&&P?.(),o&&o())};return w.jsx(Y,{isPresent:E,initial:!h.current||t?void 0:!1,custom:r,presenceAffectsLayout:f,mode:c,root:R,onExitComplete:E?void 0:L,anchorX:s,anchorY:g,children:m},i)})})};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.