@telnyx/ai-agent-widget 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.min.js +1 -1
- package/package.json +1 -1
package/dist/bundle.min.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
${g}px !important;
|
|
7
7
|
top: ${d}px !important;
|
|
8
8
|
}
|
|
9
|
-
`),()=>{w.removeChild(_),w.contains(_)&&w.removeChild(_)}},[t]),A(Ff,{isPresent:t,childRef:o,sizeRef:r,children:$d(e,{ref:o})})}const jf=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:o,mode:r,anchorX:a,root:l})=>{const c=oi($f),d=ns();let u=!0,m=ne(()=>(u=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:g=>{c.set(g,!0);for(const _ of c.values())if(!_)return;i&&i()},register:g=>(c.set(g,!1),()=>c.delete(g))}),[n,c,i]);return o&&u&&(m={...m}),ne(()=>{c.forEach((g,_)=>c.set(_,!1))},[n]),Kt(()=>{!n&&!c.size&&i&&i()},[n]),r==="popLayout"&&(e=A(Bf,{isPresent:n,anchorX:a,root:l,children:e})),A(ai.Provider,{value:m,children:e})};function $f(){return new Map}function el(e=!0){const t=wt(ai);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=t,o=ns();Kt(()=>{if(e)return s(o)},[e]);const r=ii(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,r]:[!0]}const mi=e=>e.key||"";function nl(e){const t=[];return Id.forEach(e,n=>{Go(n)&&t.push(n)}),t}const Uf=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",root:l})=>{const[c,d]=el(r),u=ne(()=>nl(e),[e]),m=r&&!c?[]:u.map(mi),g=Bt(!0),_=Bt(u),w=oi(()=>new Map),[b,y]=ee(u),[S,C]=ee(u);zo(()=>{g.current=!1,_.current=u;for(let D=0;D<S.length;D++){const x=mi(S[D]);m.includes(x)?w.delete(x):w.get(x)!==!0&&w.set(x,!1)}},[S,m.length,m.join("-")]);const P=[];if(u!==b){let D=[...u];for(let x=0;x<S.length;x++){const k=S[x],f=mi(k);m.includes(f)||(D.splice(x,0,k),P.push(k))}return o==="wait"&&P.length&&(D=P),C(nl(D)),y(u),null}const{forceRender:L}=wt(os);return A(Qt,{children:S.map(D=>{const x=mi(D),k=r&&!c?!1:u===S||m.includes(x),f=()=>{if(w.has(x))w.set(x,!0);else return;let p=!0;w.forEach(h=>{h||(p=!1)}),p&&(L==null||L(),C(_.current),r&&(d==null||d()),i&&i())};return A(jf,{isPresent:k,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:l,onExitComplete:k?void 0:f,anchorX:a,children:D},x)})})},il=Ae({strict:!1}),sl={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"]},Ze={};for(const e in sl)Ze[e]={isEnabled:t=>sl[e].some(n=>!!t[n])};function Gf(e){for(const t in e)Ze[t]={...Ze[t],...e[t]}}const Hf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function gi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Hf.has(e)}let rl=e=>!gi(e);function ol(e){typeof e=="function"&&(rl=t=>t.startsWith("on")?!gi(t):e(t))}try{ol(require("@emotion/is-prop-valid").default)}catch{}function zf(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(rl(s)||n===!0&&gi(s)||!t&&!gi(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Wf({children:e,isValidProp:t,...n}){t&&ol(t),n={...wt(Rn),...n},n.isStatic=oi(()=>n.isStatic);const i=ne(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return A(Rn.Provider,{value:i,children:e})}function qf(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const vi=Ae({});function _i(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function In(e){return typeof e=="string"||Array.isArray(e)}const Ks=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Xs=["initial",...Ks];function yi(e){return _i(e.animate)||Xs.some(t=>In(e[t]))}function al(e){return!!(yi(e)||e.variants)}function Kf(e,t){if(yi(e)){const{initial:n,animate:i}=e;return{initial:n===!1||In(n)?n:void 0,animate:In(i)?i:void 0}}return e.inherit!==!1?t:{}}function Xf(e){const{initial:t,animate:n}=Kf(e,wt(vi));return ne(()=>({initial:t,animate:n}),[ll(t),ll(n)])}function ll(e){return Array.isArray(e)?e.join(" "):e}const Yf=Symbol.for("motionComponentSymbol");function Je(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Zf(e,t,n){return ii(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Je(n)&&(n.current=i))},[t])}const Ys=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),cl="data-"+Ys("framerAppearId"),ul=Ae({});function Jf(e,t,n,i,s){var w,b;const{visualElement:o}=wt(vi),r=wt(il),a=wt(ai),l=wt(Rn).reducedMotion,c=Bt(null);i=i||r.renderer,!c.current&&i&&(c.current=i(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=wt(ul);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Qf(c.current,n,s,u);const m=Bt(!1);Ro(()=>{d&&m.current&&d.update(n,a)});const g=n[cl],_=Bt(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,g)));return zo(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),zs.render(d.render),_.current&&d.animationState&&d.animationState.animateChanges())}),Kt(()=>{d&&(!_.current&&d.animationState&&d.animationState.animateChanges(),_.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,g)}),_.current=!1))}),d}function Qf(e,t,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:dl(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!r||a&&Je(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:d,layoutScroll:l,layoutRoot:c})}function dl(e){if(e)return e.options.allowProjection!==!1?e.projection:dl(e.parent)}function tp({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Gf(e);function o(a,l){let c;const d={...wt(Rn),...a,layoutId:ep(a)},{isStatic:u}=d,m=Xf(a),g=i(a,u);if(!u&&as){np();const _=ip(d);c=_.MeasureLayout,m.visualElement=Jf(s,g,d,t,_.ProjectionNode)}return A(vi.Provider,{value:m,children:[c&&m.visualElement?A(c,{visualElement:m.visualElement,...d}):null,n(s,a,Zf(g,m.visualElement,l),g,u,m.visualElement)]})}o.displayName=`motion.${typeof s=="string"?s:`create(${s.displayName??s.name??""})`}`;const r=Rd(o);return r[Yf]=s,r}function ep({layoutId:e}){const t=wt(os).id;return t&&e!==void 0?t+"-"+e:e}function np(e,t){wt(il).strict}function ip(e){const{drag:t,layout:n}=Ze;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const Pn={};function sp(e){for(const t in e)Pn[t]=e[t],gs(t)&&(Pn[t].isCSSVariable=!0)}function hl(e,{layout:t,layoutId:n}){return Xe.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Pn[e]||e==="opacity")}const rp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},op=Ke.length;function ap(e,t,n){let i="",s=!0;for(let o=0;o<op;o++){const r=Ke[o],a=e[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Wa(a,Hs[r]);if(!l){s=!1;const d=rp[r]||r;i+=`${d}(${c}) `}n&&(t[r]=c)}}return i=i.trim(),n?i=n(t,s?"":i):s&&(i="none"),i}function Zs(e,t,n){const{style:i,vars:s,transformOrigin:o}=e;let r=!1,a=!1;for(const l in t){const c=t[l];if(Xe.has(l)){r=!0;continue}else if(gs(l)){s[l]=c;continue}else{const d=Wa(c,Hs[l]);l.startsWith("origin")?(a=!0,o[l]=d):i[l]=d}}if(t.transform||(r||n?i.transform=ap(t,e.transform,n):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;i.transformOrigin=`${l} ${c} ${d}`}}const Js=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fl(e,t,n){for(const i in t)!kt(t[i])&&!hl(i,n)&&(e[i]=t[i])}function lp({transformTemplate:e},t){return ne(()=>{const n=Js();return Zs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function cp(e,t){const n=e.style||{},i={};return fl(i,n,e),Object.assign(i,lp(e,t)),i}function up(e,t){const n={},i=cp(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const dp={offset:"stroke-dashoffset",array:"stroke-dasharray"},hp={offset:"strokeDashoffset",array:"strokeDasharray"};function fp(e,t,n=1,i=0,s=!0){e.pathLength=1;const o=s?dp:hp;e[o.offset]=U.transform(-i);const r=U.transform(t),a=U.transform(n);e[o.array]=`${r} ${a}`}function pl(e,{attrX:t,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,d){if(Zs(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:u,style:m}=e;u.transform&&(m.transform=u.transform,delete u.transform),(m.transform||u.transformOrigin)&&(m.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),m.transform&&(m.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete u.transformBox),t!==void 0&&(u.x=t),n!==void 0&&(u.y=n),i!==void 0&&(u.scale=i),s!==void 0&&fp(u,s,o,r,!1)}const ml=()=>({...Js(),attrs:{}}),gl=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pp(e,t,n,i){const s=ne(()=>{const o=ml();return pl(o,t,gl(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};fl(o,e.style,e),s.style={...o,...s.style}}return s}const mp=["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 Qs(e){return typeof e!="string"||e.includes("-")?!1:!!(mp.indexOf(e)>-1||/[A-Z]/u.test(e))}function gp(e=!1){return(n,i,s,{latestValues:o},r)=>{const l=(Qs(n)?pp:up)(i,o,r,n),c=zf(i,typeof n=="string",e),d=n!==Qt?{...c,...l,ref:s}:{},{children:u}=i,m=ne(()=>kt(u)?u.get():u,[u]);return Ft(n,{...d,children:m})}}function vl(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function tr(e,t,n,i){if(typeof t=="function"){const[s,o]=vl(i);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=vl(i);t=t(n!==void 0?n:e.custom,s,o)}return t}function bi(e){return kt(e)?e.get():e}function vp({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,s){return{latestValues:_p(n,i,s,e),renderState:t()}}const _l=e=>(t,n)=>{const i=wt(vi),s=wt(ai),o=()=>vp(e,t,i,s);return n?o():oi(o)};function _p(e,t,n,i){const s={},o=i(e,{});for(const m in o)s[m]=bi(o[m]);let{initial:r,animate:a}=e;const l=yi(e),c=al(e);t&&c&&!l&&e.inherit!==!1&&(r===void 0&&(r=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||r===!1;const u=d?a:r;if(u&&typeof u!="boolean"&&!_i(u)){const m=Array.isArray(u)?u:[u];for(let g=0;g<m.length;g++){const _=tr(e,m[g]);if(_){const{transitionEnd:w,transition:b,...y}=_;for(const S in y){let C=y[S];if(Array.isArray(C)){const P=d?C.length-1:0;C=C[P]}C!==null&&(s[S]=C)}for(const S in w)s[S]=w[S]}}}return s}function er(e,t,n){var o;const{style:i}=e,s={};for(const r in i)(kt(i[r])||t.style&&kt(t.style[r])||hl(r,e)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(s[r]=i[r]);return s}const yp={useVisualState:_l({scrapeMotionValuesFromProps:er,createRenderState:Js})};function yl(e,t,n){const i=er(e,t,n);for(const s in e)if(kt(e[s])||kt(t[s])){const o=Ke.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[o]=e[s]}return i}const bp={useVisualState:_l({scrapeMotionValuesFromProps:yl,createRenderState:ml})};function wp(e,t){return function(i,{forwardMotionProps:s}={forwardMotionProps:!1}){const r={...Qs(i)?bp:yp,preloadedFeatures:e,useRender:gp(s),createVisualElement:t,Component:i};return tp(r)}}function Mn(e,t,n){const i=e.getProps();return tr(i,t,n!==void 0?n:i.custom,e)}const nr=e=>Array.isArray(e);function xp(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ye(n))}function Sp(e){return nr(e)?e[e.length-1]||0:e}function Cp(e,t){const n=Mn(e,t);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const r in o){const a=Sp(o[r]);xp(e,r,a)}}function kp(e){return!!(kt(e)&&e.add)}function ir(e,t){const n=e.getValue("willChange");if(kp(n))return n.add(t);if(!n&&pe.WillChange){const i=new pe.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function bl(e){return e.props[cl]}const Tp=e=>e!==null;function Ep(e,{repeat:t,repeatType:n="loop"},i){const s=e.filter(Tp),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const Ap={type:"spring",stiffness:500,damping:25,restSpeed:10},Rp=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ip={type:"keyframes",duration:.8},Pp={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Mp=(e,{keyframes:t})=>t.length>2?Ip:Xe.has(e)?e.startsWith("scale")?Rp(t[1]):Ap:Pp;function Lp({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const sr=(e,t,n,i={},s,o)=>r=>{const a=Us(i,e)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-ie(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:s};Lp(a)||Object.assign(d,Mp(e,d)),d.duration&&(d.duration=ie(d.duration)),d.repeatDelay&&(d.repeatDelay=ie(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),(pe.instantAnimations||pe.skipAnimations)&&(u=!0,d.duration=0,d.delay=0),d.allowFlatten=!a.type&&!a.ease,u&&!o&&t.get()!==void 0){const m=Ep(d.keyframes,a);if(m!==void 0){ut.update(()=>{d.onUpdate(m),d.onComplete()});return}}return a.isSync?new Ms(d):new pf(d)};function Dp({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function wl(e,t,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:r,...a}=t;i&&(o=i);const l=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const d in a){const u=e.getValue(d,e.latestValues[d]??null),m=a[d];if(m===void 0||c&&Dp(c,d))continue;const g={delay:n,...Us(o||{},d)},_=u.get();if(_!==void 0&&!u.isAnimating&&!Array.isArray(m)&&m===_&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const y=bl(e);if(y){const S=window.MotionHandoffAnimation(y,d,ut);S!==null&&(g.startTime=S,w=!0)}}ir(e,d),u.start(sr(d,u,m,e.shouldReduceMotion&&Ba.has(d)?{type:!1}:g,e,w));const b=u.animation;b&&l.push(b)}return r&&Promise.all(l).then(()=>{ut.update(()=>{r&&Cp(e,r)})}),l}function rr(e,t,n={}){var l;const i=Mn(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(wl(e,i,n)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:m}=s;return Op(e,t,c,d,u,m,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,d]=a==="beforeChildren"?[o,r]:[r,o];return c().then(()=>d())}else return Promise.all([o(),r(n.delay)])}function Op(e,t,n=0,i=0,s=0,o=1,r){const a=[],l=e.variantChildren.size,c=(l-1)*s,d=typeof i=="function",u=d?m=>i(m,l):o===1?(m=0)=>m*s:(m=0)=>c-m*s;return Array.from(e.variantChildren).sort(Np).forEach((m,g)=>{m.notify("AnimationStart",t),a.push(rr(m,t,{...r,delay:n+(d?0:i)+u(g)}).then(()=>m.notify("AnimationComplete",t)))}),Promise.all(a)}function Np(e,t){return e.sortNodePosition(t)}function Vp(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(o=>rr(e,o,n));i=Promise.all(s)}else if(typeof t=="string")i=rr(e,t,n);else{const s=typeof t=="function"?Mn(e,t,n.custom):t;i=Promise.all(wl(e,s,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}function xl(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const Fp=Xs.length;function Sl(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Sl(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Fp;n++){const i=Xs[n],s=e.props[i];(In(s)||s===!1)&&(t[i]=s)}return t}const Bp=[...Ks].reverse(),jp=Ks.length;function $p(e){return t=>Promise.all(t.map(({animation:n,options:i})=>Vp(e,n,i)))}function Up(e){let t=$p(e),n=Cl(),i=!0;const s=l=>(c,d)=>{var m;const u=Mn(e,d,l==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(u){const{transition:g,transitionEnd:_,...w}=u;c={...c,...w,..._}}return c};function o(l){t=l(e)}function r(l){const{props:c}=e,d=Sl(e.parent)||{},u=[],m=new Set;let g={},_=1/0;for(let b=0;b<jp;b++){const y=Bp[b],S=n[y],C=c[y]!==void 0?c[y]:d[y],P=In(C),L=y===l?S.isActive:null;L===!1&&(_=b);let D=C===d[y]&&C!==c[y]&&P;if(D&&i&&e.manuallyAnimateOnMount&&(D=!1),S.protectedKeys={...g},!S.isActive&&L===null||!C&&!S.prevProp||_i(C)||typeof C=="boolean")continue;const x=Gp(S.prevProp,C);let k=x||y===l&&S.isActive&&!D&&P||b>_&&P,f=!1;const p=Array.isArray(C)?C:[C];let h=p.reduce(s(y),{});L===!1&&(h={});const{prevResolvedValues:v={}}=S,T={...v,...h},R=I=>{k=!0,m.has(I)&&(f=!0,m.delete(I)),S.needsAnimating[I]=!0;const N=e.getValue(I);N&&(N.liveStyle=!1)};for(const I in T){const N=h[I],K=v[I];if(g.hasOwnProperty(I))continue;let F=!1;nr(N)&&nr(K)?F=!xl(N,K):F=N!==K,F?N!=null?R(I):m.add(I):N!==void 0&&m.has(I)?R(I):S.protectedKeys[I]=!0}S.prevProp=C,S.prevResolvedValues=h,S.isActive&&(g={...g,...h}),i&&e.blockInitialAnimation&&(k=!1),k&&(!(D&&x)||f)&&u.push(...p.map(I=>({animation:I,options:{type:y}})))}if(m.size){const b={};if(typeof c.initial!="boolean"){const y=Mn(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(b.transition=y.transition)}m.forEach(y=>{const S=e.getBaseTarget(y),C=e.getValue(y);C&&(C.liveStyle=!0),b[y]=S??null}),u.push({animation:b})}let w=!!u.length;return i&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),i=!1,w?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(m=>{var g;return(g=m.animationState)==null?void 0:g.setActive(l,c)}),n[l].isActive=c;const d=r(l);for(const m in n)n[m].protectedKeys={};return d}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Cl(),i=!0}}}function Gp(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xl(t,e):!1}function Le(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cl(){return{animate:Le(!0),whileInView:Le(),whileHover:Le(),whileTap:Le(),whileDrag:Le(),whileFocus:Le(),exit:Le()}}class we{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Hp extends we{constructor(t){super(t),t.animationState||(t.animationState=Up(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_i(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 zp=0;class Wp extends we{constructor(){super(...arguments),this.id=zp++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 qp={animation:{Feature:Hp},exit:{Feature:Wp}};function Ln(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function Dn(e){return{point:{x:e.pageX,y:e.pageY}}}const Kp=e=>t=>Ws(t)&&e(t,Dn(t));function On(e,t,n,i){return Ln(e,t,Kp(n),i)}function kl({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function Xp({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Yp(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}const Tl=1e-4,Zp=1-Tl,Jp=1+Tl,El=.01,Qp=0-El,tm=0+El;function Et(e){return e.max-e.min}function em(e,t,n){return Math.abs(e-t)<=n}function Al(e,t,n,i=.5){e.origin=i,e.originPoint=mt(t.min,t.max,e.origin),e.scale=Et(n)/Et(t),e.translate=mt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Zp&&e.scale<=Jp||isNaN(e.scale))&&(e.scale=1),(e.translate>=Qp&&e.translate<=tm||isNaN(e.translate))&&(e.translate=0)}function Nn(e,t,n,i){Al(e.x,t.x,n.x,i?i.originX:void 0),Al(e.y,t.y,n.y,i?i.originY:void 0)}function Rl(e,t,n){e.min=n.min+t.min,e.max=e.min+Et(t)}function nm(e,t,n){Rl(e.x,t.x,n.x),Rl(e.y,t.y,n.y)}function Il(e,t,n){e.min=t.min-n.min,e.max=e.min+Et(t)}function Vn(e,t,n){Il(e.x,t.x,n.x),Il(e.y,t.y,n.y)}const Pl=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qe=()=>({x:Pl(),y:Pl()}),Ml=()=>({min:0,max:0}),_t=()=>({x:Ml(),y:Ml()});function $t(e){return[e("x"),e("y")]}function or(e){return e===void 0||e===1}function ar({scale:e,scaleX:t,scaleY:n}){return!or(e)||!or(t)||!or(n)}function De(e){return ar(e)||Ll(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ll(e){return Dl(e.x)||Dl(e.y)}function Dl(e){return e&&e!=="0%"}function wi(e,t,n){const i=e-n,s=t*i;return n+s}function Ol(e,t,n,i,s){return s!==void 0&&(e=wi(e,s,i)),wi(e,n,i)+t}function lr(e,t=0,n=1,i,s){e.min=Ol(e.min,t,n,i,s),e.max=Ol(e.max,t,n,i,s)}function Nl(e,{x:t,y:n}){lr(e.x,t.translate,t.scale,t.originPoint),lr(e.y,n.translate,n.scale,n.originPoint)}const Vl=.999999999999,Fl=1.0000000000001;function im(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,r;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&en(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(t.x*=r.x.scale,t.y*=r.y.scale,Nl(e,r)),i&&De(o.latestValues)&&en(e,o.latestValues))}t.x<Fl&&t.x>Vl&&(t.x=1),t.y<Fl&&t.y>Vl&&(t.y=1)}function tn(e,t){e.min=e.min+t,e.max=e.max+t}function Bl(e,t,n,i,s=.5){const o=mt(e.min,e.max,s);lr(e,t,n,o,i)}function en(e,t){Bl(e.x,t.x,t.scaleX,t.scale,t.originX),Bl(e.y,t.y,t.scaleY,t.scale,t.originY)}function jl(e,t){return kl(Yp(e.getBoundingClientRect(),t))}function sm(e,t,n){const i=jl(e,n),{scroll:s}=t;return s&&(tn(i.x,s.offset.x),tn(i.y,s.offset.y)),i}const $l=({current:e})=>e?e.ownerDocument.defaultView:null,Ul=(e,t)=>Math.abs(e-t);function rm(e,t){const n=Ul(e.x,t.x),i=Ul(e.y,t.y);return Math.sqrt(n**2+i**2)}class Gl{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=ur(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,_=rm(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!_)return;const{point:w}=m,{timestamp:b}=St;this.history.push({...w,timestamp:b});const{onStart:y,onMove:S}=this.handlers;g||(y&&y(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=cr(g,this.transformPagePoint),ut.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:_,onSessionEnd:w,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ur(m.type==="pointercancel"?this.lastMoveEventInfo:cr(g,this.transformPagePoint),this.history);this.startEvent&&_&&_(m,y),w&&w(m,y)},!Ws(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=s||window;const a=Dn(t),l=cr(a,this.transformPagePoint),{point:c}=l,{timestamp:d}=St;this.history=[{...c,timestamp:d}];const{onSessionStart:u}=n;u&&u(t,ur(l,this.history)),this.removeListeners=bn(On(this.contextWindow,"pointermove",this.handlePointerMove),On(this.contextWindow,"pointerup",this.handlePointerUp),On(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_e(this.updatePoint)}}function cr(e,t){return t?{point:t(e.point)}:e}function Hl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ur({point:e},t){return{point:e,delta:Hl(e,zl(t)),offset:Hl(e,om(t)),velocity:am(t,.1)}}function om(e){return e[0]}function zl(e){return e[e.length-1]}function am(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=zl(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>ie(t)));)n--;if(!i)return{x:0,y:0};const o=se(s.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function lm(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?mt(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?mt(n,e,i.max):Math.min(e,n)),e}function Wl(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function cm(e,{top:t,left:n,bottom:i,right:s}){return{x:Wl(e.x,n,s),y:Wl(e.y,t,i)}}function ql(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function um(e,t){return{x:ql(e.x,t.x),y:ql(e.y,t.y)}}function dm(e,t){let n=.5;const i=Et(e),s=Et(t);return s>i?n=wn(t.min,t.max-i,e.min):i>s&&(n=wn(e.min,e.max-s,t.min)),fe(0,1,n)}function hm(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const dr=.35;function fm(e=dr){return e===!1?e=0:e===!0&&(e=dr),{x:Kl(e,"left","right"),y:Kl(e,"top","bottom")}}function Kl(e,t,n){return{min:Xl(e,t),max:Xl(e,n)}}function Xl(e,t){return typeof e=="number"?e:e[t]||0}const pm=new WeakMap;class mm{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_t(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:m}=this.getProps();m?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Dn(u).point)},r=(u,m)=>{const{drag:g,dragPropagation:_,onDragStart:w}=this.getProps();if(g&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Rf(g),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$t(y=>{let S=this.getAxisMotionValue(y).get()||0;if(re.test(S)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[y];P&&(S=Et(P)*(parseFloat(S)/100))}}this.originPoint[y]=S}),w&&ut.postRender(()=>w(u,m)),ir(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m;const{dragPropagation:g,dragDirectionLock:_,onDirectionLock:w,onDrag:b}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:y}=m;if(_&&this.currentDirection===null){this.currentDirection=gm(y),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,y),this.updateAxis("y",m.point,y),this.visualElement.render(),b&&b(u,m)},l=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m,this.stop(u,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>$t(u=>{var m;return this.getAnimationState(u)==="paused"&&((m=this.getAxisMotionValue(u).animation)==null?void 0:m.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Gl(t,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:i,contextWindow:$l(this.visualElement)})}stop(t,n){const i=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:r}=s;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&ut.postRender(()=>a(i,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!xi(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=lm(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&Je(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=cm(i.layoutBox,t):this.constraints=!1,this.elastic=fm(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&$t(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=hm(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Je(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=sm(i,s.root,this.visualElement.getTransformPagePoint());let r=um(s.layout.layoutBox,o);if(n){const a=n(Xp(r));this.hasMutatedConstraints=!!a,a&&(r=kl(a))}return r}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=$t(d=>{if(!xi(d,n,this.currentDirection))return;let u=l&&l[d]||{};r&&(u={min:0,max:0});const m=s?200:1e6,g=s?40:1e7,_={type:"inertia",velocity:i?t[d]:0,bounceStiffness:m,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(d,_)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return ir(this.visualElement,t),i.start(sr(t,i,0,n,this.visualElement,!1))}stopAnimation(){$t(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){$t(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){$t(n=>{const{drag:i}=this.getProps();if(!xi(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:r,max:a}=s.layout.layoutBox[n];o.set(t[n]-mt(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Je(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};$t(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();s[r]=dm({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),$t(r=>{if(!xi(r,t,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(mt(l,c,s[r]))})}addListeners(){if(!this.visualElement.current)return;pm.set(this.visualElement,this);const t=this.visualElement.current,n=On(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Je(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ut.read(i);const r=Ln(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&($t(d=>{const u=this.getAxisMotionValue(d);u&&(this.originPoint[d]+=l[d].translate,u.set(u.get()+l[d].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:r=dr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function xi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function gm(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class vm extends we{constructor(t){super(t),this.removeGroupControls=jt,this.removeListeners=jt,this.controls=new mm(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Yl=e=>(t,n)=>{e&&ut.postRender(()=>e(t,n))};class _m extends we{constructor(){super(...arguments),this.removePointerDownListener=jt}onPointerDown(t){this.session=new Gl(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$l(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Yl(t),onStart:Yl(n),onMove:i,onEnd:(o,r)=>{delete this.session,s&&ut.postRender(()=>s(o,r))}}}mount(){this.removePointerDownListener=On(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Si={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Zl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(U.test(e))e=parseFloat(e);else return e;const n=Zl(e,t.target.x),i=Zl(e,t.target.y);return`${n}% ${i}%`}},ym={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=be.parse(e);if(s.length>5)return i;const o=be.createTransformer(e),r=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+r]/=a,s[1+r]/=l;const c=mt(a,l,.5);return typeof s[2+r]=="number"&&(s[2+r]/=c),typeof s[3+r]=="number"&&(s[3+r]/=c),o(s)}};let Jl=!1;class bm extends qt{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:o}=t;sp(wm),o&&(n.group&&n.group.add(o),i&&i.register&&s&&i.register(o),Jl&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Si.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:r}=i;return r&&(r.isPresent=o,Jl=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||ut.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ql(e){const[t,n]=el(),i=wt(os);return A(bm,{...e,layoutGroup:i,switchLayoutGroup:wt(ul),isPresent:t,safeToRemove:n})}const wm={borderRadius:{...Fn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fn,borderTopRightRadius:Fn,borderBottomLeftRadius:Fn,borderBottomRightRadius:Fn,boxShadow:ym};function xm(e,t,n){const i=kt(e)?e:Ye(e);return i.start(sr("",i,t,n)),i.animation}const Sm=(e,t)=>e.depth-t.depth;class Cm{constructor(){this.children=[],this.isDirty=!1}add(t){ls(this.children,t),this.isDirty=!0}remove(t){cs(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Sm),this.isDirty=!1,this.children.forEach(t)}}function km(e,t){const n=Mt.now(),i=({timestamp:s})=>{const o=s-n;o>=t&&(_e(i),e(o-t))};return ut.setup(i,!0),()=>_e(i)}const tc=["TopLeft","TopRight","BottomLeft","BottomRight"],Tm=tc.length,ec=e=>typeof e=="string"?parseFloat(e):e,nc=e=>typeof e=="number"||U.test(e);function Em(e,t,n,i,s,o){s?(e.opacity=mt(0,n.opacity??1,Am(i)),e.opacityExit=mt(t.opacity??1,0,Rm(i))):o&&(e.opacity=mt(t.opacity??1,n.opacity??1,i));for(let r=0;r<Tm;r++){const a=`border${tc[r]}Radius`;let l=ic(t,a),c=ic(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||nc(l)===nc(c)?(e[a]=Math.max(mt(ec(l),ec(c),i),0),(re.test(c)||re.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=mt(t.rotate||0,n.rotate||0,i))}function ic(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Am=sc(0,.5,na),Rm=sc(.5,.95,jt);function sc(e,t,n){return i=>i<e?0:i>t?1:n(wn(e,t,i))}function rc(e,t){e.min=t.min,e.max=t.max}function Ut(e,t){rc(e.x,t.x),rc(e.y,t.y)}function oc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ac(e,t,n,i,s){return e-=t,e=wi(e,1/n,i),s!==void 0&&(e=wi(e,1/s,i)),e}function Im(e,t=0,n=1,i=.5,s,o=e,r=e){if(re.test(t)&&(t=parseFloat(t),t=mt(r.min,r.max,t/100)-r.min),typeof t!="number")return;let a=mt(o.min,o.max,i);e===o&&(a-=t),e.min=ac(e.min,t,n,a,s),e.max=ac(e.max,t,n,a,s)}function lc(e,t,[n,i,s],o,r){Im(e,t[n],t[i],t[s],t.scale,o,r)}const Pm=["x","scaleX","originX"],Mm=["y","scaleY","originY"];function cc(e,t,n,i){lc(e.x,t,Pm,n?n.x:void 0,i?i.x:void 0),lc(e.y,t,Mm,n?n.y:void 0,i?i.y:void 0)}function uc(e){return e.translate===0&&e.scale===1}function dc(e){return uc(e.x)&&uc(e.y)}function hc(e,t){return e.min===t.min&&e.max===t.max}function Lm(e,t){return hc(e.x,t.x)&&hc(e.y,t.y)}function fc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pc(e,t){return fc(e.x,t.x)&&fc(e.y,t.y)}function mc(e){return Et(e.x)/Et(e.y)}function gc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Dm{constructor(){this.members=[]}add(t){ls(this.members,t),t.scheduleRender()}remove(t){if(cs(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){i=o;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Om(e,t,n){let i="";const s=e.x.translate/t.x,o=e.y.translate/t.y,r=(n==null?void 0:n.z)||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:u,rotateY:m,skewX:g,skewY:_}=n;c&&(i=`perspective(${c}px) ${i}`),d&&(i+=`rotate(${d}deg) `),u&&(i+=`rotateX(${u}deg) `),m&&(i+=`rotateY(${m}deg) `),g&&(i+=`skewX(${g}deg) `),_&&(i+=`skewY(${_}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const hr=["","X","Y","Z"],Nm=1e3;let Vm=0;function fr(e,t,n,i){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function vc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=bl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ut,!(s||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&vc(i)}function _c({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(r={},a=t==null?void 0:t()){this.id=Vm++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jm),this.nodes.forEach(Hm),this.nodes.forEach(zm),this.nodes.forEach($m)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Cm)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new hs),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=tl(r)&&!Of(r),this.instance=r;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let d,u=0;const m=()=>this.root.updateBlockedByResize=!1;ut.read(()=>{u=window.innerWidth}),e(r,()=>{const g=window.innerWidth;g!==u&&(u=g,this.root.updateBlockedByResize=!0,d&&d(),d=km(m,250),Si.hasAnimatedSinceResize&&(Si.hasAnimatedSinceResize=!1,this.nodes.forEach(wc)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:u,hasRelativeLayoutChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||c.getDefaultTransition()||Ym,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!pc(this.targetLayout,g),S=!u&&m;if(this.options.layoutRoot||this.resumeFrom||S||u&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Us(_,"layout"),onPlay:w,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(d,S)}else u||wc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),_e(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Wm),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&vc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(yc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(bc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Gm),this.nodes.forEach(Fm),this.nodes.forEach(Bm)):this.nodes.forEach(bc),this.clearAllSnapshots();const a=Mt.now();St.delta=fe(0,1e3/60,a-St.timestamp),St.timestamp=a,St.isProcessing=!0,ms.update.process(St),ms.preRender.process(St),ms.render.process(St),St.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Um),this.sharedNodes.forEach(qm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ut.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ut.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Et(this.snapshot.measuredBox.x)&&!Et(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=_t(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=i(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!dc(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;r&&this.instance&&(a||De(this.latestValues)||d)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Zm(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:r}=this.options;if(!r)return _t();const a=r.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(Jm))){const{scroll:d}=this.root;d&&(tn(a.x,d.offset.x),tn(a.y,d.offset.y))}return a}removeElementScroll(r){var l;const a=_t();if(Ut(a,r),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:u,options:m}=d;d!==this.root&&u&&m.layoutScroll&&(u.wasRoot&&Ut(a,r),tn(a.x,u.offset.x),tn(a.y,u.offset.y))}return a}applyTransform(r,a=!1){const l=_t();Ut(l,r);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&en(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),De(d.latestValues)&&en(l,d.latestValues)}return De(this.latestValues)&&en(l,this.latestValues),l}removeTransform(r){const a=_t();Ut(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!De(c.latestValues))continue;ar(c.latestValues)&&c.updateSnapshot();const d=_t(),u=c.measurePageBox();Ut(d,u),cc(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return De(this.latestValues)&&cc(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==St.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=St.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),Vn(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Ut(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_t(),this.targetWithTransforms=_t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nm(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ut(this.target,this.layout.layoutBox),Nl(this.target,this.targetDelta)):Ut(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),Vn(this.relativeTargetOrigin,this.target,g.target),Ut(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ar(this.parent.latestValues)||Ll(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var _;const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===St.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;Ut(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,m=this.treeScale.y;im(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=_t());const{target:g}=r;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(oc(this.prevProjectionDelta.x,this.projectionDelta.x),oc(this.prevProjectionDelta.y,this.projectionDelta.y)),Nn(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==m||!gc(this.projectionDelta.x,this.prevProjectionDelta.x)||!gc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Qe(),this.projectionDelta=Qe(),this.projectionDeltaWithTransform=Qe()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Qe();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const m=_t(),g=l?l.source:void 0,_=this.layout?this.layout.source:void 0,w=g!==_,b=this.getStack(),y=!b||b.members.length<=1,S=!!(w&&!y&&this.options.crossfade===!0&&!this.path.some(Xm));this.animationProgress=0;let C;this.mixTargetDelta=P=>{const L=P/1e3;xc(u.x,r.x,L),xc(u.y,r.y,L),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vn(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Km(this.relativeTarget,this.relativeTargetOrigin,m,L),C&&Lm(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=_t()),Ut(C,this.relativeTarget)),w&&(this.animationValues=d,Em(d,c,this.latestValues,L,S,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(_e(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ut.update(()=>{Si.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ye(0)),this.currentAnimation=xm(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),r.onUpdate&&r.onUpdate(d)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Nm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&Ec(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||_t();const u=Et(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+u;const m=Et(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+m}Ut(a,l),en(a,d),Nn(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Dm),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var a;const{layoutId:r}=this.options;return r?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:r}=this.options;return r?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&fr("z",r,c,this.animationValues);for(let d=0;d<hr.length;d++)fr(`rotate${hr[d]}`,r,c,this.animationValues),fr(`skew${hr[d]}`,r,c,this.animationValues);r.render();for(const d in c)r.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=bi(a==null?void 0:a.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=bi(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!De(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const d=c.animationValues||c.latestValues;this.applyTransformsToTarget();let u=Om(this.projectionDeltaWithTransform,this.treeScale,d);l&&(u=l(d,u)),r.transform=u;const{x:m,y:g}=this.projectionDelta;r.transformOrigin=`${m.origin*100}% ${g.origin*100}% 0`,c.animationValues?r.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:r.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const _ in Pn){if(d[_]===void 0)continue;const{correct:w,applyTo:b,isCSSVariable:y}=Pn[_],S=u==="none"?d[_]:w(d[_],c);if(b){const C=b.length;for(let P=0;P<C;P++)r[b[P]]=S}else y?this.options.visualElement.renderState.vars[_]=S:r[_]=S}this.options.layoutId&&(r.pointerEvents=c===this?bi(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(yc),this.root.sharedNodes.clear()}}}function Fm(e){e.updateLayout()}function Bm(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:o}=e.options,r=t.source!==e.layout.source;o==="size"?$t(u=>{const m=r?t.measuredBox[u]:t.layoutBox[u],g=Et(m);m.min=i[u].min,m.max=m.min+g}):Ec(o,t.layoutBox,i)&&$t(u=>{const m=r?t.measuredBox[u]:t.layoutBox[u],g=Et(i[u]);m.max=m.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+g)});const a=Qe();Nn(a,i,t.layoutBox);const l=Qe();r?Nn(l,e.applyTransform(s,!0),t.measuredBox):Nn(l,i,t.layoutBox);const c=!dc(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:m,layout:g}=u;if(m&&g){const _=_t();Vn(_,t.layoutBox,m.layoutBox);const w=_t();Vn(w,i,g.layoutBox),pc(_,w)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=_,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function jm(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function $m(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Um(e){e.clearSnapshot()}function yc(e){e.clearMeasurements()}function bc(e){e.isLayoutDirty=!1}function Gm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function wc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Hm(e){e.resolveTargetDelta()}function zm(e){e.calcProjection()}function Wm(e){e.resetSkewAndRotation()}function qm(e){e.removeLeadSnapshot()}function xc(e,t,n){e.translate=mt(t.translate,0,n),e.scale=mt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Sc(e,t,n,i){e.min=mt(t.min,n.min,i),e.max=mt(t.max,n.max,i)}function Km(e,t,n,i){Sc(e.x,t.x,n.x,i),Sc(e.y,t.y,n.y,i)}function Xm(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Ym={duration:.45,ease:[.4,0,.1,1]},Cc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),kc=Cc("applewebkit/")&&!Cc("chrome/")?Math.round:jt;function Tc(e){e.min=kc(e.min),e.max=kc(e.max)}function Zm(e){Tc(e.x),Tc(e.y)}function Ec(e,t,n){return e==="position"||e==="preserve-aspect"&&!em(mc(t),mc(n),.2)}function Jm(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Qm=_c({attachResizeListener:(e,t)=>Ln(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pr={current:void 0},Ac=_c({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pr.current){const e=new Qm({});e.mount(window),e.setOptions({layoutScroll:!0}),pr.current=e}return pr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),tg={pan:{Feature:_m},drag:{Feature:vm,ProjectionNode:Ac,MeasureLayout:Ql}};function Rc(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=i[s];o&&ut.postRender(()=>o(t,Dn(t)))}class eg extends we{mount(){const{current:t}=this.node;t&&(this.unmount=If(t,(n,i)=>(Rc(this.node,i,"Start"),s=>Rc(this.node,s,"End"))))}unmount(){}}class ng extends we{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=bn(Ln(this.node.current,"focus",()=>this.onFocus()),Ln(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ic(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=i[s];o&&ut.postRender(()=>o(t,Dn(t)))}class ig extends we{mount(){const{current:t}=this.node;t&&(this.unmount=Df(t,(n,i)=>(Ic(this.node,i,"Start"),(s,{success:o})=>Ic(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const mr=new WeakMap,gr=new WeakMap,sg=e=>{const t=mr.get(e.target);t&&t(e)},rg=e=>{e.forEach(sg)};function og({root:e,...t}){const n=e||document;gr.has(n)||gr.set(n,{});const i=gr.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(rg,{root:e,...t})),i[s]}function ag(e,t,n){const i=og(t);return mr.set(e,n),i.observe(e),()=>{mr.delete(e),i.unobserve(e)}}const lg={some:0,all:1};class cg extends we{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:o}=t,r={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:lg[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),m=c?d:u;m&&m(l)};return ag(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(ug(t,n))&&this.startObserver()}unmount(){}}function ug({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const dg={inView:{Feature:cg},tap:{Feature:ig},focus:{Feature:ng},hover:{Feature:eg}},hg={layout:{ProjectionNode:Ac,MeasureLayout:Ql}},vr={current:null},Pc={current:!1};function fg(){if(Pc.current=!0,!!as)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>vr.current=e.matches;e.addEventListener("change",t),t()}else vr.current=!1}const pg=new WeakMap;function mg(e,t,n){for(const i in t){const s=t[i],o=n[i];if(kt(s))e.addValue(i,s);else if(kt(o))e.addValue(i,Ye(s,{owner:e}));else if(o!==s)if(e.hasValue(i)){const r=e.getValue(i);r.liveStyle===!0?r.jump(s):r.hasAnimated||r.set(s)}else{const r=e.getStaticValue(i);e.addValue(i,Ye(r!==void 0?r:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const Mc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class gg{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=js,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Mt.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ut.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=yi(n),this.isVariantNode=al(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in u){const g=u[m];l[m]!==void 0&&kt(g)&&g.set(l[m],!1)}}mount(t){this.current=t,pg.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((n,i)=>this.bindToMotionValue(i,n)),Pc.current||fg(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:vr.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),_e(this.notifyUpdate),_e(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=Xe.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ut.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o(),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 Ze){const n=Ze[t];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_t()}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 i=0;i<Mc.length;i++){const s=Mc[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,r=t[o];r&&(this.propEventSubscriptions[s]=this.on(s,r))}this.prevMotionValues=mg(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 i=this.values.get(t);n!==i&&(i&&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 i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Ye(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Wo(i)||Ko(i))?i=parseFloat(i):!Vf(i)&&be.test(n)&&(i=za(t,n)),this.setBaseTarget(t,kt(i)?i.get():i)),kt(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const r=tr(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);r&&(i=r[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!kt(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new hs),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Lc extends gg{constructor(){super(...arguments),this.KeyframeResolver=kf}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;kt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Dc(e,{style:t,vars:n},i,s){const o=e.style;let r;for(r in t)o[r]=t[r];s==null||s.applyProjectionStyles(o,i);for(r in n)o.setProperty(r,n[r])}function vg(e){return window.getComputedStyle(e)}class _g extends Lc{constructor(){super(...arguments),this.type="html",this.renderInstance=Dc}readValueFromInstance(t,n){var i;if(Xe.has(n))return(i=this.projection)!=null&&i.isProjecting?Os(n):Hh(t,n);{const s=vg(t),o=(gs(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return jl(t,n)}build(t,n,i){Zs(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return er(t,n,i)}}const Oc=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yg(e,t,n,i){Dc(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(Oc.has(s)?s:Ys(s),t.attrs[s])}class bg extends Lc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_t}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Xe.has(n)){const i=Ha(n);return i&&i.default||0}return n=Oc.has(n)?n:Ys(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return yl(t,n,i)}build(t,n,i){pl(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,s){yg(t,n,i,s)}mount(t){this.isSVGTag=gl(t.tagName),super.mount(t)}}const wg=(e,t)=>Qs(e)?new bg(t):new _g(t,{allowProjection:e!==Qt}),xg=wp({...qp,...dg,...tg,...hg},wg),Bn=qf(xg),Sg=["agent-id","environment","position"],Ci="widget-layout-id";function Nc(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Nc(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Oe(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Nc(e))&&(i&&(i+=" "),i+=t);return i}const jn={},Vc=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Fc=e=>"init"in e,_r=e=>!!e.write,Bc=e=>"v"in e||"e"in e,ki=e=>{if("e"in e)throw e.e;if((jn?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},Ti=new WeakMap,jc=e=>{var t;return Ei(e)&&!!((t=Ti.get(e))!=null&&t[0])},Cg=e=>{const t=Ti.get(e);t!=null&&t[0]&&(t[0]=!1,t[1].forEach(n=>n()))},$c=(e,t)=>{let n=Ti.get(e);if(!n){n=[!0,new Set],Ti.set(e,n);const i=()=>{n[0]=!1};e.then(i,i)}n[1].add(t)},Ei=e=>typeof(e==null?void 0:e.then)=="function",Uc=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},yr=(e,t,n)=>{const i=n(e),s="v"in i,o=i.v;if(Ei(t))for(const r of i.d.keys())Uc(e,t,n(r));i.v=t,delete i.e,(!s||!Object.is(o,i.v))&&(++i.n,Ei(o)&&Cg(o))},Gc=(e,t,n)=>{var i;const s=new Set;for(const o of((i=n.get(e))==null?void 0:i.t)||[])n.has(o)&&s.add(o);for(const o of t.p)s.add(o);return s},kg=()=>{const e=new Set,t=()=>{e.forEach(n=>n())};return t.add=n=>(e.add(n),()=>{e.delete(n)}),t},br=()=>{const e={},t=new WeakMap,n=i=>{var s,o;(s=t.get(e))==null||s.forEach(r=>r(i)),(o=t.get(i))==null||o.forEach(r=>r())};return n.add=(i,s)=>{const o=i||e,r=(t.has(o)?t:t.set(o,new Set)).get(o);return r.add(s),()=>{r==null||r.delete(s),r.size||t.delete(o)}},n},Tg=e=>(e.c||(e.c=br()),e.m||(e.m=br()),e.u||(e.u=br()),e.f||(e.f=kg()),e),Eg=Symbol(),Hc=(e=new WeakMap,t=new WeakMap,n=new WeakMap,i=new Set,s=new Set,o=new Set,r={},a=(m,...g)=>m.read(...g),l=(m,...g)=>m.write(...g),c=(m,g)=>{var _;return(_=m.unstable_onInit)==null?void 0:_.call(m,g)},d=(m,g)=>{var _;return(_=m.onMount)==null?void 0:_.call(m,g)},...u)=>{const m=u[0]||(x=>{if((jn?"production":void 0)!=="production"&&!x)throw new Error("Atom is undefined or null");let k=e.get(x);return k||(k={d:new Map,p:new Set,n:0},e.set(x,k),c==null||c(x,D)),k}),g=u[1]||(()=>{const x=[],k=f=>{try{f()}catch(p){x.push(p)}};do{r.f&&k(r.f);const f=new Set,p=f.add.bind(f);i.forEach(h=>{var v;return(v=t.get(h))==null?void 0:v.l.forEach(p)}),i.clear(),o.forEach(p),o.clear(),s.forEach(p),s.clear(),f.forEach(k),i.size&&_()}while(i.size||o.size||s.size);if(x.length)throw new AggregateError(x)}),_=u[2]||(()=>{const x=[],k=new WeakSet,f=new WeakSet,p=Array.from(i);for(;p.length;){const h=p[p.length-1],v=m(h);if(f.has(h)){p.pop();continue}if(k.has(h)){if(n.get(h)===v.n)x.push([h,v]);else if((jn?"production":void 0)!=="production"&&n.has(h))throw new Error("[Bug] invalidated atom exists");f.add(h),p.pop();continue}k.add(h);for(const T of Gc(h,v,t))k.has(T)||p.push(T)}for(let h=x.length-1;h>=0;--h){const[v,T]=x[h];let R=!1;for(const E of T.d.keys())if(E!==v&&i.has(E)){R=!0;break}R&&(w(v),S(v)),n.delete(v)}}),w=u[3]||(x=>{var k;const f=m(x);if(Bc(f)&&(t.has(x)&&n.get(x)!==f.n||Array.from(f.d).every(([I,N])=>w(I).n===N)))return f;f.d.clear();let p=!0;const h=()=>{t.has(x)&&(S(x),_(),g())},v=I=>{var N;if(Vc(x,I)){const F=m(I);if(!Bc(F))if(Fc(I))yr(I,I.init,m);else throw new Error("no atom init");return ki(F)}const K=w(I);try{return ki(K)}finally{f.d.set(I,K.n),jc(f.v)&&Uc(x,f.v,K),(N=t.get(I))==null||N.t.add(x),p||h()}};let T,R;const E={get signal(){return T||(T=new AbortController),T.signal},get setSelf(){return(jn?"production":void 0)!=="production"&&!_r(x)&&console.warn("setSelf function cannot be used with read-only atom"),!R&&_r(x)&&(R=(...I)=>{if((jn?"production":void 0)!=="production"&&p&&console.warn("setSelf function cannot be called in sync"),!p)try{return y(x,...I)}finally{_(),g()}}),R}},M=f.n;try{const I=a(x,v,E);return yr(x,I,m),Ei(I)&&($c(I,()=>T==null?void 0:T.abort()),I.then(h,h)),f}catch(I){return delete f.v,f.e=I,++f.n,f}finally{p=!1,M!==f.n&&n.get(x)===M&&(n.set(x,f.n),i.add(x),(k=r.c)==null||k.call(r,x))}}),b=u[4]||(x=>{const k=[x];for(;k.length;){const f=k.pop(),p=m(f);for(const h of Gc(f,p,t)){const v=m(h);n.set(h,v.n),k.push(h)}}}),y=u[5]||((x,...k)=>{let f=!0;const p=v=>ki(w(v)),h=(v,...T)=>{var R;const E=m(v);try{if(Vc(x,v)){if(!Fc(v))throw new Error("atom not writable");const M=E.n,I=T[0];yr(v,I,m),S(v),M!==E.n&&(i.add(v),(R=r.c)==null||R.call(r,v),b(v));return}else return y(v,...T)}finally{f||(_(),g())}};try{return l(x,p,h,...k)}finally{f=!1}}),S=u[6]||(x=>{var k;const f=m(x),p=t.get(x);if(p&&!jc(f.v)){for(const[h,v]of f.d)if(!p.d.has(h)){const T=m(h);C(h).t.add(x),p.d.add(h),v!==T.n&&(i.add(h),(k=r.c)==null||k.call(r,h),b(h))}for(const h of p.d||[])if(!f.d.has(h)){p.d.delete(h);const v=P(h);v==null||v.t.delete(x)}}}),C=u[7]||(x=>{var k;const f=m(x);let p=t.get(x);if(!p){w(x);for(const h of f.d.keys())C(h).t.add(x);if(p={l:new Set,d:new Set(f.d.keys()),t:new Set},t.set(x,p),(k=r.m)==null||k.call(r,x),_r(x)){const h=()=>{let v=!0;const T=(...R)=>{try{return y(x,...R)}finally{v||(_(),g())}};try{const R=d(x,T);R&&(p.u=()=>{v=!0;try{R()}finally{v=!1}})}finally{v=!1}};s.add(h)}}return p}),P=u[8]||(x=>{var k;const f=m(x);let p=t.get(x);if(p&&!p.l.size&&!Array.from(p.t).some(h=>{var v;return(v=t.get(h))==null?void 0:v.d.has(x)})){p.u&&o.add(p.u),p=void 0,t.delete(x),(k=r.u)==null||k.call(r,x);for(const h of f.d.keys()){const v=P(h);v==null||v.t.delete(x)}return}return p}),L=[e,t,n,i,s,o,r,a,l,c,d,m,g,_,w,b,y,S,C,P],D={get:x=>ki(w(x)),set:(x,...k)=>{try{return y(x,...k)}finally{_(),g()}},sub:(x,k)=>{const p=C(x).l;return p.add(k),g(),()=>{p.delete(k),P(x),g()}}};return Object.defineProperty(D,Eg,{value:L}),D},Ag=Tg,zc=$c,wr={};let Rg=0;function xr(e,t){const n=`atom${++Rg}`,i={toString(){return(wr?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?i.read=e:(i.init=e,i.read=Ig,i.write=Pg),i}function Ig(e){return e(this)}function Pg(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const Mg=()=>{let e=0;const t=Ag({}),n=new WeakMap,i=new WeakMap,s=Hc(n,i,void 0,void 0,void 0,void 0,t,void 0,(a,l,c,...d)=>e?c(a,...d):a.write(l,c,...d)),o=new Set;return t.m.add(void 0,a=>{o.add(a);const l=n.get(a);l.m=i.get(a)}),t.u.add(void 0,a=>{o.delete(a);const l=n.get(a);delete l.m}),Object.assign(s,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),n),dev4_get_mounted_atoms:()=>o,dev4_restore_atoms:a=>{const l={read:()=>null,write:(c,d)=>{++e;try{for(const[u,m]of a)"init"in u&&d(u,m)}finally{--e}}};s.set(l)}})};function Lg(){return(wr?"production":void 0)!=="production"?Mg():Hc()}let $n;function Dg(){return $n||($n=Lg(),(wr?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=$n),globalThis.__JOTAI_DEFAULT_STORE__!==$n&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),$n}const Og={},Ng=Ae(void 0);function Wc(e){return wt(Ng)||Dg()}const Sr=e=>typeof(e==null?void 0:e.then)=="function",Cr=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},Vg=Ho.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(Cr(e),e)}),kr=new WeakMap,qc=(e,t)=>{let n=kr.get(e);return n||(n=new Promise((i,s)=>{let o=e;const r=c=>d=>{o===c&&i(d)},a=c=>d=>{o===c&&s(d)},l=()=>{try{const c=t();Sr(c)?(kr.set(c,n),o=c,c.then(r(c),a(c)),zc(c,l)):i(c)}catch(c){s(c)}};e.then(r(e),a(e)),zc(e,l)}),kr.set(e,n)),n};function Kc(e,t){const{delay:n,unstable_promiseStatus:i=!Ho.use}={},s=Wc(),[[o,r,a],l]=Co(d=>{const u=s.get(e);return Object.is(d[0],u)&&d[1]===s&&d[2]===e?d:[u,s,e]},void 0,()=>[s.get(e),s,e]);let c=o;if((r!==s||a!==e)&&(l(),c=s.get(e)),Kt(()=>{const d=s.sub(e,()=>{if(i)try{const u=s.get(e);Sr(u)&&Cr(qc(u,()=>s.get(e)))}catch{}if(typeof n=="number"){setTimeout(l,n);return}l()});return l(),d},[s,e,n,i]),kd(c),Sr(c)){const d=qc(c,()=>s.get(e));return i&&Cr(d),Vg(d)}return c}function Xc(e,t){const n=Wc();return ii((...s)=>{if((Og?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...s)},[n,e])}function Yc(e,t){return[Kc(e),Xc(e)]}const Fg=xr("waiting"),Zc=()=>Yc(Fg),Ai={theme:"dark",audio_visualizer_config:{color:"verdant",preset:"roundBars"},start_call_text:"Start Call",default_state:"collapsed",position:"fixed",view_history_url:null,report_issue_url:null,give_feedback_url:null,agent_thinking_text:"Thinking...",speak_to_interrupt_text:"Speak to interrupt",logo_icon_url:null},Jc=xr(Ai),Bg=()=>{const e=Xc(Jc);return ii(t=>e(()=>{const n={...t};return n.start_call_text||(n.start_call_text=Ai.start_call_text),n.agent_thinking_text||(n.agent_thinking_text=Ai.agent_thinking_text),n.speak_to_interrupt_text||(n.speak_to_interrupt_text=Ai.speak_to_interrupt_text),n}),[e])},Ne=()=>Kc(Jc),Qc=({size:e="large",className:t})=>{const n=Ne(),[i]=Zc();return A("h1",{className:Oe({"text-xs":e==="small"},t),children:i==="waiting"?n.speak_to_interrupt_text:n.agent_thinking_text})},tu=({stream:e})=>{const t=Bt(null);return Kt(()=>{!t.current||!e||(t.current.srcObject=e)},[e]),A("audio",{muted:!0,ref:t,autoPlay:!0})};/**!
|
|
9
|
+
`),()=>{w.removeChild(_),w.contains(_)&&w.removeChild(_)}},[t]),A(Ff,{isPresent:t,childRef:o,sizeRef:r,children:$d(e,{ref:o})})}const jf=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:o,mode:r,anchorX:a,root:l})=>{const c=oi($f),d=ns();let u=!0,m=ne(()=>(u=!1,{id:d,initial:t,isPresent:n,custom:s,onExitComplete:g=>{c.set(g,!0);for(const _ of c.values())if(!_)return;i&&i()},register:g=>(c.set(g,!1),()=>c.delete(g))}),[n,c,i]);return o&&u&&(m={...m}),ne(()=>{c.forEach((g,_)=>c.set(_,!1))},[n]),Kt(()=>{!n&&!c.size&&i&&i()},[n]),r==="popLayout"&&(e=A(Bf,{isPresent:n,anchorX:a,root:l,children:e})),A(ai.Provider,{value:m,children:e})};function $f(){return new Map}function el(e=!0){const t=wt(ai);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=t,o=ns();Kt(()=>{if(e)return s(o)},[e]);const r=ii(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,r]:[!0]}const mi=e=>e.key||"";function nl(e){const t=[];return Id.forEach(e,n=>{Go(n)&&t.push(n)}),t}const Uf=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync",propagate:r=!1,anchorX:a="left",root:l})=>{const[c,d]=el(r),u=ne(()=>nl(e),[e]),m=r&&!c?[]:u.map(mi),g=Bt(!0),_=Bt(u),w=oi(()=>new Map),[b,y]=ee(u),[S,C]=ee(u);zo(()=>{g.current=!1,_.current=u;for(let D=0;D<S.length;D++){const x=mi(S[D]);m.includes(x)?w.delete(x):w.get(x)!==!0&&w.set(x,!1)}},[S,m.length,m.join("-")]);const P=[];if(u!==b){let D=[...u];for(let x=0;x<S.length;x++){const k=S[x],f=mi(k);m.includes(f)||(D.splice(x,0,k),P.push(k))}return o==="wait"&&P.length&&(D=P),C(nl(D)),y(u),null}const{forceRender:L}=wt(os);return A(Qt,{children:S.map(D=>{const x=mi(D),k=r&&!c?!1:u===S||m.includes(x),f=()=>{if(w.has(x))w.set(x,!0);else return;let p=!0;w.forEach(h=>{h||(p=!1)}),p&&(L==null||L(),C(_.current),r&&(d==null||d()),i&&i())};return A(jf,{isPresent:k,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:l,onExitComplete:k?void 0:f,anchorX:a,children:D},x)})})},il=Ae({strict:!1}),sl={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"]},Ze={};for(const e in sl)Ze[e]={isEnabled:t=>sl[e].some(n=>!!t[n])};function Gf(e){for(const t in e)Ze[t]={...Ze[t],...e[t]}}const Hf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function gi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Hf.has(e)}let rl=e=>!gi(e);function ol(e){typeof e=="function"&&(rl=t=>t.startsWith("on")?!gi(t):e(t))}try{ol(require("@emotion/is-prop-valid").default)}catch{}function zf(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(rl(s)||n===!0&&gi(s)||!t&&!gi(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}function Wf({children:e,isValidProp:t,...n}){t&&ol(t),n={...wt(Rn),...n},n.isStatic=oi(()=>n.isStatic);const i=ne(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return A(Rn.Provider,{value:i,children:e})}function qf(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...i)=>e(...i);return new Proxy(n,{get:(i,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const vi=Ae({});function _i(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function In(e){return typeof e=="string"||Array.isArray(e)}const Ks=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Xs=["initial",...Ks];function yi(e){return _i(e.animate)||Xs.some(t=>In(e[t]))}function al(e){return!!(yi(e)||e.variants)}function Kf(e,t){if(yi(e)){const{initial:n,animate:i}=e;return{initial:n===!1||In(n)?n:void 0,animate:In(i)?i:void 0}}return e.inherit!==!1?t:{}}function Xf(e){const{initial:t,animate:n}=Kf(e,wt(vi));return ne(()=>({initial:t,animate:n}),[ll(t),ll(n)])}function ll(e){return Array.isArray(e)?e.join(" "):e}const Yf=Symbol.for("motionComponentSymbol");function Je(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Zf(e,t,n){return ii(i=>{i&&e.onMount&&e.onMount(i),t&&(i?t.mount(i):t.unmount()),n&&(typeof n=="function"?n(i):Je(n)&&(n.current=i))},[t])}const Ys=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),cl="data-"+Ys("framerAppearId"),ul=Ae({});function Jf(e,t,n,i,s){var w,b;const{visualElement:o}=wt(vi),r=wt(il),a=wt(ai),l=wt(Rn).reducedMotion,c=Bt(null);i=i||r.renderer,!c.current&&i&&(c.current=i(e,{visualState:t,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=wt(ul);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&Qf(c.current,n,s,u);const m=Bt(!1);Ro(()=>{d&&m.current&&d.update(n,a)});const g=n[cl],_=Bt(!!g&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,g))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,g)));return zo(()=>{d&&(m.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),zs.render(d.render),_.current&&d.animationState&&d.animationState.animateChanges())}),Kt(()=>{d&&(!_.current&&d.animationState&&d.animationState.animateChanges(),_.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,g)}),_.current=!1))}),d}function Qf(e,t,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:dl(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!r||a&&Je(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:d,layoutScroll:l,layoutRoot:c})}function dl(e){if(e)return e.options.allowProjection!==!1?e.projection:dl(e.parent)}function tp({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:i,Component:s}){e&&Gf(e);function o(a,l){let c;const d={...wt(Rn),...a,layoutId:ep(a)},{isStatic:u}=d,m=Xf(a),g=i(a,u);if(!u&&as){np();const _=ip(d);c=_.MeasureLayout,m.visualElement=Jf(s,g,d,t,_.ProjectionNode)}return A(vi.Provider,{value:m,children:[c&&m.visualElement?A(c,{visualElement:m.visualElement,...d}):null,n(s,a,Zf(g,m.visualElement,l),g,u,m.visualElement)]})}o.displayName=`motion.${typeof s=="string"?s:`create(${s.displayName??s.name??""})`}`;const r=Rd(o);return r[Yf]=s,r}function ep({layoutId:e}){const t=wt(os).id;return t&&e!==void 0?t+"-"+e:e}function np(e,t){wt(il).strict}function ip(e){const{drag:t,layout:n}=Ze;if(!t&&!n)return{};const i={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const Pn={};function sp(e){for(const t in e)Pn[t]=e[t],gs(t)&&(Pn[t].isCSSVariable=!0)}function hl(e,{layout:t,layoutId:n}){return Xe.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Pn[e]||e==="opacity")}const rp={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},op=Ke.length;function ap(e,t,n){let i="",s=!0;for(let o=0;o<op;o++){const r=Ke[o],a=e[r];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(r.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Wa(a,Hs[r]);if(!l){s=!1;const d=rp[r]||r;i+=`${d}(${c}) `}n&&(t[r]=c)}}return i=i.trim(),n?i=n(t,s?"":i):s&&(i="none"),i}function Zs(e,t,n){const{style:i,vars:s,transformOrigin:o}=e;let r=!1,a=!1;for(const l in t){const c=t[l];if(Xe.has(l)){r=!0;continue}else if(gs(l)){s[l]=c;continue}else{const d=Wa(c,Hs[l]);l.startsWith("origin")?(a=!0,o[l]=d):i[l]=d}}if(t.transform||(r||n?i.transform=ap(t,e.transform,n):i.transform&&(i.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=o;i.transformOrigin=`${l} ${c} ${d}`}}const Js=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fl(e,t,n){for(const i in t)!kt(t[i])&&!hl(i,n)&&(e[i]=t[i])}function lp({transformTemplate:e},t){return ne(()=>{const n=Js();return Zs(n,t,e),Object.assign({},n.vars,n.style)},[t])}function cp(e,t){const n=e.style||{},i={};return fl(i,n,e),Object.assign(i,lp(e,t)),i}function up(e,t){const n={},i=cp(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.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=i,n}const dp={offset:"stroke-dashoffset",array:"stroke-dasharray"},hp={offset:"strokeDashoffset",array:"strokeDasharray"};function fp(e,t,n=1,i=0,s=!0){e.pathLength=1;const o=s?dp:hp;e[o.offset]=U.transform(-i);const r=U.transform(t),a=U.transform(n);e[o.array]=`${r} ${a}`}function pl(e,{attrX:t,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,d){if(Zs(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:u,style:m}=e;u.transform&&(m.transform=u.transform,delete u.transform),(m.transform||u.transformOrigin)&&(m.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),m.transform&&(m.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete u.transformBox),t!==void 0&&(u.x=t),n!==void 0&&(u.y=n),i!==void 0&&(u.scale=i),s!==void 0&&fp(u,s,o,r,!1)}const ml=()=>({...Js(),attrs:{}}),gl=e=>typeof e=="string"&&e.toLowerCase()==="svg";function pp(e,t,n,i){const s=ne(()=>{const o=ml();return pl(o,t,gl(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};fl(o,e.style,e),s.style={...o,...s.style}}return s}const mp=["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 Qs(e){return typeof e!="string"||e.includes("-")?!1:!!(mp.indexOf(e)>-1||/[A-Z]/u.test(e))}function gp(e=!1){return(n,i,s,{latestValues:o},r)=>{const l=(Qs(n)?pp:up)(i,o,r,n),c=zf(i,typeof n=="string",e),d=n!==Qt?{...c,...l,ref:s}:{},{children:u}=i,m=ne(()=>kt(u)?u.get():u,[u]);return Ft(n,{...d,children:m})}}function vl(e){const t=[{},{}];return e==null||e.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function tr(e,t,n,i){if(typeof t=="function"){const[s,o]=vl(i);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=vl(i);t=t(n!==void 0?n:e.custom,s,o)}return t}function bi(e){return kt(e)?e.get():e}function vp({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,s){return{latestValues:_p(n,i,s,e),renderState:t()}}const _l=e=>(t,n)=>{const i=wt(vi),s=wt(ai),o=()=>vp(e,t,i,s);return n?o():oi(o)};function _p(e,t,n,i){const s={},o=i(e,{});for(const m in o)s[m]=bi(o[m]);let{initial:r,animate:a}=e;const l=yi(e),c=al(e);t&&c&&!l&&e.inherit!==!1&&(r===void 0&&(r=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||r===!1;const u=d?a:r;if(u&&typeof u!="boolean"&&!_i(u)){const m=Array.isArray(u)?u:[u];for(let g=0;g<m.length;g++){const _=tr(e,m[g]);if(_){const{transitionEnd:w,transition:b,...y}=_;for(const S in y){let C=y[S];if(Array.isArray(C)){const P=d?C.length-1:0;C=C[P]}C!==null&&(s[S]=C)}for(const S in w)s[S]=w[S]}}}return s}function er(e,t,n){var o;const{style:i}=e,s={};for(const r in i)(kt(i[r])||t.style&&kt(t.style[r])||hl(r,e)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(s[r]=i[r]);return s}const yp={useVisualState:_l({scrapeMotionValuesFromProps:er,createRenderState:Js})};function yl(e,t,n){const i=er(e,t,n);for(const s in e)if(kt(e[s])||kt(t[s])){const o=Ke.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[o]=e[s]}return i}const bp={useVisualState:_l({scrapeMotionValuesFromProps:yl,createRenderState:ml})};function wp(e,t){return function(i,{forwardMotionProps:s}={forwardMotionProps:!1}){const r={...Qs(i)?bp:yp,preloadedFeatures:e,useRender:gp(s),createVisualElement:t,Component:i};return tp(r)}}function Mn(e,t,n){const i=e.getProps();return tr(i,t,n!==void 0?n:i.custom,e)}const nr=e=>Array.isArray(e);function xp(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ye(n))}function Sp(e){return nr(e)?e[e.length-1]||0:e}function Cp(e,t){const n=Mn(e,t);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const r in o){const a=Sp(o[r]);xp(e,r,a)}}function kp(e){return!!(kt(e)&&e.add)}function ir(e,t){const n=e.getValue("willChange");if(kp(n))return n.add(t);if(!n&&pe.WillChange){const i=new pe.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function bl(e){return e.props[cl]}const Tp=e=>e!==null;function Ep(e,{repeat:t,repeatType:n="loop"},i){const s=e.filter(Tp),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[o]}const Ap={type:"spring",stiffness:500,damping:25,restSpeed:10},Rp=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ip={type:"keyframes",duration:.8},Pp={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Mp=(e,{keyframes:t})=>t.length>2?Ip:Xe.has(e)?e.startsWith("scale")?Rp(t[1]):Ap:Pp;function Lp({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const sr=(e,t,n,i={},s,o)=>r=>{const a=Us(i,e)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c=c-ie(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:s};Lp(a)||Object.assign(d,Mp(e,d)),d.duration&&(d.duration=ie(d.duration)),d.repeatDelay&&(d.repeatDelay=ie(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),(pe.instantAnimations||pe.skipAnimations)&&(u=!0,d.duration=0,d.delay=0),d.allowFlatten=!a.type&&!a.ease,u&&!o&&t.get()!==void 0){const m=Ep(d.keyframes,a);if(m!==void 0){ut.update(()=>{d.onUpdate(m),d.onComplete()});return}}return a.isSync?new Ms(d):new pf(d)};function Dp({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function wl(e,t,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:r,...a}=t;i&&(o=i);const l=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const d in a){const u=e.getValue(d,e.latestValues[d]??null),m=a[d];if(m===void 0||c&&Dp(c,d))continue;const g={delay:n,...Us(o||{},d)},_=u.get();if(_!==void 0&&!u.isAnimating&&!Array.isArray(m)&&m===_&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const y=bl(e);if(y){const S=window.MotionHandoffAnimation(y,d,ut);S!==null&&(g.startTime=S,w=!0)}}ir(e,d),u.start(sr(d,u,m,e.shouldReduceMotion&&Ba.has(d)?{type:!1}:g,e,w));const b=u.animation;b&&l.push(b)}return r&&Promise.all(l).then(()=>{ut.update(()=>{r&&Cp(e,r)})}),l}function rr(e,t,n={}){var l;const i=Mn(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(wl(e,i,n)):()=>Promise.resolve(),r=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:m}=s;return Op(e,t,c,d,u,m,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,d]=a==="beforeChildren"?[o,r]:[r,o];return c().then(()=>d())}else return Promise.all([o(),r(n.delay)])}function Op(e,t,n=0,i=0,s=0,o=1,r){const a=[],l=e.variantChildren.size,c=(l-1)*s,d=typeof i=="function",u=d?m=>i(m,l):o===1?(m=0)=>m*s:(m=0)=>c-m*s;return Array.from(e.variantChildren).sort(Np).forEach((m,g)=>{m.notify("AnimationStart",t),a.push(rr(m,t,{...r,delay:n+(d?0:i)+u(g)}).then(()=>m.notify("AnimationComplete",t)))}),Promise.all(a)}function Np(e,t){return e.sortNodePosition(t)}function Vp(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(o=>rr(e,o,n));i=Promise.all(s)}else if(typeof t=="string")i=rr(e,t,n);else{const s=typeof t=="function"?Mn(e,t,n.custom):t;i=Promise.all(wl(e,s,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}function xl(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const Fp=Xs.length;function Sl(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Sl(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Fp;n++){const i=Xs[n],s=e.props[i];(In(s)||s===!1)&&(t[i]=s)}return t}const Bp=[...Ks].reverse(),jp=Ks.length;function $p(e){return t=>Promise.all(t.map(({animation:n,options:i})=>Vp(e,n,i)))}function Up(e){let t=$p(e),n=Cl(),i=!0;const s=l=>(c,d)=>{var m;const u=Mn(e,d,l==="exit"?(m=e.presenceContext)==null?void 0:m.custom:void 0);if(u){const{transition:g,transitionEnd:_,...w}=u;c={...c,...w,..._}}return c};function o(l){t=l(e)}function r(l){const{props:c}=e,d=Sl(e.parent)||{},u=[],m=new Set;let g={},_=1/0;for(let b=0;b<jp;b++){const y=Bp[b],S=n[y],C=c[y]!==void 0?c[y]:d[y],P=In(C),L=y===l?S.isActive:null;L===!1&&(_=b);let D=C===d[y]&&C!==c[y]&&P;if(D&&i&&e.manuallyAnimateOnMount&&(D=!1),S.protectedKeys={...g},!S.isActive&&L===null||!C&&!S.prevProp||_i(C)||typeof C=="boolean")continue;const x=Gp(S.prevProp,C);let k=x||y===l&&S.isActive&&!D&&P||b>_&&P,f=!1;const p=Array.isArray(C)?C:[C];let h=p.reduce(s(y),{});L===!1&&(h={});const{prevResolvedValues:v={}}=S,T={...v,...h},R=I=>{k=!0,m.has(I)&&(f=!0,m.delete(I)),S.needsAnimating[I]=!0;const N=e.getValue(I);N&&(N.liveStyle=!1)};for(const I in T){const N=h[I],K=v[I];if(g.hasOwnProperty(I))continue;let F=!1;nr(N)&&nr(K)?F=!xl(N,K):F=N!==K,F?N!=null?R(I):m.add(I):N!==void 0&&m.has(I)?R(I):S.protectedKeys[I]=!0}S.prevProp=C,S.prevResolvedValues=h,S.isActive&&(g={...g,...h}),i&&e.blockInitialAnimation&&(k=!1),k&&(!(D&&x)||f)&&u.push(...p.map(I=>({animation:I,options:{type:y}})))}if(m.size){const b={};if(typeof c.initial!="boolean"){const y=Mn(e,Array.isArray(c.initial)?c.initial[0]:c.initial);y&&y.transition&&(b.transition=y.transition)}m.forEach(y=>{const S=e.getBaseTarget(y),C=e.getValue(y);C&&(C.liveStyle=!0),b[y]=S??null}),u.push({animation:b})}let w=!!u.length;return i&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),i=!1,w?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(m=>{var g;return(g=m.animationState)==null?void 0:g.setActive(l,c)}),n[l].isActive=c;const d=r(l);for(const m in n)n[m].protectedKeys={};return d}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Cl(),i=!0}}}function Gp(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xl(t,e):!1}function Le(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cl(){return{animate:Le(!0),whileInView:Le(),whileHover:Le(),whileTap:Le(),whileDrag:Le(),whileFocus:Le(),exit:Le()}}class we{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Hp extends we{constructor(t){super(t),t.animationState||(t.animationState=Up(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_i(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 zp=0;class Wp extends we{constructor(){super(...arguments),this.id=zp++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 qp={animation:{Feature:Hp},exit:{Feature:Wp}};function Ln(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}function Dn(e){return{point:{x:e.pageX,y:e.pageY}}}const Kp=e=>t=>Ws(t)&&e(t,Dn(t));function On(e,t,n,i){return Ln(e,t,Kp(n),i)}function kl({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function Xp({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Yp(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}const Tl=1e-4,Zp=1-Tl,Jp=1+Tl,El=.01,Qp=0-El,tm=0+El;function Et(e){return e.max-e.min}function em(e,t,n){return Math.abs(e-t)<=n}function Al(e,t,n,i=.5){e.origin=i,e.originPoint=mt(t.min,t.max,e.origin),e.scale=Et(n)/Et(t),e.translate=mt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Zp&&e.scale<=Jp||isNaN(e.scale))&&(e.scale=1),(e.translate>=Qp&&e.translate<=tm||isNaN(e.translate))&&(e.translate=0)}function Nn(e,t,n,i){Al(e.x,t.x,n.x,i?i.originX:void 0),Al(e.y,t.y,n.y,i?i.originY:void 0)}function Rl(e,t,n){e.min=n.min+t.min,e.max=e.min+Et(t)}function nm(e,t,n){Rl(e.x,t.x,n.x),Rl(e.y,t.y,n.y)}function Il(e,t,n){e.min=t.min-n.min,e.max=e.min+Et(t)}function Vn(e,t,n){Il(e.x,t.x,n.x),Il(e.y,t.y,n.y)}const Pl=()=>({translate:0,scale:1,origin:0,originPoint:0}),Qe=()=>({x:Pl(),y:Pl()}),Ml=()=>({min:0,max:0}),_t=()=>({x:Ml(),y:Ml()});function $t(e){return[e("x"),e("y")]}function or(e){return e===void 0||e===1}function ar({scale:e,scaleX:t,scaleY:n}){return!or(e)||!or(t)||!or(n)}function De(e){return ar(e)||Ll(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ll(e){return Dl(e.x)||Dl(e.y)}function Dl(e){return e&&e!=="0%"}function wi(e,t,n){const i=e-n,s=t*i;return n+s}function Ol(e,t,n,i,s){return s!==void 0&&(e=wi(e,s,i)),wi(e,n,i)+t}function lr(e,t=0,n=1,i,s){e.min=Ol(e.min,t,n,i,s),e.max=Ol(e.max,t,n,i,s)}function Nl(e,{x:t,y:n}){lr(e.x,t.translate,t.scale,t.originPoint),lr(e.y,n.translate,n.scale,n.originPoint)}const Vl=.999999999999,Fl=1.0000000000001;function im(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,r;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&en(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(t.x*=r.x.scale,t.y*=r.y.scale,Nl(e,r)),i&&De(o.latestValues)&&en(e,o.latestValues))}t.x<Fl&&t.x>Vl&&(t.x=1),t.y<Fl&&t.y>Vl&&(t.y=1)}function tn(e,t){e.min=e.min+t,e.max=e.max+t}function Bl(e,t,n,i,s=.5){const o=mt(e.min,e.max,s);lr(e,t,n,o,i)}function en(e,t){Bl(e.x,t.x,t.scaleX,t.scale,t.originX),Bl(e.y,t.y,t.scaleY,t.scale,t.originY)}function jl(e,t){return kl(Yp(e.getBoundingClientRect(),t))}function sm(e,t,n){const i=jl(e,n),{scroll:s}=t;return s&&(tn(i.x,s.offset.x),tn(i.y,s.offset.y)),i}const $l=({current:e})=>e?e.ownerDocument.defaultView:null,Ul=(e,t)=>Math.abs(e-t);function rm(e,t){const n=Ul(e.x,t.x),i=Ul(e.y,t.y);return Math.sqrt(n**2+i**2)}class Gl{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:r=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=ur(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,_=rm(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!_)return;const{point:w}=m,{timestamp:b}=St;this.history.push({...w,timestamp:b});const{onStart:y,onMove:S}=this.handlers;g||(y&&y(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=cr(g,this.transformPagePoint),ut.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:_,onSessionEnd:w,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ur(m.type==="pointercancel"?this.lastMoveEventInfo:cr(g,this.transformPagePoint),this.history);this.startEvent&&_&&_(m,y),w&&w(m,y)},!Ws(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=s||window;const a=Dn(t),l=cr(a,this.transformPagePoint),{point:c}=l,{timestamp:d}=St;this.history=[{...c,timestamp:d}];const{onSessionStart:u}=n;u&&u(t,ur(l,this.history)),this.removeListeners=bn(On(this.contextWindow,"pointermove",this.handlePointerMove),On(this.contextWindow,"pointerup",this.handlePointerUp),On(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_e(this.updatePoint)}}function cr(e,t){return t?{point:t(e.point)}:e}function Hl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ur({point:e},t){return{point:e,delta:Hl(e,zl(t)),offset:Hl(e,om(t)),velocity:am(t,.1)}}function om(e){return e[0]}function zl(e){return e[e.length-1]}function am(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=zl(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>ie(t)));)n--;if(!i)return{x:0,y:0};const o=se(s.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function lm(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?mt(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?mt(n,e,i.max):Math.min(e,n)),e}function Wl(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function cm(e,{top:t,left:n,bottom:i,right:s}){return{x:Wl(e.x,n,s),y:Wl(e.y,t,i)}}function ql(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function um(e,t){return{x:ql(e.x,t.x),y:ql(e.y,t.y)}}function dm(e,t){let n=.5;const i=Et(e),s=Et(t);return s>i?n=wn(t.min,t.max-i,e.min):i>s&&(n=wn(e.min,e.max-s,t.min)),fe(0,1,n)}function hm(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const dr=.35;function fm(e=dr){return e===!1?e=0:e===!0&&(e=dr),{x:Kl(e,"left","right"),y:Kl(e,"top","bottom")}}function Kl(e,t,n){return{min:Xl(e,t),max:Xl(e,n)}}function Xl(e,t){return typeof e=="number"?e:e[t]||0}const pm=new WeakMap;class mm{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_t(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=u=>{const{dragSnapToOrigin:m}=this.getProps();m?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Dn(u).point)},r=(u,m)=>{const{drag:g,dragPropagation:_,onDragStart:w}=this.getProps();if(g&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Rf(g),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$t(y=>{let S=this.getAxisMotionValue(y).get()||0;if(re.test(S)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[y];P&&(S=Et(P)*(parseFloat(S)/100))}}this.originPoint[y]=S}),w&&ut.postRender(()=>w(u,m)),ir(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m;const{dragPropagation:g,dragDirectionLock:_,onDirectionLock:w,onDrag:b}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:y}=m;if(_&&this.currentDirection===null){this.currentDirection=gm(y),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,y),this.updateAxis("y",m.point,y),this.visualElement.render(),b&&b(u,m)},l=(u,m)=>{this.latestPointerEvent=u,this.latestPanInfo=m,this.stop(u,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>$t(u=>{var m;return this.getAnimationState(u)==="paused"&&((m=this.getAxisMotionValue(u).animation)==null?void 0:m.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Gl(t,{onSessionStart:o,onStart:r,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:i,contextWindow:$l(this.visualElement)})}stop(t,n){const i=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!i)return;const{velocity:r}=s;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&ut.postRender(()=>a(i,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!xi(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=lm(r,this.constraints[t],this.elastic[t])),o.set(r)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&Je(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=cm(i.layoutBox,t):this.constraints=!1,this.elastic=fm(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&$t(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=hm(i.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Je(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=sm(i,s.root,this.visualElement.getTransformPagePoint());let r=um(s.layout.layoutBox,o);if(n){const a=n(Xp(r));this.hasMutatedConstraints=!!a,a&&(r=kl(a))}return r}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=$t(d=>{if(!xi(d,n,this.currentDirection))return;let u=l&&l[d]||{};r&&(u={min:0,max:0});const m=s?200:1e6,g=s?40:1e7,_={type:"inertia",velocity:i?t[d]:0,bounceStiffness:m,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...u};return this.startAxisValueAnimation(d,_)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return ir(this.visualElement,t),i.start(sr(t,i,0,n,this.visualElement,!1))}stopAnimation(){$t(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){$t(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){$t(n=>{const{drag:i}=this.getProps();if(!xi(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:r,max:a}=s.layout.layoutBox[n];o.set(t[n]-mt(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Je(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};$t(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();s[r]=dm({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),$t(r=>{if(!xi(r,t,null))return;const a=this.getAxisMotionValue(r),{min:l,max:c}=this.constraints[r];a.set(mt(l,c,s[r]))})}addListeners(){if(!this.visualElement.current)return;pm.set(this.visualElement,this);const t=this.visualElement.current,n=On(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Je(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ut.read(i);const r=Ln(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&($t(d=>{const u=this.getAxisMotionValue(d);u&&(this.originPoint[d]+=l[d].translate,u.set(u.get()+l[d].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:r=dr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function xi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function gm(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class vm extends we{constructor(t){super(t),this.removeGroupControls=jt,this.removeListeners=jt,this.controls=new mm(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||jt}unmount(){this.removeGroupControls(),this.removeListeners()}}const Yl=e=>(t,n)=>{e&&ut.postRender(()=>e(t,n))};class _m extends we{constructor(){super(...arguments),this.removePointerDownListener=jt}onPointerDown(t){this.session=new Gl(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$l(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Yl(t),onStart:Yl(n),onMove:i,onEnd:(o,r)=>{delete this.session,s&&ut.postRender(()=>s(o,r))}}}mount(){this.removePointerDownListener=On(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Si={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Zl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Fn={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(U.test(e))e=parseFloat(e);else return e;const n=Zl(e,t.target.x),i=Zl(e,t.target.y);return`${n}% ${i}%`}},ym={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=be.parse(e);if(s.length>5)return i;const o=be.createTransformer(e),r=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+r]/=a,s[1+r]/=l;const c=mt(a,l,.5);return typeof s[2+r]=="number"&&(s[2+r]/=c),typeof s[3+r]=="number"&&(s[3+r]/=c),o(s)}};let Jl=!1;class bm extends qt{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:o}=t;sp(wm),o&&(n.group&&n.group.add(o),i&&i.register&&s&&i.register(o),Jl&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Si.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:o}=this.props,{projection:r}=i;return r&&(r.isPresent=o,Jl=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?r.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?r.promote():r.relegate()||ut.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zs.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ql(e){const[t,n]=el(),i=wt(os);return A(bm,{...e,layoutGroup:i,switchLayoutGroup:wt(ul),isPresent:t,safeToRemove:n})}const wm={borderRadius:{...Fn,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Fn,borderTopRightRadius:Fn,borderBottomLeftRadius:Fn,borderBottomRightRadius:Fn,boxShadow:ym};function xm(e,t,n){const i=kt(e)?e:Ye(e);return i.start(sr("",i,t,n)),i.animation}const Sm=(e,t)=>e.depth-t.depth;class Cm{constructor(){this.children=[],this.isDirty=!1}add(t){ls(this.children,t),this.isDirty=!0}remove(t){cs(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Sm),this.isDirty=!1,this.children.forEach(t)}}function km(e,t){const n=Mt.now(),i=({timestamp:s})=>{const o=s-n;o>=t&&(_e(i),e(o-t))};return ut.setup(i,!0),()=>_e(i)}const tc=["TopLeft","TopRight","BottomLeft","BottomRight"],Tm=tc.length,ec=e=>typeof e=="string"?parseFloat(e):e,nc=e=>typeof e=="number"||U.test(e);function Em(e,t,n,i,s,o){s?(e.opacity=mt(0,n.opacity??1,Am(i)),e.opacityExit=mt(t.opacity??1,0,Rm(i))):o&&(e.opacity=mt(t.opacity??1,n.opacity??1,i));for(let r=0;r<Tm;r++){const a=`border${tc[r]}Radius`;let l=ic(t,a),c=ic(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||nc(l)===nc(c)?(e[a]=Math.max(mt(ec(l),ec(c),i),0),(re.test(c)||re.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=mt(t.rotate||0,n.rotate||0,i))}function ic(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Am=sc(0,.5,na),Rm=sc(.5,.95,jt);function sc(e,t,n){return i=>i<e?0:i>t?1:n(wn(e,t,i))}function rc(e,t){e.min=t.min,e.max=t.max}function Ut(e,t){rc(e.x,t.x),rc(e.y,t.y)}function oc(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ac(e,t,n,i,s){return e-=t,e=wi(e,1/n,i),s!==void 0&&(e=wi(e,1/s,i)),e}function Im(e,t=0,n=1,i=.5,s,o=e,r=e){if(re.test(t)&&(t=parseFloat(t),t=mt(r.min,r.max,t/100)-r.min),typeof t!="number")return;let a=mt(o.min,o.max,i);e===o&&(a-=t),e.min=ac(e.min,t,n,a,s),e.max=ac(e.max,t,n,a,s)}function lc(e,t,[n,i,s],o,r){Im(e,t[n],t[i],t[s],t.scale,o,r)}const Pm=["x","scaleX","originX"],Mm=["y","scaleY","originY"];function cc(e,t,n,i){lc(e.x,t,Pm,n?n.x:void 0,i?i.x:void 0),lc(e.y,t,Mm,n?n.y:void 0,i?i.y:void 0)}function uc(e){return e.translate===0&&e.scale===1}function dc(e){return uc(e.x)&&uc(e.y)}function hc(e,t){return e.min===t.min&&e.max===t.max}function Lm(e,t){return hc(e.x,t.x)&&hc(e.y,t.y)}function fc(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function pc(e,t){return fc(e.x,t.x)&&fc(e.y,t.y)}function mc(e){return Et(e.x)/Et(e.y)}function gc(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Dm{constructor(){this.members=[]}add(t){ls(this.members,t),t.scheduleRender()}remove(t){if(cs(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let i;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){i=o;break}}return i?(this.promote(i),!0):!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,n&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:i}=t;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Om(e,t,n){let i="";const s=e.x.translate/t.x,o=e.y.translate/t.y,r=(n==null?void 0:n.z)||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:u,rotateY:m,skewX:g,skewY:_}=n;c&&(i=`perspective(${c}px) ${i}`),d&&(i+=`rotate(${d}deg) `),u&&(i+=`rotateX(${u}deg) `),m&&(i+=`rotateY(${m}deg) `),g&&(i+=`skewX(${g}deg) `),_&&(i+=`skewY(${_}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(i+=`scale(${a}, ${l})`),i||"none"}const hr=["","X","Y","Z"],Nm=1e3;let Vm=0;function fr(e,t,n,i){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function vc(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=bl(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ut,!(s||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&vc(i)}function _c({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(r={},a=t==null?void 0:t()){this.id=Vm++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jm),this.nodes.forEach(Hm),this.nodes.forEach(zm),this.nodes.forEach($m)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Cm)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new hs),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=tl(r)&&!Of(r),this.instance=r;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let d,u=0;const m=()=>this.root.updateBlockedByResize=!1;ut.read(()=>{u=window.innerWidth}),e(r,()=>{const g=window.innerWidth;g!==u&&(u=g,this.root.updateBlockedByResize=!0,d&&d(),d=km(m,250),Si.hasAnimatedSinceResize&&(Si.hasAnimatedSinceResize=!1,this.nodes.forEach(wc)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:u,hasRelativeLayoutChanged:m,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||c.getDefaultTransition()||Ym,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!pc(this.targetLayout,g),S=!u&&m;if(this.options.layoutRoot||this.resumeFrom||S||u&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...Us(_,"layout"),onPlay:w,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(d,S)}else u||wc(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),_e(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Wm),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&vc(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(yc);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(bc);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Gm),this.nodes.forEach(Fm),this.nodes.forEach(Bm)):this.nodes.forEach(bc),this.clearAllSnapshots();const a=Mt.now();St.delta=fe(0,1e3/60,a-St.timestamp),St.timestamp=a,St.isProcessing=!0,ms.update.process(St),ms.preRender.process(St),ms.render.process(St),St.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,zs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Um),this.sharedNodes.forEach(qm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ut.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ut.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Et(this.snapshot.measuredBox.x)&&!Et(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=_t(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&this.instance){const l=i(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!dc(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;r&&this.instance&&(a||De(this.latestValues)||d)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),Zm(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:r}=this.options;if(!r)return _t();const a=r.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(Jm))){const{scroll:d}=this.root;d&&(tn(a.x,d.offset.x),tn(a.y,d.offset.y))}return a}removeElementScroll(r){var l;const a=_t();if(Ut(a,r),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:u,options:m}=d;d!==this.root&&u&&m.layoutScroll&&(u.wasRoot&&Ut(a,r),tn(a.x,u.offset.x),tn(a.y,u.offset.y))}return a}applyTransform(r,a=!1){const l=_t();Ut(l,r);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&en(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),De(d.latestValues)&&en(l,d.latestValues)}return De(this.latestValues)&&en(l,this.latestValues),l}removeTransform(r){const a=_t();Ut(a,r);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!De(c.latestValues))continue;ar(c.latestValues)&&c.updateSnapshot();const d=_t(),u=c.measurePageBox();Ut(d,u),cc(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return De(this.latestValues)&&cc(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==St.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var m;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=St.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),Vn(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),Ut(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_t(),this.targetWithTransforms=_t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nm(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ut(this.target,this.layout.layoutBox),Nl(this.target,this.targetDelta)):Ut(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),Vn(this.relativeTargetOrigin,this.target,g.target),Ut(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ar(this.parent.latestValues)||Ll(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var _;const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===St.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;Ut(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,m=this.treeScale.y;im(this.layoutCorrected,this.treeScale,this.path,a),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=_t());const{target:g}=r;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(oc(this.prevProjectionDelta.x,this.projectionDelta.x),oc(this.prevProjectionDelta.y,this.projectionDelta.y)),Nn(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==m||!gc(this.projectionDelta.x,this.prevProjectionDelta.x)||!gc(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),r){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Qe(),this.projectionDelta=Qe(),this.projectionDeltaWithTransform=Qe()}setAnimationOrigin(r,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Qe();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const m=_t(),g=l?l.source:void 0,_=this.layout?this.layout.source:void 0,w=g!==_,b=this.getStack(),y=!b||b.members.length<=1,S=!!(w&&!y&&this.options.crossfade===!0&&!this.path.some(Xm));this.animationProgress=0;let C;this.mixTargetDelta=P=>{const L=P/1e3;xc(u.x,r.x,L),xc(u.y,r.y,L),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vn(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Km(this.relativeTarget,this.relativeTargetOrigin,m,L),C&&Lm(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=_t()),Ut(C,this.relativeTarget)),w&&(this.animationValues=d,Em(d,c,this.latestValues,L,S,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(_e(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ut.update(()=>{Si.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Ye(0)),this.currentAnimation=xm(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),r.onUpdate&&r.onUpdate(d)},onStop:()=>{},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Nm),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=r;if(!(!a||!l||!c)){if(this!==r&&this.layout&&c&&Ec(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||_t();const u=Et(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+u;const m=Et(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+m}Ut(a,l),en(a,d),Nn(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Dm),this.sharedNodes.get(r).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var a;const{layoutId:r}=this.options;return r?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:r}=this.options;return r?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&fr("z",r,c,this.animationValues);for(let d=0;d<hr.length;d++)fr(`rotate${hr[d]}`,r,c,this.animationValues),fr(`skew${hr[d]}`,r,c,this.animationValues);r.render();for(const d in c)r.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);r.scheduleRender()}applyProjectionStyles(r,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=bi(a==null?void 0:a.pointerEvents)||"",r.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=bi(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!De(this.latestValues)&&(r.transform=l?l({},""):"none",this.hasProjected=!1);return}r.visibility="";const d=c.animationValues||c.latestValues;this.applyTransformsToTarget();let u=Om(this.projectionDeltaWithTransform,this.treeScale,d);l&&(u=l(d,u)),r.transform=u;const{x:m,y:g}=this.projectionDelta;r.transformOrigin=`${m.origin*100}% ${g.origin*100}% 0`,c.animationValues?r.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:r.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const _ in Pn){if(d[_]===void 0)continue;const{correct:w,applyTo:b,isCSSVariable:y}=Pn[_],S=u==="none"?d[_]:w(d[_],c);if(b){const C=b.length;for(let P=0;P<C;P++)r[b[P]]=S}else y?this.options.visualElement.renderState.vars[_]=S:r[_]=S}this.options.layoutId&&(r.pointerEvents=c===this?bi(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(yc),this.root.sharedNodes.clear()}}}function Fm(e){e.updateLayout()}function Bm(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:o}=e.options,r=t.source!==e.layout.source;o==="size"?$t(u=>{const m=r?t.measuredBox[u]:t.layoutBox[u],g=Et(m);m.min=i[u].min,m.max=m.min+g}):Ec(o,t.layoutBox,i)&&$t(u=>{const m=r?t.measuredBox[u]:t.layoutBox[u],g=Et(i[u]);m.max=m.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+g)});const a=Qe();Nn(a,i,t.layoutBox);const l=Qe();r?Nn(l,e.applyTransform(s,!0),t.measuredBox):Nn(l,i,t.layoutBox);const c=!dc(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:m,layout:g}=u;if(m&&g){const _=_t();Vn(_,t.layoutBox,m.layoutBox);const w=_t();Vn(w,i,g.layoutBox),pc(_,w)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=_,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function jm(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function $m(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Um(e){e.clearSnapshot()}function yc(e){e.clearMeasurements()}function bc(e){e.isLayoutDirty=!1}function Gm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function wc(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Hm(e){e.resolveTargetDelta()}function zm(e){e.calcProjection()}function Wm(e){e.resetSkewAndRotation()}function qm(e){e.removeLeadSnapshot()}function xc(e,t,n){e.translate=mt(t.translate,0,n),e.scale=mt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Sc(e,t,n,i){e.min=mt(t.min,n.min,i),e.max=mt(t.max,n.max,i)}function Km(e,t,n,i){Sc(e.x,t.x,n.x,i),Sc(e.y,t.y,n.y,i)}function Xm(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Ym={duration:.45,ease:[.4,0,.1,1]},Cc=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),kc=Cc("applewebkit/")&&!Cc("chrome/")?Math.round:jt;function Tc(e){e.min=kc(e.min),e.max=kc(e.max)}function Zm(e){Tc(e.x),Tc(e.y)}function Ec(e,t,n){return e==="position"||e==="preserve-aspect"&&!em(mc(t),mc(n),.2)}function Jm(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Qm=_c({attachResizeListener:(e,t)=>Ln(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pr={current:void 0},Ac=_c({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pr.current){const e=new Qm({});e.mount(window),e.setOptions({layoutScroll:!0}),pr.current=e}return pr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),tg={pan:{Feature:_m},drag:{Feature:vm,ProjectionNode:Ac,MeasureLayout:Ql}};function Rc(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=i[s];o&&ut.postRender(()=>o(t,Dn(t)))}class eg extends we{mount(){const{current:t}=this.node;t&&(this.unmount=If(t,(n,i)=>(Rc(this.node,i,"Start"),s=>Rc(this.node,s,"End"))))}unmount(){}}class ng extends we{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=bn(Ln(this.node.current,"focus",()=>this.onFocus()),Ln(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ic(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=i[s];o&&ut.postRender(()=>o(t,Dn(t)))}class ig extends we{mount(){const{current:t}=this.node;t&&(this.unmount=Df(t,(n,i)=>(Ic(this.node,i,"Start"),(s,{success:o})=>Ic(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const mr=new WeakMap,gr=new WeakMap,sg=e=>{const t=mr.get(e.target);t&&t(e)},rg=e=>{e.forEach(sg)};function og({root:e,...t}){const n=e||document;gr.has(n)||gr.set(n,{});const i=gr.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(rg,{root:e,...t})),i[s]}function ag(e,t,n){const i=og(t);return mr.set(e,n),i.observe(e),()=>{mr.delete(e),i.unobserve(e)}}const lg={some:0,all:1};class cg extends we{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:o}=t,r={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:lg[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),m=c?d:u;m&&m(l)};return ag(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(ug(t,n))&&this.startObserver()}unmount(){}}function ug({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const dg={inView:{Feature:cg},tap:{Feature:ig},focus:{Feature:ng},hover:{Feature:eg}},hg={layout:{ProjectionNode:Ac,MeasureLayout:Ql}},vr={current:null},Pc={current:!1};function fg(){if(Pc.current=!0,!!as)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>vr.current=e.matches;e.addEventListener("change",t),t()}else vr.current=!1}const pg=new WeakMap;function mg(e,t,n){for(const i in t){const s=t[i],o=n[i];if(kt(s))e.addValue(i,s);else if(kt(o))e.addValue(i,Ye(s,{owner:e}));else if(o!==s)if(e.hasValue(i)){const r=e.getValue(i);r.liveStyle===!0?r.jump(s):r.hasAnimated||r.set(s)}else{const r=e.getStaticValue(i);e.addValue(i,Ye(r!==void 0?r:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const Mc=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class gg{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:o,visualState:r},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=js,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Mt.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ut.render(this.render,!1,!0))};const{latestValues:l,renderState:c}=r;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=yi(n),this.isVariantNode=al(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...u}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in u){const g=u[m];l[m]!==void 0&&kt(g)&&g.set(l[m],!1)}}mount(t){this.current=t,pg.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((n,i)=>this.bindToMotionValue(i,n)),Pc.current||fg(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:vr.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),_e(this.notifyUpdate),_e(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const i=Xe.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ut.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o(),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 Ze){const n=Ze[t];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_t()}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 i=0;i<Mc.length;i++){const s=Mc[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,r=t[o];r&&(this.propEventSubscriptions[s]=this.on(s,r))}this.prevMotionValues=mg(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 i=this.values.get(t);n!==i&&(i&&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 i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Ye(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Wo(i)||Ko(i))?i=parseFloat(i):!Vf(i)&&be.test(n)&&(i=za(t,n)),this.setBaseTarget(t,kt(i)?i.get():i)),kt(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var o;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const r=tr(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);r&&(i=r[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!kt(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new hs),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Lc extends gg{constructor(){super(...arguments),this.KeyframeResolver=kf}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;kt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Dc(e,{style:t,vars:n},i,s){const o=e.style;let r;for(r in t)o[r]=t[r];s==null||s.applyProjectionStyles(o,i);for(r in n)o.setProperty(r,n[r])}function vg(e){return window.getComputedStyle(e)}class _g extends Lc{constructor(){super(...arguments),this.type="html",this.renderInstance=Dc}readValueFromInstance(t,n){var i;if(Xe.has(n))return(i=this.projection)!=null&&i.isProjecting?Os(n):Hh(t,n);{const s=vg(t),o=(gs(n)?s.getPropertyValue(n):s[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return jl(t,n)}build(t,n,i){Zs(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return er(t,n,i)}}const Oc=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function yg(e,t,n,i){Dc(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(Oc.has(s)?s:Ys(s),t.attrs[s])}class bg extends Lc{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_t}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Xe.has(n)){const i=Ha(n);return i&&i.default||0}return n=Oc.has(n)?n:Ys(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return yl(t,n,i)}build(t,n,i){pl(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,s){yg(t,n,i,s)}mount(t){this.isSVGTag=gl(t.tagName),super.mount(t)}}const wg=(e,t)=>Qs(e)?new bg(t):new _g(t,{allowProjection:e!==Qt}),xg=wp({...qp,...dg,...tg,...hg},wg),Bn=qf(xg),Sg=["agent-id","environment","position"],Ci="widget-layout-id";function Nc(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Nc(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Oe(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Nc(e))&&(i&&(i+=" "),i+=t);return i}const jn={},Vc=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Fc=e=>"init"in e,_r=e=>!!e.write,Bc=e=>"v"in e||"e"in e,ki=e=>{if("e"in e)throw e.e;if((jn?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},Ti=new WeakMap,jc=e=>{var t;return Ei(e)&&!!((t=Ti.get(e))!=null&&t[0])},Cg=e=>{const t=Ti.get(e);t!=null&&t[0]&&(t[0]=!1,t[1].forEach(n=>n()))},$c=(e,t)=>{let n=Ti.get(e);if(!n){n=[!0,new Set],Ti.set(e,n);const i=()=>{n[0]=!1};e.then(i,i)}n[1].add(t)},Ei=e=>typeof(e==null?void 0:e.then)=="function",Uc=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},yr=(e,t,n)=>{const i=n(e),s="v"in i,o=i.v;if(Ei(t))for(const r of i.d.keys())Uc(e,t,n(r));i.v=t,delete i.e,(!s||!Object.is(o,i.v))&&(++i.n,Ei(o)&&Cg(o))},Gc=(e,t,n)=>{var i;const s=new Set;for(const o of((i=n.get(e))==null?void 0:i.t)||[])n.has(o)&&s.add(o);for(const o of t.p)s.add(o);return s},kg=()=>{const e=new Set,t=()=>{e.forEach(n=>n())};return t.add=n=>(e.add(n),()=>{e.delete(n)}),t},br=()=>{const e={},t=new WeakMap,n=i=>{var s,o;(s=t.get(e))==null||s.forEach(r=>r(i)),(o=t.get(i))==null||o.forEach(r=>r())};return n.add=(i,s)=>{const o=i||e,r=(t.has(o)?t:t.set(o,new Set)).get(o);return r.add(s),()=>{r==null||r.delete(s),r.size||t.delete(o)}},n},Tg=e=>(e.c||(e.c=br()),e.m||(e.m=br()),e.u||(e.u=br()),e.f||(e.f=kg()),e),Eg=Symbol(),Hc=(e=new WeakMap,t=new WeakMap,n=new WeakMap,i=new Set,s=new Set,o=new Set,r={},a=(m,...g)=>m.read(...g),l=(m,...g)=>m.write(...g),c=(m,g)=>{var _;return(_=m.unstable_onInit)==null?void 0:_.call(m,g)},d=(m,g)=>{var _;return(_=m.onMount)==null?void 0:_.call(m,g)},...u)=>{const m=u[0]||(x=>{if((jn?"production":void 0)!=="production"&&!x)throw new Error("Atom is undefined or null");let k=e.get(x);return k||(k={d:new Map,p:new Set,n:0},e.set(x,k),c==null||c(x,D)),k}),g=u[1]||(()=>{const x=[],k=f=>{try{f()}catch(p){x.push(p)}};do{r.f&&k(r.f);const f=new Set,p=f.add.bind(f);i.forEach(h=>{var v;return(v=t.get(h))==null?void 0:v.l.forEach(p)}),i.clear(),o.forEach(p),o.clear(),s.forEach(p),s.clear(),f.forEach(k),i.size&&_()}while(i.size||o.size||s.size);if(x.length)throw new AggregateError(x)}),_=u[2]||(()=>{const x=[],k=new WeakSet,f=new WeakSet,p=Array.from(i);for(;p.length;){const h=p[p.length-1],v=m(h);if(f.has(h)){p.pop();continue}if(k.has(h)){if(n.get(h)===v.n)x.push([h,v]);else if((jn?"production":void 0)!=="production"&&n.has(h))throw new Error("[Bug] invalidated atom exists");f.add(h),p.pop();continue}k.add(h);for(const T of Gc(h,v,t))k.has(T)||p.push(T)}for(let h=x.length-1;h>=0;--h){const[v,T]=x[h];let R=!1;for(const E of T.d.keys())if(E!==v&&i.has(E)){R=!0;break}R&&(w(v),S(v)),n.delete(v)}}),w=u[3]||(x=>{var k;const f=m(x);if(Bc(f)&&(t.has(x)&&n.get(x)!==f.n||Array.from(f.d).every(([I,N])=>w(I).n===N)))return f;f.d.clear();let p=!0;const h=()=>{t.has(x)&&(S(x),_(),g())},v=I=>{var N;if(Vc(x,I)){const F=m(I);if(!Bc(F))if(Fc(I))yr(I,I.init,m);else throw new Error("no atom init");return ki(F)}const K=w(I);try{return ki(K)}finally{f.d.set(I,K.n),jc(f.v)&&Uc(x,f.v,K),(N=t.get(I))==null||N.t.add(x),p||h()}};let T,R;const E={get signal(){return T||(T=new AbortController),T.signal},get setSelf(){return(jn?"production":void 0)!=="production"&&!_r(x)&&console.warn("setSelf function cannot be used with read-only atom"),!R&&_r(x)&&(R=(...I)=>{if((jn?"production":void 0)!=="production"&&p&&console.warn("setSelf function cannot be called in sync"),!p)try{return y(x,...I)}finally{_(),g()}}),R}},M=f.n;try{const I=a(x,v,E);return yr(x,I,m),Ei(I)&&($c(I,()=>T==null?void 0:T.abort()),I.then(h,h)),f}catch(I){return delete f.v,f.e=I,++f.n,f}finally{p=!1,M!==f.n&&n.get(x)===M&&(n.set(x,f.n),i.add(x),(k=r.c)==null||k.call(r,x))}}),b=u[4]||(x=>{const k=[x];for(;k.length;){const f=k.pop(),p=m(f);for(const h of Gc(f,p,t)){const v=m(h);n.set(h,v.n),k.push(h)}}}),y=u[5]||((x,...k)=>{let f=!0;const p=v=>ki(w(v)),h=(v,...T)=>{var R;const E=m(v);try{if(Vc(x,v)){if(!Fc(v))throw new Error("atom not writable");const M=E.n,I=T[0];yr(v,I,m),S(v),M!==E.n&&(i.add(v),(R=r.c)==null||R.call(r,v),b(v));return}else return y(v,...T)}finally{f||(_(),g())}};try{return l(x,p,h,...k)}finally{f=!1}}),S=u[6]||(x=>{var k;const f=m(x),p=t.get(x);if(p&&!jc(f.v)){for(const[h,v]of f.d)if(!p.d.has(h)){const T=m(h);C(h).t.add(x),p.d.add(h),v!==T.n&&(i.add(h),(k=r.c)==null||k.call(r,h),b(h))}for(const h of p.d||[])if(!f.d.has(h)){p.d.delete(h);const v=P(h);v==null||v.t.delete(x)}}}),C=u[7]||(x=>{var k;const f=m(x);let p=t.get(x);if(!p){w(x);for(const h of f.d.keys())C(h).t.add(x);if(p={l:new Set,d:new Set(f.d.keys()),t:new Set},t.set(x,p),(k=r.m)==null||k.call(r,x),_r(x)){const h=()=>{let v=!0;const T=(...R)=>{try{return y(x,...R)}finally{v||(_(),g())}};try{const R=d(x,T);R&&(p.u=()=>{v=!0;try{R()}finally{v=!1}})}finally{v=!1}};s.add(h)}}return p}),P=u[8]||(x=>{var k;const f=m(x);let p=t.get(x);if(p&&!p.l.size&&!Array.from(p.t).some(h=>{var v;return(v=t.get(h))==null?void 0:v.d.has(x)})){p.u&&o.add(p.u),p=void 0,t.delete(x),(k=r.u)==null||k.call(r,x);for(const h of f.d.keys()){const v=P(h);v==null||v.t.delete(x)}return}return p}),L=[e,t,n,i,s,o,r,a,l,c,d,m,g,_,w,b,y,S,C,P],D={get:x=>ki(w(x)),set:(x,...k)=>{try{return y(x,...k)}finally{_(),g()}},sub:(x,k)=>{const p=C(x).l;return p.add(k),g(),()=>{p.delete(k),P(x),g()}}};return Object.defineProperty(D,Eg,{value:L}),D},Ag=Tg,zc=$c,wr={};let Rg=0;function xr(e,t){const n=`atom${++Rg}`,i={toString(){return(wr?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?i.read=e:(i.init=e,i.read=Ig,i.write=Pg),i}function Ig(e){return e(this)}function Pg(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const Mg=()=>{let e=0;const t=Ag({}),n=new WeakMap,i=new WeakMap,s=Hc(n,i,void 0,void 0,void 0,void 0,t,void 0,(a,l,c,...d)=>e?c(a,...d):a.write(l,c,...d)),o=new Set;return t.m.add(void 0,a=>{o.add(a);const l=n.get(a);l.m=i.get(a)}),t.u.add(void 0,a=>{o.delete(a);const l=n.get(a);delete l.m}),Object.assign(s,{dev4_get_internal_weak_map:()=>(console.log("Deprecated: Use devstore from the devtools library"),n),dev4_get_mounted_atoms:()=>o,dev4_restore_atoms:a=>{const l={read:()=>null,write:(c,d)=>{++e;try{for(const[u,m]of a)"init"in u&&d(u,m)}finally{--e}}};s.set(l)}})};function Lg(){return(wr?"production":void 0)!=="production"?Mg():Hc()}let $n;function Dg(){return $n||($n=Lg(),(wr?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=$n),globalThis.__JOTAI_DEFAULT_STORE__!==$n&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),$n}const Og={},Ng=Ae(void 0);function Wc(e){return wt(Ng)||Dg()}const Sr=e=>typeof(e==null?void 0:e.then)=="function",Cr=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},Vg=Ho.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(Cr(e),e)}),kr=new WeakMap,qc=(e,t)=>{let n=kr.get(e);return n||(n=new Promise((i,s)=>{let o=e;const r=c=>d=>{o===c&&i(d)},a=c=>d=>{o===c&&s(d)},l=()=>{try{const c=t();Sr(c)?(kr.set(c,n),o=c,c.then(r(c),a(c)),zc(c,l)):i(c)}catch(c){s(c)}};e.then(r(e),a(e)),zc(e,l)}),kr.set(e,n)),n};function Kc(e,t){const{delay:n,unstable_promiseStatus:i=!Ho.use}={},s=Wc(),[[o,r,a],l]=Co(d=>{const u=s.get(e);return Object.is(d[0],u)&&d[1]===s&&d[2]===e?d:[u,s,e]},void 0,()=>[s.get(e),s,e]);let c=o;if((r!==s||a!==e)&&(l(),c=s.get(e)),Kt(()=>{const d=s.sub(e,()=>{if(i)try{const u=s.get(e);Sr(u)&&Cr(qc(u,()=>s.get(e)))}catch{}if(typeof n=="number"){setTimeout(l,n);return}l()});return l(),d},[s,e,n,i]),kd(c),Sr(c)){const d=qc(c,()=>s.get(e));return i&&Cr(d),Vg(d)}return c}function Xc(e,t){const n=Wc();return ii((...s)=>{if((Og?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...s)},[n,e])}function Yc(e,t){return[Kc(e),Xc(e)]}const Fg=xr("waiting"),Zc=()=>Yc(Fg),Ai={theme:"dark",audio_visualizer_config:{color:"verdant",preset:"roundBars"},start_call_text:"Let's chat",default_state:"collapsed",position:"fixed",view_history_url:null,report_issue_url:null,give_feedback_url:null,agent_thinking_text:"Thinking...",speak_to_interrupt_text:"Speak to interrupt",logo_icon_url:null},Jc=xr(Ai),Bg=()=>{const e=Xc(Jc);return ii(t=>e(()=>{const n={...t};return n.start_call_text||(n.start_call_text=Ai.start_call_text),n.agent_thinking_text||(n.agent_thinking_text=Ai.agent_thinking_text),n.speak_to_interrupt_text||(n.speak_to_interrupt_text=Ai.speak_to_interrupt_text),n}),[e])},Ne=()=>Kc(Jc),Qc=({size:e="large",className:t})=>{const n=Ne(),[i]=Zc();return A("h1",{className:Oe({"text-xs":e==="small"},t),children:i==="waiting"?n.speak_to_interrupt_text:n.agent_thinking_text})},tu=({stream:e})=>{const t=Bt(null);return Kt(()=>{!t.current||!e||(t.current.srcObject=e)},[e]),A("audio",{muted:!0,ref:t,autoPlay:!0})};/**!
|
|
10
10
|
* audioMotion-analyzer
|
|
11
11
|
* High-resolution real-time graphic audio spectrum analyzer JS module
|
|
12
12
|
*
|