import{n as e,s as t}from"./rolldown-runtime-BG2f4sTM.js";import{Dvt as n,Eut as r,Mvt as i,Nvt as a,Tut as o,Ylt as s,Zlt as c,act as l,ict as u,oct as d,rct as f}from"./app-initial-BHB6SClA.js";function p(e){let t=(0,g.c)(12),{children:n,className:i,handoff:a,presentationAnchorRef:o,style:s,surface:l}=e,u=c(),d=r(),f=(0,_.useRef)(null),p=(0,_.useRef)(null),h;t[0]!==a||t[1]!==o||t[2]!==d||t[3]!==l||t[4]!==u?(h=e=>{if(o?.(e),f.current?.cancel(),f.current=null,a==null){p.current=null;return}e==null||p.current===a.sequence||(p.current=a.sequence,f.current=m(e,a,l,u,d))},t[0]=a,t[1]=o,t[2]=d,t[3]=l,t[4]=u,t[5]=h):h=t[5];let y=h,b;return t[6]!==n||t[7]!==i||t[8]!==s||t[9]!==l||t[10]!==y?(b=(0,v.jsx)(`div`,{ref:y,className:i,"data-realtime-voice-handoff-target":l,style:s,children:n}),t[6]=n,t[7]=i,t[8]=s,t[9]=l,t[10]=y,t[11]=b):b=t[11],b}function m(e,t,n,r,i){if(typeof e.animate!=`function`||i)return null;if(n===`global-overlay`&&t.from===`main-thread`)return e.animate([{opacity:.96},{opacity:1}],{duration:90,easing:y,fill:`backwards`});let a=l(e.getBoundingClientRect(),{screenX:window.screenX,screenY:window.screenY}),o=t.origin==null?h(t.from):f(t.origin,a,r,n===`main-thread`?300:180);if(n===`main-thread`&&Math.hypot(o.x,o.y)<4)return e.animate([{filter:`blur(1.5px)`,opacity:.96},{filter:`blur(0px)`,opacity:1}],{duration:120,easing:y,fill:`backwards`});let s=t.velocity==null?{x:0,y:0}:u(t.velocity,r,n===`main-thread`?56:48),c=n===`main-thread`?.86:.82;t.origin!=null&&a.width!==0&&(c=Math.min(1.12,Math.max(.82,t.origin.width/a.width)));let d=Math.min(3,Math.max(-3,o.x/40)),p={x:o.x*.3+s.x,y:o.y*.3+s.y};return e.animate([{opacity:n===`main-thread`?.88:.82,transform:`translate3d(${o.x}px, ${o.y}px, 0) scale(${c}) rotate(${d}deg)`},{opacity:1,transform:`translate3d(${p.x}px, ${p.y}px, 0) scale(1.045) rotate(${d*-.35}deg)`,offset:.46},{opacity:1,transform:`translate3d(${p.y*-.045}px, ${p.x*.045-2}px, 0) scale(1.018) rotate(0deg)`,offset:.8},{opacity:1,transform:`translate3d(0, 0, 0) scale(1) rotate(0deg)`}],{delay:n===`global-overlay`?24:0,duration:n===`main-thread`?300:280,easing:y,fill:`backwards`})}function h(e){switch(e){case`global-overlay`:return{x:0,y:-28};case`main-thread`:return{x:0,y:18}}}var g,_,v,y,b=e((()=>{g=i(),_=t(a(),1),s(),o(),d(),v=n(),y=`cubic-bezier(0.22, 1, 0.36, 1)`}));export{b as n,p as t};
//# sourceMappingURL=realtime-voice-handoff-target-C5T0-pQL.js.map