{var t=this.unsuspend;this.unsuspend=null,t()}}}var Ws=null;function $s(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ws=new Map,e.forEach(P1,t),Ws=null,Js.call(t))}function P1(t,e){if(!(e.state.loading&4)){var n=Ws.get(t);if(n)var a=n.get(null);else{n=new Map,Ws.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(l){console.error(l)}}return i(),ic.exports=f2(),ic.exports}var h2=d2();const $c=Y.createContext({});function Nr(i){const l=Y.useRef(null);return l.current===null&&(l.current=i()),l.current}const m2=typeof window<"u",zl=m2?Y.useLayoutEffect:Y.useEffect,Or=Y.createContext(null);function Ic(i,l){i.indexOf(l)===-1&&i.push(l)}function Sr(i,l){const s=i.indexOf(l);s>-1&&i.splice(s,1)}const ln=(i,l,s)=>s>l?l:s{};const jn={},tf=i=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(i),lv=i=>typeof i=="object"&&i!==null,ef=i=>/^0[^.\s]+$/u.test(i);function sv(i){let l;return()=>(l===void 0&&(l=i()),l)}const an=i=>i,Bl=(...i)=>i.reduce((l,s)=>o=>s(l(o))),Nl=(i,l,s)=>{const o=l-i;return o?(s-i)/o:1};class Tr{constructor(){this.subscriptions=[]}add(l){return Ic(this.subscriptions,l),()=>this.remove(l)}remove(l){Sr(this.subscriptions,l)}notify(l,s,o){const f=this.subscriptions.length;if(f)if(f===1)this.subscriptions[0](l,s,o);else for(let d=0;di*1e3,Ve=i=>i/1e3,rv=(i,l)=>l?i*(1e3/l):0,ov=(i,l,s)=>(((1-3*s+3*l)*i+(3*s-6*l))*i+3*l)*i,p2=1e-7,v2=12;function g2(i,l,s,o,f){let d,u,m=0;do u=l+(s-l)/2,d=ov(u,o,f)-i,d>0?s=u:l=u;while(Math.abs(d)>p2&&++mg2(d,0,1,i,s);return d=>d===0||d===1?d:ov(f(d),l,o)}const uv=i=>l=>l<=.5?i(2*l) /2:(2-i(2*(1-l)))/2,cv=i=>l=>1-i(1-l),fv=Hl(.33,1.53,.69,.99),nf=cv(fv),dv=uv(nf),hv=i=>i>=1?1:(i*=2)<1?.5*nf(i):.5*(2-Math.pow(2,-10*(i-1))),af=i=>1-Math.sin(Math.acos(i)),mv=cv(af),pv=uv(af),y2=Hl(.42,0,1,1),x2=Hl(0,0,.58,1),lf=Hl(.42,0,.58,1),b2=i=>Array.isArray(i)&&typeof i[0]!="number",vv=i=>Array.isArray(i)&&typeof i[0]=="number",S2={linear:an,easeIn:y2,easeInOut:lf,easeOut:x2,circIn:af,circInOut:pv,circOut:mv,backIn:nf,backInOut:dv,backOut:fv,anticipate:hv},T2=i=>typeof i=="string",B0=i=>{if(vv(i)){Lr(i.length===4);const[l,s,o,f]=i;return Hl(l,s,o,f)}else if(T2(i))return S2[i];return i},sr=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function E2(i){let l=new Set,s=new Set,o=!1,f=!1;const d=new Set;let u={delta:0,timestamp:0,isProcessing:!1};function m(p){d.has(p)&&(s.add(p),i()),p(u)}const v={schedule:(p,g=!1,x=!1)=>{const b=x&&o?l:s;return g&&d.add(p),b.add(p),p},cancel:p=>{s.delete(p),d.delete(p)},process:p=>{if(u=p,o){f=!0;return}o=!0;const g=l;l=s,s=g,l.forEach(m),l.clear(),o=!1,f&&(f=!1,v.process(p))}};return v}const A2=40;function gv(i,l){let s=!1,o=!0;const f={delta:0,timestamp:0,isProcessing:!1},d=()=>s=!0,u=sr.reduce((B,H)=>(B[H]=E2(d),B),{}),{setup:m,read:v,resolveKeyframes:p,preUpdate:g,update:x,preRender:S,render:b,postRender:w}=u,D=()=>{const B=jn.useManualTiming,H=B?f.timestamp:performance.now();s=!1,B||(f.delta=o?1e3/60:Math.max(Math.min(H-f.timestamp,A2),1)),f.timestamp=H,f.isProcessing=!0,m.process(f),v.process(f),p.process(f),g.process(f),x.process(f),S.process(f),b.process(f),w.process(f),f.isProcessing=!1,s&&l&&(o=!1,i(D))},_=()=>{s=!0,o=!0,f.isProcessing||i(D)};return{schedule:sr.reduce((B,H)=>{const Q=u[H];return B[H]=(I,O=!1,U=!1)=>(s||_(),Q.schedule(I,O,U)),B},{}),cancel:B=>{for(let H=0;H(dr===void 0&&de.set(se.isProcessing||jn.useManualTiming?se.timestamp:performance.now()),dr),set:i=>{dr=i,queueMicrotask(w2)}},_a=i=>Math.round(i*1e5)/1e5,yv=i=>l=>typeof l=="string"&&l.startsWith(i),xv=yv("--"),M2=yv("var(--"),sf=i=>M2(i)?_2.test(i.split("/*")[0].trim()):!1,_2=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function H0(i){return typeof i!="string"?!1:i.split("/*")[0].includes("var(--")}const Da={test:i=>typeof i=="number",parse:parseFloat,transform:i=>i},Ol={...Da,transform:i=>ln(0,1,i)},rr={...Da,default:1},rf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function R2(i){return i==null}const D2=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,of=(i,l)=>s=>!!(typeof s=="string"&&D2.test(s)&&s.startsWith(i)||l&&!R2(s)&&Object.prototype.hasOwnProperty.call(s,l)),bv=(i,l,s)=>o=>{if(typeof o!="string")return o;const[f,d,u,m]=o.match(rf);return{[i]:parseFloat(f),[l]:parseFloat(d),[s]:parseFloat(u),alpha:m!==void 0?parseFloat(m):1}},C2=i=>ln(0,255,i),oc={...Da,transform:i=>Math.round(C2(i))},Oi={test:of("rgb","red"),parse:bv("red","green","blue"),transform:({red:i,green:l,blue:s,alpha:o=1})=>"rgba("+oc.transform(i)+", "+oc.transform(l)+", "+oc.transform(s)+", "+_a(Ol.transform(o))+")"};function z2(i){let l="",s="",o="",f="";return i.length>5?(l=i.substring(1,3),s=i.substring(3,5),o=i.substring(5,7),f=i.substring(7,9)):(l=i.substring(1,2),s=i.substring(2,3),o=i.substring(3,4),f=i.substring(4,5),l+=l,s+=s,o+=o,f+=f),{red:parseInt(l,16),green:parseInt(s,16),blue:parseInt(o,16),alpha:f?parseInt(f,16)/255:1}}const Ac={test:of("#"),parse:z2,transform:Oi.transform},ql=i=>({test:l=>typeof l=="string"&&l.endsWith(i)&&l.split(" ").length===1,parse:parseFloat,transform:l=>`${l}${i}`}),Un=ql("deg"),mn=ql("%"),lt=ql("px"),N2=ql("vh"),O2=ql("vw"),q0={...mn,parse:i=>mn.parse(i)/100,transform:i=>mn.transform(i*100)},Ea={test:of("hsl","hue"),parse:bv("hue","saturation","lightness"),transform:({hue:i,saturation:l,lightness:s,alpha:o=1})=>"hsla("+Math.round(i)+", "+mn.transform(_a(l))+", "+mn.transform(_a(s))+", "+_a(Ol.transform(o))+")"},ie={test:i=>Oi.test(i)||Ac.test(i)||Ea.test(i),parse:i=>Oi.test(i)?Oi.parse(i):Ea.test(i)?Ea.parse(i):Ac.parse(i),transform:i=>typeof i=="string"?i:i.hasOwnProperty("red")?Oi.transform(i):Ea.transform(i),getAnimatableNone:i=>{const l=ie.parse(i);return l.alpha=0,ie.transform(l)}},L2=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Sv=new RegExp(rf.source),Tv=new RegExp(L2.source,"i");function U2(i){return isNaN(i)&&typeof i=="string"&&(Sv.test(i)||Tv.test(i))}const Ev="number",Av="color",j2="var",V2="var(",Y0="${}",B2=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function H2(i){const l=i.toString();return Sv.test(l)||Tv.test(l)}function Ll(i){const l=i.toString(),s=[],o={color:[],number:[],var:[]},f=[];let d=0;const m=l.replace(B2,v=>(ie.test(v)?(o.color.push(d),f.push(Av),s.push(ie.parse(v))):v.startsWith(V2)?(o.var.push(d),f.push(j2),s.push(v)):(o.number.push(d),f.push(Ev),s.push(parseFloat(v))),++d,Y0)).split(Y0);return{values:s,split:m,indexes:o,types:f}}function q2(i){return Ll(i).values}function wv({split:i,types:l}){const s=i.length;return o=>{let f="";for(let d=0;dtypeof i=="number"?0:ie.test(i)?ie.getAnimatableNone(i):i,G2=(i,l)=>typeof i=="number"?l?.trim().endsWith("/")?i:0:F2(i);function X2(i){const l=Ll(i);return wv(l)(l.values.map((o,f)=>G2(o,l.split[f])))}const Be={test:U2,parse:q2,createTransformer:Y2,getAnimatableNone:X2};function uc(i,l,s){return s<0&&(s+=1),s>1&&(s-=1),s<1 /6?i+(l-i)*6*s:s<1/2?l:s<2/3?i+(l-i)*(2/3-s)*6:i}function k2({hue:i,saturation:l,lightness:s,alpha:o}){i/=360,l/=100,s/=100;let f=0,d=0,u=0;if(!l)f=d=u=s;else{const m=s<.5?s*(1+l):s+l-s*l,v=2*s-m;f=uc(v,m,i+1/3),d=uc(v,m,i),u=uc(v,m,i-1/3)}return{red:Math.round(f*255),green:Math.round(d*255),blue:Math.round(u*255),alpha:o}}function Er(i,l){return s=>s>0?l:i}const Ut=(i,l,s)=>i+(l-i)*s,cc=(i,l,s)=>{const o=i*i,f=s*(l*l-o)+o;return f<0?0:Math.sqrt(f)},Q2=[Ac,Oi,Ea],K2=i=>Q2.find(l=>l.test(i));function F0(i){const l=K2(i);if(!l)return!1;let s=l.parse(i);return l===Ea&&(s=k2(s)),s}const G0=(i,l)=>{const s=F0(i),o=F0(l);if(!s||!o)return Er(i,l);const f={...s};return d=>(f.red=cc(s.red,o.red,d),f.green=cc(s.green,o.green,d),f.blue=cc(s.blue,o.blue,d),f.alpha=Ut(s.alpha,o.alpha,d),Oi.transform(f))},wc=new Set(["none","hidden"]);function Z2(i,l){return wc.has(i)?s=>s<=0?i:l:s=>s>=1?l:i}function P2(i,l){return s=>Ut(i,l,s)}function uf(i){return typeof i=="number"?P2:typeof i=="string"?sf(i)?Er:ie.test(i)?G0:$2:Array.isArray(i)?Mv:typeof i=="object"?ie.test(i)?G0:J2:Er}function Mv(i,l){const s=[...i],o=s.length,f=i.map((d,u)=>uf(d)(d,l[u]));return d=>{for(let u=0;u{for(const d in o)s[d]=o[d](f);return s}}function W2(i,l){const s=[],o={color:0,var:0,number:0};for(let f=0;f{const s=Be.createTransformer(l),o=Ll(i),f=Ll(l);return o.indexes.var.length===f.indexes.var.length&&o.indexes.color.length===f.indexes.color.length&&o.indexes.number.length>=f.indexes.number.length?wc.has(i)&&!f.values.length||wc.has(l)&&!o.values.length?Z2(i,l):Bl(Mv(W2(o,f),f.values),s):Er(i,l)},X0=/^(-?(?:\d+(?:\.\d*)?|\.\d+))([a-z%]*)$/iu;function I2(i,l){const s=X0.exec(i);if(!s)return;const o=X0.exec(l);if(!o||s[2]!==o[2])return;const f=s[2],d=parseFloat(s[1]),u=parseFloat(o[1]);return m=>_a(Ut(d,u,m))+f}function cf(i,l,s){if(typeof i=="number"&&typeof l=="number"&&typeof s=="number")return Ut(i,l,s);if(typeof i=="string"&&typeof l=="string"){const f=I2(i,l);if(f)return f}return uf(i)(i,l)}const tx=i=>{const l=({timestamp:s})=>i(s);return{start:(s=!0)=>Vt.update(l,s),stop:()=>fi(l),now:()=>se.isProcessing?se.timestamp:de.now()}},_v=(i,l,s=10)=>{let o="";const f=Math.max(Math.round(l/s),2);for(let d=0;d=s?1/0:f}function ex(i,l=100,s){const o=s({...i,keyframes:[0,l]}),f=Math.min(df(o),ff);return{type:" keyframes",ease:d=>o.next(f*d).value/l,duration:Ve(f)}}const Xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Mc(i,l){return i*Math.sqrt(1-l*l)}const nx=12;function ix(i,l,s){let o=s;for(let f=1;f{const g=p*u,x=g*i,S=g-s,b=Mc(p,u),w=Math.exp(-x);return fc-S/b*w},d=p=>{const x=p*u*i,S=x*s+s,b=u*u*p*p*i,w=Math.exp(-x),D=Mc(p*p,u);return(-f(p)+fc>0?-1:1)*((S-b)*w)/D}):(f=p=>{const g=Math.exp(-p*i),x=(p-s)*i+1;return-fc+g*x},d=p=>{const g=Math.exp(-p*i),x=(s-p)*(i*i);return g*x});const m=5/i,v=ix(f,d,m);if(i=Je(i),isNaN(v))return{stiffness:Xt.stiffness,damping:Xt.damping,duration:i};{const p=v*v*o;return{stiffness:p,damping:u*2*Math.sqrt(o*p),duration:i}}}const lx=["duration","bounce"];function sx(i,l){return l.some(s=>i[s]!==void 0)}const _c=(i,l)=>(l?i>=0:i>0)&&i<1 /0;function dc(i,l){if(_c(i,l))return i}function rx(i){const l=dc(i.stiffness),s=dc(i.damping,!0),o=dc(i.mass);let f={...i,stiffness:l??Xt.stiffness,damping:s??Xt.damping,mass:o??Xt.mass,isResolvedFromDuration:!1,isTimeDefined:(l??s??o)===void 0&&sx(i,lx)};if(f.isTimeDefined){if(f.velocity=0,i.visualDuration){const d=i.visualDuration,u=2*Math.PI/(d*1.2),m=u*u,v=2*ln(.05,1,1-(i.bounce||0))*Math.sqrt(m);f={...f,mass:Xt.mass,stiffness:m,damping:v}}else{const d=ax(f);f={...f,...d,mass:Xt.mass},f.isResolvedFromDuration=!0}(!_c(f.stiffness)||!_c(f.damping,!0))&&(f.stiffness=Xt.stiffness,f.damping=Xt.damping)}return f}function Ar(i=Xt.visualDuration,l=Xt.bounce){const s=typeof i!="object" ?{visualDuration:i,keyframes:[0,1],bounce:l}:i,o=s.keyframes[0],f=s.keyframes[s.keyframes.length-1],d={done:!1,value:o},{stiffness:u,damping:m,mass:v,duration:p,velocity:g,isResolvedFromDuration:x,isTimeDefined:S}=rx({...s,velocity:-Ve(s.velocity||0)}),b=m/(2*Math.sqrt(u*v)),w=Ve(Math.sqrt(u/v)),D=b*w,_={target:f,delta:f-o,velocity:g||0,restSpeed:0,restDelta:0},G=()=>{const O=Math.abs(_.delta)<5;_.restSpeed=s.restSpeed||(O?Xt.restSpeed.granular:Xt.restSpeed.default),_.restDelta=s.restDelta||(O?Xt.restDelta.granular:Xt.restDelta.default)};G();let F,B,H;if(b<1){const O=Mc(w,b),U={A:0,sinC:0,cosC:0,t:-1,env:0,sin:0,cos:0};H=()=>{U.A=(_.velocity+D*_.delta)/O,U.sinC=D*U.A+_.delta*O,U.cosC=D*_.delta-U.A*O};const W=tt=>{tt!==U.t&&(U.t=tt,U.env=Math.exp(-D*tt),U.sin=Math.sin(O*tt),U.cos=Math.cos(O*tt))};F=tt=>(W(tt),_.target-U.env*(U.A*U.sin+_.delta*U.cos)),B=tt=>(W(tt),U.env*(U.sinC*U.sin+U.cosC*U.cos))}else if(b===1){F=U=>_.target-Math.exp(-w*U)*(_.delta+(_.velocity+w*_.delta)*U);const O={C:0};H=()=>{O.C=_.velocity+w*_.delta},B=U=>Math.exp(-w*U)*(w*O.C*U-_.velocity)}else{const O=w*Math.sqrt(b*b-1);F=W=>{const tt=Math.exp(-D*W),it=Math.min(O*W,300);return _.target-tt*((_.velocity+D*_.delta)*Math.sinh(it)+O*_.delta*Math.cosh(it))/O};const U={P:0,sinh:0,cosh:0};H=()=>{U.P=(_.velocity+D*_.delta)/O,U.sinh=D*U.P-_.delta*O,U.cosh=D*_.delta-U.P*O},B=W=>{const tt=Math.exp(-D*W),it=Math.min(O*W,300);return tt*(U.sinh*Math.sinh(it)+U.cosh*Math.cosh(it))}}H();const Q=x&&p||null,I={calculatedDuration:Q,retarget:(O,U)=>{_.target=O[O.length-1],_.delta=_.target-O[0],_.velocity=S?0:-Ve(U),s.restSpeed&&s.restDelta||G(),I.calculatedDuration=Q,d.done=!1,H()},velocity:O=>Je(B(O)),next:O=>{const U=F(O);if(x)d.done=O>=p;else{const W=Je(B(O));d.done=Math.abs(W)<=_.restSpeed&&Math.abs(_.target-U)<=_.restDelta}return d.value=d.done?_.target:U,d},toString:()=>{const O=Math.min(df(I),ff),U=_v(W=>I.next(O*W).value,O,30);return O+"ms "+U},toTransition:()=>{}};return I}Ar.applyToOptions=i=>{const l=ex(i,100,Ar);return i.ease=l.ease,i.duration=Je(l.duration),i.type="keyframes",i};function Rc({keyframes:i,velocity:l=0,power:s=.8,timeConstant:o=325,bounceDamping:f=10,bounceStiffness:d=500,modifyTarget:u,min:m,max:v,restDelta:p=.5,restSpeed:g}){const x=i[0],S={done:!1,value:x},b=O=>Ov,w=O=>m===void 0?v:v===void 0||Math.abs(m-O)-D*Math.exp(-O/o),B=O=>{const U=F(O);S.done=Math.abs(U)<=p,S.value=S.done?G:G+U};let H,Q;const I=O=>{b(S.value)&&(H=O,Q=Ar({keyframes:[S.value,w(S.value)],velocity:-F(O)/o*1e3,damping:f,stiffness:d,restDelta:p,restSpeed:g}))};return I(0),{calculatedDuration:null,next:O=>{let U=!1;return!Q&&H===void 0&&(U=!0,B(O),I(O)),H!==void 0&&O>=H?Q.next(O-H):(!U&&B(O),S)}}}function ox(i,l,s){const o=[],f=s||jn.mix||cf,d=i.length-1;for(let u=0;ul[0];if(d===2&&l[0]===l[1])return()=>l[1];const u=i[0]===i[1];i[0]>i[d-1]&&(i=[...i].reverse(),l=[...l].reverse());const m=ox(l,o,f),v=m.length,p=g=>{if(u&&g1)for(;xp(ln(i[0],i[d-1],g)):p}function cx(i,l){const s=i[i.length-1];for(let o=1;o<=l;o++){const f=Nl(0,l,o);i.push(Ut(s,1,f))}}function fx(i){const l=[0];return cx(l,i.length-1),l}function dx(i,l){return i.map(s=>s*l)}function hx(i,l){return i.map(()=>l||lf).splice(0,i.length-1)}function Rl({duration:i=300,keyframes:l,times:s,ease:o="easeInOut"}){const f=b2(o)?o.map(B0):B0(o)||lf,d={done:!1,value:l[0]};if(l.length===2&&!Array.isArray(f)&&(!s||s.length!==2||s[0]===0&&s[1]===1)){const[v,p]=l,g=v===p?void 0:(jn.mix||cf)(v,p);return{calculatedDuration:i,next:x=>(d.value=g?g(f(i>0?ln(0,1,x/i):1)):p,d.done=x>=i,d)}}const u=dx(s&&s.length===l.length?s:fx(l),i),m=ux(u,l,{ease:Array.isArray(f)?f:hx(l,f)});return{calculatedDuration:i,next:v=>(d.value=m(v),d.done=v>=i,d)}}const mx=5;function px(i,l,s){const o=Math.max(l-mx,0);return rv(s-i(o),l-o)}function vx(i,l,s=0){return l<=0?s:i.velocity?i.velocity(l):px(o=>i.next(o).value,l,i.next(l).value)}const gx=i=>i!==null;function Ur(i,{repeat:l,repeatType:s="loop"},o,f=1){const d=i.filter(gx),m=f<0||l&&s!=="loop"&&l%2===1?0:d.length-1;return!m||o===void 0?d[m]:o}const yx={decay:Rc,inertia:Rc,tween:Rl,keyframes:Rl,spring:Ar};function Rv(i){typeof i.type=="string" &&(i.type=yx[i.type])}function Dv(i,l){return{kind:i,animation:l,timestamp:de.now(),frameTimestamp:se.timestamp,frameIsProcessing:se.isProcessing}}function Cv(i,l,s){const o=globalThis.__MOTION_INSPECT__;if(o)try{o({...Dv("animation-start",i),options:s?{...l,...s}:l})}catch{}}function xx(i,l){const s=globalThis.__MOTION_INSPECT__;if(s)try{s({...Dv("layout-animation-start",i),node:l})}catch{}}class hf{constructor(){this.isResolved=!1}get finished(){return this._finished||(this._finished=this.isResolved?Promise.resolve():new Promise(l=>{this._resolve=l})),this._finished}updateFinished(){this._finished=this._resolve=void 0,this.isResolved=!1}notifyFinished(){this.isResolved=!0,this._resolve?.()}then(l,s){return this.finished.then(l,s)}}const bx=i=>i/100;class wr extends hf{constructor(l){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==de.now()&&this.tick(de.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=l,this.initAnimation(),this.play(),l.autoplay===!1&&this.pause(),Cv(this,this.options)}initAnimation(){const{options:l}=this;Rv(l);const{type:s=Rl,repeat:o=0,repeatDelay:f=0,repeatType:d,velocity:u=0}=l;let{keyframes:m}=l;const v=s||Rl;v!==Rl&&typeof m[0]!="number"&&(this.mixKeyframes=Bl(bx,cf(m[0],m[1])),m=[0,100]);const p=v(m===l.keyframes?l:{...l,keyframes:m});d==="mirror"&&(this.mirroredGenerator=v({...l,keyframes:[...m].reverse(),velocity:-u})),p.calculatedDuration===null&&(p.calculatedDuration=df(p));const{calculatedDuration:g}=p;this.calculatedDuration=g,this.resolvedDuration=g+f,this.totalDuration=this.resolvedDuration*(o+1)-f,this.generator=p}updateTime(l){const s=Math.round(l-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(l,s=!1){const{generator:o,totalDuration:f,mixKeyframes:d,mirroredGenerator:u,resolvedDuration:m,calculatedDuration:v}=this;if(this.startTime===null)return o.next(0);const{delay:p=0,keyframes:g,repeat:x,repeatType:S,repeatDelay:b,type:w,onUpdate:D,finalKeyframe:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,l):this.speed<0&&(this.startTime=Math.min(l-f /this.speed,this.startTime)),s?this.currentTime=l:this.updateTime(l);const G=this.currentTime-p*(this.playbackSpeed>=0?1:-1),F=this.playbackSpeed>=0?G<0:G>f;this.currentTime=Math.max(G,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let B=this.currentTime,H=o;if(x){const U=Math.min(this.currentTime,f)/m;let W=Math.floor(U),tt=U%1;!tt&&U>=1&&(tt=1),tt===1&&W--,W=Math.min(W,x+1),W%2&&(S==="reverse"?(tt=1-tt,b&&(tt-=b/m)):S==="mirror"&&(H=u)),B=ln(0,1,tt)*m}let Q;F?(this.delayState.value=g[0],Q=this.delayState):Q=H.next(B),d&&!F&&(Q.value=d(Q.value));let{done:I}=Q;!F&&v!==null&&(I=this.playbackSpeed>=0?this.currentTime>=f:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished" ||this.state==="running" &&I);return O&&w!==Rc&&(Q.value=Ur(g,this.options,_,this.speed)),D&&D(Q.value),O&&this.finish(),Q}then(l,s){return this.finished.then(l,s)}get duration(){return Ve(this.calculatedDuration)}get iterationDuration(){const{delay:l=0}=this.options||{};return this.duration+Ve(l)}get time(){return Ve(this.currentTime)}set time(l){l=Je(l),this.currentTime=l,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=l:this.driver&&(this.startTime=this.driver.now()-l/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused" ,this.holdTime=l,this.tick(l))}getGeneratorVelocity(){return vx(this.generator,this.currentTime,this.options.velocity)}get speed(){return this.playbackSpeed}set speed(l){const s=this.playbackSpeed!==l;s&&this.driver&&this.updateTime(de.now()),this.playbackSpeed=l,s&&this.driver&&(this.time=Ve(this.currentTime))}play(){if(this.isStopped)return;const{driver:l=tx,startTime:s}=this.options;this.driver||(this.driver=l(f=>this.tick(f))),this.options.onPlay?.();const o=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=o):this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime||(this.startTime=s??o),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(de.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(l){return this.startTime=0,this.tick(l,!0)}attachTimeline(l){return this.options.allowFlatten&&(this.options.type="keyframes" ,this.options.ease="linear" ,this.initAnimation()),this.driver?.stop(),l.observe(this)}}const Sx=new Set(["brightness","contrast","saturate","opacity"]);function Tx(i){const[l,s]=i.slice(0,-1).split("(");if(l==="drop-shadow" )return i;const[o]=s.match(rf)||[];if(!o)return i;const f=s.replace(o,"");let d=Sx.has(l)?1:0;return o!==s&&(d*=100),l+"("+d+f+")"}const Ex=/\b([a-z-]*)\(.*?\)/gu,Dc={...Be,getAnimatableNone:i=>{const l=i.match(Ex);return l?l.map(Tx).join(" "):i}},Cc={...Be,getAnimatableNone:i=>{const l=Be.parse(i);return Be.createTransformer(i)(l.map(o=>typeof o=="number"?0:typeof o=="object"?{...o,alpha:1}:o))}},k0={...Da,transform:Math.round},Ax={rotate:Un,pathRotation:Un,rotateX:Un,rotateY:Un,rotateZ:Un,scale:rr,scaleX:rr,scaleY:rr,scaleZ:rr,skew:Un,skewX:Un,skewY:Un,distance:lt,translateX:lt,translateY:lt,translateZ:lt,x:lt,y:lt,z:lt,perspective:lt,transformPerspective:lt,opacity:Ol,originX:q0,originY:q0,originZ:lt},Mr={borderWidth:lt,borderTopWidth:lt,borderRightWidth:lt,borderBottomWidth:lt,borderLeftWidth:lt,borderRadius:lt,borderTopLeftRadius:lt,borderTopRightRadius:lt,borderBottomRightRadius:lt,borderBottomLeftRadius:lt,width:lt,maxWidth:lt,height:lt,maxHeight:lt,top:lt,right:lt,bottom:lt,left:lt,inset:lt,insetBlock:lt,insetBlockStart:lt,insetBlockEnd:lt,insetInline:lt,insetInlineStart:lt,insetInlineEnd:lt,padding:lt,paddingTop:lt,paddingRight:lt,paddingBottom:lt,paddingLeft:lt,paddingBlock:lt,paddingBlockStart:lt,paddingBlockEnd:lt,paddingInline:lt,paddingInlineStart:lt,paddingInlineEnd:lt,margin:lt,marginTop:lt,marginRight:lt,marginBottom:lt,marginLeft:lt,marginBlock:lt,marginBlockStart:lt,marginBlockEnd:lt,marginInline:lt,marginInlineStart:lt,marginInlineEnd:lt,fontSize:lt,backgroundPositionX:lt,backgroundPositionY:lt,...Ax,zIndex:k0,fillOpacity:Ol,strokeOpacity:Ol,numOctaves:k0},wx={...Mr,color:ie,backgroundColor:ie,outlineColor:ie,fill:ie,stroke:ie,borderColor:ie,borderTopColor:ie,borderRightColor:ie,borderBottomColor:ie,borderLeftColor:ie,filter:Dc,WebkitFilter:Dc,mask:Cc,WebkitMask:Cc},zv=i=>wx[i],Mx=new Set([Dc,Cc]);function mf(i,l){let s=zv(i);return Mx.has(s)||(s=Be),s.getAnimatableNone?s.getAnimatableNone(l):void 0}function _x(i){for(let l=1;li*180/Math.PI,zc=i=>{const l=Li(Math.atan2(i[1],i[0]));return Nc(l)},Rx={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:i=>(Math.abs(i[0])+Math.abs(i[3]))/2,rotate:zc,rotateZ:zc,skewX:i=>Li(Math.atan(i[1])),skewY:i=>Li(Math.atan(i[2])),skew:i=>(Math.abs(i[1])+Math.abs(i[2]))/2},Nc=i=>(i=i%360,i<0&&(i+=360),i),Q0=zc,K0=i=>Math.sqrt(i[0]*i[0]+i[1]*i[1]),Z0=i=>Math.sqrt(i[4]*i[4]+i[5]*i[5]),Dx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:K0,scaleY:Z0,scale:i=>(K0(i)+Z0(i))/2,rotateX:i=>Nc(Li(Math.atan2(i[6],i[5]))),rotateY:i=>Nc(Li(Math.atan2(-i[2],i[0]))),rotateZ:Q0,rotate:Q0,skewX:i=>Li(Math.atan(i[4])),skewY:i=>Li(Math.atan(i[1])),skew:i=>(Math.abs(i[1])+Math.abs(i[4]))/2};function Oc(i){return i.includes("scale")?1:0}function Lc(i,l){if(!i||i==="none")return Oc(l);const s=i.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let o,f;if(s)o=Dx,f=s;else{const m=i.match(/^matrix\(([-\d.e\s,]+)\)$/u);o=Rx,f=m}if(!f)return Oc(l);const d=o[l],u=f[1].split(",").map(zx);return typeof d=="function"?d(u):u[d]}const Cx=(i,l)=>{const{transform:s="none"}=getComputedStyle(i);return Lc(s,l)};function zx(i){return parseFloat(i.trim())}const Ca=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],za=new Set([...Ca,"pathRotation"]),P0=i=>i===Da||i===lt,Nx=new Set(["x","y","z"]),Ox=Ca.filter(i=>!Nx.has(i));function Lx(i){const l=[];return Ox.forEach(s=>{const o=i.getValue(s);if(o!==void 0){const f=o.get(),d=s.startsWith("scale")?1:0;if(f===d)return;l.push([s,f]),o.set(d)}}),l}const Ux=new Set(["bottom","right"]);function J0(i,l,s,o,f,d){const u=parseFloat(i);if(!isNaN(u))return u;const{min:m,max:v}=l()[s],p=v-m;return d==="border-box"?p:p-parseFloat(o)-parseFloat(f)}const Ui={width:({width:i,paddingLeft:l="0",paddingRight:s="0",boxSizing:o},f)=>J0(i,f,"x",l,s,o),height:({height:i,paddingTop:l="0",paddingBottom:s="0",boxSizing:o},f)=>J0(i,f,"y",l,s,o),top:({top:i})=>parseFloat(i),left:({left:i})=>parseFloat(i),bottom:({top:i},l)=>{const{y:s}=l();return parseFloat(i)+(s.max-s.min)},right:({left:i},l)=>{const{x:s}=l();return parseFloat(i)+(s.max-s.min)},x:({transform:i})=>Lc(i,"x"),y:({transform:i})=>Lc(i,"y")};Ui.translateX=Ui.x;Ui.translateY=Ui.y;const ji=new Set;let Uc=!1,jc=!1,Vc=!1;function Nv(){if(jc){const i=[],l=new Set,s=new Set;ji.forEach(f=>{f.needsMeasurement&&(i.push(f),l.add(f.element),Ux.has(f.name)&&s.add(f.element))});const o=new Map;s.forEach(f=>{const d=Lx(f);d.length&&(o.set(f,d),f.render())}),i.forEach(f=>f.measureInitialState()),l.forEach(f=>{f.render();const d=o.get(f);d&&d.forEach(([u,m])=>{f.getValue(u)?.set(m)})}),i.forEach(f=>f.measureEndState()),i.forEach(f=>{f.suspendedScrollY!==void 0&&window.scrollTo(0,f.suspendedScrollY)})}jc=!1,Uc=!1,ji.forEach(i=>i.complete(Vc)),ji.clear()}function Ov(){ji.forEach(i=>{i.readKeyframes(),i.needsMeasurement&&(jc=!0)})}function jx(){Vc=!0,Ov(),Nv(),Vc=!1}function Vx(i,l,s){if(typeof i=="string"){if(tf(i)||ef(i))return parseFloat(i);if(!Be.test(i)&&Be.test(s))return mf(l,s)}return i??void 0}class pf{constructor(l,s,o,f,d,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...l],this.onComplete=s,this.name=o,this.motionValue=f,this.element=d,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?(ji.add(this),Uc||(Uc=!0,Vt.read(Ov),Vt.resolveKeyframes(Nv))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:l,name:s,element:o,motionValue:f}=this;if(l[0]===null){const d=f?.get(),u=l[l.length-1];if(d!==void 0)l[0]=d;else if(o&&s){const m=Vx(o.readValue(s,u),s,u);m!==void 0&&(l[0]=m)}l[0]===void 0&&(l[0]=u),f&&d===void 0&&f.set(l[0])}_x(l)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(l=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,l),ji.delete(this)}cancel(){this.state==="scheduled"&&(ji.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Bx=i=>i.startsWith("--");function Lv(i,l,s){Bx(l)?i.style.setProperty(l,s):i.style[l]=s}const Hx={};function Uv(i,l){const s=sv(i);return()=>Hx[l]??s()}const qx=Uv(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),jv=Uv(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),_l=([i,l,s,o])=>`cubic-bezier(${i}, ${l}, ${s}, ${o})`,W0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_l([0,.65,.55,1]),circOut:_l([.55,0,1,.45]),backIn:_l([.31,.01,.66,-.59]),backOut:_l([.33,1.53,.69,.99])};function Vv(i,l){if(i)return typeof i=="function"?jv()?_v(i,l):"ease-out":vv(i)?_l(i):Array.isArray(i)?i.map(s=>Vv(s,l)||W0.easeOut):W0[i]}function Yx(i,l,s,{delay:o=0,duration:f=300,repeat:d=0,repeatType:u="loop",ease:m="easeOut",times:v}={},p=void 0){const g={[l]:s};v&&(g.offset=v);const x=Vv(m,f);Array.isArray(x)&&(g.easing=x);const S={delay:o,duration:f,easing:Array.isArray(x)?"linear":x,fill:"both",iterations:d+1,direction:u==="reverse"?"alternate":"normal"};return p&&(S.pseudoElement=p),i.animate(g,S)}function Bv(i){return typeof i=="function"&&"applyToOptions"in i}function Fx({type:i,...l}){return Bv(i)&&jv()?i.applyToOptions(l):(l.duration??(l.duration=300),l.ease??(l.ease="easeOut"),l)}class Hv extends hf{constructor(l){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!l)return;const{element:s,name:o,keyframes:f,pseudoElement:d,allowFlatten:u=!1,finalKeyframe:m,onComplete:v}=l;this.isPseudoElement=!!d,this.allowFlatten=u,this.options=l,Lr(typeof l.type!="string");const p=Fx(l);this.animation=Yx(s,o,f,p,d),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!d){const g=Ur(f,this.options,m,this.speed);this.updateMotionValue&&this.updateMotionValue(g),Lv(s,o,g),this.animation.cancel()}v?.(),this.notifyFinished()},Cv(this,l,p)}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:l}=this;l==="idle"||l==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const l=this.options?.element;!this.isPseudoElement&&l?.isConnected&&this.animation.commitStyles?.()}get duration(){const l=this.animation.effect?.getComputedTiming?.().duration||0;return Ve(Number(l))}get iterationDuration(){const{delay:l=0}=this.options||{};return this.duration+Ve(l)}get time(){return Ve(Number(this.animation.currentTime)||0)}set time(l){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Je(l),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(l){l<0&&(this.finishedTime=null),this.animation.playbackRate=l}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(l){this.manualStartTime=this.animation.startTime=l}attachTimeline({timeline:l,rangeStart:s,rangeEnd:o,observe:f}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,l&&qx()?(this.animation.timeline=l,s&&(this.animation.rangeStart=s),o&&(this.animation.rangeEnd=o),an):f(this)}}const qv={anticipate:hv,backInOut:dv,circInOut:pv};function Gx(i){return i in qv}function Xx(i){typeof i.ease=="string" &&Gx(i.ease)&&(i.ease=qv[i.ease])}const hc=10;class kx extends Hv{constructor(l){Xx(l),Rv(l),super(l),l.startTime!==void 0&&l.autoplay!==!1&&(this.startTime=l.startTime),this.options=l}updateMotionValue(l){const{motionValue:s,onUpdate:o,onComplete:f,element:d,...u}=this.options;if(!s)return;if(l!==void 0){s.set(l);return}const m=new wr({...u,autoplay:!1}),v=Math.max(hc,de.now()-this.startTime),p=ln(0,hc,v-hc),g=m.sample(v).value,{name:x}=this.options;d&&x&&Lv(d,x,g),s.setWithVelocity(m.sample(Math.max(0,v-p)).value,g,p),m.stop()}}const $0=(i,l)=>l==="zIndex"?!1:!!(typeof i=="number"||Array.isArray(i)||typeof i=="string"&&(Be.test(i)||i==="0")&&!i.startsWith("url("));function Qx(i){const l=i[0];if(i.length===1)return!0;for(let s=0;sObject.hasOwnProperty.call(Element.prototype,"animate"));function Wx(i){const{motionValue:l,name:s,repeatDelay:o,repeatType:f,damping:d,type:u,keyframes:m}=i;if(!s||!(Hc.has(s)||I0.has(s)))return!1;const v=l?.owner?.current;if(!(v instanceof HTMLElement)&&!(v instanceof SVGElement))return!1;const{onUpdate:p,transformTemplate:g}=l.owner.getProps();return Jx()&&(Hc.has(s)||I0.has(s)&&Px(m))&&(s!=="transform"||!g)&&!p&&!o&&f!=="mirror"&&d!==0&&u!=="inertia"}const $x=40;class Ix extends hf{constructor(l){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=de.now();const{keyframes:s,name:o,motionValue:f,element:d}=l,u=l;u.autoplay??(u.autoplay=!0),u.delay??(u.delay=0),u.type??(u.type="keyframes"),u.repeat??(u.repeat=0),u.repeatDelay??(u.repeatDelay=0),u.repeatType??(u.repeatType="loop");const m=d?.KeyframeResolver||pf;this.keyframeResolver=new m(s,(v,p,g)=>this.onKeyframesResolved(v,p,u,!g),o,f,d),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(l,s,o,f){this.keyframeResolver=void 0;const{name:d,type:u,velocity:m,delay:v,isHandoff:p,onUpdate:g}=o;this.resolvedAt=de.now();let x=!0;Kx(l,d,u,m)||(x=!1,(jn.instantAnimations||!v)&&g?.(Ur(l,o,s)),l[0]=l[l.length-1],Bc(o),o.repeat=0);const S=f?this.resolvedAt?this.resolvedAt-this.createdAt>$x?this.resolvedAt:this.createdAt:this.createdAt:void 0,{onComplete:b}=o;o.startTime??(o.startTime=S),o.finalKeyframe=s,o.keyframes=l,o.onComplete=()=>{b?.(),this.notifyFinished()};const w=x&&!p&&Wx(o);let D;if(w){o.element=o.motionValue?.owner?.current;try{D=new kx(o)}catch{D=new wr(o)}}else D=new wr(o);this.pendingTimeline&&(this.stopTimeline=D.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=D}get finished(){return this._animation?this._animation.finished:super.finished}then(l,s){return this.finished.finally(l).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),jx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(l){this.animation.time=l}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(l){this.animation.speed=l}get startTime(){return this.animation.startTime}attachTimeline(l){return this._animation?this.stopTimeline=this.animation.attachTimeline(l):this.pendingTimeline=l,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Yv(i,l,s,o=0,f=1){const d=Array.from(i).sort((p,g)=>p.sortNodePosition(g)).indexOf(l),u=i.size,m=(u-1)*o;return typeof s=="function"?s(d,u):f===1?d*o:m-d*o}const tp=30,tb=i=>!isNaN(parseFloat(i));class eb{constructor(l,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=o=>{const f=de.now();if(this.updatedAt!==f&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(o),this.current!==this.prev&&(this.notifyChange(),this.dependents))for(const d of this.dependents)d.dirty()},this.hasAnimated=!1,this.setCurrent(l),this.owner=s.owner}setCurrent(l){this.current=l,this.updatedAt=de.now(),this.canTrackVelocity===null&&l!==void 0&&(this.canTrackVelocity=tb(this.current))}setPrevFrameValue(l=this.current){this.prevFrameValue=l,this.prevUpdatedAt=this.updatedAt}onChange(l){return this.on("change",l)}on(l,s){var o;return l==="change"?this.onChangeSubscribe(s):((o=this.events)[l]||(o[l]=new Tr)).add(s)}onChangeSubscribe(l){const{events:s}=this;return!s.change&&!this.changeSubscriber?this.changeSubscriber=l:(s.change||(s.change=new Tr,s.change.add(this.changeSubscriber),this.changeSubscriber=void 0),s.change.add(l)),()=>{this.changeSubscriber===l?this.changeSubscriber=void 0:s.change?.remove(l),this.stopIfUnobserved()}}stopIfUnobserved(){Vt.read(()=>{!this.changeSubscriber&&!this.events.change?.getSize()&&this.stop()})}clearListeners(){this.changeSubscriber=void 0;for(const l in this.events)this.events[l].clear()}attach(l,s){this.passiveEffect=l,this.stopPassiveEffect=s}set(l){this.passiveEffect?this.passiveEffect(l,this.updateAndNotify):this.updateAndNotify(l)}setWithVelocity(l,s,o){this.set(s),this.prev=void 0,this.prevFrameValue=l,this.prevUpdatedAt=this.updatedAt-o}jump(l,s=!0){this.updateAndNotify(l),this.prev=l,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.notifyChange()}notifyChange(){const{current:l,changeSubscriber:s}=this;s?s(l):this.events.change?.notify(l)}addDependent(l){this.dependents||(this.dependents=new Set),this.dependents.add(l)}removeDependent(l){this.dependents&&this.dependents.delete(l)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const l=de.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||l-this.updatedAt>tp)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,tp);return rv(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(l){return this.stop(),new Promise(s=>{this.hasAnimated=!0;let o=!1,f;f=l(()=>{o=!0,this.events.animationComplete?.notify(),this.animation===f&&this.clearAnimation(),s()}),o||(this.animation=f),this.events.animationStart?.notify()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){this.animation=void 0}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ra(i,l){return new eb(i,l)}function vf(i,l){if(i?.inherit&&l){const{inherit:s,...o}=i;return{...l,...o}}return i}function gf(i,l){const s=i?.[l]??i?.default??i;return s!==i?vf(s,i):s}const nb={type:"spring",stiffness:500,damping:25,restSpeed:10},ib=i=>({type:"spring",stiffness:550,damping:i===0?2*Math.sqrt(550):30,restSpeed:10}),ab={type:"keyframes",duration:.8},lb={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sb=(i,{keyframes:l})=>l.length>2?ab:za.has(i)?i.startsWith("scale")?ib(l[1]):nb:lb,rb=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function ob(i){for(const l in i)if(!rb.has(l))return!0;return!1}const yf=(i,l,s,o={},f,d)=>u=>{const m=gf(o,i)||{},v=m.delay||o.delay||0;let{elapsed:p=0}=o;p=p-Je(v);const g={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:l.getVelocity(),...m,delay:-p,onUpdate:S=>{l.set(S),m.onUpdate&&m.onUpdate(S)},onComplete:()=>{u(),m.onComplete&&m.onComplete()},name:i,motionValue:l,element:d?void 0:f};ob(m)||Object.assign(g,sb(i,g)),g.duration&&(g.duration=Je(g.duration)),g.repeatDelay&&(g.repeatDelay=Je(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let x=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(Bc(g),g.delay===0&&(x=!0)),(jn.instantAnimations||jn.skipAnimations||f?.shouldSkipAnimations||m.skipAnimations)&&(x=!0,Bc(g),g.delay=0),g.allowFlatten=!m.type&&!m.ease,x&&!d&&l.get()!==void 0){const S=Ur(g.keyframes,m);if(S!==void 0){Vt.update(()=>{g.onUpdate(S),g.onComplete()});return}}return m.isSync?new wr(g):new Ix(g)},ub=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cb(i){const l=ub.exec(i);if(!l)return[,];const[,s,o,f]=l;return[`--${s??o}`,f]}function Fv(i,l,s=1){const[o,f]=cb(i);if(!o)return;const d=window.getComputedStyle(l).getPropertyValue(o);if(d){const u=d.trim();return tf(u)?parseFloat(u):u}return sf(f)?Fv(f,l,s+1):f}function ep(i){const l=[{},{}];return i?.values.forEach((s,o)=>{l[0][o]=s.get(),l[1][o]=s.getVelocity()}),l}function xf(i,l,s,o){if(typeof l=="function"){const[f,d]=ep(o);l=l(s!==void 0?s:i.custom,f,d)}if(typeof l=="string"&&(l=i.variants&&i.variants[l]),typeof l=="function"){const[f,d]=ep(o);l=l(s!==void 0?s:i.custom,f,d)}return l}function Vi(i,l,s){const o=i.getProps();return xf(o,l,s!==void 0?s:o.custom,i)}const Gv=new Set(["width","height","top","left","right","bottom",...Ca]),qc=i=>Array.isArray(i);function fb(i,l,s){i.hasValue(l)?i.getValue(l).set(s):i.addValue(l,Ra(s))}function db(i){return qc(i)?i[i.length-1]||0:i}function hb(i,l){const s=Vi(i,l);let{transitionEnd:o={},transition:f={},...d}=s||{};d={...d,...o};for(const u in d){const m=db(d[u]);fb(i,u,m)}}const he=i=>!!(i&&i.getVelocity);function mb(i){return!!(he(i)&&i.add)}function Yc(i,l){const s=i.getValue("willChange");if(mb(s))return s.add(l);if(!s&&jn.WillChange){const o=new jn.WillChange("auto");i.addValue("willChange",o),o.add(l)}}function bf(i){return i.replace(/([A-Z])/g,l=>`-${l.toLowerCase()}`)}const pb="framerAppearId",Xv="data-"+bf(pb);function kv(i){return i.props[Xv]}const vb=typeof window<"u";function gb({protectedKeys:i,needsAnimating:l},s){const o=i.hasOwnProperty(s)&&l[s]!==!0;return l[s]=!1,o}function Qv(i,l,{delay:s=0,transitionOverride:o,type:f}={}){let{transition:d,transitionEnd:u,...m}=l;const v=i.getDefaultTransition();d=d?vf(d,v):v;const p=d?.reduceMotion,g=d?.skipAnimations;o&&(d=o);const x=[],S=f&&i.animationState&&i.animationState.getState()[f],b=d?.path;b&&b.animateVisualElement(i,m,d,s,x);for(const w in m){const D=i.getValue(w,i.latestValues[w]??null),_=m[w];if(_===void 0||S&&gb(S,w))continue;const G={delay:s,...gf(d||{},w)};g&&(G.skipAnimations=!0);const F=D.get();if(F!==void 0&&!D.isAnimating()&&!Array.isArray(_)&&_===F&&!G.velocity){Vt.update(()=>D.set(_));continue}let B=!1;if(vb&&window.MotionHandoffAnimation){const I=kv(i);if(I){const O=window.MotionHandoffAnimation(I,w,Vt);O!==null&&(G.startTime=O,B=!0)}}Yc(i,w);const H=p??i.shouldReduceMotion;D.start(yf(w,D,_,H&&Gv.has(w)?{type:!1}:G,i,B));const Q=D.animation;Q&&x.push(Q)}if(u){const w=()=>Vt.update(()=>{u&&hb(i,u)});x.length?Promise.all(x).then(w):w()}return x}function Fc(i,l,s={}){const o=Vi(i,l,s.type==="exit"?i.presenceContext?.custom:void 0);let{transition:f=i.getDefaultTransition()||{}}=o||{};s.transitionOverride&&(f=s.transitionOverride);const d=o?()=>Promise.all(Qv(i,o,s)):()=>Promise.resolve(),u=i.variantChildren&&i.variantChildren.size?(v=0)=>{const{delayChildren:p=0,staggerChildren:g,staggerDirection:x}=f;return yb(i,l,v,p,g,x,s)}:()=>Promise.resolve(),{when:m}=f;if(m){const[v,p]=m==="beforeChildren"?[d,u]:[u,d];return v().then(()=>p())}else return Promise.all([d(),u(s.delay)])}function yb(i,l,s=0,o=0,f=0,d=1,u){const m=[];for(const v of i.variantChildren)v.notify("AnimationStart",l),m.push(Fc(v,l,{...u,delay:s+(typeof o=="function"?0:o)+Yv(i.variantChildren,v,o,f,d)}).then(()=>v.notify("AnimationComplete",l)));return Promise.all(m)}function xb(i,l,s={}){i.notify("AnimationStart",l);let o;if(Array.isArray(l)){const f=l.map(d=>Fc(i,d,s));o=Promise.all(f)}else if(typeof l=="string")o=Fc(i,l,s);else{const f=typeof l=="function"?Vi(i,l,s.custom):l;o=Promise.all(Qv(i,f,s))}return o.then(()=>{i.notify("AnimationComplete",l)})}const bb={test:i=>i==="auto",parse:i=>i},Sb=i=>l=>l.test(i),Tb=[Da,lt,mn,Un,O2,N2,bb],np=i=>Tb.find(Sb(i));function Eb(i){return typeof i=="number"?i===0:i!==null?i==="none"||i==="0"||ef(i):!0}const Ab=new Set(["auto","none","0"]);function wb(i,l,s){let o=0,f;for(;ol.measureViewportBox())}measureInitialState(){const{element:l,unresolvedKeyframes:s,name:o}=this;if(!l||!l.current)return;o==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=this.measure(),s[0]=this.measuredOrigin;const f=s[s.length-1];f!==void 0&&this.motionValue?.jump(f,!1)}measureEndState(){const{element:l,unresolvedKeyframes:s}=this;if(!l||!l.current)return;this.motionValue?.jump(this.measuredOrigin,!1);const o=s.length-1,f=s[o];s[o]=this.measure(),f!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=f),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,u])=>{l.getValue(d).set(u)}),this.resolveNoneKeyframes()}}const Sf=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function hr(i){return lv(i)&&"offsetHeight"in i&&!("ownerSVGElement"in i)}function Tf(i){return lv(i)&&"ownerSVGElement"in i}const Gc=(i,l)=>l&&typeof i=="number"?l.transform(i):i;function Kv(i,l,s){if(i==null)return[];if(i instanceof EventTarget)return[i];if(typeof i=="string"){let o=document;const f=s?.[i]??o.querySelectorAll(i);return f?Array.from(f):[]}return Array.from(i).filter(o=>o!=null)}const _b={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Rb=Ca.length;function Db(i,l,s){let o="",f=!0;for(let u=0;ulp&&(l.x=1),l.ylp&&(l.y=1)}function hn(i,l){i.min+=l,i.max+=l}function rp(i,l,s,o,f=.5){const d=Ut(i.min,i.max,f);kc(i,l,s,d,o)}function op(i,l){return typeof i=="string"?parseFloat(i)/100*(l.max-l.min):i}function mr(i,l,s){const o=s??i;rp(i.x,op(l.x,o.x),l.scaleX,l.scale,l.originX),rp(i.y,op(l.y,o.y),l.scaleY,l.scale,l.originY)}function Iv(i,l){return Jv(Lb(i.getBoundingClientRect(),l))}function jb(i,l,s){const o=Iv(i,s),{scroll:f}=l;return f&&(hn(o.x,f.offset.x),hn(o.y,f.offset.y)),o}const{schedule:Af}=gv(queueMicrotask,!1),nn={x:!1,y:!1};function tg(){return nn.x||nn.y}function Vb(i){return i==="x"||i==="y"?nn[i]?null:(nn[i]=!0,()=>{nn[i]=!1}):nn.x||nn.y?null:(nn.x=nn.y=!0,()=>{nn.x=nn.y=!1})}function eg(i,l){const s=Kv(i),o=new AbortController,f={passive:!0,...l,signal:o.signal};return[s,f,()=>o.abort()]}function Bb(i){return!(i.pointerType==="touch"||tg())}function Hb(i,l,s={}){const[o,f,d]=eg(i,s);return o.forEach(u=>{let m=!1,v=!1,p;const g=()=>{u.removeEventListener("pointerleave",w)},x=_=>{p&&(p(_),p=void 0),g()},S=_=>{m=!1,window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S),v&&(v=!1,x(_))},b=()=>{m=!0,window.addEventListener("pointerup",S,f),window.addEventListener("pointercancel",S,f)},w=_=>{if(_.pointerType!=="touch"){if(m){v=!0;return}x(_)}},D=_=>{if(!Bb(_))return;v=!1;const G=l(u,_);typeof G=="function"&&(p=G,u.addEventListener("pointerleave",w,f))};u.addEventListener("pointerenter",D,f),u.addEventListener("pointerdown",b,f)}),d}const ng=(i,l)=>l?i===l?!0:ng(i,l.parentElement):!1,wf=i=>i.pointerType==="mouse"?typeof i.button!="number"||i.button<=0:i.isPrimary!==!1,qb=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Yb(i){return qb.has(i.tagName)||i.isContentEditable===!0}const Fb=new Set(["INPUT","SELECT","TEXTAREA"]);function Gb(i){return Fb.has(i.tagName)||i.isContentEditable===!0}const pr=new WeakSet;function up(i){return l=>{l.key==="Enter"&&i(l)}}function pc(i,l){i.dispatchEvent(new PointerEvent("pointer"+l,{isPrimary:!0,bubbles:!0}))}const Xb=(i,l)=>{const s=i.currentTarget;if(!s)return;const o=up(()=>{if(pr.has(s))return;pc(s,"down");const f=up(()=>{pc(s,"up")}),d=()=>pc(s,"cancel");s.addEventListener("keyup",f,l),s.addEventListener("blur",d,l)});s.addEventListener("keydown",o,l),s.addEventListener("blur",()=>s.removeEventListener("keydown",o),l)};function cp(i){return wf(i)&&!tg()}const fp=new WeakSet;function kb(i,l,s={}){const[o,f,d]=eg(i,s),u=m=>{const v=m.currentTarget;if(!cp(m)||fp.has(m))return;pr.add(v),s.stopPropagation&&fp.add(m);const p=l(v,m),g={...f,capture:!0},x=(w,D)=>{window.removeEventListener("pointerup",S,g),window.removeEventListener("pointercancel",b,g),pr.has(v)&&pr.delete(v),cp(w)&&typeof p=="function"&&p(w,{success:D})},S=w=>{x(w,v===window||v===document||s.useGlobalTarget||ng(v,w.target))},b=w=>{x(w,!1)};window.addEventListener("pointerup",S,g),window.addEventListener("pointercancel",b,g)};return o.forEach(m=>{(s.useGlobalTarget?window:m).addEventListener("pointerdown",u,f),hr(m)&&(m.addEventListener("focus",p=>Xb(p,f)),!Yb(m)&&!m.hasAttribute("tabindex")&&(m.tabIndex=0))}),d}const vr=new WeakMap;let gr;const ig=(i,l,s)=>(o,f)=>f&&f[0]?f[0][i+"Size"]:Tf(o)&&"getBBox"in o?o.getBBox()[l]:o[s],Qb=ig("inline","width","offsetWidth"),Kb=ig("block","height","offsetHeight");function Zb({target:i,borderBoxSize:l}){vr.get(i)?.forEach(s=>{s(i,{get width(){return Qb(i,l)},get height(){return Kb(i,l)}})})}function Pb(i){i.forEach(Zb)}function Jb(){typeof ResizeObserver>"u"||(gr=new ResizeObserver(Pb))}function Wb(i,l){gr||Jb();const s=Kv(i);return s.forEach(o=>{let f=vr.get(o);f||(f=new Set,vr.set(o,f)),f.add(l),gr?.observe(o)}),()=>{s.forEach(o=>{const f=vr.get(o);f?.delete(l),f?.size||gr?.unobserve(o)})}}const yr=new Set;let Aa;function $b(){Aa=()=>{const i={get width(){return window.innerWidth},get height(){return window.innerHeight}};yr.forEach(l=>l(i))},window.addEventListener("resize",Aa)}function Ib(i){return yr.add(i),Aa||$b(),()=>{yr.delete(i),!yr.size&&typeof Aa=="function"&&(window.removeEventListener("resize",Aa),Aa=void 0)}}function dp(i,l){return typeof i=="function"?Ib(i):Wb(i,l)}function tS(i){return Tf(i)&&i.tagName==="svg"}const hp=()=>({translate:0,scale:1,origin:0,originPoint:0}),wa=()=>({x:hp(),y:hp()}),mp=()=>({min:0,max:0}),ne=()=>({x:mp(),y:mp()}),eS=new WeakMap;function jr(i){return i!==null&&typeof i=="object"&&typeof i.start=="function"}function Ul(i){return typeof i=="string"||Array.isArray(i)}const Mf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rr=["initial",...Mf];function Vr(i){if(jr(i.animate))return!0;for(let l=0;lQc.current=i.matches;i.addEventListener("change",l),l()}else Qc.current=!1}const pp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Dr={};function sg(i){Dr=i}function lS(){return Dr}class sS{scrapeMotionValuesFromProps(l,s,o){return{}}constructor({parent:l,props:s,presenceContext:o,reducedMotionConfig:f,skipAnimations:d,blockInitialAnimation:u,visualState:m},v={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=pf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const b=de.now();this.renderScheduledAtthis.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(lg.current||aS(),this.shouldReduceMotion=Qc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),fi(this.notifyUpdate),fi(this.render),this.valueSubscriptions.forEach(l=>l()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const l in this.events)this.events[l].clear();for(const l in this.features){const s=this.features[l];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(l){this.children.add(l),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(l)}removeChild(l){this.children.delete(l),this.enteringChildren&&this.enteringChildren.delete(l)}bindToMotionValue(l,s){if(this.valueSubscriptions.has(l)&&this.valueSubscriptions.get(l)(),s.accelerate&&Hc.has(l)&&this.current instanceof HTMLElement){const{factory:u,keyframes:m,times:v,ease:p,duration:g}=s.accelerate,x=new Hv({element:this.current,name:l,keyframes:m,times:v,ease:p,duration:Je(g)}),S=u(x);this.valueSubscriptions.set(l,()=>{S(),x.cancel()});return}const o=za.has(l);o&&this.onBindTransform&&this.onBindTransform();const f=s.on("change",u=>{this.latestValues[l]=u,this.props.onUpdate&&Vt.preRender(this.notifyUpdate),o&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let d;typeof window<"u"&&window.MotionCheckAppearSync&&(d=window.MotionCheckAppearSync(this,l,s)),this.valueSubscriptions.set(l,()=>{f(),d&&d()})}sortNodePosition(l){return!this.current||!this.sortInstanceNodePosition||this.type!==l.type?0:this.sortInstanceNodePosition(this.current,l.current)}updateFeatures(){let l="animation";for(l in Dr){const s=Dr[l];if(!s)continue;const{isEnabled:o,Feature:f}=s;if(!this.features[l]&&f&&o(this.props)&&(this.features[l]=new f(this)),this.features[l]){const d=this.features[l];d.isMounted?d.update():(d.mount(),d.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ne()}getStaticValue(l){return this.latestValues[l]}setStaticValue(l,s){this.latestValues[l]=s}update(l,s){(l.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=l,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let o=0;os.variantChildren.delete(l)}addValue(l,s){const o=this.values.get(l);s!==o&&(o&&this.removeValue(l),this.bindToMotionValue(l,s),this.values.set(l,s),this.latestValues[l]=s.get())}removeValue(l){this.values.delete(l);const s=this.valueSubscriptions.get(l);s&&(s(),this.valueSubscriptions.delete(l)),delete this.latestValues[l],this.removeValueFromRenderState(l,this.renderState)}hasValue(l){return this.values.has(l)}getValue(l,s){if(this.props.values&&this.props.values[l])return this.props.values[l];let o=this.values.get(l);return o===void 0&&s!==void 0&&(o=Ra(s===null?void 0:s,{owner:this}),this.addValue(l,o)),o}readValue(l,s){let o=this.latestValues[l]!==void 0||!this.current?this.latestValues[l]:this.getBaseTargetFromProps(this.props,l)??this.readValueFromInstance(this.current,l,this.options);return o!=null&&(typeof o=="string"&&(tf(o)||ef(o))?o=parseFloat(o):typeof o!="number"&&!Be.test(o)&&Be.test(s)&&(o=mf(l,s)),this.setBaseTarget(l,he(o)?o.get():o)),he(o)?o.get():o}setBaseTarget(l,s){this.baseTarget[l]=s}getBaseTarget(l){const{initial:s}=this.props;let o;if(typeof s=="string"||typeof s=="object"){const d=xf(this.props,s,this.presenceContext?.custom);d&&(o=d[l])}if(s&&o!==void 0)return o;const f=this.getBaseTargetFromProps(this.props,l);return f!==void 0&&!he(f)?f:this.initialValues[l]!==void 0&&o===void 0?void 0:this.baseTarget[l]}on(l,s){return this.events[l]||(this.events[l]=new Tr),this.events[l].add(s)}notify(l,...s){this.events[l]&&this.events[l].notify(...s)}scheduleRenderMicrotask(){Af.render(this.render)}}class rg extends sS{constructor(){super(...arguments),this.KeyframeResolver=Mb}sortInstanceNodePosition(l,s){return l.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(l,s){const o=l.style;return o?o[s]:void 0}removeValueFromRenderState(l,{vars:s,style:o}){delete s[l],delete o[l]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:l}=this.props;he(l)&&(this.childSubscription=l.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class di{constructor(l){this.isMounted=!1,this.node=l}update(){}}function og(i,{style:l,vars:s},o,f){const d=i.style;let u;for(u in l)d[u]=l[u];f?.applyProjectionStyles(d,o);for(u in s)d.setProperty(u,s[u])}function vp(i,l){return l.max===l.min?0:i/(l.max-l.min)*100}const Ml={correct:(i,l)=>{if(!l.target)return i;if(typeof i=="string")if(lt.test(i))i=parseFloat(i);else return i;const s=vp(i,l.target.x),o=vp(i,l.target.y);return`${s}% ${o}%`}},rS={correct:(i,{treeScale:l,projectionDelta:s})=>{const o=i,f=Be.parse(i);if(f.length>5)return o;const d=Be.createTransformer(i),u=typeof f[0]!="number"?1:0,m=s.x.scale*l.x,v=s.y.scale*l.y;f[0+u]/=m,f[1+u]/=v;const p=Ut(m,v,.5);return typeof f[2+u]=="number"&&(f[2+u]/=p),typeof f[3+u]=="number"&&(f[3+u]/=p),d(f)}},Kc={borderRadius:{...Ml,applyTo:[...Sf]},borderTopLeftRadius:Ml,borderTopRightRadius:Ml,borderBottomLeftRadius:Ml,borderBottomRightRadius:Ml,boxShadow:rS};function ug(i,{layout:l,layoutId:s}){return za.has(i)||i.startsWith("origin")||(l||s!==void 0)&&(!!Kc[i]||i==="opacity")}function _f(i,l,s){const o=i.style,f=l?.style,d={};if(!o)return d;for(const u in o)(he(o[u])||f&&he(f[u])||ug(u,i)||s?.getValue(u)?.liveStyle!==void 0)&&(d[u]=o[u]);return d}function oS(i){return window.getComputedStyle(i)}class uS extends rg{constructor(){super(...arguments),this.type="html",this.renderInstance=og}mount(l){Lr(!!l.style),super.mount(l)}readValueFromInstance(l,s){if(za.has(s))return this.projection?.isProjecting?Oc(s):Cx(l,s);{const o=oS(l),f=(xv(s)?o.getPropertyValue(s):o[s])||0;return typeof f=="string"?f.trim():f}}measureInstanceViewportBox(l,{transformPagePoint:s}){return Iv(l,s)}build(l,s,o){Ef(l,s,o.transformTemplate)}scrapeMotionValuesFromProps(l,s,o){return _f(l,s,o)}}const cg=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),fg=i=>typeof i=="string"&&i.toLowerCase()==="svg";function cS(i,l,s,o){og(i,l,void 0,o);for(const f in l.attrs)i.setAttribute(cg.has(f)?f:bf(f),l.attrs[f])}function dg(i,l,s){const o=_f(i,l,s);for(const f in i)if(he(i[f])||he(l[f])){const d=Ca.indexOf(f)!==-1?"attr"+f.charAt(0).toUpperCase()+f.substring(1):f;o[d]=i[f]}return o}class fS extends rg{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ne}getBaseTargetFromProps(l,s){return l[s]}readValueFromInstance(l,s){if(za.has(s)){const o=zv(s);return o&&o.default||0}if(Zv.includes(s)){const f=getComputedStyle(l)[s];if(typeof f=="string"&&f)return f.trim()}return s=cg.has(s)?s:bf(s),l.getAttribute(s)}scrapeMotionValuesFromProps(l,s,o){return dg(l,s,o)}build(l,s,o){Pv(l,s,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(l,s,o,f){cS(l,s,o,f)}mount(l){this.isSVGTag=fg(l.tagName),super.mount(l)}}const dS=Rr.length;function hg(i){if(!i)return;if(!i.isControllingVariants){const s=i.parent?hg(i.parent)||{}:{};return i.props.initial!==void 0&&(s.initial=i.props.initial),s}const l={};for(let s=0;sPromise.all(l.map(({animation:s,options:o})=>xb(i,s,o)))}function vS(i){let l=pS(i),s=gp(),o=!0,f=!1;const d=p=>(g,x)=>{const S=Vi(i,x,p==="exit"?i.presenceContext?.custom:void 0);if(S){const{transition:b,transitionEnd:w,...D}=S;g={...g,...D,...w}}return g};function u(p){l=p(i)}function m(p){const{props:g}=i,x=hg(i.parent)||{},S=[],b=new Set;let w={},D=1/0;for(let G=0;GD&&Q,tt=!1;const it=Array.isArray(H)?H:[H];let dt=it.reduce(d(F),{});I===!1&&(dt={});const{prevResolvedValues:st={}}=B,ct={...st,...dt},ut=J=>{W=!0,b.has(J)&&(tt=!0,b.delete(J)),B.needsAnimating[J]=!0;const rt=i.getValue(J);rt&&(rt.liveStyle=!1)};for(const J in ct){const rt=dt[J],ht=st[J];if(w.hasOwnProperty(J))continue;let E=!1;qc(rt)&&qc(ht)?E=!mg(rt,ht)||U:E=rt!==ht,E?rt!=null?ut(J):b.add(J):rt!==void 0&&b.has(J)?ut(J):B.protectedKeys[J]=!0}B.prevProp=H,B.prevResolvedValues=dt,B.isActive&&(w={...w,...dt}),(o||f)&&i.blockInitialAnimation&&(W=!1);const C=O&&U;W&&(!C||tt)&&S.push(...it.map(J=>{const rt={type:F};if(typeof J=="string"&&(o||f)&&!C&&i.manuallyAnimateOnMount&&i.parent){const{parent:ht}=i,E=Vi(ht,J);if(ht.enteringChildren&&E){const{delayChildren:j}=E.transition||{};rt.delay=Yv(ht.enteringChildren,i,j)}}return{animation:J,options:rt}}))}if(b.size){const G={};if(typeof g.initial!="boolean"){const F=Vi(i,Array.isArray(g.initial)?g.initial[0]:g.initial);F&&F.transition&&(G.transition=F.transition)}b.forEach(F=>{const B=i.getBaseTarget(F),H=i.getValue(F);H&&(H.liveStyle=!0),G[F]=B??null}),S.push({animation:G})}let _=!!S.length;return o&&(g.initial===!1||g.initial===g.animate)&&!i.manuallyAnimateOnMount&&(_=!1),o=!1,f=!1,_?l(S):Promise.resolve()}function v(p,g){if(s[p].isActive===g)return Promise.resolve();i.variantChildren?.forEach(S=>S.animationState?.setActive(p,g)),s[p].isActive=g;const x=m(p);for(const S in s)s[S].protectedKeys={};return x}return{animateChanges:m,setActive:v,setAnimateFunction:u,getState:()=>s,reset:()=>{s=gp(),f=!0}}}function gS(i,l){return typeof l=="string"?l!==i:Array.isArray(l)?!mg(l,i):!1}function zi(i=!1){return{isActive:i,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gp(){return{animate:zi(!0),whileInView:zi(),whileHover:zi(),whileTap:zi(),whileDrag:zi(),whileFocus:zi(),exit:zi()}}function Zc(i,l){i.min=l.min,i.max=l.max}function en(i,l){Zc(i.x,l.x),Zc(i.y,l.y)}function yp(i,l){i.translate=l.translate,i.scale=l.scale,i.originPoint=l.originPoint,i.origin=l.origin}const pg=1e-4,yS=1-pg,xS=1+pg,vg=.01,bS=0-vg,SS=0+vg;function ye(i){return i.max-i.min}function TS(i,l,s){return Math.abs(i-l)<=s}function xp(i,l,s,o=.5){i.origin=o,i.originPoint=Ut(l.min,l.max,i.origin),i.scale=ye(s)/ye(l),i.translate=Ut(s.min,s.max,i.origin)-i.originPoint,(i.scale>=yS&&i.scale<=xS||isNaN(i.scale))&&(i.scale=1),(i.translate>=bS&&i.translate<=SS||isNaN(i.translate))&&(i.translate=0)}function Dl(i,l,s,o){xp(i.x,l.x,s.x,o?o.originX:void 0),xp(i.y,l.y,s.y,o?o.originY:void 0)}function bp(i,l,s,o=0){const f=o?Ut(s.min,s.max,o):s.min;i.min=f+l.min,i.max=i.min+ye(l)}function ES(i,l,s,o){bp(i.x,l.x,s.x,o?.x),bp(i.y,l.y,s.y,o?.y)}function Sp(i,l,s,o=0){const f=o?Ut(s.min,s.max,o):s.min;i.min=l.min-f,i.max=i.min+ye(l)}function Cr(i,l,s,o){Sp(i.x,l.x,s.x,o?.x),Sp(i.y,l.y,s.y,o?.y)}function Tp(i,l,s,o,f){return i-=l,i=_r(i,1/s,o),f!==void 0&&(i=_r(i,1/f,o)),i}function AS(i,l=0,s=1,o=.5,f,d=i,u=i){if(mn.test(l)&&(l=parseFloat(l),l=Ut(u.min,u.max,l/100)-u.min),typeof l!="number" )return;let m=Ut(d.min,d.max,o);i===d&&(m-=l),i.min=Tp(i.min,l,s,m,f),i.max=Tp(i.max,l,s,m,f)}function Ep(i,l,[s,o,f],d,u){AS(i,l[s],l[o],l[f],l.scale,d,u)}const wS=["x","scaleX","originX"],MS=["y","scaleY","originY"];function Ap(i,l,s,o){Ep(i.x,l,wS,s?s.x:void 0,o?o.x:void 0),Ep(i.y,l,MS,s?s.y:void 0,o?o.y:void 0)}function wp(i){return i.translate===0&&i.scale===1}function gg(i){return wp(i.x)&&wp(i.y)}function Mp(i,l){return i.min===l.min&&i.max===l.max}function _S(i,l){return Mp(i.x,l.x)&&Mp(i.y,l.y)}function _p(i,l){return Math.round(i.min)===Math.round(l.min)&&Math.round(i.max)===Math.round(l.max)}function yg(i,l){return _p(i.x,l.x)&&_p(i.y,l.y)}function Rp(i){return ye(i.x)/ye(i.y)}function Dp(i,l){return i.translate===l.translate&&i.scale===l.scale&&i.originPoint===l.originPoint}function dn(i){return[i("x"),i("y")]}function RS(i,l,s){let o="" ;const f=i.x.translate/l.x,d=i.y.translate/l.y,u=s?.z||0;if((f||d||u)&&(o=`translate3d(${f}px, ${d}px, ${u}px) `),(l.x!==1||l.y!==1)&&(o+=`scale(${1/l.x}, ${1/l.y}) `),s){const{transformPerspective:p,rotate:g,pathRotation:x,rotateX:S,rotateY:b,skewX:w,skewY:D}=s;p&&(o=`perspective(${p}px) ${o}`),g&&(o+=`rotate(${g}deg) `),x&&(o+=`rotate(${x}deg) `),S&&(o+=`rotateX(${S}deg) `),b&&(o+=`rotateY(${b}deg) `),w&&(o+=`skewX(${w}deg) `),D&&(o+=`skewY(${D}deg) `)}const m=i.x.scale*l.x,v=i.y.scale*l.y;return(m!==1||v!==1)&&(o+=`scale(${m}, ${v})`),o||"none"}const DS=Sf.length,Cp=i=>typeof i=="string"?parseFloat(i):i,zp=i=>typeof i=="number"||lt.test(i);function CS(i,l,s,o,f,d){f?(i.opacity=Ut(0,s.opacity??1,zS(o)),i.opacityExit=Ut(l.opacity??1,0,NS(o))):d&&(i.opacity=Ut(l.opacity??1,s.opacity??1,o));for(let u=0;uol?1:s(Nl(i,l,o))}function OS(i,l,s){const o=he(i)?i:Ra(i);return o.start(yf("",o,l,s)),o.animation}function jl(i,l,s,o={passive:!0}){return i.addEventListener(l,s,o),()=>i.removeEventListener(l,s,o)}const LS=(i,l)=>i.depth-l.depth;class US{constructor(){this.children=[],this.isDirty=!1}add(l){Ic(this.children,l),this.isDirty=!0}remove(l){Sr(this.children,l),this.isDirty=!0}forEach(l){this.isDirty&&this.children.sort(LS),this.isDirty=!1,this.children.forEach(l)}}function jS(i,l){const s=de.now(),o=({timestamp:f})=>{const d=f-s;d>=l&&(fi(o),i(d-l))};return Vt.setup(o,!0),()=>fi(o)}function xr(i){return he(i)?i.get():i}class VS{constructor(){this.members=[]}add(l){Ic(this.members,l);for(let s=this.members.length-1;s>=0;s--){const o=this.members[s];if(o===l||o===this.lead||o===this.prevLead)continue;const f=o.instance;(!f||f.isConnected===!1)&&!o.snapshot&&(Sr(this.members,o),o.unmount())}l.scheduleRender()}remove(l){if(Sr(this.members,l),l===this.prevLead&&(this.prevLead=void 0),l===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(l){for(let s=this.members.indexOf(l)-1;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1&&o.instance?.isConnected!==!1)return this.promote(o),!0}return!1}promote(l,s){const o=this.lead;if(l!==o&&(this.prevLead=o,this.lead=l,l.show(),o)){o.updateSnapshot(),l.scheduleRender();const{layoutDependency:f}=o.options,{layoutDependency:d}=l.options;(f===void 0||f!==d)&&(l.resumeFrom=o,s&&(o.preserveOpacity=!0),o.snapshot&&(l.snapshot=o.snapshot,l.snapshot.latestValues=o.animationValues||o.latestValues),l.root?.isUpdating&&(l.isLayoutDirty=!0)),l.options.crossfade===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(l=>{l.options.onExitComplete?.(),l.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(l=>l.instance&&l.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const br={hasAnimatedSinceResize:!0,hasEverUpdated:!1},vc=["","X","Y","Z"],BS=1e3;let HS=0;function gc(i,l,s,o){const{latestValues:f}=l;f[i]&&(s[i]=f[i],l.setStaticValue(i,0),o&&(o[i]=0))}function bg(i){if(i.hasCheckedOptimisedAppear=!0,i.root===i)return;const{visualElement:l}=i.options;if(!l)return;const s=kv(l);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:f,layoutId:d}=i.options;window.MotionCancelOptimisedAnimation(s,"transform",Vt,!(f||d))}const{parent:o}=i;o&&!o.hasCheckedOptimisedAppear&&bg(o)}function Sg({attachResizeListener:i,defaultParent:l,measureScroll:s,checkIsScrollRoot:o,resetTransform:f}){return class{constructor(u={},m=l?.()){this.id=HS++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(FS),this.nodes.forEach(ZS),this.nodes.forEach(PS),this.nodes.forEach(GS)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=m?m.root||m:this,this.path=m?[...m.path,m]:[],this.parent=m,this.depth=m?m.depth+1:0;for(let v=0;vthis.root.updateBlockedByResize=!1;Vt.read(()=>{x=window.innerWidth}),i(u,()=>{const b=window.innerWidth;b!==x&&(x=b,this.root.updateBlockedByResize=!0,g&&g(),g=jS(S,250),br.hasAnimatedSinceResize&&(br.hasAnimatedSinceResize=!1,this.nodes.forEach(Up)))})}m&&this.root.registerSharedNode(m,this),this.options.animate!==!1&&p&&(m||v)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:x,hasRelativeLayoutChanged:S,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||p.getDefaultTransition()||tT,{onLayoutAnimationStart:D,onLayoutAnimationComplete:_}=p.getProps(),G=!this.targetLayout||!yg(this.targetLayout,b),F=!x&&S;if(this.options.layoutRoot||this.resumeFrom||F||x&&(G||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const B={...gf(w,"layout"),onPlay:D,onComplete:_};(p.shouldReduceMotion||this.options.layoutRoot)&&(B.delay=0,B.type=!1),this.startAnimation(B),this.setAnimationOrigin(g,F,B.path)}else x||Up(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),fi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(JS),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&bg(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ye(this.snapshot.measuredBox.x)&&!ye(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let v=0;v{const O=I/1e3,U=Q?.(O);U?(S.x.translate=U.x,S.x.scale=Ut(u.x.scale,1,O),S.x.origin=u.x.origin,S.x.originPoint=u.x.originPoint,S.y.translate=U.y,S.y.scale=Ut(u.y.scale,1,O),S.y.origin=u.y.origin,S.y.originPoint=u.y.originPoint):(jp(S.x,u.x,O),jp(S.y,u.y,O)),this.setTargetDelta(S),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Cr(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),$S(this.relativeTarget,this.relativeTargetOrigin,b,O),H&&_S(this.relativeTarget,H)&&(this.isProjectionDirty=!1),H||(H=ne()),en(H,this.relativeTarget)),_&&(this.animationValues=x,CS(x,g,this.latestValues,O,B,F)),U&&U.rotate!==void 0&&(this.animationValues||(this.animationValues=x),this.animationValues.pathRotation=U.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=O},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(fi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Vt.update(()=>{br.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ra(0)),this.motionValue.jump(0,!1),this.currentAnimation=OS(this.motionValue,[0,1e3],{...u,velocity:0,isSync:!0,onUpdate:m=>{this.mixTargetDelta(m),u.onUpdate&&u.onUpdate(m)},onComplete:()=>{u.onComplete&&u.onComplete(),this.completeAnimation()}}),xx(this.currentAnimation,this),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(BS),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead(),{targetWithTransforms:m,layout:v,latestValues:p}=u;let{target:g}=u;if(!(!m||!g||!v)){if(this!==u&&this.layout&&v&&Tg(this.options.animationType,this.layout.layoutBox,v.layoutBox)){g=this.target||ne();const x=ye(this.layout.layoutBox.x);g.x.min=u.target.x.min,g.x.max=g.x.min+x;const S=ye(this.layout.layoutBox.y);g.y.min=u.target.y.min,g.y.max=g.y.min+S}en(m,g),mr(m,p),Dl(this.projectionDeltaWithTransform,this.layoutCorrected,m,p)}}registerSharedNode(u,m){this.sharedNodes.has(u)||this.sharedNodes.set(u,new VS),this.sharedNodes.get(u).add(m);const p=m.options.initialPromotionConfig;m.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(m):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){const{layoutId:u}=this.options;return u?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:u}=this.options;return u?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:m,preserveFollowOpacity:v}={}){const p=this.getStack();p&&p.promote(this,v),u&&(this.projectionDelta=void 0,this.needsReset=!0),m&&this.setOptions({transition:m})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let m=!1;const{latestValues:v}=u;if((v.z||v.rotate||v.rotateX||v.rotateY||v.rotateZ||v.skewX||v.skewY)&&(m=!0),!m)return;const p={};v.z&&gc("z",u,p,this.animationValues);for(let g=0;gu.currentAnimation?.stop()),this.root.nodes.forEach(Op),this.root.sharedNodes.clear()}}}function qS(i){i.updateLayout()}function YS(i){const l=i.resumeFrom?.snapshot||i.snapshot;if(i.isLead()&&i.layout&&l&&i.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=i.layout,{animationType:f}=i.options,d=l.source!==i.layout.source;if(f==="size")dn(g=>{const x=d?l.measuredBox[g]:l.layoutBox[g],S=ye(x);x.min=s[g].min,x.max=x.min+S});else if(f==="x"||f==="y"){const g=f==="x"?"y":"x";Zc(d?l.measuredBox[g]:l.layoutBox[g],s[g])}else Tg(f,l.layoutBox,s)&&dn(g=>{const x=d?l.measuredBox[g]:l.layoutBox[g],S=ye(s[g]);x.max=x.min+S,i.relativeTarget&&!i.currentAnimation&&(i.isProjectionDirty=!0,i.relativeTarget[g].max=i.relativeTarget[g].min+S)});const u=wa();Dl(u,s,l.layoutBox);const m=wa();d?Dl(m,i.applyTransform(o,!0),l.measuredBox):Dl(m,s,l.layoutBox);const v=!gg(u);let p=!1;if(!i.resumeFrom){const g=i.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:x,layout:S}=g;if(x&&S){const b=i.options.layoutAnchor||void 0,w=ne();Cr(w,l.layoutBox,x.layoutBox,b);const D=ne();Cr(D,s,S.layoutBox,b),yg(w,D)||(p=!0),g.options.layoutRoot&&(i.relativeTarget=D,i.relativeTargetOrigin=w,i.relativeParent=g)}}}i.notifyListeners("didUpdate",{layout:s,snapshot:l,delta:m,layoutDelta:u,hasLayoutChanged:v,hasRelativeLayoutChanged:p})}else if(i.isLead()){const{onExitComplete:s}=i.options;s&&s()}i.options.transition=void 0}function FS(i){i.parent&&(i.isProjecting()||(i.isProjectionDirty=i.parent.isProjectionDirty),i.isSharedProjectionDirty||(i.isSharedProjectionDirty=!!(i.isProjectionDirty||i.parent.isProjectionDirty||i.parent.isSharedProjectionDirty)),i.isTransformDirty||(i.isTransformDirty=i.parent.isTransformDirty))}function GS(i){i.isProjectionDirty=i.isSharedProjectionDirty=i.isTransformDirty=!1}function XS(i){i.clearSnapshot()}function Op(i){i.clearMeasurements()}function kS(i){i.isLayoutDirty=!0,i.updateLayout()}function Lp(i){i.isLayoutDirty=!1}function QS(i){i.isAnimationBlocked&&i.layout&&!i.isLayoutDirty&&(i.snapshot=i.layout,i.isLayoutDirty=!0)}function KS(i){const{visualElement:l}=i.options;l&&l.getProps().onBeforeLayoutMeasure&&l.notify("BeforeLayoutMeasure"),i.resetTransform()}function Up(i){i.finishAnimation(),i.targetDelta=i.relativeTarget=i.target=void 0,i.isProjectionDirty=!0}function ZS(i){i.resolveTargetDelta()}function PS(i){i.calcProjection()}function JS(i){i.resetSkewAndRotation()}function WS(i){i.removeLeadSnapshot()}function jp(i,l,s){i.translate=Ut(l.translate,0,s),i.scale=Ut(l.scale,1,s),i.origin=l.origin,i.originPoint=l.originPoint}function Vp(i,l,s,o){i.min=Ut(l.min,s.min,o),i.max=Ut(l.max,s.max,o)}function $S(i,l,s,o){Vp(i.x,l.x,s.x,o),Vp(i.y,l.y,s.y,o)}function IS(i){return i.animationValues&&i.animationValues.opacityExit!==void 0}const tT={duration:.45,ease:[.4,0,.1,1]},Bp=i=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(i),Hp=Bp("applewebkit /")&&!Bp("chrome/")?Math.round:an;function qp(i){i.min=Hp(i.min),i.max=Hp(i.max)}function eT(i){qp(i.x),qp(i.y)}function Tg(i,l,s){return i==="position" ||i==="preserve-aspect" &&!TS(Rp(l),Rp(s),.2)}function nT(i){return i!==i.root&&i.scroll?.wasRoot}const iT=Sg({attachResizeListener:(i,l)=>jl(i,"resize",l),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),yc={current:void 0},Eg=Sg({measureScroll:i=>({x:i.scrollLeft,y:i.scrollTop}),defaultParent:()=>{if(!yc.current){const i=new iT({});i.mount(window),i.setOptions({layoutScroll:!0}),yc.current=i}return yc.current},resetTransform:(i,l)=>{i.style.transform=l!==void 0?l:"none"},checkIsScrollRoot:i=>window.getComputedStyle(i).position==="fixed"}),Vl=Y.createContext({transformPagePoint:i=>i,isStatic:!1,reducedMotion:"never"});function Yp(i,l){if(typeof i=="function")return i(l);i!=null&&(i.current=l)}function aT(...i){return l=>{let s=!1;const o=i.map(f=>{const d=Yp(f,l);return!s&&typeof d=="function"&&(s=!0),d});if(s)return()=>{for(let f=0;f{const{width:S,height:b,top:w,left:D,right:_,bottom:G,direction:F}=v.current;if(l||d===!1||!m.current||!S||!b)return;const B=F==="rtl",H=s==="left"?B?`right: ${_}`:`left: ${D}`:B?`left: ${D}`:`right: ${_}`,Q=o==="bottom"?`bottom: ${G}`:`top: ${w}`;m.current.dataset.motionPopId=u;const I=document.createElement("style");p&&(I.nonce=p);const O=f??document.head;return O.appendChild(I),I.sheet&&I.sheet.insertRule(` [data-motion-pop-id="${u}"] { position: absolute !important; width: ${S}px !important; height: ${b}px !important; ${H}px !important; ${Q}px !important; } `),()=>{m.current?.removeAttribute("data-motion-pop-id"),O.contains(I)&&O.removeChild(I)}},[l]),A.jsx(sT,{isPresent:l,childRef:m,sizeRef:v,pop:d,children:d===!1?i:Y.cloneElement(i,{ref:x})})}const oT=({children:i,initial:l,isPresent:s,onExitComplete:o,custom:f,presenceAffectsLayout:d,mode:u,anchorX:m,anchorY:v,root:p})=>{const g=Nr(uT),x=Y.useId(),S=Y.useRef(s),b=Y.useRef(o);zl(()=>{S.current=s,b.current=o});let w=!0,D=Y.useMemo(()=>(w=!1,{id:x,initial:l,isPresent:s,custom:f,onExitComplete:_=>{g.set(_,!0);for(const G of g.values())if(!G)return;o&&o()},register:_=>(g.set(_,!1),()=>{g.delete(_),!S.current&&!g.size&&b.current?.()})}),[s,g,o]);return d&&w&&(D={...D}),Y.useMemo(()=>{g.forEach((_,G)=>g.set(G,!1))},[s]),Y.useEffect(()=>{!s&&!g.size&&o&&o()},[s]),i=A.jsx(rT,{pop:u==="popLayout",isPresent:s,anchorX:m,anchorY:v,root:p,children:i}),A.jsx(Or.Provider,{value:D,children:i})};function uT(){return new Map}function Ag(i=!0){const l=Y.useContext(Or);if(l===null)return[!0,null];const{isPresent:s,onExitComplete:o,register:f}=l,d=Y.useId();Y.useEffect(()=>{if(i)return f(d)},[i]);const u=Y.useCallback(()=>i&&o&&o(d),[d,o,i]);return!s&&o?[!1,u]:[!0]}const or=i=>i.key||"";function Fp(i){const l=[];return Y.Children.forEach(i,s=>{Y.isValidElement(s)&&l.push(s)}),l}const cT=({children:i,custom:l,initial:s=!0,onExitComplete:o,presenceAffectsLayout:f=!0,mode:d="sync",propagate:u=!1,anchorX:m="left",anchorY:v="top",root:p})=>{const[g,x]=Ag(u),S=Y.useMemo(()=>Fp(i),[i]),b=u&&!g?[]:S.map(or),w=Y.useRef(!0),D=Y.useRef(S),_=Nr(()=>new Map),G=Y.useRef(new Set),[F,B]=Y.useState(S),[H,Q]=Y.useState(S);zl(()=>{u&&!g&&!H.length&&x?.()},[g,u,H.length,x]),zl(()=>{w.current=!1,D.current=S;for(let U=0;U{const W=or(U),tt=u&&!g?!1:S===H||b.includes(W),it=()=>{if(G.current.has(W))return;if(_.has(W))G.current.add(W),_.set(W,!0);else return;let dt=!0;_.forEach(st=>{st||(dt=!1)}),dt&&(O?.(),Q(D.current),u&&x?.(),o&&o())};return A.jsx(oT,{isPresent:tt,initial:!w.current||s?void 0:!1,custom:l,presenceAffectsLayout:f,mode:d,root:p,onExitComplete:tt?void 0:it,anchorX:m,anchorY:v,children:U},W)})})},wg=Y.createContext({strict:!1}),Gp={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Xp=!1;function fT(){if(Xp)return;const i={};for(const l in Gp)i[l]={isEnabled:s=>Gp[l].some(o=>!!s[o])};sg(i),Xp=!0}function Mg(){return fT(),lS()}function dT(i){const l=Mg();for(const s in i)l[s]={...l[s],...i[s]};sg(l)}function hT({children:i,...l}){const s=Y.useContext(Vl);l={...s,...l},l.transition=vf(l.transition,s.transition),l.isStatic=Nr(()=>l.isStatic);const o=Y.useMemo(()=>l,[JSON.stringify(l.transition),l.transformPagePoint,l.reducedMotion,l.skipAnimations,l.isValidProp]);return A.jsx(Vl.Provider,{value:o,children:i})}const Br=Y.createContext({});function mT(i,l){if(Vr(i)){const{initial:s,animate:o}=i;return{initial:s===!1||Ul(s)?s:void 0,animate:Ul(o)?o:void 0}}return i.inherit!==!1?l:{}}function pT(i){const{initial:l,animate:s}=mT(i,Y.useContext(Br));return Y.useMemo(()=>({initial:l,animate:s}),[kp(l),kp(s)])}function kp(i){return Array.isArray(i)?i.join(" "):i}const Rf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _g(i,l,s){for(const o in l)!he(l[o])&&!ug(o,s)&&(i[o]=l[o])}function vT({transformTemplate:i},l){return Y.useMemo(()=>{const s=Rf();return Ef(s,l,i),Object.assign({},s.vars,s.style)},[l])}function gT(i,l){const s=i.style||{},o={};return _g(o,s,i),Object.assign(o,vT(i,l)),o}function yT(i,l){const s={},o=gT(i,l);return i.drag&&i.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=i.drag===!0?"none":`pan-${i.drag==="x"?"y":"x"}`),i.tabIndex===void 0&&(i.onTap||i.onTapStart||i.whileTap)&&(s.tabIndex=0),s.style=o,s}const Rg=()=>({...Rf(),attrs:{}});function xT(i,l,s,o){const f=Y.useMemo(()=>{const d=Rg();return Pv(d,l,fg(o),i.transformTemplate,i.style),{...d.attrs,style:{...d.style}}},[l]);if(i.style){const d={};_g(d,i.style,i),f.style={...d,...f.style}}return f}const bT=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function zr(i){return i.startsWith("while")||i.startsWith("drag")&&i!=="draggable"||i.startsWith("layout")||i.startsWith("onTap")||i.startsWith("onPan")||i.startsWith("onLayout")||bT.has(i)}function ST(i,l){return i.startsWith("on")?!zr(i):l?.(i)??!zr(i)}function TT(i,l,s,o){const f={};for(const d in i)d==="values"&&typeof i.values=="object"||he(i[d])||(ST(d,o)||s===!0&&zr(d)||!l&&!zr(d)||i.draggable&&d.startsWith("onDrag"))&&(f[d]=i[d]);return f}const ET=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Df(i){return typeof i!="string"||i.includes("-")?!1:!!(ET.indexOf(i)>-1||/[A-Z]/u.test(i))}function AT(i,l,s,{latestValues:o},f,d=!1,u,m){const p=(u??Df(i)?xT:yT)(l,o,f,i),g=TT(l,typeof i=="string",d,m),x=i!==Y.Fragment?{...g,...p,ref:s}:{},{children:S}=l,b=Y.useMemo(()=>he(S)?S.get():S,[S]);return Y.createElement(i,{...x,children:b})}function wT({scrapeMotionValuesFromProps:i,createRenderState:l},s,o,f){return{latestValues:MT(s,o,f,i),renderState:l()}}function MT(i,l,s,o){const f={},d=o(i,{});for(const S in d)f[S]=xr(d[S]);let{initial:u,animate:m}=i;const v=Vr(i),p=ag(i);l&&p&&!v&&i.inherit!==!1&&(u===void 0&&(u=l.initial),m===void 0&&(m=l.animate));let g=s?s.initial===!1:!1;g=g||u===!1;const x=g?m:u;if(x&&typeof x!="boolean"&&!jr(x)){const S=Array.isArray(x)?x:[x];for(let b=0;b(l,s)=>{const o=Y.useContext(Br),f=Y.useContext(Or),d=()=>wT(i,l,o,f);return s?d():Nr(d)},_T=Dg({scrapeMotionValuesFromProps:_f,createRenderState:Rf}),RT=Dg({scrapeMotionValuesFromProps:dg,createRenderState:Rg}),DT=Symbol.for("motionComponentSymbol");function CT(i,l,s){const o=Y.useRef(s);Y.useInsertionEffect(()=>{o.current=s});const f=Y.useRef(null);return Y.useCallback(d=>{d&&i.onMount?.(d),l&&(d?l.mount(d):l.unmount());const u=o.current;if(typeof u=="function")if(d){const m=u(d);typeof m=="function"&&(f.current=m)}else f.current?(f.current(),f.current=null):u(d);else u&&(u.current=d)},[l])}const Cg=Y.createContext({});function Ta(i){return i&&typeof i=="object"&&Object.prototype.hasOwnProperty.call(i,"current")}function zT(i,l,s,o,f,d){const{visualElement:u}=Y.useContext(Br),m=Y.useContext(wg),v=Y.useContext(Or),p=Y.useContext(Vl),g=p.reducedMotion,x=p.skipAnimations,S=Y.useRef(null),b=Y.useRef(!1);o=o||m.renderer,!S.current&&o&&(S.current=o(i,{visualState:l,parent:u,props:s,presenceContext:v,blockInitialAnimation:v?v.initial===!1:!1,reducedMotionConfig:g,skipAnimations:x,isSVG:d}),b.current&&S.current&&(S.current.manuallyAnimateOnMount=!0));const w=S.current,D=Y.useContext(Cg);w&&!w.projection&&f&&(w.type==="html"||w.type==="svg")&&NT(S.current,s,f,D);const _=Y.useRef(!1);Y.useInsertionEffect(()=>{w&&_.current&&w.update(s,v)});const G=s[Xv],F=Y.useRef(!!G&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(G)&&window.MotionHasOptimisedAnimation?.(G));return zl(()=>{!b.current||!w||(w.animationState?.animateChanges(),w.enteringChildren=void 0)},[]),zl(()=>{b.current=!0,w&&(_.current=!0,window.MotionIsMounted=!0,w.updateFeatures(),w.scheduleRenderMicrotask(),F.current&&w.animationState&&w.animationState.animateChanges())}),Y.useEffect(()=>{w&&(!F.current&&w.animationState&&w.animationState.animateChanges(),F.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(G)}),F.current=!1),w.enteringChildren=void 0)}),w}function NT(i,l,s,o){const{layoutId:f,layout:d,drag:u,dragConstraints:m,layoutScroll:v,layoutRoot:p,layoutAnchor:g,layoutCrossfade:x}=l;i.projection=new s(i.latestValues,l["data-framer-portal-id"]?void 0:zg(i.parent)),i.projection.setOptions({layoutId:f,layout:d,alwaysMeasureLayout:!!u||m&&Ta(m),visualElement:i,animationType:typeof d=="string"?d:"both",initialPromotionConfig:o,crossfade:x,layoutScroll:v,layoutRoot:p,layoutAnchor:g})}function zg(i){if(i)return i.options.allowProjection!==!1?i.projection:zg(i.parent)}function xc(i,{forwardMotionProps:l=!1,type:s}={},o,f){o&&dT(o);const d=s?s==="svg":Df(i),u=d?RT:_T;function m(p,g){let x;const S={...Y.useContext(Vl),...p,layoutId:OT(p)},{isStatic:b,isValidProp:w}=S,D=pT(p),_=u(p,b);if(!b&&typeof window<"u"){LT();const G=UT(S);x=G.MeasureLayout,D.visualElement=zT(i,_,S,f,G.ProjectionNode,d)}return A.jsxs(Br.Provider,{value:D,children:[x&&D.visualElement?A.jsx(x,{visualElement:D.visualElement,...S}):null,AT(i,p,CT(_,D.visualElement,g),_,b,l,d,w)]})}m.displayName=`motion.${typeof i=="string" ?i:`create(${i.displayName??i.name??""})`}`;const v=Y.forwardRef(m);return v[DT]=i,v}function OT({layoutId:i}){const l=Y.useContext($c).id;return l&&i!==void 0?l+"-"+i:i}function LT(i,l){Y.useContext(wg).strict}function UT(i){const l=Mg(),{drag:s,layout:o}=l;if(!s&&!o)return{};const f={...s,...o};return{MeasureLayout:s?.isEnabled(i)||o?.isEnabled(i)?f.MeasureLayout:void 0,ProjectionNode:f.ProjectionNode}}function jT(i,l){if(typeof Proxy>"u")return xc;const s=new Map,o=(d,u)=>xc(d,u,i,l),f=(d,u)=>o(d,u);return new Proxy(f,{get:(d,u)=>u==="create"?o:(s.has(u)||s.set(u,xc(u,void 0,i,l)),s.get(u))})}const VT=(i,l)=>l.isSVG??Df(i)?new fS(l):new uS(l,{allowProjection:i!==Y.Fragment});class BT extends di{constructor(l){super(l),l.animationState||(l.animationState=vS(l))}updateAnimationControlsSubscription(){const{animate:l}=this.node.getProps();jr(l)&&(this.unmountControls=l.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:l}=this.node.getProps(),{animate:s}=this.node.prevProps||{};l!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let HT=0;class qT extends di{constructor(){super(...arguments),this.id=HT++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:l,onExitComplete:s}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||l===o)return;if(l&&o===!1){if(this.isExitComplete){const{initial:d,custom:u}=this.node.getProps();if(typeof d=="string"||typeof d=="object"&&d!==null&&!Array.isArray(d)){const m=Vi(this.node,d,u);if(m){const{transition:v,transitionEnd:p,...g}=m;for(const x in g)this.node.getValue(x)?.jump(g[x])}}this.node.blockInitialAnimation=!1,this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1,this.exitAnimation=void 0;return}const f=this.exitAnimation=this.node.animationState.setActive("exit",!l);s&&!l&&f.then(()=>{this.exitAnimation===f&&(this.isExitComplete=!0,s(this.id))})}mount(){const{register:l,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),l&&(this.unmount=l(this.id))}unmount(){}}const YT={animation:{Feature:BT},exit:{Feature:qT}};function Hr(i){return{point:{x:i.pageX,y:i.pageY}}}const FT=i=>l=>wf(l)&&i(l,Hr(l));function Cl(i,l,s,o){return jl(i,l,FT(s),o)}const Ng=({current:i})=>i?i.ownerDocument.defaultView:null,Qp=(i,l)=>Math.abs(i-l);function GT(i,l){const s=Qp(i.x,l.x),o=Qp(i.y,l.y);return Math.sqrt(s**2+o**2)}const Kp=new Set(["auto","scroll"]);class Og{constructor(l,s,{transformPagePoint:o,contextWindow:f=window,dragSnapToOrigin:d=!1,distanceThreshold:u=3,element:m}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=w=>{this.handleScroll(w.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.hasPendingMove=!1,this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ur(this.lastRawMoveEventInfo,this.transformPagePoint));const w=bc(this.lastMoveEventInfo,this.history),D=this.startEvent!==null,_=GT(w.offset,{x:0,y:0})>=this.distanceThreshold;if(!D&&!_)return;const{point:G}=w;this.history.push({...G,timestamp:de.now()});const{onStart:F,onMove:B}=this.handlers;D||(F&&F(this.lastMoveEvent,w),this.startEvent=this.lastMoveEvent),B&&B(this.lastMoveEvent,w)},this.handlePointerMove=(w,D)=>{this.lastMoveEvent=w,this.lastRawMoveEventInfo=D,this.lastMoveEventInfo=ur(D,this.transformPagePoint),this.hasPendingMove=!0,Vt.update(this.updatePoint,!0)},this.handlePointerUp=(w,D)=>{this.hasPendingMove&&this.updatePoint(),this.end();const{onEnd:_,onSessionEnd:G,resumeAnimation:F}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&F&&F(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const B=bc(w.type==="pointercancel"?this.lastMoveEventInfo:ur(D,this.transformPagePoint),this.history);this.startEvent&&_&&_(w,B),G&&G(w,B)},!wf(l))return;this.dragSnapToOrigin=d,this.handlers=s,this.transformPagePoint=o,this.distanceThreshold=u,this.contextWindow=f||window;const v=Hr(l),p=ur(v,this.transformPagePoint),{point:g}=p,{timestamp:x}=se;this.history=[{...g,timestamp:x}];const{onSessionStart:S}=s;S&&S(l,bc(p,this.history));const b={passive:!0,capture:!0};this.removeListeners=Bl(Cl(this.contextWindow,"pointermove",this.handlePointerMove,b),Cl(this.contextWindow,"pointerup",this.handlePointerUp,b),Cl(this.contextWindow,"pointercancel",this.handlePointerUp,b)),m&&this.startScrollTracking(m)}startScrollTracking(l){let s=l.parentElement;for(;s;){const o=getComputedStyle(s);(Kp.has(o.overflowX)||Kp.has(o.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(l){const s=this.scrollPositions.get(l);if(!s)return;const o=l===window,f=o?{x:window.scrollX,y:window.scrollY}:{x:l.scrollLeft,y:l.scrollTop},d={x:f.x-s.x,y:f.y-s.y};d.x===0&&d.y===0||(o?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=d.x,this.lastMoveEventInfo.point.y+=d.y):this.history.length>0&&(this.history[0].x-=d.x,this.history[0].y-=d.y),this.scrollPositions.set(l,f),Vt.update(this.updatePoint,!0))}updateHandlers(l){this.handlers=l}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),fi(this.updatePoint)}}function ur(i,l){return l?{point:l(i.point)}:i}function Zp(i,l){return{x:i.x-l.x,y:i.y-l.y}}function bc({point:i},l){return{point:i,delta:Zp(i,Lg(l)),offset:Zp(i,XT(l)),velocity:kT(l,.1)}}function XT(i){return i[0]}function Lg(i){return i[i.length-1]}function kT(i,l){if(i.length<2)return{x:0,y:0};let s=i.length-1,o=null;const f=Lg(i);for(;s>=0&&(o=i[s],!(f.timestamp-o.timestamp>Je(l)));)s--;if(!o)return{x:0,y:0};o===i[0]&&i.length>2&&f.timestamp-o.timestamp>Je(l)*2&&(o=i[1]);const d=Ve(f.timestamp-o.timestamp);if(d===0)return{x:0,y:0};const u={x:(f.x-o.x)/d,y:(f.y-o.y)/d};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function QT(i,{min:l,max:s},o){return l!==void 0&&is&&(i=o?Ut(s,i,o.max):Math.min(i,s)),i}function Pp(i,l,s){return{min:l!==void 0?i.min+l:void 0,max:s!==void 0?i.max+s-(i.max-i.min):void 0}}function KT(i,{top:l,left:s,bottom:o,right:f}){return{x:Pp(i.x,s,f),y:Pp(i.y,l,o)}}function Jp(i,l){let s=l.min-i.min,o=l.max-i.max;return l.max-l.mino?s=Nl(l.min,l.max-o,i.min):o>f&&(s=Nl(i.min,i.max-f,l.min)),ln(0,1,s)}function JT(i,l){const s={};return l.min!==void 0&&(s.min=l.min-i.min),l.max!==void 0&&(s.max=l.max-i.min),s}const Pc=.35;function WT(i=Pc){return i===!1?i=0:i===!0&&(i=Pc),{x:Wp(i,"left","right"),y:Wp(i,"top","bottom")}}function Wp(i,l,s){return{min:$p(i,l),max:$p(i,s)}}function $p(i,l){return typeof i=="number"?i:i[l]||0}const $T=new WeakMap;class IT{constructor(l){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ne(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=l}start(l,{snapToCursor:s=!1,distanceThreshold:o}={}){const{presenceContext:f}=this.visualElement;if(f&&f.isPresent===!1)return;const d=x=>{s&&this.snapToCursor(x),this.stopAnimation()},u=(x,S)=>{const{drag:b,dragPropagation:w,onDragStart:D}=this.getProps();if(b&&!w&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Vb(b),!this.openDragLock))return;this.latestPointerEvent=x,this.latestPanInfo=S,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),dn(G=>{let F=this.getAxisMotionValue(G).get()||0;if(mn.test(F)){const{projection:B}=this.visualElement;if(B&&B.layout){const H=B.layout.layoutBox[G];H&&(F=ye(H)*(parseFloat(F)/100))}}this.originPoint[G]=F}),D&&Vt.update(()=>D(x,S),!1,!0),Yc(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},m=(x,S)=>{this.latestPointerEvent=x,this.latestPanInfo=S;const{dragPropagation:b,dragDirectionLock:w,onDirectionLock:D,onDrag:_}=this.getProps();if(!b&&!this.openDragLock)return;const{offset:G}=S;if(w&&this.currentDirection===null){this.currentDirection=eE(G),this.currentDirection!==null&&D&&D(this.currentDirection);return}this.updateAxis("x",S.point,G),this.updateAxis("y",S.point,G),this.visualElement.render(),_&&Vt.update(()=>_(x,S),!1,!0)},v=(x,S)=>{this.latestPointerEvent=x,this.latestPanInfo=S,this.stop(x,S),this.latestPointerEvent=null,this.latestPanInfo=null},p=()=>{const{dragSnapToOrigin:x}=this.getProps();(x||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:g}=this.getProps();this.panSession=new Og(l,{onSessionStart:d,onStart:u,onMove:m,onSessionEnd:v,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:g,distanceThreshold:o,contextWindow:Ng(this.visualElement),element:this.visualElement.current})}stop(l,s){const o=l||this.latestPointerEvent,f=s||this.latestPanInfo,d=this.isDragging;if(this.cancel(),!d||!f||!o)return;const{velocity:u}=f;this.startAnimation(u);const{onDragEnd:m}=this.getProps();m&&Vt.postRender(()=>m(o,f))}cancel(){this.isDragging=!1;const{projection:l,animationState:s}=this.visualElement;l&&(l.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(l,s,o){const{drag:f}=this.getProps();if(!o||!cr(l,f,this.currentDirection))return;const d=this.getAxisMotionValue(l);let u=this.originPoint[l]+o[l];this.constraints&&this.constraints[l]&&(u=QT(u,this.constraints[l],this.elastic[l])),d.set(u)}resolveConstraints(){const{dragConstraints:l,dragElastic:s}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,f=this.constraints;l&&Ta(l)?this.constraints||(this.constraints=this.resolveRefConstraints()):l&&o?this.constraints=KT(o.layoutBox,l):this.constraints=!1,this.elastic=WT(s),f!==this.constraints&&!Ta(l)&&o&&this.constraints&&!this.hasMutatedConstraints&&dn(d=>{this.constraints!==!1&&this.getAxisMotionValue(d)&&(this.constraints[d]=JT(o.layoutBox[d],this.constraints[d]))})}resolveRefConstraints(){const{dragConstraints:l,onMeasureDragConstraints:s}=this.getProps();if(!l||!Ta(l))return!1;const o=l.current,{projection:f}=this.visualElement;if(!f||!f.layout)return!1;f.root&&(f.root.scroll=void 0,f.root.updateScroll());const d=jb(o,f.root,this.visualElement.getTransformPagePoint());let u=ZT(f.layout.layoutBox,d);if(s){const m=s(Ob(u));this.hasMutatedConstraints=!!m,m&&(u=Jv(m))}return u}startAnimation(l){const{drag:s,dragMomentum:o,dragElastic:f,dragTransition:d,dragSnapToOrigin:u,onDragTransitionEnd:m}=this.getProps(),v=this.constraints||{},p=dn(g=>{if(!cr(g,s,this.currentDirection))return;let x=v&&v[g]||{};(u===!0||u===g)&&(x={min:0,max:0});const S=f?200:1e6,b=f?40:1e7,w={type:"inertia",velocity:o?l[g]:0,bounceStiffness:S,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...d,...x};return this.startAxisValueAnimation(g,w)});return Promise.all(p).then(m)}startAxisValueAnimation(l,s){const o=this.getAxisMotionValue(l);return Yc(this.visualElement,l),o.start(yf(l,o,0,s,this.visualElement,!1))}stopAnimation(){dn(l=>this.getAxisMotionValue(l).stop())}getAxisMotionValue(l){const s=`_drag${l.toUpperCase()}`,f=this.visualElement.getProps()[s];return f||this.visualElement.getValue(l,this.visualElement.latestValues[l]??0)}snapToCursor({clientX:l,clientY:s}){const{drag:o}=this.getProps(),f={x:l,y:s},d=this.visualElement.getTransformPagePoint()?.(f)||f,u=this.visualElement.measureViewportBox();dn(m=>{if(!cr(m,o,this.currentDirection))return;const v=this.getAxisMotionValue(m),{min:p,max:g}=u[m];v.set((v.get()||0)+d[m]-Ut(p,g,.5))})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:l,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!Ta(s)||!o||!this.constraints)return;this.stopAnimation();const f=this.constraints,d={x:0,y:0};dn(m=>{const v=this.getAxisMotionValue(m).get();d[m]=PT({min:v,max:v},f[m])});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.constraints=!1,this.resolveConstraints(),dn(m=>{const v=this.getAxisMotionValue(m);if(!cr(m,l,null)||!v.get())return;const{min:p,max:g}=this.constraints[m];v.set(Ut(p,g,d[m]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;$T.set(this.visualElement,this);const l=this.visualElement.current,s=Cl(l,"pointerdown",p=>{const{drag:g,dragListener:x=!0}=this.getProps(),S=p.target,b=S!==l&&Gb(S);g&&x&&!b&&this.start(p)});let o;const f=()=>{const{dragConstraints:p}=this.getProps();Ta(p)&&p.current&&(this.constraints=this.resolveRefConstraints(),o||(o=tE(l,p.current,()=>this.scalePositionWithinConstraints())))},{projection:d}=this.visualElement,u=d.addEventListener("measure",f);d&&!d.layout&&(d.root&&d.root.updateScroll(),d.updateLayout()),Vt.read(f);const m=jl(window,"resize",()=>this.scalePositionWithinConstraints()),v=d.addEventListener("didUpdate",(({delta:p,hasLayoutChanged:g})=>{this.isDragging&&g&&(dn(x=>{const S=this.getAxisMotionValue(x);S&&(this.originPoint[x]+=p[x].translate,S.set(S.get()+p[x].translate))}),this.visualElement.render())}));return()=>{m(),s(),u(),v&&v(),o&&o()}}getProps(){const l=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:o=!1,dragPropagation:f=!1,dragConstraints:d=!1,dragElastic:u=Pc,dragMomentum:m=!0}=l;return{...l,drag:s,dragDirectionLock:o,dragPropagation:f,dragConstraints:d,dragElastic:u,dragMomentum:m}}}function Ip(i){let l=!0;return()=>{if(l){l=!1;return}i()}}function tE(i,l,s){const o=dp(i,Ip(s)),f=dp(l,Ip(s));return()=>{o(),f()}}function cr(i,l,s){return(l===!0||l===i)&&(s===null||s===i)}function eE(i,l=10){let s=null;return Math.abs(i.y)>l?s="y":Math.abs(i.x)>l&&(s="x"),s}class nE extends di{constructor(l){super(l),this.removeGroupControls=an,this.removeListeners=an,this.controls=new IT(l)}mount(){const{dragControls:l}=this.node.getProps();l&&(this.removeGroupControls=l.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||an}update(){const{dragControls:l}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};l!==s&&(this.removeGroupControls(),l&&(this.removeGroupControls=l.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Sc=i=>(l,s)=>{i&&Vt.update(()=>i(l,s),!1,!0)};class iE extends di{constructor(){super(...arguments),this.removePointerDownListener=an}onPointerDown(l){this.session=new Og(l,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ng(this.node)})}createPanHandlers(){const{onPanSessionStart:l,onPanStart:s,onPan:o,onPanEnd:f}=this.node.getProps();return{onSessionStart:Sc(l),onStart:Sc(s),onMove:Sc(o),onEnd:(d,u)=>{delete this.session,f&&Vt.postRender(()=>f(d,u))}}}mount(){this.removePointerDownListener=Cl(this.node.current,"pointerdown",l=>this.onPointerDown(l))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Tc=!1;class aE extends Y.Component{componentDidMount(){const{visualElement:l,layoutGroup:s,switchLayoutGroup:o,layoutId:f}=this.props,{projection:d}=l;d&&(s.group&&s.group.add(d),o&&o.register&&f&&o.register(d),Tc&&d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),br.hasEverUpdated=!0}getSnapshotBeforeUpdate(l){const{layoutDependency:s,visualElement:o,drag:f,isPresent:d}=this.props,{projection:u}=o;return u&&(u.isPresent=d,l.layoutDependency!==s&&u.setOptions({...u.options,layoutDependency:s}),Tc=!0,f||l.layoutDependency!==s||s===void 0||l.isPresent!==d?u.willUpdate():this.safeToRemove(),l.isPresent!==d&&(d?u.promote():u.relegate()||Vt.postRender(()=>{const m=u.getStack();(!m||!m.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:l,layoutAnchor:s}=this.props,{projection:o}=l;o&&(o.options.layoutAnchor=s,o.root.didUpdate(),Af.postRender(()=>{!o.currentAnimation&&o.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:l,layoutGroup:s,switchLayoutGroup:o}=this.props,{projection:f}=l;Tc=!0,f&&(f.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(f),o&&o.deregister&&o.deregister(f))}safeToRemove(){const{safeToRemove:l}=this.props;l&&l()}render(){return null}}function Ug(i){const[l,s]=Ag(),o=Y.useContext($c);return A.jsx(aE,{...i,layoutGroup:o,switchLayoutGroup:Y.useContext(Cg),isPresent:l,safeToRemove:s})}const lE={pan:{Feature:iE},drag:{Feature:nE,ProjectionNode:Eg,MeasureLayout:Ug}};function tv(i,l,s){const{props:o}=i;i.animationState&&o.whileHover&&i.animationState.setActive("whileHover",s==="Start");const f="onHover"+s,d=o[f];d&&Vt.postRender(()=>d(l,Hr(l)))}class sE extends di{mount(){const{current:l}=this.node;l&&(this.unmount=Hb(l,(s,o)=>(tv(this.node,o,"Start"),f=>tv(this.node,f,"End"))))}unmount(){}}class rE extends di{constructor(){super(...arguments),this.isActive=!1}onFocus(){let l=!1;try{l=this.node.current.matches(":focus-visible")}catch{l=!0}!l||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Bl(jl(this.node.current,"focus",()=>this.onFocus()),jl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ev(i,l,s){const{props:o}=i;if(i.current instanceof HTMLButtonElement&&i.current.disabled)return;i.animationState&&o.whileTap&&i.animationState.setActive("whileTap",s==="Start");const f="onTap"+(s==="End"?"":s),d=o[f];d&&Vt.postRender(()=>d(l,Hr(l)))}class oE extends di{mount(){const{current:l}=this.node;if(!l)return;const{globalTapTarget:s,propagate:o}=this.node.props;this.unmount=kb(l,(f,d)=>(ev(this.node,d,"Start"),(u,{success:m})=>ev(this.node,u,m?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:o?.tap===!1})}unmount(){}}const Jc=new WeakMap,Ec=new WeakMap,uE=i=>{const l=Jc.get(i.target);l&&l(i)},cE=i=>{i.forEach(uE)};function fE({root:i,...l}){const s=i||document;Ec.has(s)||Ec.set(s,{});const o=Ec.get(s),f=JSON.stringify(l);return o[f]||(o[f]=new IntersectionObserver(cE,{root:i,...l})),o[f]}function dE(i,l,s){const o=fE(l);return Jc.set(i,s),o.observe(i),()=>{Jc.delete(i),o.unobserve(i)}}const hE={some:0,all:1};class mE extends di{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:l={}}=this.node.getProps(),{root:s,margin:o,amount:f="some",once:d}=l,u={root:s?s.current:void 0,rootMargin:o,threshold:typeof f=="number"?f:hE[f]},m=v=>{const{isIntersecting:p}=v;if(this.isInView===p||(this.isInView=p,d&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:g,onViewportLeave:x}=this.node.getProps(),S=p?g:x;S&&S(v)};this.stopObserver=dE(this.node.current,u,m)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:l,prevProps:s}=this.node;["amount","margin","root"].some(pE(l,s))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function pE({viewport:i={}},{viewport:l={}}={}){return s=>i[s]!==l[s]}const vE={inView:{Feature:mE},tap:{Feature:oE},focus:{Feature:rE},hover:{Feature:sE}},gE={layout:{ProjectionNode:Eg,MeasureLayout:Ug}},yE={...YT,...vE,...lE,...gE},nv=jT(yE,VT),xE=` attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos, 0.0, 1.0); } `,bE=` #ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif uniform vec2 u_res; uniform float u_time; uniform vec2 u_ptr; uniform float u_press; uniform float u_energy; float smin(float a, float b, float k){ float h = clamp(0.5 + 0.5 * (b - a) / k, 0.0, 1.0); return mix(b, a, h) - k * h * (1.0 - h); } float map(vec3 p){ float t = u_time; float spread = 1.0 + u_energy * 0.45; // the drop itself, glued to the pointer vec3 c0 = vec3(u_ptr, 0.12 * sin(t * 0.7)); float d = length(p - c0) - (0.44 + 0.05 * u_press); // four satellites orbiting it with their own lag for (int i = 0; i < 4; i++){ float fi=float(i); float a=t * (0.42 + 0.17 * fi) + fi * 1.9; float rad=(0.72 + 0.30 * sin(t * 0.55 + fi * 2.2)) * spread; vec3 s=vec3( u_ptr.x + cos(a) * rad, u_ptr.y + sin(a * 1.25 + fi) * rad * 0.6, 0.45 * sin(a * 0.8 + fi * 1.3) ); float r=0.17 + 0.06 * sin(t * 1.3 + fi * 2.4) + 0.07 * u_press; d=smin(d, length(p - s) - r, 0.42); } return d; } vec3 calcNormal(vec3 p){ vec2 e=vec2(0.0015, 0.0); return normalize(vec3( map(p + e.xyy) - map(p - e.xyy), map(p + e.yxy) - map(p - e.yxy), map(p + e.yyx) - map(p - e.yyx) )); } // the studio the chrome is standing in: bone plaster, dark floor, // one window, one ember lamp vec3 env(vec3 r){ vec3 sky=vec3(0.972, 0.966, 0.952); vec3 grd=vec3(0.285, 0.268, 0.243); vec3 col=mix(grd, sky, smoothstep(-0.45, 0.55, r.y)); float band=smoothstep(0.17, 0.0, abs(r.y + 0.04)); col=mix(col, vec3(0.06, 0.06, 0.066), band * 0.82); float win=smoothstep(0.30, 0.02, abs(r.y - 0.30)) * smoothstep(0.75, 0.05, abs(r.x - 0.15)); col +=vec3(1.0, 0.99, 0.97) * win * 0.55; vec3 key=normalize(vec3(0.60, 0.35, 0.60)); col +=vec3(1.0, 0.32, 0.10) * pow(max(dot(r, key), 0.0), 18.0) * 1.55; vec3 fill=normalize(vec3(-0.70, 0.50, 0.40)); col +=vec3(0.44, 0.52, 0.62) * pow(max(dot(r, fill), 0.0), 10.0) * 0.30; return col; } vec3 plaster(vec2 uv, vec2 ptr){ vec3 base=vec3(0.929, 0.918, 0.890); float v=length(uv * vec2(0.60, 0.95)); base *=1.0 - 0.17 * smoothstep(0.32, 1.15, v); base +=vec3(0.035, 0.022, 0.006) * smoothstep(1.1, 0.0, length(uv - vec2(-0.72, 0.52))); float ao=smoothstep(1.15, 0.0, length(uv - ptr)); base *=1.0 - 0.16 * ao * ao; return base; } void main(){ vec2 uv=(gl_FragCoord.xy - 0.5 * u_res) / u_res.y; vec3 col=plaster(uv, u_ptr); vec3 ro=vec3(0.0, 0.0, 3.2); vec3 rd=normalize(vec3(uv, -1.75)); float t=0.0; float d=1.0; bool hit=false; for (int i=0; i < 72; i++){ vec3 p=ro + rd * t; d=map(p); if (d < 0.0016) { hit=true; break; } t +=d; if (t> 7.0) break; } if (hit){ vec3 p = ro + rd * t; vec3 n = calcNormal(p); vec3 refl = reflect(rd, n); vec3 c = env(refl); float fres = pow(1.0 - max(dot(n, -rd), 0.0), 4.0); c = mix(c, env(reflect(rd, normalize(n * 0.55 + vec3(0.0, 1.0, 0.0) * 0.45))), 0.16); c += fres * vec3(1.0, 0.42, 0.16) * 0.55; c *= 0.90 + 0.10 * max(n.y, 0.0); c = mix(c, vec3(0.929, 0.918, 0.890), smoothstep(3.4, 6.6, t) * 0.35); col = c; } // gentle film grain float g = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453); col += (g - 0.5) * 0.016; gl_FragColor = vec4(col, 1.0); } `;function SE(){const i=Y.useRef(null),l=Y.useRef(null),[s,o]=Y.useState(!1);return Y.useEffect(()=>{const f=i.current;if(!f)return;let d=null;try{d=f.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch{d=null}if(!d){o(!0);return}const u=(E,j)=>{const K=d.createShader(E);return K?(d.shaderSource(K,j),d.compileShader(K),d.getShaderParameter(K,d.COMPILE_STATUS)?K:(console.warn("shader:",d.getShaderInfoLog(K)),d.deleteShader(K),null)):null},m=u(d.VERTEX_SHADER,xE),v=u(d.FRAGMENT_SHADER,bE);if(!m||!v){o(!0);return}const p=d.createProgram();if(!p){o(!0);return}if(d.attachShader(p,m),d.attachShader(p,v),d.linkProgram(p),!d.getProgramParameter(p,d.LINK_STATUS)){console.warn("link:",d.getProgramInfoLog(p)),o(!0);return}d.useProgram(p);const g=d.createBuffer();d.bindBuffer(d.ARRAY_BUFFER,g),d.bufferData(d.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),d.STATIC_DRAW);const x=d.getAttribLocation(p,"a_pos");d.enableVertexAttribArray(x),d.vertexAttribPointer(x,2,d.FLOAT,!1,0,0);const S=d.getUniformLocation(p,"u_res"),b=d.getUniformLocation(p,"u_time"),w=d.getUniformLocation(p,"u_ptr"),D=d.getUniformLocation(p,"u_press"),_=d.getUniformLocation(p,"u_energy"),G=()=>{const j=Math.min(window.devicePixelRatio||1,2)*1.3;let K=Math.max(1,Math.round(window.innerWidth*j)),P=Math.max(1,Math.round(window.innerHeight*j));const et=24e5,nt=K*P;if(nt>et){const $=Math.sqrt(et/nt);K=Math.max(1,Math.round(K*$)),P=Math.max(1,Math.round(P*$))}(f.width!==K||f.height!==P)&&(f.width=K,f.height=P),d.viewport(0,0,f.width,f.height)};G();const F={x:.1,y:0},B={x:.1,y:0},H={x:0,y:0};let Q=0,I=0,O=0,U=!1,W=0,tt=0,it=performance.now();const dt=E=>{const j=window.innerWidth,K=window.innerHeight,P=(E.clientX-j/2)/K,et=(K/2-E.clientY)/K,nt=performance.now(),$=Math.max(nt-it,1),pt=Math.hypot(P-W,et-tt)/($/1e3);Q=Math.min(1,Q+pt*7e-4),W=P,tt=et,it=nt,U=!0,F.x=P,F.y=et},st=()=>{O=1},ct=()=>{O=0};window.addEventListener("pointermove",dt,{passive:!0}),window.addEventListener("pointerdown",st,{passive:!0}),window.addEventListener("pointerup",ct,{passive:!0}),window.addEventListener("pointercancel",ct,{passive:!0}),window.addEventListener("resize",G);const ut=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let C=0,Z=performance.now(),J=0;const rt=E=>{C=requestAnimationFrame(rt);const j=Math.min((E-Z)/1e3,1/30);if(Z=E,document.hidden)return;ut||(J+=j),U||(F.x=.12+.17*Math.sin(J*.33),F.y=.05*Math.cos(J*.26));const K=74,P=13.5;H.x+=((F.x-B.x)*K-H.x*P)*j,H.y+=((F.y-B.y)*K-H.y*P)*j,B.x+=H.x*j,B.y+=H.y*j,Q*=Math.exp(-j*1.5),I+=(O-I)*Math.min(1,j*7),d.uniform2f(S,f.width,f.height),d.uniform1f(b,J),d.uniform2f(w,B.x,B.y),d.uniform1f(D,I),d.uniform1f(_,Q),d.drawArrays(d.TRIANGLES,0,3)};C=requestAnimationFrame(rt);const ht=E=>{E.preventDefault(),cancelAnimationFrame(C),o(!0)};return f.addEventListener("webglcontextlost",ht),()=>{cancelAnimationFrame(C),window.removeEventListener("pointermove",dt),window.removeEventListener("pointerdown",st),window.removeEventListener("pointerup",ct),window.removeEventListener("pointercancel",ct),window.removeEventListener("resize",G),f.removeEventListener("webglcontextlost",ht),d?.deleteProgram(p),d?.deleteShader(m),d?.deleteShader(v),d?.deleteBuffer(g)}},[]),Y.useEffect(()=>{if(!s)return;const f=l.current;if(!f)return;const d={x:0,y:0},u={x:0,y:0};let m=0,v=performance.now(),p=!1,g=0;const x=b=>{p=!0,d.x=b.clientX-window.innerWidth/2,d.y=b.clientY-window.innerHeight/2};window.addEventListener("pointermove",x,{passive:!0});const S=b=>{m=requestAnimationFrame(S);const w=Math.min((b-v)/1e3,1/30);v=b,g+=w,p||(d.x=Math.sin(g*.33)*window.innerWidth*.14,d.y=Math.cos(g*.26)*window.innerHeight*.1),u.x+=(d.x-u.x)*Math.min(1,w*6),u.y+=(d.y-u.y)*Math.min(1,w*6),f.style.transform=`translate3d(${u.x}px, ${u.y}px, 0)`};return m=requestAnimationFrame(S),()=>{cancelAnimationFrame(m),window.removeEventListener("pointermove",x)}},[s]),A.jsxs("div",{className:"fixed inset-0 z-0 overflow-hidden","aria-hidden":"true",children:[A.jsx("canvas",{ref:i,className:"block h-full w-full"}),s&&A.jsx("div",{className:"absolute left-1/2 top-1/2 h-[46vmin] w-[46vmin] -translate-x-1/2 -translate-y-1/2",children:A.jsx("div",{ref:l,className:"h-full w-full rounded-full will-change-transform",style:{background:"radial-gradient(circle at 34% 28%, #ffffff 0%, #dcd8cf 16%, #6e6a61 44%, #12110f 63%, #ff4d19 78%, #e2ded4 100%)",boxShadow:"0 40px 90px rgba(18,17,15,0.25)"}})})]})}const TE=` attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos, 0.0, 1.0); } `,jg=` #ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif `,EE=` ${jg} uniform sampler2D u_prev; uniform vec2 u_res; uniform float u_aspect; uniform float u_time; uniform float u_dt; uniform vec2 u_p0; uniform vec2 u_p1; uniform vec2 u_pvel; uniform float u_press; uniform float u_emit; float hash(vec2 p){ p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); } float vnoise(vec2 p){ vec2 i = floor(p); vec2 f = fract(p); vec2 u = f * f * (3.0 - 2.0 * f); float a = hash(i); float b = hash(i + vec2(1.0, 0.0)); float c = hash(i + vec2(0.0, 1.0)); float d = hash(i + vec2(1.0, 1.0)); return mix(mix(a, b, u.x), mix(c, d, u.x), u.y); } float fbm(vec2 p){ float s = 0.0; float a = 0.5; for (int i = 0; i < 4; i++){ s +=a * vnoise(p); p=p * 2.03 + vec2(1.7, 9.2); a *=0.5; } return s; } float segDist(vec2 p, vec2 a, vec2 b){ vec2 pa=p - a; vec2 ba=b - a; float h=clamp(dot(pa, ba) / max(dot(ba, ba), 1e-6), 0.0, 1.0); return length(pa - ba * h); } void main(){ vec2 uv=gl_FragCoord.xy / u_res; vec2 sp=vec2(uv.x * u_aspect, uv.y); float dens0=texture2D(u_prev, uv).r; // --- velocity field ------------------------------------------------- float e=0.012; vec2 q=sp * 2.35 + vec2(0.0, -u_time * 0.06); float n0=fbm(q); float nx=fbm(q + vec2(e, 0.0)); float ny=fbm(q + vec2(0.0, e)); vec2 curl=vec2(ny - n0, -(nx - n0)) / e; vec2 vel=curl * 0.030; // warm smoke rises, and rises harder where it is thick vel.y +=0.10 * smoothstep(0.02, 0.65, dens0); // your hand drags the medium with it float dseg=segDist(sp, u_p0, u_p1); float drag=exp(-dseg * dseg / 0.020); vel +=u_pvel * drag * 0.90; // --- advect --------------------------------------------------------- vec2 back=uv - vec2(vel.x / u_aspect, vel.y) * u_dt; vec4 s=texture2D(u_prev, back); float d=s.r; float heat=s.g; // --- dissipate ------------------------------------------------------ d *=exp(-u_dt * 0.62); heat *=exp(-u_dt * 2.30); // --- inject along the pointer stroke -------------------------------- float r=0.048 + 0.030 * u_press; float g=exp(-dseg * dseg / (r * r)); d +=g * u_emit * u_dt * 2.6; heat +=g * g * u_emit * u_dt * 3.4; // keep the borders from silting up vec2 edge=smoothstep(vec2(0.0), vec2(0.045), uv) * smoothstep(vec2(0.0), vec2(0.045), 1.0 - uv); d *=edge.x * edge.y; // dither so 8-bit transport dissolves instead of banding float dth=(hash(gl_FragCoord.xy + fract(u_time) * 17.3) - 0.5) / 255.0; gl_FragColor=vec4(clamp(d + dth, 0.0, 1.0), clamp(heat, 0.0, 1.0), 0.0, 1.0); } `,AE=` ${jg} uniform sampler2D u_sim; uniform vec2 u_res; uniform vec2 u_texel; uniform vec2 u_ptr; uniform float u_aspect; void main(){ vec2 uv=gl_FragCoord.xy / u_res; vec2 sp=vec2(uv.x * u_aspect, uv.y); vec4 c=texture2D(u_sim, uv); float d=c.r; float h=c.g; // light the density like a volume, using its own gradient as a normal float dl=texture2D(u_sim, uv - vec2(u_texel.x, 0.0)).r; float dr=texture2D(u_sim, uv + vec2(u_texel.x, 0.0)).r; float db=texture2D(u_sim, uv - vec2(0.0, u_texel.y)).r; float du=texture2D(u_sim, uv + vec2(0.0, u_texel.y)).r; vec3 n=normalize(vec3(dl - dr, db - du, 0.085)); float lit=clamp(dot(n, normalize(vec3(-0.50, 0.66, 0.56))) * 0.5 + 0.5, 0.0, 1.0); // the room: near-black, one cold window high left, one ember pool at the hand vec3 bg=vec3(0.042, 0.042, 0.049); bg +=vec3(0.052, 0.058, 0.072) * smoothstep(1.35, 0.0, length(sp - vec2(0.18, 1.05))); bg +=vec3(0.085, 0.030, 0.008) * smoothstep(0.95, 0.0, length(sp - u_ptr)); bg *=1.0 - 0.30 * smoothstep(0.35, 1.25, length((uv - 0.5) * vec2(1.25, 1.0))); vec3 smokeCol=mix(vec3(0.105, 0.102, 0.108), vec3(0.870, 0.845, 0.805), lit); smokeCol=mix(smokeCol, vec3(1.0, 0.45, 0.16), clamp(h * 1.7, 0.0, 1.0)); // only the densest core goes fully opaque, so type stays readable through it float a=smoothstep(0.02, 0.88, d); vec3 col=mix(bg, smokeCol, a * 0.93); col +=vec3(1.0, 0.36, 0.12) * h * 0.55; float grain=fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453); col +=(grain - 0.5) * 0.020; gl_FragColor=vec4(col, 1.0); } `;function wE(){const i=Y.useRef(null),l=Y.useRef(null),[s,o]=Y.useState(!1);return Y.useEffect(()=>{const f=i.current;if(!f)return;let d=null;try{d=f.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance"})}catch{d=null}if(!d){o(!0);return}const u=d,m=(P,et)=>{const nt=u.createShader(P);return nt?(u.shaderSource(nt,et),u.compileShader(nt),u.getShaderParameter(nt,u.COMPILE_STATUS)?nt:(console.warn("smoke shader:",u.getShaderInfoLog(nt)),u.deleteShader(nt),null)):null},v=P=>{const et=m(u.VERTEX_SHADER,TE),nt=m(u.FRAGMENT_SHADER,P);if(!et||!nt)return null;const $=u.createProgram();return $?(u.attachShader($,et),u.attachShader($,nt),u.bindAttribLocation($,0,"a_pos"),u.linkProgram($),u.deleteShader(et),u.deleteShader(nt),u.getProgramParameter($,u.LINK_STATUS)?$:(console.warn("smoke link:",u.getProgramInfoLog($)),null)):null},p=v(EE),g=v(AE);if(!p||!g){o(!0);return}const x=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,x),u.bufferData(u.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),u.STATIC_DRAW),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,2,u.FLOAT,!1,0,0);const S={simPrev:u.getUniformLocation(p,"u_prev"),simRes:u.getUniformLocation(p,"u_res"),simAspect:u.getUniformLocation(p,"u_aspect"),simTime:u.getUniformLocation(p,"u_time"),simDt:u.getUniformLocation(p,"u_dt"),simP0:u.getUniformLocation(p,"u_p0"),simP1:u.getUniformLocation(p,"u_p1"),simPvel:u.getUniformLocation(p,"u_pvel"),simPress:u.getUniformLocation(p,"u_press"),simEmit:u.getUniformLocation(p,"u_emit"),showSim:u.getUniformLocation(g,"u_sim"),showRes:u.getUniformLocation(g,"u_res"),showTexel:u.getUniformLocation(g,"u_texel"),showPtr:u.getUniformLocation(g,"u_ptr"),showAspect:u.getUniformLocation(g,"u_aspect")};let b=1,w=1,D=[];const _=(P,et)=>{const nt=u.createTexture(),$=u.createFramebuffer();return!nt||!$?null:(u.bindTexture(u.TEXTURE_2D,nt),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,P,et,0,u.RGBA,u.UNSIGNED_BYTE,null),u.bindFramebuffer(u.FRAMEBUFFER,$),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,nt,0),u.checkFramebufferStatus(u.FRAMEBUFFER)!==u.FRAMEBUFFER_COMPLETE?(u.deleteTexture(nt),u.deleteFramebuffer($),null):(u.clearColor(0,0,0,1),u.clear(u.COLOR_BUFFER_BIT),u.bindFramebuffer(u.FRAMEBUFFER,null),{tex:nt,fb:$}))},G=()=>{D.forEach(P=>{u.deleteTexture(P.tex),u.deleteFramebuffer(P.fb)}),D=[]},F=()=>{const P=Math.min(window.devicePixelRatio||1,2),et=Math.max(1,Math.round(window.innerWidth*P)),nt=Math.max(1,Math.round(window.innerHeight*P));(f.width!==et||f.height!==nt)&&(f.width=et,f.height=nt);let $=Math.round(window.innerWidth*.5),pt=Math.round(window.innerHeight*.5);const wt=42e4,xe=$*pt;if(xe>wt){const Rt=Math.sqrt(wt/xe);$=Math.round($*Rt),pt=Math.round(pt*Rt)}if($=Math.max(64,$),pt=Math.max(64,pt),$===b&&pt===w&&D.length===2)return;b=$,w=pt,G();const sn=_($,pt),Gt=_($,pt);if(!sn||!Gt){o(!0);return}D=[sn,Gt]};if(F(),D.length!==2){o(!0);return}let B=window.innerWidth/window.innerHeight,H=.5*B,Q=.5,I=H,O=Q,U=0,W=0,tt=0,it=0,dt=!1,st=0;const ct=P=>{dt=!0,B=window.innerWidth/window.innerHeight,H=P.clientX/window.innerWidth*B,Q=1-P.clientY/window.innerHeight},ut=()=>{it=1},C=()=>{it=0};window.addEventListener("pointermove",ct,{passive:!0}),window.addEventListener("pointerdown",ut,{passive:!0}),window.addEventListener("pointerup",C,{passive:!0}),window.addEventListener("pointercancel",C,{passive:!0}),window.addEventListener("resize",F);const Z=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let J=0,rt=0,ht=performance.now(),E=0;const j=P=>{rt=requestAnimationFrame(j);let et=(P-ht)/1e3;if(ht=P,document.hidden||D.length!==2)return;et=Math.min(Math.max(et,1/240),1/30),E+=Z?et*.25:et,dt||(B=window.innerWidth/window.innerHeight,H=(.5+.2*Math.sin(E*.42))*B,Q=.42+.16*Math.sin(E*.31+1.1)),U=(H-I)/et,W=(Q-O)/et;const nt=Math.hypot(U,W),$=2.4;nt>$&&(U=U/nt*$,W=W/nt*$),tt+=(it-tt)*Math.min(1,et*8);const pt=dt?Math.min(1,.32+nt*.65+tt*.5):.34;st+=(pt-st)*Math.min(1,et*9);const wt=D[J],xe=D[1-J];u.useProgram(p),u.bindFramebuffer(u.FRAMEBUFFER,xe.fb),u.viewport(0,0,b,w),u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,wt.tex),u.uniform1i(S.simPrev,0),u.uniform2f(S.simRes,b,w),u.uniform1f(S.simAspect,B),u.uniform1f(S.simTime,E),u.uniform1f(S.simDt,et),u.uniform2f(S.simP0,I,O),u.uniform2f(S.simP1,H,Q),u.uniform2f(S.simPvel,U,W),u.uniform1f(S.simPress,tt),u.uniform1f(S.simEmit,st),u.drawArrays(u.TRIANGLES,0,3),u.useProgram(g),u.bindFramebuffer(u.FRAMEBUFFER,null),u.viewport(0,0,f.width,f.height),u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,xe.tex),u.uniform1i(S.showSim,0),u.uniform2f(S.showRes,f.width,f.height),u.uniform2f(S.showTexel,1/b,1/w),u.uniform2f(S.showPtr,H,Q),u.uniform1f(S.showAspect,B),u.drawArrays(u.TRIANGLES,0,3),J=1-J,I=H,O=Q};rt=requestAnimationFrame(j);const K=P=>{P.preventDefault(),cancelAnimationFrame(rt),o(!0)};return f.addEventListener("webglcontextlost",K),()=>{cancelAnimationFrame(rt),window.removeEventListener("pointermove",ct),window.removeEventListener("pointerdown",ut),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C),window.removeEventListener("resize",F),f.removeEventListener("webglcontextlost",K),G(),u.deleteProgram(p),u.deleteProgram(g),u.deleteBuffer(x)}},[]),Y.useEffect(()=>{if(!s)return;const f=l.current;if(!f)return;let d=0,u=performance.now(),m=0,v=window.innerWidth/2,p=window.innerHeight/2,g=v,x=p,S=!1;const b=D=>{S=!0,v=D.clientX,p=D.clientY};window.addEventListener("pointermove",b,{passive:!0});const w=D=>{d=requestAnimationFrame(w);const _=Math.min((D-u)/1e3,1/30);u=D,m+=_,S||(v=window.innerWidth*(.5+.2*Math.sin(m*.42)),p=window.innerHeight*(.55+.16*Math.sin(m*.31+1.1))),g+=(v-g)*Math.min(1,_*2.4),x+=(p-x)*Math.min(1,_*2.4),f.style.transform=`translate3d(${g-260}px, ${x-260}px, 0)`};return d=requestAnimationFrame(w),()=>{cancelAnimationFrame(d),window.removeEventListener("pointermove",b)}},[s]),A.jsxs("div",{className:"fixed inset-0 z-0 overflow-hidden bg-[#0a0a0c]","aria-hidden":"true",children:[A.jsx("canvas",{ref:i,className:"block h-full w-full"}),s&&A.jsx("div",{ref:l,className:"absolute left-0 top-0 h-[520px] w-[520px] rounded-full blur-3xl will-change-transform",style:{background:"radial-gradient(circle, rgba(240,236,228,0.40) 0%, rgba(150,145,138,0.22) 34%, rgba(255,90,31,0.10) 58%, rgba(10,10,12,0) 72%)"}})]})}const Vg=` attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos, 0.0, 1.0); } `,Vn=` #ifdef GL_FRAGMENT_PRECISION_HIGH precision highp float; #else precision mediump float; #endif `;function qr(i,l){let s=null;try{s=i.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch{s=null}if(!s)return null;const o=s,f=(w,D)=>{const _=o.createShader(w);return _?(o.shaderSource(_,D),o.compileShader(_),o.getShaderParameter(_,o.COMPILE_STATUS)?_:(console.warn("shader:",o.getShaderInfoLog(_)),o.deleteShader(_),null)):null},d=f(o.VERTEX_SHADER,Vg),u=f(o.FRAGMENT_SHADER,l);if(!d||!u)return null;const m=o.createProgram();if(!m)return null;if(o.attachShader(m,d),o.attachShader(m,u),o.bindAttribLocation(m,0,"a_pos"),o.linkProgram(m),o.deleteShader(d),o.deleteShader(u),!o.getProgramParameter(m,o.LINK_STATUS))return console.warn("link:",o.getProgramInfoLog(m)),null;o.useProgram(m);const v=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,v),o.bufferData(o.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,0,0);const p=new Map;return{gl:o,program:m,u:w=>(p.has(w)||p.set(w,o.getUniformLocation(m,w)),p.get(w)??null),resize:(w=24e5,D=1)=>{const G=Math.min(window.devicePixelRatio||1,2)*D;let F=Math.max(1,Math.round(window.innerWidth*G)),B=Math.max(1,Math.round(window.innerHeight*G));const H=F*B;if(H>w){const Q=Math.sqrt(w/H);F=Math.max(1,Math.round(F*Q)),B=Math.max(1,Math.round(B*Q))}(i.width!==F||i.height!==B)&&(i.width=F,i.height=B),o.viewport(0,0,i.width,i.height)},draw:()=>o.drawArrays(o.TRIANGLES,0,3),dispose:()=>{o.deleteProgram(m),o.deleteBuffer(v)}}}function Yl(){const i={x:.5,y:.5,prevX:.5,prevY:.5,vx:0,vy:0,press:0,speed:0,has:!1,aspect:1};let l=0;const s=m=>{i.has=!0,i.aspect=window.innerWidth/window.innerHeight,i.x=m.clientX/window.innerWidth*i.aspect,i.y=1-m.clientY/window.innerHeight},o=()=>{l=1},f=()=>{l=0};return window.addEventListener("pointermove",s,{passive:!0}),window.addEventListener("pointerdown",o,{passive:!0}),window.addEventListener("pointerup",f,{passive:!0}),window.addEventListener("pointercancel",f,{passive:!0}),{state:i,integrate:m=>{i.vx=(i.x-i.prevX)/m,i.vy=(i.y-i.prevY)/m,i.speed=Math.hypot(i.vx,i.vy);const v=2.4;i.speed>v&&(i.vx=i.vx/i.speed*v,i.vy=i.vy/i.speed*v),i.press+=(l-i.press)*Math.min(1,m*8),i.prevX=i.x,i.prevY=i.y},dispose:()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerdown",o),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f)}}}const Ma=16,ME=` ${Vn} uniform vec2 u_res; uniform float u_aspect; uniform float u_time; uniform vec2 u_ptr; uniform float u_press; uniform vec4 u_drops[${Ma}]; // xy = origin, z = age, w = strength // one expanding, decaying wave packet float packet(vec2 p, vec4 d){ if (d.z < 0.0 || d.z> 7.0) return 0.0; float dist = length(p - d.xy); float front = 0.58 * d.z; float ring = exp(-11.0 * (dist - front) * (dist - front)); float decay = exp(-0.80 * d.z) / (0.40 + 2.0 * dist); return d.w * ring * decay * sin(34.0 * (dist - front)); } float height(vec2 p){ float h = 0.0; for (int i = 0; i < ${Ma}; i++) h +=packet(p, u_drops[i]); // the swell that never stops h +=0.020 * sin(p.x * 5.1 + u_time * 0.85); h +=0.016 * sin(p.y * 6.4 - u_time * 0.63); h +=0.010 * sin((p.x + p.y) * 9.2 + u_time * 1.25); // the bulge the finger itself pushes into the surface float dp=length(p - u_ptr); h -=(0.055 + 0.075 * u_press) * exp(-dp * dp / 0.010); return h; } // tiled pool floor, seen through the water vec3 floorCol(vec2 p){ vec2 g=abs(fract(p * 3.4) - 0.5); float line=smoothstep(0.46, 0.50, max(g.x, g.y)); vec3 tile=mix(vec3(0.028, 0.098, 0.115), vec3(0.020, 0.074, 0.090), line); tile *=1.0 - 0.35 * smoothstep(0.2, 1.4, length(p - vec2(u_aspect * 0.5, 0.5))); return tile; } void main(){ vec2 uv=gl_FragCoord.xy / u_res; vec2 p=vec2(uv.x * u_aspect, uv.y); float e=1.6 / u_res.y; float h=height(p); float hx=height(p + vec2(e, 0.0)); float hy=height(p + vec2(0.0, e)); vec3 n=normalize(vec3(-(hx - h) / e, -(hy - h) / e, 6.0)); // refracted floor vec3 col=floorCol(p + n.xy * 0.085); // caustics: light focused by the curvature of the surface float curv=abs(hx + hy - 2.0 * h) / (e * e); col +=vec3(0.24, 0.92, 0.82) * smoothstep(0.35, 3.2, curv) * 0.16; // deep water absorbs, fresnel lifts the grazing angles vec3 viewDir=normalize(vec3(p - vec2(u_aspect * 0.5, 0.42), 1.25)); float fres=pow(1.0 - max(dot(n, vec3(0.0, 0.0, 1.0)), 0.0), 2.2); col=mix(col, vec3(0.035, 0.175, 0.205), 0.34); col=mix(col, vec3(0.055, 0.320, 0.330), clamp(fres * 1.5, 0.0, 1.0)); // specular glint of a single cold window vec3 L=normalize(vec3(-0.45, 0.72, 0.62)); vec3 H=normalize(L - viewDir); float spec=pow(max(dot(n, H), 0.0), 120.0); col +=vec3(0.78, 1.0, 0.98) * spec * 0.85; // the accent lives in the crests col +=vec3(0.20, 0.88, 0.78) * smoothstep(0.02, 0.10, h) * 0.30; // a glow under the hand col +=vec3(0.12, 0.62, 0.58) * exp(-length(p - u_ptr) * 3.2) * (0.10 + 0.22 * u_press); col *=1.0 - 0.30 * smoothstep(0.35, 1.25, length((uv - 0.5) * vec2(1.3, 1.0))); float grain=fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453); col +=(grain - 0.5) * 0.018; gl_FragColor=vec4(col, 1.0); } `;function _E(){const i=Y.useRef(null),l=Y.useRef(null),[s,o]=Y.useState(!1);return Y.useEffect(()=>{const f=i.current;if(!f)return;const d=qr(f,ME);if(!d){o(!0);return}const{gl:u,u:m,resize:v,draw:p,dispose:g}=d,x=()=>v(17e5,1);x(),window.addEventListener("resize",x);const S=Yl(),b=S.state;b.aspect=window.innerWidth/window.innerHeight,b.x=.5*b.aspect,b.y=.5,b.prevX=b.x,b.prevY=b.y;const w=new Float32Array(Ma*4);for(let tt=0;tt{const st=D*4;w[st]=tt,w[st+1]=it,w[st+2]=0,w[st+3]=dt,D=(D+1)%Ma},H=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let Q=0,I=performance.now(),O=0;const U=tt=>{Q=requestAnimationFrame(U);let it=(tt-I)/1e3;if(I=tt,document.hidden)return;it=Math.min(Math.max(it,1/240),1/30),O+=H?it*.3:it,b.has||(b.aspect=window.innerWidth/window.innerHeight,b.x=(.5+.22*Math.sin(O*.37))*b.aspect,b.y=.5+.18*Math.sin(O*.29+.8)),S.integrate(it);for(let st=0;st.055||_>.42&&b.press>.35||_>1.1)&&(B(b.x,b.y,Math.min(.85,.24+b.speed*.22+b.press*.45)),G=b.x,F=b.y,_=0),u.uniform2f(m("u_res"),f.width,f.height),u.uniform1f(m("u_aspect"),b.aspect),u.uniform1f(m("u_time"),O),u.uniform2f(m("u_ptr"),b.x,b.y),u.uniform1f(m("u_press"),b.press),u.uniform4fv(m("u_drops"),w),p()};Q=requestAnimationFrame(U);const W=tt=>{tt.preventDefault(),cancelAnimationFrame(Q),o(!0)};return f.addEventListener("webglcontextlost",W),()=>{cancelAnimationFrame(Q),window.removeEventListener("resize",x),f.removeEventListener("webglcontextlost",W),S.dispose(),g()}},[]),Y.useEffect(()=>{if(!s)return;const f=l.current;if(!f)return;let d=0,u=performance.now(),m=0,v=window.innerWidth/2,p=window.innerHeight/2,g=v,x=p,S=!1;const b=D=>{S=!0,v=D.clientX,p=D.clientY};window.addEventListener("pointermove",b,{passive:!0});const w=D=>{d=requestAnimationFrame(w);const _=Math.min((D-u)/1e3,1/30);u=D,m+=_,S||(v=window.innerWidth*(.5+.2*Math.sin(m*.37)),p=window.innerHeight*(.5+.18*Math.sin(m*.29))),g+=(v-g)*Math.min(1,_*4),x+=(p-x)*Math.min(1,_*4),f.style.transform=`translate3d(${g-300}px, ${x-300}px, 0)`};return d=requestAnimationFrame(w),()=>{cancelAnimationFrame(d),window.removeEventListener("pointermove",b)}},[s]),A.jsxs("div",{className:"fixed inset-0 z-0 overflow-hidden bg-[#04141A]","aria-hidden":"true",children:[A.jsx("canvas",{ref:i,className:"block h-full w-full"}),s&&A.jsx("div",{ref:l,className:"absolute left-0 top-0 h-[600px] w-[600px] rounded-full blur-2xl will-change-transform",style:{background:"repeating-radial-gradient(circle, rgba(53,224,208,0.16) 0 14px, rgba(4,20,26,0) 14px 34px)"}})]})}const iv=11,RE=` ${Vn} uniform vec2 u_res; uniform float u_aspect; uniform float u_time; uniform vec2 u_ptr; uniform float u_press; uniform float u_swirl; float hash(vec2 p){ p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); } float vnoise(vec2 p){ vec2 i = floor(p); vec2 f = fract(p); vec2 w = f * f * (3.0 - 2.0 * f); float a = hash(i); float b = hash(i + vec2(1.0, 0.0)); float c = hash(i + vec2(0.0, 1.0)); float d = hash(i + vec2(1.0, 1.0)); return mix(mix(a, b, w.x), mix(c, d, w.x), w.y); } vec2 poleField(vec2 p, vec2 c, float q){ vec2 d = p - c; float r2 = dot(d, d) + 0.0035; return q * d / (r2 * 1.35); } vec2 field(vec2 p){ vec2 f = vec2(0.0); f += poleField(p, u_ptr, 1.0 + 0.85 * u_press); f += poleField(p, vec2(u_aspect * 0.16, 0.80), -0.55); f += poleField(p, vec2(u_aspect * 0.86, 0.22), -0.50); // a slow rotation around the hand turns the spikes into loops vec2 d = p - u_ptr; f += vec2(-d.y, d.x) / (dot(d, d) + 0.05) * u_swirl * 0.34; // faint drift so the sheet is never completely static f += vec2(sin(p.y * 2.1 + u_time * 0.25), cos(p.x * 1.9 - u_time * 0.21)) * 0.055; return f; } void main(){ vec2 uv = gl_FragCoord.xy / u_res; vec2 p = vec2(uv.x * u_aspect, uv.y); float strength = length(field(p)); // --- line integral convolution ------------------------------------- float h = 0.0055; float sum = 0.0; float wsum = 0.0; vec2 fw = p; vec2 bw = p; for (int i = 0; i < ${iv}; i++){ float w=1.0 - float(i) / float(${iv}); vec2 df=field(fw); fw +=normalize(df + vec2(1e-6)) * h; sum +=vnoise(fw * 240.0) * w; wsum +=w; vec2 db=field(bw); bw -=normalize(db + vec2(1e-6)) * h; sum +=vnoise(bw * 240.0) * w; wsum +=w; } float lic=sum / wsum; // contrast the smear into discrete needles float needles=smoothstep(0.42, 0.62, lic); // filings crowd where the field is strong and vanish where it is dead float density=smoothstep(0.10, 1.30, strength); float ink=needles * (0.20 + 0.80 * density); // paper vec3 paper=vec3(0.929, 0.918, 0.890); paper -=0.045 * vnoise(p * 90.0); paper *=1.0 - 0.14 * smoothstep(0.35, 1.25, length((uv - 0.5) * vec2(1.25, 1.0))); vec3 filings=mix(vec3(0.115, 0.118, 0.140), vec3(0.055, 0.058, 0.075), needles); vec3 col=mix(paper, filings, clamp(ink, 0.0, 1.0)); // the pole itself: electric blue bloom, plus a bright core float dp=length(p - u_ptr); float glow=exp(-dp * 4.6) * (0.35 + 0.55 * u_press); col=mix(col, vec3(0.169, 0.286, 1.0), clamp(glow * 0.75, 0.0, 1.0)); col +=vec3(0.35, 0.45, 1.0) * exp(-dp * 26.0) * 0.9; // the anchored poles read as two soft shadows in the paper col *=1.0 - 0.20 * exp(-length(p - vec2(u_aspect * 0.16, 0.80)) * 7.0); col *=1.0 - 0.20 * exp(-length(p - vec2(u_aspect * 0.86, 0.22)) * 7.0); float grain=fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453); col +=(grain - 0.5) * 0.020; gl_FragColor=vec4(col, 1.0); } `;function DE(){const i=Y.useRef(null),l=Y.useRef(null),[s,o]=Y.useState(!1);return Y.useEffect(()=>{const f=i.current;if(!f)return;const d=qr(f,RE);if(!d){o(!0);return}const{gl:u,u:m,resize:v,draw:p,dispose:g}=d,x=()=>v(13e5,1);x(),window.addEventListener("resize",x);const S=Yl(),b=S.state;b.aspect=window.innerWidth/window.innerHeight,b.x=.5*b.aspect,b.y=.5,b.prevX=b.x,b.prevY=b.y;let w=b.x,D=b.y,_=0;const G=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let F=0,B=performance.now(),H=0;const Q=O=>{F=requestAnimationFrame(Q);let U=(O-B)/1e3;if(B=O,document.hidden)return;U=Math.min(Math.max(U,1/240),1/30),H+=G?U*.3:U,b.has||(b.aspect=window.innerWidth/window.innerHeight,b.x=(.5+.24*Math.sin(H*.31))*b.aspect,b.y=.5+.2*Math.cos(H*.24)),S.integrate(U);const W=Math.min(1,U*7);w+=(b.x-w)*W,D+=(b.y-D)*W;const tt=Math.min(1,b.speed*.55+b.press*.8);_+=(tt-_)*Math.min(1,U*2.2),u.uniform2f(m("u_res"),f.width,f.height),u.uniform1f(m("u_aspect"),b.aspect),u.uniform1f(m("u_time"),H),u.uniform2f(m("u_ptr"),w,D),u.uniform1f(m("u_press"),b.press),u.uniform1f(m("u_swirl"),_),p()};F=requestAnimationFrame(Q);const I=O=>{O.preventDefault(),cancelAnimationFrame(F),o(!0)};return f.addEventListener("webglcontextlost",I),()=>{cancelAnimationFrame(F),window.removeEventListener("resize",x),f.removeEventListener("webglcontextlost",I),S.dispose(),g()}},[]),Y.useEffect(()=>{if(!s)return;const f=l.current;if(!f)return;let d=0,u=performance.now(),m=0,v=window.innerWidth/2,p=window.innerHeight/2,g=v,x=p,S=!1;const b=D=>{S=!0,v=D.clientX,p=D.clientY};window.addEventListener("pointermove",b,{passive:!0});const w=D=>{d=requestAnimationFrame(w);const _=Math.min((D-u)/1e3,1/30);u=D,m+=_,S||(v=window.innerWidth*(.5+.22*Math.sin(m*.31)),p=window.innerHeight*(.5+.2*Math.cos(m*.24))),g+=(v-g)*Math.min(1,_*6),x+=(p-x)*Math.min(1,_*6),f.style.transform=`translate3d(${g-320}px, ${x-320}px, 0)`};return d=requestAnimationFrame(w),()=>{cancelAnimationFrame(d),window.removeEventListener("pointermove",b)}},[s]),A.jsxs("div",{className:"fixed inset-0 z-0 overflow-hidden bg-[#EDEAE3]","aria-hidden":"true",children:[A.jsx("canvas",{ref:i,className:"block h-full w-full"}),s&&A.jsx("div",{ref:l,className:"absolute left-0 top-0 h-[640px] w-[640px] rounded-full will-change-transform",style:{background:"repeating-conic-gradient(from 0deg, rgba(18,17,20,0.28) 0deg 0.7deg, rgba(237,234,227,0) 0.7deg 3deg)",maskImage:"radial-gradient(circle, #000 0%, transparent 68%)",WebkitMaskImage:"radial-gradient(circle, #000 0%, transparent 68%)"}})]})}const CE=` ${Vn} uniform sampler2D u_prev; uniform vec2 u_res; uniform float u_aspect; uniform float u_time; uniform float u_dt; uniform vec2 u_p0; uniform vec2 u_p1; uniform vec2 u_pvel; uniform float u_press; float hash(vec2 p){ p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); } float vnoise(vec2 p){ vec2 i = floor(p); vec2 f = fract(p); vec2 w = f * f * (3.0 - 2.0 * f); float a = hash(i); float b = hash(i + vec2(1.0, 0.0)); float c = hash(i + vec2(0.0, 1.0)); float d = hash(i + vec2(1.0, 1.0)); return mix(mix(a, b, w.x), mix(c, d, w.x), w.y); } float fbm(vec2 p){ float s = 0.0; float a = 0.5; for (int i = 0; i < 4; i++){ s +=a * vnoise(p); p=p * 2.07 + vec2(3.1, 7.7); a *=0.5; } return s; } float segDist(vec2 p, vec2 a, vec2 b){ vec2 pa=p - a; vec2 ba=b - a; float h=clamp(dot(pa, ba) / max(dot(ba, ba), 1e-6), 0.0, 1.0); return length(pa - ba * h); } void main(){ vec2 uv=gl_FragCoord.xy / u_res; vec2 sp=vec2(uv.x * u_aspect, uv.y); vec4 prev=texture2D(u_prev, uv); float fuel0=prev.r; float temp0=prev.g; // --- velocity --------------------------------------------------------- float e=0.011; vec2 q=sp * 3.1 + vec2(0.0, -u_time * 0.55); float n0=fbm(q); vec2 curl=vec2(fbm(q + vec2(0.0, e)) - n0, -(fbm(q + vec2(e, 0.0)) - n0)) / e; vec2 vel=curl * 0.026 * (0.45 + temp0); // buoyancy: this is what makes it a flame and not a cloud vel.y +=(0.34 * temp0 + 0.09 * fuel0) * 1.35; // flames pinch inward as they rise vel.x +=-(sp.x - u_p1.x) * temp0 * 0.42; // your hand still drags the gas float dseg=segDist(sp, u_p0, u_p1); vel +=u_pvel * exp(-dseg * dseg / 0.016) * 0.75; // --- advect ----------------------------------------------------------- vec2 back=uv - vec2(vel.x / u_aspect, vel.y) * u_dt; vec4 s=texture2D(u_prev, back); float fuel=s.r; float temp=s.g; // --- burn and cool ---------------------------------------------------- // fuel is consumed where it is hot, and that release keeps the heat alive float burn=fuel * temp * 3.1 * u_dt; fuel -=burn; temp +=burn * 1.45; temp *=exp(-u_dt * 2.05); // radiative cooling fuel *=exp(-u_dt * 0.50); // soot slowly disperses // --- inject at the hand ----------------------------------------------- float r=0.042 + 0.030 * u_press; float g=exp(-dseg * dseg / (r * r)); float flick=0.72 + 0.55 * vnoise(vec2(u_time * 7.0, sp.x * 9.0)); fuel +=g * u_dt * 3.4 * flick * (1.0 + u_press); temp +=g * u_dt * 4.6 * flick * (1.0 + u_press); vec2 edge=smoothstep(vec2(0.0), vec2(0.04), uv) * smoothstep(vec2(0.0), vec2(0.04), 1.0 - uv); fuel *=edge.x * edge.y; temp *=edge.x * edge.y; float dth=(hash(gl_FragCoord.xy + fract(u_time) * 31.7) - 0.5) / 255.0; gl_FragColor=vec4( clamp(fuel + dth, 0.0, 1.0), clamp(temp + dth, 0.0, 1.0), 0.0, 1.0 ); } `,zE=` ${Vn} uniform sampler2D u_sim; uniform vec2 u_res; uniform vec2 u_texel; uniform vec2 u_ptr; uniform float u_aspect; // incandescence: cold soot → red → orange → yellow → white vec3 blackbody(float t){ vec3 c=vec3(0.0); c +=vec3(0.95, 0.16, 0.03) * smoothstep(0.06, 0.34, t); c +=vec3(0.75, 0.38, 0.00) * smoothstep(0.26, 0.58, t); c +=vec3(0.45, 0.45, 0.10) * smoothstep(0.52, 0.86, t); c +=vec3(0.30, 0.34, 0.55) * smoothstep(0.80, 1.00, t); return c; } void main(){ vec2 uv=gl_FragCoord.xy / u_res; vec2 sp=vec2(uv.x * u_aspect, uv.y); vec4 c=texture2D(u_sim, uv); float fuel=c.r; float temp=c.g; // the room, lit only by the flame vec3 bg=vec3(0.043, 0.030, 0.026); bg +=vec3(0.115, 0.045, 0.012) * smoothstep(1.15, 0.0, length(sp - u_ptr)); bg *=1.0 - 0.32 * smoothstep(0.35, 1.25, length((uv - 0.5) * vec2(1.25, 1.0))); // soot reads as a dark, lit body before it ignites float dl=texture2D(u_sim, uv - vec2(u_texel.x, 0.0)).r; float dr=texture2D(u_sim, uv + vec2(u_texel.x, 0.0)).r; float db=texture2D(u_sim, uv - vec2(0.0, u_texel.y)).r; float du=texture2D(u_sim, uv + vec2(0.0, u_texel.y)).r; vec3 n=normalize(vec3(dl - dr, db - du, 0.10)); float lit=clamp(dot(n, normalize(vec3(-0.4, 0.7, 0.6))) * 0.5 + 0.5, 0.0, 1.0); vec3 soot=mix(vec3(0.075, 0.062, 0.058), vec3(0.34, 0.29, 0.27), lit); vec3 col=mix(bg, soot, smoothstep(0.03, 0.75, fuel) * 0.85); // the flame itself is emissive: add, never mix float flame=smoothstep(0.05, 0.95, temp); col +=blackbody(temp) * flame * 1.65; // halo of radiated light around the hottest core col +=vec3(1.0, 0.36, 0.09) * smoothstep(0.30, 1.0, temp) * 0.45; float grain=fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453); col +=(grain - 0.5) * 0.020; gl_FragColor=vec4(col, 1.0); } `;function NE(){const i=Y.useRef(null),l=Y.useRef(null),[s,o]=Y.useState(!1);return Y.useEffect(()=>{const f=i.current;if(!f)return;let d=null;try{d=f.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch{d=null}if(!d){o(!0);return}const u=d,m=(st,ct)=>{const ut=u.createShader(st);return ut?(u.shaderSource(ut,ct),u.compileShader(ut),u.getShaderParameter(ut,u.COMPILE_STATUS)?ut:(console.warn("fire shader:",u.getShaderInfoLog(ut)),u.deleteShader(ut),null)):null},v=st=>{const ct=m(u.VERTEX_SHADER,Vg),ut=m(u.FRAGMENT_SHADER,st);if(!ct||!ut)return null;const C=u.createProgram();return C?(u.attachShader(C,ct),u.attachShader(C,ut),u.bindAttribLocation(C,0,"a_pos"),u.linkProgram(C),u.deleteShader(ct),u.deleteShader(ut),u.getProgramParameter(C,u.LINK_STATUS)?C:(console.warn("fire link:",u.getProgramInfoLog(C)),null)):null},p=v(CE),g=v(zE);if(!p||!g){o(!0);return}const x=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,x),u.bufferData(u.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),u.STATIC_DRAW),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,2,u.FLOAT,!1,0,0);const S=new Map,b=(st,ct,ut)=>{const C=ct+ut;return S.has(C)||S.set(C,u.getUniformLocation(st,ut)),S.get(C)??null};let w=1,D=1,_=[];const G=(st,ct)=>{const ut=u.createTexture(),C=u.createFramebuffer();return!ut||!C?null:(u.bindTexture(u.TEXTURE_2D,ut),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,st,ct,0,u.RGBA,u.UNSIGNED_BYTE,null),u.bindFramebuffer(u.FRAMEBUFFER,C),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,ut,0),u.checkFramebufferStatus(u.FRAMEBUFFER)!==u.FRAMEBUFFER_COMPLETE?(u.deleteTexture(ut),u.deleteFramebuffer(C),null):(u.clearColor(0,0,0,1),u.clear(u.COLOR_BUFFER_BIT),u.bindFramebuffer(u.FRAMEBUFFER,null),{tex:ut,fb:C}))},F=()=>{_.forEach(st=>{u.deleteTexture(st.tex),u.deleteFramebuffer(st.fb)}),_=[]},B=()=>{const st=Math.min(window.devicePixelRatio||1,2),ct=Math.max(1,Math.round(window.innerWidth*st)),ut=Math.max(1,Math.round(window.innerHeight*st));(f.width!==ct||f.height!==ut)&&(f.width=ct,f.height=ut);let C=Math.round(window.innerWidth*.5),Z=Math.round(window.innerHeight*.5);const J=42e4,rt=C*Z;if(rt>J){const j=Math.sqrt(J/rt);C=Math.round(C*j),Z=Math.round(Z*j)}if(C=Math.max(64,C),Z=Math.max(64,Z),C===w&&Z===D&&_.length===2)return;w=C,D=Z,F();const ht=G(C,Z),E=G(C,Z);if(!ht||!E){o(!0);return}_=[ht,E]};if(B(),_.length!==2){o(!0);return}window.addEventListener("resize",B);const H=Yl(),Q=H.state;Q.aspect=window.innerWidth/window.innerHeight,Q.x=.5*Q.aspect,Q.y=.35,Q.prevX=Q.x,Q.prevY=Q.y;const I=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let O=0,U=0,W=performance.now(),tt=0;const it=st=>{U=requestAnimationFrame(it);let ct=(st-W)/1e3;if(W=st,document.hidden||_.length!==2)return;ct=Math.min(Math.max(ct,1/240),1/30),tt+=I?ct*.3:ct;const ut=Q.prevX,C=Q.prevY;Q.has||(Q.aspect=window.innerWidth/window.innerHeight,Q.x=(.5+.16*Math.sin(tt*.5))*Q.aspect,Q.y=.3+.05*Math.sin(tt*.8)),H.integrate(ct);const Z=_[O],J=_[1-O];u.useProgram(p),u.bindFramebuffer(u.FRAMEBUFFER,J.fb),u.viewport(0,0,w,D),u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,Z.tex),u.uniform1i(b(p,"s","u_prev"),0),u.uniform2f(b(p,"s","u_res"),w,D),u.uniform1f(b(p,"s","u_aspect"),Q.aspect),u.uniform1f(b(p,"s","u_time"),tt),u.uniform1f(b(p,"s","u_dt"),ct),u.uniform2f(b(p,"s","u_p0"),ut,C),u.uniform2f(b(p,"s","u_p1"),Q.x,Q.y),u.uniform2f(b(p,"s","u_pvel"),Q.vx,Q.vy),u.uniform1f(b(p,"s","u_press"),Q.press),u.drawArrays(u.TRIANGLES,0,3),u.useProgram(g),u.bindFramebuffer(u.FRAMEBUFFER,null),u.viewport(0,0,f.width,f.height),u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,J.tex),u.uniform1i(b(g,"d","u_sim"),0),u.uniform2f(b(g,"d","u_res"),f.width,f.height),u.uniform2f(b(g,"d","u_texel"),1/w,1/D),u.uniform2f(b(g,"d","u_ptr"),Q.x,Q.y),u.uniform1f(b(g,"d","u_aspect"),Q.aspect),u.drawArrays(u.TRIANGLES,0,3),O=1-O};U=requestAnimationFrame(it);const dt=st=>{st.preventDefault(),cancelAnimationFrame(U),o(!0)};return f.addEventListener("webglcontextlost",dt),()=>{cancelAnimationFrame(U),window.removeEventListener("resize",B),f.removeEventListener("webglcontextlost",dt),H.dispose(),F(),u.deleteProgram(p),u.deleteProgram(g),u.deleteBuffer(x)}},[]),Y.useEffect(()=>{if(!s)return;const f=l.current;if(!f)return;let d=0,u=performance.now(),m=0,v=window.innerWidth/2,p=window.innerHeight*.65,g=v,x=p,S=!1;const b=D=>{S=!0,v=D.clientX,p=D.clientY};window.addEventListener("pointermove",b,{passive:!0});const w=D=>{d=requestAnimationFrame(w);const _=Math.min((D-u)/1e3,1/30);u=D,m+=_,S||(v=window.innerWidth*(.5+.12*Math.sin(m*.5))),g+=(v-g)*Math.min(1,_*5),x+=(p-x)*Math.min(1,_*5),f.style.transform=`translate3d(${g-200}px, ${x-330}px, 0) scaleY(${1+.06*Math.sin(m*9)})`};return d=requestAnimationFrame(w),()=>{cancelAnimationFrame(d),window.removeEventListener("pointermove",b)}},[s]),A.jsxs("div",{className:"fixed inset-0 z-0 overflow-hidden bg-[#0B0705]","aria-hidden":"true",children:[A.jsx("canvas",{ref:i,className:"block h-full w-full"}),s&&A.jsx("div",{ref:l,className:"absolute left-0 top-0 h-[400px] w-[400px] rounded-full blur-2xl will-change-transform",style:{background:"radial-gradient(circle at 50% 75%, rgba(255,240,190,0.85) 0%, rgba(255,140,20,0.55) 26%, rgba(200,40,10,0.30) 48%, rgba(11,7,5,0) 70%)"}})]})}const fn=1100,OE=` attribute vec2 a_pos; // css pixels, y down attribute vec3 a_attr; // life 0..1, size px, heat 0..1 uniform vec2 u_res; varying float v_life; varying float v_heat; void main(){ vec2 clip = (a_pos / u_res) * 2.0 - 1.0; gl_Position = vec4(clip.x, -clip.y, 0.0, 1.0); gl_PointSize = a_attr.y; v_life = a_attr.x; v_heat = a_attr.z; } `,LE=` ${Vn} varying float v_life; varying float v_heat; void main(){ vec2 d = gl_PointCoord - 0.5; float r = length(d); if (r > 0.5) discard; // soft core, hard centre float a = smoothstep(0.5, 0.0, r); a = a * a; vec3 hot = vec3(1.00, 0.93, 0.72); vec3 warm = vec3(1.00, 0.52, 0.12); vec3 dim = vec3(0.72, 0.13, 0.03); vec3 col = mix(dim, warm, smoothstep(0.0, 0.55, v_heat)); col = mix(col, hot, smoothstep(0.62, 1.0, v_heat)); gl_FragColor = vec4(col * a * v_life, a * v_life); } `,av=` attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos, 0.0, 1.0); } `,UE=` ${Vn} uniform float u_fade; void main(){ gl_FragColor = vec4(0.0, 0.0, 0.0, u_fade); } `,jE=` ${Vn} uniform sampler2D u_tex; uniform vec2 u_res; uniform vec2 u_ptr; // css pixels, y down uniform float u_press; void main(){ vec2 uv = gl_FragCoord.xy / u_res; vec3 trail = texture2D(u_tex, uv).rgb; // the dark room the sparks fall through vec3 bg = vec3(0.028, 0.026, 0.034); vec2 p = gl_FragCoord.xy; vec2 ptr = vec2(u_ptr.x, u_res.y - u_ptr.y); float d = length(p - ptr) / u_res.y; bg += vec3(0.115, 0.050, 0.014) * exp(-d * 3.4) * (0.55 + 0.55 * u_press); bg *= 1.0 - 0.30 * smoothstep(0.35, 1.25, length((uv - 0.5) * vec2(1.25, 1.0))); // cheap bloom: the accumulation buffer is already blurry at its own scale vec3 col = bg + trail * 1.28 + trail * trail * 0.55; float grain = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453); col += (grain - 0.5) * 0.020; gl_FragColor = vec4(col, 1.0); } `;function VE(){const i=Y.useRef(null),l=Y.useRef(null),[s,o]=Y.useState(!1);return Y.useEffect(()=>{const f=i.current;if(!f)return;let d=null;try{d=f.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,stencil:!1,powerPreference:"high-performance"})}catch{d=null}if(!d){o(!0);return}const u=d,m=(Gt,Rt)=>{const Yt=u.createShader(Gt);return Yt?(u.shaderSource(Yt,Rt),u.compileShader(Yt),u.getShaderParameter(Yt,u.COMPILE_STATUS)?Yt:(console.warn("ember shader:",u.getShaderInfoLog(Yt)),u.deleteShader(Yt),null)):null},v=(Gt,Rt,Yt)=>{const Pt=m(u.VERTEX_SHADER,Gt),Jt=m(u.FRAGMENT_SHADER,Rt);if(!Pt||!Jt)return null;const Bt=u.createProgram();return Bt?(u.attachShader(Bt,Pt),u.attachShader(Bt,Jt),Yt.forEach((He,me)=>u.bindAttribLocation(Bt,me,He)),u.linkProgram(Bt),u.deleteShader(Pt),u.deleteShader(Jt),u.getProgramParameter(Bt,u.LINK_STATUS)?Bt:(console.warn("ember link:",u.getProgramInfoLog(Bt)),null)):null},p=v(OE,LE,["a_pos","a_attr"]),g=v(av,UE,["a_pos"]),x=v(av,jE,["a_pos"]);if(!p||!g||!x){o(!0);return}const S=u.createBuffer();u.bindBuffer(u.ARRAY_BUFFER,S),u.bufferData(u.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),u.STATIC_DRAW);const b=5,w=new Float32Array(fn*b),D=u.createBuffer(),_=new Float32Array(fn),G=new Float32Array(fn),F=new Float32Array(fn),B=new Float32Array(fn),H=new Float32Array(fn),Q=new Float32Array(fn),I=new Float32Array(fn);let O=0,U=null,W=null,tt=1,it=1;const dt=()=>{U&&u.deleteTexture(U),W&&u.deleteFramebuffer(W),U=null,W=null},st=()=>{const Gt=Math.min(window.devicePixelRatio||1,2),Rt=Math.max(1,Math.round(window.innerWidth*Gt)),Yt=Math.max(1,Math.round(window.innerHeight*Gt));(f.width!==Rt||f.height!==Yt)&&(f.width=Rt,f.height=Yt);let Pt=Math.round(window.innerWidth*.75),Jt=Math.round(window.innerHeight*.75);const Bt=11e5,He=Pt*Jt;if(He>Bt){const me=Math.sqrt(Bt/He);Pt=Math.round(Pt*me),Jt=Math.round(Jt*me)}if(Pt=Math.max(64,Pt),Jt=Math.max(64,Jt),!(Pt===tt&&Jt===it&&W)){if(tt=Pt,it=Jt,dt(),U=u.createTexture(),W=u.createFramebuffer(),!U||!W){o(!0);return}if(u.bindTexture(u.TEXTURE_2D,U),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MIN_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_MAG_FILTER,u.LINEAR),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_S,u.CLAMP_TO_EDGE),u.texParameteri(u.TEXTURE_2D,u.TEXTURE_WRAP_T,u.CLAMP_TO_EDGE),u.texImage2D(u.TEXTURE_2D,0,u.RGBA,tt,it,0,u.RGBA,u.UNSIGNED_BYTE,null),u.bindFramebuffer(u.FRAMEBUFFER,W),u.framebufferTexture2D(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0,u.TEXTURE_2D,U,0),u.checkFramebufferStatus(u.FRAMEBUFFER)!==u.FRAMEBUFFER_COMPLETE){o(!0);return}u.clearColor(0,0,0,1),u.clear(u.COLOR_BUFFER_BIT),u.bindFramebuffer(u.FRAMEBUFFER,null)}};if(st(),!W){o(!0);return}window.addEventListener("resize",st);let ct=window.innerWidth/2,ut=window.innerHeight*.55,C=ct,Z=ut,J=!1,rt=0,ht=0;const E=Gt=>{J=!0,ct=Gt.clientX,ut=Gt.clientY},j=()=>{ht=1},K=()=>{ht=0};window.addEventListener("pointermove",E,{passive:!0}),window.addEventListener("pointerdown",j,{passive:!0}),window.addEventListener("pointerup",K,{passive:!0}),window.addEventListener("pointercancel",K,{passive:!0});const P=(Gt,Rt,Yt,Pt,Jt)=>{const Bt=O;O=(O+1)%fn;const He=Math.random()*Math.PI*2,me=20+Math.random()*130*Jt;_[Bt]=Gt+(Math.random()-.5)*10,G[Bt]=Rt+(Math.random()-.5)*10,F[Bt]=Math.cos(He)*me*.55+Yt*.32,B[Bt]=Math.sin(He)*me*.55+Pt*.32-40*Math.random(),Q[Bt]=.75+Math.random()*1.65,H[Bt]=Q[Bt],I[Bt]=Math.random()*100},et=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let nt=0,$=performance.now(),pt=0,wt=0;const xe=Gt=>{nt=requestAnimationFrame(xe);let Rt=(Gt-$)/1e3;if($=Gt,document.hidden||!W)return;Rt=Math.min(Math.max(Rt,1/240),1/30),pt+=et?Rt*.3:Rt;const Yt=tt/Math.max(1,window.innerWidth);J||(ct=window.innerWidth*(.5+.18*Math.sin(pt*.45)),ut=window.innerHeight*(.55+.12*Math.sin(pt*.33+1))),rt+=(ht-rt)*Math.min(1,Rt*8);const Pt=(ct-C)/Rt,Jt=(ut-Z)/Rt,Bt=Math.min(Math.hypot(Pt,Jt),2600),He=26+Bt*.55+rt*420;wt+=He*Rt;const me=Math.min(Math.floor(wt),90);wt-=me;for(let At=0;At1?At/(me-1):1;P(C+(ct-C)*We,Z+(ut-Z)*We,Pt,Jt,Math.min(1,.35+Bt/1400+rt*.5))}let pn=0;for(let At=0;Atwindow.innerWidth+60||G[At]>window.innerHeight+60){H[At]=0;continue}const pe=.72+.28*Math.sin(pt*26+I[At]*7.3),Yr=Math.pow(We,1.45)*pe,Bn=pn*b;w[Bn]=_[At],w[Bn+1]=G[At],w[Bn+2]=Math.min(1,We*1.8)*pe,w[Bn+3]=Math.max(1,(1.6+4.6*We)*Yt),w[Bn+4]=Yr,pn++}C=ct,Z=ut,u.bindFramebuffer(u.FRAMEBUFFER,W),u.viewport(0,0,tt,it),u.enable(u.BLEND),u.blendFunc(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA),u.useProgram(g),u.bindBuffer(u.ARRAY_BUFFER,S),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,2,u.FLOAT,!1,0,0),u.uniform1f(u.getUniformLocation(g,"u_fade"),1-Math.exp(-Rt*5.2)),u.drawArrays(u.TRIANGLES,0,3),pn>0&&(u.blendFunc(u.SRC_ALPHA,u.ONE),u.useProgram(p),u.bindBuffer(u.ARRAY_BUFFER,D),u.bufferData(u.ARRAY_BUFFER,w.subarray(0,pn*b),u.DYNAMIC_DRAW),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,2,u.FLOAT,!1,b*4,0),u.enableVertexAttribArray(1),u.vertexAttribPointer(1,3,u.FLOAT,!1,b*4,8),u.uniform2f(u.getUniformLocation(p,"u_res"),window.innerWidth,window.innerHeight),u.drawArrays(u.POINTS,0,pn),u.disableVertexAttribArray(1)),u.disable(u.BLEND),u.bindFramebuffer(u.FRAMEBUFFER,null),u.viewport(0,0,f.width,f.height),u.useProgram(x),u.bindBuffer(u.ARRAY_BUFFER,S),u.enableVertexAttribArray(0),u.vertexAttribPointer(0,2,u.FLOAT,!1,0,0),u.activeTexture(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,U),u.uniform1i(u.getUniformLocation(x,"u_tex"),0),u.uniform2f(u.getUniformLocation(x,"u_res"),f.width,f.height),u.uniform2f(u.getUniformLocation(x,"u_ptr"),ct/window.innerWidth*f.width,ut/window.innerHeight*f.height),u.uniform1f(u.getUniformLocation(x,"u_press"),rt),u.drawArrays(u.TRIANGLES,0,3)};nt=requestAnimationFrame(xe);const sn=Gt=>{Gt.preventDefault(),cancelAnimationFrame(nt),o(!0)};return f.addEventListener("webglcontextlost",sn),()=>{cancelAnimationFrame(nt),window.removeEventListener("resize",st),window.removeEventListener("pointermove",E),window.removeEventListener("pointerdown",j),window.removeEventListener("pointerup",K),window.removeEventListener("pointercancel",K),f.removeEventListener("webglcontextlost",sn),dt(),u.deleteProgram(p),u.deleteProgram(g),u.deleteProgram(x),u.deleteBuffer(S),u.deleteBuffer(D)}},[]),Y.useEffect(()=>{if(!s)return;const f=l.current;if(!f)return;let d=0,u=window.innerWidth/2,m=window.innerHeight/2,v=u,p=m,g=performance.now();const x=b=>{u=b.clientX,m=b.clientY};window.addEventListener("pointermove",x,{passive:!0});const S=b=>{d=requestAnimationFrame(S);const w=Math.min((b-g)/1e3,1/30);g=b,v+=(u-v)*Math.min(1,w*7),p+=(m-p)*Math.min(1,w*7),f.style.transform=`translate3d(${v-160}px, ${p-160}px, 0)`};return d=requestAnimationFrame(S),()=>{cancelAnimationFrame(d),window.removeEventListener("pointermove",x)}},[s]),A.jsxs("div",{className:"fixed inset-0 z-0 overflow-hidden bg-[#07060A]","aria-hidden":"true",children:[A.jsx("canvas",{ref:i,className:"block h-full w-full"}),s&&A.jsx("div",{ref:l,className:"absolute left-0 top-0 h-80 w-80 rounded-full blur-xl will-change-transform",style:{background:"radial-gradient(circle, rgba(255,205,120,0.65) 0%, rgba(255,120,30,0.35) 30%, rgba(7,6,10,0) 65%)"}})]})}const _e=15,ci=3,Bg=_e*ci,BE=` ${Vn} uniform vec2 u_res; uniform float u_aspect; uniform float u_time; uniform vec2 u_ptr; uniform float u_press; uniform float u_flash; uniform vec2 u_pts[${Bg}]; uniform float u_amp[${ci}]; float segDist(vec2 p, vec2 a, vec2 b){ vec2 pa = p - a; vec2 ba = b - a; float h = clamp(dot(pa, ba) / max(dot(ba, ba), 1e-6), 0.0, 1.0); return length(pa - ba * h); } void main(){ vec2 uv = gl_FragCoord.xy / u_res; vec2 p = vec2(uv.x * u_aspect, uv.y); float core = 0.0; float halo = 0.0; for (int b = 0; b < ${ci}; b++){ float amp=u_amp[b]; if (amp <=0.01) continue; float best=10.0; for (int i=0; i < ${_e-1}; i++){ int idx=b * ${_e} + i; vec2 a=u_pts[idx]; vec2 c=u_pts[idx + 1]; best=min(best, segDist(p, a, c)); } core +=amp * exp(-best * 900.0); core +=amp * exp(-best * 220.0) * 0.55; halo +=amp * exp(-best * 26.0); } // storm-lit interior vec3 bg=vec3(0.023, 0.026, 0.050); bg +=vec3(0.030, 0.042, 0.090) * smoothstep(1.3, 0.0, length(p - u_ptr)); bg *=1.0 - 0.32 * smoothstep(0.35, 1.25, length((uv - 0.5) * vec2(1.25, 1.0))); // the flash washes the whole frame, briefly bg +=vec3(0.16, 0.22, 0.42) * u_flash * 0.55; vec3 col=bg; col +=vec3(0.34, 0.50, 1.00) * halo * 0.85; col +=vec3(0.80, 0.88, 1.00) * core * 1.35; col +=vec3(1.00, 1.00, 1.00) * smoothstep(1.2, 3.0, core); // the point it earths itself on float dp=length(p - u_ptr); col +=vec3(0.55, 0.70, 1.0) * exp(-dp * 28.0) * (0.85 + 0.6 * u_press); col +=vec3(0.14, 0.22, 0.55) * exp(-dp * 6.0) * (0.35 + 0.4 * u_press); float grain=fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453); col +=(grain - 0.5) * 0.022; gl_FragColor=vec4(col, 1.0); } `;function HE(){const i=Y.useRef(null),l=Y.useRef(null),[s,o]=Y.useState(!1);return Y.useEffect(()=>{const f=i.current;if(!f)return;const d=qr(f,BE);if(!d){o(!0);return}const{gl:u,u:m,resize:v,draw:p,dispose:g}=d,x=()=>v(19e5,1);x(),window.addEventListener("resize",x);const S=Yl(),b=S.state;b.aspect=window.innerWidth/window.innerHeight,b.x=.5*b.aspect,b.y=.5,b.prevX=b.x,b.prevY=b.y;const w=new Float32Array(Bg*2),D=new Float32Array(ci),_=new Float32Array(ci);let G=0;const F=[[.06,1.04],[.94,1.04],[.5,-.05]],B=(it,dt)=>{const st=F[it],ct=st[0]*b.aspect,ut=st[1],C=b.x,Z=b.y,J=new Float32Array(_e),rt=new Float32Array(_e);for(let $=0;$<_e;$++){const pt=$/(_e-1);J[$]=ct+(C-ct)*pt,rt[$]=ut+(Z-ut)*pt}const ht=C-ct,E=Z-ut,j=Math.hypot(ht,E)||1,K=-E/j,P=ht/j;let et=_e-1,nt=dt;for(;et>1;){const $=et>>1;for(let pt=$;pt<_e;pt+=et){const wt=(Math.random()-.5)*nt;J[pt]+=K*wt,rt[pt]+=P*wt}et=$,nt*=.55}for(let $=0;$<_e;$++)w[(it*_e+$)*2]=J[$],w[(it*_e+$)*2+1]=rt[$];D[it]=.85+Math.random()*.5,G=Math.min(1,G+.55)};for(let it=0;it{for(let it=0;it{I=requestAnimationFrame(W);let dt=(it-O)/1e3;if(O=it,!document.hidden){dt=Math.min(Math.max(dt,1/240),1/30),U+=dt,b.has||(b.aspect=window.innerWidth/window.innerHeight,b.x=(.5+.2*Math.sin(U*.36))*b.aspect,b.y=.48+.16*Math.cos(U*.27)),S.integrate(dt);for(let st=0;st{it.preventDefault(),cancelAnimationFrame(I),o(!0)};return f.addEventListener("webglcontextlost",tt),()=>{cancelAnimationFrame(I),window.removeEventListener("resize",x),window.removeEventListener("pointerdown",H),f.removeEventListener("webglcontextlost",tt),S.dispose(),g()}},[]),Y.useEffect(()=>{if(!s)return;const f=l.current;if(!f)return;let d=0,u=performance.now(),m=window.innerWidth/2,v=window.innerHeight/2,p=m,g=v;const x=b=>{m=b.clientX,v=b.clientY};window.addEventListener("pointermove",x,{passive:!0});const S=b=>{d=requestAnimationFrame(S);const w=Math.min((b-u)/1e3,1/30);u=b,p+=(m-p)*Math.min(1,w*12),g+=(v-g)*Math.min(1,w*12),f.style.transform=`translate3d(${p-220}px, ${g-220}px, 0)`,f.style.opacity=String(.55+.45*Math.random())};return d=requestAnimationFrame(S),()=>{cancelAnimationFrame(d),window.removeEventListener("pointermove",x)}},[s]),A.jsxs("div",{className:"fixed inset-0 z-0 overflow-hidden bg-[#060814]","aria-hidden":"true",children:[A.jsx("canvas",{ref:i,className:"block h-full w-full"}),s&&A.jsx("div",{ref:l,className:"absolute left-0 top-0 h-[440px] w-[440px] rounded-full blur-2xl will-change-transform",style:{background:"radial-gradient(circle, rgba(220,232,255,0.55) 0%, rgba(90,130,255,0.30) 26%, rgba(6,8,20,0) 62%)"}})]})}const qE=` ${Vn} uniform vec2 u_res; uniform float u_aspect; uniform float u_time; uniform vec2 u_ptr; uniform float u_press; uniform float u_energy; float hash(vec2 p){ p = fract(p * vec2(123.34, 456.21)); p += dot(p, p + 45.32); return fract(p.x * p.y); } float vnoise(vec2 p){ vec2 i = floor(p); vec2 f = fract(p); vec2 w = f * f * (3.0 - 2.0 * f); float a = hash(i); float b = hash(i + vec2(1.0, 0.0)); float c = hash(i + vec2(0.0, 1.0)); float d = hash(i + vec2(1.0, 1.0)); return mix(mix(a, b, w.x), mix(c, d, w.x), w.y); } float fbm(vec2 p){ float s = 0.0; float a = 0.5; for (int i = 0; i < 4; i++){ s +=a * vnoise(p); p=p * 2.02 + vec2(5.2, 1.3); a *=0.5; } return s; } void main(){ vec2 uv=gl_FragCoord.xy / u_res; vec2 p=vec2(uv.x * u_aspect, uv.y); vec3 col=vec3(0.016, 0.028, 0.055); col +=vec3(0.010, 0.030, 0.062) * (1.0 - uv.y); // stars, thinning out towards the horizon vec2 sg=floor(p * 190.0); float star=step(0.9965, hash(sg)); float tw=0.55 + 0.45 * sin(u_time * 2.4 + hash(sg + 3.1) * 40.0); col +=vec3(0.78, 0.86, 1.0) * star * tw * smoothstep(0.22, 0.95, uv.y) * 0.65; // the hand pushes the curtains aside vec2 toPtr=p - u_ptr; float dp=length(toPtr); float push=exp(-dp * dp / (0.075 + 0.11 * u_press)); vec2 bend=normalize(toPtr + vec2(1e-5)) * push * (0.10 + 0.12 * u_press); for (int i=0; i < 5; i++){ float fi=float(i); vec2 q=p + bend * (0.55 + 0.30 * fi); q.x +=u_time * (0.035 + 0.018 * fi); // domain warp gives the ribbon its folds float w1=fbm(q * vec2(1.35, 0.75) + vec2(0.0, u_time * 0.05)); float w2=fbm(q * vec2(2.70, 1.15) + vec2(4.2, -u_time * 0.07)); float base=0.40 + 0.115 * fi; float centre=base + 0.135 * sin(q.x * 1.25 + fi * 1.7 + u_time * 0.22) + 0.190 * (w1 - 0.5) + 0.085 * (w2 - 0.5); float thick=0.055 + 0.030 * sin(fi * 2.1 + u_time * 0.3) + 0.022 * w2; float d=abs(p.y - centre); float ribbon=exp(-d * d / (thick * thick)); // curtains are bright at the bottom edge and feather upward ribbon *=smoothstep(0.0, 0.35, p.y - centre + thick * 2.4); // vertical striations, the rays ribbon *=0.62 + 0.38 * fbm(vec2(q.x * 9.0, p.y * 1.4 + u_time * 0.12)); vec3 tint=mix( vec3(0.180, 1.000, 0.620), vec3(0.320, 0.560, 1.000), fract(fi * 0.37 + 0.15) ); tint=mix(tint, vec3(0.95, 0.35, 0.75), smoothstep(0.62, 1.0, fract(fi * 0.53)) * 0.55); float boost=1.0 + push * 1.7 + u_energy * 0.6; col +=tint * ribbon * (0.34 + 0.10 * fi) * boost; } // ridge line: a dark horizon so the sky has something to stand on float ridge=0.055 + 0.045 * fbm(vec2(p.x * 2.4, 0.5)) + 0.02 * fbm(vec2(p.x * 9.0, 1.7)); float land=smoothstep(ridge + 0.004, ridge - 0.004, p.y); col=mix(col, vec3(0.012, 0.018, 0.032), land); // the aurora reflects faintly off the snow col +=vec3(0.06, 0.18, 0.14) * land * smoothstep(0.10, 0.0, p.y) * 0.5; col *=1.0 - 0.28 * smoothstep(0.40, 1.30, length((uv - 0.5) * vec2(1.2, 1.0))); float grain=fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453); col +=(grain - 0.5) * 0.018; gl_FragColor=vec4(col, 1.0); } `;function YE(){const i=Y.useRef(null),l=Y.useRef(null),[s,o]=Y.useState(!1);return Y.useEffect(()=>{const f=i.current;if(!f)return;const d=qr(f,qE);if(!d){o(!0);return}const{gl:u,u:m,resize:v,draw:p,dispose:g}=d,x=()=>v(18e5,1);x(),window.addEventListener("resize",x);const S=Yl(),b=S.state;b.aspect=window.innerWidth/window.innerHeight,b.x=.5*b.aspect,b.y=.5,b.prevX=b.x,b.prevY=b.y;let w=b.x,D=b.y,_=0;const G=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let F=0,B=performance.now(),H=0;const Q=O=>{F=requestAnimationFrame(Q);let U=(O-B)/1e3;if(B=O,document.hidden)return;U=Math.min(Math.max(U,1/240),1/30),H+=G?U*.3:U,b.has||(b.aspect=window.innerWidth/window.innerHeight,b.x=(.5+.26*Math.sin(H*.22))*b.aspect,b.y=.52+.14*Math.sin(H*.17+.6)),S.integrate(U);const W=Math.min(1,U*3.4);w+=(b.x-w)*W,D+=(b.y-D)*W,_+=(Math.min(1,b.speed*.5+b.press)-_)*Math.min(1,U*1.8),u.uniform2f(m("u_res"),f.width,f.height),u.uniform1f(m("u_aspect"),b.aspect),u.uniform1f(m("u_time"),H),u.uniform2f(m("u_ptr"),w,D),u.uniform1f(m("u_press"),b.press),u.uniform1f(m("u_energy"),_),p()};F=requestAnimationFrame(Q);const I=O=>{O.preventDefault(),cancelAnimationFrame(F),o(!0)};return f.addEventListener("webglcontextlost",I),()=>{cancelAnimationFrame(F),window.removeEventListener("resize",x),f.removeEventListener("webglcontextlost",I),S.dispose(),g()}},[]),Y.useEffect(()=>{if(!s)return;const f=l.current;if(!f)return;let d=0,u=performance.now(),m=window.innerWidth/2,v=m;const p=x=>{m=x.clientX};window.addEventListener("pointermove",p,{passive:!0});const g=x=>{d=requestAnimationFrame(g);const S=Math.min((x-u)/1e3,1/30);u=x,v+=(m-v)*Math.min(1,S*2),f.style.transform=`translate3d(${v-window.innerWidth/2}px, 0, 0)`};return d=requestAnimationFrame(g),()=>{cancelAnimationFrame(d),window.removeEventListener("pointermove",p)}},[s]),A.jsxs("div",{className:"fixed inset-0 z-0 overflow-hidden bg-[#050B14]","aria-hidden":"true",children:[A.jsx("canvas",{ref:i,className:"block h-full w-full"}),s&&A.jsx("div",{ref:l,className:"absolute inset-x-[-20%] top-[28%] h-[34vh] blur-3xl will-change-transform",style:{background:"linear-gradient(100deg, rgba(124,255,178,0) 0%, rgba(124,255,178,0.30) 26%, rgba(80,140,255,0.26) 56%, rgba(5,11,20,0) 88%)"}})]})}function FE(){const[i,l]=Y.useState(!1),[s,o]=Y.useState(!1),[f,d]=Y.useState(!1),[u,m]=Y.useState(!1),v=Y.useRef(null),p=Y.useRef(null);return Y.useEffect(()=>{window.matchMedia("(pointer: fine)").matches&&l(!0)},[]),Y.useEffect(()=>{if(!i)return;let g=0,x=window.innerWidth/2,S=window.innerHeight/2,b=x,w=S,D=x,_=S,G=!1,F=!1;const B=U=>{x=U.clientX,S=U.clientY,G||(G=!0,m(!0));const tt=!!U.target?.closest?.("a, button, [data-hot]");tt!==F&&(F=tt,o(tt))},H=()=>d(!0),Q=()=>d(!1),I=()=>{G&&(G=!1,m(!1))},O=()=>{g=requestAnimationFrame(O),b+=(x-b)*.16,w+=(S-w)*.16,D+=(x-D)*.42,_+=(S-_)*.42,v.current&&(v.current.style.transform=`translate3d(${b-22}px, ${w-22}px, 0)`),p.current&&(p.current.style.transform=`translate3d(${D-3}px, ${_-3}px, 0)`)};return g=requestAnimationFrame(O),window.addEventListener("pointermove",B,{passive:!0}),window.addEventListener("pointerdown",H,{passive:!0}),window.addEventListener("pointerup",Q,{passive:!0}),document.addEventListener("pointerleave",I),()=>{cancelAnimationFrame(g),window.removeEventListener("pointermove",B),window.removeEventListener("pointerdown",H),window.removeEventListener("pointerup",Q),document.removeEventListener("pointerleave",I)}},[i]),i?A.jsxs(A.Fragment,{children:[A.jsxs("div",{ref:v,className:"pointer-events-none fixed left-0 top-0 z-[100] h-11 w-11 rounded-full border transition-[opacity,border-width,transform] duration-300",style:{opacity:u?1:0,borderWidth:s?2:1,borderColor:"#FFFFFF",transform:"translate3d(-100px,-100px,0)",mixBlendMode:"difference"},children:[A.jsx("span",{className:"absolute left-1/2 top-1/2 block rounded-full transition-all duration-300",style:{width:s?7:3,height:s?7:3,background:"#FFFFFF",opacity:s?1:.7,transform:"translate(-50%, -50%)"}}),A.jsx("span",{className:"absolute inset-[6px] rounded-full border border-dashed border-white/50 transition-transform duration-500",style:{transform:f?"scale(0.55) rotate(45deg)":"scale(1)"}})]}),A.jsx("div",{ref:p,className:"pointer-events-none fixed left-0 top-0 z-[101] h-1.5 w-1.5 rounded-full",style:{background:"#FFFFFF",mixBlendMode:"difference",opacity:u?1:0,transform:"translate3d(-100px,-100px,0)"}})]}):null}const Ln=["chrome","smoke","waves","magnet","fire","embers","lightning","aurora"],fr={chrome:{label:"Хром",n:"01",matter:"Жидкий металл"},smoke:{label:"Дым",n:"02",matter:"Перенос плотности"},waves:{label:"Волны",n:"03",matter:"Волновые пакеты"},magnet:{label:"Магнит",n:"04",matter:"Силовые линии"},fire:{label:"Огонь",n:"05",matter:"Горение и тяга"},embers:{label:"Искры",n:"06",matter:"1100 частиц"},lightning:{label:"Молния",n:"07",matter:"Ветвление разряда"},aurora:{label:"Сияние",n:"08",matter:"Полярные шторы"}},GE={chrome:"#EDEAE3",smoke:"#0A0A0C",waves:"#04141A",magnet:"#EDEAE3",fire:"#0B0705",embers:"#07060A",lightning:"#060814",aurora:"#050B14"};function XE(){const[i,l]=Y.useState(()=>{try{const u=localStorage.getItem("mirage-mode");return u&&Ln.includes(u)?u:"chrome"}catch{return"chrome"}}),[s,o]=Y.useState(!1);Y.useEffect(()=>{document.documentElement.dataset.mode=i;const u=document.querySelector('meta[name="theme-color"]');u&&u.setAttribute("content",GE[i]||"#EDEAE3");try{localStorage.setItem("mirage-mode",i)}catch{}},[i]),Y.useEffect(()=>{let u=0;const m=()=>{u||(u=requestAnimationFrame(()=>{o(window.scrollY>40),u=0}))};return m(),window.addEventListener("scroll",m,{passive:!0}),()=>window.removeEventListener("scroll",m)},[]),Y.useEffect(()=>{const u=m=>{if(m.metaKey||m.ctrlKey||m.altKey)return;const v=m.target;if(v&&/^(INPUT|TEXTAREA|SELECT)$/.test(v.tagName))return;const p=Number(m.key);if(p>=1&&p<=Ln.length){l(Ln[p-1]);return}(m.key==="ArrowRight"||m.key==="ArrowLeft")&&l(g=>{const x=Ln.indexOf(g),S=m.key==="ArrowRight"?1:-1;return Ln[(x+S+Ln.length)%Ln.length]})};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[]);const f={chrome:()=>A.jsx(SE,{}),smoke:()=>A.jsx(wE,{}),waves:()=>A.jsx(_E,{}),magnet:()=>A.jsx(DE,{}),fire:()=>A.jsx(NE,{}),embers:()=>A.jsx(VE,{}),lightning:()=>A.jsx(HE,{}),aurora:()=>A.jsx(YE,{})},d=fr[i];return A.jsxs(hT,{reducedMotion:"user",children:[A.jsx(cT,{mode:"wait",children:A.jsx(nv.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.6,ease:"easeInOut"},className:"fixed inset-0 z-0 overflow-hidden",children:f[i]()},i)}),A.jsx(FE,{}),A.jsx("div",{className:"grain"}),A.jsx("div",{className:"fixed bottom-3 left-1/2 z-50 w-[min(96vw,60rem)] -translate-x-1/2 sm:bottom-5",children:A.jsxs("div",{className:"rounded-2xl border border-ink/25 bg-bone/80 p-1.5 backdrop-blur-md sm:p-2",children:[A.jsxs("div",{className:"mb-1 hidden items-center justify-between px-2 pt-0.5 lg:flex",children:[A.jsxs("span",{className:"eyebrow text-muted",children:["Вещество — ",d.matter]}),A.jsx("span",{className:"eyebrow text-muted/70",children:"Клавиши 1–8 или ← →"})]}),A.jsx("div",{role:"group","aria-label":"Версия эффекта",className:"grid grid-cols-4 gap-1 sm:grid-cols-8",children:Ln.map(u=>{const m=u===i;return A.jsxs("button",{type:"button",onClick:()=>l(u),"aria-pressed":m,title:fr[u].matter,className:"relative rounded-xl px-1 py-2 sm:px-2",children:[m&&A.jsx(nv.span,{layoutId:"mode-pill",transition:{type:"spring",stiffness:420,damping:34},className:"absolute inset-0 rounded-xl bg-ember"}),A.jsxs("span",{className:"switch-label relative z-10 flex flex-col items-center gap-0.5 transition-colors duration-300 "+(m?"text-[var(--on-ember)]":"text-muted"),children:[A.jsx("span",{className:"tnum opacity-60",children:fr[u].n}),A.jsx("span",{className:"whitespace-nowrap",children:fr[u].label})]})]},u)})})]})}),A.jsxs("header",{className:"fixed inset-x-0 top-0 z-40 flex items-center justify-between px-5 py-3 transition-colors duration-500 sm:px-8 lg:px-12 "+(s?"border-b border-ink/15 bg-bone/85 backdrop-blur-md":"border-b border-transparent"),children:[A.jsxs("a",{href:"#hero",className:"display text-base tracking-tight","data-hot":!0,children:["Мираз ",A.jsx("span",{className:"text-ember",children:"·"})," ",A.jsx("span",{className:"text-sm font-medium tracking-tight normal-case opacity-80",children:"мир-сайтов.рф"})]}),A.jsx("nav",{className:"hidden items-center gap-6 md:flex",children:["#tariffs","#includes","#steps","#faq","#contacts"].map(u=>A.jsx("a",{href:u,className:"eyebrow text-muted transition-colors hover:text-ember",children:{"#tariffs":"Тарифы","#includes":"Что входит","#steps":"Как делаем","#faq":"Вопросы","#contacts":"Контакты"}[u]},u))}),A.jsx("a",{href:"#form","data-hot":!0,className:"eyebrow hidden border border-ink px-4 py-2 transition-colors hover:bg-ink hover:text-bone sm:inline-block",children:"Оставить заявку"})]}),A.jsxs("main",{children:[A.jsx("section",{id:"hero",className:"relative min-h-[100svh] px-5 pb-20 pt-28 sm:px-8 lg:px-16 lg:pt-32",children:A.jsxs("div",{className:"mx-auto max-w-6xl",children:[A.jsxs("div",{className:"eyebrow mb-5 inline-flex items-center gap-2 rounded-full border border-ink/25 bg-bone/60 px-4 py-2 backdrop-blur-sm",children:[A.jsx("span",{className:"block h-1.5 w-1.5 animate-pulse rounded-full bg-ember"}),A.jsx("span",{className:"hidden md:inline",children:"Двигайте курсором"}),A.jsx("span",{className:"md:hidden",children:"Ведите пальцем"})]}),A.jsxs("h1",{className:"display halo -ml-[0.035em] select-none text-[clamp(3.4rem,18.5vw,14rem)] leading-[0.82]",children:["Фирменный ",A.jsx("br",{}),A.jsx("span",{className:"text-ember",children:"стиль"})]}),A.jsxs("div",{className:"mt-8 grid grid-cols-12 gap-6 border-t border-ink/25 pt-6",children:[A.jsxs("p",{className:"halo col-span-12 max-w-[50ch] text-[1.02rem] leading-[1.55] md:col-span-6",children:["Разрабатываем узнаваемый бренд: логотип, палитра, типографика, деловая полиграфия, брендбук. ",Ln.indexOf(i)>3?"Ваш курсор — это физическое явление на этой странице.":"Ваш курсор тянет изображение на этом экране — не видео, всё считается сейчас."]}),A.jsxs("p",{className:"halo col-span-12 text-sm leading-relaxed text-muted md:col-span-5 md:col-start-8",children:[A.jsx("span",{className:"text-ink",children:d.matter})," — это текущий эффект. Переключайте вещество в панели внизу. Ниже — три тарифа, что входит, как мы работаем, вопросы, форма заявки."]})]}),A.jsxs("div",{className:"mt-10 flex flex-wrap gap-3",children:[A.jsx("a",{href:"#tariffs",className:"eyebrow inline-flex items-center gap-2 rounded-full bg-ink px-7 py-3.5 text-bone transition-colors hover:bg-ember","data-hot":!0,children:"Выбрать тариф ↓"}),A.jsx("a",{href:"#form",className:"eyebrow inline-flex items-center gap-2 rounded-full border border-ink px-7 py-3.5 transition-colors hover:bg-ink hover:text-bone","data-hot":!0,children:"Написать нам"})]})]})}),A.jsx("section",{id:"tariffs",className:"relative bg-bone2/70 px-5 py-20 sm:px-8 lg:px-16",children:A.jsxs("div",{className:"mx-auto max-w-6xl",children:[A.jsx("h2",{className:"display text-[clamp(2rem,5vw,3.6rem)]",children:"Три тарифа"}),A.jsx("p",{className:"mt-2 text-muted",children:"От базового набора до полного брендбука"}),A.jsx("div",{className:"mt-10 grid gap-6 md:grid-cols-3",children:[{name:"Фирстиль Старт",price:"15 000 ₽",time:"5–7 дней",old:"20 000 ₽",features:["Логотип + 3 варианта","Фирменные цвета","Подбор шрифтов","Визитка (двусторонняя)","Исходники AI/EPS/PNG","2 правки"],btn:"#form",label:"Заказать Старт"},{name:"Фирстиль Бизнес",price:"35 000 ₽",time:"10–20 дней",old:"45 000 ₽",popular:!0,features:["Логотип + 5 вариантов","Полная цветовая палитра","Типографика (пара шрифтов)","Фирменные паттерны","Визитка, бланк, конверт","Оформление соцсетей","Брендбук (PDF)","5 правок"],btn:"#form",label:"Заказать Бизнес"},{name:"Фирстиль Максимум",price:"70 000 ₽",time:"20–30 дней",old:"90 000 ₽",features:["Логотип + 10 вариантов","Расширенная палитра","Полная типографика","Фирменная графика и иконки","Вся деловая полиграфия","Презентация компании","Дизайн упаковки","Расширенный брендбук","Безлимитные правки"],btn:"#form",label:"Заказать Максимум"}].map(u=>A.jsxs("article",{className:"group border border-ink/15 bg-bone/80 p-7 transition hover:border-ink/40 "+(u.popular?"relative overflow-hidden border-ember/50 ring-1 ring-ember/20":""),children:[u.popular&&A.jsx("span",{className:"eyebrow absolute right-0 top-0 bg-ember px-3 py-1 text-white text-[0.6rem]",children:"Рекомендуем"}),A.jsx("h3",{className:"display-light text-xl",children:u.name}),A.jsxs("div",{className:"mt-3 flex items-baseline gap-2",children:[A.jsx("span",{className:"display text-3xl",children:u.price}),A.jsx("span",{className:"line-through text-muted",children:u.old})]}),A.jsx("div",{className:"eyebrow mt-2 text-muted",children:u.time}),A.jsx("ul",{className:"mt-5 space-y-2.5",children:u.features.map(m=>A.jsxs("li",{className:"flex items-start gap-2.5 text-sm leading-snug text-ink/90",children:[A.jsx("span",{className:"mt-0.5 shrink-0 text-ember",children:"✓"}),A.jsx("span",{children:m})]},m))}),A.jsx("a",{href:u.btn,className:"mt-7 block w-full rounded-full px-5 py-3 text-center transition "+(u.popular?"bg-ink text-bone hover:bg-ember":"border border-ink hover:bg-ink hover:text-bone"),children:u.label})]},u.name))})]})}),A.jsx("section",{id:"includes",className:"relative px-5 py-20 sm:px-8 lg:px-16",children:A.jsxs("div",{className:"mx-auto max-w-6xl",children:[A.jsx("h2",{className:"display text-[clamp(2rem,5vw,3.6rem)]",children:"Что входит"}),A.jsx("p",{className:"mt-2 text-muted",children:"Комплексный подход к бренду"}),A.jsx("div",{className:"mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:[{h:"Логотип",p:"Уникальный знак, который станет лицом бренда. Несколько концепций на выбор."},{h:"Цветовая палитра",p:"Подбираем фирменные цвета, которые передают ценности бренда и выделяют на фоне конкурентов."},{h:"Типографика",p:"Выбираем шрифтовые пары для заголовков, текста и акцентов — единообразие на всех носителях."},{h:"Деловая полиграфия",p:"Визитки, бланки, конверты, папки — всё в едином стиле и готово к печати."},{h:"Рекламные материалы",p:"Баннеры, буклеты, листовки и оформление соцсетей в единой визуальной системе."},{h:"Брендбук",p:"Документ с правилами использования: как применять логотип, цвета, шрифты и примеры носителей."}].map(u=>A.jsxs("article",{className:"group border border-ink/20 bg-bone/70 p-6 transition hover:border-ink/50",children:[A.jsx("h3",{className:"display-light text-xl",children:u.h}),A.jsx("p",{className:"mt-3 text-sm leading-relaxed text-muted",children:u.p})]},u.h))})]})}),A.jsx("section",{id:"steps",className:"relative bg-bone2/70 px-5 py-20 sm:px-8 lg:px-16",children:A.jsxs("div",{className:"mx-auto max-w-6xl",children:[A.jsx("h2",{className:"display text-[clamp(2rem,5vw,3.6rem)]",children:"Как мы работаем"}),A.jsx("p",{className:"mt-2 text-muted",children:"6 этапов создания фирменного стиля"}),A.jsx("div",{className:"mt-10 grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:[{n:"01",h:"Брифинг",p:"Узнаём ценности бренда, аудиторию, пожелания, примеры."},{n:"02",h:"Анализ",p:"Изучаем конкурентов и тренды в нише для точного позиционирования."},{n:"03",h:"Концепция",p:"Разрабатываем несколько направлений дизайна для выбора лучшего."},{n:"04",h:"Разработка",p:"Детализируем выбранную концепцию до готового решения."},{n:"05",h:"Полиграфия",p:"Создаём визитки, бланки, буклеты и другие носители в едином стиле."},{n:"06",h:"Брендбук",p:"Оформляем гайдлайн с правилами использования — гарантия единообразия."}].map(u=>A.jsxs("article",{className:"relative overflow-hidden border border-ink/15 bg-bone/80 p-7 transition hover:-translate-y-1 hover:shadow-lg",children:[A.jsx("div",{className:"eyebrow text-ember mb-3",children:u.n}),A.jsx("h3",{className:"display-light text-lg",children:u.h}),A.jsx("p",{className:"mt-3 text-sm leading-relaxed text-muted",children:u.p})]},u.n))})]})}),A.jsx("section",{className:"relative px-5 py-14 sm:px-8 lg:px-16",children:A.jsx("div",{className:"mx-auto max-w-6xl",children:A.jsx("div",{className:"grid gap-8 border-t border-b border-ink/15 py-10 sm:grid-cols-4",children:[{v:"400+",l:"фирстилей разработано"},{v:"97%",l:"клиентов довольны результатом"},{v:"5–20",l:"дней — средний срок разработки"},{v:"30+",l:"наград в сфере брендинга"}].map(u=>A.jsxs("div",{className:"text-center",children:[A.jsx("div",{className:"display text-4xl sm:text-5xl text-ink",children:u.v}),A.jsx("div",{className:"eyebrow mt-2 text-muted",children:u.l})]},u.v))})})}),A.jsx("section",{id:"examples",className:"relative bg-bone2/70 px-5 py-20 sm:px-8 lg:px-16",children:A.jsxs("div",{className:"mx-auto max-w-6xl",children:[A.jsx("h2",{className:"display text-[clamp(2rem,5vw,3.6rem)]",children:"Реальные результаты"}),A.jsx("p",{className:"mt-2 text-muted",children:"Кейсы с измеримыми эффектами"}),A.jsx("div",{className:"mt-10 grid gap-6 md:grid-cols-3",children:[{cat:"Автосервис",h:"Фирстиль автосервиса",res:"+50% узнаваемости"},{cat:"Медицина",h:"Бренд стоматологической клиники",res:"+35% обращений"},{cat:"Образование",h:"Фирстиль образовательного центра",res:"+42% новых учеников"}].map(u=>A.jsxs("a",{href:"#contact",className:"group block overflow-hidden border border-ink/15 bg-bone/70 transition hover:border-ink/40",children:[A.jsx("div",{className:"h-48 w-full bg-gradient-to-br from-ink/10 to-ink/5 group-hover:scale-[1.02]"}),A.jsxs("div",{className:"p-6",children:[A.jsx("span",{className:"eyebrow text-ember",children:u.cat}),A.jsx("h3",{className:"display-light mt-2 text-xl",children:u.h}),A.jsx("div",{className:"eyebrow mt-3 text-muted",children:u.res})]})]},u.h))})]})}),A.jsx("section",{id:"faq",className:"relative px-5 py-20 sm:px-8 lg:px-16",children:A.jsxs("div",{className:"mx-auto max-w-3xl",children:[A.jsx("h2",{className:"display text-[clamp(2rem,5vw,3.6rem)]",children:"Частые вопросы"}),A.jsx("p",{className:"mt-2 text-muted",children:"Ответы на популярные вопросы о фирменном стиле"}),A.jsx("div",{className:"mt-8 space-y-3",children:[["Сколько стоит фирменный стиль?","Базовый тариф — от 15 000 ₽, бизнес — от 35 000 ₽, максимальный — от 70 000 ₽."],["Сколько времени занимает разработка?","Старт: 5–7 дней. Бизнес: 10–20 дней. Максимум: 20–30 дней."],["Что входит в фирменный стиль?","Логотип, палитра, типографика, паттерны, деловая полиграфия, оформление соцсетей, брендбук."],["Что такое брендбук?","Документ с правилами использования: логотип, цвета, шрифты, примеры носителей — гарантия единообразия."],["Можно ли заказать только логотип?","Да, но мы рекомендуем хотя бы минимальный набор: логотип + цвета + шрифты + визитка."],["В каком формате получу файлы?","Исходники AI/EPS/SVG для печати, PNG/JPG/SVG для веба. Брендбук в PDF."]].map(([u,m])=>A.jsxs("div",{className:"border border-ink/15 bg-bone/70 p-5",children:[A.jsx("h3",{className:"text-base font-semibold leading-snug text-ink",children:u}),A.jsx("p",{className:"mt-2 text-sm leading-relaxed text-muted",children:m})]},u))})]})}),A.jsx("section",{id:"cta",className:"relative bg-bone2/70 px-5 py-20 text-center sm:px-8 lg:px-16",children:A.jsxs("div",{className:"mx-auto max-w-3xl",children:[A.jsx("h2",{className:"display text-[clamp(2rem,5vw,3.6rem)]",children:"Готовы создать узнаваемый бренд?"}),A.jsx("p",{className:"mt-3 text-muted",children:"Оставьте заявку — мы свяжемся в течение часа"}),A.jsxs("div",{className:"mt-8 flex flex-wrap justify-center gap-3",children:[A.jsx("a",{href:"#form",className:"eyebrow rounded-full bg-ink px-8 py-3.5 text-bone transition hover:bg-ember","data-hot":!0,children:"Оставить заявку"}),A.jsx("a",{href:"https://t.me/mir_saytov",target:"_blank",rel:"noopener",className:"eyebrow rounded-full border border-ink px-8 py-3.5 transition hover:bg-ink hover:text-bone",children:"Telegram"}),A.jsx("a",{href:"https://wa.me/79142025027",target:"_blank",rel:"noopener",className:"eyebrow rounded-full border border-ink px-8 py-3.5 transition hover:bg-ink hover:text-bone",children:"WhatsApp"})]})]})}),A.jsx("section",{id:"form",className:"relative px-5 py-20 sm:px-8 lg:px-16",children:A.jsxs("div",{className:"mx-auto max-w-2xl",children:[A.jsx("h2",{className:"display text-[clamp(2rem,5vw,3rem)]",children:"Заявка на фирстиль"}),A.jsx("p",{className:"mt-2 text-muted",children:"Заполните форму — мы свяжемся в течение 30 минут"}),A.jsxs("form",{className:"mt-8 space-y-5",onSubmit:u=>{u.preventDefault(),alert("Заявка отправлена! (демо)")},children:[A.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[A.jsx("input",{type:"text",placeholder:"Ваше имя",required:!0,className:"w-full rounded-xl border border-ink/20 bg-bone/80 px-5 py-3.5 outline-none transition focus:border-ember focus:ring-1 focus:ring-ember/40"}),A.jsx("input",{type:"tel",placeholder:"Телефон",required:!0,className:"w-full rounded-xl border border-ink/20 bg-bone/80 px-5 py-3.5 outline-none transition focus:border-ember focus:ring-1 focus:ring-ember/40"})]}),A.jsx("input",{type:"email",placeholder:"Email",className:"w-full rounded-xl border border-ink/20 bg-bone/80 px-5 py-3.5 outline-none transition focus:border-ember focus:ring-1 focus:ring-ember/40"}),A.jsxs("select",{className:"w-full rounded-xl border border-ink/20 bg-bone/80 px-5 py-3.5 text-muted outline-none transition focus:border-ember focus:ring-1 focus:ring-ember/40",children:[A.jsx("option",{children:"Выберите тариф"}),A.jsx("option",{children:"Фирстиль Старт — 15 000 ₽"}),A.jsx("option",{children:"Фирстиль Бизнес — 35 000 ₽"}),A.jsx("option",{children:"Фирстиль Максимум — 70 000 ₽"}),A.jsx("option",{children:"Нужна консультация"})]}),A.jsx("textarea",{rows:4,placeholder:"Расскажите о проекте...",className:"w-full rounded-xl border border-ink/20 bg-bone/80 px-5 py-3.5 outline-none transition focus:border-ember focus:ring-1 focus:ring-ember/40 resize-none"}),A.jsx("button",{type:"submit",className:"eyebrow w-full rounded-full bg-ink px-7 py-3.5 text-bone transition hover:bg-ember","data-hot":!0,children:"Отправить заявку"})]}),A.jsxs("p",{className:"mt-4 text-xs text-muted",children:["Нажимая кнопку, вы соглашаетесь с ",A.jsx("a",{href:"#",className:"underline hover:text-ember",children:"политикой конфиденциальности"})]})]})})]}),A.jsx("footer",{id:"contacts",className:"border-t border-ink/15 bg-bone/90 px-5 py-14 sm:px-8 lg:px-16",children:A.jsxs("div",{className:"mx-auto max-w-6xl",children:[A.jsxs("div",{className:"grid gap-10 md:grid-cols-4",children:[A.jsxs("div",{children:[A.jsxs("a",{href:"#hero",className:"display text-lg tracking-tight","data-hot":!0,children:["Мираз ",A.jsx("span",{className:"text-ember",children:"·"})," ",A.jsx("span",{className:"text-sm font-medium tracking-tight opacity-80",children:"мир-сайтов.рф"})]}),A.jsx("p",{className:"mt-3 text-sm text-muted",children:"Создаём узнаваемые бренды и интерактивные сайты. Работаем с 2018 года по всей России."}),A.jsxs("div",{className:"mt-4 flex gap-3",children:[A.jsx("a",{href:"https://t.me/mir_saytov",target:"_blank",rel:"noopener",className:"eyebrow border border-ink/20 px-2.5 py-1 text-[0.6rem] transition hover:bg-ink hover:text-bone",children:"TG"}),A.jsx("a",{href:"https://wa.me/79142025027",target:"_blank",rel:"noopener",className:"eyebrow border border-ink/20 px-2.5 py-1 text-[0.6rem] transition hover:bg-ink hover:text-bone",children:"WA"})]})]}),A.jsxs("div",{children:[A.jsx("h4",{className:"eyebrow mb-4 text-ink",children:"Услуги"}),A.jsxs("ul",{className:"space-y-2 text-sm text-muted",children:[A.jsx("li",{children:A.jsx("a",{href:"#tariffs",className:"hover:text-ember",children:"Фирменный стиль"})}),A.jsx("li",{children:A.jsx("a",{href:"#",className:"hover:text-ember",children:"Создание сайтов"})}),A.jsx("li",{children:A.jsx("a",{href:"#",className:"hover:text-ember",children:"SEO-продвижение"})}),A.jsx("li",{children:A.jsx("a",{href:"#",className:"hover:text-ember",children:"Поддержка"})})]})]}),A.jsxs("div",{children:[A.jsx("h4",{className:"eyebrow mb-4 text-ink",children:"Навигация"}),A.jsxs("ul",{className:"space-y-2 text-sm text-muted",children:[A.jsx("li",{children:A.jsx("a",{href:"#hero",className:"hover:text-ember",children:"Начало"})}),A.jsx("li",{children:A.jsx("a",{href:"#tariffs",className:"hover:text-ember",children:"Тарифы"})}),A.jsx("li",{children:A.jsx("a",{href:"#includes",className:"hover:text-ember",children:"Что входит"})}),A.jsx("li",{children:A.jsx("a",{href:"#faq",className:"hover:text-ember",children:"Вопросы"})}),A.jsx("li",{children:A.jsx("a",{href:"#contacts",className:"hover:text-ember",children:"Контакты"})})]})]}),A.jsxs("div",{children:[A.jsx("h4",{className:"eyebrow mb-4 text-ink",children:"Контакты"}),A.jsxs("ul",{className:"space-y-2 text-sm text-muted",children:[A.jsx("li",{children:A.jsx("a",{href:"mailto:info-mpk-dv@yandex.ru",className:"hover:text-ember",children:"info-mpk-dv@yandex.ru"})}),A.jsx("li",{children:A.jsx("a",{href:"tel:+79142025027",className:"hover:text-ember",children:"+7 (914) 202-50-27"})}),A.jsx("li",{children:"Пн–Пт: 9:00–19:00"}),A.jsx("li",{children:A.jsx("a",{href:"#form",className:"hover:text-ember",children:"Оставить заявку"})})]})]})]}),A.jsxs("div",{className:"mt-10 flex flex-col items-center justify-between gap-3 border-t border-ink/10 pt-6 text-xs text-muted sm:flex-row",children:[A.jsx("span",{children:"© 2026 «мир-сайтов.рф». Все права защищены."}),A.jsx("a",{href:"#",className:"hover:text-ember",children:"Политика конфиденциальности"})]})]})})]})}h2.createRoot(document.getElementById("root")).render(A.jsx(Y.StrictMode,{children:A.jsx(XE,{})}));