@epic-web/workshop-app 4.2.8 → 4.3.0

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.
Files changed (109) hide show
  1. package/build/client/assets/{_-CsdFvUbA.js → _-ByTWgb53.js} +2 -2
  2. package/build/client/assets/{_-CsdFvUbA.js.map → _-ByTWgb53.js.map} +1 -1
  3. package/build/client/assets/_exerciseNumber-9RwIhGRW.js +2 -0
  4. package/build/client/assets/{_exerciseNumber-DWZNkWZM.js.map → _exerciseNumber-9RwIhGRW.js.map} +1 -1
  5. package/build/client/assets/{_exerciseNumber_._stepNumber-P76hDsE6.js → _exerciseNumber_._stepNumber-D1wwEMQx.js} +2 -2
  6. package/build/client/assets/{_exerciseNumber_._stepNumber-P76hDsE6.js.map → _exerciseNumber_._stepNumber-D1wwEMQx.js.map} +1 -1
  7. package/build/client/assets/_exerciseNumber_.finished-BhpKVn4e.js +2 -0
  8. package/build/client/assets/{_exerciseNumber_.finished-CpC-flTW.js.map → _exerciseNumber_.finished-BhpKVn4e.js.map} +1 -1
  9. package/build/client/assets/{_layout-DEZ-aTmx.js → _layout-BaPtC79F.js} +2 -2
  10. package/build/client/assets/{_layout-DEZ-aTmx.js.map → _layout-BaPtC79F.js.map} +1 -1
  11. package/build/client/assets/_layout-Bj9PyQQD.js +2 -0
  12. package/build/client/assets/{_layout-D1A2zp9y.js.map → _layout-Bj9PyQQD.js.map} +1 -1
  13. package/build/client/assets/_layout-DPfeFZ1b.js +2 -0
  14. package/build/client/assets/{_layout-BSoUgboG.js.map → _layout-DPfeFZ1b.js.map} +1 -1
  15. package/build/client/assets/_layout-PTTX5RMb.js +2 -0
  16. package/build/client/assets/_layout-PTTX5RMb.js.map +1 -0
  17. package/build/client/assets/account-C6GYxzo4.js +2 -0
  18. package/build/client/assets/{account-BeKnQB9r.js.map → account-C6GYxzo4.js.map} +1 -1
  19. package/build/client/assets/{button-Da1iG51o.js → button-DnQOyJAN.js} +2 -2
  20. package/build/client/assets/{button-Da1iG51o.js.map → button-DnQOyJAN.js.map} +1 -1
  21. package/build/client/assets/{client-hints-B2pbEa_9.js → client-hints-BsCjbOX0.js} +3 -3
  22. package/build/client/assets/client-hints-BsCjbOX0.js.map +1 -0
  23. package/build/client/assets/{components-BM_XUa9h.js → components-Dj3sm47B.js} +15 -15
  24. package/build/client/assets/{components-BM_XUa9h.js.map → components-Dj3sm47B.js.map} +1 -1
  25. package/build/client/assets/{diff-BQhWtDyS.js → diff-BQB9RSaR.js} +2 -2
  26. package/build/client/assets/{diff-BQhWtDyS.js.map → diff-BQB9RSaR.js.map} +1 -1
  27. package/build/client/assets/diff-SN_GIbcP.js +2 -0
  28. package/build/client/assets/{diff-BDeBUdSw.js.map → diff-SN_GIbcP.js.map} +1 -1
  29. package/build/client/assets/discord-CK7yz4w6.js +2 -0
  30. package/build/client/assets/discord-CK7yz4w6.js.map +1 -0
  31. package/build/client/assets/{discord-BMNnObT9.js → discord-CsluX01E.js} +2 -2
  32. package/build/client/assets/{discord-BMNnObT9.js.map → discord-CsluX01E.js.map} +1 -1
  33. package/build/client/assets/{entry.client-XC5tKTFs.js → entry.client-DBBrAxtJ.js} +2 -2
  34. package/build/client/assets/{entry.client-XC5tKTFs.js.map → entry.client-DBBrAxtJ.js.map} +1 -1
  35. package/build/client/assets/{epic-video-CxRPT-8l.js → epic-video-21h2ikhz.js} +2 -2
  36. package/build/client/assets/{epic-video-CxRPT-8l.js.map → epic-video-21h2ikhz.js.map} +1 -1
  37. package/build/client/assets/{error-boundary-tJSWbP6w.js → error-boundary-Bg54_knF.js} +2 -2
  38. package/build/client/assets/{error-boundary-tJSWbP6w.js.map → error-boundary-Bg54_knF.js.map} +1 -1
  39. package/build/client/assets/finished-BcwIbl76.js +2 -0
  40. package/build/client/assets/{finished-CMGRmsnb.js.map → finished-BcwIbl76.js.map} +1 -1
  41. package/build/client/assets/{index-B8G3eD8F.js → index-BL4aE6WC.js} +2 -2
  42. package/build/client/assets/{index-B8G3eD8F.js.map → index-BL4aE6WC.js.map} +1 -1
  43. package/build/client/assets/{index-BymJEf3X.js → index-BfoHqrT5.js} +2 -2
  44. package/build/client/assets/{index-BymJEf3X.js.map → index-BfoHqrT5.js.map} +1 -1
  45. package/build/client/assets/index-CsvysmWA.js +2 -0
  46. package/build/client/assets/{index-CQZ5FyEE.js.map → index-CsvysmWA.js.map} +1 -1
  47. package/build/client/assets/index-D1WEsmVZ.js +36 -0
  48. package/build/client/assets/{index-BDqSZ0-h.js.map → index-D1WEsmVZ.js.map} +1 -1
  49. package/build/client/assets/index-HBgMKyVf.js +2 -0
  50. package/build/client/assets/{index-Dc59VwXx.js.map → index-HBgMKyVf.js.map} +1 -1
  51. package/build/client/assets/{loading-DsjO-T0W.js → loading-Ba880UMD.js} +2 -2
  52. package/build/client/assets/{loading-DsjO-T0W.js.map → loading-Ba880UMD.js.map} +1 -1
  53. package/build/client/assets/login-BQY-a6kw.js +2 -0
  54. package/build/client/assets/{login-CcuvIoiW.js.map → login-BQY-a6kw.js.map} +1 -1
  55. package/build/client/assets/manifest-0d62be17.js +1 -0
  56. package/build/client/assets/mdx-wWk4dtHt.js +2 -0
  57. package/build/client/assets/{mdx-CZ_BPVoS.js.map → mdx-wWk4dtHt.js.map} +1 -1
  58. package/build/client/assets/misc-CXGQ7VS9.js +2 -0
  59. package/build/client/assets/{misc-C1rq7sPa.js.map → misc-CXGQ7VS9.js.map} +1 -1
  60. package/build/client/assets/{nav-chevrons-C-dN3WfT.js → nav-chevrons-D8c9lJW6.js} +2 -2
  61. package/build/client/assets/{nav-chevrons-C-dN3WfT.js.map → nav-chevrons-D8c9lJW6.js.map} +1 -1
  62. package/build/client/assets/onboarding-gD8f59tE.js +2 -0
  63. package/build/client/assets/{onboarding-CfXLKsN3.js.map → onboarding-gD8f59tE.js.map} +1 -1
  64. package/build/client/assets/presence-B2xpI37C.js +28 -0
  65. package/build/client/assets/presence-B2xpI37C.js.map +1 -0
  66. package/build/client/assets/{progress-mfa_5CZx.js → progress-CBZt2pmu.js} +2 -2
  67. package/build/client/assets/{progress-mfa_5CZx.js.map → progress-CBZt2pmu.js.map} +1 -1
  68. package/build/client/assets/{progress-bar-BmszwN_j.js → progress-bar-DX6yYES2.js} +2 -2
  69. package/build/client/assets/{progress-bar-BmszwN_j.js.map → progress-bar-DX6yYES2.js.map} +1 -1
  70. package/build/client/assets/request-info-BHMoxBaT.js +2 -0
  71. package/build/client/assets/request-info-BHMoxBaT.js.map +1 -0
  72. package/build/client/assets/{root-1Cc21xa6.js → root-BcFXTrBQ.js} +2 -2
  73. package/build/client/assets/{root-1Cc21xa6.js.map → root-BcFXTrBQ.js.map} +1 -1
  74. package/build/client/assets/{support--jou3sWH.js → support-QTdmLyE7.js} +2 -2
  75. package/build/client/assets/{support--jou3sWH.js.map → support-QTdmLyE7.js.map} +1 -1
  76. package/build/client/assets/{tooltip-BlVFw-is.js → tooltip-CVFWPOu0.js} +2 -2
  77. package/build/client/assets/{tooltip-BlVFw-is.js.map → tooltip-CVFWPOu0.js.map} +1 -1
  78. package/build/client/assets/{use-event-source-DPLyo0Bh.js → use-event-source-DXlRuRq2.js} +2 -2
  79. package/build/client/assets/{use-event-source-DPLyo0Bh.js.map → use-event-source-DXlRuRq2.js.map} +1 -1
  80. package/build/client/assets/{user-p2QVtDZI.js → user-DiGtbaa7.js} +2 -2
  81. package/build/client/assets/{user-p2QVtDZI.js.map → user-DiGtbaa7.js.map} +1 -1
  82. package/build/client/img/tiffany.png +0 -0
  83. package/build/server/index.js +10 -4
  84. package/build/server/index.js.map +1 -1
  85. package/package.json +3 -3
  86. package/build/client/assets/_exerciseNumber-DWZNkWZM.js +0 -2
  87. package/build/client/assets/_exerciseNumber_.finished-CpC-flTW.js +0 -2
  88. package/build/client/assets/_layout-BSoUgboG.js +0 -2
  89. package/build/client/assets/_layout-C8fK4Z98.js +0 -2
  90. package/build/client/assets/_layout-C8fK4Z98.js.map +0 -1
  91. package/build/client/assets/_layout-D1A2zp9y.js +0 -2
  92. package/build/client/assets/account-BeKnQB9r.js +0 -2
  93. package/build/client/assets/client-hints-B2pbEa_9.js.map +0 -1
  94. package/build/client/assets/diff-BDeBUdSw.js +0 -2
  95. package/build/client/assets/discord-DdAReDkL.js +0 -2
  96. package/build/client/assets/discord-DdAReDkL.js.map +0 -1
  97. package/build/client/assets/finished-CMGRmsnb.js +0 -2
  98. package/build/client/assets/index-B8k-Gd1G.js +0 -2
  99. package/build/client/assets/index-B8k-Gd1G.js.map +0 -1
  100. package/build/client/assets/index-BDqSZ0-h.js +0 -36
  101. package/build/client/assets/index-CQZ5FyEE.js +0 -2
  102. package/build/client/assets/index-Dc59VwXx.js +0 -2
  103. package/build/client/assets/login-CcuvIoiW.js +0 -2
  104. package/build/client/assets/manifest-1656ae4d.js +0 -1
  105. package/build/client/assets/mdx-CZ_BPVoS.js +0 -2
  106. package/build/client/assets/misc-C1rq7sPa.js +0 -2
  107. package/build/client/assets/onboarding-CfXLKsN3.js +0 -2
  108. package/build/client/assets/presence-BF7lWuVd.js +0 -28
  109. package/build/client/assets/presence-BF7lWuVd.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{r as P,R as ls,u as Fi,c as ki,j as tt}from"./index-BDqSZ0-h.js";import{c as Je}from"./clsx-B-dksMZM.js";import{b as Bi,e as ji,a as Oi}from"./components-BM_XUa9h.js";const us=P.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Kt=P.createContext({}),Se=P.createContext(null),Ve=typeof document<"u",Ii=Ve?P.useLayoutEffect:P.useEffect,cs=P.createContext({strict:!1}),we=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ni="framerAppearId",hs="data-"+we(Ni),Ui={skipAnimations:!1,useManualTiming:!1};class tn{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function Ki(t){let e=new tn,n=new tn,s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const h=c&&i,f=h?e:n;return u&&r.add(l),f.add(l)&&h&&i&&(s=e.order.length),l},cancel:l=>{n.remove(l),r.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[e,n]=[n,e],n.clear(),s=e.order.length,s)for(let u=0;u<s;u++){const c=e.order[u];r.has(c)&&(a.schedule(c),t()),c(l)}i=!1,o&&(o=!1,a.process(l))}};return a}const Dt=["read","resolveKeyframes","update","preRender","render","postRender"],Wi=40;function fs(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=Dt.reduce((h,f)=>(h[f]=Ki(()=>n=!0),h),{}),r=h=>{o[h].process(i)},a=()=>{const h=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(h-i.timestamp,Wi),1),i.timestamp=h,i.isProcessing=!0,Dt.forEach(r),i.isProcessing=!1,n&&e&&(s=!1,t(a))},l=()=>{n=!0,s=!0,i.isProcessing||t(a)};return{schedule:Dt.reduce((h,f)=>{const d=o[f];return h[f]=(m,p=!1,y=!1)=>(n||l(),d.schedule(m,p,y)),h},{}),cancel:h=>Dt.forEach(f=>o[f].cancel(h)),state:i,steps:o}}const{schedule:Ae,cancel:tu}=fs(queueMicrotask,!1);function Gi(t,e,n,s){const{visualElement:i}=P.useContext(Kt),o=P.useContext(cs),r=P.useContext(Se),a=P.useContext(us).reducedMotion,l=P.useRef();s=s||o.renderer,!l.current&&s&&(l.current=s(t,{visualState:e,parent:i,props:n,presenceContext:r,blockInitialAnimation:r?r.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;P.useInsertionEffect(()=>{u&&u.update(n,r)});const c=P.useRef(!!(n[hs]&&!window.HandoffComplete));return Ii(()=>{u&&(Ae.postRender(u.render),c.current&&u.animationState&&u.animationState.animateChanges())}),P.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),c.current&&(c.current=!1,window.HandoffComplete=!0))}),u}function lt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function $i(t,e,n){return P.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):lt(n)&&(n.current=s))},[e])}function Tt(t){return typeof t=="string"||Array.isArray(t)}function Wt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Ce=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],De=["initial",...Ce];function Gt(t){return Wt(t.animate)||De.some(e=>Tt(t[e]))}function ds(t){return!!(Gt(t)||t.variants)}function _i(t,e){if(Gt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Tt(n)?n:void 0,animate:Tt(s)?s:void 0}}return t.inherit!==!1?e:{}}function Hi(t){const{initial:e,animate:n}=_i(t,P.useContext(Kt));return P.useMemo(()=>({initial:e,animate:n}),[en(e),en(n)])}function en(t){return Array.isArray(t)?t.join(" "):t}const nn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Pt={};for(const t in nn)Pt[t]={isEnabled:e=>nn[t].some(n=>!!e[n])};function zi(t){for(const e in t)Pt[e]={...Pt[e],...t[e]}}const ms=P.createContext({}),ps=P.createContext({}),Yi=Symbol.for("motionComponentSymbol");function Xi({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&zi(t);function o(a,l){let u;const c={...P.useContext(us),...a,layoutId:qi(a)},{isStatic:h}=c,f=Hi(a),d=s(a,h);if(!h&&Ve){f.visualElement=Gi(i,d,c,e);const m=P.useContext(ps),p=P.useContext(cs).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,p,t,m))}return P.createElement(Kt.Provider,{value:f},u&&f.visualElement?P.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,a,$i(d,f.visualElement,l),d,h,f.visualElement))}const r=P.forwardRef(o);return r[Yi]=i,r}function qi({layoutId:t}){const e=P.useContext(ms).id;return e&&t!==void 0?e+"-"+t:t}function Zi(t){function e(s,i={}){return Xi(t(s,i))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const Qi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Me(t){return typeof t!="string"||t.includes("-")?!1:!!(Qi.indexOf(t)>-1||/[A-Z]/u.test(t))}const kt={};function Ji(t){Object.assign(kt,t)}const Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ot=new Set(Vt);function gs(t,{layout:e,layoutId:n}){return ot.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!kt[t]||t==="opacity")}const E=t=>!!(t&&t.getVelocity),tr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},er=Vt.length;function nr(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,i){let o="";for(let r=0;r<er;r++){const a=Vt[r];if(t[a]!==void 0){const l=tr[a]||a;o+=`${l}(${t[a]}) `}}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(t,s?"":o):n&&s&&(o="none"),o}const ys=t=>e=>typeof e=="string"&&e.startsWith(t),vs=ys("--"),sr=ys("var(--"),Re=t=>sr(t)?ir.test(t.split("/*")[0].trim()):!1,ir=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,rr=(t,e)=>e&&typeof t=="number"?e.transform(t):t,q=(t,e,n)=>n>e?e:n<t?t:n,dt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},gt={...dt,transform:t=>q(0,1,t)},Mt={...dt,default:1},yt=t=>Math.round(t*1e5)/1e5,Ee=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,or=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ar=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function wt(t){return typeof t=="string"}const At=t=>({test:e=>wt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),H=At("deg"),N=At("%"),T=At("px"),lr=At("vh"),ur=At("vw"),sn={...N,parse:t=>N.parse(t)/100,transform:t=>N.transform(t*100)},rn={...dt,transform:Math.round},xs={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,size:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,rotate:H,rotateX:H,rotateY:H,rotateZ:H,scale:Mt,scaleX:Mt,scaleY:Mt,scaleZ:Mt,skew:H,skewX:H,skewY:H,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:gt,originX:sn,originY:sn,originZ:T,zIndex:rn,backgroundPositionX:T,backgroundPositionY:T,fillOpacity:gt,strokeOpacity:gt,numOctaves:rn};function Le(t,e,n,s){const{style:i,vars:o,transform:r,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const h in e){const f=e[h];if(vs(h)){o[h]=f;continue}const d=xs[h],m=rr(f,d);if(ot.has(h)){if(l=!0,r[h]=m,!c)continue;f!==(d.default||0)&&(c=!1)}else h.startsWith("origin")?(u=!0,a[h]=m):i[h]=m}if(e.transform||(l||s?i.transform=nr(t.transform,n,c,s):i.transform&&(i.transform="none")),u){const{originX:h="50%",originY:f="50%",originZ:d=0}=a;i.transformOrigin=`${h} ${f} ${d}`}}const Fe=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ts(t,e,n){for(const s in e)!E(e[s])&&!gs(s,n)&&(t[s]=e[s])}function cr({transformTemplate:t},e,n){return P.useMemo(()=>{const s=Fe();return Le(s,e,{enableHardwareAcceleration:!n},t),Object.assign({},s.vars,s.style)},[e])}function hr(t,e,n){const s=t.style||{},i={};return Ts(i,s,t),Object.assign(i,cr(t,e,n)),i}function fr(t,e,n){const s={},i=hr(t,e,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=i,s}const dr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Bt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||dr.has(t)}let Ps=t=>!Bt(t);function mr(t){t&&(Ps=e=>e.startsWith("on")?!Bt(e):t(e))}try{mr(require("@emotion/is-prop-valid").default)}catch{}function pr(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Ps(i)||n===!0&&Bt(i)||!e&&!Bt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function on(t,e,n){return typeof t=="string"?t:T.transform(e+n*t)}function gr(t,e,n){const s=on(e,t.x,t.width),i=on(n,t.y,t.height);return`${s} ${i}`}const yr={offset:"stroke-dashoffset",array:"stroke-dasharray"},vr={offset:"strokeDashoffset",array:"strokeDasharray"};function xr(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?yr:vr;t[o.offset]=T.transform(-s);const r=T.transform(e),a=T.transform(n);t[o.array]=`${r} ${a}`}function ke(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},c,h,f){if(Le(t,u,c,f),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(i!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=gr(p,i!==void 0?i:.5,o!==void 0?o:.5)),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&xr(d,r,a,l,!1)}const bs=()=>({...Fe(),attrs:{}}),Be=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Tr(t,e,n,s){const i=P.useMemo(()=>{const o=bs();return ke(o,e,{enableHardwareAcceleration:!1},Be(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Ts(o,t.style,t),i.style={...o,...i.style}}return i}function Pr(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(Me(n)?Tr:fr)(s,o,r,n),u=pr(s,typeof n=="string",t),c=n!==P.Fragment?{...u,...l,ref:i}:{},{children:h}=s,f=P.useMemo(()=>E(h)?h.get():h,[h]);return P.createElement(n,{...c,children:f})}}function Ss(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}const Vs=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"]);function ws(t,e,n,s){Ss(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Vs.has(i)?i:we(i),e.attrs[i])}function je(t,e,n){var s;const{style:i}=t,o={};for(const r in i)(E(i[r])||e.style&&E(e.style[r])||gs(r,t)||((s=n==null?void 0:n.getValue(r))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(o[r]=i[r]);return o}function As(t,e,n){const s=je(t,e,n);for(const i in t)if(E(t[i])||E(e[i])){const o=Vt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}function Oe(t,e,n,s={},i={}){return typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,i)),e}function br(t){const e=P.useRef(null);return e.current===null&&(e.current=t()),e.current}const ue=t=>Array.isArray(t),Sr=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Vr=t=>ue(t)?t[t.length-1]||0:t;function Et(t){const e=E(t)?t.get():t;return Sr(e)?e.toValue():e}function wr({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,i,o){const r={latestValues:Ar(s,i,o,t),renderState:e()};return n&&(r.mount=a=>n(s,a,r)),r}const Cs=t=>(e,n)=>{const s=P.useContext(Kt),i=P.useContext(Se),o=()=>wr(t,e,s,i);return n?o():br(o)};function Ar(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Et(o[f]);let{initial:r,animate:a}=t;const l=Gt(t),u=ds(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;return h&&typeof h!="boolean"&&!Wt(h)&&(Array.isArray(h)?h:[h]).forEach(d=>{const m=Oe(t,d);if(!m)return;const{transitionEnd:p,transition:y,...v}=m;for(const x in v){let g=v[x];if(Array.isArray(g)){const b=c?g.length-1:0;g=g[b]}g!==null&&(i[x]=g)}for(const x in p)i[x]=p[x]}),i}const L=t=>t,{schedule:D,cancel:Z,state:C,steps:Xt}=fs(typeof requestAnimationFrame<"u"?requestAnimationFrame:L,!0),Cr={useVisualState:Cs({scrapeMotionValuesFromProps:As,createRenderState:bs,onMount:(t,e,{renderState:n,latestValues:s})=>{D.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),D.render(()=>{ke(n,s,{enableHardwareAcceleration:!1},Be(e.tagName),t.transformTemplate),ws(e,n)})}})},Dr={useVisualState:Cs({scrapeMotionValuesFromProps:je,createRenderState:Fe})};function Mr(t,{forwardMotionProps:e=!1},n,s){return{...Me(t)?Cr:Dr,preloadedFeatures:n,useRender:Pr(e),createVisualElement:s,Component:t}}function K(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Ds=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function $t(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const Rr=t=>e=>Ds(e)&&t(e,$t(e));function W(t,e,n,s){return K(t,e,Rr(n),s)}const Er=(t,e)=>n=>e(t(n)),G=(...t)=>t.reduce(Er);function Ms(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const an=Ms("dragHorizontal"),ln=Ms("dragVertical");function Rs(t){let e=!1;if(t==="y")e=ln();else if(t==="x")e=an();else{const n=an(),s=ln();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Es(){const t=Rs(!0);return t?(t(),!1):!0}class J{constructor(e){this.isMounted=!1,this.node=e}update(){}}function un(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End"),i=(o,r)=>{if(o.pointerType==="touch"||Es())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e),a[s]&&a[s](o,r)};return W(t.current,n,i,{passive:!t.getProps()[s]})}class Lr extends J{mount(){this.unmount=G(un(this.node,!0),un(this.node,!1))}unmount(){}}class Fr extends J{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=G(K(this.node.current,"focus",()=>this.onFocus()),K(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Ls=(t,e)=>e?t===e?!0:Ls(t,e.parentElement):!1;function qt(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,$t(n))}class kr extends J{constructor(){super(...arguments),this.removeStartListeners=L,this.removeEndListeners=L,this.removeAccessibleListeners=L,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),o=W(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:h}=this.node.getProps();!h&&!Ls(this.node.current,a.target)?c&&c(a,l):u&&u(a,l)},{passive:!(s.onTap||s.onPointerUp)}),r=W(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=G(o,r),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=o=>{if(o.key!=="Enter"||this.isPressing)return;const r=a=>{a.key!=="Enter"||!this.checkPressEnd()||qt("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&c(l,u)})};this.removeEndListeners(),this.removeEndListeners=K(this.node.current,"keyup",r),qt("down",(a,l)=>{this.startPress(a,l)})},n=K(this.node.current,"keydown",e),s=()=>{this.isPressing&&qt("cancel",(o,r)=>this.cancelPress(o,r))},i=K(this.node.current,"blur",s);this.removeAccessibleListeners=G(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:s,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&s(e,n)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Es()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&s(e,n)}mount(){const e=this.node.getProps(),n=W(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),s=K(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=G(n,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const ce=new WeakMap,Zt=new WeakMap,Br=t=>{const e=ce.get(t.target);e&&e(t)},jr=t=>{t.forEach(Br)};function Or({root:t,...e}){const n=t||document;Zt.has(n)||Zt.set(n,{});const s=Zt.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(jr,{root:t,...e})),s[i]}function Ir(t,e,n){const s=Or(e);return ce.set(t,n),s.observe(t),()=>{ce.delete(t),s.unobserve(t)}}const Nr={some:0,all:1};class Ur extends J{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Nr[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Ir(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Kr(e,n))&&this.startObserver()}unmount(){}}function Kr({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Wr={inView:{Feature:Ur},tap:{Feature:kr},focus:{Feature:Fr},hover:{Feature:Lr}};function Fs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function Gr(t){const e={};return t.values.forEach((n,s)=>e[s]=n.get()),e}function $r(t){const e={};return t.values.forEach((n,s)=>e[s]=n.getVelocity()),e}function _t(t,e,n){const s=t.getProps();return Oe(s,e,n!==void 0?n:s.custom,Gr(t),$r(t))}const Y=t=>t*1e3,$=t=>t/1e3,_r={type:"spring",stiffness:500,damping:25,restSpeed:10},Hr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),zr={type:"keyframes",duration:.8},Yr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Xr=(t,{keyframes:e})=>e.length>2?zr:ot.has(t)?t.startsWith("scale")?Hr(e[1]):_r:Yr;function qr({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function Ie(t,e){return t[e]||t.default||t}const Zr=t=>t!==null;function Ht(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Zr),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}let Lt;function Qr(){Lt=void 0}const X={now:()=>(Lt===void 0&&X.set(C.isProcessing||Ui.useManualTiming?C.timestamp:performance.now()),Lt),set:t=>{Lt=t,queueMicrotask(Qr)}},ks=t=>/^0[^.\s]+$/u.test(t);function Jr(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ks(t):!0}let Bs=L;const js=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),to=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function eo(t){const e=to.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Os(t,e,n=1){const[s,i]=eo(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return js(r)?parseFloat(r):r}return Re(i)?Os(i,e,n+1):i}const no=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),cn=t=>t===dt||t===T,hn=(t,e)=>parseFloat(t.split(", ")[e]),fn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return hn(i[1],e);{const o=s.match(/^matrix\((.+)\)$/u);return o?hn(o[1],t):0}},so=new Set(["x","y","z"]),io=Vt.filter(t=>!so.has(t));function dn(t){const e=[];return io.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ft={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:fn(4,13),y:fn(5,14)};ft.translateX=ft.x;ft.translateY=ft.y;const Is=t=>e=>e.test(t),ro={test:t=>t==="auto",parse:t=>t},Ns=[dt,T,N,H,ur,lr,ro],mn=t=>Ns.find(Is(t)),rt=new Set;let he=!1,fe=!1;function Us(){if(fe){const t=Array.from(rt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{dn(s).length&&(n.set(s,dn(s)),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render()}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}fe=!1,he=!1,rt.forEach(t=>t.complete()),rt.clear()}function Ks(){rt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(fe=!0)})}function oo(){Ks(),Us()}class Ne{constructor(e,n,s,i,o,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(rt.add(this),he||(he=!0,D.read(Ks),D.resolveKeyframes(Us))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const r=i==null?void 0:i.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),rt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,rt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ue=(t,e)=>n=>!!(wt(n)&&ar.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Ws=(t,e,n)=>s=>{if(!wt(s))return s;const[i,o,r,a]=s.match(Ee);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},ao=t=>q(0,255,t),Qt={...dt,transform:t=>Math.round(ao(t))},it={test:Ue("rgb","red"),parse:Ws("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Qt.transform(t)+", "+Qt.transform(e)+", "+Qt.transform(n)+", "+yt(gt.transform(s))+")"};function lo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const de={test:Ue("#"),parse:lo,transform:it.transform},ut={test:Ue("hsl","hue"),parse:Ws("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+N.transform(yt(e))+", "+N.transform(yt(n))+", "+yt(gt.transform(s))+")"},R={test:t=>it.test(t)||de.test(t)||ut.test(t),parse:t=>it.test(t)?it.parse(t):ut.test(t)?ut.parse(t):de.parse(t),transform:t=>wt(t)?t:t.hasOwnProperty("red")?it.transform(t):ut.transform(t)};function uo(t){var e,n;return isNaN(t)&&wt(t)&&(((e=t.match(Ee))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(or))===null||n===void 0?void 0:n.length)||0)>0}const Gs="number",$s="color",co="var",ho="var(",pn="${}",fo=/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 jt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(fo,l=>(R.test(l)?(s.color.push(o),i.push($s),n.push(R.parse(l))):l.startsWith(ho)?(s.var.push(o),i.push(co),n.push(l)):(s.number.push(o),i.push(Gs),n.push(parseFloat(l))),++o,pn)).split(pn);return{values:n,split:a,indexes:s,types:i}}function _s(t){return jt(t).values}function Hs(t){const{split:e,types:n}=jt(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===Gs?o+=yt(i[r]):a===$s?o+=R.transform(i[r]):o+=i[r]}return o}}const mo=t=>typeof t=="number"?0:t;function po(t){const e=_s(t);return Hs(t)(e.map(mo))}const Q={test:uo,parse:_s,createTransformer:Hs,getAnimatableNone:po},go=new Set(["brightness","contrast","saturate","opacity"]);function yo(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ee)||[];if(!s)return t;const i=n.replace(s,"");let o=go.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const vo=/\b([a-z-]*)\(.*?\)/gu,me={...Q,getAnimatableNone:t=>{const e=t.match(vo);return e?e.map(yo).join(" "):t}},xo={...xs,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:me,WebkitFilter:me},Ke=t=>xo[t];function zs(t,e){let n=Ke(t);return n!==me&&(n=Q),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function To(t,e,n){let s=0,i;for(;s<t.length&&!i;)typeof t[s]=="string"&&t[s]!=="none"&&t[s]!=="0"&&(i=t[s]),s++;if(i&&n)for(const o of e)t[o]=zs(n,i)}class Ys extends Ne{constructor(e,n,s,i){super(e,n,s,i,i==null?void 0:i.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){const u=e[l];if(typeof u=="string"&&Re(u)){const c=Os(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(!no.has(s)||e.length!==2)return this.resolveNoneKeyframes();const[i,o]=e,r=mn(i),a=mn(o);if(r!==a)if(cn(r)&&cn(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)Jr(e[i])&&s.push(i);s.length&&To(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ft[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n.current)return;const o=n.getValue(s);o&&o.jump(this.measuredOrigin,!1);const r=i.length-1,a=i[r];i[r]=ft[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function Po(t){let e;return()=>(e===void 0&&(e=t()),e)}const gn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Q.test(t)||t==="0")&&!t.startsWith("url("));function bo(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function So(t,e,n,s){const i=t[0];if(i===null)return!1;const o=t[t.length-1],r=gn(i,e),a=gn(o,e);return!r||!a?!1:bo(t)||n==="spring"&&s}class Xs{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,...a},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&oo(),this._resolved}onKeyframesResolved(e,n){this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:o,delay:r,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!So(e,s,i,o))if(r)this.options.duration=0;else{l==null||l(Ht(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function qs(t,e){return e?t*(1e3/e):0}const Vo=5;function Zs(t,e,n){const s=Math.max(e-Vo,0);return qs(n-t(s),e-s)}const Jt=.001,wo=.01,Ao=10,Co=.05,Do=1;function Mo({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let i,o,r=1-e;r=q(Co,Do,r),t=q(wo,Ao,$(t)),r<1?(i=u=>{const c=u*r,h=c*t,f=c-n,d=pe(u,r),m=Math.exp(-h);return Jt-f/d*m},o=u=>{const h=u*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-h),p=pe(Math.pow(u,2),r);return(-i(u)+Jt>0?-1:1)*((f-d)*m)/p}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-Jt+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Eo(i,o,a);if(t=Y(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Ro=12;function Eo(t,e,n){let s=n;for(let i=1;i<Ro;i++)s=s-t(s)/e(s);return s}function pe(t,e){return t*Math.sqrt(1-e*e)}const Lo=["duration","bounce"],Fo=["stiffness","damping","mass"];function yn(t,e){return e.some(n=>t[n]!==void 0)}function ko(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!yn(t,Fo)&&yn(t,Lo)){const n=Mo(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function Qs({keyframes:t,restDelta:e,restSpeed:n,...s}){const i=t[0],o=t[t.length-1],r={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:f}=ko({...s,velocity:-$(s.velocity||0)}),d=h||0,m=l/(2*Math.sqrt(a*u)),p=o-i,y=$(Math.sqrt(a/u)),v=Math.abs(p)<5;n||(n=v?.01:2),e||(e=v?.005:.5);let x;if(m<1){const g=pe(y,m);x=b=>{const V=Math.exp(-m*y*b);return o-V*((d+m*y*p)/g*Math.sin(g*b)+p*Math.cos(g*b))}}else if(m===1)x=g=>o-Math.exp(-y*g)*(p+(d+y*p)*g);else{const g=y*Math.sqrt(m*m-1);x=b=>{const V=Math.exp(-m*y*b),M=Math.min(g*b,300);return o-V*((d+m*y*p)*Math.sinh(M)+g*p*Math.cosh(M))/g}}return{calculatedDuration:f&&c||null,next:g=>{const b=x(g);if(f)r.done=g>=c;else{let V=d;g!==0&&(m<1?V=Zs(x,g,b):V=0);const M=Math.abs(V)<=n,_=Math.abs(o-b)<=e;r.done=M&&_}return r.value=r.done?o:b,r}}}function vn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=S=>a!==void 0&&S<a||l!==void 0&&S>l,m=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l;let p=n*e;const y=h+p,v=r===void 0?y:r(y);v!==y&&(p=v-h);const x=S=>-p*Math.exp(-S/s),g=S=>v+x(S),b=S=>{const B=x(S),j=g(S);f.done=Math.abs(B)<=u,f.value=f.done?v:j};let V,M;const _=S=>{d(f.value)&&(V=S,M=Qs({keyframes:[f.value,m(f.value)],velocity:Zs(g,S,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:S=>{let B=!1;return!M&&V===void 0&&(B=!0,b(S),_(S)),V!==void 0&&S>=V?M.next(S-V):(!B&&b(S),f)}}}const Js=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Bo=1e-7,jo=12;function Oo(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Js(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Bo&&++a<jo);return r}function Ct(t,e,n,s){if(t===e&&n===s)return L;const i=o=>Oo(o,0,1,t,n);return o=>o===0||o===1?o:Js(i(o),e,s)}const Io=Ct(.42,0,1,1),No=Ct(0,0,.58,1),ti=Ct(.42,0,.58,1),Uo=t=>Array.isArray(t)&&typeof t[0]!="number",ei=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ni=t=>e=>1-t(1-e),We=t=>1-Math.sin(Math.acos(t)),si=ni(We),Ko=ei(We),ii=Ct(.33,1.53,.69,.99),Ge=ni(ii),Wo=ei(Ge),Go=t=>(t*=2)<1?.5*Ge(t):.5*(2-Math.pow(2,-10*(t-1))),$o={linear:L,easeIn:Io,easeInOut:ti,easeOut:No,circIn:We,circInOut:Ko,circOut:si,backIn:Ge,backInOut:Wo,backOut:ii,anticipate:Go},xn=t=>{if(Array.isArray(t)){Bs(t.length===4);const[e,n,s,i]=t;return Ct(e,n,s,i)}else if(typeof t=="string")return $o[t];return t},bt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},w=(t,e,n)=>t+(e-t)*n;function te(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function _o({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=te(l,a,t+1/3),o=te(l,a,t),r=te(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}const ee=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ho=[de,it,ut],zo=t=>Ho.find(e=>e.test(t));function Tn(t){const e=zo(t);let n=e.parse(t);return e===ut&&(n=_o(n)),n}const Pn=(t,e)=>{const n=Tn(t),s=Tn(e),i={...n};return o=>(i.red=ee(n.red,s.red,o),i.green=ee(n.green,s.green,o),i.blue=ee(n.blue,s.blue,o),i.alpha=w(n.alpha,s.alpha,o),it.transform(i))};function ge(t,e){return n=>n>0?e:t}function Yo(t,e){return n=>w(t,e,n)}function $e(t){return typeof t=="number"?Yo:typeof t=="string"?Re(t)?ge:R.test(t)?Pn:Zo:Array.isArray(t)?ri:typeof t=="object"?R.test(t)?Pn:Xo:ge}function ri(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>$e(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function Xo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=$e(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function qo(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][i[r]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[o]=l,i[r]++}return s}const Zo=(t,e)=>{const n=Q.createTransformer(e),s=jt(t),i=jt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?G(ri(qo(s,i),i.values),n):ge(t,e)};function oi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?w(t,e,n):$e(t)(t,e)}function Qo(t,e,n){const s=[],i=n||oi,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||L:e;a=G(l,a)}s.push(a)}return s}function Jo(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Bs(o===e.length),o===1)return()=>e[0];if(o===2&&t[0]===t[1])return()=>e[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Qo(e,s,i),a=r.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const h=bt(t[c],t[c+1],u);return r[c](h)};return n?u=>l(q(t[0],t[o-1],u)):l}function ta(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=bt(0,e,s);t.push(w(n,1,i))}}function ea(t){const e=[0];return ta(e,t.length-1),e}function na(t,e){return t.map(n=>n*e)}function sa(t,e){return t.map(()=>e||ti).splice(0,t.length-1)}function Ot({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Uo(s)?s.map(xn):xn(s),o={done:!1,value:e[0]},r=na(n&&n.length===e.length?n:ea(e),t),a=Jo(r,e,{ease:Array.isArray(i)?i:sa(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const bn=2e4;function ia(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<bn;)e+=n,s=t.next(e);return e>=bn?1/0:e}const ra=t=>{const e=({timestamp:n})=>t(n);return{start:()=>D.update(e,!0),stop:()=>Z(e),now:()=>C.isProcessing?C.timestamp:X.now()}},oa={decay:vn,inertia:vn,tween:Ot,keyframes:Ot,spring:Qs},aa=t=>t/100;class _e extends Xs{constructor({KeyframeResolver:e=Ne,...n}){super(n),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle";const{name:s,motionValue:i,keyframes:o}=this.options,r=(a,l)=>this.onKeyframesResolved(a,l);s&&i&&i.owner?this.resolver=i.owner.resolveKeyframes(o,r,s,i):this.resolver=new e(o,r,s,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=this.options,a=oa[n]||Ot;let l,u;a!==Ot&&typeof e[0]!="number"&&(l=G(aa,oi(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});o==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-r})),c.calculatedDuration===null&&(c.calculatedDuration=ia(c));const{calculatedDuration:h}=c,f=h+i,d=f*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:f,totalDuration:d}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return o.next(0);const{delay:f,repeat:d,repeatType:m,repeatDelay:p,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-f*(this.speed>=0?1:-1),x=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let g=this.currentTime,b=o;if(d){const S=Math.min(this.currentTime,c)/h;let B=Math.floor(S),j=S%1;!j&&S>=1&&(j=1),j===1&&B--,B=Math.min(B,d+1),!!(B%2)&&(m==="reverse"?(j=1-j,p&&(j-=p/h)):m==="mirror"&&(b=r)),g=q(0,1,j)*h}const V=x?{done:!1,value:l[0]}:b.next(g);a&&(V.value=a(V.value));let{done:M}=V;!x&&u!==null&&(M=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return _&&i!==void 0&&(V.value=Ht(l,this.options,i)),y&&y(V.value),_&&this.finish(),V}get duration(){const{resolved:e}=this;return e?$(e.calculatedDuration):0}get time(){return $(this.currentTime)}set time(e){e=Y(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=$(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=ra,onPlay:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=s),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:e}=this.options;e&&e()}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ai=t=>Array.isArray(t)&&typeof t[0]=="number";function li(t){return!!(!t||typeof t=="string"&&ui[t]||ai(t)||Array.isArray(t)&&t.every(li))}const pt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,ui={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pt([0,.65,.55,1]),circOut:pt([.55,0,1,.45]),backIn:pt([.31,.01,.66,-.59]),backOut:pt([.33,1.53,.69,.99])};function ci(t){if(t)return ai(t)?pt(t):Array.isArray(t)?t.map(ci):ui[t]}function la(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=ci(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"})}const ua=Po(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ca=new Set(["opacity","clipPath","filter","transform"]),It=10,ha=2e4;function fa(t){return t.type==="spring"||t.name==="backgroundColor"||!li(t.ease)}function da(t,e){const n=new _e({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&o<ha;)s=n.sample(o),i.push(s.value),o+=It;return{times:void 0,keyframes:i,duration:o-It,ease:"linear"}}class Sn extends Xs{constructor(e){super(e);const{name:n,motionValue:s,keyframes:i}=this.options;this.resolver=new Ys(i,(o,r)=>this.onKeyframesResolved(o,r),n,s),this.resolver.scheduleResolve()}initPlayback(e,n){var s;let{duration:i=300,times:o,ease:r,type:a,motionValue:l,name:u}=this.options;if(!(!((s=l.owner)===null||s===void 0)&&s.current))return!1;if(fa(this.options)){const{onComplete:h,onUpdate:f,motionValue:d,...m}=this.options,p=da(e,m);e=p.keyframes,e.length===1&&(e[1]=e[0]),i=p.duration,o=p.times,r=p.ease,a="keyframes"}const c=la(l.owner.current,u,e,{...this.options,duration:i,times:o,ease:r});return c.startTime=X.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:h}=this.options;l.set(Ht(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:i,times:o,type:a,ease:r,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return $(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return $(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=Y(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return L;const{animation:s}=n;s.timeline=e,s.onfinish=null}return L}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:o,ease:r,times:a}=e;if(!(n.playState==="idle"||n.playState==="finished")){if(this.time){const{motionValue:l,onUpdate:u,onComplete:c,...h}=this.options,f=new _e({...h,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),d=Y(this.time);l.setWithVelocity(f.sample(d-It).value,f.sample(d).value,It)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:o,damping:r,type:a}=e;return ua()&&s&&ca.has(s)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}const He=(t,e,n,s={},i,o)=>r=>{const a=Ie(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-Y(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};qr(a)||(c={...c,...Xr(t,c)}),c.duration&&(c.duration=Y(c.duration)),c.repeatDelay&&(c.repeatDelay=Y(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(h=!0)),h&&!o&&e.get()!==void 0){const f=Ht(c.keyframes,a);if(f!==void 0){D.update(()=>{c.onUpdate(f),c.onComplete()});return}}return!o&&Sn.supports(c)?new Sn(c):new _e(c)};function Nt(t){return!!(E(t)&&t.add)}function ze(t,e){t.indexOf(e)===-1&&t.push(e)}function Ye(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Xe{constructor(){this.subscriptions=[]}add(e){return ze(this.subscriptions,e),()=>Ye(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Vn=30,ma=t=>!isNaN(parseFloat(t));class pa{constructor(e,n={}){this.version="11.0.28",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=X.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.canTrackVelocity=ma(this.current),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=X.now()}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Xe);const s=this.events[e].add(n);return e==="change"?()=>{s(),D.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=X.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Vn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Vn);return qs(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function St(t,e){return new pa(t,e)}function ga(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,St(n))}function ya(t,e){const n=_t(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Vr(o[r]);ga(t,r,a)}}function va({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function hi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;const u=t.getValue("willChange");s&&(r=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in l){const d=t.getValue(f,(o=t.latestValues[f])!==null&&o!==void 0?o:null),m=l[f];if(m===void 0||h&&va(h,f))continue;const p={delay:n,elapsed:0,...Ie(r||{},f)};let y=!1;if(window.HandoffAppearAnimations){const x=t.getProps()[hs];if(x){const g=window.HandoffAppearAnimations(x,f);g!==null&&(p.elapsed=g,y=!0)}}d.start(He(f,d,m,t.shouldReduceMotion&&ot.has(f)?{type:!1}:p,t,y));const v=d.animation;v&&(Nt(u)&&(u.add(f),v.then(()=>u.remove(f))),c.push(v))}return a&&Promise.all(c).then(()=>{D.update(()=>{a&&ya(t,a)})}),c}function ye(t,e,n={}){var s;const i=_t(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const r=i?()=>Promise.all(hi(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=o;return xa(t,e,c+u,h,f,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,c]=l==="beforeChildren"?[r,a]:[a,r];return u().then(()=>c())}else return Promise.all([r(),a(n.delay)])}function xa(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(Ta).forEach((u,c)=>{u.notify("AnimationStart",e),r.push(ye(u,e,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(r)}function Ta(t,e){return t.sortNodePosition(e)}function Pa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>ye(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=ye(t,e,n);else{const i=typeof e=="function"?_t(t,e,n.custom):e;s=Promise.all(hi(t,i,n))}return s.then(()=>{D.postRender(()=>{t.notify("AnimationComplete",e)})})}const ba=[...Ce].reverse(),Sa=Ce.length;function Va(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Pa(t,n,s)))}function wa(t){let e=Va(t);const n=Ca();let s=!0;const i=l=>(u,c)=>{var h;const f=_t(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(f){const{transition:d,transitionEnd:m,...p}=f;u={...u,...p,...m}}return u};function o(l){e=l(t)}function r(l){const u=t.getProps(),c=t.getVariantContext(!0)||{},h=[],f=new Set;let d={},m=1/0;for(let y=0;y<Sa;y++){const v=ba[y],x=n[v],g=u[v]!==void 0?u[v]:c[v],b=Tt(g),V=v===l?x.isActive:null;V===!1&&(m=y);let M=g===c[v]&&g!==u[v]&&b;if(M&&s&&t.manuallyAnimateOnMount&&(M=!1),x.protectedKeys={...d},!x.isActive&&V===null||!g&&!x.prevProp||Wt(g)||typeof g=="boolean")continue;let S=Aa(x.prevProp,g)||v===l&&x.isActive&&!M&&b||y>m&&b,B=!1;const j=Array.isArray(g)?g:[g];let at=j.reduce(i(v),{});V===!1&&(at={});const{prevResolvedValues:Ze={}}=x,Li={...Ze,...at},Qe=F=>{S=!0,f.has(F)&&(B=!0,f.delete(F)),x.needsAnimating[F]=!0;const U=t.getValue(F);U&&(U.liveStyle=!1)};for(const F in Li){const U=at[F],zt=Ze[F];if(d.hasOwnProperty(F))continue;let Yt=!1;ue(U)&&ue(zt)?Yt=!Fs(U,zt):Yt=U!==zt,Yt?U!=null?Qe(F):f.add(F):U!==void 0&&f.has(F)?Qe(F):x.protectedKeys[F]=!0}x.prevProp=g,x.prevResolvedValues=at,x.isActive&&(d={...d,...at}),s&&t.blockInitialAnimation&&(S=!1),S&&(!M||B)&&h.push(...j.map(F=>({animation:F,options:{type:v}})))}if(f.size){const y={};f.forEach(v=>{const x=t.getBaseTarget(v),g=t.getValue(v);g&&(g.liveStyle=!0),y[v]=x===void 0?null:x}),h.push({animation:y})}let p=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(h):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var d;return(d=f.animationState)===null||d===void 0?void 0:d.setActive(l,u)}),n[l].isActive=u;const h=r(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n}}function Aa(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Fs(e,t):!1}function et(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ca(){return{animate:et(!0),whileInView:et(),whileHover:et(),whileTap:et(),whileDrag:et(),whileFocus:et(),exit:et()}}class Da extends J{constructor(e){super(e),e.animationState||(e.animationState=wa(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Wt(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let Ma=0;class Ra extends J{constructor(){super(...arguments),this.id=Ma++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Ea={animation:{Feature:Da},exit:{Feature:Ra}},wn=(t,e)=>Math.abs(t-e);function La(t,e){const n=wn(t.x,e.x),s=wn(t.y,e.y);return Math.sqrt(n**2+s**2)}class fi{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=se(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=La(h.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:m}=h,{timestamp:p}=C;this.history.push({...m,timestamp:p});const{onStart:y,onMove:v}=this.handlers;f||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=ne(f,this.transformPagePoint),D.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:d,onSessionEnd:m,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=se(h.type==="pointercancel"?this.lastMoveEventInfo:ne(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(h,y),m&&m(h,y)},!Ds(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=$t(e),a=ne(r,this.transformPagePoint),{point:l}=a,{timestamp:u}=C;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,se(a,this.history)),this.removeListeners=G(W(this.contextWindow,"pointermove",this.handlePointerMove),W(this.contextWindow,"pointerup",this.handlePointerUp),W(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Z(this.updatePoint)}}function ne(t,e){return e?{point:e(t.point)}:t}function An(t,e){return{x:t.x-e.x,y:t.y-e.y}}function se({point:t},e){return{point:t,delta:An(t,di(e)),offset:An(t,Fa(e)),velocity:ka(e,.1)}}function Fa(t){return t[0]}function di(t){return t[t.length-1]}function ka(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=di(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>Y(e)));)n--;if(!s)return{x:0,y:0};const o=$(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function k(t){return t.max-t.min}function ve(t,e=0,n=.01){return Math.abs(t-e)<=n}function Cn(t,e,n,s=.5){t.origin=s,t.originPoint=w(e.min,e.max,t.origin),t.scale=k(n)/k(e),(ve(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=w(n.min,n.max,t.origin)-t.originPoint,(ve(t.translate)||isNaN(t.translate))&&(t.translate=0)}function vt(t,e,n,s){Cn(t.x,e.x,n.x,s?s.originX:void 0),Cn(t.y,e.y,n.y,s?s.originY:void 0)}function Dn(t,e,n){t.min=n.min+e.min,t.max=t.min+k(e)}function Ba(t,e,n){Dn(t.x,e.x,n.x),Dn(t.y,e.y,n.y)}function Mn(t,e,n){t.min=e.min-n.min,t.max=t.min+k(e)}function xt(t,e,n){Mn(t.x,e.x,n.x),Mn(t.y,e.y,n.y)}function ja(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?w(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?w(n,t,s.max):Math.min(t,n)),t}function Rn(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Oa(t,{top:e,left:n,bottom:s,right:i}){return{x:Rn(t.x,n,i),y:Rn(t.y,e,s)}}function En(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Ia(t,e){return{x:En(t.x,e.x),y:En(t.y,e.y)}}function Na(t,e){let n=.5;const s=k(t),i=k(e);return i>s?n=bt(e.min,e.max-s,t.min):s>i&&(n=bt(t.min,t.max-i,e.min)),q(0,1,n)}function Ua(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const xe=.35;function Ka(t=xe){return t===!1?t=0:t===!0&&(t=xe),{x:Ln(t,"left","right"),y:Ln(t,"top","bottom")}}function Ln(t,e,n){return{min:Fn(t,e),max:Fn(t,n)}}function Fn(t,e){return typeof t=="number"?t:t[e]||0}const kn=()=>({translate:0,scale:1,origin:0,originPoint:0}),ct=()=>({x:kn(),y:kn()}),Bn=()=>({min:0,max:0}),A=()=>({x:Bn(),y:Bn()});function I(t){return[t("x"),t("y")]}function mi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Wa({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ga(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ie(t){return t===void 0||t===1}function Te({scale:t,scaleX:e,scaleY:n}){return!ie(t)||!ie(e)||!ie(n)}function nt(t){return Te(t)||pi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function pi(t){return jn(t.x)||jn(t.y)}function jn(t){return t&&t!=="0%"}function Ut(t,e,n){const s=t-n,i=e*s;return n+i}function On(t,e,n,s,i){return i!==void 0&&(t=Ut(t,i,s)),Ut(t,n,s)+e}function Pe(t,e=0,n=1,s,i){t.min=On(t.min,e,n,s,i),t.max=On(t.max,e,n,s,i)}function gi(t,{x:e,y:n}){Pe(t.x,e.translate,e.scale,e.originPoint),Pe(t.y,n.translate,n.scale,n.originPoint)}function $a(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const l=o.instance;l&&l.style&&l.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&ht(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,gi(t,r)),s&&nt(o.latestValues)&&ht(t,o.latestValues))}e.x=In(e.x),e.y=In(e.y)}function In(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function z(t,e){t.min=t.min+e,t.max=t.max+e}function Nn(t,e,[n,s,i]){const o=e[i]!==void 0?e[i]:.5,r=w(t.min,t.max,o);Pe(t,e[n],e[s],r,e.scale)}const _a=["x","scaleX","originX"],Ha=["y","scaleY","originY"];function ht(t,e){Nn(t.x,e,_a),Nn(t.y,e,Ha)}function yi(t,e){return mi(Ga(t.getBoundingClientRect(),e))}function za(t,e,n){const s=yi(t,n),{scroll:i}=e;return i&&(z(s.x,i.offset.x),z(s.y,i.offset.y)),s}const vi=({current:t})=>t?t.ownerDocument.defaultView:null,Ya=new WeakMap;class Xa{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=A(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor($t(c,"page").point)},o=(c,h)=>{const{drag:f,dragPropagation:d,onDragStart:m}=this.getProps();if(f&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Rs(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),I(y=>{let v=this.getAxisMotionValue(y).get()||0;if(N.test(v)){const{projection:x}=this.visualElement;if(x&&x.layout){const g=x.layout.layoutBox[y];g&&(v=k(g)*(parseFloat(v)/100))}}this.originPoint[y]=v}),m&&m(c,h);const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},r=(c,h)=>{const{dragPropagation:f,dragDirectionLock:d,onDirectionLock:m,onDrag:p}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:y}=h;if(d&&this.currentDirection===null){this.currentDirection=qa(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),p&&p(c,h)},a=(c,h)=>this.stop(c,h),l=()=>I(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new fi(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:vi(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&o(e,n)}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Rt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=ja(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,o=this.constraints;n&&lt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Oa(i.layoutBox,n):this.constraints=!1,this.elastic=Ka(s),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&I(r=>{this.getAxisMotionValue(r)&&(this.constraints[r]=Ua(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!lt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=za(s,i.root,this.visualElement.getTransformPagePoint());let r=Ia(i.layout.layoutBox,o);if(n){const a=n(Wa(r));this.hasMutatedConstraints=!!a,a&&(r=mi(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=I(c=>{if(!Rt(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return s.start(He(e,s,0,n,this.visualElement))}stopAnimation(){I(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){I(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n="_drag"+e.toUpperCase(),s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){I(n=>{const{drag:s}=this.getProps();if(!Rt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-w(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!lt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};I(r=>{const a=this.getAxisMotionValue(r);if(a){const l=a.get();i[r]=Na({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),I(r=>{if(!Rt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(w(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;Ya.set(this.visualElement,this);const e=this.visualElement.current,n=W(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();lt(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),s();const r=K(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(I(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=xe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Rt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function qa(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Za extends J{constructor(e){super(e),this.removeGroupControls=L,this.removeListeners=L,this.controls=new Xa(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}unmount(){this.removeGroupControls(),this.removeListeners()}}const Un=t=>(e,n)=>{t&&t(e,n)};class Qa extends J{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(e){this.session=new fi(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vi(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Un(e),onStart:Un(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&i(o,r)}}}mount(){this.removePointerDownListener=W(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Ja(){const t=P.useContext(Se);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=P.useId();return P.useEffect(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}const Ft={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Kn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const mt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Kn(t,e.target.x),s=Kn(t,e.target.y);return`${n}% ${s}%`}},tl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Q.parse(t);if(i.length>5)return s;const o=Q.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=w(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}};class el extends ls.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;Ji(nl),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Ft.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,r=s.projection;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||D.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ae.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function xi(t){const[e,n]=Ja(),s=P.useContext(ms);return ls.createElement(el,{...t,layoutGroup:s,switchLayoutGroup:P.useContext(ps),isPresent:e,safeToRemove:n})}const nl={borderRadius:{...mt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomLeftRadius:mt,borderBottomRightRadius:mt,boxShadow:tl},Ti=["TopLeft","TopRight","BottomLeft","BottomRight"],sl=Ti.length,Wn=t=>typeof t=="string"?parseFloat(t):t,Gn=t=>typeof t=="number"||T.test(t);function il(t,e,n,s,i,o){i?(t.opacity=w(0,n.opacity!==void 0?n.opacity:1,rl(s)),t.opacityExit=w(e.opacity!==void 0?e.opacity:1,0,ol(s))):o&&(t.opacity=w(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;r<sl;r++){const a=`border${Ti[r]}Radius`;let l=$n(e,a),u=$n(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Gn(l)===Gn(u)?(t[a]=Math.max(w(Wn(l),Wn(u),s),0),(N.test(u)||N.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=w(e.rotate||0,n.rotate||0,s))}function $n(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const rl=Pi(0,.5,si),ol=Pi(.5,.95,L);function Pi(t,e,n){return s=>s<t?0:s>e?1:n(bt(t,e,s))}function _n(t,e){t.min=e.min,t.max=e.max}function O(t,e){_n(t.x,e.x),_n(t.y,e.y)}function Hn(t,e,n,s,i){return t-=e,t=Ut(t,1/n,s),i!==void 0&&(t=Ut(t,1/i,s)),t}function al(t,e=0,n=1,s=.5,i,o=t,r=t){if(N.test(e)&&(e=parseFloat(e),e=w(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=w(o.min,o.max,s);t===o&&(a-=e),t.min=Hn(t.min,e,n,a,i),t.max=Hn(t.max,e,n,a,i)}function zn(t,e,[n,s,i],o,r){al(t,e[n],e[s],e[i],e.scale,o,r)}const ll=["x","scaleX","originX"],ul=["y","scaleY","originY"];function Yn(t,e,n,s){zn(t.x,e,ll,n?n.x:void 0,s?s.x:void 0),zn(t.y,e,ul,n?n.y:void 0,s?s.y:void 0)}function Xn(t){return t.translate===0&&t.scale===1}function bi(t){return Xn(t.x)&&Xn(t.y)}function cl(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Si(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function qn(t){return k(t.x)/k(t.y)}class hl{constructor(){this.members=[]}add(e){ze(this.members,e),e.scheduleRender()}remove(e){if(Ye(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zn(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const fl=(t,e)=>t.depth-e.depth;class dl{constructor(){this.children=[],this.isDirty=!1}add(e){ze(this.children,e),this.isDirty=!0}remove(e){Ye(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fl),this.isDirty=!1,this.children.forEach(e)}}function ml(t,e){const n=X.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(Z(s),t(o-e))};return D.read(s,!0),()=>Z(s)}function pl(t){window.MotionDebug&&window.MotionDebug.record(t)}function gl(t){return t instanceof SVGElement&&t.tagName!=="svg"}function yl(t,e,n){const s=E(t)?t:St(t);return s.start(He("",s,e,n)),s.animation}const re=["","X","Y","Z"],vl={visibility:"hidden"},Qn=1e3;let xl=0;const st={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function oe(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Vi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=xl++,this.animationId=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.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,st.totalNodes=st.resolvedTargetDeltas=st.recalculatedProjection=0,this.nodes.forEach(bl),this.nodes.forEach(Cl),this.nodes.forEach(Dl),this.nodes.forEach(Sl),pl(st)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,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 dl)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new Xe),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=gl(r),this.instance=r;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=ml(f,250),Ft.hasAnimatedSinceResize&&(Ft.hasAnimatedSinceResize=!1,this.nodes.forEach(ts))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeTargetChanged:d,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Fl,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=c.getProps(),x=!this.targetLayout||!Si(this.targetLayout,m)||d,g=!f&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,g);const b={...Ie(p,"layout"),onPlay:y,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||ts(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Z(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(Ml),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Jn);return}this.isUpdating||this.nodes.forEach(wl),this.isUpdating=!1,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes.forEach(Al),this.nodes.forEach(Tl),this.nodes.forEach(Pl),this.clearAllSnapshots();const a=X.now();C.delta=q(0,1e3/60,a-C.timestamp),C.timestamp=a,C.isProcessing=!0,Xt.update.process(C),Xt.preRender.process(C),Xt.render.process(C),C.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ae.read(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(Vl),this.sharedNodes.forEach(Rl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,D.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){D.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}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 r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=A(),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,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:r,isRoot:s(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform,a=this.projectionDelta&&!bi(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&(a||nt(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),kl(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return A();const a=r.measureViewportBox(),{scroll:l}=this.root;return l&&(z(a.x,l.offset.x),z(a.y,l.offset.y)),a}removeElementScroll(r){const a=A();O(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:h}=u;if(u!==this.root&&c&&h.layoutScroll){if(c.isRoot){O(a,r);const{scroll:f}=this.root;f&&(z(a.x,-f.offset.x),z(a.y,-f.offset.y))}z(a.x,c.offset.x),z(a.y,c.offset.y)}}return a}applyTransform(r,a=!1){const l=A();O(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ht(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),nt(c.latestValues)&&ht(l,c.latestValues)}return nt(this.latestValues)&&ht(l,this.latestValues),l}removeTransform(r){const a=A();O(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!nt(u.latestValues))continue;Te(u.latestValues)&&u.updateSnapshot();const c=A(),h=u.measurePageBox();O(c,h),Yn(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return nt(this.latestValues)&&Yn(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.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!==C.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(r||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:h,layoutId:f}=this.options;if(!(!this.layout||!(h||f))){if(this.resolvedRelativeTargetAt=C.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=A(),this.relativeTargetOrigin=A(),xt(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),O(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=A(),this.targetWithTransforms=A()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ba(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):O(this.target,this.layout.layoutBox),gi(this.target,this.targetDelta)):O(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=A(),this.relativeTargetOrigin=A(),xt(this.relativeTargetOrigin,this.target,d.target),O(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}st.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Te(this.parent.latestValues)||pi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var r;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((r=this.parent)===null||r===void 0)&&r.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===C.timestamp&&(u=!1),u)return;const{layout:c,layoutId:h}=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||h))return;O(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;$a(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=A());const{target:m}=a;if(!m){this.projectionTransform&&(this.projectionDelta=ct(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=ct(),this.projectionDeltaWithTransform=ct());const p=this.projectionTransform;vt(this.projectionDelta,this.layoutCorrected,m,this.latestValues),this.projectionTransform=Zn(this.projectionDelta,this.treeScale),(this.projectionTransform!==p||this.treeScale.x!==f||this.treeScale.y!==d)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),st.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=ct();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=A(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=d!==m,y=this.getStack(),v=!y||y.members.length<=1,x=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(Ll));this.animationProgress=0;let g;this.mixTargetDelta=b=>{const V=b/1e3;es(h.x,r.x,V),es(h.y,r.y,V),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),El(this.relativeTarget,this.relativeTargetOrigin,f,V),g&&cl(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=A()),O(g,this.relativeTarget)),p&&(this.animationValues=c,il(c,u,this.latestValues,V,x,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Z(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=D.update(()=>{Ft.hasAnimatedSinceResize=!0,this.currentAnimation=yl(0,Qn,{...r,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onComplete:()=>{r.onComplete&&r.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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Qn),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&wi(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||A();const h=k(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=k(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}O(a,l),ht(a,c),vt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new hl),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&oe("z",r,u,this.animationValues);for(let c=0;c<re.length;c++)oe(`rotate${re[c]}`,r,u,this.animationValues),oe(`skew${re[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}getProjectionStyles(r){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return vl;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Et(r==null?void 0:r.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Et(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!nt(this.latestValues)&&(p.transform=c?c({},""):"none",this.hasProjected=!1),p}const f=h.animationValues||h.latestValues;this.applyTransformsToTarget(),u.transform=Zn(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:d,y:m}=this.projectionDelta;u.transformOrigin=`${d.origin*100}% ${m.origin*100}% 0`,h.animationValues?u.opacity=h===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=h===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const p in kt){if(f[p]===void 0)continue;const{correct:y,applyTo:v}=kt[p],x=u.transform==="none"?f[p]:y(f[p],h);if(v){const g=v.length;for(let b=0;b<g;b++)u[v[b]]=x}else u[p]=x}return this.options.layoutId&&(u.pointerEvents=h===this?Et(r==null?void 0:r.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Jn),this.root.sharedNodes.clear()}}}function Tl(t){t.updateLayout()}function Pl(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=n.source!==t.layout.source;o==="size"?I(h=>{const f=r?n.measuredBox[h]:n.layoutBox[h],d=k(f);f.min=s[h].min,f.max=f.min+d}):wi(o,n.layoutBox,s)&&I(h=>{const f=r?n.measuredBox[h]:n.layoutBox[h],d=k(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=ct();vt(a,s,n.layoutBox);const l=ct();r?vt(l,t.applyTransform(i,!0),n.measuredBox):vt(l,s,n.layoutBox);const u=!bi(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=A();xt(m,n.layoutBox,f.layoutBox);const p=A();xt(p,s,d.layoutBox),Si(m,p)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function bl(t){st.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Sl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Vl(t){t.clearSnapshot()}function Jn(t){t.clearMeasurements()}function wl(t){t.isLayoutDirty=!1}function Al(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ts(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Cl(t){t.resolveTargetDelta()}function Dl(t){t.calcProjection()}function Ml(t){t.resetSkewAndRotation()}function Rl(t){t.removeLeadSnapshot()}function es(t,e,n){t.translate=w(e.translate,0,n),t.scale=w(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ns(t,e,n,s){t.min=w(e.min,n.min,s),t.max=w(e.max,n.max,s)}function El(t,e,n,s){ns(t.x,e.x,n.x,s),ns(t.y,e.y,n.y,s)}function Ll(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Fl={duration:.45,ease:[.4,0,.1,1]},ss=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),is=ss("applewebkit/")&&!ss("chrome/")?Math.round:L;function rs(t){t.min=is(t.min),t.max=is(t.max)}function kl(t){rs(t.x),rs(t.y)}function wi(t,e,n){return t==="position"||t==="preserve-aspect"&&!ve(qn(e),qn(n),.2)}const Bl=Vi({attachResizeListener:(t,e)=>K(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ae={current:void 0},Ai=Vi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ae.current){const t=new Bl({});t.mount(window),t.setOptions({layoutScroll:!0}),ae.current=t}return ae.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),jl={pan:{Feature:Qa},drag:{Feature:Za,ProjectionNode:Ai,MeasureLayout:xi}},be={current:null},Ci={current:!1};function Ol(){if(Ci.current=!0,!!Ve)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>be.current=t.matches;t.addListener(e),e()}else be.current=!1}function Il(t,e,n){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(E(o))t.addValue(i,o),Nt(s)&&s.add(i);else if(E(r))t.addValue(i,St(o,{owner:t})),Nt(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const a=t.getValue(i);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=t.getStaticValue(i);t.addValue(i,St(a!==void 0?a:o,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const os=new WeakMap,Nl=[...Ns,R,Q],Ul=t=>Nl.find(Is(t)),Di=Object.keys(Pt),Kl=Di.length,as=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Wl=De.length;function Mi(t){if(t)return t.options.allowProjection!==!1?t.projection:Mi(t.parent)}class Gl{constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.resolveKeyframes=(f,d,m,p)=>new this.KeyframeResolver(f,d,m,p,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ne,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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.scheduleRender=()=>D.render(this.render,!1,!0);const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Gt(n),this.isVariantNode=ds(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&E(d)&&(d.set(l[f],!1),Nt(c)&&c.add(f))}}scrapeMotionValuesFromProps(e,n,s){return{}}mount(e){this.current=e,os.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Ci.current||Ol(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:be.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){os.delete(this.current),this.projection&&this.projection.unmount(),Z(this.notifyUpdate),Z(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,n){const s=ot.has(e),i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&D.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...n},s,i,o){let r,a;for(let l=0;l<Kl;l++){const u=Di[l],{isEnabled:c,Feature:h,ProjectionNode:f,MeasureLayout:d}=Pt[u];f&&(r=f),c(n)&&(!this.features[u]&&h&&(this.features[u]=new h(this)),d&&(a=d))}if((this.type==="html"||this.type==="svg")&&!this.projection&&r){this.projection=new r(this.latestValues,Mi(this.parent));const{layoutId:l,layout:u,drag:c,dragConstraints:h,layoutScroll:f,layoutRoot:d}=n;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!c||h&&lt(h),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:d})}return a}updateFeatures(){for(const e in this.features){const n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):A()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<as.length;s++){const i=as[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o=e["on"+i];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Il(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const s=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(s.initial=this.props.initial),s}const n={};for(let s=0;s<Wl;s++){const i=De[s],o=this.props[i];(Tt(o)||o===!1)&&(n[i]=o)}return n}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){n!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,n)),this.values.set(e,n),this.latestValues[e]=n.get()}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=St(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(js(i)||ks(i))?i=parseFloat(i):!Ul(i)&&Q.test(n)&&(i=zs(e,n)),this.setBaseTarget(e,E(i)?i.get():i)),E(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n,s;const{initial:i}=this.props,o=typeof i=="string"||typeof i=="object"?(s=Oe(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom))===null||s===void 0?void 0:s[e]:void 0;if(i&&o!==void 0)return o;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!E(r)?r:this.initialValues[e]!==void 0&&o===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Xe),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Ri extends Gl{constructor(){super(...arguments),this.KeyframeResolver=Ys}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}}function $l(t){return window.getComputedStyle(t)}class _l extends Ri{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(ot.has(n)){const s=Ke(n);return s&&s.default||0}else{const s=$l(e),i=(vs(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return yi(e,n)}build(e,n,s,i){Le(e,n,s,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return je(e,n,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;E(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,s,i){Ss(e,n,s,i)}}class Hl extends Ri{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ot.has(n)){const s=Ke(n);return s&&s.default||0}return n=Vs.has(n)?n:we(n),e.getAttribute(n)}measureInstanceViewportBox(){return A()}scrapeMotionValuesFromProps(e,n,s){return As(e,n,s)}build(e,n,s,i){ke(e,n,s,this.isSVGTag,i.transformTemplate)}renderInstance(e,n,s,i){ws(e,n,s,i)}mount(e){this.isSVGTag=Be(e.tagName),super.mount(e)}}const zl=(t,e)=>Me(t)?new Hl(e,{enableHardwareAcceleration:!1}):new _l(e,{allowProjection:t!==P.Fragment,enableHardwareAcceleration:!0}),Yl={layout:{ProjectionNode:Ai,MeasureLayout:xi}},Xl={...Ea,...Wr,...jl,...Yl},le=Zi((t,e)=>Mr(t,e,Xl,zl));function qe(){const t=Bi("root"),e=ji().find(n=>{var s;return n.formAction==="/progress"&&((s=n.formData)==null?void 0:s.has("complete"))});return!e||!(t!=null&&t.progress)?(t==null?void 0:t.progress)??null:t.progress.map(n=>{var o,r;const s=((o=e.formData)==null?void 0:o.get("complete"))==="true";return((r=e.formData)==null?void 0:r.get("lessonSlug"))===n.epicLessonSlug?{...n,epicCompletedAt:s?Date.now():null}:n})}function nu(){const t=qe();if(!t)return null;const e=r=>r.type==="workshop-instructions"?0:r.type==="workshop-finished"?1e4:r.type==="instructions"?r.exerciseNumber*100:r.type==="step"?r.exerciseNumber*100+r.stepNumber:r.type==="finished"?r.exerciseNumber*100+100:r.type==="unknown"?1e5:-1,s=t.sort((r,a)=>e(r)-e(a)).find(r=>!r.epicCompletedAt);if(!s||s.type==="unknown")return null;if(s.type==="workshop-instructions")return"/";if(s.type==="workshop-finished")return"/finished";const i=s.exerciseNumber.toString().padStart(2,"0");if(s.type==="instructions")return`/${i}`;if(s.type==="finished")return`/${i}/finished`;const o=s.stepNumber.toString().padStart(2,"0");return s.type==="step"?`/${i}/${o}/problem`:null}const ql={0:"",1:"before:h-[10%]",2:"before:h-[20%]",3:"before:h-[30%]",4:"before:h-[40%]",5:"before:h-[50%]",6:"before:h-[60%]",7:"before:h-[70%]",8:"before:h-[80%]",9:"before:h-[90%]",10:"before:h-[100%]"};function su(t){const e=qe();if(!(e!=null&&e.length))return null;const n=e.filter(o=>(o.type==="instructions"||o.type==="step"||o.type==="finished")&&o.exerciseNumber===t);if(!n.length)return null;const s=n.reduce((o,r)=>r.epicCompletedAt?o+1:o,0)/n.length,i=Math[s>.1?"floor":"ceil"](s*10);return`relative ${ql[i]} before:bg-highlight before:absolute before:left-0 before:top-0 before:w-[4px]`}function iu(t){const e=Ei(t);return e!=null&&e.epicCompletedAt?"relative before:h-[100%] before:bg-highlight before:absolute before:left-0 before:top-0 before:w-[4px]":null}function Ei({exerciseNumber:t,stepNumber:e,type:n}){const s=qe();return s!=null&&s.length?n==="workshop-finished"||n==="workshop-instructions"?s.find(i=>i.type===n)??null:n==="instructions"||n==="finished"?s.find(i=>i.type===n&&i.exerciseNumber===t)??null:n==="step"?s.find(i=>i.type===n&&i.exerciseNumber===t&&i.stepNumber===e)??null:null:null}function ru({className:t,...e}){var m,p,y,v;const n=Oi(),s=Ei(e),i=P.useRef(null),o=P.useRef(null),r=(m=n.formData)!=null&&m.has("complete")?n.formData.get("complete")==="true":!!(s!=null&&s.epicCompletedAt),[a,l]=P.useState(!1),u=Fi(),c=ki(),h=(y=(p=c.location)==null?void 0:p.state)==null?void 0:y.from,f=(v=c.location)==null?void 0:v.pathname,d=u.pathname;return P.useEffect(()=>{var x;h==="continue next lesson button"&&d===f&&(l(!0),(x=o.current)==null||x.focus())},[u.key,d,f,h]),P.useEffect(()=>{if(!i.current||!a)return;const x=i.current.getAnimations().map(({finished:g})=>g);Promise.allSettled(x).then(()=>{l(!1)})},[a]),ENV.EPICSHOP_DEPLOYED||!s?null:tt.jsxs(n.Form,{method:"POST",action:"/progress",children:[tt.jsx("input",{type:"hidden",name:"lessonSlug",value:s.epicLessonSlug}),tt.jsx("input",{type:"hidden",name:"complete",value:(!r).toString()}),tt.jsxs(le.button,{ref:o,onClick:()=>{l(!r)},type:"submit",className:Je("group relative flex w-full items-center justify-between overflow-hidden transition hover:bg-[hsl(var(--foreground)/0.02)] focus:bg-[hsl(var(--foreground)/0.02)]",t),children:[r?"Mark as incomplete":"Mark as complete",a?tt.jsx(le.div,{ref:i,className:"absolute right-0 h-20 w-20 rounded-full bg-foreground/20",initial:{scale:.5,opacity:0},animate:{scale:[.5,2],opacity:[0,1,0]},transition:{duration:1,ease:"easeInOut"}}):null,tt.jsx(le.div,{"aria-hidden":!0,className:Je("relative flex h-8 w-8 items-center justify-center overflow-hidden rounded-full border transition",{"bg-foreground text-background duration-1000":r,"duration-100 group-hover:bg-background":!r}),children:r?"✓":tt.jsx("div",{className:"absolute -translate-y-10 opacity-25 transition group-hover:translate-y-0",children:"✓"})})]})]})}export{ru as P,qe as a,Pa as b,br as c,Ii as d,nu as e,iu as f,le as m,ya as s,su as u};
2
- //# sourceMappingURL=progress-mfa_5CZx.js.map
1
+ import{r as P,R as ls,u as Fi,c as ki,j as tt}from"./index-D1WEsmVZ.js";import{c as Je}from"./clsx-B-dksMZM.js";import{b as Bi,e as ji,a as Oi}from"./components-Dj3sm47B.js";const us=P.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Kt=P.createContext({}),Se=P.createContext(null),Ve=typeof document<"u",Ii=Ve?P.useLayoutEffect:P.useEffect,cs=P.createContext({strict:!1}),we=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ni="framerAppearId",hs="data-"+we(Ni),Ui={skipAnimations:!1,useManualTiming:!1};class tn{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function Ki(t){let e=new tn,n=new tn,s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const h=c&&i,f=h?e:n;return u&&r.add(l),f.add(l)&&h&&i&&(s=e.order.length),l},cancel:l=>{n.remove(l),r.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[e,n]=[n,e],n.clear(),s=e.order.length,s)for(let u=0;u<s;u++){const c=e.order[u];r.has(c)&&(a.schedule(c),t()),c(l)}i=!1,o&&(o=!1,a.process(l))}};return a}const Dt=["read","resolveKeyframes","update","preRender","render","postRender"],Wi=40;function fs(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=Dt.reduce((h,f)=>(h[f]=Ki(()=>n=!0),h),{}),r=h=>{o[h].process(i)},a=()=>{const h=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(h-i.timestamp,Wi),1),i.timestamp=h,i.isProcessing=!0,Dt.forEach(r),i.isProcessing=!1,n&&e&&(s=!1,t(a))},l=()=>{n=!0,s=!0,i.isProcessing||t(a)};return{schedule:Dt.reduce((h,f)=>{const d=o[f];return h[f]=(m,p=!1,y=!1)=>(n||l(),d.schedule(m,p,y)),h},{}),cancel:h=>Dt.forEach(f=>o[f].cancel(h)),state:i,steps:o}}const{schedule:Ae,cancel:tu}=fs(queueMicrotask,!1);function Gi(t,e,n,s){const{visualElement:i}=P.useContext(Kt),o=P.useContext(cs),r=P.useContext(Se),a=P.useContext(us).reducedMotion,l=P.useRef();s=s||o.renderer,!l.current&&s&&(l.current=s(t,{visualState:e,parent:i,props:n,presenceContext:r,blockInitialAnimation:r?r.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;P.useInsertionEffect(()=>{u&&u.update(n,r)});const c=P.useRef(!!(n[hs]&&!window.HandoffComplete));return Ii(()=>{u&&(Ae.postRender(u.render),c.current&&u.animationState&&u.animationState.animateChanges())}),P.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),c.current&&(c.current=!1,window.HandoffComplete=!0))}),u}function lt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function $i(t,e,n){return P.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):lt(n)&&(n.current=s))},[e])}function Tt(t){return typeof t=="string"||Array.isArray(t)}function Wt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const Ce=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],De=["initial",...Ce];function Gt(t){return Wt(t.animate)||De.some(e=>Tt(t[e]))}function ds(t){return!!(Gt(t)||t.variants)}function _i(t,e){if(Gt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Tt(n)?n:void 0,animate:Tt(s)?s:void 0}}return t.inherit!==!1?e:{}}function Hi(t){const{initial:e,animate:n}=_i(t,P.useContext(Kt));return P.useMemo(()=>({initial:e,animate:n}),[en(e),en(n)])}function en(t){return Array.isArray(t)?t.join(" "):t}const nn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Pt={};for(const t in nn)Pt[t]={isEnabled:e=>nn[t].some(n=>!!e[n])};function zi(t){for(const e in t)Pt[e]={...Pt[e],...t[e]}}const ms=P.createContext({}),ps=P.createContext({}),Yi=Symbol.for("motionComponentSymbol");function Xi({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&zi(t);function o(a,l){let u;const c={...P.useContext(us),...a,layoutId:qi(a)},{isStatic:h}=c,f=Hi(a),d=s(a,h);if(!h&&Ve){f.visualElement=Gi(i,d,c,e);const m=P.useContext(ps),p=P.useContext(cs).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,p,t,m))}return P.createElement(Kt.Provider,{value:f},u&&f.visualElement?P.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,a,$i(d,f.visualElement,l),d,h,f.visualElement))}const r=P.forwardRef(o);return r[Yi]=i,r}function qi({layoutId:t}){const e=P.useContext(ms).id;return e&&t!==void 0?e+"-"+t:t}function Zi(t){function e(s,i={}){return Xi(t(s,i))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const Qi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Me(t){return typeof t!="string"||t.includes("-")?!1:!!(Qi.indexOf(t)>-1||/[A-Z]/u.test(t))}const kt={};function Ji(t){Object.assign(kt,t)}const Vt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ot=new Set(Vt);function gs(t,{layout:e,layoutId:n}){return ot.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!kt[t]||t==="opacity")}const E=t=>!!(t&&t.getVelocity),tr={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},er=Vt.length;function nr(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,i){let o="";for(let r=0;r<er;r++){const a=Vt[r];if(t[a]!==void 0){const l=tr[a]||a;o+=`${l}(${t[a]}) `}}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(t,s?"":o):n&&s&&(o="none"),o}const ys=t=>e=>typeof e=="string"&&e.startsWith(t),vs=ys("--"),sr=ys("var(--"),Re=t=>sr(t)?ir.test(t.split("/*")[0].trim()):!1,ir=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,rr=(t,e)=>e&&typeof t=="number"?e.transform(t):t,q=(t,e,n)=>n>e?e:n<t?t:n,dt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},gt={...dt,transform:t=>q(0,1,t)},Mt={...dt,default:1},yt=t=>Math.round(t*1e5)/1e5,Ee=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,or=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,ar=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function wt(t){return typeof t=="string"}const At=t=>({test:e=>wt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),H=At("deg"),N=At("%"),T=At("px"),lr=At("vh"),ur=At("vw"),sn={...N,parse:t=>N.parse(t)/100,transform:t=>N.transform(t*100)},rn={...dt,transform:Math.round},xs={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,size:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,rotate:H,rotateX:H,rotateY:H,rotateZ:H,scale:Mt,scaleX:Mt,scaleY:Mt,scaleZ:Mt,skew:H,skewX:H,skewY:H,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:gt,originX:sn,originY:sn,originZ:T,zIndex:rn,backgroundPositionX:T,backgroundPositionY:T,fillOpacity:gt,strokeOpacity:gt,numOctaves:rn};function Le(t,e,n,s){const{style:i,vars:o,transform:r,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const h in e){const f=e[h];if(vs(h)){o[h]=f;continue}const d=xs[h],m=rr(f,d);if(ot.has(h)){if(l=!0,r[h]=m,!c)continue;f!==(d.default||0)&&(c=!1)}else h.startsWith("origin")?(u=!0,a[h]=m):i[h]=m}if(e.transform||(l||s?i.transform=nr(t.transform,n,c,s):i.transform&&(i.transform="none")),u){const{originX:h="50%",originY:f="50%",originZ:d=0}=a;i.transformOrigin=`${h} ${f} ${d}`}}const Fe=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ts(t,e,n){for(const s in e)!E(e[s])&&!gs(s,n)&&(t[s]=e[s])}function cr({transformTemplate:t},e,n){return P.useMemo(()=>{const s=Fe();return Le(s,e,{enableHardwareAcceleration:!n},t),Object.assign({},s.vars,s.style)},[e])}function hr(t,e,n){const s=t.style||{},i={};return Ts(i,s,t),Object.assign(i,cr(t,e,n)),i}function fr(t,e,n){const s={},i=hr(t,e,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=i,s}const dr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Bt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||dr.has(t)}let Ps=t=>!Bt(t);function mr(t){t&&(Ps=e=>e.startsWith("on")?!Bt(e):t(e))}try{mr(require("@emotion/is-prop-valid").default)}catch{}function pr(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Ps(i)||n===!0&&Bt(i)||!e&&!Bt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function on(t,e,n){return typeof t=="string"?t:T.transform(e+n*t)}function gr(t,e,n){const s=on(e,t.x,t.width),i=on(n,t.y,t.height);return`${s} ${i}`}const yr={offset:"stroke-dashoffset",array:"stroke-dasharray"},vr={offset:"strokeDashoffset",array:"strokeDasharray"};function xr(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?yr:vr;t[o.offset]=T.transform(-s);const r=T.transform(e),a=T.transform(n);t[o.array]=`${r} ${a}`}function ke(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},c,h,f){if(Le(t,u,c,f),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(i!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=gr(p,i!==void 0?i:.5,o!==void 0?o:.5)),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&xr(d,r,a,l,!1)}const bs=()=>({...Fe(),attrs:{}}),Be=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Tr(t,e,n,s){const i=P.useMemo(()=>{const o=bs();return ke(o,e,{enableHardwareAcceleration:!1},Be(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Ts(o,t.style,t),i.style={...o,...i.style}}return i}function Pr(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(Me(n)?Tr:fr)(s,o,r,n),u=pr(s,typeof n=="string",t),c=n!==P.Fragment?{...u,...l,ref:i}:{},{children:h}=s,f=P.useMemo(()=>E(h)?h.get():h,[h]);return P.createElement(n,{...c,children:f})}}function Ss(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}const Vs=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"]);function ws(t,e,n,s){Ss(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Vs.has(i)?i:we(i),e.attrs[i])}function je(t,e,n){var s;const{style:i}=t,o={};for(const r in i)(E(i[r])||e.style&&E(e.style[r])||gs(r,t)||((s=n==null?void 0:n.getValue(r))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(o[r]=i[r]);return o}function As(t,e,n){const s=je(t,e,n);for(const i in t)if(E(t[i])||E(e[i])){const o=Vt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}function Oe(t,e,n,s={},i={}){return typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,i)),e}function br(t){const e=P.useRef(null);return e.current===null&&(e.current=t()),e.current}const ue=t=>Array.isArray(t),Sr=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Vr=t=>ue(t)?t[t.length-1]||0:t;function Et(t){const e=E(t)?t.get():t;return Sr(e)?e.toValue():e}function wr({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,i,o){const r={latestValues:Ar(s,i,o,t),renderState:e()};return n&&(r.mount=a=>n(s,a,r)),r}const Cs=t=>(e,n)=>{const s=P.useContext(Kt),i=P.useContext(Se),o=()=>wr(t,e,s,i);return n?o():br(o)};function Ar(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Et(o[f]);let{initial:r,animate:a}=t;const l=Gt(t),u=ds(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const h=c?a:r;return h&&typeof h!="boolean"&&!Wt(h)&&(Array.isArray(h)?h:[h]).forEach(d=>{const m=Oe(t,d);if(!m)return;const{transitionEnd:p,transition:y,...v}=m;for(const x in v){let g=v[x];if(Array.isArray(g)){const b=c?g.length-1:0;g=g[b]}g!==null&&(i[x]=g)}for(const x in p)i[x]=p[x]}),i}const L=t=>t,{schedule:D,cancel:Z,state:C,steps:Xt}=fs(typeof requestAnimationFrame<"u"?requestAnimationFrame:L,!0),Cr={useVisualState:Cs({scrapeMotionValuesFromProps:As,createRenderState:bs,onMount:(t,e,{renderState:n,latestValues:s})=>{D.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),D.render(()=>{ke(n,s,{enableHardwareAcceleration:!1},Be(e.tagName),t.transformTemplate),ws(e,n)})}})},Dr={useVisualState:Cs({scrapeMotionValuesFromProps:je,createRenderState:Fe})};function Mr(t,{forwardMotionProps:e=!1},n,s){return{...Me(t)?Cr:Dr,preloadedFeatures:n,useRender:Pr(e),createVisualElement:s,Component:t}}function K(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const Ds=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function $t(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const Rr=t=>e=>Ds(e)&&t(e,$t(e));function W(t,e,n,s){return K(t,e,Rr(n),s)}const Er=(t,e)=>n=>e(t(n)),G=(...t)=>t.reduce(Er);function Ms(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const an=Ms("dragHorizontal"),ln=Ms("dragVertical");function Rs(t){let e=!1;if(t==="y")e=ln();else if(t==="x")e=an();else{const n=an(),s=ln();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Es(){const t=Rs(!0);return t?(t(),!1):!0}class J{constructor(e){this.isMounted=!1,this.node=e}update(){}}function un(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End"),i=(o,r)=>{if(o.pointerType==="touch"||Es())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e),a[s]&&a[s](o,r)};return W(t.current,n,i,{passive:!t.getProps()[s]})}class Lr extends J{mount(){this.unmount=G(un(this.node,!0),un(this.node,!1))}unmount(){}}class Fr extends J{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=G(K(this.node.current,"focus",()=>this.onFocus()),K(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Ls=(t,e)=>e?t===e?!0:Ls(t,e.parentElement):!1;function qt(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,$t(n))}class kr extends J{constructor(){super(...arguments),this.removeStartListeners=L,this.removeEndListeners=L,this.removeAccessibleListeners=L,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),o=W(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:h}=this.node.getProps();!h&&!Ls(this.node.current,a.target)?c&&c(a,l):u&&u(a,l)},{passive:!(s.onTap||s.onPointerUp)}),r=W(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=G(o,r),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=o=>{if(o.key!=="Enter"||this.isPressing)return;const r=a=>{a.key!=="Enter"||!this.checkPressEnd()||qt("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&c(l,u)})};this.removeEndListeners(),this.removeEndListeners=K(this.node.current,"keyup",r),qt("down",(a,l)=>{this.startPress(a,l)})},n=K(this.node.current,"keydown",e),s=()=>{this.isPressing&&qt("cancel",(o,r)=>this.cancelPress(o,r))},i=K(this.node.current,"blur",s);this.removeAccessibleListeners=G(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:s,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&s(e,n)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Es()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&s(e,n)}mount(){const e=this.node.getProps(),n=W(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),s=K(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=G(n,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const ce=new WeakMap,Zt=new WeakMap,Br=t=>{const e=ce.get(t.target);e&&e(t)},jr=t=>{t.forEach(Br)};function Or({root:t,...e}){const n=t||document;Zt.has(n)||Zt.set(n,{});const s=Zt.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(jr,{root:t,...e})),s[i]}function Ir(t,e,n){const s=Or(e);return ce.set(t,n),s.observe(t),()=>{ce.delete(t),s.unobserve(t)}}const Nr={some:0,all:1};class Ur extends J{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Nr[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Ir(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Kr(e,n))&&this.startObserver()}unmount(){}}function Kr({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Wr={inView:{Feature:Ur},tap:{Feature:kr},focus:{Feature:Fr},hover:{Feature:Lr}};function Fs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function Gr(t){const e={};return t.values.forEach((n,s)=>e[s]=n.get()),e}function $r(t){const e={};return t.values.forEach((n,s)=>e[s]=n.getVelocity()),e}function _t(t,e,n){const s=t.getProps();return Oe(s,e,n!==void 0?n:s.custom,Gr(t),$r(t))}const Y=t=>t*1e3,$=t=>t/1e3,_r={type:"spring",stiffness:500,damping:25,restSpeed:10},Hr=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),zr={type:"keyframes",duration:.8},Yr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Xr=(t,{keyframes:e})=>e.length>2?zr:ot.has(t)?t.startsWith("scale")?Hr(e[1]):_r:Yr;function qr({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function Ie(t,e){return t[e]||t.default||t}const Zr=t=>t!==null;function Ht(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Zr),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}let Lt;function Qr(){Lt=void 0}const X={now:()=>(Lt===void 0&&X.set(C.isProcessing||Ui.useManualTiming?C.timestamp:performance.now()),Lt),set:t=>{Lt=t,queueMicrotask(Qr)}},ks=t=>/^0[^.\s]+$/u.test(t);function Jr(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||ks(t):!0}let Bs=L;const js=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),to=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function eo(t){const e=to.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function Os(t,e,n=1){const[s,i]=eo(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return js(r)?parseFloat(r):r}return Re(i)?Os(i,e,n+1):i}const no=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),cn=t=>t===dt||t===T,hn=(t,e)=>parseFloat(t.split(", ")[e]),fn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return hn(i[1],e);{const o=s.match(/^matrix\((.+)\)$/u);return o?hn(o[1],t):0}},so=new Set(["x","y","z"]),io=Vt.filter(t=>!so.has(t));function dn(t){const e=[];return io.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ft={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:fn(4,13),y:fn(5,14)};ft.translateX=ft.x;ft.translateY=ft.y;const Is=t=>e=>e.test(t),ro={test:t=>t==="auto",parse:t=>t},Ns=[dt,T,N,H,ur,lr,ro],mn=t=>Ns.find(Is(t)),rt=new Set;let he=!1,fe=!1;function Us(){if(fe){const t=Array.from(rt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{dn(s).length&&(n.set(s,dn(s)),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render()}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}fe=!1,he=!1,rt.forEach(t=>t.complete()),rt.clear()}function Ks(){rt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(fe=!0)})}function oo(){Ks(),Us()}class Ne{constructor(e,n,s,i,o,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(rt.add(this),he||(he=!0,D.read(Ks),D.resolveKeyframes(Us))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const r=i==null?void 0:i.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),rt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,rt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Ue=(t,e)=>n=>!!(wt(n)&&ar.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Ws=(t,e,n)=>s=>{if(!wt(s))return s;const[i,o,r,a]=s.match(Ee);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},ao=t=>q(0,255,t),Qt={...dt,transform:t=>Math.round(ao(t))},it={test:Ue("rgb","red"),parse:Ws("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Qt.transform(t)+", "+Qt.transform(e)+", "+Qt.transform(n)+", "+yt(gt.transform(s))+")"};function lo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const de={test:Ue("#"),parse:lo,transform:it.transform},ut={test:Ue("hsl","hue"),parse:Ws("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+N.transform(yt(e))+", "+N.transform(yt(n))+", "+yt(gt.transform(s))+")"},R={test:t=>it.test(t)||de.test(t)||ut.test(t),parse:t=>it.test(t)?it.parse(t):ut.test(t)?ut.parse(t):de.parse(t),transform:t=>wt(t)?t:t.hasOwnProperty("red")?it.transform(t):ut.transform(t)};function uo(t){var e,n;return isNaN(t)&&wt(t)&&(((e=t.match(Ee))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(or))===null||n===void 0?void 0:n.length)||0)>0}const Gs="number",$s="color",co="var",ho="var(",pn="${}",fo=/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 jt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(fo,l=>(R.test(l)?(s.color.push(o),i.push($s),n.push(R.parse(l))):l.startsWith(ho)?(s.var.push(o),i.push(co),n.push(l)):(s.number.push(o),i.push(Gs),n.push(parseFloat(l))),++o,pn)).split(pn);return{values:n,split:a,indexes:s,types:i}}function _s(t){return jt(t).values}function Hs(t){const{split:e,types:n}=jt(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===Gs?o+=yt(i[r]):a===$s?o+=R.transform(i[r]):o+=i[r]}return o}}const mo=t=>typeof t=="number"?0:t;function po(t){const e=_s(t);return Hs(t)(e.map(mo))}const Q={test:uo,parse:_s,createTransformer:Hs,getAnimatableNone:po},go=new Set(["brightness","contrast","saturate","opacity"]);function yo(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ee)||[];if(!s)return t;const i=n.replace(s,"");let o=go.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const vo=/\b([a-z-]*)\(.*?\)/gu,me={...Q,getAnimatableNone:t=>{const e=t.match(vo);return e?e.map(yo).join(" "):t}},xo={...xs,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:me,WebkitFilter:me},Ke=t=>xo[t];function zs(t,e){let n=Ke(t);return n!==me&&(n=Q),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function To(t,e,n){let s=0,i;for(;s<t.length&&!i;)typeof t[s]=="string"&&t[s]!=="none"&&t[s]!=="0"&&(i=t[s]),s++;if(i&&n)for(const o of e)t[o]=zs(n,i)}class Ys extends Ne{constructor(e,n,s,i){super(e,n,s,i,i==null?void 0:i.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){const u=e[l];if(typeof u=="string"&&Re(u)){const c=Os(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(!no.has(s)||e.length!==2)return this.resolveNoneKeyframes();const[i,o]=e,r=mn(i),a=mn(o);if(r!==a)if(cn(r)&&cn(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)Jr(e[i])&&s.push(i);s.length&&To(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ft[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n.current)return;const o=n.getValue(s);o&&o.jump(this.measuredOrigin,!1);const r=i.length-1,a=i[r];i[r]=ft[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function Po(t){let e;return()=>(e===void 0&&(e=t()),e)}const gn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Q.test(t)||t==="0")&&!t.startsWith("url("));function bo(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function So(t,e,n,s){const i=t[0];if(i===null)return!1;const o=t[t.length-1],r=gn(i,e),a=gn(o,e);return!r||!a?!1:bo(t)||n==="spring"&&s}class Xs{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,...a},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&oo(),this._resolved}onKeyframesResolved(e,n){this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:o,delay:r,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!So(e,s,i,o))if(r)this.options.duration=0;else{l==null||l(Ht(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function qs(t,e){return e?t*(1e3/e):0}const Vo=5;function Zs(t,e,n){const s=Math.max(e-Vo,0);return qs(n-t(s),e-s)}const Jt=.001,wo=.01,Ao=10,Co=.05,Do=1;function Mo({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let i,o,r=1-e;r=q(Co,Do,r),t=q(wo,Ao,$(t)),r<1?(i=u=>{const c=u*r,h=c*t,f=c-n,d=pe(u,r),m=Math.exp(-h);return Jt-f/d*m},o=u=>{const h=u*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-h),p=pe(Math.pow(u,2),r);return(-i(u)+Jt>0?-1:1)*((f-d)*m)/p}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-Jt+c*h},o=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Eo(i,o,a);if(t=Y(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const Ro=12;function Eo(t,e,n){let s=n;for(let i=1;i<Ro;i++)s=s-t(s)/e(s);return s}function pe(t,e){return t*Math.sqrt(1-e*e)}const Lo=["duration","bounce"],Fo=["stiffness","damping","mass"];function yn(t,e){return e.some(n=>t[n]!==void 0)}function ko(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!yn(t,Fo)&&yn(t,Lo)){const n=Mo(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function Qs({keyframes:t,restDelta:e,restSpeed:n,...s}){const i=t[0],o=t[t.length-1],r={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:f}=ko({...s,velocity:-$(s.velocity||0)}),d=h||0,m=l/(2*Math.sqrt(a*u)),p=o-i,y=$(Math.sqrt(a/u)),v=Math.abs(p)<5;n||(n=v?.01:2),e||(e=v?.005:.5);let x;if(m<1){const g=pe(y,m);x=b=>{const V=Math.exp(-m*y*b);return o-V*((d+m*y*p)/g*Math.sin(g*b)+p*Math.cos(g*b))}}else if(m===1)x=g=>o-Math.exp(-y*g)*(p+(d+y*p)*g);else{const g=y*Math.sqrt(m*m-1);x=b=>{const V=Math.exp(-m*y*b),M=Math.min(g*b,300);return o-V*((d+m*y*p)*Math.sinh(M)+g*p*Math.cosh(M))/g}}return{calculatedDuration:f&&c||null,next:g=>{const b=x(g);if(f)r.done=g>=c;else{let V=d;g!==0&&(m<1?V=Zs(x,g,b):V=0);const M=Math.abs(V)<=n,_=Math.abs(o-b)<=e;r.done=M&&_}return r.value=r.done?o:b,r}}}function vn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=S=>a!==void 0&&S<a||l!==void 0&&S>l,m=S=>a===void 0?l:l===void 0||Math.abs(a-S)<Math.abs(l-S)?a:l;let p=n*e;const y=h+p,v=r===void 0?y:r(y);v!==y&&(p=v-h);const x=S=>-p*Math.exp(-S/s),g=S=>v+x(S),b=S=>{const B=x(S),j=g(S);f.done=Math.abs(B)<=u,f.value=f.done?v:j};let V,M;const _=S=>{d(f.value)&&(V=S,M=Qs({keyframes:[f.value,m(f.value)],velocity:Zs(g,S,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:S=>{let B=!1;return!M&&V===void 0&&(B=!0,b(S),_(S)),V!==void 0&&S>=V?M.next(S-V):(!B&&b(S),f)}}}const Js=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Bo=1e-7,jo=12;function Oo(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Js(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Bo&&++a<jo);return r}function Ct(t,e,n,s){if(t===e&&n===s)return L;const i=o=>Oo(o,0,1,t,n);return o=>o===0||o===1?o:Js(i(o),e,s)}const Io=Ct(.42,0,1,1),No=Ct(0,0,.58,1),ti=Ct(.42,0,.58,1),Uo=t=>Array.isArray(t)&&typeof t[0]!="number",ei=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,ni=t=>e=>1-t(1-e),We=t=>1-Math.sin(Math.acos(t)),si=ni(We),Ko=ei(We),ii=Ct(.33,1.53,.69,.99),Ge=ni(ii),Wo=ei(Ge),Go=t=>(t*=2)<1?.5*Ge(t):.5*(2-Math.pow(2,-10*(t-1))),$o={linear:L,easeIn:Io,easeInOut:ti,easeOut:No,circIn:We,circInOut:Ko,circOut:si,backIn:Ge,backInOut:Wo,backOut:ii,anticipate:Go},xn=t=>{if(Array.isArray(t)){Bs(t.length===4);const[e,n,s,i]=t;return Ct(e,n,s,i)}else if(typeof t=="string")return $o[t];return t},bt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},w=(t,e,n)=>t+(e-t)*n;function te(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function _o({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=te(l,a,t+1/3),o=te(l,a,t),r=te(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}const ee=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},Ho=[de,it,ut],zo=t=>Ho.find(e=>e.test(t));function Tn(t){const e=zo(t);let n=e.parse(t);return e===ut&&(n=_o(n)),n}const Pn=(t,e)=>{const n=Tn(t),s=Tn(e),i={...n};return o=>(i.red=ee(n.red,s.red,o),i.green=ee(n.green,s.green,o),i.blue=ee(n.blue,s.blue,o),i.alpha=w(n.alpha,s.alpha,o),it.transform(i))};function ge(t,e){return n=>n>0?e:t}function Yo(t,e){return n=>w(t,e,n)}function $e(t){return typeof t=="number"?Yo:typeof t=="string"?Re(t)?ge:R.test(t)?Pn:Zo:Array.isArray(t)?ri:typeof t=="object"?R.test(t)?Pn:Xo:ge}function ri(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>$e(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function Xo(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=$e(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function qo(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const r=e.types[o],a=t.indexes[r][i[r]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[o]=l,i[r]++}return s}const Zo=(t,e)=>{const n=Q.createTransformer(e),s=jt(t),i=jt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?G(ri(qo(s,i),i.values),n):ge(t,e)};function oi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?w(t,e,n):$e(t)(t,e)}function Qo(t,e,n){const s=[],i=n||oi,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||L:e;a=G(l,a)}s.push(a)}return s}function Jo(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Bs(o===e.length),o===1)return()=>e[0];if(o===2&&t[0]===t[1])return()=>e[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Qo(e,s,i),a=r.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const h=bt(t[c],t[c+1],u);return r[c](h)};return n?u=>l(q(t[0],t[o-1],u)):l}function ta(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=bt(0,e,s);t.push(w(n,1,i))}}function ea(t){const e=[0];return ta(e,t.length-1),e}function na(t,e){return t.map(n=>n*e)}function sa(t,e){return t.map(()=>e||ti).splice(0,t.length-1)}function Ot({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Uo(s)?s.map(xn):xn(s),o={done:!1,value:e[0]},r=na(n&&n.length===e.length?n:ea(e),t),a=Jo(r,e,{ease:Array.isArray(i)?i:sa(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const bn=2e4;function ia(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<bn;)e+=n,s=t.next(e);return e>=bn?1/0:e}const ra=t=>{const e=({timestamp:n})=>t(n);return{start:()=>D.update(e,!0),stop:()=>Z(e),now:()=>C.isProcessing?C.timestamp:X.now()}},oa={decay:vn,inertia:vn,tween:Ot,keyframes:Ot,spring:Qs},aa=t=>t/100;class _e extends Xs{constructor({KeyframeResolver:e=Ne,...n}){super(n),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle";const{name:s,motionValue:i,keyframes:o}=this.options,r=(a,l)=>this.onKeyframesResolved(a,l);s&&i&&i.owner?this.resolver=i.owner.resolveKeyframes(o,r,s,i):this.resolver=new e(o,r,s,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=this.options,a=oa[n]||Ot;let l,u;a!==Ot&&typeof e[0]!="number"&&(l=G(aa,oi(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});o==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-r})),c.calculatedDuration===null&&(c.calculatedDuration=ia(c));const{calculatedDuration:h}=c,f=h+i,d=f*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:f,totalDuration:d}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return o.next(0);const{delay:f,repeat:d,repeatType:m,repeatDelay:p,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-f*(this.speed>=0?1:-1),x=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let g=this.currentTime,b=o;if(d){const S=Math.min(this.currentTime,c)/h;let B=Math.floor(S),j=S%1;!j&&S>=1&&(j=1),j===1&&B--,B=Math.min(B,d+1),!!(B%2)&&(m==="reverse"?(j=1-j,p&&(j-=p/h)):m==="mirror"&&(b=r)),g=q(0,1,j)*h}const V=x?{done:!1,value:l[0]}:b.next(g);a&&(V.value=a(V.value));let{done:M}=V;!x&&u!==null&&(M=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return _&&i!==void 0&&(V.value=Ht(l,this.options,i)),y&&y(V.value),_&&this.finish(),V}get duration(){const{resolved:e}=this;return e?$(e.calculatedDuration):0}get time(){return $(this.currentTime)}set time(e){e=Y(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=$(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=ra,onPlay:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=s),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:e}=this.options;e&&e()}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ai=t=>Array.isArray(t)&&typeof t[0]=="number";function li(t){return!!(!t||typeof t=="string"&&ui[t]||ai(t)||Array.isArray(t)&&t.every(li))}const pt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,ui={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pt([0,.65,.55,1]),circOut:pt([.55,0,1,.45]),backIn:pt([.31,.01,.66,-.59]),backOut:pt([.33,1.53,.69,.99])};function ci(t){if(t)return ai(t)?pt(t):Array.isArray(t)?t.map(ci):ui[t]}function la(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=ci(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"})}const ua=Po(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ca=new Set(["opacity","clipPath","filter","transform"]),It=10,ha=2e4;function fa(t){return t.type==="spring"||t.name==="backgroundColor"||!li(t.ease)}function da(t,e){const n=new _e({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&o<ha;)s=n.sample(o),i.push(s.value),o+=It;return{times:void 0,keyframes:i,duration:o-It,ease:"linear"}}class Sn extends Xs{constructor(e){super(e);const{name:n,motionValue:s,keyframes:i}=this.options;this.resolver=new Ys(i,(o,r)=>this.onKeyframesResolved(o,r),n,s),this.resolver.scheduleResolve()}initPlayback(e,n){var s;let{duration:i=300,times:o,ease:r,type:a,motionValue:l,name:u}=this.options;if(!(!((s=l.owner)===null||s===void 0)&&s.current))return!1;if(fa(this.options)){const{onComplete:h,onUpdate:f,motionValue:d,...m}=this.options,p=da(e,m);e=p.keyframes,e.length===1&&(e[1]=e[0]),i=p.duration,o=p.times,r=p.ease,a="keyframes"}const c=la(l.owner.current,u,e,{...this.options,duration:i,times:o,ease:r});return c.startTime=X.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:h}=this.options;l.set(Ht(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:i,times:o,type:a,ease:r,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return $(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return $(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=Y(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return L;const{animation:s}=n;s.timeline=e,s.onfinish=null}return L}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:o,ease:r,times:a}=e;if(!(n.playState==="idle"||n.playState==="finished")){if(this.time){const{motionValue:l,onUpdate:u,onComplete:c,...h}=this.options,f=new _e({...h,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),d=Y(this.time);l.setWithVelocity(f.sample(d-It).value,f.sample(d).value,It)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:o,damping:r,type:a}=e;return ua()&&s&&ca.has(s)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}const He=(t,e,n,s={},i,o)=>r=>{const a=Ie(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-Y(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};qr(a)||(c={...c,...Xr(t,c)}),c.duration&&(c.duration=Y(c.duration)),c.repeatDelay&&(c.repeatDelay=Y(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(h=!0)),h&&!o&&e.get()!==void 0){const f=Ht(c.keyframes,a);if(f!==void 0){D.update(()=>{c.onUpdate(f),c.onComplete()});return}}return!o&&Sn.supports(c)?new Sn(c):new _e(c)};function Nt(t){return!!(E(t)&&t.add)}function ze(t,e){t.indexOf(e)===-1&&t.push(e)}function Ye(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Xe{constructor(){this.subscriptions=[]}add(e){return ze(this.subscriptions,e),()=>Ye(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Vn=30,ma=t=>!isNaN(parseFloat(t));class pa{constructor(e,n={}){this.version="11.0.28",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=X.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.canTrackVelocity=ma(this.current),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=X.now()}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Xe);const s=this.events[e].add(n);return e==="change"?()=>{s(),D.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=X.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Vn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Vn);return qs(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function St(t,e){return new pa(t,e)}function ga(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,St(n))}function ya(t,e){const n=_t(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=Vr(o[r]);ga(t,r,a)}}function va({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function hi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=e;const u=t.getValue("willChange");s&&(r=s);const c=[],h=i&&t.animationState&&t.animationState.getState()[i];for(const f in l){const d=t.getValue(f,(o=t.latestValues[f])!==null&&o!==void 0?o:null),m=l[f];if(m===void 0||h&&va(h,f))continue;const p={delay:n,elapsed:0,...Ie(r||{},f)};let y=!1;if(window.HandoffAppearAnimations){const x=t.getProps()[hs];if(x){const g=window.HandoffAppearAnimations(x,f);g!==null&&(p.elapsed=g,y=!0)}}d.start(He(f,d,m,t.shouldReduceMotion&&ot.has(f)?{type:!1}:p,t,y));const v=d.animation;v&&(Nt(u)&&(u.add(f),v.then(()=>u.remove(f))),c.push(v))}return a&&Promise.all(c).then(()=>{D.update(()=>{a&&ya(t,a)})}),c}function ye(t,e,n={}){var s;const i=_t(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const r=i?()=>Promise.all(hi(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=o;return xa(t,e,c+u,h,f,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,c]=l==="beforeChildren"?[r,a]:[a,r];return u().then(()=>c())}else return Promise.all([r(),a(n.delay)])}function xa(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(Ta).forEach((u,c)=>{u.notify("AnimationStart",e),r.push(ye(u,e,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(r)}function Ta(t,e){return t.sortNodePosition(e)}function Pa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>ye(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=ye(t,e,n);else{const i=typeof e=="function"?_t(t,e,n.custom):e;s=Promise.all(hi(t,i,n))}return s.then(()=>{D.postRender(()=>{t.notify("AnimationComplete",e)})})}const ba=[...Ce].reverse(),Sa=Ce.length;function Va(t){return e=>Promise.all(e.map(({animation:n,options:s})=>Pa(t,n,s)))}function wa(t){let e=Va(t);const n=Ca();let s=!0;const i=l=>(u,c)=>{var h;const f=_t(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(f){const{transition:d,transitionEnd:m,...p}=f;u={...u,...p,...m}}return u};function o(l){e=l(t)}function r(l){const u=t.getProps(),c=t.getVariantContext(!0)||{},h=[],f=new Set;let d={},m=1/0;for(let y=0;y<Sa;y++){const v=ba[y],x=n[v],g=u[v]!==void 0?u[v]:c[v],b=Tt(g),V=v===l?x.isActive:null;V===!1&&(m=y);let M=g===c[v]&&g!==u[v]&&b;if(M&&s&&t.manuallyAnimateOnMount&&(M=!1),x.protectedKeys={...d},!x.isActive&&V===null||!g&&!x.prevProp||Wt(g)||typeof g=="boolean")continue;let S=Aa(x.prevProp,g)||v===l&&x.isActive&&!M&&b||y>m&&b,B=!1;const j=Array.isArray(g)?g:[g];let at=j.reduce(i(v),{});V===!1&&(at={});const{prevResolvedValues:Ze={}}=x,Li={...Ze,...at},Qe=F=>{S=!0,f.has(F)&&(B=!0,f.delete(F)),x.needsAnimating[F]=!0;const U=t.getValue(F);U&&(U.liveStyle=!1)};for(const F in Li){const U=at[F],zt=Ze[F];if(d.hasOwnProperty(F))continue;let Yt=!1;ue(U)&&ue(zt)?Yt=!Fs(U,zt):Yt=U!==zt,Yt?U!=null?Qe(F):f.add(F):U!==void 0&&f.has(F)?Qe(F):x.protectedKeys[F]=!0}x.prevProp=g,x.prevResolvedValues=at,x.isActive&&(d={...d,...at}),s&&t.blockInitialAnimation&&(S=!1),S&&(!M||B)&&h.push(...j.map(F=>({animation:F,options:{type:v}})))}if(f.size){const y={};f.forEach(v=>{const x=t.getBaseTarget(v),g=t.getValue(v);g&&(g.liveStyle=!0),y[v]=x===void 0?null:x}),h.push({animation:y})}let p=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(h):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var d;return(d=f.animationState)===null||d===void 0?void 0:d.setActive(l,u)}),n[l].isActive=u;const h=r(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n}}function Aa(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Fs(e,t):!1}function et(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ca(){return{animate:et(!0),whileInView:et(),whileHover:et(),whileTap:et(),whileDrag:et(),whileFocus:et(),exit:et()}}class Da extends J{constructor(e){super(e),e.animationState||(e.animationState=wa(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Wt(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let Ma=0;class Ra extends J{constructor(){super(...arguments),this.id=Ma++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Ea={animation:{Feature:Da},exit:{Feature:Ra}},wn=(t,e)=>Math.abs(t-e);function La(t,e){const n=wn(t.x,e.x),s=wn(t.y,e.y);return Math.sqrt(n**2+s**2)}class fi{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=se(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=La(h.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:m}=h,{timestamp:p}=C;this.history.push({...m,timestamp:p});const{onStart:y,onMove:v}=this.handlers;f||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=ne(f,this.transformPagePoint),D.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:d,onSessionEnd:m,resumeAnimation:p}=this.handlers;if(this.dragSnapToOrigin&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=se(h.type==="pointercancel"?this.lastMoveEventInfo:ne(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(h,y),m&&m(h,y)},!Ds(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=$t(e),a=ne(r,this.transformPagePoint),{point:l}=a,{timestamp:u}=C;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,se(a,this.history)),this.removeListeners=G(W(this.contextWindow,"pointermove",this.handlePointerMove),W(this.contextWindow,"pointerup",this.handlePointerUp),W(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Z(this.updatePoint)}}function ne(t,e){return e?{point:e(t.point)}:t}function An(t,e){return{x:t.x-e.x,y:t.y-e.y}}function se({point:t},e){return{point:t,delta:An(t,di(e)),offset:An(t,Fa(e)),velocity:ka(e,.1)}}function Fa(t){return t[0]}function di(t){return t[t.length-1]}function ka(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=di(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>Y(e)));)n--;if(!s)return{x:0,y:0};const o=$(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function k(t){return t.max-t.min}function ve(t,e=0,n=.01){return Math.abs(t-e)<=n}function Cn(t,e,n,s=.5){t.origin=s,t.originPoint=w(e.min,e.max,t.origin),t.scale=k(n)/k(e),(ve(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=w(n.min,n.max,t.origin)-t.originPoint,(ve(t.translate)||isNaN(t.translate))&&(t.translate=0)}function vt(t,e,n,s){Cn(t.x,e.x,n.x,s?s.originX:void 0),Cn(t.y,e.y,n.y,s?s.originY:void 0)}function Dn(t,e,n){t.min=n.min+e.min,t.max=t.min+k(e)}function Ba(t,e,n){Dn(t.x,e.x,n.x),Dn(t.y,e.y,n.y)}function Mn(t,e,n){t.min=e.min-n.min,t.max=t.min+k(e)}function xt(t,e,n){Mn(t.x,e.x,n.x),Mn(t.y,e.y,n.y)}function ja(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?w(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?w(n,t,s.max):Math.min(t,n)),t}function Rn(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Oa(t,{top:e,left:n,bottom:s,right:i}){return{x:Rn(t.x,n,i),y:Rn(t.y,e,s)}}function En(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Ia(t,e){return{x:En(t.x,e.x),y:En(t.y,e.y)}}function Na(t,e){let n=.5;const s=k(t),i=k(e);return i>s?n=bt(e.min,e.max-s,t.min):s>i&&(n=bt(t.min,t.max-i,e.min)),q(0,1,n)}function Ua(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const xe=.35;function Ka(t=xe){return t===!1?t=0:t===!0&&(t=xe),{x:Ln(t,"left","right"),y:Ln(t,"top","bottom")}}function Ln(t,e,n){return{min:Fn(t,e),max:Fn(t,n)}}function Fn(t,e){return typeof t=="number"?t:t[e]||0}const kn=()=>({translate:0,scale:1,origin:0,originPoint:0}),ct=()=>({x:kn(),y:kn()}),Bn=()=>({min:0,max:0}),A=()=>({x:Bn(),y:Bn()});function I(t){return[t("x"),t("y")]}function mi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Wa({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Ga(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ie(t){return t===void 0||t===1}function Te({scale:t,scaleX:e,scaleY:n}){return!ie(t)||!ie(e)||!ie(n)}function nt(t){return Te(t)||pi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function pi(t){return jn(t.x)||jn(t.y)}function jn(t){return t&&t!=="0%"}function Ut(t,e,n){const s=t-n,i=e*s;return n+i}function On(t,e,n,s,i){return i!==void 0&&(t=Ut(t,i,s)),Ut(t,n,s)+e}function Pe(t,e=0,n=1,s,i){t.min=On(t.min,e,n,s,i),t.max=On(t.max,e,n,s,i)}function gi(t,{x:e,y:n}){Pe(t.x,e.translate,e.scale,e.originPoint),Pe(t.y,n.translate,n.scale,n.originPoint)}function $a(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const l=o.instance;l&&l.style&&l.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&ht(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,gi(t,r)),s&&nt(o.latestValues)&&ht(t,o.latestValues))}e.x=In(e.x),e.y=In(e.y)}function In(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function z(t,e){t.min=t.min+e,t.max=t.max+e}function Nn(t,e,[n,s,i]){const o=e[i]!==void 0?e[i]:.5,r=w(t.min,t.max,o);Pe(t,e[n],e[s],r,e.scale)}const _a=["x","scaleX","originX"],Ha=["y","scaleY","originY"];function ht(t,e){Nn(t.x,e,_a),Nn(t.y,e,Ha)}function yi(t,e){return mi(Ga(t.getBoundingClientRect(),e))}function za(t,e,n){const s=yi(t,n),{scroll:i}=e;return i&&(z(s.x,i.offset.x),z(s.y,i.offset.y)),s}const vi=({current:t})=>t?t.ownerDocument.defaultView:null,Ya=new WeakMap;class Xa{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=A(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor($t(c,"page").point)},o=(c,h)=>{const{drag:f,dragPropagation:d,onDragStart:m}=this.getProps();if(f&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Rs(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),I(y=>{let v=this.getAxisMotionValue(y).get()||0;if(N.test(v)){const{projection:x}=this.visualElement;if(x&&x.layout){const g=x.layout.layoutBox[y];g&&(v=k(g)*(parseFloat(v)/100))}}this.originPoint[y]=v}),m&&m(c,h);const{animationState:p}=this.visualElement;p&&p.setActive("whileDrag",!0)},r=(c,h)=>{const{dragPropagation:f,dragDirectionLock:d,onDirectionLock:m,onDrag:p}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:y}=h;if(d&&this.currentDirection===null){this.currentDirection=qa(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),p&&p(c,h)},a=(c,h)=>this.stop(c,h),l=()=>I(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new fi(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:vi(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&o(e,n)}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Rt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=ja(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,o=this.constraints;n&&lt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Oa(i.layoutBox,n):this.constraints=!1,this.elastic=Ka(s),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&I(r=>{this.getAxisMotionValue(r)&&(this.constraints[r]=Ua(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!lt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=za(s,i.root,this.visualElement.getTransformPagePoint());let r=Ia(i.layout.layoutBox,o);if(n){const a=n(Wa(r));this.hasMutatedConstraints=!!a,a&&(r=mi(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=I(c=>{if(!Rt(c,n,this.currentDirection))return;let h=l&&l[c]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return s.start(He(e,s,0,n,this.visualElement))}stopAnimation(){I(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){I(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n="_drag"+e.toUpperCase(),s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){I(n=>{const{drag:s}=this.getProps();if(!Rt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-w(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!lt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};I(r=>{const a=this.getAxisMotionValue(r);if(a){const l=a.get();i[r]=Na({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),I(r=>{if(!Rt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(w(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;Ya.set(this.visualElement,this);const e=this.visualElement.current,n=W(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();lt(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),s();const r=K(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(I(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=xe,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Rt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function qa(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Za extends J{constructor(e){super(e),this.removeGroupControls=L,this.removeListeners=L,this.controls=new Xa(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}unmount(){this.removeGroupControls(),this.removeListeners()}}const Un=t=>(e,n)=>{t&&t(e,n)};class Qa extends J{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(e){this.session=new fi(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vi(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Un(e),onStart:Un(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&i(o,r)}}}mount(){this.removePointerDownListener=W(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function Ja(){const t=P.useContext(Se);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=P.useId();return P.useEffect(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}const Ft={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Kn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const mt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Kn(t,e.target.x),s=Kn(t,e.target.y);return`${n}% ${s}%`}},tl={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=Q.parse(t);if(i.length>5)return s;const o=Q.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=w(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}};class el extends ls.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;Ji(nl),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Ft.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,r=s.projection;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||D.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Ae.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function xi(t){const[e,n]=Ja(),s=P.useContext(ms);return ls.createElement(el,{...t,layoutGroup:s,switchLayoutGroup:P.useContext(ps),isPresent:e,safeToRemove:n})}const nl={borderRadius:{...mt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:mt,borderTopRightRadius:mt,borderBottomLeftRadius:mt,borderBottomRightRadius:mt,boxShadow:tl},Ti=["TopLeft","TopRight","BottomLeft","BottomRight"],sl=Ti.length,Wn=t=>typeof t=="string"?parseFloat(t):t,Gn=t=>typeof t=="number"||T.test(t);function il(t,e,n,s,i,o){i?(t.opacity=w(0,n.opacity!==void 0?n.opacity:1,rl(s)),t.opacityExit=w(e.opacity!==void 0?e.opacity:1,0,ol(s))):o&&(t.opacity=w(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;r<sl;r++){const a=`border${Ti[r]}Radius`;let l=$n(e,a),u=$n(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Gn(l)===Gn(u)?(t[a]=Math.max(w(Wn(l),Wn(u),s),0),(N.test(u)||N.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=w(e.rotate||0,n.rotate||0,s))}function $n(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const rl=Pi(0,.5,si),ol=Pi(.5,.95,L);function Pi(t,e,n){return s=>s<t?0:s>e?1:n(bt(t,e,s))}function _n(t,e){t.min=e.min,t.max=e.max}function O(t,e){_n(t.x,e.x),_n(t.y,e.y)}function Hn(t,e,n,s,i){return t-=e,t=Ut(t,1/n,s),i!==void 0&&(t=Ut(t,1/i,s)),t}function al(t,e=0,n=1,s=.5,i,o=t,r=t){if(N.test(e)&&(e=parseFloat(e),e=w(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=w(o.min,o.max,s);t===o&&(a-=e),t.min=Hn(t.min,e,n,a,i),t.max=Hn(t.max,e,n,a,i)}function zn(t,e,[n,s,i],o,r){al(t,e[n],e[s],e[i],e.scale,o,r)}const ll=["x","scaleX","originX"],ul=["y","scaleY","originY"];function Yn(t,e,n,s){zn(t.x,e,ll,n?n.x:void 0,s?s.x:void 0),zn(t.y,e,ul,n?n.y:void 0,s?s.y:void 0)}function Xn(t){return t.translate===0&&t.scale===1}function bi(t){return Xn(t.x)&&Xn(t.y)}function cl(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Si(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function qn(t){return k(t.x)/k(t.y)}class hl{constructor(){this.members=[]}add(e){ze(this.members,e),e.scheduleRender()}remove(e){if(Ye(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Zn(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const fl=(t,e)=>t.depth-e.depth;class dl{constructor(){this.children=[],this.isDirty=!1}add(e){ze(this.children,e),this.isDirty=!0}remove(e){Ye(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fl),this.isDirty=!1,this.children.forEach(e)}}function ml(t,e){const n=X.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(Z(s),t(o-e))};return D.read(s,!0),()=>Z(s)}function pl(t){window.MotionDebug&&window.MotionDebug.record(t)}function gl(t){return t instanceof SVGElement&&t.tagName!=="svg"}function yl(t,e,n){const s=E(t)?t:St(t);return s.start(He("",s,e,n)),s.animation}const re=["","X","Y","Z"],vl={visibility:"hidden"},Qn=1e3;let xl=0;const st={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function oe(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Vi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=xl++,this.animationId=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.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,st.totalNodes=st.resolvedTargetDeltas=st.recalculatedProjection=0,this.nodes.forEach(bl),this.nodes.forEach(Cl),this.nodes.forEach(Dl),this.nodes.forEach(Sl),pl(st)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,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 dl)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new Xe),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=gl(r),this.instance=r;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=ml(f,250),Ft.hasAnimatedSinceResize&&(Ft.hasAnimatedSinceResize=!1,this.nodes.forEach(ts))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeTargetChanged:d,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||c.getDefaultTransition()||Fl,{onLayoutAnimationStart:y,onLayoutAnimationComplete:v}=c.getProps(),x=!this.targetLayout||!Si(this.targetLayout,m)||d,g=!f&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,g);const b={...Ie(p,"layout"),onPlay:y,onComplete:v};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||ts(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Z(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(Ml),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Jn);return}this.isUpdating||this.nodes.forEach(wl),this.isUpdating=!1,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes.forEach(Al),this.nodes.forEach(Tl),this.nodes.forEach(Pl),this.clearAllSnapshots();const a=X.now();C.delta=q(0,1e3/60,a-C.timestamp),C.timestamp=a,C.isProcessing=!0,Xt.update.process(C),Xt.preRender.process(C),Xt.render.process(C),C.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Ae.read(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(Vl),this.sharedNodes.forEach(Rl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,D.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){D.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}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 r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=A(),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,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:r,isRoot:s(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform,a=this.projectionDelta&&!bi(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&(a||nt(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),kl(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return A();const a=r.measureViewportBox(),{scroll:l}=this.root;return l&&(z(a.x,l.offset.x),z(a.y,l.offset.y)),a}removeElementScroll(r){const a=A();O(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:h}=u;if(u!==this.root&&c&&h.layoutScroll){if(c.isRoot){O(a,r);const{scroll:f}=this.root;f&&(z(a.x,-f.offset.x),z(a.y,-f.offset.y))}z(a.x,c.offset.x),z(a.y,c.offset.y)}}return a}applyTransform(r,a=!1){const l=A();O(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ht(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),nt(c.latestValues)&&ht(l,c.latestValues)}return nt(this.latestValues)&&ht(l,this.latestValues),l}removeTransform(r){const a=A();O(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!nt(u.latestValues))continue;Te(u.latestValues)&&u.updateSnapshot();const c=A(),h=u.measurePageBox();O(c,h),Yn(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return nt(this.latestValues)&&Yn(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.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!==C.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(r||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:h,layoutId:f}=this.options;if(!(!this.layout||!(h||f))){if(this.resolvedRelativeTargetAt=C.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=A(),this.relativeTargetOrigin=A(),xt(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),O(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=A(),this.targetWithTransforms=A()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ba(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):O(this.target,this.layout.layoutBox),gi(this.target,this.targetDelta)):O(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=A(),this.relativeTargetOrigin=A(),xt(this.relativeTargetOrigin,this.target,d.target),O(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}st.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Te(this.parent.latestValues)||pi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var r;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((r=this.parent)===null||r===void 0)&&r.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===C.timestamp&&(u=!1),u)return;const{layout:c,layoutId:h}=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||h))return;O(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;$a(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=A());const{target:m}=a;if(!m){this.projectionTransform&&(this.projectionDelta=ct(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=ct(),this.projectionDeltaWithTransform=ct());const p=this.projectionTransform;vt(this.projectionDelta,this.layoutCorrected,m,this.latestValues),this.projectionTransform=Zn(this.projectionDelta,this.treeScale),(this.projectionTransform!==p||this.treeScale.x!==f||this.treeScale.y!==d)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),st.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=ct();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=A(),d=l?l.source:void 0,m=this.layout?this.layout.source:void 0,p=d!==m,y=this.getStack(),v=!y||y.members.length<=1,x=!!(p&&!v&&this.options.crossfade===!0&&!this.path.some(Ll));this.animationProgress=0;let g;this.mixTargetDelta=b=>{const V=b/1e3;es(h.x,r.x,V),es(h.y,r.y,V),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),El(this.relativeTarget,this.relativeTargetOrigin,f,V),g&&cl(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=A()),O(g,this.relativeTarget)),p&&(this.animationValues=c,il(c,u,this.latestValues,V,x,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Z(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=D.update(()=>{Ft.hasAnimatedSinceResize=!0,this.currentAnimation=yl(0,Qn,{...r,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onComplete:()=>{r.onComplete&&r.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 r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Qn),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&wi(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||A();const h=k(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+h;const f=k(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+f}O(a,l),ht(a,c),vt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new hl),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&oe("z",r,u,this.animationValues);for(let c=0;c<re.length;c++)oe(`rotate${re[c]}`,r,u,this.animationValues),oe(`skew${re[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}getProjectionStyles(r){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return vl;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Et(r==null?void 0:r.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Et(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!nt(this.latestValues)&&(p.transform=c?c({},""):"none",this.hasProjected=!1),p}const f=h.animationValues||h.latestValues;this.applyTransformsToTarget(),u.transform=Zn(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:d,y:m}=this.projectionDelta;u.transformOrigin=`${d.origin*100}% ${m.origin*100}% 0`,h.animationValues?u.opacity=h===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=h===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const p in kt){if(f[p]===void 0)continue;const{correct:y,applyTo:v}=kt[p],x=u.transform==="none"?f[p]:y(f[p],h);if(v){const g=v.length;for(let b=0;b<g;b++)u[v[b]]=x}else u[p]=x}return this.options.layoutId&&(u.pointerEvents=h===this?Et(r==null?void 0:r.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Jn),this.root.sharedNodes.clear()}}}function Tl(t){t.updateLayout()}function Pl(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=n.source!==t.layout.source;o==="size"?I(h=>{const f=r?n.measuredBox[h]:n.layoutBox[h],d=k(f);f.min=s[h].min,f.max=f.min+d}):wi(o,n.layoutBox,s)&&I(h=>{const f=r?n.measuredBox[h]:n.layoutBox[h],d=k(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=ct();vt(a,s,n.layoutBox);const l=ct();r?vt(l,t.applyTransform(i,!0),n.measuredBox):vt(l,s,n.layoutBox);const u=!bi(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=A();xt(m,n.layoutBox,f.layoutBox);const p=A();xt(p,s,d.layoutBox),Si(m,p)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function bl(t){st.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Sl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Vl(t){t.clearSnapshot()}function Jn(t){t.clearMeasurements()}function wl(t){t.isLayoutDirty=!1}function Al(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ts(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Cl(t){t.resolveTargetDelta()}function Dl(t){t.calcProjection()}function Ml(t){t.resetSkewAndRotation()}function Rl(t){t.removeLeadSnapshot()}function es(t,e,n){t.translate=w(e.translate,0,n),t.scale=w(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ns(t,e,n,s){t.min=w(e.min,n.min,s),t.max=w(e.max,n.max,s)}function El(t,e,n,s){ns(t.x,e.x,n.x,s),ns(t.y,e.y,n.y,s)}function Ll(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Fl={duration:.45,ease:[.4,0,.1,1]},ss=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),is=ss("applewebkit/")&&!ss("chrome/")?Math.round:L;function rs(t){t.min=is(t.min),t.max=is(t.max)}function kl(t){rs(t.x),rs(t.y)}function wi(t,e,n){return t==="position"||t==="preserve-aspect"&&!ve(qn(e),qn(n),.2)}const Bl=Vi({attachResizeListener:(t,e)=>K(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ae={current:void 0},Ai=Vi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ae.current){const t=new Bl({});t.mount(window),t.setOptions({layoutScroll:!0}),ae.current=t}return ae.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),jl={pan:{Feature:Qa},drag:{Feature:Za,ProjectionNode:Ai,MeasureLayout:xi}},be={current:null},Ci={current:!1};function Ol(){if(Ci.current=!0,!!Ve)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>be.current=t.matches;t.addListener(e),e()}else be.current=!1}function Il(t,e,n){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(E(o))t.addValue(i,o),Nt(s)&&s.add(i);else if(E(r))t.addValue(i,St(o,{owner:t})),Nt(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const a=t.getValue(i);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=t.getStaticValue(i);t.addValue(i,St(a!==void 0?a:o,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const os=new WeakMap,Nl=[...Ns,R,Q],Ul=t=>Nl.find(Is(t)),Di=Object.keys(Pt),Kl=Di.length,as=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Wl=De.length;function Mi(t){if(t)return t.options.allowProjection!==!1?t.projection:Mi(t.parent)}class Gl{constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:o,visualState:r},a={}){this.resolveKeyframes=(f,d,m,p)=>new this.KeyframeResolver(f,d,m,p,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ne,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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.scheduleRender=()=>D.render(this.render,!1,!0);const{latestValues:l,renderState:u}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Gt(n),this.isVariantNode=ds(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&E(d)&&(d.set(l[f],!1),Nt(c)&&c.add(f))}}scrapeMotionValuesFromProps(e,n,s){return{}}mount(e){this.current=e,os.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Ci.current||Ol(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:be.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){os.delete(this.current),this.projection&&this.projection.unmount(),Z(this.notifyUpdate),Z(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,n){const s=ot.has(e),i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&D.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...n},s,i,o){let r,a;for(let l=0;l<Kl;l++){const u=Di[l],{isEnabled:c,Feature:h,ProjectionNode:f,MeasureLayout:d}=Pt[u];f&&(r=f),c(n)&&(!this.features[u]&&h&&(this.features[u]=new h(this)),d&&(a=d))}if((this.type==="html"||this.type==="svg")&&!this.projection&&r){this.projection=new r(this.latestValues,Mi(this.parent));const{layoutId:l,layout:u,drag:c,dragConstraints:h,layoutScroll:f,layoutRoot:d}=n;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!c||h&&lt(h),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:d})}return a}updateFeatures(){for(const e in this.features){const n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):A()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<as.length;s++){const i=as[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o=e["on"+i];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Il(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const s=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(s.initial=this.props.initial),s}const n={};for(let s=0;s<Wl;s++){const i=De[s],o=this.props[i];(Tt(o)||o===!1)&&(n[i]=o)}return n}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){n!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,n)),this.values.set(e,n),this.latestValues[e]=n.get()}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=St(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(js(i)||ks(i))?i=parseFloat(i):!Ul(i)&&Q.test(n)&&(i=zs(e,n)),this.setBaseTarget(e,E(i)?i.get():i)),E(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n,s;const{initial:i}=this.props,o=typeof i=="string"||typeof i=="object"?(s=Oe(this.props,i,(n=this.presenceContext)===null||n===void 0?void 0:n.custom))===null||s===void 0?void 0:s[e]:void 0;if(i&&o!==void 0)return o;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!E(r)?r:this.initialValues[e]!==void 0&&o===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Xe),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Ri extends Gl{constructor(){super(...arguments),this.KeyframeResolver=Ys}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}}function $l(t){return window.getComputedStyle(t)}class _l extends Ri{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,n){if(ot.has(n)){const s=Ke(n);return s&&s.default||0}else{const s=$l(e),i=(vs(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return yi(e,n)}build(e,n,s,i){Le(e,n,s,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return je(e,n,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;E(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,s,i){Ss(e,n,s,i)}}class Hl extends Ri{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ot.has(n)){const s=Ke(n);return s&&s.default||0}return n=Vs.has(n)?n:we(n),e.getAttribute(n)}measureInstanceViewportBox(){return A()}scrapeMotionValuesFromProps(e,n,s){return As(e,n,s)}build(e,n,s,i){ke(e,n,s,this.isSVGTag,i.transformTemplate)}renderInstance(e,n,s,i){ws(e,n,s,i)}mount(e){this.isSVGTag=Be(e.tagName),super.mount(e)}}const zl=(t,e)=>Me(t)?new Hl(e,{enableHardwareAcceleration:!1}):new _l(e,{allowProjection:t!==P.Fragment,enableHardwareAcceleration:!0}),Yl={layout:{ProjectionNode:Ai,MeasureLayout:xi}},Xl={...Ea,...Wr,...jl,...Yl},le=Zi((t,e)=>Mr(t,e,Xl,zl));function qe(){const t=Bi("root"),e=ji().find(n=>{var s;return n.formAction==="/progress"&&((s=n.formData)==null?void 0:s.has("complete"))});return!e||!(t!=null&&t.progress)?(t==null?void 0:t.progress)??null:t.progress.map(n=>{var o,r;const s=((o=e.formData)==null?void 0:o.get("complete"))==="true";return((r=e.formData)==null?void 0:r.get("lessonSlug"))===n.epicLessonSlug?{...n,epicCompletedAt:s?Date.now():null}:n})}function nu(){const t=qe();if(!t)return null;const e=r=>r.type==="workshop-instructions"?0:r.type==="workshop-finished"?1e4:r.type==="instructions"?r.exerciseNumber*100:r.type==="step"?r.exerciseNumber*100+r.stepNumber:r.type==="finished"?r.exerciseNumber*100+100:r.type==="unknown"?1e5:-1,s=t.sort((r,a)=>e(r)-e(a)).find(r=>!r.epicCompletedAt);if(!s||s.type==="unknown")return null;if(s.type==="workshop-instructions")return"/";if(s.type==="workshop-finished")return"/finished";const i=s.exerciseNumber.toString().padStart(2,"0");if(s.type==="instructions")return`/${i}`;if(s.type==="finished")return`/${i}/finished`;const o=s.stepNumber.toString().padStart(2,"0");return s.type==="step"?`/${i}/${o}/problem`:null}const ql={0:"",1:"before:h-[10%]",2:"before:h-[20%]",3:"before:h-[30%]",4:"before:h-[40%]",5:"before:h-[50%]",6:"before:h-[60%]",7:"before:h-[70%]",8:"before:h-[80%]",9:"before:h-[90%]",10:"before:h-[100%]"};function su(t){const e=qe();if(!(e!=null&&e.length))return null;const n=e.filter(o=>(o.type==="instructions"||o.type==="step"||o.type==="finished")&&o.exerciseNumber===t);if(!n.length)return null;const s=n.reduce((o,r)=>r.epicCompletedAt?o+1:o,0)/n.length,i=Math[s>.1?"floor":"ceil"](s*10);return`relative ${ql[i]} before:bg-highlight before:absolute before:left-0 before:top-0 before:w-[4px]`}function iu(t){const e=Ei(t);return e!=null&&e.epicCompletedAt?"relative before:h-[100%] before:bg-highlight before:absolute before:left-0 before:top-0 before:w-[4px]":null}function Ei({exerciseNumber:t,stepNumber:e,type:n}){const s=qe();return s!=null&&s.length?n==="workshop-finished"||n==="workshop-instructions"?s.find(i=>i.type===n)??null:n==="instructions"||n==="finished"?s.find(i=>i.type===n&&i.exerciseNumber===t)??null:n==="step"?s.find(i=>i.type===n&&i.exerciseNumber===t&&i.stepNumber===e)??null:null:null}function ru({className:t,...e}){var m,p,y,v;const n=Oi(),s=Ei(e),i=P.useRef(null),o=P.useRef(null),r=(m=n.formData)!=null&&m.has("complete")?n.formData.get("complete")==="true":!!(s!=null&&s.epicCompletedAt),[a,l]=P.useState(!1),u=Fi(),c=ki(),h=(y=(p=c.location)==null?void 0:p.state)==null?void 0:y.from,f=(v=c.location)==null?void 0:v.pathname,d=u.pathname;return P.useEffect(()=>{var x;h==="continue next lesson button"&&d===f&&(l(!0),(x=o.current)==null||x.focus())},[u.key,d,f,h]),P.useEffect(()=>{if(!i.current||!a)return;const x=i.current.getAnimations().map(({finished:g})=>g);Promise.allSettled(x).then(()=>{l(!1)})},[a]),ENV.EPICSHOP_DEPLOYED||!s?null:tt.jsxs(n.Form,{method:"POST",action:"/progress",children:[tt.jsx("input",{type:"hidden",name:"lessonSlug",value:s.epicLessonSlug}),tt.jsx("input",{type:"hidden",name:"complete",value:(!r).toString()}),tt.jsxs(le.button,{ref:o,onClick:()=>{l(!r)},type:"submit",className:Je("group relative flex w-full items-center justify-between overflow-hidden transition hover:bg-[hsl(var(--foreground)/0.02)] focus:bg-[hsl(var(--foreground)/0.02)]",t),children:[r?"Mark as incomplete":"Mark as complete",a?tt.jsx(le.div,{ref:i,className:"absolute right-0 h-20 w-20 rounded-full bg-foreground/20",initial:{scale:.5,opacity:0},animate:{scale:[.5,2],opacity:[0,1,0]},transition:{duration:1,ease:"easeInOut"}}):null,tt.jsx(le.div,{"aria-hidden":!0,className:Je("relative flex h-8 w-8 items-center justify-center overflow-hidden rounded-full border transition",{"bg-foreground text-background duration-1000":r,"duration-100 group-hover:bg-background":!r}),children:r?"✓":tt.jsx("div",{className:"absolute -translate-y-10 opacity-25 transition group-hover:translate-y-0",children:"✓"})})]})]})}export{ru as P,qe as a,Pa as b,br as c,Ii as d,nu as e,iu as f,le as m,ya as s,su as u};
2
+ //# sourceMappingURL=progress-CBZt2pmu.js.map