@gauravrathod674/super-customizable-chatbot 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,269 @@
1
+ (function(ut,v){typeof exports=="object"&&typeof module<"u"?v(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"],v):(ut=typeof globalThis<"u"?globalThis:ut||self,v(ut.CustomChatBot={},ut.React,ut.reactFontawesome,ut.freeSolidSvgIcons,ut.ReactMarkdown))})(this,function(ut,v,ia,ra,oa){"use strict";function aa(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 Je=aa(v);var Qe={exports:{}},ee={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Cs;function la(){if(Cs)return ee;Cs=1;var t=v,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function r(a,l,u){var c,f={},h=null,p=null;u!==void 0&&(h=""+u),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(p=l.ref);for(c in l)s.call(l,c)&&!o.hasOwnProperty(c)&&(f[c]=l[c]);if(a&&a.defaultProps)for(c in l=a.defaultProps,l)f[c]===void 0&&(f[c]=l[c]);return{$$typeof:e,type:a,key:h,ref:p,props:f,_owner:i.current}}return ee.Fragment=n,ee.jsx=r,ee.jsxs=r,ee}var ne={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Es;function ca(){return Es||(Es=1,process.env.NODE_ENV!=="production"&&function(){var t=v,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator,b="@@iterator";function T(d){if(d===null||typeof d!="object")return null;var g=m&&d[m]||d[b];return typeof g=="function"?g:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(d){{for(var g=arguments.length,w=new Array(g>1?g-1:0),D=1;D<g;D++)w[D-1]=arguments[D];E("error",d,w)}}function E(d,g,w){{var D=y.ReactDebugCurrentFrame,L=D.getStackAddendum();L!==""&&(g+="%s",w=w.concat([L]));var j=w.map(function(_){return String(_)});j.unshift("Warning: "+g),Function.prototype.apply.call(console[d],console,j)}}var V=!1,C=!1,R=!1,k=!1,M=!1,U;U=Symbol.for("react.module.reference");function Y(d){return!!(typeof d=="string"||typeof d=="function"||d===s||d===o||M||d===i||d===u||d===c||k||d===p||V||C||R||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===r||d.$$typeof===a||d.$$typeof===l||d.$$typeof===U||d.getModuleId!==void 0))}function pt(d,g,w){var D=d.displayName;if(D)return D;var L=g.displayName||g.name||"";return L!==""?w+"("+L+")":w}function bt(d){return d.displayName||"Context"}function P(d){if(d==null)return null;if(typeof d.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d;switch(d){case s:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case a:var g=d;return bt(g)+".Consumer";case r:var w=d;return bt(w._context)+".Provider";case l:return pt(d,d.render,"ForwardRef");case f:var D=d.displayName||null;return D!==null?D:P(d.type)||"Memo";case h:{var L=d,j=L._payload,_=L._init;try{return P(_(j))}catch{return null}}}return null}var ot=Object.assign,mt=0,Re,$,J,xt,Mt,Nt,O;function W(){}W.__reactDisabledLog=!0;function gt(){{if(mt===0){Re=console.log,$=console.info,J=console.warn,xt=console.error,Mt=console.group,Nt=console.groupCollapsed,O=console.groupEnd;var d={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}mt++}}function Dt(){{if(mt--,mt===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ot({},d,{value:Re}),info:ot({},d,{value:$}),warn:ot({},d,{value:J}),error:ot({},d,{value:xt}),group:ot({},d,{value:Mt}),groupCollapsed:ot({},d,{value:Nt}),groupEnd:ot({},d,{value:O})})}mt<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var wt=y.ReactCurrentDispatcher,Q;function yt(d,g,w){{if(Q===void 0)try{throw Error()}catch(L){var D=L.stack.trim().match(/\n( *(at )?)/);Q=D&&D[1]||""}return`
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:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,Ts,Bt,Ud,Bt),na[Bt+Ts]=!0}}return d===s?Ld(H):kd(H),H}}function jd(d,g,w){return sa(d,g,w,!0)}function Nd(d,g,w){return sa(d,g,w,!1)}var Fd=Nd,Bd=jd;ne.Fragment=s,ne.jsx=Fd,ne.jsxs=Bd}()),ne}process.env.NODE_ENV==="production"?Qe.exports=la():Qe.exports=ca();var S=Qe.exports;const tn=v.createContext({});function en(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const nn=typeof window<"u",Ss=nn?v.useLayoutEffect:v.useEffect,Oe=v.createContext(null),sn=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class ua extends Je.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,o=this.props.sizeRef.current;o.height=n.offsetHeight||0,o.width=n.offsetWidth||0,o.top=n.offsetTop,o.left=n.offsetLeft,o.right=i-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function fa({children:t,isPresent:e,anchorX:n}){const s=v.useId(),i=v.useRef(null),o=v.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:r}=v.useContext(sn);return v.useInsertionEffect(()=>{const{width:a,height:l,top:u,left:c,right:f}=o.current;if(e||!i.current||!a||!l)return;const h=n==="left"?`left: ${c}`:`right: ${f}`;i.current.dataset.motionPopId=s;const p=document.createElement("style");return r&&(p.nonce=r),document.head.appendChild(p),p.sheet&&p.sheet.insertRule(`
31
+ [data-motion-pop-id="${s}"] {
32
+ position: absolute !important;
33
+ width: ${a}px !important;
34
+ height: ${l}px !important;
35
+ ${h}px !important;
36
+ top: ${u}px !important;
37
+ }
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={}));/**
39
+ * @license
40
+ * Copyright 2024 Google LLC
41
+ *
42
+ * Licensed under the Apache License, Version 2.0 (the "License");
43
+ * you may not use this file except in compliance with the License.
44
+ * You may obtain a copy of the License at
45
+ *
46
+ * http://www.apache.org/licenses/LICENSE-2.0
47
+ *
48
+ * Unless required by applicable law or agreed to in writing, software
49
+ * distributed under the License is distributed on an "AS IS" BASIS,
50
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
51
+ * See the License for the specific language governing permissions and
52
+ * limitations under the License.
53
+ */var wo;(function(t){t.LANGUAGE_UNSPECIFIED="language_unspecified",t.PYTHON="python"})(wo||(wo={}));var To;(function(t){t.OUTCOME_UNSPECIFIED="outcome_unspecified",t.OUTCOME_OK="outcome_ok",t.OUTCOME_FAILED="outcome_failed",t.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(To||(To={}));/**
54
+ * @license
55
+ * Copyright 2024 Google LLC
56
+ *
57
+ * Licensed under the Apache License, Version 2.0 (the "License");
58
+ * you may not use this file except in compliance with the License.
59
+ * You may obtain a copy of the License at
60
+ *
61
+ * http://www.apache.org/licenses/LICENSE-2.0
62
+ *
63
+ * Unless required by applicable law or agreed to in writing, software
64
+ * distributed under the License is distributed on an "AS IS" BASIS,
65
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
66
+ * See the License for the specific language governing permissions and
67
+ * limitations under the License.
68
+ */const Co=["user","model","function","system"];var Eo;(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"})(Eo||(Eo={}));var So;(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"})(So||(So={}));var Ao;(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(Ao||(Ao={}));var Po;(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER"})(Po||(Po={}));var Ee;(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"})(Ee||(Ee={}));var Ro;(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"})(Ro||(Ro={}));var Mo;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(Mo||(Mo={}));var Do;(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(Do||(Do={}));/**
69
+ * @license
70
+ * Copyright 2024 Google LLC
71
+ *
72
+ * Licensed under the Apache License, Version 2.0 (the "License");
73
+ * you may not use this file except in compliance with the License.
74
+ * You may obtain a copy of the License at
75
+ *
76
+ * http://www.apache.org/licenses/LICENSE-2.0
77
+ *
78
+ * Unless required by applicable law or agreed to in writing, software
79
+ * distributed under the License is distributed on an "AS IS" BASIS,
80
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
81
+ * See the License for the specific language governing permissions and
82
+ * limitations under the License.
83
+ */class Z extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}}class Zt extends Z{constructor(e,n){super(e),this.response=n}}class Oo extends Z{constructor(e,n,s,i){super(e),this.status=n,this.statusText=s,this.errorDetails=i}}class Pt extends Z{}class Vo extends Z{}/**
84
+ * @license
85
+ * Copyright 2024 Google LLC
86
+ *
87
+ * Licensed under the Apache License, Version 2.0 (the "License");
88
+ * you may not use this file except in compliance with the License.
89
+ * You may obtain a copy of the License at
90
+ *
91
+ * http://www.apache.org/licenses/LICENSE-2.0
92
+ *
93
+ * Unless required by applicable law or agreed to in writing, software
94
+ * distributed under the License is distributed on an "AS IS" BASIS,
95
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96
+ * See the License for the specific language governing permissions and
97
+ * limitations under the License.
98
+ */const Ff="https://generativelanguage.googleapis.com",Bf="v1beta",Uf="0.24.1",$f="genai-js";var jt;(function(t){t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.EMBED_CONTENT="embedContent",t.BATCH_EMBED_CONTENTS="batchEmbedContents"})(jt||(jt={}));class Gf{constructor(e,n,s,i,o){this.model=e,this.task=n,this.apiKey=s,this.stream=i,this.requestOptions=o}toString(){var e,n;const s=((e=this.requestOptions)===null||e===void 0?void 0:e.apiVersion)||Bf;let o=`${((n=this.requestOptions)===null||n===void 0?void 0:n.baseUrl)||Ff}/${s}/${this.model}:${this.task}`;return this.stream&&(o+="?alt=sse"),o}}function Kf(t){const e=[];return t!=null&&t.apiClient&&e.push(t.apiClient),e.push(`${$f}/${Uf}`),e.join(" ")}async function Wf(t){var e;const n=new Headers;n.append("Content-Type","application/json"),n.append("x-goog-api-client",Kf(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 Pt(`unable to convert customHeaders value ${JSON.stringify(s)} to Headers: ${i.message}`)}for(const[i,o]of s.entries()){if(i==="x-goog-api-key")throw new Pt(`Cannot set reserved header name ${i}`);if(i==="x-goog-api-client")throw new Pt(`Header name ${i} can only be set using the apiClient field`);n.append(i,o)}}return n}async function Hf(t,e,n,s,i,o){const r=new Gf(t,e,n,s,o);return{url:r.toString(),fetchOptions:Object.assign(Object.assign({},Xf(o)),{method:"POST",headers:await Wf(r),body:i})}}async function Se(t,e,n,s,i,o={},r=fetch){const{url:a,fetchOptions:l}=await Hf(t,e,n,s,i,o);return Yf(a,l,r)}async function Yf(t,e,n=fetch){let s;try{s=await n(t,e)}catch(i){zf(i,t)}return s.ok||await qf(s,t),s}function zf(t,e){let n=t;throw n.name==="AbortError"?(n=new Vo(`Request aborted when fetching ${e.toString()}: ${t.message}`),n.stack=t.stack):t instanceof Oo||t instanceof Pt||(n=new Z(`Error fetching from ${e.toString()}: ${t.message}`),n.stack=t.stack),n}async function qf(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 Oo(`Error fetching from ${e.toString()}: [${t.status} ${t.statusText}] ${n}`,t.status,t.statusText,s)}function Xf(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
+ * @license
100
+ * Copyright 2024 Google LLC
101
+ *
102
+ * Licensed under the Apache License, Version 2.0 (the "License");
103
+ * you may not use this file except in compliance with the License.
104
+ * You may obtain a copy of the License at
105
+ *
106
+ * http://www.apache.org/licenses/LICENSE-2.0
107
+ *
108
+ * Unless required by applicable law or agreed to in writing, software
109
+ * distributed under the License is distributed on an "AS IS" BASIS,
110
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111
+ * See the License for the specific language governing permissions and
112
+ * limitations under the License.
113
+ */function ps(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.`),Xe(t.candidates[0]))throw new Zt(`${Rt(t)}`,t);return Zf(t)}else if(t.promptFeedback)throw new Zt(`Text not available. ${Rt(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.`),Xe(t.candidates[0]))throw new Zt(`${Rt(t)}`,t);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),Io(t)[0]}else if(t.promptFeedback)throw new Zt(`Function call not available. ${Rt(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.`),Xe(t.candidates[0]))throw new Zt(`${Rt(t)}`,t);return Io(t)}else if(t.promptFeedback)throw new Zt(`Function call not available. ${Rt(t)}`,t)},t}function Zf(t){var e,n,s,i;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const r of(i=(s=t.candidates)===null||s===void 0?void 0:s[0].content)===null||i===void 0?void 0:i.parts)r.text&&o.push(r.text),r.executableCode&&o.push("\n```"+r.executableCode.language+`
114
+ `+r.executableCode.code+"\n```\n"),r.codeExecutionResult&&o.push("\n```\n"+r.codeExecutionResult.output+"\n```\n");return o.length>0?o.join(""):""}function Io(t){var e,n,s,i;const o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(const r of(i=(s=t.candidates)===null||s===void 0?void 0:s[0].content)===null||i===void 0?void 0:i.parts)r.functionCall&&o.push(r.functionCall);if(o.length>0)return o}const Jf=[Ee.RECITATION,Ee.SAFETY,Ee.LANGUAGE];function Xe(t){return!!t.finishReason&&Jf.includes(t.finishReason)}function Rt(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 o=t.candidates[0];Xe(o)&&(i+=`Candidate was blocked due to ${o.finishReason}`,o.finishMessage&&(i+=`: ${o.finishMessage}`))}return i}function Ae(t){return this instanceof Ae?(this.v=t,this):new Ae(t)}function Qf(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n.apply(t,e||[]),i,o=[];return i={},r("next"),r("throw"),r("return"),i[Symbol.asyncIterator]=function(){return this},i;function r(h){s[h]&&(i[h]=function(p){return new Promise(function(m,b){o.push([h,p,m,b])>1||a(h,p)})})}function a(h,p){try{l(s[h](p))}catch(m){f(o[0][3],m)}}function l(h){h.value instanceof Ae?Promise.resolve(h.value.v).then(u,c):f(o[0][2],h)}function u(h){a("next",h)}function c(h){a("throw",h)}function f(h,p){h(p),o.shift(),o.length&&a(o[0][0],o[0][1])}}typeof SuppressedError=="function"&&SuppressedError;/**
115
+ * @license
116
+ * Copyright 2024 Google LLC
117
+ *
118
+ * Licensed under the Apache License, Version 2.0 (the "License");
119
+ * you may not use this file except in compliance with the License.
120
+ * You may obtain a copy of the License at
121
+ *
122
+ * http://www.apache.org/licenses/LICENSE-2.0
123
+ *
124
+ * Unless required by applicable law or agreed to in writing, software
125
+ * distributed under the License is distributed on an "AS IS" BASIS,
126
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127
+ * See the License for the specific language governing permissions and
128
+ * limitations under the License.
129
+ */const _o=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function td(t){const e=t.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),n=sd(e),[s,i]=n.tee();return{stream:nd(s),response:ed(i)}}async function ed(t){const e=[],n=t.getReader();for(;;){const{done:s,value:i}=await n.read();if(s)return ps(id(e));e.push(i)}}function nd(t){return Qf(this,arguments,function*(){const n=t.getReader();for(;;){const{value:s,done:i}=yield Ae(n.read());if(i)break;yield yield Ae(ps(s))}})}function sd(t){const e=t.getReader();return new ReadableStream({start(s){let i="";return o();function o(){return e.read().then(({value:r,done:a})=>{if(a){if(i.trim()){s.error(new Z("Failed to parse stream"));return}s.close();return}i+=r;let l=i.match(_o),u;for(;l;){try{u=JSON.parse(l[1])}catch{s.error(new Z(`Error parsing JSON response: "${l[1]}"`));return}s.enqueue(u),i=i.substring(l[0].length),l=i.match(_o)}return o()}).catch(r=>{let a=r;throw a.stack=r.stack,a.name==="AbortError"?a=new Vo("Request aborted when reading from the stream"):a=new Z("Error reading from the stream"),a})}}})}function id(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 o of s.candidates)if(n.candidates||(n.candidates=[]),n.candidates[i]||(n.candidates[i]={index:i}),n.candidates[i].citationMetadata=o.citationMetadata,n.candidates[i].groundingMetadata=o.groundingMetadata,n.candidates[i].finishReason=o.finishReason,n.candidates[i].finishMessage=o.finishMessage,n.candidates[i].safetyRatings=o.safetyRatings,o.content&&o.content.parts){n.candidates[i].content||(n.candidates[i].content={role:o.content.role||"user",parts:[]});const r={};for(const a of o.content.parts)a.text&&(r.text=a.text),a.functionCall&&(r.functionCall=a.functionCall),a.executableCode&&(r.executableCode=a.executableCode),a.codeExecutionResult&&(r.codeExecutionResult=a.codeExecutionResult),Object.keys(r).length===0&&(r.text=""),n.candidates[i].content.parts.push(r)}i++}s.usageMetadata&&(n.usageMetadata=s.usageMetadata)}return n}/**
130
+ * @license
131
+ * Copyright 2024 Google LLC
132
+ *
133
+ * Licensed under the Apache License, Version 2.0 (the "License");
134
+ * you may not use this file except in compliance with the License.
135
+ * You may obtain a copy of the License at
136
+ *
137
+ * http://www.apache.org/licenses/LICENSE-2.0
138
+ *
139
+ * Unless required by applicable law or agreed to in writing, software
140
+ * distributed under the License is distributed on an "AS IS" BASIS,
141
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
142
+ * See the License for the specific language governing permissions and
143
+ * limitations under the License.
144
+ */async function ko(t,e,n,s){const i=await Se(e,jt.STREAM_GENERATE_CONTENT,t,!0,JSON.stringify(n),s);return td(i)}async function Lo(t,e,n,s){const o=await(await Se(e,jt.GENERATE_CONTENT,t,!1,JSON.stringify(n),s)).json();return{response:ps(o)}}/**
145
+ * @license
146
+ * Copyright 2024 Google LLC
147
+ *
148
+ * Licensed under the Apache License, Version 2.0 (the "License");
149
+ * you may not use this file except in compliance with the License.
150
+ * You may obtain a copy of the License at
151
+ *
152
+ * http://www.apache.org/licenses/LICENSE-2.0
153
+ *
154
+ * Unless required by applicable law or agreed to in writing, software
155
+ * distributed under the License is distributed on an "AS IS" BASIS,
156
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
157
+ * See the License for the specific language governing permissions and
158
+ * limitations under the License.
159
+ */function jo(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 Pe(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 rd(e)}function rd(t){const e={role:"user",parts:[]},n={role:"function",parts:[]};let s=!1,i=!1;for(const o of t)"functionResponse"in o?(n.parts.push(o),i=!0):(e.parts.push(o),s=!0);if(s&&i)throw new Z("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 Z("No content is provided for sending chat message.");return s?e:n}function od(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 Pt("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 o=Pe(t);s.contents=[o]}return{generateContentRequest:s}}function No(t){let e;return t.contents?e=t:e={contents:[Pe(t)]},t.systemInstruction&&(e.systemInstruction=jo(t.systemInstruction)),e}function ad(t){return typeof t=="string"||Array.isArray(t)?{content:Pe(t)}:t}/**
160
+ * @license
161
+ * Copyright 2024 Google LLC
162
+ *
163
+ * Licensed under the Apache License, Version 2.0 (the "License");
164
+ * you may not use this file except in compliance with the License.
165
+ * You may obtain a copy of the License at
166
+ *
167
+ * http://www.apache.org/licenses/LICENSE-2.0
168
+ *
169
+ * Unless required by applicable law or agreed to in writing, software
170
+ * distributed under the License is distributed on an "AS IS" BASIS,
171
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
172
+ * See the License for the specific language governing permissions and
173
+ * limitations under the License.
174
+ */const Fo=["text","inlineData","functionCall","functionResponse","executableCode","codeExecutionResult"],ld={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall","executableCode","codeExecutionResult"],system:["text"]};function cd(t){let e=!1;for(const n of t){const{role:s,parts:i}=n;if(!e&&s!=="user")throw new Z(`First content should be with role 'user', got ${s}`);if(!Co.includes(s))throw new Z(`Each item should include role field. Got ${s} but valid roles are: ${JSON.stringify(Co)}`);if(!Array.isArray(i))throw new Z("Content should have 'parts' property with an array of Parts");if(i.length===0)throw new Z("Each Content should have at least one part");const o={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(const a of i)for(const l of Fo)l in a&&(o[l]+=1);const r=ld[s];for(const a of Fo)if(!r.includes(a)&&o[a]>0)throw new Z(`Content with role '${s}' can't contain '${a}' part`);e=!0}}function Bo(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
+ * @license
176
+ * Copyright 2024 Google LLC
177
+ *
178
+ * Licensed under the Apache License, Version 2.0 (the "License");
179
+ * you may not use this file except in compliance with the License.
180
+ * You may obtain a copy of the License at
181
+ *
182
+ * http://www.apache.org/licenses/LICENSE-2.0
183
+ *
184
+ * Unless required by applicable law or agreed to in writing, software
185
+ * distributed under the License is distributed on an "AS IS" BASIS,
186
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
187
+ * See the License for the specific language governing permissions and
188
+ * limitations under the License.
189
+ */const Uo="SILENT_ERROR";class ud{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&&(cd(s.history),this._history=s.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,n={}){var s,i,o,r,a,l;await this._sendPromise;const u=Pe(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:(o=this.params)===null||o===void 0?void 0:o.tools,toolConfig:(r=this.params)===null||r===void 0?void 0:r.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]},f=Object.assign(Object.assign({},this._requestOptions),n);let h;return this._sendPromise=this._sendPromise.then(()=>Lo(this._apiKey,this.model,c,f)).then(p=>{var m;if(Bo(p.response)){this._history.push(u);const b=Object.assign({parts:[],role:"model"},(m=p.response.candidates)===null||m===void 0?void 0:m[0].content);this._history.push(b)}else{const b=Rt(p.response);b&&console.warn(`sendMessage() was unsuccessful. ${b}. Inspect response object for details.`)}h=p}).catch(p=>{throw this._sendPromise=Promise.resolve(),p}),await this._sendPromise,h}async sendMessageStream(e,n={}){var s,i,o,r,a,l;await this._sendPromise;const u=Pe(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:(o=this.params)===null||o===void 0?void 0:o.tools,toolConfig:(r=this.params)===null||r===void 0?void 0:r.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]},f=Object.assign(Object.assign({},this._requestOptions),n),h=ko(this._apiKey,this.model,c,f);return this._sendPromise=this._sendPromise.then(()=>h).catch(p=>{throw new Error(Uo)}).then(p=>p.response).then(p=>{if(Bo(p)){this._history.push(u);const m=Object.assign({},p.candidates[0].content);m.role||(m.role="model"),this._history.push(m)}else{const m=Rt(p);m&&console.warn(`sendMessageStream() was unsuccessful. ${m}. Inspect response object for details.`)}}).catch(p=>{p.message!==Uo&&console.error(p)}),h}}/**
190
+ * @license
191
+ * Copyright 2024 Google LLC
192
+ *
193
+ * Licensed under the Apache License, Version 2.0 (the "License");
194
+ * you may not use this file except in compliance with the License.
195
+ * You may obtain a copy of the License at
196
+ *
197
+ * http://www.apache.org/licenses/LICENSE-2.0
198
+ *
199
+ * Unless required by applicable law or agreed to in writing, software
200
+ * distributed under the License is distributed on an "AS IS" BASIS,
201
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ * See the License for the specific language governing permissions and
203
+ * limitations under the License.
204
+ */async function fd(t,e,n,s){return(await Se(e,jt.COUNT_TOKENS,t,!1,JSON.stringify(n),s)).json()}/**
205
+ * @license
206
+ * Copyright 2024 Google LLC
207
+ *
208
+ * Licensed under the Apache License, Version 2.0 (the "License");
209
+ * you may not use this file except in compliance with the License.
210
+ * You may obtain a copy of the License at
211
+ *
212
+ * http://www.apache.org/licenses/LICENSE-2.0
213
+ *
214
+ * Unless required by applicable law or agreed to in writing, software
215
+ * distributed under the License is distributed on an "AS IS" BASIS,
216
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
217
+ * See the License for the specific language governing permissions and
218
+ * limitations under the License.
219
+ */async function dd(t,e,n,s){return(await Se(e,jt.EMBED_CONTENT,t,!1,JSON.stringify(n),s)).json()}async function hd(t,e,n,s){const i=n.requests.map(r=>Object.assign(Object.assign({},r),{model:e}));return(await Se(e,jt.BATCH_EMBED_CONTENTS,t,!1,JSON.stringify({requests:i}),s)).json()}/**
220
+ * @license
221
+ * Copyright 2024 Google LLC
222
+ *
223
+ * Licensed under the Apache License, Version 2.0 (the "License");
224
+ * you may not use this file except in compliance with the License.
225
+ * You may obtain a copy of the License at
226
+ *
227
+ * http://www.apache.org/licenses/LICENSE-2.0
228
+ *
229
+ * Unless required by applicable law or agreed to in writing, software
230
+ * distributed under the License is distributed on an "AS IS" BASIS,
231
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
232
+ * See the License for the specific language governing permissions and
233
+ * limitations under the License.
234
+ */class $o{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=jo(n.systemInstruction),this.cachedContent=n.cachedContent}async generateContent(e,n={}){var s;const i=No(e),o=Object.assign(Object.assign({},this._requestOptions),n);return Lo(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),o)}async generateContentStream(e,n={}){var s;const i=No(e),o=Object.assign(Object.assign({},this._requestOptions),n);return ko(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),o)}startChat(e){var n;return new ud(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=od(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 fd(this.apiKey,this.model,s,i)}async embedContent(e,n={}){const s=ad(e),i=Object.assign(Object.assign({},this._requestOptions),n);return dd(this.apiKey,this.model,s,i)}async batchEmbedContents(e,n={}){const s=Object.assign(Object.assign({},this._requestOptions),n);return hd(this.apiKey,this.model,e,s)}}/**
235
+ * @license
236
+ * Copyright 2024 Google LLC
237
+ *
238
+ * Licensed under the Apache License, Version 2.0 (the "License");
239
+ * you may not use this file except in compliance with the License.
240
+ * You may obtain a copy of the License at
241
+ *
242
+ * http://www.apache.org/licenses/LICENSE-2.0
243
+ *
244
+ * Unless required by applicable law or agreed to in writing, software
245
+ * distributed under the License is distributed on an "AS IS" BASIS,
246
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
247
+ * See the License for the specific language governing permissions and
248
+ * limitations under the License.
249
+ */class pd{constructor(e){this.apiKey=e}getGenerativeModel(e,n){if(!e.model)throw new Z("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");return new $o(this.apiKey,e,n)}getGenerativeModelFromCachedContent(e,n,s){if(!e.name)throw new Pt("Cached content must contain a `name` field.");if(!e.model)throw new Pt("Cached content must contain a `model` field.");const i=["model","systemInstruction"];for(const r of i)if(n!=null&&n[r]&&e[r]&&(n==null?void 0:n[r])!==e[r]){if(r==="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 Pt(`Different value for "${r}" specified in modelParams (${n[r]}) and cachedContent (${e[r]})`)}const o=Object.assign(Object.assign({},n),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new $o(this.apiKey,o,s)}}const md=()=>S.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-full h-full",children:[S.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"}),S.jsx("path",{d:"M16.5 14C16.5 14 15 15.5 12 15.5C9 15.5 7.5 14 7.5 14",strokeLinecap:"round"}),S.jsx("circle",{cx:"9",cy:"10",r:"1",fill:"currentColor"}),S.jsx("circle",{cx:"15",cy:"10",r:"1",fill:"currentColor"})]}),gd=()=>S.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-full h-full",children:[S.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"}),S.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"})]}),yd=()=>S.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5",children:[S.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"}),S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12h9"})]}),vd=()=>S.jsxs("div",{className:"flex items-center space-x-1 p-3",children:[S.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-pulse [animation-delay:-0.3s]"}),S.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-pulse [animation-delay:-0.15s]"}),S.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-pulse"})]}),bd=t=>{const e=[];if(!t||t.length===0)return e;let s=t.reduce((o,r)=>{const a=o[o.length-1];return a&&a.sender===r.sender?a.text+=`
250
+ ${r.text}`:o.push({...r}),o},[]).map(o=>({role:o.sender==="bot"?"model":"user",parts:[{text:o.text}]}));const i=s.findIndex(o=>o.role==="user");if(i>-1)s=s.slice(i);else return[];return s},xd=({botName:t="ChatBot",botAvatar:e=S.jsx(md,{}),userAvatar:n=S.jsx(gd,{}),welcomeMessage:s="Hello! How can I help?",placeholderText:i="Type a message...",isOpen:o=!1,disabled:r=!1,isTyping:a=!1,onSend:l=()=>{},theme:u={},geminiApiKey:c,messages:f})=>{const[h]=v.useState(()=>`chatbot-instance-${Math.random().toString(36).substring(2,9)}`),[p,m]=v.useState(o),[b,T]=v.useState(()=>s?[{id:1,text:s,sender:"bot"}]:[]),[y,x]=v.useState(""),[E,V]=v.useState(!1),C=typeof f<"u",R=C?f:b,k=C?()=>{}:T,M=v.useRef(null),U=v.useRef(null),Y=v.useRef(null),pt=v.useRef(null),bt=v.useMemo(()=>{if(!c)return null;try{return new pd(c).getGenerativeModel({model:"gemini-2.5-flash"})}catch(O){return console.error("Failed to initialize Gemini:",O),null}},[c]),P=v.useMemo(()=>{var gt;const O=((gt=u==null?void 0:u.window)==null?void 0:gt.placement)==="center",W={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:O?"80vw":"22rem",height:O?"80vh":"30rem",placement:"bottom-right",backdrop:!1,backdropColor:"rgba(0, 0, 0, 0.4)",backdropBlur:"4px",scrollbarThumbColor:"#a1a1aa",scrollbarTrackColor:"#f1f5f9"}};return{launcher:{...W.launcher,...u.launcher},header:{...W.header,...u.header},messages:{...W.messages,...u.messages},input:{...W.input,...u.input},window:{...W.window,...u.window}}},[u]),ot=v.useMemo(()=>({"--chatbot-launcher-bg":P.launcher.backgroundColor,"--chatbot-launcher-icon-color":P.launcher.iconColor,"--chatbot-launcher-size":P.launcher.size,"--chatbot-header-bg":P.header.backgroundColor,"--chatbot-header-text-color":P.header.textColor,"--chatbot-header-font-family":P.header.fontFamily,"--chatbot-header-font-weight":P.header.fontWeight,"--chatbot-user-msg-bg":P.messages.userBackgroundColor,"--chatbot-user-msg-text-color":P.messages.userTextColor,"--chatbot-bot-msg-bg":P.messages.botBackgroundColor,"--chatbot-bot-msg-text-color":P.messages.botTextColor,"--chatbot-msg-font-family":P.messages.fontFamily,"--chatbot-msg-font-size":P.messages.fontSize,"--chatbot-input-bg":P.input.backgroundColor,"--chatbot-input-text-color":P.input.textColor,"--chatbot-input-placeholder-color":P.input.placeholderTextColor,"--chatbot-input-border-color":P.input.borderColor,"--chatbot-input-focus-ring":P.input.focusRingColor,"--chatbot-window-bg":P.window.backgroundColor,"--chatbot-window-border-color":P.window.borderColor,"--chatbot-window-border-radius":P.window.borderRadius,"--chatbot-window-width":P.window.width,"--chatbot-window-height":P.window.height}),[P]);v.useEffect(()=>{var wt;const O=P.window.scrollbarThumbColor,W=P.window.scrollbarTrackColor,gt=`scrollbar-style-${h}`;(wt=document.getElementById(gt))==null||wt.remove();const Dt=document.createElement("style");return Dt.id=gt,Dt.innerHTML=`
251
+ /* Modern browsers */
252
+ #${h} .chatbot-message-list {
253
+ scrollbar-width: thin;
254
+ scrollbar-color: ${O} ${W};
255
+ }
256
+ /* WebKit-based browsers (Chrome, Safari, Edge) */
257
+ #${h} .chatbot-message-list::-webkit-scrollbar {
258
+ width: 8px;
259
+ }
260
+ #${h} .chatbot-message-list::-webkit-scrollbar-track {
261
+ background: ${W};
262
+ border-radius: 4px;
263
+ }
264
+ #${h} .chatbot-message-list::-webkit-scrollbar-thumb {
265
+ background-color: ${O};
266
+ border-radius: 4px;
267
+ border: 2px solid ${W};
268
+ }
269
+ `,document.head.appendChild(Dt),()=>{var Q;(Q=document.getElementById(gt))==null||Q.remove()}},[h,P.window.scrollbarThumbColor,P.window.scrollbarTrackColor]),v.useEffect(()=>{V(a)},[a]),v.useEffect(()=>{var O;(O=U.current)==null||O.scrollIntoView({behavior:"smooth"})},[R,E,a]),v.useEffect(()=>{var O,W;p?(O=M.current)==null||O.focus():(W=Y.current)==null||W.focus()},[p]),v.useEffect(()=>{const O=W=>{W.key==="Escape"&&p&&m(!1)};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[p]);const mt=v.useCallback(async()=>{var Dt,wt;const O=y.trim();if(!O||r||E||a)return;const W={id:Date.now(),text:O,sender:"user"},gt=[...R,W];if(C||k(Q=>[...Q,W]),l(O),x(""),bt){V(!0);try{const Q=bd(gt),yt=Q.slice(0,-1),Ft=((wt=(Dt=Q[Q.length-1])==null?void 0:Dt.parts[0])==null?void 0:wt.text)||"",gs=(await(await bt.startChat({history:yt}).sendMessage(Ft)).response).text(),ys={id:Date.now()+1,text:gs,sender:"bot"};k(Jt=>[...Jt,ys])}catch(Q){console.error("Gemini API Error:",Q);const yt={id:Date.now()+1,text:"Sorry, an error occurred. Please try again.",sender:"bot"};k(Ft=>[...Ft,yt])}finally{V(!1)}}else C||(V(!0),setTimeout(()=>{const Q={id:Date.now()+1,text:`You said: "${O}"`,sender:"bot"};k(yt=>[...yt,Q]),V(!1)},800))},[y,r,E,a,l,bt,C,R,k]),Re=v.useCallback(O=>{O.key==="Enter"&&mt()},[mt]),$=O=>typeof O=="string"?S.jsx("img",{src:O,alt:"avatar",className:"w-8 h-8 rounded-full object-cover"}):S.jsx("div",{className:"w-8 h-8 rounded-full text-gray-500",children:O}),J=E||a,xt={"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"},Mt=P.window.placement==="center",Nt={rounded:"rounded-xl",square:"rounded-md"};return S.jsxs("div",{id:h,style:ot,className:"font-sans",children:[S.jsx(Rs,{children:!p&&S.jsx(bo.button,{ref:Y,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:S.jsx(ia.FontAwesomeIcon,{icon:ra.faCommentDots})})}),S.jsxs(Rs,{children:[p&&Mt&&P.window.backdrop&&S.jsx(bo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{backgroundColor:P.window.backdropColor,backdropFilter:`blur(${P.window.backdropBlur})`,WebkitBackdropFilter:`blur(${P.window.backdropBlur})`},className:"fixed inset-0 z-40",onClick:()=>m(!1)}),p&&S.jsxs("div",{ref:pt,"aria-modal":"true",role:"dialog",className:`fixed ${xt[P.window.placement]||xt["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:[S.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:[S.jsxs("div",{className:"flex items-center space-x-3",children:[S.jsx("div",{className:"w-10 h-10 rounded-full bg-white/30 flex items-center justify-center p-1",children:$(e)}),S.jsx("span",{style:{fontFamily:"var(--chatbot-header-font-family)",fontWeight:"var(--chatbot-header-font-weight)"},className:"text-lg",children:t})]}),S.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:S.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:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),S.jsxs("div",{role:"log","aria-live":"polite",className:"chatbot-message-list flex-1 p-4 overflow-y-auto space-y-4",children:[R.map(O=>S.jsxs("div",{className:`flex items-end max-w-[85%] gap-2 ${O.sender==="user"?"ml-auto flex-row-reverse":"mr-auto"}`,children:[P.messages.showAvatars&&S.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 overflow-hidden",children:$(O.sender==="user"?n:e)}),S.jsx("div",{className:`px-3 py-2 ${Nt[P.messages.bubbleShape]||Nt.rounded} ${P.messages.bubblePointer?O.sender==="user"?"rounded-br-none":"rounded-bl-none":""}`,style:{backgroundColor:O.sender==="user"?"var(--chatbot-user-msg-bg)":"var(--chatbot-bot-msg-bg)",color:O.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:S.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:S.jsx(oa,{children:O.text})})})]},O.id)),J&&S.jsxs("div",{className:"flex items-end max-w-[85%] gap-2 mr-auto",children:[P.messages.showAvatars&&S.jsx("div",{className:"w-7 h-7 rounded-full flex-shrink-0 overflow-hidden",children:$(e)}),S.jsx("div",{className:`px-3 py-2 ${Nt[P.messages.bubbleShape]||Nt.rounded} rounded-bl-none`,style:{backgroundColor:"var(--chatbot-bot-msg-bg)"},children:S.jsx(vd,{})})]}),S.jsx("div",{ref:U})]}),S.jsx("footer",{className:"p-3 border-t flex-shrink-0",style:{borderColor:"var(--chatbot-window-border-color)",backgroundColor:"var(--chatbot-input-bg)"},children:S.jsxs("div",{className:"flex items-center space-x-2",children:[S.jsx("input",{ref:M,type:"text",value:y,onChange:O=>x(O.target.value),onKeyPress:Re,placeholder:i,disabled:r||J,"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)"}}),S.jsx("button",{onClick:mt,disabled:!y.trim()||r||J,"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:S.jsx(yd,{})})]})})]})]})]})};ut.ChatBot=xd,Object.defineProperty(ut,Symbol.toStringTag,{value:"Module"})});