react-pro-messenger 1.0.25 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +1433 -1375
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +10 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/Input/Input.d.ts +5 -3
- package/dist/src/components/Media/Media.d.ts +2 -1
- package/dist/src/domain/MessageEntity.d.ts +3 -1
- package/dist/src/features/Chat/index.d.ts +2 -2
- package/dist/src/features/Chat/logic.d.ts +2 -1
- package/dist/src/helper/formatTimer.d.ts +2 -0
- package/dist/src/ts/interfaces.d.ts +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`+
|
|
3
|
-
`),xe=
|
|
4
|
-
`),
|
|
5
|
-
`+
|
|
1
|
+
(function(fe,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(fe=typeof globalThis<"u"?globalThis:fe||self,x(fe.ReactProMessenger={},fe.React,fe.ReactDOM))})(this,function(fe,x,$e){"use strict";var Ld=Object.defineProperty;var kd=(fe,x,$e)=>x in fe?Ld(fe,x,{enumerable:!0,configurable:!0,writable:!0,value:$e}):fe[x]=$e;var Ae=(fe,x,$e)=>(kd(fe,typeof x!="symbol"?x+"":x,$e),$e);function ra(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const tn=ra(x);var m={exports:{}},ct={};var _r;function sa(){if(_r)return ct;_r=1;var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,a,c){var u,f={},h=null,g=null;c!==void 0&&(h=""+c),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(g=a.ref);for(u in a)r.call(a,u)&&!i.hasOwnProperty(u)&&(f[u]=a[u]);if(l&&l.defaultProps)for(u in a=l.defaultProps,a)f[u]===void 0&&(f[u]=a[u]);return{$$typeof:t,type:l,key:h,ref:g,props:f,_owner:s.current}}return ct.Fragment=n,ct.jsx=o,ct.jsxs=o,ct}var ft={};var Ir;function ia(){return Ir||(Ir=1,process.env.NODE_ENV!=="production"&&function(){var e=x,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),b=Symbol.iterator,y="@@iterator";function P(d){if(d===null||typeof d!="object")return null;var w=b&&d[b]||d[y];return typeof w=="function"?w:null}var T=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(d){{for(var w=arguments.length,A=new Array(w>1?w-1:0),F=1;F<w;F++)A[F-1]=arguments[F];E("error",d,A)}}function E(d,w,A){{var F=T.ReactDebugCurrentFrame,q=F.getStackAddendum();q!==""&&(w+="%s",A=A.concat([q]));var J=A.map(function(Y){return String(Y)});J.unshift("Warning: "+w),Function.prototype.apply.call(console[d],console,J)}}var V=!1,p=!1,M=!1,$=!1,R=!1,X;X=Symbol.for("react.module.reference");function N(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||R||d===s||d===c||d===u||$||d===g||V||p||M||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===l||d.$$typeof===a||d.$$typeof===X||d.getModuleId!==void 0))}function se(d,w,A){var F=d.displayName;if(F)return F;var q=w.displayName||w.name||"";return q!==""?A+"("+q+")":A}function ye(d){return d.displayName||"Context"}function ae(d){if(d==null)return null;if(typeof d.tag=="number"&&C("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 r:return"Fragment";case n:return"Portal";case i:return"Profiler";case s:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case l:var w=d;return ye(w)+".Consumer";case o:var A=d;return ye(A._context)+".Provider";case a:return se(d,d.render,"ForwardRef");case f:var F=d.displayName||null;return F!==null?F:ae(d.type)||"Memo";case h:{var q=d,J=q._payload,Y=q._init;try{return ae(Y(J))}catch{return null}}}return null}var ne=Object.assign,ve=0,le,Z,ue,Se,v,S,D;function _(){}_.__reactDisabledLog=!0;function O(){{if(ve===0){le=console.log,Z=console.info,ue=console.warn,Se=console.error,v=console.group,S=console.groupCollapsed,D=console.groupEnd;var d={configurable:!0,enumerable:!0,value:_,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}ve++}}function k(){{if(ve--,ve===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ne({},d,{value:le}),info:ne({},d,{value:Z}),warn:ne({},d,{value:ue}),error:ne({},d,{value:Se}),group:ne({},d,{value:v}),groupCollapsed:ne({},d,{value:S}),groupEnd:ne({},d,{value:D})})}ve<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var I=T.ReactCurrentDispatcher,B;function U(d,w,A){{if(B===void 0)try{throw Error()}catch(q){var F=q.stack.trim().match(/\n( *(at )?)/);B=F&&F[1]||""}return`
|
|
2
|
+
`+B+d}}var K=!1,W;{var me=typeof WeakMap=="function"?WeakMap:Map;W=new me}function j(d,w){if(!d||K)return"";{var A=W.get(d);if(A!==void 0)return A}var F;K=!0;var q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var J;J=I.current,I.current=null,O();try{if(w){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(Le){F=Le}Reflect.construct(d,[],Y)}else{try{Y.call()}catch(Le){F=Le}d.call(Y.prototype)}}else{try{throw Error()}catch(Le){F=Le}d()}}catch(Le){if(Le&&F&&typeof Le.stack=="string"){for(var z=Le.stack.split(`
|
|
3
|
+
`),xe=F.stack.split(`
|
|
4
|
+
`),ie=z.length-1,oe=xe.length-1;ie>=1&&oe>=0&&z[ie]!==xe[oe];)oe--;for(;ie>=1&&oe>=0;ie--,oe--)if(z[ie]!==xe[oe]){if(ie!==1||oe!==1)do if(ie--,oe--,oe<0||z[ie]!==xe[oe]){var Ce=`
|
|
5
|
+
`+z[ie].replace(" at new "," at ");return d.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",d.displayName)),typeof d=="function"&&W.set(d,Ce),Ce}while(ie>=1&&oe>=0);break}}}finally{K=!1,I.current=J,k(),Error.prepareStackTrace=q}var ut=d?d.displayName||d.name:"",na=ut?U(ut):"";return typeof d=="function"&&W.set(d,na),na}function Pe(d,w,A){return j(d,!1)}function at(d){var w=d.prototype;return!!(w&&w.isReactComponent)}function Ge(d,w,A){if(d==null)return"";if(typeof d=="function")return j(d,at(d));if(typeof d=="string")return U(d);switch(d){case c:return U("Suspense");case u:return U("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case a:return Pe(d.render);case f:return Ge(d.type,w,A);case h:{var F=d,q=F._payload,J=F._init;try{return Ge(J(q),w,A)}catch{}}}return""}var Qt=Object.prototype.hasOwnProperty,zo={},Yo=T.ReactDebugCurrentFrame;function en(d){if(d){var w=d._owner,A=Ge(d.type,d._source,w?w.type:null);Yo.setExtraStackFrame(A)}else Yo.setExtraStackFrame(null)}function pd(d,w,A,F,q){{var J=Function.call.bind(Qt);for(var Y in d)if(J(d,Y)){var z=void 0;try{if(typeof d[Y]!="function"){var xe=Error((F||"React class")+": "+A+" type `"+Y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[Y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw xe.name="Invariant Violation",xe}z=d[Y](w,Y,F,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ie){z=ie}z&&!(z instanceof Error)&&(en(q),C("%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).",F||"React class",A,Y,typeof z),en(null)),z instanceof Error&&!(z.message in zo)&&(zo[z.message]=!0,en(q),C("Failed %s type: %s",A,z.message),en(null))}}}var md=Array.isArray;function Rr(d){return md(d)}function gd(d){{var w=typeof Symbol=="function"&&Symbol.toStringTag,A=w&&d[Symbol.toStringTag]||d.constructor.name||"Object";return A}}function yd(d){try{return Ko(d),!1}catch{return!0}}function Ko(d){return""+d}function qo(d){if(yd(d))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",gd(d)),Ko(d)}var Vt=T.ReactCurrentOwner,vd={key:!0,ref:!0,__self:!0,__source:!0},Go,Ho,Vr;Vr={};function xd(d){if(Qt.call(d,"ref")){var w=Object.getOwnPropertyDescriptor(d,"ref").get;if(w&&w.isReactWarning)return!1}return d.ref!==void 0}function bd(d){if(Qt.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function Td(d,w){if(typeof d.ref=="string"&&Vt.current&&w&&Vt.current.stateNode!==w){var A=ae(Vt.current.type);Vr[A]||(C('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ae(Vt.current.type),d.ref),Vr[A]=!0)}}function wd(d,w){{var A=function(){Go||(Go=!0,C("%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)",w))};A.isReactWarning=!0,Object.defineProperty(d,"key",{get:A,configurable:!0})}}function Sd(d,w){{var A=function(){Ho||(Ho=!0,C("%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)",w))};A.isReactWarning=!0,Object.defineProperty(d,"ref",{get:A,configurable:!0})}}var Pd=function(d,w,A,F,q,J,Y){var z={$$typeof:t,type:d,key:w,ref:A,props:Y,_owner:J};return z._store={},Object.defineProperty(z._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(z,"_self",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.defineProperty(z,"_source",{configurable:!1,enumerable:!1,writable:!1,value:q}),Object.freeze&&(Object.freeze(z.props),Object.freeze(z)),z};function Cd(d,w,A,F,q){{var J,Y={},z=null,xe=null;A!==void 0&&(qo(A),z=""+A),bd(w)&&(qo(w.key),z=""+w.key),xd(w)&&(xe=w.ref,Td(w,q));for(J in w)Qt.call(w,J)&&!vd.hasOwnProperty(J)&&(Y[J]=w[J]);if(d&&d.defaultProps){var ie=d.defaultProps;for(J in ie)Y[J]===void 0&&(Y[J]=ie[J])}if(z||xe){var oe=typeof d=="function"?d.displayName||d.name||"Unknown":d;z&&wd(Y,oe),xe&&Sd(Y,oe)}return Pd(d,z,xe,q,F,Vt.current,Y)}}var Or=T.ReactCurrentOwner,Xo=T.ReactDebugCurrentFrame;function lt(d){if(d){var w=d._owner,A=Ge(d.type,d._source,w?w.type:null);Xo.setExtraStackFrame(A)}else Xo.setExtraStackFrame(null)}var Lr;Lr=!1;function kr(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Zo(){{if(Or.current){var d=ae(Or.current.type);if(d)return`
|
|
6
6
|
|
|
7
|
-
Check the render method of \``+d+"`."}return""}}function
|
|
7
|
+
Check the render method of \``+d+"`."}return""}}function Ed(d){{if(d!==void 0){var w=d.fileName.replace(/^.*[\\\/]/,""),A=d.lineNumber;return`
|
|
8
8
|
|
|
9
|
-
Check your code at `+w+":"+A+"."}return""}}var Jo={};function
|
|
9
|
+
Check your code at `+w+":"+A+"."}return""}}var Jo={};function Ad(d){{var w=Zo();if(!w){var A=typeof d=="string"?d:d.displayName||d.name;A&&(w=`
|
|
10
10
|
|
|
11
|
-
Check the top-level render call using <`+A+">.")}return w}}function Qo(d,w){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var A=
|
|
11
|
+
Check the top-level render call using <`+A+">.")}return w}}function Qo(d,w){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var A=Ad(w);if(Jo[A])return;Jo[A]=!0;var F="";d&&d._owner&&d._owner!==Or.current&&(F=" It was passed a child from "+ae(d._owner.type)+"."),lt(d),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,F),lt(null)}}function ea(d,w){{if(typeof d!="object")return;if(Rr(d))for(var A=0;A<d.length;A++){var F=d[A];kr(F)&&Qo(F,w)}else if(kr(d))d._store&&(d._store.validated=!0);else if(d){var q=P(d);if(typeof q=="function"&&q!==d.entries)for(var J=q.call(d),Y;!(Y=J.next()).done;)kr(Y.value)&&Qo(Y.value,w)}}}function jd(d){{var w=d.type;if(w==null||typeof w=="string")return;var A;if(typeof w=="function")A=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===a||w.$$typeof===f))A=w.propTypes;else return;if(A){var F=ae(w);pd(A,d.props,"prop",F,d)}else if(w.PropTypes!==void 0&&!Lr){Lr=!0;var q=ae(w);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",q||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Md(d){{for(var w=Object.keys(d.props),A=0;A<w.length;A++){var F=w[A];if(F!=="children"&&F!=="key"){lt(d),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",F),lt(null);break}}d.ref!==null&&(lt(d),C("Invalid attribute `ref` supplied to `React.Fragment`."),lt(null))}}function ta(d,w,A,F,q,J){{var Y=N(d);if(!Y){var z="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(z+=" 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 xe=Ed(q);xe?z+=xe:z+=Zo();var ie;d===null?ie="null":Rr(d)?ie="array":d!==void 0&&d.$$typeof===t?(ie="<"+(ae(d.type)||"Unknown")+" />",z=" Did you accidentally export a JSX literal instead of a component?"):ie=typeof d,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ie,z)}var oe=Cd(d,w,A,q,J);if(oe==null)return oe;if(Y){var Ce=w.children;if(Ce!==void 0)if(F)if(Rr(Ce)){for(var ut=0;ut<Ce.length;ut++)ea(Ce[ut],d);Object.freeze&&Object.freeze(Ce)}else C("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(Ce,d)}return d===r?Md(oe):jd(oe),oe}}function Dd(d,w,A){return ta(d,w,A,!0)}function Rd(d,w,A){return ta(d,w,A,!1)}var Vd=Rd,Od=Dd;ft.Fragment=r,ft.jsx=Vd,ft.jsxs=Od}()),ft}(function(e){process.env.NODE_ENV==="production"?e.exports=sa():e.exports=ia()})(m);const _d="",oa=()=>{const e=x.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return m.exports.jsx("button",{onClick:e,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded",children:"Vite is better than Webpack"})};class Ot{constructor({id:t,text:n,createdDate:r,attachment:s,attachmentType:i,attachmentFormat:o,user:l,isRightSided:a,symbols:c,isSending:u}){Ae(this,"id","0");Ae(this,"text","");Ae(this,"createdDate","");Ae(this,"attachment","");Ae(this,"attachmentType");Ae(this,"attachmentFormat","");Ae(this,"user",{id:""});Ae(this,"isRightSided",!1);Ae(this,"symbols");Ae(this,"isSending");this.id=t,this.text=n,this.createdDate=r,this.attachment=s,this.attachmentType=i,this.attachmentFormat=o,this.user=l,this.isRightSided=a,this.symbols=c,this.isSending=u}}const nn=x.createContext({});function rn(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const Lt=x.createContext(null),sn=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class aa extends tn.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,s=r instanceof HTMLElement&&r.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=s-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function la({children:e,isPresent:t,anchorX:n}){const r=x.useId(),s=x.useRef(null),i=x.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=x.useContext(sn);return x.useInsertionEffect(()=>{const{width:l,height:a,top:c,left:u,right:f}=i.current;if(t||!s.current||!l||!a)return;const h=n==="left"?`left: ${u}`:`right: ${f}`;s.current.dataset.motionPopId=r;const g=document.createElement("style");return o&&(g.nonce=o),document.head.appendChild(g),g.sheet&&g.sheet.insertRule(`
|
|
12
12
|
[data-motion-pop-id="${r}"] {
|
|
13
13
|
position: absolute !important;
|
|
14
14
|
width: ${l}px !important;
|
|
@@ -16,6 +16,6 @@ Check the top-level render call using <`+A+">.")}return w}}function Qo(d,w){{if(
|
|
|
16
16
|
${h}px !important;
|
|
17
17
|
top: ${c}px !important;
|
|
18
18
|
}
|
|
19
|
-
`),()=>{document.head.removeChild(m)}},[t]),g.exports.jsx(aa,{isPresent:t,childRef:s,sizeRef:i,children:tn.cloneElement(e,{ref:s})})}const ua=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l})=>{const a=rn(ca),c=v.useId(),u=v.useCallback(h=>{a.set(h,!0);for(const m of a.values())if(!m)return;r&&r()},[a,r]),f=v.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),i?[Math.random(),u]:[n,u]);return v.useMemo(()=>{a.forEach((h,m)=>a.set(m,!1))},[n]),tn.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=g.exports.jsx(la,{isPresent:n,anchorX:l,children:e})),g.exports.jsx(Lt.Provider,{value:f,children:e})};function ca(){return new Map}function Fr(e=!0){const t=v.useContext(Lt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=v.useId();v.useEffect(()=>{if(e)return s(i)},[e]);const o=v.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const kt=e=>e.key||"";function Nr(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const on=typeof window<"u",Br=on?v.useLayoutEffect:v.useEffect,$r=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left"})=>{const[a,c]=Fr(o),u=v.useMemo(()=>Nr(e),[e]),f=o&&!a?[]:u.map(kt),h=v.useRef(!0),m=v.useRef(u),x=rn(()=>new Map),[y,P]=v.useState(u),[b,S]=v.useState(u);Br(()=>{h.current=!1,m.current=u;for(let p=0;p<b.length;p++){const M=kt(b[p]);f.includes(M)?x.delete(M):x.get(M)!==!0&&x.set(M,!1)}},[b,f.length,f.join("-")]);const C=[];if(u!==y){let p=[...u];for(let M=0;M<b.length;M++){const B=b[M],R=kt(B);f.includes(R)||(p.splice(M,0,B),C.push(B))}return i==="wait"&&C.length&&(p=C),S(Nr(p)),P(u),null}process.env.NODE_ENV!=="production"&&i==="wait"&&b.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:D}=v.useContext(nn);return g.exports.jsx(g.exports.Fragment,{children:b.map(p=>{const M=kt(p),B=o&&!a?!1:u===b||f.includes(M),R=()=>{if(x.has(M))x.set(M,!0);else return;let Q=!0;x.forEach(Y=>{Y||(Q=!1)}),Q&&(D==null||D(),S(m.current),o&&(c==null||c()),r&&r())};return g.exports.jsx(ua,{isPresent:B,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:B?void 0:R,anchorX:l,children:p},M)})})},be=e=>e;let He=be,Le=be;process.env.NODE_ENV!=="production"&&(He=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Le=(e,t)=>{if(!e)throw new Error(t)});function an(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Ae=e=>e*1e3,Re=e=>e/1e3,Ur={skipAnimations:!1,useManualTiming:!1},_t=["read","resolveKeyframes","update","preRender","render","postRender"],ke={value:null,addProjectionMetrics:null};function fa(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},a=0;function c(f){o.has(f)&&(u.schedule(f),e()),a++,f(l)}const u={schedule:(f,h=!1,m=!1)=>{const y=m&&s?n:r;return h&&o.add(f),y.has(f)||y.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(l=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&ke.value&&ke.value.frameloop[t].push(a),a=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const da=40;function Wr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=_t.reduce((b,S)=>(b[S]=fa(i,t?S:void 0),b),{}),{read:l,resolveKeyframes:a,update:c,preRender:u,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,da),1),s.timestamp=b,s.isProcessing=!0,l.process(s),a.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},x=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:_t.reduce((b,S)=>{const C=o[S];return b[S]=(D,p=!1,M=!1)=>(n||x(),C.schedule(D,p,M)),b},{}),cancel:b=>{for(let S=0;S<_t.length;S++)o[_t[S]].cancel(b)},state:s,steps:o}}const{schedule:te,cancel:_e,state:he,steps:ln}=Wr(typeof requestAnimationFrame<"u"?requestAnimationFrame:be,!0),zr=v.createContext({strict:!1}),Yr={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ze={};for(const e in Yr)Ze[e]={isEnabled:t=>Yr[e].some(n=>!!t[n])};function ha(e){for(const t in e)Ze[t]={...Ze[t],...e[t]}}const pa=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 It(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pa.has(e)}let Kr=e=>!It(e);function ma(e){e&&(Kr=t=>t.startsWith("on")?!It(t):e(t))}try{ma(require("@emotion/is-prop-valid").default)}catch{}function ga(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Kr(s)||n===!0&&It(s)||!t&&!It(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Gr=new Set;function Ft(e,t,n){e||Gr.has(t)||(console.warn(t),n&&console.warn(n),Gr.add(t))}function ya(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ft(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Nt=v.createContext({});function Bt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dt(e){return typeof e=="string"||Array.isArray(e)}const un=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cn=["initial",...un];function $t(e){return Bt(e.animate)||cn.some(t=>dt(e[t]))}function qr(e){return Boolean($t(e)||e.variants)}function va(e,t){if($t(e)){const{initial:n,animate:r}=e;return{initial:n===!1||dt(n)?n:void 0,animate:dt(r)?r:void 0}}return e.inherit!==!1?t:{}}function xa(e){const{initial:t,animate:n}=va(e,v.useContext(Nt));return v.useMemo(()=>({initial:t,animate:n}),[Hr(t),Hr(n)])}function Hr(e){return Array.isArray(e)?e.join(" "):e}const ba=Symbol.for("motionComponentSymbol");function Je(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ta(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Je(n)&&(n.current=r))},[t])}const fn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xr="data-"+fn("framerAppearId"),{schedule:dn,cancel:Id}=Wr(queueMicrotask,!1),Zr=v.createContext({});function wa(e,t,n,r,s){var i,o;const{visualElement:l}=v.useContext(Nt),a=v.useContext(zr),c=v.useContext(Lt),u=v.useContext(sn).reducedMotion,f=v.useRef(null);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,m=v.useContext(Zr);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Pa(f.current,n,s,m);const x=v.useRef(!1);v.useInsertionEffect(()=>{h&&x.current&&h.update(n,c)});const y=n[Xr],P=v.useRef(Boolean(y)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Br(()=>{h&&(x.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),dn.render(h.render),P.current&&h.animationState&&h.animationState.animateChanges())}),v.useEffect(()=>{h&&(!P.current&&h.animationState&&h.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),P.current=!1))}),h}function Pa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jr(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||l&&Je(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:c})}function Jr(e){if(e)return e.options.allowProjection!==!1?e.projection:Jr(e.parent)}function Sa({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ha(e);function l(c,u){let f;const h={...v.useContext(sn),...c,layoutId:Ca(c)},{isStatic:m}=h,x=xa(c),y=r(c,m);if(!m&&on){Ea(h,e);const P=Aa(h);f=P.MeasureLayout,x.visualElement=wa(s,y,h,t,P.ProjectionNode)}return g.exports.jsxs(Nt.Provider,{value:x,children:[f&&x.visualElement?g.exports.jsx(f,{visualElement:x.visualElement,...h}):null,n(s,c,Ta(y,x.visualElement,u),y,m,x.visualElement)]})}l.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const a=v.forwardRef(l);return a[ba]=s,a}function Ca({layoutId:e}){const t=v.useContext(nn).id;return t&&e!==void 0?t+"-"+e:e}function Ea(e,t){const n=v.useContext(zr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?He(!1,r):Le(!1,r)}}function Aa(e){const{drag:t,layout:n}=Ze;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Qr=e=>t=>typeof t=="string"&&t.startsWith(e),hn=Qr("--"),ja=Qr("var(--"),pn=e=>ja(e)?Ma.test(e.split("/*")[0].trim()):!1,Ma=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ht={};function Da(e){for(const t in e)ht[t]=e[t],hn(t)&&(ht[t].isCSSVariable=!0)}const Qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ue=new Set(Qe);function es(e,{layout:t,layoutId:n}){return Ue.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ht[e]||e==="opacity")}const pe=e=>Boolean(e&&e.getVelocity),ts=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ve=(e,t,n)=>n>t?t:n<e?e:n,et={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},pt={...et,transform:e=>Ve(0,1,e)},Ut={...et,default:1},mt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ie=mt("deg"),je=mt("%"),V=mt("px"),Ra=mt("vh"),Va=mt("vw"),ns={...je,parse:e=>je.parse(e)/100,transform:e=>je.transform(e*100)},Oa={borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,backgroundPositionX:V,backgroundPositionY:V},La={rotate:Ie,rotateX:Ie,rotateY:Ie,rotateZ:Ie,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:Ie,skewX:Ie,skewY:Ie,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,transformPerspective:V,opacity:pt,originX:ns,originY:ns,originZ:V},rs={...et,transform:Math.round},mn={...Oa,...La,zIndex:rs,size:V,fillOpacity:pt,strokeOpacity:pt,numOctaves:rs},ka={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_a=Qe.length;function Ia(e,t,n){let r="",s=!0;for(let i=0;i<_a;i++){const o=Qe[i],l=e[o];if(l===void 0)continue;let a=!0;if(typeof l=="number"?a=l===(o.startsWith("scale")?1:0):a=parseFloat(l)===0,!a||n){const c=ts(l,mn[o]);if(!a){s=!1;const u=ka[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function gn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,l=!1;for(const a in t){const c=t[a];if(Ue.has(a)){o=!0;continue}else if(hn(a)){s[a]=c;continue}else{const u=ts(c,mn[a]);a.startsWith("origin")?(l=!0,i[a]=u):r[a]=u}}if(t.transform||(o||n?r.transform=Ia(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:a="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${a} ${c} ${u}`}}const yn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ss(e,t,n){for(const r in t)!pe(t[r])&&!es(r,n)&&(e[r]=t[r])}function Fa({transformTemplate:e},t){return v.useMemo(()=>{const n=yn();return gn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Na(e,t){const n=e.style||{},r={};return ss(r,n,e),Object.assign(r,Fa(e,t)),r}function Ba(e,t){const n={},r=Na(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const $a=["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 vn(e){return typeof e!="string"||e.includes("-")?!1:!!($a.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ua={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wa={offset:"strokeDashoffset",array:"strokeDasharray"};function za(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ua:Wa;e[i.offset]=V.transform(-r);const o=V.transform(t),l=V.transform(n);e[i.array]=`${o} ${l}`}function is(e,t,n){return typeof e=="string"?e:V.transform(t+n*e)}function Ya(e,t,n){const r=is(t,e.x,e.width),s=is(n,e.y,e.height);return`${r} ${s}`}function xn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:l=1,pathOffset:a=0,...c},u,f){if(gn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:x}=e;h.transform&&(x&&(m.transform=h.transform),delete h.transform),x&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Ya(x,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&za(h,o,l,a,!1)}const os=()=>({...yn(),attrs:{}}),bn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ka(e,t,n,r){const s=v.useMemo(()=>{const i=os();return xn(i,t,bn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ss(i,e.style,e),s.style={...i,...s.style}}return s}function Ga(e=!1){return(n,r,s,{latestValues:i},o)=>{const a=(vn(n)?Ka:Ba)(r,i,o,n),c=ga(r,typeof n=="string",e),u=n!==v.Fragment?{...c,...a,ref:s}:{},{children:f}=r,h=v.useMemo(()=>pe(f)?f.get():f,[f]);return v.createElement(n,{...u,children:h})}}function as(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Tn(e,t,n,r){if(typeof t=="function"){const[s,i]=as(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=as(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const wn=e=>Array.isArray(e),qa=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ha=e=>wn(e)?e[e.length-1]||0:e;function Wt(e){const t=pe(e)?e.get():e;return qa(t)?t.toValue():t}function Xa({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:Za(r,s,i,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const ls=e=>(t,n)=>{const r=v.useContext(Nt),s=v.useContext(Lt),i=()=>Xa(e,t,r,s);return n?i():rn(i)};function Za(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Wt(i[h]);let{initial:o,animate:l}=e;const a=$t(e),c=qr(e);t&&c&&!a&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?l:o;if(f&&typeof f!="boolean"&&!Bt(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const x=Tn(e,h[m]);if(x){const{transitionEnd:y,transition:P,...b}=x;for(const S in b){let C=b[S];if(Array.isArray(C)){const D=u?C.length-1:0;C=C[D]}C!==null&&(s[S]=C)}for(const S in y)s[S]=y[S]}}}return s}function Pn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(pe(s[o])||t.style&&pe(t.style[o])||es(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const Ja={useVisualState:ls({scrapeMotionValuesFromProps:Pn,createRenderState:yn})};function us(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function cs(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const fs=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 ds(e,t,n,r){cs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(fs.has(s)?s:fn(s),t.attrs[s])}function hs(e,t,n){const r=Pn(e,t,n);for(const s in e)if(pe(e[s])||pe(t[s])){const i=Qe.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const ps=["x","y","width","height","cx","cy","r"],Qa={useVisualState:ls({scrapeMotionValuesFromProps:hs,createRenderState:os,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(Ue.has(l)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let l=0;l<ps.length;l++){const a=ps[l];e[a]!==t[a]&&(o=!0)}o&&te.read(()=>{us(n,r),te.render(()=>{xn(r,s,bn(n.tagName),e.transformTemplate),ds(n,r)})})}})};function el(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...vn(r)?Qa:Ja,preloadedFeatures:e,useRender:Ga(s),createVisualElement:t,Component:r};return Sa(o)}}function gt(e,t,n){const r=e.getProps();return Tn(r,t,n!==void 0?n:r.custom,e)}const tl=an(()=>window.ScrollTimeline!==void 0);class nl{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(tl()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class rl extends nl{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Sn(e,t){return e?e[t]||e.default||e:void 0}const Cn=2e4;function ms(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Cn;)t+=n,r=e.next(t);return t>=Cn?1/0:t}function En(e){return typeof e=="function"}function gs(e,t){e.timeline=t,e.onfinish=null}const An=e=>Array.isArray(e)&&typeof e[0]=="number",sl={linearEasing:void 0};function il(e,t){const n=an(e);return()=>{var r;return(r=sl[t])!==null&&r!==void 0?r:n()}}const zt=il(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ys=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Xe(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function vs(e){return Boolean(typeof e=="function"&&zt()||!e||typeof e=="string"&&(e in jn||zt())||An(e)||Array.isArray(e)&&e.every(vs))}const yt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function xs(e,t){if(e)return typeof e=="function"&&zt()?ys(e,t):An(e)?yt(e):Array.isArray(e)?e.map(n=>xs(n,t)||jn.easeOut):jn[e]}const Ee={x:!1,y:!1};function bs(){return Ee.x||Ee.y}function ol(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Ts(e,t){const n=ol(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function ws(e){return!(e.pointerType==="touch"||bs())}function al(e,t,n={}){const[r,s,i]=Ts(e,n),o=l=>{if(!ws(l))return;const{target:a}=l,c=t(a,l);if(typeof c!="function"||!a)return;const u=f=>{ws(f)&&(c(f),a.removeEventListener("pointerleave",u))};a.addEventListener("pointerleave",u,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),i}function Yt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Ps=(e,t)=>t?e===t?!0:Ps(e,t.parentElement):!1,Mn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ll=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ul(e){return ll.has(e.tagName)||e.tabIndex!==-1}const vt=new WeakSet;function Ss(e){return t=>{t.key==="Enter"&&e(t)}}function Dn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const cl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ss(()=>{if(vt.has(n))return;Dn(n,"down");const s=Ss(()=>{Dn(n,"up")}),i=()=>Dn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Cs(e){return Mn(e)&&!bs()}function fl(e,t,n={}){const[r,s,i]=Ts(e,n),o=l=>{const a=l.currentTarget;if(!a||!Cs(l)||vt.has(a))return;vt.add(a),Yt(l,"set");const c=t(a,l),u=(m,x)=>{a.removeEventListener("pointerup",f),a.removeEventListener("pointercancel",h),Yt(m,"release"),!(!Cs(m)||!vt.has(a))&&(vt.delete(a),typeof c=="function"&&c(m,{success:x}))},f=m=>{(m.isTrusted?dl(m,a instanceof Element?a.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(m,!1):u(m,!(a instanceof Element)||Ps(a,m.target))},h=m=>{u(m,!1)};a.addEventListener("pointerup",f,s),a.addEventListener("pointercancel",h,s),a.addEventListener("lostpointercapture",h,s)};return r.forEach(l=>{l=n.useGlobalTarget?window:l;let a=!1;l instanceof HTMLElement&&(a=!0,!ul(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0)),l.addEventListener("pointerdown",o,s),a&&l.addEventListener("focus",c=>cl(c,s),s)}),i}function dl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function hl(e){return e==="x"||e==="y"?Ee[e]?null:(Ee[e]=!0,()=>{Ee[e]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1})}const Es=new Set(["width","height","top","left","right","bottom",...Qe]);let Kt;function pl(){Kt=void 0}const Me={now:()=>(Kt===void 0&&Me.set(he.isProcessing||Ur.useManualTiming?he.timestamp:performance.now()),Kt),set:e=>{Kt=e,queueMicrotask(pl)}};function Rn(e,t){e.indexOf(t)===-1&&e.push(t)}function Vn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class On{constructor(){this.subscriptions=[]}add(t){return Rn(this.subscriptions,t),()=>Vn(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function As(e,t){return t?e*(1e3/t):0}const js=30,ml=e=>!isNaN(parseFloat(e));class gl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Me.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Me.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ml(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new On);const r=this.events[t].add(n);return t==="change"?()=>{r(),te.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Me.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>js)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,js);return As(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xt(e,t){return new gl(e,t)}function yl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xt(n))}function vl(e,t){const n=gt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Ha(i[o]);yl(e,o,l)}}function xl(e){return Boolean(pe(e)&&e.add)}function Ln(e,t){const n=e.getValue("willChange");if(xl(n))return n.add(t)}function Ms(e){return e.props[Xr]}const bl={current:!1},Ds=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Tl=1e-7,wl=12;function Pl(e,t,n,r,s){let i,o,l=0;do o=t+(n-t)/2,i=Ds(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Tl&&++l<wl);return o}function bt(e,t,n,r){if(e===t&&n===r)return be;const s=i=>Pl(i,0,1,e,n);return i=>i===0||i===1?i:Ds(s(i),t,r)}const Rs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Vs=e=>t=>1-e(1-t),Os=bt(.33,1.53,.69,.99),kn=Vs(Os),Ls=Rs(kn),ks=e=>(e*=2)<1?.5*kn(e):.5*(2-Math.pow(2,-10*(e-1))),_n=e=>1-Math.sin(Math.acos(e)),_s=Vs(_n),Is=Rs(_n),Fs=e=>/^0[^.\s]+$/u.test(e);function Sl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fs(e):!0}const Tt=e=>Math.round(e*1e5)/1e5,In=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Cl(e){return e==null}const El=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fn=(e,t)=>n=>Boolean(typeof n=="string"&&El.test(n)&&n.startsWith(e)||t&&!Cl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ns=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(In);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Al=e=>Ve(0,255,e),Nn={...et,transform:e=>Math.round(Al(e))},We={test:Fn("rgb","red"),parse:Ns("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nn.transform(e)+", "+Nn.transform(t)+", "+Nn.transform(n)+", "+Tt(pt.transform(r))+")"};function jl(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Bn={test:Fn("#"),parse:jl,transform:We.transform},tt={test:Fn("hsl","hue"),parse:Ns("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+je.transform(Tt(t))+", "+je.transform(Tt(n))+", "+Tt(pt.transform(r))+")"},me={test:e=>We.test(e)||Bn.test(e)||tt.test(e),parse:e=>We.test(e)?We.parse(e):tt.test(e)?tt.parse(e):Bn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?We.transform(e):tt.transform(e)},Ml=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Dl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(In))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Ml))===null||n===void 0?void 0:n.length)||0)>0}const Bs="number",$s="color",Rl="var",Vl="var(",Us="${}",Ol=/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 wt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(Ol,a=>(me.test(a)?(r.color.push(i),s.push($s),n.push(me.parse(a))):a.startsWith(Vl)?(r.var.push(i),s.push(Rl),n.push(a)):(r.number.push(i),s.push(Bs),n.push(parseFloat(a))),++i,Us)).split(Us);return{values:n,split:l,indexes:r,types:s}}function Ws(e){return wt(e).values}function zs(e){const{split:t,types:n}=wt(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const l=n[o];l===Bs?i+=Tt(s[o]):l===$s?i+=me.transform(s[o]):i+=s[o]}return i}}const Ll=e=>typeof e=="number"?0:e;function kl(e){const t=Ws(e);return zs(e)(t.map(Ll))}const Fe={test:Dl,parse:Ws,createTransformer:zs,getAnimatableNone:kl},_l=new Set(["brightness","contrast","saturate","opacity"]);function Il(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(In)||[];if(!r)return e;const s=n.replace(r,"");let i=_l.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Fl=/\b([a-z-]*)\(.*?\)/gu,$n={...Fe,getAnimatableNone:e=>{const t=e.match(Fl);return t?t.map(Il).join(" "):e}},Nl={...mn,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:$n,WebkitFilter:$n},Un=e=>Nl[e];function Ys(e,t){let n=Un(e);return n!==$n&&(n=Fe),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bl=new Set(["auto","none","0"]);function $l(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Bl.has(i)&&wt(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Ys(n,s)}const Ks=e=>e===et||e===V,Gs=(e,t)=>parseFloat(e.split(", ")[t]),qs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Gs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Gs(i[1],e):0}},Ul=new Set(["x","y","z"]),Wl=Qe.filter(e=>!Ul.has(e));function zl(e){const t=[];return Wl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:qs(4,13),y:qs(5,14)};nt.translateX=nt.x,nt.translateY=nt.y;const ze=new Set;let Wn=!1,zn=!1;function Hs(){if(zn){const e=Array.from(ze).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=zl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}zn=!1,Wn=!1,ze.forEach(e=>e.complete()),ze.clear()}function Xs(){ze.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zn=!0)})}function Yl(){Xs(),Hs()}class Yn{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ze.add(this),Wn||(Wn=!0,te.read(Xs),te.resolveKeyframes(Hs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,l);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=l),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Zs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Kl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Gl(e){const t=Kl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const ql=4;function Js(e,t,n=1){Le(n<=ql,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Gl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Zs(o)?parseFloat(o):o}return pn(s)?Js(s,t,n+1):s}const Qs=e=>t=>t.test(e),ei=[et,V,je,Ie,Va,Ra,{test:e=>e==="auto",parse:e=>e}],ti=e=>ei.find(Qs(e));class ni extends Yn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let c=t[a];if(typeof c=="string"&&(c=c.trim(),pn(c))){const u=Js(c,n.current);u!==void 0&&(t[a]=u),a===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Es.has(r)||t.length!==2)return;const[s,i]=t,o=ti(s),l=ti(i);if(o!==l)if(Ks(o)&&Ks(l))for(let a=0;a<t.length;a++){const c=t[a];typeof c=="string"&&(t[a]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Sl(t[s])&&r.push(s);r.length&&$l(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,l=s[o];s[o]=nt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([a,c])=>{n.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const ri=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Fe.test(e)||e==="0")&&!e.startsWith("url("));function Hl(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Xl(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ri(s,t),l=ri(i,t);return He(o===l,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!l?!1:Hl(e)||(n==="spring"||En(n))&&r}const Zl=e=>e!==null;function Gt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Zl),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Jl=40;class si{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Me.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Jl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Yl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Me.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:l,onUpdate:a,isGenerator:c}=this.options;if(!c&&!Xl(t,r,s,i))if(o)this.options.duration=0;else{a&&a(Gt(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Pt={layout:0,mainThread:0,waapi:0},ne=(e,t,n)=>e+(t-e)*n;function Kn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ql({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,a=2*n-l;s=Kn(a,l,e+1/3),i=Kn(a,l,e),o=Kn(a,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function qt(e,t){return n=>n>0?t:e}const Gn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},eu=[Bn,We,tt],tu=e=>eu.find(t=>t.test(e));function ii(e){const t=tu(e);if(He(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===tt&&(n=Ql(n)),n}const oi=(e,t)=>{const n=ii(e),r=ii(t);if(!n||!r)return qt(e,t);const s={...n};return i=>(s.red=Gn(n.red,r.red,i),s.green=Gn(n.green,r.green,i),s.blue=Gn(n.blue,r.blue,i),s.alpha=ne(n.alpha,r.alpha,i),We.transform(s))},nu=(e,t)=>n=>t(e(n)),St=(...e)=>e.reduce(nu),qn=new Set(["none","hidden"]);function ru(e,t){return qn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function su(e,t){return n=>ne(e,t,n)}function Hn(e){return typeof e=="number"?su:typeof e=="string"?pn(e)?qt:me.test(e)?oi:au:Array.isArray(e)?ai:typeof e=="object"?me.test(e)?oi:iu:qt}function ai(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Hn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function iu(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Hn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function ou(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],l=e.indexes[o][s[o]],a=(n=e.values[l])!==null&&n!==void 0?n:0;r[i]=a,s[o]++}return r}const au=(e,t)=>{const n=Fe.createTransformer(t),r=wt(e),s=wt(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?qn.has(e)&&!s.values.length||qn.has(t)&&!r.values.length?ru(e,t):St(ai(ou(r,s),s.values),n):(He(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),qt(e,t))};function li(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ne(e,t,n):Hn(e)(e,t)}const lu=5;function ui(e,t,n){const r=Math.max(t-lu,0);return As(n-e(r),t-r)}const re={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},Xn=.001;function uu({duration:e=re.duration,bounce:t=re.bounce,velocity:n=re.velocity,mass:r=re.mass}){let s,i;He(e<=Ae(re.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Ve(re.minDamping,re.maxDamping,o),e=Ve(re.minDuration,re.maxDuration,Re(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=Zn(c,o),x=Math.exp(-f);return Xn-h/m*x},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,x=Math.exp(-f),y=Zn(Math.pow(c,2),o);return(-s(c)+Xn>0?-1:1)*((h-m)*x)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Xn+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const l=5/e,a=fu(s,i,l);if(e=Ae(e),isNaN(a))return{stiffness:re.stiffness,damping:re.damping,duration:e};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const cu=12;function fu(e,t,n){let r=n;for(let s=1;s<cu;s++)r=r-e(r)/t(r);return r}function Zn(e,t){return e*Math.sqrt(1-t*t)}const du=["duration","bounce"],hu=["stiffness","damping","mass"];function ci(e,t){return t.some(n=>e[n]!==void 0)}function pu(e){let t={velocity:re.velocity,stiffness:re.stiffness,damping:re.damping,mass:re.mass,isResolvedFromDuration:!1,...e};if(!ci(e,hu)&&ci(e,du))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Ve(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:re.mass,stiffness:s,damping:i}}else{const n=uu(e);t={...t,...n,mass:re.mass},t.isResolvedFromDuration=!0}return t}function fi(e=re.visualDuration,t=re.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:a,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:m}=pu({...n,velocity:-Re(n.velocity||0)}),x=h||0,y=c/(2*Math.sqrt(a*u)),P=o-i,b=Re(Math.sqrt(a/u)),S=Math.abs(P)<5;r||(r=S?re.restSpeed.granular:re.restSpeed.default),s||(s=S?re.restDelta.granular:re.restDelta.default);let C;if(y<1){const p=Zn(b,y);C=M=>{const B=Math.exp(-y*b*M);return o-B*((x+y*b*P)/p*Math.sin(p*M)+P*Math.cos(p*M))}}else if(y===1)C=p=>o-Math.exp(-b*p)*(P+(x+b*P)*p);else{const p=b*Math.sqrt(y*y-1);C=M=>{const B=Math.exp(-y*b*M),R=Math.min(p*M,300);return o-B*((x+y*b*P)*Math.sinh(R)+p*P*Math.cosh(R))/p}}const D={calculatedDuration:m&&f||null,next:p=>{const M=C(p);if(m)l.done=p>=f;else{let B=0;y<1&&(B=p===0?Ae(x):ui(C,p,M));const R=Math.abs(B)<=r,Q=Math.abs(o-M)<=s;l.done=R&&Q}return l.value=l.done?o:M,l},toString:()=>{const p=Math.min(ms(D),Cn),M=ys(B=>D.next(p*B).value,p,30);return p+"ms "+M}};return D}function di({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:a,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},m=R=>l!==void 0&&R<l||a!==void 0&&R>a,x=R=>l===void 0?a:a===void 0||Math.abs(l-R)<Math.abs(a-R)?l:a;let y=n*t;const P=f+y,b=o===void 0?P:o(P);b!==P&&(y=b-f);const S=R=>-y*Math.exp(-R/r),C=R=>b+S(R),D=R=>{const Q=S(R),Y=C(R);h.done=Math.abs(Q)<=c,h.value=h.done?b:Y};let p,M;const B=R=>{m(h.value)&&(p=R,M=fi({keyframes:[h.value,x(h.value)],velocity:ui(C,R,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return B(0),{calculatedDuration:null,next:R=>{let Q=!1;return!M&&p===void 0&&(Q=!0,D(R),B(R)),p!==void 0&&R>=p?M.next(R-p):(!Q&&D(R),h)}}}const mu=bt(.42,0,1,1),gu=bt(0,0,.58,1),hi=bt(.42,0,.58,1),yu=e=>Array.isArray(e)&&typeof e[0]!="number",pi={linear:be,easeIn:mu,easeInOut:hi,easeOut:gu,circIn:_n,circInOut:Is,circOut:_s,backIn:kn,backInOut:Ls,backOut:Os,anticipate:ks},mi=e=>{if(An(e)){Le(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return bt(t,n,r,s)}else if(typeof e=="string")return Le(pi[e]!==void 0,`Invalid easing type '${e}'`),pi[e];return e};function vu(e,t,n){const r=[],s=n||li,i=e.length-1;for(let o=0;o<i;o++){let l=s(e[o],e[o+1]);if(t){const a=Array.isArray(t)?t[o]||be:t;l=St(a,l)}r.push(l)}return r}function xu(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(Le(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=vu(t,r,s),a=l.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(a>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Xe(e[f],e[f+1],u);return l[f](h)};return n?u=>c(Ve(e[0],e[i-1],u)):c}function bu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Xe(0,t,r);e.push(ne(n,1,s))}}function Tu(e){const t=[0];return bu(t,e.length-1),t}function wu(e,t){return e.map(n=>n*t)}function Pu(e,t){return e.map(()=>t||hi).splice(0,e.length-1)}function Ct({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=yu(r)?r.map(mi):mi(r),i={done:!1,value:t[0]},o=wu(n&&n.length===t.length?n:Tu(t),e),l=xu(o,t,{ease:Array.isArray(s)?s:Pu(t,s)});return{calculatedDuration:e,next:a=>(i.value=l(a),i.done=a>=e,i)}}const Su=e=>{const t=({timestamp:n})=>e(n);return{start:()=>te.update(t,!0),stop:()=>_e(t),now:()=>he.isProcessing?he.timestamp:Me.now()}},Cu={decay:di,inertia:di,tween:Ct,keyframes:Ct,spring:fi},Eu=e=>e/100;class Jn extends si{constructor(t){super(t),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:a}=this.options;a&&a()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Yn,l=(a,c)=>this.onKeyframesResolved(a,c);this.resolver=new o(i,l,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,l=En(n)?n:Cu[n]||Ct;let a,c;process.env.NODE_ENV!=="production"&&l!==Ct&&Le(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Ct&&typeof t[0]!="number"&&(a=St(Eu,li(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});i==="mirror"&&(c=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ms(u));const{calculatedDuration:f}=u,h=f+s,m=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:a,calculatedDuration:f,resolvedDuration:h,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;Pt.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:a,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:x,repeatDelay:y,onUpdate:P}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-h*(this.speed>=0?1:-1),S=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let C=this.currentTime,D=i;if(m){const R=Math.min(this.currentTime,u)/f;let Q=Math.floor(R),Y=R%1;!Y&&R>=1&&(Y=1),Y===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(x==="reverse"?(Y=1-Y,y&&(Y-=y/f)):x==="mirror"&&(D=o)),C=Ve(0,1,Y)*f}const p=S?{done:!1,value:a[0]}:D.next(C);l&&(p.value=l(p.value));let{done:M}=p;!S&&c!==null&&(M=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const B=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return B&&s!==void 0&&(p.value=Gt(a,this.options,s)),P&&P(p.value),B&&this.finish(),p}get duration(){const{resolved:t}=this;return t?Re(t.calculatedDuration):0}get time(){return Re(this.currentTime)}set time(t){t=Ae(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Re(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Su,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}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(),Pt.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Au=new Set(["opacity","clipPath","filter","transform"]);function ju(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeInOut",times:a}={}){const c={[t]:n};a&&(c.offset=a);const u=xs(l,s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Mu=an(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ht=10,Du=2e4;function Ru(e){return En(e.type)||e.type==="spring"||!vs(e.ease)}function Vu(e,t){const n=new Jn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<Du;)r=n.sample(i),s.push(r.value),i+=Ht;return{times:void 0,keyframes:s,duration:i-Ht,ease:"linear"}}const gi={anticipate:ks,backInOut:Ls,circInOut:Is};function Ou(e){return e in gi}class yi extends si{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ni(i,(o,l)=>this.onKeyframesResolved(o,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:l,name:a,startTime:c}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&zt()&&Ou(i)&&(i=gi[i]),Ru(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:x,...y}=this.options,P=Vu(t,y);t=P.keyframes,t.length===1&&(t[1]=t[0]),r=P.duration,s=P.times,i=P.ease,o="keyframes"}const u=ju(l.owner.current,a,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(gs(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(Gt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Re(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Re(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Ae(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return be;const{animation:r}=n;gs(r,t)}return be}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...m}=this.options,x=new Jn({...m,keyframes:r,duration:s,type:i,ease:o,times:l,isGenerator:!0}),y=Ae(this.time);c.setWithVelocity(x.sample(y-Ht).value,x.sample(y).value,Ht)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:c}=n.owner.getProps();return Mu()&&r&&Au.has(r)&&!a&&!c&&!s&&i!=="mirror"&&o!==0&&l!=="inertia"}}const Lu={type:"spring",stiffness:500,damping:25,restSpeed:10},ku=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_u={type:"keyframes",duration:.8},Iu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fu=(e,{keyframes:t})=>t.length>2?_u:Ue.has(e)?e.startsWith("scale")?ku(t[1]):Lu:Iu;function Nu({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:l,from:a,elapsed:c,...u}){return!!Object.keys(u).length}const Qn=(e,t,n,r={},s,i)=>o=>{const l=Sn(r,e)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ae(a);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};Nu(l)||(u={...u,...Fu(e,u)}),u.duration&&(u.duration=Ae(u.duration)),u.repeatDelay&&(u.repeatDelay=Ae(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),(bl.current||Ur.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=Gt(u.keyframes,l);if(h!==void 0)return te.update(()=>{u.onUpdate(h),u.onComplete()}),new rl([])}return!i&&yi.supports(u)?new yi(u):new Jn(u)};function Bu({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...a}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in a){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=a[f];if(m===void 0||u&&Bu(u,f))continue;const x={delay:n,...Sn(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Ms(e);if(b){const S=window.MotionHandoffAnimation(b,f,te);S!==null&&(x.startTime=S,y=!0)}}Ln(e,f),h.start(Qn(f,h,m,e.shouldReduceMotion&&Es.has(f)?{type:!1}:x,e,y));const P=h.animation;P&&c.push(P)}return l&&Promise.all(c).then(()=>{te.update(()=>{l&&vl(e,l)})}),c}function er(e,t,n={}){var r;const s=gt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(vi(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return $u(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,l]:[l,o];return c().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function $u(e,t,n=0,r=0,s=1,i){const o=[],l=(e.variantChildren.size-1)*r,a=s===1?(c=0)=>c*r:(c=0)=>l-c*r;return Array.from(e.variantChildren).sort(Uu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(er(c,t,{...i,delay:n+a(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Uu(e,t){return e.sortNodePosition(t)}function Wu(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>er(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=er(e,t,n);else{const s=typeof t=="function"?gt(e,t,n.custom):t;r=Promise.all(vi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function xi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const zu=cn.length;function bi(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?bi(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<zu;n++){const r=cn[n],s=e.props[r];(dt(s)||s===!1)&&(t[r]=s)}return t}const Yu=[...un].reverse(),Ku=un.length;function Gu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Wu(e,n,r)))}function qu(e){let t=Gu(e),n=Ti(),r=!0;const s=a=>(c,u)=>{var f;const h=gt(e,u,a==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:x,...y}=h;c={...c,...y,...x}}return c};function i(a){t=a(e)}function o(a){const{props:c}=e,u=bi(e.parent)||{},f=[],h=new Set;let m={},x=1/0;for(let P=0;P<Ku;P++){const b=Yu[P],S=n[b],C=c[b]!==void 0?c[b]:u[b],D=dt(C),p=b===a?S.isActive:null;p===!1&&(x=P);let M=C===u[b]&&C!==c[b]&&D;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),S.protectedKeys={...m},!S.isActive&&p===null||!C&&!S.prevProp||Bt(C)||typeof C=="boolean")continue;const B=Hu(S.prevProp,C);let R=B||b===a&&S.isActive&&!M&&D||P>x&&D,Q=!1;const Y=Array.isArray(C)?C:[C];let ae=Y.reduce(s(b),{});p===!1&&(ae={});const{prevResolvedValues:Te={}}=S,ce={...Te,...ae},se=O=>{R=!0,h.has(O)&&(Q=!0,h.delete(O)),S.needsAnimating[O]=!0;const k=e.getValue(O);k&&(k.liveStyle=!1)};for(const O in ce){const k=ae[O],le=Te[O];if(m.hasOwnProperty(O))continue;let T=!1;wn(k)&&wn(le)?T=!xi(k,le):T=k!==le,T?k!=null?se(O):h.add(O):k!==void 0&&h.has(O)?se(O):S.protectedKeys[O]=!0}S.prevProp=C,S.prevResolvedValues=ae,S.isActive&&(m={...m,...ae}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(M&&B)||Q)&&f.push(...Y.map(O=>({animation:O,options:{type:b}})))}if(h.size){const P={};if(typeof c.initial!="boolean"){const b=gt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(P.transition=b.transition)}h.forEach(b=>{const S=e.getBaseTarget(b),C=e.getValue(b);C&&(C.liveStyle=!0),P[b]=S??null}),f.push({animation:P})}let y=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function l(a,c){var u;if(n[a].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(a,c)}),n[a].isActive=c;const f=o(a);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ti(),r=!0}}}function Hu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xi(t,e):!1}function Ye(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ti(){return{animate:Ye(!0),whileInView:Ye(),whileHover:Ye(),whileTap:Ye(),whileDrag:Ye(),whileFocus:Ye(),exit:Ye()}}class Ne{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Xu extends Ne{constructor(t){super(t),t.animationState||(t.animationState=qu(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Zu=0;class Ju extends Ne{constructor(){super(...arguments),this.id=Zu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Qu={animation:{Feature:Xu},exit:{Feature:Ju}};function Et(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function At(e){return{point:{x:e.pageX,y:e.pageY}}}const ec=e=>t=>Mn(t)&&e(t,At(t));function rt(e,t,n,r){return Et(e,t,ec(n),r)}function wi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function tc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function nc(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Pi=1e-4,rc=1-Pi,sc=1+Pi,Si=.01,ic=0-Si,oc=0+Si;function ye(e){return e.max-e.min}function ac(e,t,n){return Math.abs(e-t)<=n}function Ci(e,t,n,r=.5){e.origin=r,e.originPoint=ne(t.min,t.max,e.origin),e.scale=ye(n)/ye(t),e.translate=ne(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rc&&e.scale<=sc||isNaN(e.scale))&&(e.scale=1),(e.translate>=ic&&e.translate<=oc||isNaN(e.translate))&&(e.translate=0)}function jt(e,t,n,r){Ci(e.x,t.x,n.x,r?r.originX:void 0),Ci(e.y,t.y,n.y,r?r.originY:void 0)}function Ei(e,t,n){e.min=n.min+t.min,e.max=e.min+ye(t)}function lc(e,t,n){Ei(e.x,t.x,n.x),Ei(e.y,t.y,n.y)}function Ai(e,t,n){e.min=t.min-n.min,e.max=e.min+ye(t)}function Mt(e,t,n){Ai(e.x,t.x,n.x),Ai(e.y,t.y,n.y)}const ji=()=>({translate:0,scale:1,origin:0,originPoint:0}),st=()=>({x:ji(),y:ji()}),Mi=()=>({min:0,max:0}),ie=()=>({x:Mi(),y:Mi()});function we(e){return[e("x"),e("y")]}function tr(e){return e===void 0||e===1}function nr({scale:e,scaleX:t,scaleY:n}){return!tr(e)||!tr(t)||!tr(n)}function Ke(e){return nr(e)||Di(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Di(e){return Ri(e.x)||Ri(e.y)}function Ri(e){return e&&e!=="0%"}function Xt(e,t,n){const r=e-n,s=t*r;return n+s}function Vi(e,t,n,r,s){return s!==void 0&&(e=Xt(e,s,r)),Xt(e,n,r)+t}function rr(e,t=0,n=1,r,s){e.min=Vi(e.min,t,n,r,s),e.max=Vi(e.max,t,n,r,s)}function Oi(e,{x:t,y:n}){rr(e.x,t.translate,t.scale,t.originPoint),rr(e.y,n.translate,n.scale,n.originPoint)}const Li=.999999999999,ki=1.0000000000001;function uc(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:a}=i.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ot(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Oi(e,o)),r&&Ke(i.latestValues)&&ot(e,i.latestValues))}t.x<ki&&t.x>Li&&(t.x=1),t.y<ki&&t.y>Li&&(t.y=1)}function it(e,t){e.min=e.min+t,e.max=e.max+t}function _i(e,t,n,r,s=.5){const i=ne(e.min,e.max,s);rr(e,t,n,i,r)}function ot(e,t){_i(e.x,t.x,t.scaleX,t.scale,t.originX),_i(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ii(e,t){return wi(nc(e.getBoundingClientRect(),t))}function cc(e,t,n){const r=Ii(e,n),{scroll:s}=t;return s&&(it(r.x,s.offset.x),it(r.y,s.offset.y)),r}const Fi=(e,t)=>Math.abs(e-t);function fc(e,t){const n=Fi(e.x,t.x),r=Fi(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ni{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=ir(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=fc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:x}=he;this.history.push({...m,timestamp:x});const{onStart:y,onMove:P}=this.handlers;f||(y&&y(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=sr(f,this.transformPagePoint),te.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Yt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ir(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:sr(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},!Mn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=At(t),o=sr(i,this.transformPagePoint),{point:l}=o,{timestamp:a}=he;this.history=[{...l,timestamp:a}];const{onSessionStart:c}=n;c&&c(t,ir(o,this.history)),Yt(t,"set"),this.removeListeners=St(rt(t.currentTarget,"pointermove",this.handlePointerMove),rt(t.currentTarget,"pointerup",this.handlePointerUp),rt(t.currentTarget,"pointercancel",this.handlePointerUp),rt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),_e(this.updatePoint)}}function sr(e,t){return t?{point:t(e.point)}:e}function Bi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ir({point:e},t){return{point:e,delta:Bi(e,$i(t)),offset:Bi(e,dc(t)),velocity:hc(t,.1)}}function dc(e){return e[0]}function $i(e){return e[e.length-1]}function hc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=$i(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ae(t)));)n--;if(!r)return{x:0,y:0};const i=Re(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function pc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ne(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ne(n,e,r.max):Math.min(e,n)),e}function Ui(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function mc(e,{top:t,left:n,bottom:r,right:s}){return{x:Ui(e.x,n,s),y:Ui(e.y,t,r)}}function Wi(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function gc(e,t){return{x:Wi(e.x,t.x),y:Wi(e.y,t.y)}}function yc(e,t){let n=.5;const r=ye(e),s=ye(t);return s>r?n=Xe(t.min,t.max-r,e.min):r>s&&(n=Xe(e.min,e.max-s,t.min)),Ve(0,1,n)}function vc(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const or=.35;function xc(e=or){return e===!1?e=0:e===!0&&(e=or),{x:zi(e,"left","right"),y:zi(e,"top","bottom")}}function zi(e,t,n){return{min:Yi(e,t),max:Yi(e,n)}}function Yi(e,t){return typeof e=="number"?e:e[t]||0}const bc=new WeakMap;class Tc{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ie(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(At(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:x}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=hl(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),we(P=>{let b=this.getAxisMotionValue(P).get()||0;if(je.test(b)){const{projection:S}=this.visualElement;if(S&&S.layout){const C=S.layout.layoutBox[P];C&&(b=ye(C)*(parseFloat(b)/100))}}this.originPoint[P]=b}),x&&te.postRender(()=>x(u,f)),Ln(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:x,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:P}=f;if(m&&this.currentDirection===null){this.currentDirection=wc(P),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",f.point,P),this.updateAxis("y",f.point,P),this.visualElement.render(),y&&y(u,f)},l=(u,f)=>this.stop(u,f),a=()=>we(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ni(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:l,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&te.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Zt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=pc(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&Je(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=mc(s.layoutBox,n):this.constraints=!1,this.elastic=xc(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&we(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Je(t))return!1;const r=t.current;Le(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=cc(r,s.root,this.visualElement.getTransformPagePoint());let o=gc(s.layout.layoutBox,i);if(n){const l=n(tc(o));this.hasMutatedConstraints=!!l,l&&(o=wi(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=we(u=>{if(!Zt(u,n,this.currentDirection))return;let f=a&&a[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,x={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,x)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ln(this.visualElement,t),r.start(Qn(t,r,0,n,this.visualElement,!1))}stopAnimation(){we(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){we(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){we(n=>{const{drag:r}=this.getProps();if(!Zt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];i.set(t[n]-ne(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Je(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};we(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();s[o]=yc({min:a,max:a},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),we(o=>{if(!Zt(o,t,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(ne(a,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;bc.set(this.visualElement,this);const t=this.visualElement.current,n=rt(t,"pointerdown",a=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(a)}),r=()=>{const{dragConstraints:a}=this.getProps();Je(a)&&a.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),te.read(r);const o=Et(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:a,hasLayoutChanged:c})=>{this.isDragging&&c&&(we(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=a[u].translate,f.set(f.get()+a[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=or,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Zt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Pc extends Ne{constructor(t){super(t),this.removeGroupControls=be,this.removeListeners=be,this.controls=new Tc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||be}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ki=e=>(t,n)=>{e&&te.postRender(()=>e(t,n))};class Sc extends Ne{constructor(){super(...arguments),this.removePointerDownListener=be}onPointerDown(t){this.session=new Ni(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ki(t),onStart:Ki(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&te.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=rt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Dt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(V.test(e))e=parseFloat(e);else return e;const n=Gi(e,t.target.x),r=Gi(e,t.target.y);return`${n}% ${r}%`}},Cc={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Fe.parse(e);if(s.length>5)return r;const i=Fe.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,a=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=a;const c=ne(l,a,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class Ec extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Da(Ac),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||te.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),dn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function qi(e){const[t,n]=Fr(),r=v.useContext(nn);return g.exports.jsx(Ec,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(Zr),isPresent:t,safeToRemove:n})}const Ac={borderRadius:{...Dt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Dt,borderTopRightRadius:Dt,borderBottomLeftRadius:Dt,borderBottomRightRadius:Dt,boxShadow:Cc};function jc(e,t,n){const r=pe(e)?e:xt(e);return r.start(Qn("",r,t,n)),r.animation}function Mc(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Dc=(e,t)=>e.depth-t.depth;class Rc{constructor(){this.children=[],this.isDirty=!1}add(t){Rn(this.children,t),this.isDirty=!0}remove(t){Vn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Dc),this.isDirty=!1,this.children.forEach(t)}}function Vc(e,t){const n=Me.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(_e(r),e(i-t))};return te.read(r,!0),()=>_e(r)}const Hi=["TopLeft","TopRight","BottomLeft","BottomRight"],Oc=Hi.length,Xi=e=>typeof e=="string"?parseFloat(e):e,Zi=e=>typeof e=="number"||V.test(e);function Lc(e,t,n,r,s,i){s?(e.opacity=ne(0,n.opacity!==void 0?n.opacity:1,kc(r)),e.opacityExit=ne(t.opacity!==void 0?t.opacity:1,0,_c(r))):i&&(e.opacity=ne(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Oc;o++){const l=`border${Hi[o]}Radius`;let a=Ji(t,l),c=Ji(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Zi(a)===Zi(c)?(e[l]=Math.max(ne(Xi(a),Xi(c),r),0),(je.test(c)||je.test(a))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=ne(t.rotate||0,n.rotate||0,r))}function Ji(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const kc=Qi(0,.5,_s),_c=Qi(.5,.95,be);function Qi(e,t,n){return r=>r<e?0:r>t?1:n(Xe(e,t,r))}function eo(e,t){e.min=t.min,e.max=t.max}function Pe(e,t){eo(e.x,t.x),eo(e.y,t.y)}function to(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function no(e,t,n,r,s){return e-=t,e=Xt(e,1/n,r),s!==void 0&&(e=Xt(e,1/s,r)),e}function Ic(e,t=0,n=1,r=.5,s,i=e,o=e){if(je.test(t)&&(t=parseFloat(t),t=ne(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ne(i.min,i.max,r);e===i&&(l-=t),e.min=no(e.min,t,n,l,s),e.max=no(e.max,t,n,l,s)}function ro(e,t,[n,r,s],i,o){Ic(e,t[n],t[r],t[s],t.scale,i,o)}const Fc=["x","scaleX","originX"],Nc=["y","scaleY","originY"];function so(e,t,n,r){ro(e.x,t,Fc,n?n.x:void 0,r?r.x:void 0),ro(e.y,t,Nc,n?n.y:void 0,r?r.y:void 0)}function io(e){return e.translate===0&&e.scale===1}function oo(e){return io(e.x)&&io(e.y)}function ao(e,t){return e.min===t.min&&e.max===t.max}function Bc(e,t){return ao(e.x,t.x)&&ao(e.y,t.y)}function lo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uo(e,t){return lo(e.x,t.x)&&lo(e.y,t.y)}function co(e){return ye(e.x)/ye(e.y)}function fo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class $c{constructor(){this.members=[]}add(t){Rn(this.members,t),t.scheduleRender()}remove(t){if(Vn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Uc(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:m,skewY:x}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),x&&(r+=`skewY(${x}deg) `)}const l=e.x.scale*t.x,a=e.y.scale*t.y;return(l!==1||a!==1)&&(r+=`scale(${l}, ${a})`),r||"none"}const Ge={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ar=["","X","Y","Z"],Wc={visibility:"hidden"},ho=1e3;let zc=0;function lr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function po(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ms(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",te,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&po(r)}function mo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=zc++,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,ke.value&&(Ge.nodes=Ge.calculatedTargetDeltas=Ge.calculatedProjections=0),this.nodes.forEach(Gc),this.nodes.forEach(Jc),this.nodes.forEach(Qc),this.nodes.forEach(qc),ke.addProjectionMetrics&&ke.addProjectionMetrics(Ge)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new Rc)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new On),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const a=this.eventHandlers.get(o);a&&a.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Mc(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(c||a)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Vc(h,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(yo))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||sf,{onLayoutAnimationStart:P,onLayoutAnimationComplete:b}=u.getProps(),S=!this.targetLayout||!uo(this.targetLayout,x),C=!h&&m;if(this.options.layoutRoot||this.resumeFrom||C||h&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const D={...Sn(y,"layout"),onPlay:P,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(D.delay=0,D.type=!1),this.startAnimation(D)}else h||yo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,_e(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(ef),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&po(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:a}=this.options;if(l===void 0&&!a)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(go);return}this.isUpdating||this.nodes.forEach(Xc),this.isUpdating=!1,this.nodes.forEach(Zc),this.nodes.forEach(Yc),this.nodes.forEach(Kc),this.clearAllSnapshots();const l=Me.now();he.delta=Ve(0,1e3/60,l-he.timestamp),he.timestamp=l,he.isProcessing=!0,ln.update.process(he),ln.preRender.process(he),ln.render.process(he),he.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hc),this.sharedNodes.forEach(tf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,te.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){te.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ye(this.snapshot.measuredBox.x)&&!ye(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 a=0;a<this.path.length;a++)this.path[a].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ie(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const a=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:a,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:a}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oo(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(l||Ke(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let a=this.removeElementScroll(l);return o&&(a=this.removeTransform(a)),of(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return ie();const a=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(af))){const{scroll:u}=this.root;u&&(it(a.x,u.offset.x),it(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=ie();if(Pe(a,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Pe(a,o),it(a.x,f.offset.x),it(a.y,f.offset.y))}return a}applyTransform(o,l=!1){const a=ie();Pe(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ot(a,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ke(u.latestValues)&&ot(a,u.latestValues)}return Ke(this.latestValues)&&ot(a,this.latestValues),a}removeTransform(o){const l=ie();Pe(l,o);for(let a=0;a<this.path.length;a++){const c=this.path[a];if(!c.instance||!Ke(c.latestValues))continue;nr(c.latestValues)&&c.updateSnapshot();const u=ie(),f=c.measurePageBox();Pe(u,f),so(l,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ke(this.latestValues)&&so(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==he.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=he.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ie(),this.relativeTargetOrigin=ie(),Mt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ie(),this.targetWithTransforms=ie()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Pe(this.target,this.layout.layoutBox),Oi(this.target,this.targetDelta)):Pe(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&Boolean(m.resumingFrom)===Boolean(this.resumingFrom)&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ie(),this.relativeTargetOrigin=ie(),Mt(this.relativeTargetOrigin,this.target,m.target),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ke.value&&Ge.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nr(this.parent.latestValues)||Di(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),a=Boolean(this.resumingFrom)||this!==l;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===he.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;Pe(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;uc(this.layoutCorrected,this.treeScale,this.path,a),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=ie());const{target:x}=l;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(to(this.prevProjectionDelta.x,this.projectionDelta.x),to(this.prevProjectionDelta.y,this.projectionDelta.y)),jt(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!fo(this.projectionDelta.x,this.prevProjectionDelta.x)||!fo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x)),ke.value&&Ge.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=st(),this.projectionDelta=st(),this.projectionDeltaWithTransform=st()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},f=st();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=ie(),m=a?a.source:void 0,x=this.layout?this.layout.source:void 0,y=m!==x,P=this.getStack(),b=!P||P.members.length<=1,S=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(rf));this.animationProgress=0;let C;this.mixTargetDelta=D=>{const p=D/1e3;vo(f.x,o.x,p),vo(f.y,o.y,p),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nf(this.relativeTarget,this.relativeTargetOrigin,h,p),C&&Bc(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ie()),Pe(C,this.relativeTarget)),y&&(this.animationValues=u,Lc(u,c,this.latestValues,p,S,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=p},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(_e(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=te.update(()=>{Jt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=jc(0,ho,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onStop:()=>{Pt.layout--},onComplete:()=>{Pt.layout--,o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ho),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:a,layout:c,latestValues:u}=o;if(!(!l||!a||!c)){if(this!==o&&this.layout&&c&&Po(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||ie();const f=ye(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+f;const h=ye(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+h}Pe(l,a),ot(l,u),jt(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new $c),this.sharedNodes.get(o).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:a}={}){const c=this.getStack();c&&c.promote(this,a),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:a}=o;if((a.z||a.rotate||a.rotateX||a.rotateY||a.rotateZ||a.skewX||a.skewY)&&(l=!0),!l)return;const c={};a.z&&lr("z",o,c,this.animationValues);for(let u=0;u<ar.length;u++)lr(`rotate${ar[u]}`,o,c,this.animationValues),lr(`skew${ar[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var l,a;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Wc;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ke(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Uc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y:x}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${x.origin*100}% 0`,f.animationValues?c.opacity=f===this?(a=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&a!==void 0?a:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in ht){if(h[y]===void 0)continue;const{correct:P,applyTo:b,isCSSVariable:S}=ht[y],C=c.transform==="none"?h[y]:P(h[y],f);if(b){const D=b.length;for(let p=0;p<D;p++)c[b[p]]=C}else S?this.options.visualElement.renderState.vars[y]=C:c[y]=C}return this.options.layoutId&&(c.pointerEvents=f===this?Wt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(go),this.root.sharedNodes.clear()}}}function Yc(e){e.updateLayout()}function Kc(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?we(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=ye(h);h.min=r[f].min,h.max=h.min+m}):Po(i,n.layoutBox,r)&&we(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=ye(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const l=st();jt(l,r,n.layoutBox);const a=st();o?jt(a,e.applyTransform(s,!0),n.measuredBox):jt(a,r,n.layoutBox);const c=!oo(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const x=ie();Mt(x,n.layoutBox,h.layoutBox);const y=ie();Mt(y,r,m.layoutBox),uo(x,y)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:a,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Gc(e){ke.value&&Ge.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hc(e){e.clearSnapshot()}function go(e){e.clearMeasurements()}function Xc(e){e.isLayoutDirty=!1}function Zc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function yo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jc(e){e.resolveTargetDelta()}function Qc(e){e.calcProjection()}function ef(e){e.resetSkewAndRotation()}function tf(e){e.removeLeadSnapshot()}function vo(e,t,n){e.translate=ne(t.translate,0,n),e.scale=ne(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xo(e,t,n,r){e.min=ne(t.min,n.min,r),e.max=ne(t.max,n.max,r)}function nf(e,t,n,r){xo(e.x,t.x,n.x,r),xo(e.y,t.y,n.y,r)}function rf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sf={duration:.45,ease:[.4,0,.1,1]},bo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),To=bo("applewebkit/")&&!bo("chrome/")?Math.round:be;function wo(e){e.min=To(e.min),e.max=To(e.max)}function of(e){wo(e.x),wo(e.y)}function Po(e,t,n){return e==="position"||e==="preserve-aspect"&&!ac(co(t),co(n),.2)}function af(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const lf=mo({attachResizeListener:(e,t)=>Et(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ur={current:void 0},So=mo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ur.current){const e=new lf({});e.mount(window),e.setOptions({layoutScroll:!0}),ur.current=e}return ur.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),uf={pan:{Feature:Sc},drag:{Feature:Pc,ProjectionNode:So,MeasureLayout:qi}};function Co(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&te.postRender(()=>i(t,At(t)))}class cf extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=al(t,(n,r)=>(Co(this.node,r,"Start"),s=>Co(this.node,s,"End"))))}unmount(){}}class ff extends Ne{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=St(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Eo(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&te.postRender(()=>i(t,At(t)))}class df extends Ne{mount(){const{current:t}=this.node;t&&(this.unmount=fl(t,(n,r)=>(Eo(this.node,r,"Start"),(s,{success:i})=>Eo(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cr=new WeakMap,fr=new WeakMap,hf=e=>{const t=cr.get(e.target);t&&t(e)},pf=e=>{e.forEach(hf)};function mf({root:e,...t}){const n=e||document;fr.has(n)||fr.set(n,{});const r=fr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(pf,{root:e,...t})),r[s]}function gf(e,t,n){const r=mf(t);return cr.set(e,n),r.observe(e),()=>{cr.delete(e),r.unobserve(e)}}const yf={some:0,all:1};class vf extends Ne{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:yf[s]},l=a=>{const{isIntersecting:c}=a;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(a)};return gf(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xf(t,n))&&this.startObserver()}unmount(){}}function xf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const bf={inView:{Feature:vf},tap:{Feature:df},focus:{Feature:ff},hover:{Feature:cf}},Tf={layout:{ProjectionNode:So,MeasureLayout:qi}},dr={current:null},Ao={current:!1};function wf(){if(Ao.current=!0,!!on)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>dr.current=e.matches;e.addListener(t),t()}else dr.current=!1}const Pf=[...ei,me,Fe],Sf=e=>Pf.find(Qs(e)),Cf=new WeakMap;function Ef(e,t,n){for(const r in t){const s=t[r],i=n[r];if(pe(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Ft(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(pe(i))e.addValue(r,xt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,xt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const jo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Af{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Me.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,te.render(this.render,!1,!0))};const{latestValues:a,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=$t(n),this.isVariantNode=qr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in h){const x=h[m];a[m]!==void 0&&pe(x)&&x.set(a[m],!1)}}mount(t){this.current=t,Cf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Ao.current||wf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dr.current,process.env.NODE_ENV!=="production"&&Ft(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(),_e(this.notifyUpdate),_e(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ue.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&te.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ze){const n=Ze[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ie()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<jo.length;r++){const s=jo[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Ef(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=xt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Zs(s)||Fs(s))?s=parseFloat(s):!Sf(s)&&Fe.test(n)&&(s=Ys(t,n)),this.setBaseTarget(t,pe(s)?s.get():s)),pe(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Tn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!pe(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new On),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Mo extends Af{constructor(){super(...arguments),this.KeyframeResolver=ni}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;pe(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function jf(e){return window.getComputedStyle(e)}class Mf extends Mo{constructor(){super(...arguments),this.type="html",this.renderInstance=cs}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}else{const r=jf(t),s=(hn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Ii(t,n)}build(t,n,r){gn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class Df extends Mo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ie,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&us(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}return n=fs.has(n)?n:fn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return hs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&te.postRender(this.updateDimensions)}build(t,n,r){xn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ds(t,n,r,s)}mount(t){this.isSVGTag=bn(t.tagName),super.mount(t)}}const Rf=(e,t)=>vn(e)?new Df(t):new Mf(t,{allowProjection:e!==v.Fragment}),Vf=el({...Qu,...bf,...uf,...Tf},Rf),hr=ya(Vf),Of=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?g.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:g.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:g.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[g.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[g.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),g.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[g.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:g.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),g.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),g.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:g.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),g.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[g.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),g.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,Lf=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=v.useRef(null),[o,l]=v.useState(!1);return v.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),l(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:$e.createPortal(g.exports.jsx($r,{children:t&&g.exports.jsx(hr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((a,c)=>a!=null&&a.onlyCurrentUserMessage&&!s?null:g.exports.jsxs("button",{disabled:a==null?void 0:a.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>a.onClick(r),children:[v.cloneElement(a.icon,{className:"text-black",size:18}),g.exports.jsx("span",{className:"ml-2 text-black",children:a.name})]},c))})}),i.current)},kf=()=>g.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),_f=()=>g.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),Do=()=>g.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:g.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),pr=e=>g.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:g.exports.jsxs("g",{fill:"none",children:[g.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),g.exports.jsx("path",{className:" fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),g.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),g.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),If=({onSendMessage:e,onSendVoice:t,onFileSend:n,dynamicSymbolAssignments:r})=>{const[s,i]=v.useState(""),[o,l]=v.useState(!1),[a,c]=v.useState(0),[u,f]=v.useState(null),[h,m]=v.useState(null),[x,y]=v.useState(0),P=v.useRef(null),b=v.useRef([]),S=v.useRef(null),C=v.useRef(null),D=v.useRef(null),[p,M]=v.useState(!1),B=I=>{const O=I.target.value;i(O);const k=O.match(/(\S+)$/);if(k){const le=k[0];if(u){const T=k[0].split(u)[1];m(T)}r!=null&&r.some(T=>T.symbol===le)&&f(le)}else f(null)},R=(I,O)=>{i(k=>k+O+" "),f(null),C.current.focus()},Q=()=>{s.trim()!==""&&(e(s),i(""),f(null))},Y=async()=>{l(!0),c(0),b.current=[],S.current=setInterval(()=>{c(k=>k+1)},1e3);const I=await navigator.mediaDevices.getUserMedia({audio:!0}),O=new MediaRecorder(I);P.current=O,O.ondataavailable=k=>{k.data.size>0&&b.current.push(k.data)},O.onstop=()=>{clearInterval(S.current);const k=new Blob(b.current,{type:"audio/mp3"}),le=URL.createObjectURL(k);t(le),l(!1)},O.start()},ae=()=>{var I;(I=P.current)==null||I.stop()},Te=()=>{var I;(I=D.current)==null||I.click()},ce=I=>{var k;const O=(k=I.target.files)==null?void 0:k[0];O&&n(O)},se=I=>{const O=Math.floor(I/60),k=I%60;return`${O.toString().padStart(2,"0")}:${k.toString().padStart(2,"0")}`},ve=I=>{const{scrollTop:O,scrollHeight:k,clientHeight:le}=I.currentTarget;if(O>x){if(O+le>=k-1){const E=r==null?void 0:r.find(_=>_.symbol===u);E&&(E!=null&&E.updatePageNumber)&&(M(!0),E==null||E.updatePageNumber(E.pagNumber+1),y(O),setTimeout(()=>{M(!1)},500))}}else y(O)};return g.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[o?g.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[g.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:se(a)}),g.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:ae,children:g.exports.jsx(Do,{})})]}):g.exports.jsxs(g.exports.Fragment,{children:[g.exports.jsxs("div",{className:"w-[90%] relative ",children:[g.exports.jsx("div",{onClick:Te,className:"cursor-pointer absolute right-4 top-[11px]",children:g.exports.jsx(kf,{})}),g.exports.jsx("input",{type:"file",ref:D,style:{display:"none"},onChange:ce}),g.exports.jsx("input",{type:"text",ref:C,className:"w-full bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",placeholder:"Type a message...",value:s,onChange:B,onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),Q())}}),g.exports.jsx(pr,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),g.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:s?Q:Y,children:s?g.exports.jsx(Do,{}):g.exports.jsx(_f,{})})]}),u&&g.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:ve,children:[g.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[g.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",g.exports.jsx("span",{className:"text-blue-500",children:u})]}),g.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>f(null),children:"✕"})]}),g.exports.jsxs("div",{className:"space-y-2",children:[r?r.filter(I=>I.symbol===u).map(I=>{var le;const{component:O,lists:k}=I;return O?h?(le=k==null?void 0:k.filter(T=>T==null?void 0:T.name.includes(h)))==null?void 0:le.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,F)=>R(_,F)})},E)):k==null?void 0:k.map((T,E)=>g.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:g.exports.jsx(O,{listsProps:T,onClick:(_,F)=>R(_,F)})},E)):null}):null,g.exports.jsx("div",{className:"h-8",children:p&&"Loading more items..."})]})]})]})};var Be=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Be||{});const Ro=({fileName:e,fileSize:t,format:n,src:r})=>{const s=()=>({rar:g.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:g.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:g.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:g.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:g.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),"":g.exports.jsx("p",{className:"p-2 text-black font-bold",children:n})})[n||""],i=o=>o>1048576?(o/1048576).toFixed(1)+" MB":(o/1024).toFixed(1)+" KB";return g.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[g.exports.jsx("div",{className:"mr-3 relative border border-green-950 rounded-md p-3",children:s()}),g.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[g.exports.jsx("a",{href:r,download:e,className:"text-gray-900 font-medium hover:underline",children:e}),g.exports.jsx("span",{className:"text-gray-600 text-sm",children:i(t)})]}),g.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},Ff=e=>g.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:g.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Nf=e=>g.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[g.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),g.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Rt=null;const Bf=({src:e,className:t})=>{const[n,r]=v.useState(!1),[s,i]=v.useState(0),o=v.useRef(null);v.useEffect(()=>{const a=o.current;if(!a)return;const c=()=>{i(a.currentTime/a.duration*100)},u=()=>r(!0),f=()=>r(!1),h=()=>{r(!1),i(0)};return a.addEventListener("timeupdate",c),a.addEventListener("play",u),a.addEventListener("pause",f),a.addEventListener("ended",h),()=>{a.removeEventListener("timeupdate",c),a.removeEventListener("play",u),a.removeEventListener("pause",f),a.removeEventListener("ended",h)}},[]);const l=()=>{const a=o.current;a&&(n?a.pause():(Rt&&Rt!==a&&(Rt.pause(),Rt.currentTime=0),a.play(),Rt=a))};return g.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[g.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:l,children:n?g.exports.jsx(Nf,{}):g.exports.jsx(Ff,{})}),g.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:g.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${s}%`}})}),g.exports.jsx("audio",{ref:o,src:e})]})},$f=({attachment:e,attachmentType:t})=>e?t===Be.Voice?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx(Bf,{src:e})}):t===Be.Image?g.exports.jsx("div",{className:"w-full",children:g.exports.jsx("img",{src:e})}):t===Be.File?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Ro,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):t===Be.Video?g.exports.jsx("div",{className:"w-full mt-1",children:g.exports.jsx(Ro,{fileName:"productivity",fileSize:23e3,format:"rar",src:e})}):null:null,Uf=({message:e,showUserProfile:t,handleContextMenu:n,media:r})=>{var s,i,o,l,a;return g.exports.jsxs(g.exports.Fragment,{children:[t?g.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:c=>n(c,e),className:`relative ${r?"w-3/4":"w-fit max-w-3/4"}flex flex-col gap-1 md:max-w-[400px] p-2 pt-5 rounded-lg bg-green-200`,children:[g.exports.jsx("span",{className:"absolute top-1 text-xs text-orange-700",children:(s=e.user)!=null&&s.fullName&&((o=(i=e.user)==null?void 0:i.fullName)==null?void 0:o.length)>16?(l=e.user)==null?void 0:l.firstName:(a=e.user)==null?void 0:a.fullName}),r||null,g.exports.jsx("span",{children:e.text}),g.exports.jsx("div",{className:"w-full flex gap- items-center justify-end",children:g.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]})}),g.exports.jsx(pr,{className:"fill-blue-200 -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 [&>g>path]:fill-green-200"})]})]})},Wf=()=>g.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[g.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),g.exports.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),Vo=({size:e=24,color:t="text-current",className:n})=>g.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:g.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[g.exports.jsx("defs",{children:g.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[g.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),g.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),g.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),g.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[g.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),g.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),zf=({handleContextMenu:e,media:t,message:n})=>g.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:r=>e(r,n),className:`relative self-end ${t?"w-3/4":"max-w-3/4"} flex flex-col justify-center md:max-w-[400px] p-2 rounded-lg bg-blue-200`,children:[t||null,g.exports.jsx("span",{children:n.text}),g.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[g.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?g.exports.jsx(Vo,{size:13,color:"text-black"}):g.exports.jsx(Wf,{})]}),g.exports.jsx(pr,{className:"fill-blue-200 rotate-180 absolute -right-2 bottom-0 [&>g>path]:fill-blue-200"})]});var fe={exports:{}},mr={exports:{}},Z={};var Oo;function Yf(){if(Oo)return Z;Oo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(p){if(typeof p=="object"&&p!==null){var M=p.$$typeof;switch(M){case t:switch(p=p.type,p){case a:case c:case r:case i:case s:case f:return p;default:switch(p=p&&p.$$typeof,p){case l:case u:case x:case m:case o:return p;default:return M}}case n:return M}}}function D(p){return C(p)===c}return Z.AsyncMode=a,Z.ConcurrentMode=c,Z.ContextConsumer=l,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=u,Z.Fragment=r,Z.Lazy=x,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(p){return D(p)||C(p)===a},Z.isConcurrentMode=D,Z.isContextConsumer=function(p){return C(p)===l},Z.isContextProvider=function(p){return C(p)===o},Z.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},Z.isForwardRef=function(p){return C(p)===u},Z.isFragment=function(p){return C(p)===r},Z.isLazy=function(p){return C(p)===x},Z.isMemo=function(p){return C(p)===m},Z.isPortal=function(p){return C(p)===n},Z.isProfiler=function(p){return C(p)===i},Z.isStrictMode=function(p){return C(p)===s},Z.isSuspense=function(p){return C(p)===f},Z.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===c||p===i||p===s||p===f||p===h||typeof p=="object"&&p!==null&&(p.$$typeof===x||p.$$typeof===m||p.$$typeof===o||p.$$typeof===l||p.$$typeof===u||p.$$typeof===P||p.$$typeof===b||p.$$typeof===S||p.$$typeof===y)},Z.typeOf=C,Z}var J={};var Lo;function Kf(){return Lo||(Lo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,m=e?Symbol.for("react.memo"):60115,x=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function C(j){return typeof j=="string"||typeof j=="function"||j===r||j===c||j===i||j===s||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===x||j.$$typeof===m||j.$$typeof===o||j.$$typeof===l||j.$$typeof===u||j.$$typeof===P||j.$$typeof===b||j.$$typeof===S||j.$$typeof===y)}function D(j){if(typeof j=="object"&&j!==null){var Se=j.$$typeof;switch(Se){case t:var at=j.type;switch(at){case a:case c:case r:case i:case s:case f:return at;default:var qe=at&&at.$$typeof;switch(qe){case l:case u:case x:case m:case o:return qe;default:return Se}}case n:return Se}}}var p=a,M=c,B=l,R=o,Q=t,Y=u,ae=r,Te=x,ce=m,se=n,ve=i,I=s,O=f,k=!1;function le(j){return k||(k=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),T(j)||D(j)===a}function T(j){return D(j)===c}function E(j){return D(j)===l}function _(j){return D(j)===o}function F(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function N(j){return D(j)===u}function G(j){return D(j)===r}function $(j){return D(j)===x}function U(j){return D(j)===m}function W(j){return D(j)===n}function H(j){return D(j)===i}function z(j){return D(j)===s}function ge(j){return D(j)===f}J.AsyncMode=p,J.ConcurrentMode=M,J.ContextConsumer=B,J.ContextProvider=R,J.Element=Q,J.ForwardRef=Y,J.Fragment=ae,J.Lazy=Te,J.Memo=ce,J.Portal=se,J.Profiler=ve,J.StrictMode=I,J.Suspense=O,J.isAsyncMode=le,J.isConcurrentMode=T,J.isContextConsumer=E,J.isContextProvider=_,J.isElement=F,J.isForwardRef=N,J.isFragment=G,J.isLazy=$,J.isMemo=U,J.isPortal=W,J.isProfiler=H,J.isStrictMode=z,J.isSuspense=ge,J.isValidElementType=C,J.typeOf=D}()),J}var ko;function _o(){return ko||(ko=1,function(e){process.env.NODE_ENV==="production"?e.exports=Yf():e.exports=Kf()}(mr)),mr.exports}var gr,Io;function Gf(){if(Io)return gr;Io=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},l=0;l<10;l++)o["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return gr=s()?Object.assign:function(i,o){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(a[f]=l[f]);if(e){c=e(l);for(var h=0;h<c.length;h++)n.call(l,c[h])&&(a[c[h]]=l[c[h]])}}return a},gr}var yr,Fo;function vr(){if(Fo)return yr;Fo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yr=e,yr}var xr,No;function Bo(){return No||(No=1,xr=Function.call.bind(Object.prototype.hasOwnProperty)),xr}var br,$o;function qf(){if($o)return br;$o=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=vr(),n={},r=Bo();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,l,a,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var h=Error((a||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[u](o,u,a,l,null,t)}catch(x){f=x}if(f&&!(f instanceof Error)&&e((a||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var m=c?c():"";e("Failed "+l+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},br=s,br}var Tr,Uo;function Hf(){if(Uo)return Tr;Uo=1;var e=_o(),t=Gf(),n=vr(),r=Bo(),s=qf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(l){var a="Warning: "+l;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}});function o(){return null}return Tr=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var E=T&&(c&&T[c]||T[u]);if(typeof E=="function")return E}var h="<<anonymous>>",m={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:S(),arrayOf:C,element:D(),elementType:p(),instanceOf:M,node:Y(),objectOf:R,oneOf:B,oneOfType:Q,shape:Te,exact:ce};function x(T,E){return T===E?T!==0||1/T===1/E:T!==T&&E!==E}function y(T,E){this.message=T,this.data=E&&typeof E=="object"?E:{},this.stack=""}y.prototype=Error.prototype;function P(T){if(process.env.NODE_ENV!=="production")var E={},_=0;function F(G,$,U,W,H,z,ge){if(W=W||h,z=z||U,ge!==n){if(a){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Se=W+":"+U;!E[Se]&&_<3&&(i("You are manually calling a React.PropTypes validation function for the `"+z+"` prop on `"+W+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),E[Se]=!0,_++)}}return $[U]==null?G?$[U]===null?new y("The "+H+" `"+z+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new y("The "+H+" `"+z+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:T($,U,W,H,z)}var N=F.bind(null,!1);return N.isRequired=F.bind(null,!0),N}function b(T){function E(_,F,N,G,$,U){var W=_[F],H=I(W);if(H!==T){var z=O(W);return new y("Invalid "+G+" `"+$+"` of type "+("`"+z+"` supplied to `"+N+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return P(E)}function S(){return P(o)}function C(T){function E(_,F,N,G,$){if(typeof T!="function")return new y("Property `"+$+"` of component `"+N+"` has invalid PropType notation inside arrayOf.");var U=_[F];if(!Array.isArray(U)){var W=I(U);return new y("Invalid "+G+" `"+$+"` of type "+("`"+W+"` supplied to `"+N+"`, expected an array."))}for(var H=0;H<U.length;H++){var z=T(U,H,N,G,$+"["+H+"]",n);if(z instanceof Error)return z}return null}return P(E)}function D(){function T(E,_,F,N,G){var $=E[_];if(!l($)){var U=I($);return new y("Invalid "+N+" `"+G+"` of type "+("`"+U+"` supplied to `"+F+"`, expected a single ReactElement."))}return null}return P(T)}function p(){function T(E,_,F,N,G){var $=E[_];if(!e.isValidElementType($)){var U=I($);return new y("Invalid "+N+" `"+G+"` of type "+("`"+U+"` supplied to `"+F+"`, expected a single ReactElement type."))}return null}return P(T)}function M(T){function E(_,F,N,G,$){if(!(_[F]instanceof T)){var U=T.name||h,W=le(_[F]);return new y("Invalid "+G+" `"+$+"` of type "+("`"+W+"` supplied to `"+N+"`, expected ")+("instance of `"+U+"`."))}return null}return P(E)}function B(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function E(_,F,N,G,$){for(var U=_[F],W=0;W<T.length;W++)if(x(U,T[W]))return null;var H=JSON.stringify(T,function(ge,j){var Se=O(j);return Se==="symbol"?String(j):j});return new y("Invalid "+G+" `"+$+"` of value `"+String(U)+"` "+("supplied to `"+N+"`, expected one of "+H+"."))}return P(E)}function R(T){function E(_,F,N,G,$){if(typeof T!="function")return new y("Property `"+$+"` of component `"+N+"` has invalid PropType notation inside objectOf.");var U=_[F],W=I(U);if(W!=="object")return new y("Invalid "+G+" `"+$+"` of type "+("`"+W+"` supplied to `"+N+"`, expected an object."));for(var H in U)if(r(U,H)){var z=T(U,H,N,G,$+"."+H,n);if(z instanceof Error)return z}return null}return P(E)}function Q(T){if(!Array.isArray(T))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var E=0;E<T.length;E++){var _=T[E];if(typeof _!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+k(_)+" at index "+E+"."),o}function F(N,G,$,U,W){for(var H=[],z=0;z<T.length;z++){var ge=T[z],j=ge(N,G,$,U,W,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&H.push(j.data.expectedType)}var Se=H.length>0?", expected one of type ["+H.join(", ")+"]":"";return new y("Invalid "+U+" `"+W+"` supplied to "+("`"+$+"`"+Se+"."))}return P(F)}function Y(){function T(E,_,F,N,G){return se(E[_])?null:new y("Invalid "+N+" `"+G+"` supplied to "+("`"+F+"`, expected a ReactNode."))}return P(T)}function ae(T,E,_,F,N){return new y((T||"React class")+": "+E+" type `"+_+"."+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+N+"`.")}function Te(T){function E(_,F,N,G,$){var U=_[F],W=I(U);if(W!=="object")return new y("Invalid "+G+" `"+$+"` of type `"+W+"` "+("supplied to `"+N+"`, expected `object`."));for(var H in T){var z=T[H];if(typeof z!="function")return ae(N,G,$,H,O(z));var ge=z(U,H,N,G,$+"."+H,n);if(ge)return ge}return null}return P(E)}function ce(T){function E(_,F,N,G,$){var U=_[F],W=I(U);if(W!=="object")return new y("Invalid "+G+" `"+$+"` of type `"+W+"` "+("supplied to `"+N+"`, expected `object`."));var H=t({},_[F],T);for(var z in H){var ge=T[z];if(r(T,z)&&typeof ge!="function")return ae(N,G,$,z,O(ge));if(!ge)return new y("Invalid "+G+" `"+$+"` key `"+z+"` supplied to `"+N+"`.\nBad object: "+JSON.stringify(_[F],null," ")+`
|
|
20
|
-
Valid keys: `+JSON.stringify(Object.keys(T),null," "));var j=ge(U,z,N,G,$+"."+z,n);if(j)return j}return null}return P(E)}function se(T){switch(typeof T){case"number":case"string":case"undefined":return!0;case"boolean":return!T;case"object":if(Array.isArray(T))return T.every(se);if(T===null||l(T))return!0;var E=f(T);if(E){var _=E.call(T),F;if(E!==T.entries){for(;!(F=_.next()).done;)if(!se(F.value))return!1}else for(;!(F=_.next()).done;){var N=F.value;if(N&&!se(N[1]))return!1}}else return!1;return!0;default:return!1}}function ve(T,E){return T==="symbol"?!0:E?E["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&E instanceof Symbol:!1}function I(T){var E=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":ve(E,T)?"symbol":E}function O(T){if(typeof T>"u"||T===null)return""+T;var E=I(T);if(E==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return E}function k(T){var E=O(T);switch(E){case"array":case"object":return"an "+E;case"boolean":case"date":case"regexp":return"a "+E;default:return E}}function le(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Tr}var wr,Wo;function Xf(){if(Wo)return wr;Wo=1;var e=vr();function t(){}function n(){}return n.resetWarningCache=t,wr=function(){function r(o,l,a,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},wr}if(process.env.NODE_ENV!=="production"){var Zf=_o(),Jf=!0;fe.exports=Hf()(Zf.isElement,Jf)}else fe.exports=Xf()();function Pr(){return Pr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pr.apply(this,arguments)}function Qf(e,t){if(e==null)return{};var n=ed(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ed(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Sr=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=Qf(e,["color","size"]);return v.createElement("svg",Pr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),v.createElement("polyline",{points:"20 6 9 17 4 12"}))});Sr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Sr.displayName="Check";const td=Sr;function Cr(){return Cr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cr.apply(this,arguments)}function nd(e,t){if(e==null)return{};var n=rd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Er=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=nd(e,["color","size"]);return v.createElement("svg",Cr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),v.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),v.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});Er.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Er.displayName="Copy";const sd=Er;function Ar(){return Ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ar.apply(this,arguments)}function id(e,t){if(e==null)return{};var n=od(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function od(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var jr=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=id(e,["color","size"]);return v.createElement("svg",Ar({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),v.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),v.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});jr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},jr.displayName="Edit";const ad=jr;function Mr(){return Mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}function ld(e,t){if(e==null)return{};var n=ud(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ud(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Dr=v.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ld(e,["color","size"]);return v.createElement("svg",Mr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),v.createElement("polyline",{points:"3 6 5 6 21 6"}),v.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});Dr.propTypes={color:fe.exports.string,size:fe.exports.oneOfType([fe.exports.string,fe.exports.number])},Dr.displayName="Trash";const cd=Dr,fd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,onDeleteMessage:i})=>{const o=v.useRef(null),[l,a]=v.useState(!1),[c,u]=v.useState(null),[f,h]=v.useState(null),m=()=>{setTimeout(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},100)};v.useEffect(()=>{const p=()=>{h(null)};return window.addEventListener("scroll",p,!0),()=>{window.removeEventListener("scroll",p,!0)}},[h]);const x=(p,M)=>{p.preventDefault();const B=window.scrollX,R=window.scrollY;h({x:p.clientX+B,y:p.clientY+R,message:M})},y=()=>{h(null)},P=p=>{const M=new Ot({id:new Date().toString(),text:p,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),m()},b=p=>{const M=new Ot({id:new Date().toString(),text:"",attachment:p,attachmentType:Be.Voice,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),m()},S=p=>{const M=URL.createObjectURL(p),B=new Ot({id:new Date().toString(),text:"",attachment:M,attachmentType:Be.File,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,B]),r(B),m()};return{handleDeleteConfirmation:()=>{c&&(i(c),u(null)),a(!1)},handleCloseContextMenu:y,contextMenuItems:[{name:"Edit",icon:g.exports.jsx(ad,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:p=>{console.log("Edit clicked"),y(),s(p)}},{name:"Delete",icon:g.exports.jsx(cd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:p=>{u(p),a(!0),y()}},{name:"Select",icon:g.exports.jsx(td,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),y()}},{name:"Copy",icon:g.exports.jsx(sd,{className:"text-blue-600"}),onClick:p=>{const M=t.find(B=>B.id===p);M&&navigator.clipboard.writeText(M.text),y()}}],handleSendFile:S,handleSendVoice:b,handleSendMessage:P,handleContextMenu:x,isModalOpen:l,contextMenu:f,chatRef:o,setIsModalOpen:a}},dd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:l,onMessageSent:a,onDeleteMessage:c,onEditMessage:u,dynamicSymbolAssignments:f,backgroundImage:h})=>{var R,Q;const{handleDeleteConfirmation:m,handleCloseContextMenu:x,handleSendFile:y,handleSendVoice:P,handleSendMessage:b,handleContextMenu:S,contextMenuItems:C,isModalOpen:D,contextMenu:p,chatRef:M,setIsModalOpen:B}=fd({user:o,messages:i,updateMessages:l,onMessageSent:a,onEditMessage:u,onDeleteMessage:c});return g.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+h+")",...s},onClick:x,children:[g.exports.jsx("div",{ref:M,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${p?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?g.exports.jsx(Vo,{className:"mt-3",size:27,color:"text-gray-800"}):g.exports.jsx($r,{children:i.map((Y,ae)=>{var se,ve,I;const Te=Y!=null&&Y.attachment?g.exports.jsx($f,{attachment:Y.attachment,attachmentType:Y==null?void 0:Y.attachmentType},ae):null;if(Y.isRightSided)return g.exports.jsx(zf,{media:Te,handleContextMenu:S,message:Y},ae);const ce=((ve=(se=i[ae-1])==null?void 0:se.user)==null?void 0:ve.id)!==((I=Y==null?void 0:Y.user)==null?void 0:I.id);return g.exports.jsx(Uf,{showUserProfile:ce,media:Te,handleContextMenu:S,message:Y},ae)})})}),g.exports.jsx(Of,{isOpen:D,onClose:()=>B(!1),onConfirm:m,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),p&&((R=p==null?void 0:p.message)!=null&&R.id)?g.exports.jsx(Lf,{items:C,isVisible:Boolean(p),messageId:String(p==null?void 0:p.message.id),isCurrentUserMessage:((Q=p==null?void 0:p.message)==null?void 0:Q.user.id)===o.id,position:{x:p==null?void 0:p.x,y:p==null?void 0:p.y}}):null,g.exports.jsx(If,{onSendVoice:P,onSendMessage:b,onFileSend:y,dynamicSymbolAssignments:f})]})};de.AttachmentTypeEnum=Be,de.Button=oa,de.Chat=dd,de.MessageEntity=Ot,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
|
|
19
|
+
`),()=>{document.head.removeChild(g)}},[t]),m.exports.jsx(aa,{isPresent:t,childRef:s,sizeRef:i,children:tn.cloneElement(e,{ref:s})})}const ua=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l})=>{const a=rn(ca),c=x.useId(),u=x.useCallback(h=>{a.set(h,!0);for(const g of a.values())if(!g)return;r&&r()},[a,r]),f=x.useMemo(()=>({id:c,initial:t,isPresent:n,custom:s,onExitComplete:u,register:h=>(a.set(h,!1),()=>a.delete(h))}),i?[Math.random(),u]:[n,u]);return x.useMemo(()=>{a.forEach((h,g)=>a.set(g,!1))},[n]),tn.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=m.exports.jsx(la,{isPresent:n,anchorX:l,children:e})),m.exports.jsx(Lt.Provider,{value:f,children:e})};function ca(){return new Map}function Fr(e=!0){const t=x.useContext(Lt);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=x.useId();x.useEffect(()=>{if(e)return s(i)},[e]);const o=x.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const kt=e=>e.key||"";function Nr(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const on=typeof window<"u",Br=on?x.useLayoutEffect:x.useEffect,$r=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left"})=>{const[a,c]=Fr(o),u=x.useMemo(()=>Nr(e),[e]),f=o&&!a?[]:u.map(kt),h=x.useRef(!0),g=x.useRef(u),b=rn(()=>new Map),[y,P]=x.useState(u),[T,C]=x.useState(u);Br(()=>{h.current=!1,g.current=u;for(let p=0;p<T.length;p++){const M=kt(T[p]);f.includes(M)?b.delete(M):b.get(M)!==!0&&b.set(M,!1)}},[T,f.length,f.join("-")]);const E=[];if(u!==y){let p=[...u];for(let M=0;M<T.length;M++){const $=T[M],R=kt($);f.includes(R)||(p.splice(M,0,$),E.push($))}return i==="wait"&&E.length&&(p=E),C(Nr(p)),P(u),null}process.env.NODE_ENV!=="production"&&i==="wait"&&T.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}=x.useContext(nn);return m.exports.jsx(m.exports.Fragment,{children:T.map(p=>{const M=kt(p),$=o&&!a?!1:u===T||f.includes(M),R=()=>{if(b.has(M))b.set(M,!0);else return;let X=!0;b.forEach(N=>{N||(X=!1)}),X&&(V==null||V(),C(g.current),o&&(c==null||c()),r&&r())};return m.exports.jsx(ua,{isPresent:$,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:$?void 0:R,anchorX:l,children:p},M)})})},be=e=>e;let He=be,ke=be;process.env.NODE_ENV!=="production"&&(He=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},ke=(e,t)=>{if(!e)throw new Error(t)});function an(e){let t;return()=>(t===void 0&&(t=e()),t)}const Xe=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},je=e=>e*1e3,Ve=e=>e/1e3,Ur={skipAnimations:!1,useManualTiming:!1},_t=["read","resolveKeyframes","update","preRender","render","postRender"],_e={value:null,addProjectionMetrics:null};function fa(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},a=0;function c(f){o.has(f)&&(u.schedule(f),e()),a++,f(l)}const u={schedule:(f,h=!1,g=!1)=>{const y=g&&s?n:r;return h&&o.add(f),y.has(f)||y.add(f),f},cancel:f=>{r.delete(f),o.delete(f)},process:f=>{if(l=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(c),t&&_e.value&&_e.value.frameloop[t].push(a),a=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const da=40;function Wr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=_t.reduce((T,C)=>(T[C]=fa(i,t?C:void 0),T),{}),{read:l,resolveKeyframes:a,update:c,preRender:u,render:f,postRender:h}=o,g=()=>{const T=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,da),1),s.timestamp=T,s.isProcessing=!0,l.process(s),a.process(s),c.process(s),u.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},b=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:_t.reduce((T,C)=>{const E=o[C];return T[C]=(V,p=!1,M=!1)=>(n||b(),E.schedule(V,p,M)),T},{}),cancel:T=>{for(let C=0;C<_t.length;C++)o[_t[C]].cancel(T)},state:s,steps:o}}const{schedule:Q,cancel:Ie,state:de,steps:ln}=Wr(typeof requestAnimationFrame<"u"?requestAnimationFrame:be,!0),zr=x.createContext({strict:!1}),Yr={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ze={};for(const e in Yr)Ze[e]={isEnabled:t=>Yr[e].some(n=>!!t[n])};function ha(e){for(const t in e)Ze[t]={...Ze[t],...e[t]}}const pa=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 It(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pa.has(e)}let Kr=e=>!It(e);function ma(e){e&&(Kr=t=>t.startsWith("on")?!It(t):e(t))}try{ma(require("@emotion/is-prop-valid").default)}catch{}function ga(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Kr(s)||n===!0&&It(s)||!t&&!It(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const qr=new Set;function Ft(e,t,n){e||qr.has(t)||(console.warn(t),n&&console.warn(n),qr.add(t))}function ya(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Ft(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Nt=x.createContext({});function Bt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function dt(e){return typeof e=="string"||Array.isArray(e)}const un=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cn=["initial",...un];function $t(e){return Bt(e.animate)||cn.some(t=>dt(e[t]))}function Gr(e){return Boolean($t(e)||e.variants)}function va(e,t){if($t(e)){const{initial:n,animate:r}=e;return{initial:n===!1||dt(n)?n:void 0,animate:dt(r)?r:void 0}}return e.inherit!==!1?t:{}}function xa(e){const{initial:t,animate:n}=va(e,x.useContext(Nt));return x.useMemo(()=>({initial:t,animate:n}),[Hr(t),Hr(n)])}function Hr(e){return Array.isArray(e)?e.join(" "):e}const ba=Symbol.for("motionComponentSymbol");function Je(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ta(e,t,n){return x.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Je(n)&&(n.current=r))},[t])}const fn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xr="data-"+fn("framerAppearId"),{schedule:dn,cancel:Fd}=Wr(queueMicrotask,!1),Zr=x.createContext({});function wa(e,t,n,r,s){var i,o;const{visualElement:l}=x.useContext(Nt),a=x.useContext(zr),c=x.useContext(Lt),u=x.useContext(sn).reducedMotion,f=x.useRef(null);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const h=f.current,g=x.useContext(Zr);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Sa(f.current,n,s,g);const b=x.useRef(!1);x.useInsertionEffect(()=>{h&&b.current&&h.update(n,c)});const y=n[Xr],P=x.useRef(Boolean(y)&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,y))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,y)));return Br(()=>{h&&(b.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),dn.render(h.render),P.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!P.current&&h.animationState&&h.animationState.animateChanges(),P.current&&(queueMicrotask(()=>{var T;(T=window.MotionHandoffMarkAsComplete)===null||T===void 0||T.call(window,y)}),P.current=!1))}),h}function Sa(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:l,layoutScroll:a,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Jr(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||l&&Je(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:c})}function Jr(e){if(e)return e.options.allowProjection!==!1?e.projection:Jr(e.parent)}function Pa({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ha(e);function l(c,u){let f;const h={...x.useContext(sn),...c,layoutId:Ca(c)},{isStatic:g}=h,b=xa(c),y=r(c,g);if(!g&&on){Ea(h,e);const P=Aa(h);f=P.MeasureLayout,b.visualElement=wa(s,y,h,t,P.ProjectionNode)}return m.exports.jsxs(Nt.Provider,{value:b,children:[f&&b.visualElement?m.exports.jsx(f,{visualElement:b.visualElement,...h}):null,n(s,c,Ta(y,b.visualElement,u),y,g,b.visualElement)]})}l.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const a=x.forwardRef(l);return a[ba]=s,a}function Ca({layoutId:e}){const t=x.useContext(nn).id;return t&&e!==void 0?t+"-"+e:e}function Ea(e,t){const n=x.useContext(zr).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?He(!1,r):ke(!1,r)}}function Aa(e){const{drag:t,layout:n}=Ze;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Qr=e=>t=>typeof t=="string"&&t.startsWith(e),hn=Qr("--"),ja=Qr("var(--"),pn=e=>ja(e)?Ma.test(e.split("/*")[0].trim()):!1,Ma=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ht={};function Da(e){for(const t in e)ht[t]=e[t],hn(t)&&(ht[t].isCSSVariable=!0)}const Qe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ue=new Set(Qe);function es(e,{layout:t,layoutId:n}){return Ue.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ht[e]||e==="opacity")}const he=e=>Boolean(e&&e.getVelocity),ts=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Oe=(e,t,n)=>n>t?t:n<e?e:n,et={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},pt={...et,transform:e=>Oe(0,1,e)},Ut={...et,default:1},mt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=mt("deg"),Me=mt("%"),L=mt("px"),Ra=mt("vh"),Va=mt("vw"),ns={...Me,parse:e=>Me.parse(e)/100,transform:e=>Me.transform(e*100)},Oa={borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,radius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,top:L,right:L,bottom:L,left:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,backgroundPositionX:L,backgroundPositionY:L},La={rotate:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:Ut,scaleX:Ut,scaleY:Ut,scaleZ:Ut,skew:Fe,skewX:Fe,skewY:Fe,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,transformPerspective:L,opacity:pt,originX:ns,originY:ns,originZ:L},rs={...et,transform:Math.round},mn={...Oa,...La,zIndex:rs,size:L,fillOpacity:pt,strokeOpacity:pt,numOctaves:rs},ka={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},_a=Qe.length;function Ia(e,t,n){let r="",s=!0;for(let i=0;i<_a;i++){const o=Qe[i],l=e[o];if(l===void 0)continue;let a=!0;if(typeof l=="number"?a=l===(o.startsWith("scale")?1:0):a=parseFloat(l)===0,!a||n){const c=ts(l,mn[o]);if(!a){s=!1;const u=ka[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function gn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,l=!1;for(const a in t){const c=t[a];if(Ue.has(a)){o=!0;continue}else if(hn(a)){s[a]=c;continue}else{const u=ts(c,mn[a]);a.startsWith("origin")?(l=!0,i[a]=u):r[a]=u}}if(t.transform||(o||n?r.transform=Ia(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:a="50%",originY:c="50%",originZ:u=0}=i;r.transformOrigin=`${a} ${c} ${u}`}}const yn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function ss(e,t,n){for(const r in t)!he(t[r])&&!es(r,n)&&(e[r]=t[r])}function Fa({transformTemplate:e},t){return x.useMemo(()=>{const n=yn();return gn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Na(e,t){const n=e.style||{},r={};return ss(r,n,e),Object.assign(r,Fa(e,t)),r}function Ba(e,t){const n={},r=Na(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const $a=["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 vn(e){return typeof e!="string"||e.includes("-")?!1:!!($a.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ua={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wa={offset:"strokeDashoffset",array:"strokeDasharray"};function za(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ua:Wa;e[i.offset]=L.transform(-r);const o=L.transform(t),l=L.transform(n);e[i.array]=`${o} ${l}`}function is(e,t,n){return typeof e=="string"?e:L.transform(t+n*e)}function Ya(e,t,n){const r=is(t,e.x,e.width),s=is(n,e.y,e.height);return`${r} ${s}`}function xn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:l=1,pathOffset:a=0,...c},u,f){if(gn(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:g,dimensions:b}=e;h.transform&&(b&&(g.transform=h.transform),delete h.transform),b&&(s!==void 0||i!==void 0||g.transform)&&(g.transformOrigin=Ya(b,s!==void 0?s:.5,i!==void 0?i:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),o!==void 0&&za(h,o,l,a,!1)}const os=()=>({...yn(),attrs:{}}),bn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ka(e,t,n,r){const s=x.useMemo(()=>{const i=os();return xn(i,t,bn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};ss(i,e.style,e),s.style={...i,...s.style}}return s}function qa(e=!1){return(n,r,s,{latestValues:i},o)=>{const a=(vn(n)?Ka:Ba)(r,i,o,n),c=ga(r,typeof n=="string",e),u=n!==x.Fragment?{...c,...a,ref:s}:{},{children:f}=r,h=x.useMemo(()=>he(f)?f.get():f,[f]);return x.createElement(n,{...u,children:h})}}function as(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Tn(e,t,n,r){if(typeof t=="function"){const[s,i]=as(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=as(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const wn=e=>Array.isArray(e),Ga=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ha=e=>wn(e)?e[e.length-1]||0:e;function Wt(e){const t=he(e)?e.get():e;return Ga(t)?t.toValue():t}function Xa({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:Za(r,s,i,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const ls=e=>(t,n)=>{const r=x.useContext(Nt),s=x.useContext(Lt),i=()=>Xa(e,t,r,s);return n?i():rn(i)};function Za(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Wt(i[h]);let{initial:o,animate:l}=e;const a=$t(e),c=Gr(e);t&&c&&!a&&e.inherit!==!1&&(o===void 0&&(o=t.initial),l===void 0&&(l=t.animate));let u=n?n.initial===!1:!1;u=u||o===!1;const f=u?l:o;if(f&&typeof f!="boolean"&&!Bt(f)){const h=Array.isArray(f)?f:[f];for(let g=0;g<h.length;g++){const b=Tn(e,h[g]);if(b){const{transitionEnd:y,transition:P,...T}=b;for(const C in T){let E=T[C];if(Array.isArray(E)){const V=u?E.length-1:0;E=E[V]}E!==null&&(s[C]=E)}for(const C in y)s[C]=y[C]}}}return s}function Sn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(he(s[o])||t.style&&he(t.style[o])||es(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(i[o]=s[o]);return i}const Ja={useVisualState:ls({scrapeMotionValuesFromProps:Sn,createRenderState:yn})};function us(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function cs(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const fs=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 ds(e,t,n,r){cs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(fs.has(s)?s:fn(s),t.attrs[s])}function hs(e,t,n){const r=Sn(e,t,n);for(const s in e)if(he(e[s])||he(t[s])){const i=Qe.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const ps=["x","y","width","height","cx","cy","r"],Qa={useVisualState:ls({scrapeMotionValuesFromProps:hs,createRenderState:os,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in s)if(Ue.has(l)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let l=0;l<ps.length;l++){const a=ps[l];e[a]!==t[a]&&(o=!0)}o&&Q.read(()=>{us(n,r),Q.render(()=>{xn(r,s,bn(n.tagName),e.transformTemplate),ds(n,r)})})}})};function el(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...vn(r)?Qa:Ja,preloadedFeatures:e,useRender:qa(s),createVisualElement:t,Component:r};return Pa(o)}}function gt(e,t,n){const r=e.getProps();return Tn(r,t,n!==void 0?n:r.custom,e)}const tl=an(()=>window.ScrollTimeline!==void 0);class nl{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(tl()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,i)=>{s&&s(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class rl extends nl{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Pn(e,t){return e?e[t]||e.default||e:void 0}const Cn=2e4;function ms(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Cn;)t+=n,r=e.next(t);return t>=Cn?1/0:t}function En(e){return typeof e=="function"}function gs(e,t){e.timeline=t,e.onfinish=null}const An=e=>Array.isArray(e)&&typeof e[0]=="number",sl={linearEasing:void 0};function il(e,t){const n=an(e);return()=>{var r;return(r=sl[t])!==null&&r!==void 0?r:n()}}const zt=il(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ys=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Xe(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function vs(e){return Boolean(typeof e=="function"&&zt()||!e||typeof e=="string"&&(e in jn||zt())||An(e)||Array.isArray(e)&&e.every(vs))}const yt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function xs(e,t){if(e)return typeof e=="function"&&zt()?ys(e,t):An(e)?yt(e):Array.isArray(e)?e.map(n=>xs(n,t)||jn.easeOut):jn[e]}const Ee={x:!1,y:!1};function bs(){return Ee.x||Ee.y}function ol(e,t,n){var r;if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;t&&(s=t.current);const i=(r=n==null?void 0:n[e])!==null&&r!==void 0?r:s.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Ts(e,t){const n=ol(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function ws(e){return!(e.pointerType==="touch"||bs())}function al(e,t,n={}){const[r,s,i]=Ts(e,n),o=l=>{if(!ws(l))return;const{target:a}=l,c=t(a,l);if(typeof c!="function"||!a)return;const u=f=>{ws(f)&&(c(f),a.removeEventListener("pointerleave",u))};a.addEventListener("pointerleave",u,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),i}function Yt(e,t){const n=`${t}PointerCapture`;if(e.target instanceof Element&&n in e.target&&e.pointerId!==void 0)try{e.target[n](e.pointerId)}catch{}}const Ss=(e,t)=>t?e===t?!0:Ss(e,t.parentElement):!1,Mn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ll=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function ul(e){return ll.has(e.tagName)||e.tabIndex!==-1}const vt=new WeakSet;function Ps(e){return t=>{t.key==="Enter"&&e(t)}}function Dn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const cl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Ps(()=>{if(vt.has(n))return;Dn(n,"down");const s=Ps(()=>{Dn(n,"up")}),i=()=>Dn(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Cs(e){return Mn(e)&&!bs()}function fl(e,t,n={}){const[r,s,i]=Ts(e,n),o=l=>{const a=l.currentTarget;if(!a||!Cs(l)||vt.has(a))return;vt.add(a),Yt(l,"set");const c=t(a,l),u=(g,b)=>{a.removeEventListener("pointerup",f),a.removeEventListener("pointercancel",h),Yt(g,"release"),!(!Cs(g)||!vt.has(a))&&(vt.delete(a),typeof c=="function"&&c(g,{success:b}))},f=g=>{(g.isTrusted?dl(g,a instanceof Element?a.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?u(g,!1):u(g,!(a instanceof Element)||Ss(a,g.target))},h=g=>{u(g,!1)};a.addEventListener("pointerup",f,s),a.addEventListener("pointercancel",h,s),a.addEventListener("lostpointercapture",h,s)};return r.forEach(l=>{l=n.useGlobalTarget?window:l;let a=!1;l instanceof HTMLElement&&(a=!0,!ul(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0)),l.addEventListener("pointerdown",o,s),a&&l.addEventListener("focus",c=>cl(c,s),s)}),i}function dl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function hl(e){return e==="x"||e==="y"?Ee[e]?null:(Ee[e]=!0,()=>{Ee[e]=!1}):Ee.x||Ee.y?null:(Ee.x=Ee.y=!0,()=>{Ee.x=Ee.y=!1})}const Es=new Set(["width","height","top","left","right","bottom",...Qe]);let Kt;function pl(){Kt=void 0}const De={now:()=>(Kt===void 0&&De.set(de.isProcessing||Ur.useManualTiming?de.timestamp:performance.now()),Kt),set:e=>{Kt=e,queueMicrotask(pl)}};function Rn(e,t){e.indexOf(t)===-1&&e.push(t)}function Vn(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class On{constructor(){this.subscriptions=[]}add(t){return Rn(this.subscriptions,t),()=>Vn(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function As(e,t){return t?e*(1e3/t):0}const js=30,ml=e=>!isNaN(parseFloat(e));class gl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=De.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=De.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ml(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Ft(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new On);const r=this.events[t].add(n);return t==="change"?()=>{r(),Q.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=De.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>js)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,js);return As(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xt(e,t){return new gl(e,t)}function yl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,xt(n))}function vl(e,t){const n=gt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Ha(i[o]);yl(e,o,l)}}function xl(e){return Boolean(he(e)&&e.add)}function Ln(e,t){const n=e.getValue("willChange");if(xl(n))return n.add(t)}function Ms(e){return e.props[Xr]}const bl={current:!1},Ds=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Tl=1e-7,wl=12;function Sl(e,t,n,r,s){let i,o,l=0;do o=t+(n-t)/2,i=Ds(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Tl&&++l<wl);return o}function bt(e,t,n,r){if(e===t&&n===r)return be;const s=i=>Sl(i,0,1,e,n);return i=>i===0||i===1?i:Ds(s(i),t,r)}const Rs=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Vs=e=>t=>1-e(1-t),Os=bt(.33,1.53,.69,.99),kn=Vs(Os),Ls=Rs(kn),ks=e=>(e*=2)<1?.5*kn(e):.5*(2-Math.pow(2,-10*(e-1))),_n=e=>1-Math.sin(Math.acos(e)),_s=Vs(_n),Is=Rs(_n),Fs=e=>/^0[^.\s]+$/u.test(e);function Pl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Fs(e):!0}const Tt=e=>Math.round(e*1e5)/1e5,In=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Cl(e){return e==null}const El=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fn=(e,t)=>n=>Boolean(typeof n=="string"&&El.test(n)&&n.startsWith(e)||t&&!Cl(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ns=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(In);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Al=e=>Oe(0,255,e),Nn={...et,transform:e=>Math.round(Al(e))},We={test:Fn("rgb","red"),parse:Ns("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Nn.transform(e)+", "+Nn.transform(t)+", "+Nn.transform(n)+", "+Tt(pt.transform(r))+")"};function jl(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Bn={test:Fn("#"),parse:jl,transform:We.transform},tt={test:Fn("hsl","hue"),parse:Ns("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Me.transform(Tt(t))+", "+Me.transform(Tt(n))+", "+Tt(pt.transform(r))+")"},pe={test:e=>We.test(e)||Bn.test(e)||tt.test(e),parse:e=>We.test(e)?We.parse(e):tt.test(e)?tt.parse(e):Bn.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?We.transform(e):tt.transform(e)},Ml=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Dl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(In))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Ml))===null||n===void 0?void 0:n.length)||0)>0}const Bs="number",$s="color",Rl="var",Vl="var(",Us="${}",Ol=/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 wt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(Ol,a=>(pe.test(a)?(r.color.push(i),s.push($s),n.push(pe.parse(a))):a.startsWith(Vl)?(r.var.push(i),s.push(Rl),n.push(a)):(r.number.push(i),s.push(Bs),n.push(parseFloat(a))),++i,Us)).split(Us);return{values:n,split:l,indexes:r,types:s}}function Ws(e){return wt(e).values}function zs(e){const{split:t,types:n}=wt(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const l=n[o];l===Bs?i+=Tt(s[o]):l===$s?i+=pe.transform(s[o]):i+=s[o]}return i}}const Ll=e=>typeof e=="number"?0:e;function kl(e){const t=Ws(e);return zs(e)(t.map(Ll))}const Ne={test:Dl,parse:Ws,createTransformer:zs,getAnimatableNone:kl},_l=new Set(["brightness","contrast","saturate","opacity"]);function Il(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(In)||[];if(!r)return e;const s=n.replace(r,"");let i=_l.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Fl=/\b([a-z-]*)\(.*?\)/gu,$n={...Ne,getAnimatableNone:e=>{const t=e.match(Fl);return t?t.map(Il).join(" "):e}},Nl={...mn,color:pe,backgroundColor:pe,outlineColor:pe,fill:pe,stroke:pe,borderColor:pe,borderTopColor:pe,borderRightColor:pe,borderBottomColor:pe,borderLeftColor:pe,filter:$n,WebkitFilter:$n},Un=e=>Nl[e];function Ys(e,t){let n=Un(e);return n!==$n&&(n=Ne),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Bl=new Set(["auto","none","0"]);function $l(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Bl.has(i)&&wt(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Ys(n,s)}const Ks=e=>e===et||e===L,qs=(e,t)=>parseFloat(e.split(", ")[t]),Gs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return qs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?qs(i[1],e):0}},Ul=new Set(["x","y","z"]),Wl=Qe.filter(e=>!Ul.has(e));function zl(e){const t=[];return Wl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const nt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Gs(4,13),y:Gs(5,14)};nt.translateX=nt.x,nt.translateY=nt.y;const ze=new Set;let Wn=!1,zn=!1;function Hs(){if(zn){const e=Array.from(ze).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=zl(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var l;(l=r.getValue(i))===null||l===void 0||l.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}zn=!1,Wn=!1,ze.forEach(e=>e.complete()),ze.clear()}function Xs(){ze.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zn=!0)})}function Yl(){Xs(),Hs()}class Yn{constructor(t,n,r,s,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ze.add(this),Wn||(Wn=!0,Q.read(Xs),Q.resolveKeyframes(Hs))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const o=s==null?void 0:s.get(),l=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const a=r.readValue(n,l);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=l),s&&o===void 0&&s.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ze.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ze.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Zs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Kl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ql(e){const t=Kl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Gl=4;function Js(e,t,n=1){ke(n<=Gl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=ql(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return Zs(o)?parseFloat(o):o}return pn(s)?Js(s,t,n+1):s}const Qs=e=>t=>t.test(e),ei=[et,L,Me,Fe,Va,Ra,{test:e=>e==="auto",parse:e=>e}],ti=e=>ei.find(Qs(e));class ni extends Yn{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let a=0;a<t.length;a++){let c=t[a];if(typeof c=="string"&&(c=c.trim(),pn(c))){const u=Js(c,n.current);u!==void 0&&(t[a]=u),a===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!Es.has(r)||t.length!==2)return;const[s,i]=t,o=ti(s),l=ti(i);if(o!==l)if(Ks(o)&&Ks(l))for(let a=0;a<t.length;a++){const c=t[a];typeof c=="string"&&(t[a]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Pl(t[s])&&r.push(s);r.length&&$l(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=nt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const i=n.getValue(r);i&&i.jump(this.measuredOrigin,!1);const o=s.length-1,l=s[o];s[o]=nt[r](n.measureViewportBox(),window.getComputedStyle(n.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([a,c])=>{n.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const ri=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ne.test(e)||e==="0")&&!e.startsWith("url("));function Hl(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Xl(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=ri(s,t),l=ri(i,t);return He(o===l,`You are trying to animate ${t} from "${s}" to "${i}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${i} via the \`style\` property.`),!o||!l?!1:Hl(e)||(n==="spring"||En(n))&&r}const Zl=e=>e!==null;function qt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Zl),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const Jl=40;class si{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=De.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>Jl?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Yl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=De.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:l,onUpdate:a,isGenerator:c}=this.options;if(!c&&!Xl(t,r,s,i))if(o)this.options.duration=0;else{a&&a(qt(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const St={layout:0,mainThread:0,waapi:0},ee=(e,t,n)=>e+(t-e)*n;function Kn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Ql({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const l=n<.5?n*(1+t):n+t-n*t,a=2*n-l;s=Kn(a,l,e+1/3),i=Kn(a,l,e),o=Kn(a,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Gt(e,t){return n=>n>0?t:e}const qn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},eu=[Bn,We,tt],tu=e=>eu.find(t=>t.test(e));function ii(e){const t=tu(e);if(He(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let n=t.parse(e);return t===tt&&(n=Ql(n)),n}const oi=(e,t)=>{const n=ii(e),r=ii(t);if(!n||!r)return Gt(e,t);const s={...n};return i=>(s.red=qn(n.red,r.red,i),s.green=qn(n.green,r.green,i),s.blue=qn(n.blue,r.blue,i),s.alpha=ee(n.alpha,r.alpha,i),We.transform(s))},nu=(e,t)=>n=>t(e(n)),Pt=(...e)=>e.reduce(nu),Gn=new Set(["none","hidden"]);function ru(e,t){return Gn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function su(e,t){return n=>ee(e,t,n)}function Hn(e){return typeof e=="number"?su:typeof e=="string"?pn(e)?Gt:pe.test(e)?oi:au:Array.isArray(e)?ai:typeof e=="object"?pe.test(e)?oi:iu:Gt}function ai(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Hn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function iu(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Hn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function ou(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const o=t.types[i],l=e.indexes[o][s[o]],a=(n=e.values[l])!==null&&n!==void 0?n:0;r[i]=a,s[o]++}return r}const au=(e,t)=>{const n=Ne.createTransformer(t),r=wt(e),s=wt(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Gn.has(e)&&!s.values.length||Gn.has(t)&&!r.values.length?ru(e,t):Pt(ai(ou(r,s),s.values),n):(He(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Gt(e,t))};function li(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ee(e,t,n):Hn(e)(e,t)}const lu=5;function ui(e,t,n){const r=Math.max(t-lu,0);return As(n-e(r),t-r)}const te={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},Xn=.001;function uu({duration:e=te.duration,bounce:t=te.bounce,velocity:n=te.velocity,mass:r=te.mass}){let s,i;He(e<=je(te.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Oe(te.minDamping,te.maxDamping,o),e=Oe(te.minDuration,te.maxDuration,Ve(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,g=Zn(c,o),b=Math.exp(-f);return Xn-h/g*b},i=c=>{const f=c*o*e,h=f*n+n,g=Math.pow(o,2)*Math.pow(c,2)*e,b=Math.exp(-f),y=Zn(Math.pow(c,2),o);return(-s(c)+Xn>0?-1:1)*((h-g)*b)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Xn+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const l=5/e,a=fu(s,i,l);if(e=je(e),isNaN(a))return{stiffness:te.stiffness,damping:te.damping,duration:e};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const cu=12;function fu(e,t,n){let r=n;for(let s=1;s<cu;s++)r=r-e(r)/t(r);return r}function Zn(e,t){return e*Math.sqrt(1-t*t)}const du=["duration","bounce"],hu=["stiffness","damping","mass"];function ci(e,t){return t.some(n=>e[n]!==void 0)}function pu(e){let t={velocity:te.velocity,stiffness:te.stiffness,damping:te.damping,mass:te.mass,isResolvedFromDuration:!1,...e};if(!ci(e,hu)&&ci(e,du))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Oe(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:te.mass,stiffness:s,damping:i}}else{const n=uu(e);t={...t,...n,mass:te.mass},t.isResolvedFromDuration=!0}return t}function fi(e=te.visualDuration,t=te.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:a,damping:c,mass:u,duration:f,velocity:h,isResolvedFromDuration:g}=pu({...n,velocity:-Ve(n.velocity||0)}),b=h||0,y=c/(2*Math.sqrt(a*u)),P=o-i,T=Ve(Math.sqrt(a/u)),C=Math.abs(P)<5;r||(r=C?te.restSpeed.granular:te.restSpeed.default),s||(s=C?te.restDelta.granular:te.restDelta.default);let E;if(y<1){const p=Zn(T,y);E=M=>{const $=Math.exp(-y*T*M);return o-$*((b+y*T*P)/p*Math.sin(p*M)+P*Math.cos(p*M))}}else if(y===1)E=p=>o-Math.exp(-T*p)*(P+(b+T*P)*p);else{const p=T*Math.sqrt(y*y-1);E=M=>{const $=Math.exp(-y*T*M),R=Math.min(p*M,300);return o-$*((b+y*T*P)*Math.sinh(R)+p*P*Math.cosh(R))/p}}const V={calculatedDuration:g&&f||null,next:p=>{const M=E(p);if(g)l.done=p>=f;else{let $=0;y<1&&($=p===0?je(b):ui(E,p,M));const R=Math.abs($)<=r,X=Math.abs(o-M)<=s;l.done=R&&X}return l.value=l.done?o:M,l},toString:()=>{const p=Math.min(ms(V),Cn),M=ys($=>V.next(p*$).value,p,30);return p+"ms "+M}};return V}function di({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:a,restDelta:c=.5,restSpeed:u}){const f=e[0],h={done:!1,value:f},g=R=>l!==void 0&&R<l||a!==void 0&&R>a,b=R=>l===void 0?a:a===void 0||Math.abs(l-R)<Math.abs(a-R)?l:a;let y=n*t;const P=f+y,T=o===void 0?P:o(P);T!==P&&(y=T-f);const C=R=>-y*Math.exp(-R/r),E=R=>T+C(R),V=R=>{const X=C(R),N=E(R);h.done=Math.abs(X)<=c,h.value=h.done?T:N};let p,M;const $=R=>{g(h.value)&&(p=R,M=fi({keyframes:[h.value,b(h.value)],velocity:ui(E,R,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return $(0),{calculatedDuration:null,next:R=>{let X=!1;return!M&&p===void 0&&(X=!0,V(R),$(R)),p!==void 0&&R>=p?M.next(R-p):(!X&&V(R),h)}}}const mu=bt(.42,0,1,1),gu=bt(0,0,.58,1),hi=bt(.42,0,.58,1),yu=e=>Array.isArray(e)&&typeof e[0]!="number",pi={linear:be,easeIn:mu,easeInOut:hi,easeOut:gu,circIn:_n,circInOut:Is,circOut:_s,backIn:kn,backInOut:Ls,backOut:Os,anticipate:ks},mi=e=>{if(An(e)){ke(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return bt(t,n,r,s)}else if(typeof e=="string")return ke(pi[e]!==void 0,`Invalid easing type '${e}'`),pi[e];return e};function vu(e,t,n){const r=[],s=n||li,i=e.length-1;for(let o=0;o<i;o++){let l=s(e[o],e[o+1]);if(t){const a=Array.isArray(t)?t[o]||be:t;l=Pt(a,l)}r.push(l)}return r}function xu(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(ke(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=vu(t,r,s),a=l.length,c=u=>{if(o&&u<e[0])return t[0];let f=0;if(a>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const h=Xe(e[f],e[f+1],u);return l[f](h)};return n?u=>c(Oe(e[0],e[i-1],u)):c}function bu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Xe(0,t,r);e.push(ee(n,1,s))}}function Tu(e){const t=[0];return bu(t,e.length-1),t}function wu(e,t){return e.map(n=>n*t)}function Su(e,t){return e.map(()=>t||hi).splice(0,e.length-1)}function Ct({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=yu(r)?r.map(mi):mi(r),i={done:!1,value:t[0]},o=wu(n&&n.length===t.length?n:Tu(t),e),l=xu(o,t,{ease:Array.isArray(s)?s:Su(t,s)});return{calculatedDuration:e,next:a=>(i.value=l(a),i.done=a>=e,i)}}const Pu=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Q.update(t,!0),stop:()=>Ie(t),now:()=>de.isProcessing?de.timestamp:De.now()}},Cu={decay:di,inertia:di,tween:Ct,keyframes:Ct,spring:fi},Eu=e=>e/100;class Jn extends si{constructor(t){super(t),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:a}=this.options;a&&a()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Yn,l=(a,c)=>this.onKeyframesResolved(a,c);this.resolver=new o(i,l,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=this.options,l=En(n)?n:Cu[n]||Ct;let a,c;process.env.NODE_ENV!=="production"&&l!==Ct&&ke(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Ct&&typeof t[0]!="number"&&(a=Pt(Eu,li(t[0],t[1])),t=[0,100]);const u=l({...this.options,keyframes:t});i==="mirror"&&(c=l({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=ms(u));const{calculatedDuration:f}=u,h=f+s,g=h*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:a,calculatedDuration:f,resolvedDuration:h,totalDuration:g}}onPostResolved(){const{autoplay:t=!0}=this.options;St.mainThread++,this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:R}=this.options;return{done:!0,value:R[R.length-1]}}const{finalKeyframe:s,generator:i,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:a,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:g,repeatType:b,repeatDelay:y,onUpdate:P}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const T=this.currentTime-h*(this.speed>=0?1:-1),C=this.speed>=0?T<0:T>u;this.currentTime=Math.max(T,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let E=this.currentTime,V=i;if(g){const R=Math.min(this.currentTime,u)/f;let X=Math.floor(R),N=R%1;!N&&R>=1&&(N=1),N===1&&X--,X=Math.min(X,g+1),Boolean(X%2)&&(b==="reverse"?(N=1-N,y&&(N-=y/f)):b==="mirror"&&(V=o)),E=Oe(0,1,N)*f}const p=C?{done:!1,value:a[0]}:V.next(E);l&&(p.value=l(p.value));let{done:M}=p;!C&&c!==null&&(M=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const $=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&M);return $&&s!==void 0&&(p.value=qt(a,this.options,s)),P&&P(p.value),$&&this.finish(),p}get duration(){const{resolved:t}=this;return t?Ve(t.calculatedDuration):0}get time(){return Ve(this.currentTime)}set time(t){t=je(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Ve(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Pu,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}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(),St.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Au=new Set(["opacity","clipPath","filter","transform"]);function ju(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:l="easeInOut",times:a}={}){const c={[t]:n};a&&(c.offset=a);const u=xs(l,s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Mu=an(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Ht=10,Du=2e4;function Ru(e){return En(e.type)||e.type==="spring"||!vs(e.ease)}function Vu(e,t){const n=new Jn({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let i=0;for(;!r.done&&i<Du;)r=n.sample(i),s.push(r.value),i+=Ht;return{times:void 0,keyframes:s,duration:i-Ht,ease:"linear"}}const gi={anticipate:ks,backInOut:Ls,circInOut:Is};function Ou(e){return e in gi}class yi extends si{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ni(i,(o,l)=>this.onKeyframesResolved(o,l),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:l,name:a,startTime:c}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&zt()&&Ou(i)&&(i=gi[i]),Ru(this.options)){const{onComplete:f,onUpdate:h,motionValue:g,element:b,...y}=this.options,P=Vu(t,y);t=P.keyframes,t.length===1&&(t[1]=t[0]),r=P.duration,s=P.times,i=P.ease,o="keyframes"}const u=ju(l.owner.current,a,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(gs(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;l.set(qt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:o,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Ve(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Ve(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=je(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return be;const{animation:r}=n;gs(r,t)}return be}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:i,ease:o,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:h,...g}=this.options,b=new Jn({...g,keyframes:r,duration:s,type:i,ease:o,times:l,isGenerator:!0}),y=je(this.time);c.setWithVelocity(b.sample(y-Ht).value,b.sample(y).value,Ht)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:i,damping:o,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:a,transformTemplate:c}=n.owner.getProps();return Mu()&&r&&Au.has(r)&&!a&&!c&&!s&&i!=="mirror"&&o!==0&&l!=="inertia"}}const Lu={type:"spring",stiffness:500,damping:25,restSpeed:10},ku=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),_u={type:"keyframes",duration:.8},Iu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Fu=(e,{keyframes:t})=>t.length>2?_u:Ue.has(e)?e.startsWith("scale")?ku(t[1]):Lu:Iu;function Nu({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:l,from:a,elapsed:c,...u}){return!!Object.keys(u).length}const Qn=(e,t,n,r={},s,i)=>o=>{const l=Pn(r,e)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-je(a);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};Nu(l)||(u={...u,...Fu(e,u)}),u.duration&&(u.duration=je(u.duration)),u.repeatDelay&&(u.repeatDelay=je(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),(bl.current||Ur.skipAnimations)&&(f=!0,u.duration=0,u.delay=0),f&&!i&&t.get()!==void 0){const h=qt(u.keyframes,l);if(h!==void 0)return Q.update(()=>{u.onUpdate(h),u.onComplete()}),new rl([])}return!i&&yi.supports(u)?new yi(u):new Jn(u)};function Bu({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function vi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:l,...a}=t;r&&(o=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in a){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),g=a[f];if(g===void 0||u&&Bu(u,f))continue;const b={delay:n,...Pn(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const T=Ms(e);if(T){const C=window.MotionHandoffAnimation(T,f,Q);C!==null&&(b.startTime=C,y=!0)}}Ln(e,f),h.start(Qn(f,h,g,e.shouldReduceMotion&&Es.has(f)?{type:!1}:b,e,y));const P=h.animation;P&&c.push(P)}return l&&Promise.all(c).then(()=>{Q.update(()=>{l&&vl(e,l)})}),c}function er(e,t,n={}){var r;const s=gt(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(vi(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return $u(e,t,u+c,f,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,u]=a==="beforeChildren"?[o,l]:[l,o];return c().then(()=>u())}else return Promise.all([o(),l(n.delay)])}function $u(e,t,n=0,r=0,s=1,i){const o=[],l=(e.variantChildren.size-1)*r,a=s===1?(c=0)=>c*r:(c=0)=>l-c*r;return Array.from(e.variantChildren).sort(Uu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(er(c,t,{...i,delay:n+a(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Uu(e,t){return e.sortNodePosition(t)}function Wu(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>er(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=er(e,t,n);else{const s=typeof t=="function"?gt(e,t,n.custom):t;r=Promise.all(vi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function xi(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const zu=cn.length;function bi(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?bi(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<zu;n++){const r=cn[n],s=e.props[r];(dt(s)||s===!1)&&(t[r]=s)}return t}const Yu=[...un].reverse(),Ku=un.length;function qu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Wu(e,n,r)))}function Gu(e){let t=qu(e),n=Ti(),r=!0;const s=a=>(c,u)=>{var f;const h=gt(e,u,a==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:g,transitionEnd:b,...y}=h;c={...c,...y,...b}}return c};function i(a){t=a(e)}function o(a){const{props:c}=e,u=bi(e.parent)||{},f=[],h=new Set;let g={},b=1/0;for(let P=0;P<Ku;P++){const T=Yu[P],C=n[T],E=c[T]!==void 0?c[T]:u[T],V=dt(E),p=T===a?C.isActive:null;p===!1&&(b=P);let M=E===u[T]&&E!==c[T]&&V;if(M&&r&&e.manuallyAnimateOnMount&&(M=!1),C.protectedKeys={...g},!C.isActive&&p===null||!E&&!C.prevProp||Bt(E)||typeof E=="boolean")continue;const $=Hu(C.prevProp,E);let R=$||T===a&&C.isActive&&!M&&V||P>b&&V,X=!1;const N=Array.isArray(E)?E:[E];let se=N.reduce(s(T),{});p===!1&&(se={});const{prevResolvedValues:ye={}}=C,ae={...ye,...se},ne=Z=>{R=!0,h.has(Z)&&(X=!0,h.delete(Z)),C.needsAnimating[Z]=!0;const ue=e.getValue(Z);ue&&(ue.liveStyle=!1)};for(const Z in ae){const ue=se[Z],Se=ye[Z];if(g.hasOwnProperty(Z))continue;let v=!1;wn(ue)&&wn(Se)?v=!xi(ue,Se):v=ue!==Se,v?ue!=null?ne(Z):h.add(Z):ue!==void 0&&h.has(Z)?ne(Z):C.protectedKeys[Z]=!0}C.prevProp=E,C.prevResolvedValues=se,C.isActive&&(g={...g,...se}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(M&&$)||X)&&f.push(...N.map(Z=>({animation:Z,options:{type:T}})))}if(h.size){const P={};if(typeof c.initial!="boolean"){const T=gt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);T&&T.transition&&(P.transition=T.transition)}h.forEach(T=>{const C=e.getBaseTarget(T),E=e.getValue(T);E&&(E.liveStyle=!0),P[T]=C??null}),f.push({animation:P})}let y=Boolean(f.length);return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function l(a,c){var u;if(n[a].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(h=>{var g;return(g=h.animationState)===null||g===void 0?void 0:g.setActive(a,c)}),n[a].isActive=c;const f=o(a);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ti(),r=!0}}}function Hu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!xi(t,e):!1}function Ye(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ti(){return{animate:Ye(!0),whileInView:Ye(),whileHover:Ye(),whileTap:Ye(),whileDrag:Ye(),whileFocus:Ye(),exit:Ye()}}class Be{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Xu extends Be{constructor(t){super(t),t.animationState||(t.animationState=Gu(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bt(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Zu=0;class Ju extends Be{constructor(){super(...arguments),this.id=Zu++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Qu={animation:{Feature:Xu},exit:{Feature:Ju}};function Et(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function At(e){return{point:{x:e.pageX,y:e.pageY}}}const ec=e=>t=>Mn(t)&&e(t,At(t));function rt(e,t,n,r){return Et(e,t,ec(n),r)}function wi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function tc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function nc(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Si=1e-4,rc=1-Si,sc=1+Si,Pi=.01,ic=0-Pi,oc=0+Pi;function ge(e){return e.max-e.min}function ac(e,t,n){return Math.abs(e-t)<=n}function Ci(e,t,n,r=.5){e.origin=r,e.originPoint=ee(t.min,t.max,e.origin),e.scale=ge(n)/ge(t),e.translate=ee(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rc&&e.scale<=sc||isNaN(e.scale))&&(e.scale=1),(e.translate>=ic&&e.translate<=oc||isNaN(e.translate))&&(e.translate=0)}function jt(e,t,n,r){Ci(e.x,t.x,n.x,r?r.originX:void 0),Ci(e.y,t.y,n.y,r?r.originY:void 0)}function Ei(e,t,n){e.min=n.min+t.min,e.max=e.min+ge(t)}function lc(e,t,n){Ei(e.x,t.x,n.x),Ei(e.y,t.y,n.y)}function Ai(e,t,n){e.min=t.min-n.min,e.max=e.min+ge(t)}function Mt(e,t,n){Ai(e.x,t.x,n.x),Ai(e.y,t.y,n.y)}const ji=()=>({translate:0,scale:1,origin:0,originPoint:0}),st=()=>({x:ji(),y:ji()}),Mi=()=>({min:0,max:0}),re=()=>({x:Mi(),y:Mi()});function Te(e){return[e("x"),e("y")]}function tr(e){return e===void 0||e===1}function nr({scale:e,scaleX:t,scaleY:n}){return!tr(e)||!tr(t)||!tr(n)}function Ke(e){return nr(e)||Di(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Di(e){return Ri(e.x)||Ri(e.y)}function Ri(e){return e&&e!=="0%"}function Xt(e,t,n){const r=e-n,s=t*r;return n+s}function Vi(e,t,n,r,s){return s!==void 0&&(e=Xt(e,s,r)),Xt(e,n,r)+t}function rr(e,t=0,n=1,r,s){e.min=Vi(e.min,t,n,r,s),e.max=Vi(e.max,t,n,r,s)}function Oi(e,{x:t,y:n}){rr(e.x,t.translate,t.scale,t.originPoint),rr(e.y,n.translate,n.scale,n.originPoint)}const Li=.999999999999,ki=1.0000000000001;function uc(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:a}=i.options;a&&a.props.style&&a.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&ot(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Oi(e,o)),r&&Ke(i.latestValues)&&ot(e,i.latestValues))}t.x<ki&&t.x>Li&&(t.x=1),t.y<ki&&t.y>Li&&(t.y=1)}function it(e,t){e.min=e.min+t,e.max=e.max+t}function _i(e,t,n,r,s=.5){const i=ee(e.min,e.max,s);rr(e,t,n,i,r)}function ot(e,t){_i(e.x,t.x,t.scaleX,t.scale,t.originX),_i(e.y,t.y,t.scaleY,t.scale,t.originY)}function Ii(e,t){return wi(nc(e.getBoundingClientRect(),t))}function cc(e,t,n){const r=Ii(e,n),{scroll:s}=t;return s&&(it(r.x,s.offset.x),it(r.y,s.offset.y)),r}const Fi=(e,t)=>Math.abs(e-t);function fc(e,t){const n=Fi(e.x,t.x),r=Fi(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ni{constructor(t,n,{transformPagePoint:r,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=ir(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=fc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:g}=u,{timestamp:b}=de;this.history.push({...g,timestamp:b});const{onStart:y,onMove:P}=this.handlers;f||(y&&y(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),P&&P(this.lastMoveEvent,u)},this.handlePointerMove=(u,f)=>{if(u.target instanceof Element&&u.target.hasPointerCapture&&u.pointerId!==void 0)try{if(!u.target.hasPointerCapture(u.pointerId))return}catch{}this.lastMoveEvent=u,this.lastMoveEventInfo=sr(f,this.transformPagePoint),Q.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Yt(u,"release"),this.end();const{onEnd:h,onSessionEnd:g,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ir(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:sr(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),g&&g(u,y)},!Mn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=At(t),o=sr(i,this.transformPagePoint),{point:l}=o,{timestamp:a}=de;this.history=[{...l,timestamp:a}];const{onSessionStart:c}=n;c&&c(t,ir(o,this.history)),Yt(t,"set"),this.removeListeners=Pt(rt(t.currentTarget,"pointermove",this.handlePointerMove),rt(t.currentTarget,"pointerup",this.handlePointerUp),rt(t.currentTarget,"pointercancel",this.handlePointerUp),rt(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ie(this.updatePoint)}}function sr(e,t){return t?{point:t(e.point)}:e}function Bi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ir({point:e},t){return{point:e,delta:Bi(e,$i(t)),offset:Bi(e,dc(t)),velocity:hc(t,.1)}}function dc(e){return e[0]}function $i(e){return e[e.length-1]}function hc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=$i(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>je(t)));)n--;if(!r)return{x:0,y:0};const i=Ve(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function pc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ee(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ee(n,e,r.max):Math.min(e,n)),e}function Ui(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function mc(e,{top:t,left:n,bottom:r,right:s}){return{x:Ui(e.x,n,s),y:Ui(e.y,t,r)}}function Wi(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function gc(e,t){return{x:Wi(e.x,t.x),y:Wi(e.y,t.y)}}function yc(e,t){let n=.5;const r=ge(e),s=ge(t);return s>r?n=Xe(t.min,t.max-r,e.min):r>s&&(n=Xe(e.min,e.max-s,t.min)),Oe(0,1,n)}function vc(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const or=.35;function xc(e=or){return e===!1?e=0:e===!0&&(e=or),{x:zi(e,"left","right"),y:zi(e,"top","bottom")}}function zi(e,t,n){return{min:Yi(e,t),max:Yi(e,n)}}function Yi(e,t){return typeof e=="number"?e:e[t]||0}const bc=new WeakMap;class Tc{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=re(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(At(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:g,onDragStart:b}=this.getProps();if(h&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=hl(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),Te(P=>{let T=this.getAxisMotionValue(P).get()||0;if(Me.test(T)){const{projection:C}=this.visualElement;if(C&&C.layout){const E=C.layout.layoutBox[P];E&&(T=ge(E)*(parseFloat(T)/100))}}this.originPoint[P]=T}),b&&Q.postRender(()=>b(u,f)),Ln(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:g,onDirectionLock:b,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:P}=f;if(g&&this.currentDirection===null){this.currentDirection=wc(P),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",f.point,P),this.updateAxis("y",f.point,P),this.visualElement.render(),y&&y(u,f)},l=(u,f)=>this.stop(u,f),a=()=>Te(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Ni(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:l,resumeAnimation:a},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&Q.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!Zt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=pc(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,i=this.constraints;n&&Je(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=mc(s.layoutBox,n):this.constraints=!1,this.elastic=xc(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Te(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Je(t))return!1;const r=t.current;ke(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=cc(r,s.root,this.visualElement.getTransformPagePoint());let o=gc(s.layout.layoutBox,i);if(n){const l=n(tc(o));this.hasMutatedConstraints=!!l,l&&(o=wi(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=Te(u=>{if(!Zt(u,n,this.currentDirection))return;let f=a&&a[u]||{};o&&(f={min:0,max:0});const h=s?200:1e6,g=s?40:1e7,b={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,b)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ln(this.visualElement,t),r.start(Qn(t,r,0,n,this.visualElement,!1))}stopAnimation(){Te(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Te(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Te(n=>{const{drag:r}=this.getProps();if(!Zt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[n];i.set(t[n]-ee(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Je(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Te(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();s[o]=yc({min:a,max:a},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Te(o=>{if(!Zt(o,t,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(ee(a,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;bc.set(this.visualElement,this);const t=this.visualElement.current,n=rt(t,"pointerdown",a=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(a)}),r=()=>{const{dragConstraints:a}=this.getProps();Je(a)&&a.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Q.read(r);const o=Et(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:a,hasLayoutChanged:c})=>{this.isDragging&&c&&(Te(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=a[u].translate,f.set(f.get()+a[u].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=or,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Zt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function wc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Sc extends Be{constructor(t){super(t),this.removeGroupControls=be,this.removeListeners=be,this.controls=new Tc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||be}unmount(){this.removeGroupControls(),this.removeListeners()}}const Ki=e=>(t,n)=>{e&&Q.postRender(()=>e(t,n))};class Pc extends Be{constructor(){super(...arguments),this.removePointerDownListener=be}onPointerDown(t){this.session=new Ni(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ki(t),onStart:Ki(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&Q.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=rt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Jt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function qi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Dt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(L.test(e))e=parseFloat(e);else return e;const n=qi(e,t.target.x),r=qi(e,t.target.y);return`${n}% ${r}%`}},Cc={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ne.parse(e);if(s.length>5)return r;const i=Ne.createTransformer(e),o=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,a=n.y.scale*t.y;s[0+o]/=l,s[1+o]/=a;const c=ee(l,a,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}};class Ec extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Da(Ac),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Jt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,o=r.projection;return o&&(o.isPresent=i,s||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||Q.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),dn.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Gi(e){const[t,n]=Fr(),r=x.useContext(nn);return m.exports.jsx(Ec,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(Zr),isPresent:t,safeToRemove:n})}const Ac={borderRadius:{...Dt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Dt,borderTopRightRadius:Dt,borderBottomLeftRadius:Dt,borderBottomRightRadius:Dt,boxShadow:Cc};function jc(e,t,n){const r=he(e)?e:xt(e);return r.start(Qn("",r,t,n)),r.animation}function Mc(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Dc=(e,t)=>e.depth-t.depth;class Rc{constructor(){this.children=[],this.isDirty=!1}add(t){Rn(this.children,t),this.isDirty=!0}remove(t){Vn(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Dc),this.isDirty=!1,this.children.forEach(t)}}function Vc(e,t){const n=De.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ie(r),e(i-t))};return Q.read(r,!0),()=>Ie(r)}const Hi=["TopLeft","TopRight","BottomLeft","BottomRight"],Oc=Hi.length,Xi=e=>typeof e=="string"?parseFloat(e):e,Zi=e=>typeof e=="number"||L.test(e);function Lc(e,t,n,r,s,i){s?(e.opacity=ee(0,n.opacity!==void 0?n.opacity:1,kc(r)),e.opacityExit=ee(t.opacity!==void 0?t.opacity:1,0,_c(r))):i&&(e.opacity=ee(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<Oc;o++){const l=`border${Hi[o]}Radius`;let a=Ji(t,l),c=Ji(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Zi(a)===Zi(c)?(e[l]=Math.max(ee(Xi(a),Xi(c),r),0),(Me.test(c)||Me.test(a))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=ee(t.rotate||0,n.rotate||0,r))}function Ji(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const kc=Qi(0,.5,_s),_c=Qi(.5,.95,be);function Qi(e,t,n){return r=>r<e?0:r>t?1:n(Xe(e,t,r))}function eo(e,t){e.min=t.min,e.max=t.max}function we(e,t){eo(e.x,t.x),eo(e.y,t.y)}function to(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function no(e,t,n,r,s){return e-=t,e=Xt(e,1/n,r),s!==void 0&&(e=Xt(e,1/s,r)),e}function Ic(e,t=0,n=1,r=.5,s,i=e,o=e){if(Me.test(t)&&(t=parseFloat(t),t=ee(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=ee(i.min,i.max,r);e===i&&(l-=t),e.min=no(e.min,t,n,l,s),e.max=no(e.max,t,n,l,s)}function ro(e,t,[n,r,s],i,o){Ic(e,t[n],t[r],t[s],t.scale,i,o)}const Fc=["x","scaleX","originX"],Nc=["y","scaleY","originY"];function so(e,t,n,r){ro(e.x,t,Fc,n?n.x:void 0,r?r.x:void 0),ro(e.y,t,Nc,n?n.y:void 0,r?r.y:void 0)}function io(e){return e.translate===0&&e.scale===1}function oo(e){return io(e.x)&&io(e.y)}function ao(e,t){return e.min===t.min&&e.max===t.max}function Bc(e,t){return ao(e.x,t.x)&&ao(e.y,t.y)}function lo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function uo(e,t){return lo(e.x,t.x)&&lo(e.y,t.y)}function co(e){return ge(e.x)/ge(e.y)}function fo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class $c{constructor(){this.members=[]}add(t){Rn(this.members,t),t.scheduleRender()}remove(t){if(Vn(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Uc(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:h,skewX:g,skewY:b}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),g&&(r+=`skewX(${g}deg) `),b&&(r+=`skewY(${b}deg) `)}const l=e.x.scale*t.x,a=e.y.scale*t.y;return(l!==1||a!==1)&&(r+=`scale(${l}, ${a})`),r||"none"}const qe={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ar=["","X","Y","Z"],Wc={visibility:"hidden"},ho=1e3;let zc=0;function lr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function po(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ms(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Q,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&po(r)}function mo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=zc++,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,_e.value&&(qe.nodes=qe.calculatedTargetDeltas=qe.calculatedProjections=0),this.nodes.forEach(qc),this.nodes.forEach(Jc),this.nodes.forEach(Qc),this.nodes.forEach(Gc),_e.addProjectionMetrics&&_e.addProjectionMetrics(qe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let a=0;a<this.path.length;a++)this.path[a].shouldResetTransform=!0;this.root===this&&(this.nodes=new Rc)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new On),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const a=this.eventHandlers.get(o);a&&a.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Mc(o),this.instance=o;const{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(c||a)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=Vc(h,250),Jt.hasAnimatedSinceResize&&(Jt.hasAnimatedSinceResize=!1,this.nodes.forEach(yo))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:g,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||sf,{onLayoutAnimationStart:P,onLayoutAnimationComplete:T}=u.getProps(),C=!this.targetLayout||!uo(this.targetLayout,b),E=!h&&g;if(this.options.layoutRoot||this.resumeFrom||E||h&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,E);const V={...Pn(y,"layout"),onPlay:P,onComplete:T};(u.shouldReduceMotion||this.options.layoutRoot)&&(V.delay=0,V.type=!1),this.startAnimation(V)}else h||yo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ie(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(ef),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&po(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:a}=this.options;if(l===void 0&&!a)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(go);return}this.isUpdating||this.nodes.forEach(Xc),this.isUpdating=!1,this.nodes.forEach(Zc),this.nodes.forEach(Yc),this.nodes.forEach(Kc),this.clearAllSnapshots();const l=De.now();de.delta=Oe(0,1e3/60,l-de.timestamp),de.timestamp=l,de.isProcessing=!0,ln.update.process(de),ln.preRender.process(de),ln.render.process(de),de.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,dn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Hc),this.sharedNodes.forEach(tf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ge(this.snapshot.measuredBox.x)&&!ge(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 a=0;a<this.path.length;a++)this.path[a].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=re(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const a=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:a,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:a}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!oo(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(l||Ke(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let a=this.removeElementScroll(l);return o&&(a=this.removeTransform(a)),of(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return re();const a=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(af))){const{scroll:u}=this.root;u&&(it(a.x,u.offset.x),it(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=re();if(we(a,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:h}=u;u!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&we(a,o),it(a.x,f.offset.x),it(a.y,f.offset.y))}return a}applyTransform(o,l=!1){const a=re();we(a,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&ot(a,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ke(u.latestValues)&&ot(a,u.latestValues)}return Ke(this.latestValues)&&ot(a,this.latestValues),a}removeTransform(o){const l=re();we(l,o);for(let a=0;a<this.path.length;a++){const c=this.path[a];if(!c.instance||!Ke(c.latestValues))continue;nr(c.latestValues)&&c.updateSnapshot();const u=re(),f=c.measurePageBox();we(u,f),so(l,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ke(this.latestValues)&&so(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==de.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=Boolean(this.resumingFrom)||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=de.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=re(),this.relativeTargetOrigin=re(),Mt(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),we(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=re(),this.targetWithTransforms=re()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):we(this.target,this.layout.layoutBox),Oi(this.target,this.targetDelta)):we(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&Boolean(g.resumingFrom)===Boolean(this.resumingFrom)&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=re(),this.relativeTargetOrigin=re(),Mt(this.relativeTargetOrigin,this.target,g.target),we(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}_e.value&&qe.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||nr(this.parent.latestValues)||Di(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),a=Boolean(this.resumingFrom)||this!==l;let c=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===de.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;we(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,g=this.treeScale.y;uc(this.layoutCorrected,this.treeScale,this.path,a),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=re());const{target:b}=l;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(to(this.prevProjectionDelta.x,this.projectionDelta.x),to(this.prevProjectionDelta.y,this.projectionDelta.y)),jt(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==g||!fo(this.projectionDelta.x,this.prevProjectionDelta.x)||!fo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b)),_e.value&&qe.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=st(),this.projectionDelta=st(),this.projectionDeltaWithTransform=st()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},f=st();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=re(),g=a?a.source:void 0,b=this.layout?this.layout.source:void 0,y=g!==b,P=this.getStack(),T=!P||P.members.length<=1,C=Boolean(y&&!T&&this.options.crossfade===!0&&!this.path.some(rf));this.animationProgress=0;let E;this.mixTargetDelta=V=>{const p=V/1e3;vo(f.x,o.x,p),vo(f.y,o.y,p),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nf(this.relativeTarget,this.relativeTargetOrigin,h,p),E&&Bc(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=re()),we(E,this.relativeTarget)),y&&(this.animationValues=u,Lc(u,c,this.latestValues,p,C,T)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=p},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ie(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Q.update(()=>{Jt.hasAnimatedSinceResize=!0,St.layout++,this.currentAnimation=jc(0,ho,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onStop:()=>{St.layout--},onComplete:()=>{St.layout--,o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ho),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:a,layout:c,latestValues:u}=o;if(!(!l||!a||!c)){if(this!==o&&this.layout&&c&&So(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||re();const f=ge(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+f;const h=ge(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+h}we(l,a),ot(l,u),jt(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new $c),this.sharedNodes.get(o).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:a}={}){const c=this.getStack();c&&c.promote(this,a),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:a}=o;if((a.z||a.rotate||a.rotateX||a.rotateY||a.rotateZ||a.skewX||a.skewY)&&(l=!0),!l)return;const c={};a.z&&lr("z",o,c,this.animationValues);for(let u=0;u<ar.length;u++)lr(`rotate${ar[u]}`,o,c,this.animationValues),lr(`skew${ar[u]}`,o,c,this.animationValues);o.render();for(const u in c)o.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);o.scheduleRender()}getProjectionStyles(o){var l,a;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Wc;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const y={};return this.options.layoutId&&(y.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,y.pointerEvents=Wt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ke(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=Uc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:g,y:b}=this.projectionDelta;c.transformOrigin=`${g.origin*100}% ${b.origin*100}% 0`,f.animationValues?c.opacity=f===this?(a=(l=h.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&a!==void 0?a:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:c.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in ht){if(h[y]===void 0)continue;const{correct:P,applyTo:T,isCSSVariable:C}=ht[y],E=c.transform==="none"?h[y]:P(h[y],f);if(T){const V=T.length;for(let p=0;p<V;p++)c[T[p]]=E}else C?this.options.visualElement.renderState.vars[y]=E:c[y]=E}return this.options.layoutId&&(c.pointerEvents=f===this?Wt(o==null?void 0:o.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(go),this.root.sharedNodes.clear()}}}function Yc(e){e.updateLayout()}function Kc(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=n.source!==e.layout.source;i==="size"?Te(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],g=ge(h);h.min=r[f].min,h.max=h.min+g}):So(i,n.layoutBox,r)&&Te(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],g=ge(r[f]);h.max=h.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=st();jt(l,r,n.layoutBox);const a=st();o?jt(a,e.applyTransform(s,!0),n.measuredBox):jt(a,r,n.layoutBox);const c=!oo(l);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:g}=f;if(h&&g){const b=re();Mt(b,n.layoutBox,h.layoutBox);const y=re();Mt(y,r,g.layoutBox),uo(b,y)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=b,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:a,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function qc(e){_e.value&&qe.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Gc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Hc(e){e.clearSnapshot()}function go(e){e.clearMeasurements()}function Xc(e){e.isLayoutDirty=!1}function Zc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function yo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Jc(e){e.resolveTargetDelta()}function Qc(e){e.calcProjection()}function ef(e){e.resetSkewAndRotation()}function tf(e){e.removeLeadSnapshot()}function vo(e,t,n){e.translate=ee(t.translate,0,n),e.scale=ee(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function xo(e,t,n,r){e.min=ee(t.min,n.min,r),e.max=ee(t.max,n.max,r)}function nf(e,t,n,r){xo(e.x,t.x,n.x,r),xo(e.y,t.y,n.y,r)}function rf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sf={duration:.45,ease:[.4,0,.1,1]},bo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),To=bo("applewebkit/")&&!bo("chrome/")?Math.round:be;function wo(e){e.min=To(e.min),e.max=To(e.max)}function of(e){wo(e.x),wo(e.y)}function So(e,t,n){return e==="position"||e==="preserve-aspect"&&!ac(co(t),co(n),.2)}function af(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const lf=mo({attachResizeListener:(e,t)=>Et(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ur={current:void 0},Po=mo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ur.current){const e=new lf({});e.mount(window),e.setOptions({layoutScroll:!0}),ur.current=e}return ur.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),uf={pan:{Feature:Pc},drag:{Feature:Sc,ProjectionNode:Po,MeasureLayout:Gi}};function Co(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Q.postRender(()=>i(t,At(t)))}class cf extends Be{mount(){const{current:t}=this.node;t&&(this.unmount=al(t,(n,r)=>(Co(this.node,r,"Start"),s=>Co(this.node,s,"End"))))}unmount(){}}class ff extends Be{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Pt(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Eo(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Q.postRender(()=>i(t,At(t)))}class df extends Be{mount(){const{current:t}=this.node;t&&(this.unmount=fl(t,(n,r)=>(Eo(this.node,r,"Start"),(s,{success:i})=>Eo(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cr=new WeakMap,fr=new WeakMap,hf=e=>{const t=cr.get(e.target);t&&t(e)},pf=e=>{e.forEach(hf)};function mf({root:e,...t}){const n=e||document;fr.has(n)||fr.set(n,{});const r=fr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(pf,{root:e,...t})),r[s]}function gf(e,t,n){const r=mf(t);return cr.set(e,n),r.observe(e),()=>{cr.delete(e),r.unobserve(e)}}const yf={some:0,all:1};class vf extends Be{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:yf[s]},l=a=>{const{isIntersecting:c}=a;if(this.isInView===c||(this.isInView=c,i&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),h=c?u:f;h&&h(a)};return gf(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(xf(t,n))&&this.startObserver()}unmount(){}}function xf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const bf={inView:{Feature:vf},tap:{Feature:df},focus:{Feature:ff},hover:{Feature:cf}},Tf={layout:{ProjectionNode:Po,MeasureLayout:Gi}},dr={current:null},Ao={current:!1};function wf(){if(Ao.current=!0,!!on)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>dr.current=e.matches;e.addListener(t),t()}else dr.current=!1}const Sf=[...ei,pe,Ne],Pf=e=>Sf.find(Qs(e)),Cf=new WeakMap;function Ef(e,t,n){for(const r in t){const s=t[r],i=n[r];if(he(s))e.addValue(r,s),process.env.NODE_ENV==="development"&&Ft(s.version==="12.4.7",`Attempting to mix Motion versions ${s.version} with 12.4.7 may not work as expected.`);else if(he(i))e.addValue(r,xt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,xt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const jo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Af{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Yn,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 g=De.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,Q.render(this.render,!1,!0))};const{latestValues:a,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=l,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=$t(n),this.isVariantNode=Gr(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in h){const b=h[g];a[g]!==void 0&&he(b)&&b.set(a[g],!1)}}mount(t){this.current=t,Cf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Ao.current||wf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:dr.current,process.env.NODE_ENV!=="production"&&Ft(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(),Ie(this.notifyUpdate),Ie(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Ue.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Q.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ze){const n=Ze[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):re()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<jo.length;r++){const s=jo[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=Ef(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=xt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(Zs(s)||Fs(s))?s=parseFloat(s):!Pf(s)&&Ne.test(n)&&(s=Ys(t,n)),this.setBaseTarget(t,he(s)?s.get():s)),he(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const o=Tn(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(s=o[t])}if(r&&s!==void 0)return s;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!he(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new On),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Mo extends Af{constructor(){super(...arguments),this.KeyframeResolver=ni}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;he(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function jf(e){return window.getComputedStyle(e)}class Mf extends Mo{constructor(){super(...arguments),this.type="html",this.renderInstance=cs}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}else{const r=jf(t),s=(hn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Ii(t,n)}build(t,n,r){gn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Sn(t,n,r)}}class Df extends Mo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=re,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&us(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ue.has(n)){const r=Un(n);return r&&r.default||0}return n=fs.has(n)?n:fn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return hs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Q.postRender(this.updateDimensions)}build(t,n,r){xn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ds(t,n,r,s)}mount(t){this.isSVGTag=bn(t.tagName),super.mount(t)}}const Rf=(e,t)=>vn(e)?new Df(t):new Mf(t,{allowProjection:e!==x.Fragment}),Vf=el({...Qu,...bf,...uf,...Tf},Rf),hr=ya(Vf),Of=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?m.exports.jsx("div",{id:"default-modal",tabIndex:-1,"aria-hidden":"true",className:"absolute z-10 w-full md:inset-0 h-full max-h-full overflow-y-auto overflow-x-hidden flex justify-center items-center bg-[rgb(0,0,0,0.6)]",children:m.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:m.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[m.exports.jsxs("div",{className:"flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600 border-gray-200",children:[m.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),m.exports.jsxs("button",{type:"button",className:"text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 inline-flex justify-center items-center",onClick:t,children:[m.exports.jsx("svg",{className:"w-3 h-3","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 14 14",children:m.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),m.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),m.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:m.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),m.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[m.exports.jsx("button",{onClick:()=>{n(),t()},type:"button",className:"text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800",children:"Yes "}),m.exports.jsx("button",{onClick:t,type:"button",className:"py-2.5 px-5 ml-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700",children:"Cancel"})]})]})})}):null,Lf=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,l]=x.useState(!1);return x.useEffect(()=>(i.current||(i.current=document.createElement("div"),i.current.style.zIndex="1500",i.current.style.position="fixed",i.current.style.top="0",i.current.style.left="0",i.current.style.width="100%",i.current.style.height="100%",i.current.style.pointerEvents="none",document.body.appendChild(i.current)),l(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:$e.createPortal(m.exports.jsx($r,{children:t&&m.exports.jsx(hr.div,{initial:{opacity:0,scale:.8,y:-10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:-10},transition:{duration:.2,ease:"easeOut"},className:"absolute z-50 bg-white shadow-lg rounded-md p-2 px-1 w-42 pointer-events-auto",style:{top:n.y,left:n.x},children:e.map((a,c)=>a!=null&&a.onlyCurrentUserMessage&&!s?null:m.exports.jsxs("button",{disabled:a==null?void 0:a.disabled,className:"cursor-pointer flex items-center gap-2 w-full rounded-md text-left px-2 py-1 disabled:opacity-20 hover:bg-gray-200",onClick:()=>a.onClick(r),children:[x.cloneElement(a.icon,{className:"text-black",size:18}),m.exports.jsx("span",{className:"ml-2 text-black",children:a.name})]},c))})}),i.current)},kf=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},_f=()=>m.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.exports.jsx("path",{d:"M9.77169 2.74358C12.1132 0.399998 15.9121 0.399998 18.2553 2.74314C20.5384 5.02621 20.5969 8.69142 18.4309 11.0454L18.2428 11.2427L9.44273 20.0409L9.40616 20.0712C7.94492 21.3879 5.69092 21.3432 4.28355 19.9358C2.96453 18.6168 2.84241 16.5541 3.9172 15.0974C3.94054 15.0521 3.96879 15.0083 4.002 14.9672L4.05556 14.9075L4.14247 14.8198L4.28355 14.6719L4.28647 14.6748L11.7222 7.22047C11.9881 6.95385 12.4047 6.92909 12.6986 7.14656L12.7829 7.21906C13.0495 7.48497 13.0742 7.9016 12.8568 8.19551L12.7843 8.27972L5.18966 15.8928C4.47202 16.7684 4.5219 18.0627 5.3393 18.8801C6.16836 19.7091 7.48801 19.7486 8.3638 18.9985L17.1965 10.1681C18.952 8.41041 18.952 5.56116 17.1946 3.8038C15.4922 2.10136 12.765 2.04816 10.9986 3.6442L10.8307 3.8038L10.8181 3.81812L1.28179 13.3544C0.988902 13.6473 0.514028 13.6473 0.221135 13.3544C-0.0451319 13.0882 -0.0693378 12.6715 0.148517 12.3779L0.221135 12.2938L9.77001 2.74314L9.77169 2.74358Z",fill:"#8A8A8A"})}),If=()=>m.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.exports.jsx("path",{d:"M13.25 9C13.6297 9 13.9435 9.28215 13.9932 9.64823L14 9.75V10.25C14 13.8094 11.245 16.7254 7.75098 16.9817L7.75 19.25C7.75 19.6642 7.41421 20 7 20C6.6203 20 6.30651 19.7178 6.25685 19.3518L6.25 19.25L6.25002 16.9818C2.83323 16.7316 0.122835 13.938 0.00406027 10.4863L0 10.25V9.75C0 9.33579 0.335786 9 0.75 9C1.1297 9 1.44349 9.28215 1.49315 9.64823L1.5 9.75V10.25C1.5 13.077 3.73445 15.3821 6.5336 15.4956L6.75 15.5H7.25C10.077 15.5 12.3821 13.2656 12.4956 10.4664L12.5 10.25V9.75C12.5 9.33579 12.8358 9 13.25 9ZM7 0C9.20914 0 11 1.79086 11 4V10C11 12.2091 9.20914 14 7 14C4.79086 14 3 12.2091 3 10V4C3 1.79086 4.79086 0 7 0ZM7 1.5C5.61929 1.5 4.5 2.61929 4.5 4V10C4.5 11.3807 5.61929 12.5 7 12.5C8.38071 12.5 9.5 11.3807 9.5 10V4C9.5 2.61929 8.38071 1.5 7 1.5Z",fill:"#fff"})}),Do=()=>m.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.exports.jsx("path",{d:"M10.8147 10.1974L3.28344 11.4526C3.10705 11.482 2.95979 11.6034 2.89723 11.7709L0.299335 18.7283C0.0506615 19.3678 0.720085 19.9778 1.33375 19.671L19.3337 10.671C19.8865 10.3946 19.8865 9.60573 19.3337 9.32933L1.33375 0.329334C0.720085 0.0225017 0.0506615 0.632543 0.299335 1.27199L2.89723 8.22938C2.95979 8.39691 3.10705 8.51827 3.28344 8.54767L10.8147 9.80287C10.9236 9.82103 10.9972 9.92408 10.9791 10.033C10.965 10.1173 10.899 10.1834 10.8147 10.1974Z",fill:"#fff"})}),pr=e=>m.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:m.exports.jsxs("g",{fill:"none",children:[m.exports.jsx("path",{className:"background",fill:"#ffffff",d:"M8,1 L9,1 L9,20 L8,20 L8,18 C7.807,15.161 7.124,12.233 5.950,9.218 C5.046,6.893 3.504,4.733 1.325,2.738 L1.325,2.738 C0.917,2.365 0.89,1.732 1.263,1.325 C1.452,1.118 1.72,1 2,1 L8,1 Z"}),m.exports.jsx("path",{className:" fill-gray-200",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0 L9,0 L9,20 L7,20 L7,20 L7.002,18.068 C6.816,15.333 6.156,12.504 5.018,9.58 C4.172,7.406 2.72,5.371 0.649,3.475 C-0.165,2.729 -0.221,1.464 0.525,0.649 C0.904,0.236 1.439,0 2,0 Z"}),m.exports.jsx("path",{className:"border_2x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.5 L9,0.5 L9,20 L7.5,20 L7.5,20 L7.501,18.034 C7.312,15.247 6.64,12.369 5.484,9.399 C4.609,7.15 3.112,5.052 0.987,3.106 C0.376,2.547 0.334,1.598 0.894,0.987 C1.178,0.677 1.579,0.5 2,0.5 Z"}),m.exports.jsx("path",{className:"border_3x",d:"M9,1 L2,1 C1.72,1 1.452,1.118 1.263,1.325 C0.89,1.732 0.917,2.365 1.325,2.738 C3.504,4.733 5.046,6.893 5.95,9.218 C7.124,12.233 7.807,15.161 8,18 L8,20 L9,20 L9,1 Z M2,0.667 L9,0.667 L9,20 L7.667,20 L7.667,20 L7.668,18.023 C7.477,15.218 6.802,12.324 5.64,9.338 C4.755,7.064 3.243,4.946 1.1,2.983 C0.557,2.486 0.52,1.643 1.017,1.1 C1.269,0.824 1.626,0.667 2,0.667 Z"})]})}),Ff=({onSendMessage:e,onSendVoice:t,onImageSend:n,onVideoSend:r,onFileSend:s,dynamicSymbolAssignments:i})=>{const[o,l]=x.useState(""),[a,c]=x.useState(!1),[u,f]=x.useState(0),[h,g]=x.useState(null),[b,y]=x.useState(null),[P,T]=x.useState(0),C=x.useRef(null),E=x.useRef([]),V=x.useRef(null),p=x.useRef(null),M=x.useRef(null),[$,R]=x.useState(!1),X=v=>{const S=v.target.value;l(S);const D=S.match(/(\S+)$/);N(D)},N=v=>{if(v){const S=v[0];if(h){const D=v[0].split(h)[1];y(D)}i!=null&&i.some(D=>D.symbol===S)&&g(S)}else g(null)},se=(v,S)=>{l(D=>D+S+" "),g(null),p.current.focus()},ye=()=>{o.trim()!==""&&(e(o),l(""),g(null))},ae=async()=>{c(!0),f(0),E.current=[],V.current=setInterval(()=>{f(D=>D+1)},1e3);const v=await navigator.mediaDevices.getUserMedia({audio:!0}),S=new MediaRecorder(v);C.current=S,S.ondataavailable=D=>{D.data.size>0&&E.current.push(D.data)},S.onstop=()=>{clearInterval(V.current);const D=new Blob(E.current,{type:"audio/mp3"}),_=URL.createObjectURL(D);t(_),c(!1)},S.start()},ne=()=>{var v;(v=C.current)==null||v.stop()},ve=v=>{const{scrollTop:S,scrollHeight:D,clientHeight:_}=v.currentTarget;if(S>P){if(S+_>=D-1){const k=i==null?void 0:i.find(I=>I.symbol===h);k&&(k!=null&&k.updatePageNumber)&&(R(!0),k==null||k.updatePageNumber(k.pagNumber+1),T(S),setTimeout(()=>{R(!1)},500))}}else T(S)},le=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),Z=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),ue=()=>{var v;(v=M.current)==null||v.click()},Se=v=>{var _,O;const S=(_=v.target.files)==null?void 0:_[0];if(!S)return;let D="";if(S.type){const k=S.type.split("/");k.length===2&&(D=k[1])}D||(D=((O=S.name.split(".").pop())==null?void 0:O.toLowerCase())||""),le.has(D)?n(S):Z.has(D)?r(S):s(S)};return m.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[a?m.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[m.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:kf(u)}),m.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:ne,children:m.exports.jsx(Do,{})})]}):m.exports.jsxs(m.exports.Fragment,{children:[m.exports.jsxs("div",{className:"w-[90%] relative ",children:[m.exports.jsx("div",{onClick:ue,className:"cursor-pointer absolute right-4 top-[11px]",children:m.exports.jsx(_f,{})}),m.exports.jsx("input",{type:"file",ref:M,style:{display:"none"},onChange:Se}),m.exports.jsx("input",{type:"text",ref:p,className:"w-full bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",placeholder:"Type a message...",value:o,onChange:X,onKeyDown:v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),ye())}}),m.exports.jsx(pr,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),m.exports.jsx("button",{className:"flex items-center justify-center cursor-pointer w-9 h-9 ml-2 p-2 bg-blue-500 text-white rounded-full hover:bg-blue-600 transition",onClick:o?ye:ae,children:o?m.exports.jsx(Do,{}):m.exports.jsx(If,{})})]}),h&&m.exports.jsxs("div",{className:"absolute bottom-full left-0 w-full bg-white shadow-xl rounded-lg border border-gray-200 p-4 z-50 max-h-60 overflow-y-auto",onScroll:ve,children:[m.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[m.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",m.exports.jsx("span",{className:"text-blue-500",children:h})]}),m.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>g(null),children:"✕"})]}),m.exports.jsxs("div",{className:"space-y-2",children:[i?i.filter(v=>v.symbol===h).map(v=>{var _;const{component:S,lists:D}=v;return S?b?(_=D==null?void 0:D.filter(O=>O==null?void 0:O.name.includes(b)))==null?void 0:_.map((O,k)=>m.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:m.exports.jsx(S,{listsProps:O,onClick:(I,B)=>se(I,B)})},k)):D==null?void 0:D.map((O,k)=>m.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:m.exports.jsx(S,{listsProps:O,onClick:(I,B)=>se(I,B)})},k)):null}):null,m.exports.jsx("div",{className:"h-8",children:$&&"Loading more items..."})]})]})]})};var Re=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Re||{});const Ro=({fileName:e,fileSize:t,format:n,src:r})=>{const s=()=>{const o={rar:m.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:m.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:m.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:m.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:m.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:m.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:m.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:m.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:m.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:m.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:m.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:m.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:m.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:m.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:m.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:m.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:m.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:m.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:m.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:m.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:m.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:m.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&o[n]?o[n]:m.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},i=o=>o>1048576?(o/1048576).toFixed(1)+" MB":(o/1024).toFixed(1)+" KB";return m.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[m.exports.jsx("div",{className:"w-14 h-14 mr-3 flex items-center justify-center relative border border-green-900 rounded-md p-3",children:s()}),m.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[m.exports.jsx("a",{href:r,download:e,className:"text-gray-900 font-medium hover:underline",children:e}),m.exports.jsx("span",{className:"text-gray-600 text-sm",children:i(t)})]}),m.exports.jsx("a",{href:r,download:e,className:"ml-2 bg-green-500 text-white px-2 py-1 text-sm rounded hover:bg-green-600",children:"Download"})]})},Nf=e=>m.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-play",...e,children:m.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Bf=e=>m.exports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-pause",...e,children:[m.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),m.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Rt=null;const $f=({src:e,className:t})=>{const[n,r]=x.useState(!1),[s,i]=x.useState(0),o=x.useRef(null);x.useEffect(()=>{const a=o.current;if(!a)return;const c=()=>{i(a.currentTime/a.duration*100)},u=()=>r(!0),f=()=>r(!1),h=()=>{r(!1),i(0)};return a.addEventListener("timeupdate",c),a.addEventListener("play",u),a.addEventListener("pause",f),a.addEventListener("ended",h),()=>{a.removeEventListener("timeupdate",c),a.removeEventListener("play",u),a.removeEventListener("pause",f),a.removeEventListener("ended",h)}},[]);const l=()=>{const a=o.current;a&&(n?a.pause():(Rt&&Rt!==a&&(Rt.pause(),Rt.currentTime=0),a.play(),Rt=a))};return m.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[m.exports.jsx("button",{className:"w-9 h-9 cursor-pointer flex items-center justify-center pl-[1.5px] bg-gray-700 rounded-full hover:bg-gray-600",onClick:l,children:n?m.exports.jsx(Bf,{}):m.exports.jsx(Nf,{})}),m.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:m.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${s}%`}})}),m.exports.jsx("audio",{ref:o,src:e})]})},Uf=({attachment:e,attachmentType:t,attachmentFormat:n})=>e?t===Re.Voice?m.exports.jsx("div",{className:"w-full",children:m.exports.jsx($f,{src:e})}):t===Re.Image?m.exports.jsx("div",{className:"w-full",children:m.exports.jsx("img",{src:e})}):t===Re.File?m.exports.jsx("div",{className:"w-full mt-1",children:m.exports.jsx(Ro,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e})}):t===Re.Video?m.exports.jsx("div",{className:"w-full mt-1",children:m.exports.jsx(Ro,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e})}):null:null,Wf=({message:e,showUserProfile:t,handleContextMenu:n,media:r})=>{var s,i,o,l,a;return m.exports.jsxs(m.exports.Fragment,{children:[t?m.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,m.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:c=>n(c,e),className:`relative ${r?"w-3/4":"w-fit max-w-3/4"}flex flex-col gap-1 md:max-w-[400px] p-2 pt-5 rounded-lg bg-green-200`,children:[m.exports.jsx("span",{className:"absolute top-1 text-xs text-orange-700",children:(s=e.user)!=null&&s.fullName&&((o=(i=e.user)==null?void 0:i.fullName)==null?void 0:o.length)>16?(l=e.user)==null?void 0:l.firstName:(a=e.user)==null?void 0:a.fullName}),r||null,m.exports.jsx("span",{children:e.text}),m.exports.jsx("div",{className:"w-full flex gap- items-center justify-end",children:m.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]})}),m.exports.jsx(pr,{className:"fill-blue-200 -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 [&>g>path]:fill-green-200"})]})]})},zf=()=>m.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[m.exports.jsx("path",{d:"M11.6619 4.6478C11.8358 4.83691 11.8272 5.1347 11.6427 5.31294L4.36284 12.3463C4.14493 12.5568 3.80285 12.5503 3.59268 12.3317L1.13205 9.77168C0.954124 9.58658 0.956276 9.28866 1.13686 9.10628C1.31743 8.92389 1.60806 8.9261 1.78598 9.1112L3.99455 11.4089L11.013 4.62812C11.1975 4.44988 11.488 4.4587 11.6619 4.6478Z",fill:"gray"}),m.exports.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.8759 4.64963C15.0492 4.83921 15.0399 5.13698 14.8549 5.31471L7.51066 12.3726C7.32572 12.5503 7.03524 12.5407 6.86185 12.3511C6.68847 12.1616 6.69784 11.8638 6.88278 11.6861L14.227 4.62818C14.412 4.45045 14.7025 4.46005 14.8759 4.64963Z",fill:"gray"})]}),Vo=({size:e=24,color:t="text-current",className:n})=>m.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:m.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[m.exports.jsx("defs",{children:m.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[m.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),m.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),m.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),m.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[m.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),m.exports.jsx("path",{d:"M34,18 C34,9.163444 26.836556,2 18,2 C11.6597233,2 6.18078805,5.68784135 3.59122325,11.0354951",stroke:"url(#linearGradient-1)",strokeWidth:"4",strokeLinecap:"round"})]})]})}),Yf=({handleContextMenu:e,media:t,message:n})=>m.exports.jsxs(hr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:r=>e(r,n),className:`relative self-end ${t?"w-3/4":"max-w-3/4"} flex flex-col justify-center md:max-w-[400px] p-2 rounded-lg bg-blue-200`,children:[t||null,m.exports.jsx("span",{children:n.text}),m.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[m.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?m.exports.jsx(Vo,{size:13,color:"text-black"}):m.exports.jsx(zf,{})]}),m.exports.jsx(pr,{className:"fill-blue-200 rotate-180 absolute -right-2 bottom-0 [&>g>path]:fill-blue-200"})]});var ce={exports:{}},mr={exports:{}},G={};var Oo;function Kf(){if(Oo)return G;Oo=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function E(p){if(typeof p=="object"&&p!==null){var M=p.$$typeof;switch(M){case t:switch(p=p.type,p){case a:case c:case r:case i:case s:case f:return p;default:switch(p=p&&p.$$typeof,p){case l:case u:case b:case g:case o:return p;default:return M}}case n:return M}}}function V(p){return E(p)===c}return G.AsyncMode=a,G.ConcurrentMode=c,G.ContextConsumer=l,G.ContextProvider=o,G.Element=t,G.ForwardRef=u,G.Fragment=r,G.Lazy=b,G.Memo=g,G.Portal=n,G.Profiler=i,G.StrictMode=s,G.Suspense=f,G.isAsyncMode=function(p){return V(p)||E(p)===a},G.isConcurrentMode=V,G.isContextConsumer=function(p){return E(p)===l},G.isContextProvider=function(p){return E(p)===o},G.isElement=function(p){return typeof p=="object"&&p!==null&&p.$$typeof===t},G.isForwardRef=function(p){return E(p)===u},G.isFragment=function(p){return E(p)===r},G.isLazy=function(p){return E(p)===b},G.isMemo=function(p){return E(p)===g},G.isPortal=function(p){return E(p)===n},G.isProfiler=function(p){return E(p)===i},G.isStrictMode=function(p){return E(p)===s},G.isSuspense=function(p){return E(p)===f},G.isValidElementType=function(p){return typeof p=="string"||typeof p=="function"||p===r||p===c||p===i||p===s||p===f||p===h||typeof p=="object"&&p!==null&&(p.$$typeof===b||p.$$typeof===g||p.$$typeof===o||p.$$typeof===l||p.$$typeof===u||p.$$typeof===P||p.$$typeof===T||p.$$typeof===C||p.$$typeof===y)},G.typeOf=E,G}var H={};var Lo;function qf(){return Lo||(Lo=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,o=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,P=e?Symbol.for("react.fundamental"):60117,T=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function E(j){return typeof j=="string"||typeof j=="function"||j===r||j===c||j===i||j===s||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===b||j.$$typeof===g||j.$$typeof===o||j.$$typeof===l||j.$$typeof===u||j.$$typeof===P||j.$$typeof===T||j.$$typeof===C||j.$$typeof===y)}function V(j){if(typeof j=="object"&&j!==null){var Pe=j.$$typeof;switch(Pe){case t:var at=j.type;switch(at){case a:case c:case r:case i:case s:case f:return at;default:var Ge=at&&at.$$typeof;switch(Ge){case l:case u:case b:case g:case o:return Ge;default:return Pe}}case n:return Pe}}}var p=a,M=c,$=l,R=o,X=t,N=u,se=r,ye=b,ae=g,ne=n,ve=i,le=s,Z=f,ue=!1;function Se(j){return ue||(ue=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),v(j)||V(j)===a}function v(j){return V(j)===c}function S(j){return V(j)===l}function D(j){return V(j)===o}function _(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function O(j){return V(j)===u}function k(j){return V(j)===r}function I(j){return V(j)===b}function B(j){return V(j)===g}function U(j){return V(j)===n}function K(j){return V(j)===i}function W(j){return V(j)===s}function me(j){return V(j)===f}H.AsyncMode=p,H.ConcurrentMode=M,H.ContextConsumer=$,H.ContextProvider=R,H.Element=X,H.ForwardRef=N,H.Fragment=se,H.Lazy=ye,H.Memo=ae,H.Portal=ne,H.Profiler=ve,H.StrictMode=le,H.Suspense=Z,H.isAsyncMode=Se,H.isConcurrentMode=v,H.isContextConsumer=S,H.isContextProvider=D,H.isElement=_,H.isForwardRef=O,H.isFragment=k,H.isLazy=I,H.isMemo=B,H.isPortal=U,H.isProfiler=K,H.isStrictMode=W,H.isSuspense=me,H.isValidElementType=E,H.typeOf=V}()),H}var ko;function _o(){return ko||(ko=1,function(e){process.env.NODE_ENV==="production"?e.exports=Kf():e.exports=qf()}(mr)),mr.exports}var gr,Io;function Gf(){if(Io)return gr;Io=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function s(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var o={},l=0;l<10;l++)o["_"+String.fromCharCode(l)]=l;var a=Object.getOwnPropertyNames(o).map(function(u){return o[u]});if(a.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return gr=s()?Object.assign:function(i,o){for(var l,a=r(i),c,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var f in l)t.call(l,f)&&(a[f]=l[f]);if(e){c=e(l);for(var h=0;h<c.length;h++)n.call(l,c[h])&&(a[c[h]]=l[c[h]])}}return a},gr}var yr,Fo;function vr(){if(Fo)return yr;Fo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yr=e,yr}var xr,No;function Bo(){return No||(No=1,xr=Function.call.bind(Object.prototype.hasOwnProperty)),xr}var br,$o;function Hf(){if($o)return br;$o=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=vr(),n={},r=Bo();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,l,a,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var h=Error((a||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[u](o,u,a,l,null,t)}catch(b){f=b}if(f&&!(f instanceof Error)&&e((a||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var g=c?c():"";e("Failed "+l+" type: "+f.message+(g??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},br=s,br}var Tr,Uo;function Xf(){if(Uo)return Tr;Uo=1;var e=_o(),t=Gf(),n=vr(),r=Bo(),s=Hf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(l){var a="Warning: "+l;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}});function o(){return null}return Tr=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(v){var S=v&&(c&&v[c]||v[u]);if(typeof S=="function")return S}var h="<<anonymous>>",g={array:T("array"),bigint:T("bigint"),bool:T("boolean"),func:T("function"),number:T("number"),object:T("object"),string:T("string"),symbol:T("symbol"),any:C(),arrayOf:E,element:V(),elementType:p(),instanceOf:M,node:N(),objectOf:R,oneOf:$,oneOfType:X,shape:ye,exact:ae};function b(v,S){return v===S?v!==0||1/v===1/S:v!==v&&S!==S}function y(v,S){this.message=v,this.data=S&&typeof S=="object"?S:{},this.stack=""}y.prototype=Error.prototype;function P(v){if(process.env.NODE_ENV!=="production")var S={},D=0;function _(k,I,B,U,K,W,me){if(U=U||h,W=W||B,me!==n){if(a){var j=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw j.name="Invariant Violation",j}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Pe=U+":"+B;!S[Pe]&&D<3&&(i("You are manually calling a React.PropTypes validation function for the `"+W+"` prop on `"+U+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),S[Pe]=!0,D++)}}return I[B]==null?k?I[B]===null?new y("The "+K+" `"+W+"` is marked as required "+("in `"+U+"`, but its value is `null`.")):new y("The "+K+" `"+W+"` is marked as required in "+("`"+U+"`, but its value is `undefined`.")):null:v(I,B,U,K,W)}var O=_.bind(null,!1);return O.isRequired=_.bind(null,!0),O}function T(v){function S(D,_,O,k,I,B){var U=D[_],K=le(U);if(K!==v){var W=Z(U);return new y("Invalid "+k+" `"+I+"` of type "+("`"+W+"` supplied to `"+O+"`, expected ")+("`"+v+"`."),{expectedType:v})}return null}return P(S)}function C(){return P(o)}function E(v){function S(D,_,O,k,I){if(typeof v!="function")return new y("Property `"+I+"` of component `"+O+"` has invalid PropType notation inside arrayOf.");var B=D[_];if(!Array.isArray(B)){var U=le(B);return new y("Invalid "+k+" `"+I+"` of type "+("`"+U+"` supplied to `"+O+"`, expected an array."))}for(var K=0;K<B.length;K++){var W=v(B,K,O,k,I+"["+K+"]",n);if(W instanceof Error)return W}return null}return P(S)}function V(){function v(S,D,_,O,k){var I=S[D];if(!l(I)){var B=le(I);return new y("Invalid "+O+" `"+k+"` of type "+("`"+B+"` supplied to `"+_+"`, expected a single ReactElement."))}return null}return P(v)}function p(){function v(S,D,_,O,k){var I=S[D];if(!e.isValidElementType(I)){var B=le(I);return new y("Invalid "+O+" `"+k+"` of type "+("`"+B+"` supplied to `"+_+"`, expected a single ReactElement type."))}return null}return P(v)}function M(v){function S(D,_,O,k,I){if(!(D[_]instanceof v)){var B=v.name||h,U=Se(D[_]);return new y("Invalid "+k+" `"+I+"` of type "+("`"+U+"` supplied to `"+O+"`, expected ")+("instance of `"+B+"`."))}return null}return P(S)}function $(v){if(!Array.isArray(v))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),o;function S(D,_,O,k,I){for(var B=D[_],U=0;U<v.length;U++)if(b(B,v[U]))return null;var K=JSON.stringify(v,function(me,j){var Pe=Z(j);return Pe==="symbol"?String(j):j});return new y("Invalid "+k+" `"+I+"` of value `"+String(B)+"` "+("supplied to `"+O+"`, expected one of "+K+"."))}return P(S)}function R(v){function S(D,_,O,k,I){if(typeof v!="function")return new y("Property `"+I+"` of component `"+O+"` has invalid PropType notation inside objectOf.");var B=D[_],U=le(B);if(U!=="object")return new y("Invalid "+k+" `"+I+"` of type "+("`"+U+"` supplied to `"+O+"`, expected an object."));for(var K in B)if(r(B,K)){var W=v(B,K,O,k,I+"."+K,n);if(W instanceof Error)return W}return null}return P(S)}function X(v){if(!Array.isArray(v))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),o;for(var S=0;S<v.length;S++){var D=v[S];if(typeof D!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ue(D)+" at index "+S+"."),o}function _(O,k,I,B,U){for(var K=[],W=0;W<v.length;W++){var me=v[W],j=me(O,k,I,B,U,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&K.push(j.data.expectedType)}var Pe=K.length>0?", expected one of type ["+K.join(", ")+"]":"";return new y("Invalid "+B+" `"+U+"` supplied to "+("`"+I+"`"+Pe+"."))}return P(_)}function N(){function v(S,D,_,O,k){return ne(S[D])?null:new y("Invalid "+O+" `"+k+"` supplied to "+("`"+_+"`, expected a ReactNode."))}return P(v)}function se(v,S,D,_,O){return new y((v||"React class")+": "+S+" type `"+D+"."+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+O+"`.")}function ye(v){function S(D,_,O,k,I){var B=D[_],U=le(B);if(U!=="object")return new y("Invalid "+k+" `"+I+"` of type `"+U+"` "+("supplied to `"+O+"`, expected `object`."));for(var K in v){var W=v[K];if(typeof W!="function")return se(O,k,I,K,Z(W));var me=W(B,K,O,k,I+"."+K,n);if(me)return me}return null}return P(S)}function ae(v){function S(D,_,O,k,I){var B=D[_],U=le(B);if(U!=="object")return new y("Invalid "+k+" `"+I+"` of type `"+U+"` "+("supplied to `"+O+"`, expected `object`."));var K=t({},D[_],v);for(var W in K){var me=v[W];if(r(v,W)&&typeof me!="function")return se(O,k,I,W,Z(me));if(!me)return new y("Invalid "+k+" `"+I+"` key `"+W+"` supplied to `"+O+"`.\nBad object: "+JSON.stringify(D[_],null," ")+`
|
|
20
|
+
Valid keys: `+JSON.stringify(Object.keys(v),null," "));var j=me(B,W,O,k,I+"."+W,n);if(j)return j}return null}return P(S)}function ne(v){switch(typeof v){case"number":case"string":case"undefined":return!0;case"boolean":return!v;case"object":if(Array.isArray(v))return v.every(ne);if(v===null||l(v))return!0;var S=f(v);if(S){var D=S.call(v),_;if(S!==v.entries){for(;!(_=D.next()).done;)if(!ne(_.value))return!1}else for(;!(_=D.next()).done;){var O=_.value;if(O&&!ne(O[1]))return!1}}else return!1;return!0;default:return!1}}function ve(v,S){return v==="symbol"?!0:S?S["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&S instanceof Symbol:!1}function le(v){var S=typeof v;return Array.isArray(v)?"array":v instanceof RegExp?"object":ve(S,v)?"symbol":S}function Z(v){if(typeof v>"u"||v===null)return""+v;var S=le(v);if(S==="object"){if(v instanceof Date)return"date";if(v instanceof RegExp)return"regexp"}return S}function ue(v){var S=Z(v);switch(S){case"array":case"object":return"an "+S;case"boolean":case"date":case"regexp":return"a "+S;default:return S}}function Se(v){return!v.constructor||!v.constructor.name?h:v.constructor.name}return g.checkPropTypes=s,g.resetWarningCache=s.resetWarningCache,g.PropTypes=g,g},Tr}var wr,Wo;function Zf(){if(Wo)return wr;Wo=1;var e=vr();function t(){}function n(){}return n.resetWarningCache=t,wr=function(){function r(o,l,a,c,u,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function s(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},wr}if(process.env.NODE_ENV!=="production"){var Jf=_o(),Qf=!0;ce.exports=Xf()(Jf.isElement,Qf)}else ce.exports=Zf()();function Sr(){return Sr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sr.apply(this,arguments)}function ed(e,t){if(e==null)return{};var n=td(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function td(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Pr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ed(e,["color","size"]);return x.createElement("svg",Sr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"20 6 9 17 4 12"}))});Pr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Pr.displayName="Check";const nd=Pr;function Cr(){return Cr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cr.apply(this,arguments)}function rd(e,t){if(e==null)return{};var n=sd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Er=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=rd(e,["color","size"]);return x.createElement("svg",Cr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),x.createElement("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}))});Er.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Er.displayName="Copy";const id=Er;function Ar(){return Ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ar.apply(this,arguments)}function od(e,t){if(e==null)return{};var n=ad(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ad(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var jr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=od(e,["color","size"]);return x.createElement("svg",Ar({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),x.createElement("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"}))});jr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},jr.displayName="Edit";const ld=jr;function Mr(){return Mr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mr.apply(this,arguments)}function ud(e,t){if(e==null)return{};var n=cd(e,t),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)r=i[s],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cd(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}var Dr=x.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,s=e.size,i=s===void 0?24:s,o=ud(e,["color","size"]);return x.createElement("svg",Mr({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},o),x.createElement("polyline",{points:"3 6 5 6 21 6"}),x.createElement("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}))});Dr.propTypes={color:ce.exports.string,size:ce.exports.oneOfType([ce.exports.string,ce.exports.number])},Dr.displayName="Trash";const fd=Dr,dd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,onDeleteMessage:i})=>{const o=x.useRef(null),[l,a]=x.useState(!1),[c,u]=x.useState(null),[f,h]=x.useState(null),g=()=>{setTimeout(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},100)};x.useEffect(()=>{const p=()=>{h(null)};return window.addEventListener("scroll",p,!0),()=>{window.removeEventListener("scroll",p,!0)}},[h]);const b=(p,M)=>{p.preventDefault();const $=window.scrollX,R=window.scrollY;h({x:p.clientX+$,y:p.clientY+R,message:M})},y=()=>{h(null)},P=p=>{const M=new Ot({id:new Date().toString(),text:p,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),g()},T=p=>{const M=new Ot({id:new Date().toString(),text:"",attachment:p,attachmentType:Re.Voice,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,M]),r(M),g()},C=(p,M)=>{const $=URL.createObjectURL(p),R=new Ot({id:new Date().toString(),text:"",attachment:$,attachmentType:M,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,R]),r(R),g()};return{handleDeleteConfirmation:()=>{c&&(i(c),u(null)),a(!1)},handleCloseContextMenu:y,contextMenuItems:[{name:"Edit",icon:m.exports.jsx(ld,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:p=>{console.log("Edit clicked"),y(),s(p)}},{name:"Delete",icon:m.exports.jsx(fd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:p=>{u(p),a(!0),y()}},{name:"Select",icon:m.exports.jsx(nd,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),y()}},{name:"Copy",icon:m.exports.jsx(id,{className:"text-blue-600"}),onClick:p=>{const M=t.find($=>$.id===p);M&&navigator.clipboard.writeText(M.text),y()}}],handleSendFile:C,handleSendVoice:T,handleSendMessage:P,handleContextMenu:b,isModalOpen:l,contextMenu:f,chatRef:o,setIsModalOpen:a}},hd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:l,onMessageSent:a,onDeleteMessage:c,onEditMessage:u,dynamicSymbolAssignments:f,backgroundImage:h})=>{var R,X;const{handleDeleteConfirmation:g,handleCloseContextMenu:b,handleSendFile:y,handleSendVoice:P,handleSendMessage:T,handleContextMenu:C,contextMenuItems:E,isModalOpen:V,contextMenu:p,chatRef:M,setIsModalOpen:$}=dd({user:o,messages:i,updateMessages:l,onMessageSent:a,onEditMessage:u,onDeleteMessage:c});return m.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+h+")",...s},onClick:b,children:[m.exports.jsx("div",{ref:M,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${p?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?m.exports.jsx(Vo,{className:"mt-3",size:27,color:"text-gray-800"}):m.exports.jsx($r,{children:i.length>0?i.map((N,se)=>{var ne,ve,le;const ye=N!=null&&N.attachment?m.exports.jsx(Uf,{attachment:N.attachment,attachmentType:N==null?void 0:N.attachmentType,attachmentFormat:N==null?void 0:N.attachmentFormat},se):null;if(N.isRightSided)return m.exports.jsx(Yf,{media:ye,handleContextMenu:C,message:N},se);const ae=((ve=(ne=i[se-1])==null?void 0:ne.user)==null?void 0:ve.id)!==((le=N==null?void 0:N.user)==null?void 0:le.id);return m.exports.jsx(Wf,{showUserProfile:ae,media:ye,handleContextMenu:C,message:N},se)}):null})}),m.exports.jsx(Of,{isOpen:V,onClose:()=>$(!1),onConfirm:g,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),p&&((R=p==null?void 0:p.message)!=null&&R.id)?m.exports.jsx(Lf,{items:E,isVisible:Boolean(p),messageId:String(p==null?void 0:p.message.id),isCurrentUserMessage:((X=p==null?void 0:p.message)==null?void 0:X.user.id)===o.id,position:{x:p==null?void 0:p.x,y:p==null?void 0:p.y}}):null,m.exports.jsx(Ff,{onSendVoice:P,onSendMessage:T,onFileSend:N=>y(N,Re.File),onImageSend:N=>y(N,Re.Image),onVideoSend:N=>y(N,Re.Video),dynamicSymbolAssignments:f})]})};fe.AttachmentTypeEnum=Re,fe.Button=oa,fe.Chat=hd,fe.MessageEntity=Ot,Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"})});
|
|
21
21
|
//# sourceMappingURL=index.umd.js.map
|