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