fightbook 1.0.9 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  **AI Combat Arena** — Configure fighters with skills.md, simulate MMA combat in real-time.
7
7
 
8
8
  🔗 **Live Demo**: https://fightbook.xyz
9
- 🐦 **Twitter**: [@fightbookxyz](https://x.com/fightbookxyz)
9
+ 📦 **NPM**: [fightbook](https://www.npmjs.com/package/fightbook)
10
10
 
11
11
  ---
12
12
 
@@ -274,7 +274,7 @@ wrestling: 40
274
274
  submissions: 30
275
275
  cardio: 70
276
276
  chin: 75
277
- aggression: 0.85`})})]})]})}),u.jsx("footer",{className:"border-t border-zinc-800 px-4 py-4",children:u.jsxs("div",{className:"max-w-2xl mx-auto flex items-center justify-between text-xs text-zinc-600",children:[u.jsx("div",{children:"fightbook v1.0"}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("a",{href:"https://x.com/fightbookxyz",target:"_blank",rel:"noopener",children:"@fightbookxyz"}),u.jsx("span",{children:"skills.md powered"})]})]})})]})}const $u=x.createContext({});function Bu(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const Yg=typeof window<"u",Xg=Yg?x.useLayoutEffect:x.useEffect,aa=x.createContext(null);function Uu(e,t){e.indexOf(t)===-1&&e.push(t)}function Do(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const It=(e,t,n)=>n>t?t:n<e?e:n;let la=()=>{},Gr=()=>{};const qt={},Qg=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function qg(e){return typeof e=="object"&&e!==null}const Zg=e=>/^0[^.\s]+$/u.test(e);function Jg(e){let t;return()=>(t===void 0&&(t=e()),t)}const at=e=>e,vS=(e,t)=>n=>t(e(n)),ds=(...e)=>e.reduce(vS),Ji=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Hu{constructor(){this.subscriptions=[]}add(t){return Uu(this.subscriptions,t),()=>Do(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const lt=e=>e*1e3,st=e=>e/1e3;function e0(e,t){return t?e*(1e3/t):0}const t0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,xS=1e-7,wS=12;function SS(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=t0(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>xS&&++a<wS);return o}function fs(e,t,n,r){if(e===t&&n===r)return at;const i=s=>SS(s,0,1,e,n);return s=>s===0||s===1?s:t0(i(s),t,r)}const n0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,r0=e=>t=>1-e(1-t),i0=fs(.33,1.53,.69,.99),Wu=r0(i0),s0=n0(Wu),o0=e=>(e*=2)<1?.5*Wu(e):.5*(2-Math.pow(2,-10*(e-1))),Ku=e=>1-Math.sin(Math.acos(e)),a0=r0(Ku),l0=n0(Ku),bS=fs(.42,0,1,1),kS=fs(0,0,.58,1),c0=fs(.42,0,.58,1),CS=e=>Array.isArray(e)&&typeof e[0]!="number",u0=e=>Array.isArray(e)&&typeof e[0]=="number",Yf={linear:at,easeIn:bS,easeInOut:c0,easeOut:kS,circIn:Ku,circInOut:l0,circOut:a0,backIn:Wu,backInOut:s0,backOut:i0,anticipate:o0},TS=e=>typeof e=="string",Xf=e=>{if(u0(e)){Gr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return fs(t,n,r,i)}else if(TS(e))return Gr(Yf[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Yf[e];return e},zs=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Qf={value:null,addProjectionMetrics:null};function NS(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(f){o.has(f)&&(d.schedule(f),e()),l++,f(a)}const d={schedule:(f,m=!1,h=!1)=>{const w=h&&i?n:r;return m&&o.add(f),w.has(f)||w.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&Qf.value&&Qf.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(f))}};return d}const ES=40;function d0(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=zs.reduce((y,b)=>(y[b]=NS(s,t?b:void 0),y),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:d,update:f,preRender:m,render:h,postRender:v}=o,w=()=>{const y=qt.useManualTiming?i.timestamp:performance.now();n=!1,qt.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,ES),1)),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),f.process(i),m.process(i),h.process(i),v.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(w))},S=()=>{n=!0,r=!0,i.isProcessing||e(w)};return{schedule:zs.reduce((y,b)=>{const k=o[b];return y[b]=(C,N=!1,T=!1)=>(n||S(),k.schedule(C,N,T)),y},{}),cancel:y=>{for(let b=0;b<zs.length;b++)o[zs[b]].cancel(y)},state:i,steps:o}}const{schedule:te,cancel:En,state:Te,steps:Xa}=d0(typeof requestAnimationFrame<"u"?requestAnimationFrame:at,!0);let eo;function PS(){eo=void 0}const Le={now:()=>(eo===void 0&&Le.set(Te.isProcessing||qt.useManualTiming?Te.timestamp:performance.now()),eo),set:e=>{eo=e,queueMicrotask(PS)}},f0=e=>t=>typeof t=="string"&&t.startsWith(e),h0=f0("--"),jS=f0("var(--"),Gu=e=>jS(e)?AS.test(e.split("/*")[0].trim()):!1,AS=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function qf(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Jr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},es={...Jr,transform:e=>It(0,1,e)},Is={...Jr,default:1},Ri=e=>Math.round(e*1e5)/1e5,Yu=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function RS(e){return e==null}const MS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xu=(e,t)=>n=>!!(typeof n=="string"&&MS.test(n)&&n.startsWith(e)||t&&!RS(n)&&Object.prototype.hasOwnProperty.call(n,t)),m0=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Yu);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},DS=e=>It(0,255,e),Qa={...Jr,transform:e=>Math.round(DS(e))},Wn={test:Xu("rgb","red"),parse:m0("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Qa.transform(e)+", "+Qa.transform(t)+", "+Qa.transform(n)+", "+Ri(es.transform(r))+")"};function _S(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const fc={test:Xu("#"),parse:_S,transform:Wn.transform},hs=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ln=hs("deg"),zt=hs("%"),L=hs("px"),LS=hs("vh"),zS=hs("vw"),Zf={...zt,parse:e=>zt.parse(e)/100,transform:e=>zt.transform(e*100)},br={test:Xu("hsl","hue"),parse:m0("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+zt.transform(Ri(t))+", "+zt.transform(Ri(n))+", "+Ri(es.transform(r))+")"},ye={test:e=>Wn.test(e)||fc.test(e)||br.test(e),parse:e=>Wn.test(e)?Wn.parse(e):br.test(e)?br.parse(e):fc.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Wn.transform(e):br.transform(e),getAnimatableNone:e=>{const t=ye.parse(e);return t.alpha=0,ye.transform(t)}},IS=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function VS(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Yu))==null?void 0:t.length)||0)+(((n=e.match(IS))==null?void 0:n.length)||0)>0}const p0="number",g0="color",OS="var",FS="var(",Jf="${}",$S=/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 ts(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace($S,l=>(ye.test(l)?(r.color.push(s),i.push(g0),n.push(ye.parse(l))):l.startsWith(FS)?(r.var.push(s),i.push(OS),n.push(l)):(r.number.push(s),i.push(p0),n.push(parseFloat(l))),++s,Jf)).split(Jf);return{values:n,split:a,indexes:r,types:i}}function y0(e){return ts(e).values}function v0(e){const{split:t,types:n}=ts(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===p0?s+=Ri(i[o]):a===g0?s+=ye.transform(i[o]):s+=i[o]}return s}}const BS=e=>typeof e=="number"?0:ye.test(e)?ye.getAnimatableNone(e):e;function US(e){const t=y0(e);return v0(e)(t.map(BS))}const Nt={test:VS,parse:y0,createTransformer:v0,getAnimatableNone:US};function qa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function HS({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=qa(l,a,e+1/3),s=qa(l,a,e),o=qa(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function _o(e,t){return n=>n>0?t:e}const de=(e,t,n)=>e+(t-e)*n,Za=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},WS=[fc,Wn,br],KS=e=>WS.find(t=>t.test(e));function eh(e){const t=KS(e);if(la(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===br&&(n=HS(n)),n}const th=(e,t)=>{const n=eh(e),r=eh(t);if(!n||!r)return _o(e,t);const i={...n};return s=>(i.red=Za(n.red,r.red,s),i.green=Za(n.green,r.green,s),i.blue=Za(n.blue,r.blue,s),i.alpha=de(n.alpha,r.alpha,s),Wn.transform(i))},hc=new Set(["none","hidden"]);function GS(e,t){return hc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function YS(e,t){return n=>de(e,t,n)}function Qu(e){return typeof e=="number"?YS:typeof e=="string"?Gu(e)?_o:ye.test(e)?th:qS:Array.isArray(e)?x0:typeof e=="object"?ye.test(e)?th:XS:_o}function x0(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Qu(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function XS(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Qu(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function QS(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const qS=(e,t)=>{const n=Nt.createTransformer(t),r=ts(e),i=ts(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?hc.has(e)&&!i.values.length||hc.has(t)&&!r.values.length?GS(e,t):ds(x0(QS(r,i),i.values),n):(la(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),_o(e,t))};function w0(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?de(e,t,n):Qu(e)(e,t)}const ZS=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>te.update(t,n),stop:()=>En(t),now:()=>Te.isProcessing?Te.timestamp:Le.now()}},S0=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Lo=2e4;function qu(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Lo;)t+=n,r=e.next(t);return t>=Lo?1/0:t}function JS(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(qu(r),Lo);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:st(i)}}const eb=5;function b0(e,t,n){const r=Math.max(t-eb,0);return e0(n-e(r),t-r)}const ce={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},Ja=.001;function tb({duration:e=ce.duration,bounce:t=ce.bounce,velocity:n=ce.velocity,mass:r=ce.mass}){let i,s;la(e<=lt(ce.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=It(ce.minDamping,ce.maxDamping,o),e=It(ce.minDuration,ce.maxDuration,st(e)),o<1?(i=c=>{const d=c*o,f=d*e,m=d-n,h=mc(c,o),v=Math.exp(-f);return Ja-m/h*v},s=c=>{const f=c*o*e,m=f*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,v=Math.exp(-f),w=mc(Math.pow(c,2),o);return(-i(c)+Ja>0?-1:1)*((m-h)*v)/w}):(i=c=>{const d=Math.exp(-c*e),f=(c-n)*e+1;return-Ja+d*f},s=c=>{const d=Math.exp(-c*e),f=(n-c)*(e*e);return d*f});const a=5/e,l=rb(i,s,a);if(e=lt(e),isNaN(l))return{stiffness:ce.stiffness,damping:ce.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const nb=12;function rb(e,t,n){let r=n;for(let i=1;i<nb;i++)r=r-e(r)/t(r);return r}function mc(e,t){return e*Math.sqrt(1-t*t)}const ib=["duration","bounce"],sb=["stiffness","damping","mass"];function nh(e,t){return t.some(n=>e[n]!==void 0)}function ob(e){let t={velocity:ce.velocity,stiffness:ce.stiffness,damping:ce.damping,mass:ce.mass,isResolvedFromDuration:!1,...e};if(!nh(e,sb)&&nh(e,ib))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*It(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ce.mass,stiffness:i,damping:s}}else{const n=tb(e);t={...t,...n,mass:ce.mass},t.isResolvedFromDuration=!0}return t}function zo(e=ce.visualDuration,t=ce.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:f,velocity:m,isResolvedFromDuration:h}=ob({...n,velocity:-st(n.velocity||0)}),v=m||0,w=c/(2*Math.sqrt(l*d)),S=o-s,p=st(Math.sqrt(l/d)),g=Math.abs(S)<5;r||(r=g?ce.restSpeed.granular:ce.restSpeed.default),i||(i=g?ce.restDelta.granular:ce.restDelta.default);let y;if(w<1){const k=mc(p,w);y=C=>{const N=Math.exp(-w*p*C);return o-N*((v+w*p*S)/k*Math.sin(k*C)+S*Math.cos(k*C))}}else if(w===1)y=k=>o-Math.exp(-p*k)*(S+(v+p*S)*k);else{const k=p*Math.sqrt(w*w-1);y=C=>{const N=Math.exp(-w*p*C),T=Math.min(k*C,300);return o-N*((v+w*p*S)*Math.sinh(T)+k*S*Math.cosh(T))/k}}const b={calculatedDuration:h&&f||null,next:k=>{const C=y(k);if(h)a.done=k>=f;else{let N=k===0?v:0;w<1&&(N=k===0?lt(v):b0(y,k,C));const T=Math.abs(N)<=r,E=Math.abs(o-C)<=i;a.done=T&&E}return a.value=a.done?o:C,a},toString:()=>{const k=Math.min(qu(b),Lo),C=S0(N=>b.next(k*N).value,k,30);return k+"ms "+C},toTransition:()=>{}};return b}zo.applyToOptions=e=>{const t=JS(e,100,zo);return e.ease=t.ease,e.duration=lt(t.duration),e.type="keyframes",e};function pc({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const f=e[0],m={done:!1,value:f},h=T=>a!==void 0&&T<a||l!==void 0&&T>l,v=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let w=n*t;const S=f+w,p=o===void 0?S:o(S);p!==S&&(w=p-f);const g=T=>-w*Math.exp(-T/r),y=T=>p+g(T),b=T=>{const E=g(T),P=y(T);m.done=Math.abs(E)<=c,m.value=m.done?p:P};let k,C;const N=T=>{h(m.value)&&(k=T,C=zo({keyframes:[m.value,v(m.value)],velocity:b0(y,T,m.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return N(0),{calculatedDuration:null,next:T=>{let E=!1;return!C&&k===void 0&&(E=!0,b(T),N(T)),k!==void 0&&T>=k?C.next(T-k):(!E&&b(T),m)}}}function ab(e,t,n){const r=[],i=n||qt.mix||w0,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||at:t;a=ds(l,a)}r.push(a)}return r}function lb(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Gr(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=ab(t,r,i),l=a.length,c=d=>{if(o&&d<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const m=Ji(e[f],e[f+1],d);return a[f](m)};return n?d=>c(It(e[0],e[s-1],d)):c}function cb(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ji(0,t,r);e.push(de(n,1,i))}}function ub(e){const t=[0];return cb(t,e.length-1),t}function db(e,t){return e.map(n=>n*t)}function fb(e,t){return e.map(()=>t||c0).splice(0,e.length-1)}function Mi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=CS(r)?r.map(Xf):Xf(r),s={done:!1,value:t[0]},o=db(n&&n.length===t.length?n:ub(t),e),a=lb(o,t,{ease:Array.isArray(i)?i:fb(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const hb=e=>e!==null;function Zu(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(hb),a=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const mb={decay:pc,inertia:pc,tween:Mi,keyframes:Mi,spring:zo};function k0(e){typeof e.type=="string"&&(e.type=mb[e.type])}class Ju{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const pb=e=>e/100;class ed extends Ju{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Le.now()&&this.tick(Le.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;k0(t);const{type:n=Mi,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Mi;l!==Mi&&typeof a[0]!="number"&&(this.mixKeyframes=ds(pb,w0(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=qu(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:f,repeatType:m,repeatDelay:h,type:v,onUpdate:w,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const p=this.currentTime-c*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?p<0:p>i;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let y=this.currentTime,b=r;if(f){const T=Math.min(this.currentTime,i)/a;let E=Math.floor(T),P=T%1;!P&&T>=1&&(P=1),P===1&&E--,E=Math.min(E,f+1),!!(E%2)&&(m==="reverse"?(P=1-P,h&&(P-=h/a)):m==="mirror"&&(b=o)),y=It(0,1,P)*a}const k=g?{done:!1,value:d[0]}:b.next(y);s&&(k.value=s(k.value));let{done:C}=k;!g&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return N&&v!==pc&&(k.value=Zu(d,this.options,S,this.speed)),w&&w(k.value),N&&this.finish(),k}then(t,n){return this.finished.then(t,n)}get duration(){return st(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+st(t)}get time(){return st(this.currentTime)}set time(t){var n;t=lt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Le.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=st(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=ZS,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(Le.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function gb(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Kn=e=>e*180/Math.PI,gc=e=>{const t=Kn(Math.atan2(e[1],e[0]));return yc(t)},yb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gc,rotateZ:gc,skewX:e=>Kn(Math.atan(e[1])),skewY:e=>Kn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},yc=e=>(e=e%360,e<0&&(e+=360),e),rh=gc,ih=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sh=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),vb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ih,scaleY:sh,scale:e=>(ih(e)+sh(e))/2,rotateX:e=>yc(Kn(Math.atan2(e[6],e[5]))),rotateY:e=>yc(Kn(Math.atan2(-e[2],e[0]))),rotateZ:rh,rotate:rh,skewX:e=>Kn(Math.atan(e[4])),skewY:e=>Kn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function vc(e){return e.includes("scale")?1:0}function xc(e,t){if(!e||e==="none")return vc(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=vb,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=yb,i=a}if(!i)return vc(t);const s=r[t],o=i[1].split(",").map(wb);return typeof s=="function"?s(o):o[s]}const xb=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return xc(n,t)};function wb(e){return parseFloat(e.trim())}const ei=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ti=new Set(ei),oh=e=>e===Jr||e===L,Sb=new Set(["x","y","z"]),bb=ei.filter(e=>!Sb.has(e));function kb(e){const t=[];return bb.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const gn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>xc(t,"x"),y:(e,{transform:t})=>xc(t,"y")};gn.translateX=gn.x;gn.translateY=gn.y;const Xn=new Set;let wc=!1,Sc=!1,bc=!1;function C0(){if(Sc){const e=Array.from(Xn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=kb(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Sc=!1,wc=!1,Xn.forEach(e=>e.complete(bc)),Xn.clear()}function T0(){Xn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Sc=!0)})}function Cb(){bc=!0,T0(),C0(),bc=!1}class td{constructor(t,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Xn.add(this),wc||(wc=!0,te.read(T0),te.resolveKeyframes(C0))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}gb(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Xn.delete(this)}cancel(){this.state==="scheduled"&&(Xn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Tb=e=>e.startsWith("--");function Nb(e,t,n){Tb(t)?e.style.setProperty(t,n):e.style[t]=n}const Eb={};function N0(e,t){const n=Jg(e);return()=>Eb[t]??n()}const Pb=N0(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),E0=N0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Si=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ah={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Si([0,.65,.55,1]),circOut:Si([.55,0,1,.45]),backIn:Si([.31,.01,.66,-.59]),backOut:Si([.33,1.53,.69,.99])};function P0(e,t){if(e)return typeof e=="function"?E0()?S0(e,t):"ease-out":u0(e)?Si(e):Array.isArray(e)?e.map(n=>P0(n,t)||ah.easeOut):ah[e]}function jb(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const f=P0(a,i);Array.isArray(f)&&(d.easing=f);const m={delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(d,m)}function j0(e){return typeof e=="function"&&"applyToOptions"in e}function Ab({type:e,...t}){return j0(e)&&E0()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class A0 extends Ju{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,Gr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=Ab(t);this.animation=jb(n,r,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=Zu(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):Nb(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return st(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+st(t)}get time(){return st(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=lt(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Pb()?(this.animation.timeline=t,at):n(this)}}const R0={anticipate:o0,backInOut:s0,circInOut:l0};function Rb(e){return e in R0}function Mb(e){typeof e.ease=="string"&&Rb(e.ease)&&(e.ease=R0[e.ease])}const el=10;class Db extends A0{constructor(t){Mb(t),k0(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new ed({...o,autoplay:!1}),l=Math.max(el,Le.now()-this.startTime),c=It(0,el,l-el);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const lh=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Nt.test(e)||e==="0")&&!e.startsWith("url("));function _b(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Lb(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=lh(i,t),a=lh(s,t);return la(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:_b(e)||(n==="spring"||j0(n))&&r}function kc(e){e.duration=0,e.type="keyframes"}const zb=new Set(["opacity","clipPath","filter","transform"]),Ib=Jg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Vb(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return Ib()&&n&&zb.has(n)&&(n!=="transform"||!c)&&!l&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const Ob=40;class Fb extends Ju{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:d,...f}){var v;super(),this.stop=()=>{var w,S;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(S=this.keyframeResolver)==null||S.cancel()},this.createdAt=Le.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:l,motionValue:c,element:d,...f},h=(d==null?void 0:d.KeyframeResolver)||td;this.keyframeResolver=new h(a,(w,S,p)=>this.onKeyframesResolved(w,S,m,!p),l,c,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,i){var S,p;this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:d}=r;this.resolvedAt=Le.now(),Lb(t,s,o,a)||((qt.instantAnimations||!l)&&(d==null||d(Zu(t,r,n))),t[0]=t[t.length-1],kc(r),r.repeat=0);const m={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Ob?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&Vb(m),v=(p=(S=m.motionValue)==null?void 0:S.owner)==null?void 0:p.current,w=h?new Db({...m,element:v}):new ed(m);w.finished.then(()=>{this.notifyFinished()}).catch(at),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Cb()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function M0(e,t,n,r=0,i=1){const s=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(s,o):i===1?s*r:a-s*r}const $b=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bb(e){const t=$b.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const Ub=4;function D0(e,t,n=1){Gr(n<=Ub,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=Bb(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Qg(o)?parseFloat(o):o}return Gu(i)?D0(i,t,n+1):i}const Hb={type:"spring",stiffness:500,damping:25,restSpeed:10},Wb=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Kb={type:"keyframes",duration:.8},Gb={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yb=(e,{keyframes:t})=>t.length>2?Kb:ti.has(e)?e.startsWith("scale")?Wb(t[1]):Hb:Gb,Xb=e=>e!==null;function Qb(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Xb),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}function _0(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function nd(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?_0(n,e):n}function qb({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const rd=(e,t,n,r={},i,s)=>o=>{const a=nd(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-lt(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};qb(a)||Object.assign(d,Yb(e,d)),d.duration&&(d.duration=lt(d.duration)),d.repeatDelay&&(d.repeatDelay=lt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(kc(d),d.delay===0&&(f=!0)),(qt.instantAnimations||qt.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(f=!0,kc(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const m=Qb(d.keyframes,a);if(m!==void 0){te.update(()=>{d.onUpdate(m),d.onComplete()});return}}return a.isSync?new ed(d):new Fb(d)};function ch(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function id(e,t,n,r){if(typeof t=="function"){const[i,s]=ch(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=ch(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function _r(e,t,n){const r=e.getProps();return id(r,t,n!==void 0?n:r.custom,e)}const L0=new Set(["width","height","top","left","right","bottom",...ei]),uh=30,Zb=e=>!isNaN(parseFloat(e));class Jb{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=Le.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Zb(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Hu);const r=this.events[t].add(n);return t==="change"?()=>{r(),te.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>uh)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,uh);return e0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yr(e,t){return new Jb(e,t)}const Cc=e=>Array.isArray(e);function ek(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yr(n))}function tk(e){return Cc(e)?e[e.length-1]||0:e}function nk(e,t){const n=_r(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=tk(s[o]);ek(e,o,a)}}const Re=e=>!!(e&&e.getVelocity);function rk(e){return!!(Re(e)&&e.add)}function Tc(e,t){const n=e.getValue("willChange");if(rk(n))return n.add(t);if(!n&&qt.WillChange){const r=new qt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function sd(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ik="framerAppearId",z0="data-"+sd(ik);function I0(e){return e.props[z0]}function sk({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function V0(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();s=s?_0(s,l):l;const c=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=i&&e.animationState&&e.animationState.getState()[i];for(const m in a){const h=e.getValue(m,e.latestValues[m]??null),v=a[m];if(v===void 0||f&&sk(f,m))continue;const w={delay:n,...nd(s||{},m)},S=h.get();if(S!==void 0&&!h.isAnimating&&!Array.isArray(v)&&v===S&&!w.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const b=I0(e);if(b){const k=window.MotionHandoffAnimation(b,m,te);k!==null&&(w.startTime=k,p=!0)}}Tc(e,m);const g=c??e.shouldReduceMotion;h.start(rd(m,h,v,g&&L0.has(m)?{type:!1}:w,e,p));const y=h.animation;y&&d.push(y)}if(o){const m=()=>te.update(()=>{o&&nk(e,o)});d.length?Promise.all(d).then(m):m()}return d}function Nc(e,t,n={}){var l;const r=_r(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(V0(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:m}=i;return ok(e,t,c,d,f,m,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,d]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function ok(e,t,n=0,r=0,i=0,s=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Nc(l,t,{...o,delay:n+(typeof r=="function"?0:r)+M0(e.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function ak(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Nc(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Nc(e,t,n);else{const i=typeof t=="function"?_r(e,t,n.custom):t;r=Promise.all(V0(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const lk={test:e=>e==="auto",parse:e=>e},O0=e=>t=>t.test(e),F0=[Jr,L,zt,ln,zS,LS,lk],dh=e=>F0.find(O0(e));function ck(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zg(e):!0}const uk=new Set(["brightness","contrast","saturate","opacity"]);function dk(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yu)||[];if(!r)return e;const i=n.replace(r,"");let s=uk.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const fk=/\b([a-z-]*)\(.*?\)/gu,Ec={...Nt,getAnimatableNone:e=>{const t=e.match(fk);return t?t.map(dk).join(" "):e}},Pc={...Nt,getAnimatableNone:e=>{const t=Nt.parse(e);return Nt.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},fh={...Jr,transform:Math.round},hk={rotate:ln,rotateX:ln,rotateY:ln,rotateZ:ln,scale:Is,scaleX:Is,scaleY:Is,scaleZ:Is,skew:ln,skewX:ln,skewY:ln,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:es,originX:Zf,originY:Zf,originZ:L},od={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,fontSize:L,backgroundPositionX:L,backgroundPositionY:L,...hk,zIndex:fh,fillOpacity:es,strokeOpacity:es,numOctaves:fh},mk={...od,color:ye,backgroundColor:ye,outlineColor:ye,fill:ye,stroke:ye,borderColor:ye,borderTopColor:ye,borderRightColor:ye,borderBottomColor:ye,borderLeftColor:ye,filter:Ec,WebkitFilter:Ec,mask:Pc,WebkitMask:Pc},$0=e=>mk[e],pk=new Set([Ec,Pc]);function B0(e,t){let n=$0(e);return pk.has(n)||(n=Nt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const gk=new Set(["auto","none","0"]);function yk(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!gk.has(s)&&ts(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=B0(n,i)}class vk extends td{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),Gu(f))){const m=D0(f,n.current);m!==void 0&&(t[d]=m),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!L0.has(r)||t.length!==2)return;const[i,s]=t,o=dh(i),a=dh(s),l=qf(i),c=qf(s);if(l!==c&&gn[r]){this.needsMeasurement=!0;return}if(o!==a)if(oh(o)&&oh(a))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else gn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||ck(t[i]))&&r.push(i);r.length&&yk(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=gn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const xk=new Set(["opacity","clipPath","filter","transform"]);function U0(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const H0=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function jc(e){return qg(e)&&"offsetHeight"in e}const{schedule:ad,cancel:XE}=d0(queueMicrotask,!1),wt={x:!1,y:!1};function W0(){return wt.x||wt.y}function wk(e){return e==="x"||e==="y"?wt[e]?null:(wt[e]=!0,()=>{wt[e]=!1}):wt.x||wt.y?null:(wt.x=wt.y=!0,()=>{wt.x=wt.y=!1})}function K0(e,t){const n=U0(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Sk(e){return!(e.pointerType==="touch"||W0())}function bk(e,t,n={}){const[r,i,s]=K0(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const d=()=>{o.removeEventListener("pointerleave",v)},f=S=>{c&&(c(S),c=void 0),d()},m=S=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),l&&(l=!1,f(S))},h=()=>{a=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},v=S=>{if(S.pointerType!=="touch"){if(a){l=!0;return}f(S)}},w=S=>{if(!Sk(S))return;l=!1;const p=t(o,S);typeof p=="function"&&(c=p,o.addEventListener("pointerleave",v,i))};o.addEventListener("pointerenter",w,i),o.addEventListener("pointerdown",h,i)}),s}const G0=(e,t)=>t?e===t?!0:G0(e,t.parentElement):!1,ld=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,kk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ck(e){return kk.has(e.tagName)||e.isContentEditable===!0}const Tk=new Set(["INPUT","SELECT","TEXTAREA"]);function Nk(e){return Tk.has(e.tagName)||e.isContentEditable===!0}const to=new WeakSet;function hh(e){return t=>{t.key==="Enter"&&e(t)}}function tl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ek=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=hh(()=>{if(to.has(n))return;tl(n,"down");const i=hh(()=>{tl(n,"up")}),s=()=>tl(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function mh(e){return ld(e)&&!W0()}const ph=new WeakSet;function Pk(e,t,n={}){const[r,i,s]=K0(e,n),o=a=>{const l=a.currentTarget;if(!mh(a)||ph.has(a))return;to.add(l),n.stopPropagation&&ph.add(a);const c=t(l,a),d=(h,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",m),to.has(l)&&to.delete(l),mh(h)&&typeof c=="function"&&c(h,{success:v})},f=h=>{d(h,l===window||l===document||n.useGlobalTarget||G0(l,h.target))},m=h=>{d(h,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",m,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),jc(a)&&(a.addEventListener("focus",c=>Ek(c,i)),!Ck(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function cd(e){return qg(e)&&"ownerSVGElement"in e}const no=new WeakMap;let cn;const Y0=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:cd(r)&&"getBBox"in r?r.getBBox()[t]:r[n],jk=Y0("inline","width","offsetWidth"),Ak=Y0("block","height","offsetHeight");function Rk({target:e,borderBoxSize:t}){var n;(n=no.get(e))==null||n.forEach(r=>{r(e,{get width(){return jk(e,t)},get height(){return Ak(e,t)}})})}function Mk(e){e.forEach(Rk)}function Dk(){typeof ResizeObserver>"u"||(cn=new ResizeObserver(Mk))}function _k(e,t){cn||Dk();const n=U0(e);return n.forEach(r=>{let i=no.get(r);i||(i=new Set,no.set(r,i)),i.add(t),cn==null||cn.observe(r)}),()=>{n.forEach(r=>{const i=no.get(r);i==null||i.delete(t),i!=null&&i.size||cn==null||cn.unobserve(r)})}}const ro=new Set;let kr;function Lk(){kr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ro.forEach(t=>t(e))},window.addEventListener("resize",kr)}function zk(e){return ro.add(e),kr||Lk(),()=>{ro.delete(e),!ro.size&&typeof kr=="function"&&(window.removeEventListener("resize",kr),kr=void 0)}}function gh(e,t){return typeof e=="function"?zk(e):_k(e,t)}function Ik(e){return cd(e)&&e.tagName==="svg"}const Vk=[...F0,ye,Nt],Ok=e=>Vk.find(O0(e)),yh=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cr=()=>({x:yh(),y:yh()}),vh=()=>({min:0,max:0}),xe=()=>({x:vh(),y:vh()}),Fk=new WeakMap;function ca(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ns(e){return typeof e=="string"||Array.isArray(e)}const ud=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dd=["initial",...ud];function ua(e){return ca(e.animate)||dd.some(t=>ns(e[t]))}function X0(e){return!!(ua(e)||e.variants)}function $k(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Re(i))e.addValue(r,i);else if(Re(s))e.addValue(r,Yr(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Yr(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ac={current:null},Q0={current:!1},Bk=typeof window<"u";function Uk(){if(Q0.current=!0,!!Bk)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ac.current=e.matches;e.addEventListener("change",t),t()}else Ac.current=!1}const xh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Io={};function q0(e){Io=e}function Hk(){return Io}class Wk{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:a},l={}){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=td,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 h=Le.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,te.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=ua(n),this.isVariantNode=X0(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in m){const v=m[h];c[h]!==void 0&&Re(v)&&v.set(c[h])}}mount(t){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,Fk.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Q0.current||Uk(),this.shouldReduceMotion=Ac.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),En(this.notifyUpdate),En(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&xk.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:d}=n.accelerate,f=new A0({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:lt(d)}),m=o(f);this.valueSubscriptions.set(t,()=>{m(),f.cancel()});return}const r=ti.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&te.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Io){const n=Io[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<xh.length;r++){const i=xh[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=$k(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Yr(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Qg(r)||Zg(r))?r=parseFloat(r):!Ok(r)&&Nt.test(n)&&(r=B0(t,n)),this.setBaseTarget(t,Re(r)?r.get():r)),Re(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=id(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Re(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Hu),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ad.render(this.render)}}class Z0 extends Wk{constructor(){super(...arguments),this.KeyframeResolver=vk}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Re(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Mn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function J0({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Kk({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gk(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function nl(e){return e===void 0||e===1}function Rc({scale:e,scaleX:t,scaleY:n}){return!nl(e)||!nl(t)||!nl(n)}function On(e){return Rc(e)||ey(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ey(e){return wh(e.x)||wh(e.y)}function wh(e){return e&&e!=="0%"}function Vo(e,t,n){const r=e-n,i=t*r;return n+i}function Sh(e,t,n,r,i){return i!==void 0&&(e=Vo(e,i,r)),Vo(e,n,r)+t}function Mc(e,t=0,n=1,r,i){e.min=Sh(e.min,t,n,r,i),e.max=Sh(e.max,t,n,r,i)}function ty(e,{x:t,y:n}){Mc(e.x,t.translate,t.scale,t.originPoint),Mc(e.y,n.translate,n.scale,n.originPoint)}const bh=.999999999999,kh=1.0000000000001;function Yk(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Nr(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ty(e,o)),r&&On(s.latestValues)&&Nr(e,s.latestValues))}t.x<kh&&t.x>bh&&(t.x=1),t.y<kh&&t.y>bh&&(t.y=1)}function Tr(e,t){e.min=e.min+t,e.max=e.max+t}function Ch(e,t,n,r,i=.5){const s=de(e.min,e.max,i);Mc(e,t,n,s,r)}function Nr(e,t){Ch(e.x,t.x,t.scaleX,t.scale,t.originX),Ch(e.y,t.y,t.scaleY,t.scale,t.originY)}function ny(e,t){return J0(Gk(e.getBoundingClientRect(),t))}function Xk(e,t,n){const r=ny(e,n),{scroll:i}=t;return i&&(Tr(r.x,i.offset.x),Tr(r.y,i.offset.y)),r}const Qk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qk=ei.length;function Zk(e,t,n){let r="",i=!0;for(let s=0;s<qk;s++){const o=ei[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const c=parseFloat(a);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=H0(a,od[o]);if(!l){i=!1;const d=Qk[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function fd(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(ti.has(l)){o=!0;continue}else if(h0(l)){i[l]=c;continue}else{const d=H0(c,od[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=Zk(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${c} ${d}`}}function ry(e,{style:t,vars:n},r,i){const s=e.style;let o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function Th(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const mi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(L.test(e))e=parseFloat(e);else return e;const n=Th(e,t.target.x),r=Th(e,t.target.y);return`${n}% ${r}%`}},Jk={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Nt.parse(e);if(i.length>5)return r;const s=Nt.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=de(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}},Dc={borderRadius:{...mi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mi,borderTopRightRadius:mi,borderBottomLeftRadius:mi,borderBottomRightRadius:mi,boxShadow:Jk};function iy(e,{layout:t,layoutId:n}){return ti.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Dc[e]||e==="opacity")}function hd(e,t,n){var o;const r=e.style,i=t==null?void 0:t.style,s={};if(!r)return s;for(const a in r)(Re(r[a])||i&&Re(i[a])||iy(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function eC(e){return window.getComputedStyle(e)}class tC extends Z0{constructor(){super(...arguments),this.type="html",this.renderInstance=ry}readValueFromInstance(t,n){var r;if(ti.has(n))return(r=this.projection)!=null&&r.isProjecting?vc(n):xb(t,n);{const i=eC(t),s=(h0(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ny(t,n)}build(t,n,r){fd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return hd(t,n,r)}}const nC={offset:"stroke-dashoffset",array:"stroke-dasharray"},rC={offset:"strokeDashoffset",array:"strokeDasharray"};function iC(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?nC:rC;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const sC=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function sy(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,c,d){if(fd(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:m}=e;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const h of sC)f[h]!==void 0&&(m[h]=f[h],delete f[h]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&iC(f,i,s,o,!1)}const oy=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"]),ay=e=>typeof e=="string"&&e.toLowerCase()==="svg";function oC(e,t,n,r){ry(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(oy.has(i)?i:sd(i),t.attrs[i])}function ly(e,t,n){const r=hd(e,t,n);for(const i in e)if(Re(e[i])||Re(t[i])){const s=ei.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}class aC extends Z0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ti.has(n)){const r=$0(n);return r&&r.default||0}return n=oy.has(n)?n:sd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ly(t,n,r)}build(t,n,r){sy(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){oC(t,n,r,i)}mount(t){this.isSVGTag=ay(t.tagName),super.mount(t)}}const lC=dd.length;function cy(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?cy(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lC;n++){const r=dd[n],i=e.props[r];(ns(i)||i===!1)&&(t[r]=i)}return t}function uy(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const cC=[...ud].reverse(),uC=ud.length;function dC(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ak(e,n,r)))}function fC(e){let t=dC(e),n=Nh(),r=!0;const i=l=>(c,d)=>{var m;const f=_r(e,d,l==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(f){const{transition:h,transitionEnd:v,...w}=f;c={...c,...w,...v}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=cy(e.parent)||{},f=[],m=new Set;let h={},v=1/0;for(let S=0;S<uC;S++){const p=cC[S],g=n[p],y=c[p]!==void 0?c[p]:d[p],b=ns(y),k=p===l?g.isActive:null;k===!1&&(v=S);let C=y===d[p]&&y!==c[p]&&b;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),g.protectedKeys={...h},!g.isActive&&k===null||!y&&!g.prevProp||ca(y)||typeof y=="boolean")continue;if(p==="exit"&&g.isActive&&k!==!0){g.prevResolvedValues&&(h={...h,...g.prevResolvedValues});continue}const N=hC(g.prevProp,y);let T=N||p===l&&g.isActive&&!C&&b||S>v&&b,E=!1;const P=Array.isArray(y)?y:[y];let z=P.reduce(i(p),{});k===!1&&(z={});const{prevResolvedValues:I={}}=g,J={...I,...z},le=$=>{T=!0,m.has($)&&(E=!0,m.delete($)),g.needsAnimating[$]=!0;const j=e.getValue($);j&&(j.liveStyle=!1)};for(const $ in J){const j=z[$],A=I[$];if(h.hasOwnProperty($))continue;let D=!1;Cc(j)&&Cc(A)?D=!uy(j,A):D=j!==A,D?j!=null?le($):m.add($):j!==void 0&&m.has($)?le($):g.protectedKeys[$]=!0}g.prevProp=y,g.prevResolvedValues=z,g.isActive&&(h={...h,...z}),r&&e.blockInitialAnimation&&(T=!1);const pe=C&&N;T&&(!pe||E)&&f.push(...P.map($=>{const j={type:p};if(typeof $=="string"&&r&&!pe&&e.manuallyAnimateOnMount&&e.parent){const{parent:A}=e,D=_r(A,$);if(A.enteringChildren&&D){const{delayChildren:W}=D.transition||{};j.delay=M0(A.enteringChildren,e,W)}}return{animation:$,options:j}}))}if(m.size){const S={};if(typeof c.initial!="boolean"){const p=_r(e,Array.isArray(c.initial)?c.initial[0]:c.initial);p&&p.transition&&(S.transition=p.transition)}m.forEach(p=>{const g=e.getBaseTarget(p),y=e.getValue(p);y&&(y.liveStyle=!0),S[p]=g??null}),f.push({animation:S})}let w=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function a(l,c){var f;if(n[l].isActive===c)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(m=>{var h;return(h=m.animationState)==null?void 0:h.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const m in n)n[m].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Nh()}}}function hC(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!uy(t,e):!1}function zn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Nh(){return{animate:zn(!0),whileInView:zn(),whileHover:zn(),whileTap:zn(),whileDrag:zn(),whileFocus:zn(),exit:zn()}}function Eh(e,t){e.min=t.min,e.max=t.max}function xt(e,t){Eh(e.x,t.x),Eh(e.y,t.y)}function Ph(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const dy=1e-4,mC=1-dy,pC=1+dy,fy=.01,gC=0-fy,yC=0+fy;function ze(e){return e.max-e.min}function vC(e,t,n){return Math.abs(e-t)<=n}function jh(e,t,n,r=.5){e.origin=r,e.originPoint=de(t.min,t.max,e.origin),e.scale=ze(n)/ze(t),e.translate=de(n.min,n.max,e.origin)-e.originPoint,(e.scale>=mC&&e.scale<=pC||isNaN(e.scale))&&(e.scale=1),(e.translate>=gC&&e.translate<=yC||isNaN(e.translate))&&(e.translate=0)}function Di(e,t,n,r){jh(e.x,t.x,n.x,r?r.originX:void 0),jh(e.y,t.y,n.y,r?r.originY:void 0)}function Ah(e,t,n){e.min=n.min+t.min,e.max=e.min+ze(t)}function xC(e,t,n){Ah(e.x,t.x,n.x),Ah(e.y,t.y,n.y)}function Rh(e,t,n){e.min=t.min-n.min,e.max=e.min+ze(t)}function Oo(e,t,n){Rh(e.x,t.x,n.x),Rh(e.y,t.y,n.y)}function Mh(e,t,n,r,i){return e-=t,e=Vo(e,1/n,r),i!==void 0&&(e=Vo(e,1/i,r)),e}function wC(e,t=0,n=1,r=.5,i,s=e,o=e){if(zt.test(t)&&(t=parseFloat(t),t=de(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=de(s.min,s.max,r);e===s&&(a-=t),e.min=Mh(e.min,t,n,a,i),e.max=Mh(e.max,t,n,a,i)}function Dh(e,t,[n,r,i],s,o){wC(e,t[n],t[r],t[i],t.scale,s,o)}const SC=["x","scaleX","originX"],bC=["y","scaleY","originY"];function _h(e,t,n,r){Dh(e.x,t,SC,n?n.x:void 0,r?r.x:void 0),Dh(e.y,t,bC,n?n.y:void 0,r?r.y:void 0)}function Lh(e){return e.translate===0&&e.scale===1}function hy(e){return Lh(e.x)&&Lh(e.y)}function zh(e,t){return e.min===t.min&&e.max===t.max}function kC(e,t){return zh(e.x,t.x)&&zh(e.y,t.y)}function Ih(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function my(e,t){return Ih(e.x,t.x)&&Ih(e.y,t.y)}function Vh(e){return ze(e.x)/ze(e.y)}function Oh(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Rt(e){return[e("x"),e("y")]}function CC(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:f,rotateY:m,skewX:h,skewY:v}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),m&&(r+=`rotateY(${m}deg) `),h&&(r+=`skewX(${h}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const py=["TopLeft","TopRight","BottomLeft","BottomRight"],TC=py.length,Fh=e=>typeof e=="string"?parseFloat(e):e,$h=e=>typeof e=="number"||L.test(e);function NC(e,t,n,r,i,s){i?(e.opacity=de(0,n.opacity??1,EC(r)),e.opacityExit=de(t.opacity??1,0,PC(r))):s&&(e.opacity=de(t.opacity??1,n.opacity??1,r));for(let o=0;o<TC;o++){const a=`border${py[o]}Radius`;let l=Bh(t,a),c=Bh(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||$h(l)===$h(c)?(e[a]=Math.max(de(Fh(l),Fh(c),r),0),(zt.test(c)||zt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=de(t.rotate||0,n.rotate||0,r))}function Bh(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const EC=gy(0,.5,a0),PC=gy(.5,.95,at);function gy(e,t,n){return r=>r<e?0:r>t?1:n(Ji(e,t,r))}function jC(e,t,n){const r=Re(e)?e:Yr(e);return r.start(rd("",r,t,n)),r.animation}function rs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const AC=(e,t)=>e.depth-t.depth;class RC{constructor(){this.children=[],this.isDirty=!1}add(t){Uu(this.children,t),this.isDirty=!0}remove(t){Do(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(AC),this.isDirty=!1,this.children.forEach(t)}}function MC(e,t){const n=Le.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(En(r),e(s-t))};return te.setup(r,!0),()=>En(r)}function io(e){return Re(e)?e.get():e}class DC{constructor(){this.members=[]}add(t){Uu(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const i=r.instance;i&&i.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&Do(this.members,r)}t.scheduleRender()}remove(t){if(Do(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i],o=s.instance;if(s.isPresent!==!1&&(!o||o.isConnected!==!1)){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const i=r.options.layoutDependency,s=t.options.layoutDependency;if(!(i!==void 0&&s!==void 0&&i===s)){const l=r.instance;l&&l.isConnected===!1&&!r.snapshot||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:a}=t.options;a===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const so={hasAnimatedSinceResize:!0,hasEverUpdated:!1},rl=["","X","Y","Z"],_C=1e3;let LC=0;function il(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=I0(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",te,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yy(r)}function vy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=LC++,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(VC),this.nodes.forEach(BC),this.nodes.forEach(UC),this.nodes.forEach(OC)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new RC)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Hu),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=cd(o)&&!Ik(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let d,f=0;const m=()=>this.root.updateBlockedByResize=!1;te.read(()=>{f=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,d&&d(),d=MC(m,250),so.hasAnimatedSinceResize&&(so.hasAnimatedSinceResize=!1,this.nodes.forEach(Wh)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||c.getDefaultTransition()||YC,{onLayoutAnimationStart:w,onLayoutAnimationComplete:S}=c.getProps(),p=!this.targetLayout||!my(this.targetLayout,h),g=!f&&m;if(this.options.layoutRoot||this.resumeFrom||g||f&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...nd(v,"layout"),onPlay:w,onComplete:S};(c.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,g)}else f||Wh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),En(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(HC),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Uh);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Hh);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach($C),this.nodes.forEach(zC),this.nodes.forEach(IC)):this.nodes.forEach(Hh),this.clearAllSnapshots();const a=Le.now();Te.delta=It(0,1e3/60,a-Te.timestamp),Te.timestamp=a,Te.isProcessing=!0,Xa.update.process(Te),Xa.preRender.process(Te),Xa.render.process(Te),Te.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ad.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(FC),this.sharedNodes.forEach(WC)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ze(this.snapshot.measuredBox.x)&&!ze(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=xe(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!hy(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||On(this.latestValues)||d)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),XC(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return xe();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(QC))){const{scroll:d}=this.root;d&&(Tr(a.x,d.offset.x),Tr(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=xe();if(xt(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:f,options:m}=d;d!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&xt(a,o),Tr(a.x,f.offset.x),Tr(a.y,f.offset.y))}return a}applyTransform(o,a=!1){const l=xe();xt(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Nr(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),On(d.latestValues)&&Nr(l,d.latestValues)}return On(this.latestValues)&&Nr(l,this.latestValues),l}removeTransform(o){const a=xe();xt(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!On(c.latestValues))continue;Rc(c.latestValues)&&c.updateSnapshot();const d=xe(),f=c.measurePageBox();xt(d,f),_h(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return On(this.latestValues)&&_h(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Te.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=Te.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xe(),this.targetWithTransforms=xe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xC(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xt(this.target,this.layout.layoutBox),ty(this.target,this.targetDelta)):xt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Rc(this.parent.latestValues)||ey(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xe(),this.relativeTargetOrigin=xe(),Oo(this.relativeTargetOrigin,a,l),xt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var v;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Te.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;xt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;Yk(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=xe());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ph(this.prevProjectionDelta.x,this.projectionDelta.x),Ph(this.prevProjectionDelta.y,this.projectionDelta.y)),Di(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Oh(this.projectionDelta.x,this.prevProjectionDelta.x)||!Oh(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Cr(),this.projectionDelta=Cr(),this.projectionDeltaWithTransform=Cr()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},f=Cr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const m=xe(),h=l?l.source:void 0,v=this.layout?this.layout.source:void 0,w=h!==v,S=this.getStack(),p=!S||S.members.length<=1,g=!!(w&&!p&&this.options.crossfade===!0&&!this.path.some(GC));this.animationProgress=0;let y;this.mixTargetDelta=b=>{const k=b/1e3;Kh(f.x,o.x,k),Kh(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Oo(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),KC(this.relativeTarget,this.relativeTargetOrigin,m,k),y&&kC(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=xe()),xt(y,this.relativeTarget)),w&&(this.animationValues=d,NC(d,c,this.latestValues,k,g,p)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(En(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=te.update(()=>{so.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Yr(0)),this.currentAnimation=jC(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_C),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&xy(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||xe();const f=ze(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const m=ze(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+m}xt(a,l),Nr(a,d),Di(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new DC),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&il("z",o,c,this.animationValues);for(let d=0;d<rl.length;d++)il(`rotate${rl[d]}`,o,c,this.animationValues),il(`skew${rl[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=io(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=io(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!On(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=CC(this.projectionDeltaWithTransform,this.treeScale,d);l&&(f=l(d,f)),o.transform=f;const{x:m,y:h}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${h.origin*100}% 0`,c.animationValues?o.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in Dc){if(d[v]===void 0)continue;const{correct:w,applyTo:S,isCSSVariable:p}=Dc[v],g=f==="none"?d[v]:w(d[v],c);if(S){const y=S.length;for(let b=0;b<y;b++)o[S[b]]=g}else p?this.options.visualElement.renderState.vars[v]=g:o[v]=g}this.options.layoutId&&(o.pointerEvents=c===this?io(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Uh),this.root.sharedNodes.clear()}}}function zC(e){e.updateLayout()}function IC(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?Rt(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],h=ze(m);m.min=r[f].min,m.max=m.min+h}):xy(s,t.layoutBox,r)&&Rt(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],h=ze(r[f]);m.max=m.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const a=Cr();Di(a,r,t.layoutBox);const l=Cr();o?Di(l,e.applyTransform(i,!0),t.measuredBox):Di(l,r,t.layoutBox);const c=!hy(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:h}=f;if(m&&h){const v=xe();Oo(v,t.layoutBox,m.layoutBox);const w=xe();Oo(w,r,h.layoutBox),my(v,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function VC(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function OC(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function FC(e){e.clearSnapshot()}function Uh(e){e.clearMeasurements()}function Hh(e){e.isLayoutDirty=!1}function $C(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wh(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function BC(e){e.resolveTargetDelta()}function UC(e){e.calcProjection()}function HC(e){e.resetSkewAndRotation()}function WC(e){e.removeLeadSnapshot()}function Kh(e,t,n){e.translate=de(t.translate,0,n),e.scale=de(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Gh(e,t,n,r){e.min=de(t.min,n.min,r),e.max=de(t.max,n.max,r)}function KC(e,t,n,r){Gh(e.x,t.x,n.x,r),Gh(e.y,t.y,n.y,r)}function GC(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const YC={duration:.45,ease:[.4,0,.1,1]},Yh=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Xh=Yh("applewebkit/")&&!Yh("chrome/")?Math.round:at;function Qh(e){e.min=Xh(e.min),e.max=Xh(e.max)}function XC(e){Qh(e.x),Qh(e.y)}function xy(e,t,n){return e==="position"||e==="preserve-aspect"&&!vC(Vh(t),Vh(n),.2)}function QC(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const qC=vy({attachResizeListener:(e,t)=>rs(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),sl={current:void 0},wy=vy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sl.current){const e=new qC({});e.mount(window),e.setOptions({layoutScroll:!0}),sl.current=e}return sl.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),md=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function qh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ZC(...e){return t=>{let n=!1;const r=e.map(i=>{const s=qh(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():qh(e[i],null)}}}}function JC(...e){return x.useCallback(ZC(...e),e)}class e2 extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=jc(r)&&r.offsetWidth||0,s=jc(r)&&r.offsetHeight||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left,o.bottom=s-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function t2({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:s}){var m;const o=x.useId(),a=x.useRef(null),l=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=x.useContext(md),d=((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref),f=JC(a,d);return x.useInsertionEffect(()=>{const{width:h,height:v,top:w,left:S,right:p,bottom:g}=l.current;if(t||s===!1||!a.current||!h||!v)return;const y=n==="left"?`left: ${S}`:`right: ${p}`,b=r==="bottom"?`bottom: ${g}`:`top: ${w}`;a.current.dataset.motionPopId=o;const k=document.createElement("style");c&&(k.nonce=c);const C=i??document.head;return C.appendChild(k),k.sheet&&k.sheet.insertRule(`
277
+ aggression: 0.85`})})]})]})}),u.jsx("footer",{className:"border-t border-zinc-800 px-4 py-4",children:u.jsxs("div",{className:"max-w-2xl mx-auto flex items-center justify-between text-xs text-zinc-600",children:[u.jsx("div",{children:"fightbook v1.0"}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("a",{href:"https://github.com/resided/wallet-warriors",target:"_blank",rel:"noopener",children:"github"}),u.jsx("span",{children:"skills.md powered"})]})]})})]})}const $u=x.createContext({});function Bu(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const Yg=typeof window<"u",Xg=Yg?x.useLayoutEffect:x.useEffect,aa=x.createContext(null);function Uu(e,t){e.indexOf(t)===-1&&e.push(t)}function Do(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const It=(e,t,n)=>n>t?t:n<e?e:n;let la=()=>{},Gr=()=>{};const qt={},Qg=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function qg(e){return typeof e=="object"&&e!==null}const Zg=e=>/^0[^.\s]+$/u.test(e);function Jg(e){let t;return()=>(t===void 0&&(t=e()),t)}const at=e=>e,vS=(e,t)=>n=>t(e(n)),ds=(...e)=>e.reduce(vS),Ji=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Hu{constructor(){this.subscriptions=[]}add(t){return Uu(this.subscriptions,t),()=>Do(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const lt=e=>e*1e3,st=e=>e/1e3;function e0(e,t){return t?e*(1e3/t):0}const t0=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,xS=1e-7,wS=12;function SS(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=t0(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>xS&&++a<wS);return o}function fs(e,t,n,r){if(e===t&&n===r)return at;const i=s=>SS(s,0,1,e,n);return s=>s===0||s===1?s:t0(i(s),t,r)}const n0=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,r0=e=>t=>1-e(1-t),i0=fs(.33,1.53,.69,.99),Wu=r0(i0),s0=n0(Wu),o0=e=>(e*=2)<1?.5*Wu(e):.5*(2-Math.pow(2,-10*(e-1))),Ku=e=>1-Math.sin(Math.acos(e)),a0=r0(Ku),l0=n0(Ku),bS=fs(.42,0,1,1),kS=fs(0,0,.58,1),c0=fs(.42,0,.58,1),CS=e=>Array.isArray(e)&&typeof e[0]!="number",u0=e=>Array.isArray(e)&&typeof e[0]=="number",Yf={linear:at,easeIn:bS,easeInOut:c0,easeOut:kS,circIn:Ku,circInOut:l0,circOut:a0,backIn:Wu,backInOut:s0,backOut:i0,anticipate:o0},TS=e=>typeof e=="string",Xf=e=>{if(u0(e)){Gr(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return fs(t,n,r,i)}else if(TS(e))return Gr(Yf[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),Yf[e];return e},zs=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],Qf={value:null,addProjectionMetrics:null};function NS(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(f){o.has(f)&&(d.schedule(f),e()),l++,f(a)}const d={schedule:(f,m=!1,h=!1)=>{const w=h&&i?n:r;return m&&o.add(f),w.has(f)||w.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(a=f,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&Qf.value&&Qf.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(f))}};return d}const ES=40;function d0(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=zs.reduce((y,b)=>(y[b]=NS(s,t?b:void 0),y),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:d,update:f,preRender:m,render:h,postRender:v}=o,w=()=>{const y=qt.useManualTiming?i.timestamp:performance.now();n=!1,qt.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(y-i.timestamp,ES),1)),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),f.process(i),m.process(i),h.process(i),v.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(w))},S=()=>{n=!0,r=!0,i.isProcessing||e(w)};return{schedule:zs.reduce((y,b)=>{const k=o[b];return y[b]=(C,N=!1,T=!1)=>(n||S(),k.schedule(C,N,T)),y},{}),cancel:y=>{for(let b=0;b<zs.length;b++)o[zs[b]].cancel(y)},state:i,steps:o}}const{schedule:te,cancel:En,state:Te,steps:Xa}=d0(typeof requestAnimationFrame<"u"?requestAnimationFrame:at,!0);let eo;function PS(){eo=void 0}const Le={now:()=>(eo===void 0&&Le.set(Te.isProcessing||qt.useManualTiming?Te.timestamp:performance.now()),eo),set:e=>{eo=e,queueMicrotask(PS)}},f0=e=>t=>typeof t=="string"&&t.startsWith(e),h0=f0("--"),jS=f0("var(--"),Gu=e=>jS(e)?AS.test(e.split("/*")[0].trim()):!1,AS=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function qf(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Jr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},es={...Jr,transform:e=>It(0,1,e)},Is={...Jr,default:1},Ri=e=>Math.round(e*1e5)/1e5,Yu=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function RS(e){return e==null}const MS=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Xu=(e,t)=>n=>!!(typeof n=="string"&&MS.test(n)&&n.startsWith(e)||t&&!RS(n)&&Object.prototype.hasOwnProperty.call(n,t)),m0=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Yu);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},DS=e=>It(0,255,e),Qa={...Jr,transform:e=>Math.round(DS(e))},Wn={test:Xu("rgb","red"),parse:m0("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Qa.transform(e)+", "+Qa.transform(t)+", "+Qa.transform(n)+", "+Ri(es.transform(r))+")"};function _S(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const fc={test:Xu("#"),parse:_S,transform:Wn.transform},hs=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ln=hs("deg"),zt=hs("%"),L=hs("px"),LS=hs("vh"),zS=hs("vw"),Zf={...zt,parse:e=>zt.parse(e)/100,transform:e=>zt.transform(e*100)},br={test:Xu("hsl","hue"),parse:m0("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+zt.transform(Ri(t))+", "+zt.transform(Ri(n))+", "+Ri(es.transform(r))+")"},ye={test:e=>Wn.test(e)||fc.test(e)||br.test(e),parse:e=>Wn.test(e)?Wn.parse(e):br.test(e)?br.parse(e):fc.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Wn.transform(e):br.transform(e),getAnimatableNone:e=>{const t=ye.parse(e);return t.alpha=0,ye.transform(t)}},IS=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function VS(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Yu))==null?void 0:t.length)||0)+(((n=e.match(IS))==null?void 0:n.length)||0)>0}const p0="number",g0="color",OS="var",FS="var(",Jf="${}",$S=/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 ts(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace($S,l=>(ye.test(l)?(r.color.push(s),i.push(g0),n.push(ye.parse(l))):l.startsWith(FS)?(r.var.push(s),i.push(OS),n.push(l)):(r.number.push(s),i.push(p0),n.push(parseFloat(l))),++s,Jf)).split(Jf);return{values:n,split:a,indexes:r,types:i}}function y0(e){return ts(e).values}function v0(e){const{split:t,types:n}=ts(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===p0?s+=Ri(i[o]):a===g0?s+=ye.transform(i[o]):s+=i[o]}return s}}const BS=e=>typeof e=="number"?0:ye.test(e)?ye.getAnimatableNone(e):e;function US(e){const t=y0(e);return v0(e)(t.map(BS))}const Nt={test:VS,parse:y0,createTransformer:v0,getAnimatableNone:US};function qa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function HS({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=qa(l,a,e+1/3),s=qa(l,a,e),o=qa(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function _o(e,t){return n=>n>0?t:e}const de=(e,t,n)=>e+(t-e)*n,Za=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},WS=[fc,Wn,br],KS=e=>WS.find(t=>t.test(e));function eh(e){const t=KS(e);if(la(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===br&&(n=HS(n)),n}const th=(e,t)=>{const n=eh(e),r=eh(t);if(!n||!r)return _o(e,t);const i={...n};return s=>(i.red=Za(n.red,r.red,s),i.green=Za(n.green,r.green,s),i.blue=Za(n.blue,r.blue,s),i.alpha=de(n.alpha,r.alpha,s),Wn.transform(i))},hc=new Set(["none","hidden"]);function GS(e,t){return hc.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function YS(e,t){return n=>de(e,t,n)}function Qu(e){return typeof e=="number"?YS:typeof e=="string"?Gu(e)?_o:ye.test(e)?th:qS:Array.isArray(e)?x0:typeof e=="object"?ye.test(e)?th:XS:_o}function x0(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Qu(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function XS(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Qu(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function QS(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const qS=(e,t)=>{const n=Nt.createTransformer(t),r=ts(e),i=ts(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?hc.has(e)&&!i.values.length||hc.has(t)&&!r.values.length?GS(e,t):ds(x0(QS(r,i),i.values),n):(la(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),_o(e,t))};function w0(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?de(e,t,n):Qu(e)(e,t)}const ZS=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>te.update(t,n),stop:()=>En(t),now:()=>Te.isProcessing?Te.timestamp:Le.now()}},S0=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Lo=2e4;function qu(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Lo;)t+=n,r=e.next(t);return t>=Lo?1/0:t}function JS(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(qu(r),Lo);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:st(i)}}const eb=5;function b0(e,t,n){const r=Math.max(t-eb,0);return e0(n-e(r),t-r)}const ce={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},Ja=.001;function tb({duration:e=ce.duration,bounce:t=ce.bounce,velocity:n=ce.velocity,mass:r=ce.mass}){let i,s;la(e<=lt(ce.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=It(ce.minDamping,ce.maxDamping,o),e=It(ce.minDuration,ce.maxDuration,st(e)),o<1?(i=c=>{const d=c*o,f=d*e,m=d-n,h=mc(c,o),v=Math.exp(-f);return Ja-m/h*v},s=c=>{const f=c*o*e,m=f*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,v=Math.exp(-f),w=mc(Math.pow(c,2),o);return(-i(c)+Ja>0?-1:1)*((m-h)*v)/w}):(i=c=>{const d=Math.exp(-c*e),f=(c-n)*e+1;return-Ja+d*f},s=c=>{const d=Math.exp(-c*e),f=(n-c)*(e*e);return d*f});const a=5/e,l=rb(i,s,a);if(e=lt(e),isNaN(l))return{stiffness:ce.stiffness,damping:ce.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const nb=12;function rb(e,t,n){let r=n;for(let i=1;i<nb;i++)r=r-e(r)/t(r);return r}function mc(e,t){return e*Math.sqrt(1-t*t)}const ib=["duration","bounce"],sb=["stiffness","damping","mass"];function nh(e,t){return t.some(n=>e[n]!==void 0)}function ob(e){let t={velocity:ce.velocity,stiffness:ce.stiffness,damping:ce.damping,mass:ce.mass,isResolvedFromDuration:!1,...e};if(!nh(e,sb)&&nh(e,ib))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*It(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ce.mass,stiffness:i,damping:s}}else{const n=tb(e);t={...t,...n,mass:ce.mass},t.isResolvedFromDuration=!0}return t}function zo(e=ce.visualDuration,t=ce.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:f,velocity:m,isResolvedFromDuration:h}=ob({...n,velocity:-st(n.velocity||0)}),v=m||0,w=c/(2*Math.sqrt(l*d)),S=o-s,p=st(Math.sqrt(l/d)),g=Math.abs(S)<5;r||(r=g?ce.restSpeed.granular:ce.restSpeed.default),i||(i=g?ce.restDelta.granular:ce.restDelta.default);let y;if(w<1){const k=mc(p,w);y=C=>{const N=Math.exp(-w*p*C);return o-N*((v+w*p*S)/k*Math.sin(k*C)+S*Math.cos(k*C))}}else if(w===1)y=k=>o-Math.exp(-p*k)*(S+(v+p*S)*k);else{const k=p*Math.sqrt(w*w-1);y=C=>{const N=Math.exp(-w*p*C),T=Math.min(k*C,300);return o-N*((v+w*p*S)*Math.sinh(T)+k*S*Math.cosh(T))/k}}const b={calculatedDuration:h&&f||null,next:k=>{const C=y(k);if(h)a.done=k>=f;else{let N=k===0?v:0;w<1&&(N=k===0?lt(v):b0(y,k,C));const T=Math.abs(N)<=r,E=Math.abs(o-C)<=i;a.done=T&&E}return a.value=a.done?o:C,a},toString:()=>{const k=Math.min(qu(b),Lo),C=S0(N=>b.next(k*N).value,k,30);return k+"ms "+C},toTransition:()=>{}};return b}zo.applyToOptions=e=>{const t=JS(e,100,zo);return e.ease=t.ease,e.duration=lt(t.duration),e.type="keyframes",e};function pc({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const f=e[0],m={done:!1,value:f},h=T=>a!==void 0&&T<a||l!==void 0&&T>l,v=T=>a===void 0?l:l===void 0||Math.abs(a-T)<Math.abs(l-T)?a:l;let w=n*t;const S=f+w,p=o===void 0?S:o(S);p!==S&&(w=p-f);const g=T=>-w*Math.exp(-T/r),y=T=>p+g(T),b=T=>{const E=g(T),P=y(T);m.done=Math.abs(E)<=c,m.value=m.done?p:P};let k,C;const N=T=>{h(m.value)&&(k=T,C=zo({keyframes:[m.value,v(m.value)],velocity:b0(y,T,m.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return N(0),{calculatedDuration:null,next:T=>{let E=!1;return!C&&k===void 0&&(E=!0,b(T),N(T)),k!==void 0&&T>=k?C.next(T-k):(!E&&b(T),m)}}}function ab(e,t,n){const r=[],i=n||qt.mix||w0,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||at:t;a=ds(l,a)}r.push(a)}return r}function lb(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Gr(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=ab(t,r,i),l=a.length,c=d=>{if(o&&d<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const m=Ji(e[f],e[f+1],d);return a[f](m)};return n?d=>c(It(e[0],e[s-1],d)):c}function cb(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ji(0,t,r);e.push(de(n,1,i))}}function ub(e){const t=[0];return cb(t,e.length-1),t}function db(e,t){return e.map(n=>n*t)}function fb(e,t){return e.map(()=>t||c0).splice(0,e.length-1)}function Mi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=CS(r)?r.map(Xf):Xf(r),s={done:!1,value:t[0]},o=db(n&&n.length===t.length?n:ub(t),e),a=lb(o,t,{ease:Array.isArray(i)?i:fb(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const hb=e=>e!==null;function Zu(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(hb),a=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!a||r===void 0?s[a]:r}const mb={decay:pc,inertia:pc,tween:Mi,keyframes:Mi,spring:zo};function k0(e){typeof e.type=="string"&&(e.type=mb[e.type])}class Ju{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const pb=e=>e/100;class ed extends Ju{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==Le.now()&&this.tick(Le.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;k0(t);const{type:n=Mi,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Mi;l!==Mi&&typeof a[0]!="number"&&(this.mixKeyframes=ds(pb,w0(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=qu(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:f,repeatType:m,repeatDelay:h,type:v,onUpdate:w,finalKeyframe:S}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const p=this.currentTime-c*(this.playbackSpeed>=0?1:-1),g=this.playbackSpeed>=0?p<0:p>i;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let y=this.currentTime,b=r;if(f){const T=Math.min(this.currentTime,i)/a;let E=Math.floor(T),P=T%1;!P&&T>=1&&(P=1),P===1&&E--,E=Math.min(E,f+1),!!(E%2)&&(m==="reverse"?(P=1-P,h&&(P-=h/a)):m==="mirror"&&(b=o)),y=It(0,1,P)*a}const k=g?{done:!1,value:d[0]}:b.next(y);s&&(k.value=s(k.value));let{done:C}=k;!g&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return N&&v!==pc&&(k.value=Zu(d,this.options,S,this.speed)),w&&w(k.value),N&&this.finish(),k}then(t,n){return this.finished.then(t,n)}get duration(){return st(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+st(t)}get time(){return st(this.currentTime)}set time(t){var n;t=lt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Le.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=st(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=ZS,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(Le.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function gb(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Kn=e=>e*180/Math.PI,gc=e=>{const t=Kn(Math.atan2(e[1],e[0]));return yc(t)},yb={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gc,rotateZ:gc,skewX:e=>Kn(Math.atan(e[1])),skewY:e=>Kn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},yc=e=>(e=e%360,e<0&&(e+=360),e),rh=gc,ih=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),sh=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),vb={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ih,scaleY:sh,scale:e=>(ih(e)+sh(e))/2,rotateX:e=>yc(Kn(Math.atan2(e[6],e[5]))),rotateY:e=>yc(Kn(Math.atan2(-e[2],e[0]))),rotateZ:rh,rotate:rh,skewX:e=>Kn(Math.atan(e[4])),skewY:e=>Kn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function vc(e){return e.includes("scale")?1:0}function xc(e,t){if(!e||e==="none")return vc(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=vb,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=yb,i=a}if(!i)return vc(t);const s=r[t],o=i[1].split(",").map(wb);return typeof s=="function"?s(o):o[s]}const xb=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return xc(n,t)};function wb(e){return parseFloat(e.trim())}const ei=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ti=new Set(ei),oh=e=>e===Jr||e===L,Sb=new Set(["x","y","z"]),bb=ei.filter(e=>!Sb.has(e));function kb(e){const t=[];return bb.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const gn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>xc(t,"x"),y:(e,{transform:t})=>xc(t,"y")};gn.translateX=gn.x;gn.translateY=gn.y;const Xn=new Set;let wc=!1,Sc=!1,bc=!1;function C0(){if(Sc){const e=Array.from(Xn).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=kb(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Sc=!1,wc=!1,Xn.forEach(e=>e.complete(bc)),Xn.clear()}function T0(){Xn.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Sc=!0)})}function Cb(){bc=!0,T0(),C0(),bc=!1}class td{constructor(t,n,r,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Xn.add(this),wc||(wc=!0,te.read(T0),te.resolveKeyframes(C0))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}gb(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Xn.delete(this)}cancel(){this.state==="scheduled"&&(Xn.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Tb=e=>e.startsWith("--");function Nb(e,t,n){Tb(t)?e.style.setProperty(t,n):e.style[t]=n}const Eb={};function N0(e,t){const n=Jg(e);return()=>Eb[t]??n()}const Pb=N0(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),E0=N0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Si=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ah={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Si([0,.65,.55,1]),circOut:Si([.55,0,1,.45]),backIn:Si([.31,.01,.66,-.59]),backOut:Si([.33,1.53,.69,.99])};function P0(e,t){if(e)return typeof e=="function"?E0()?S0(e,t):"ease-out":u0(e)?Si(e):Array.isArray(e)?e.map(n=>P0(n,t)||ah.easeOut):ah[e]}function jb(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const f=P0(a,i);Array.isArray(f)&&(d.easing=f);const m={delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(d,m)}function j0(e){return typeof e=="function"&&"applyToOptions"in e}function Ab({type:e,...t}){return j0(e)&&E0()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class A0 extends Ju{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,Gr(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const c=Ab(t);this.animation=jb(n,r,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=Zu(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):Nb(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(r=this.animation).commitStyles)==null||i.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return st(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+st(t)}get time(){return st(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=lt(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Pb()?(this.animation.timeline=t,at):n(this)}}const R0={anticipate:o0,backInOut:s0,circInOut:l0};function Rb(e){return e in R0}function Mb(e){typeof e.ease=="string"&&Rb(e.ease)&&(e.ease=R0[e.ease])}const el=10;class Db extends A0{constructor(t){Mb(t),k0(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new ed({...o,autoplay:!1}),l=Math.max(el,Le.now()-this.startTime),c=It(0,el,l-el);n.setWithVelocity(a.sample(Math.max(0,l-c)).value,a.sample(l).value,c),a.stop()}}const lh=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Nt.test(e)||e==="0")&&!e.startsWith("url("));function _b(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Lb(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=lh(i,t),a=lh(s,t);return la(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:_b(e)||(n==="spring"||j0(n))&&r}function kc(e){e.duration=0,e.type="keyframes"}const zb=new Set(["opacity","clipPath","filter","transform"]),Ib=Jg(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Vb(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=t.owner.getProps();return Ib()&&n&&zb.has(n)&&(n!=="transform"||!c)&&!l&&!r&&i!=="mirror"&&s!==0&&o!=="inertia"}const Ob=40;class Fb extends Ju{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:d,...f}){var v;super(),this.stop=()=>{var w,S;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(S=this.keyframeResolver)==null||S.cancel()},this.createdAt=Le.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,name:l,motionValue:c,element:d,...f},h=(d==null?void 0:d.KeyframeResolver)||td;this.keyframeResolver=new h(a,(w,S,p)=>this.onKeyframesResolved(w,S,m,!p),l,c,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,i){var S,p;this.keyframeResolver=void 0;const{name:s,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:d}=r;this.resolvedAt=Le.now(),Lb(t,s,o,a)||((qt.instantAnimations||!l)&&(d==null||d(Zu(t,r,n))),t[0]=t[t.length-1],kc(r),r.repeat=0);const m={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Ob?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},h=!c&&Vb(m),v=(p=(S=m.motionValue)==null?void 0:S.owner)==null?void 0:p.current,w=h?new Db({...m,element:v}):new ed(m);w.finished.then(()=>{this.notifyFinished()}).catch(at),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Cb()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function M0(e,t,n,r=0,i=1){const s=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(s,o):i===1?s*r:a-s*r}const $b=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Bb(e){const t=$b.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const Ub=4;function D0(e,t,n=1){Gr(n<=Ub,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=Bb(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Qg(o)?parseFloat(o):o}return Gu(i)?D0(i,t,n+1):i}const Hb={type:"spring",stiffness:500,damping:25,restSpeed:10},Wb=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Kb={type:"keyframes",duration:.8},Gb={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yb=(e,{keyframes:t})=>t.length>2?Kb:ti.has(e)?e.startsWith("scale")?Wb(t[1]):Hb:Gb,Xb=e=>e!==null;function Qb(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Xb),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}function _0(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function nd(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?_0(n,e):n}function qb({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const rd=(e,t,n,r={},i,s)=>o=>{const a=nd(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-lt(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};qb(a)||Object.assign(d,Yb(e,d)),d.duration&&(d.duration=lt(d.duration)),d.repeatDelay&&(d.repeatDelay=lt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(kc(d),d.delay===0&&(f=!0)),(qt.instantAnimations||qt.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(f=!0,kc(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){const m=Qb(d.keyframes,a);if(m!==void 0){te.update(()=>{d.onUpdate(m),d.onComplete()});return}}return a.isSync?new ed(d):new Fb(d)};function ch(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function id(e,t,n,r){if(typeof t=="function"){const[i,s]=ch(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=ch(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function _r(e,t,n){const r=e.getProps();return id(r,t,n!==void 0?n:r.custom,e)}const L0=new Set(["width","height","top","left","right","bottom",...ei]),uh=30,Zb=e=>!isNaN(parseFloat(e));class Jb{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=Le.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Zb(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Hu);const r=this.events[t].add(n);return t==="change"?()=>{r(),te.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>uh)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,uh);return e0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Yr(e,t){return new Jb(e,t)}const Cc=e=>Array.isArray(e);function ek(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Yr(n))}function tk(e){return Cc(e)?e[e.length-1]||0:e}function nk(e,t){const n=_r(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=tk(s[o]);ek(e,o,a)}}const Re=e=>!!(e&&e.getVelocity);function rk(e){return!!(Re(e)&&e.add)}function Tc(e,t){const n=e.getValue("willChange");if(rk(n))return n.add(t);if(!n&&qt.WillChange){const r=new qt.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function sd(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ik="framerAppearId",z0="data-"+sd(ik);function I0(e){return e.props[z0]}function sk({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function V0(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();s=s?_0(s,l):l;const c=s==null?void 0:s.reduceMotion;r&&(s=r);const d=[],f=i&&e.animationState&&e.animationState.getState()[i];for(const m in a){const h=e.getValue(m,e.latestValues[m]??null),v=a[m];if(v===void 0||f&&sk(f,m))continue;const w={delay:n,...nd(s||{},m)},S=h.get();if(S!==void 0&&!h.isAnimating&&!Array.isArray(v)&&v===S&&!w.velocity)continue;let p=!1;if(window.MotionHandoffAnimation){const b=I0(e);if(b){const k=window.MotionHandoffAnimation(b,m,te);k!==null&&(w.startTime=k,p=!0)}}Tc(e,m);const g=c??e.shouldReduceMotion;h.start(rd(m,h,v,g&&L0.has(m)?{type:!1}:w,e,p));const y=h.animation;y&&d.push(y)}if(o){const m=()=>te.update(()=>{o&&nk(e,o)});d.length?Promise.all(d).then(m):m()}return d}function Nc(e,t,n={}){var l;const r=_r(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(V0(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:m}=i;return ok(e,t,c,d,f,m,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,d]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function ok(e,t,n=0,r=0,i=0,s=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Nc(l,t,{...o,delay:n+(typeof r=="function"?0:r)+M0(e.variantChildren,l,r,i,s)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function ak(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Nc(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Nc(e,t,n);else{const i=typeof t=="function"?_r(e,t,n.custom):t;r=Promise.all(V0(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const lk={test:e=>e==="auto",parse:e=>e},O0=e=>t=>t.test(e),F0=[Jr,L,zt,ln,zS,LS,lk],dh=e=>F0.find(O0(e));function ck(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zg(e):!0}const uk=new Set(["brightness","contrast","saturate","opacity"]);function dk(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Yu)||[];if(!r)return e;const i=n.replace(r,"");let s=uk.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const fk=/\b([a-z-]*)\(.*?\)/gu,Ec={...Nt,getAnimatableNone:e=>{const t=e.match(fk);return t?t.map(dk).join(" "):e}},Pc={...Nt,getAnimatableNone:e=>{const t=Nt.parse(e);return Nt.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},fh={...Jr,transform:Math.round},hk={rotate:ln,rotateX:ln,rotateY:ln,rotateZ:ln,scale:Is,scaleX:Is,scaleY:Is,scaleZ:Is,skew:ln,skewX:ln,skewY:ln,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:es,originX:Zf,originY:Zf,originZ:L},od={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,inset:L,insetBlock:L,insetBlockStart:L,insetBlockEnd:L,insetInline:L,insetInlineStart:L,insetInlineEnd:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockStart:L,paddingBlockEnd:L,paddingInline:L,paddingInlineStart:L,paddingInlineEnd:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockStart:L,marginBlockEnd:L,marginInline:L,marginInlineStart:L,marginInlineEnd:L,fontSize:L,backgroundPositionX:L,backgroundPositionY:L,...hk,zIndex:fh,fillOpacity:es,strokeOpacity:es,numOctaves:fh},mk={...od,color:ye,backgroundColor:ye,outlineColor:ye,fill:ye,stroke:ye,borderColor:ye,borderTopColor:ye,borderRightColor:ye,borderBottomColor:ye,borderLeftColor:ye,filter:Ec,WebkitFilter:Ec,mask:Pc,WebkitMask:Pc},$0=e=>mk[e],pk=new Set([Ec,Pc]);function B0(e,t){let n=$0(e);return pk.has(n)||(n=Nt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const gk=new Set(["auto","none","0"]);function yk(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!gk.has(s)&&ts(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=B0(n,i)}class vk extends td{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),Gu(f))){const m=D0(f,n.current);m!==void 0&&(t[d]=m),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!L0.has(r)||t.length!==2)return;const[i,s]=t,o=dh(i),a=dh(s),l=qf(i),c=qf(s);if(l!==c&&gn[r]){this.needsMeasurement=!0;return}if(o!==a)if(oh(o)&&oh(a))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else gn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||ck(t[i]))&&r.push(i);r.length&&yk(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=gn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const xk=new Set(["opacity","clipPath","filter","transform"]);function U0(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const H0=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function jc(e){return qg(e)&&"offsetHeight"in e}const{schedule:ad,cancel:XE}=d0(queueMicrotask,!1),wt={x:!1,y:!1};function W0(){return wt.x||wt.y}function wk(e){return e==="x"||e==="y"?wt[e]?null:(wt[e]=!0,()=>{wt[e]=!1}):wt.x||wt.y?null:(wt.x=wt.y=!0,()=>{wt.x=wt.y=!1})}function K0(e,t){const n=U0(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Sk(e){return!(e.pointerType==="touch"||W0())}function bk(e,t,n={}){const[r,i,s]=K0(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const d=()=>{o.removeEventListener("pointerleave",v)},f=S=>{c&&(c(S),c=void 0),d()},m=S=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),l&&(l=!1,f(S))},h=()=>{a=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},v=S=>{if(S.pointerType!=="touch"){if(a){l=!0;return}f(S)}},w=S=>{if(!Sk(S))return;l=!1;const p=t(o,S);typeof p=="function"&&(c=p,o.addEventListener("pointerleave",v,i))};o.addEventListener("pointerenter",w,i),o.addEventListener("pointerdown",h,i)}),s}const G0=(e,t)=>t?e===t?!0:G0(e,t.parentElement):!1,ld=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,kk=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ck(e){return kk.has(e.tagName)||e.isContentEditable===!0}const Tk=new Set(["INPUT","SELECT","TEXTAREA"]);function Nk(e){return Tk.has(e.tagName)||e.isContentEditable===!0}const to=new WeakSet;function hh(e){return t=>{t.key==="Enter"&&e(t)}}function tl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ek=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=hh(()=>{if(to.has(n))return;tl(n,"down");const i=hh(()=>{tl(n,"up")}),s=()=>tl(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function mh(e){return ld(e)&&!W0()}const ph=new WeakSet;function Pk(e,t,n={}){const[r,i,s]=K0(e,n),o=a=>{const l=a.currentTarget;if(!mh(a)||ph.has(a))return;to.add(l),n.stopPropagation&&ph.add(a);const c=t(l,a),d=(h,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",m),to.has(l)&&to.delete(l),mh(h)&&typeof c=="function"&&c(h,{success:v})},f=h=>{d(h,l===window||l===document||n.useGlobalTarget||G0(l,h.target))},m=h=>{d(h,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",m,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),jc(a)&&(a.addEventListener("focus",c=>Ek(c,i)),!Ck(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function cd(e){return qg(e)&&"ownerSVGElement"in e}const no=new WeakMap;let cn;const Y0=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+"Size"]:cd(r)&&"getBBox"in r?r.getBBox()[t]:r[n],jk=Y0("inline","width","offsetWidth"),Ak=Y0("block","height","offsetHeight");function Rk({target:e,borderBoxSize:t}){var n;(n=no.get(e))==null||n.forEach(r=>{r(e,{get width(){return jk(e,t)},get height(){return Ak(e,t)}})})}function Mk(e){e.forEach(Rk)}function Dk(){typeof ResizeObserver>"u"||(cn=new ResizeObserver(Mk))}function _k(e,t){cn||Dk();const n=U0(e);return n.forEach(r=>{let i=no.get(r);i||(i=new Set,no.set(r,i)),i.add(t),cn==null||cn.observe(r)}),()=>{n.forEach(r=>{const i=no.get(r);i==null||i.delete(t),i!=null&&i.size||cn==null||cn.unobserve(r)})}}const ro=new Set;let kr;function Lk(){kr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ro.forEach(t=>t(e))},window.addEventListener("resize",kr)}function zk(e){return ro.add(e),kr||Lk(),()=>{ro.delete(e),!ro.size&&typeof kr=="function"&&(window.removeEventListener("resize",kr),kr=void 0)}}function gh(e,t){return typeof e=="function"?zk(e):_k(e,t)}function Ik(e){return cd(e)&&e.tagName==="svg"}const Vk=[...F0,ye,Nt],Ok=e=>Vk.find(O0(e)),yh=()=>({translate:0,scale:1,origin:0,originPoint:0}),Cr=()=>({x:yh(),y:yh()}),vh=()=>({min:0,max:0}),xe=()=>({x:vh(),y:vh()}),Fk=new WeakMap;function ca(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ns(e){return typeof e=="string"||Array.isArray(e)}const ud=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dd=["initial",...ud];function ua(e){return ca(e.animate)||dd.some(t=>ns(e[t]))}function X0(e){return!!(ua(e)||e.variants)}function $k(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Re(i))e.addValue(r,i);else if(Re(s))e.addValue(r,Yr(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Yr(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ac={current:null},Q0={current:!1},Bk=typeof window<"u";function Uk(){if(Q0.current=!0,!!Bk)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ac.current=e.matches;e.addEventListener("change",t),t()}else Ac.current=!1}const xh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Io={};function q0(e){Io=e}function Hk(){return Io}class Wk{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:a},l={}){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=td,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 h=Le.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,te.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=ua(n),this.isVariantNode=X0(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in m){const v=m[h];c[h]!==void 0&&Re(v)&&v.set(c[h])}}mount(t){var n,r;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,Fk.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Q0.current||Uk(),this.shouldReduceMotion=Ac.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),En(this.notifyUpdate),En(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&xk.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:d}=n.accelerate,f=new A0({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:lt(d)}),m=o(f);this.valueSubscriptions.set(t,()=>{m(),f.cancel()});return}const r=ti.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&te.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Io){const n=Io[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):xe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<xh.length;r++){const i=xh[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=$k(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Yr(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Qg(r)||Zg(r))?r=parseFloat(r):!Ok(r)&&Nt.test(n)&&(r=B0(t,n)),this.setBaseTarget(t,Re(r)?r.get():r)),Re(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=id(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Re(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Hu),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){ad.render(this.render)}}class Z0 extends Wk{constructor(){super(...arguments),this.KeyframeResolver=vk}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Re(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Mn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function J0({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Kk({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gk(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function nl(e){return e===void 0||e===1}function Rc({scale:e,scaleX:t,scaleY:n}){return!nl(e)||!nl(t)||!nl(n)}function On(e){return Rc(e)||ey(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ey(e){return wh(e.x)||wh(e.y)}function wh(e){return e&&e!=="0%"}function Vo(e,t,n){const r=e-n,i=t*r;return n+i}function Sh(e,t,n,r,i){return i!==void 0&&(e=Vo(e,i,r)),Vo(e,n,r)+t}function Mc(e,t=0,n=1,r,i){e.min=Sh(e.min,t,n,r,i),e.max=Sh(e.max,t,n,r,i)}function ty(e,{x:t,y:n}){Mc(e.x,t.translate,t.scale,t.originPoint),Mc(e.y,n.translate,n.scale,n.originPoint)}const bh=.999999999999,kh=1.0000000000001;function Yk(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Nr(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ty(e,o)),r&&On(s.latestValues)&&Nr(e,s.latestValues))}t.x<kh&&t.x>bh&&(t.x=1),t.y<kh&&t.y>bh&&(t.y=1)}function Tr(e,t){e.min=e.min+t,e.max=e.max+t}function Ch(e,t,n,r,i=.5){const s=de(e.min,e.max,i);Mc(e,t,n,s,r)}function Nr(e,t){Ch(e.x,t.x,t.scaleX,t.scale,t.originX),Ch(e.y,t.y,t.scaleY,t.scale,t.originY)}function ny(e,t){return J0(Gk(e.getBoundingClientRect(),t))}function Xk(e,t,n){const r=ny(e,n),{scroll:i}=t;return i&&(Tr(r.x,i.offset.x),Tr(r.y,i.offset.y)),r}const Qk={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},qk=ei.length;function Zk(e,t,n){let r="",i=!0;for(let s=0;s<qk;s++){const o=ei[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const c=parseFloat(a);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=H0(a,od[o]);if(!l){i=!1;const d=Qk[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function fd(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(ti.has(l)){o=!0;continue}else if(h0(l)){i[l]=c;continue}else{const d=H0(c,od[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=Zk(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${c} ${d}`}}function ry(e,{style:t,vars:n},r,i){const s=e.style;let o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,r);for(o in n)s.setProperty(o,n[o])}function Th(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const mi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(L.test(e))e=parseFloat(e);else return e;const n=Th(e,t.target.x),r=Th(e,t.target.y);return`${n}% ${r}%`}},Jk={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Nt.parse(e);if(i.length>5)return r;const s=Nt.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=de(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}},Dc={borderRadius:{...mi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mi,borderTopRightRadius:mi,borderBottomLeftRadius:mi,borderBottomRightRadius:mi,boxShadow:Jk};function iy(e,{layout:t,layoutId:n}){return ti.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Dc[e]||e==="opacity")}function hd(e,t,n){var o;const r=e.style,i=t==null?void 0:t.style,s={};if(!r)return s;for(const a in r)(Re(r[a])||i&&Re(i[a])||iy(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(s[a]=r[a]);return s}function eC(e){return window.getComputedStyle(e)}class tC extends Z0{constructor(){super(...arguments),this.type="html",this.renderInstance=ry}readValueFromInstance(t,n){var r;if(ti.has(n))return(r=this.projection)!=null&&r.isProjecting?vc(n):xb(t,n);{const i=eC(t),s=(h0(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ny(t,n)}build(t,n,r){fd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return hd(t,n,r)}}const nC={offset:"stroke-dashoffset",array:"stroke-dasharray"},rC={offset:"strokeDashoffset",array:"strokeDasharray"};function iC(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?nC:rC;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const sC=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function sy(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},l,c,d){if(fd(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:m}=e;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const h of sC)f[h]!==void 0&&(m[h]=f[h],delete f[h]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),i!==void 0&&iC(f,i,s,o,!1)}const oy=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"]),ay=e=>typeof e=="string"&&e.toLowerCase()==="svg";function oC(e,t,n,r){ry(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(oy.has(i)?i:sd(i),t.attrs[i])}function ly(e,t,n){const r=hd(e,t,n);for(const i in e)if(Re(e[i])||Re(t[i])){const s=ei.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}class aC extends Z0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=xe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ti.has(n)){const r=$0(n);return r&&r.default||0}return n=oy.has(n)?n:sd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ly(t,n,r)}build(t,n,r){sy(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){oC(t,n,r,i)}mount(t){this.isSVGTag=ay(t.tagName),super.mount(t)}}const lC=dd.length;function cy(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?cy(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<lC;n++){const r=dd[n],i=e.props[r];(ns(i)||i===!1)&&(t[r]=i)}return t}function uy(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const cC=[...ud].reverse(),uC=ud.length;function dC(e){return t=>Promise.all(t.map(({animation:n,options:r})=>ak(e,n,r)))}function fC(e){let t=dC(e),n=Nh(),r=!0;const i=l=>(c,d)=>{var m;const f=_r(e,d,l==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(f){const{transition:h,transitionEnd:v,...w}=f;c={...c,...w,...v}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=cy(e.parent)||{},f=[],m=new Set;let h={},v=1/0;for(let S=0;S<uC;S++){const p=cC[S],g=n[p],y=c[p]!==void 0?c[p]:d[p],b=ns(y),k=p===l?g.isActive:null;k===!1&&(v=S);let C=y===d[p]&&y!==c[p]&&b;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),g.protectedKeys={...h},!g.isActive&&k===null||!y&&!g.prevProp||ca(y)||typeof y=="boolean")continue;if(p==="exit"&&g.isActive&&k!==!0){g.prevResolvedValues&&(h={...h,...g.prevResolvedValues});continue}const N=hC(g.prevProp,y);let T=N||p===l&&g.isActive&&!C&&b||S>v&&b,E=!1;const P=Array.isArray(y)?y:[y];let z=P.reduce(i(p),{});k===!1&&(z={});const{prevResolvedValues:I={}}=g,J={...I,...z},le=$=>{T=!0,m.has($)&&(E=!0,m.delete($)),g.needsAnimating[$]=!0;const j=e.getValue($);j&&(j.liveStyle=!1)};for(const $ in J){const j=z[$],A=I[$];if(h.hasOwnProperty($))continue;let D=!1;Cc(j)&&Cc(A)?D=!uy(j,A):D=j!==A,D?j!=null?le($):m.add($):j!==void 0&&m.has($)?le($):g.protectedKeys[$]=!0}g.prevProp=y,g.prevResolvedValues=z,g.isActive&&(h={...h,...z}),r&&e.blockInitialAnimation&&(T=!1);const pe=C&&N;T&&(!pe||E)&&f.push(...P.map($=>{const j={type:p};if(typeof $=="string"&&r&&!pe&&e.manuallyAnimateOnMount&&e.parent){const{parent:A}=e,D=_r(A,$);if(A.enteringChildren&&D){const{delayChildren:W}=D.transition||{};j.delay=M0(A.enteringChildren,e,W)}}return{animation:$,options:j}}))}if(m.size){const S={};if(typeof c.initial!="boolean"){const p=_r(e,Array.isArray(c.initial)?c.initial[0]:c.initial);p&&p.transition&&(S.transition=p.transition)}m.forEach(p=>{const g=e.getBaseTarget(p),y=e.getValue(p);y&&(y.liveStyle=!0),S[p]=g??null}),f.push({animation:S})}let w=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(f):Promise.resolve()}function a(l,c){var f;if(n[l].isActive===c)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(m=>{var h;return(h=m.animationState)==null?void 0:h.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const m in n)n[m].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Nh()}}}function hC(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!uy(t,e):!1}function zn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Nh(){return{animate:zn(!0),whileInView:zn(),whileHover:zn(),whileTap:zn(),whileDrag:zn(),whileFocus:zn(),exit:zn()}}function Eh(e,t){e.min=t.min,e.max=t.max}function xt(e,t){Eh(e.x,t.x),Eh(e.y,t.y)}function Ph(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const dy=1e-4,mC=1-dy,pC=1+dy,fy=.01,gC=0-fy,yC=0+fy;function ze(e){return e.max-e.min}function vC(e,t,n){return Math.abs(e-t)<=n}function jh(e,t,n,r=.5){e.origin=r,e.originPoint=de(t.min,t.max,e.origin),e.scale=ze(n)/ze(t),e.translate=de(n.min,n.max,e.origin)-e.originPoint,(e.scale>=mC&&e.scale<=pC||isNaN(e.scale))&&(e.scale=1),(e.translate>=gC&&e.translate<=yC||isNaN(e.translate))&&(e.translate=0)}function Di(e,t,n,r){jh(e.x,t.x,n.x,r?r.originX:void 0),jh(e.y,t.y,n.y,r?r.originY:void 0)}function Ah(e,t,n){e.min=n.min+t.min,e.max=e.min+ze(t)}function xC(e,t,n){Ah(e.x,t.x,n.x),Ah(e.y,t.y,n.y)}function Rh(e,t,n){e.min=t.min-n.min,e.max=e.min+ze(t)}function Oo(e,t,n){Rh(e.x,t.x,n.x),Rh(e.y,t.y,n.y)}function Mh(e,t,n,r,i){return e-=t,e=Vo(e,1/n,r),i!==void 0&&(e=Vo(e,1/i,r)),e}function wC(e,t=0,n=1,r=.5,i,s=e,o=e){if(zt.test(t)&&(t=parseFloat(t),t=de(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=de(s.min,s.max,r);e===s&&(a-=t),e.min=Mh(e.min,t,n,a,i),e.max=Mh(e.max,t,n,a,i)}function Dh(e,t,[n,r,i],s,o){wC(e,t[n],t[r],t[i],t.scale,s,o)}const SC=["x","scaleX","originX"],bC=["y","scaleY","originY"];function _h(e,t,n,r){Dh(e.x,t,SC,n?n.x:void 0,r?r.x:void 0),Dh(e.y,t,bC,n?n.y:void 0,r?r.y:void 0)}function Lh(e){return e.translate===0&&e.scale===1}function hy(e){return Lh(e.x)&&Lh(e.y)}function zh(e,t){return e.min===t.min&&e.max===t.max}function kC(e,t){return zh(e.x,t.x)&&zh(e.y,t.y)}function Ih(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function my(e,t){return Ih(e.x,t.x)&&Ih(e.y,t.y)}function Vh(e){return ze(e.x)/ze(e.y)}function Oh(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Rt(e){return[e("x"),e("y")]}function CC(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:f,rotateY:m,skewX:h,skewY:v}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),m&&(r+=`rotateY(${m}deg) `),h&&(r+=`skewX(${h}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const py=["TopLeft","TopRight","BottomLeft","BottomRight"],TC=py.length,Fh=e=>typeof e=="string"?parseFloat(e):e,$h=e=>typeof e=="number"||L.test(e);function NC(e,t,n,r,i,s){i?(e.opacity=de(0,n.opacity??1,EC(r)),e.opacityExit=de(t.opacity??1,0,PC(r))):s&&(e.opacity=de(t.opacity??1,n.opacity??1,r));for(let o=0;o<TC;o++){const a=`border${py[o]}Radius`;let l=Bh(t,a),c=Bh(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||$h(l)===$h(c)?(e[a]=Math.max(de(Fh(l),Fh(c),r),0),(zt.test(c)||zt.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=de(t.rotate||0,n.rotate||0,r))}function Bh(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const EC=gy(0,.5,a0),PC=gy(.5,.95,at);function gy(e,t,n){return r=>r<e?0:r>t?1:n(Ji(e,t,r))}function jC(e,t,n){const r=Re(e)?e:Yr(e);return r.start(rd("",r,t,n)),r.animation}function rs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const AC=(e,t)=>e.depth-t.depth;class RC{constructor(){this.children=[],this.isDirty=!1}add(t){Uu(this.children,t),this.isDirty=!0}remove(t){Do(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(AC),this.isDirty=!1,this.children.forEach(t)}}function MC(e,t){const n=Le.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(En(r),e(s-t))};return te.setup(r,!0),()=>En(r)}function io(e){return Re(e)?e.get():e}class DC{constructor(){this.members=[]}add(t){Uu(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const i=r.instance;i&&i.isConnected===!1&&r.isPresent!==!1&&!r.snapshot&&Do(this.members,r)}t.scheduleRender()}remove(t){if(Do(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i],o=s.instance;if(s.isPresent!==!1&&(!o||o.isConnected!==!1)){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const i=r.options.layoutDependency,s=t.options.layoutDependency;if(!(i!==void 0&&s!==void 0&&i===s)){const l=r.instance;l&&l.isConnected===!1&&!r.snapshot||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0))}const{crossfade:a}=t.options;a===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const so={hasAnimatedSinceResize:!0,hasEverUpdated:!1},rl=["","X","Y","Z"],_C=1e3;let LC=0;function il(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yy(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=I0(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",te,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yy(r)}function vy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=LC++,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(VC),this.nodes.forEach(BC),this.nodes.forEach(UC),this.nodes.forEach(OC)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new RC)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Hu),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=cd(o)&&!Ik(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let d,f=0;const m=()=>this.root.updateBlockedByResize=!1;te.read(()=>{f=window.innerWidth}),e(o,()=>{const h=window.innerWidth;h!==f&&(f=h,this.root.updateBlockedByResize=!0,d&&d(),d=MC(m,250),so.hasAnimatedSinceResize&&(so.hasAnimatedSinceResize=!1,this.nodes.forEach(Wh)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:h})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||c.getDefaultTransition()||YC,{onLayoutAnimationStart:w,onLayoutAnimationComplete:S}=c.getProps(),p=!this.targetLayout||!my(this.targetLayout,h),g=!f&&m;if(this.options.layoutRoot||this.resumeFrom||g||f&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...nd(v,"layout"),onPlay:w,onComplete:S};(c.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,g)}else f||Wh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=h})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),En(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(HC),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yy(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Uh);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Hh);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach($C),this.nodes.forEach(zC),this.nodes.forEach(IC)):this.nodes.forEach(Hh),this.clearAllSnapshots();const a=Le.now();Te.delta=It(0,1e3/60,a-Te.timestamp),Te.timestamp=a,Te.isProcessing=!0,Xa.update.process(Te),Xa.preRender.process(Te),Xa.render.process(Te),Te.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ad.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(FC),this.sharedNodes.forEach(WC)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ze(this.snapshot.measuredBox.x)&&!ze(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 l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=xe(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!hy(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||On(this.latestValues)||d)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),XC(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return xe();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(QC))){const{scroll:d}=this.root;d&&(Tr(a.x,d.offset.x),Tr(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=xe();if(xt(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:f,options:m}=d;d!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&xt(a,o),Tr(a.x,f.offset.x),Tr(a.y,f.offset.y))}return a}applyTransform(o,a=!1){const l=xe();xt(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Nr(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),On(d.latestValues)&&Nr(l,d.latestValues)}return On(this.latestValues)&&Nr(l,this.latestValues),l}removeTransform(o){const a=xe();xt(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!On(c.latestValues))continue;Rc(c.latestValues)&&c.updateSnapshot();const d=xe(),f=c.measurePageBox();xt(d,f),_h(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return On(this.latestValues)&&_h(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Te.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=Te.timestamp;const m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=xe(),this.targetWithTransforms=xe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xC(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xt(this.target,this.layout.layoutBox),ty(this.target,this.targetDelta)):xt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Rc(this.parent.latestValues)||ey(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=xe(),this.relativeTargetOrigin=xe(),Oo(this.relativeTargetOrigin,a,l),xt(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var v;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Te.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;xt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,m=this.treeScale.y;Yk(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=xe());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ph(this.prevProjectionDelta.x,this.projectionDelta.x),Ph(this.prevProjectionDelta.y,this.projectionDelta.y)),Di(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Oh(this.projectionDelta.x,this.prevProjectionDelta.x)||!Oh(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Cr(),this.projectionDelta=Cr(),this.projectionDeltaWithTransform=Cr()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},f=Cr();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const m=xe(),h=l?l.source:void 0,v=this.layout?this.layout.source:void 0,w=h!==v,S=this.getStack(),p=!S||S.members.length<=1,g=!!(w&&!p&&this.options.crossfade===!0&&!this.path.some(GC));this.animationProgress=0;let y;this.mixTargetDelta=b=>{const k=b/1e3;Kh(f.x,o.x,k),Kh(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Oo(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),KC(this.relativeTarget,this.relativeTargetOrigin,m,k),y&&kC(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=xe()),xt(y,this.relativeTarget)),w&&(this.animationValues=d,NC(d,c,this.latestValues,k,g,p)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(En(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=te.update(()=>{so.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Yr(0)),this.currentAnimation=jC(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_C),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&xy(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||xe();const f=ze(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const m=ze(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+m}xt(a,l),Nr(a,d),Di(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new DC),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&il("z",o,c,this.animationValues);for(let d=0;d<rl.length;d++)il(`rotate${rl[d]}`,o,c,this.animationValues),il(`skew${rl[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=io(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=io(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!On(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=CC(this.projectionDeltaWithTransform,this.treeScale,d);l&&(f=l(d,f)),o.transform=f;const{x:m,y:h}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${h.origin*100}% 0`,c.animationValues?o.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in Dc){if(d[v]===void 0)continue;const{correct:w,applyTo:S,isCSSVariable:p}=Dc[v],g=f==="none"?d[v]:w(d[v],c);if(S){const y=S.length;for(let b=0;b<y;b++)o[S[b]]=g}else p?this.options.visualElement.renderState.vars[v]=g:o[v]=g}this.options.layoutId&&(o.pointerEvents=c===this?io(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Uh),this.root.sharedNodes.clear()}}}function zC(e){e.updateLayout()}function IC(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?Rt(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],h=ze(m);m.min=r[f].min,m.max=m.min+h}):xy(s,t.layoutBox,r)&&Rt(f=>{const m=o?t.measuredBox[f]:t.layoutBox[f],h=ze(r[f]);m.max=m.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const a=Cr();Di(a,r,t.layoutBox);const l=Cr();o?Di(l,e.applyTransform(i,!0),t.measuredBox):Di(l,r,t.layoutBox);const c=!hy(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:m,layout:h}=f;if(m&&h){const v=xe();Oo(v,t.layoutBox,m.layoutBox);const w=xe();Oo(w,r,h.layoutBox),my(v,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function VC(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function OC(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function FC(e){e.clearSnapshot()}function Uh(e){e.clearMeasurements()}function Hh(e){e.isLayoutDirty=!1}function $C(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wh(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function BC(e){e.resolveTargetDelta()}function UC(e){e.calcProjection()}function HC(e){e.resetSkewAndRotation()}function WC(e){e.removeLeadSnapshot()}function Kh(e,t,n){e.translate=de(t.translate,0,n),e.scale=de(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Gh(e,t,n,r){e.min=de(t.min,n.min,r),e.max=de(t.max,n.max,r)}function KC(e,t,n,r){Gh(e.x,t.x,n.x,r),Gh(e.y,t.y,n.y,r)}function GC(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const YC={duration:.45,ease:[.4,0,.1,1]},Yh=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Xh=Yh("applewebkit/")&&!Yh("chrome/")?Math.round:at;function Qh(e){e.min=Xh(e.min),e.max=Xh(e.max)}function XC(e){Qh(e.x),Qh(e.y)}function xy(e,t,n){return e==="position"||e==="preserve-aspect"&&!vC(Vh(t),Vh(n),.2)}function QC(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const qC=vy({attachResizeListener:(e,t)=>rs(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),sl={current:void 0},wy=vy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!sl.current){const e=new qC({});e.mount(window),e.setOptions({layoutScroll:!0}),sl.current=e}return sl.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),md=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function qh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ZC(...e){return t=>{let n=!1;const r=e.map(i=>{const s=qh(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():qh(e[i],null)}}}}function JC(...e){return x.useCallback(ZC(...e),e)}class e2 extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,i=jc(r)&&r.offsetWidth||0,s=jc(r)&&r.offsetHeight||0,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left,o.bottom=s-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function t2({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:s}){var m;const o=x.useId(),a=x.useRef(null),l=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=x.useContext(md),d=((m=e.props)==null?void 0:m.ref)??(e==null?void 0:e.ref),f=JC(a,d);return x.useInsertionEffect(()=>{const{width:h,height:v,top:w,left:S,right:p,bottom:g}=l.current;if(t||s===!1||!a.current||!h||!v)return;const y=n==="left"?`left: ${S}`:`right: ${p}`,b=r==="bottom"?`bottom: ${g}`:`top: ${w}`;a.current.dataset.motionPopId=o;const k=document.createElement("style");c&&(k.nonce=c);const C=i??document.head;return C.appendChild(k),k.sheet&&k.sheet.insertRule(`
278
278
  [data-motion-pop-id="${o}"] {
279
279
  position: absolute !important;
280
280
  width: ${h}px !important;
@@ -354,4 +354,4 @@ Respond in JSON format:
354
354
  {"technique": "Technique Name", "reasoning": "Brief reason for your choice"}`}async function SE(e,t,n,r){const i=wE(e,t,n);try{return r.provider==="openai"?await bE(i,r):await kE(i,r)}catch(s){return console.error("LLM API error:",s),CE(n.myPosition)}}async function bE(e,t){var o,a;const n=t.model||"gpt-4o-mini",r=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.apiKey}`},signal:AbortSignal.timeout(5e3),body:JSON.stringify({model:n,messages:[{role:"system",content:"You are an MMA fighter making tactical decisions in a fight. Respond with JSON only."},{role:"user",content:e}],temperature:.7,max_tokens:200})});if(!r.ok)throw new Error(`OpenAI API error: ${r.status}`);const s=((a=(o=(await r.json()).choices[0])==null?void 0:o.message)==null?void 0:a.content)||"";return Nv(s)}async function kE(e,t){var o;const n=t.model||"claude-3-haiku-20240307",r=await fetch("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"Content-Type":"application/json","x-api-key":t.apiKey,"anthropic-version":"2023-06-01"},signal:AbortSignal.timeout(5e3),body:JSON.stringify({model:n,max_tokens:200,system:"You are an MMA fighter making tactical decisions in a fight. Respond with JSON only.",messages:[{role:"user",content:e}],temperature:.7})});if(!r.ok)throw new Error(`Anthropic API error: ${r.status}`);const s=((o=(await r.json()).content[0])==null?void 0:o.text)||"";return Nv(s)}function Nv(e){try{const t=e.match(/\{[\s\S]*\}/);if(!t)throw new Error("No JSON found in response");const n=JSON.parse(t[0]);if(n.technique)return n.technique;throw new Error("No technique in response")}catch{console.error("Failed to parse LLM response:",e);const n=e.match(/"technique"\s*:\s*"([^"]+)"/i);if(n)return n[1];throw new Error("Could not parse technique from LLM response")}}function CE(e){const t=Tv(e);return t.length===0?Sm()[Math.floor(Math.random()*Sm().length)]:t[Math.floor(Math.random()*t.length)]}async function TE(e){return null}function NE({onDismiss:e,agent1Name:t,agent2Name:n}){const[r,i]=x.useState(0),[s,o]=x.useState(""),a=[{title:"Welcome to the Arena",content:"Two AI agents. One cage. No mercy.",detail:`${t} vs ${n} — a 3-round battle for supremacy.`},{title:"How It Works",content:"Real-time MMA combat simulation.",detail:"Every punch, takedown, and submission attempt is calculated based on your agent's skills.md configuration."},{title:"The Action Feed",content:"Watch the fight unfold move-by-move.",detail:"Light hits in cyan. Heavy damage in orange. Critical strikes in red. Position changes in real-time."},{title:"Victory Conditions",content:"KO • TKO • Submission • Decision",detail:"Win by knockout, ref stoppage, tapout, or judges' scorecards. Your agent's legacy is permanent."}],l=a[r];x.useEffect(()=>{o("");let d=0;const f=l.content,m=setInterval(()=>{d<f.length?(o(f.slice(0,d+1)),d++):clearInterval(m)},30);return()=>clearInterval(m)},[r]);const c=()=>{r<a.length-1?i(r+1):e()};return u.jsx(Et.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 bg-black/95 backdrop-blur-sm flex items-center justify-center p-6",children:u.jsxs(Et.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},className:"w-full max-w-2xl bg-zinc-950 border border-zinc-800 rounded-xl overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-6 py-4 bg-zinc-900/50 border-b border-zinc-800",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(uc,{className:"w-5 h-5 text-orange-500"}),u.jsx("span",{className:"font-mono text-sm text-zinc-400",children:"fightbook_init.sh"})]}),u.jsx("button",{onClick:e,className:"text-zinc-500 hover:text-white transition-colors",children:u.jsx(Gg,{className:"w-5 h-5"})})]}),u.jsx("div",{className:"flex items-center gap-1 px-6 py-3 bg-zinc-900/30",children:a.map((d,f)=>u.jsx("div",{className:`h-1 flex-1 rounded-full transition-colors ${f<=r?"bg-orange-500":"bg-zinc-800"}`},f))}),u.jsx("div",{className:"p-8",children:u.jsx(Er,{mode:"wait",children:u.jsxs(Et.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono text-zinc-500",children:[u.jsxs("span",{className:"text-orange-500",children:["0",r+1]}),u.jsx("span",{children:"/"}),u.jsxs("span",{children:["0",a.length]})]}),u.jsx("h2",{className:"text-3xl font-display text-white",children:l.title}),u.jsxs("div",{className:"font-mono text-xl text-orange-400",children:[u.jsx("span",{className:"text-zinc-600",children:"$"})," ",s,u.jsx("span",{className:"animate-pulse",children:"_"})]}),u.jsx("p",{className:"text-zinc-400 leading-relaxed",children:l.detail}),u.jsxs("div",{className:"py-4",children:[r===0&&u.jsx(EE,{agent1:t,agent2:n}),r===1&&u.jsx(PE,{}),r===2&&u.jsx(jE,{}),r===3&&u.jsx(AE,{})]})]},r)})}),u.jsxs("div",{className:"flex items-center justify-between px-6 py-4 bg-zinc-900/30 border-t border-zinc-800",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs text-zinc-500",children:[u.jsx(oS,{className:"w-4 h-4"}),u.jsx("span",{children:"Press SPACE to skip"})]}),u.jsx(Dt,{onClick:c,className:"bg-orange-500 hover:bg-orange-400 text-black font-bold",children:r===a.length-1?u.jsxs(u.Fragment,{children:[u.jsx(tr,{className:"w-4 h-4 mr-2"}),"Enter Arena"]}):u.jsxs(u.Fragment,{children:["Next",u.jsx(Iu,{className:"w-4 h-4 ml-2"})]})})]})]})})}function EE({agent1:e,agent2:t}){return u.jsxs("div",{className:"flex items-center justify-center gap-6 py-4",children:[u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-br from-orange-500/20 to-orange-600/20 border border-orange-500/30 flex items-center justify-center text-2xl font-display text-orange-400",children:e.charAt(0)}),u.jsx("p",{className:"text-xs text-zinc-500 mt-2 font-mono",children:e})]}),u.jsx("div",{className:"text-3xl font-display text-zinc-600",children:"VS"}),u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-br from-purple-500/20 to-purple-600/20 border border-purple-500/30 flex items-center justify-center text-2xl font-display text-purple-400",children:t.charAt(0)}),u.jsx("p",{className:"text-xs text-zinc-500 mt-2 font-mono",children:t})]})]})}function PE(){const e=[{icon:Ou,label:"Striking",color:"text-orange-500"},{icon:Kg,label:"Grappling",color:"text-blue-500"},{icon:Wg,label:"Fight IQ",color:"text-purple-500"},{icon:Hg,label:"Cardio",color:"text-green-500"}];return u.jsx("div",{className:"grid grid-cols-4 gap-3",children:e.map(t=>u.jsxs("div",{className:"bg-zinc-900/50 border border-zinc-800 rounded-lg p-4 text-center",children:[u.jsx(t.icon,{className:`w-6 h-6 ${t.color} mx-auto mb-2`}),u.jsx("p",{className:"text-xs text-zinc-500",children:t.label})]},t.label))})}function jE(){const e=[{text:"2:47 Clean jab lands",color:"text-cyan-400"},{text:"2:31 Takedown attempt...",color:"text-zinc-400"},{text:"2:28 BLOCKED",color:"text-yellow-400"},{text:"2:15 CRUSHING hook!",color:"text-red-400"}];return u.jsxs("div",{className:"bg-zinc-950 border border-zinc-800 rounded-lg p-4 font-mono text-sm",children:[e.map((t,n)=>u.jsx("div",{className:`${t.color} mb-1`,children:t.text},n)),u.jsx("div",{className:"text-zinc-600 mt-2",children:"_"})]})}function AE(){const e=[{icon:Fu,label:"KO",desc:"Knockout"},{icon:sS,label:"TKO",desc:"Ref Stop"},{icon:Ou,label:"SUB",desc:"Submission"},{icon:us,label:"DEC",desc:"Decision"}];return u.jsx("div",{className:"flex items-center justify-center gap-3",children:e.map(t=>u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"w-12 h-12 rounded-lg bg-zinc-900 border border-zinc-800 flex items-center justify-center mb-2",children:u.jsx(t.icon,{className:"w-5 h-5 text-orange-500"})}),u.jsx("p",{className:"text-xs font-bold text-white",children:t.label}),u.jsx("p",{className:"text-[10px] text-zinc-600",children:t.desc})]},t.label))})}function RE({agent1:e,agent2:t,onFightComplete:n,onBack:r,isCpuOpponent:i=!1,cpuDifficulty:s="medium"}){const{toast:o}=uE(),[a,l]=x.useState(null),[c,d]=x.useState(!1),[f,m]=x.useState(1),[h,v]=x.useState([]),[w,S]=x.useState(!0),[p,g]=x.useState(!1),[y,b]=x.useState(null),[k,C]=x.useState(()=>!sessionStorage.getItem("fightbook_seen_intro")),N=x.useRef(null),T=x.useRef(null),E=x.useRef(null),P=e.metadata.id.startsWith("cpu_"),z=t.metadata.id.startsWith("cpu_"),I=!P&&!z,J=x.useCallback((V,K,U)=>{const X=P?e:t,O={...lr(X),id:X.metadata.id,isCpu:!0,difficulty:s,position:U.myPosition},De=lr(P?t:e);return xE(O,De,{round:U.round,timeRemaining:U.timeRemaining,actorHealth:U.myHealth,actorStamina:U.myStamina,actorPosition:U.myPosition,targetHealth:U.oppHealth,targetStamina:U.oppStamina,targetPosition:U.oppPosition,recentActions:U.recentActions,isWinning:U.myHealth>U.oppHealth,isTired:U.myStamina<30,targetIsHurt:U.oppHealth<40})},[e,t,P,z,s]),le=x.useCallback(async(V,K,U)=>{g(!0),b(V);try{const X=await TE(e.metadata.id);if(!X)return o({title:"No API Key",description:"Fighter doesn't have an API key configured. Using random moves.",variant:"destructive"}),km(U.myPosition);const O={provider:"openai",apiKey:X},De=lr(e),Ge=lr(t),Ot=await SE(De,Ge,U,O);return o({title:"LLM Decision",description:`Selected: ${Ot}`,duration:2e3}),Ot}catch(X){return console.error("LLM error:",X),o({title:"LLM Error",description:"Using fallback random technique",variant:"destructive"}),km(U.myPosition)}finally{g(!1),b(null)}},[e,t,o]),pe=x.useCallback(()=>{const V=lr(e),K=lr(t),U=i||P||z,X={onAction:O=>{var De;v(Ge=>[...Ge,O]),l(((De=N.current)==null?void 0:De.getState())||null)},onRoundEnd:()=>{var O;l(((O=N.current)==null?void 0:O.getState())||null)},onFightEnd:O=>{d(!1),l(O),Og({id:O.id,timestamp:Date.now(),agent1:{id:e.metadata.id,name:e.skills.name},agent2:{id:t.metadata.id,name:t.skills.name},winner:O.winner||null,method:O.method||"DEC",round:O.endRound||3,time:A(O.endTime||0),fightData:O});const De=P||z;if(pE(e,t,O,void 0,De).then(()=>{o({title:"Fight Saved!",description:De?"Practice fight saved (won't affect leaderboard).":"Fight saved to database."})}).catch(Ge=>{console.error("Failed to save to database:",Ge),o({title:"Fight Saved (Local)",description:"Saved to browser storage only."})}),O.winner&&!De){const Ge=O.winner===e.skills.name?e.metadata.id:t.metadata.id,Ot=O.winner===e.skills.name?t.metadata.id:e.metadata.id;Promise.all([eN(Ge),tN(Ot)]).then(()=>{console.log("Win/loss counts updated")}).catch(Dn=>{console.error("Failed to update win/loss counts:",Dn)})}else De&&console.log("Practice fight - leaderboard stats not updated");o({title:O.winner?`${O.winner} Wins!`:"Draw!",description:`by ${O.method}`}),n==null||n(O)}};U&&(X.cpuCallback=J,X.mixedMode=!0,X.llmFighterId="fighter1"),I&&(X.llmCallback=le,X.mixedMode=!0),N.current=new mE(V,K,X),l(N.current.getState()),v([])},[e,t,i,P,z,I,J,le,n,o]);x.useEffect(()=>(pe(),()=>{var V;(V=N.current)==null||V.stop()}),[pe]),x.useEffect(()=>{E.current&&(E.current.scrollTop=E.current.scrollHeight)},[h]);const ne=()=>{N.current&&(c?N.current.pause():(a!=null&&a.isComplete&&pe(),N.current.resume()),d(!c))},$=()=>{var V;(V=N.current)==null||V.stop(),d(!1),pe()},j=()=>{N.current&&(N.current.pause(),$())},A=V=>{const K=Math.floor(V/60),U=V%60;return`${K}:${U.toString().padStart(2,"0")}`};if(!a)return null;const D=a.rounds[a.currentRound-1],W=D?A(D.timeRemaining):"0:00",F=()=>{C(!1),sessionStorage.setItem("fightbook_seen_intro","true")};return u.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[u.jsx(Er,{children:k&&u.jsx(NE,{onDismiss:F,agent1Name:e.skills.name,agent2Name:t.skills.name})}),u.jsx("header",{className:"border-b border-border/50 bg-background/95 backdrop-blur-sm sticky top-0 z-50",children:u.jsx("div",{className:"px-6 py-4",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[r&&u.jsx(Dt,{variant:"ghost",onClick:r,children:"← Back"}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-lg bg-gradient-to-br from-primary to-secondary flex items-center justify-center",children:u.jsx(tr,{className:"w-5 h-5 text-white"})}),u.jsxs("div",{children:[u.jsx("h1",{className:"font-display text-lg",children:"FightBook Arena"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Live Text Combat"})]})]})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[p&&u.jsxs("div",{className:"flex items-center gap-2 text-primary animate-pulse",children:[u.jsx(Wg,{className:"w-4 h-4"}),u.jsxs("span",{className:"text-sm font-medium",children:[y," is thinking..."]})]}),u.jsx("div",{className:"flex items-center gap-1 bg-muted rounded-lg p-1",children:[1,2,4].map(V=>u.jsxs("button",{onClick:()=>m(V),className:`px-3 py-1 rounded text-sm font-medium transition-colors ${f===V?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[V,"x"]},V))}),u.jsx(Dt,{variant:"outline",size:"sm",onClick:()=>S(!w),children:w?"Hide Stats":"Show Stats"})]})]})})}),u.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[u.jsx(Er,{children:w&&u.jsx(Et.div,{initial:{width:0,opacity:0},animate:{width:320,opacity:1},exit:{width:0,opacity:0},className:"border-r border-border/50 overflow-y-auto",children:u.jsx(bm,{agent:e,state:a.fighter1,isWinner:a.winner===a.fighter1.name,isLeft:!0})})}),u.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[u.jsx("div",{className:"border-b border-border/50 px-6 py-4",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs(ma,{variant:"outline",className:"text-lg px-4 py-1",children:["ROUND ",a.currentRound," / 3"]}),u.jsxs("div",{className:"flex items-center gap-2 text-2xl font-display",children:[u.jsx(hS,{className:"w-5 h-5 text-primary"}),u.jsx(Er,{mode:"wait",children:u.jsx(Et.span,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:D!=null&&D.timeRemaining&&D.timeRemaining<=10?"text-red-500":"",children:W},W)})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Dt,{variant:"outline",size:"icon",onClick:$,children:u.jsx(uS,{className:"w-4 h-4"})}),u.jsx(Dt,{variant:c?"outline":"default",size:"icon",onClick:ne,className:"h-12 w-12",children:c?u.jsx(aS,{className:"w-5 h-5"}):u.jsx(cS,{className:"w-5 h-5 ml-0.5"})}),u.jsx(Dt,{variant:"outline",size:"icon",onClick:j,children:u.jsx(fS,{className:"w-4 h-4"})})]})]})}),u.jsx(kv,{className:"flex-1 p-6",ref:E,children:u.jsxs("div",{className:"max-w-3xl mx-auto space-y-2",children:[h.length===0&&u.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[u.jsx(tr,{className:"w-12 h-12 mx-auto mb-4 opacity-30"}),u.jsx("p",{className:"text-lg",children:"Fight ready to begin..."}),u.jsx("p",{className:"text-sm",children:"Press play to start"})]}),h.map((V,K)=>u.jsx(ME,{action:V,isNew:K===h.length-1,agent1Name:e.skills.name,agent2Name:t.skills.name},`${V.timestamp}-${K}`)),D&&!D.isActive&&a.currentRound<3&&u.jsx(DE,{round:a.currentRound,fighter1:a.fighter1,fighter2:a.fighter2}),a.isComplete&&u.jsx(_E,{fight:a}),u.jsx("div",{ref:T})]})})]}),u.jsx(Er,{children:w&&u.jsx(Et.div,{initial:{width:0,opacity:0},animate:{width:320,opacity:1},exit:{width:0,opacity:0},className:"border-l border-border/50 overflow-y-auto",children:u.jsx(bm,{agent:t,state:a.fighter2,isWinner:a.winner===a.fighter2.name})})})]})]})}function ME({action:e,isNew:t,agent1Name:n,agent2Name:r}){const i=e.actor===n,s=()=>{switch(e.impact){case"devastating":return"text-red-500 border-red-500/30 bg-red-500/5";case"heavy":return"text-orange-500 border-orange-500/30 bg-orange-500/5";case"moderate":return"text-yellow-500 border-yellow-500/30 bg-yellow-500/5";default:return"text-muted-foreground border-border/30 bg-muted/20"}};return u.jsxs(Et.div,{initial:t?{opacity:0,x:i?-20:20}:!1,animate:{opacity:1,x:0},className:`flex gap-4 p-3 rounded-lg border ${s()} ${i?"flex-row":"flex-row-reverse"}`,children:[u.jsxs("div",{className:"text-xs font-mono text-muted-foreground pt-1",children:["R",e.round," ",LE(e.timeRemaining)]}),u.jsxs("div",{className:`flex-1 ${i?"text-left":"text-right"}`,children:[u.jsx("p",{className:`text-sm ${e.impact==="devastating"?"font-bold":""}`,children:e.description}),e.damage>0&&u.jsxs("span",{className:"text-xs text-red-400",children:["-",e.damage," HP"]})]}),e.impact&&e.impact!=="light"&&u.jsx(ma,{variant:"outline",className:"text-xs capitalize",children:e.impact})]})}function DE({round:e,fighter1:t,fighter2:n}){return u.jsxs("div",{className:"my-6 p-6 bg-muted/30 rounded-xl border border-border/50 text-center",children:[u.jsxs("h3",{className:"text-2xl font-display mb-4",children:["End of Round ",e]}),u.jsxs("div",{className:"grid grid-cols-2 gap-8 max-w-md mx-auto",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:t.name}),u.jsx("div",{className:"text-2xl font-display",children:t.significantStrikes}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Significant Strikes"})]}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:n.name}),u.jsx("div",{className:"text-2xl font-display",children:n.significantStrikes}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Significant Strikes"})]})]})]})}function _E({fight:e}){return u.jsxs(Et.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"my-8 p-8 bg-gradient-to-br from-primary/20 to-secondary/20 rounded-2xl border border-primary/30 text-center",children:[u.jsx(us,{className:"w-16 h-16 mx-auto mb-4 text-yellow-500"}),u.jsx("h2",{className:"text-4xl font-display mb-2",children:e.winner?`${e.winner} Wins!`:"Draw!"}),u.jsxs("p",{className:"text-xl text-muted-foreground mb-6",children:["by ",e.method," ",e.endRound!==3&&`- Round ${e.endRound}`]}),u.jsxs("div",{className:"grid grid-cols-2 gap-6 max-w-lg mx-auto",children:[u.jsxs("div",{className:"bg-background/50 rounded-lg p-4",children:[u.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.fighter1.name}),u.jsxs("div",{className:"text-3xl font-display",children:[Math.round(e.fighter1.currentHealth),"%"]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Health Remaining"})]}),u.jsxs("div",{className:"bg-background/50 rounded-lg p-4",children:[u.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:e.fighter2.name}),u.jsxs("div",{className:"text-3xl font-display",children:[Math.round(e.fighter2.currentHealth),"%"]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Health Remaining"})]})]})]})}function bm({agent:e,state:t,isWinner:n,isLeft:r=!1}){const i=t.currentHealth,s=t.currentStamina;return u.jsxs("div",{className:"p-6 space-y-6",children:[u.jsxs("div",{className:`flex items-center gap-4 ${r?"":"flex-row-reverse text-right"}`,children:[u.jsx("div",{className:"w-16 h-16 rounded-full bg-gradient-to-br from-primary/20 to-secondary/20 flex items-center justify-center text-2xl font-display",children:e.skills.name.charAt(0)}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-display text-xl",children:e.skills.name}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:['"',e.skills.nickname,'"']}),n&&u.jsx(ma,{className:"mt-1 bg-yellow-500 text-black",children:"WINNER"})]})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[u.jsx("span",{className:"text-red-400",children:"Health"}),u.jsxs("span",{className:"font-mono",children:[Math.round(i),"%"]})]}),u.jsx($c,{value:i,className:"h-3 bg-red-950"})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[u.jsx("span",{className:"text-yellow-400",children:"Stamina"}),u.jsxs("span",{className:"font-mono",children:[Math.round(s),"%"]})]}),u.jsx($c,{value:s,className:"h-2 bg-yellow-950"})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsx("h4",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:"Fight Stats"}),u.jsx(on,{label:"Significant Strikes",value:t.significantStrikes}),u.jsx(on,{label:"Total Strikes",value:t.totalStrikes}),u.jsx(on,{label:"Takedowns",value:t.takedownsLanded}),u.jsx(on,{label:"Knockdowns",value:t.knockdowns})]}),u.jsxs("div",{className:"pt-4 border-t border-border/50 space-y-3",children:[u.jsx("h4",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider",children:"Agent Stats"}),u.jsx(on,{label:"Striking",value:e.skills.striking,icon:Ou}),u.jsx(on,{label:"Wrestling",value:e.skills.wrestling,icon:Kg}),u.jsx(on,{label:"Submissions",value:e.skills.submissions,icon:Fu}),u.jsx(on,{label:"Cardio",value:e.skills.cardio,icon:Hg})]}),u.jsxs("div",{className:"pt-4 border-t border-border/50",children:[u.jsx("h4",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"Career"}),u.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[u.jsxs("div",{className:"bg-muted/30 rounded-lg p-2",children:[u.jsx("div",{className:"text-lg font-display text-green-500",children:e.metadata.wins}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Wins"})]}),u.jsxs("div",{className:"bg-muted/30 rounded-lg p-2",children:[u.jsx("div",{className:"text-lg font-display text-red-500",children:e.metadata.losses}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Losses"})]}),u.jsxs("div",{className:"bg-muted/30 rounded-lg p-2",children:[u.jsx("div",{className:"text-lg font-display",children:e.metadata.ranking}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Rating"})]})]})]})]})}function on({label:e,value:t,icon:n}){return u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsxs("span",{className:"text-muted-foreground flex items-center gap-2",children:[n&&u.jsx(n,{className:"w-3 h-3"}),e]}),u.jsx("span",{className:"font-mono font-medium",children:t})]})}function lr(e){const t=e.skills;return{name:t.name,nickname:t.nickname,striking:t.striking,punchSpeed:t.punchSpeed,kickPower:t.kickPower,headMovement:t.headMovement,wrestling:t.wrestling,takedownDefense:t.takedownDefense,submissions:t.submissions,submissionDefense:t.submissionDefense,groundGame:(t.groundAndPound+t.topControl+t.bottomGame)/3,cardio:t.cardio,chin:t.chin,recovery:t.recovery,aggression:t.aggression,fightIQ:t.fightIQ,heart:t.heart}}function LE(e){const t=Math.floor(e/60),n=e%60;return`${t}:${n.toString().padStart(2,"0")}`}function km(e){const t=[...zr,...Ir,...Vr,...Or],n=t.filter(r=>r.position.includes(e));return n.length===0?t[Math.floor(Math.random()*t.length)].name:n[Math.floor(Math.random()*n.length)].name}const Ev="fightbook_votes";async function zE(e,t){return FE(e,t||"anonymous")}async function IE(e,t){return $E(e,t||"anonymous")}async function VE(e,t){return await Pv(e,t)?(await IE(e,t),{voted:!1}):(await zE(e,t),{voted:!0})}async function OE(e){return BE(e)}async function Pv(e,t){return t?UE(e,t):!1}function ya(){try{const e=localStorage.getItem(Ev);return e?JSON.parse(e):{}}catch{return{}}}function jv(e){localStorage.setItem(Ev,JSON.stringify(e))}function FE(e,t){const n=ya();return n[e]||(n[e]=[]),n[e].includes(t)||(n[e].push(t),jv(n)),!0}function $E(e,t){const n=ya();return n[e]&&(n[e]=n[e].filter(r=>r!==t),jv(n)),!0}function BE(e){var n;return((n=ya()[e])==null?void 0:n.length)||0}function UE(e,t){var r;return((r=ya()[e])==null?void 0:r.includes(t))||!1}function HE({fightId:e,userId:t,initialVoteCount:n=0,showCount:r=!0,size:i="default",variant:s="outline"}){const[o,a]=x.useState(n),[l,c]=x.useState(!1),[d,f]=x.useState(!1),[m,h]=x.useState(!1);x.useEffect(()=>{v()},[e,t]);const v=async()=>{try{const[p,g]=await Promise.all([OE(e),Pv(e,t)]);a(p),c(g)}catch(p){console.error("Failed to load vote status:",p)}finally{h(!0)}},w=async()=>{if(!d){f(!0);try{(await VE(e,t)).voted?(a(g=>g+1),c(!0),Hn.success("You voted this fight as entertaining!",{description:"Thanks for your vote."})):(a(g=>Math.max(0,g-1)),c(!1),Hn.info("Vote removed"))}catch{Hn.error("Failed to vote",{description:"Please try again."})}finally{f(!1)}}},S={sm:"h-7 text-xs px-2",default:"h-9 px-3",lg:"h-11 px-4"};return m?u.jsx(Et.div,{whileTap:{scale:.95},children:u.jsxs(Dt,{variant:s,size:"sm",onClick:w,disabled:d,className:`
355
355
  ${S[i]} gap-1.5 transition-all
356
356
  ${l?"bg-orange-500/20 text-orange-500 border-orange-500/50 hover:bg-orange-500/30":"hover:bg-orange-500/10 hover:text-orange-500 hover:border-orange-500/30"}
357
- `,children:[d?u.jsx(Gf,{className:"w-4 h-4 animate-spin"}):u.jsx(Vu,{className:`w-4 h-4 ${l?"fill-current":""}`}),u.jsx("span",{children:"Entertaining"}),r&&u.jsx(ma,{variant:"secondary",className:`ml-1 text-xs ${l?"bg-orange-500/30 text-orange-200":""}`,children:o})]})}):u.jsxs(Dt,{variant:s,size:"sm",disabled:!0,className:`${S[i]} opacity-50`,children:[u.jsx(Gf,{className:"w-4 h-4 animate-spin mr-1"}),r&&u.jsx("span",{className:"ml-1",children:"..."})]})}function WE({onBack:e}){const[t,n]=x.useState([]),[r,i]=x.useState({}),[s,o]=x.useState(!0),[a,l]=x.useState("all"),[c,d]=x.useState(null);x.useEffect(()=>{f()},[]);const f=async()=>{o(!0);try{const[h,v]=await Promise.all([yE(),Promise.resolve(Rn())]);n(h);const w={};v.forEach(S=>{w[S.metadata.id]=S}),i(w)}catch(h){console.error("Failed to load fights:",h)}finally{o(!1)}},m=t.filter(h=>{if(a==="all")return!0;const v=h.winnerId===h.agent1Id;return a==="wins"?v:a==="losses"?!v&&h.winnerId!==null:!0});return s?u.jsx("div",{className:"border border-zinc-800 rounded-sm p-8 text-center",children:u.jsx("div",{className:"text-zinc-500 animate-pulse",children:"loading fight history..."})}):t.length===0?u.jsxs("div",{className:"border border-zinc-800 rounded-sm p-8 text-center",children:[u.jsx("div",{className:"text-zinc-600 mb-2",children:"No fights recorded"}),u.jsx("div",{className:"text-sm text-zinc-500",children:"Complete a fight to see it here"})]}):u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsxs("h2",{className:"text-lg font-bold flex items-center gap-2",children:[u.jsx(us,{className:"w-5 h-5 text-yellow-500"}),"Fight History"]}),u.jsxs("p",{className:"text-sm text-zinc-500",children:[t.length," fight",t.length!==1?"s":""," recorded"]})]}),u.jsx("div",{className:"flex items-center gap-2",children:["all","wins","losses"].map(h=>u.jsx("button",{onClick:()=>l(h),className:`px-3 py-1 text-xs uppercase tracking-wider transition-colors ${a===h?"text-orange-500 border-b border-orange-500":"text-zinc-500 hover:text-white"}`,children:h},h))})]}),u.jsxs("div",{className:"border border-zinc-800 rounded-sm overflow-hidden",children:[u.jsxs("div",{className:"grid grid-cols-12 gap-4 px-4 py-2 bg-zinc-900 text-xs text-zinc-500 uppercase tracking-wider",children:[u.jsx("div",{className:"col-span-4",children:"Matchup"}),u.jsx("div",{className:"col-span-2",children:"Result"}),u.jsx("div",{className:"col-span-2",children:"Method"}),u.jsx("div",{className:"col-span-2",children:"Round"}),u.jsx("div",{className:"col-span-2 text-right",children:"Actions"})]}),m.map(h=>{const v=r[h.agent1Id],w=r[h.agent2Id],S=h.winnerId===h.agent1Id,p=h.winnerId&&h.winnerId!==h.agent1Id;h.winnerId;const g=c===h.id;return u.jsxs("div",{children:[u.jsxs("div",{className:"grid grid-cols-12 gap-4 px-4 py-3 border-t border-zinc-800 items-center hover:bg-zinc-900/30 transition-colors cursor-pointer",onClick:()=>d(g?null:h.id),children:[u.jsxs("div",{className:"col-span-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[u.jsx("span",{className:"font-medium",children:(v==null?void 0:v.skills.name)||"Unknown"}),u.jsx("span",{className:"text-zinc-600",children:"vs"}),u.jsx("span",{className:"font-medium",children:(w==null?void 0:w.skills.name)||"Unknown"})]}),u.jsx("div",{className:"text-xs text-zinc-500 mt-0.5",children:new Date(h.createdAt).toLocaleDateString()})]}),u.jsx("div",{className:"col-span-2",children:u.jsx("span",{className:`text-xs uppercase font-medium ${S?"text-green-500":p?"text-red-500":"text-zinc-500"}`,children:S?"Win":p?"Loss":"Draw"})}),u.jsx("div",{className:"col-span-2 text-sm text-zinc-400",children:h.method}),u.jsxs("div",{className:"col-span-2 text-sm font-mono text-zinc-400",children:["R",h.round]}),u.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-1",children:[u.jsx(HE,{fightId:h.id,size:"sm",showCount:!0}),u.jsx("button",{onClick:y=>{y.stopPropagation(),KE(h,v,w)},className:"p-1.5 text-zinc-500 hover:text-blue-400 transition-colors",title:"Share to X",children:u.jsx(pS,{className:"w-4 h-4"})}),u.jsx(Iu,{className:`w-4 h-4 text-zinc-600 transition-transform ${g?"rotate-90":""}`})]})]}),g&&u.jsxs("div",{className:"border-t border-zinc-800 bg-zinc-900/20 px-4 py-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-6 text-sm",children:[u.jsxs("div",{children:[u.jsxs("h4",{className:"text-zinc-500 mb-2",children:[(v==null?void 0:v.skills.name)||"Fighter 1"," Stats"]}),u.jsxs("div",{className:"space-y-1 font-mono text-xs",children:[u.jsx(an,{label:"Health",value:`${Math.round(h.fightData.fighter1.currentHealth)}%`}),u.jsx(an,{label:"Strikes",value:h.fightData.fighter1.significantStrikes}),u.jsx(an,{label:"Takedowns",value:h.fightData.fighter1.takedownsLanded}),u.jsx(an,{label:"Knockdowns",value:h.fightData.fighter1.knockdowns})]})]}),u.jsxs("div",{children:[u.jsxs("h4",{className:"text-zinc-500 mb-2",children:[(w==null?void 0:w.skills.name)||"Fighter 2"," Stats"]}),u.jsxs("div",{className:"space-y-1 font-mono text-xs",children:[u.jsx(an,{label:"Health",value:`${Math.round(h.fightData.fighter2.currentHealth)}%`}),u.jsx(an,{label:"Strikes",value:h.fightData.fighter2.significantStrikes}),u.jsx(an,{label:"Takedowns",value:h.fightData.fighter2.takedownsLanded}),u.jsx(an,{label:"Knockdowns",value:h.fightData.fighter2.knockdowns})]})]})]}),h.prizeAwarded&&u.jsx("div",{className:"mt-4 pt-4 border-t border-zinc-800",children:u.jsxs("div",{className:"flex items-center gap-2 text-green-500 text-sm",children:[u.jsx(rS,{className:"w-4 h-4"}),u.jsxs("span",{children:["Prize awarded: $",h.prizeAmount]}),h.fightData.isEntertaining&&u.jsxs("span",{className:"flex items-center gap-1 text-orange-500",children:[u.jsx(Vu,{className:"w-3 h-3"}),"(entertaining)"]})]})})]})]},h.id)})]})]})}function an({label:e,value:t}){return u.jsxs("div",{className:"flex justify-between py-1 border-b border-zinc-800/50 last:border-0",children:[u.jsx("span",{className:"text-zinc-500",children:e}),u.jsx("span",{children:t})]})}function KE(e,t,n){const r=(t==null?void 0:t.skills.name)||"Fighter 1",i=(n==null?void 0:n.skills.name)||"Fighter 2",s=e.winnerId===e.agent1Id?r:i,o=`Just watched ${r} vs ${i}! ${s} wins by ${e.method} in Round ${e.round}! 🥊 #AIFights #FightBook`,a=`https://twitter.com/intent/tweet?text=${encodeURIComponent(o)}`;window.open(a,"_blank","width=600,height=400")}function GE(){const[e,t]=x.useState("landing"),[n,r]=x.useState([]),[i,s]=x.useState(null),[o,a]=x.useState(null),[l,c]=x.useState(null),[d,f]=x.useState(!0),[m,h]=x.useState(()=>!localStorage.getItem("fightbook_boot_complete"));x.useEffect(()=>{v()},[]);const v=()=>{const E=Rn(),P=Sw();r(E),s(P),f(!1)},w=()=>{t(n.length>0?"roster":"create")},S=()=>{a(null),t("create")},p=E=>{a(E),t("edit")},g=E=>{xw(E),(!i||E.metadata.id===i.metadata.id)&&Hf(E),v(),t("roster"),Hn.success(`${E.skills.name} saved`)},y=E=>{ww(E),v(),Hn.success("Agent deleted")},b=E=>{Hf(E),s(E)},k=(E,P)=>{c([E,P]),t("fight")},C=()=>{v()},N=E=>{try{const P=Fg(E),z=lc(P.name||"Unnamed");z.skills={...z.skills,...P},g(z),Hn.success("Agent imported from skills.md")}catch{Hn.error("Failed to parse skills.md")}},T=()=>{h(!1),localStorage.setItem("fightbook_boot_complete","true")};return d?u.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:u.jsx("div",{className:"text-zinc-500 animate-pulse",children:"loading..."})}):m?u.jsx(QT,{onComplete:T}):e==="landing"?u.jsx(yS,{onEnter:w}):u.jsxs("div",{className:"min-h-screen bg-black text-white",children:[u.jsx("header",{className:"border-b border-zinc-800 bg-zinc-950/50",children:u.jsx("div",{className:"max-w-6xl mx-auto px-4 py-3",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>t("roster"),children:[u.jsx("span",{className:"text-orange-500 font-bold text-lg",children:"⌘"}),u.jsx("span",{className:"font-bold",children:"fightbook"}),u.jsx("span",{className:"text-zinc-600 text-sm",children:"v1.0"})]}),u.jsxs("nav",{className:"flex items-center gap-1",children:[u.jsx($s,{active:e==="roster",onClick:()=>t("roster"),children:"roster"}),u.jsx($s,{active:e==="history",onClick:()=>t("history"),children:"history"}),u.jsx($s,{active:e==="leaderboard",onClick:()=>t("leaderboard"),children:"leaderboard"}),u.jsx($s,{active:e==="create",onClick:S,children:"+new"})]})]})})}),u.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-6",children:[e==="roster"&&u.jsx(qT,{agents:n,currentAgent:i,onCreate:S,onEdit:p,onDelete:y,onSelect:b,onFight:k,onImport:N}),(e==="create"||e==="edit")&&u.jsx(DN,{agent:o,onSave:g,onCancel:()=>t("roster")}),e==="fight"&&l&&u.jsx(RE,{agent1:l[0],agent2:l[1],onFightComplete:C,onBack:()=>t("roster")}),e==="history"&&u.jsx(WE,{onBack:()=>t("roster")}),e==="leaderboard"&&u.jsx(iN,{})]}),u.jsx("footer",{className:"border-t border-zinc-800 mt-auto",children:u.jsx("div",{className:"max-w-6xl mx-auto px-4 py-3",children:u.jsxs("div",{className:"flex items-center justify-between text-xs text-zinc-600",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs("span",{children:[n.length," agents"]}),u.jsxs("span",{children:[(i==null?void 0:i.metadata.totalFights)||0," fights"]})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("a",{href:"https://x.com/fightbookxyz",target:"_blank",rel:"noopener",children:"@fightbookxyz"}),u.jsx("span",{className:"text-zinc-700",children:"|"}),u.jsx("span",{children:"skills.md powered"})]})]})})})]})}function $s({children:e,active:t,onClick:n}){return u.jsx("button",{onClick:n,className:`px-3 py-1.5 text-sm transition-all ${t?"text-orange-500 border-b-2 border-orange-500":"text-zinc-400 hover:text-white"}`,children:e})}Vg(document.getElementById("root")).render(u.jsx(GE,{}));
357
+ `,children:[d?u.jsx(Gf,{className:"w-4 h-4 animate-spin"}):u.jsx(Vu,{className:`w-4 h-4 ${l?"fill-current":""}`}),u.jsx("span",{children:"Entertaining"}),r&&u.jsx(ma,{variant:"secondary",className:`ml-1 text-xs ${l?"bg-orange-500/30 text-orange-200":""}`,children:o})]})}):u.jsxs(Dt,{variant:s,size:"sm",disabled:!0,className:`${S[i]} opacity-50`,children:[u.jsx(Gf,{className:"w-4 h-4 animate-spin mr-1"}),r&&u.jsx("span",{className:"ml-1",children:"..."})]})}function WE({onBack:e}){const[t,n]=x.useState([]),[r,i]=x.useState({}),[s,o]=x.useState(!0),[a,l]=x.useState("all"),[c,d]=x.useState(null);x.useEffect(()=>{f()},[]);const f=async()=>{o(!0);try{const[h,v]=await Promise.all([yE(),Promise.resolve(Rn())]);n(h);const w={};v.forEach(S=>{w[S.metadata.id]=S}),i(w)}catch(h){console.error("Failed to load fights:",h)}finally{o(!1)}},m=t.filter(h=>{if(a==="all")return!0;const v=h.winnerId===h.agent1Id;return a==="wins"?v:a==="losses"?!v&&h.winnerId!==null:!0});return s?u.jsx("div",{className:"border border-zinc-800 rounded-sm p-8 text-center",children:u.jsx("div",{className:"text-zinc-500 animate-pulse",children:"loading fight history..."})}):t.length===0?u.jsxs("div",{className:"border border-zinc-800 rounded-sm p-8 text-center",children:[u.jsx("div",{className:"text-zinc-600 mb-2",children:"No fights recorded"}),u.jsx("div",{className:"text-sm text-zinc-500",children:"Complete a fight to see it here"})]}):u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsxs("h2",{className:"text-lg font-bold flex items-center gap-2",children:[u.jsx(us,{className:"w-5 h-5 text-yellow-500"}),"Fight History"]}),u.jsxs("p",{className:"text-sm text-zinc-500",children:[t.length," fight",t.length!==1?"s":""," recorded"]})]}),u.jsx("div",{className:"flex items-center gap-2",children:["all","wins","losses"].map(h=>u.jsx("button",{onClick:()=>l(h),className:`px-3 py-1 text-xs uppercase tracking-wider transition-colors ${a===h?"text-orange-500 border-b border-orange-500":"text-zinc-500 hover:text-white"}`,children:h},h))})]}),u.jsxs("div",{className:"border border-zinc-800 rounded-sm overflow-hidden",children:[u.jsxs("div",{className:"grid grid-cols-12 gap-4 px-4 py-2 bg-zinc-900 text-xs text-zinc-500 uppercase tracking-wider",children:[u.jsx("div",{className:"col-span-4",children:"Matchup"}),u.jsx("div",{className:"col-span-2",children:"Result"}),u.jsx("div",{className:"col-span-2",children:"Method"}),u.jsx("div",{className:"col-span-2",children:"Round"}),u.jsx("div",{className:"col-span-2 text-right",children:"Actions"})]}),m.map(h=>{const v=r[h.agent1Id],w=r[h.agent2Id],S=h.winnerId===h.agent1Id,p=h.winnerId&&h.winnerId!==h.agent1Id;h.winnerId;const g=c===h.id;return u.jsxs("div",{children:[u.jsxs("div",{className:"grid grid-cols-12 gap-4 px-4 py-3 border-t border-zinc-800 items-center hover:bg-zinc-900/30 transition-colors cursor-pointer",onClick:()=>d(g?null:h.id),children:[u.jsxs("div",{className:"col-span-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[u.jsx("span",{className:"font-medium",children:(v==null?void 0:v.skills.name)||"Unknown"}),u.jsx("span",{className:"text-zinc-600",children:"vs"}),u.jsx("span",{className:"font-medium",children:(w==null?void 0:w.skills.name)||"Unknown"})]}),u.jsx("div",{className:"text-xs text-zinc-500 mt-0.5",children:new Date(h.createdAt).toLocaleDateString()})]}),u.jsx("div",{className:"col-span-2",children:u.jsx("span",{className:`text-xs uppercase font-medium ${S?"text-green-500":p?"text-red-500":"text-zinc-500"}`,children:S?"Win":p?"Loss":"Draw"})}),u.jsx("div",{className:"col-span-2 text-sm text-zinc-400",children:h.method}),u.jsxs("div",{className:"col-span-2 text-sm font-mono text-zinc-400",children:["R",h.round]}),u.jsxs("div",{className:"col-span-2 flex items-center justify-end gap-1",children:[u.jsx(HE,{fightId:h.id,size:"sm",showCount:!0}),u.jsx("button",{onClick:y=>{y.stopPropagation(),KE(h,v,w)},className:"p-1.5 text-zinc-500 hover:text-blue-400 transition-colors",title:"Share to X",children:u.jsx(pS,{className:"w-4 h-4"})}),u.jsx(Iu,{className:`w-4 h-4 text-zinc-600 transition-transform ${g?"rotate-90":""}`})]})]}),g&&u.jsxs("div",{className:"border-t border-zinc-800 bg-zinc-900/20 px-4 py-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-6 text-sm",children:[u.jsxs("div",{children:[u.jsxs("h4",{className:"text-zinc-500 mb-2",children:[(v==null?void 0:v.skills.name)||"Fighter 1"," Stats"]}),u.jsxs("div",{className:"space-y-1 font-mono text-xs",children:[u.jsx(an,{label:"Health",value:`${Math.round(h.fightData.fighter1.currentHealth)}%`}),u.jsx(an,{label:"Strikes",value:h.fightData.fighter1.significantStrikes}),u.jsx(an,{label:"Takedowns",value:h.fightData.fighter1.takedownsLanded}),u.jsx(an,{label:"Knockdowns",value:h.fightData.fighter1.knockdowns})]})]}),u.jsxs("div",{children:[u.jsxs("h4",{className:"text-zinc-500 mb-2",children:[(w==null?void 0:w.skills.name)||"Fighter 2"," Stats"]}),u.jsxs("div",{className:"space-y-1 font-mono text-xs",children:[u.jsx(an,{label:"Health",value:`${Math.round(h.fightData.fighter2.currentHealth)}%`}),u.jsx(an,{label:"Strikes",value:h.fightData.fighter2.significantStrikes}),u.jsx(an,{label:"Takedowns",value:h.fightData.fighter2.takedownsLanded}),u.jsx(an,{label:"Knockdowns",value:h.fightData.fighter2.knockdowns})]})]})]}),h.prizeAwarded&&u.jsx("div",{className:"mt-4 pt-4 border-t border-zinc-800",children:u.jsxs("div",{className:"flex items-center gap-2 text-green-500 text-sm",children:[u.jsx(rS,{className:"w-4 h-4"}),u.jsxs("span",{children:["Prize awarded: $",h.prizeAmount]}),h.fightData.isEntertaining&&u.jsxs("span",{className:"flex items-center gap-1 text-orange-500",children:[u.jsx(Vu,{className:"w-3 h-3"}),"(entertaining)"]})]})})]})]},h.id)})]})]})}function an({label:e,value:t}){return u.jsxs("div",{className:"flex justify-between py-1 border-b border-zinc-800/50 last:border-0",children:[u.jsx("span",{className:"text-zinc-500",children:e}),u.jsx("span",{children:t})]})}function KE(e,t,n){const r=(t==null?void 0:t.skills.name)||"Fighter 1",i=(n==null?void 0:n.skills.name)||"Fighter 2",s=e.winnerId===e.agent1Id?r:i,o=`Just watched ${r} vs ${i}! ${s} wins by ${e.method} in Round ${e.round}! 🥊 #AIFights #FightBook`,a=`https://twitter.com/intent/tweet?text=${encodeURIComponent(o)}`;window.open(a,"_blank","width=600,height=400")}function GE(){const[e,t]=x.useState("landing"),[n,r]=x.useState([]),[i,s]=x.useState(null),[o,a]=x.useState(null),[l,c]=x.useState(null),[d,f]=x.useState(!0),[m,h]=x.useState(()=>!localStorage.getItem("fightbook_boot_complete"));x.useEffect(()=>{v()},[]);const v=()=>{const E=Rn(),P=Sw();r(E),s(P),f(!1)},w=()=>{t(n.length>0?"roster":"create")},S=()=>{a(null),t("create")},p=E=>{a(E),t("edit")},g=E=>{xw(E),(!i||E.metadata.id===i.metadata.id)&&Hf(E),v(),t("roster"),Hn.success(`${E.skills.name} saved`)},y=E=>{ww(E),v(),Hn.success("Agent deleted")},b=E=>{Hf(E),s(E)},k=(E,P)=>{c([E,P]),t("fight")},C=()=>{v()},N=E=>{try{const P=Fg(E),z=lc(P.name||"Unnamed");z.skills={...z.skills,...P},g(z),Hn.success("Agent imported from skills.md")}catch{Hn.error("Failed to parse skills.md")}},T=()=>{h(!1),localStorage.setItem("fightbook_boot_complete","true")};return d?u.jsx("div",{className:"min-h-screen bg-black flex items-center justify-center",children:u.jsx("div",{className:"text-zinc-500 animate-pulse",children:"loading..."})}):m?u.jsx(QT,{onComplete:T}):e==="landing"?u.jsx(yS,{onEnter:w}):u.jsxs("div",{className:"min-h-screen bg-black text-white",children:[u.jsx("header",{className:"border-b border-zinc-800 bg-zinc-950/50",children:u.jsx("div",{className:"max-w-6xl mx-auto px-4 py-3",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>t("roster"),children:[u.jsx("span",{className:"text-orange-500 font-bold text-lg",children:"⌘"}),u.jsx("span",{className:"font-bold",children:"fightbook"}),u.jsx("span",{className:"text-zinc-600 text-sm",children:"v1.0"})]}),u.jsxs("nav",{className:"flex items-center gap-1",children:[u.jsx($s,{active:e==="roster",onClick:()=>t("roster"),children:"roster"}),u.jsx($s,{active:e==="history",onClick:()=>t("history"),children:"history"}),u.jsx($s,{active:e==="leaderboard",onClick:()=>t("leaderboard"),children:"leaderboard"}),u.jsx($s,{active:e==="create",onClick:S,children:"+new"})]})]})})}),u.jsxs("main",{className:"max-w-6xl mx-auto px-4 py-6",children:[e==="roster"&&u.jsx(qT,{agents:n,currentAgent:i,onCreate:S,onEdit:p,onDelete:y,onSelect:b,onFight:k,onImport:N}),(e==="create"||e==="edit")&&u.jsx(DN,{agent:o,onSave:g,onCancel:()=>t("roster")}),e==="fight"&&l&&u.jsx(RE,{agent1:l[0],agent2:l[1],onFightComplete:C,onBack:()=>t("roster")}),e==="history"&&u.jsx(WE,{onBack:()=>t("roster")}),e==="leaderboard"&&u.jsx(iN,{})]}),u.jsx("footer",{className:"border-t border-zinc-800 mt-auto",children:u.jsx("div",{className:"max-w-6xl mx-auto px-4 py-3",children:u.jsxs("div",{className:"flex items-center justify-between text-xs text-zinc-600",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs("span",{children:[n.length," agents"]}),u.jsxs("span",{children:[(i==null?void 0:i.metadata.totalFights)||0," fights"]})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("a",{href:"https://github.com/resided/wallet-warriors",target:"_blank",rel:"noopener",children:"github"}),u.jsx("span",{className:"text-zinc-700",children:"|"}),u.jsx("span",{children:"skills.md powered"})]})]})})})]})}function $s({children:e,active:t,onClick:n}){return u.jsx("button",{onClick:n,className:`px-3 py-1.5 text-sm transition-all ${t?"text-orange-500 border-b-2 border-orange-500":"text-zinc-400 hover:text-white"}`,children:e})}Vg(document.getElementById("root")).render(u.jsx(GE,{}));
package/dist/index.html CHANGED
@@ -23,7 +23,7 @@
23
23
 
