@gauravrathod674/super-customizable-chatbot 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-chatbot.es.js +2610 -2959
- package/dist/custom-chatbot.umd.js +34 -42
- package/package.json +10 -6
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(nt,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("react"),require("@fortawesome/react-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("react-markdown")):typeof define=="function"&&define.amd?define(["exports","react","@fortawesome/react-fontawesome","@fortawesome/free-solid-svg-icons","react-markdown"],y):(nt=typeof globalThis<"u"?globalThis:nt||self,y(nt.CustomChatBot={},nt.React,nt.ReactFontAwesome,nt.FontAwesomeIcons,nt.ReactMarkdown))})(this,function(nt,y,yr,vr,br){"use strict";function xr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Ie=xr(y);var ke={exports:{}},jt={};/**
|
|
2
2
|
* @license React
|
|
3
|
-
* react-jsx-runtime.production.
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c)
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Xn;function wr(){if(Xn)return jt;Xn=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(s,i,r){var o=null;if(r!==void 0&&(o=""+r),i.key!==void 0&&(o=""+i.key),"key"in i){r={};for(var a in i)a!=="key"&&(r[a]=i[a])}else r=i;return i=r.ref,{$$typeof:t,type:s,key:o,ref:i!==void 0?i:null,props:r}}return jt.Fragment=e,jt.jsx=n,jt.jsxs=n,jt}var Ft={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
13
|
-
* Copyright (c)
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+Q+d}}var Ft=!1,Me;{var Go=typeof WeakMap=="function"?WeakMap:Map;Me=new Go}function ms(d,g){if(!d||Ft)return"";{var w=Me.get(d);if(w!==void 0)return w}var D;Ft=!0;var L=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=wt.current,wt.current=null,gt();try{if(g){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(nt){D=nt}Reflect.construct(d,[],_)}else{try{_.call()}catch(nt){D=nt}d.call(_.prototype)}}else{try{throw Error()}catch(nt){D=nt}d()}}catch(nt){if(nt&&D&&typeof nt.stack=="string"){for(var I=nt.stack.split(`
|
|
19
|
-
`),et=D.stack.split(`
|
|
20
|
-
`),K=I.length-1,H=et.length-1;K>=1&&H>=0&&I[K]!==et[H];)H--;for(;K>=1&&H>=0;K--,H--)if(I[K]!==et[H]){if(K!==1||H!==1)do if(K--,H--,H<0||I[K]!==et[H]){var at=`
|
|
21
|
-
`+I[K].replace(" at new "," at ");return d.displayName&&at.includes("<anonymous>")&&(at=at.replace("<anonymous>",d.displayName)),typeof d=="function"&&Me.set(d,at),at}while(K>=1&&H>=0);break}}}finally{Ft=!1,wt.current=j,Dt(),Error.prepareStackTrace=L}var te=d?d.displayName||d.name:"",Bt=te?yt(te):"";return typeof d=="function"&&Me.set(d,Bt),Bt}function gs(d,g,w){return ms(d,!1)}function ys(d){var g=d.prototype;return!!(g&&g.isReactComponent)}function Jt(d,g,w){if(d==null)return"";if(typeof d=="function")return ms(d,ys(d));if(typeof d=="string")return yt(d);switch(d){case u:return yt("Suspense");case c:return yt("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case l:return gs(d.render);case f:return Jt(d.type,g,w);case h:{var D=d,L=D._payload,j=D._init;try{return Jt(j(L),g,w)}catch{}}}return""}var De=Object.prototype.hasOwnProperty,Ko={},Wo=y.ReactDebugCurrentFrame;function Ze(d){if(d){var g=d._owner,w=Jt(d.type,d._source,g?g.type:null);Wo.setExtraStackFrame(w)}else Wo.setExtraStackFrame(null)}function wd(d,g,w,D,L){{var j=Function.call.bind(De);for(var _ in d)if(j(d,_)){var I=void 0;try{if(typeof d[_]!="function"){var et=Error((D||"React class")+": "+w+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw et.name="Invariant Violation",et}I=d[_](g,_,D,w,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(K){I=K}I&&!(I instanceof Error)&&(Ze(L),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",D||"React class",w,_,typeof I),Ze(null)),I instanceof Error&&!(I.message in Ko)&&(Ko[I.message]=!0,Ze(L),x("Failed %s type: %s",w,I.message),Ze(null))}}}var Td=Array.isArray;function vs(d){return Td(d)}function Cd(d){{var g=typeof Symbol=="function"&&Symbol.toStringTag,w=g&&d[Symbol.toStringTag]||d.constructor.name||"Object";return w}}function Ed(d){try{return Ho(d),!1}catch{return!0}}function Ho(d){return""+d}function Yo(d){if(Ed(d))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Cd(d)),Ho(d)}var zo=y.ReactCurrentOwner,Sd={key:!0,ref:!0,__self:!0,__source:!0},qo,Xo;function Ad(d){if(De.call(d,"ref")){var g=Object.getOwnPropertyDescriptor(d,"ref").get;if(g&&g.isReactWarning)return!1}return d.ref!==void 0}function Pd(d){if(De.call(d,"key")){var g=Object.getOwnPropertyDescriptor(d,"key").get;if(g&&g.isReactWarning)return!1}return d.key!==void 0}function Rd(d,g){typeof d.ref=="string"&&zo.current}function Md(d,g){{var w=function(){qo||(qo=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g))};w.isReactWarning=!0,Object.defineProperty(d,"key",{get:w,configurable:!0})}}function Dd(d,g){{var w=function(){Xo||(Xo=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",g))};w.isReactWarning=!0,Object.defineProperty(d,"ref",{get:w,configurable:!0})}}var Od=function(d,g,w,D,L,j,_){var I={$$typeof:e,type:d,key:g,ref:w,props:_,_owner:j};return I._store={},Object.defineProperty(I._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(I,"_self",{configurable:!1,enumerable:!1,writable:!1,value:D}),Object.defineProperty(I,"_source",{configurable:!1,enumerable:!1,writable:!1,value:L}),Object.freeze&&(Object.freeze(I.props),Object.freeze(I)),I};function Vd(d,g,w,D,L){{var j,_={},I=null,et=null;w!==void 0&&(Yo(w),I=""+w),Pd(g)&&(Yo(g.key),I=""+g.key),Ad(g)&&(et=g.ref,Rd(g,L));for(j in g)De.call(g,j)&&!Sd.hasOwnProperty(j)&&(_[j]=g[j]);if(d&&d.defaultProps){var K=d.defaultProps;for(j in K)_[j]===void 0&&(_[j]=K[j])}if(I||et){var H=typeof d=="function"?d.displayName||d.name||"Unknown":d;I&&Md(_,H),et&&Dd(_,H)}return Od(d,I,et,L,D,zo.current,_)}}var bs=y.ReactCurrentOwner,Zo=y.ReactDebugCurrentFrame;function Qt(d){if(d){var g=d._owner,w=Jt(d.type,d._source,g?g.type:null);Zo.setExtraStackFrame(w)}else Zo.setExtraStackFrame(null)}var xs;xs=!1;function ws(d){return typeof d=="object"&&d!==null&&d.$$typeof===e}function Jo(){{if(bs.current){var d=P(bs.current.type);if(d)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+d+"`."}return""}}function Id(d){return""}var Qo={};function _d(d){{var g=Jo();if(!g){var w=typeof d=="string"?d:d.displayName||d.name;w&&(g=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+w+">.")}return g}}function ta(d,g){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var w=_d(g);if(Qo[w])return;Qo[w]=!0;var D="";d&&d._owner&&d._owner!==bs.current&&(D=" It was passed a child from "+P(d._owner.type)+"."),Qt(d),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',w,D),Qt(null)}}function ea(d,g){{if(typeof d!="object")return;if(vs(d))for(var w=0;w<d.length;w++){var D=d[w];ws(D)&&ta(D,g)}else if(ws(d))d._store&&(d._store.validated=!0);else if(d){var L=T(d);if(typeof L=="function"&&L!==d.entries)for(var j=L.call(d),_;!(_=j.next()).done;)ws(_.value)&&ta(_.value,g)}}}function kd(d){{var g=d.type;if(g==null||typeof g=="string")return;var w;if(typeof g=="function")w=g.propTypes;else if(typeof g=="object"&&(g.$$typeof===l||g.$$typeof===f))w=g.propTypes;else return;if(w){var D=P(g);wd(w,d.props,"prop",D,d)}else if(g.PropTypes!==void 0&&!xs){xs=!0;var L=P(g);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",L||"Unknown")}typeof g.getDefaultProps=="function"&&!g.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ld(d){{for(var g=Object.keys(d.props),w=0;w<g.length;w++){var D=g[w];if(D!=="children"&&D!=="key"){Qt(d),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",D),Qt(null);break}}d.ref!==null&&(Qt(d),x("Invalid attribute `ref` supplied to `React.Fragment`."),Qt(null))}}var na={};function sa(d,g,w,D,L,j){{var _=Y(d);if(!_){var I="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(I+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var et=Id();et?I+=et:I+=Jo();var K;d===null?K="null":vs(d)?K="array":d!==void 0&&d.$$typeof===e?(K="<"+(P(d.type)||"Unknown")+" />",I=" Did you accidentally export a JSX literal instead of a component?"):K=typeof d,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",K,I)}var H=Vd(d,g,w,L,j);if(H==null)return H;if(_){var at=g.children;if(at!==void 0)if(D)if(vs(at)){for(var te=0;te<at.length;te++)ea(at[te],d);Object.freeze&&Object.freeze(at)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ea(at,d)}if(De.call(g,"key")){var Bt=P(d),nt=Object.keys(g).filter(function($d){return $d!=="key"}),Ts=nt.length>0?"{key: someKey, "+nt.join(": ..., ")+": ...}":"{key: someKey}";if(!na[Bt+Ts]){var Ud=nt.length>0?"{"+nt.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX:
|
|
17
|
+
*/var Zn;function Tr(){return Zn||(Zn=1,process.env.NODE_ENV!=="production"&&function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===B?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case v:return"Fragment";case g:return"Profiler";case b:return"StrictMode";case x:return"Suspense";case A:return"SuspenseList";case L:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case m:return"Portal";case w:return(p.displayName||"Context")+".Provider";case E:return(p._context.displayName||"Context")+".Consumer";case D:var R=p.render;return p=p.displayName,p||(p=R.displayName||R.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case O:return R=p.displayName||null,R!==null?R:t(p.type)||"Memo";case P:R=p._payload,p=p._init;try{return t(p(R))}catch{}}return null}function e(p){return""+p}function n(p){try{e(p);var R=!1}catch{R=!0}if(R){R=console;var T=R.error,V=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return T.call(R,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",V),e(p)}}function s(p){if(p===v)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===P)return"<...>";try{var R=t(p);return R?"<"+R+">":"<...>"}catch{return"<...>"}}function i(){var p=Q.A;return p===null?null:p.getOwner()}function r(){return Error("react-stack-top-frame")}function o(p){if(lt.call(p,"key")){var R=Object.getOwnPropertyDescriptor(p,"key").get;if(R&&R.isReactWarning)return!1}return p.key!==void 0}function a(p,R){function T(){At||(At=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",R))}T.isReactWarning=!0,Object.defineProperty(p,"key",{get:T,configurable:!0})}function l(){var p=t(this.type);return he[p]||(he[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function u(p,R,T,V,$,G,ut,z){return T=G.ref,p={$$typeof:f,type:p,key:R,props:G,_owner:$},(T!==void 0?T:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:l}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ut}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function c(p,R,T,V,$,G,ut,z){var j=R.children;if(j!==void 0)if(V)if(M(j)){for(V=0;V<j.length;V++)h(j[V]);Object.freeze&&Object.freeze(j)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(j);if(lt.call(R,"key")){j=t(p);var rt=Object.keys(R).filter(function(gr){return gr!=="key"});V=0<rt.length?"{key: someKey, "+rt.join(": ..., ")+": ...}":"{key: someKey}",ct[j+V]||(rt=0<rt.length?"{"+rt.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
26
18
|
let props = %s;
|
|
27
19
|
<%s {...props} />
|
|
28
20
|
React keys must be passed directly to JSX without using spread:
|
|
29
21
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,V,j,rt,j),ct[j+V]=!0)}if(j=null,T!==void 0&&(n(T),j=""+T),o(R)&&(n(R.key),j=""+R.key),"key"in R){T={};for(var Oe in R)Oe!=="key"&&(T[Oe]=R[Oe])}else T=R;return j&&a(T,typeof p=="function"?p.displayName||p.name||"Unknown":p),u(p,j,G,$,i(),T,ut,z)}function h(p){typeof p=="object"&&p!==null&&p.$$typeof===f&&p._store&&(p._store.validated=1)}var d=y,f=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),w=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),B=Symbol.for("react.client.reference"),Q=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,lt=Object.prototype.hasOwnProperty,M=Array.isArray,vt=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var At,he={},N=d["react-stack-bottom-frame"].bind(d,r)(),Y=vt(s(r)),ct={};Ft.Fragment=v,Ft.jsx=function(p,R,T,V,$){var G=1e4>Q.recentlyCreatedOwnerStacks++;return c(p,R,T,!1,V,$,G?Error("react-stack-top-frame"):N,G?vt(s(p)):Y)},Ft.jsxs=function(p,R,T,V,$){var G=1e4>Q.recentlyCreatedOwnerStacks++;return c(p,R,T,!0,V,$,G?Error("react-stack-top-frame"):N,G?vt(s(p)):Y)}}()),Ft}process.env.NODE_ENV==="production"?ke.exports=wr():ke.exports=Tr();var C=ke.exports;const _e=y.createContext({});function Le(t){const e=y.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ne=typeof window<"u",Jn=Ne?y.useLayoutEffect:y.useEffect,de=y.createContext(null),je=y.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class Cr extends Ie.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,i=s instanceof HTMLElement&&s.offsetWidth||0,r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft,r.right=i-r.width-r.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Er({children:t,isPresent:e,anchorX:n}){const s=y.useId(),i=y.useRef(null),r=y.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=y.useContext(je);return y.useInsertionEffect(()=>{const{width:a,height:l,top:u,left:c,right:h}=r.current;if(e||!i.current||!a||!l)return;const d=n==="left"?`left: ${c}`:`right: ${h}`;i.current.dataset.motionPopId=s;const f=document.createElement("style");return o&&(f.nonce=o),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(`
|
|
31
23
|
[data-motion-pop-id="${s}"] {
|
|
32
24
|
position: absolute !important;
|
|
33
25
|
width: ${a}px !important;
|
|
34
26
|
height: ${l}px !important;
|
|
35
|
-
${
|
|
27
|
+
${d}px !important;
|
|
36
28
|
top: ${u}px !important;
|
|
37
29
|
}
|
|
38
|
-
`),()=>{document.head.removeChild(p)}},[e]),S.jsx(ua,{isPresent:e,childRef:i,sizeRef:o,children:Je.cloneElement(t,{ref:i})})}const da=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:o,mode:r,anchorX:a})=>{const l=en(ha),u=v.useId();let c=!0,f=v.useMemo(()=>(c=!1,{id:u,initial:e,isPresent:n,custom:i,onExitComplete:h=>{l.set(h,!0);for(const p of l.values())if(!p)return;s&&s()},register:h=>(l.set(h,!1),()=>l.delete(h))}),[n,l,s]);return o&&c&&(f={...f}),v.useMemo(()=>{l.forEach((h,p)=>l.set(p,!1))},[n]),Je.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),r==="popLayout"&&(t=S.jsx(fa,{isPresent:n,anchorX:a,children:t})),S.jsx(Oe.Provider,{value:f,children:t})};function ha(){return new Map}function As(t=!0){const e=v.useContext(Oe);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,o=v.useId();v.useEffect(()=>{if(t)return i(o)},[t]);const r=v.useCallback(()=>t&&s&&s(o),[o,s,t]);return!n&&s?[!1,r]:[!0]}const Ve=t=>t.key||"";function Ps(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const Rs=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:o="sync",propagate:r=!1,anchorX:a="left"})=>{const[l,u]=As(r),c=v.useMemo(()=>Ps(t),[t]),f=r&&!l?[]:c.map(Ve),h=v.useRef(!0),p=v.useRef(c),m=en(()=>new Map),[b,T]=v.useState(c),[y,x]=v.useState(c);Ss(()=>{h.current=!1,p.current=c;for(let C=0;C<y.length;C++){const R=Ve(y[C]);f.includes(R)?m.delete(R):m.get(R)!==!0&&m.set(R,!1)}},[y,f.length,f.join("-")]);const E=[];if(c!==b){let C=[...c];for(let R=0;R<y.length;R++){const k=y[R],M=Ve(k);f.includes(M)||(C.splice(R,0,k),E.push(k))}return o==="wait"&&E.length&&(C=E),x(Ps(C)),T(c),null}process.env.NODE_ENV!=="production"&&o==="wait"&&y.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:V}=v.useContext(tn);return S.jsx(S.Fragment,{children:y.map(C=>{const R=Ve(C),k=r&&!l?!1:c===y||f.includes(R),M=()=>{if(m.has(R))m.set(R,!0);else return;let U=!0;m.forEach(Y=>{Y||(U=!1)}),U&&(V==null||V(),x(p.current),r&&(u==null||u()),s&&s())};return S.jsx(da,{isPresent:k,initial:!h.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:o,onExitComplete:k?void 0:M,anchorX:a,children:C},R)})})};function rn(t,e){t.indexOf(e)===-1&&t.push(e)}function on(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let Ut=()=>{},Tt=()=>{};process.env.NODE_ENV!=="production"&&(Ut=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},Tt=(t,e)=>{if(!t)throw new Error(e)});const an={useManualTiming:!1};function ln(t){let e;return()=>(e===void 0&&(e=t()),e)}const st=t=>t,se=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class cn{constructor(){this.subscriptions=[]}add(e){return rn(this.subscriptions,e),()=>on(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const lt=t=>t*1e3,ft=t=>t/1e3;function Ms(t,e){return e?t*(1e3/e):0}const Ds=new Set;function Ie(t,e,n){t||Ds.has(e)||(console.warn(e),Ds.add(e))}const pa=ln(()=>window.ScrollTimeline!==void 0);class ma{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(i=>{if(pa()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class ga extends ma{then(e,n){return this.finished.finally(e).then(()=>{})}}const Os={value:null},un=t=>Array.isArray(t)&&typeof t[0]=="number",ya={};function va(t,e){const n=ln(t);return()=>ya[e]??n()}const ie=va(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vs=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let o=0;o<i;o++)s+=t(o/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},re=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,fn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:re([0,.65,.55,1]),circOut:re([.55,0,1,.45]),backIn:re([.31,.01,.66,-.59]),backOut:re([.33,1.53,.69,.99])};function Is(t,e){if(t)return typeof t=="function"&&ie()?Vs(t,e):un(t)?re(t):Array.isArray(t)?t.map(n=>Is(n,e)||fn.easeOut):fn[t]}function ba(t,e,n,{delay:s=0,duration:i=300,repeat:o=0,repeatType:r="loop",ease:a="easeInOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const f=Is(a,i);return Array.isArray(f)&&(c.easing=f),t.animate(c,{delay:s,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal",pseudoElement:u})}function dn(t){return typeof t=="function"&&"applyToOptions"in t}function hn(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const _e=2e4;function pn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<_e;)e+=n,s=t.next(e);return e>=_e?1/0:e}function xa(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(pn(s),_e);return{type:"keyframes",ease:o=>s.next(i*o).value/e,duration:ft(i)}}function _s(t){return!!(typeof t=="function"&&ie()||!t||typeof t=="string"&&(t in fn||ie())||un(t)||Array.isArray(t)&&t.every(_s))}function ks(t,e){t.timeline=e,t.onfinish=null}const ke=["read","resolveKeyframes","update","preRender","render","postRender"];function wa(t,e){let n=new Set,s=new Set,i=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(f){r.has(f)&&(c.schedule(f),t()),l++,f(a)}const c={schedule:(f,h=!1,p=!1)=>{const b=p&&i?n:s;return h&&r.add(f),b.has(f)||b.add(f),f},cancel:f=>{s.delete(f),r.delete(f)},process:f=>{if(a=f,i){o=!0;return}i=!0,[n,s]=[s,n],n.forEach(u),e&&Os.value&&Os.value.frameloop[e].push(l),l=0,n.clear(),i=!1,o&&(o=!1,c.process(f))}};return c}const Ta=40;function Ls(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=ke.reduce((y,x)=>(y[x]=wa(o,e?x:void 0),y),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:f,postRender:h}=r,p=()=>{const y=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(y-i.timestamp,Ta),1),i.timestamp=y,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),f.process(i),h.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(p))},m=()=>{n=!0,s=!0,i.isProcessing||t(p)};return{schedule:ke.reduce((y,x)=>{const E=r[x];return y[x]=(V,C=!1,R=!1)=>(n||m(),E.schedule(V,C,R)),y},{}),cancel:y=>{for(let x=0;x<ke.length;x++)r[ke[x]].cancel(y)},state:i,steps:r}}const{schedule:mn}=Ls(queueMicrotask,!1),{schedule:N,cancel:Ct,state:z,steps:gn}=Ls(typeof requestAnimationFrame<"u"?requestAnimationFrame:st,!0);let Le;function Ca(){Le=void 0}const dt={now:()=>(Le===void 0&&dt.set(z.isProcessing||an.useManualTiming?z.timestamp:performance.now()),Le),set:t=>{Le=t,queueMicrotask(Ca)}},ct={x:!1,y:!1};function js(){return ct.x||ct.y}function Ea(t){return t==="x"||t==="y"?ct[t]?null:(ct[t]=!0,()=>{ct[t]=!1}):ct.x||ct.y?null:(ct.x=ct.y=!0,()=>{ct.x=ct.y=!1})}function Sa(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}function Ns(t,e){const n=Sa(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function Fs(t){return!(t.pointerType==="touch"||js())}function Aa(t,e,n={}){const[s,i,o]=Ns(t,n),r=a=>{if(!Fs(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=f=>{Fs(f)&&(u(f),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",r,i)}),o}const Bs=(t,e)=>e?t===e?!0:Bs(t,e.parentElement):!1,yn=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Pa=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ra(t){return Pa.has(t.tagName)||t.tabIndex!==-1}const oe=new WeakSet;function Us(t){return e=>{e.key==="Enter"&&t(e)}}function vn(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Ma=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Us(()=>{if(oe.has(n))return;vn(n,"down");const i=Us(()=>{vn(n,"up")}),o=()=>vn(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",o,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function $s(t){return yn(t)&&!js()}function Da(t,e,n={}){const[s,i,o]=Ns(t,n),r=a=>{const l=a.currentTarget;if(!$s(a)||oe.has(l))return;oe.add(l);const u=e(l,a),c=(p,m)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),!(!$s(p)||!oe.has(l))&&(oe.delete(l),typeof u=="function"&&u(p,{success:m}))},f=p=>{c(p,l===window||l===document||n.useGlobalTarget||Bs(l,p.target))},h=p=>{c(p,!1)};window.addEventListener("pointerup",f,i),window.addEventListener("pointercancel",h,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",r,i),a instanceof HTMLElement&&(a.addEventListener("focus",u=>Ma(u,i)),!Ra(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}const Gs=30,Oa=t=>!isNaN(parseFloat(t));class Va{constructor(e,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const o=dt.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=dt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Oa(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&Ie(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new cn);const s=this.events[e].add(n);return e==="change"?()=>{s(),N.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=dt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Gs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Gs);return Ms(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ae(t,e){return new Va(t,e)}const Ks=v.createContext({strict:!1}),Ws={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"]},$t={};for(const t in Ws)$t[t]={isEnabled:e=>Ws[t].some(n=>!!e[n])};function Ia(t){for(const e in t)$t[e]={...$t[e],...t[e]}}const _a=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 je(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||_a.has(t)}let Hs=t=>!je(t);function ka(t){t&&(Hs=e=>e.startsWith("on")?!je(e):t(e))}try{ka(require("@emotion/is-prop-valid").default)}catch{}function La(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Hs(i)||n===!0&&je(i)||!e&&!je(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function ja(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>(process.env.NODE_ENV!=="production"&&Ie(!1,"motion() is deprecated. Use motion.create() instead."),t(...s));return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const Ne=v.createContext({});function Fe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function le(t){return typeof t=="string"||Array.isArray(t)}const bn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xn=["initial",...bn];function Be(t){return Fe(t.animate)||xn.some(e=>le(t[e]))}function Ys(t){return!!(Be(t)||t.variants)}function Na(t,e){if(Be(t)){const{initial:n,animate:s}=t;return{initial:n===!1||le(n)?n:void 0,animate:le(s)?s:void 0}}return t.inherit!==!1?e:{}}function Fa(t){const{initial:e,animate:n}=Na(t,v.useContext(Ne));return v.useMemo(()=>({initial:e,animate:n}),[zs(e),zs(n)])}function zs(t){return Array.isArray(t)?t.join(" "):t}const Ba=Symbol.for("motionComponentSymbol");function Gt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ua(t,e,n){return v.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):Gt(n)&&(n.current=s))},[e])}const wn=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),qs="data-"+wn("framerAppearId"),Xs=v.createContext({});function $a(t,e,n,s,i){var b,T;const{visualElement:o}=v.useContext(Ne),r=v.useContext(Ks),a=v.useContext(Oe),l=v.useContext(sn).reducedMotion,u=v.useRef(null);s=s||r.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:o,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,f=v.useContext(Xs);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&Ga(u.current,n,i,f);const h=v.useRef(!1);v.useInsertionEffect(()=>{c&&h.current&&c.update(n,a)});const p=n[qs],m=v.useRef(!!p&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,p))&&((T=window.MotionHasOptimisedAnimation)==null?void 0:T.call(window,p)));return Ss(()=>{c&&(h.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),mn.render(c.render),m.current&&c.animationState&&c.animationState.animateChanges())}),v.useEffect(()=>{c&&(!m.current&&c.animationState&&c.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)==null||y.call(window,p)}),m.current=!1))}),c}function Ga(t,e,n,s){const{layoutId:i,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Zs(t.parent)),t.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!r||a&&Gt(a),visualElement:t,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function Zs(t){if(t)return t.options.allowProjection!==!1?t.projection:Zs(t.parent)}function Ka({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&Ia(t);function o(a,l){let u;const c={...v.useContext(sn),...a,layoutId:Wa(a)},{isStatic:f}=c,h=Fa(a),p=s(a,f);if(!f&&nn){Ha(c,t);const m=Ya(c);u=m.MeasureLayout,h.visualElement=$a(i,p,c,e,m.ProjectionNode)}return S.jsxs(Ne.Provider,{value:h,children:[u&&h.visualElement?S.jsx(u,{visualElement:h.visualElement,...c}):null,n(i,a,Ua(p,h.visualElement,l),p,f,h.visualElement)]})}o.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const r=v.forwardRef(o);return r[Ba]=i,r}function Wa({layoutId:t}){const e=v.useContext(tn).id;return e&&t!==void 0?e+"-"+t:t}function Ha(t,e){const n=v.useContext(Ks).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Ut(!1,s):Tt(!1,s)}}function Ya(t){const{drag:e,layout:n}=$t;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const Js=t=>e=>typeof e=="string"&&e.startsWith(t),Tn=Js("--"),za=Js("var(--"),Cn=t=>za(t)?qa.test(t.split("/*")[0].trim()):!1,qa=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ce={};function Xa(t){for(const e in t)ce[e]=t[e],Tn(e)&&(ce[e].isCSSVariable=!0)}const Kt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ot=new Set(Kt);function Qs(t,{layout:e,layoutId:n}){return Ot.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ce[t]||t==="opacity")}const q=t=>!!(t&&t.getVelocity),ti=(t,e)=>e&&typeof t=="number"?e.transform(t):t,vt=(t,e,n)=>n>e?e:n<t?t:n,Wt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ue={...Wt,transform:t=>vt(0,1,t)},Ue={...Wt,default:1},fe=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Et=fe("deg"),ht=fe("%"),A=fe("px"),Za=fe("vh"),Ja=fe("vw"),ei={...ht,parse:t=>ht.parse(t)/100,transform:t=>ht.transform(t*100)},Qa={borderWidth:A,borderTopWidth:A,borderRightWidth:A,borderBottomWidth:A,borderLeftWidth:A,borderRadius:A,radius:A,borderTopLeftRadius:A,borderTopRightRadius:A,borderBottomRightRadius:A,borderBottomLeftRadius:A,width:A,maxWidth:A,height:A,maxHeight:A,top:A,right:A,bottom:A,left:A,padding:A,paddingTop:A,paddingRight:A,paddingBottom:A,paddingLeft:A,margin:A,marginTop:A,marginRight:A,marginBottom:A,marginLeft:A,backgroundPositionX:A,backgroundPositionY:A},tl={rotate:Et,rotateX:Et,rotateY:Et,rotateZ:Et,scale:Ue,scaleX:Ue,scaleY:Ue,scaleZ:Ue,skew:Et,skewX:Et,skewY:Et,distance:A,translateX:A,translateY:A,translateZ:A,x:A,y:A,z:A,perspective:A,transformPerspective:A,opacity:ue,originX:ei,originY:ei,originZ:A},ni={...Wt,transform:Math.round},En={...Qa,...tl,zIndex:ni,size:A,fillOpacity:ue,strokeOpacity:ue,numOctaves:ni},el={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nl=Kt.length;function sl(t,e,n){let s="",i=!0;for(let o=0;o<nl;o++){const r=Kt[o],a=t[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 u=ti(a,En[r]);if(!l){i=!1;const c=el[r]||r;s+=`${c}(${u}) `}n&&(e[r]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Sn(t,e,n){const{style:s,vars:i,transformOrigin:o}=t;let r=!1,a=!1;for(const l in e){const u=e[l];if(Ot.has(l)){r=!0;continue}else if(Tn(l)){i[l]=u;continue}else{const c=ti(u,En[l]);l.startsWith("origin")?(a=!0,o[l]=c):s[l]=c}}if(e.transform||(r||n?s.transform=sl(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=o;s.transformOrigin=`${l} ${u} ${c}`}}const An=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function si(t,e,n){for(const s in e)!q(e[s])&&!Qs(s,n)&&(t[s]=e[s])}function il({transformTemplate:t},e){return v.useMemo(()=>{const n=An();return Sn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function rl(t,e){const n=t.style||{},s={};return si(s,n,t),Object.assign(s,il(t,e)),s}function ol(t,e){const n={},s=rl(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const al=["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 Pn(t){return typeof t!="string"||t.includes("-")?!1:!!(al.indexOf(t)>-1||/[A-Z]/u.test(t))}const ll={offset:"stroke-dashoffset",array:"stroke-dasharray"},cl={offset:"strokeDashoffset",array:"strokeDasharray"};function ul(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?ll:cl;t[o.offset]=A.transform(-s);const r=A.transform(e),a=A.transform(n);t[o.array]=`${r} ${a}`}function ii(t,e,n){return typeof t=="string"?t:A.transform(e+n*t)}function fl(t,e,n){const s=ii(e,t.x,t.width),i=ii(n,t.y,t.height);return`${s} ${i}`}function Rn(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:l=0,...u},c,f){if(Sn(t,u,f),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:p,dimensions:m}=t;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=fl(m,i!==void 0?i:.5,o!==void 0?o:.5)),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),s!==void 0&&(h.scale=s),r!==void 0&&ul(h,r,a,l,!1)}const ri=()=>({...An(),attrs:{}}),Mn=t=>typeof t=="string"&&t.toLowerCase()==="svg";function dl(t,e,n,s){const i=v.useMemo(()=>{const o=ri();return Rn(o,e,Mn(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};si(o,t.style,t),i.style={...o,...i.style}}return i}function hl(t=!1){return(n,s,i,{latestValues:o},r)=>{const l=(Pn(n)?dl:ol)(s,o,r,n),u=La(s,typeof n=="string",t),c=n!==v.Fragment?{...u,...l,ref:i}:{},{children:f}=s,h=v.useMemo(()=>q(f)?f.get():f,[f]);return v.createElement(n,{...c,children:h})}}function oi(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Dn(t,e,n,s){if(typeof e=="function"){const[i,o]=oi(s);e=e(n!==void 0?n:t.custom,i,o)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,o]=oi(s);e=e(n!==void 0?n:t.custom,i,o)}return e}const On=t=>Array.isArray(t),pl=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),ml=t=>On(t)?t[t.length-1]||0:t;function $e(t){const e=q(t)?t.get():t;return pl(e)?e.toValue():e}function gl({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,o){const r={latestValues:yl(s,i,o,t),renderState:e()};return n&&(r.onMount=a=>n({props:s,current:a,...r}),r.onUpdate=a=>n(a)),r}const ai=t=>(e,n)=>{const s=v.useContext(Ne),i=v.useContext(Oe),o=()=>gl(t,e,s,i);return n?o():en(o)};function yl(t,e,n,s){const i={},o=s(t,{});for(const h in o)i[h]=$e(o[h]);let{initial:r,animate:a}=t;const l=Be(t),u=Ys(t);e&&u&&!l&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||r===!1;const f=c?a:r;if(f&&typeof f!="boolean"&&!Fe(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const m=Dn(t,h[p]);if(m){const{transitionEnd:b,transition:T,...y}=m;for(const x in y){let E=y[x];if(Array.isArray(E)){const V=c?E.length-1:0;E=E[V]}E!==null&&(i[x]=E)}for(const x in b)i[x]=b[x]}}}return i}function Vn(t,e,n){var o;const{style:s}=t,i={};for(const r in s)(q(s[r])||e.style&&q(e.style[r])||Qs(r,t)||((o=n==null?void 0:n.getValue(r))==null?void 0:o.liveStyle)!==void 0)&&(i[r]=s[r]);return i}const vl={useVisualState:ai({scrapeMotionValuesFromProps:Vn,createRenderState:An})};function li(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}function ci(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}const ui=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 fi(t,e,n,s){ci(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(ui.has(i)?i:wn(i),e.attrs[i])}function di(t,e,n){const s=Vn(t,e,n);for(const i in t)if(q(t[i])||q(e[i])){const o=Kt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[o]=t[i]}return s}const hi=["x","y","width","height","cx","cy","r"],bl={useVisualState:ai({scrapeMotionValuesFromProps:di,createRenderState:ri,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:i})=>{if(!n)return;let o=!!t.drag;if(!o){for(const a in i)if(Ot.has(a)){o=!0;break}}if(!o)return;let r=!e;if(e)for(let a=0;a<hi.length;a++){const l=hi[a];t[l]!==e[l]&&(r=!0)}r&&N.read(()=>{li(n,s),N.render(()=>{Rn(s,i,Mn(n.tagName),t.transformTemplate),fi(n,s)})})}})};function xl(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const r={...Pn(s)?bl:vl,preloadedFeatures:t,useRender:hl(i),createVisualElement:e,Component:s};return Ka(r)}}function de(t,e,n){const s=t.getProps();return Dn(s,e,n!==void 0?n:s.custom,t)}const pi=new Set(["width","height","top","left","right","bottom",...Kt]);function wl(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ae(n))}function Tl(t,e){const n=de(t,e);let{transitionEnd:s={},transition:i={},...o}=n||{};o={...o,...s};for(const r in o){const a=ml(o[r]);wl(t,r,a)}}function Cl(t){return!!(q(t)&&t.add)}function In(t,e){const n=t.getValue("willChange");if(Cl(n))return n.add(e);if(!n&&an.WillChange){const s=new an.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function mi(t){return t.props[qs]}const gi=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,El=1e-7,Sl=12;function Al(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=gi(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>El&&++a<Sl);return r}function he(t,e,n,s){if(t===e&&n===s)return st;const i=o=>Al(o,0,1,t,n);return o=>o===0||o===1?o:gi(i(o),e,s)}const yi=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,vi=t=>e=>1-t(1-e),bi=he(.33,1.53,.69,.99),_n=vi(bi),xi=yi(_n),wi=t=>(t*=2)<1?.5*_n(t):.5*(2-Math.pow(2,-10*(t-1))),kn=t=>1-Math.sin(Math.acos(t)),Ti=vi(kn),Ci=yi(kn),Ei=t=>/^0[^.\s]+$/u.test(t);function Pl(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ei(t):!0}const pe=t=>Math.round(t*1e5)/1e5,Ln=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Rl(t){return t==null}const Ml=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jn=(t,e)=>n=>!!(typeof n=="string"&&Ml.test(n)&&n.startsWith(t)||e&&!Rl(n)&&Object.prototype.hasOwnProperty.call(n,e)),Si=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,o,r,a]=s.match(Ln);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},Dl=t=>vt(0,255,t),Nn={...Wt,transform:t=>Math.round(Dl(t))},Vt={test:jn("rgb","red"),parse:Si("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Nn.transform(t)+", "+Nn.transform(e)+", "+Nn.transform(n)+", "+pe(ue.transform(s))+")"};function Ol(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Fn={test:jn("#"),parse:Ol,transform:Vt.transform},Ht={test:jn("hsl","hue"),parse:Si("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ht.transform(pe(e))+", "+ht.transform(pe(n))+", "+pe(ue.transform(s))+")"},X={test:t=>Vt.test(t)||Fn.test(t)||Ht.test(t),parse:t=>Vt.test(t)?Vt.parse(t):Ht.test(t)?Ht.parse(t):Fn.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Vt.transform(t):Ht.transform(t)},Vl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Il(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Ln))==null?void 0:e.length)||0)+(((n=t.match(Vl))==null?void 0:n.length)||0)>0}const Ai="number",Pi="color",_l="var",kl="var(",Ri="${}",Ll=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function me(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let o=0;const a=e.replace(Ll,l=>(X.test(l)?(s.color.push(o),i.push(Pi),n.push(X.parse(l))):l.startsWith(kl)?(s.var.push(o),i.push(_l),n.push(l)):(s.number.push(o),i.push(Ai),n.push(parseFloat(l))),++o,Ri)).split(Ri);return{values:n,split:a,indexes:s,types:i}}function Mi(t){return me(t).values}function Di(t){const{split:e,types:n}=me(t),s=e.length;return i=>{let o="";for(let r=0;r<s;r++)if(o+=e[r],i[r]!==void 0){const a=n[r];a===Ai?o+=pe(i[r]):a===Pi?o+=X.transform(i[r]):o+=i[r]}return o}}const jl=t=>typeof t=="number"?0:t;function Nl(t){const e=Mi(t);return Di(t)(e.map(jl))}const St={test:Il,parse:Mi,createTransformer:Di,getAnimatableNone:Nl},Fl=new Set(["brightness","contrast","saturate","opacity"]);function Bl(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ln)||[];if(!s)return t;const i=n.replace(s,"");let o=Fl.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Ul=/\b([a-z-]*)\(.*?\)/gu,Bn={...St,getAnimatableNone:t=>{const e=t.match(Ul);return e?e.map(Bl).join(" "):t}},$l={...En,color:X,backgroundColor:X,outlineColor:X,fill:X,stroke:X,borderColor:X,borderTopColor:X,borderRightColor:X,borderBottomColor:X,borderLeftColor:X,filter:Bn,WebkitFilter:Bn},Oi=t=>$l[t];function Vi(t,e){let n=Oi(t);return n!==Bn&&(n=St),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Gl=new Set(["auto","none","0"]);function Kl(t,e,n){let s=0,i;for(;s<t.length&&!i;){const o=t[s];typeof o=="string"&&!Gl.has(o)&&me(o).values.length&&(i=t[s]),s++}if(i&&n)for(const o of e)t[o]=Vi(n,i)}const It=t=>t*180/Math.PI,Un=t=>{const e=It(Math.atan2(t[1],t[0]));return $n(e)},Wl={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Un,rotateZ:Un,skewX:t=>It(Math.atan(t[1])),skewY:t=>It(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},$n=t=>(t=t%360,t<0&&(t+=360),t),Ii=Un,_i=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ki=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),Hl={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_i,scaleY:ki,scale:t=>(_i(t)+ki(t))/2,rotateX:t=>$n(It(Math.atan2(t[6],t[5]))),rotateY:t=>$n(It(Math.atan2(-t[2],t[0]))),rotateZ:Ii,rotate:Ii,skewX:t=>It(Math.atan(t[4])),skewY:t=>It(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Li(t){return t.includes("scale")?1:0}function Gn(t,e){if(!t||t==="none")return Li(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=Hl,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Wl,i=a}if(!i)return Li(e);const o=s[e],r=i[1].split(",").map(zl);return typeof o=="function"?o(r):r[o]}const Yl=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return Gn(n,e)};function zl(t){return parseFloat(t.trim())}const ji=t=>t===Wt||t===A,ql=new Set(["x","y","z"]),Xl=Kt.filter(t=>!ql.has(t));function Zl(t){const e=[];return Xl.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Yt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>Gn(e,"x"),y:(t,{transform:e})=>Gn(e,"y")};Yt.translateX=Yt.x,Yt.translateY=Yt.y;const _t=new Set;let Kn=!1,Wn=!1;function Ni(){if(Wn){const t=Array.from(_t).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Zl(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([o,r])=>{var a;(a=s.getValue(o))==null||a.set(r)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Wn=!1,Kn=!1,_t.forEach(t=>t.complete()),_t.clear()}function Fi(){_t.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Wn=!0)})}function Jl(){Fi(),Ni()}class Hn{constructor(e,n,s,i,o,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=o,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(_t.add(this),Kn||(Kn=!0,N.read(Fi),N.resolveKeyframes(Ni))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const r=i==null?void 0:i.get(),a=e[e.length-1];if(r!==void 0)e[0]=r;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&r===void 0&&i.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),_t.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,_t.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Bi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),Ql=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function tc(t){const e=Ql.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const ec=4;function Ui(t,e,n=1){Tt(n<=ec,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,i]=tc(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return Bi(r)?parseFloat(r):r}return Cn(i)?Ui(i,e,n+1):i}const $i=t=>e=>e.test(t),Gi=[Wt,A,ht,Et,Ja,Za,{test:t=>t==="auto",parse:t=>t}],Ki=t=>Gi.find($i(t));class Wi extends Hn{constructor(e,n,s,i,o){super(e,n,s,i,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),Cn(u))){const c=Ui(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!pi.has(s)||e.length!==2)return;const[i,o]=e,r=Ki(i),a=Ki(o);if(r!==a)if(ji(r)&&ji(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)Pl(e[i])&&s.push(i);s.length&&Kl(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Yt[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,r=s[o];s[o]=Yt[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const Hi=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(St.test(t)||t==="0")&&!t.startsWith("url("));function nc(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function sc(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const o=t[t.length-1],r=Hi(i,e),a=Hi(o,e);return Ut(r===a,`You are trying to animate ${e} from "${i}" to "${o}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${o} via the \`style\` property.`),!r||!a?!1:nc(t)||(n==="spring"||dn(n))&&s}const ic=t=>t!==null;function Ge(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(ic),o=e&&n!=="loop"&&e%2===1?0:i.length-1;return!o||s===void 0?i[o]:s}const rc=40;class Yi{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:o=0,repeatType:r="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=dt.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:o,repeatType:r,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>rc?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Jl(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=dt.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:o,delay:r,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!sc(e,s,i,o))if(r)this.options.duration=0;else{l&&l(Ge(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const F=(t,e,n)=>t+(e-t)*n;function Yn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function oc({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=Yn(l,a,t+1/3),o=Yn(l,a,t),r=Yn(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}function Ke(t,e){return n=>n>0?e:t}const zn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ac=[Fn,Vt,Ht],lc=t=>ac.find(e=>e.test(t));function zi(t){const e=lc(t);if(Ut(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Ht&&(n=oc(n)),n}const qi=(t,e)=>{const n=zi(t),s=zi(e);if(!n||!s)return Ke(t,e);const i={...n};return o=>(i.red=zn(n.red,s.red,o),i.green=zn(n.green,s.green,o),i.blue=zn(n.blue,s.blue,o),i.alpha=F(n.alpha,s.alpha,o),Vt.transform(i))},cc=(t,e)=>n=>e(t(n)),ge=(...t)=>t.reduce(cc),qn=new Set(["none","hidden"]);function uc(t,e){return qn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function fc(t,e){return n=>F(t,e,n)}function Xn(t){return typeof t=="number"?fc:typeof t=="string"?Cn(t)?Ke:X.test(t)?qi:pc:Array.isArray(t)?Xi:typeof t=="object"?X.test(t)?qi:dc:Ke}function Xi(t,e){const n=[...t],s=n.length,i=t.map((o,r)=>Xn(o)(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}}function dc(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Xn(t[i])(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}}function hc(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],r=t.indexes[o][s[o]],a=t.values[r]??0;n[i]=a,s[o]++}return n}const pc=(t,e)=>{const n=St.createTransformer(e),s=me(t),i=me(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?qn.has(t)&&!i.values.length||qn.has(e)&&!s.values.length?uc(t,e):ge(Xi(hc(s,i),i.values),n):(Ut(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Ke(t,e))};function Zi(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?F(t,e,n):Xn(t)(t,e)}const mc=5;function Ji(t,e,n){const s=Math.max(e-mc,0);return Ms(n-t(s),e-s)}const B={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Zn=.001;function gc({duration:t=B.duration,bounce:e=B.bounce,velocity:n=B.velocity,mass:s=B.mass}){let i,o;Ut(t<=lt(B.maxDuration),"Spring duration must be 10 seconds or less");let r=1-e;r=vt(B.minDamping,B.maxDamping,r),t=vt(B.minDuration,B.maxDuration,ft(t)),r<1?(i=u=>{const c=u*r,f=c*t,h=c-n,p=Jn(u,r),m=Math.exp(-f);return Zn-h/p*m},o=u=>{const f=u*r*t,h=f*n+n,p=Math.pow(r,2)*Math.pow(u,2)*t,m=Math.exp(-f),b=Jn(Math.pow(u,2),r);return(-i(u)+Zn>0?-1:1)*((h-p)*m)/b}):(i=u=>{const c=Math.exp(-u*t),f=(u-n)*t+1;return-Zn+c*f},o=u=>{const c=Math.exp(-u*t),f=(n-u)*(t*t);return c*f});const a=5/t,l=vc(i,o,a);if(t=lt(t),isNaN(l))return{stiffness:B.stiffness,damping:B.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:r*2*Math.sqrt(s*u),duration:t}}}const yc=12;function vc(t,e,n){let s=n;for(let i=1;i<yc;i++)s=s-t(s)/e(s);return s}function Jn(t,e){return t*Math.sqrt(1-e*e)}const bc=["duration","bounce"],xc=["stiffness","damping","mass"];function Qi(t,e){return e.some(n=>t[n]!==void 0)}function wc(t){let e={velocity:B.velocity,stiffness:B.stiffness,damping:B.damping,mass:B.mass,isResolvedFromDuration:!1,...t};if(!Qi(t,xc)&&Qi(t,bc))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,o=2*vt(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:B.mass,stiffness:i,damping:o}}else{const n=gc(t);e={...e,...n,mass:B.mass},e.isResolvedFromDuration=!0}return e}function We(t=B.visualDuration,e=B.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:f,velocity:h,isResolvedFromDuration:p}=wc({...n,velocity:-ft(n.velocity||0)}),m=h||0,b=u/(2*Math.sqrt(l*c)),T=r-o,y=ft(Math.sqrt(l/c)),x=Math.abs(T)<5;s||(s=x?B.restSpeed.granular:B.restSpeed.default),i||(i=x?B.restDelta.granular:B.restDelta.default);let E;if(b<1){const C=Jn(y,b);E=R=>{const k=Math.exp(-b*y*R);return r-k*((m+b*y*T)/C*Math.sin(C*R)+T*Math.cos(C*R))}}else if(b===1)E=C=>r-Math.exp(-y*C)*(T+(m+y*T)*C);else{const C=y*Math.sqrt(b*b-1);E=R=>{const k=Math.exp(-b*y*R),M=Math.min(C*R,300);return r-k*((m+b*y*T)*Math.sinh(M)+C*T*Math.cosh(M))/C}}const V={calculatedDuration:p&&f||null,next:C=>{const R=E(C);if(p)a.done=C>=f;else{let k=0;b<1&&(k=C===0?lt(m):Ji(E,C,R));const M=Math.abs(k)<=s,U=Math.abs(r-R)<=i;a.done=M&&U}return a.value=a.done?r:R,a},toString:()=>{const C=Math.min(pn(V),_e),R=Vs(k=>V.next(C*k).value,C,30);return C+"ms "+R},toTransition:()=>{}};return V}We.applyToOptions=t=>{const e=xa(t,100,We);return t.ease=ie()?e.ease:"easeOut",t.duration=lt(e.duration),t.type="keyframes",t};function tr({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=t[0],h={done:!1,value:f},p=M=>a!==void 0&&M<a||l!==void 0&&M>l,m=M=>a===void 0?l:l===void 0||Math.abs(a-M)<Math.abs(l-M)?a:l;let b=n*e;const T=f+b,y=r===void 0?T:r(T);y!==T&&(b=y-f);const x=M=>-b*Math.exp(-M/s),E=M=>y+x(M),V=M=>{const U=x(M),Y=E(M);h.done=Math.abs(U)<=u,h.value=h.done?y:Y};let C,R;const k=M=>{p(h.value)&&(C=M,R=We({keyframes:[h.value,m(h.value)],velocity:Ji(E,M,h.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return k(0),{calculatedDuration:null,next:M=>{let U=!1;return!R&&C===void 0&&(U=!0,V(M),k(M)),C!==void 0&&M>=C?R.next(M-C):(!U&&V(M),h)}}}const Tc=he(.42,0,1,1),Cc=he(0,0,.58,1),er=he(.42,0,.58,1),Ec=t=>Array.isArray(t)&&typeof t[0]!="number",nr={linear:st,easeIn:Tc,easeInOut:er,easeOut:Cc,circIn:kn,circInOut:Ci,circOut:Ti,backIn:_n,backInOut:xi,backOut:bi,anticipate:wi},sr=t=>{if(un(t)){Tt(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,s,i]=t;return he(e,n,s,i)}else if(typeof t=="string")return Tt(nr[t]!==void 0,`Invalid easing type '${t}'`),nr[t];return t};function Sc(t,e,n){const s=[],i=n||Zi,o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const l=Array.isArray(e)?e[r]||st:e;a=ge(l,a)}s.push(a)}return s}function Ac(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Tt(o===e.length,"Both input and output ranges must be the same length"),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=Sc(e,s,i),l=a.length,u=c=>{if(r&&c<t[0])return e[0];let f=0;if(l>1)for(;f<t.length-2&&!(c<t[f+1]);f++);const h=se(t[f],t[f+1],c);return a[f](h)};return n?c=>u(vt(t[0],t[o-1],c)):u}function Pc(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=se(0,e,s);t.push(F(n,1,i))}}function Rc(t){const e=[0];return Pc(e,t.length-1),e}function Mc(t,e){return t.map(n=>n*e)}function Dc(t,e){return t.map(()=>e||er).splice(0,t.length-1)}function ye({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Ec(s)?s.map(sr):sr(s),o={done:!1,value:e[0]},r=Mc(n&&n.length===e.length?n:Rc(e),t),a=Ac(r,e,{ease:Array.isArray(i)?i:Dc(e,i)});return{calculatedDuration:t,next:l=>(o.value=a(l),o.done=l>=t,o)}}const Oc=t=>{const e=({timestamp:n})=>t(n);return{start:()=>N.update(e,!0),stop:()=>Ct(e),now:()=>z.isProcessing?z.timestamp:dt.now()}},Vc={decay:tr,inertia:tr,tween:ye,keyframes:ye,spring:We},Ic=t=>t/100;class Qn extends Yi{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:o}=this.options,r=(i==null?void 0:i.KeyframeResolver)||Hn,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new r(o,a,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o,velocity:r=0}=this.options,a=dn(n)?n:Vc[n]||ye;let l,u;process.env.NODE_ENV!=="production"&&a!==ye&&Tt(e.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a!==ye&&typeof e[0]!="number"&&(l=ge(Ic,Zi(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});o==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-r})),c.calculatedDuration===null&&(c.calculatedDuration=pn(c));const{calculatedDuration:f}=c,h=f+i,p=h*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:h,totalDuration:p}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:r,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=s;if(this.startTime===null)return o.next(0);const{delay:h,repeat:p,repeatType:m,repeatDelay:b,onUpdate:T}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const y=this.currentTime-h*(this.speed>=0?1:-1),x=this.speed>=0?y<0:y>c;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let E=this.currentTime,V=o;if(p){const M=Math.min(this.currentTime,c)/f;let U=Math.floor(M),Y=M%1;!Y&&M>=1&&(Y=1),Y===1&&U--,U=Math.min(U,p+1),!!(U%2)&&(m==="reverse"?(Y=1-Y,b&&(Y-=b/f)):m==="mirror"&&(V=r)),E=vt(0,1,Y)*f}const C=x?{done:!1,value:l[0]}:V.next(E);a&&(C.value=a(C.value));let{done:R}=C;!x&&u!==null&&(R=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return k&&i!==void 0&&(C.value=Ge(l,this.options,i)),T&&T(C.value),k&&this.finish(),C}get duration(){const{resolved:e}=this;return e?ft(e.calculatedDuration):0}get time(){return ft(this.currentTime)}set time(e){e=lt(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=ft(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Oc,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}get finished(){return this.currentFinishedPromise}}const _c=new Set(["opacity","clipPath","filter","transform"]),kc=ln(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),He=10,Lc=2e4;function jc(t){return dn(t.type)||t.type==="spring"||!_s(t.ease)}function Nc(t,e){const n=new Qn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let o=0;for(;!s.done&&o<Lc;)s=n.sample(o),i.push(s.value),o+=He;return{times:void 0,keyframes:i,duration:o-He,ease:"linear"}}const ir={anticipate:wi,backInOut:xi,circInOut:Ci};function Fc(t){return t in ir}class rr extends Yi{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:o}=this.options;this.resolver=new Wi(o,(r,a)=>this.onKeyframesResolved(r,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:s=300,times:i,ease:o,type:r,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof o=="string"&&ie()&&Fc(o)&&(o=ir[o]),jc(this.options)){const{onComplete:f,onUpdate:h,motionValue:p,element:m,...b}=this.options,T=Nc(e,b);e=T.keyframes,e.length===1&&(e[1]=e[0]),s=T.duration,i=T.times,o=T.ease,r="keyframes"}const c=ba(a.owner.current,l,e,{...this.options,duration:s,times:i,ease:o});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(ks(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;a.set(Ge(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:i,type:r,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return ft(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return ft(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=lt(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return st;const{animation:s}=n;ks(s,e)}return st}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:o,ease:r,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:f,element:h,...p}=this.options,m=new Qn({...p,keyframes:s,duration:i,type:o,ease:r,times:a,isGenerator:!0}),b=lt(this.time);u.setWithVelocity(m.sample(b-He).value,m.sample(b).value,He)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:o,damping:r,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return kc()&&s&&_c.has(s)&&(s!=="transform"||!u)&&!l&&!i&&o!=="mirror"&&r!==0&&a!=="inertia"}}const Bc={type:"spring",stiffness:500,damping:25,restSpeed:10},Uc=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$c={type:"keyframes",duration:.8},Gc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Kc=(t,{keyframes:e})=>e.length>2?$c:Ot.has(t)?t.startsWith("scale")?Uc(e[1]):Bc:Gc;function Wc({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const ts=(t,e,n,s={},i,o)=>r=>{const a=hn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-lt(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:h=>{e.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:i};Wc(a)||(c={...c,...Kc(t,c)}),c.duration&&(c.duration=lt(c.duration)),c.repeatDelay&&(c.repeatDelay=lt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),c.allowFlatten=!a.type&&!a.ease,f&&!o&&e.get()!==void 0){const h=Ge(c.keyframes,a);if(h!==void 0)return N.update(()=>{c.onUpdate(h),c.onComplete()}),new ga([])}return!o&&rr.supports(c)?new rr(c):new Qn(c)};function Hc({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function or(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;s&&(o=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const c in a){const f=t.getValue(c,t.latestValues[c]??null),h=a[c];if(h===void 0||u&&Hc(u,c))continue;const p={delay:n,...hn(o||{},c)};let m=!1;if(window.MotionHandoffAnimation){const T=mi(t);if(T){const y=window.MotionHandoffAnimation(T,c,N);y!==null&&(p.startTime=y,m=!0)}}In(t,c),f.start(ts(c,f,h,t.shouldReduceMotion&&pi.has(c)?{type:!1}:p,t,m));const b=f.animation;b&&l.push(b)}return r&&Promise.all(l).then(()=>{N.update(()=>{r&&Tl(t,r)})}),l}function es(t,e,n={}){var l;const s=de(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(or(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:h}=i;return Yc(t,e,c+u,f,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[o,r]:[r,o];return u().then(()=>c())}else return Promise.all([o(),r(n.delay)])}function Yc(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(zc).forEach((u,c)=>{u.notify("AnimationStart",e),r.push(es(u,e,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(r)}function zc(t,e){return t.sortNodePosition(e)}function qc(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>es(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=es(t,e,n);else{const i=typeof e=="function"?de(t,e,n.custom):e;s=Promise.all(or(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function ar(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const Xc=xn.length;function lr(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?lr(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Xc;n++){const s=xn[n],i=t.props[s];(le(i)||i===!1)&&(e[s]=i)}return e}const Zc=[...bn].reverse(),Jc=bn.length;function Qc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>qc(t,n,s)))}function tu(t){let e=Qc(t),n=cr(),s=!0;const i=l=>(u,c)=>{var h;const f=de(t,c,l==="exit"?(h=t.presenceContext)==null?void 0:h.custom:void 0);if(f){const{transition:p,transitionEnd:m,...b}=f;u={...u,...b,...m}}return u};function o(l){e=l(t)}function r(l){const{props:u}=t,c=lr(t.parent)||{},f=[],h=new Set;let p={},m=1/0;for(let T=0;T<Jc;T++){const y=Zc[T],x=n[y],E=u[y]!==void 0?u[y]:c[y],V=le(E),C=y===l?x.isActive:null;C===!1&&(m=T);let R=E===c[y]&&E!==u[y]&&V;if(R&&s&&t.manuallyAnimateOnMount&&(R=!1),x.protectedKeys={...p},!x.isActive&&C===null||!E&&!x.prevProp||Fe(E)||typeof E=="boolean")continue;const k=eu(x.prevProp,E);let M=k||y===l&&x.isActive&&!R&&V||T>m&&V,U=!1;const Y=Array.isArray(E)?E:[E];let pt=Y.reduce(i(y),{});C===!1&&(pt={});const{prevResolvedValues:bt={}}=x,P={...bt,...pt},ot=$=>{M=!0,h.has($)&&(U=!0,h.delete($)),x.needsAnimating[$]=!0;const J=t.getValue($);J&&(J.liveStyle=!1)};for(const $ in P){const J=pt[$],xt=bt[$];if(p.hasOwnProperty($))continue;let Mt=!1;On(J)&&On(xt)?Mt=!ar(J,xt):Mt=J!==xt,Mt?J!=null?ot($):h.add($):J!==void 0&&h.has($)?ot($):x.protectedKeys[$]=!0}x.prevProp=E,x.prevResolvedValues=pt,x.isActive&&(p={...p,...pt}),s&&t.blockInitialAnimation&&(M=!1),M&&(!(R&&k)||U)&&f.push(...Y.map($=>({animation:$,options:{type:y}})))}if(h.size){const T={};if(typeof u.initial!="boolean"){const y=de(t,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(T.transition=y.transition)}h.forEach(y=>{const x=t.getBaseTarget(y),E=t.getValue(y);E&&(E.liveStyle=!0),T[y]=x??null}),f.push({animation:T})}let b=!!f.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(b=!1),s=!1,b?e(f):Promise.resolve()}function a(l,u){var f;if(n[l].isActive===u)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(h=>{var p;return(p=h.animationState)==null?void 0:p.setActive(l,u)}),n[l].isActive=u;const c=r(l);for(const h in n)n[h].protectedKeys={};return c}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=cr(),s=!0}}}function eu(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!ar(e,t):!1}function kt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function cr(){return{animate:kt(!0),whileInView:kt(),whileHover:kt(),whileTap:kt(),whileDrag:kt(),whileFocus:kt(),exit:kt()}}class At{constructor(e){this.isMounted=!1,this.node=e}update(){}}class nu extends At{constructor(e){super(e),e.animationState||(e.animationState=tu(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Fe(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let su=0;class iu extends At{constructor(){super(...arguments),this.id=su++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const ru={animation:{Feature:nu},exit:{Feature:iu}};function ve(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function be(t){return{point:{x:t.pageX,y:t.pageY}}}const ou=t=>e=>yn(e)&&t(e,be(e));function xe(t,e,n,s){return ve(t,e,ou(n),s)}function ur({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function au({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function lu(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const fr=1e-4,cu=1-fr,uu=1+fr,dr=.01,fu=0-dr,du=0+dr;function tt(t){return t.max-t.min}function hu(t,e,n){return Math.abs(t-e)<=n}function hr(t,e,n,s=.5){t.origin=s,t.originPoint=F(e.min,e.max,t.origin),t.scale=tt(n)/tt(e),t.translate=F(n.min,n.max,t.origin)-t.originPoint,(t.scale>=cu&&t.scale<=uu||isNaN(t.scale))&&(t.scale=1),(t.translate>=fu&&t.translate<=du||isNaN(t.translate))&&(t.translate=0)}function we(t,e,n,s){hr(t.x,e.x,n.x,s?s.originX:void 0),hr(t.y,e.y,n.y,s?s.originY:void 0)}function pr(t,e,n){t.min=n.min+e.min,t.max=t.min+tt(e)}function pu(t,e,n){pr(t.x,e.x,n.x),pr(t.y,e.y,n.y)}function mr(t,e,n){t.min=e.min-n.min,t.max=t.min+tt(e)}function Te(t,e,n){mr(t.x,e.x,n.x),mr(t.y,e.y,n.y)}const gr=()=>({translate:0,scale:1,origin:0,originPoint:0}),zt=()=>({x:gr(),y:gr()}),yr=()=>({min:0,max:0}),G=()=>({x:yr(),y:yr()});function it(t){return[t("x"),t("y")]}function ns(t){return t===void 0||t===1}function ss({scale:t,scaleX:e,scaleY:n}){return!ns(t)||!ns(e)||!ns(n)}function Lt(t){return ss(t)||vr(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function vr(t){return br(t.x)||br(t.y)}function br(t){return t&&t!=="0%"}function Ye(t,e,n){const s=t-n,i=e*s;return n+i}function xr(t,e,n,s,i){return i!==void 0&&(t=Ye(t,i,s)),Ye(t,n,s)+e}function is(t,e=0,n=1,s,i){t.min=xr(t.min,e,n,s,i),t.max=xr(t.max,e,n,s,i)}function wr(t,{x:e,y:n}){is(t.x,e.translate,e.scale,e.originPoint),is(t.y,n.translate,n.scale,n.originPoint)}const Tr=.999999999999,Cr=1.0000000000001;function mu(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Xt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,wr(t,r)),s&&Lt(o.latestValues)&&Xt(t,o.latestValues))}e.x<Cr&&e.x>Tr&&(e.x=1),e.y<Cr&&e.y>Tr&&(e.y=1)}function qt(t,e){t.min=t.min+e,t.max=t.max+e}function Er(t,e,n,s,i=.5){const o=F(t.min,t.max,i);is(t,e,n,o,s)}function Xt(t,e){Er(t.x,e.x,e.scaleX,e.scale,e.originX),Er(t.y,e.y,e.scaleY,e.scale,e.originY)}function Sr(t,e){return ur(lu(t.getBoundingClientRect(),e))}function gu(t,e,n){const s=Sr(t,n),{scroll:i}=e;return i&&(qt(s.x,i.offset.x),qt(s.y,i.offset.y)),s}const Ar=({current:t})=>t?t.ownerDocument.defaultView:null,Pr=(t,e)=>Math.abs(t-e);function yu(t,e){const n=Pr(t.x,e.x),s=Pr(t.y,e.y);return Math.sqrt(n**2+s**2)}class Rr{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=os(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,p=yu(f.offset,{x:0,y:0})>=3;if(!h&&!p)return;const{point:m}=f,{timestamp:b}=z;this.history.push({...m,timestamp:b});const{onStart:T,onMove:y}=this.handlers;h||(T&&T(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,f)},this.handlePointerMove=(f,h)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=rs(h,this.transformPagePoint),N.update(this.updatePoint,!0)},this.handlePointerUp=(f,h)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=os(f.type==="pointercancel"?this.lastMoveEventInfo:rs(h,this.transformPagePoint),this.history);this.startEvent&&p&&p(f,T),m&&m(f,T)},!yn(e))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const r=be(e),a=rs(r,this.transformPagePoint),{point:l}=a,{timestamp:u}=z;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,os(a,this.history)),this.removeListeners=ge(xe(this.contextWindow,"pointermove",this.handlePointerMove),xe(this.contextWindow,"pointerup",this.handlePointerUp),xe(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Ct(this.updatePoint)}}function rs(t,e){return e?{point:e(t.point)}:t}function Mr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function os({point:t},e){return{point:t,delta:Mr(t,Dr(e)),offset:Mr(t,vu(e)),velocity:bu(e,.1)}}function vu(t){return t[0]}function Dr(t){return t[t.length-1]}function bu(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=Dr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>lt(e)));)n--;if(!s)return{x:0,y:0};const o=ft(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function xu(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?F(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?F(n,t,s.max):Math.min(t,n)),t}function Or(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function wu(t,{top:e,left:n,bottom:s,right:i}){return{x:Or(t.x,n,i),y:Or(t.y,e,s)}}function Vr(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Tu(t,e){return{x:Vr(t.x,e.x),y:Vr(t.y,e.y)}}function Cu(t,e){let n=.5;const s=tt(t),i=tt(e);return i>s?n=se(e.min,e.max-s,t.min):s>i&&(n=se(t.min,t.max-i,e.min)),vt(0,1,n)}function Eu(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const as=.35;function Su(t=as){return t===!1?t=0:t===!0&&(t=as),{x:Ir(t,"left","right"),y:Ir(t,"top","bottom")}}function Ir(t,e,n){return{min:_r(t,e),max:_r(t,n)}}function _r(t,e){return typeof t=="number"?t:t[e]||0}const Au=new WeakMap;class Pu{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=G(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(be(c).point)},o=(c,f)=>{const{drag:h,dragPropagation:p,onDragStart:m}=this.getProps();if(h&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Ea(h),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),it(T=>{let y=this.getAxisMotionValue(T).get()||0;if(ht.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const E=x.layout.layoutBox[T];E&&(y=tt(E)*(parseFloat(y)/100))}}this.originPoint[T]=y}),m&&N.postRender(()=>m(c,f)),In(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},r=(c,f)=>{const{dragPropagation:h,dragDirectionLock:p,onDirectionLock:m,onDrag:b}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:T}=f;if(p&&this.currentDirection===null){this.currentDirection=Ru(T),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",f.point,T),this.updateAxis("y",f.point,T),this.visualElement.render(),b&&b(c,f)},a=(c,f)=>this.stop(c,f),l=()=>it(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Rr(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Ar(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&N.postRender(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!ze(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=xu(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){var o;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,i=this.constraints;e&&Gt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=wu(s.layoutBox,e):this.constraints=!1,this.elastic=Su(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&it(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Eu(s.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Gt(e))return!1;const s=e.current;Tt(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=gu(s,i.root,this.visualElement.getTransformPagePoint());let r=Tu(i.layout.layoutBox,o);if(n){const a=n(au(r));this.hasMutatedConstraints=!!a,a&&(r=ur(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=it(c=>{if(!ze(c,n,this.currentDirection))return;let f=l&&l[c]||{};r&&(f={min:0,max:0});const h=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return In(this.visualElement,e),s.start(ts(e,s,0,n,this.visualElement,!1))}stopAnimation(){it(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){it(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){it(n=>{const{drag:s}=this.getProps();if(!ze(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-F(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Gt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};it(r=>{const a=this.getAxisMotionValue(r);if(a&&this.constraints!==!1){const l=a.get();i[r]=Cu({min:l,max:l},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),it(r=>{if(!ze(r,e,null))return;const a=this.getAxisMotionValue(r),{min:l,max:u}=this.constraints[r];a.set(F(l,u,i[r]))})}addListeners(){if(!this.visualElement.current)return;Au.set(this.visualElement,this);const e=this.visualElement.current,n=xe(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();Gt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),N.read(s);const r=ve(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(it(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=as,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function ze(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Ru(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Mu extends At{constructor(e){super(e),this.removeGroupControls=st,this.removeListeners=st,this.controls=new Pu(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||st}unmount(){this.removeGroupControls(),this.removeListeners()}}const kr=t=>(e,n)=>{t&&N.postRender(()=>t(e,n))};class Du extends At{constructor(){super(...arguments),this.removePointerDownListener=st}onPointerDown(e){this.session=new Rr(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ar(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:kr(e),onStart:kr(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&N.postRender(()=>i(o,r))}}}mount(){this.removePointerDownListener=xe(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const qe={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Lr(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ce={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(A.test(t))t=parseFloat(t);else return t;const n=Lr(t,e.target.x),s=Lr(t,e.target.y);return`${n}% ${s}%`}},Ou={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=St.parse(t);if(i.length>5)return s;const o=St.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=l;const u=F(a,l,.5);return typeof i[2+r]=="number"&&(i[2+r]/=u),typeof i[3+r]=="number"&&(i[3+r]/=u),o(i)}};class Vu extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;Xa(Iu),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),qe.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,r=s.projection;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0||e.isPresent!==o?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||N.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),mn.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function jr(t){const[e,n]=As(),s=v.useContext(tn);return S.jsx(Vu,{...t,layoutGroup:s,switchLayoutGroup:v.useContext(Xs),isPresent:e,safeToRemove:n})}const Iu={borderRadius:{...Ce,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ce,borderTopRightRadius:Ce,borderBottomLeftRadius:Ce,borderBottomRightRadius:Ce,boxShadow:Ou};function _u(t,e,n){const s=q(t)?t:ae(t);return s.start(ts("",s,e,n)),s.animation}function ku(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Lu=(t,e)=>t.depth-e.depth;class ju{constructor(){this.children=[],this.isDirty=!1}add(e){rn(this.children,e),this.isDirty=!0}remove(e){on(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Lu),this.isDirty=!1,this.children.forEach(e)}}function Nu(t,e){const n=dt.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(Ct(s),t(o-e))};return N.read(s,!0),()=>Ct(s)}const Nr=["TopLeft","TopRight","BottomLeft","BottomRight"],Fu=Nr.length,Fr=t=>typeof t=="string"?parseFloat(t):t,Br=t=>typeof t=="number"||A.test(t);function Bu(t,e,n,s,i,o){i?(t.opacity=F(0,n.opacity??1,Uu(s)),t.opacityExit=F(e.opacity??1,0,$u(s))):o&&(t.opacity=F(e.opacity??1,n.opacity??1,s));for(let r=0;r<Fu;r++){const a=`border${Nr[r]}Radius`;let l=Ur(e,a),u=Ur(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Br(l)===Br(u)?(t[a]=Math.max(F(Fr(l),Fr(u),s),0),(ht.test(u)||ht.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=F(e.rotate||0,n.rotate||0,s))}function Ur(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Uu=$r(0,.5,Ti),$u=$r(.5,.95,st);function $r(t,e,n){return s=>s<t?0:s>e?1:n(se(t,e,s))}function Gr(t,e){t.min=e.min,t.max=e.max}function rt(t,e){Gr(t.x,e.x),Gr(t.y,e.y)}function Kr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Wr(t,e,n,s,i){return t-=e,t=Ye(t,1/n,s),i!==void 0&&(t=Ye(t,1/i,s)),t}function Gu(t,e=0,n=1,s=.5,i,o=t,r=t){if(ht.test(e)&&(e=parseFloat(e),e=F(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=F(o.min,o.max,s);t===o&&(a-=e),t.min=Wr(t.min,e,n,a,i),t.max=Wr(t.max,e,n,a,i)}function Hr(t,e,[n,s,i],o,r){Gu(t,e[n],e[s],e[i],e.scale,o,r)}const Ku=["x","scaleX","originX"],Wu=["y","scaleY","originY"];function Yr(t,e,n,s){Hr(t.x,e,Ku,n?n.x:void 0,s?s.x:void 0),Hr(t.y,e,Wu,n?n.y:void 0,s?s.y:void 0)}function zr(t){return t.translate===0&&t.scale===1}function qr(t){return zr(t.x)&&zr(t.y)}function Xr(t,e){return t.min===e.min&&t.max===e.max}function Hu(t,e){return Xr(t.x,e.x)&&Xr(t.y,e.y)}function Zr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Jr(t,e){return Zr(t.x,e.x)&&Zr(t.y,e.y)}function Qr(t){return tt(t.x)/tt(t.y)}function to(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Yu{constructor(){this.members=[]}add(e){rn(this.members,e),e.scheduleRender()}remove(e){if(on(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function zu(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y,r=(n==null?void 0:n.z)||0;if((i||o||r)&&(s=`translate3d(${i}px, ${o}px, ${r}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:f,rotateY:h,skewX:p,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),f&&(s+=`rotateX(${f}deg) `),h&&(s+=`rotateY(${h}deg) `),p&&(s+=`skewX(${p}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const ls=["","X","Y","Z"],qu={visibility:"hidden"},eo=1e3;let Xu=0;function cs(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function no(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=mi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",N,!(i||o))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&no(s)}function so({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=Xu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.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(Qu),this.nodes.forEach(rf),this.nodes.forEach(of),this.nodes.forEach(tf)},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 ju)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new cn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const l=this.eventHandlers.get(r);l&&l.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ku(r),this.instance=r;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let f;const h=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Nu(h,250),qe.hasAnimatedSinceResize&&(qe.hasAnimatedSinceResize=!1,this.nodes.forEach(ro))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||c.getDefaultTransition()||ff,{onLayoutAnimationStart:T,onLayoutAnimationComplete:y}=c.getProps(),x=!this.targetLayout||!Jr(this.targetLayout,m),E=!h&&p;if(this.options.layoutRoot||this.resumeFrom||E||h&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,E);const V={...hn(b,"layout"),onPlay:T,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(V.delay=0,V.type=!1),this.startAnimation(V)}else h||ro(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ct(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(af),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&&no(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(io);return}this.isUpdating||this.nodes.forEach(nf),this.isUpdating=!1,this.nodes.forEach(sf),this.nodes.forEach(Zu),this.nodes.forEach(Ju),this.clearAllSnapshots();const a=dt.now();z.delta=vt(0,1e3/60,a-z.timestamp),z.timestamp=a,z.isProcessing=!0,gn.update.process(z),gn.preRender.process(z),gn.render.process(z),z.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,mn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ef),this.sharedNodes.forEach(lf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,N.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){N.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!tt(this.snapshot.measuredBox.x)&&!tt(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=G(),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){const l=s(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(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!qr(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;r&&(a||Lt(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return r&&(l=this.removeTransform(l)),df(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:r}=this.options;if(!r)return G();const a=r.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(hf))){const{scroll:c}=this.root;c&&(qt(a.x,c.offset.x),qt(a.y,c.offset.y))}return a}removeElementScroll(r){var l;const a=G();if(rt(a,r),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:f,options:h}=c;c!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&rt(a,r),qt(a.x,f.offset.x),qt(a.y,f.offset.y))}return a}applyTransform(r,a=!1){const l=G();rt(l,r);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Xt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Lt(c.latestValues)&&Xt(l,c.latestValues)}return Lt(this.latestValues)&&Xt(l,this.latestValues),l}removeTransform(r){const a=G();rt(a,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Lt(u.latestValues))continue;ss(u.latestValues)&&u.updateSnapshot();const c=G(),f=u.measurePageBox();rt(c,f),Yr(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Lt(this.latestValues)&&Yr(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!==z.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var h;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:f}=this.options;if(!(!this.layout||!(c||f))){if(this.resolvedRelativeTargetAt=z.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),Te(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),rt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=G(),this.targetWithTransforms=G()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),pu(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):rt(this.target,this.layout.layoutBox),wr(this.target,this.targetDelta)):rt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),Te(this.relativeTargetOrigin,this.target,p.target),rt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||ss(this.parent.latestValues)||vr(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 m;const r=this.getLead(),a=!!this.resumingFrom||this!==r;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===z.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;rt(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;mu(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=G());const{target:p}=r;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Kr(this.prevProjectionDelta.x,this.projectionDelta.x),Kr(this.prevProjectionDelta.y,this.projectionDelta.y)),we(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!to(this.projectionDelta.x,this.prevProjectionDelta.x)||!to(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}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=zt(),this.projectionDelta=zt(),this.projectionDeltaWithTransform=zt()}setAnimationOrigin(r,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=zt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=G(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,b=p!==m,T=this.getStack(),y=!T||T.members.length<=1,x=!!(b&&!y&&this.options.crossfade===!0&&!this.path.some(uf));this.animationProgress=0;let E;this.mixTargetDelta=V=>{const C=V/1e3;oo(f.x,r.x,C),oo(f.y,r.y,C),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Te(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),cf(this.relativeTarget,this.relativeTargetOrigin,h,C),E&&Hu(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=G()),rt(E,this.relativeTarget)),b&&(this.animationValues=c,Bu(c,u,this.latestValues,C,x,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ct(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=N.update(()=>{qe.hasAnimatedSinceResize=!0,this.currentAnimation=_u(0,eo,{...r,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},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(eo),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=r;if(!(!a||!l||!u)){if(this!==r&&this.layout&&u&&fo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||G();const f=tt(this.layout.layoutBox.x);l.x.min=r.target.x.min,l.x.max=l.x.min+f;const h=tt(this.layout.layoutBox.y);l.y.min=r.target.y.min,l.y.max=l.y.min+h}rt(a,l),Xt(a,c),we(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Yu),this.sharedNodes.get(r).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var 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 u=this.getStack();u&&u.promote(this,l),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:l}=r;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&cs("z",r,u,this.animationValues);for(let c=0;c<ls.length;c++)cs(`rotate${ls[c]}`,r,u,this.animationValues),cs(`skew${ls[c]}`,r,u,this.animationValues);r.render();for(const c in u)r.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);r.scheduleRender()}getProjectionStyles(r){if(!this.instance||this.isSVG)return;if(!this.isVisible)return qu;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=$e(r==null?void 0:r.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=$e(r==null?void 0:r.pointerEvents)||""),this.hasProjected&&!Lt(this.latestValues)&&(p.transform=l?l({},""):"none",this.hasProjected=!1),p}const c=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=zu(this.projectionDeltaWithTransform,this.treeScale,c),l&&(a.transform=l(c,a.transform));const{x:f,y:h}=this.projectionDelta;a.transformOrigin=`${f.origin*100}% ${h.origin*100}% 0`,u.animationValues?a.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:a.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const p in ce){if(c[p]===void 0)continue;const{correct:m,applyTo:b,isCSSVariable:T}=ce[p],y=a.transform==="none"?c[p]:m(c[p],u);if(b){const x=b.length;for(let E=0;E<x;E++)a[b[E]]=y}else T?this.options.visualElement.renderState.vars[p]=y:a[p]=y}return this.options.layoutId&&(a.pointerEvents=u===this?$e(r==null?void 0:r.pointerEvents)||"":"none"),a}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(io),this.root.sharedNodes.clear()}}}function Zu(t){t.updateLayout()}function Ju(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=e.source!==t.layout.source;o==="size"?it(f=>{const h=r?e.measuredBox[f]:e.layoutBox[f],p=tt(h);h.min=s[f].min,h.max=h.min+p}):fo(o,e.layoutBox,s)&&it(f=>{const h=r?e.measuredBox[f]:e.layoutBox[f],p=tt(s[f]);h.max=h.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[f].max=t.relativeTarget[f].min+p)});const a=zt();we(a,s,e.layoutBox);const l=zt();r?we(l,t.applyTransform(i,!0),e.measuredBox):we(l,s,e.layoutBox);const u=!qr(a);let c=!1;if(!t.resumeFrom){const f=t.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const m=G();Te(m,e.layoutBox,h.layoutBox);const b=G();Te(b,s,p.layoutBox),Jr(m,b)||(c=!0),f.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=m,t.relativeParent=f)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function Qu(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function tf(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ef(t){t.clearSnapshot()}function io(t){t.clearMeasurements()}function nf(t){t.isLayoutDirty=!1}function sf(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ro(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function rf(t){t.resolveTargetDelta()}function of(t){t.calcProjection()}function af(t){t.resetSkewAndRotation()}function lf(t){t.removeLeadSnapshot()}function oo(t,e,n){t.translate=F(e.translate,0,n),t.scale=F(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ao(t,e,n,s){t.min=F(e.min,n.min,s),t.max=F(e.max,n.max,s)}function cf(t,e,n,s){ao(t.x,e.x,n.x,s),ao(t.y,e.y,n.y,s)}function uf(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ff={duration:.45,ease:[.4,0,.1,1]},lo=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),co=lo("applewebkit/")&&!lo("chrome/")?Math.round:st;function uo(t){t.min=co(t.min),t.max=co(t.max)}function df(t){uo(t.x),uo(t.y)}function fo(t,e,n){return t==="position"||t==="preserve-aspect"&&!hu(Qr(e),Qr(n),.2)}function hf(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const pf=so({attachResizeListener:(t,e)=>ve(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),us={current:void 0},ho=so({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!us.current){const t=new pf({});t.mount(window),t.setOptions({layoutScroll:!0}),us.current=t}return us.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),mf={pan:{Feature:Du},drag:{Feature:Mu,ProjectionNode:ho,MeasureLayout:jr}};function po(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,o=s[i];o&&N.postRender(()=>o(e,be(e)))}class gf extends At{mount(){const{current:e}=this.node;e&&(this.unmount=Aa(e,(n,s)=>(po(this.node,s,"Start"),i=>po(this.node,i,"End"))))}unmount(){}}class yf extends At{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ge(ve(this.node.current,"focus",()=>this.onFocus()),ve(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function mo(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),o=s[i];o&&N.postRender(()=>o(e,be(e)))}class vf extends At{mount(){const{current:e}=this.node;e&&(this.unmount=Da(e,(n,s)=>(mo(this.node,s,"Start"),(i,{success:o})=>mo(this.node,i,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const fs=new WeakMap,ds=new WeakMap,bf=t=>{const e=fs.get(t.target);e&&e(t)},xf=t=>{t.forEach(bf)};function wf({root:t,...e}){const n=t||document;ds.has(n)||ds.set(n,{});const s=ds.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(xf,{root:t,...e})),s[i]}function Tf(t,e,n){const s=wf(e);return fs.set(t,n),s.observe(t),()=>{fs.delete(t),s.unobserve(t)}}const Cf={some:0,all:1};class Ef extends At{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Cf[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),h=u?c:f;h&&h(l)};return Tf(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Sf(e,n))&&this.startObserver()}unmount(){}}function Sf({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Af={inView:{Feature:Ef},tap:{Feature:vf},focus:{Feature:yf},hover:{Feature:gf}},Pf={layout:{ProjectionNode:ho,MeasureLayout:jr}},hs={current:null},go={current:!1};function Rf(){if(go.current=!0,!!nn)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>hs.current=t.matches;t.addListener(e),e()}else hs.current=!1}const Mf=[...Gi,X,St],Df=t=>Mf.find($i(t)),Of=new WeakMap;function Vf(t,e,n){for(const s in e){const i=e[s],o=n[s];if(q(i))t.addValue(s,i),process.env.NODE_ENV==="development"&&Ie(i.version==="12.7.4",`Attempting to mix Motion versions ${i.version} with 12.7.4 may not work as expected.`);else if(q(o))t.addValue(s,ae(i,{owner:t}));else if(o!==i)if(t.hasValue(s)){const r=t.getValue(s);r.liveStyle===!0?r.jump(i):r.hasAnimated||r.set(i)}else{const r=t.getStaticValue(s);t.addValue(s,ae(r!==void 0?r:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const yo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class If{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,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=Hn,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 p=dt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,N.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=r;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Be(n),this.isVariantNode=Ys(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const m=h[p];l[p]!==void 0&&q(m)&&m.set(l[p],!1)}}mount(e){this.current=e,Of.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),go.current||Rf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:hs.current,process.env.NODE_ENV!=="production"&&Ie(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Ct(this.notifyUpdate),Ct(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=Ot.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&N.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),o(),r&&r(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in $t){const n=$t[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const o=this.features[e];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):G()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<yo.length;s++){const i=yo[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,r=e[o];r&&(this.propEventSubscriptions[i]=this.on(i,r))}this.prevMotionValues=Vf(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=ae(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(Bi(s)||Ei(s))?s=parseFloat(s):!Df(s)&&St.test(n)&&(s=Vi(e,n)),this.setBaseTarget(e,q(s)?s.get():s)),q(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var o;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const r=Dn(this.props,n,(o=this.presenceContext)==null?void 0:o.custom);r&&(s=r[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!q(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new cn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class vo extends If{constructor(){super(...arguments),this.KeyframeResolver=Wi}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;q(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function _f(t){return window.getComputedStyle(t)}class kf extends vo{constructor(){super(...arguments),this.type="html",this.renderInstance=ci}readValueFromInstance(e,n){if(Ot.has(n))return Yl(e,n);{const s=_f(e),i=(Tn(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Sr(e,n)}build(e,n,s){Sn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Vn(e,n,s)}}class Lf extends vo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=G,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&li(this.current,this.renderState)}}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Ot.has(n)){const s=Oi(n);return s&&s.default||0}return n=ui.has(n)?n:wn(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return di(e,n,s)}onBindTransform(){this.current&&!this.renderState.dimensions&&N.postRender(this.updateDimensions)}build(e,n,s){Rn(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){fi(e,n,s,i)}mount(e){this.isSVGTag=Mn(e.tagName),super.mount(e)}}const jf=(t,e)=>Pn(t)?new Lf(e):new kf(e,{allowProjection:t!==v.Fragment}),Nf=xl({...ru,...Af,...mf,...Pf},jf),bo=ja(Nf);var xo;(function(t){t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object"})(xo||(xo={}));/**
|
|
30
|
+
`),()=>{document.head.removeChild(f)}},[e]),C.jsx(Cr,{isPresent:e,childRef:i,sizeRef:r,children:Ie.cloneElement(t,{ref:i})})}const Sr=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:i,presenceAffectsLayout:r,mode:o,anchorX:a})=>{const l=Le(Ar),u=y.useId();let c=!0,h=y.useMemo(()=>(c=!1,{id:u,initial:e,isPresent:n,custom:i,onExitComplete:d=>{l.set(d,!0);for(const f of l.values())if(!f)return;s&&s()},register:d=>(l.set(d,!1),()=>l.delete(d))}),[n,l,s]);return r&&c&&(h={...h}),y.useMemo(()=>{l.forEach((d,f)=>l.set(f,!1))},[n]),Ie.useEffect(()=>{!n&&!l.size&&s&&s()},[n]),o==="popLayout"&&(t=C.jsx(Er,{isPresent:n,anchorX:a,children:t})),C.jsx(de.Provider,{value:h,children:t})};function Ar(){return new Map}function Qn(t=!0){const e=y.useContext(de);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:i}=e,r=y.useId();y.useEffect(()=>{if(t)return i(r)},[t]);const o=y.useCallback(()=>t&&s&&s(r),[r,s,t]);return!n&&s?[!1,o]:[!0]}const fe=t=>t.key||"";function ts(t){const e=[];return y.Children.forEach(t,n=>{y.isValidElement(n)&&e.push(n)}),e}const es=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:i=!0,mode:r="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=Qn(o),c=y.useMemo(()=>ts(t),[t]),h=o&&!l?[]:c.map(fe),d=y.useRef(!0),f=y.useRef(c),m=Le(()=>new Map),[v,b]=y.useState(c),[g,E]=y.useState(c);Jn(()=>{d.current=!1,f.current=c;for(let x=0;x<g.length;x++){const A=fe(g[x]);h.includes(A)?m.delete(A):m.get(A)!==!0&&m.set(A,!1)}},[g,h.length,h.join("-")]);const w=[];if(c!==v){let x=[...c];for(let A=0;A<g.length;A++){const O=g[A],P=fe(O);h.includes(P)||(x.splice(A,0,O),w.push(O))}return r==="wait"&&w.length&&(x=w),E(ts(x)),b(c),null}process.env.NODE_ENV!=="production"&&r==="wait"&&g.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:D}=y.useContext(_e);return C.jsx(C.Fragment,{children:g.map(x=>{const A=fe(x),O=o&&!l?!1:c===g||h.includes(A),P=()=>{if(m.has(A))m.set(A,!0);else return;let L=!0;m.forEach(B=>{B||(L=!1)}),L&&(D==null||D(),E(f.current),o&&(u==null||u()),s&&s())};return C.jsx(Sr,{isPresent:O,initial:!d.current||n?void 0:!1,custom:e,presenceAffectsLayout:i,mode:r,onExitComplete:O?void 0:P,anchorX:a,children:x},A)})})};function Fe(t,e){t.indexOf(e)===-1&&t.push(e)}function Be(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let Pt=()=>{},ht=()=>{};process.env.NODE_ENV!=="production"&&(Pt=(t,e)=>{!t&&typeof console<"u"&&console.warn(e)},ht=(t,e)=>{if(!t)throw new Error(e)});const Ue={useManualTiming:!1};function $e(t){let e;return()=>(e===void 0&&(e=t()),e)}const X=t=>t,Bt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class Ge{constructor(){this.subscriptions=[]}add(e){return Fe(this.subscriptions,e),()=>Be(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const tt=t=>t*1e3,st=t=>t/1e3;function ns(t,e){return e?t*(1e3/e):0}const ss=new Set;function me(t,e,n){t||ss.has(e)||(console.warn(e),ss.add(e))}const Pr=$e(()=>window.ScrollTimeline!==void 0);class Mr{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(i=>{if(Pr()&&i.attachTimeline)return i.attachTimeline(e);if(typeof n=="function")return n(i)});return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Rr extends Mr{then(e,n){return this.finished.finally(e).then(()=>{})}}const is={value:null},Ke=t=>Array.isArray(t)&&typeof t[0]=="number",Dr={};function Vr(t,e){const n=$e(t);return()=>Dr[e]??n()}const Ut=Vr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),os=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let r=0;r<i;r++)s+=t(r/(i-1))+", ";return`linear(${s.substring(0,s.length-2)})`},$t=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,He={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$t([0,.65,.55,1]),circOut:$t([.55,0,1,.45]),backIn:$t([.31,.01,.66,-.59]),backOut:$t([.33,1.53,.69,.99])};function rs(t,e){if(t)return typeof t=="function"&&Ut()?os(t,e):Ke(t)?$t(t):Array.isArray(t)?t.map(n=>rs(n,e)||He.easeOut):He[t]}function Or(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},u=void 0){const c={[e]:n};l&&(c.offset=l);const h=rs(a,i);return Array.isArray(h)&&(c.easing=h),t.animate(c,{delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:u})}function We(t){return typeof t=="function"&&"applyToOptions"in t}function Ye(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const pe=2e4;function ze(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<pe;)e+=n,s=t.next(e);return e>=pe?1/0:e}function Ir(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(ze(s),pe);return{type:"keyframes",ease:r=>s.next(i*r).value/e,duration:st(i)}}function as(t){return!!(typeof t=="function"&&Ut()||!t||typeof t=="string"&&(t in He||Ut())||Ke(t)||Array.isArray(t)&&t.every(as))}function ls(t,e){t.timeline=e,t.onfinish=null}const ge=["read","resolveKeyframes","update","preRender","render","postRender"];function kr(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(h){o.has(h)&&(c.schedule(h),t()),l++,h(a)}const c={schedule:(h,d=!1,f=!1)=>{const v=f&&i?n:s;return d&&o.add(h),v.has(h)||v.add(h),h},cancel:h=>{s.delete(h),o.delete(h)},process:h=>{if(a=h,i){r=!0;return}i=!0,[n,s]=[s,n],n.forEach(u),e&&is.value&&is.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,c.process(h))}};return c}const _r=40;function cs(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=ge.reduce((g,E)=>(g[E]=kr(r,e?E:void 0),g),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:d}=o,f=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,_r),1),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),d.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(f))},m=()=>{n=!0,s=!0,i.isProcessing||t(f)};return{schedule:ge.reduce((g,E)=>{const w=o[E];return g[E]=(D,x=!1,A=!1)=>(n||m(),w.schedule(D,x,A)),g},{}),cancel:g=>{for(let E=0;E<ge.length;E++)o[ge[E]].cancel(g)},state:i,steps:o}}const{schedule:qe}=cs(queueMicrotask,!1),{schedule:I,cancel:dt,state:U,steps:Xe}=cs(typeof requestAnimationFrame<"u"?requestAnimationFrame:X,!0);let ye;function Lr(){ye=void 0}const it={now:()=>(ye===void 0&&it.set(U.isProcessing||Ue.useManualTiming?U.timestamp:performance.now()),ye),set:t=>{ye=t,queueMicrotask(Lr)}},et={x:!1,y:!1};function us(){return et.x||et.y}function Nr(t){return t==="x"||t==="y"?et[t]?null:(et[t]=!0,()=>{et[t]=!1}):et.x||et.y?null:(et.x=et.y=!0,()=>{et.x=et.y=!1})}function jr(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const i=(n==null?void 0:n[t])??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}function hs(t,e){const n=jr(t),s=new AbortController,i={passive:!0,...e,signal:s.signal};return[n,i,()=>s.abort()]}function ds(t){return!(t.pointerType==="touch"||us())}function Fr(t,e,n={}){const[s,i,r]=hs(t,n),o=a=>{if(!ds(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const c=h=>{ds(h)&&(u(h),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,i)};return s.forEach(a=>{a.addEventListener("pointerenter",o,i)}),r}const fs=(t,e)=>e?t===e?!0:fs(t,e.parentElement):!1,Ze=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Br=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ur(t){return Br.has(t.tagName)||t.tabIndex!==-1}const Gt=new WeakSet;function ms(t){return e=>{e.key==="Enter"&&t(e)}}function Je(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const $r=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=ms(()=>{if(Gt.has(n))return;Je(n,"down");const i=ms(()=>{Je(n,"up")}),r=()=>Je(n,"cancel");n.addEventListener("keyup",i,e),n.addEventListener("blur",r,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function ps(t){return Ze(t)&&!us()}function Gr(t,e,n={}){const[s,i,r]=hs(t,n),o=a=>{const l=a.currentTarget;if(!ps(a)||Gt.has(l))return;Gt.add(l);const u=e(l,a),c=(f,m)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),!(!ps(f)||!Gt.has(l))&&(Gt.delete(l),typeof u=="function"&&u(f,{success:m}))},h=f=>{c(f,l===window||l===document||n.useGlobalTarget||fs(l,f.target))},d=f=>{c(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",d,i)};return s.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",u=>$r(u,i)),!Ur(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),r}const gs=30,Kr=t=>!isNaN(parseFloat(t));class Hr{constructor(e,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=it.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=it.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Kr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return process.env.NODE_ENV!=="production"&&me(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Ge);const s=this.events[e].add(n);return e==="change"?()=>{s(),I.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=it.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>gs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gs);return ns(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Kt(t,e){return new Hr(t,e)}const ys=y.createContext({strict:!1}),vs={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"]},Mt={};for(const t in vs)Mt[t]={isEnabled:e=>vs[t].some(n=>!!e[n])};function Wr(t){for(const e in t)Mt[e]={...Mt[e],...t[e]}}const Yr=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 ve(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Yr.has(t)}let bs=t=>!ve(t);function zr(t){t&&(bs=e=>e.startsWith("on")?!ve(e):t(e))}try{zr(require("@emotion/is-prop-valid").default)}catch{}function qr(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(bs(i)||n===!0&&ve(i)||!e&&!ve(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function Xr(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>(process.env.NODE_ENV!=="production"&&me(!1,"motion() is deprecated. Use motion.create() instead."),t(...s));return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const be=y.createContext({});function xe(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ht(t){return typeof t=="string"||Array.isArray(t)}const Qe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],tn=["initial",...Qe];function we(t){return xe(t.animate)||tn.some(e=>Ht(t[e]))}function xs(t){return!!(we(t)||t.variants)}function Zr(t,e){if(we(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Ht(n)?n:void 0,animate:Ht(s)?s:void 0}}return t.inherit!==!1?e:{}}function Jr(t){const{initial:e,animate:n}=Zr(t,y.useContext(be));return y.useMemo(()=>({initial:e,animate:n}),[ws(e),ws(n)])}function ws(t){return Array.isArray(t)?t.join(" "):t}const Qr=Symbol.for("motionComponentSymbol");function Rt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ta(t,e,n){return y.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):Rt(n)&&(n.current=s))},[e])}const en=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Ts="data-"+en("framerAppearId"),Cs=y.createContext({});function ea(t,e,n,s,i){var v,b;const{visualElement:r}=y.useContext(be),o=y.useContext(ys),a=y.useContext(de),l=y.useContext(je).reducedMotion,u=y.useRef(null);s=s||o.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:r,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const c=u.current,h=y.useContext(Cs);c&&!c.projection&&i&&(c.type==="html"||c.type==="svg")&&na(u.current,n,i,h);const d=y.useRef(!1);y.useInsertionEffect(()=>{c&&d.current&&c.update(n,a)});const f=n[Ts],m=y.useRef(!!f&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,f))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,f)));return Jn(()=>{c&&(d.current=!0,window.MotionIsMounted=!0,c.updateFeatures(),qe.render(c.render),m.current&&c.animationState&&c.animationState.animateChanges())}),y.useEffect(()=>{c&&(!m.current&&c.animationState&&c.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)==null||g.call(window,f)}),m.current=!1))}),c}function na(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:c}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Es(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&&Rt(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,crossfade:c,layoutScroll:l,layoutRoot:u})}function Es(t){if(t)return t.options.allowProjection!==!1?t.projection:Es(t.parent)}function sa({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&Wr(t);function r(a,l){let u;const c={...y.useContext(je),...a,layoutId:ia(a)},{isStatic:h}=c,d=Jr(a),f=s(a,h);if(!h&&Ne){oa(c,t);const m=ra(c);u=m.MeasureLayout,d.visualElement=ea(i,f,c,e,m.ProjectionNode)}return C.jsxs(be.Provider,{value:d,children:[u&&d.visualElement?C.jsx(u,{visualElement:d.visualElement,...c}):null,n(i,a,ta(f,d.visualElement,l),f,h,d.visualElement)]})}r.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=y.forwardRef(r);return o[Qr]=i,o}function ia({layoutId:t}){const e=y.useContext(_e).id;return e&&t!==void 0?e+"-"+t:t}function oa(t,e){const n=y.useContext(ys).strict;if(process.env.NODE_ENV!=="production"&&e&&n){const s="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?Pt(!1,s):ht(!1,s)}}function ra(t){const{drag:e,layout:n}=Mt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const Ss=t=>e=>typeof e=="string"&&e.startsWith(t),nn=Ss("--"),aa=Ss("var(--"),sn=t=>aa(t)?la.test(t.split("/*")[0].trim()):!1,la=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wt={};function ca(t){for(const e in t)Wt[e]=t[e],nn(e)&&(Wt[e].isCSSVariable=!0)}const Dt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bt=new Set(Dt);function As(t,{layout:e,layoutId:n}){return bt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Wt[t]||t==="opacity")}const K=t=>!!(t&&t.getVelocity),Ps=(t,e)=>e&&typeof t=="number"?e.transform(t):t,at=(t,e,n)=>n>e?e:n<t?t:n,Vt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Yt={...Vt,transform:t=>at(0,1,t)},Te={...Vt,default:1},zt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ft=zt("deg"),ot=zt("%"),S=zt("px"),ua=zt("vh"),ha=zt("vw"),Ms={...ot,parse:t=>ot.parse(t)/100,transform:t=>ot.transform(t*100)},da={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,radius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,backgroundPositionX:S,backgroundPositionY:S},fa={rotate:ft,rotateX:ft,rotateY:ft,rotateZ:ft,scale:Te,scaleX:Te,scaleY:Te,scaleZ:Te,skew:ft,skewX:ft,skewY:ft,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:Yt,originX:Ms,originY:Ms,originZ:S},Rs={...Vt,transform:Math.round},on={...da,...fa,zIndex:Rs,size:S,fillOpacity:Yt,strokeOpacity:Yt,numOctaves:Rs},ma={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pa=Dt.length;function ga(t,e,n){let s="",i=!0;for(let r=0;r<pa;r++){const o=Dt[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Ps(a,on[o]);if(!l){i=!1;const c=ma[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function rn(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(bt.has(l)){o=!0;continue}else if(nn(l)){i[l]=u;continue}else{const c=Ps(u,on[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=ga(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}const an=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ds(t,e,n){for(const s in e)!K(e[s])&&!As(s,n)&&(t[s]=e[s])}function ya({transformTemplate:t},e){return y.useMemo(()=>{const n=an();return rn(n,e,t),Object.assign({},n.vars,n.style)},[e])}function va(t,e){const n=t.style||{},s={};return Ds(s,n,t),Object.assign(s,ya(t,e)),s}function ba(t,e){const n={},s=va(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const xa=["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 ln(t){return typeof t!="string"||t.includes("-")?!1:!!(xa.indexOf(t)>-1||/[A-Z]/u.test(t))}const wa={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ta={offset:"strokeDashoffset",array:"strokeDasharray"};function Ca(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?wa:Ta;t[r.offset]=S.transform(-s);const o=S.transform(e),a=S.transform(n);t[r.array]=`${o} ${a}`}function Vs(t,e,n){return typeof t=="string"?t:S.transform(e+n*t)}function Ea(t,e,n){const s=Vs(e,t.x,t.width),i=Vs(n,t.y,t.height);return`${s} ${i}`}function cn(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(rn(t,u,h),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:f,dimensions:m}=t;d.transform&&(m&&(f.transform=d.transform),delete d.transform),m&&(i!==void 0||r!==void 0||f.transform)&&(f.transformOrigin=Ea(m,i!==void 0?i:.5,r!==void 0?r:.5)),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),o!==void 0&&Ca(d,o,a,l,!1)}const Os=()=>({...an(),attrs:{}}),un=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Sa(t,e,n,s){const i=y.useMemo(()=>{const r=Os();return cn(r,e,un(s),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Ds(r,t.style,t),i.style={...r,...i.style}}return i}function Aa(t=!1){return(n,s,i,{latestValues:r},o)=>{const l=(ln(n)?Sa:ba)(s,r,o,n),u=qr(s,typeof n=="string",t),c=n!==y.Fragment?{...u,...l,ref:i}:{},{children:h}=s,d=y.useMemo(()=>K(h)?h.get():h,[h]);return y.createElement(n,{...c,children:d})}}function Is(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function hn(t,e,n,s){if(typeof e=="function"){const[i,r]=Is(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=Is(s);e=e(n!==void 0?n:t.custom,i,r)}return e}const dn=t=>Array.isArray(t),Pa=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Ma=t=>dn(t)?t[t.length-1]||0:t;function Ce(t){const e=K(t)?t.get():t;return Pa(e)?e.toValue():e}function Ra({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,i,r){const o={latestValues:Da(s,i,r,t),renderState:e()};return n&&(o.onMount=a=>n({props:s,current:a,...o}),o.onUpdate=a=>n(a)),o}const ks=t=>(e,n)=>{const s=y.useContext(be),i=y.useContext(de),r=()=>Ra(t,e,s,i);return n?r():Le(r)};function Da(t,e,n,s){const i={},r=s(t,{});for(const d in r)i[d]=Ce(r[d]);let{initial:o,animate:a}=t;const l=we(t),u=xs(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const h=c?a:o;if(h&&typeof h!="boolean"&&!xe(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const m=hn(t,d[f]);if(m){const{transitionEnd:v,transition:b,...g}=m;for(const E in g){let w=g[E];if(Array.isArray(w)){const D=c?w.length-1:0;w=w[D]}w!==null&&(i[E]=w)}for(const E in v)i[E]=v[E]}}}return i}function fn(t,e,n){var r;const{style:s}=t,i={};for(const o in s)(K(s[o])||e.style&&K(e.style[o])||As(o,t)||((r=n==null?void 0:n.getValue(o))==null?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const Va={useVisualState:ks({scrapeMotionValuesFromProps:fn,createRenderState:an})};function _s(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}function Ls(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const Ns=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 js(t,e,n,s){Ls(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Ns.has(i)?i:en(i),e.attrs[i])}function Fs(t,e,n){const s=fn(t,e,n);for(const i in t)if(K(t[i])||K(e[i])){const r=Dt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}const Bs=["x","y","width","height","cx","cy","r"],Oa={useVisualState:ks({scrapeMotionValuesFromProps:Fs,createRenderState:Os,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:i})=>{if(!n)return;let r=!!t.drag;if(!r){for(const a in i)if(bt.has(a)){r=!0;break}}if(!r)return;let o=!e;if(e)for(let a=0;a<Bs.length;a++){const l=Bs[a];t[l]!==e[l]&&(o=!0)}o&&I.read(()=>{_s(n,s),I.render(()=>{cn(s,i,un(n.tagName),t.transformTemplate),js(n,s)})})}})};function Ia(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...ln(s)?Oa:Va,preloadedFeatures:t,useRender:Aa(i),createVisualElement:e,Component:s};return sa(o)}}function qt(t,e,n){const s=t.getProps();return hn(s,e,n!==void 0?n:s.custom,t)}const Us=new Set(["width","height","top","left","right","bottom",...Dt]);function ka(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Kt(n))}function _a(t,e){const n=qt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Ma(r[o]);ka(t,o,a)}}function La(t){return!!(K(t)&&t.add)}function mn(t,e){const n=t.getValue("willChange");if(La(n))return n.add(e);if(!n&&Ue.WillChange){const s=new Ue.WillChange("auto");t.addValue("willChange",s),s.add(e)}}function $s(t){return t.props[Ts]}const Gs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Na=1e-7,ja=12;function Fa(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=Gs(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>Na&&++a<ja);return o}function Xt(t,e,n,s){if(t===e&&n===s)return X;const i=r=>Fa(r,0,1,t,n);return r=>r===0||r===1?r:Gs(i(r),e,s)}const Ks=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Hs=t=>e=>1-t(1-e),Ws=Xt(.33,1.53,.69,.99),pn=Hs(Ws),Ys=Ks(pn),zs=t=>(t*=2)<1?.5*pn(t):.5*(2-Math.pow(2,-10*(t-1))),gn=t=>1-Math.sin(Math.acos(t)),qs=Hs(gn),Xs=Ks(gn),Zs=t=>/^0[^.\s]+$/u.test(t);function Ba(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Zs(t):!0}const Zt=t=>Math.round(t*1e5)/1e5,yn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ua(t){return t==null}const $a=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vn=(t,e)=>n=>!!(typeof n=="string"&&$a.test(n)&&n.startsWith(t)||e&&!Ua(n)&&Object.prototype.hasOwnProperty.call(n,e)),Js=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(yn);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Ga=t=>at(0,255,t),bn={...Vt,transform:t=>Math.round(Ga(t))},xt={test:vn("rgb","red"),parse:Js("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+bn.transform(t)+", "+bn.transform(e)+", "+bn.transform(n)+", "+Zt(Yt.transform(s))+")"};function Ka(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const xn={test:vn("#"),parse:Ka,transform:xt.transform},Ot={test:vn("hsl","hue"),parse:Js("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+ot.transform(Zt(e))+", "+ot.transform(Zt(n))+", "+Zt(Yt.transform(s))+")"},H={test:t=>xt.test(t)||xn.test(t)||Ot.test(t),parse:t=>xt.test(t)?xt.parse(t):Ot.test(t)?Ot.parse(t):xn.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?xt.transform(t):Ot.transform(t)},Ha=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Wa(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(yn))==null?void 0:e.length)||0)+(((n=t.match(Ha))==null?void 0:n.length)||0)>0}const Qs="number",ti="color",Ya="var",za="var(",ei="${}",qa=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Jt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(qa,l=>(H.test(l)?(s.color.push(r),i.push(ti),n.push(H.parse(l))):l.startsWith(za)?(s.var.push(r),i.push(Ya),n.push(l)):(s.number.push(r),i.push(Qs),n.push(parseFloat(l))),++r,ei)).split(ei);return{values:n,split:a,indexes:s,types:i}}function ni(t){return Jt(t).values}function si(t){const{split:e,types:n}=Jt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===Qs?r+=Zt(i[o]):a===ti?r+=H.transform(i[o]):r+=i[o]}return r}}const Xa=t=>typeof t=="number"?0:t;function Za(t){const e=ni(t);return si(t)(e.map(Xa))}const mt={test:Wa,parse:ni,createTransformer:si,getAnimatableNone:Za},Ja=new Set(["brightness","contrast","saturate","opacity"]);function Qa(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(yn)||[];if(!s)return t;const i=n.replace(s,"");let r=Ja.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const tl=/\b([a-z-]*)\(.*?\)/gu,wn={...mt,getAnimatableNone:t=>{const e=t.match(tl);return e?e.map(Qa).join(" "):t}},el={...on,color:H,backgroundColor:H,outlineColor:H,fill:H,stroke:H,borderColor:H,borderTopColor:H,borderRightColor:H,borderBottomColor:H,borderLeftColor:H,filter:wn,WebkitFilter:wn},ii=t=>el[t];function oi(t,e){let n=ii(t);return n!==wn&&(n=mt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const nl=new Set(["auto","none","0"]);function sl(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!nl.has(r)&&Jt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=oi(n,i)}const wt=t=>t*180/Math.PI,Tn=t=>{const e=wt(Math.atan2(t[1],t[0]));return Cn(e)},il={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Tn,rotateZ:Tn,skewX:t=>wt(Math.atan(t[1])),skewY:t=>wt(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Cn=t=>(t=t%360,t<0&&(t+=360),t),ri=Tn,ai=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),li=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),ol={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ai,scaleY:li,scale:t=>(ai(t)+li(t))/2,rotateX:t=>Cn(wt(Math.atan2(t[6],t[5]))),rotateY:t=>Cn(wt(Math.atan2(-t[2],t[0]))),rotateZ:ri,rotate:ri,skewX:t=>wt(Math.atan(t[4])),skewY:t=>wt(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ci(t){return t.includes("scale")?1:0}function En(t,e){if(!t||t==="none")return ci(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=ol,i=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=il,i=a}if(!i)return ci(e);const r=s[e],o=i[1].split(",").map(al);return typeof r=="function"?r(o):o[r]}const rl=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return En(n,e)};function al(t){return parseFloat(t.trim())}const ui=t=>t===Vt||t===S,ll=new Set(["x","y","z"]),cl=Dt.filter(t=>!ll.has(t));function ul(t){const e=[];return cl.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const It={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>En(e,"x"),y:(t,{transform:e})=>En(e,"y")};It.translateX=It.x,It.translateY=It.y;const Tt=new Set;let Sn=!1,An=!1;function hi(){if(An){const t=Array.from(Tt).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=ul(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))==null||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}An=!1,Sn=!1,Tt.forEach(t=>t.complete()),Tt.clear()}function di(){Tt.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(An=!0)})}function hl(){di(),hi()}class Pn{constructor(e,n,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Tt.add(this),Sn||(Sn=!0,I.read(di),I.resolveKeyframes(hi))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let r=0;r<e.length;r++)if(e[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Tt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Tt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const fi=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),dl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fl(t){const e=dl.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}const ml=4;function mi(t,e,n=1){ht(n<=ml,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,i]=fl(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return fi(o)?parseFloat(o):o}return sn(i)?mi(i,e,n+1):i}const pi=t=>e=>e.test(t),gi=[Vt,S,ot,ft,ha,ua,{test:t=>t==="auto",parse:t=>t}],yi=t=>gi.find(pi(t));class vi extends Pn{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),sn(u))){const c=mi(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Us.has(s)||e.length!==2)return;const[i,r]=e,o=yi(i),a=yi(r);if(o!==a)if(ui(o)&&ui(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)Ba(e[i])&&s.push(i);s.length&&sl(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=It[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var a;const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const i=e.getValue(n);i&&i.jump(this.measuredOrigin,!1);const r=s.length-1,o=s[r];s[r]=It[n](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,u])=>{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const bi=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(mt.test(t)||t==="0")&&!t.startsWith("url("));function pl(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function gl(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=bi(i,e),a=bi(r,e);return Pt(o===a,`You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`),!o||!a?!1:pl(t)||(n==="spring"||We(n))&&s}const yl=t=>t!==null;function Ee(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(yl),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const vl=40;class xi{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=it.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>vl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&hl(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=it.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!gl(e,s,i,r))if(o)this.options.duration=0;else{l&&l(Ee(e,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const k=(t,e,n)=>t+(e-t)*n;function Mn(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function bl({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=Mn(l,a,t+1/3),r=Mn(l,a,t),o=Mn(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function Se(t,e){return n=>n>0?e:t}const Rn=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},xl=[xn,xt,Ot],wl=t=>xl.find(e=>e.test(t));function wi(t){const e=wl(t);if(Pt(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let n=e.parse(t);return e===Ot&&(n=bl(n)),n}const Ti=(t,e)=>{const n=wi(t),s=wi(e);if(!n||!s)return Se(t,e);const i={...n};return r=>(i.red=Rn(n.red,s.red,r),i.green=Rn(n.green,s.green,r),i.blue=Rn(n.blue,s.blue,r),i.alpha=k(n.alpha,s.alpha,r),xt.transform(i))},Tl=(t,e)=>n=>e(t(n)),Qt=(...t)=>t.reduce(Tl),Dn=new Set(["none","hidden"]);function Cl(t,e){return Dn.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function El(t,e){return n=>k(t,e,n)}function Vn(t){return typeof t=="number"?El:typeof t=="string"?sn(t)?Se:H.test(t)?Ti:Pl:Array.isArray(t)?Ci:typeof t=="object"?H.test(t)?Ti:Sl:Se}function Ci(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Vn(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Sl(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Vn(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function Al(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}const Pl=(t,e)=>{const n=mt.createTransformer(e),s=Jt(t),i=Jt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Dn.has(t)&&!i.values.length||Dn.has(e)&&!s.values.length?Cl(t,e):Qt(Ci(Al(s,i),i.values),n):(Pt(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Se(t,e))};function Ei(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?k(t,e,n):Vn(t)(t,e)}const Ml=5;function Si(t,e,n){const s=Math.max(e-Ml,0);return ns(n-t(s),e-s)}const _={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},On=.001;function Rl({duration:t=_.duration,bounce:e=_.bounce,velocity:n=_.velocity,mass:s=_.mass}){let i,r;Pt(t<=tt(_.maxDuration),"Spring duration must be 10 seconds or less");let o=1-e;o=at(_.minDamping,_.maxDamping,o),t=at(_.minDuration,_.maxDuration,st(t)),o<1?(i=u=>{const c=u*o,h=c*t,d=c-n,f=In(u,o),m=Math.exp(-h);return On-d/f*m},r=u=>{const h=u*o*t,d=h*n+n,f=Math.pow(o,2)*Math.pow(u,2)*t,m=Math.exp(-h),v=In(Math.pow(u,2),o);return(-i(u)+On>0?-1:1)*((d-f)*m)/v}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-On+c*h},r=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=Vl(i,r,a);if(t=tt(t),isNaN(l))return{stiffness:_.stiffness,damping:_.damping,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const Dl=12;function Vl(t,e,n){let s=n;for(let i=1;i<Dl;i++)s=s-t(s)/e(s);return s}function In(t,e){return t*Math.sqrt(1-e*e)}const Ol=["duration","bounce"],Il=["stiffness","damping","mass"];function Ai(t,e){return e.some(n=>t[n]!==void 0)}function kl(t){let e={velocity:_.velocity,stiffness:_.stiffness,damping:_.damping,mass:_.mass,isResolvedFromDuration:!1,...t};if(!Ai(t,Il)&&Ai(t,Ol))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),i=s*s,r=2*at(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:_.mass,stiffness:i,damping:r}}else{const n=Rl(t);e={...e,...n,mass:_.mass},e.isResolvedFromDuration=!0}return e}function Ae(t=_.visualDuration,e=_.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:u,mass:c,duration:h,velocity:d,isResolvedFromDuration:f}=kl({...n,velocity:-st(n.velocity||0)}),m=d||0,v=u/(2*Math.sqrt(l*c)),b=o-r,g=st(Math.sqrt(l/c)),E=Math.abs(b)<5;s||(s=E?_.restSpeed.granular:_.restSpeed.default),i||(i=E?_.restDelta.granular:_.restDelta.default);let w;if(v<1){const x=In(g,v);w=A=>{const O=Math.exp(-v*g*A);return o-O*((m+v*g*b)/x*Math.sin(x*A)+b*Math.cos(x*A))}}else if(v===1)w=x=>o-Math.exp(-g*x)*(b+(m+g*b)*x);else{const x=g*Math.sqrt(v*v-1);w=A=>{const O=Math.exp(-v*g*A),P=Math.min(x*A,300);return o-O*((m+v*g*b)*Math.sinh(P)+x*b*Math.cosh(P))/x}}const D={calculatedDuration:f&&h||null,next:x=>{const A=w(x);if(f)a.done=x>=h;else{let O=0;v<1&&(O=x===0?tt(m):Si(w,x,A));const P=Math.abs(O)<=s,L=Math.abs(o-A)<=i;a.done=P&&L}return a.value=a.done?o:A,a},toString:()=>{const x=Math.min(ze(D),pe),A=os(O=>D.next(x*O).value,x,30);return x+"ms "+A},toTransition:()=>{}};return D}Ae.applyToOptions=t=>{const e=Ir(t,100,Ae);return t.ease=Ut()?e.ease:"easeOut",t.duration=tt(e.duration),t.type="keyframes",t};function Pi({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],d={done:!1,value:h},f=P=>a!==void 0&&P<a||l!==void 0&&P>l,m=P=>a===void 0?l:l===void 0||Math.abs(a-P)<Math.abs(l-P)?a:l;let v=n*e;const b=h+v,g=o===void 0?b:o(b);g!==b&&(v=g-h);const E=P=>-v*Math.exp(-P/s),w=P=>g+E(P),D=P=>{const L=E(P),B=w(P);d.done=Math.abs(L)<=u,d.value=d.done?g:B};let x,A;const O=P=>{f(d.value)&&(x=P,A=Ae({keyframes:[d.value,m(d.value)],velocity:Si(w,P,d.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return O(0),{calculatedDuration:null,next:P=>{let L=!1;return!A&&x===void 0&&(L=!0,D(P),O(P)),x!==void 0&&P>=x?A.next(P-x):(!L&&D(P),d)}}}const _l=Xt(.42,0,1,1),Ll=Xt(0,0,.58,1),Mi=Xt(.42,0,.58,1),Nl=t=>Array.isArray(t)&&typeof t[0]!="number",Ri={linear:X,easeIn:_l,easeInOut:Mi,easeOut:Ll,circIn:gn,circInOut:Xs,circOut:qs,backIn:pn,backInOut:Ys,backOut:Ws,anticipate:zs},Di=t=>{if(Ke(t)){ht(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[e,n,s,i]=t;return Xt(e,n,s,i)}else if(typeof t=="string")return ht(Ri[t]!==void 0,`Invalid easing type '${t}'`),Ri[t];return t};function jl(t,e,n){const s=[],i=n||Ei,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||X:e;a=Qt(l,a)}s.push(a)}return s}function Fl(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(ht(r===e.length,"Both input and output ranges must be the same length"),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=jl(e,s,i),l=a.length,u=c=>{if(o&&c<t[0])return e[0];let h=0;if(l>1)for(;h<t.length-2&&!(c<t[h+1]);h++);const d=Bt(t[h],t[h+1],c);return a[h](d)};return n?c=>u(at(t[0],t[r-1],c)):u}function Bl(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Bt(0,e,s);t.push(k(n,1,i))}}function Ul(t){const e=[0];return Bl(e,t.length-1),e}function $l(t,e){return t.map(n=>n*e)}function Gl(t,e){return t.map(()=>e||Mi).splice(0,t.length-1)}function te({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=Nl(s)?s.map(Di):Di(s),r={done:!1,value:e[0]},o=$l(n&&n.length===e.length?n:Ul(e),t),a=Fl(o,e,{ease:Array.isArray(i)?i:Gl(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const Kl=t=>{const e=({timestamp:n})=>t(n);return{start:()=>I.update(e,!0),stop:()=>dt(e),now:()=>U.isProcessing?U.timestamp:it.now()}},Hl={decay:Pi,inertia:Pi,tween:te,keyframes:te,spring:Ae},Wl=t=>t/100;class kn extends xi{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:r}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Pn,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(r,a,n,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=We(n)?n:Hl[n]||te;let l,u;process.env.NODE_ENV!=="production"&&a!==te&&ht(e.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),a!==te&&typeof e[0]!="number"&&(l=Qt(Wl,Ei(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});r==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=ze(c));const{calculatedDuration:h}=c,d=h+i,f=d*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:P}=this.options;return{done:!0,value:P[P.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return r.next(0);const{delay:d,repeat:f,repeatType:m,repeatDelay:v,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),E=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let w=this.currentTime,D=r;if(f){const P=Math.min(this.currentTime,c)/h;let L=Math.floor(P),B=P%1;!B&&P>=1&&(B=1),B===1&&L--,L=Math.min(L,f+1),!!(L%2)&&(m==="reverse"?(B=1-B,v&&(B-=v/h)):m==="mirror"&&(D=o)),w=at(0,1,B)*h}const x=E?{done:!1,value:l[0]}:D.next(w);a&&(x.value=a(x.value));let{done:A}=x;!E&&u!==null&&(A=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const O=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return O&&i!==void 0&&(x.value=Ee(l,this.options,i)),b&&b(x.value),O&&this.finish(),x}get duration(){const{resolved:e}=this;return e?st(e.calculatedDuration):0}get time(){return st(this.currentTime)}set time(e){e=tt(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=st(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Kl,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}get finished(){return this.currentFinishedPromise}}const Yl=new Set(["opacity","clipPath","filter","transform"]),zl=$e(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Pe=10,ql=2e4;function Xl(t){return We(t.type)||t.type==="spring"||!as(t.ease)}function Zl(t,e){const n=new kn({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<ql;)s=n.sample(r),i.push(s.value),r+=Pe;return{times:void 0,keyframes:i,duration:r-Pe,ease:"linear"}}const Vi={anticipate:zs,backInOut:Ys,circInOut:Xs};function Jl(t){return t in Vi}class Oi extends xi{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:r}=this.options;this.resolver=new vi(r,(o,a)=>this.onKeyframesResolved(o,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof r=="string"&&Ut()&&Jl(r)&&(r=Vi[r]),Xl(this.options)){const{onComplete:h,onUpdate:d,motionValue:f,element:m,...v}=this.options,b=Zl(e,v);e=b.keyframes,e.length===1&&(e[1]=e[0]),s=b.duration,i=b.times,r=b.ease,o="keyframes"}const c=Or(a.owner.current,l,e,{...this.options,duration:s,times:i,ease:r});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(ls(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:h}=this.options;a.set(Ee(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:s,times:i,type:o,ease:r,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return st(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return st(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=tt(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return X;const{animation:s}=n;ls(s,e)}return X}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:r,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:h,element:d,...f}=this.options,m=new kn({...f,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),v=tt(this.time);u.setWithVelocity(m.sample(v-Pe).value,m.sample(v).value,Pe)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return zl()&&s&&Yl.has(s)&&(s!=="transform"||!u)&&!l&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}const Ql={type:"spring",stiffness:500,damping:25,restSpeed:10},tc=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),ec={type:"keyframes",duration:.8},nc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},sc=(t,{keyframes:e})=>e.length>2?ec:bt.has(t)?t.startsWith("scale")?tc(e[1]):Ql:nc;function ic({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const _n=(t,e,n,s={},i,r)=>o=>{const a=Ye(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-tt(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:d=>{e.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};ic(a)||(c={...c,...sc(t,c)}),c.duration&&(c.duration=tt(c.duration)),c.repeatDelay&&(c.repeatDelay=tt(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(h=!0)),c.allowFlatten=!a.type&&!a.ease,h&&!r&&e.get()!==void 0){const d=Ee(c.keyframes,a);if(d!==void 0)return I.update(()=>{c.onUpdate(d),c.onComplete()}),new Rr([])}return!r&&Oi.supports(c)?new Oi(c):new kn(c)};function oc({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function Ii(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const c in a){const h=t.getValue(c,t.latestValues[c]??null),d=a[c];if(d===void 0||u&&oc(u,c))continue;const f={delay:n,...Ye(r||{},c)};let m=!1;if(window.MotionHandoffAnimation){const b=$s(t);if(b){const g=window.MotionHandoffAnimation(b,c,I);g!==null&&(f.startTime=g,m=!0)}}mn(t,c),h.start(_n(c,h,d,t.shouldReduceMotion&&Us.has(c)?{type:!1}:f,t,m));const v=h.animation;v&&l.push(v)}return o&&Promise.all(l).then(()=>{I.update(()=>{o&&_a(t,o)})}),l}function Ln(t,e,n={}){var l;const s=qt(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Ii(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:d}=i;return rc(t,e,c+u,h,d,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[u,c]=a==="beforeChildren"?[r,o]:[o,r];return u().then(()=>c())}else return Promise.all([r(),o(n.delay)])}function rc(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(ac).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Ln(u,e,{...r,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function ac(t,e){return t.sortNodePosition(e)}function lc(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Ln(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Ln(t,e,n);else{const i=typeof e=="function"?qt(t,e,n.custom):e;s=Promise.all(Ii(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function ki(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const cc=tn.length;function _i(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?_i(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<cc;n++){const s=tn[n],i=t.props[s];(Ht(i)||i===!1)&&(e[s]=i)}return e}const uc=[...Qe].reverse(),hc=Qe.length;function dc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>lc(t,n,s)))}function fc(t){let e=dc(t),n=Li(),s=!0;const i=l=>(u,c)=>{var d;const h=qt(t,c,l==="exit"?(d=t.presenceContext)==null?void 0:d.custom:void 0);if(h){const{transition:f,transitionEnd:m,...v}=h;u={...u,...v,...m}}return u};function r(l){e=l(t)}function o(l){const{props:u}=t,c=_i(t.parent)||{},h=[],d=new Set;let f={},m=1/0;for(let b=0;b<hc;b++){const g=uc[b],E=n[g],w=u[g]!==void 0?u[g]:c[g],D=Ht(w),x=g===l?E.isActive:null;x===!1&&(m=b);let A=w===c[g]&&w!==u[g]&&D;if(A&&s&&t.manuallyAnimateOnMount&&(A=!1),E.protectedKeys={...f},!E.isActive&&x===null||!w&&!E.prevProp||xe(w)||typeof w=="boolean")continue;const O=mc(E.prevProp,w);let P=O||g===l&&E.isActive&&!A&&D||b>m&&D,L=!1;const B=Array.isArray(w)?w:[w];let Q=B.reduce(i(g),{});x===!1&&(Q={});const{prevResolvedValues:lt={}}=E,M={...lt,...Q},vt=N=>{P=!0,d.has(N)&&(L=!0,d.delete(N)),E.needsAnimating[N]=!0;const Y=t.getValue(N);Y&&(Y.liveStyle=!1)};for(const N in M){const Y=Q[N],ct=lt[N];if(f.hasOwnProperty(N))continue;let p=!1;dn(Y)&&dn(ct)?p=!ki(Y,ct):p=Y!==ct,p?Y!=null?vt(N):d.add(N):Y!==void 0&&d.has(N)?vt(N):E.protectedKeys[N]=!0}E.prevProp=w,E.prevResolvedValues=Q,E.isActive&&(f={...f,...Q}),s&&t.blockInitialAnimation&&(P=!1),P&&(!(A&&O)||L)&&h.push(...B.map(N=>({animation:N,options:{type:g}})))}if(d.size){const b={};if(typeof u.initial!="boolean"){const g=qt(t,Array.isArray(u.initial)?u.initial[0]:u.initial);g&&g.transition&&(b.transition=g.transition)}d.forEach(g=>{const E=t.getBaseTarget(g),w=t.getValue(g);w&&(w.liveStyle=!0),b[g]=E??null}),h.push({animation:b})}let v=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(v=!1),s=!1,v?e(h):Promise.resolve()}function a(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(d=>{var f;return(f=d.animationState)==null?void 0:f.setActive(l,u)}),n[l].isActive=u;const c=o(l);for(const d in n)n[d].protectedKeys={};return c}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Li(),s=!0}}}function mc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!ki(e,t):!1}function Ct(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Li(){return{animate:Ct(!0),whileInView:Ct(),whileHover:Ct(),whileTap:Ct(),whileDrag:Ct(),whileFocus:Ct(),exit:Ct()}}class pt{constructor(e){this.isMounted=!1,this.node=e}update(){}}class pc extends pt{constructor(e){super(e),e.animationState||(e.animationState=fc(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();xe(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let gc=0;class yc extends pt{constructor(){super(...arguments),this.id=gc++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const vc={animation:{Feature:pc},exit:{Feature:yc}};function ee(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function ne(t){return{point:{x:t.pageX,y:t.pageY}}}const bc=t=>e=>Ze(e)&&t(e,ne(e));function se(t,e,n,s){return ee(t,e,bc(n),s)}function Ni({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function xc({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function wc(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const ji=1e-4,Tc=1-ji,Cc=1+ji,Fi=.01,Ec=0-Fi,Sc=0+Fi;function q(t){return t.max-t.min}function Ac(t,e,n){return Math.abs(t-e)<=n}function Bi(t,e,n,s=.5){t.origin=s,t.originPoint=k(e.min,e.max,t.origin),t.scale=q(n)/q(e),t.translate=k(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Tc&&t.scale<=Cc||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ec&&t.translate<=Sc||isNaN(t.translate))&&(t.translate=0)}function ie(t,e,n,s){Bi(t.x,e.x,n.x,s?s.originX:void 0),Bi(t.y,e.y,n.y,s?s.originY:void 0)}function Ui(t,e,n){t.min=n.min+e.min,t.max=t.min+q(e)}function Pc(t,e,n){Ui(t.x,e.x,n.x),Ui(t.y,e.y,n.y)}function $i(t,e,n){t.min=e.min-n.min,t.max=t.min+q(e)}function oe(t,e,n){$i(t.x,e.x,n.x),$i(t.y,e.y,n.y)}const Gi=()=>({translate:0,scale:1,origin:0,originPoint:0}),kt=()=>({x:Gi(),y:Gi()}),Ki=()=>({min:0,max:0}),F=()=>({x:Ki(),y:Ki()});function Z(t){return[t("x"),t("y")]}function Nn(t){return t===void 0||t===1}function jn({scale:t,scaleX:e,scaleY:n}){return!Nn(t)||!Nn(e)||!Nn(n)}function Et(t){return jn(t)||Hi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Hi(t){return Wi(t.x)||Wi(t.y)}function Wi(t){return t&&t!=="0%"}function Me(t,e,n){const s=t-n,i=e*s;return n+i}function Yi(t,e,n,s,i){return i!==void 0&&(t=Me(t,i,s)),Me(t,n,s)+e}function Fn(t,e=0,n=1,s,i){t.min=Yi(t.min,e,n,s,i),t.max=Yi(t.max,e,n,s,i)}function zi(t,{x:e,y:n}){Fn(t.x,e.translate,e.scale,e.originPoint),Fn(t.y,n.translate,n.scale,n.originPoint)}const qi=.999999999999,Xi=1.0000000000001;function Mc(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Lt(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,zi(t,o)),s&&Et(r.latestValues)&&Lt(t,r.latestValues))}e.x<Xi&&e.x>qi&&(e.x=1),e.y<Xi&&e.y>qi&&(e.y=1)}function _t(t,e){t.min=t.min+e,t.max=t.max+e}function Zi(t,e,n,s,i=.5){const r=k(t.min,t.max,i);Fn(t,e,n,r,s)}function Lt(t,e){Zi(t.x,e.x,e.scaleX,e.scale,e.originX),Zi(t.y,e.y,e.scaleY,e.scale,e.originY)}function Ji(t,e){return Ni(wc(t.getBoundingClientRect(),e))}function Rc(t,e,n){const s=Ji(t,n),{scroll:i}=e;return i&&(_t(s.x,i.offset.x),_t(s.y,i.offset.y)),s}const Qi=({current:t})=>t?t.ownerDocument.defaultView:null,to=(t,e)=>Math.abs(t-e);function Dc(t,e){const n=to(t.x,e.x),s=to(t.y,e.y);return Math.sqrt(n**2+s**2)}class eo{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Un(this.lastMoveEventInfo,this.history),d=this.startEvent!==null,f=Dc(h.offset,{x:0,y:0})>=3;if(!d&&!f)return;const{point:m}=h,{timestamp:v}=U;this.history.push({...m,timestamp:v});const{onStart:b,onMove:g}=this.handlers;d||(b&&b(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,h)},this.handlePointerMove=(h,d)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Bn(d,this.transformPagePoint),I.update(this.updatePoint,!0)},this.handlePointerUp=(h,d)=>{this.end();const{onEnd:f,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=Un(h.type==="pointercancel"?this.lastMoveEventInfo:Bn(d,this.transformPagePoint),this.history);this.startEvent&&f&&f(h,b),m&&m(h,b)},!Ze(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=ne(e),a=Bn(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=U;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,Un(a,this.history)),this.removeListeners=Qt(se(this.contextWindow,"pointermove",this.handlePointerMove),se(this.contextWindow,"pointerup",this.handlePointerUp),se(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),dt(this.updatePoint)}}function Bn(t,e){return e?{point:e(t.point)}:t}function no(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Un({point:t},e){return{point:t,delta:no(t,so(e)),offset:no(t,Vc(e)),velocity:Oc(e,.1)}}function Vc(t){return t[0]}function so(t){return t[t.length-1]}function Oc(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=so(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>tt(e)));)n--;if(!s)return{x:0,y:0};const r=st(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Ic(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?k(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?k(n,t,s.max):Math.min(t,n)),t}function io(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function kc(t,{top:e,left:n,bottom:s,right:i}){return{x:io(t.x,n,i),y:io(t.y,e,s)}}function oo(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function _c(t,e){return{x:oo(t.x,e.x),y:oo(t.y,e.y)}}function Lc(t,e){let n=.5;const s=q(t),i=q(e);return i>s?n=Bt(e.min,e.max-s,t.min):s>i&&(n=Bt(t.min,t.max-i,e.min)),at(0,1,n)}function Nc(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const $n=.35;function jc(t=$n){return t===!1?t=0:t===!0&&(t=$n),{x:ro(t,"left","right"),y:ro(t,"top","bottom")}}function ro(t,e,n){return{min:ao(t,e),max:ao(t,n)}}function ao(t,e){return typeof t=="number"?t:t[e]||0}const Fc=new WeakMap;class Bc{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=F(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ne(c).point)},r=(c,h)=>{const{drag:d,dragPropagation:f,onDragStart:m}=this.getProps();if(d&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Nr(d),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Z(b=>{let g=this.getAxisMotionValue(b).get()||0;if(ot.test(g)){const{projection:E}=this.visualElement;if(E&&E.layout){const w=E.layout.layoutBox[b];w&&(g=q(w)*(parseFloat(g)/100))}}this.originPoint[b]=g}),m&&I.postRender(()=>m(c,h)),mn(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(c,h)=>{const{dragPropagation:d,dragDirectionLock:f,onDirectionLock:m,onDrag:v}=this.getProps();if(!d&&!this.openDragLock)return;const{offset:b}=h;if(f&&this.currentDirection===null){this.currentDirection=Uc(b),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",h.point,b),this.updateAxis("y",h.point,b),this.visualElement.render(),v&&v(c,h)},a=(c,h)=>this.stop(c,h),l=()=>Z(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)==null?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new eo(e,{onSessionStart:i,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Qi(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&I.postRender(()=>r(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Re(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=Ic(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,i=this.constraints;e&&Rt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=kc(s.layoutBox,e):this.constraints=!1,this.elastic=jc(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Z(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Nc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Rt(e))return!1;const s=e.current;ht(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=Rc(s,i.root,this.visualElement.getTransformPagePoint());let o=_c(i.layout.layoutBox,r);if(n){const a=n(xc(o));this.hasMutatedConstraints=!!a,a&&(o=Ni(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Z(c=>{if(!Re(c,n,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const d=i?200:1e6,f=i?40:1e7,m={type:"inertia",velocity:s?e[c]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return mn(this.visualElement,e),s.start(_n(e,s,0,n,this.visualElement,!1))}stopAnimation(){Z(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Z(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){Z(n=>{const{drag:s}=this.getProps();if(!Re(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];r.set(e[n]-k(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Rt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Z(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=Lc({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Z(o=>{if(!Re(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(k(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;Fc.set(this.visualElement,this);const e=this.visualElement.current,n=se(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();Rt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),I.read(s);const o=ee(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Z(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=$n,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Re(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Uc(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class $c extends pt{constructor(e){super(e),this.removeGroupControls=X,this.removeListeners=X,this.controls=new Bc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||X}unmount(){this.removeGroupControls(),this.removeListeners()}}const lo=t=>(e,n)=>{t&&I.postRender(()=>t(e,n))};class Gc extends pt{constructor(){super(...arguments),this.removePointerDownListener=X}onPointerDown(e){this.session=new eo(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Qi(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:lo(e),onStart:lo(n),onMove:s,onEnd:(r,o)=>{delete this.session,i&&I.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=se(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const De={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function co(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const re={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(S.test(t))t=parseFloat(t);else return t;const n=co(t,e.target.x),s=co(t,e.target.y);return`${n}% ${s}%`}},Kc={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=mt.parse(t);if(i.length>5)return s;const r=mt.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=k(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}};class Hc extends y.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;ca(Wc),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),De.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,o=s.projection;return o&&(o.isPresent=r,i||e.layoutDependency!==n||n===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||I.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),qe.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function uo(t){const[e,n]=Qn(),s=y.useContext(_e);return C.jsx(Hc,{...t,layoutGroup:s,switchLayoutGroup:y.useContext(Cs),isPresent:e,safeToRemove:n})}const Wc={borderRadius:{...re,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:re,borderTopRightRadius:re,borderBottomLeftRadius:re,borderBottomRightRadius:re,boxShadow:Kc};function Yc(t,e,n){const s=K(t)?t:Kt(t);return s.start(_n("",s,e,n)),s.animation}function zc(t){return t instanceof SVGElement&&t.tagName!=="svg"}const qc=(t,e)=>t.depth-e.depth;class Xc{constructor(){this.children=[],this.isDirty=!1}add(e){Fe(this.children,e),this.isDirty=!0}remove(e){Be(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(qc),this.isDirty=!1,this.children.forEach(e)}}function Zc(t,e){const n=it.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(dt(s),t(r-e))};return I.read(s,!0),()=>dt(s)}const ho=["TopLeft","TopRight","BottomLeft","BottomRight"],Jc=ho.length,fo=t=>typeof t=="string"?parseFloat(t):t,mo=t=>typeof t=="number"||S.test(t);function Qc(t,e,n,s,i,r){i?(t.opacity=k(0,n.opacity??1,tu(s)),t.opacityExit=k(e.opacity??1,0,eu(s))):r&&(t.opacity=k(e.opacity??1,n.opacity??1,s));for(let o=0;o<Jc;o++){const a=`border${ho[o]}Radius`;let l=po(e,a),u=po(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||mo(l)===mo(u)?(t[a]=Math.max(k(fo(l),fo(u),s),0),(ot.test(u)||ot.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=k(e.rotate||0,n.rotate||0,s))}function po(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const tu=go(0,.5,qs),eu=go(.5,.95,X);function go(t,e,n){return s=>s<t?0:s>e?1:n(Bt(t,e,s))}function yo(t,e){t.min=e.min,t.max=e.max}function J(t,e){yo(t.x,e.x),yo(t.y,e.y)}function vo(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function bo(t,e,n,s,i){return t-=e,t=Me(t,1/n,s),i!==void 0&&(t=Me(t,1/i,s)),t}function nu(t,e=0,n=1,s=.5,i,r=t,o=t){if(ot.test(e)&&(e=parseFloat(e),e=k(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=k(r.min,r.max,s);t===r&&(a-=e),t.min=bo(t.min,e,n,a,i),t.max=bo(t.max,e,n,a,i)}function xo(t,e,[n,s,i],r,o){nu(t,e[n],e[s],e[i],e.scale,r,o)}const su=["x","scaleX","originX"],iu=["y","scaleY","originY"];function wo(t,e,n,s){xo(t.x,e,su,n?n.x:void 0,s?s.x:void 0),xo(t.y,e,iu,n?n.y:void 0,s?s.y:void 0)}function To(t){return t.translate===0&&t.scale===1}function Co(t){return To(t.x)&&To(t.y)}function Eo(t,e){return t.min===e.min&&t.max===e.max}function ou(t,e){return Eo(t.x,e.x)&&Eo(t.y,e.y)}function So(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ao(t,e){return So(t.x,e.x)&&So(t.y,e.y)}function Po(t){return q(t.x)/q(t.y)}function Mo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class ru{constructor(){this.members=[]}add(e){Fe(this.members,e),e.scheduleRender()}remove(e){if(Be(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function au(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:d,skewX:f,skewY:m}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),d&&(s+=`rotateY(${d}deg) `),f&&(s+=`skewX(${f}deg) `),m&&(s+=`skewY(${m}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const Gn=["","X","Y","Z"],lu={visibility:"hidden"},Ro=1e3;let cu=0;function Kn(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Do(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=$s(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",I,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Do(s)}function Vo({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=cu++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.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(du),this.nodes.forEach(yu),this.nodes.forEach(vu),this.nodes.forEach(fu)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Xc)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ge),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=zc(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const d=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=Zc(d,250),De.hasAnimatedSinceResize&&(De.hasAnimatedSinceResize=!1,this.nodes.forEach(Io))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeLayoutChanged:f,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||c.getDefaultTransition()||Cu,{onLayoutAnimationStart:b,onLayoutAnimationComplete:g}=c.getProps(),E=!this.targetLayout||!Ao(this.targetLayout,m),w=!d&&f;if(this.options.layoutRoot||this.resumeFrom||w||d&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,w);const D={...Ye(v,"layout"),onPlay:b,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else d||Io(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,dt(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(bu),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Do(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Oo);return}this.isUpdating||this.nodes.forEach(pu),this.isUpdating=!1,this.nodes.forEach(gu),this.nodes.forEach(uu),this.nodes.forEach(hu),this.clearAllSnapshots();const a=it.now();U.delta=at(0,1e3/60,a-U.timestamp),U.timestamp=a,U.isProcessing=!0,Xe.update.process(U),Xe.preRender.process(U),Xe.render.process(U),U.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qe.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(mu),this.sharedNodes.forEach(xu)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,I.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){I.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!q(this.snapshot.measuredBox.x)&&!q(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=F(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Co(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Et(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Eu(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return F();const a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Su))){const{scroll:c}=this.root;c&&(_t(a.x,c.offset.x),_t(a.y,c.offset.y))}return a}removeElementScroll(o){var l;const a=F();if(J(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:d}=c;c!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&J(a,o),_t(a.x,h.offset.x),_t(a.y,h.offset.y))}return a}applyTransform(o,a=!1){const l=F();J(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Lt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Et(c.latestValues)&&Lt(l,c.latestValues)}return Et(this.latestValues)&&Lt(l,this.latestValues),l}removeTransform(o){const a=F();J(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Et(u.latestValues))continue;jn(u.latestValues)&&u.updateSnapshot();const c=F(),h=u.measurePageBox();J(c,h),wo(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Et(this.latestValues)&&wo(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==U.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:c,layoutId:h}=this.options;if(!(!this.layout||!(c||h))){if(this.resolvedRelativeTargetAt=U.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),oe(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),J(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=F(),this.targetWithTransforms=F()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Pc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):J(this.target,this.layout.layoutBox),zi(this.target,this.targetDelta)):J(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),oe(this.relativeTargetOrigin,this.target,f.target),J(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||jn(this.parent.latestValues)||Hi(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 m;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(m=this.parent)!=null&&m.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===U.timestamp&&(l=!1),l)return;const{layout:u,layoutId:c}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||c))return;J(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;Mc(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=F());const{target:f}=o;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(vo(this.prevProjectionDelta.x,this.projectionDelta.x),vo(this.prevProjectionDelta.y,this.projectionDelta.y)),ie(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!Mo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Mo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=kt(),this.projectionDelta=kt(),this.projectionDeltaWithTransform=kt()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=kt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=F(),f=l?l.source:void 0,m=this.layout?this.layout.source:void 0,v=f!==m,b=this.getStack(),g=!b||b.members.length<=1,E=!!(v&&!g&&this.options.crossfade===!0&&!this.path.some(Tu));this.animationProgress=0;let w;this.mixTargetDelta=D=>{const x=D/1e3;ko(h.x,o.x,x),ko(h.y,o.y,x),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(oe(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),wu(this.relativeTarget,this.relativeTargetOrigin,d,x),w&&ou(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=F()),J(w,this.relativeTarget)),v&&(this.animationValues=c,Qc(c,u,this.latestValues,x,E,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=x},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(dt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=I.update(()=>{De.hasAnimatedSinceResize=!0,this.currentAnimation=Yc(0,Ro,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Ro),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Fo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||F();const h=q(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const d=q(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+d}J(a,l),Lt(a,c),ie(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ru),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Kn("z",o,u,this.animationValues);for(let c=0;c<Gn.length;c++)Kn(`rotate${Gn[c]}`,o,u,this.animationValues),Kn(`skew${Gn[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return lu;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=Ce(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const f={};return this.options.layoutId&&(f.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,f.pointerEvents=Ce(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Et(this.latestValues)&&(f.transform=l?l({},""):"none",this.hasProjected=!1),f}const c=u.animationValues||u.latestValues;this.applyTransformsToTarget(),a.transform=au(this.projectionDeltaWithTransform,this.treeScale,c),l&&(a.transform=l(c,a.transform));const{x:h,y:d}=this.projectionDelta;a.transformOrigin=`${h.origin*100}% ${d.origin*100}% 0`,u.animationValues?a.opacity=u===this?c.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:c.opacityExit:a.opacity=u===this?c.opacity!==void 0?c.opacity:"":c.opacityExit!==void 0?c.opacityExit:0;for(const f in Wt){if(c[f]===void 0)continue;const{correct:m,applyTo:v,isCSSVariable:b}=Wt[f],g=a.transform==="none"?c[f]:m(c[f],u);if(v){const E=v.length;for(let w=0;w<E;w++)a[v[w]]=g}else b?this.options.visualElement.renderState.vars[f]=g:a[f]=g}return this.options.layoutId&&(a.pointerEvents=u===this?Ce(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Oo),this.root.sharedNodes.clear()}}}function uu(t){t.updateLayout()}function hu(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;r==="size"?Z(h=>{const d=o?e.measuredBox[h]:e.layoutBox[h],f=q(d);d.min=s[h].min,d.max=d.min+f}):Fo(r,e.layoutBox,s)&&Z(h=>{const d=o?e.measuredBox[h]:e.layoutBox[h],f=q(s[h]);d.max=d.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const a=kt();ie(a,s,e.layoutBox);const l=kt();o?ie(l,t.applyTransform(i,!0),e.measuredBox):ie(l,s,e.layoutBox);const u=!Co(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:f}=h;if(d&&f){const m=F();oe(m,e.layoutBox,d.layoutBox);const v=F();oe(v,s,f.layoutBox),Ao(m,v)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=v,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function du(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function fu(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function mu(t){t.clearSnapshot()}function Oo(t){t.clearMeasurements()}function pu(t){t.isLayoutDirty=!1}function gu(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Io(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function yu(t){t.resolveTargetDelta()}function vu(t){t.calcProjection()}function bu(t){t.resetSkewAndRotation()}function xu(t){t.removeLeadSnapshot()}function ko(t,e,n){t.translate=k(e.translate,0,n),t.scale=k(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function _o(t,e,n,s){t.min=k(e.min,n.min,s),t.max=k(e.max,n.max,s)}function wu(t,e,n,s){_o(t.x,e.x,n.x,s),_o(t.y,e.y,n.y,s)}function Tu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Cu={duration:.45,ease:[.4,0,.1,1]},Lo=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),No=Lo("applewebkit/")&&!Lo("chrome/")?Math.round:X;function jo(t){t.min=No(t.min),t.max=No(t.max)}function Eu(t){jo(t.x),jo(t.y)}function Fo(t,e,n){return t==="position"||t==="preserve-aspect"&&!Ac(Po(e),Po(n),.2)}function Su(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Au=Vo({attachResizeListener:(t,e)=>ee(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hn={current:void 0},Bo=Vo({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Hn.current){const t=new Au({});t.mount(window),t.setOptions({layoutScroll:!0}),Hn.current=t}return Hn.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Pu={pan:{Feature:Gc},drag:{Feature:$c,ProjectionNode:Bo,MeasureLayout:uo}};function Uo(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=s[i];r&&I.postRender(()=>r(e,ne(e)))}class Mu extends pt{mount(){const{current:e}=this.node;e&&(this.unmount=Fr(e,(n,s)=>(Uo(this.node,s,"Start"),i=>Uo(this.node,i,"End"))))}unmount(){}}class Ru extends pt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Qt(ee(this.node.current,"focus",()=>this.onFocus()),ee(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $o(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=s[i];r&&I.postRender(()=>r(e,ne(e)))}class Du extends pt{mount(){const{current:e}=this.node;e&&(this.unmount=Gr(e,(n,s)=>($o(this.node,s,"Start"),(i,{success:r})=>$o(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Wn=new WeakMap,Yn=new WeakMap,Vu=t=>{const e=Wn.get(t.target);e&&e(t)},Ou=t=>{t.forEach(Vu)};function Iu({root:t,...e}){const n=t||document;Yn.has(n)||Yn.set(n,{});const s=Yn.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ou,{root:t,...e})),s[i]}function ku(t,e,n){const s=Iu(e);return Wn.set(t,n),s.observe(t),()=>{Wn.delete(t),s.unobserve(t)}}const _u={some:0,all:1};class Lu extends pt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:_u[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),d=u?c:h;d&&d(l)};return ku(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Nu(e,n))&&this.startObserver()}unmount(){}}function Nu({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const ju={inView:{Feature:Lu},tap:{Feature:Du},focus:{Feature:Ru},hover:{Feature:Mu}},Fu={layout:{ProjectionNode:Bo,MeasureLayout:uo}},zn={current:null},Go={current:!1};function Bu(){if(Go.current=!0,!!Ne)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>zn.current=t.matches;t.addListener(e),e()}else zn.current=!1}const Uu=[...gi,H,mt],$u=t=>Uu.find(pi(t)),Gu=new WeakMap;function Ku(t,e,n){for(const s in e){const i=e[s],r=n[s];if(K(i))t.addValue(s,i),process.env.NODE_ENV==="development"&&me(i.version==="12.7.4",`Attempting to mix Motion versions ${i.version} with 12.7.4 may not work as expected.`);else if(K(r))t.addValue(s,Kt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Kt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Ko=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Hu{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Pn,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 f=it.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,I.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=o;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=we(n),this.isVariantNode=xs(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const m=d[f];l[f]!==void 0&&K(m)&&m.set(l[f],!1)}}mount(e){this.current=e,Gu.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Go.current||Bu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zn.current,process.env.NODE_ENV!=="production"&&me(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),dt(this.notifyUpdate),dt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=bt.has(e);s&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&I.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Mt){const n=Mt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):F()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Ko.length;s++){const i=Ko[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Ku(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Kt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(fi(s)||Zs(s))?s=parseFloat(s):!$u(s)&&mt.test(n)&&(s=oi(e,n)),this.setBaseTarget(e,K(s)?s.get():s)),K(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var r;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const o=hn(this.props,n,(r=this.presenceContext)==null?void 0:r.custom);o&&(s=o[e])}if(n&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!K(i)?i:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Ge),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Ho extends Hu{constructor(){super(...arguments),this.KeyframeResolver=vi}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;K(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Wu(t){return window.getComputedStyle(t)}class Yu extends Ho{constructor(){super(...arguments),this.type="html",this.renderInstance=Ls}readValueFromInstance(e,n){if(bt.has(n))return rl(e,n);{const s=Wu(e),i=(nn(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Ji(e,n)}build(e,n,s){rn(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return fn(e,n,s)}}class zu extends Ho{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=F,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&_s(this.current,this.renderState)}}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(bt.has(n)){const s=ii(n);return s&&s.default||0}return n=Ns.has(n)?n:en(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Fs(e,n,s)}onBindTransform(){this.current&&!this.renderState.dimensions&&I.postRender(this.updateDimensions)}build(e,n,s){cn(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){js(e,n,s,i)}mount(e){this.isSVGTag=un(e.tagName),super.mount(e)}}const qu=(t,e)=>ln(t)?new zu(e):new Yu(e,{allowProjection:t!==y.Fragment}),Xu=Ia({...vc,...ju,...Pu,...Fu},qu),Wo=Xr(Xu);var Yo;(function(t){t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object"})(Yo||(Yo={}));/**
|
|
39
31
|
* @license
|
|
40
32
|
* Copyright 2024 Google LLC
|
|
41
33
|
*
|
|
@@ -50,7 +42,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
50
42
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
51
43
|
* See the License for the specific language governing permissions and
|
|
52
44
|
* limitations under the License.
|
|
53
|
-
*/var
|
|
45
|
+
*/var zo;(function(t){t.LANGUAGE_UNSPECIFIED="language_unspecified",t.PYTHON="python"})(zo||(zo={}));var qo;(function(t){t.OUTCOME_UNSPECIFIED="outcome_unspecified",t.OUTCOME_OK="outcome_ok",t.OUTCOME_FAILED="outcome_failed",t.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(qo||(qo={}));/**
|
|
54
46
|
* @license
|
|
55
47
|
* Copyright 2024 Google LLC
|
|
56
48
|
*
|
|
@@ -65,7 +57,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
65
57
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
66
58
|
* See the License for the specific language governing permissions and
|
|
67
59
|
* limitations under the License.
|
|
68
|
-
*/const
|
|
60
|
+
*/const Xo=["user","model","function","system"];var Zo;(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(Zo||(Zo={}));var Jo;(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(Jo||(Jo={}));var Qo;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(Qo||(Qo={}));var tr;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER"})(tr||(tr={}));var ae;(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.OTHER="OTHER"})(ae||(ae={}));var er;(function(t){t.TASK_TYPE_UNSPECIFIED="TASK_TYPE_UNSPECIFIED",t.RETRIEVAL_QUERY="RETRIEVAL_QUERY",t.RETRIEVAL_DOCUMENT="RETRIEVAL_DOCUMENT",t.SEMANTIC_SIMILARITY="SEMANTIC_SIMILARITY",t.CLASSIFICATION="CLASSIFICATION",t.CLUSTERING="CLUSTERING"})(er||(er={}));var nr;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(nr||(nr={}));var sr;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(sr||(sr={}));/**
|
|
69
61
|
* @license
|
|
70
62
|
* Copyright 2024 Google LLC
|
|
71
63
|
*
|
|
@@ -80,7 +72,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
80
72
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
81
73
|
* See the License for the specific language governing permissions and
|
|
82
74
|
* limitations under the License.
|
|
83
|
-
*/class
|
|
75
|
+
*/class W extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}}class Nt extends W{constructor(e,n){super(e),this.response=n}}class ir extends W{constructor(e,n,s,i){super(e),this.status=n,this.statusText=s,this.errorDetails=i}}class gt extends W{}class or extends W{}/**
|
|
84
76
|
* @license
|
|
85
77
|
* Copyright 2024 Google LLC
|
|
86
78
|
*
|
|
@@ -95,7 +87,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
95
87
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
96
88
|
* See the License for the specific language governing permissions and
|
|
97
89
|
* limitations under the License.
|
|
98
|
-
*/const
|
|
90
|
+
*/const Zu="https://generativelanguage.googleapis.com",Ju="v1beta",Qu="0.24.1",th="genai-js";var St;(function(t){t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.EMBED_CONTENT="embedContent",t.BATCH_EMBED_CONTENTS="batchEmbedContents"})(St||(St={}));class eh{constructor(e,n,s,i,r){this.model=e,this.task=n,this.apiKey=s,this.stream=i,this.requestOptions=r}toString(){var e,n;const s=((e=this.requestOptions)===null||e===void 0?void 0:e.apiVersion)||Ju;let r=`${((n=this.requestOptions)===null||n===void 0?void 0:n.baseUrl)||Zu}/${s}/${this.model}:${this.task}`;return this.stream&&(r+="?alt=sse"),r}}function nh(t){const e=[];return t!=null&&t.apiClient&&e.push(t.apiClient),e.push(`${th}/${Qu}`),e.join(" ")}async function sh(t){var e;const n=new Headers;n.append("Content-Type","application/json"),n.append("x-goog-api-client",nh(t.requestOptions)),n.append("x-goog-api-key",t.apiKey);let s=(e=t.requestOptions)===null||e===void 0?void 0:e.customHeaders;if(s){if(!(s instanceof Headers))try{s=new Headers(s)}catch(i){throw new gt(`unable to convert customHeaders value ${JSON.stringify(s)} to Headers: ${i.message}`)}for(const[i,r]of s.entries()){if(i==="x-goog-api-key")throw new gt(`Cannot set reserved header name ${i}`);if(i==="x-goog-api-client")throw new gt(`Header name ${i} can only be set using the apiClient field`);n.append(i,r)}}return n}async function ih(t,e,n,s,i,r){const o=new eh(t,e,n,s,r);return{url:o.toString(),fetchOptions:Object.assign(Object.assign({},lh(r)),{method:"POST",headers:await sh(o),body:i})}}async function le(t,e,n,s,i,r={},o=fetch){const{url:a,fetchOptions:l}=await ih(t,e,n,s,i,r);return oh(a,l,o)}async function oh(t,e,n=fetch){let s;try{s=await n(t,e)}catch(i){rh(i,t)}return s.ok||await ah(s,t),s}function rh(t,e){let n=t;throw n.name==="AbortError"?(n=new or(`Request aborted when fetching ${e.toString()}: ${t.message}`),n.stack=t.stack):t instanceof ir||t instanceof gt||(n=new W(`Error fetching from ${e.toString()}: ${t.message}`),n.stack=t.stack),n}async function ah(t,e){let n="",s;try{const i=await t.json();n=i.error.message,i.error.details&&(n+=` ${JSON.stringify(i.error.details)}`,s=i.error.details)}catch{}throw new ir(`Error fetching from ${e.toString()}: [${t.status} ${t.statusText}] ${n}`,t.status,t.statusText,s)}function lh(t){const e={};if((t==null?void 0:t.signal)!==void 0||(t==null?void 0:t.timeout)>=0){const n=new AbortController;(t==null?void 0:t.timeout)>=0&&setTimeout(()=>n.abort(),t.timeout),t!=null&&t.signal&&t.signal.addEventListener("abort",()=>{n.abort()}),e.signal=n.signal}return e}/**
|
|
99
91
|
* @license
|
|
100
92
|
* Copyright 2024 Google LLC
|
|
101
93
|
*
|
|
@@ -110,8 +102,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
110
102
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
111
103
|
* See the License for the specific language governing permissions and
|
|
112
104
|
* limitations under the License.
|
|
113
|
-
*/function
|
|
114
|
-
`+
|
|
105
|
+
*/function qn(t){return t.text=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),Ve(t.candidates[0]))throw new Nt(`${yt(t)}`,t);return ch(t)}else if(t.promptFeedback)throw new Nt(`Text not available. ${yt(t)}`,t);return""},t.functionCall=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),Ve(t.candidates[0]))throw new Nt(`${yt(t)}`,t);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),rr(t)[0]}else if(t.promptFeedback)throw new Nt(`Function call not available. ${yt(t)}`,t)},t.functionCalls=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),Ve(t.candidates[0]))throw new Nt(`${yt(t)}`,t);return rr(t)}else if(t.promptFeedback)throw new Nt(`Function call not available. ${yt(t)}`,t)},t}function ch(t){var e,n,s,i;const r=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const o of(i=(s=t.candidates)===null||s===void 0?void 0:s[0].content)===null||i===void 0?void 0:i.parts)o.text&&r.push(o.text),o.executableCode&&r.push("\n```"+o.executableCode.language+`
|
|
106
|
+
`+o.executableCode.code+"\n```\n"),o.codeExecutionResult&&r.push("\n```\n"+o.codeExecutionResult.output+"\n```\n");return r.length>0?r.join(""):""}function rr(t){var e,n,s,i;const r=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const o of(i=(s=t.candidates)===null||s===void 0?void 0:s[0].content)===null||i===void 0?void 0:i.parts)o.functionCall&&r.push(o.functionCall);if(r.length>0)return r}const uh=[ae.RECITATION,ae.SAFETY,ae.LANGUAGE];function Ve(t){return!!t.finishReason&&uh.includes(t.finishReason)}function yt(t){var e,n,s;let i="";if((!t.candidates||t.candidates.length===0)&&t.promptFeedback)i+="Response was blocked",!((e=t.promptFeedback)===null||e===void 0)&&e.blockReason&&(i+=` due to ${t.promptFeedback.blockReason}`),!((n=t.promptFeedback)===null||n===void 0)&&n.blockReasonMessage&&(i+=`: ${t.promptFeedback.blockReasonMessage}`);else if(!((s=t.candidates)===null||s===void 0)&&s[0]){const r=t.candidates[0];Ve(r)&&(i+=`Candidate was blocked due to ${r.finishReason}`,r.finishMessage&&(i+=`: ${r.finishMessage}`))}return i}function ce(t){return this instanceof ce?(this.v=t,this):new ce(t)}function hh(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n.apply(t,e||[]),i,r=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){s[d]&&(i[d]=function(f){return new Promise(function(m,v){r.push([d,f,m,v])>1||a(d,f)})})}function a(d,f){try{l(s[d](f))}catch(m){h(r[0][3],m)}}function l(d){d.value instanceof ce?Promise.resolve(d.value.v).then(u,c):h(r[0][2],d)}function u(d){a("next",d)}function c(d){a("throw",d)}function h(d,f){d(f),r.shift(),r.length&&a(r[0][0],r[0][1])}}typeof SuppressedError=="function"&&SuppressedError;/**
|
|
115
107
|
* @license
|
|
116
108
|
* Copyright 2024 Google LLC
|
|
117
109
|
*
|
|
@@ -126,7 +118,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
126
118
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
127
119
|
* See the License for the specific language governing permissions and
|
|
128
120
|
* limitations under the License.
|
|
129
|
-
*/const
|
|
121
|
+
*/const ar=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function dh(t){const e=t.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),n=ph(e),[s,i]=n.tee();return{stream:mh(s),response:fh(i)}}async function fh(t){const e=[],n=t.getReader();for(;;){const{done:s,value:i}=await n.read();if(s)return qn(gh(e));e.push(i)}}function mh(t){return hh(this,arguments,function*(){const n=t.getReader();for(;;){const{value:s,done:i}=yield ce(n.read());if(i)break;yield yield ce(qn(s))}})}function ph(t){const e=t.getReader();return new ReadableStream({start(s){let i="";return r();function r(){return e.read().then(({value:o,done:a})=>{if(a){if(i.trim()){s.error(new W("Failed to parse stream"));return}s.close();return}i+=o;let l=i.match(ar),u;for(;l;){try{u=JSON.parse(l[1])}catch{s.error(new W(`Error parsing JSON response: "${l[1]}"`));return}s.enqueue(u),i=i.substring(l[0].length),l=i.match(ar)}return r()}).catch(o=>{let a=o;throw a.stack=o.stack,a.name==="AbortError"?a=new or("Request aborted when reading from the stream"):a=new W("Error reading from the stream"),a})}}})}function gh(t){const e=t[t.length-1],n={promptFeedback:e==null?void 0:e.promptFeedback};for(const s of t){if(s.candidates){let i=0;for(const r of s.candidates)if(n.candidates||(n.candidates=[]),n.candidates[i]||(n.candidates[i]={index:i}),n.candidates[i].citationMetadata=r.citationMetadata,n.candidates[i].groundingMetadata=r.groundingMetadata,n.candidates[i].finishReason=r.finishReason,n.candidates[i].finishMessage=r.finishMessage,n.candidates[i].safetyRatings=r.safetyRatings,r.content&&r.content.parts){n.candidates[i].content||(n.candidates[i].content={role:r.content.role||"user",parts:[]});const o={};for(const a of r.content.parts)a.text&&(o.text=a.text),a.functionCall&&(o.functionCall=a.functionCall),a.executableCode&&(o.executableCode=a.executableCode),a.codeExecutionResult&&(o.codeExecutionResult=a.codeExecutionResult),Object.keys(o).length===0&&(o.text=""),n.candidates[i].content.parts.push(o)}i++}s.usageMetadata&&(n.usageMetadata=s.usageMetadata)}return n}/**
|
|
130
122
|
* @license
|
|
131
123
|
* Copyright 2024 Google LLC
|
|
132
124
|
*
|
|
@@ -141,7 +133,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
141
133
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
142
134
|
* See the License for the specific language governing permissions and
|
|
143
135
|
* limitations under the License.
|
|
144
|
-
*/async function
|
|
136
|
+
*/async function lr(t,e,n,s){const i=await le(e,St.STREAM_GENERATE_CONTENT,t,!0,JSON.stringify(n),s);return dh(i)}async function cr(t,e,n,s){const r=await(await le(e,St.GENERATE_CONTENT,t,!1,JSON.stringify(n),s)).json();return{response:qn(r)}}/**
|
|
145
137
|
* @license
|
|
146
138
|
* Copyright 2024 Google LLC
|
|
147
139
|
*
|
|
@@ -156,7 +148,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
156
148
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
157
149
|
* See the License for the specific language governing permissions and
|
|
158
150
|
* limitations under the License.
|
|
159
|
-
*/function
|
|
151
|
+
*/function ur(t){if(t!=null){if(typeof t=="string")return{role:"system",parts:[{text:t}]};if(t.text)return{role:"system",parts:[t]};if(t.parts)return t.role?t:{role:"system",parts:t.parts}}}function ue(t){let e=[];if(typeof t=="string")e=[{text:t}];else for(const n of t)typeof n=="string"?e.push({text:n}):e.push(n);return yh(e)}function yh(t){const e={role:"user",parts:[]},n={role:"function",parts:[]};let s=!1,i=!1;for(const r of t)"functionResponse"in r?(n.parts.push(r),i=!0):(e.parts.push(r),s=!0);if(s&&i)throw new W("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.");if(!s&&!i)throw new W("No content is provided for sending chat message.");return s?e:n}function vh(t,e){var n;let s={model:e==null?void 0:e.model,generationConfig:e==null?void 0:e.generationConfig,safetySettings:e==null?void 0:e.safetySettings,tools:e==null?void 0:e.tools,toolConfig:e==null?void 0:e.toolConfig,systemInstruction:e==null?void 0:e.systemInstruction,cachedContent:(n=e==null?void 0:e.cachedContent)===null||n===void 0?void 0:n.name,contents:[]};const i=t.generateContentRequest!=null;if(t.contents){if(i)throw new gt("CountTokensRequest must have one of contents or generateContentRequest, not both.");s.contents=t.contents}else if(i)s=Object.assign(Object.assign({},s),t.generateContentRequest);else{const r=ue(t);s.contents=[r]}return{generateContentRequest:s}}function hr(t){let e;return t.contents?e=t:e={contents:[ue(t)]},t.systemInstruction&&(e.systemInstruction=ur(t.systemInstruction)),e}function bh(t){return typeof t=="string"||Array.isArray(t)?{content:ue(t)}:t}/**
|
|
160
152
|
* @license
|
|
161
153
|
* Copyright 2024 Google LLC
|
|
162
154
|
*
|
|
@@ -171,7 +163,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
171
163
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
172
164
|
* See the License for the specific language governing permissions and
|
|
173
165
|
* limitations under the License.
|
|
174
|
-
*/const
|
|
166
|
+
*/const dr=["text","inlineData","functionCall","functionResponse","executableCode","codeExecutionResult"],xh={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall","executableCode","codeExecutionResult"],system:["text"]};function wh(t){let e=!1;for(const n of t){const{role:s,parts:i}=n;if(!e&&s!=="user")throw new W(`First content should be with role 'user', got ${s}`);if(!Xo.includes(s))throw new W(`Each item should include role field. Got ${s} but valid roles are: ${JSON.stringify(Xo)}`);if(!Array.isArray(i))throw new W("Content should have 'parts' property with an array of Parts");if(i.length===0)throw new W("Each Content should have at least one part");const r={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(const a of i)for(const l of dr)l in a&&(r[l]+=1);const o=xh[s];for(const a of dr)if(!o.includes(a)&&r[a]>0)throw new W(`Content with role '${s}' can't contain '${a}' part`);e=!0}}function fr(t){var e;if(t.candidates===void 0||t.candidates.length===0)return!1;const n=(e=t.candidates[0])===null||e===void 0?void 0:e.content;if(n===void 0||n.parts===void 0||n.parts.length===0)return!1;for(const s of n.parts)if(s===void 0||Object.keys(s).length===0||s.text!==void 0&&s.text==="")return!1;return!0}/**
|
|
175
167
|
* @license
|
|
176
168
|
* Copyright 2024 Google LLC
|
|
177
169
|
*
|
|
@@ -186,7 +178,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
186
178
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
187
179
|
* See the License for the specific language governing permissions and
|
|
188
180
|
* limitations under the License.
|
|
189
|
-
*/const
|
|
181
|
+
*/const mr="SILENT_ERROR";class Th{constructor(e,n,s,i={}){this.model=n,this.params=s,this._requestOptions=i,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=e,s!=null&&s.history&&(wh(s.history),this._history=s.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,n={}){var s,i,r,o,a,l;await this._sendPromise;const u=ue(e),c={safetySettings:(s=this.params)===null||s===void 0?void 0:s.safetySettings,generationConfig:(i=this.params)===null||i===void 0?void 0:i.generationConfig,tools:(r=this.params)===null||r===void 0?void 0:r.tools,toolConfig:(o=this.params)===null||o===void 0?void 0:o.toolConfig,systemInstruction:(a=this.params)===null||a===void 0?void 0:a.systemInstruction,cachedContent:(l=this.params)===null||l===void 0?void 0:l.cachedContent,contents:[...this._history,u]},h=Object.assign(Object.assign({},this._requestOptions),n);let d;return this._sendPromise=this._sendPromise.then(()=>cr(this._apiKey,this.model,c,h)).then(f=>{var m;if(fr(f.response)){this._history.push(u);const v=Object.assign({parts:[],role:"model"},(m=f.response.candidates)===null||m===void 0?void 0:m[0].content);this._history.push(v)}else{const v=yt(f.response);v&&console.warn(`sendMessage() was unsuccessful. ${v}. Inspect response object for details.`)}d=f}).catch(f=>{throw this._sendPromise=Promise.resolve(),f}),await this._sendPromise,d}async sendMessageStream(e,n={}){var s,i,r,o,a,l;await this._sendPromise;const u=ue(e),c={safetySettings:(s=this.params)===null||s===void 0?void 0:s.safetySettings,generationConfig:(i=this.params)===null||i===void 0?void 0:i.generationConfig,tools:(r=this.params)===null||r===void 0?void 0:r.tools,toolConfig:(o=this.params)===null||o===void 0?void 0:o.toolConfig,systemInstruction:(a=this.params)===null||a===void 0?void 0:a.systemInstruction,cachedContent:(l=this.params)===null||l===void 0?void 0:l.cachedContent,contents:[...this._history,u]},h=Object.assign(Object.assign({},this._requestOptions),n),d=lr(this._apiKey,this.model,c,h);return this._sendPromise=this._sendPromise.then(()=>d).catch(f=>{throw new Error(mr)}).then(f=>f.response).then(f=>{if(fr(f)){this._history.push(u);const m=Object.assign({},f.candidates[0].content);m.role||(m.role="model"),this._history.push(m)}else{const m=yt(f);m&&console.warn(`sendMessageStream() was unsuccessful. ${m}. Inspect response object for details.`)}}).catch(f=>{f.message!==mr&&console.error(f)}),d}}/**
|
|
190
182
|
* @license
|
|
191
183
|
* Copyright 2024 Google LLC
|
|
192
184
|
*
|
|
@@ -201,7 +193,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
201
193
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
194
|
* See the License for the specific language governing permissions and
|
|
203
195
|
* limitations under the License.
|
|
204
|
-
*/async function
|
|
196
|
+
*/async function Ch(t,e,n,s){return(await le(e,St.COUNT_TOKENS,t,!1,JSON.stringify(n),s)).json()}/**
|
|
205
197
|
* @license
|
|
206
198
|
* Copyright 2024 Google LLC
|
|
207
199
|
*
|
|
@@ -216,7 +208,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
216
208
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
217
209
|
* See the License for the specific language governing permissions and
|
|
218
210
|
* limitations under the License.
|
|
219
|
-
*/async function
|
|
211
|
+
*/async function Eh(t,e,n,s){return(await le(e,St.EMBED_CONTENT,t,!1,JSON.stringify(n),s)).json()}async function Sh(t,e,n,s){const i=n.requests.map(o=>Object.assign(Object.assign({},o),{model:e}));return(await le(e,St.BATCH_EMBED_CONTENTS,t,!1,JSON.stringify({requests:i}),s)).json()}/**
|
|
220
212
|
* @license
|
|
221
213
|
* Copyright 2024 Google LLC
|
|
222
214
|
*
|
|
@@ -231,7 +223,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
231
223
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
232
224
|
* See the License for the specific language governing permissions and
|
|
233
225
|
* limitations under the License.
|
|
234
|
-
*/class
|
|
226
|
+
*/class pr{constructor(e,n,s={}){this.apiKey=e,this._requestOptions=s,n.model.includes("/")?this.model=n.model:this.model=`models/${n.model}`,this.generationConfig=n.generationConfig||{},this.safetySettings=n.safetySettings||[],this.tools=n.tools,this.toolConfig=n.toolConfig,this.systemInstruction=ur(n.systemInstruction),this.cachedContent=n.cachedContent}async generateContent(e,n={}){var s;const i=hr(e),r=Object.assign(Object.assign({},this._requestOptions),n);return cr(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(s=this.cachedContent)===null||s===void 0?void 0:s.name},i),r)}async generateContentStream(e,n={}){var s;const i=hr(e),r=Object.assign(Object.assign({},this._requestOptions),n);return lr(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(s=this.cachedContent)===null||s===void 0?void 0:s.name},i),r)}startChat(e){var n;return new Th(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(n=this.cachedContent)===null||n===void 0?void 0:n.name},e),this._requestOptions)}async countTokens(e,n={}){const s=vh(e,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),i=Object.assign(Object.assign({},this._requestOptions),n);return Ch(this.apiKey,this.model,s,i)}async embedContent(e,n={}){const s=bh(e),i=Object.assign(Object.assign({},this._requestOptions),n);return Eh(this.apiKey,this.model,s,i)}async batchEmbedContents(e,n={}){const s=Object.assign(Object.assign({},this._requestOptions),n);return Sh(this.apiKey,this.model,e,s)}}/**
|
|
235
227
|
* @license
|
|
236
228
|
* Copyright 2024 Google LLC
|
|
237
229
|
*
|
|
@@ -246,24 +238,24 @@ React keys must be passed directly to JSX without using spread:
|
|
|
246
238
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
247
239
|
* See the License for the specific language governing permissions and
|
|
248
240
|
* limitations under the License.
|
|
249
|
-
*/class
|
|
250
|
-
${
|
|
241
|
+
*/class Ah{constructor(e){this.apiKey=e}getGenerativeModel(e,n){if(!e.model)throw new W("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");return new pr(this.apiKey,e,n)}getGenerativeModelFromCachedContent(e,n,s){if(!e.name)throw new gt("Cached content must contain a `name` field.");if(!e.model)throw new gt("Cached content must contain a `model` field.");const i=["model","systemInstruction"];for(const o of i)if(n!=null&&n[o]&&e[o]&&(n==null?void 0:n[o])!==e[o]){if(o==="model"){const a=n.model.startsWith("models/")?n.model.replace("models/",""):n.model,l=e.model.startsWith("models/")?e.model.replace("models/",""):e.model;if(a===l)continue}throw new gt(`Different value for "${o}" specified in modelParams (${n[o]}) and cachedContent (${e[o]})`)}const r=Object.assign(Object.assign({},n),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new pr(this.apiKey,r,s)}}const Ph=()=>C.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-full h-full",children:[C.jsx("path",{d:"M12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4Z"}),C.jsx("path",{d:"M16.5 14C16.5 14 15 15.5 12 15.5C9 15.5 7.5 14 7.5 14",strokeLinecap:"round"}),C.jsx("circle",{cx:"9",cy:"10",r:"1",fill:"currentColor"}),C.jsx("circle",{cx:"15",cy:"10",r:"1",fill:"currentColor"})]}),Mh=()=>C.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-full h-full",children:[C.jsx("path",{d:"M12 12C14.2091 12 16 10.2091 16 8C16 5.79086 14.2091 4 12 4C9.79086 4 8 5.79086 8 8C8 10.2091 9.79086 12 12 12Z",strokeLinecap:"round"}),C.jsx("path",{d:"M19.21 17.14C19.21 17.14 19 19 12 19C5 19 4.79 17.14 4.79 17.14C4.79 17.14 6.33 15 12 15C17.67 15 19.21 17.14 19.21 17.14Z",strokeLinecap:"round"})]}),Rh=()=>C.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:[C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.875L6 12z"}),C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12h9"})]}),Dh=()=>C.jsxs("div",{className:"flex items-center space-x-1 p-3",children:[C.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-pulse [animation-delay:-0.3s]"}),C.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-pulse [animation-delay:-0.15s]"}),C.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-pulse"})]}),Vh=t=>{const e=[];if(!t||t.length===0)return e;let s=t.reduce((r,o)=>{const a=r[r.length-1];return a&&a.sender===o.sender?a.text+=`
|
|
242
|
+
${o.text}`:r.push({...o}),r},[]).map(r=>({role:r.sender==="bot"?"model":"user",parts:[{text:r.text}]}));const i=s.findIndex(r=>r.role==="user");if(i>-1)s=s.slice(i);else return[];return s},Oh=({botName:t="ChatBot",botAvatar:e=C.jsx(Ph,{}),userAvatar:n=C.jsx(Mh,{}),welcomeMessage:s="Hello! How can I help?",placeholderText:i="Type a message...",isOpen:r=!1,disabled:o=!1,isTyping:a=!1,onSend:l=()=>{},theme:u={},geminiApiKey:c,messages:h})=>{const[d]=y.useState(()=>`chatbot-instance-${Math.random().toString(36).substring(2,9)}`),[f,m]=y.useState(r),[v,b]=y.useState(()=>s?[{id:1,text:s,sender:"bot"}]:[]),[g,E]=y.useState(""),[w,D]=y.useState(!1),x=typeof h<"u",A=x?h:v,O=x?()=>{}:b,P=y.useRef(null),L=y.useRef(null),B=y.useRef(null),Q=y.useRef(null),lt=y.useMemo(()=>{if(!c)return null;try{return new Ah(c).getGenerativeModel({model:"gemini-2.5-flash"})}catch(T){return console.error("Failed to initialize Gemini:",T),null}},[c]),M=y.useMemo(()=>{var $;const T=(($=u==null?void 0:u.window)==null?void 0:$.placement)==="center",V={launcher:{backgroundColor:"#4f46e5",iconColor:"#ffffff",size:"3.5rem"},header:{backgroundColor:"#4f46e5",textColor:"#ffffff",fontFamily:"inherit",fontWeight:"600"},messages:{userBackgroundColor:"#4f46e5",userTextColor:"#ffffff",botBackgroundColor:"#f3f4f6",botTextColor:"#1f2937",fontFamily:"inherit",fontSize:"0.9rem",showAvatars:!0,bubbleShape:"rounded",bubblePointer:!0},input:{backgroundColor:"#ffffff",textColor:"#1f2937",placeholderTextColor:"#9ca3af",borderColor:"#e5e7eb",focusRingColor:"#4f46e5"},window:{backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:"0.75rem",width:T?"80vw":"22rem",height:T?"80vh":"30rem",placement:"bottom-right",backdrop:!1,backdropColor:"rgba(0, 0, 0, 0.4)",backdropBlur:"4px",scrollbarThumbColor:"#a1a1aa",scrollbarTrackColor:"#f1f5f9"}};return{launcher:{...V.launcher,...u.launcher},header:{...V.header,...u.header},messages:{...V.messages,...u.messages},input:{...V.input,...u.input},window:{...V.window,...u.window}}},[u]),vt=y.useMemo(()=>({"--chatbot-launcher-bg":M.launcher.backgroundColor,"--chatbot-launcher-icon-color":M.launcher.iconColor,"--chatbot-launcher-size":M.launcher.size,"--chatbot-header-bg":M.header.backgroundColor,"--chatbot-header-text-color":M.header.textColor,"--chatbot-header-font-family":M.header.fontFamily,"--chatbot-header-font-weight":M.header.fontWeight,"--chatbot-user-msg-bg":M.messages.userBackgroundColor,"--chatbot-user-msg-text-color":M.messages.userTextColor,"--chatbot-bot-msg-bg":M.messages.botBackgroundColor,"--chatbot-bot-msg-text-color":M.messages.botTextColor,"--chatbot-msg-font-family":M.messages.fontFamily,"--chatbot-msg-font-size":M.messages.fontSize,"--chatbot-input-bg":M.input.backgroundColor,"--chatbot-input-text-color":M.input.textColor,"--chatbot-input-placeholder-color":M.input.placeholderTextColor,"--chatbot-input-border-color":M.input.borderColor,"--chatbot-input-focus-ring":M.input.focusRingColor,"--chatbot-window-bg":M.window.backgroundColor,"--chatbot-window-border-color":M.window.borderColor,"--chatbot-window-border-radius":M.window.borderRadius,"--chatbot-window-width":M.window.width,"--chatbot-window-height":M.window.height}),[M]);y.useEffect(()=>{var ut;const T=M.window.scrollbarThumbColor,V=M.window.scrollbarTrackColor,$=`scrollbar-style-${d}`;(ut=document.getElementById($))==null||ut.remove();const G=document.createElement("style");return G.id=$,G.innerHTML=`
|
|
251
243
|
/* Modern browsers */
|
|
252
|
-
#${
|
|
244
|
+
#${d} .chatbot-message-list {
|
|
253
245
|
scrollbar-width: thin;
|
|
254
|
-
scrollbar-color: ${
|
|
246
|
+
scrollbar-color: ${T} ${V};
|
|
255
247
|
}
|
|
256
248
|
/* WebKit-based browsers (Chrome, Safari, Edge) */
|
|
257
|
-
#${
|
|
249
|
+
#${d} .chatbot-message-list::-webkit-scrollbar {
|
|
258
250
|
width: 8px;
|
|
259
251
|
}
|
|
260
|
-
#${
|
|
261
|
-
background: ${
|
|
252
|
+
#${d} .chatbot-message-list::-webkit-scrollbar-track {
|
|
253
|
+
background: ${V};
|
|
262
254
|
border-radius: 4px;
|
|
263
255
|
}
|
|
264
|
-
#${
|
|
265
|
-
background-color: ${
|
|
256
|
+
#${d} .chatbot-message-list::-webkit-scrollbar-thumb {
|
|
257
|
+
background-color: ${T};
|
|
266
258
|
border-radius: 4px;
|
|
267
|
-
border: 2px solid ${
|
|
259
|
+
border: 2px solid ${V};
|
|
268
260
|
}
|
|
269
|
-
`,document.head.appendChild(
|
|
261
|
+
`,document.head.appendChild(G),()=>{var z;(z=document.getElementById($))==null||z.remove()}},[d,M.window.scrollbarThumbColor,M.window.scrollbarTrackColor]),y.useEffect(()=>{D(a)},[a]),y.useEffect(()=>{var T;(T=L.current)==null||T.scrollIntoView({behavior:"smooth"})},[A,w,a]),y.useEffect(()=>{var T,V;f?(T=P.current)==null||T.focus():(V=B.current)==null||V.focus()},[f]),y.useEffect(()=>{const T=V=>{V.key==="Escape"&&f&&m(!1)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[f]);const At=y.useCallback(async()=>{var G,ut;const T=g.trim();if(!T||o||w||a)return;const V={id:Date.now(),text:T,sender:"user"},$=[...A,V];if(x||O(z=>[...z,V]),l(T),E(""),lt){D(!0);try{const z=Vh($),j=z.slice(0,-1),rt=((ut=(G=z[z.length-1])==null?void 0:G.parts[0])==null?void 0:ut.text)||"",Ih=(await(await lt.startChat({history:j}).sendMessage(rt)).response).text(),kh={id:Date.now()+1,text:Ih,sender:"bot"};O(_h=>[..._h,kh])}catch(z){console.error("Gemini API Error:",z);const j={id:Date.now()+1,text:"Sorry, an error occurred. Please try again.",sender:"bot"};O(rt=>[...rt,j])}finally{D(!1)}}else x||(D(!0),setTimeout(()=>{const z={id:Date.now()+1,text:`You said: "${T}"`,sender:"bot"};O(j=>[...j,z]),D(!1)},800))},[g,o,w,a,l,lt,x,A,O]),he=y.useCallback(T=>{T.key==="Enter"&&At()},[At]),N=T=>typeof T=="string"?C.jsx("img",{src:T,alt:"avatar",className:"w-8 h-8 rounded-full object-cover"}):C.jsx("div",{className:"w-8 h-8 rounded-full text-gray-500",children:T}),Y=w||a,ct={"bottom-right":"bottom-5 right-5","bottom-left":"bottom-5 left-5",center:"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"},p=M.window.placement==="center",R={rounded:"rounded-xl",square:"rounded-md"};return C.jsxs("div",{id:d,style:vt,className:"font-sans",children:[C.jsx(es,{children:!f&&C.jsx(Wo.button,{ref:B,onClick:()=>m(!0),"aria-label":"Open Chat",initial:{scale:0,opacity:0},animate:{scale:1,opacity:1},exit:{scale:0,opacity:0},transition:{duration:.2,ease:"easeOut"},className:"fixed bottom-10 right-10 z-50 rounded-full shadow-lg flex items-center justify-center cursor-pointer border-2 border-white/50 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-[--chatbot-launcher-bg]",style:{backgroundColor:"var(--chatbot-launcher-bg)",color:"var(--chatbot-launcher-icon-color)",width:"var(--chatbot-launcher-size)",height:"var(--chatbot-launcher-size)"},children:C.jsx(yr.FontAwesomeIcon,{icon:vr.faCommentDots})})}),C.jsxs(es,{children:[f&&p&&M.window.backdrop&&C.jsx(Wo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{backgroundColor:M.window.backdropColor,backdropFilter:`blur(${M.window.backdropBlur})`,WebkitBackdropFilter:`blur(${M.window.backdropBlur})`},className:"fixed inset-0 z-40",onClick:()=>m(!1)}),f&&C.jsxs("div",{ref:Q,"aria-modal":"true",role:"dialog",className:`fixed ${ct[M.window.placement]||ct["bottom-right"]} z-50 flex flex-col overflow-hidden shadow-2xl border`,style:{width:"var(--chatbot-window-width)",height:"var(--chatbot-window-height)",borderRadius:"var(--chatbot-window-border-radius)",backgroundColor:"var(--chatbot-window-bg)",borderColor:"var(--chatbot-window-border-color)"},children:[C.jsxs("header",{className:"flex items-center justify-between p-3 flex-shrink-0",style:{background:"var(--chatbot-header-bg)",color:"var(--chatbot-header-text-color)"},children:[C.jsxs("div",{className:"flex items-center space-x-3",children:[C.jsx("div",{className:"w-10 h-10 rounded-full bg-white/30 flex items-center justify-center p-1",children:N(e)}),C.jsx("span",{style:{fontFamily:"var(--chatbot-header-font-family)",fontWeight:"var(--chatbot-header-font-weight)"},className:"text-lg",children:t})]}),C.jsx("button",{onClick:()=>m(!1),"aria-label":"Close Chat",className:"p-1 rounded-full hover:bg-white/20 focus:outline-none focus-visible:ring-2 focus-visible:ring-white",children:C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),C.jsxs("div",{role:"log","aria-live":"polite",className:"chatbot-message-list flex-1 p-4 overflow-y-auto space-y-4",children:[A.map(T=>C.jsxs("div",{className:`flex items-end max-w-[85%] gap-2 ${T.sender==="user"?"ml-auto flex-row-reverse":"mr-auto"}`,children:[M.messages.showAvatars&&C.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 overflow-hidden",children:N(T.sender==="user"?n:e)}),C.jsx("div",{className:`px-3 py-2 ${R[M.messages.bubbleShape]||R.rounded} ${M.messages.bubblePointer?T.sender==="user"?"rounded-br-none":"rounded-bl-none":""}`,style:{backgroundColor:T.sender==="user"?"var(--chatbot-user-msg-bg)":"var(--chatbot-bot-msg-bg)",color:T.sender==="user"?"var(--chatbot-user-msg-text-color)":"var(--chatbot-bot-msg-text-color)",fontFamily:"var(--chatbot-msg-font-family)",fontSize:"var(--chatbot-msg-font-size)"},children:C.jsx("div",{className:"prose prose-sm max-w-none text-inherit prose-p:my-0 prose-headings:my-2 prose-ul:my-1 prose-li:my-0.5",style:{color:"inherit"},children:C.jsx(br,{children:T.text})})})]},T.id)),Y&&C.jsxs("div",{className:"flex items-end max-w-[85%] gap-2 mr-auto",children:[M.messages.showAvatars&&C.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 overflow-hidden",children:N(e)}),C.jsx("div",{className:`px-3 py-2 ${R[M.messages.bubbleShape]||R.rounded} rounded-bl-none`,style:{backgroundColor:"var(--chatbot-bot-msg-bg)"},children:C.jsx(Dh,{})})]}),C.jsx("div",{ref:L})]}),C.jsx("footer",{className:"p-3 border-t flex-shrink-0",style:{borderColor:"var(--chatbot-window-border-color)",backgroundColor:"var(--chatbot-input-bg)"},children:C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsx("input",{ref:P,type:"text",value:g,onChange:T=>E(T.target.value),onKeyPress:he,placeholder:i,disabled:o||Y,"aria-label":"Chat input",className:"flex-1 w-full px-4 py-2 bg-transparent rounded-full border focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:opacity-60",style:{color:"var(--chatbot-input-text-color)",borderColor:"var(--chatbot-input-border-color)","--tw-ring-color":"var(--chatbot-input-focus-ring)"}}),C.jsx("button",{onClick:At,disabled:!g.trim()||o||Y,"aria-label":"Send Message",className:"px-4 h-10 rounded-full flex items-center justify-center flex-shrink-0 font-semibold text-sm transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",style:{backgroundColor:"var(--chatbot-user-msg-bg)",color:"var(--chatbot-user-msg-text-color)","--tw-ring-color":"var(--chatbot-user-msg-bg)"},children:C.jsx(Rh,{})})]})})]})]})]})};nt.ChatBot=Oh,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});
|