@ssgoi/core 6.6.6 → 6.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
transform: scaleY(${o==="hidden"?0:1});
|
|
28
28
|
transform-origin: ${i==="left"?"top":"bottom"} center;
|
|
29
29
|
will-change: transform;
|
|
30
|
-
`}r.push(d),a.appendChild(d)}return e.appendChild(a),{container:a,blinds:r}}const Oe=(e={})=>{const t=e.blindCount??_e,n=e.direction??Ie,s=e.blindColor??ve,o=e.physics??Pe;return{prepare:async({from:i,to:l})=>{const a=await i,r=await l;a.style.zIndex="1000";const c=mt(a,t,n,s,"hidden","left");r.style.position="relative",r.style.zIndex="0";const d=mt(r,t,n,s,"closed","right");return{fromEl:a,fromBlinds:c.blinds,fromContainer:c.container,toBlinds:d.blinds,toContainer:d.container}},animation:({fromEl:i,fromBlinds:l,fromContainer:a,toBlinds:r,toContainer:c})=>{const d=l.map(y=>new u.WebAnimation({element:y,integrator:g.from(o),style:h=>({transform:n==="horizontal"?`scaleX(${h})`:`scaleY(${h})`})})),p=r.map((y,h)=>new u.WebAnimation({element:y,integrator:g.from(o),style:(b,w)=>({transform:n==="horizontal"?`scaleX(${w})`:`scaleY(${w})`}),onComplete:h===r.length-1?()=>{c.remove(),a.remove(),i.style.zIndex="",i.style.position=""}:void 0})),f=new u.MultiAnimation(d,{mode:"parallel"}),m=new u.MultiAnimation(p,{mode:"parallel"});return new u.MultiAnimation([f,m],{mode:"sequence"})}}};function Te(e){const{paths:t,type:n="horizontal"}=e;return _(t,()=>Oe({direction:n}))}const De={spring:{stiffness:200,damping:20,doubleSpring:.7}},k=.5;function Fe(e){const t=e==="enter"?-100:100,n=e==="enter"?100:-100;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${t*s}%, 0, 0)`,opacity:`${k+(1-k)*(1-s)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${n}%, 0, 0)`,opacity:`${k}`},animate:s=>({transform:`translate3d(${n*(1-s)}%, 0, 0)`,opacity:`${k+(1-k)*s}`})}}}function ke(){return{physics:De,build:Fe}}const Ye={spring:{stiffness:
|
|
30
|
+
`}r.push(d),a.appendChild(d)}return e.appendChild(a),{container:a,blinds:r}}const Oe=(e={})=>{const t=e.blindCount??_e,n=e.direction??Ie,s=e.blindColor??ve,o=e.physics??Pe;return{prepare:async({from:i,to:l})=>{const a=await i,r=await l;a.style.zIndex="1000";const c=mt(a,t,n,s,"hidden","left");r.style.position="relative",r.style.zIndex="0";const d=mt(r,t,n,s,"closed","right");return{fromEl:a,fromBlinds:c.blinds,fromContainer:c.container,toBlinds:d.blinds,toContainer:d.container}},animation:({fromEl:i,fromBlinds:l,fromContainer:a,toBlinds:r,toContainer:c})=>{const d=l.map(y=>new u.WebAnimation({element:y,integrator:g.from(o),style:h=>({transform:n==="horizontal"?`scaleX(${h})`:`scaleY(${h})`})})),p=r.map((y,h)=>new u.WebAnimation({element:y,integrator:g.from(o),style:(b,w)=>({transform:n==="horizontal"?`scaleX(${w})`:`scaleY(${w})`}),onComplete:h===r.length-1?()=>{c.remove(),a.remove(),i.style.zIndex="",i.style.position=""}:void 0})),f=new u.MultiAnimation(d,{mode:"parallel"}),m=new u.MultiAnimation(p,{mode:"parallel"});return new u.MultiAnimation([f,m],{mode:"sequence"})}}};function Te(e){const{paths:t,type:n="horizontal"}=e;return _(t,()=>Oe({direction:n}))}const De={spring:{stiffness:200,damping:20,doubleSpring:.7}},k=.5;function Fe(e){const t=e==="enter"?-100:100,n=e==="enter"?100:-100;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${t*s}%, 0, 0)`,opacity:`${k+(1-k)*(1-s)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${n}%, 0, 0)`,opacity:`${k}`},animate:s=>({transform:`translate3d(${n*(1-s)}%, 0, 0)`,opacity:`${k+(1-k)*s}`})}}}function ke(){return{physics:De,build:Fe}}const Ye={spring:{stiffness:230,damping:25,doubleSpring:{stiffness:230,damping:24}}};function Le(e){const t=e==="enter"?-20:100,n=e==="enter"?100:-20;return{out:{willChange:"transform",startStyle:{},animate:s=>({transform:`translate3d(${t*s}%, 0, 0)`})},in:{willChange:"transform",startStyle:{transform:`translate3d(${n}%, 0, 0)`},animate:s=>({transform:`translate3d(${n*(1-s)}%, 0, 0)`})}}}function Me(){return{physics:Ye,build:Le}}const He={parallax:Me(),crossfade:ke()},I="0",kt="1",v="2",We="parallax";function gt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,s]of Object.entries(t.startStyle))e.style[n]=s}const ze=(e={})=>{const t=e.direction??"enter",n=He[e.type??We],s=n.physics,o=n.build(t),i=t==="enter"?I:v,l=t==="enter"?v:I;return{prepare:({from:a,to:r})=>(a.then(c=>{gt(c,o.out),c.style.pointerEvents="none",c.style.zIndex=i}),r.then(c=>{gt(c,o.in),c.style.position="relative",c.style.zIndex=l}),{}),animation:({from:a,to:r})=>{const c=new u.WebAnimation({element:a,integrator:g.from(s),style:p=>o.out.animate(p),onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.transform="",a.style.opacity="",a.style.pointerEvents="",a.style.zIndex=""}}),d=new u.WebAnimation({element:r,integrator:g.from(s),style:p=>o.in.animate(p),onComplete:()=>{r.style.willChange="auto",r.style.backfaceVisibility="",r.style.contain="",r.style.transform="",r.style.opacity="",r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===l&&(r.style.zIndex="")}});for(const p of[c,d]){const f=p.onComplete;p.onComplete=()=>{f==null||f(),p.releaseFill()}}return new u.MultiAnimation([c,d],{mode:"parallel"})}}};function Re(e){return e==="slide"||e==="crossfade"?"crossfade":"parallax"}function Ue(e){const{enter:t,exit:n}=e,s=e.type,o=Re(s);return Tt({enter:t,exit:n},i=>ze({direction:i,type:o}))}const Ne={spring:{stiffness:180,damping:20,doubleSpring:!0}},Ve={spring:{stiffness:170,damping:20,doubleSpring:!0}},Xe=(e={})=>{const t=e.physics??Ve,n=e.physics??Ne;return{prepare:({to:s})=>(s.then(o=>{o.style.opacity="0",o.style.willChange="opacity"}),{}),animation:({from:s,to:o})=>{const i=new u.WebAnimation({element:s,integrator:g.from(n),style:(a,r)=>({opacity:r}),onComplete:()=>{s.style.willChange="auto",s.style.opacity=""}}),l=new u.WebAnimation({element:o,integrator:g.from(t),style:a=>({opacity:a}),onComplete:()=>{o.style.willChange="auto",o.style.opacity=""}});return new u.MultiAnimation([i,l],{mode:"sequence"})}}};function Be(e){const{paths:t}=e;return _(t,()=>Xe())}const B={scaleDown:{stiffness:20,damping:7},translate:{stiffness:15,damping:7},scaleUp:{stiffness:20,damping:7}},D={scaleDown:0,translate:.2,scaleUp:.8},Ze=.8,qe="white",bt=1e3/60,je=600;function Ke(e){const{items:t,from:n,to:s,recordFrame:o}=e,i=bt/1e3,l=Math.abs(s-n),a=t.map(c=>({item:c,integrator:new H({stiffness:c.spring.stiffness,damping:c.spring.damping}),state:{position:n,velocity:0},started:!1,settled:!1,settleTime:0}));for(let c=0;c<a.length;c++)(c===0||a[c].item.offset===0)&&(a[c].started=!0);o(0);let r=0;for(let c=1;c<=je;c++){const d=c*bt;r=d;for(const p of a)!p.started||p.settled||(p.state=p.integrator.step(p.state,s,i),p.integrator.isSettled(p.state,s)?(p.settleTime+=i,p.settleTime>=u.SETTLE_THRESHOLD&&(p.state={position:s,velocity:0},p.settled=!0)):p.settleTime=0,p.item.tick(p.state.position));for(let p=1;p<a.length;p++){const f=a[p];if(f.started)continue;const m=a[p-1];if(!m.started)continue;(l===0?1:Math.abs(m.state.position-n)/l)>=f.item.offset&&(f.started=!0)}if(o(d),a.every(p=>p.settled))return d}return r}function Z(e,t){return e!=null&&e.spring?{stiffness:e.spring.stiffness,damping:e.spring.damping}:t}function wt(e){const{rect:t,scale:n,direction:s,override:o}=e,i=s==="out"?{scale:1,translateY:-t.top}:{scale:n,translateY:-t.top+t.height},l=Z(o,B.scaleDown),a=Z(o,B.translate),r=Z(o,B.scaleUp),c=s==="out"?1:0,d=s==="out"?0:1,p=s==="out"?[{spring:l,offset:D.scaleDown,tick:y=>{const h=1-y;i.scale=1-(1-n)*h}},{spring:a,offset:D.translate,tick:y=>{const h=1-y;i.translateY=-t.top-t.height*h}},{spring:r,offset:D.scaleUp,tick:y=>{const h=1-y;i.scale=n+(1-n)*h}}]:[{spring:l,offset:D.scaleDown,tick:y=>{i.scale=1-(1-n)*y}},{spring:a,offset:D.translate,tick:y=>{i.translateY=-t.top+t.height*(1-y)}},{spring:r,offset:D.scaleUp,tick:y=>{i.scale=n+(1-n)*y}}],f=[],m=Ke({items:p,from:c,to:d,recordFrame:y=>f.push({time:y,scale:i.scale,translateY:i.translateY})});return{snapshots:f,totalDuration:m}}function Ge(e,t){if(e.length===0)return{time:0,scale:1,translateY:0};if(e.length===1||t<=0)return e[0];if(t>=1)return e[e.length-1];const n=t*(e.length-1),s=Math.floor(n),o=Math.ceil(n);if(s===o)return e[s];const i=e[s],l=e[o],a=n-s;return{time:i.time+(l.time-i.time)*a,scale:i.scale+(l.scale-i.scale)*a,translateY:i.translateY+(l.translateY-i.translateY)*a}}const Je=[[1,1],[-1,1],[1,-1],[-1,-1]];function Qe(e,t){const o=(i,l,a)=>{const r=document.createElement("div");Object.assign(r.style,{position:"fixed",pointerEvents:"none",zIndex:"9999",width:"15px",height:"15px",...i});const c=document.createElement("div");Object.assign(c.style,{position:"absolute",width:"15px",height:"1px",backgroundColor:e,[a]:"0",[l]:"0"});const d=document.createElement("div");return Object.assign(d.style,{position:"absolute",width:"1px",height:"15px",backgroundColor:e,[a]:"0",[l]:"0"}),r.appendChild(c),r.appendChild(d),r};return{topLeft:o({top:`${t.top-1}px`,left:`${t.left-1}px`},"left","top"),topRight:o({top:`${t.top-1}px`,left:`${t.left+t.width-15+1}px`},"right","top"),bottomLeft:o({top:`${t.top+t.height-15+1}px`,left:`${t.left-1}px`},"left","bottom"),bottomRight:o({top:`${t.top+t.height-15+1}px`,left:`${t.left+t.width-15+1}px`},"right","bottom")}}function St(e,t){const n=t.left+t.width/2,s=t.top+t.height/2;e.style.transformOrigin=`${n}px ${s}px`}function $t(e,t){e.style.clipPath=`polygon(
|
|
31
31
|
${t.left}px ${t.top}px,
|
|
32
32
|
${t.left+t.width}px ${t.top}px,
|
|
33
33
|
${t.left+t.width}px ${t.top+t.height}px,
|
|
34
34
|
${t.left}px ${t.top+t.height}px
|
|
35
|
-
)`}function q(e,t,n,s,o){const i=n/1e3;return new u.WebAnimation({element:e,integrator:new jt({durationSec:i}),lowerBound:0,upperBound:1,style:l=>s(Ge(t,l)),onComplete:o})}const tn=(e={})=>{var o;const t=((o=e.border)==null?void 0:o.color)??qe,n=Ze,s=e.physics;return{prepare:({from:i,to:l,context:a})=>{const r=O(a,"from"),c=O(a,"to"),d=R(document.body,a.positionedParent),p=Qe(t,{...r,top:d.top});for(const f of["topLeft","topRight","bottomLeft","bottomRight"])a.positionedParent.appendChild(p[f]);return i.then(f=>{St(f,r),$t(f,r),f.style.transform=`translateY(${-r.top}px)`}),l.then(f=>{St(f,c),$t(f,c),f.style.transform=`translateY(${-c.top+c.height}px) scale(${n})`}),{borders:p,fromRect:r,toRect:c}},animation:({from:i,to:l,context:a,borders:r,fromRect:c,toRect:d})=>{const p=wt({rect:c,scale:n,direction:"out",override:s}),f=wt({rect:d,scale:n,direction:"in",override:s}),m=q(i,p.snapshots,p.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin="",i.style.transform=""}),y=q(l,f.snapshots,f.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{l.style.clipPath="",l.style.transformOrigin="",l.style.transform=""}),h=Je.map(([S,x],$)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][$];return q(r[C],p.snapshots,p.totalDuration,P=>{const A=(c.width-c.width*P.scale)/2*.7*S,F=(c.height-c.height*P.scale)/2*.7*x;return{transform:`translate(${A}px, ${F}px)`}})}),b=new u.MultiAnimation([m,y,...h],{mode:"parallel"}),w=b.onComplete;return b.onComplete=()=>{w==null||w();const S=a.positionedParent;for(const x of["topLeft","topRight","bottomLeft","bottomRight"]){const $=r[x];$.parentElement===S&&S.removeChild($)}},b}}};function en(e){const{paths:t,options:n}=e,s=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return _(t,()=>tn(s))}const Ct="data-hero-enter-key",Et="data-hero-exit-key",j="data-hero-key";class nn{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const sn=()=>new nn;class on{contribute(t){const{from:n,to:s,physics:o,onComplete:i}=t,l=n.style.opacity,a=s.style.opacity,r=n.style.willChange,c=s.style.willChange;return s.style.opacity="0",n.style.willChange="opacity",s.style.willChange="opacity",i(()=>{n.style.opacity=l,s.style.opacity=a,n.style.willChange=r,s.style.willChange=c}),[new u.WebAnimation({element:n,integrator:g.from(o),style:(d,p)=>({opacity:p})}),new u.WebAnimation({element:s,integrator:g.from(o),style:d=>({opacity:d})})]}}const rn=()=>new on,an={static:sn,fade:rn},ln={spring:{stiffness:320,damping:30}},cn=()=>ln,pn={spring:{stiffness:300,damping:30,doubleSpring:1}},dn=()=>pn,fn={default:cn,smooth:dn},yn=700,hn="data-hero-aspect-ratio",un="data-hero-radius";function mn(e){if(!e)return null;if(e.includes("/")){const[n,s]=e.split("/"),o=parseFloat(n??""),i=parseFloat(s??"");return!Number.isFinite(o)||!Number.isFinite(i)||o<=0||i<=0?null:o/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function xt(e){const t=e.getAttribute(un);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function W(e){return e.left+e.width/2}function z(e){return e.top+e.height/2}function gn(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function bn(e,t,n){const s=e.width/e.height;let o,i;return n==="contain"?s>t?(i=e.height,o=i*t):(o=e.width,i=o/t):s>t?(o=e.width,i=o/t):(i=e.height,o=i*t),{left:e.left+(e.width-o)/2,top:e.top+(e.height-i)/2,width:o,height:i}}function At(e,t,n){const s=R(e,t),o=mn(t.getAttribute(hn));if(o===null)return{bbox:s,content:s,window:s,clipInset:{top:0,right:0,bottom:0,left:0}};const i=bn(s,o,n),l=n==="cover"?s:i;return{bbox:s,content:i,window:l,clipInset:gn(i,l)}}function wn(e,t,n,s){const o=n.width/s,i=n.height/s,l=e.width/2+(W(n)-W(t))/s-o/2,a=e.height/2+(z(n)-z(t))/s-i/2;return{top:Math.max(0,a),right:Math.max(0,e.width-l-o),bottom:Math.max(0,e.height-a-i),left:Math.max(0,l)}}function L(e,t){const n=new Map,s=e.querySelectorAll(`[${t}]`);for(const o of Array.from(s)){const i=o.getAttribute(t);i&&(n.has(i)||n.set(i,o))}return n}function Sn(e,t){const n=[],s=L(t,Ct),o=L(e,Et);for(const[a,r]of s){const c=o.get(a);c&&n.push({key:a,fromEl:c,toEl:r,fromFit:"cover",toFit:"contain"})}const i=L(e,Ct),l=L(t,Et);for(const[a,r]of i){const c=l.get(a);c&&n.push({key:a,fromEl:r,toEl:c,fromFit:"contain",toFit:"cover"})}return n}function $n(e,t){const n=[],s=Array.from(t.querySelectorAll(`[${j}]`));for(const o of s){const i=o.getAttribute(j);if(!i)continue;const l=e.querySelector(`[${j}="${i}"]`);l&&n.push({key:i,fromEl:l,toEl:o,fromFit:"contain",toFit:"contain"})}return n}function Cn(e,t){const n=Sn(e,t);return n.length>0?n:$n(e,t)}function En(e,t,n){const{fromEl:s,toEl:o}=t,i=At(e,s,t.fromFit),l=At(e,o,t.toFit),a=i.content,r=i.window,c=l.content,d=l.window,p=l.clipInset,f=xt(s),m=xt(o);if(a.width===0||a.height===0||r.width===0||r.height===0||c.width===0||c.height===0||d.width===0||d.height===0)return null;const y=Math.max(a.width/c.width,a.height/c.height),h=W(a),b=z(a),w=W(c),S=z(c),x=h-w,$=b-S;if(Math.abs($)>n)return null;const C=wn(c,a,r,y);return{toContent:c,hasRadius:f>0||m>0,styleFor:(P,A)=>{const F=A*x,Y=A*$,T=P+A*y,Mt=(f*A+m*P)/T,Ht=C.top*A+p.top*P,Wt=C.right*A+p.right*P,zt=C.bottom*A+p.bottom*P,Rt=C.left*A+p.left*P;return{transform:`translate(${F}px, ${Y}px) scale(${T})`,clipPath:`inset(${Ht}px ${Wt}px ${zt}px ${Rt}px round ${Mt}px)`}}}}function xn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class An{contribute(t){const{resolved:n,physics:s,positionedParent:o,maxDistance:i,onComplete:l}=t,a=[];for(const r of n.pairs){const{fromEl:c,toEl:d}=r,p=En(o,r,i);if(!p)continue;const f=d.cloneNode(!0);f.style.position="absolute",f.style.left=`${p.toContent.left}px`,f.style.top=`${p.toContent.top}px`,f.style.width=`${p.toContent.width}px`,f.style.height=`${p.toContent.height}px`,f.style.margin="0",f.style.transformOrigin="center center",f.style.zIndex="1000",f.style.willChange="transform, clip-path",f.style.pointerEvents="none",f.style.maxWidth="none",f.style.maxHeight="none",p.hasRadius&&(f.style.borderRadius="0"),xn(f,p.styleFor(0,1)),o.appendChild(f);const m=c.style.opacity,y=d.style.opacity;c.style.opacity="0",d.style.opacity="0",l(()=>{c.style.opacity=m,d.style.opacity=y,f.parentElement&&f.parentElement.removeChild(f)}),a.push(new u.WebAnimation({element:f,integrator:g.from(s),style:p.styleFor}))}return a}}function Pn(e){return[new An,an[e.type]()]}const _n=e=>{const t=Pn(e),n=fn[e.variant](),s=yn;return{prepare:o=>{var a;const i=Promise.all([o.from,o.to]).then(([r,c])=>({pairs:Cn(r,c)})),l={from:o.from,to:o.to,resolved:i};for(const r of t)(a=r.prepare)==null||a.call(r,l);return i.then(r=>({resolved:r}))},animation:({from:o,to:i,context:l,resolved:a})=>{if(a.pairs.length===0)return new u.MultiAnimation([],{mode:"parallel"});const r=[],c=y=>{r.push(y)},d={from:o,to:i,resolved:a,physics:n,positionedParent:l.positionedParent,maxDistance:s,onComplete:c},p=[];for(const y of t)y.contribute&&p.push(...y.contribute(d));if(p.length===0)return new u.MultiAnimation([],{mode:"parallel"});const f=new u.MultiAnimation(p,{mode:"parallel"}),m=f.onComplete;return f.onComplete=()=>{m==null||m();for(const y of r)try{y()}catch(h){console.error("[hero] cleanup error",h)}},f}}};function In(e){const{paths:t}=e,n=e.type??"static",s=e.variant??"default";return _(t,()=>_n({type:n,variant:s}))}const vn={spring:{stiffness:50,damping:30}},On={spring:{stiffness:80,damping:25}},Tn=(e={})=>{const t=e.physics??vn,n=e.initialRotation??45,s=e.initialScale??.01,o=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:l,context:a})=>(i.then(r=>{r.style.opacity="1"}),l.then(r=>{const c=O(a,"to"),d=Math.min(c.width,c.height)*.4;r.style.setProperty("--max-border-radius",`${d}px`),r.style.setProperty("--border-radius-scale","1"),r.style.willChange="transform",r.style.backfaceVisibility="hidden";const p=c.left+c.width/2,f=c.top+c.height/2;r.style.transformOrigin=`${p}px ${f}px`,r.style.position="fixed",r.style.top=`${c.top}px`,r.style.left=`${c.left}px`,r.style.width=`${c.width}px`,r.style.height=`${c.height}px`,r.style.zIndex="1000",r.style.overflow="hidden",r.style.transform=`rotate(${n}deg) scale(${s}) translateZ(0)`,r.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",r.style.opacity="1"}),{}),animation:({from:i,to:l})=>{const a=new u.WebAnimation({element:i,integrator:g.from(On),style:(c,d)=>({opacity:d}),onComplete:()=>{i.style.opacity=""}}),r=new u.WebAnimation({element:l,integrator:g.from(t),style:c=>{let d;if(c<=.05)d=s;else if(c<=o){const y=(c-.05)/(o-.05),h=Math.pow(y,9);d=s+(.8-s)*h}else{const y=(c-o)/(1-o);d=.8+.2*(1-Math.pow(1-y,3))}const p=.7;let f;if(c<=p)f=n;else{const y=(c-p)/(1-p),h=1-Math.pow(1-y,2);f=n*(1-h)}let m;if(c<=p)m=1;else{const y=(c-p)/(1-p);m=1-Math.pow(y,.5)}return{transform:`rotate(${f.toFixed(2)}deg) scale(${d.toFixed(4)}) translateZ(0)`,"--border-radius-scale":m.toFixed(4)}},onComplete:()=>{l.style.willChange="",l.style.backfaceVisibility="",l.style.removeProperty("--max-border-radius"),l.style.removeProperty("--border-radius-scale"),l.style.transform="",l.style.transformOrigin="",l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.width="",l.style.height="",l.style.overflow="",l.style.borderRadius=""}});return new u.MultiAnimation([a,r],{mode:"parallel"})}}};function Dn(e){const{paths:t}=e;return _(t,()=>Tn())}const Fn={spring:{stiffness:100,damping:30}},kn=(e={})=>{const t=e.physics??Fn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),s.then(o=>{o.style.opacity="0",o.style.transform="rotate(-180deg)",o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:l=>({transform:`rotate(${l*180}deg)`,opacity:l<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(l,a)=>({transform:`rotate(${-a*180}deg)`,opacity:l>.5?1:0}),onComplete:()=>{s.style.willChange="auto",s.style.transform="",s.style.transformOrigin="",s.style.opacity=""}});return new u.MultiAnimation([o,i],{mode:"parallel"})}}};function Yn(e){const{paths:t}=e;return _(t,()=>kn())}const Ln={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},Pt=(e={})=>{const t=e.direction??"up",n=e.physics??Ln,s=t==="up",o=s?I:v,i=s?v:I;return{prepare:({from:l,to:a})=>(l.then(r=>{r.style.zIndex=o,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),a.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.position="relative",r.style.zIndex=i}),{}),animation:({from:l,to:a})=>{const r=l.offsetHeight,c=a.offsetHeight,d=window.innerHeight,p=Math.max(Math.min(r,c),d),f=new u.WebAnimation({element:l,integrator:g.from(n),style:y=>({transform:`translate3d(0, ${s?-p*y:p*y}px, 0)`}),onComplete:()=>{l.style.willChange="auto",l.style.backfaceVisibility="",l.style.contain="",l.style.transform="",l.style.pointerEvents="",l.style.zIndex=""}}),m=new u.WebAnimation({element:a,integrator:g.from(n),style:(y,h)=>({transform:`translate3d(0, ${s?h*p:h*-p}px, 0)`}),onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.transform="",a.style.position==="relative"&&(a.style.position=""),a.style.zIndex===i&&(a.style.zIndex="")}});for(const y of[f,m]){const h=y.onComplete;y.onComplete=()=>{h==null||h(),y.releaseFill()}}return new u.MultiAnimation([f,m],{mode:"parallel"})}}};function Mn(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?_(t,()=>Pt({direction:"up"})):nt(t,{forward:"up",backward:"down"},s=>Pt({direction:s}))}const Hn={spring:{stiffness:200,damping:24}},Wn={inertia:{acceleration:25,resistance:1.2}},K=.2;function zn(){return{enterPhysics:Hn,exitPhysics:Wn,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-K*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-K+K*e})`,opacity:e})}}}const Rn={spring:{stiffness:200,damping:24}},Un={inertia:{acceleration:25,resistance:1.2}},G=.08,Nn=16,J=.6,Vn=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function Xn(){return{enterPhysics:Rn,exitPhysics:Un,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-G*e})`,opacity:1-(1-J)*e}),exitStyle:e=>({transform:`scale(${1-G+G*e})`,opacity:J+(1-J)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=Vn(Nn*n);return{backdropFilter:s,WebkitBackdropFilter:s}}}}}const Bn={spring:{stiffness:200,damping:24}},Zn={inertia:{acceleration:25,resistance:1.2}};function qn(){return{enterPhysics:Bn,exitPhysics:Zn,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const jn={static:qn(),"background-scale":zn(),blur:Xn()},Kn="static",Gn="transform",Jn=(e={})=>{const t=e.direction??"enter",n=jn[e.type??Kn],s=t==="enter"?n.enterPhysics:n.exitPhysics,o=n.background,i=n.overlay,l=o.willChange!=="";return{prepare:({from:a,to:r,context:c,createElement:d})=>{const p=t==="enter"?r:a,f=t==="enter"?a:r;p.then(y=>{y.style.willChange=Gn,y.style.backfaceVisibility="hidden",y.style.contain="layout paint",y.style.zIndex=v,t==="enter"?y.style.position="relative":y.style.pointerEvents="none"}),f.then(y=>{l&&(y.style.willChange=o.willChange,y.style.backfaceVisibility="hidden",y.style.contain="layout paint"),y.style.zIndex=I,t==="enter"?y.style.pointerEvents="none":y.style.position="relative"});let m;return i&&(m=d("sheet-overlay"),Object.assign(m.style,i.initialStyle),m.style.willChange=i.willChange,c.positionedParent.appendChild(m)),{overlay:m}},animation:({from:a,to:r,context:c,overlay:d})=>{const p=t==="enter"?r:a,f=t==="enter"?a:r,m=O(c,t==="enter"?"to":"from"),y=()=>{a.style.pointerEvents="",a.style.zIndex=""},h=()=>{const $=t==="enter"?v:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===$&&(r.style.zIndex="")},b=$=>{const C=$.onComplete;$.onComplete=()=>{C==null||C(),$.releaseFill()}};p.style.clipPath=`inset(${m.top}px 0 calc(100% - ${m.top+m.height}px) 0)`;const w=t==="enter"?($,C)=>({transform:`translate3d(0, ${C*m.height}px, 0)`}):$=>({transform:`translate3d(0, ${$*m.height}px, 0)`}),S=new u.WebAnimation({element:p,integrator:g.from(s),style:w,onComplete:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transform="",y(),h()}});b(S);const x=[S];if(l){const $=f.scrollHeight;$>0&&(f.style.height=`${$}px`);const C=O(c,t==="enter"?"from":"to"),P=C.left+C.width/2,A=C.top+C.height/2;f.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,f.style.transformOrigin=`${P}px ${A}px`;const F=t==="enter"?(T,st)=>o.enterStyle(T,st):T=>o.exitStyle(T),Y=new u.WebAnimation({element:f,integrator:g.from(s),style:F,onComplete:()=>{f.style.willChange="auto",f.style.backfaceVisibility="",f.style.contain="",f.style.clipPath="",f.style.transformOrigin="",f.style.transform="",f.style.opacity="",f.style.height=""}});b(Y),x.push(Y)}if(d&&i){d.style.zIndex=kt;const $=Dt(c,"to");d.style.top=`${$.top}px`,d.style.height=`${$.height}px`,x.push(new u.WebAnimation({element:d,integrator:g.from(s),style:C=>i.style(t,C)}))}return new u.MultiAnimation(x,{mode:"parallel"})}}};function Qn(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function ts(e){const{enter:t,exit:n}=e,s=e.type,o=Qn(s);return Tt({enter:t,exit:n},i=>Jn({direction:i,type:o}))}const es={spring:{stiffness:170,damping:22,doubleSpring:.8}},ns=(e={})=>{const t=e.direction??"left",n=e.physics??es,s=t==="left";return{prepare:({from:o,to:i})=>(o.then(l=>{l.style.willChange="transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint",l.style.pointerEvents="none"}),i.then(l=>{const a=s?100:-100;l.style.transform=`translate3d(${a}%, 0, 0)`,l.style.willChange="transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const l=new u.WebAnimation({element:o,integrator:g.from(n),style:r=>({transform:`translate3d(${s?-100*r:100*r}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents=""}}),a=new u.WebAnimation({element:i,integrator:g.from(n),style:(r,c)=>({transform:`translate3d(${s?c*100:c*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new u.MultiAnimation([l,a],{mode:"parallel"})}}};function ss(e){const{paths:t}=e;return nt(t,{forward:"left",backward:"right"},n=>ns({direction:n}))}const os={spring:{stiffness:17,damping:6}},Q=20,M=800,is=(e={})=>{const t=e.physics??os;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none",o.style.transform=`perspective(${M}px) rotateY(0deg) translate3d(0%, 0, 0)`}),s.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.transform=`perspective(${M}px) rotateY(${Q}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:l=>{const a=-l*Q,r=l*100;return{transform:`perspective(${M}px) rotateY(${a}deg) translate3d(${r}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(l,a)=>{const r=a*Q,c=-a*100;return{transform:`perspective(${M}px) rotateY(${r}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}});return new u.MultiAnimation([o,i],{mode:"sequence"})}}};function rs(e){const{paths:t}=e;return _(t,()=>is())}function as({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const l=t.left-e.left+(t.width-e.width)/2-s.x,a=t.top-e.top+(t.height-e.height)/2-s.y,r=t.width/e.width,c=t.height/e.height,d=e.top/n.height*100,p=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(r-1)*h,w=1+(c-1)*h,x=(i*h+o*(1-h))/((b+w)/2);return{clipPath:`inset(${d*h}% ${p*h}% ${f*h}% ${m*h}% round ${x}px)`,transform:`translate(${l*h}px, ${a*h}px) scale(${b}, ${w})`}}}}function ls({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const l=t.left-e.left+(t.width-e.width)/2+s.x,a=t.top-e.top+(t.height-e.height)/2+s.y,r=t.width/e.width,c=t.height/e.height,d=e.top/n.height*100,p=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(r-1)*h,w=1+(c-1)*h,x=(o*(1-h)+i*h)/((b+w)/2);return{clipPath:`inset(${d*h}% ${p*h}% ${f*h}% ${m*h}% round ${x}px)`,transform:`translate(${l*h-s.x}px, ${a*h}px) scale(${b}, ${w})`}}}}const cs={spring:{stiffness:430,damping:33,doubleSpring:1}},Yt=.12,ps=18;function ds(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Yt*t})`}}}}function fs(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Yt*t})`}}}}const tt={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=`blur(${ps*n}px)`;return{backdropFilter:s,WebkitBackdropFilter:s}}};class ys{constructor(){E(this,"physics",cs)}contribute(t){const{from:n,to:s,resolved:o,physics:i}=t,l=o.mode==="enter",a=l?n:s,r=l?ds():fs();return r&&(a.style.transformOrigin=r.transformOrigin),[new u.WebAnimation({element:a,integrator:g.from(i),style:l?(c,d)=>r.animate(d):c=>r.animate(c)})]}}class hs{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,tt.initialStyle),n.style.willChange=tt.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=kt;const s=Dt(t.context,"to");return n.style.top=`${s.top}px`,n.style.height=`${s.height}px`,[new u.WebAnimation({element:n,integrator:g.from(t.physics),style:o=>tt.style(t.resolved.mode,o)})]}}const us={spring:{stiffness:430,damping:33,doubleSpring:1}};function ms({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2+n.x,o=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,l=e.height/t.height,a=Math.max(i,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:r=>{const c=1-r;return{transform:`translate(${s*c-n.x}px, ${o*c}px) scale(${1+(a-1)*c})`}}}}function gs({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2-n.x,o=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,l=e.height/t.height,a=Math.max(i,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:r=>{const c=1-r;return{transform:`translate(${s*c}px, ${o*c}px) scale(${1+(a-1)*c})`}}}}class bs{constructor(){E(this,"physics",us)}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:l}=t,a=o.mode==="enter",r=a?n:s,c=a?ms(i):gs(i);return c&&(r.style.transformOrigin=c.transformOrigin),[new u.WebAnimation({element:r,integrator:g.from(l),style:a?(d,p)=>c.animate(p):d=>c.animate(d)})]}}const ws={spring:{stiffness:530,damping:34,doubleSpring:1}};class Ss{constructor(){E(this,"physics",ws)}contribute(t){return[]}}const $s={expand:()=>new bs,static:()=>new Ss,blur:()=>new ys};function Cs(e){return $s[e]()}const et="data-zoom-enter-key",_t="data-zoom-exit-key",Es="data-zoom-radius";function It(e){const t=e.getAttribute(Es);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function xs(e,t){const n=[];let s=t;for(;s&&s!==e;){const o=s.parentElement;if(!o)break;for(const i of Array.from(o.children))i!==s&&i instanceof HTMLElement&&n.push(i);s=o}return n}function vt(e){const t=e.querySelectorAll(`[${et}]`);return t.length!==1?null:t[0]}function Ot(e,t){const n=e.querySelectorAll(`[${_t}]`);for(const s of n)if(s.getAttribute(_t)===t)return s;return null}function As(e,t){const n=vt(e),s=vt(t);if(!n&&s){const o=s.getAttribute(et);if(!o)return null;const i=Ot(e,o);return i?{mode:"enter",enterEl:s,exitEl:i}:null}if(n&&!s){const o=n.getAttribute(et);if(!o)return null;const i=Ot(t,o);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function Ps(e,t,n,s){return{enterRect:ot(e.mode==="enter"?n:t,e.enterEl),exitRect:ot(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:s,enterRadius:It(e.enterEl),exitRadius:It(e.exitEl)}}class _s{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:l,onComplete:a}=t,r=o.mode==="enter",c=r?as(i):ls(i),d=r?s:n,p=r?"t":"u";c&&(d.style.transformOrigin=c.transformOrigin);const f=r?I:v,m=r?v:I,y=n.style.zIndex;n.style.zIndex=f;const h=s.style.zIndex,b=s.style.position;return s.style.zIndex=m,s.style.position="relative",a(()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.transformOrigin="",d.style.contain="",n.style.zIndex=y,s.style.zIndex===m&&(s.style.zIndex=h),s.style.position==="relative"&&(s.style.position=b),s.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new u.WebAnimation({element:d,integrator:g.from(l),style:p==="t"?w=>c.animate(w):(w,S)=>c.animate(S)})]}}class Is{contribute(t){const{resolved:n,physics:s,from:o,to:i,onComplete:l}=t,a=n.mode==="enter"?i:o,r=xs(a,n.enterEl);if(r.length===0)return[];const c=r.map(d=>d.style.opacity);if(n.mode==="enter")for(const d of r)d.style.opacity="0";return l(()=>{for(let d=0;d<r.length;d++){const p=r[d];p&&(p.style.opacity=c[d]??"")}}),r.map(d=>new u.WebAnimation({element:d,integrator:g.from(s),style:(p,f)=>({opacity:n.mode==="enter"?p:f})}))}}class Lt{contribute(){return[]}}const vs={default:()=>new Lt,fade:()=>new Is};function Os(e){return vs[e]()}class Ts extends Lt{}function Ds(e){const t=Cs(e.type);return{strategies:[new _s,t,Os(e.variant),new Ts,...e.type==="blur"?[new hs]:[]],physics:t.physics}}const Fs=e=>{const{strategies:t,physics:n}=Ds(e);return{prepare:s=>{const o={from:s.from,to:s.to,context:{positionedParent:s.context.positionedParent},createElement:s.createElement},i={};for(const l of t){if(!l.prepare)continue;const a=l.prepare(o);a&&Object.assign(i,a)}return i},animation:({from:s,to:o,context:i,...l})=>{const a=As(s,o);if(!a)return new u.MultiAnimation([],{mode:"parallel"});const r=Ps(a,s,o,i.scrollOffset),c=[],p={from:s,to:o,resolved:a,input:r,physics:n,context:i,extras:l,onComplete:y=>{c.push(y)}},f=[];for(const y of t)y.contribute&&f.push(...y.contribute(p));const m=f[0];if(m){const y=m.onComplete;m.onComplete=()=>{y==null||y();for(const h of c)try{h()}catch(b){console.error("[zoom] cleanup error",b)}}}for(const y of f){if(!(y instanceof u.WebAnimation))continue;const h=y.onComplete;y.onComplete=()=>{h==null||h(),y.releaseFill()}}return new u.MultiAnimation(f,{mode:"parallel"})}}};function ks(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function Ys(e){const t=ks(e);return _(e.paths,()=>Fs(t))}exports.Animation=u.Animation;exports.MultiAnimation=u.MultiAnimation;exports.WebAnimation=u.WebAnimation;exports.axis=Ae;exports.blind=Te;exports.drill=Ue;exports.fade=Be;exports.film=en;exports.hero=In;exports.jaemin=Dn;exports.rotate=Yn;exports.scroll=Mn;exports.sheet=ts;exports.slide=ss;exports.strip=rs;exports.zoom=Ys;
|
|
35
|
+
)`}function q(e,t,n,s,o){const i=n/1e3;return new u.WebAnimation({element:e,integrator:new jt({durationSec:i}),lowerBound:0,upperBound:1,style:l=>s(Ge(t,l)),onComplete:o})}const tn=(e={})=>{var o;const t=((o=e.border)==null?void 0:o.color)??qe,n=Ze,s=e.physics;return{prepare:({from:i,to:l,context:a})=>{const r=O(a,"from"),c=O(a,"to"),d=R(document.body,a.positionedParent),p=Qe(t,{...r,top:d.top});for(const f of["topLeft","topRight","bottomLeft","bottomRight"])a.positionedParent.appendChild(p[f]);return i.then(f=>{St(f,r),$t(f,r),f.style.transform=`translateY(${-r.top}px)`}),l.then(f=>{St(f,c),$t(f,c),f.style.transform=`translateY(${-c.top+c.height}px) scale(${n})`}),{borders:p,fromRect:r,toRect:c}},animation:({from:i,to:l,context:a,borders:r,fromRect:c,toRect:d})=>{const p=wt({rect:c,scale:n,direction:"out",override:s}),f=wt({rect:d,scale:n,direction:"in",override:s}),m=q(i,p.snapshots,p.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{i.style.clipPath="",i.style.transformOrigin="",i.style.transform=""}),y=q(l,f.snapshots,f.totalDuration,S=>({transform:`translateY(${S.translateY}px) scale(${S.scale})`}),()=>{l.style.clipPath="",l.style.transformOrigin="",l.style.transform=""}),h=Je.map(([S,x],$)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][$];return q(r[C],p.snapshots,p.totalDuration,P=>{const A=(c.width-c.width*P.scale)/2*.7*S,F=(c.height-c.height*P.scale)/2*.7*x;return{transform:`translate(${A}px, ${F}px)`}})}),b=new u.MultiAnimation([m,y,...h],{mode:"parallel"}),w=b.onComplete;return b.onComplete=()=>{w==null||w();const S=a.positionedParent;for(const x of["topLeft","topRight","bottomLeft","bottomRight"]){const $=r[x];$.parentElement===S&&S.removeChild($)}},b}}};function en(e){const{paths:t,options:n}=e,s=(n==null?void 0:n.borderColor)!==void 0?{border:{color:n.borderColor}}:void 0;return _(t,()=>tn(s))}const Ct="data-hero-enter-key",Et="data-hero-exit-key",j="data-hero-key";class nn{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const sn=()=>new nn;class on{contribute(t){const{from:n,to:s,physics:o,onComplete:i}=t,l=n.style.opacity,a=s.style.opacity,r=n.style.willChange,c=s.style.willChange;return s.style.opacity="0",n.style.willChange="opacity",s.style.willChange="opacity",i(()=>{n.style.opacity=l,s.style.opacity=a,n.style.willChange=r,s.style.willChange=c}),[new u.WebAnimation({element:n,integrator:g.from(o),style:(d,p)=>({opacity:p})}),new u.WebAnimation({element:s,integrator:g.from(o),style:d=>({opacity:d})})]}}const rn=()=>new on,an={static:sn,fade:rn},ln={spring:{stiffness:320,damping:30}},cn=()=>ln,pn={spring:{stiffness:300,damping:30,doubleSpring:1}},dn=()=>pn,fn={default:cn,smooth:dn},yn=700,hn="data-hero-aspect-ratio",un="data-hero-radius";function mn(e){if(!e)return null;if(e.includes("/")){const[n,s]=e.split("/"),o=parseFloat(n??""),i=parseFloat(s??"");return!Number.isFinite(o)||!Number.isFinite(i)||o<=0||i<=0?null:o/i}const t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function xt(e){const t=e.getAttribute(un);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function W(e){return e.left+e.width/2}function z(e){return e.top+e.height/2}function gn(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function bn(e,t,n){const s=e.width/e.height;let o,i;return n==="contain"?s>t?(i=e.height,o=i*t):(o=e.width,i=o/t):s>t?(o=e.width,i=o/t):(i=e.height,o=i*t),{left:e.left+(e.width-o)/2,top:e.top+(e.height-i)/2,width:o,height:i}}function At(e,t,n){const s=R(e,t),o=mn(t.getAttribute(hn));if(o===null)return{bbox:s,content:s,window:s,clipInset:{top:0,right:0,bottom:0,left:0}};const i=bn(s,o,n),l=n==="cover"?s:i;return{bbox:s,content:i,window:l,clipInset:gn(i,l)}}function wn(e,t,n,s){const o=n.width/s,i=n.height/s,l=e.width/2+(W(n)-W(t))/s-o/2,a=e.height/2+(z(n)-z(t))/s-i/2;return{top:Math.max(0,a),right:Math.max(0,e.width-l-o),bottom:Math.max(0,e.height-a-i),left:Math.max(0,l)}}function L(e,t){const n=new Map,s=e.querySelectorAll(`[${t}]`);for(const o of Array.from(s)){const i=o.getAttribute(t);i&&(n.has(i)||n.set(i,o))}return n}function Sn(e,t){const n=[],s=L(t,Ct),o=L(e,Et);for(const[a,r]of s){const c=o.get(a);c&&n.push({key:a,fromEl:c,toEl:r,fromFit:"cover",toFit:"contain"})}const i=L(e,Ct),l=L(t,Et);for(const[a,r]of i){const c=l.get(a);c&&n.push({key:a,fromEl:r,toEl:c,fromFit:"contain",toFit:"cover"})}return n}function $n(e,t){const n=[],s=Array.from(t.querySelectorAll(`[${j}]`));for(const o of s){const i=o.getAttribute(j);if(!i)continue;const l=e.querySelector(`[${j}="${i}"]`);l&&n.push({key:i,fromEl:l,toEl:o,fromFit:"contain",toFit:"contain"})}return n}function Cn(e,t){const n=Sn(e,t);return n.length>0?n:$n(e,t)}function En(e,t,n){const{fromEl:s,toEl:o}=t,i=At(e,s,t.fromFit),l=At(e,o,t.toFit),a=i.content,r=i.window,c=l.content,d=l.window,p=l.clipInset,f=xt(s),m=xt(o);if(a.width===0||a.height===0||r.width===0||r.height===0||c.width===0||c.height===0||d.width===0||d.height===0)return null;const y=Math.max(a.width/c.width,a.height/c.height),h=W(a),b=z(a),w=W(c),S=z(c),x=h-w,$=b-S;if(Math.abs($)>n)return null;const C=wn(c,a,r,y);return{toContent:c,hasRadius:f>0||m>0,styleFor:(P,A)=>{const F=A*x,Y=A*$,T=P+A*y,Mt=(f*A+m*P)/T,Ht=C.top*A+p.top*P,Wt=C.right*A+p.right*P,zt=C.bottom*A+p.bottom*P,Rt=C.left*A+p.left*P;return{transform:`translate(${F}px, ${Y}px) scale(${T})`,clipPath:`inset(${Ht}px ${Wt}px ${zt}px ${Rt}px round ${Mt}px)`}}}}function xn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class An{contribute(t){const{resolved:n,physics:s,positionedParent:o,maxDistance:i,onComplete:l}=t,a=[];for(const r of n.pairs){const{fromEl:c,toEl:d}=r,p=En(o,r,i);if(!p)continue;const f=d.cloneNode(!0);f.style.position="absolute",f.style.left=`${p.toContent.left}px`,f.style.top=`${p.toContent.top}px`,f.style.width=`${p.toContent.width}px`,f.style.height=`${p.toContent.height}px`,f.style.margin="0",f.style.transformOrigin="center center",f.style.zIndex="1000",f.style.willChange="transform, clip-path",f.style.pointerEvents="none",f.style.maxWidth="none",f.style.maxHeight="none",p.hasRadius&&(f.style.borderRadius="0"),xn(f,p.styleFor(0,1)),o.appendChild(f);const m=c.style.opacity,y=d.style.opacity;c.style.opacity="0",d.style.opacity="0",l(()=>{c.style.opacity=m,d.style.opacity=y,f.parentElement&&f.parentElement.removeChild(f)}),a.push(new u.WebAnimation({element:f,integrator:g.from(s),style:p.styleFor}))}return a}}function Pn(e){return[new An,an[e.type]()]}const _n=e=>{const t=Pn(e),n=fn[e.variant](),s=yn;return{prepare:o=>{var a;const i=Promise.all([o.from,o.to]).then(([r,c])=>({pairs:Cn(r,c)})),l={from:o.from,to:o.to,resolved:i};for(const r of t)(a=r.prepare)==null||a.call(r,l);return i.then(r=>({resolved:r}))},animation:({from:o,to:i,context:l,resolved:a})=>{if(a.pairs.length===0)return new u.MultiAnimation([],{mode:"parallel"});const r=[],c=y=>{r.push(y)},d={from:o,to:i,resolved:a,physics:n,positionedParent:l.positionedParent,maxDistance:s,onComplete:c},p=[];for(const y of t)y.contribute&&p.push(...y.contribute(d));if(p.length===0)return new u.MultiAnimation([],{mode:"parallel"});const f=new u.MultiAnimation(p,{mode:"parallel"}),m=f.onComplete;return f.onComplete=()=>{m==null||m();for(const y of r)try{y()}catch(h){console.error("[hero] cleanup error",h)}},f}}};function In(e){const{paths:t}=e,n=e.type??"static",s=e.variant??"default";return _(t,()=>_n({type:n,variant:s}))}const vn={spring:{stiffness:50,damping:30}},On={spring:{stiffness:80,damping:25}},Tn=(e={})=>{const t=e.physics??vn,n=e.initialRotation??45,s=e.initialScale??.01,o=e.rotationTriggerPoint??.8;return{prepare:({from:i,to:l,context:a})=>(i.then(r=>{r.style.opacity="1"}),l.then(r=>{const c=O(a,"to"),d=Math.min(c.width,c.height)*.4;r.style.setProperty("--max-border-radius",`${d}px`),r.style.setProperty("--border-radius-scale","1"),r.style.willChange="transform",r.style.backfaceVisibility="hidden";const p=c.left+c.width/2,f=c.top+c.height/2;r.style.transformOrigin=`${p}px ${f}px`,r.style.position="fixed",r.style.top=`${c.top}px`,r.style.left=`${c.left}px`,r.style.width=`${c.width}px`,r.style.height=`${c.height}px`,r.style.zIndex="1000",r.style.overflow="hidden",r.style.transform=`rotate(${n}deg) scale(${s}) translateZ(0)`,r.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",r.style.opacity="1"}),{}),animation:({from:i,to:l})=>{const a=new u.WebAnimation({element:i,integrator:g.from(On),style:(c,d)=>({opacity:d}),onComplete:()=>{i.style.opacity=""}}),r=new u.WebAnimation({element:l,integrator:g.from(t),style:c=>{let d;if(c<=.05)d=s;else if(c<=o){const y=(c-.05)/(o-.05),h=Math.pow(y,9);d=s+(.8-s)*h}else{const y=(c-o)/(1-o);d=.8+.2*(1-Math.pow(1-y,3))}const p=.7;let f;if(c<=p)f=n;else{const y=(c-p)/(1-p),h=1-Math.pow(1-y,2);f=n*(1-h)}let m;if(c<=p)m=1;else{const y=(c-p)/(1-p);m=1-Math.pow(y,.5)}return{transform:`rotate(${f.toFixed(2)}deg) scale(${d.toFixed(4)}) translateZ(0)`,"--border-radius-scale":m.toFixed(4)}},onComplete:()=>{l.style.willChange="",l.style.backfaceVisibility="",l.style.removeProperty("--max-border-radius"),l.style.removeProperty("--border-radius-scale"),l.style.transform="",l.style.transformOrigin="",l.style.position="",l.style.zIndex="",l.style.top="",l.style.left="",l.style.width="",l.style.height="",l.style.overflow="",l.style.borderRadius=""}});return new u.MultiAnimation([a,r],{mode:"parallel"})}}};function Dn(e){const{paths:t}=e;return _(t,()=>Tn())}const Fn={spring:{stiffness:100,damping:30}},kn=(e={})=>{const t=e.physics??Fn;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),s.then(o=>{o.style.opacity="0",o.style.transform="rotate(-180deg)",o.style.transformOrigin="center center",o.style.willChange="transform, opacity"}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:l=>({transform:`rotate(${l*180}deg)`,opacity:l<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(l,a)=>({transform:`rotate(${-a*180}deg)`,opacity:l>.5?1:0}),onComplete:()=>{s.style.willChange="auto",s.style.transform="",s.style.transformOrigin="",s.style.opacity=""}});return new u.MultiAnimation([o,i],{mode:"parallel"})}}};function Yn(e){const{paths:t}=e;return _(t,()=>kn())}const Ln={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},Pt=(e={})=>{const t=e.direction??"up",n=e.physics??Ln,s=t==="up",o=s?I:v,i=s?v:I;return{prepare:({from:l,to:a})=>(l.then(r=>{r.style.zIndex=o,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),a.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.position="relative",r.style.zIndex=i}),{}),animation:({from:l,to:a})=>{const r=l.offsetHeight,c=a.offsetHeight,d=window.innerHeight,p=Math.max(Math.min(r,c),d),f=new u.WebAnimation({element:l,integrator:g.from(n),style:y=>({transform:`translate3d(0, ${s?-p*y:p*y}px, 0)`}),onComplete:()=>{l.style.willChange="auto",l.style.backfaceVisibility="",l.style.contain="",l.style.transform="",l.style.pointerEvents="",l.style.zIndex=""}}),m=new u.WebAnimation({element:a,integrator:g.from(n),style:(y,h)=>({transform:`translate3d(0, ${s?h*p:h*-p}px, 0)`}),onComplete:()=>{a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain="",a.style.transform="",a.style.position==="relative"&&(a.style.position=""),a.style.zIndex===i&&(a.style.zIndex="")}});for(const y of[f,m]){const h=y.onComplete;y.onComplete=()=>{h==null||h(),y.releaseFill()}}return new u.MultiAnimation([f,m],{mode:"parallel"})}}};function Mn(e){const{paths:t,type:n="directional"}=e;return n==="non-directional"?_(t,()=>Pt({direction:"up"})):nt(t,{forward:"up",backward:"down"},s=>Pt({direction:s}))}const Hn={spring:{stiffness:200,damping:24}},Wn={inertia:{acceleration:25,resistance:1.2}},K=.2;function zn(){return{enterPhysics:Hn,exitPhysics:Wn,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-K*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-K+K*e})`,opacity:e})}}}const Rn={spring:{stiffness:200,damping:24}},Un={inertia:{acceleration:25,resistance:1.2}},G=.08,Nn=16,J=.6,Vn=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function Xn(){return{enterPhysics:Rn,exitPhysics:Un,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-G*e})`,opacity:1-(1-J)*e}),exitStyle:e=>({transform:`scale(${1-G+G*e})`,opacity:J+(1-J)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=Vn(Nn*n);return{backdropFilter:s,WebkitBackdropFilter:s}}}}}const Bn={spring:{stiffness:200,damping:24}},Zn={inertia:{acceleration:25,resistance:1.2}};function qn(){return{enterPhysics:Bn,exitPhysics:Zn,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const jn={static:qn(),"background-scale":zn(),blur:Xn()},Kn="static",Gn="transform",Jn=(e={})=>{const t=e.direction??"enter",n=jn[e.type??Kn],s=t==="enter"?n.enterPhysics:n.exitPhysics,o=n.background,i=n.overlay,l=o.willChange!=="";return{prepare:({from:a,to:r,context:c,createElement:d})=>{const p=t==="enter"?r:a,f=t==="enter"?a:r;p.then(y=>{y.style.willChange=Gn,y.style.backfaceVisibility="hidden",y.style.contain="layout paint",y.style.zIndex=v,t==="enter"?y.style.position="relative":y.style.pointerEvents="none"}),f.then(y=>{l&&(y.style.willChange=o.willChange,y.style.backfaceVisibility="hidden",y.style.contain="layout paint"),y.style.zIndex=I,t==="enter"?y.style.pointerEvents="none":y.style.position="relative"});let m;return i&&(m=d("sheet-overlay"),Object.assign(m.style,i.initialStyle),m.style.willChange=i.willChange,c.positionedParent.appendChild(m)),{overlay:m}},animation:({from:a,to:r,context:c,overlay:d})=>{const p=t==="enter"?r:a,f=t==="enter"?a:r,m=O(c,t==="enter"?"to":"from"),y=()=>{a.style.pointerEvents="",a.style.zIndex=""},h=()=>{const $=t==="enter"?v:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===$&&(r.style.zIndex="")},b=$=>{const C=$.onComplete;$.onComplete=()=>{C==null||C(),$.releaseFill()}};p.style.clipPath=`inset(${m.top}px 0 calc(100% - ${m.top+m.height}px) 0)`;const w=t==="enter"?($,C)=>({transform:`translate3d(0, ${C*m.height}px, 0)`}):$=>({transform:`translate3d(0, ${$*m.height}px, 0)`}),S=new u.WebAnimation({element:p,integrator:g.from(s),style:w,onComplete:()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.contain="",p.style.clipPath="",p.style.transform="",y(),h()}});b(S);const x=[S];if(l){const $=f.scrollHeight;$>0&&(f.style.height=`${$}px`);const C=O(c,t==="enter"?"from":"to"),P=C.left+C.width/2,A=C.top+C.height/2;f.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,f.style.transformOrigin=`${P}px ${A}px`;const F=t==="enter"?(T,st)=>o.enterStyle(T,st):T=>o.exitStyle(T),Y=new u.WebAnimation({element:f,integrator:g.from(s),style:F,onComplete:()=>{f.style.willChange="auto",f.style.backfaceVisibility="",f.style.contain="",f.style.clipPath="",f.style.transformOrigin="",f.style.transform="",f.style.opacity="",f.style.height=""}});b(Y),x.push(Y)}if(d&&i){d.style.zIndex=kt;const $=Dt(c,"to");d.style.top=`${$.top}px`,d.style.height=`${$.height}px`,x.push(new u.WebAnimation({element:d,integrator:g.from(s),style:C=>i.style(t,C)}))}return new u.MultiAnimation(x,{mode:"parallel"})}}};function Qn(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function ts(e){const{enter:t,exit:n}=e,s=e.type,o=Qn(s);return Tt({enter:t,exit:n},i=>Jn({direction:i,type:o}))}const es={spring:{stiffness:170,damping:22,doubleSpring:.8}},ns=(e={})=>{const t=e.direction??"left",n=e.physics??es,s=t==="left";return{prepare:({from:o,to:i})=>(o.then(l=>{l.style.willChange="transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint",l.style.pointerEvents="none"}),i.then(l=>{const a=s?100:-100;l.style.transform=`translate3d(${a}%, 0, 0)`,l.style.willChange="transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint"}),{}),animation:({from:o,to:i})=>{const l=new u.WebAnimation({element:o,integrator:g.from(n),style:r=>({transform:`translate3d(${s?-100*r:100*r}%, 0, 0)`}),onComplete:()=>{o.style.willChange="auto",o.style.backfaceVisibility="",o.style.contain="",o.style.transform="",o.style.pointerEvents=""}}),a=new u.WebAnimation({element:i,integrator:g.from(n),style:(r,c)=>({transform:`translate3d(${s?c*100:c*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new u.MultiAnimation([l,a],{mode:"parallel"})}}};function ss(e){const{paths:t}=e;return nt(t,{forward:"left",backward:"right"},n=>ns({direction:n}))}const os={spring:{stiffness:17,damping:6}},Q=20,M=800,is=(e={})=>{const t=e.physics??os;return{prepare:({from:n,to:s})=>(n.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none",o.style.transform=`perspective(${M}px) rotateY(0deg) translate3d(0%, 0, 0)`}),s.then(o=>{o.style.willChange="transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.transform=`perspective(${M}px) rotateY(${Q}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:s})=>{const o=new u.WebAnimation({element:n,integrator:g.from(t),style:l=>{const a=-l*Q,r=l*100;return{transform:`perspective(${M}px) rotateY(${a}deg) translate3d(${r}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),i=new u.WebAnimation({element:s,integrator:g.from(t),style:(l,a)=>{const r=a*Q,c=-a*100;return{transform:`perspective(${M}px) rotateY(${r}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}});return new u.MultiAnimation([o,i],{mode:"sequence"})}}};function rs(e){const{paths:t}=e;return _(t,()=>is())}function as({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const l=t.left-e.left+(t.width-e.width)/2-s.x,a=t.top-e.top+(t.height-e.height)/2-s.y,r=t.width/e.width,c=t.height/e.height,d=e.top/n.height*100,p=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(r-1)*h,w=1+(c-1)*h,x=(i*h+o*(1-h))/((b+w)/2);return{clipPath:`inset(${d*h}% ${p*h}% ${f*h}% ${m*h}% round ${x}px)`,transform:`translate(${l*h}px, ${a*h}px) scale(${b}, ${w})`}}}}function ls({enterRect:e,exitRect:t,pageRect:n,scrollOffset:s,enterRadius:o,exitRadius:i}){const l=t.left-e.left+(t.width-e.width)/2+s.x,a=t.top-e.top+(t.height-e.height)/2+s.y,r=t.width/e.width,c=t.height/e.height,d=e.top/n.height*100,p=(n.width-(e.left+e.width))/n.width*100,f=(n.height-(e.top+e.height))/n.height*100,m=e.left/n.width*100;return{transformOrigin:`${e.left+e.width/2}px ${e.top+e.height/2}px`,animate:y=>{const h=1-y,b=1+(r-1)*h,w=1+(c-1)*h,x=(o*(1-h)+i*h)/((b+w)/2);return{clipPath:`inset(${d*h}% ${p*h}% ${f*h}% ${m*h}% round ${x}px)`,transform:`translate(${l*h-s.x}px, ${a*h}px) scale(${b}, ${w})`}}}}const cs={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}},Yt=.12,ps=18;function ds(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Yt*t})`}}}}function fs(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Yt*t})`}}}}const tt={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,s=`blur(${ps*n}px)`;return{backdropFilter:s,WebkitBackdropFilter:s}}};class ys{constructor(){E(this,"physics",cs)}contribute(t){const{from:n,to:s,resolved:o,physics:i}=t,l=o.mode==="enter",a=l?n:s,r=l?ds():fs();return r&&(a.style.transformOrigin=r.transformOrigin),[new u.WebAnimation({element:a,integrator:g.from(i),style:l?(c,d)=>r.animate(d):c=>r.animate(c)})]}}class hs{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,tt.initialStyle),n.style.willChange=tt.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=kt;const s=Dt(t.context,"to");return n.style.top=`${s.top}px`,n.style.height=`${s.height}px`,[new u.WebAnimation({element:n,integrator:g.from(t.physics),style:o=>tt.style(t.resolved.mode,o)})]}}const us={spring:{stiffness:430,damping:33,doubleSpring:1}};function ms({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2+n.x,o=e.top-t.top+(e.height-t.height)/2+n.y,i=e.width/t.width,l=e.height/t.height,a=Math.max(i,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:r=>{const c=1-r;return{transform:`translate(${s*c-n.x}px, ${o*c}px) scale(${1+(a-1)*c})`}}}}function gs({enterRect:e,exitRect:t,scrollOffset:n}){const s=e.left-t.left+(e.width-t.width)/2-n.x,o=e.top-t.top+(e.height-t.height)/2-n.y,i=e.width/t.width,l=e.height/t.height,a=Math.max(i,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:r=>{const c=1-r;return{transform:`translate(${s*c}px, ${o*c}px) scale(${1+(a-1)*c})`}}}}class bs{constructor(){E(this,"physics",us)}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:l}=t,a=o.mode==="enter",r=a?n:s,c=a?ms(i):gs(i);return c&&(r.style.transformOrigin=c.transformOrigin),[new u.WebAnimation({element:r,integrator:g.from(l),style:a?(d,p)=>c.animate(p):d=>c.animate(d)})]}}const ws={spring:{stiffness:530,damping:34,doubleSpring:1}};class Ss{constructor(){E(this,"physics",ws)}contribute(t){return[]}}const $s={expand:()=>new bs,static:()=>new Ss,blur:()=>new ys};function Cs(e){return $s[e]()}const et="data-zoom-enter-key",_t="data-zoom-exit-key",Es="data-zoom-radius";function It(e){const t=e.getAttribute(Es);if(!t)return 0;const n=parseFloat(t);return Number.isFinite(n)&&n>0?n:0}function xs(e,t){const n=[];let s=t;for(;s&&s!==e;){const o=s.parentElement;if(!o)break;for(const i of Array.from(o.children))i!==s&&i instanceof HTMLElement&&n.push(i);s=o}return n}function vt(e){const t=e.querySelectorAll(`[${et}]`);return t.length!==1?null:t[0]}function Ot(e,t){const n=e.querySelectorAll(`[${_t}]`);for(const s of n)if(s.getAttribute(_t)===t)return s;return null}function As(e,t){const n=vt(e),s=vt(t);if(!n&&s){const o=s.getAttribute(et);if(!o)return null;const i=Ot(e,o);return i?{mode:"enter",enterEl:s,exitEl:i}:null}if(n&&!s){const o=n.getAttribute(et);if(!o)return null;const i=Ot(t,o);return i?{mode:"exit",enterEl:n,exitEl:i}:null}return null}function Ps(e,t,n,s){return{enterRect:ot(e.mode==="enter"?n:t,e.enterEl),exitRect:ot(e.mode==="enter"?t:n,e.exitEl),pageRect:e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),scrollOffset:s,enterRadius:It(e.enterEl),exitRadius:It(e.exitEl)}}class _s{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:s,resolved:o,input:i,physics:l,onComplete:a}=t,r=o.mode==="enter",c=r?as(i):ls(i),d=r?s:n,p=r?"t":"u";c&&(d.style.transformOrigin=c.transformOrigin);const f=r?I:v,m=r?v:I,y=n.style.zIndex;n.style.zIndex=f;const h=s.style.zIndex,b=s.style.position;return s.style.zIndex=m,s.style.position="relative",a(()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.transformOrigin="",d.style.contain="",n.style.zIndex=y,s.style.zIndex===m&&(s.style.zIndex=h),s.style.position==="relative"&&(s.style.position=b),s.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new u.WebAnimation({element:d,integrator:g.from(l),style:p==="t"?w=>c.animate(w):(w,S)=>c.animate(S)})]}}class Is{contribute(t){const{resolved:n,physics:s,from:o,to:i,onComplete:l}=t,a=n.mode==="enter"?i:o,r=xs(a,n.enterEl);if(r.length===0)return[];const c=r.map(d=>d.style.opacity);if(n.mode==="enter")for(const d of r)d.style.opacity="0";return l(()=>{for(let d=0;d<r.length;d++){const p=r[d];p&&(p.style.opacity=c[d]??"")}}),r.map(d=>new u.WebAnimation({element:d,integrator:g.from(s),style:(p,f)=>({opacity:n.mode==="enter"?p:f})}))}}class Lt{contribute(){return[]}}const vs={default:()=>new Lt,fade:()=>new Is};function Os(e){return vs[e]()}class Ts extends Lt{}function Ds(e){const t=Cs(e.type);return{strategies:[new _s,t,Os(e.variant),new Ts,...e.type==="blur"?[new hs]:[]],physics:t.physics}}const Fs=e=>{const{strategies:t,physics:n}=Ds(e);return{prepare:s=>{const o={from:s.from,to:s.to,context:{positionedParent:s.context.positionedParent},createElement:s.createElement},i={};for(const l of t){if(!l.prepare)continue;const a=l.prepare(o);a&&Object.assign(i,a)}return i},animation:({from:s,to:o,context:i,...l})=>{const a=As(s,o);if(!a)return new u.MultiAnimation([],{mode:"parallel"});const r=Ps(a,s,o,i.scrollOffset),c=[],p={from:s,to:o,resolved:a,input:r,physics:n,context:i,extras:l,onComplete:y=>{c.push(y)}},f=[];for(const y of t)y.contribute&&f.push(...y.contribute(p));const m=f[0];if(m){const y=m.onComplete;m.onComplete=()=>{y==null||y();for(const h of c)try{h()}catch(b){console.error("[zoom] cleanup error",b)}}}for(const y of f){if(!(y instanceof u.WebAnimation))continue;const h=y.onComplete;y.onComplete=()=>{h==null||h(),y.releaseFill()}}return new u.MultiAnimation(f,{mode:"parallel"})}}};function ks(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function Ys(e){const t=ks(e);return _(e.paths,()=>Fs(t))}exports.Animation=u.Animation;exports.MultiAnimation=u.MultiAnimation;exports.WebAnimation=u.WebAnimation;exports.axis=Ae;exports.blind=Te;exports.drill=Ue;exports.fade=Be;exports.film=en;exports.hero=In;exports.jaemin=Dn;exports.rotate=Yn;exports.scroll=Mn;exports.sheet=ts;exports.slide=ss;exports.strip=rs;exports.zoom=Ys;
|
package/dist/index.js
CHANGED
|
@@ -725,7 +725,14 @@ function Le() {
|
|
|
725
725
|
};
|
|
726
726
|
}
|
|
727
727
|
const He = {
|
|
728
|
-
spring: {
|
|
728
|
+
spring: {
|
|
729
|
+
stiffness: 230,
|
|
730
|
+
damping: 25,
|
|
731
|
+
doubleSpring: {
|
|
732
|
+
stiffness: 230,
|
|
733
|
+
damping: 24
|
|
734
|
+
}
|
|
735
|
+
}
|
|
729
736
|
};
|
|
730
737
|
function Me(e) {
|
|
731
738
|
const t = e === "enter" ? -20 : 100, n = e === "enter" ? 100 : -20;
|
|
@@ -1910,9 +1917,12 @@ function ts({
|
|
|
1910
1917
|
}
|
|
1911
1918
|
const es = {
|
|
1912
1919
|
spring: {
|
|
1913
|
-
stiffness:
|
|
1914
|
-
damping:
|
|
1915
|
-
doubleSpring:
|
|
1920
|
+
stiffness: 380,
|
|
1921
|
+
damping: 30,
|
|
1922
|
+
doubleSpring: {
|
|
1923
|
+
stiffness: 260,
|
|
1924
|
+
damping: 30
|
|
1925
|
+
}
|
|
1916
1926
|
}
|
|
1917
1927
|
}, Mt = 0.12, ns = 18;
|
|
1918
1928
|
function ss() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallax.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/drill/provider/parallax.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,aAAa,EACd,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"parallax.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/drill/provider/parallax.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,aAAa,EACd,MAAM,UAAU,CAAC;AAyClB,wBAAgB,sBAAsB,IAAI,aAAa,CAKtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EAEV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAK5B,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EAEV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAK5B,eAAO,MAAM,YAAY,EAAE,cAS1B,CAAC;AAqEF,qBAAa,sBAAuB,YAAW,YAAY;IACzD,QAAQ,CAAC,OAAO,iBAAgB;IAEhC,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAkBhD;AAQD,qBAAa,eAAgB,YAAW,YAAY;IAClD,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAQjD,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CA2BhD;AAMD,wBAAgB,kBAAkB,IAAI,YAAY,CASjD"}
|