@telegraph/modal 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @telegraph/modal
|
|
2
2
|
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#709](https://github.com/knocklabs/telegraph/pull/709) [`560071e`](https://github.com/knocklabs/telegraph/commit/560071edb330493cb5db6fe9230158555cdc7da2) Thanks [@MikeCarbone](https://github.com/MikeCarbone)! - mike-kno-11947-telegraph-fix-border-color-to-look-better-in-dark-and-light
|
|
8
|
+
|
|
3
9
|
## 0.2.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),Qs=require("@radix-ui/react-dialog"),w=require("react"),ei=require("react-dom"),ti=require("@radix-ui/react-focus-scope"),ni=require("@radix-ui/react-portal"),si=require("@radix-ui/react-visually-hidden"),ii=require("@telegraph/button"),ri=require("@telegraph/helpers"),X=require("@telegraph/layout"),oi=require("@telegraph/typography"),ai=require("lucide-react");function ge(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ne=ge(Qs),x=ge(w),ci=ge(ei),ui=ge(ni),li=ge(si);function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Nt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xn(...e){return t=>{let n=!1;const s=e.map(i=>{const r=Nt(i,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Nt(e[i],null)}}}}function Sn(...e){return x.useCallback(xn(...e),e)}function fi(e){const t=di(e),n=x.forwardRef((s,i)=>{const{children:r,...o}=s,a=x.Children.toArray(r),l=a.find(pi);if(l){const u=l.props.children,c=a.map(d=>d===l?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:d);return M.jsx(t,{...o,ref:i,children:x.isValidElement(u)?x.cloneElement(u,void 0,c):null})}return M.jsx(t,{...o,ref:i,children:r})});return n.displayName=`${e}.Slot`,n}function di(e){const t=x.forwardRef((n,s)=>{const{children:i,...r}=n;if(x.isValidElement(i)){const o=gi(i),a=mi(r,i.props);return i.type!==x.Fragment&&(a.ref=s?xn(s,o):o),x.cloneElement(i,a)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hi=Symbol("radix.slottable");function pi(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hi}function mi(e,t){const n={...t};for(const s in t){const i=e[s],r=t[s];/^on[A-Z]/.test(s)?i&&r?n[s]=(...a)=>{const l=r(...a);return i(...a),l}:i&&(n[s]=i):s==="style"?n[s]={...i,...r}:s==="className"&&(n[s]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}function gi(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vn=yi.reduce((e,t)=>{const n=fi(`Primitive.${t}`),s=x.forwardRef((i,r)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),M.jsx(l,{...a,ref:r})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function bi(e,t){e&&ci.flushSync(()=>e.dispatchEvent(t))}function ht(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function vi(e,t=globalThis==null?void 0:globalThis.document){const n=ht(e);x.useEffect(()=>{const s=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var Ti="DismissableLayer",Ue="dismissableLayer.update",wi="dismissableLayer.pointerDownOutside",xi="dismissableLayer.focusOutside",jt,Cn=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),An=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:o,onDismiss:a,...l}=e,u=x.useContext(Cn),[c,d]=x.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=x.useState({}),p=Sn(t,C=>d(C)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=b.indexOf(y),S=c?b.indexOf(c):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,A=S>=m,T=Ci(C=>{const V=C.target,D=[...u.branches].some(O=>O.contains(V));!A||D||(i==null||i(C),o==null||o(C),C.defaultPrevented||a==null||a())},f),P=Ai(C=>{const V=C.target;[...u.branches].some(O=>O.contains(V))||(r==null||r(C),o==null||o(C),C.defaultPrevented||a==null||a())},f);return vi(C=>{S===u.layers.size-1&&(s==null||s(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),x.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Kt(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=jt)}},[c,f,n,u]),x.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Kt())},[c,u]),x.useEffect(()=>{const C=()=>h({});return document.addEventListener(Ue,C),()=>document.removeEventListener(Ue,C)},[]),M.jsx(Vn.div,{...l,ref:p,style:{pointerEvents:v?A?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,T.onPointerDownCapture)})});An.displayName=Ti;var Si="DismissableLayerBranch",Vi=x.forwardRef((e,t)=>{const n=x.useContext(Cn),s=x.useRef(null),i=Sn(t,s);return x.useEffect(()=>{const r=s.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),M.jsx(Vn.div,{...e,ref:i})});Vi.displayName=Si;function Ci(e,t=globalThis==null?void 0:globalThis.document){const n=ht(e),s=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const r=a=>{if(a.target&&!s.current){let l=function(){Mn(wi,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",r),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function Ai(e,t=globalThis==null?void 0:globalThis.document){const n=ht(e),s=x.useRef(!1);return x.useEffect(()=>{const i=r=>{r.target&&!s.current&&Mn(xi,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Kt(){const e=new CustomEvent(Ue);document.dispatchEvent(e)}function Mn(e,t,n,{discrete:s}){const i=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),s?bi(i,r):i.dispatchEvent(r)}var Mi=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},Pi=x[" useInsertionEffect ".trim().toString()]||Mi;function Ei({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[i,r,o]=Ri({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const c=x.useRef(e!==void 0);x.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${s} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,s])}const u=x.useCallback(c=>{var d;if(a){const f=Di(c)?c(e):c;f!==e&&((d=o.current)==null||d.call(o,f))}else r(c)},[a,e,r,o]);return[l,u]}function Ri({defaultProp:e,onChange:t}){const[n,s]=x.useState(e),i=x.useRef(n),r=x.useRef(t);return Pi(()=>{r.current=t},[t]),x.useEffect(()=>{var o;i.current!==n&&((o=r.current)==null||o.call(r,n),i.current=n)},[n,i]),[n,s,r]}function Di(e){return typeof e=="function"}const Fi=w.createContext({});function Oi(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Pn=typeof window<"u",ki=Pn?w.useLayoutEffect:w.useEffect,En=w.createContext(null);function Li(e,t){e.indexOf(t)===-1&&e.push(t)}function Ii(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const H=(e,t,n)=>n>t?t:n<e?e:n;function Ge(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let ye=()=>{},Z=()=>{};var wn;typeof process<"u"&&((wn=process.env)==null?void 0:wn.NODE_ENV)!=="production"&&(ye=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Ge(t,n))},Z=(e,t,n)=>{if(!e)throw new Error(Ge(t,n))});const W={},Rn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Bi(e){return typeof e=="object"&&e!==null}const Dn=e=>/^0[^.\s]+$/u.test(e);function Fn(e){let t;return()=>(t===void 0&&(t=e()),t)}const re=e=>e,Ni=(e,t)=>n=>t(e(n)),Fe=(...e)=>e.reduce(Ni),On=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class kn{constructor(){this.subscriptions=[]}add(t){return Li(this.subscriptions,t),()=>Ii(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const K=e=>e*1e3,B=e=>e/1e3;function Ln(e,t){return t?e*(1e3/t):0}const Wt=new Set;function In(e,t,n){e||Wt.has(t)||(console.warn(Ge(t,n)),Wt.add(t))}const Bn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ji=1e-7,Ki=12;function Wi(e,t,n,s,i){let r,o,a=0;do o=t+(n-t)/2,r=Bn(o,s,i)-e,r>0?n=o:t=o;while(Math.abs(r)>ji&&++a<Ki);return o}function be(e,t,n,s){if(e===t&&n===s)return re;const i=r=>Wi(r,0,1,e,n);return r=>r===0||r===1?r:Bn(i(r),t,s)}const Nn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,jn=e=>t=>1-e(1-t),Kn=be(.33,1.53,.69,.99),pt=jn(Kn),Wn=Nn(pt),$n=e=>(e*=2)<1?.5*pt(e):.5*(2-Math.pow(2,-10*(e-1))),mt=e=>1-Math.sin(Math.acos(e)),$i=jn(mt),_n=Nn(mt),_i=be(.42,0,1,1),Hi=be(0,0,.58,1),Hn=be(.42,0,.58,1),Ui=e=>Array.isArray(e)&&typeof e[0]!="number",Un=e=>Array.isArray(e)&&typeof e[0]=="number",$t={linear:re,easeIn:_i,easeInOut:Hn,easeOut:Hi,circIn:mt,circInOut:_n,circOut:$i,backIn:pt,backInOut:Wn,backOut:Kn,anticipate:$n},Gi=e=>typeof e=="string",_t=e=>{if(Un(e)){Z(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,i]=e;return be(t,n,s,i)}else if(Gi(e))return Z($t[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),$t[e];return e},we=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zi(e,t){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),e()),c(a)}const u={schedule:(c,d=!1,f=!1)=>{const p=f&&i?n:s;return d&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(a=c,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,r&&(r=!1,u.process(c))}};return u}const qi=40;function Gn(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=we.reduce((v,A)=>(v[A]=zi(r),v),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:f,render:h,postRender:p}=o,b=()=>{const v=W.useManualTiming?i.timestamp:performance.now();n=!1,W.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,qi),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),h.process(i),p.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(b))},y=()=>{n=!0,s=!0,i.isProcessing||e(b)};return{schedule:we.reduce((v,A)=>{const T=o[A];return v[A]=(P,C=!1,V=!1)=>(n||y(),T.schedule(P,C,V)),v},{}),cancel:v=>{for(let A=0;A<we.length;A++)o[we[A]].cancel(v)},state:i,steps:o}}const{schedule:j,cancel:ze,state:Ce}=Gn(typeof requestAnimationFrame<"u"?requestAnimationFrame:re,!0);let Se;function Yi(){Se=void 0}const L={now:()=>(Se===void 0&&L.set(Ce.isProcessing||W.useManualTiming?Ce.timestamp:performance.now()),Se),set:e=>{Se=e,queueMicrotask(Yi)}},zn=e=>t=>typeof t=="string"&&t.startsWith(e),qn=zn("--"),Xi=zn("var(--"),gt=e=>Xi(e)?Zi.test(e.split("/*")[0].trim()):!1,Zi=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ht(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const oe={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},he={...oe,transform:e=>H(0,1,e)},xe={...oe,default:1},de=e=>Math.round(e*1e5)/1e5,yt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ji(e){return e==null}const Qi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bt=(e,t)=>n=>!!(typeof n=="string"&&Qi.test(n)&&n.startsWith(e)||t&&!Ji(n)&&Object.prototype.hasOwnProperty.call(n,t)),Yn=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(yt);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},er=e=>H(0,255,e),Be={...oe,transform:e=>Math.round(er(e))},z={test:bt("rgb","red"),parse:Yn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Be.transform(e)+", "+Be.transform(t)+", "+Be.transform(n)+", "+de(he.transform(s))+")"};function tr(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const qe={test:bt("#"),parse:tr,transform:z.transform},ve=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$=ve("deg"),se=ve("%"),g=ve("px"),nr=ve("vh"),sr=ve("vw"),Ut={...se,parse:e=>se.parse(e)/100,transform:e=>se.transform(e*100)},ee={test:bt("hsl","hue"),parse:Yn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+se.transform(de(t))+", "+se.transform(de(n))+", "+de(he.transform(s))+")"},R={test:e=>z.test(e)||qe.test(e)||ee.test(e),parse:e=>z.test(e)?z.parse(e):ee.test(e)?ee.parse(e):qe.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?z.transform(e):ee.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},ir=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(yt))==null?void 0:t.length)||0)+(((n=e.match(ir))==null?void 0:n.length)||0)>0}const Xn="number",Zn="color",or="var",ar="var(",Gt="${}",cr=/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 pe(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=t.replace(cr,l=>(R.test(l)?(s.color.push(r),i.push(Zn),n.push(R.parse(l))):l.startsWith(ar)?(s.var.push(r),i.push(or),n.push(l)):(s.number.push(r),i.push(Xn),n.push(parseFloat(l))),++r,Gt)).split(Gt);return{values:n,split:a,indexes:s,types:i}}function Jn(e){return pe(e).values}function Qn(e){const{split:t,types:n}=pe(e),s=t.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=t[o],i[o]!==void 0){const a=n[o];a===Xn?r+=de(i[o]):a===Zn?r+=R.transform(i[o]):r+=i[o]}return r}}const ur=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e;function lr(e){const t=Jn(e);return Qn(e)(t.map(ur))}const N={test:rr,parse:Jn,createTransformer:Qn,getAnimatableNone:lr};function Ne(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function fr({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,r=0,o=0;if(!t)i=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Ne(l,a,e+1/3),r=Ne(l,a,e),o=Ne(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Ae(e,t){return n=>n>0?t:e}const Te=(e,t,n)=>e+(t-e)*n,je=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},dr=[qe,z,ee],hr=e=>dr.find(t=>t.test(e));function zt(e){const t=hr(e);if(ye(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ee&&(n=fr(n)),n}const qt=(e,t)=>{const n=zt(e),s=zt(t);if(!n||!s)return Ae(e,t);const i={...n};return r=>(i.red=je(n.red,s.red,r),i.green=je(n.green,s.green,r),i.blue=je(n.blue,s.blue,r),i.alpha=Te(n.alpha,s.alpha,r),z.transform(i))},Ye=new Set(["none","hidden"]);function pr(e,t){return Ye.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function mr(e,t){return n=>Te(e,t,n)}function vt(e){return typeof e=="number"?mr:typeof e=="string"?gt(e)?Ae:R.test(e)?qt:br:Array.isArray(e)?es:typeof e=="object"?R.test(e)?qt:gr:Ae}function es(e,t){const n=[...e],s=n.length,i=e.map((r,o)=>vt(r)(r,t[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function gr(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=vt(e[i])(e[i],t[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function yr(e,t){const n=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const r=t.types[i],o=e.indexes[r][s[r]],a=e.values[o]??0;n[i]=a,s[r]++}return n}const br=(e,t)=>{const n=N.createTransformer(t),s=pe(e),i=pe(t);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?Ye.has(e)&&!i.values.length||Ye.has(t)&&!s.values.length?pr(e,t):Fe(es(yr(s,i),i.values),n):(ye(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ae(e,t))};function ts(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Te(e,t,n):vt(e)(e,t)}const vr=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>j.update(t,n),stop:()=>ze(t),now:()=>Ce.isProcessing?Ce.timestamp:L.now()}},ns=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let r=0;r<i;r++)s+=Math.round(e(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Me=2e4;function Tt(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Me;)t+=n,s=e.next(t);return t>=Me?1/0:t}function Tr(e,t=100,n){const s=n({...e,keyframes:[0,t]}),i=Math.min(Tt(s),Me);return{type:"keyframes",ease:r=>s.next(i*r).value/t,duration:B(i)}}const wr=5;function ss(e,t,n){const s=Math.max(t-wr,0);return Ln(n-e(s),t-s)}const E={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ke=.001;function xr({duration:e=E.duration,bounce:t=E.bounce,velocity:n=E.velocity,mass:s=E.mass}){let i,r;ye(e<=K(E.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=H(E.minDamping,E.maxDamping,o),e=H(E.minDuration,E.maxDuration,B(e)),o<1?(i=u=>{const c=u*o,d=c*e,f=c-n,h=Xe(u,o),p=Math.exp(-d);return Ke-f/h*p},r=u=>{const d=u*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(u,2)*e,p=Math.exp(-d),b=Xe(Math.pow(u,2),o);return(-i(u)+Ke>0?-1:1)*((f-h)*p)/b}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Ke+c*d},r=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=Vr(i,r,a);if(e=K(e),isNaN(l))return{stiffness:E.stiffness,damping:E.damping,duration:e};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const Sr=12;function Vr(e,t,n){let s=n;for(let i=1;i<Sr;i++)s=s-e(s)/t(s);return s}function Xe(e,t){return e*Math.sqrt(1-t*t)}const Cr=["duration","bounce"],Ar=["stiffness","damping","mass"];function Yt(e,t){return t.some(n=>e[n]!==void 0)}function Mr(e){let t={velocity:E.velocity,stiffness:E.stiffness,damping:E.damping,mass:E.mass,isResolvedFromDuration:!1,...e};if(!Yt(e,Ar)&&Yt(e,Cr))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*H(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:E.mass,stiffness:i,damping:r}}else{const n=xr({...e,velocity:0});t={...t,...n,mass:E.mass},t.isResolvedFromDuration=!0}return t}function Pe(e=E.visualDuration,t=E.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:h}=Mr({...n,velocity:-B(n.velocity||0)}),p=f||0,b=u/(2*Math.sqrt(l*c)),y=o-r,m=B(Math.sqrt(l/c)),S=Math.abs(y)<5;s||(s=S?E.restSpeed.granular:E.restSpeed.default),i||(i=S?E.restDelta.granular:E.restDelta.default);let v;if(b<1){const T=Xe(m,b);v=P=>{const C=Math.exp(-b*m*P);return o-C*((p+b*m*y)/T*Math.sin(T*P)+y*Math.cos(T*P))}}else if(b===1)v=T=>o-Math.exp(-m*T)*(y+(p+m*y)*T);else{const T=m*Math.sqrt(b*b-1);v=P=>{const C=Math.exp(-b*m*P),V=Math.min(T*P,300);return o-C*((p+b*m*y)*Math.sinh(V)+T*y*Math.cosh(V))/T}}const A={calculatedDuration:h&&d||null,next:T=>{const P=v(T);if(h)a.done=T>=d;else{let C=T===0?p:0;b<1&&(C=T===0?K(p):ss(v,T,P));const V=Math.abs(C)<=s,D=Math.abs(o-P)<=i;a.done=V&&D}return a.value=a.done?o:P,a},toString:()=>{const T=Math.min(Tt(A),Me),P=ns(C=>A.next(T*C).value,T,30);return T+"ms "+P},toTransition:()=>{}};return A}Pe.applyToOptions=e=>{const t=Tr(e,100,Pe);return e.ease=t.ease,e.duration=K(t.duration),e.type="keyframes",e};function Ze({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=V=>a!==void 0&&V<a||l!==void 0&&V>l,p=V=>a===void 0?l:l===void 0||Math.abs(a-V)<Math.abs(l-V)?a:l;let b=n*t;const y=d+b,m=o===void 0?y:o(y);m!==y&&(b=m-d);const S=V=>-b*Math.exp(-V/s),v=V=>m+S(V),A=V=>{const D=S(V),O=v(V);f.done=Math.abs(D)<=u,f.value=f.done?m:O};let T,P;const C=V=>{h(f.value)&&(T=V,P=Pe({keyframes:[f.value,p(f.value)],velocity:ss(v,V,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:V=>{let D=!1;return!P&&T===void 0&&(D=!0,A(V),C(V)),T!==void 0&&V>=T?P.next(V-T):(!D&&A(V),f)}}}function Pr(e,t,n){const s=[],i=n||W.mix||ts,r=e.length-1;for(let o=0;o<r;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||re:t;a=Fe(l,a)}s.push(a)}return s}function Er(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const r=e.length;if(Z(r===t.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Pr(t,s,i),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const f=On(e[d],e[d+1],c);return a[d](f)};return n?c=>u(H(e[0],e[r-1],c)):u}function Rr(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=On(0,t,s);e.push(Te(n,1,i))}}function Dr(e){const t=[0];return Rr(t,e.length-1),t}function Fr(e,t){return e.map(n=>n*t)}function Or(e,t){return e.map(()=>t||Hn).splice(0,e.length-1)}function te({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=Ui(s)?s.map(_t):_t(s),r={done:!1,value:t[0]},o=Fr(n&&n.length===t.length?n:Dr(t),e),a=Er(o,t,{ease:Array.isArray(i)?i:Or(t,i)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}const kr=e=>e!==null;function wt(e,{repeat:t,repeatType:n="loop"},s,i=1){const r=e.filter(kr),a=i<0||t&&n!=="loop"&&t%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Lr={decay:Ze,inertia:Ze,tween:te,keyframes:te,spring:Pe};function is(e){typeof e.type=="string"&&(e.type=Lr[e.type])}class xt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Ir=e=>e/100;class St extends xt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==L.now()&&this.tick(L.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;is(t);const{type:n=te,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=t;let{keyframes:a}=t;const l=n||te;process.env.NODE_ENV!=="production"&&l!==te&&Z(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==te&&typeof a[0]!="number"&&(this.mixKeyframes=Fe(Ir,ts(a[0],a[1])),a=[0,100]);const u=l({...t,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Tt(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:d,repeatType:f,repeatDelay:h,type:p,onUpdate:b,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const m=this.currentTime-u*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?m<0:m>i;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,A=s;if(d){const V=Math.min(this.currentTime,i)/a;let D=Math.floor(V),O=V%1;!O&&V>=1&&(O=1),O===1&&D--,D=Math.min(D,d+1),!!(D%2)&&(f==="reverse"?(O=1-O,h&&(O-=h/a)):f==="mirror"&&(A=o)),v=H(0,1,O)*a}const T=S?{done:!1,value:c[0]}:A.next(v);r&&(T.value=r(T.value));let{done:P}=T;!S&&l!==null&&(P=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return C&&p!==Ze&&(T.value=wt(c,this.options,y,this.speed)),b&&b(T.value),C&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return B(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(this.currentTime)}set time(t){var n;t=K(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(L.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=B(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:t=vr,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(L.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Br(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const q=e=>e*180/Math.PI,Je=e=>{const t=q(Math.atan2(e[1],e[0]));return Qe(t)},Nr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Je,rotateZ:Je,skewX:e=>q(Math.atan(e[1])),skewY:e=>q(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Qe=e=>(e=e%360,e<0&&(e+=360),e),Xt=Je,Zt=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Jt=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),jr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zt,scaleY:Jt,scale:e=>(Zt(e)+Jt(e))/2,rotateX:e=>Qe(q(Math.atan2(e[6],e[5]))),rotateY:e=>Qe(q(Math.atan2(-e[2],e[0]))),rotateZ:Xt,rotate:Xt,skewX:e=>q(Math.atan(e[4])),skewY:e=>q(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function et(e){return e.includes("scale")?1:0}function tt(e,t){if(!e||e==="none")return et(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=jr,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Nr,i=a}if(!i)return et(t);const r=s[t],o=i[1].split(",").map(Wr);return typeof r=="function"?r(o):o[r]}const Kr=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return tt(n,t)};function Wr(e){return parseFloat(e.trim())}const ae=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ce=new Set(ae),Qt=e=>e===oe||e===g,$r=new Set(["x","y","z"]),_r=ae.filter(e=>!$r.has(e));function Hr(e){const t=[];return _r.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const _={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>tt(t,"x"),y:(e,{transform:t})=>tt(t,"y")};_.translateX=_.x;_.translateY=_.y;const Y=new Set;let nt=!1,st=!1,it=!1;function rs(){if(st){const e=Array.from(Y).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=Hr(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}st=!1,nt=!1,Y.forEach(e=>e.complete(it)),Y.clear()}function os(){Y.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(st=!0)})}function Ur(){it=!0,os(),rs(),it=!1}class Vt{constructor(t,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Y.add(this),nt||(nt=!0,j.read(os),j.resolveKeyframes(rs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;if(t[0]===null){const r=i==null?void 0:i.get(),o=t[t.length-1];if(r!==void 0)t[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&r===void 0&&i.set(t[0])}Br(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Y.delete(this)}cancel(){this.state==="scheduled"&&(Y.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Gr=e=>e.startsWith("--");function zr(e,t,n){Gr(t)?e.style.setProperty(t,n):e.style[t]=n}const qr={};function as(e,t){const n=Fn(e);return()=>qr[t]??n()}const Yr=as(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),cs=as(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),fe=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,en={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fe([0,.65,.55,1]),circOut:fe([.55,0,1,.45]),backIn:fe([.31,.01,.66,-.59]),backOut:fe([.33,1.53,.69,.99])};function us(e,t){if(e)return typeof e=="function"?cs()?ns(e,t):"ease-out":Un(e)?fe(e):Array.isArray(e)?e.map(n=>us(n,t)||en.easeOut):en[e]}function Xr(e,t,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const d=us(a,i);Array.isArray(d)&&(c.easing=d);const f={delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(c,f)}function ls(e){return typeof e=="function"&&"applyToOptions"in e}function Zr({type:e,...t}){return ls(e)&&cs()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class fs extends xt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=t,Z(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Zr(t);this.animation=Xr(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=wt(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):zr(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return B(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=K(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Yr()?(this.animation.timeline=t,re):n(this)}}const ds={anticipate:$n,backInOut:Wn,circInOut:_n};function Jr(e){return e in ds}function Qr(e){typeof e.ease=="string"&&Jr(e.ease)&&(e.ease=ds[e.ease])}const We=10;class eo extends fs{constructor(t){Qr(t),is(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new St({...o,autoplay:!1}),l=Math.max(We,L.now()-this.startTime),u=H(0,We,l-We);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const tn=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(N.test(e)||e==="0")&&!e.startsWith("url("));function to(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function no(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=e[e.length-1],o=tn(i,t),a=tn(r,t);return ye(o===a,`You are trying to animate ${t} from "${i}" to "${r}". "${o?r:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:to(e)||(n==="spring"||ls(n))&&s}function rt(e){e.duration=0,e.type="keyframes"}const so=new Set(["opacity","clipPath","filter","transform"]),io=Fn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ro(e){var c;const{motionValue:t,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=e;if(!(((c=t==null?void 0:t.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return io()&&n&&so.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const oo=40;class ao extends xt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:c,...d}){var p;super(),this.stop=()=>{var b,y;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=L.now();const f={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:u,element:c,...d},h=(c==null?void 0:c.KeyframeResolver)||Vt;this.keyframeResolver=new h(a,(b,y,m)=>this.onKeyframesResolved(b,y,f,!m),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(t,n,s,i){var y,m;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=L.now(),no(t,r,o,a)||((W.instantAnimations||!l)&&(c==null||c(wt(t,s,n))),t[0]=t[t.length-1],rt(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>oo?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!u&&ro(f),p=(m=(y=f.motionValue)==null?void 0:y.owner)==null?void 0:m.current,b=h?new eo({...f,element:p}):new St(f);b.finished.then(()=>{this.notifyFinished()}).catch(re),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ur()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function hs(e,t,n,s=0,i=1){const r=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),o=e.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const co=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uo(e){const t=co.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}const lo=4;function ps(e,t,n=1){Z(n<=lo,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,i]=uo(e);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const o=r.trim();return Rn(o)?parseFloat(o):o}return gt(i)?ps(i,t,n+1):i}const fo={type:"spring",stiffness:500,damping:25,restSpeed:10},ho=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),po={type:"keyframes",duration:.8},mo={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},go=(e,{keyframes:t})=>t.length>2?po:ce.has(e)?e.startsWith("scale")?ho(t[1]):fo:mo,yo=e=>e!==null;function bo(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(yo),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}function ms(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function gs(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?ms(n,e):n}function vo({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const To=(e,t,n,s={},i,r)=>o=>{const a=gs(s,e)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-K(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:r?void 0:i};vo(a)||Object.assign(c,go(e,c)),c.duration&&(c.duration=K(c.duration)),c.repeatDelay&&(c.repeatDelay=K(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(rt(c),c.delay===0&&(d=!0)),(W.instantAnimations||W.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(d=!0,rt(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,d&&!r&&t.get()!==void 0){const f=bo(c.keyframes,a);if(f!==void 0){j.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new St(c):new ao(c)};function nn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Ct(e,t,n,s){if(typeof t=="function"){const[i,r]=nn(s);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=nn(s);t=t(n!==void 0?n:e.custom,i,r)}return t}function ie(e,t,n){const s=e.getProps();return Ct(s,t,n!==void 0?n:s.custom,e)}const ys=new Set(["width","height","top","left","right","bottom",...ae]),sn=30,wo=e=>!isNaN(parseFloat(e));class xo{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var r;const i=L.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=L.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=wo(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&In(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new kn);const s=this.events[t].add(n);return t==="change"?()=>{s(),j.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=L.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>sn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,sn);return Ln(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ee(e,t){return new xo(e,t)}const ot=e=>Array.isArray(e);function So(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ee(n))}function Vo(e){return ot(e)?e[e.length-1]||0:e}function Co(e,t){const n=ie(e,t);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Vo(r[o]);So(e,o,a)}}const k=e=>!!(e&&e.getVelocity);function Ao(e){return!!(k(e)&&e.add)}function Mo(e,t){const n=e.getValue("willChange");if(Ao(n))return n.add(t);if(!n&&W.WillChange){const s=new W.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function At(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Po="framerAppearId",bs="data-"+At(Po);function Eo(e){return e.props[bs]}function Ro({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function vs(e,t,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();r=r?ms(r,l):l;const u=r==null?void 0:r.reduceMotion;s&&(r=s);const c=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in a){const h=e.getValue(f,e.latestValues[f]??null),p=a[f];if(p===void 0||d&&Ro(d,f))continue;const b={delay:n,...gs(r||{},f)},y=h.get();if(y!==void 0&&!h.isAnimating&&!Array.isArray(p)&&p===y&&!b.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const A=Eo(e);if(A){const T=window.MotionHandoffAnimation(A,f,j);T!==null&&(b.startTime=T,m=!0)}}Mo(e,f);const S=u??e.shouldReduceMotion;h.start(To(f,h,p,S&&ys.has(f)?{type:!1}:b,e,m));const v=h.animation;v&&c.push(v)}if(o){const f=()=>j.update(()=>{o&&Co(e,o)});c.length?Promise.all(c).then(f):f()}return c}function at(e,t,n={}){var l;const s=ie(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(vs(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=i;return Do(e,t,u,c,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function Do(e,t,n=0,s=0,i=0,r=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(at(l,t,{...o,delay:n+(typeof s=="function"?0:s)+hs(e.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Fo(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(r=>at(e,r,n));s=Promise.all(i)}else if(typeof t=="string")s=at(e,t,n);else{const i=typeof t=="function"?ie(e,t,n.custom):t;s=Promise.all(vs(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Oo={test:e=>e==="auto",parse:e=>e},Ts=e=>t=>t.test(e),ws=[oe,g,se,$,sr,nr,Oo],rn=e=>ws.find(Ts(e));function ko(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Dn(e):!0}const Lo=new Set(["brightness","contrast","saturate","opacity"]);function Io(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(yt)||[];if(!s)return e;const i=n.replace(s,"");let r=Lo.has(t)?1:0;return s!==n&&(r*=100),t+"("+r+i+")"}const Bo=/\b([a-z-]*)\(.*?\)/gu,ct={...N,getAnimatableNone:e=>{const t=e.match(Bo);return t?t.map(Io).join(" "):e}},ut={...N,getAnimatableNone:e=>{const t=N.parse(e);return N.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},on={...oe,transform:Math.round},No={rotate:$,rotateX:$,rotateY:$,rotateZ:$,scale:xe,scaleX:xe,scaleY:xe,scaleZ:xe,skew:$,skewX:$,skewY:$,distance:g,translateX:g,translateY:g,translateZ:g,x:g,y:g,z:g,perspective:g,transformPerspective:g,opacity:he,originX:Ut,originY:Ut,originZ:g},Mt={borderWidth:g,borderTopWidth:g,borderRightWidth:g,borderBottomWidth:g,borderLeftWidth:g,borderRadius:g,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomRightRadius:g,borderBottomLeftRadius:g,width:g,maxWidth:g,height:g,maxHeight:g,top:g,right:g,bottom:g,left:g,inset:g,insetBlock:g,insetBlockStart:g,insetBlockEnd:g,insetInline:g,insetInlineStart:g,insetInlineEnd:g,padding:g,paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g,paddingBlock:g,paddingBlockStart:g,paddingBlockEnd:g,paddingInline:g,paddingInlineStart:g,paddingInlineEnd:g,margin:g,marginTop:g,marginRight:g,marginBottom:g,marginLeft:g,marginBlock:g,marginBlockStart:g,marginBlockEnd:g,marginInline:g,marginInlineStart:g,marginInlineEnd:g,fontSize:g,backgroundPositionX:g,backgroundPositionY:g,...No,zIndex:on,fillOpacity:he,strokeOpacity:he,numOctaves:on},jo={...Mt,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ct,WebkitFilter:ct,mask:ut,WebkitMask:ut},xs=e=>jo[e],Ko=new Set([ct,ut]);function Ss(e,t){let n=xs(e);return Ko.has(n)||(n=N),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Wo=new Set(["auto","none","0"]);function $o(e,t,n){let s=0,i;for(;s<e.length&&!i;){const r=e[s];typeof r=="string"&&!Wo.has(r)&&pe(r).values.length&&(i=e[s]),s++}if(i&&n)for(const r of t)e[r]=Ss(n,i)}class _o extends Vt{constructor(t,n,s,i,r){super(t,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),gt(d))){const f=ps(d,n.current);f!==void 0&&(t[c]=f),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!ys.has(s)||t.length!==2)return;const[i,r]=t,o=rn(i),a=rn(r),l=Ht(i),u=Ht(r);if(l!==u&&_[s]){this.needsMeasurement=!0;return}if(o!==a)if(Qt(o)&&Qt(a))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else _[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)(t[i]===null||ko(t[i]))&&s.push(i);s.length&&$o(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=_[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Ho=new Set(["opacity","clipPath","filter","transform"]);function Uo(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const i=(n==null?void 0:n[e])??s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(s=>s!=null)}const Vs=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Go(e){return Bi(e)&&"offsetHeight"in e}const{schedule:zo}=Gn(queueMicrotask,!1),qo={y:!1};function Yo(){return qo.y}function Cs(e,t){const n=Uo(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function Xo(e){return!(e.pointerType==="touch"||Yo())}function Zo(e,t,n={}){const[s,i,r]=Cs(e,n);return s.forEach(o=>{let a=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",p)},d=y=>{u&&(u(y),u=void 0),c()},f=y=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,d(y))},h=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=y=>{if(y.pointerType!=="touch"){if(a){l=!0;return}d(y)}},b=y=>{if(!Xo(y))return;l=!1;const m=t(o,y);typeof m=="function"&&(u=m,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",b,i),o.addEventListener("pointerdown",h,i)}),r}const As=(e,t)=>t?e===t?!0:As(e,t.parentElement):!1,Jo=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Qo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ea(e){return Qo.has(e.tagName)||e.isContentEditable===!0}const Ve=new WeakSet;function an(e){return t=>{t.key==="Enter"&&e(t)}}function $e(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ta=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=an(()=>{if(Ve.has(n))return;$e(n,"down");const i=an(()=>{$e(n,"up")}),r=()=>$e(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",r,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function cn(e){return Jo(e)&&!0}const un=new WeakSet;function na(e,t,n={}){const[s,i,r]=Cs(e,n),o=a=>{const l=a.currentTarget;if(!cn(a)||un.has(a))return;Ve.add(l),n.stopPropagation&&un.add(a);const u=t(l,a),c=(h,p)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Ve.has(l)&&Ve.delete(l),cn(h)&&typeof u=="function"&&u(h,{success:p})},d=h=>{c(h,l===window||l===document||n.useGlobalTarget||As(l,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Go(a)&&(a.addEventListener("focus",u=>ta(u,i)),!ea(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}const sa=[...ws,R,N],ia=e=>sa.find(Ts(e)),ln=()=>({min:0,max:0}),Ms=()=>({x:ln(),y:ln()}),ra=new WeakMap;function Oe(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function me(e){return typeof e=="string"||Array.isArray(e)}const Pt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Et=["initial",...Pt];function ke(e){return Oe(e.animate)||Et.some(t=>me(e[t]))}function Ps(e){return!!(ke(e)||e.variants)}function oa(e,t,n){for(const s in t){const i=t[s],r=n[s];if(k(i))e.addValue(s,i);else if(k(r))e.addValue(s,Ee(i,{owner:e}));else if(r!==i)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(s);e.addValue(s,Ee(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const lt={current:null},Es={current:!1},aa=typeof window<"u";function ca(){if(Es.current=!0,!!aa)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lt.current=e.matches;e.addEventListener("change",t),t()}else lt.current=!1}const fn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Re={};function Rs(e){Re=e}function ua(){return Re}class la{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Vt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=L.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,j.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=ke(n),this.isVariantNode=Ps(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const p=f[h];u[h]!==void 0&&k(p)&&p.set(u[h])}}mount(t){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,ra.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,r)=>this.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Es.current||ca(),this.shouldReduceMotion=lt.current),process.env.NODE_ENV!=="production"&&In(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ze(this.notifyUpdate),ze(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Ho.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:c}=n.accelerate,d=new fs({element:this.current,name:t,keyframes:a,times:l,ease:u,duration:K(c)}),f=o(d);this.valueSubscriptions.set(t,()=>{f(),d.cancel()});return}const s=ce.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&j.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Re){const n=Re[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ms()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<fn.length;s++){const i=fn[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=t[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=oa(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Ee(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Rn(s)||Dn(s))?s=parseFloat(s):!ia(s)&&N.test(n)&&(s=Ss(t,n)),this.setBaseTarget(t,k(s)?s.get():s)),k(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Ct(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!k(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zo.render(this.render)}}class Ds extends la{constructor(){super(...arguments),this.KeyframeResolver=_o}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;k(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ue{constructor(t){this.isMounted=!1,this.node=t}update(){}}function fa({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function da(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ha(e,t){return fa(da(e.getBoundingClientRect(),t))}const pa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ma=ae.length;function ga(e,t,n){let s="",i=!0;for(let r=0;r<ma;r++){const o=ae[r],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);l=o.startsWith("scale")?u===1:u===0}if(!l||n){const u=Vs(a,Mt[o]);if(!l){i=!1;const c=pa[o]||o;s+=`${c}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Rt(e,t,n){const{style:s,vars:i,transformOrigin:r}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(ce.has(l)){o=!0;continue}else if(qn(l)){i[l]=u;continue}else{const c=Vs(u,Mt[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(t.transform||(o||n?s.transform=ga(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}function Fs(e,{style:t,vars:n},s,i){const r=e.style;let o;for(o in t)r[o]=t[o];i==null||i.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function dn(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const le={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(g.test(e))e=parseFloat(e);else return e;const n=dn(e,t.target.x),s=dn(e,t.target.y);return`${n}% ${s}%`}},ya={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=N.parse(e);if(i.length>5)return s;const r=N.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=Te(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},ba={borderRadius:{...le,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:le,borderTopRightRadius:le,borderBottomLeftRadius:le,borderBottomRightRadius:le,boxShadow:ya};function Os(e,{layout:t,layoutId:n}){return ce.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ba[e]||e==="opacity")}function Dt(e,t,n){var o;const s=e.style,i=t==null?void 0:t.style,r={};if(!s)return r;for(const a in s)(k(s[a])||i&&k(i[a])||Os(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=s[a]);return r}function va(e){return window.getComputedStyle(e)}class Ta extends Ds{constructor(){super(...arguments),this.type="html",this.renderInstance=Fs}readValueFromInstance(t,n){var s;if(ce.has(n))return(s=this.projection)!=null&&s.isProjecting?et(n):Kr(t,n);{const i=va(t),r=(qn(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ha(t,n)}build(t,n,s){Rt(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Dt(t,n,s)}}const wa={offset:"stroke-dashoffset",array:"stroke-dasharray"},xa={offset:"strokeDashoffset",array:"strokeDasharray"};function Sa(e,t,n=1,s=0,i=!0){e.pathLength=1;const r=i?wa:xa;e[r.offset]=`${-s}`,e[r.array]=`${t} ${n}`}const Va=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ks(e,{attrX:t,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(Rt(e,a,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox);for(const h of Va)d[h]!==void 0&&(f[h]=d[h],delete d[h]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),i!==void 0&&Sa(d,i,r,o,!1)}const Ls=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"]),Is=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ca(e,t,n,s){Fs(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(Ls.has(i)?i:At(i),t.attrs[i])}function Bs(e,t,n){const s=Dt(e,t,n);for(const i in e)if(k(e[i])||k(t[i])){const r=ae.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=e[i]}return s}class Aa extends Ds{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ms}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ce.has(n)){const s=xs(n);return s&&s.default||0}return n=Ls.has(n)?n:At(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Bs(t,n,s)}build(t,n,s){ks(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,i){Ca(t,n,s,i)}mount(t){this.isSVGTag=Is(t.tagName),super.mount(t)}}const Ma=Et.length;function Ns(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ns(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ma;n++){const s=Et[n],i=e.props[s];(me(i)||i===!1)&&(t[s]=i)}return t}function js(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Pa=[...Pt].reverse(),Ea=Pt.length;function Ra(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Fo(e,n,s)))}function Da(e){let t=Ra(e),n=hn(),s=!0;const i=l=>(u,c)=>{var f;const d=ie(e,c,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:p,...b}=d;u={...u,...b,...p}}return u};function r(l){t=l(e)}function o(l){const{props:u}=e,c=Ns(e.parent)||{},d=[],f=new Set;let h={},p=1/0;for(let y=0;y<Ea;y++){const m=Pa[y],S=n[m],v=u[m]!==void 0?u[m]:c[m],A=me(v),T=m===l?S.isActive:null;T===!1&&(p=y);let P=v===c[m]&&v!==u[m]&&A;if(P&&s&&e.manuallyAnimateOnMount&&(P=!1),S.protectedKeys={...h},!S.isActive&&T===null||!v&&!S.prevProp||Oe(v)||typeof v=="boolean")continue;if(m==="exit"&&S.isActive&&T!==!0){S.prevResolvedValues&&(h={...h,...S.prevResolvedValues});continue}const C=Fa(S.prevProp,v);let V=C||m===l&&S.isActive&&!P&&A||y>p&&A,D=!1;const O=Array.isArray(v)?v:[v];let J=O.reduce(i(m),{});T===!1&&(J={});const{prevResolvedValues:Lt={}}=S,Zs={...Lt,...J},It=F=>{V=!0,f.has(F)&&(D=!0,f.delete(F)),S.needsAnimating[F]=!0;const I=e.getValue(F);I&&(I.liveStyle=!1)};for(const F in Zs){const I=J[F],U=Lt[F];if(h.hasOwnProperty(F))continue;let Q=!1;ot(I)&&ot(U)?Q=!js(I,U):Q=I!==U,Q?I!=null?It(F):f.add(F):I!==void 0&&f.has(F)?It(F):S.protectedKeys[F]=!0}S.prevProp=v,S.prevResolvedValues=J,S.isActive&&(h={...h,...J}),s&&e.blockInitialAnimation&&(V=!1);const Bt=P&&C;V&&(!Bt||D)&&d.push(...O.map(F=>{const I={type:m};if(typeof F=="string"&&s&&!Bt&&e.manuallyAnimateOnMount&&e.parent){const{parent:U}=e,Q=ie(U,F);if(U.enteringChildren&&Q){const{delayChildren:Js}=Q.transition||{};I.delay=hs(U.enteringChildren,e,Js)}}return{animation:F,options:I}}))}if(f.size){const y={};if(typeof u.initial!="boolean"){const m=ie(e,Array.isArray(u.initial)?u.initial[0]:u.initial);m&&m.transition&&(y.transition=m.transition)}f.forEach(m=>{const S=e.getBaseTarget(m),v=e.getValue(m);v&&(v.liveStyle=!0),y[m]=S??null}),d.push({animation:y})}let b=!!d.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(d):Promise.resolve()}function a(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(l,u)}),n[l].isActive=u;const c=o(l);for(const f in n)n[f].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=hn()}}}function Fa(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!js(t,e):!1}function G(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hn(){return{animate:G(!0),whileInView:G(),whileHover:G(),whileTap:G(),whileDrag:G(),whileFocus:G(),exit:G()}}function pn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Oa(e){return k(e)?e.get():e}const Ks=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Ft=w.createContext({strict:!1}),mn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let gn=!1;function ka(){if(gn)return;const e={};for(const t in mn)e[t]={isEnabled:n=>mn[t].some(s=>!!n[s])};Rs(e),gn=!0}function Ws(){return ka(),ua()}function yn(e){const t=Ws();for(const n in e)t[n]={...t[n],...e[n]};Rs(t)}function La({children:e,features:t,strict:n=!1}){const[,s]=w.useState(!_e(t)),i=w.useRef(void 0);if(!_e(t)){const{renderer:r,...o}=t;i.current=r,yn(o)}return w.useEffect(()=>{_e(t)&&t().then(({renderer:r,...o})=>{yn(o),i.current=r,s(!0)})},[]),M.jsx(Ft.Provider,{value:{renderer:i.current,strict:n},children:e})}function _e(e){return typeof e=="function"}const Ia=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function De(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ia.has(e)}let $s=e=>!De(e);function Ba(e){typeof e=="function"&&($s=t=>t.startsWith("on")?!De(t):e(t))}try{Ba(require("@emotion/is-prop-valid").default)}catch{}function Na(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||($s(i)||n===!0&&De(i)||!t&&!De(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}const Le=w.createContext({});function ja(e,t){if(ke(e)){const{initial:n,animate:s}=e;return{initial:n===!1||me(n)?n:void 0,animate:me(s)?s:void 0}}return e.inherit!==!1?t:{}}function Ka(e){const{initial:t,animate:n}=ja(e,w.useContext(Le));return w.useMemo(()=>({initial:t,animate:n}),[bn(t),bn(n)])}function bn(e){return Array.isArray(e)?e.join(" "):e}const Ot=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _s(e,t,n){for(const s in t)!k(t[s])&&!Os(s,n)&&(e[s]=t[s])}function Wa({transformTemplate:e},t){return w.useMemo(()=>{const n=Ot();return Rt(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $a(e,t){const n=e.style||{},s={};return _s(s,n,e),Object.assign(s,Wa(e,t)),s}function _a(e,t){const n={},s=$a(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Hs=()=>({...Ot(),attrs:{}});function Ha(e,t,n,s){const i=w.useMemo(()=>{const r=Hs();return ks(r,t,Is(s),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};_s(r,e.style,e),i.style={...r,...i.style}}return i}const Ua=["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 kt(e){return typeof e!="string"||e.includes("-")?!1:!!(Ua.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ga(e,t,n,{latestValues:s},i,r=!1,o){const l=(o??kt(e)?Ha:_a)(t,s,i,e),u=Na(t,typeof e=="string",r),c=e!==w.Fragment?{...u,...l,ref:n}:{},{children:d}=t,f=w.useMemo(()=>k(d)?d.get():d,[d]);return w.createElement(e,{...c,children:f})}function za({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,i){return{latestValues:qa(n,s,i,e),renderState:t()}}function qa(e,t,n,s){const i={},r=s(e,{});for(const f in r)i[f]=Oa(r[f]);let{initial:o,animate:a}=e;const l=ke(e),u=Ps(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;if(d&&typeof d!="boolean"&&!Oe(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const p=Ct(e,f[h]);if(p){const{transitionEnd:b,transition:y,...m}=p;for(const S in m){let v=m[S];if(Array.isArray(v)){const A=c?v.length-1:0;v=v[A]}v!==null&&(i[S]=v)}for(const S in b)i[S]=b[S]}}}return i}const Us=e=>(t,n)=>{const s=w.useContext(Le),i=w.useContext(En),r=()=>za(e,t,s,i);return n?r():Oi(r)},Ya=Us({scrapeMotionValuesFromProps:Dt,createRenderState:Ot}),Xa=Us({scrapeMotionValuesFromProps:Bs,createRenderState:Hs}),Za=Symbol.for("motionComponentSymbol");function Ja(e,t,n){const s=w.useRef(n);w.useInsertionEffect(()=>{s.current=n});const i=w.useRef(null);return w.useCallback(r=>{var a;r&&((a=e.onMount)==null||a.call(e,r)),t&&(r?t.mount(r):t.unmount());const o=s.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[t])}const Qa=w.createContext({});function ec(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function tc(e,t,n,s,i,r){var v,A;const{visualElement:o}=w.useContext(Le),a=w.useContext(Ft),l=w.useContext(En),u=w.useContext(Ks),c=u.reducedMotion,d=u.skipAnimations,f=w.useRef(null),h=w.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:d,isSVG:r}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,b=w.useContext(Qa);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&nc(f.current,n,i,b);const y=w.useRef(!1);w.useInsertionEffect(()=>{p&&y.current&&p.update(n,l)});const m=n[bs],S=w.useRef(!!m&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,m))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,m)));return ki(()=>{h.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),S.current&&p.animationState&&p.animationState.animateChanges())}),w.useEffect(()=>{p&&(!S.current&&p.animationState&&p.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,m)}),S.current=!1),p.enteringChildren=void 0)}),p}function nc(e,t,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Gs(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&ec(a),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function Gs(e){if(e)return e.options.allowProjection!==!1?e.projection:Gs(e.parent)}function sc(e,{forwardMotionProps:t=!1,type:n}={},s,i){const r=n?n==="svg":kt(e),o=r?Xa:Ya;function a(u,c){let d;const f={...w.useContext(Ks),...u,layoutId:ic(u)},{isStatic:h}=f,p=Ka(u),b=o(u,h);if(!h&&Pn){rc(f,s);const y=oc(f);d=y.MeasureLayout,p.visualElement=tc(e,b,f,i,y.ProjectionNode,r)}return M.jsxs(Le.Provider,{value:p,children:[d&&p.visualElement?M.jsx(d,{visualElement:p.visualElement,...f}):null,Ga(e,u,Ja(b,p.visualElement,c),b,h,t,r)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=w.forwardRef(a);return l[Za]=e,l}function ic({layoutId:e}){const t=w.useContext(Fi).id;return t&&e!==void 0?t+"-"+e:e}function rc(e,t){w.useContext(Ft).strict,process.env.NODE_ENV}function oc(e){const t=Ws(),{drag:n,layout:s}=t;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(e)||s!=null&&s.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const ac=(e,t)=>t.isSVG??kt(e)?new Aa(t):new Ta(t,{allowProjection:e!==w.Fragment});class cc extends ue{constructor(t){super(t),t.animationState||(t.animationState=Da(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Oe(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let uc=0;class lc extends ue{constructor(){super(...arguments),this.id=uc++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const fc={animation:{Feature:cc},exit:{Feature:lc}};function zs(e){return{point:{x:e.pageX,y:e.pageY}}}function vn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&j.postRender(()=>r(t,zs(t)))}class dc extends ue{mount(){const{current:t}=this.node;t&&(this.unmount=Zo(t,(n,s)=>(vn(this.node,s,"Start"),i=>vn(this.node,i,"End"))))}unmount(){}}class hc extends ue{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Fe(pn(this.node.current,"focus",()=>this.onFocus()),pn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Tn(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&j.postRender(()=>r(t,zs(t)))}class pc extends ue{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=na(t,(i,r)=>(Tn(this.node,r,"Start"),(o,{success:a})=>Tn(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const ft=new WeakMap,He=new WeakMap,mc=e=>{const t=ft.get(e.target);t&&t(e)},gc=e=>{e.forEach(mc)};function yc({root:e,...t}){const n=e||document;He.has(n)||He.set(n,{});const s=He.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(gc,{root:e,...t})),s[i]}function bc(e,t,n){const s=yc(t);return ft.set(e,n),s.observe(e),()=>{ft.delete(e),s.unobserve(e)}}const vc={some:0,all:1};class Tc extends ue{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:vc[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return bc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(wc(t,n))&&this.startObserver()}unmount(){}}function wc({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const xc={inView:{Feature:Tc},tap:{Feature:pc},focus:{Feature:hc},hover:{Feature:dc}},Sc={renderer:ac,...fc,...xc};function Vc(e,t){return sc(e,t)}const dt=Vc("div"),qs=w.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),Cc=({children:e})=>{const[t,n]=w.useState([]),s=o=>{n(a=>[...a,o])},i=o=>{n(t.filter(a=>a!==o))},r=()=>{const o=t[t.length-1];o&&i(o)};return M.jsx(qs.Provider,{value:{layers:t,setLayers:n,addLayer:s,removeLayer:i,removeTopLayer:r},children:e})},Ys=()=>w.useContext(qs),Ac=({defaultOpen:e,open:t,onOpenChange:n,...s})=>{const[i,r]=Ei({prop:t,onChange:n,defaultProp:e??!1}),o=Ys(),a=s.a11yTitle;if(w.useEffect(()=>{!i&&o.layers.includes(a)&&o.removeLayer(a)},[a,o,i]),!!i)return M.jsx(Mc,{open:i,onOpenChange:r,...s})},Mc=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:s,children:i,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,...l})=>{var b,y;const u=n,c=Ys();w.useEffect(()=>{!c||!e||c.layers.includes(u)||c.addLayer(u)},[u,c,e]);const d=((b=c.layers)==null?void 0:b.indexOf(u))||0,f=((y=c.layers)==null?void 0:y.length)||0,h=d!==0,p=u===c.layers[c.layers.length-1];return M.jsx(La,{features:Sc,children:M.jsx(An,{onEscapeKeyDown:m=>{p&&(m.preventDefault(),c.removeTopLayer(),t(!1))},onPointerDownOutside:m=>{p&&(m.preventDefault(),c.removeTopLayer(),t(!1))},children:M.jsxs(ne.Root,{open:e,onOpenChange:m=>{var v;if(((v=c==null?void 0:c.layers)==null?void 0:v.length)>0)return m===!1&&u===c.layers[c.layers.length-1]?(c.removeLayer(u),t(!1)):void 0;t(m)},children:[M.jsxs(li.Root,{children:[M.jsx(ne.Title,{children:n}),s&&M.jsx(ne.Description,{children:s})]}),e&&M.jsx(ui.Root,{className:"tgph",children:M.jsx(Pc,{layer:d,children:M.jsx(ti.FocusScope,{trapped:typeof r=="boolean"?r:p,onMountAutoFocus:o,onUnmountAutoFocus:a,asChild:!0,children:M.jsx(ri.RefToTgphRef,{children:M.jsx(X.Stack,{as:dt,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${f-1})`},animate:{top:h?`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${d} )`:"var(--tgph-spacing-16)"},exit:{top:0},transition:{type:"spring",duration:.3,bounce:0},w:"full",justify:"center",style:{position:"fixed",left:0,maxHeight:"calc(100vh - var(--tgph-spacing-32))",maxWidth:"calc(100vw - var(--tgph-spacing-8))",zIndex:`calc(var(--tgph-zIndex-modal) + ${d})`},children:M.jsx(X.Stack,{direction:"column",as:dt,animate:{scale:1.02-Math.abs(f-d)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:l.maxW??"160",w:l.w??"full",bg:"surface-1",border:"px",borderColor:"gray-8",rounded:"4",shadow:"3",...l,children:i},`content-${u}`)},`container-${u}`)})})})})]},u)})})},Pc=({layer:e,children:t})=>e>0?t:M.jsxs(ne.Overlay,{children:[M.jsx(X.Box,{as:dt,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,bounce:0,type:"spring"},bg:"alpha-black-6",w:"full",h:"full",zIndex:"overlay",style:{position:"fixed",cursor:"pointer",inset:"0px"}}),t]}),Ec=w.forwardRef(({children:e,...t},n)=>M.jsx(ne.Content,{ref:n,asChild:!0,...t,children:M.jsx(X.Stack,{direction:"column",h:"full",...t,children:e})})),Rc=({size:e="1",variant:t="ghost",...n})=>M.jsx(ne.Close,{asChild:!0,children:M.jsx(ii.Button,{icon:{icon:ai.X,alt:"Close Modal"},variant:t,size:e,...n})}),Dc=({style:e,children:t,...n})=>M.jsx(X.Stack,{direction:"column",px:"6",py:"4",style:{overflowY:"auto",...e},...n,children:t}),Fc=({children:e,...t})=>M.jsx(X.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),Oc=({children:e,...t})=>M.jsx(X.Stack,{direction:"row",align:"center",justify:"flex-end",gap:"2",px:"6",py:"4",borderTop:"px",...t,children:e}),kc=({as:e,size:t="3",weight:n="medium",...s})=>M.jsx(oi.Heading,{as:e||"h2",size:t,weight:n,...s}),Xs={};Object.assign(Xs,{Root:Ac,Content:Ec,Close:Rc,Body:Dc,Header:Fc,Footer:Oc,Heading:kc});exports.Modal=Xs;exports.ModalStackingProvider=Cc;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const M=require("react/jsx-runtime"),Qs=require("@radix-ui/react-dialog"),w=require("react"),ei=require("react-dom"),ti=require("@radix-ui/react-focus-scope"),ni=require("@radix-ui/react-portal"),si=require("@radix-ui/react-visually-hidden"),ii=require("@telegraph/button"),ri=require("@telegraph/helpers"),X=require("@telegraph/layout"),oi=require("@telegraph/typography"),ai=require("lucide-react");function ge(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ne=ge(Qs),x=ge(w),ci=ge(ei),ui=ge(ni),li=ge(si);function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Nt(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function xn(...e){return t=>{let n=!1;const s=e.map(i=>{const r=Nt(i,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let i=0;i<s.length;i++){const r=s[i];typeof r=="function"?r():Nt(e[i],null)}}}}function Sn(...e){return x.useCallback(xn(...e),e)}function fi(e){const t=di(e),n=x.forwardRef((s,i)=>{const{children:r,...o}=s,a=x.Children.toArray(r),l=a.find(pi);if(l){const u=l.props.children,c=a.map(d=>d===l?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:d);return M.jsx(t,{...o,ref:i,children:x.isValidElement(u)?x.cloneElement(u,void 0,c):null})}return M.jsx(t,{...o,ref:i,children:r})});return n.displayName=`${e}.Slot`,n}function di(e){const t=x.forwardRef((n,s)=>{const{children:i,...r}=n;if(x.isValidElement(i)){const o=gi(i),a=mi(r,i.props);return i.type!==x.Fragment&&(a.ref=s?xn(s,o):o),x.cloneElement(i,a)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hi=Symbol("radix.slottable");function pi(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hi}function mi(e,t){const n={...t};for(const s in t){const i=e[s],r=t[s];/^on[A-Z]/.test(s)?i&&r?n[s]=(...a)=>{const l=r(...a);return i(...a),l}:i&&(n[s]=i):s==="style"?n[s]={...i,...r}:s==="className"&&(n[s]=[i,r].filter(Boolean).join(" "))}return{...e,...n}}function gi(e){var s,i;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vn=yi.reduce((e,t)=>{const n=fi(`Primitive.${t}`),s=x.forwardRef((i,r)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),M.jsx(l,{...a,ref:r})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function bi(e,t){e&&ci.flushSync(()=>e.dispatchEvent(t))}function ht(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var s;return(s=t.current)==null?void 0:s.call(t,...n)},[])}function vi(e,t=globalThis==null?void 0:globalThis.document){const n=ht(e);x.useEffect(()=>{const s=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[n,t])}var Ti="DismissableLayer",Ue="dismissableLayer.update",wi="dismissableLayer.pointerDownOutside",xi="dismissableLayer.focusOutside",jt,Cn=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),An=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:r,onInteractOutside:o,onDismiss:a,...l}=e,u=x.useContext(Cn),[c,d]=x.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=x.useState({}),p=Sn(t,C=>d(C)),b=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=b.indexOf(y),S=c?b.indexOf(c):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,A=S>=m,T=Ci(C=>{const V=C.target,D=[...u.branches].some(O=>O.contains(V));!A||D||(i==null||i(C),o==null||o(C),C.defaultPrevented||a==null||a())},f),P=Ai(C=>{const V=C.target;[...u.branches].some(O=>O.contains(V))||(r==null||r(C),o==null||o(C),C.defaultPrevented||a==null||a())},f);return vi(C=>{S===u.layers.size-1&&(s==null||s(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),x.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(jt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Kt(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=jt)}},[c,f,n,u]),x.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Kt())},[c,u]),x.useEffect(()=>{const C=()=>h({});return document.addEventListener(Ue,C),()=>document.removeEventListener(Ue,C)},[]),M.jsx(Vn.div,{...l,ref:p,style:{pointerEvents:v?A?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,T.onPointerDownCapture)})});An.displayName=Ti;var Si="DismissableLayerBranch",Vi=x.forwardRef((e,t)=>{const n=x.useContext(Cn),s=x.useRef(null),i=Sn(t,s);return x.useEffect(()=>{const r=s.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),M.jsx(Vn.div,{...e,ref:i})});Vi.displayName=Si;function Ci(e,t=globalThis==null?void 0:globalThis.document){const n=ht(e),s=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const r=a=>{if(a.target&&!s.current){let l=function(){Mn(wi,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);s.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",r),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>s.current=!0}}function Ai(e,t=globalThis==null?void 0:globalThis.document){const n=ht(e),s=x.useRef(!1);return x.useEffect(()=>{const i=r=>{r.target&&!s.current&&Mn(xi,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Kt(){const e=new CustomEvent(Ue);document.dispatchEvent(e)}function Mn(e,t,n,{discrete:s}){const i=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),s?bi(i,r):i.dispatchEvent(r)}var Mi=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},Pi=x[" useInsertionEffect ".trim().toString()]||Mi;function Ei({prop:e,defaultProp:t,onChange:n=()=>{},caller:s}){const[i,r,o]=Ri({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const c=x.useRef(e!==void 0);x.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${s} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,s])}const u=x.useCallback(c=>{var d;if(a){const f=Di(c)?c(e):c;f!==e&&((d=o.current)==null||d.call(o,f))}else r(c)},[a,e,r,o]);return[l,u]}function Ri({defaultProp:e,onChange:t}){const[n,s]=x.useState(e),i=x.useRef(n),r=x.useRef(t);return Pi(()=>{r.current=t},[t]),x.useEffect(()=>{var o;i.current!==n&&((o=r.current)==null||o.call(r,n),i.current=n)},[n,i]),[n,s,r]}function Di(e){return typeof e=="function"}const Fi=w.createContext({});function Oi(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}const Pn=typeof window<"u",ki=Pn?w.useLayoutEffect:w.useEffect,En=w.createContext(null);function Li(e,t){e.indexOf(t)===-1&&e.push(t)}function Ii(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const H=(e,t,n)=>n>t?t:n<e?e:n;function Ge(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let ye=()=>{},Z=()=>{};var wn;typeof process<"u"&&((wn=process.env)==null?void 0:wn.NODE_ENV)!=="production"&&(ye=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(Ge(t,n))},Z=(e,t,n)=>{if(!e)throw new Error(Ge(t,n))});const W={},Rn=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Bi(e){return typeof e=="object"&&e!==null}const Dn=e=>/^0[^.\s]+$/u.test(e);function Fn(e){let t;return()=>(t===void 0&&(t=e()),t)}const re=e=>e,Ni=(e,t)=>n=>t(e(n)),Fe=(...e)=>e.reduce(Ni),On=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};class kn{constructor(){this.subscriptions=[]}add(t){return Li(this.subscriptions,t),()=>Ii(this.subscriptions,t)}notify(t,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const K=e=>e*1e3,B=e=>e/1e3;function Ln(e,t){return t?e*(1e3/t):0}const Wt=new Set;function In(e,t,n){e||Wt.has(t)||(console.warn(Ge(t,n)),Wt.add(t))}const Bn=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ji=1e-7,Ki=12;function Wi(e,t,n,s,i){let r,o,a=0;do o=t+(n-t)/2,r=Bn(o,s,i)-e,r>0?n=o:t=o;while(Math.abs(r)>ji&&++a<Ki);return o}function be(e,t,n,s){if(e===t&&n===s)return re;const i=r=>Wi(r,0,1,e,n);return r=>r===0||r===1?r:Bn(i(r),t,s)}const Nn=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,jn=e=>t=>1-e(1-t),Kn=be(.33,1.53,.69,.99),pt=jn(Kn),Wn=Nn(pt),$n=e=>(e*=2)<1?.5*pt(e):.5*(2-Math.pow(2,-10*(e-1))),mt=e=>1-Math.sin(Math.acos(e)),$i=jn(mt),_n=Nn(mt),_i=be(.42,0,1,1),Hi=be(0,0,.58,1),Hn=be(.42,0,.58,1),Ui=e=>Array.isArray(e)&&typeof e[0]!="number",Un=e=>Array.isArray(e)&&typeof e[0]=="number",$t={linear:re,easeIn:_i,easeInOut:Hn,easeOut:Hi,circIn:mt,circInOut:_n,circOut:$i,backIn:pt,backInOut:Wn,backOut:Kn,anticipate:$n},Gi=e=>typeof e=="string",_t=e=>{if(Un(e)){Z(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,s,i]=e;return be(t,n,s,i)}else if(Gi(e))return Z($t[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),$t[e];return e},we=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function zi(e,t){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){o.has(c)&&(u.schedule(c),e()),c(a)}const u={schedule:(c,d=!1,f=!1)=>{const p=f&&i?n:s;return d&&o.add(c),p.has(c)||p.add(c),c},cancel:c=>{s.delete(c),o.delete(c)},process:c=>{if(a=c,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(l),n.clear(),i=!1,r&&(r=!1,u.process(c))}};return u}const qi=40;function Gn(e,t){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=we.reduce((v,A)=>(v[A]=zi(r),v),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:c,update:d,preRender:f,render:h,postRender:p}=o,b=()=>{const v=W.useManualTiming?i.timestamp:performance.now();n=!1,W.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(v-i.timestamp,qi),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),h.process(i),p.process(i),i.isProcessing=!1,n&&t&&(s=!1,e(b))},y=()=>{n=!0,s=!0,i.isProcessing||e(b)};return{schedule:we.reduce((v,A)=>{const T=o[A];return v[A]=(P,C=!1,V=!1)=>(n||y(),T.schedule(P,C,V)),v},{}),cancel:v=>{for(let A=0;A<we.length;A++)o[we[A]].cancel(v)},state:i,steps:o}}const{schedule:j,cancel:ze,state:Ce}=Gn(typeof requestAnimationFrame<"u"?requestAnimationFrame:re,!0);let Se;function Yi(){Se=void 0}const L={now:()=>(Se===void 0&&L.set(Ce.isProcessing||W.useManualTiming?Ce.timestamp:performance.now()),Se),set:e=>{Se=e,queueMicrotask(Yi)}},zn=e=>t=>typeof t=="string"&&t.startsWith(e),qn=zn("--"),Xi=zn("var(--"),gt=e=>Xi(e)?Zi.test(e.split("/*")[0].trim()):!1,Zi=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ht(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const oe={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},he={...oe,transform:e=>H(0,1,e)},xe={...oe,default:1},de=e=>Math.round(e*1e5)/1e5,yt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ji(e){return e==null}const Qi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bt=(e,t)=>n=>!!(typeof n=="string"&&Qi.test(n)&&n.startsWith(e)||t&&!Ji(n)&&Object.prototype.hasOwnProperty.call(n,t)),Yn=(e,t,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(yt);return{[e]:parseFloat(i),[t]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},er=e=>H(0,255,e),Be={...oe,transform:e=>Math.round(er(e))},z={test:bt("rgb","red"),parse:Yn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Be.transform(e)+", "+Be.transform(t)+", "+Be.transform(n)+", "+de(he.transform(s))+")"};function tr(e){let t="",n="",s="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const qe={test:bt("#"),parse:tr,transform:z.transform},ve=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$=ve("deg"),se=ve("%"),g=ve("px"),nr=ve("vh"),sr=ve("vw"),Ut={...se,parse:e=>se.parse(e)/100,transform:e=>se.transform(e*100)},ee={test:bt("hsl","hue"),parse:Yn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+se.transform(de(t))+", "+se.transform(de(n))+", "+de(he.transform(s))+")"},R={test:e=>z.test(e)||qe.test(e)||ee.test(e),parse:e=>z.test(e)?z.parse(e):ee.test(e)?ee.parse(e):qe.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?z.transform(e):ee.transform(e),getAnimatableNone:e=>{const t=R.parse(e);return t.alpha=0,R.transform(t)}},ir=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function rr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(yt))==null?void 0:t.length)||0)+(((n=e.match(ir))==null?void 0:n.length)||0)>0}const Xn="number",Zn="color",or="var",ar="var(",Gt="${}",cr=/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 pe(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=t.replace(cr,l=>(R.test(l)?(s.color.push(r),i.push(Zn),n.push(R.parse(l))):l.startsWith(ar)?(s.var.push(r),i.push(or),n.push(l)):(s.number.push(r),i.push(Xn),n.push(parseFloat(l))),++r,Gt)).split(Gt);return{values:n,split:a,indexes:s,types:i}}function Jn(e){return pe(e).values}function Qn(e){const{split:t,types:n}=pe(e),s=t.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=t[o],i[o]!==void 0){const a=n[o];a===Xn?r+=de(i[o]):a===Zn?r+=R.transform(i[o]):r+=i[o]}return r}}const ur=e=>typeof e=="number"?0:R.test(e)?R.getAnimatableNone(e):e;function lr(e){const t=Jn(e);return Qn(e)(t.map(ur))}const N={test:rr,parse:Jn,createTransformer:Qn,getAnimatableNone:lr};function Ne(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function fr({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let i=0,r=0,o=0;if(!t)i=r=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Ne(l,a,e+1/3),r=Ne(l,a,e),o=Ne(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Ae(e,t){return n=>n>0?t:e}const Te=(e,t,n)=>e+(t-e)*n,je=(e,t,n)=>{const s=e*e,i=n*(t*t-s)+s;return i<0?0:Math.sqrt(i)},dr=[qe,z,ee],hr=e=>dr.find(t=>t.test(e));function zt(e){const t=hr(e);if(ye(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ee&&(n=fr(n)),n}const qt=(e,t)=>{const n=zt(e),s=zt(t);if(!n||!s)return Ae(e,t);const i={...n};return r=>(i.red=je(n.red,s.red,r),i.green=je(n.green,s.green,r),i.blue=je(n.blue,s.blue,r),i.alpha=Te(n.alpha,s.alpha,r),z.transform(i))},Ye=new Set(["none","hidden"]);function pr(e,t){return Ye.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function mr(e,t){return n=>Te(e,t,n)}function vt(e){return typeof e=="number"?mr:typeof e=="string"?gt(e)?Ae:R.test(e)?qt:br:Array.isArray(e)?es:typeof e=="object"?R.test(e)?qt:gr:Ae}function es(e,t){const n=[...e],s=n.length,i=e.map((r,o)=>vt(r)(r,t[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function gr(e,t){const n={...e,...t},s={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(s[i]=vt(e[i])(e[i],t[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function yr(e,t){const n=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const r=t.types[i],o=e.indexes[r][s[r]],a=e.values[o]??0;n[i]=a,s[r]++}return n}const br=(e,t)=>{const n=N.createTransformer(t),s=pe(e),i=pe(t);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?Ye.has(e)&&!i.values.length||Ye.has(t)&&!s.values.length?pr(e,t):Fe(es(yr(s,i),i.values),n):(ye(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),Ae(e,t))};function ts(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Te(e,t,n):vt(e)(e,t)}const vr=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>j.update(t,n),stop:()=>ze(t),now:()=>Ce.isProcessing?Ce.timestamp:L.now()}},ns=(e,t,n=10)=>{let s="";const i=Math.max(Math.round(t/n),2);for(let r=0;r<i;r++)s+=Math.round(e(r/(i-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},Me=2e4;function Tt(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Me;)t+=n,s=e.next(t);return t>=Me?1/0:t}function Tr(e,t=100,n){const s=n({...e,keyframes:[0,t]}),i=Math.min(Tt(s),Me);return{type:"keyframes",ease:r=>s.next(i*r).value/t,duration:B(i)}}const wr=5;function ss(e,t,n){const s=Math.max(t-wr,0);return Ln(n-e(s),t-s)}const E={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ke=.001;function xr({duration:e=E.duration,bounce:t=E.bounce,velocity:n=E.velocity,mass:s=E.mass}){let i,r;ye(e<=K(E.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=H(E.minDamping,E.maxDamping,o),e=H(E.minDuration,E.maxDuration,B(e)),o<1?(i=u=>{const c=u*o,d=c*e,f=c-n,h=Xe(u,o),p=Math.exp(-d);return Ke-f/h*p},r=u=>{const d=u*o*e,f=d*n+n,h=Math.pow(o,2)*Math.pow(u,2)*e,p=Math.exp(-d),b=Xe(Math.pow(u,2),o);return(-i(u)+Ke>0?-1:1)*((f-h)*p)/b}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Ke+c*d},r=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=Vr(i,r,a);if(e=K(e),isNaN(l))return{stiffness:E.stiffness,damping:E.damping,duration:e};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:e}}}const Sr=12;function Vr(e,t,n){let s=n;for(let i=1;i<Sr;i++)s=s-e(s)/t(s);return s}function Xe(e,t){return e*Math.sqrt(1-t*t)}const Cr=["duration","bounce"],Ar=["stiffness","damping","mass"];function Yt(e,t){return t.some(n=>e[n]!==void 0)}function Mr(e){let t={velocity:E.velocity,stiffness:E.stiffness,damping:E.damping,mass:E.mass,isResolvedFromDuration:!1,...e};if(!Yt(e,Ar)&&Yt(e,Cr))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*H(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:E.mass,stiffness:i,damping:r}}else{const n=xr({...e,velocity:0});t={...t,...n,mass:E.mass},t.isResolvedFromDuration=!0}return t}function Pe(e=E.visualDuration,t=E.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:h}=Mr({...n,velocity:-B(n.velocity||0)}),p=f||0,b=u/(2*Math.sqrt(l*c)),y=o-r,m=B(Math.sqrt(l/c)),S=Math.abs(y)<5;s||(s=S?E.restSpeed.granular:E.restSpeed.default),i||(i=S?E.restDelta.granular:E.restDelta.default);let v;if(b<1){const T=Xe(m,b);v=P=>{const C=Math.exp(-b*m*P);return o-C*((p+b*m*y)/T*Math.sin(T*P)+y*Math.cos(T*P))}}else if(b===1)v=T=>o-Math.exp(-m*T)*(y+(p+m*y)*T);else{const T=m*Math.sqrt(b*b-1);v=P=>{const C=Math.exp(-b*m*P),V=Math.min(T*P,300);return o-C*((p+b*m*y)*Math.sinh(V)+T*y*Math.cosh(V))/T}}const A={calculatedDuration:h&&d||null,next:T=>{const P=v(T);if(h)a.done=T>=d;else{let C=T===0?p:0;b<1&&(C=T===0?K(p):ss(v,T,P));const V=Math.abs(C)<=s,D=Math.abs(o-P)<=i;a.done=V&&D}return a.value=a.done?o:P,a},toString:()=>{const T=Math.min(Tt(A),Me),P=ns(C=>A.next(T*C).value,T,30);return T+"ms "+P},toTransition:()=>{}};return A}Pe.applyToOptions=e=>{const t=Tr(e,100,Pe);return e.ease=t.ease,e.duration=K(t.duration),e.type="keyframes",e};function Ze({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=V=>a!==void 0&&V<a||l!==void 0&&V>l,p=V=>a===void 0?l:l===void 0||Math.abs(a-V)<Math.abs(l-V)?a:l;let b=n*t;const y=d+b,m=o===void 0?y:o(y);m!==y&&(b=m-d);const S=V=>-b*Math.exp(-V/s),v=V=>m+S(V),A=V=>{const D=S(V),O=v(V);f.done=Math.abs(D)<=u,f.value=f.done?m:O};let T,P;const C=V=>{h(f.value)&&(T=V,P=Pe({keyframes:[f.value,p(f.value)],velocity:ss(v,V,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:V=>{let D=!1;return!P&&T===void 0&&(D=!0,A(V),C(V)),T!==void 0&&V>=T?P.next(V-T):(!D&&A(V),f)}}}function Pr(e,t,n){const s=[],i=n||W.mix||ts,r=e.length-1;for(let o=0;o<r;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||re:t;a=Fe(l,a)}s.push(a)}return s}function Er(e,t,{clamp:n=!0,ease:s,mixer:i}={}){const r=e.length;if(Z(r===t.length,"Both input and output ranges must be the same length","range-length"),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[r-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Pr(t,s,i),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const f=On(e[d],e[d+1],c);return a[d](f)};return n?c=>u(H(e[0],e[r-1],c)):u}function Rr(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const i=On(0,t,s);e.push(Te(n,1,i))}}function Dr(e){const t=[0];return Rr(t,e.length-1),t}function Fr(e,t){return e.map(n=>n*t)}function Or(e,t){return e.map(()=>t||Hn).splice(0,e.length-1)}function te({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const i=Ui(s)?s.map(_t):_t(s),r={done:!1,value:t[0]},o=Fr(n&&n.length===t.length?n:Dr(t),e),a=Er(o,t,{ease:Array.isArray(i)?i:Or(t,i)});return{calculatedDuration:e,next:l=>(r.value=a(l),r.done=l>=e,r)}}const kr=e=>e!==null;function wt(e,{repeat:t,repeatType:n="loop"},s,i=1){const r=e.filter(kr),a=i<0||t&&n!=="loop"&&t%2===1?0:r.length-1;return!a||s===void 0?r[a]:s}const Lr={decay:Ze,inertia:Ze,tween:te,keyframes:te,spring:Pe};function is(e){typeof e.type=="string"&&(e.type=Lr[e.type])}class xt{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const Ir=e=>e/100;class St extends xt{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,i;const{motionValue:n}=this.options;n&&n.updatedAt!==L.now()&&this.tick(L.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(s=this.options).onStop)==null||i.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;is(t);const{type:n=te,repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=t;let{keyframes:a}=t;const l=n||te;process.env.NODE_ENV!=="production"&&l!==te&&Z(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),l!==te&&typeof a[0]!="number"&&(this.mixKeyframes=Fe(Ir,ts(a[0],a[1])),a=[0,100]);const u=l({...t,keyframes:a});r==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Tt(u));const{calculatedDuration:c}=u;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(s+1)-i,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:i,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return s.next(0);const{delay:u=0,keyframes:c,repeat:d,repeatType:f,repeatDelay:h,type:p,onUpdate:b,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const m=this.currentTime-u*(this.playbackSpeed>=0?1:-1),S=this.playbackSpeed>=0?m<0:m>i;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let v=this.currentTime,A=s;if(d){const V=Math.min(this.currentTime,i)/a;let D=Math.floor(V),O=V%1;!O&&V>=1&&(O=1),O===1&&D--,D=Math.min(D,d+1),!!(D%2)&&(f==="reverse"?(O=1-O,h&&(O-=h/a)):f==="mirror"&&(A=o)),v=H(0,1,O)*a}const T=S?{done:!1,value:c[0]}:A.next(v);r&&(T.value=r(T.value));let{done:P}=T;!S&&l!==null&&(P=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return C&&p!==Ze&&(T.value=wt(c,this.options,y,this.speed)),b&&b(T.value),C&&this.finish(),T}then(t,n){return this.finished.then(t,n)}get duration(){return B(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(this.currentTime)}set time(t){var n;t=K(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(L.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=B(this.currentTime))}play(){var i,r;if(this.isStopped)return;const{driver:t=vr,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(r=(i=this.options).onPlay)==null||r.call(i);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(L.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function Br(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const q=e=>e*180/Math.PI,Je=e=>{const t=q(Math.atan2(e[1],e[0]));return Qe(t)},Nr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Je,rotateZ:Je,skewX:e=>q(Math.atan(e[1])),skewY:e=>q(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Qe=e=>(e=e%360,e<0&&(e+=360),e),Xt=Je,Zt=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Jt=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),jr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zt,scaleY:Jt,scale:e=>(Zt(e)+Jt(e))/2,rotateX:e=>Qe(q(Math.atan2(e[6],e[5]))),rotateY:e=>Qe(q(Math.atan2(-e[2],e[0]))),rotateZ:Xt,rotate:Xt,skewX:e=>q(Math.atan(e[4])),skewY:e=>q(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function et(e){return e.includes("scale")?1:0}function tt(e,t){if(!e||e==="none")return et(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=jr,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Nr,i=a}if(!i)return et(t);const r=s[t],o=i[1].split(",").map(Wr);return typeof r=="function"?r(o):o[r]}const Kr=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return tt(n,t)};function Wr(e){return parseFloat(e.trim())}const ae=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ce=new Set(ae),Qt=e=>e===oe||e===g,$r=new Set(["x","y","z"]),_r=ae.filter(e=>!$r.has(e));function Hr(e){const t=[];return _r.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const _={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>tt(t,"x"),y:(e,{transform:t})=>tt(t,"y")};_.translateX=_.x;_.translateY=_.y;const Y=new Set;let nt=!1,st=!1,it=!1;function rs(){if(st){const e=Array.from(Y).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const i=Hr(s);i.length&&(n.set(s,i),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}st=!1,nt=!1,Y.forEach(e=>e.complete(it)),Y.clear()}function os(){Y.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(st=!0)})}function Ur(){it=!0,os(),rs(),it=!1}class Vt{constructor(t,n,s,i,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Y.add(this),nt||(nt=!0,j.read(os),j.resolveKeyframes(rs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:i}=this;if(t[0]===null){const r=i==null?void 0:i.get(),o=t[t.length-1];if(r!==void 0)t[0]=r;else if(s&&n){const a=s.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&r===void 0&&i.set(t[0])}Br(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Y.delete(this)}cancel(){this.state==="scheduled"&&(Y.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Gr=e=>e.startsWith("--");function zr(e,t,n){Gr(t)?e.style.setProperty(t,n):e.style[t]=n}const qr={};function as(e,t){const n=Fn(e);return()=>qr[t]??n()}const Yr=as(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),cs=as(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),fe=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,en={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:fe([0,.65,.55,1]),circOut:fe([.55,0,1,.45]),backIn:fe([.31,.01,.66,-.59]),backOut:fe([.33,1.53,.69,.99])};function us(e,t){if(e)return typeof e=="function"?cs()?ns(e,t):"ease-out":Un(e)?fe(e):Array.isArray(e)?e.map(n=>us(n,t)||en.easeOut):en[e]}function Xr(e,t,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const c={[t]:n};l&&(c.offset=l);const d=us(a,i);Array.isArray(d)&&(c.easing=d);const f={delay:s,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),e.animate(c,f)}function ls(e){return typeof e=="function"&&"applyToOptions"in e}function Zr({type:e,...t}){return ls(e)&&cs()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class fs extends xt{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:s,keyframes:i,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=t,Z(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=Zr(t);this.animation=Xr(n,s,i,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const c=wt(i,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(c):zr(n,s,c),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,s,i;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(s=this.animation).commitStyles)==null||i.call(s))}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return B(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+B(t)}get time(){return B(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=K(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Yr()?(this.animation.timeline=t,re):n(this)}}const ds={anticipate:$n,backInOut:Wn,circInOut:_n};function Jr(e){return e in ds}function Qr(e){typeof e.ease=="string"&&Jr(e.ease)&&(e.ease=ds[e.ease])}const We=10;class eo extends fs{constructor(t){Qr(t),is(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:i,element:r,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new St({...o,autoplay:!1}),l=Math.max(We,L.now()-this.startTime),u=H(0,We,l-We);n.setWithVelocity(a.sample(Math.max(0,l-u)).value,a.sample(l).value,u),a.stop()}}const tn=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(N.test(e)||e==="0")&&!e.startsWith("url("));function to(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function no(e,t,n,s){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=e[e.length-1],o=tn(i,t),a=tn(r,t);return ye(o===a,`You are trying to animate ${t} from "${i}" to "${r}". "${o?r:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:to(e)||(n==="spring"||ls(n))&&s}function rt(e){e.duration=0,e.type="keyframes"}const so=new Set(["opacity","clipPath","filter","transform"]),io=Fn(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ro(e){var c;const{motionValue:t,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=e;if(!(((c=t==null?void 0:t.owner)==null?void 0:c.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=t.owner.getProps();return io()&&n&&so.has(n)&&(n!=="transform"||!u)&&!l&&!s&&i!=="mirror"&&r!==0&&o!=="inertia"}const oo=40;class ao extends xt{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:c,...d}){var p;super(),this.stop=()=>{var b,y;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=L.now();const f={autoplay:t,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,name:l,motionValue:u,element:c,...d},h=(c==null?void 0:c.KeyframeResolver)||Vt;this.keyframeResolver=new h(a,(b,y,m)=>this.onKeyframesResolved(b,y,f,!m),l,u,c),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(t,n,s,i){var y,m;this.keyframeResolver=void 0;const{name:r,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:c}=s;this.resolvedAt=L.now(),no(t,r,o,a)||((W.instantAnimations||!l)&&(c==null||c(wt(t,s,n))),t[0]=t[t.length-1],rt(s),s.repeat=0);const f={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>oo?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},h=!u&&ro(f),p=(m=(y=f.motionValue)==null?void 0:y.owner)==null?void 0:m.current,b=h?new eo({...f,element:p}):new St(f);b.finished.then(()=>{this.notifyFinished()}).catch(re),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ur()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function hs(e,t,n,s=0,i=1){const r=Array.from(e).sort((u,c)=>u.sortNodePosition(c)).indexOf(t),o=e.size,a=(o-1)*s;return typeof n=="function"?n(r,o):i===1?r*s:a-r*s}const co=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function uo(e){const t=co.exec(e);if(!t)return[,];const[,n,s,i]=t;return[`--${n??s}`,i]}const lo=4;function ps(e,t,n=1){Z(n<=lo,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[s,i]=uo(e);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const o=r.trim();return Rn(o)?parseFloat(o):o}return gt(i)?ps(i,t,n+1):i}const fo={type:"spring",stiffness:500,damping:25,restSpeed:10},ho=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),po={type:"keyframes",duration:.8},mo={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},go=(e,{keyframes:t})=>t.length>2?po:ce.has(e)?e.startsWith("scale")?ho(t[1]):fo:mo,yo=e=>e!==null;function bo(e,{repeat:t,repeatType:n="loop"},s){const i=e.filter(yo),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}function ms(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...s}=e;return{...t,...s}}return e}function gs(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?ms(n,e):n}function vo({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const To=(e,t,n,s={},i,r)=>o=>{const a=gs(s,e)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-K(l);const c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:r?void 0:i};vo(a)||Object.assign(c,go(e,c)),c.duration&&(c.duration=K(c.duration)),c.repeatDelay&&(c.repeatDelay=K(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(rt(c),c.delay===0&&(d=!0)),(W.instantAnimations||W.skipAnimations||i!=null&&i.shouldSkipAnimations)&&(d=!0,rt(c),c.delay=0),c.allowFlatten=!a.type&&!a.ease,d&&!r&&t.get()!==void 0){const f=bo(c.keyframes,a);if(f!==void 0){j.update(()=>{c.onUpdate(f),c.onComplete()});return}}return a.isSync?new St(c):new ao(c)};function nn(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function Ct(e,t,n,s){if(typeof t=="function"){const[i,r]=nn(s);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=nn(s);t=t(n!==void 0?n:e.custom,i,r)}return t}function ie(e,t,n){const s=e.getProps();return Ct(s,t,n!==void 0?n:s.custom,e)}const ys=new Set(["width","height","top","left","right","bottom",...ae]),sn=30,wo=e=>!isNaN(parseFloat(e));class xo{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{var r;const i=L.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=L.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=wo(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&In(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new kn);const s=this.events[t].add(n);return t==="change"?()=>{s(),j.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=L.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>sn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,sn);return Ln(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ee(e,t){return new xo(e,t)}const ot=e=>Array.isArray(e);function So(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ee(n))}function Vo(e){return ot(e)?e[e.length-1]||0:e}function Co(e,t){const n=ie(e,t);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Vo(r[o]);So(e,o,a)}}const k=e=>!!(e&&e.getVelocity);function Ao(e){return!!(k(e)&&e.add)}function Mo(e,t){const n=e.getValue("willChange");if(Ao(n))return n.add(t);if(!n&&W.WillChange){const s=new W.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function At(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Po="framerAppearId",bs="data-"+At(Po);function Eo(e){return e.props[bs]}function Ro({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function vs(e,t,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();r=r?ms(r,l):l;const u=r==null?void 0:r.reduceMotion;s&&(r=s);const c=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const f in a){const h=e.getValue(f,e.latestValues[f]??null),p=a[f];if(p===void 0||d&&Ro(d,f))continue;const b={delay:n,...gs(r||{},f)},y=h.get();if(y!==void 0&&!h.isAnimating&&!Array.isArray(p)&&p===y&&!b.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const A=Eo(e);if(A){const T=window.MotionHandoffAnimation(A,f,j);T!==null&&(b.startTime=T,m=!0)}}Mo(e,f);const S=u??e.shouldReduceMotion;h.start(To(f,h,p,S&&ys.has(f)?{type:!1}:b,e,m));const v=h.animation;v&&c.push(v)}if(o){const f=()=>j.update(()=>{o&&Co(e,o)});c.length?Promise.all(c).then(f):f()}return c}function at(e,t,n={}){var l;const s=ie(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(vs(e,s,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=i;return Do(e,t,u,c,d,f,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function Do(e,t,n=0,s=0,i=0,r=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(at(l,t,{...o,delay:n+(typeof s=="function"?0:s)+hs(e.variantChildren,l,s,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Fo(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const i=t.map(r=>at(e,r,n));s=Promise.all(i)}else if(typeof t=="string")s=at(e,t,n);else{const i=typeof t=="function"?ie(e,t,n.custom):t;s=Promise.all(vs(e,i,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}const Oo={test:e=>e==="auto",parse:e=>e},Ts=e=>t=>t.test(e),ws=[oe,g,se,$,sr,nr,Oo],rn=e=>ws.find(Ts(e));function ko(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Dn(e):!0}const Lo=new Set(["brightness","contrast","saturate","opacity"]);function Io(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(yt)||[];if(!s)return e;const i=n.replace(s,"");let r=Lo.has(t)?1:0;return s!==n&&(r*=100),t+"("+r+i+")"}const Bo=/\b([a-z-]*)\(.*?\)/gu,ct={...N,getAnimatableNone:e=>{const t=e.match(Bo);return t?t.map(Io).join(" "):e}},ut={...N,getAnimatableNone:e=>{const t=N.parse(e);return N.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},on={...oe,transform:Math.round},No={rotate:$,rotateX:$,rotateY:$,rotateZ:$,scale:xe,scaleX:xe,scaleY:xe,scaleZ:xe,skew:$,skewX:$,skewY:$,distance:g,translateX:g,translateY:g,translateZ:g,x:g,y:g,z:g,perspective:g,transformPerspective:g,opacity:he,originX:Ut,originY:Ut,originZ:g},Mt={borderWidth:g,borderTopWidth:g,borderRightWidth:g,borderBottomWidth:g,borderLeftWidth:g,borderRadius:g,borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomRightRadius:g,borderBottomLeftRadius:g,width:g,maxWidth:g,height:g,maxHeight:g,top:g,right:g,bottom:g,left:g,inset:g,insetBlock:g,insetBlockStart:g,insetBlockEnd:g,insetInline:g,insetInlineStart:g,insetInlineEnd:g,padding:g,paddingTop:g,paddingRight:g,paddingBottom:g,paddingLeft:g,paddingBlock:g,paddingBlockStart:g,paddingBlockEnd:g,paddingInline:g,paddingInlineStart:g,paddingInlineEnd:g,margin:g,marginTop:g,marginRight:g,marginBottom:g,marginLeft:g,marginBlock:g,marginBlockStart:g,marginBlockEnd:g,marginInline:g,marginInlineStart:g,marginInlineEnd:g,fontSize:g,backgroundPositionX:g,backgroundPositionY:g,...No,zIndex:on,fillOpacity:he,strokeOpacity:he,numOctaves:on},jo={...Mt,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ct,WebkitFilter:ct,mask:ut,WebkitMask:ut},xs=e=>jo[e],Ko=new Set([ct,ut]);function Ss(e,t){let n=xs(e);return Ko.has(n)||(n=N),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Wo=new Set(["auto","none","0"]);function $o(e,t,n){let s=0,i;for(;s<e.length&&!i;){const r=e[s];typeof r=="string"&&!Wo.has(r)&&pe(r).values.length&&(i=e[s]),s++}if(i&&n)for(const r of t)e[r]=Ss(n,i)}class _o extends Vt{constructor(t,n,s,i,r){super(t,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let d=t[c];if(typeof d=="string"&&(d=d.trim(),gt(d))){const f=ps(d,n.current);f!==void 0&&(t[c]=f),c===t.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!ys.has(s)||t.length!==2)return;const[i,r]=t,o=rn(i),a=rn(r),l=Ht(i),u=Ht(r);if(l!==u&&_[s]){this.needsMeasurement=!0;return}if(o!==a)if(Qt(o)&&Qt(a))for(let c=0;c<t.length;c++){const d=t[c];typeof d=="string"&&(t[c]=parseFloat(d))}else _[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let i=0;i<t.length;i++)(t[i]===null||ko(t[i]))&&s.push(i);s.length&&$o(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=_[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{t.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Ho=new Set(["opacity","clipPath","filter","transform"]);function Uo(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const i=(n==null?void 0:n[e])??s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(s=>s!=null)}const Vs=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Go(e){return Bi(e)&&"offsetHeight"in e}const{schedule:zo}=Gn(queueMicrotask,!1),qo={y:!1};function Yo(){return qo.y}function Cs(e,t){const n=Uo(e),s=new AbortController,i={passive:!0,...t,signal:s.signal};return[n,i,()=>s.abort()]}function Xo(e){return!(e.pointerType==="touch"||Yo())}function Zo(e,t,n={}){const[s,i,r]=Cs(e,n);return s.forEach(o=>{let a=!1,l=!1,u;const c=()=>{o.removeEventListener("pointerleave",p)},d=y=>{u&&(u(y),u=void 0),c()},f=y=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,d(y))},h=()=>{a=!0,window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",f,i)},p=y=>{if(y.pointerType!=="touch"){if(a){l=!0;return}d(y)}},b=y=>{if(!Xo(y))return;l=!1;const m=t(o,y);typeof m=="function"&&(u=m,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",b,i),o.addEventListener("pointerdown",h,i)}),r}const As=(e,t)=>t?e===t?!0:As(e,t.parentElement):!1,Jo=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Qo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ea(e){return Qo.has(e.tagName)||e.isContentEditable===!0}const Ve=new WeakSet;function an(e){return t=>{t.key==="Enter"&&e(t)}}function $e(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ta=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=an(()=>{if(Ve.has(n))return;$e(n,"down");const i=an(()=>{$e(n,"up")}),r=()=>$e(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",r,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function cn(e){return Jo(e)&&!0}const un=new WeakSet;function na(e,t,n={}){const[s,i,r]=Cs(e,n),o=a=>{const l=a.currentTarget;if(!cn(a)||un.has(a))return;Ve.add(l),n.stopPropagation&&un.add(a);const u=t(l,a),c=(h,p)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),Ve.has(l)&&Ve.delete(l),cn(h)&&typeof u=="function"&&u(h,{success:p})},d=h=>{c(h,l===window||l===document||n.useGlobalTarget||As(l,h.target))},f=h=>{c(h,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),Go(a)&&(a.addEventListener("focus",u=>ta(u,i)),!ea(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}const sa=[...ws,R,N],ia=e=>sa.find(Ts(e)),ln=()=>({min:0,max:0}),Ms=()=>({x:ln(),y:ln()}),ra=new WeakMap;function Oe(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function me(e){return typeof e=="string"||Array.isArray(e)}const Pt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Et=["initial",...Pt];function ke(e){return Oe(e.animate)||Et.some(t=>me(e[t]))}function Ps(e){return!!(ke(e)||e.variants)}function oa(e,t,n){for(const s in t){const i=t[s],r=n[s];if(k(i))e.addValue(s,i);else if(k(r))e.addValue(s,Ee(i,{owner:e}));else if(r!==i)if(e.hasValue(s)){const o=e.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(s);e.addValue(s,Ee(o!==void 0?o:i,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const lt={current:null},Es={current:!1},aa=typeof window<"u";function ca(){if(Es.current=!0,!!aa)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lt.current=e.matches;e.addEventListener("change",t),t()}else lt.current=!1}const fn=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Re={};function Rs(e){Re=e}function ua(){return Re}class la{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:i,skipAnimations:r,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Vt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=L.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,j.render(this.render,!1,!0))};const{latestValues:u,renderState:c}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=n.initial?{...u}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=r,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=ke(n),this.isVariantNode=Ps(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in f){const p=f[h];u[h]!==void 0&&k(p)&&p.set(u[h])}}mount(t){var n,s;if(this.hasBeenMounted)for(const i in this.initialValues)(n=this.values.get(i))==null||n.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,ra.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((i,r)=>this.bindToMotionValue(r,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Es.current||ca(),this.shouldReduceMotion=lt.current),process.env.NODE_ENV!=="production"&&In(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(s=this.parent)==null||s.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ze(this.notifyUpdate),ze(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const s=this.features[n];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Ho.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:c}=n.accelerate,d=new fs({element:this.current,name:t,keyframes:a,times:l,ease:u,duration:K(c)}),f=o(d);this.valueSubscriptions.set(t,()=>{f(),d.cancel()});return}const s=ce.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&j.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Re){const n=Re[t];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ms()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<fn.length;s++){const i=fn[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=t[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=oa(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Ee(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Rn(s)||Dn(s))?s=parseFloat(s):!ia(s)&&N.test(n)&&(s=Ss(t,n)),this.setBaseTarget(t,k(s)?s.get():s)),k(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=Ct(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[t])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!k(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){zo.render(this.render)}}class Ds extends la{constructor(){super(...arguments),this.KeyframeResolver=_o}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const s=t.style;return s?s[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;k(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ue{constructor(t){this.isMounted=!1,this.node=t}update(){}}function fa({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function da(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ha(e,t){return fa(da(e.getBoundingClientRect(),t))}const pa={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ma=ae.length;function ga(e,t,n){let s="",i=!0;for(let r=0;r<ma;r++){const o=ae[r],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const u=parseFloat(a);l=o.startsWith("scale")?u===1:u===0}if(!l||n){const u=Vs(a,Mt[o]);if(!l){i=!1;const c=pa[o]||o;s+=`${c}(${u}) `}n&&(t[o]=u)}}return s=s.trim(),n?s=n(t,i?"":s):i&&(s="none"),s}function Rt(e,t,n){const{style:s,vars:i,transformOrigin:r}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(ce.has(l)){o=!0;continue}else if(qn(l)){i[l]=u;continue}else{const c=Vs(u,Mt[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(t.transform||(o||n?s.transform=ga(t,e.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}function Fs(e,{style:t,vars:n},s,i){const r=e.style;let o;for(o in t)r[o]=t[o];i==null||i.applyProjectionStyles(r,s);for(o in n)r.setProperty(o,n[o])}function dn(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const le={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(g.test(e))e=parseFloat(e);else return e;const n=dn(e,t.target.x),s=dn(e,t.target.y);return`${n}% ${s}%`}},ya={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,i=N.parse(e);if(i.length>5)return s;const r=N.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=Te(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},ba={borderRadius:{...le,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:le,borderTopRightRadius:le,borderBottomLeftRadius:le,borderBottomRightRadius:le,boxShadow:ya};function Os(e,{layout:t,layoutId:n}){return ce.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ba[e]||e==="opacity")}function Dt(e,t,n){var o;const s=e.style,i=t==null?void 0:t.style,r={};if(!s)return r;for(const a in s)(k(s[a])||i&&k(i[a])||Os(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(r[a]=s[a]);return r}function va(e){return window.getComputedStyle(e)}class Ta extends Ds{constructor(){super(...arguments),this.type="html",this.renderInstance=Fs}readValueFromInstance(t,n){var s;if(ce.has(n))return(s=this.projection)!=null&&s.isProjecting?et(n):Kr(t,n);{const i=va(t),r=(qn(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ha(t,n)}build(t,n,s){Rt(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return Dt(t,n,s)}}const wa={offset:"stroke-dashoffset",array:"stroke-dasharray"},xa={offset:"strokeDashoffset",array:"strokeDasharray"};function Sa(e,t,n=1,s=0,i=!0){e.pathLength=1;const r=i?wa:xa;e[r.offset]=`${-s}`,e[r.array]=`${t} ${n}`}const Va=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ks(e,{attrX:t,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,u,c){if(Rt(e,a,u),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),f.transform&&(f.transformBox=(c==null?void 0:c.transformBox)??"fill-box",delete d.transformBox);for(const h of Va)d[h]!==void 0&&(f[h]=d[h],delete d[h]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),i!==void 0&&Sa(d,i,r,o,!1)}const Ls=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"]),Is=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ca(e,t,n,s){Fs(e,t,void 0,s);for(const i in t.attrs)e.setAttribute(Ls.has(i)?i:At(i),t.attrs[i])}function Bs(e,t,n){const s=Dt(e,t,n);for(const i in e)if(k(e[i])||k(t[i])){const r=ae.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=e[i]}return s}class Aa extends Ds{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ms}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ce.has(n)){const s=xs(n);return s&&s.default||0}return n=Ls.has(n)?n:At(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return Bs(t,n,s)}build(t,n,s){ks(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,i){Ca(t,n,s,i)}mount(t){this.isSVGTag=Is(t.tagName),super.mount(t)}}const Ma=Et.length;function Ns(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ns(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ma;n++){const s=Et[n],i=e.props[s];(me(i)||i===!1)&&(t[s]=i)}return t}function js(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Pa=[...Pt].reverse(),Ea=Pt.length;function Ra(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Fo(e,n,s)))}function Da(e){let t=Ra(e),n=hn(),s=!0;const i=l=>(u,c)=>{var f;const d=ie(e,c,l==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(d){const{transition:h,transitionEnd:p,...b}=d;u={...u,...b,...p}}return u};function r(l){t=l(e)}function o(l){const{props:u}=e,c=Ns(e.parent)||{},d=[],f=new Set;let h={},p=1/0;for(let y=0;y<Ea;y++){const m=Pa[y],S=n[m],v=u[m]!==void 0?u[m]:c[m],A=me(v),T=m===l?S.isActive:null;T===!1&&(p=y);let P=v===c[m]&&v!==u[m]&&A;if(P&&s&&e.manuallyAnimateOnMount&&(P=!1),S.protectedKeys={...h},!S.isActive&&T===null||!v&&!S.prevProp||Oe(v)||typeof v=="boolean")continue;if(m==="exit"&&S.isActive&&T!==!0){S.prevResolvedValues&&(h={...h,...S.prevResolvedValues});continue}const C=Fa(S.prevProp,v);let V=C||m===l&&S.isActive&&!P&&A||y>p&&A,D=!1;const O=Array.isArray(v)?v:[v];let J=O.reduce(i(m),{});T===!1&&(J={});const{prevResolvedValues:Lt={}}=S,Zs={...Lt,...J},It=F=>{V=!0,f.has(F)&&(D=!0,f.delete(F)),S.needsAnimating[F]=!0;const I=e.getValue(F);I&&(I.liveStyle=!1)};for(const F in Zs){const I=J[F],U=Lt[F];if(h.hasOwnProperty(F))continue;let Q=!1;ot(I)&&ot(U)?Q=!js(I,U):Q=I!==U,Q?I!=null?It(F):f.add(F):I!==void 0&&f.has(F)?It(F):S.protectedKeys[F]=!0}S.prevProp=v,S.prevResolvedValues=J,S.isActive&&(h={...h,...J}),s&&e.blockInitialAnimation&&(V=!1);const Bt=P&&C;V&&(!Bt||D)&&d.push(...O.map(F=>{const I={type:m};if(typeof F=="string"&&s&&!Bt&&e.manuallyAnimateOnMount&&e.parent){const{parent:U}=e,Q=ie(U,F);if(U.enteringChildren&&Q){const{delayChildren:Js}=Q.transition||{};I.delay=hs(U.enteringChildren,e,Js)}}return{animation:F,options:I}}))}if(f.size){const y={};if(typeof u.initial!="boolean"){const m=ie(e,Array.isArray(u.initial)?u.initial[0]:u.initial);m&&m.transition&&(y.transition=m.transition)}f.forEach(m=>{const S=e.getBaseTarget(m),v=e.getValue(m);v&&(v.liveStyle=!0),y[m]=S??null}),d.push({animation:y})}let b=!!d.length;return s&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(b=!1),s=!1,b?t(d):Promise.resolve()}function a(l,u){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)==null||d.forEach(f=>{var h;return(h=f.animationState)==null?void 0:h.setActive(l,u)}),n[l].isActive=u;const c=o(l);for(const f in n)n[f].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=hn()}}}function Fa(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!js(t,e):!1}function G(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function hn(){return{animate:G(!0),whileInView:G(),whileHover:G(),whileTap:G(),whileDrag:G(),whileFocus:G(),exit:G()}}function pn(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}function Oa(e){return k(e)?e.get():e}const Ks=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Ft=w.createContext({strict:!1}),mn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let gn=!1;function ka(){if(gn)return;const e={};for(const t in mn)e[t]={isEnabled:n=>mn[t].some(s=>!!n[s])};Rs(e),gn=!0}function Ws(){return ka(),ua()}function yn(e){const t=Ws();for(const n in e)t[n]={...t[n],...e[n]};Rs(t)}function La({children:e,features:t,strict:n=!1}){const[,s]=w.useState(!_e(t)),i=w.useRef(void 0);if(!_e(t)){const{renderer:r,...o}=t;i.current=r,yn(o)}return w.useEffect(()=>{_e(t)&&t().then(({renderer:r,...o})=>{yn(o),i.current=r,s(!0)})},[]),M.jsx(Ft.Provider,{value:{renderer:i.current,strict:n},children:e})}function _e(e){return typeof e=="function"}const Ia=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function De(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ia.has(e)}let $s=e=>!De(e);function Ba(e){typeof e=="function"&&($s=t=>t.startsWith("on")?!De(t):e(t))}try{Ba(require("@emotion/is-prop-valid").default)}catch{}function Na(e,t,n){const s={};for(const i in e)i==="values"&&typeof e.values=="object"||($s(i)||n===!0&&De(i)||!t&&!De(i)||e.draggable&&i.startsWith("onDrag"))&&(s[i]=e[i]);return s}const Le=w.createContext({});function ja(e,t){if(ke(e)){const{initial:n,animate:s}=e;return{initial:n===!1||me(n)?n:void 0,animate:me(s)?s:void 0}}return e.inherit!==!1?t:{}}function Ka(e){const{initial:t,animate:n}=ja(e,w.useContext(Le));return w.useMemo(()=>({initial:t,animate:n}),[bn(t),bn(n)])}function bn(e){return Array.isArray(e)?e.join(" "):e}const Ot=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _s(e,t,n){for(const s in t)!k(t[s])&&!Os(s,n)&&(e[s]=t[s])}function Wa({transformTemplate:e},t){return w.useMemo(()=>{const n=Ot();return Rt(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $a(e,t){const n=e.style||{},s={};return _s(s,n,e),Object.assign(s,Wa(e,t)),s}function _a(e,t){const n={},s=$a(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Hs=()=>({...Ot(),attrs:{}});function Ha(e,t,n,s){const i=w.useMemo(()=>{const r=Hs();return ks(r,t,Is(s),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};_s(r,e.style,e),i.style={...r,...i.style}}return i}const Ua=["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 kt(e){return typeof e!="string"||e.includes("-")?!1:!!(Ua.indexOf(e)>-1||/[A-Z]/u.test(e))}function Ga(e,t,n,{latestValues:s},i,r=!1,o){const l=(o??kt(e)?Ha:_a)(t,s,i,e),u=Na(t,typeof e=="string",r),c=e!==w.Fragment?{...u,...l,ref:n}:{},{children:d}=t,f=w.useMemo(()=>k(d)?d.get():d,[d]);return w.createElement(e,{...c,children:f})}function za({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,i){return{latestValues:qa(n,s,i,e),renderState:t()}}function qa(e,t,n,s){const i={},r=s(e,{});for(const f in r)i[f]=Oa(r[f]);let{initial:o,animate:a}=e;const l=ke(e),u=Ps(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;if(d&&typeof d!="boolean"&&!Oe(d)){const f=Array.isArray(d)?d:[d];for(let h=0;h<f.length;h++){const p=Ct(e,f[h]);if(p){const{transitionEnd:b,transition:y,...m}=p;for(const S in m){let v=m[S];if(Array.isArray(v)){const A=c?v.length-1:0;v=v[A]}v!==null&&(i[S]=v)}for(const S in b)i[S]=b[S]}}}return i}const Us=e=>(t,n)=>{const s=w.useContext(Le),i=w.useContext(En),r=()=>za(e,t,s,i);return n?r():Oi(r)},Ya=Us({scrapeMotionValuesFromProps:Dt,createRenderState:Ot}),Xa=Us({scrapeMotionValuesFromProps:Bs,createRenderState:Hs}),Za=Symbol.for("motionComponentSymbol");function Ja(e,t,n){const s=w.useRef(n);w.useInsertionEffect(()=>{s.current=n});const i=w.useRef(null);return w.useCallback(r=>{var a;r&&((a=e.onMount)==null||a.call(e,r)),t&&(r?t.mount(r):t.unmount());const o=s.current;if(typeof o=="function")if(r){const l=o(r);typeof l=="function"&&(i.current=l)}else i.current?(i.current(),i.current=null):o(r);else o&&(o.current=r)},[t])}const Qa=w.createContext({});function ec(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function tc(e,t,n,s,i,r){var v,A;const{visualElement:o}=w.useContext(Le),a=w.useContext(Ft),l=w.useContext(En),u=w.useContext(Ks),c=u.reducedMotion,d=u.skipAnimations,f=w.useRef(null),h=w.useRef(!1);s=s||a.renderer,!f.current&&s&&(f.current=s(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c,skipAnimations:d,isSVG:r}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,b=w.useContext(Qa);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&nc(f.current,n,i,b);const y=w.useRef(!1);w.useInsertionEffect(()=>{p&&y.current&&p.update(n,l)});const m=n[bs],S=w.useRef(!!m&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,m))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,m)));return ki(()=>{h.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),S.current&&p.animationState&&p.animationState.animateChanges())}),w.useEffect(()=>{p&&(!S.current&&p.animationState&&p.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)==null||T.call(window,m)}),S.current=!1),p.enteringChildren=void 0)}),p}function nc(e,t,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Gs(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&ec(a),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function Gs(e){if(e)return e.options.allowProjection!==!1?e.projection:Gs(e.parent)}function sc(e,{forwardMotionProps:t=!1,type:n}={},s,i){const r=n?n==="svg":kt(e),o=r?Xa:Ya;function a(u,c){let d;const f={...w.useContext(Ks),...u,layoutId:ic(u)},{isStatic:h}=f,p=Ka(u),b=o(u,h);if(!h&&Pn){rc(f,s);const y=oc(f);d=y.MeasureLayout,p.visualElement=tc(e,b,f,i,y.ProjectionNode,r)}return M.jsxs(Le.Provider,{value:p,children:[d&&p.visualElement?M.jsx(d,{visualElement:p.visualElement,...f}):null,Ga(e,u,Ja(b,p.visualElement,c),b,h,t,r)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=w.forwardRef(a);return l[Za]=e,l}function ic({layoutId:e}){const t=w.useContext(Fi).id;return t&&e!==void 0?t+"-"+e:e}function rc(e,t){w.useContext(Ft).strict,process.env.NODE_ENV}function oc(e){const t=Ws(),{drag:n,layout:s}=t;if(!n&&!s)return{};const i={...n,...s};return{MeasureLayout:n!=null&&n.isEnabled(e)||s!=null&&s.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const ac=(e,t)=>t.isSVG??kt(e)?new Aa(t):new Ta(t,{allowProjection:e!==w.Fragment});class cc extends ue{constructor(t){super(t),t.animationState||(t.animationState=Da(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Oe(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let uc=0;class lc extends ue{constructor(){super(...arguments),this.id=uc++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const fc={animation:{Feature:cc},exit:{Feature:lc}};function zs(e){return{point:{x:e.pageX,y:e.pageY}}}function vn(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&j.postRender(()=>r(t,zs(t)))}class dc extends ue{mount(){const{current:t}=this.node;t&&(this.unmount=Zo(t,(n,s)=>(vn(this.node,s,"Start"),i=>vn(this.node,i,"End"))))}unmount(){}}class hc extends ue{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=Fe(pn(this.node.current,"focus",()=>this.onFocus()),pn(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Tn(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&j.postRender(()=>r(t,zs(t)))}class pc extends ue{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:s}=this.node.props;this.unmount=na(t,(i,r)=>(Tn(this.node,r,"Start"),(o,{success:a})=>Tn(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(s==null?void 0:s.tap)===!1})}unmount(){}}const ft=new WeakMap,He=new WeakMap,mc=e=>{const t=ft.get(e.target);t&&t(e)},gc=e=>{e.forEach(mc)};function yc({root:e,...t}){const n=e||document;He.has(n)||He.set(n,{});const s=He.get(n),i=JSON.stringify(t);return s[i]||(s[i]=new IntersectionObserver(gc,{root:e,...t})),s[i]}function bc(e,t,n){const s=yc(t);return ft.set(e,n),s.observe(e),()=>{ft.delete(e),s.unobserve(e)}}const vc={some:0,all:1};class Tc extends ue{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=t,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:vc[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return bc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(wc(t,n))&&this.startObserver()}unmount(){}}function wc({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const xc={inView:{Feature:Tc},tap:{Feature:pc},focus:{Feature:hc},hover:{Feature:dc}},Sc={renderer:ac,...fc,...xc};function Vc(e,t){return sc(e,t)}const dt=Vc("div"),qs=w.createContext({layers:[],setLayers:()=>{},addLayer:()=>{},removeLayer:()=>{},removeTopLayer:()=>{}}),Cc=({children:e})=>{const[t,n]=w.useState([]),s=o=>{n(a=>[...a,o])},i=o=>{n(t.filter(a=>a!==o))},r=()=>{const o=t[t.length-1];o&&i(o)};return M.jsx(qs.Provider,{value:{layers:t,setLayers:n,addLayer:s,removeLayer:i,removeTopLayer:r},children:e})},Ys=()=>w.useContext(qs),Ac=({defaultOpen:e,open:t,onOpenChange:n,...s})=>{const[i,r]=Ei({prop:t,onChange:n,defaultProp:e??!1}),o=Ys(),a=s.a11yTitle;if(w.useEffect(()=>{!i&&o.layers.includes(a)&&o.removeLayer(a)},[a,o,i]),!!i)return M.jsx(Mc,{open:i,onOpenChange:r,...s})},Mc=({open:e,onOpenChange:t,a11yTitle:n,a11yDescription:s,children:i,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,...l})=>{var b,y;const u=n,c=Ys();w.useEffect(()=>{!c||!e||c.layers.includes(u)||c.addLayer(u)},[u,c,e]);const d=((b=c.layers)==null?void 0:b.indexOf(u))||0,f=((y=c.layers)==null?void 0:y.length)||0,h=d!==0,p=u===c.layers[c.layers.length-1];return M.jsx(La,{features:Sc,children:M.jsx(An,{onEscapeKeyDown:m=>{p&&(m.preventDefault(),c.removeTopLayer(),t(!1))},onPointerDownOutside:m=>{p&&(m.preventDefault(),c.removeTopLayer(),t(!1))},children:M.jsxs(ne.Root,{open:e,onOpenChange:m=>{var v;if(((v=c==null?void 0:c.layers)==null?void 0:v.length)>0)return m===!1&&u===c.layers[c.layers.length-1]?(c.removeLayer(u),t(!1)):void 0;t(m)},children:[M.jsxs(li.Root,{children:[M.jsx(ne.Title,{children:n}),s&&M.jsx(ne.Description,{children:s})]}),e&&M.jsx(ui.Root,{className:"tgph",children:M.jsx(Pc,{layer:d,children:M.jsx(ti.FocusScope,{trapped:typeof r=="boolean"?r:p,onMountAutoFocus:o,onUnmountAutoFocus:a,asChild:!0,children:M.jsx(ri.RefToTgphRef,{children:M.jsx(X.Stack,{as:dt,initial:{top:`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${f-1})`},animate:{top:h?`calc(var(--tgph-spacing-16) + var(--tgph-spacing-4) * ${d} )`:"var(--tgph-spacing-16)"},exit:{top:0},transition:{type:"spring",duration:.3,bounce:0},w:"full",justify:"center",style:{position:"fixed",left:0,maxHeight:"calc(100vh - var(--tgph-spacing-32))",maxWidth:"calc(100vw - var(--tgph-spacing-8))",zIndex:`calc(var(--tgph-zIndex-modal) + ${d})`},children:M.jsx(X.Stack,{direction:"column",as:dt,animate:{scale:1.02-Math.abs(f-d)*.02,transformOrigin:"center center"},transition:{duration:.2,bounce:0,type:"spring"},maxW:l.maxW??"160",w:l.w??"full",bg:"surface-1",border:"px",borderColor:"gray-6",rounded:"4",shadow:"3",...l,children:i},`content-${u}`)},`container-${u}`)})})})})]},u)})})},Pc=({layer:e,children:t})=>e>0?t:M.jsxs(ne.Overlay,{children:[M.jsx(X.Box,{as:dt,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,bounce:0,type:"spring"},bg:"alpha-black-6",w:"full",h:"full",zIndex:"overlay",style:{position:"fixed",cursor:"pointer",inset:"0px"}}),t]}),Ec=w.forwardRef(({children:e,...t},n)=>M.jsx(ne.Content,{ref:n,asChild:!0,...t,children:M.jsx(X.Stack,{direction:"column",h:"full",...t,children:e})})),Rc=({size:e="1",variant:t="ghost",...n})=>M.jsx(ne.Close,{asChild:!0,children:M.jsx(ii.Button,{icon:{icon:ai.X,alt:"Close Modal"},variant:t,size:e,...n})}),Dc=({style:e,children:t,...n})=>M.jsx(X.Stack,{direction:"column",px:"6",py:"4",style:{overflowY:"auto",...e},...n,children:t}),Fc=({children:e,...t})=>M.jsx(X.Stack,{direction:"row",justify:"space-between",align:"center",px:"6",py:"4",borderBottom:"px",...t,children:e}),Oc=({children:e,...t})=>M.jsx(X.Stack,{direction:"row",align:"center",justify:"flex-end",gap:"2",px:"6",py:"4",borderTop:"px",...t,children:e}),kc=({as:e,size:t="3",weight:n="medium",...s})=>M.jsx(oi.Heading,{as:e||"h2",size:t,weight:n,...s}),Xs={};Object.assign(Xs,{Root:Ac,Content:Ec,Close:Rc,Body:Dc,Header:Fc,Footer:Oc,Heading:kc});exports.Modal=Xs;exports.ModalStackingProvider=Cc;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|