24
24
  <!-- Theme Color -->
25
25
  <meta name="theme-color" content="#0a0a0a" />
26
- <script type="module" crossorigin src="/assets/index-C-_XA-_f.js"></script>
26
+ <script type="module" crossorigin src="/assets/index-CLZQAKX8.js"></script>
27
27
  <link rel="stylesheet" crossorigin href="/assets/index-DDAi7vIJ.css">
28
28
  </head>
29
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fightbook",
3
- "version": "1.0.9",
3
+ "version": "1.1.2",
4
4
  "type": "module",
5
5
  "description": "AI Combat Arena - Configure fighters with skills.md, simulate MMA combat in real-time",
6
6
  "main": "./dist/index.js",
@@ -45,12 +45,12 @@
45
45
  "license": "MIT",
46
46
  "repository": {
47
47
  "type": "git",
48
- "url": "git+https://github.com/resided/fightbook.git"
48
+ "url": "git+https://github.com/resided/wallet-warriors.git"
49
49
  },
50
50
  "bugs": {
51
- "url": "https://github.com/resided/fightbook/issues"
51
+ "url": "https://github.com/resided/wallet-warriors/issues"
52
52
  },
53
- "homepage": "https://fightbook.xyz",
53
+ "homepage": "https://fightbook-chi.vercel.app",
54
54
  "dependencies": {
55
55
  "@hookform/resolvers": "^3.10.0",
56
56
  "@radix-ui/react-accordion": "^1.2.11",