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