react-pro-messenger 1.0.40 → 1.0.42

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.umd.js CHANGED
@@ -1,21 +1,21 @@
1
- (function(he,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):(he=typeof globalThis<"u"?globalThis:he||self,x(he.ReactProMessenger={},he.React,he.ReactDOM))})(this,function(he,x,Ue){"use strict";var Id=Object.defineProperty;var Nd=(he,x,Ue)=>x in he?Id(he,x,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):he[x]=Ue;var Te=(he,x,Ue)=>(Nd(he,typeof x!="symbol"?x+"":x,Ue),Ue);function sa(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 rn=sa(x);var p={exports:{}},dt={};var Nr;function ia(){if(Nr)return dt;Nr=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,m=null;c!==void 0&&(h=""+c),a.key!==void 0&&(h=""+a.key),a.ref!==void 0&&(m=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:m,props:f,_owner:s.current}}return dt.Fragment=n,dt.jsx=o,dt.jsxs=o,dt}var ht={};var Fr;function oa(){return Fr||(Fr=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"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function S(d){if(d===null||typeof d!="object")return null;var w=v&&d[v]||d[y];return typeof w=="function"?w:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(d){{for(var w=arguments.length,D=new Array(w>1?w-1:0),B=1;B<w;B++)D[B-1]=arguments[B];C("error",d,D)}}function C(d,w,D){{var B=b.ReactDebugCurrentFrame,X=B.getStackAddendum();X!==""&&(w+="%s",D=D.concat([X]));var te=D.map(function(q){return String(q)});te.unshift("Warning: "+w),Function.prototype.apply.call(console[d],console,te)}}var L=!1,g=!1,O=!1,Y=!1,E=!1,Q;Q=Symbol.for("react.module.reference");function N(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||E||d===s||d===c||d===u||Y||d===m||L||g||O||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===l||d.$$typeof===a||d.$$typeof===Q||d.getModuleId!==void 0))}function G(d,w,D){var B=d.displayName;if(B)return B;var X=w.displayName||w.name||"";return X!==""?D+"("+X+")":D}function oe(d){return d.displayName||"Context"}function ee(d){if(d==null)return null;if(typeof d.tag=="number"&&P("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 oe(w)+".Consumer";case o:var D=d;return oe(D._context)+".Provider";case a:return G(d,d.render,"ForwardRef");case f:var B=d.displayName||null;return B!==null?B:ee(d.type)||"Memo";case h:{var X=d,te=X._payload,q=X._init;try{return ee(q(te))}catch{return null}}}return null}var ae=Object.assign,xe=0,z,K,le,Se,T,R,U;function W(){}W.__reactDisabledLog=!0;function $(){{if(xe===0){z=console.log,K=console.info,le=console.warn,Se=console.error,T=console.group,R=console.groupCollapsed,U=console.groupEnd;var d={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}xe++}}function V(){{if(xe--,xe===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ae({},d,{value:z}),info:ae({},d,{value:K}),warn:ae({},d,{value:le}),error:ae({},d,{value:Se}),group:ae({},d,{value:T}),groupCollapsed:ae({},d,{value:R}),groupEnd:ae({},d,{value:U})})}xe<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var A=b.ReactCurrentDispatcher,M;function k(d,w,D){{if(M===void 0)try{throw Error()}catch(X){var B=X.stack.trim().match(/\n( *(at )?)/);M=B&&B[1]||""}return`
2
- `+M+d}}var F=!1,_;{var ue=typeof WeakMap=="function"?WeakMap:Map;_=new ue}function j(d,w){if(!d||F)return"";{var D=_.get(d);if(D!==void 0)return D}var B;F=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var te;te=A.current,A.current=null,$();try{if(w){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(ke){B=ke}Reflect.construct(d,[],q)}else{try{q.call()}catch(ke){B=ke}d.call(q.prototype)}}else{try{throw Error()}catch(ke){B=ke}d()}}catch(ke){if(ke&&B&&typeof ke.stack=="string"){for(var H=ke.stack.split(`
3
- `),be=B.stack.split(`
1
+ (function(he,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):(he=typeof globalThis<"u"?globalThis:he||self,x(he.ReactProMessenger={},he.React,he.ReactDOM))})(this,function(he,x,Ue){"use strict";var Nd=Object.defineProperty;var Fd=(he,x,Ue)=>x in he?Nd(he,x,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):he[x]=Ue;var we=(he,x,Ue)=>(Fd(he,typeof x!="symbol"?x+"":x,Ue),Ue);function ia(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 rn=ia(x);var p={exports:{}},dt={};var Fr;function oa(){if(Fr)return dt;Fr=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(a,l,u){var c,f={},h=null,m=null;u!==void 0&&(h=""+u),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(m=l.ref);for(c in l)r.call(l,c)&&!i.hasOwnProperty(c)&&(f[c]=l[c]);if(a&&a.defaultProps)for(c in l=a.defaultProps,l)f[c]===void 0&&(f[c]=l[c]);return{$$typeof:t,type:a,key:h,ref:m,props:f,_owner:s.current}}return dt.Fragment=n,dt.jsx=o,dt.jsxs=o,dt}var ht={};var Br;function aa(){return Br||(Br=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"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function w(d){if(d===null||typeof d!="object")return null;var S=v&&d[v]||d[y];return typeof S=="function"?S:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(d){{for(var S=arguments.length,M=new Array(S>1?S-1:0),U=1;U<S;U++)M[U-1]=arguments[U];P("error",d,M)}}function P(d,S,M){{var U=b.ReactDebugCurrentFrame,X=U.getStackAddendum();X!==""&&(S+="%s",M=M.concat([X]));var te=M.map(function(G){return String(G)});te.unshift("Warning: "+S),Function.prototype.apply.call(console[d],console,te)}}var L=!1,g=!1,O=!1,Y=!1,R=!1,Q;Q=Symbol.for("react.module.reference");function F(d){return!!(typeof d=="string"||typeof d=="function"||d===r||d===i||R||d===s||d===u||d===c||Y||d===m||L||g||O||typeof d=="object"&&d!==null&&(d.$$typeof===h||d.$$typeof===f||d.$$typeof===o||d.$$typeof===a||d.$$typeof===l||d.$$typeof===Q||d.getModuleId!==void 0))}function I(d,S,M){var U=d.displayName;if(U)return U;var X=S.displayName||S.name||"";return X!==""?M+"("+X+")":M}function oe(d){return d.displayName||"Context"}function ee(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 u:return"Suspense";case c:return"SuspenseList"}if(typeof d=="object")switch(d.$$typeof){case a:var S=d;return oe(S)+".Consumer";case o:var M=d;return oe(M._context)+".Provider";case l:return I(d,d.render,"ForwardRef");case f:var U=d.displayName||null;return U!==null?U:ee(d.type)||"Memo";case h:{var X=d,te=X._payload,G=X._init;try{return ee(G(te))}catch{return null}}}return null}var ae=Object.assign,Se=0,pe,q,le,K,T,V,z;function W(){}W.__reactDisabledLog=!0;function $(){{if(Se===0){pe=console.log,q=console.info,le=console.warn,K=console.error,T=console.group,V=console.groupCollapsed,z=console.groupEnd;var d={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:d,log:d,warn:d,error:d,group:d,groupCollapsed:d,groupEnd:d})}Se++}}function D(){{if(Se--,Se===0){var d={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ae({},d,{value:pe}),info:ae({},d,{value:q}),warn:ae({},d,{value:le}),error:ae({},d,{value:K}),group:ae({},d,{value:T}),groupCollapsed:ae({},d,{value:V}),groupEnd:ae({},d,{value:z})})}Se<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var E=b.ReactCurrentDispatcher,A;function k(d,S,M){{if(A===void 0)try{throw Error()}catch(X){var U=X.stack.trim().match(/\n( *(at )?)/);A=U&&U[1]||""}return`
2
+ `+A+d}}var B=!1,_;{var ce=typeof WeakMap=="function"?WeakMap:Map;_=new ce}function j(d,S){if(!d||B)return"";{var M=_.get(d);if(M!==void 0)return M}var U;B=!0;var X=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var te;te=E.current,E.current=null,$();try{if(S){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(ke){U=ke}Reflect.construct(d,[],G)}else{try{G.call()}catch(ke){U=ke}d.call(G.prototype)}}else{try{throw Error()}catch(ke){U=ke}d()}}catch(ke){if(ke&&U&&typeof ke.stack=="string"){for(var H=ke.stack.split(`
3
+ `),be=U.stack.split(`
4
4
  `),fe=H.length-1,de=be.length-1;fe>=1&&de>=0&&H[fe]!==be[de];)de--;for(;fe>=1&&de>=0;fe--,de--)if(H[fe]!==be[de]){if(fe!==1||de!==1)do if(fe--,de--,de<0||H[fe]!==be[de]){var je=`
5
- `+H[fe].replace(" at new "," at ");return d.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",d.displayName)),typeof d=="function"&&_.set(d,je),je}while(fe>=1&&de>=0);break}}}finally{F=!1,A.current=te,V(),Error.prepareStackTrace=X}var ft=d?d.displayName||d.name:"",ra=ft?k(ft):"";return typeof d=="function"&&_.set(d,ra),ra}function Ee(d,w,D){return j(d,!1)}function ut(d){var w=d.prototype;return!!(w&&w.isReactComponent)}function qe(d,w,D){if(d==null)return"";if(typeof d=="function")return j(d,ut(d));if(typeof d=="string")return k(d);switch(d){case c:return k("Suspense");case u:return k("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case a:return Ee(d.render);case f:return qe(d.type,w,D);case h:{var B=d,X=B._payload,te=B._init;try{return qe(te(X),w,D)}catch{}}}return""}var tn=Object.prototype.hasOwnProperty,Yo={},Ko=b.ReactDebugCurrentFrame;function nn(d){if(d){var w=d._owner,D=qe(d.type,d._source,w?w.type:null);Ko.setExtraStackFrame(D)}else Ko.setExtraStackFrame(null)}function yd(d,w,D,B,X){{var te=Function.call.bind(tn);for(var q in d)if(te(d,q)){var H=void 0;try{if(typeof d[q]!="function"){var be=Error((B||"React class")+": "+D+" type `"+q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[q]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw be.name="Invariant Violation",be}H=d[q](w,q,B,D,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(fe){H=fe}H&&!(H instanceof Error)&&(nn(X),P("%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).",B||"React class",D,q,typeof H),nn(null)),H instanceof Error&&!(H.message in Yo)&&(Yo[H.message]=!0,nn(X),P("Failed %s type: %s",D,H.message),nn(null))}}}var vd=Array.isArray;function Or(d){return vd(d)}function xd(d){{var w=typeof Symbol=="function"&&Symbol.toStringTag,D=w&&d[Symbol.toStringTag]||d.constructor.name||"Object";return D}}function bd(d){try{return Ho(d),!1}catch{return!0}}function Ho(d){return""+d}function Go(d){if(bd(d))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xd(d)),Ho(d)}var Lt=b.ReactCurrentOwner,Td={key:!0,ref:!0,__self:!0,__source:!0},qo,Xo,Lr;Lr={};function wd(d){if(tn.call(d,"ref")){var w=Object.getOwnPropertyDescriptor(d,"ref").get;if(w&&w.isReactWarning)return!1}return d.ref!==void 0}function Sd(d){if(tn.call(d,"key")){var w=Object.getOwnPropertyDescriptor(d,"key").get;if(w&&w.isReactWarning)return!1}return d.key!==void 0}function Pd(d,w){if(typeof d.ref=="string"&&Lt.current&&w&&Lt.current.stateNode!==w){var D=ee(Lt.current.type);Lr[D]||(P('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',ee(Lt.current.type),d.ref),Lr[D]=!0)}}function Cd(d,w){{var D=function(){qo||(qo=!0,P("%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))};D.isReactWarning=!0,Object.defineProperty(d,"key",{get:D,configurable:!0})}}function Ed(d,w){{var D=function(){Xo||(Xo=!0,P("%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))};D.isReactWarning=!0,Object.defineProperty(d,"ref",{get:D,configurable:!0})}}var jd=function(d,w,D,B,X,te,q){var H={$$typeof:t,type:d,key:w,ref:D,props:q,_owner:te};return H._store={},Object.defineProperty(H._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(H,"_self",{configurable:!1,enumerable:!1,writable:!1,value:B}),Object.defineProperty(H,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(H.props),Object.freeze(H)),H};function Ad(d,w,D,B,X){{var te,q={},H=null,be=null;D!==void 0&&(Go(D),H=""+D),Sd(w)&&(Go(w.key),H=""+w.key),wd(w)&&(be=w.ref,Pd(w,X));for(te in w)tn.call(w,te)&&!Td.hasOwnProperty(te)&&(q[te]=w[te]);if(d&&d.defaultProps){var fe=d.defaultProps;for(te in fe)q[te]===void 0&&(q[te]=fe[te])}if(H||be){var de=typeof d=="function"?d.displayName||d.name||"Unknown":d;H&&Cd(q,de),be&&Ed(q,de)}return jd(d,H,be,X,B,Lt.current,q)}}var kr=b.ReactCurrentOwner,Zo=b.ReactDebugCurrentFrame;function ct(d){if(d){var w=d._owner,D=qe(d.type,d._source,w?w.type:null);Zo.setExtraStackFrame(D)}else Zo.setExtraStackFrame(null)}var _r;_r=!1;function Ir(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Jo(){{if(kr.current){var d=ee(kr.current.type);if(d)return`
5
+ `+H[fe].replace(" at new "," at ");return d.displayName&&je.includes("<anonymous>")&&(je=je.replace("<anonymous>",d.displayName)),typeof d=="function"&&_.set(d,je),je}while(fe>=1&&de>=0);break}}}finally{B=!1,E.current=te,D(),Error.prepareStackTrace=X}var ft=d?d.displayName||d.name:"",sa=ft?k(ft):"";return typeof d=="function"&&_.set(d,sa),sa}function Ee(d,S,M){return j(d,!1)}function ct(d){var S=d.prototype;return!!(S&&S.isReactComponent)}function Ge(d,S,M){if(d==null)return"";if(typeof d=="function")return j(d,ct(d));if(typeof d=="string")return k(d);switch(d){case u:return k("Suspense");case c:return k("SuspenseList")}if(typeof d=="object")switch(d.$$typeof){case l:return Ee(d.render);case f:return Ge(d.type,S,M);case h:{var U=d,X=U._payload,te=U._init;try{return Ge(te(X),S,M)}catch{}}}return""}var tn=Object.prototype.hasOwnProperty,Ko={},Ho=b.ReactDebugCurrentFrame;function nn(d){if(d){var S=d._owner,M=Ge(d.type,d._source,S?S.type:null);Ho.setExtraStackFrame(M)}else Ho.setExtraStackFrame(null)}function vd(d,S,M,U,X){{var te=Function.call.bind(tn);for(var G in d)if(te(d,G)){var H=void 0;try{if(typeof d[G]!="function"){var be=Error((U||"React class")+": "+M+" type `"+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof d[G]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw be.name="Invariant Violation",be}H=d[G](S,G,U,M,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(fe){H=fe}H&&!(H instanceof Error)&&(nn(X),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).",U||"React class",M,G,typeof H),nn(null)),H instanceof Error&&!(H.message in Ko)&&(Ko[H.message]=!0,nn(X),C("Failed %s type: %s",M,H.message),nn(null))}}}var xd=Array.isArray;function Lr(d){return xd(d)}function bd(d){{var S=typeof Symbol=="function"&&Symbol.toStringTag,M=S&&d[Symbol.toStringTag]||d.constructor.name||"Object";return M}}function wd(d){try{return qo(d),!1}catch{return!0}}function qo(d){return""+d}function Go(d){if(wd(d))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bd(d)),qo(d)}var Lt=b.ReactCurrentOwner,Td={key:!0,ref:!0,__self:!0,__source:!0},Xo,Zo,kr;kr={};function Sd(d){if(tn.call(d,"ref")){var S=Object.getOwnPropertyDescriptor(d,"ref").get;if(S&&S.isReactWarning)return!1}return d.ref!==void 0}function Cd(d){if(tn.call(d,"key")){var S=Object.getOwnPropertyDescriptor(d,"key").get;if(S&&S.isReactWarning)return!1}return d.key!==void 0}function Pd(d,S){if(typeof d.ref=="string"&&Lt.current&&S&&Lt.current.stateNode!==S){var M=ee(Lt.current.type);kr[M]||(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',ee(Lt.current.type),d.ref),kr[M]=!0)}}function Ed(d,S){{var M=function(){Xo||(Xo=!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)",S))};M.isReactWarning=!0,Object.defineProperty(d,"key",{get:M,configurable:!0})}}function jd(d,S){{var M=function(){Zo||(Zo=!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)",S))};M.isReactWarning=!0,Object.defineProperty(d,"ref",{get:M,configurable:!0})}}var Ad=function(d,S,M,U,X,te,G){var H={$$typeof:t,type:d,key:S,ref:M,props:G,_owner:te};return H._store={},Object.defineProperty(H._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(H,"_self",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.defineProperty(H,"_source",{configurable:!1,enumerable:!1,writable:!1,value:X}),Object.freeze&&(Object.freeze(H.props),Object.freeze(H)),H};function Md(d,S,M,U,X){{var te,G={},H=null,be=null;M!==void 0&&(Go(M),H=""+M),Cd(S)&&(Go(S.key),H=""+S.key),Sd(S)&&(be=S.ref,Pd(S,X));for(te in S)tn.call(S,te)&&!Td.hasOwnProperty(te)&&(G[te]=S[te]);if(d&&d.defaultProps){var fe=d.defaultProps;for(te in fe)G[te]===void 0&&(G[te]=fe[te])}if(H||be){var de=typeof d=="function"?d.displayName||d.name||"Unknown":d;H&&Ed(G,de),be&&jd(G,de)}return Ad(d,H,be,X,U,Lt.current,G)}}var _r=b.ReactCurrentOwner,Jo=b.ReactDebugCurrentFrame;function ut(d){if(d){var S=d._owner,M=Ge(d.type,d._source,S?S.type:null);Jo.setExtraStackFrame(M)}else Jo.setExtraStackFrame(null)}var Ir;Ir=!1;function Nr(d){return typeof d=="object"&&d!==null&&d.$$typeof===t}function Qo(){{if(_r.current){var d=ee(_r.current.type);if(d)return`
6
6
 
7
- Check the render method of \``+d+"`."}return""}}function Md(d){{if(d!==void 0){var w=d.fileName.replace(/^.*[\\\/]/,""),D=d.lineNumber;return`
7
+ Check the render method of \``+d+"`."}return""}}function Dd(d){{if(d!==void 0){var S=d.fileName.replace(/^.*[\\\/]/,""),M=d.lineNumber;return`
8
8
 
9
- Check your code at `+w+":"+D+"."}return""}}var Qo={};function Dd(d){{var w=Jo();if(!w){var D=typeof d=="string"?d:d.displayName||d.name;D&&(w=`
9
+ Check your code at `+S+":"+M+"."}return""}}var ea={};function Vd(d){{var S=Qo();if(!S){var M=typeof d=="string"?d:d.displayName||d.name;M&&(S=`
10
10
 
11
- Check the top-level render call using <`+D+">.")}return w}}function ea(d,w){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var D=Dd(w);if(Qo[D])return;Qo[D]=!0;var B="";d&&d._owner&&d._owner!==kr.current&&(B=" It was passed a child from "+ee(d._owner.type)+"."),ct(d),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',D,B),ct(null)}}function ta(d,w){{if(typeof d!="object")return;if(Or(d))for(var D=0;D<d.length;D++){var B=d[D];Ir(B)&&ea(B,w)}else if(Ir(d))d._store&&(d._store.validated=!0);else if(d){var X=S(d);if(typeof X=="function"&&X!==d.entries)for(var te=X.call(d),q;!(q=te.next()).done;)Ir(q.value)&&ea(q.value,w)}}}function Rd(d){{var w=d.type;if(w==null||typeof w=="string")return;var D;if(typeof w=="function")D=w.propTypes;else if(typeof w=="object"&&(w.$$typeof===a||w.$$typeof===f))D=w.propTypes;else return;if(D){var B=ee(w);yd(D,d.props,"prop",B,d)}else if(w.PropTypes!==void 0&&!_r){_r=!0;var X=ee(w);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof w.getDefaultProps=="function"&&!w.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Vd(d){{for(var w=Object.keys(d.props),D=0;D<w.length;D++){var B=w[D];if(B!=="children"&&B!=="key"){ct(d),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",B),ct(null);break}}d.ref!==null&&(ct(d),P("Invalid attribute `ref` supplied to `React.Fragment`."),ct(null))}}function na(d,w,D,B,X,te){{var q=N(d);if(!q){var H="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(H+=" 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 be=Md(X);be?H+=be:H+=Jo();var fe;d===null?fe="null":Or(d)?fe="array":d!==void 0&&d.$$typeof===t?(fe="<"+(ee(d.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):fe=typeof d,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fe,H)}var de=Ad(d,w,D,X,te);if(de==null)return de;if(q){var je=w.children;if(je!==void 0)if(B)if(Or(je)){for(var ft=0;ft<je.length;ft++)ta(je[ft],d);Object.freeze&&Object.freeze(je)}else P("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 ta(je,d)}return d===r?Vd(de):Rd(de),de}}function Od(d,w,D){return na(d,w,D,!0)}function Ld(d,w,D){return na(d,w,D,!1)}var kd=Ld,_d=Od;ht.Fragment=r,ht.jsx=kd,ht.jsxs=_d}()),ht}(function(e){process.env.NODE_ENV==="production"?e.exports=ia():e.exports=oa()})(p);const Fd="",aa=()=>{const e=x.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return p.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"})},la=({symbol:e,onClick:t,item:n})=>p.exports.jsxs("div",{onClick:()=>{t(n.id,n.name)},className:"flex gap-2 justify-between, items-center",children:[p.exports.jsx("div",{children:e}),p.exports.jsx("div",{children:n.name})]});class Xe{constructor({id:t,text:n,createdDate:r,attachmentUrl:s,attachmentType:i,attachmentFormat:o,attachmentBlob:l,user:a,isRightSided:c,symbols:u,isSending:f,isEdited:h}){Te(this,"id","0");Te(this,"text","");Te(this,"createdDate","");Te(this,"attachmentUrl","");Te(this,"attachmentBlob");Te(this,"attachmentType");Te(this,"attachmentFormat","");Te(this,"user",{id:""});Te(this,"isRightSided",!1);Te(this,"symbols");Te(this,"isSending");Te(this,"isEdited");Te(this,"updateId",t=>{this.id=t});Te(this,"updateIsSending",t=>{this.isSending=t});this.id=t,this.text=n,this.createdDate=r,this.attachmentUrl=s,this.attachmentType=i,this.attachmentFormat=o,this.attachmentBlob=l,this.user=a,this.isRightSided=c,this.symbols=u,this.isSending=f,this.isEdited=h}}const sn=x.createContext({});function on(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const kt=x.createContext(null),an=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class ua extends rn.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 ca({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(an);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 m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
11
+ Check the top-level render call using <`+M+">.")}return S}}function ta(d,S){{if(!d._store||d._store.validated||d.key!=null)return;d._store.validated=!0;var M=Vd(S);if(ea[M])return;ea[M]=!0;var U="";d&&d._owner&&d._owner!==_r.current&&(U=" It was passed a child from "+ee(d._owner.type)+"."),ut(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.',M,U),ut(null)}}function na(d,S){{if(typeof d!="object")return;if(Lr(d))for(var M=0;M<d.length;M++){var U=d[M];Nr(U)&&ta(U,S)}else if(Nr(d))d._store&&(d._store.validated=!0);else if(d){var X=w(d);if(typeof X=="function"&&X!==d.entries)for(var te=X.call(d),G;!(G=te.next()).done;)Nr(G.value)&&ta(G.value,S)}}}function Rd(d){{var S=d.type;if(S==null||typeof S=="string")return;var M;if(typeof S=="function")M=S.propTypes;else if(typeof S=="object"&&(S.$$typeof===l||S.$$typeof===f))M=S.propTypes;else return;if(M){var U=ee(S);vd(M,d.props,"prop",U,d)}else if(S.PropTypes!==void 0&&!Ir){Ir=!0;var X=ee(S);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",X||"Unknown")}typeof S.getDefaultProps=="function"&&!S.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Od(d){{for(var S=Object.keys(d.props),M=0;M<S.length;M++){var U=S[M];if(U!=="children"&&U!=="key"){ut(d),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",U),ut(null);break}}d.ref!==null&&(ut(d),C("Invalid attribute `ref` supplied to `React.Fragment`."),ut(null))}}function ra(d,S,M,U,X,te){{var G=F(d);if(!G){var H="";(d===void 0||typeof d=="object"&&d!==null&&Object.keys(d).length===0)&&(H+=" 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 be=Dd(X);be?H+=be:H+=Qo();var fe;d===null?fe="null":Lr(d)?fe="array":d!==void 0&&d.$$typeof===t?(fe="<"+(ee(d.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):fe=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",fe,H)}var de=Md(d,S,M,X,te);if(de==null)return de;if(G){var je=S.children;if(je!==void 0)if(U)if(Lr(je)){for(var ft=0;ft<je.length;ft++)na(je[ft],d);Object.freeze&&Object.freeze(je)}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 na(je,d)}return d===r?Od(de):Rd(de),de}}function Ld(d,S,M){return ra(d,S,M,!0)}function kd(d,S,M){return ra(d,S,M,!1)}var _d=kd,Id=Ld;ht.Fragment=r,ht.jsx=_d,ht.jsxs=Id}()),ht}(function(e){process.env.NODE_ENV==="production"?e.exports=oa():e.exports=aa()})(p);const Bd="",la=()=>{const e=x.useCallback(()=>{console.log("Vite + React + TypeScript + Tailwind = ❤️")},[]);return p.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"})},ca=({symbol:e,onClick:t,item:n})=>p.exports.jsxs("div",{onClick:()=>{t(n.id,n.name)},className:"flex gap-2 justify-between, items-center",children:[p.exports.jsx("div",{children:e}),p.exports.jsx("div",{children:n.name})]});class Xe{constructor({id:t,text:n,createdDate:r,attachmentUrl:s,attachmentType:i,attachmentFormat:o,attachmentBlob:a,user:l,isRightSided:u,symbols:c,isSending:f,isEdited:h}){we(this,"id","0");we(this,"text","");we(this,"createdDate","");we(this,"attachmentUrl","");we(this,"attachmentBlob");we(this,"attachmentType");we(this,"attachmentFormat","");we(this,"user",{id:""});we(this,"isRightSided",!1);we(this,"symbols");we(this,"isSending");we(this,"isEdited");we(this,"updateId",t=>{this.id=t});we(this,"updateIsSending",t=>{this.isSending=t});this.id=t,this.text=n,this.createdDate=r,this.attachmentUrl=s,this.attachmentType=i,this.attachmentFormat=o,this.attachmentBlob=a,this.user=l,this.isRightSided=u,this.symbols=c,this.isSending=f,this.isEdited=h}}const sn=x.createContext({});function on(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const kt=x.createContext(null),an=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class ua extends rn.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 fa({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(an);return x.useInsertionEffect(()=>{const{width:a,height:l,top:u,left:c,right:f}=i.current;if(t||!s.current||!a||!l)return;const h=n==="left"?`left: ${c}`:`right: ${f}`;s.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
12
12
  [data-motion-pop-id="${r}"] {
13
13
  position: absolute !important;
14
- width: ${l}px !important;
15
- height: ${a}px !important;
14
+ width: ${a}px !important;
15
+ height: ${l}px !important;
16
16
  ${h}px !important;
17
- top: ${c}px !important;
17
+ top: ${u}px !important;
18
18
  }
19
- `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(ua,{isPresent:t,childRef:s,sizeRef:i,children:rn.cloneElement(e,{ref:s})})}const fa=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:l})=>{const a=on(da),c=x.useId(),u=x.useCallback(h=>{a.set(h,!0);for(const m of a.values())if(!m)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,m)=>a.set(m,!1))},[n]),rn.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(ca,{isPresent:n,anchorX:l,children:e})),p.exports.jsx(kt.Provider,{value:f,children:e})};function da(){return new Map}function Br(e=!0){const t=x.useContext(kt);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 _t=e=>e.key||"";function $r(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const ln=typeof window<"u",Ur=ln?x.useLayoutEffect:x.useEffect,Wr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:l="left"})=>{const[a,c]=Br(o),u=x.useMemo(()=>$r(e),[e]),f=o&&!a?[]:u.map(_t),h=x.useRef(!0),m=x.useRef(u),v=on(()=>new Map),[y,S]=x.useState(u),[b,P]=x.useState(u);Ur(()=>{h.current=!1,m.current=u;for(let g=0;g<b.length;g++){const O=_t(b[g]);f.includes(O)?v.delete(O):v.get(O)!==!0&&v.set(O,!1)}},[b,f.length,f.join("-")]);const C=[];if(u!==y){let g=[...u];for(let O=0;O<b.length;O++){const Y=b[O],E=_t(Y);f.includes(E)||(g.splice(O,0,Y),C.push(Y))}return i==="wait"&&C.length&&(g=C),P($r(g)),S(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:L}=x.useContext(sn);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=_t(g),Y=o&&!a?!1:u===b||f.includes(O),E=()=>{if(v.has(O))v.set(O,!0);else return;let Q=!0;v.forEach(N=>{N||(Q=!1)}),Q&&(L==null||L(),P(m.current),o&&(c==null||c()),r&&r())};return p.exports.jsx(fa,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:E,anchorX:l,children:g},O)})})},we=e=>e;let Ze=we,_e=we;process.env.NODE_ENV!=="production"&&(Ze=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},_e=(e,t)=>{if(!e)throw new Error(t)});function un(e){let t;return()=>(t===void 0&&(t=e()),t)}const Je=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Me=e=>e*1e3,Oe=e=>e/1e3,zr={skipAnimations:!1,useManualTiming:!1},It=["read","resolveKeyframes","update","preRender","render","postRender"],Ie={value:null,addProjectionMetrics:null};function ha(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&&Ie.value&&Ie.value.frameloop[t].push(a),a=0,n.clear(),s=!1,i&&(i=!1,u.process(f))}};return u}const pa=40;function Yr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=It.reduce((b,P)=>(b[P]=ha(i,t?P: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,pa),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))},v=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:It.reduce((b,P)=>{const C=o[P];return b[P]=(L,g=!1,O=!1)=>(n||v(),C.schedule(L,g,O)),b},{}),cancel:b=>{for(let P=0;P<It.length;P++)o[It[P]].cancel(b)},state:s,steps:o}}const{schedule:ne,cancel:Ne,state:me,steps:cn}=Yr(typeof requestAnimationFrame<"u"?requestAnimationFrame:we,!0),Kr=x.createContext({strict:!1}),Hr={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"]},Qe={};for(const e in Hr)Qe[e]={isEnabled:t=>Hr[e].some(n=>!!t[n])};function ma(e){for(const t in e)Qe[t]={...Qe[t],...e[t]}}const ga=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 Nt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ga.has(e)}let Gr=e=>!Nt(e);function ya(e){e&&(Gr=t=>t.startsWith("on")?!Nt(t):e(t))}try{ya(require("@emotion/is-prop-valid").default)}catch{}function va(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Gr(s)||n===!0&&Nt(s)||!t&&!Nt(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 xa(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 Bt=x.createContext({});function $t(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pt(e){return typeof e=="string"||Array.isArray(e)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Ut(e){return $t(e.animate)||dn.some(t=>pt(e[t]))}function Xr(e){return Boolean(Ut(e)||e.variants)}function ba(e,t){if(Ut(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pt(n)?n:void 0,animate:pt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ta(e){const{initial:t,animate:n}=ba(e,x.useContext(Bt));return x.useMemo(()=>({initial:t,animate:n}),[Zr(t),Zr(n)])}function Zr(e){return Array.isArray(e)?e.join(" "):e}const wa=Symbol.for("motionComponentSymbol");function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Sa(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):et(n)&&(n.current=r))},[t])}const hn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Jr="data-"+hn("framerAppearId"),{schedule:pn,cancel:$d}=Yr(queueMicrotask,!1),Qr=x.createContext({});function Pa(e,t,n,r,s){var i,o;const{visualElement:l}=x.useContext(Bt),a=x.useContext(Kr),c=x.useContext(kt),u=x.useContext(an).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,m=x.useContext(Qr);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Ca(f.current,n,s,m);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,c)});const y=n[Jr],S=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 Ur(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),pn.render(h.render),S.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!S.current&&h.animationState&&h.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),S.current=!1))}),h}function Ca(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:es(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||l&&et(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:a,layoutRoot:c})}function es(e){if(e)return e.options.allowProjection!==!1?e.projection:es(e.parent)}function Ea({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ma(e);function l(c,u){let f;const h={...x.useContext(an),...c,layoutId:ja(c)},{isStatic:m}=h,v=Ta(c),y=r(c,m);if(!m&&ln){Aa(h,e);const S=Ma(h);f=S.MeasureLayout,v.visualElement=Pa(s,y,h,t,S.ProjectionNode)}return p.exports.jsxs(Bt.Provider,{value:v,children:[f&&v.visualElement?p.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(s,c,Sa(y,v.visualElement,u),y,m,v.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[wa]=s,a}function ja({layoutId:e}){const t=x.useContext(sn).id;return t&&e!==void 0?t+"-"+e:e}function Aa(e,t){const n=x.useContext(Kr).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?Ze(!1,r):_e(!1,r)}}function Ma(e){const{drag:t,layout:n}=Qe;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 ts=e=>t=>typeof t=="string"&&t.startsWith(e),mn=ts("--"),Da=ts("var(--"),gn=e=>Da(e)?Ra.test(e.split("/*")[0].trim()):!1,Ra=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mt={};function Va(e){for(const t in e)mt[t]=e[t],mn(t)&&(mt[t].isCSSVariable=!0)}const tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],We=new Set(tt);function ns(e,{layout:t,layoutId:n}){return We.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mt[e]||e==="opacity")}const ge=e=>Boolean(e&&e.getVelocity),rs=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Le=(e,t,n)=>n>t?t:n<e?e:n,nt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gt={...nt,transform:e=>Le(0,1,e)},Wt={...nt,default:1},yt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=yt("deg"),De=yt("%"),I=yt("px"),Oa=yt("vh"),La=yt("vw"),ss={...De,parse:e=>De.parse(e)/100,transform:e=>De.transform(e*100)},ka={borderWidth:I,borderTopWidth:I,borderRightWidth:I,borderBottomWidth:I,borderLeftWidth:I,borderRadius:I,radius:I,borderTopLeftRadius:I,borderTopRightRadius:I,borderBottomRightRadius:I,borderBottomLeftRadius:I,width:I,maxWidth:I,height:I,maxHeight:I,top:I,right:I,bottom:I,left:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,backgroundPositionX:I,backgroundPositionY:I},_a={rotate:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:Fe,skewX:Fe,skewY:Fe,distance:I,translateX:I,translateY:I,translateZ:I,x:I,y:I,z:I,perspective:I,transformPerspective:I,opacity:gt,originX:ss,originY:ss,originZ:I},is={...nt,transform:Math.round},yn={...ka,..._a,zIndex:is,size:I,fillOpacity:gt,strokeOpacity:gt,numOctaves:is},Ia={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Na=tt.length;function Fa(e,t,n){let r="",s=!0;for(let i=0;i<Na;i++){const o=tt[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=rs(l,yn[o]);if(!a){s=!1;const u=Ia[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function vn(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(We.has(a)){o=!0;continue}else if(mn(a)){s[a]=c;continue}else{const u=rs(c,yn[a]);a.startsWith("origin")?(l=!0,i[a]=u):r[a]=u}}if(t.transform||(o||n?r.transform=Fa(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 xn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function os(e,t,n){for(const r in t)!ge(t[r])&&!ns(r,n)&&(e[r]=t[r])}function Ba({transformTemplate:e},t){return x.useMemo(()=>{const n=xn();return vn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function $a(e,t){const n=e.style||{},r={};return os(r,n,e),Object.assign(r,Ba(e,t)),r}function Ua(e,t){const n={},r=$a(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 Wa=["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 bn(e){return typeof e!="string"||e.includes("-")?!1:!!(Wa.indexOf(e)>-1||/[A-Z]/u.test(e))}const za={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ya={offset:"strokeDashoffset",array:"strokeDasharray"};function Ka(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?za:Ya;e[i.offset]=I.transform(-r);const o=I.transform(t),l=I.transform(n);e[i.array]=`${o} ${l}`}function as(e,t,n){return typeof e=="string"?e:I.transform(t+n*e)}function Ha(e,t,n){const r=as(t,e.x,e.width),s=as(n,e.y,e.height);return`${r} ${s}`}function Tn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:l=1,pathOffset:a=0,...c},u,f){if(vn(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:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=Ha(v,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&&Ka(h,o,l,a,!1)}const ls=()=>({...xn(),attrs:{}}),wn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ga(e,t,n,r){const s=x.useMemo(()=>{const i=ls();return Tn(i,t,wn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};os(i,e.style,e),s.style={...i,...s.style}}return s}function qa(e=!1){return(n,r,s,{latestValues:i},o)=>{const a=(bn(n)?Ga:Ua)(r,i,o,n),c=va(r,typeof n=="string",e),u=n!==x.Fragment?{...c,...a,ref:s}:{},{children:f}=r,h=x.useMemo(()=>ge(f)?f.get():f,[f]);return x.createElement(n,{...u,children:h})}}function us(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Sn(e,t,n,r){if(typeof t=="function"){const[s,i]=us(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]=us(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Pn=e=>Array.isArray(e),Xa=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Za=e=>Pn(e)?e[e.length-1]||0:e;function zt(e){const t=ge(e)?e.get():e;return Xa(t)?t.toValue():t}function Ja({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:Qa(r,s,i,e),renderState:t()};return n&&(o.onMount=l=>n({props:r,current:l,...o}),o.onUpdate=l=>n(l)),o}const cs=e=>(t,n)=>{const r=x.useContext(Bt),s=x.useContext(kt),i=()=>Ja(e,t,r,s);return n?i():on(i)};function Qa(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=zt(i[h]);let{initial:o,animate:l}=e;const a=Ut(e),c=Xr(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"&&!$t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const v=Sn(e,h[m]);if(v){const{transitionEnd:y,transition:S,...b}=v;for(const P in b){let C=b[P];if(Array.isArray(C)){const L=u?C.length-1:0;C=C[L]}C!==null&&(s[P]=C)}for(const P in y)s[P]=y[P]}}}return s}function Cn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(ge(s[o])||t.style&&ge(t.style[o])||ns(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 el={useVisualState:cs({scrapeMotionValuesFromProps:Cn,createRenderState:xn})};function fs(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 ds(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 hs=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 ps(e,t,n,r){ds(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(hs.has(s)?s:hn(s),t.attrs[s])}function ms(e,t,n){const r=Cn(e,t,n);for(const s in e)if(ge(e[s])||ge(t[s])){const i=tt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const gs=["x","y","width","height","cx","cy","r"],tl={useVisualState:cs({scrapeMotionValuesFromProps:ms,createRenderState:ls,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(We.has(l)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let l=0;l<gs.length;l++){const a=gs[l];e[a]!==t[a]&&(o=!0)}o&&ne.read(()=>{fs(n,r),ne.render(()=>{Tn(r,s,wn(n.tagName),e.transformTemplate),ps(n,r)})})}})};function nl(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...bn(r)?tl:el,preloadedFeatures:e,useRender:qa(s),createVisualElement:t,Component:r};return Ea(o)}}function vt(e,t,n){const r=e.getProps();return Sn(r,t,n!==void 0?n:r.custom,e)}const rl=un(()=>window.ScrollTimeline!==void 0);class sl{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(rl()&&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 il extends sl{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function En(e,t){return e?e[t]||e.default||e:void 0}const jn=2e4;function ys(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<jn;)t+=n,r=e.next(t);return t>=jn?1/0:t}function An(e){return typeof e=="function"}function vs(e,t){e.timeline=t,e.onfinish=null}const Mn=e=>Array.isArray(e)&&typeof e[0]=="number",ol={linearEasing:void 0};function al(e,t){const n=un(e);return()=>{var r;return(r=ol[t])!==null&&r!==void 0?r:n()}}const Yt=al(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),xs=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Je(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function bs(e){return Boolean(typeof e=="function"&&Yt()||!e||typeof e=="string"&&(e in Dn||Yt())||Mn(e)||Array.isArray(e)&&e.every(bs))}const xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xt([0,.65,.55,1]),circOut:xt([.55,0,1,.45]),backIn:xt([.31,.01,.66,-.59]),backOut:xt([.33,1.53,.69,.99])};function Ts(e,t){if(e)return typeof e=="function"&&Yt()?xs(e,t):Mn(e)?xt(e):Array.isArray(e)?e.map(n=>Ts(n,t)||Dn.easeOut):Dn[e]}const Ae={x:!1,y:!1};function ws(){return Ae.x||Ae.y}function ll(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 Ss(e,t){const n=ll(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ps(e){return!(e.pointerType==="touch"||ws())}function ul(e,t,n={}){const[r,s,i]=Ss(e,n),o=l=>{if(!Ps(l))return;const{target:a}=l,c=t(a,l);if(typeof c!="function"||!a)return;const u=f=>{Ps(f)&&(c(f),a.removeEventListener("pointerleave",u))};a.addEventListener("pointerleave",u,s)};return r.forEach(l=>{l.addEventListener("pointerenter",o,s)}),i}function Kt(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 Cs=(e,t)=>t?e===t?!0:Cs(e,t.parentElement):!1,Rn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,cl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function fl(e){return cl.has(e.tagName)||e.tabIndex!==-1}const bt=new WeakSet;function Es(e){return t=>{t.key==="Enter"&&e(t)}}function Vn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Es(()=>{if(bt.has(n))return;Vn(n,"down");const s=Es(()=>{Vn(n,"up")}),i=()=>Vn(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 js(e){return Rn(e)&&!ws()}function hl(e,t,n={}){const[r,s,i]=Ss(e,n),o=l=>{const a=l.currentTarget;if(!a||!js(l)||bt.has(a))return;bt.add(a),Kt(l,"set");const c=t(a,l),u=(m,v)=>{a.removeEventListener("pointerup",f),a.removeEventListener("pointercancel",h),Kt(m,"release"),!(!js(m)||!bt.has(a))&&(bt.delete(a),typeof c=="function"&&c(m,{success:v}))},f=m=>{(m.isTrusted?pl(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)||Cs(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,!fl(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0)),l.addEventListener("pointerdown",o,s),a&&l.addEventListener("focus",c=>dl(c,s),s)}),i}function pl(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function ml(e){return e==="x"||e==="y"?Ae[e]?null:(Ae[e]=!0,()=>{Ae[e]=!1}):Ae.x||Ae.y?null:(Ae.x=Ae.y=!0,()=>{Ae.x=Ae.y=!1})}const As=new Set(["width","height","top","left","right","bottom",...tt]);let Ht;function gl(){Ht=void 0}const Re={now:()=>(Ht===void 0&&Re.set(me.isProcessing||zr.useManualTiming?me.timestamp:performance.now()),Ht),set:e=>{Ht=e,queueMicrotask(gl)}};function On(e,t){e.indexOf(t)===-1&&e.push(t)}function Ln(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class kn{constructor(){this.subscriptions=[]}add(t){return On(this.subscriptions,t),()=>Ln(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 Ms(e,t){return t?e*(1e3/t):0}const Ds=30,yl=e=>!isNaN(parseFloat(e));class vl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Re.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=Re.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=yl(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 kn);const r=this.events[t].add(n);return t==="change"?()=>{r(),ne.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=Re.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Ds)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Ds);return Ms(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 Tt(e,t){return new vl(e,t)}function xl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Tt(n))}function bl(e,t){const n=vt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const l=Za(i[o]);xl(e,o,l)}}function Tl(e){return Boolean(ge(e)&&e.add)}function _n(e,t){const n=e.getValue("willChange");if(Tl(n))return n.add(t)}function Rs(e){return e.props[Jr]}const wl={current:!1},Vs=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Sl=1e-7,Pl=12;function Cl(e,t,n,r,s){let i,o,l=0;do o=t+(n-t)/2,i=Vs(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Sl&&++l<Pl);return o}function wt(e,t,n,r){if(e===t&&n===r)return we;const s=i=>Cl(i,0,1,e,n);return i=>i===0||i===1?i:Vs(s(i),t,r)}const Os=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Ls=e=>t=>1-e(1-t),ks=wt(.33,1.53,.69,.99),In=Ls(ks),_s=Os(In),Is=e=>(e*=2)<1?.5*In(e):.5*(2-Math.pow(2,-10*(e-1))),Nn=e=>1-Math.sin(Math.acos(e)),Ns=Ls(Nn),Fs=Os(Nn),Bs=e=>/^0[^.\s]+$/u.test(e);function El(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Bs(e):!0}const St=e=>Math.round(e*1e5)/1e5,Fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jl(e){return e==null}const Al=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bn=(e,t)=>n=>Boolean(typeof n=="string"&&Al.test(n)&&n.startsWith(e)||t&&!jl(n)&&Object.prototype.hasOwnProperty.call(n,t)),$s=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,l]=r.match(Fn);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},Ml=e=>Le(0,255,e),$n={...nt,transform:e=>Math.round(Ml(e))},ze={test:Bn("rgb","red"),parse:$s("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$n.transform(e)+", "+$n.transform(t)+", "+$n.transform(n)+", "+St(gt.transform(r))+")"};function Dl(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 Un={test:Bn("#"),parse:Dl,transform:ze.transform},rt={test:Bn("hsl","hue"),parse:$s("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(St(t))+", "+De.transform(St(n))+", "+St(gt.transform(r))+")"},ye={test:e=>ze.test(e)||Un.test(e)||rt.test(e),parse:e=>ze.test(e)?ze.parse(e):rt.test(e)?rt.parse(e):Un.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ze.transform(e):rt.transform(e)},Rl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Vl(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fn))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Rl))===null||n===void 0?void 0:n.length)||0)>0}const Us="number",Ws="color",Ol="var",Ll="var(",zs="${}",kl=/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 Pt(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(kl,a=>(ye.test(a)?(r.color.push(i),s.push(Ws),n.push(ye.parse(a))):a.startsWith(Ll)?(r.var.push(i),s.push(Ol),n.push(a)):(r.number.push(i),s.push(Us),n.push(parseFloat(a))),++i,zs)).split(zs);return{values:n,split:l,indexes:r,types:s}}function Ys(e){return Pt(e).values}function Ks(e){const{split:t,types:n}=Pt(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===Us?i+=St(s[o]):l===Ws?i+=ye.transform(s[o]):i+=s[o]}return i}}const _l=e=>typeof e=="number"?0:e;function Il(e){const t=Ys(e);return Ks(e)(t.map(_l))}const Be={test:Vl,parse:Ys,createTransformer:Ks,getAnimatableNone:Il},Nl=new Set(["brightness","contrast","saturate","opacity"]);function Fl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fn)||[];if(!r)return e;const s=n.replace(r,"");let i=Nl.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Bl=/\b([a-z-]*)\(.*?\)/gu,Wn={...Be,getAnimatableNone:e=>{const t=e.match(Bl);return t?t.map(Fl).join(" "):e}},$l={...yn,color:ye,backgroundColor:ye,outlineColor:ye,fill:ye,stroke:ye,borderColor:ye,borderTopColor:ye,borderRightColor:ye,borderBottomColor:ye,borderLeftColor:ye,filter:Wn,WebkitFilter:Wn},zn=e=>$l[e];function Hs(e,t){let n=zn(e);return n!==Wn&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ul=new Set(["auto","none","0"]);function Wl(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Ul.has(i)&&Pt(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=Hs(n,s)}const Gs=e=>e===nt||e===I,qs=(e,t)=>parseFloat(e.split(", ")[t]),Xs=(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}},zl=new Set(["x","y","z"]),Yl=tt.filter(e=>!zl.has(e));function Kl(e){const t=[];return Yl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const st={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:Xs(4,13),y:Xs(5,14)};st.translateX=st.x,st.translateY=st.y;const Ye=new Set;let Yn=!1,Kn=!1;function Zs(){if(Kn){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Kl(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)})}Kn=!1,Yn=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Js(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kn=!0)})}function Hl(){Js(),Zs()}class Hn{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?(Ye.add(this),Yn||(Yn=!0,ne.read(Js),ne.resolveKeyframes(Zs))):(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),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Qs=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Gl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ql(e){const t=Gl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Xl=4;function ei(e,t,n=1){_e(n<=Xl,`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 Qs(o)?parseFloat(o):o}return gn(s)?ei(s,t,n+1):s}const ti=e=>t=>t.test(e),ni=[nt,I,De,Fe,La,Oa,{test:e=>e==="auto",parse:e=>e}],ri=e=>ni.find(ti(e));class si extends Hn{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(),gn(c))){const u=ei(c,n.current);u!==void 0&&(t[a]=u),a===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!As.has(r)||t.length!==2)return;const[s,i]=t,o=ri(s),l=ri(i);if(o!==l)if(Gs(o)&&Gs(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++)El(t[s])&&r.push(s);r.length&&Wl(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=st[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]=st[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 ii=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Be.test(e)||e==="0")&&!e.startsWith("url("));function Zl(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 Jl(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=ii(s,t),l=ii(i,t);return Ze(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:Zl(e)||(n==="spring"||An(n))&&r}const Ql=e=>e!==null;function Gt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(Ql),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const eu=40;class oi{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=Re.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>eu?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Hl(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Re.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:l,onUpdate:a,isGenerator:c}=this.options;if(!c&&!Jl(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 Ct={layout:0,mainThread:0,waapi:0},re=(e,t,n)=>e+(t-e)*n;function Gn(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 tu({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=Gn(a,l,e+1/3),i=Gn(a,l,e),o=Gn(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 qn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},nu=[Un,ze,rt],ru=e=>nu.find(t=>t.test(e));function ai(e){const t=ru(e);if(Ze(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===rt&&(n=tu(n)),n}const li=(e,t)=>{const n=ai(e),r=ai(t);if(!n||!r)return qt(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=re(n.alpha,r.alpha,i),ze.transform(s))},su=(e,t)=>n=>t(e(n)),Et=(...e)=>e.reduce(su),Xn=new Set(["none","hidden"]);function iu(e,t){return Xn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ou(e,t){return n=>re(e,t,n)}function Zn(e){return typeof e=="number"?ou:typeof e=="string"?gn(e)?qt:ye.test(e)?li:uu:Array.isArray(e)?ui:typeof e=="object"?ye.test(e)?li:au:qt}function ui(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Zn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function au(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Zn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function lu(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 uu=(e,t)=>{const n=Be.createTransformer(t),r=Pt(e),s=Pt(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?Xn.has(e)&&!s.values.length||Xn.has(t)&&!r.values.length?iu(e,t):Et(ui(lu(r,s),s.values),n):(Ze(!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 ci(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?re(e,t,n):Zn(e)(e,t)}const cu=5;function fi(e,t,n){const r=Math.max(t-cu,0);return Ms(n-e(r),t-r)}const se={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},Jn=.001;function fu({duration:e=se.duration,bounce:t=se.bounce,velocity:n=se.velocity,mass:r=se.mass}){let s,i;Ze(e<=Me(se.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Le(se.minDamping,se.maxDamping,o),e=Le(se.minDuration,se.maxDuration,Oe(e)),o<1?(s=c=>{const u=c*o,f=u*e,h=u-n,m=Qn(c,o),v=Math.exp(-f);return Jn-h/m*v},i=c=>{const f=c*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,v=Math.exp(-f),y=Qn(Math.pow(c,2),o);return(-s(c)+Jn>0?-1:1)*((h-m)*v)/y}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-Jn+u*f},i=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const l=5/e,a=hu(s,i,l);if(e=Me(e),isNaN(a))return{stiffness:se.stiffness,damping:se.damping,duration:e};{const c=Math.pow(a,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const du=12;function hu(e,t,n){let r=n;for(let s=1;s<du;s++)r=r-e(r)/t(r);return r}function Qn(e,t){return e*Math.sqrt(1-t*t)}const pu=["duration","bounce"],mu=["stiffness","damping","mass"];function di(e,t){return t.some(n=>e[n]!==void 0)}function gu(e){let t={velocity:se.velocity,stiffness:se.stiffness,damping:se.damping,mass:se.mass,isResolvedFromDuration:!1,...e};if(!di(e,mu)&&di(e,pu))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Le(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:se.mass,stiffness:s,damping:i}}else{const n=fu(e);t={...t,...n,mass:se.mass},t.isResolvedFromDuration=!0}return t}function hi(e=se.visualDuration,t=se.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}=gu({...n,velocity:-Oe(n.velocity||0)}),v=h||0,y=c/(2*Math.sqrt(a*u)),S=o-i,b=Oe(Math.sqrt(a/u)),P=Math.abs(S)<5;r||(r=P?se.restSpeed.granular:se.restSpeed.default),s||(s=P?se.restDelta.granular:se.restDelta.default);let C;if(y<1){const g=Qn(b,y);C=O=>{const Y=Math.exp(-y*b*O);return o-Y*((v+y*b*S)/g*Math.sin(g*O)+S*Math.cos(g*O))}}else if(y===1)C=g=>o-Math.exp(-b*g)*(S+(v+b*S)*g);else{const g=b*Math.sqrt(y*y-1);C=O=>{const Y=Math.exp(-y*b*O),E=Math.min(g*O,300);return o-Y*((v+y*b*S)*Math.sinh(E)+g*S*Math.cosh(E))/g}}const L={calculatedDuration:m&&f||null,next:g=>{const O=C(g);if(m)l.done=g>=f;else{let Y=0;y<1&&(Y=g===0?Me(v):fi(C,g,O));const E=Math.abs(Y)<=r,Q=Math.abs(o-O)<=s;l.done=E&&Q}return l.value=l.done?o:O,l},toString:()=>{const g=Math.min(ys(L),jn),O=xs(Y=>L.next(g*Y).value,g,30);return g+"ms "+O}};return L}function pi({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=E=>l!==void 0&&E<l||a!==void 0&&E>a,v=E=>l===void 0?a:a===void 0||Math.abs(l-E)<Math.abs(a-E)?l:a;let y=n*t;const S=f+y,b=o===void 0?S:o(S);b!==S&&(y=b-f);const P=E=>-y*Math.exp(-E/r),C=E=>b+P(E),L=E=>{const Q=P(E),N=C(E);h.done=Math.abs(Q)<=c,h.value=h.done?b:N};let g,O;const Y=E=>{m(h.value)&&(g=E,O=hi({keyframes:[h.value,v(h.value)],velocity:fi(C,E,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:u}))};return Y(0),{calculatedDuration:null,next:E=>{let Q=!1;return!O&&g===void 0&&(Q=!0,L(E),Y(E)),g!==void 0&&E>=g?O.next(E-g):(!Q&&L(E),h)}}}const yu=wt(.42,0,1,1),vu=wt(0,0,.58,1),mi=wt(.42,0,.58,1),xu=e=>Array.isArray(e)&&typeof e[0]!="number",gi={linear:we,easeIn:yu,easeInOut:mi,easeOut:vu,circIn:Nn,circInOut:Fs,circOut:Ns,backIn:In,backInOut:_s,backOut:ks,anticipate:Is},yi=e=>{if(Mn(e)){_e(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return wt(t,n,r,s)}else if(typeof e=="string")return _e(gi[e]!==void 0,`Invalid easing type '${e}'`),gi[e];return e};function bu(e,t,n){const r=[],s=n||ci,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]||we:t;l=Et(a,l)}r.push(l)}return r}function Tu(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_e(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=bu(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=Je(e[f],e[f+1],u);return l[f](h)};return n?u=>c(Le(e[0],e[i-1],u)):c}function wu(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Je(0,t,r);e.push(re(n,1,s))}}function Su(e){const t=[0];return wu(t,e.length-1),t}function Pu(e,t){return e.map(n=>n*t)}function Cu(e,t){return e.map(()=>t||mi).splice(0,e.length-1)}function jt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=xu(r)?r.map(yi):yi(r),i={done:!1,value:t[0]},o=Pu(n&&n.length===t.length?n:Su(t),e),l=Tu(o,t,{ease:Array.isArray(s)?s:Cu(t,s)});return{calculatedDuration:e,next:a=>(i.value=l(a),i.done=a>=e,i)}}const Eu=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ne.update(t,!0),stop:()=>Ne(t),now:()=>me.isProcessing?me.timestamp:Re.now()}},ju={decay:pi,inertia:pi,tween:jt,keyframes:jt,spring:hi},Au=e=>e/100;class er extends oi{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)||Hn,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=An(n)?n:ju[n]||jt;let a,c;process.env.NODE_ENV!=="production"&&l!==jt&&_e(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==jt&&typeof t[0]!="number"&&(a=Et(Au,ci(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=ys(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;Ct.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:E}=this.options;return{done:!0,value:E[E.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:v,repeatDelay:y,onUpdate:S}=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),P=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,L=i;if(m){const E=Math.min(this.currentTime,u)/f;let Q=Math.floor(E),N=E%1;!N&&E>=1&&(N=1),N===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(v==="reverse"?(N=1-N,y&&(N-=y/f)):v==="mirror"&&(L=o)),C=Le(0,1,N)*f}const g=P?{done:!1,value:a[0]}:L.next(C);l&&(g.value=l(g.value));let{done:O}=g;!P&&c!==null&&(O=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=Gt(a,this.options,s)),S&&S(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?Oe(t.calculatedDuration):0}get time(){return Oe(this.currentTime)}set time(t){t=Me(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=Oe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Eu,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(),Ct.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Mu=new Set(["opacity","clipPath","filter","transform"]);function Du(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=Ts(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 Ru=un(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xt=10,Vu=2e4;function Ou(e){return An(e.type)||e.type==="spring"||!bs(e.ease)}function Lu(e,t){const n=new er({...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<Vu;)r=n.sample(i),s.push(r.value),i+=Xt;return{times:void 0,keyframes:s,duration:i-Xt,ease:"linear"}}const vi={anticipate:Is,backInOut:_s,circInOut:Fs};function ku(e){return e in vi}class xi extends oi{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new si(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"&&Yt()&&ku(i)&&(i=vi[i]),Ou(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:v,...y}=this.options,S=Lu(t,y);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,s=S.times,i=S.ease,o="keyframes"}const u=Du(l.owner.current,a,t,{...this.options,duration:r,times:s,ease:i});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(vs(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 Oe(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Oe(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Me(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 we;const{animation:r}=n;vs(r,t)}return we}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,v=new er({...m,keyframes:r,duration:s,type:i,ease:o,times:l,isGenerator:!0}),y=Me(this.time);c.setWithVelocity(v.sample(y-Xt).value,v.sample(y).value,Xt)}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 Ru()&&r&&Mu.has(r)&&!a&&!c&&!s&&i!=="mirror"&&o!==0&&l!=="inertia"}}const _u={type:"spring",stiffness:500,damping:25,restSpeed:10},Iu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Nu={type:"keyframes",duration:.8},Fu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Bu=(e,{keyframes:t})=>t.length>2?Nu:We.has(e)?e.startsWith("scale")?Iu(t[1]):_u:Fu;function $u({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 tr=(e,t,n,r={},s,i)=>o=>{const l=En(r,e)||{},a=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Me(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};$u(l)||(u={...u,...Bu(e,u)}),u.duration&&(u.duration=Me(u.duration)),u.repeatDelay&&(u.repeatDelay=Me(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)),(wl.current||zr.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 ne.update(()=>{u.onUpdate(h),u.onComplete()}),new il([])}return!i&&xi.supports(u)?new xi(u):new er(u)};function Uu({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bi(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&&Uu(u,f))continue;const v={delay:n,...En(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Rs(e);if(b){const P=window.MotionHandoffAnimation(b,f,ne);P!==null&&(v.startTime=P,y=!0)}}_n(e,f),h.start(tr(f,h,m,e.shouldReduceMotion&&As.has(f)?{type:!1}:v,e,y));const S=h.animation;S&&c.push(S)}return l&&Promise.all(c).then(()=>{ne.update(()=>{l&&bl(e,l)})}),c}function nr(e,t,n={}){var r;const s=vt(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(bi(e,s,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:h}=i;return Wu(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 Wu(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(zu).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(nr(c,t,{...i,delay:n+a(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function zu(e,t){return e.sortNodePosition(t)}function Yu(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>nr(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=nr(e,t,n);else{const s=typeof t=="function"?vt(e,t,n.custom):t;r=Promise.all(bi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ti(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 Ku=dn.length;function wi(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?wi(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ku;n++){const r=dn[n],s=e.props[r];(pt(s)||s===!1)&&(t[r]=s)}return t}const Hu=[...fn].reverse(),Gu=fn.length;function qu(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Yu(e,n,r)))}function Xu(e){let t=qu(e),n=Si(),r=!0;const s=a=>(c,u)=>{var f;const h=vt(e,u,a==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:v,...y}=h;c={...c,...y,...v}}return c};function i(a){t=a(e)}function o(a){const{props:c}=e,u=wi(e.parent)||{},f=[],h=new Set;let m={},v=1/0;for(let S=0;S<Gu;S++){const b=Hu[S],P=n[b],C=c[b]!==void 0?c[b]:u[b],L=pt(C),g=b===a?P.isActive:null;g===!1&&(v=S);let O=C===u[b]&&C!==c[b]&&L;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),P.protectedKeys={...m},!P.isActive&&g===null||!C&&!P.prevProp||$t(C)||typeof C=="boolean")continue;const Y=Zu(P.prevProp,C);let E=Y||b===a&&P.isActive&&!O&&L||S>v&&L,Q=!1;const N=Array.isArray(C)?C:[C];let G=N.reduce(s(b),{});g===!1&&(G={});const{prevResolvedValues:oe={}}=P,ee={...oe,...G},ae=K=>{E=!0,h.has(K)&&(Q=!0,h.delete(K)),P.needsAnimating[K]=!0;const le=e.getValue(K);le&&(le.liveStyle=!1)};for(const K in ee){const le=G[K],Se=oe[K];if(m.hasOwnProperty(K))continue;let T=!1;Pn(le)&&Pn(Se)?T=!Ti(le,Se):T=le!==Se,T?le!=null?ae(K):h.add(K):le!==void 0&&h.has(K)?ae(K):P.protectedKeys[K]=!0}P.prevProp=C,P.prevResolvedValues=G,P.isActive&&(m={...m,...G}),r&&e.blockInitialAnimation&&(E=!1),E&&(!(O&&Y)||Q)&&f.push(...N.map(K=>({animation:K,options:{type:b}})))}if(h.size){const S={};if(typeof c.initial!="boolean"){const b=vt(e,Array.isArray(c.initial)?c.initial[0]:c.initial);b&&b.transition&&(S.transition=b.transition)}h.forEach(b=>{const P=e.getBaseTarget(b),C=e.getValue(b);C&&(C.liveStyle=!0),S[b]=P??null}),f.push({animation:S})}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=Si(),r=!0}}}function Zu(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ti(t,e):!1}function Ke(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Si(){return{animate:Ke(!0),whileInView:Ke(),whileHover:Ke(),whileTap:Ke(),whileDrag:Ke(),whileFocus:Ke(),exit:Ke()}}class $e{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Ju extends $e{constructor(t){super(t),t.animationState||(t.animationState=Xu(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$t(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 Qu=0;class ec extends $e{constructor(){super(...arguments),this.id=Qu++}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 tc={animation:{Feature:Ju},exit:{Feature:ec}};function At(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mt(e){return{point:{x:e.pageX,y:e.pageY}}}const nc=e=>t=>Rn(t)&&e(t,Mt(t));function it(e,t,n,r){return At(e,t,nc(n),r)}function Pi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function rc({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function sc(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 Ci=1e-4,ic=1-Ci,oc=1+Ci,Ei=.01,ac=0-Ei,lc=0+Ei;function ve(e){return e.max-e.min}function uc(e,t,n){return Math.abs(e-t)<=n}function ji(e,t,n,r=.5){e.origin=r,e.originPoint=re(t.min,t.max,e.origin),e.scale=ve(n)/ve(t),e.translate=re(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ic&&e.scale<=oc||isNaN(e.scale))&&(e.scale=1),(e.translate>=ac&&e.translate<=lc||isNaN(e.translate))&&(e.translate=0)}function Dt(e,t,n,r){ji(e.x,t.x,n.x,r?r.originX:void 0),ji(e.y,t.y,n.y,r?r.originY:void 0)}function Ai(e,t,n){e.min=n.min+t.min,e.max=e.min+ve(t)}function cc(e,t,n){Ai(e.x,t.x,n.x),Ai(e.y,t.y,n.y)}function Mi(e,t,n){e.min=t.min-n.min,e.max=e.min+ve(t)}function Rt(e,t,n){Mi(e.x,t.x,n.x),Mi(e.y,t.y,n.y)}const Di=()=>({translate:0,scale:1,origin:0,originPoint:0}),ot=()=>({x:Di(),y:Di()}),Ri=()=>({min:0,max:0}),ce=()=>({x:Ri(),y:Ri()});function Pe(e){return[e("x"),e("y")]}function rr(e){return e===void 0||e===1}function sr({scale:e,scaleX:t,scaleY:n}){return!rr(e)||!rr(t)||!rr(n)}function He(e){return sr(e)||Vi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Vi(e){return Oi(e.x)||Oi(e.y)}function Oi(e){return e&&e!=="0%"}function Zt(e,t,n){const r=e-n,s=t*r;return n+s}function Li(e,t,n,r,s){return s!==void 0&&(e=Zt(e,s,r)),Zt(e,n,r)+t}function ir(e,t=0,n=1,r,s){e.min=Li(e.min,t,n,r,s),e.max=Li(e.max,t,n,r,s)}function ki(e,{x:t,y:n}){ir(e.x,t.translate,t.scale,t.originPoint),ir(e.y,n.translate,n.scale,n.originPoint)}const _i=.999999999999,Ii=1.0000000000001;function fc(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&&lt(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ki(e,o)),r&&He(i.latestValues)&&lt(e,i.latestValues))}t.x<Ii&&t.x>_i&&(t.x=1),t.y<Ii&&t.y>_i&&(t.y=1)}function at(e,t){e.min=e.min+t,e.max=e.max+t}function Ni(e,t,n,r,s=.5){const i=re(e.min,e.max,s);ir(e,t,n,i,r)}function lt(e,t){Ni(e.x,t.x,t.scaleX,t.scale,t.originX),Ni(e.y,t.y,t.scaleY,t.scale,t.originY)}function Fi(e,t){return Pi(sc(e.getBoundingClientRect(),t))}function dc(e,t,n){const r=Fi(e,n),{scroll:s}=t;return s&&(at(r.x,s.offset.x),at(r.y,s.offset.y)),r}const Bi=(e,t)=>Math.abs(e-t);function hc(e,t){const n=Bi(e.x,t.x),r=Bi(e.y,t.y);return Math.sqrt(n**2+r**2)}class $i{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=ar(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=hc(u.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=u,{timestamp:v}=me;this.history.push({...m,timestamp:v});const{onStart:y,onMove:S}=this.handlers;f||(y&&y(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),S&&S(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=or(f,this.transformPagePoint),ne.update(this.updatePoint,!0)},this.handlePointerUp=(u,f)=>{Kt(u,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ar(u.type==="pointercancel"||u.type==="lostpointercapture"?this.lastMoveEventInfo:or(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,y),m&&m(u,y)},!Rn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Mt(t),o=or(i,this.transformPagePoint),{point:l}=o,{timestamp:a}=me;this.history=[{...l,timestamp:a}];const{onSessionStart:c}=n;c&&c(t,ar(o,this.history)),Kt(t,"set"),this.removeListeners=Et(it(t.currentTarget,"pointermove",this.handlePointerMove),it(t.currentTarget,"pointerup",this.handlePointerUp),it(t.currentTarget,"pointercancel",this.handlePointerUp),it(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function or(e,t){return t?{point:t(e.point)}:e}function Ui(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ar({point:e},t){return{point:e,delta:Ui(e,Wi(t)),offset:Ui(e,pc(t)),velocity:mc(t,.1)}}function pc(e){return e[0]}function Wi(e){return e[e.length-1]}function mc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Wi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Me(t)));)n--;if(!r)return{x:0,y:0};const i=Oe(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 gc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?re(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?re(n,e,r.max):Math.min(e,n)),e}function zi(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 yc(e,{top:t,left:n,bottom:r,right:s}){return{x:zi(e.x,n,s),y:zi(e.y,t,r)}}function Yi(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 vc(e,t){return{x:Yi(e.x,t.x),y:Yi(e.y,t.y)}}function xc(e,t){let n=.5;const r=ve(e),s=ve(t);return s>r?n=Je(t.min,t.max-r,e.min):r>s&&(n=Je(e.min,e.max-s,t.min)),Le(0,1,n)}function bc(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 lr=.35;function Tc(e=lr){return e===!1?e=0:e===!0&&(e=lr),{x:Ki(e,"left","right"),y:Ki(e,"top","bottom")}}function Ki(e,t,n){return{min:Hi(e,t),max:Hi(e,n)}}function Hi(e,t){return typeof e=="number"?e:e[t]||0}const wc=new WeakMap;class Sc{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=ce(),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(Mt(u).point)},i=(u,f)=>{const{drag:h,dragPropagation:m,onDragStart:v}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ml(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),Pe(S=>{let b=this.getAxisMotionValue(S).get()||0;if(De.test(b)){const{projection:P}=this.visualElement;if(P&&P.layout){const C=P.layout.layoutBox[S];C&&(b=ve(C)*(parseFloat(b)/100))}}this.originPoint[S]=b}),v&&ne.postRender(()=>v(u,f)),_n(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(u,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:S}=f;if(m&&this.currentDirection===null){this.currentDirection=Pc(S),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",f.point,S),this.updateAxis("y",f.point,S),this.visualElement.render(),y&&y(u,f)},l=(u,f)=>this.stop(u,f),a=()=>Pe(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 $i(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&&ne.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||!Jt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=gc(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&&et(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=yc(s.layoutBox,n):this.constraints=!1,this.elastic=Tc(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Pe(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=bc(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!et(t))return!1;const r=t.current;_e(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=dc(r,s.root,this.visualElement.getTransformPagePoint());let o=vc(s.layout.layoutBox,i);if(n){const l=n(rc(o));this.hasMutatedConstraints=!!l,l&&(o=Pi(l))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),a=this.constraints||{},c=Pe(u=>{if(!Jt(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,v={type:"inertia",velocity:r?t[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(u,v)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return _n(this.visualElement,t),r.start(tr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Pe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Pe(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){Pe(n=>{const{drag:r}=this.getProps();if(!Jt(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]-re(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!et(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Pe(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const a=l.get();s[o]=xc({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(),Pe(o=>{if(!Jt(o,t,null))return;const l=this.getAxisMotionValue(o),{min:a,max:c}=this.constraints[o];l.set(re(a,c,s[o]))})}addListeners(){if(!this.visualElement.current)return;wc.set(this.visualElement,this);const t=this.visualElement.current,n=it(t,"pointerdown",a=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(a)}),r=()=>{const{dragConstraints:a}=this.getProps();et(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()),ne.read(r);const o=At(window,"resize",()=>this.scalePositionWithinConstraints()),l=s.addEventListener("didUpdate",({delta:a,hasLayoutChanged:c})=>{this.isDragging&&c&&(Pe(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=lr,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Jt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Pc(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Cc extends $e{constructor(t){super(t),this.removeGroupControls=we,this.removeListeners=we,this.controls=new Sc(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||we}unmount(){this.removeGroupControls(),this.removeListeners()}}const Gi=e=>(t,n)=>{e&&ne.postRender(()=>e(t,n))};class Ec extends $e{constructor(){super(...arguments),this.removePointerDownListener=we}onPointerDown(t){this.session=new $i(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gi(t),onStart:Gi(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&ne.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=it(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 Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function qi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(I.test(e))e=parseFloat(e);else return e;const n=qi(e,t.target.x),r=qi(e,t.target.y);return`${n}% ${r}%`}},jc={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Be.parse(e);if(s.length>5)return r;const i=Be.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=re(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 Ac extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Va(Mc),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()})),Qt.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()||ne.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),pn.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 Xi(e){const[t,n]=Br(),r=x.useContext(sn);return p.exports.jsx(Ac,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(Qr),isPresent:t,safeToRemove:n})}const Mc={borderRadius:{...Vt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vt,borderTopRightRadius:Vt,borderBottomLeftRadius:Vt,borderBottomRightRadius:Vt,boxShadow:jc};function Dc(e,t,n){const r=ge(e)?e:Tt(e);return r.start(tr("",r,t,n)),r.animation}function Rc(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Vc=(e,t)=>e.depth-t.depth;class Oc{constructor(){this.children=[],this.isDirty=!1}add(t){On(this.children,t),this.isDirty=!0}remove(t){Ln(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Vc),this.isDirty=!1,this.children.forEach(t)}}function Lc(e,t){const n=Re.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ne(r),e(i-t))};return ne.read(r,!0),()=>Ne(r)}const Zi=["TopLeft","TopRight","BottomLeft","BottomRight"],kc=Zi.length,Ji=e=>typeof e=="string"?parseFloat(e):e,Qi=e=>typeof e=="number"||I.test(e);function _c(e,t,n,r,s,i){s?(e.opacity=re(0,n.opacity!==void 0?n.opacity:1,Ic(r)),e.opacityExit=re(t.opacity!==void 0?t.opacity:1,0,Nc(r))):i&&(e.opacity=re(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<kc;o++){const l=`border${Zi[o]}Radius`;let a=eo(t,l),c=eo(n,l);if(a===void 0&&c===void 0)continue;a||(a=0),c||(c=0),a===0||c===0||Qi(a)===Qi(c)?(e[l]=Math.max(re(Ji(a),Ji(c),r),0),(De.test(c)||De.test(a))&&(e[l]+="%")):e[l]=c}(t.rotate||n.rotate)&&(e.rotate=re(t.rotate||0,n.rotate||0,r))}function eo(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Ic=to(0,.5,Ns),Nc=to(.5,.95,we);function to(e,t,n){return r=>r<e?0:r>t?1:n(Je(e,t,r))}function no(e,t){e.min=t.min,e.max=t.max}function Ce(e,t){no(e.x,t.x),no(e.y,t.y)}function ro(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function so(e,t,n,r,s){return e-=t,e=Zt(e,1/n,r),s!==void 0&&(e=Zt(e,1/s,r)),e}function Fc(e,t=0,n=1,r=.5,s,i=e,o=e){if(De.test(t)&&(t=parseFloat(t),t=re(o.min,o.max,t/100)-o.min),typeof t!="number")return;let l=re(i.min,i.max,r);e===i&&(l-=t),e.min=so(e.min,t,n,l,s),e.max=so(e.max,t,n,l,s)}function io(e,t,[n,r,s],i,o){Fc(e,t[n],t[r],t[s],t.scale,i,o)}const Bc=["x","scaleX","originX"],$c=["y","scaleY","originY"];function oo(e,t,n,r){io(e.x,t,Bc,n?n.x:void 0,r?r.x:void 0),io(e.y,t,$c,n?n.y:void 0,r?r.y:void 0)}function ao(e){return e.translate===0&&e.scale===1}function lo(e){return ao(e.x)&&ao(e.y)}function uo(e,t){return e.min===t.min&&e.max===t.max}function Uc(e,t){return uo(e.x,t.x)&&uo(e.y,t.y)}function co(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function fo(e,t){return co(e.x,t.x)&&co(e.y,t.y)}function ho(e){return ve(e.x)/ve(e.y)}function po(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Wc{constructor(){this.members=[]}add(t){On(this.members,t),t.scheduleRender()}remove(t){if(Ln(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 zc(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:v}=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) `),v&&(r+=`skewY(${v}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},ur=["","X","Y","Z"],Yc={visibility:"hidden"},mo=1e3;let Kc=0;function cr(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function go(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rs(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ne,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&go(r)}function yo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=t==null?void 0:t()){this.id=Kc++,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,Ie.value&&(Ge.nodes=Ge.calculatedTargetDeltas=Ge.calculatedProjections=0),this.nodes.forEach(qc),this.nodes.forEach(ef),this.nodes.forEach(tf),this.nodes.forEach(Xc),Ie.addProjectionMetrics&&Ie.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 Oc)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kn),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=Rc(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=Lc(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(xo))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||u.getDefaultTransition()||af,{onLayoutAnimationStart:S,onLayoutAnimationComplete:b}=u.getProps(),P=!this.targetLayout||!fo(this.targetLayout,v),C=!h&&m;if(this.options.layoutRoot||this.resumeFrom||C||h&&(P||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const L={...En(y,"layout"),onPlay:S,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else h||xo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}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,Ne(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(nf),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&&go(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(vo);return}this.isUpdating||this.nodes.forEach(Jc),this.isUpdating=!1,this.nodes.forEach(Qc),this.nodes.forEach(Hc),this.nodes.forEach(Gc),this.clearAllSnapshots();const l=Re.now();me.delta=Le(0,1e3/60,l-me.timestamp),me.timestamp=l,me.isProcessing=!0,cn.update.process(me),cn.preRender.process(me),cn.render.process(me),me.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Zc),this.sharedNodes.forEach(rf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ne.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ne.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ve(this.snapshot.measuredBox.x)&&!ve(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=ce(),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&&!lo(this.projectionDelta),a=this.getTransformTemplate(),c=a?a(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;o&&(l||He(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)),lf(a),{animationId:this.root.animationId,measuredBox:l,layoutBox:a,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return ce();const a=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(uf))){const{scroll:u}=this.root;u&&(at(a.x,u.offset.x),at(a.y,u.offset.y))}return a}removeElementScroll(o){var l;const a=ce();if(Ce(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&&Ce(a,o),at(a.x,f.offset.x),at(a.y,f.offset.y))}return a}applyTransform(o,l=!1){const a=ce();Ce(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&&lt(a,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),He(u.latestValues)&&lt(a,u.latestValues)}return He(this.latestValues)&&lt(a,this.latestValues),a}removeTransform(o){const l=ce();Ce(l,o);for(let a=0;a<this.path.length;a++){const c=this.path[a];if(!c.instance||!He(c.latestValues))continue;sr(c.latestValues)&&c.updateSnapshot();const u=ce(),f=c.measurePageBox();Ce(u,f),oo(l,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return He(this.latestValues)&&oo(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!==me.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=me.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ce(),this.relativeTargetOrigin=ce(),Rt(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),Ce(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=ce(),this.targetWithTransforms=ce()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),cc(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Ce(this.target,this.layout.layoutBox),ki(this.target,this.targetDelta)):Ce(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=ce(),this.relativeTargetOrigin=ce(),Rt(this.relativeTargetOrigin,this.target,m.target),Ce(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ie.value&&Ge.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||sr(this.parent.latestValues)||Vi(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===me.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;Ce(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;fc(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=ce());const{target:v}=l;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ro(this.prevProjectionDelta.x,this.projectionDelta.x),ro(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!po(this.projectionDelta.x,this.prevProjectionDelta.x)||!po(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Ie.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=ot(),this.projectionDelta=ot(),this.projectionDeltaWithTransform=ot()}setAnimationOrigin(o,l=!1){const a=this.snapshot,c=a?a.latestValues:{},u={...this.latestValues},f=ot();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const h=ce(),m=a?a.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,S=this.getStack(),b=!S||S.members.length<=1,P=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(of));this.animationProgress=0;let C;this.mixTargetDelta=L=>{const g=L/1e3;bo(f.x,o.x,g),bo(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Rt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),sf(this.relativeTarget,this.relativeTargetOrigin,h,g),C&&Uc(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ce()),Ce(C,this.relativeTarget)),y&&(this.animationValues=u,_c(u,c,this.latestValues,g,P,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},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&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ne.update(()=>{Qt.hasAnimatedSinceResize=!0,Ct.layout++,this.currentAnimation=Dc(0,mo,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onStop:()=>{Ct.layout--},onComplete:()=>{Ct.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(mo),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&&Co(this.options.animationType,this.layout.layoutBox,c.layoutBox)){a=this.target||ce();const f=ve(this.layout.layoutBox.x);a.x.min=o.target.x.min,a.x.max=a.x.min+f;const h=ve(this.layout.layoutBox.y);a.y.min=o.target.y.min,a.y.max=a.y.min+h}Ce(l,a),lt(l,u),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Wc),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&&cr("z",o,c,this.animationValues);for(let u=0;u<ur.length;u++)cr(`rotate${ur[u]}`,o,c,this.animationValues),cr(`skew${ur[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 Yc;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=zt(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=zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!He(this.latestValues)&&(y.transform=u?u({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=zc(this.projectionDeltaWithTransform,this.treeScale,h),u&&(c.transform=u(h,c.transform));const{x:m,y:v}=this.projectionDelta;c.transformOrigin=`${m.origin*100}% ${v.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 mt){if(h[y]===void 0)continue;const{correct:S,applyTo:b,isCSSVariable:P}=mt[y],C=c.transform==="none"?h[y]:S(h[y],f);if(b){const L=b.length;for(let g=0;g<L;g++)c[b[g]]=C}else P?this.options.visualElement.renderState.vars[y]=C:c[y]=C}return this.options.layoutId&&(c.pointerEvents=f===this?zt(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(vo),this.root.sharedNodes.clear()}}}function Hc(e){e.updateLayout()}function Gc(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"?Pe(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=ve(h);h.min=r[f].min,h.max=h.min+m}):Co(i,n.layoutBox,r)&&Pe(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=ve(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=ot();Dt(l,r,n.layoutBox);const a=ot();o?Dt(a,e.applyTransform(s,!0),n.measuredBox):Dt(a,r,n.layoutBox);const c=!lo(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 v=ce();Rt(v,n.layoutBox,h.layoutBox);const y=ce();Rt(y,r,m.layoutBox),fo(v,y)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,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){Ie.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 Xc(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Zc(e){e.clearSnapshot()}function vo(e){e.clearMeasurements()}function Jc(e){e.isLayoutDirty=!1}function Qc(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function xo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ef(e){e.resolveTargetDelta()}function tf(e){e.calcProjection()}function nf(e){e.resetSkewAndRotation()}function rf(e){e.removeLeadSnapshot()}function bo(e,t,n){e.translate=re(t.translate,0,n),e.scale=re(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function To(e,t,n,r){e.min=re(t.min,n.min,r),e.max=re(t.max,n.max,r)}function sf(e,t,n,r){To(e.x,t.x,n.x,r),To(e.y,t.y,n.y,r)}function of(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const af={duration:.45,ease:[.4,0,.1,1]},wo=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),So=wo("applewebkit/")&&!wo("chrome/")?Math.round:we;function Po(e){e.min=So(e.min),e.max=So(e.max)}function lf(e){Po(e.x),Po(e.y)}function Co(e,t,n){return e==="position"||e==="preserve-aspect"&&!uc(ho(t),ho(n),.2)}function uf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const cf=yo({attachResizeListener:(e,t)=>At(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fr={current:void 0},Eo=yo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fr.current){const e=new cf({});e.mount(window),e.setOptions({layoutScroll:!0}),fr.current=e}return fr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),ff={pan:{Feature:Ec},drag:{Feature:Cc,ProjectionNode:Eo,MeasureLayout:Xi}};function jo(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&&ne.postRender(()=>i(t,Mt(t)))}class df extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=ul(t,(n,r)=>(jo(this.node,r,"Start"),s=>jo(this.node,s,"End"))))}unmount(){}}class hf extends $e{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=Et(At(this.node.current,"focus",()=>this.onFocus()),At(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ao(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&&ne.postRender(()=>i(t,Mt(t)))}class pf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=hl(t,(n,r)=>(Ao(this.node,r,"Start"),(s,{success:i})=>Ao(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dr=new WeakMap,hr=new WeakMap,mf=e=>{const t=dr.get(e.target);t&&t(e)},gf=e=>{e.forEach(mf)};function yf({root:e,...t}){const n=e||document;hr.has(n)||hr.set(n,{});const r=hr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(gf,{root:e,...t})),r[s]}function vf(e,t,n){const r=yf(t);return dr.set(e,n),r.observe(e),()=>{dr.delete(e),r.unobserve(e)}}const xf={some:0,all:1};class bf extends $e{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:xf[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 vf(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(Tf(t,n))&&this.startObserver()}unmount(){}}function Tf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const wf={inView:{Feature:bf},tap:{Feature:pf},focus:{Feature:hf},hover:{Feature:df}},Sf={layout:{ProjectionNode:Eo,MeasureLayout:Xi}},pr={current:null},Mo={current:!1};function Pf(){if(Mo.current=!0,!!ln)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pr.current=e.matches;e.addListener(t),t()}else pr.current=!1}const Cf=[...ni,ye,Be],Ef=e=>Cf.find(ti(e)),jf=new WeakMap;function Af(e,t,n){for(const r in t){const s=t[r],i=n[r];if(ge(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(ge(i))e.addValue(r,Tt(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,Tt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Do=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Mf{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=Hn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Re.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ne.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=Ut(n),this.isVariantNode=Xr(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 v=h[m];a[m]!==void 0&&ge(v)&&v.set(a[m],!1)}}mount(t){this.current=t,jf.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)),Mo.current||Pf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pr.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(),Ne(this.notifyUpdate),Ne(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=We.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&ne.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 Qe){const n=Qe[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):ce()}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<Do.length;r++){const s=Do[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=Af(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=Tt(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"&&(Qs(s)||Bs(s))?s=parseFloat(s):!Ef(s)&&Be.test(n)&&(s=Hs(t,n)),this.setBaseTarget(t,ge(s)?s.get():s)),ge(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=Sn(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&&!ge(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ro extends Mf{constructor(){super(...arguments),this.KeyframeResolver=si}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;ge(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Df(e){return window.getComputedStyle(e)}class Rf extends Ro{constructor(){super(...arguments),this.type="html",this.renderInstance=ds}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}else{const r=Df(t),s=(mn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Fi(t,n)}build(t,n,r){vn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Cn(t,n,r)}}class Vf extends Ro{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ce,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&fs(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}return n=hs.has(n)?n:hn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return ms(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&ne.postRender(this.updateDimensions)}build(t,n,r){Tn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ps(t,n,r,s)}mount(t){this.isSVGTag=wn(t.tagName),super.mount(t)}}const Of=(e,t)=>bn(e)?new Vf(t):new Rf(t,{allowProjection:e!==x.Fragment}),Lf=nl({...tc,...wf,...ff,...Sf},Of),mr=xa(Lf),kf=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.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:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.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:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.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:[p.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:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.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 "}),p.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,_f=({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:Ue.createPortal(p.exports.jsx(Wr,{children:t&&p.exports.jsx(mr.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:p.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}),p.exports.jsx("span",{className:"ml-2 text-black",children:a.name})]},c))})}),i.current)},If=(e,t)=>{if(!t.current)return 0;const n=window.getComputedStyle(t.current),r=parseInt(n.lineHeight,10)||20;return Math.ceil(t.current.scrollHeight/r)-1},Nf=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},Ff=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),Bf=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),gr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),en=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.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"}),p.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"}),p.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"}),p.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"})]})}),$f=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,messageToEdit:l,setMessageToEdit:a})=>{const[c,u]=x.useState(""),[f,h]=x.useState(!1),[m,v]=x.useState(0),[y,S]=x.useState(null),[b,P]=x.useState(null),[C,L]=x.useState(0),g=x.useRef(null),O=x.useRef([]),Y=x.useRef(null),E=x.useRef(null),Q=x.useRef(null),[N,G]=x.useState(!1),oe=150,ee=41.6,ae=V=>{const A=V.target.value;l?a(k=>k?new Xe({...k,text:A,isEdited:!0}):void 0):u(A);const M=A.match(/(\S+)$/);if(xe(M),console.log("numberOfLineBreaks",If(A,E)),E.current){const k=E.current.scrollHeight,F=Math.ceil(E.current.scrollHeight/k)-1;console.log(F),k>ee?k>oe?(E.current.style.height=`${oe}px`,E.current.style.overflowY="auto"):(E.current.style.height=`${k}px`,E.current.style.overflowY="hidden"):(console.log("buy"),E.current.style.height=`${ee}px`,E.current.style.overflowY="hidden")}},xe=V=>{if(V){const A=V[0];if(y){const M=V[0].split(y)[1];P(M)}o!=null&&o.some(M=>M.symbol===A)&&S(A)}else S(null),P(null)},z=(V,A)=>{l?a(M=>M?new Xe({...M,text:M.text+A+" "}):void 0):u(M=>M+A+" "),S(null),P(null),E.current.focus()},K=()=>{if(l){if(l.text.trim()==="")return;t(l),a(void 0)}else{if(c.trim()==="")return;e(c),u("")}S(null),P(null),E.current&&(E.current.style.height=`${ee}px`)},le=async()=>{h(!0),v(0),O.current=[],Y.current=setInterval(()=>{v(M=>M+1)},1e3);const V=await navigator.mediaDevices.getUserMedia({audio:!0}),A=new MediaRecorder(V);g.current=A,A.ondataavailable=M=>{M.data.size>0&&O.current.push(M.data)},A.onstop=()=>{clearInterval(Y.current);const M=new Blob(O.current,{type:"audio/mp3"});n(M),h(!1)},A.start()},Se=()=>{var V;(V=g.current)==null||V.stop()},T=V=>{const{scrollTop:A,scrollHeight:M,clientHeight:k}=V.currentTarget;if(A>C){if(A+k>=M-1){const _=o==null?void 0:o.find(ue=>ue.symbol===y);_&&(_!=null&&_.updatePageNumber)&&(G(!0),_==null||_.updatePageNumber(_.pagNumber+1),L(A),setTimeout(()=>{G(!1)},500))}}else L(A)},R=new Set(["jpeg","png","gif","webp","bmp","svg+xml","tiff","x-icon"]),U=new Set(["mp4","webm","ogg","mpeg","quicktime","x-msvideo","x-ms-wmv","3gpp","3gpp2"]),W=()=>{var V;(V=Q.current)==null||V.click()},$=V=>{var k,F;const A=(k=V.target.files)==null?void 0:k[0];if(!A)return;let M="";if(A.type){const _=A.type.split("/");_.length===2&&(M=_[1])}M||(M=((F=A.name.split(".").pop())==null?void 0:F.toLowerCase())||""),R.has(M)?r(A):U.has(M)?s(A):i(A)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[f?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Nf(m)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:Se,children:p.exports.jsx(gr,{})})]}):l?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative ",children:[p.exports.jsxs("div",{className:"flex justify-between items-center px-2 h-12 bottom-10 absolute w-full border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{className:"text-gray-400 whitespace-nowrap truncate",children:l.text}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>a(void 0),children:"✕"})]}),p.exports.jsx("textarea",{ref:E,className:"w-full resize-none bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:l.text,onChange:ae,onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),K())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-5"})]}),p.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:K,children:p.exports.jsx(gr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] h-10 relative ",children:[p.exports.jsx("div",{onClick:W,className:"cursor-pointer z-10 absolute right-4 top-[11px]",children:p.exports.jsx(Ff,{})}),p.exports.jsx("input",{type:"file",ref:Q,style:{display:"none"},onChange:$}),p.exports.jsx("textarea",{ref:E,className:"w-full absolute bottom-0 resize-none bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",style:{height:ee},placeholder:"Type a message...",value:c,onChange:ae,onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),K())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.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:c?K:le,children:c?p.exports.jsx(gr,{}):p.exports.jsx(Bf,{})})]}),y&&p.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:T,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:y})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>S(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(V=>V.symbol===y).map(V=>{var k;const{component:A,lists:M}=V;return A?b?(k=M==null?void 0:M.filter(F=>F==null?void 0:F.name.includes(b)))==null?void 0:k.map((F,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(A,{listsProps:F,onClick:(ue,j)=>z(ue,j)})},_)):M==null?void 0:M.map((F,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(A,{listsProps:F,onClick:(ue,j)=>z(ue,j)})},_)):null}):null,p.exports.jsx("div",{className:"h-8",children:N&&"Loading more items..."})]})]})]})};var Ve=(e=>(e[e.File=0]="File",e[e.Voice=1]="Voice",e[e.Video=2]="Video",e[e.Image=3]="Image",e))(Ve||{}),ie=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(ie||{});const Vo=({fileName:e,fileSize:t,format:n,src:r,them:s})=>{const i=()=>{const l={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&l[n]?l[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},o=l=>l>1048576?(l/1048576).toFixed(1)+" MB":(l/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[p.exports.jsx("div",{className:` border ${s===ie.Simple?" border-white ":s===ie.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:i()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===ie.Simple?"text-white":s===ie.Telegram?"text-gray-900":""} font-medium hover:underline`,children:e}),p.exports.jsx("span",{className:`${s===ie.Simple?"text-gray-800":s===ie.Telegram?"text-gray-900":""} text-sm`,children:o(t)})]}),p.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"})]})},Uf=e=>p.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:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),Wf=e=>p.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:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Ot=null;const zf=({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():(Ot&&Ot!==a&&(Ot.pause(),Ot.currentTime=0),a.play(),Ot=a))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[p.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?p.exports.jsx(Wf,{}):p.exports.jsx(Uf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${s}%`}})}),p.exports.jsx("audio",{ref:o,src:e})]})},Yf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,them:r})=>e?t===Ve.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(zf,{src:e})}):t===Ve.Image?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx("img",{src:e})}):t===Ve.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Vo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e})}):t===Ve.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Vo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e})}):null:null,Kf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s})=>{var i,o,l,a,c,u,f,h,m,v;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:y=>n(y,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 ${s===ie.Simple?"bg-[#f8fbff]":s===ie.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(i=e.user)!=null&&i.fullName&&((l=(o=e.user)==null?void 0:o.fullName)==null?void 0:l.length)>16?(a=e.user)==null?void 0:a.firstName:(c=e.user)==null?void 0:c.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(u=e.user)!=null&&u.fullName&&((h=(f=e.user)==null?void 0:f.fullName)==null?void 0:h.length)>16?(m=e.user)==null?void 0:m.firstName:(v=e.user)==null?void 0:v.fullName}),r||null,p.exports.jsx("span",{children:e.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===ie.Simple?"text-gray-700":s===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:` ${s===ie.Simple?"[&>g>path]:fill-[#f8fbff]":s===ie.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},Hf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.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"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"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"})]}),Oo=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.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"})]})]})}),Gf=({handleContextMenu:e,media:t,message:n,them:r})=>p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:s=>e(s,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 ${r===ie.Telegram?" bg-green-200":ie.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(Oo,{size:13,color:"text-black"}):p.exports.jsx(Hf,{className:r===ie.Telegram?" ":ie.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===ie.Simple?"text-gray-200":r===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===ie.Telegram?"[&>g>path]:fill-green-200":ie.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var pe={exports:{}},yr={exports:{}},Z={};var Lo;function qf(){if(Lo)return Z;Lo=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,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,P=e?Symbol.for("react.scope"):60119;function C(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case a:case c:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case l:case u:case v:case m:case o:return g;default:return O}}case n:return O}}}function L(g){return C(g)===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=v,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(g){return L(g)||C(g)===a},Z.isConcurrentMode=L,Z.isContextConsumer=function(g){return C(g)===l},Z.isContextProvider=function(g){return C(g)===o},Z.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},Z.isForwardRef=function(g){return C(g)===u},Z.isFragment=function(g){return C(g)===r},Z.isLazy=function(g){return C(g)===v},Z.isMemo=function(g){return C(g)===m},Z.isPortal=function(g){return C(g)===n},Z.isProfiler=function(g){return C(g)===i},Z.isStrictMode=function(g){return C(g)===s},Z.isSuspense=function(g){return C(g)===f},Z.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===c||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===v||g.$$typeof===m||g.$$typeof===o||g.$$typeof===l||g.$$typeof===u||g.$$typeof===S||g.$$typeof===b||g.$$typeof===P||g.$$typeof===y)},Z.typeOf=C,Z}var J={};var ko;function Xf(){return ko||(ko=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,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,S=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,P=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===v||j.$$typeof===m||j.$$typeof===o||j.$$typeof===l||j.$$typeof===u||j.$$typeof===S||j.$$typeof===b||j.$$typeof===P||j.$$typeof===y)}function L(j){if(typeof j=="object"&&j!==null){var Ee=j.$$typeof;switch(Ee){case t:var ut=j.type;switch(ut){case a:case c:case r:case i:case s:case f:return ut;default:var qe=ut&&ut.$$typeof;switch(qe){case l:case u:case v:case m:case o:return qe;default:return Ee}}case n:return Ee}}}var g=a,O=c,Y=l,E=o,Q=t,N=u,G=r,oe=v,ee=m,ae=n,xe=i,z=s,K=f,le=!1;function Se(j){return le||(le=!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)||L(j)===a}function T(j){return L(j)===c}function R(j){return L(j)===l}function U(j){return L(j)===o}function W(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function $(j){return L(j)===u}function V(j){return L(j)===r}function A(j){return L(j)===v}function M(j){return L(j)===m}function k(j){return L(j)===n}function F(j){return L(j)===i}function _(j){return L(j)===s}function ue(j){return L(j)===f}J.AsyncMode=g,J.ConcurrentMode=O,J.ContextConsumer=Y,J.ContextProvider=E,J.Element=Q,J.ForwardRef=N,J.Fragment=G,J.Lazy=oe,J.Memo=ee,J.Portal=ae,J.Profiler=xe,J.StrictMode=z,J.Suspense=K,J.isAsyncMode=Se,J.isConcurrentMode=T,J.isContextConsumer=R,J.isContextProvider=U,J.isElement=W,J.isForwardRef=$,J.isFragment=V,J.isLazy=A,J.isMemo=M,J.isPortal=k,J.isProfiler=F,J.isStrictMode=_,J.isSuspense=ue,J.isValidElementType=C,J.typeOf=L}()),J}var _o;function Io(){return _o||(_o=1,function(e){process.env.NODE_ENV==="production"?e.exports=qf():e.exports=Xf()}(yr)),yr.exports}var vr,No;function Zf(){if(No)return vr;No=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 vr=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},vr}var xr,Fo;function br(){if(Fo)return xr;Fo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xr=e,xr}var Tr,Bo;function $o(){return Bo||(Bo=1,Tr=Function.call.bind(Object.prototype.hasOwnProperty)),Tr}var wr,Uo;function Jf(){if(Uo)return wr;Uo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=br(),n={},r=$o();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(v){f=v}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={})},wr=s,wr}var Sr,Wo;function Qf(){if(Wo)return Sr;Wo=1;var e=Io(),t=Zf(),n=br(),r=$o(),s=Jf(),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 Sr=function(l,a){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(T){var R=T&&(c&&T[c]||T[u]);if(typeof R=="function")return R}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:P(),arrayOf:C,element:L(),elementType:g(),instanceOf:O,node:N(),objectOf:E,oneOf:Y,oneOfType:Q,shape:oe,exact:ee};function v(T,R){return T===R?T!==0||1/T===1/R:T!==T&&R!==R}function y(T,R){this.message=T,this.data=R&&typeof R=="object"?R:{},this.stack=""}y.prototype=Error.prototype;function S(T){if(process.env.NODE_ENV!=="production")var R={},U=0;function W(V,A,M,k,F,_,ue){if(k=k||h,_=_||M,ue!==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 Ee=k+":"+M;!R[Ee]&&U<3&&(i("You are manually calling a React.PropTypes validation function for the `"+_+"` prop on `"+k+"`. 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."),R[Ee]=!0,U++)}}return A[M]==null?V?A[M]===null?new y("The "+F+" `"+_+"` is marked as required "+("in `"+k+"`, but its value is `null`.")):new y("The "+F+" `"+_+"` is marked as required in "+("`"+k+"`, but its value is `undefined`.")):null:T(A,M,k,F,_)}var $=W.bind(null,!1);return $.isRequired=W.bind(null,!0),$}function b(T){function R(U,W,$,V,A,M){var k=U[W],F=z(k);if(F!==T){var _=K(k);return new y("Invalid "+V+" `"+A+"` of type "+("`"+_+"` supplied to `"+$+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return S(R)}function P(){return S(o)}function C(T){function R(U,W,$,V,A){if(typeof T!="function")return new y("Property `"+A+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var M=U[W];if(!Array.isArray(M)){var k=z(M);return new y("Invalid "+V+" `"+A+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an array."))}for(var F=0;F<M.length;F++){var _=T(M,F,$,V,A+"["+F+"]",n);if(_ instanceof Error)return _}return null}return S(R)}function L(){function T(R,U,W,$,V){var A=R[U];if(!l(A)){var M=z(A);return new y("Invalid "+$+" `"+V+"` of type "+("`"+M+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return S(T)}function g(){function T(R,U,W,$,V){var A=R[U];if(!e.isValidElementType(A)){var M=z(A);return new y("Invalid "+$+" `"+V+"` of type "+("`"+M+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return S(T)}function O(T){function R(U,W,$,V,A){if(!(U[W]instanceof T)){var M=T.name||h,k=Se(U[W]);return new y("Invalid "+V+" `"+A+"` of type "+("`"+k+"` supplied to `"+$+"`, expected ")+("instance of `"+M+"`."))}return null}return S(R)}function Y(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 R(U,W,$,V,A){for(var M=U[W],k=0;k<T.length;k++)if(v(M,T[k]))return null;var F=JSON.stringify(T,function(ue,j){var Ee=K(j);return Ee==="symbol"?String(j):j});return new y("Invalid "+V+" `"+A+"` of value `"+String(M)+"` "+("supplied to `"+$+"`, expected one of "+F+"."))}return S(R)}function E(T){function R(U,W,$,V,A){if(typeof T!="function")return new y("Property `"+A+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var M=U[W],k=z(M);if(k!=="object")return new y("Invalid "+V+" `"+A+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an object."));for(var F in M)if(r(M,F)){var _=T(M,F,$,V,A+"."+F,n);if(_ instanceof Error)return _}return null}return S(R)}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 R=0;R<T.length;R++){var U=T[R];if(typeof U!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le(U)+" at index "+R+"."),o}function W($,V,A,M,k){for(var F=[],_=0;_<T.length;_++){var ue=T[_],j=ue($,V,A,M,k,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&F.push(j.data.expectedType)}var Ee=F.length>0?", expected one of type ["+F.join(", ")+"]":"";return new y("Invalid "+M+" `"+k+"` supplied to "+("`"+A+"`"+Ee+"."))}return S(W)}function N(){function T(R,U,W,$,V){return ae(R[U])?null:new y("Invalid "+$+" `"+V+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return S(T)}function G(T,R,U,W,$){return new y((T||"React class")+": "+R+" type `"+U+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function oe(T){function R(U,W,$,V,A){var M=U[W],k=z(M);if(k!=="object")return new y("Invalid "+V+" `"+A+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));for(var F in T){var _=T[F];if(typeof _!="function")return G($,V,A,F,K(_));var ue=_(M,F,$,V,A+"."+F,n);if(ue)return ue}return null}return S(R)}function ee(T){function R(U,W,$,V,A){var M=U[W],k=z(M);if(k!=="object")return new y("Invalid "+V+" `"+A+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));var F=t({},U[W],T);for(var _ in F){var ue=T[_];if(r(T,_)&&typeof ue!="function")return G($,V,A,_,K(ue));if(!ue)return new y("Invalid "+V+" `"+A+"` key `"+_+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(U[W],null," ")+`
20
- Valid keys: `+JSON.stringify(Object.keys(T),null," "));var j=ue(M,_,$,V,A+"."+_,n);if(j)return j}return null}return S(R)}function ae(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(ae);if(T===null||l(T))return!0;var R=f(T);if(R){var U=R.call(T),W;if(R!==T.entries){for(;!(W=U.next()).done;)if(!ae(W.value))return!1}else for(;!(W=U.next()).done;){var $=W.value;if($&&!ae($[1]))return!1}}else return!1;return!0;default:return!1}}function xe(T,R){return T==="symbol"?!0:R?R["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&R instanceof Symbol:!1}function z(T){var R=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":xe(R,T)?"symbol":R}function K(T){if(typeof T>"u"||T===null)return""+T;var R=z(T);if(R==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return R}function le(T){var R=K(T);switch(R){case"array":case"object":return"an "+R;case"boolean":case"date":case"regexp":return"a "+R;default:return R}}function Se(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Sr}var Pr,zo;function ed(){if(zo)return Pr;zo=1;var e=br();function t(){}function n(){}return n.resetWarningCache=t,Pr=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},Pr}if(process.env.NODE_ENV!=="production"){var td=Io(),nd=!0;pe.exports=Qf()(td.isElement,nd)}else pe.exports=ed()();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("polyline",{points:"20 6 9 17 4 12"}))});Er.propTypes={color:pe.exports.string,size:pe.exports.oneOfType([pe.exports.string,pe.exports.number])},Er.displayName="Check";const id=Er;function jr(){return jr=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},jr.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 Ar=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",jr({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"}))});Ar.propTypes={color:pe.exports.string,size:pe.exports.oneOfType([pe.exports.string,pe.exports.number])},Ar.displayName="Copy";const ld=Ar;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("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"}))});Dr.propTypes={color:pe.exports.string,size:pe.exports.oneOfType([pe.exports.string,pe.exports.number])},Dr.displayName="Edit";const fd=Dr;function Rr(){return Rr=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},Rr.apply(this,arguments)}function dd(e,t){if(e==null)return{};var n=hd(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 hd(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 Vr=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=dd(e,["color","size"]);return x.createElement("svg",Rr({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"}))});Vr.propTypes={color:pe.exports.string,size:pe.exports.oneOfType([pe.exports.string,pe.exports.number])},Vr.displayName="Trash";const pd=Vr,md=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,isSendingDefultForNewMessage:i,isSendingDefultForEdited:o,onDeleteMessage:l})=>{const a=x.useRef(null),[c,u]=x.useState(!1),[f,h]=x.useState(null),[m,v]=x.useState(),[y,S]=x.useState(null),b=()=>{setTimeout(()=>{a.current&&(a.current.scrollTop=a.current.scrollHeight)},100)};x.useEffect(()=>{const N=()=>{S(null)};return window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("scroll",N,!0)}},[S]);const P=(N,G)=>{N.preventDefault();const oe=window.scrollX,ee=window.scrollY;S({x:N.clientX+oe,y:N.clientY+ee,message:G})},C=()=>{S(null)},L=N=>{const G=new Xe({id:new Date().toString(),text:N,user:e,isRightSided:!0,isSending:i,createdDate:new Date().toString()});n([...t,G]),r(G),b()},g=N=>{n(t.map(G=>G.id===N.id?(N.updateIsSending(Boolean(o)),N):G)),s(N)},O=N=>{const G=URL.createObjectURL(N),oe=new Xe({id:new Date().toString(),text:"",attachmentUrl:G,attachmentType:Ve.Voice,attachmentBlob:N,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,oe]),r(oe),b()},Y=(N,G)=>{const oe=URL.createObjectURL(N),ee=new Xe({id:new Date().toString(),text:"",attachmentUrl:oe,attachmentBlob:N,attachmentType:G,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ee]),r(ee),b()};return{handleDeleteConfirmation:()=>{f&&(l(f),h(null)),u(!1)},handleCloseContextMenu:C,contextMenuItems:[{name:"Edit",icon:p.exports.jsx(fd,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:N=>{v(t.find(G=>G.id===N)),C()}},{name:"Delete",icon:p.exports.jsx(pd,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:N=>{h(N),u(!0),C()}},{name:"Select",icon:p.exports.jsx(id,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),C()}},{name:"Copy",icon:p.exports.jsx(ld,{className:"text-blue-600"}),onClick:N=>{const G=t.find(oe=>oe.id===N);G&&navigator.clipboard.writeText(G.text),C()}}],handleSendFile:Y,handleSendVoice:O,handleSendMessage:L,handleContextMenu:P,isModalOpen:c,contextMenu:y,chatRef:a,setIsModalOpen:u,messageToEdit:m,setMessageToEdit:v,handleEditMessage:g}},gd=({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,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m,backgroundImage:v,them:y=ie.Telegram})=>{var ae,xe;const{handleDeleteConfirmation:S,handleCloseContextMenu:b,handleSendFile:P,handleSendVoice:C,handleSendMessage:L,handleContextMenu:g,contextMenuItems:O,isModalOpen:Y,contextMenu:E,chatRef:Q,setIsModalOpen:N,messageToEdit:G,setMessageToEdit:oe,handleEditMessage:ee}=md({user:o,messages:i,updateMessages:l,onMessageSent:a,onEditMessage:u,onDeleteMessage:c,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m});return p.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+v+")",...s},onClick:b,children:[p.exports.jsx("div",{ref:Q,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${E?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?p.exports.jsx(Oo,{className:"mt-3",size:27,color:"text-gray-800"}):p.exports.jsx(Wr,{children:i.length>0?i.map((z,K)=>{var T,R,U;const le=z!=null&&z.attachmentUrl?p.exports.jsx(Yf,{attachmentUrl:z.attachmentUrl,attachmentType:z==null?void 0:z.attachmentType,attachmentFormat:z==null?void 0:z.attachmentFormat},K):null;if(z.isRightSided)return p.exports.jsx(Gf,{media:le,handleContextMenu:g,message:z,them:y},K);const Se=((R=(T=i[K-1])==null?void 0:T.user)==null?void 0:R.id)!==((U=z==null?void 0:z.user)==null?void 0:U.id);return p.exports.jsx(Kf,{showUserProfile:Se,media:le,handleContextMenu:g,message:z,them:y},K)}):null})}),p.exports.jsx(kf,{isOpen:Y,onClose:()=>N(!1),onConfirm:S,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),E&&((ae=E==null?void 0:E.message)!=null&&ae.id)?p.exports.jsx(_f,{items:O,isVisible:Boolean(E),messageId:String(E==null?void 0:E.message.id),isCurrentUserMessage:((xe=E==null?void 0:E.message)==null?void 0:xe.user.id)===o.id,position:{x:E==null?void 0:E.x,y:E==null?void 0:E.y}}):null,p.exports.jsx($f,{onSendVoice:C,onSendMessage:L,onFileSend:z=>P(z,Ve.File),onImageSend:z=>P(z,Ve.Image),onVideoSend:z=>P(z,Ve.Video),dynamicSymbolAssignments:f,messageToEdit:G,setMessageToEdit:oe,onEditMessage:ee})]})};he.AttachmentTypeEnum=Ve,he.Button=aa,he.Chat=gd,he.ChatThemEntity=ie,he.MessageEntity=Xe,he.SymbolsListComponent=la,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
19
+ `),()=>{document.head.removeChild(m)}},[t]),p.exports.jsx(ua,{isPresent:t,childRef:s,sizeRef:i,children:rn.cloneElement(e,{ref:s})})}const da=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a})=>{const l=on(ha),u=x.useId(),c=x.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;r&&r()},[l,r]),f=x.useMemo(()=>({id:u,initial:t,isPresent:n,custom:s,onExitComplete:c,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),c]:[n,c]);return x.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[n]),rn.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=p.exports.jsx(fa,{isPresent:n,anchorX:a,children:e})),p.exports.jsx(kt.Provider,{value:f,children:e})};function ha(){return new Map}function $r(e=!0){const t=x.useContext(kt);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 _t=e=>e.key||"";function Ur(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const ln=typeof window<"u",Wr=ln?x.useLayoutEffect:x.useEffect,zr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,u]=$r(o),c=x.useMemo(()=>Ur(e),[e]),f=o&&!l?[]:c.map(_t),h=x.useRef(!0),m=x.useRef(c),v=on(()=>new Map),[y,w]=x.useState(c),[b,C]=x.useState(c);Wr(()=>{h.current=!1,m.current=c;for(let g=0;g<b.length;g++){const O=_t(b[g]);f.includes(O)?v.delete(O):v.get(O)!==!0&&v.set(O,!1)}},[b,f.length,f.join("-")]);const P=[];if(c!==y){let g=[...c];for(let O=0;O<b.length;O++){const Y=b[O],R=_t(Y);f.includes(R)||(g.splice(O,0,Y),P.push(Y))}return i==="wait"&&P.length&&(g=P),C(Ur(g)),w(c),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:L}=x.useContext(sn);return p.exports.jsx(p.exports.Fragment,{children:b.map(g=>{const O=_t(g),Y=o&&!l?!1:c===b||f.includes(O),R=()=>{if(v.has(O))v.set(O,!0);else return;let Q=!0;v.forEach(F=>{F||(Q=!1)}),Q&&(L==null||L(),C(m.current),o&&(u==null||u()),r&&r())};return p.exports.jsx(da,{isPresent:Y,initial:!h.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,onExitComplete:Y?void 0:R,anchorX:a,children:g},O)})})},Te=e=>e;let Ze=Te,_e=Te;process.env.NODE_ENV!=="production"&&(Ze=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},_e=(e,t)=>{if(!e)throw new Error(t)});function cn(e){let t;return()=>(t===void 0&&(t=e()),t)}const Je=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Me=e=>e*1e3,Oe=e=>e/1e3,Yr={skipAnimations:!1,useManualTiming:!1},It=["read","resolveKeyframes","update","preRender","render","postRender"],Ie={value:null,addProjectionMetrics:null};function pa(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function u(f){o.has(f)&&(c.schedule(f),e()),l++,f(a)}const c={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(a=f,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(u),t&&Ie.value&&Ie.value.frameloop[t].push(l),l=0,n.clear(),s=!1,i&&(i=!1,c.process(f))}};return c}const ma=40;function Kr(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=It.reduce((b,C)=>(b[C]=pa(i,t?C:void 0),b),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:f,postRender:h}=o,m=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,ma),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),c.process(s),f.process(s),h.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(m))},v=()=>{n=!0,r=!0,s.isProcessing||e(m)};return{schedule:It.reduce((b,C)=>{const P=o[C];return b[C]=(L,g=!1,O=!1)=>(n||v(),P.schedule(L,g,O)),b},{}),cancel:b=>{for(let C=0;C<It.length;C++)o[It[C]].cancel(b)},state:s,steps:o}}const{schedule:ne,cancel:Ne,state:ge,steps:un}=Kr(typeof requestAnimationFrame<"u"?requestAnimationFrame:Te,!0),Hr=x.createContext({strict:!1}),qr={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"]},Qe={};for(const e in qr)Qe[e]={isEnabled:t=>qr[e].some(n=>!!t[n])};function ga(e){for(const t in e)Qe[t]={...Qe[t],...e[t]}}const ya=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 Nt(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||ya.has(e)}let Gr=e=>!Nt(e);function va(e){e&&(Gr=t=>t.startsWith("on")?!Nt(t):e(t))}try{va(require("@emotion/is-prop-valid").default)}catch{}function xa(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Gr(s)||n===!0&&Nt(s)||!t&&!Nt(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Xr=new Set;function Ft(e,t,n){e||Xr.has(t)||(console.warn(t),n&&console.warn(n),Xr.add(t))}function ba(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 Bt=x.createContext({});function $t(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function pt(e){return typeof e=="string"||Array.isArray(e)}const fn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],dn=["initial",...fn];function Ut(e){return $t(e.animate)||dn.some(t=>pt(e[t]))}function Zr(e){return Boolean(Ut(e)||e.variants)}function wa(e,t){if(Ut(e)){const{initial:n,animate:r}=e;return{initial:n===!1||pt(n)?n:void 0,animate:pt(r)?r:void 0}}return e.inherit!==!1?t:{}}function Ta(e){const{initial:t,animate:n}=wa(e,x.useContext(Bt));return x.useMemo(()=>({initial:t,animate:n}),[Jr(t),Jr(n)])}function Jr(e){return Array.isArray(e)?e.join(" "):e}const Sa=Symbol.for("motionComponentSymbol");function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ca(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):et(n)&&(n.current=r))},[t])}const hn=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qr="data-"+hn("framerAppearId"),{schedule:pn,cancel:Ud}=Kr(queueMicrotask,!1),es=x.createContext({});function Pa(e,t,n,r,s){var i,o;const{visualElement:a}=x.useContext(Bt),l=x.useContext(Hr),u=x.useContext(kt),c=x.useContext(an).reducedMotion,f=x.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const h=f.current,m=x.useContext(es);h&&!h.projection&&s&&(h.type==="html"||h.type==="svg")&&Ea(f.current,n,s,m);const v=x.useRef(!1);x.useInsertionEffect(()=>{h&&v.current&&h.update(n,u)});const y=n[Qr],w=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 Wr(()=>{h&&(v.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),pn.render(h.render),w.current&&h.animationState&&h.animationState.animateChanges())}),x.useEffect(()=>{h&&(!w.current&&h.animationState&&h.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,y)}),w.current=!1))}),h}function Ea(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:ts(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:Boolean(o)||a&&et(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function ts(e){if(e)return e.options.allowProjection!==!1?e.projection:ts(e.parent)}function ja({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var i,o;e&&ga(e);function a(u,c){let f;const h={...x.useContext(an),...u,layoutId:Aa(u)},{isStatic:m}=h,v=Ta(u),y=r(u,m);if(!m&&ln){Ma(h,e);const w=Da(h);f=w.MeasureLayout,v.visualElement=Pa(s,y,h,t,w.ProjectionNode)}return p.exports.jsxs(Bt.Provider,{value:v,children:[f&&v.visualElement?p.exports.jsx(f,{visualElement:v.visualElement,...h}):null,n(s,u,Ca(y,v.visualElement,c),y,m,v.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(o=(i=s.displayName)!==null&&i!==void 0?i:s.name)!==null&&o!==void 0?o:""})`}`;const l=x.forwardRef(a);return l[Sa]=s,l}function Aa({layoutId:e}){const t=x.useContext(sn).id;return t&&e!==void 0?t+"-"+e:e}function Ma(e,t){const n=x.useContext(Hr).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?Ze(!1,r):_e(!1,r)}}function Da(e){const{drag:t,layout:n}=Qe;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 ns=e=>t=>typeof t=="string"&&t.startsWith(e),mn=ns("--"),Va=ns("var(--"),gn=e=>Va(e)?Ra.test(e.split("/*")[0].trim()):!1,Ra=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,mt={};function Oa(e){for(const t in e)mt[t]=e[t],mn(t)&&(mt[t].isCSSVariable=!0)}const tt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],We=new Set(tt);function rs(e,{layout:t,layoutId:n}){return We.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mt[e]||e==="opacity")}const ye=e=>Boolean(e&&e.getVelocity),ss=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Le=(e,t,n)=>n>t?t:n<e?e:n,nt={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},gt={...nt,transform:e=>Le(0,1,e)},Wt={...nt,default:1},yt=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Fe=yt("deg"),De=yt("%"),N=yt("px"),La=yt("vh"),ka=yt("vw"),is={...De,parse:e=>De.parse(e)/100,transform:e=>De.transform(e*100)},_a={borderWidth:N,borderTopWidth:N,borderRightWidth:N,borderBottomWidth:N,borderLeftWidth:N,borderRadius:N,radius:N,borderTopLeftRadius:N,borderTopRightRadius:N,borderBottomRightRadius:N,borderBottomLeftRadius:N,width:N,maxWidth:N,height:N,maxHeight:N,top:N,right:N,bottom:N,left:N,padding:N,paddingTop:N,paddingRight:N,paddingBottom:N,paddingLeft:N,margin:N,marginTop:N,marginRight:N,marginBottom:N,marginLeft:N,backgroundPositionX:N,backgroundPositionY:N},Ia={rotate:Fe,rotateX:Fe,rotateY:Fe,rotateZ:Fe,scale:Wt,scaleX:Wt,scaleY:Wt,scaleZ:Wt,skew:Fe,skewX:Fe,skewY:Fe,distance:N,translateX:N,translateY:N,translateZ:N,x:N,y:N,z:N,perspective:N,transformPerspective:N,opacity:gt,originX:is,originY:is,originZ:N},os={...nt,transform:Math.round},yn={..._a,...Ia,zIndex:os,size:N,fillOpacity:gt,strokeOpacity:gt,numOctaves:os},Na={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Fa=tt.length;function Ba(e,t,n){let r="",s=!0;for(let i=0;i<Fa;i++){const o=tt[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=ss(a,yn[o]);if(!l){s=!1;const c=Na[o]||o;r+=`${c}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function vn(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(We.has(l)){o=!0;continue}else if(mn(l)){s[l]=u;continue}else{const c=ss(u,yn[l]);l.startsWith("origin")?(a=!0,i[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=Ba(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=i;r.transformOrigin=`${l} ${u} ${c}`}}const xn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function as(e,t,n){for(const r in t)!ye(t[r])&&!rs(r,n)&&(e[r]=t[r])}function $a({transformTemplate:e},t){return x.useMemo(()=>{const n=xn();return vn(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Ua(e,t){const n=e.style||{},r={};return as(r,n,e),Object.assign(r,$a(e,t)),r}function Wa(e,t){const n={},r=Ua(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 za=["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 bn(e){return typeof e!="string"||e.includes("-")?!1:!!(za.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ya={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ka={offset:"strokeDashoffset",array:"strokeDasharray"};function Ha(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?Ya:Ka;e[i.offset]=N.transform(-r);const o=N.transform(t),a=N.transform(n);e[i.array]=`${o} ${a}`}function ls(e,t,n){return typeof e=="string"?e:N.transform(t+n*e)}function qa(e,t,n){const r=ls(t,e.x,e.width),s=ls(n,e.y,e.height);return`${r} ${s}`}function wn(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:i,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,f){if(vn(e,u,f),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m,dimensions:v}=e;h.transform&&(v&&(m.transform=h.transform),delete h.transform),v&&(s!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=qa(v,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&&Ha(h,o,a,l,!1)}const cs=()=>({...xn(),attrs:{}}),Tn=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ga(e,t,n,r){const s=x.useMemo(()=>{const i=cs();return wn(i,t,Tn(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};as(i,e.style,e),s.style={...i,...s.style}}return s}function Xa(e=!1){return(n,r,s,{latestValues:i},o)=>{const l=(bn(n)?Ga:Wa)(r,i,o,n),u=xa(r,typeof n=="string",e),c=n!==x.Fragment?{...u,...l,ref:s}:{},{children:f}=r,h=x.useMemo(()=>ye(f)?f.get():f,[f]);return x.createElement(n,{...c,children:h})}}function us(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Sn(e,t,n,r){if(typeof t=="function"){const[s,i]=us(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]=us(r);t=t(n!==void 0?n:e.custom,s,i)}return t}const Cn=e=>Array.isArray(e),Za=e=>Boolean(e&&typeof e=="object"&&e.mix&&e.toValue),Ja=e=>Cn(e)?e[e.length-1]||0:e;function zt(e){const t=ye(e)?e.get():e;return Za(t)?t.toValue():t}function Qa({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,i){const o={latestValues:el(r,s,i,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const fs=e=>(t,n)=>{const r=x.useContext(Bt),s=x.useContext(kt),i=()=>Qa(e,t,r,s);return n?i():on(i)};function el(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=zt(i[h]);let{initial:o,animate:a}=e;const l=Ut(e),u=Zr(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const f=c?a:o;if(f&&typeof f!="boolean"&&!$t(f)){const h=Array.isArray(f)?f:[f];for(let m=0;m<h.length;m++){const v=Sn(e,h[m]);if(v){const{transitionEnd:y,transition:w,...b}=v;for(const C in b){let P=b[C];if(Array.isArray(P)){const L=c?P.length-1:0;P=P[L]}P!==null&&(s[C]=P)}for(const C in y)s[C]=y[C]}}}return s}function Pn(e,t,n){var r;const{style:s}=e,i={};for(const o in s)(ye(s[o])||t.style&&ye(t.style[o])||rs(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 tl={useVisualState:fs({scrapeMotionValuesFromProps:Pn,createRenderState:xn})};function ds(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 hs(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 ps=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 ms(e,t,n,r){hs(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(ps.has(s)?s:hn(s),t.attrs[s])}function gs(e,t,n){const r=Pn(e,t,n);for(const s in e)if(ye(e[s])||ye(t[s])){const i=tt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}const ys=["x","y","width","height","cx","cy","r"],nl={useVisualState:fs({scrapeMotionValuesFromProps:gs,createRenderState:cs,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let i=!!e.drag;if(!i){for(const a in s)if(We.has(a)){i=!0;break}}if(!i)return;let o=!t;if(t)for(let a=0;a<ys.length;a++){const l=ys[a];e[l]!==t[l]&&(o=!0)}o&&ne.read(()=>{ds(n,r),ne.render(()=>{wn(r,s,Tn(n.tagName),e.transformTemplate),ms(n,r)})})}})};function rl(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const o={...bn(r)?nl:tl,preloadedFeatures:e,useRender:Xa(s),createVisualElement:t,Component:r};return ja(o)}}function vt(e,t,n){const r=e.getProps();return Sn(r,t,n!==void 0?n:r.custom,e)}const sl=cn(()=>window.ScrollTimeline!==void 0);class il{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(sl()&&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 ol extends il{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function En(e,t){return e?e[t]||e.default||e:void 0}const jn=2e4;function vs(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<jn;)t+=n,r=e.next(t);return t>=jn?1/0:t}function An(e){return typeof e=="function"}function xs(e,t){e.timeline=t,e.onfinish=null}const Mn=e=>Array.isArray(e)&&typeof e[0]=="number",al={linearEasing:void 0};function ll(e,t){const n=cn(e);return()=>{var r;return(r=al[t])!==null&&r!==void 0?r:n()}}const Yt=ll(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),bs=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=e(Je(0,s-1,i))+", ";return`linear(${r.substring(0,r.length-2)})`};function ws(e){return Boolean(typeof e=="function"&&Yt()||!e||typeof e=="string"&&(e in Dn||Yt())||Mn(e)||Array.isArray(e)&&e.every(ws))}const xt=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:xt([0,.65,.55,1]),circOut:xt([.55,0,1,.45]),backIn:xt([.31,.01,.66,-.59]),backOut:xt([.33,1.53,.69,.99])};function Ts(e,t){if(e)return typeof e=="function"&&Yt()?bs(e,t):Mn(e)?xt(e):Array.isArray(e)?e.map(n=>Ts(n,t)||Dn.easeOut):Dn[e]}const Ae={x:!1,y:!1};function Ss(){return Ae.x||Ae.y}function cl(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 Cs(e,t){const n=cl(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ps(e){return!(e.pointerType==="touch"||Ss())}function ul(e,t,n={}){const[r,s,i]=Cs(e,n),o=a=>{if(!Ps(a))return;const{target:l}=a,u=t(l,a);if(typeof u!="function"||!l)return;const c=f=>{Ps(f)&&(u(f),l.removeEventListener("pointerleave",c))};l.addEventListener("pointerleave",c,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}function Kt(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 Es=(e,t)=>t?e===t?!0:Es(e,t.parentElement):!1,Vn=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,fl=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function dl(e){return fl.has(e.tagName)||e.tabIndex!==-1}const bt=new WeakSet;function js(e){return t=>{t.key==="Enter"&&e(t)}}function Rn(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const hl=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=js(()=>{if(bt.has(n))return;Rn(n,"down");const s=js(()=>{Rn(n,"up")}),i=()=>Rn(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 As(e){return Vn(e)&&!Ss()}function pl(e,t,n={}){const[r,s,i]=Cs(e,n),o=a=>{const l=a.currentTarget;if(!l||!As(a)||bt.has(l))return;bt.add(l),Kt(a,"set");const u=t(l,a),c=(m,v)=>{l.removeEventListener("pointerup",f),l.removeEventListener("pointercancel",h),Kt(m,"release"),!(!As(m)||!bt.has(l))&&(bt.delete(l),typeof u=="function"&&u(m,{success:v}))},f=m=>{(m.isTrusted?ml(m,l instanceof Element?l.getBoundingClientRect():{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}):!1)?c(m,!1):c(m,!(l instanceof Element)||Es(l,m.target))},h=m=>{c(m,!1)};l.addEventListener("pointerup",f,s),l.addEventListener("pointercancel",h,s),l.addEventListener("lostpointercapture",h,s)};return r.forEach(a=>{a=n.useGlobalTarget?window:a;let l=!1;a instanceof HTMLElement&&(l=!0,!dl(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0)),a.addEventListener("pointerdown",o,s),l&&a.addEventListener("focus",u=>hl(u,s),s)}),i}function ml(e,t){return e.clientX<t.left||e.clientX>t.right||e.clientY<t.top||e.clientY>t.bottom}function gl(e){return e==="x"||e==="y"?Ae[e]?null:(Ae[e]=!0,()=>{Ae[e]=!1}):Ae.x||Ae.y?null:(Ae.x=Ae.y=!0,()=>{Ae.x=Ae.y=!1})}const Ms=new Set(["width","height","top","left","right","bottom",...tt]);let Ht;function yl(){Ht=void 0}const Ve={now:()=>(Ht===void 0&&Ve.set(ge.isProcessing||Yr.useManualTiming?ge.timestamp:performance.now()),Ht),set:e=>{Ht=e,queueMicrotask(yl)}};function On(e,t){e.indexOf(t)===-1&&e.push(t)}function Ln(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class kn{constructor(){this.subscriptions=[]}add(t){return On(this.subscriptions,t),()=>Ln(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 Ds(e,t){return t?e*(1e3/t):0}const Vs=30,vl=e=>!isNaN(parseFloat(e));class xl{constructor(t,n={}){this.version="12.4.7",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const i=Ve.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=Ve.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=vl(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 kn);const r=this.events[t].add(n);return t==="change"?()=>{r(),ne.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=Ve.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Vs)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Vs);return Ds(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 wt(e,t){return new xl(e,t)}function bl(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,wt(n))}function wl(e,t){const n=vt(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=Ja(i[o]);bl(e,o,a)}}function Tl(e){return Boolean(ye(e)&&e.add)}function _n(e,t){const n=e.getValue("willChange");if(Tl(n))return n.add(t)}function Rs(e){return e.props[Qr]}const Sl={current:!1},Os=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Cl=1e-7,Pl=12;function El(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Os(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>Cl&&++a<Pl);return o}function Tt(e,t,n,r){if(e===t&&n===r)return Te;const s=i=>El(i,0,1,e,n);return i=>i===0||i===1?i:Os(s(i),t,r)}const Ls=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ks=e=>t=>1-e(1-t),_s=Tt(.33,1.53,.69,.99),In=ks(_s),Is=Ls(In),Ns=e=>(e*=2)<1?.5*In(e):.5*(2-Math.pow(2,-10*(e-1))),Nn=e=>1-Math.sin(Math.acos(e)),Fs=ks(Nn),Bs=Ls(Nn),$s=e=>/^0[^.\s]+$/u.test(e);function jl(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||$s(e):!0}const St=e=>Math.round(e*1e5)/1e5,Fn=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Al(e){return e==null}const Ml=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bn=(e,t)=>n=>Boolean(typeof n=="string"&&Ml.test(n)&&n.startsWith(e)||t&&!Al(n)&&Object.prototype.hasOwnProperty.call(n,t)),Us=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Fn);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dl=e=>Le(0,255,e),$n={...nt,transform:e=>Math.round(Dl(e))},ze={test:Bn("rgb","red"),parse:Us("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+$n.transform(e)+", "+$n.transform(t)+", "+$n.transform(n)+", "+St(gt.transform(r))+")"};function Vl(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 Un={test:Bn("#"),parse:Vl,transform:ze.transform},rt={test:Bn("hsl","hue"),parse:Us("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+De.transform(St(t))+", "+De.transform(St(n))+", "+St(gt.transform(r))+")"},ve={test:e=>ze.test(e)||Un.test(e)||rt.test(e),parse:e=>ze.test(e)?ze.parse(e):rt.test(e)?rt.parse(e):Un.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ze.transform(e):rt.transform(e)},Rl=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ol(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Fn))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Rl))===null||n===void 0?void 0:n.length)||0)>0}const Ws="number",zs="color",Ll="var",kl="var(",Ys="${}",_l=/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 Ct(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(_l,l=>(ve.test(l)?(r.color.push(i),s.push(zs),n.push(ve.parse(l))):l.startsWith(kl)?(r.var.push(i),s.push(Ll),n.push(l)):(r.number.push(i),s.push(Ws),n.push(parseFloat(l))),++i,Ys)).split(Ys);return{values:n,split:a,indexes:r,types:s}}function Ks(e){return Ct(e).values}function Hs(e){const{split:t,types:n}=Ct(e),r=t.length;return s=>{let i="";for(let o=0;o<r;o++)if(i+=t[o],s[o]!==void 0){const a=n[o];a===Ws?i+=St(s[o]):a===zs?i+=ve.transform(s[o]):i+=s[o]}return i}}const Il=e=>typeof e=="number"?0:e;function Nl(e){const t=Ks(e);return Hs(e)(t.map(Il))}const Be={test:Ol,parse:Ks,createTransformer:Hs,getAnimatableNone:Nl},Fl=new Set(["brightness","contrast","saturate","opacity"]);function Bl(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Fn)||[];if(!r)return e;const s=n.replace(r,"");let i=Fl.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const $l=/\b([a-z-]*)\(.*?\)/gu,Wn={...Be,getAnimatableNone:e=>{const t=e.match($l);return t?t.map(Bl).join(" "):e}},Ul={...yn,color:ve,backgroundColor:ve,outlineColor:ve,fill:ve,stroke:ve,borderColor:ve,borderTopColor:ve,borderRightColor:ve,borderBottomColor:ve,borderLeftColor:ve,filter:Wn,WebkitFilter:Wn},zn=e=>Ul[e];function qs(e,t){let n=zn(e);return n!==Wn&&(n=Be),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Wl=new Set(["auto","none","0"]);function zl(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!Wl.has(i)&&Ct(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=qs(n,s)}const Gs=e=>e===nt||e===N,Xs=(e,t)=>parseFloat(e.split(", ")[t]),Zs=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return Xs(s[1],t);{const i=r.match(/^matrix\((.+)\)$/u);return i?Xs(i[1],e):0}},Yl=new Set(["x","y","z"]),Kl=tt.filter(e=>!Yl.has(e));function Hl(e){const t=[];return Kl.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const st={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:Zs(4,13),y:Zs(5,14)};st.translateX=st.x,st.translateY=st.y;const Ye=new Set;let Yn=!1,Kn=!1;function Js(){if(Kn){const e=Array.from(Ye).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=Hl(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 a;(a=r.getValue(i))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Kn=!1,Yn=!1,Ye.forEach(e=>e.complete()),Ye.clear()}function Qs(){Ye.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kn=!0)})}function ql(){Qs(),Js()}class Hn{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?(Ye.add(this),Yn||(Yn=!0,ne.read(Qs),ne.resolveKeyframes(Js))):(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(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),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),Ye.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ye.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const ei=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Gl=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Xl(e){const t=Gl.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}const Zl=4;function ti(e,t,n=1){_e(n<=Zl,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,s]=Xl(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return ei(o)?parseFloat(o):o}return gn(s)?ti(s,t,n+1):s}const ni=e=>t=>t.test(e),ri=[nt,N,De,Fe,ka,La,{test:e=>e==="auto",parse:e=>e}],si=e=>ri.find(ni(e));class ii extends Hn{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 l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),gn(u))){const c=ti(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Ms.has(r)||t.length!==2)return;const[s,i]=t,o=si(s),a=si(i);if(o!==a)if(Gs(o)&&Gs(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)jl(t[s])&&r.push(s);r.length&&zl(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=st[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,a=s[o];s[o]=st[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const oi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Be.test(e)||e==="0")&&!e.startsWith("url("));function Jl(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 Ql(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=oi(s,t),a=oi(i,t);return Ze(o===a,`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||!a?!1:Jl(e)||(n==="spring"||An(n))&&r}const ec=e=>e!==null;function qt(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(ec),i=t&&n!=="loop"&&t%2===1?0:s.length-1;return!i||r===void 0?s[i]:r}const tc=40;class ai{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ve.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tc?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&ql(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ve.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:i,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Ql(t,r,s,i))if(o)this.options.duration=0;else{l&&l(qt(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},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},re=(e,t,n)=>e+(t-e)*n;function qn(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 nc({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 a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=qn(l,a,e+1/3),i=qn(l,a,e),o=qn(l,a,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 Gn=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},rc=[Un,ze,rt],sc=e=>rc.find(t=>t.test(e));function li(e){const t=sc(e);if(Ze(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===rt&&(n=nc(n)),n}const ci=(e,t)=>{const n=li(e),r=li(t);if(!n||!r)return Gt(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=re(n.alpha,r.alpha,i),ze.transform(s))},ic=(e,t)=>n=>t(e(n)),Et=(...e)=>e.reduce(ic),Xn=new Set(["none","hidden"]);function oc(e,t){return Xn.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ac(e,t){return n=>re(e,t,n)}function Zn(e){return typeof e=="number"?ac:typeof e=="string"?gn(e)?Gt:ve.test(e)?ci:uc:Array.isArray(e)?ui:typeof e=="object"?ve.test(e)?ci:lc:Gt}function ui(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Zn(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function lc(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Zn(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function cc(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],a=e.indexes[o][s[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[i]=l,s[o]++}return r}const uc=(e,t)=>{const n=Be.createTransformer(t),r=Ct(e),s=Ct(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?Xn.has(e)&&!s.values.length||Xn.has(t)&&!r.values.length?oc(e,t):Et(ui(cc(r,s),s.values),n):(Ze(!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 fi(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?re(e,t,n):Zn(e)(e,t)}const fc=5;function di(e,t,n){const r=Math.max(t-fc,0);return Ds(n-e(r),t-r)}const se={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},Jn=.001;function dc({duration:e=se.duration,bounce:t=se.bounce,velocity:n=se.velocity,mass:r=se.mass}){let s,i;Ze(e<=Me(se.maxDuration),"Spring duration must be 10 seconds or less");let o=1-t;o=Le(se.minDamping,se.maxDamping,o),e=Le(se.minDuration,se.maxDuration,Oe(e)),o<1?(s=u=>{const c=u*o,f=c*e,h=c-n,m=Qn(u,o),v=Math.exp(-f);return Jn-h/m*v},i=u=>{const f=u*o*e,h=f*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-f),y=Qn(Math.pow(u,2),o);return(-s(u)+Jn>0?-1:1)*((h-m)*v)/y}):(s=u=>{const c=Math.exp(-u*e),f=(u-n)*e+1;return-Jn+c*f},i=u=>{const c=Math.exp(-u*e),f=(n-u)*(e*e);return c*f});const a=5/e,l=pc(s,i,a);if(e=Me(e),isNaN(l))return{stiffness:se.stiffness,damping:se.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const hc=12;function pc(e,t,n){let r=n;for(let s=1;s<hc;s++)r=r-e(r)/t(r);return r}function Qn(e,t){return e*Math.sqrt(1-t*t)}const mc=["duration","bounce"],gc=["stiffness","damping","mass"];function hi(e,t){return t.some(n=>e[n]!==void 0)}function yc(e){let t={velocity:se.velocity,stiffness:se.stiffness,damping:se.damping,mass:se.mass,isResolvedFromDuration:!1,...e};if(!hi(e,gc)&&hi(e,mc))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Le(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:se.mass,stiffness:s,damping:i}}else{const n=dc(e);t={...t,...n,mass:se.mass},t.isResolvedFromDuration=!0}return t}function pi(e=se.visualDuration,t=se.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],a={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:f,velocity:h,isResolvedFromDuration:m}=yc({...n,velocity:-Oe(n.velocity||0)}),v=h||0,y=u/(2*Math.sqrt(l*c)),w=o-i,b=Oe(Math.sqrt(l/c)),C=Math.abs(w)<5;r||(r=C?se.restSpeed.granular:se.restSpeed.default),s||(s=C?se.restDelta.granular:se.restDelta.default);let P;if(y<1){const g=Qn(b,y);P=O=>{const Y=Math.exp(-y*b*O);return o-Y*((v+y*b*w)/g*Math.sin(g*O)+w*Math.cos(g*O))}}else if(y===1)P=g=>o-Math.exp(-b*g)*(w+(v+b*w)*g);else{const g=b*Math.sqrt(y*y-1);P=O=>{const Y=Math.exp(-y*b*O),R=Math.min(g*O,300);return o-Y*((v+y*b*w)*Math.sinh(R)+g*w*Math.cosh(R))/g}}const L={calculatedDuration:m&&f||null,next:g=>{const O=P(g);if(m)a.done=g>=f;else{let Y=0;y<1&&(Y=g===0?Me(v):di(P,g,O));const R=Math.abs(Y)<=r,Q=Math.abs(o-O)<=s;a.done=R&&Q}return a.value=a.done?o:O,a},toString:()=>{const g=Math.min(vs(L),jn),O=bs(Y=>L.next(g*Y).value,g,30);return g+"ms "+O}};return L}function mi({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const f=e[0],h={done:!1,value:f},m=R=>a!==void 0&&R<a||l!==void 0&&R>l,v=R=>a===void 0?l:l===void 0||Math.abs(a-R)<Math.abs(l-R)?a:l;let y=n*t;const w=f+y,b=o===void 0?w:o(w);b!==w&&(y=b-f);const C=R=>-y*Math.exp(-R/r),P=R=>b+C(R),L=R=>{const Q=C(R),F=P(R);h.done=Math.abs(Q)<=u,h.value=h.done?b:F};let g,O;const Y=R=>{m(h.value)&&(g=R,O=pi({keyframes:[h.value,v(h.value)],velocity:di(P,R,h.value),damping:s,stiffness:i,restDelta:u,restSpeed:c}))};return Y(0),{calculatedDuration:null,next:R=>{let Q=!1;return!O&&g===void 0&&(Q=!0,L(R),Y(R)),g!==void 0&&R>=g?O.next(R-g):(!Q&&L(R),h)}}}const vc=Tt(.42,0,1,1),xc=Tt(0,0,.58,1),gi=Tt(.42,0,.58,1),bc=e=>Array.isArray(e)&&typeof e[0]!="number",yi={linear:Te,easeIn:vc,easeInOut:gi,easeOut:xc,circIn:Nn,circInOut:Bs,circOut:Fs,backIn:In,backInOut:Is,backOut:_s,anticipate:Ns},vi=e=>{if(Mn(e)){_e(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,s]=e;return Tt(t,n,r,s)}else if(typeof e=="string")return _e(yi[e]!==void 0,`Invalid easing type '${e}'`),yi[e];return e};function wc(e,t,n){const r=[],s=n||fi,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Te:t;a=Et(l,a)}r.push(a)}return r}function Tc(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(_e(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 a=wc(t,r,s),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(c<e[f+1]);f++);const h=Je(e[f],e[f+1],c);return a[f](h)};return n?c=>u(Le(e[0],e[i-1],c)):u}function Sc(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Je(0,t,r);e.push(re(n,1,s))}}function Cc(e){const t=[0];return Sc(t,e.length-1),t}function Pc(e,t){return e.map(n=>n*t)}function Ec(e,t){return e.map(()=>t||gi).splice(0,e.length-1)}function jt({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=bc(r)?r.map(vi):vi(r),i={done:!1,value:t[0]},o=Pc(n&&n.length===t.length?n:Cc(t),e),a=Tc(o,t,{ease:Array.isArray(s)?s:Ec(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const jc=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ne.update(t,!0),stop:()=>Ne(t),now:()=>ge.isProcessing?ge.timestamp:Ve.now()}},Ac={decay:mi,inertia:mi,tween:jt,keyframes:jt,spring:pi},Mc=e=>e/100;class er extends ai{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:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:i}=this.options,o=(s==null?void 0:s.KeyframeResolver)||Hn,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(i,a,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,a=An(n)?n:Ac[n]||jt;let l,u;process.env.NODE_ENV!=="production"&&a!==jt&&_e(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a!==jt&&typeof t[0]!="number"&&(l=Et(Mc,fi(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});i==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=vs(c));const{calculatedDuration:f}=c,h=f+s,m=h*(r+1)-s;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,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:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:h,repeat:m,repeatType:v,repeatDelay:y,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/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),C=this.speed>=0?b<0:b>c;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let P=this.currentTime,L=i;if(m){const R=Math.min(this.currentTime,c)/f;let Q=Math.floor(R),F=R%1;!F&&R>=1&&(F=1),F===1&&Q--,Q=Math.min(Q,m+1),Boolean(Q%2)&&(v==="reverse"?(F=1-F,y&&(F-=y/f)):v==="mirror"&&(L=o)),P=Le(0,1,F)*f}const g=C?{done:!1,value:l[0]}:L.next(P);a&&(g.value=a(g.value));let{done:O}=g;!C&&u!==null&&(O=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const Y=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return Y&&s!==void 0&&(g.value=qt(l,this.options,s)),w&&w(g.value),Y&&this.finish(),g}get duration(){const{resolved:t}=this;return t?Oe(t.calculatedDuration):0}get time(){return Oe(this.currentTime)}set time(t){t=Me(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=Oe(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=jc,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 Dc=new Set(["opacity","clipPath","filter","transform"]);function Vc(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=Ts(a,s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:s,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const Rc=cn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Xt=10,Oc=2e4;function Lc(e){return An(e.type)||e.type==="spring"||!ws(e.ease)}function kc(e,t){const n=new er({...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<Oc;)r=n.sample(i),s.push(r.value),i+=Xt;return{times:void 0,keyframes:s,duration:i-Xt,ease:"linear"}}const xi={anticipate:Ns,backInOut:Is,circInOut:Bs};function _c(e){return e in xi}class bi extends ai{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:i}=this.options;this.resolver=new ii(i,(o,a)=>this.onKeyframesResolved(o,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:i,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof i=="string"&&Yt()&&_c(i)&&(i=xi[i]),Lc(this.options)){const{onComplete:f,onUpdate:h,motionValue:m,element:v,...y}=this.options,w=kc(t,y);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,s=w.times,i=w.ease,o="keyframes"}const c=Vc(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:i});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(xs(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;a.set(qt(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,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 Oe(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Oe(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Me(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 Te;const{animation:r}=n;xs(r,t)}return Te}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:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:f,element:h,...m}=this.options,v=new er({...m,keyframes:r,duration:s,type:i,ease:o,times:a,isGenerator:!0}),y=Me(this.time);u.setWithVelocity(v.sample(y-Xt).value,v.sample(y).value,Xt)}const{onStop:l}=this.options;l&&l(),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:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return Rc()&&r&&Dc.has(r)&&!l&&!u&&!s&&i!=="mirror"&&o!==0&&a!=="inertia"}}const Ic={type:"spring",stiffness:500,damping:25,restSpeed:10},Nc=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Fc={type:"keyframes",duration:.8},Bc={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},$c=(e,{keyframes:t})=>t.length>2?Fc:We.has(e)?e.startsWith("scale")?Nc(t[1]):Ic:Bc;function Uc({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const tr=(e,t,n,r={},s,i)=>o=>{const a=En(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Me(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};Uc(a)||(c={...c,...$c(e,c)}),c.duration&&(c.duration=Me(c.duration)),c.repeatDelay&&(c.repeatDelay=Me(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let f=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(f=!0)),(Sl.current||Yr.skipAnimations)&&(f=!0,c.duration=0,c.delay=0),f&&!i&&t.get()!==void 0){const h=qt(c.keyframes,a);if(h!==void 0)return ne.update(()=>{c.onUpdate(h),c.onComplete()}),new ol([])}return!i&&bi.supports(c)?new bi(c):new er(c)};function Wc({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function wi(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var i;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const u=[],c=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const h=e.getValue(f,(i=e.latestValues[f])!==null&&i!==void 0?i:null),m=l[f];if(m===void 0||c&&Wc(c,f))continue;const v={delay:n,...En(o||{},f)};let y=!1;if(window.MotionHandoffAnimation){const b=Rs(e);if(b){const C=window.MotionHandoffAnimation(b,f,ne);C!==null&&(v.startTime=C,y=!0)}}_n(e,f),h.start(tr(f,h,m,e.shouldReduceMotion&&Ms.has(f)?{type:!1}:v,e,y));const w=h.animation;w&&u.push(w)}return a&&Promise.all(u).then(()=>{ne.update(()=>{a&&wl(e,a)})}),u}function nr(e,t,n={}){var r;const s=vt(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(wi(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:f,staggerDirection:h}=i;return zc(e,t,c+u,f,h,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function zc(e,t,n=0,r=0,s=1,i){const o=[],a=(e.variantChildren.size-1)*r,l=s===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(Yc).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(nr(u,t,{...i,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function Yc(e,t){return e.sortNodePosition(t)}function Kc(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>nr(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=nr(e,t,n);else{const s=typeof t=="function"?vt(e,t,n.custom):t;r=Promise.all(wi(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Ti(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 Hc=dn.length;function Si(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Si(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Hc;n++){const r=dn[n],s=e.props[r];(pt(s)||s===!1)&&(t[r]=s)}return t}const qc=[...fn].reverse(),Gc=fn.length;function Xc(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Kc(e,n,r)))}function Zc(e){let t=Xc(e),n=Ci(),r=!0;const s=l=>(u,c)=>{var f;const h=vt(e,c,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(h){const{transition:m,transitionEnd:v,...y}=h;u={...u,...y,...v}}return u};function i(l){t=l(e)}function o(l){const{props:u}=e,c=Si(e.parent)||{},f=[],h=new Set;let m={},v=1/0;for(let w=0;w<Gc;w++){const b=qc[w],C=n[b],P=u[b]!==void 0?u[b]:c[b],L=pt(P),g=b===l?C.isActive:null;g===!1&&(v=w);let O=P===c[b]&&P!==u[b]&&L;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),C.protectedKeys={...m},!C.isActive&&g===null||!P&&!C.prevProp||$t(P)||typeof P=="boolean")continue;const Y=Jc(C.prevProp,P);let R=Y||b===l&&C.isActive&&!O&&L||w>v&&L,Q=!1;const F=Array.isArray(P)?P:[P];let I=F.reduce(s(b),{});g===!1&&(I={});const{prevResolvedValues:oe={}}=C,ee={...oe,...I},ae=q=>{R=!0,h.has(q)&&(Q=!0,h.delete(q)),C.needsAnimating[q]=!0;const le=e.getValue(q);le&&(le.liveStyle=!1)};for(const q in ee){const le=I[q],K=oe[q];if(m.hasOwnProperty(q))continue;let T=!1;Cn(le)&&Cn(K)?T=!Ti(le,K):T=le!==K,T?le!=null?ae(q):h.add(q):le!==void 0&&h.has(q)?ae(q):C.protectedKeys[q]=!0}C.prevProp=P,C.prevResolvedValues=I,C.isActive&&(m={...m,...I}),r&&e.blockInitialAnimation&&(R=!1),R&&(!(O&&Y)||Q)&&f.push(...F.map(q=>({animation:q,options:{type:b}})))}if(h.size){const w={};if(typeof u.initial!="boolean"){const b=vt(e,Array.isArray(u.initial)?u.initial[0]:u.initial);b&&b.transition&&(w.transition=b.transition)}h.forEach(b=>{const C=e.getBaseTarget(b),P=e.getValue(b);P&&(P.liveStyle=!0),w[b]=C??null}),f.push({animation:w})}let y=Boolean(f.length);return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(f):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const f=o(l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=Ci(),r=!0}}}function Jc(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Ti(t,e):!1}function Ke(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ci(){return{animate:Ke(!0),whileInView:Ke(),whileHover:Ke(),whileTap:Ke(),whileDrag:Ke(),whileFocus:Ke(),exit:Ke()}}class $e{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Qc extends $e{constructor(t){super(t),t.animationState||(t.animationState=Zc(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();$t(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 eu=0;class tu extends $e{constructor(){super(...arguments),this.id=eu++}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 nu={animation:{Feature:Qc},exit:{Feature:tu}};function At(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Mt(e){return{point:{x:e.pageX,y:e.pageY}}}const ru=e=>t=>Vn(t)&&e(t,Mt(t));function it(e,t,n,r){return At(e,t,ru(n),r)}function Pi({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function su({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iu(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 Ei=1e-4,ou=1-Ei,au=1+Ei,ji=.01,lu=0-ji,cu=0+ji;function xe(e){return e.max-e.min}function uu(e,t,n){return Math.abs(e-t)<=n}function Ai(e,t,n,r=.5){e.origin=r,e.originPoint=re(t.min,t.max,e.origin),e.scale=xe(n)/xe(t),e.translate=re(n.min,n.max,e.origin)-e.originPoint,(e.scale>=ou&&e.scale<=au||isNaN(e.scale))&&(e.scale=1),(e.translate>=lu&&e.translate<=cu||isNaN(e.translate))&&(e.translate=0)}function Dt(e,t,n,r){Ai(e.x,t.x,n.x,r?r.originX:void 0),Ai(e.y,t.y,n.y,r?r.originY:void 0)}function Mi(e,t,n){e.min=n.min+t.min,e.max=e.min+xe(t)}function fu(e,t,n){Mi(e.x,t.x,n.x),Mi(e.y,t.y,n.y)}function Di(e,t,n){e.min=t.min-n.min,e.max=e.min+xe(t)}function Vt(e,t,n){Di(e.x,t.x,n.x),Di(e.y,t.y,n.y)}const Vi=()=>({translate:0,scale:1,origin:0,originPoint:0}),ot=()=>({x:Vi(),y:Vi()}),Ri=()=>({min:0,max:0}),ue=()=>({x:Ri(),y:Ri()});function Ce(e){return[e("x"),e("y")]}function rr(e){return e===void 0||e===1}function sr({scale:e,scaleX:t,scaleY:n}){return!rr(e)||!rr(t)||!rr(n)}function He(e){return sr(e)||Oi(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Oi(e){return Li(e.x)||Li(e.y)}function Li(e){return e&&e!=="0%"}function Zt(e,t,n){const r=e-n,s=t*r;return n+s}function ki(e,t,n,r,s){return s!==void 0&&(e=Zt(e,s,r)),Zt(e,n,r)+t}function ir(e,t=0,n=1,r,s){e.min=ki(e.min,t,n,r,s),e.max=ki(e.max,t,n,r,s)}function _i(e,{x:t,y:n}){ir(e.x,t.translate,t.scale,t.originPoint),ir(e.y,n.translate,n.scale,n.originPoint)}const Ii=.999999999999,Ni=1.0000000000001;function du(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let a=0;a<s;a++){i=n[a],o=i.projectionDelta;const{visualElement:l}=i.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&lt(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,_i(e,o)),r&&He(i.latestValues)&&lt(e,i.latestValues))}t.x<Ni&&t.x>Ii&&(t.x=1),t.y<Ni&&t.y>Ii&&(t.y=1)}function at(e,t){e.min=e.min+t,e.max=e.max+t}function Fi(e,t,n,r,s=.5){const i=re(e.min,e.max,s);ir(e,t,n,i,r)}function lt(e,t){Fi(e.x,t.x,t.scaleX,t.scale,t.originX),Fi(e.y,t.y,t.scaleY,t.scale,t.originY)}function Bi(e,t){return Pi(iu(e.getBoundingClientRect(),t))}function hu(e,t,n){const r=Bi(e,n),{scroll:s}=t;return s&&(at(r.x,s.offset.x),at(r.y,s.offset.y)),r}const $i=(e,t)=>Math.abs(e-t);function pu(e,t){const n=$i(e.x,t.x),r=$i(e.y,t.y);return Math.sqrt(n**2+r**2)}class Ui{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 c=ar(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,h=pu(c.offset,{x:0,y:0})>=3;if(!f&&!h)return;const{point:m}=c,{timestamp:v}=ge;this.history.push({...m,timestamp:v});const{onStart:y,onMove:w}=this.handlers;f||(y&&y(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{if(c.target instanceof Element&&c.target.hasPointerCapture&&c.pointerId!==void 0)try{if(!c.target.hasPointerCapture(c.pointerId))return}catch{}this.lastMoveEvent=c,this.lastMoveEventInfo=or(f,this.transformPagePoint),ne.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{Kt(c,"release"),this.end();const{onEnd:h,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=ar(c.type==="pointercancel"||c.type==="lostpointercapture"?this.lastMoveEventInfo:or(f,this.transformPagePoint),this.history);this.startEvent&&h&&h(c,y),m&&m(c,y)},!Vn(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r;const i=Mt(t),o=or(i,this.transformPagePoint),{point:a}=o,{timestamp:l}=ge;this.history=[{...a,timestamp:l}];const{onSessionStart:u}=n;u&&u(t,ar(o,this.history)),Kt(t,"set"),this.removeListeners=Et(it(t.currentTarget,"pointermove",this.handlePointerMove),it(t.currentTarget,"pointerup",this.handlePointerUp),it(t.currentTarget,"pointercancel",this.handlePointerUp),it(t.currentTarget,"lostpointercapture",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ne(this.updatePoint)}}function or(e,t){return t?{point:t(e.point)}:e}function Wi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ar({point:e},t){return{point:e,delta:Wi(e,zi(t)),offset:Wi(e,mu(t)),velocity:gu(t,.1)}}function mu(e){return e[0]}function zi(e){return e[e.length-1]}function gu(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=zi(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Me(t)));)n--;if(!r)return{x:0,y:0};const i=Oe(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 yu(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?re(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?re(n,e,r.max):Math.min(e,n)),e}function Yi(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 vu(e,{top:t,left:n,bottom:r,right:s}){return{x:Yi(e.x,n,s),y:Yi(e.y,t,r)}}function Ki(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 xu(e,t){return{x:Ki(e.x,t.x),y:Ki(e.y,t.y)}}function bu(e,t){let n=.5;const r=xe(e),s=xe(t);return s>r?n=Je(t.min,t.max-r,e.min):r>s&&(n=Je(e.min,e.max-s,t.min)),Le(0,1,n)}function wu(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 lr=.35;function Tu(e=lr){return e===!1?e=0:e===!0&&(e=lr),{x:Hi(e,"left","right"),y:Hi(e,"top","bottom")}}function Hi(e,t,n){return{min:qi(e,t),max:qi(e,n)}}function qi(e,t){return typeof e=="number"?e:e[t]||0}const Su=new WeakMap;class Cu{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=ue(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=c=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Mt(c).point)},i=(c,f)=>{const{drag:h,dragPropagation:m,onDragStart:v}=this.getProps();if(h&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=gl(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),Ce(w=>{let b=this.getAxisMotionValue(w).get()||0;if(De.test(b)){const{projection:C}=this.visualElement;if(C&&C.layout){const P=C.layout.layoutBox[w];P&&(b=xe(P)*(parseFloat(b)/100))}}this.originPoint[w]=b}),v&&ne.postRender(()=>v(c,f)),_n(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},o=(c,f)=>{const{dragPropagation:h,dragDirectionLock:m,onDirectionLock:v,onDrag:y}=this.getProps();if(!h&&!this.openDragLock)return;const{offset:w}=f;if(m&&this.currentDirection===null){this.currentDirection=Pu(w),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",f.point,w),this.updateAxis("y",f.point,w),this.visualElement.render(),y&&y(c,f)},a=(c,f)=>this.stop(c,f),l=()=>Ce(c=>{var f;return this.getAnimationState(c)==="paused"&&((f=this.getAxisMotionValue(c).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Ui(t,{onSessionStart:s,onStart:i,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u})}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&&ne.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||!Jt(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=yu(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&&et(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=vu(s.layoutBox,n):this.constraints=!1,this.elastic=Tu(r),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ce(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=wu(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!et(t))return!1;const r=t.current;_e(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=hu(r,s.root,this.visualElement.getTransformPagePoint());let o=xu(s.layout.layoutBox,i);if(n){const a=n(su(o));this.hasMutatedConstraints=!!a,a&&(o=Pi(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ce(c=>{if(!Jt(c,n,this.currentDirection))return;let f=l&&l[c]||{};o&&(f={min:0,max:0});const h=s?200:1e6,m=s?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return _n(this.visualElement,t),r.start(tr(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ce(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ce(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){Ce(n=>{const{drag:r}=this.getProps();if(!Jt(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(t[n]-re(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!et(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ce(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=bu({min:l,max:l},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(),Ce(o=>{if(!Jt(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(re(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;Su.set(this.visualElement,this);const t=this.visualElement.current,n=it(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();et(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),ne.read(r);const o=At(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ce(c=>{const f=this.getAxisMotionValue(c);f&&(this.originPoint[c]+=l[c].translate,f.set(f.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=lr,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Jt(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Pu(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Eu extends $e{constructor(t){super(t),this.removeGroupControls=Te,this.removeListeners=Te,this.controls=new Cu(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Te}unmount(){this.removeGroupControls(),this.removeListeners()}}const Gi=e=>(t,n)=>{e&&ne.postRender(()=>e(t,n))};class ju extends $e{constructor(){super(...arguments),this.removePointerDownListener=Te}onPointerDown(t){this.session=new Ui(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Gi(t),onStart:Gi(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&ne.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=it(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 Qt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Xi(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Rt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(N.test(e))e=parseFloat(e);else return e;const n=Xi(e,t.target.x),r=Xi(e,t.target.y);return`${n}% ${r}%`}},Au={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Be.parse(e);if(s.length>5)return r;const i=Be.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const u=re(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};class Mu extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;Oa(Du),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()})),Qt.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()||ne.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),pn.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 Zi(e){const[t,n]=$r(),r=x.useContext(sn);return p.exports.jsx(Mu,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(es),isPresent:t,safeToRemove:n})}const Du={borderRadius:{...Rt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Rt,borderTopRightRadius:Rt,borderBottomLeftRadius:Rt,borderBottomRightRadius:Rt,boxShadow:Au};function Vu(e,t,n){const r=ye(e)?e:wt(e);return r.start(tr("",r,t,n)),r.animation}function Ru(e){return e instanceof SVGElement&&e.tagName!=="svg"}const Ou=(e,t)=>e.depth-t.depth;class Lu{constructor(){this.children=[],this.isDirty=!1}add(t){On(this.children,t),this.isDirty=!0}remove(t){Ln(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ou),this.isDirty=!1,this.children.forEach(t)}}function ku(e,t){const n=Ve.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Ne(r),e(i-t))};return ne.read(r,!0),()=>Ne(r)}const Ji=["TopLeft","TopRight","BottomLeft","BottomRight"],_u=Ji.length,Qi=e=>typeof e=="string"?parseFloat(e):e,eo=e=>typeof e=="number"||N.test(e);function Iu(e,t,n,r,s,i){s?(e.opacity=re(0,n.opacity!==void 0?n.opacity:1,Nu(r)),e.opacityExit=re(t.opacity!==void 0?t.opacity:1,0,Fu(r))):i&&(e.opacity=re(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<_u;o++){const a=`border${Ji[o]}Radius`;let l=to(t,a),u=to(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||eo(l)===eo(u)?(e[a]=Math.max(re(Qi(l),Qi(u),r),0),(De.test(u)||De.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=re(t.rotate||0,n.rotate||0,r))}function to(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Nu=no(0,.5,Fs),Fu=no(.5,.95,Te);function no(e,t,n){return r=>r<e?0:r>t?1:n(Je(e,t,r))}function ro(e,t){e.min=t.min,e.max=t.max}function Pe(e,t){ro(e.x,t.x),ro(e.y,t.y)}function so(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function io(e,t,n,r,s){return e-=t,e=Zt(e,1/n,r),s!==void 0&&(e=Zt(e,1/s,r)),e}function Bu(e,t=0,n=1,r=.5,s,i=e,o=e){if(De.test(t)&&(t=parseFloat(t),t=re(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=re(i.min,i.max,r);e===i&&(a-=t),e.min=io(e.min,t,n,a,s),e.max=io(e.max,t,n,a,s)}function oo(e,t,[n,r,s],i,o){Bu(e,t[n],t[r],t[s],t.scale,i,o)}const $u=["x","scaleX","originX"],Uu=["y","scaleY","originY"];function ao(e,t,n,r){oo(e.x,t,$u,n?n.x:void 0,r?r.x:void 0),oo(e.y,t,Uu,n?n.y:void 0,r?r.y:void 0)}function lo(e){return e.translate===0&&e.scale===1}function co(e){return lo(e.x)&&lo(e.y)}function uo(e,t){return e.min===t.min&&e.max===t.max}function Wu(e,t){return uo(e.x,t.x)&&uo(e.y,t.y)}function fo(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ho(e,t){return fo(e.x,t.x)&&fo(e.y,t.y)}function po(e){return xe(e.x)/xe(e.y)}function mo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class zu{constructor(){this.members=[]}add(t){On(this.members,t),t.scheduleRender()}remove(t){if(Ln(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 Yu(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:u,rotate:c,rotateX:f,rotateY:h,skewX:m,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const qe={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},cr=["","X","Y","Z"],Ku={visibility:"hidden"},go=1e3;let Hu=0;function ur(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function yo(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Rs(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ne,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&yo(r)}function vo({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Hu++,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,Ie.value&&(qe.nodes=qe.calculatedTargetDeltas=qe.calculatedProjections=0),this.nodes.forEach(Xu),this.nodes.forEach(tf),this.nodes.forEach(nf),this.nodes.forEach(Zu),Ie.addProjectionMetrics&&Ie.addProjectionMetrics(qe)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new Lu)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new kn),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Ru(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let f;const h=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=ku(h,250),Qt.hasAnimatedSinceResize&&(Qt.hasAnimatedSinceResize=!1,this.nodes.forEach(bo))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||lf,{onLayoutAnimationStart:w,onLayoutAnimationComplete:b}=c.getProps(),C=!this.targetLayout||!ho(this.targetLayout,v),P=!h&&m;if(this.options.layoutRoot||this.resumeFrom||P||h&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,P);const L={...En(y,"layout"),onPlay:w,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else h||bo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}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,Ne(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(rf),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&&yo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const f=this.path[c];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(xo);return}this.isUpdating||this.nodes.forEach(Qu),this.isUpdating=!1,this.nodes.forEach(ef),this.nodes.forEach(qu),this.nodes.forEach(Gu),this.clearAllSnapshots();const a=Ve.now();ge.delta=Le(0,1e3/60,a-ge.timestamp),ge.timestamp=a,ge.isProcessing=!0,un.update.process(ge),un.preRender.process(ge),un.render.process(ge),ge.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pn.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Ju),this.sharedNodes.forEach(sf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ne.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ne.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xe(this.snapshot.measuredBox.x)&&!xe(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ue(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!co(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||He(this.latestValues)||c)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),cf(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return ue();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(uf))){const{scroll:c}=this.root;c&&(at(l.x,c.offset.x),at(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=ue();if(Pe(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:f,options:h}=c;c!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&Pe(l,o),at(l.x,f.offset.x),at(l.y,f.offset.y))}return l}applyTransform(o,a=!1){const l=ue();Pe(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&lt(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),He(c.latestValues)&&lt(l,c.latestValues)}return He(this.latestValues)&&lt(l,this.latestValues),l}removeTransform(o){const a=ue();Pe(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!He(u.latestValues))continue;sr(u.latestValues)&&u.updateSnapshot();const c=ue(),f=u.measurePageBox();Pe(c,f),ao(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return He(this.latestValues)&&ao(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ge.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=Boolean(this.resumingFrom)||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:h}=this.options;if(!(!this.layout||!(f||h))){if(this.resolvedRelativeTargetAt=ge.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ue(),this.relativeTargetOrigin=ue(),Vt(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=ue(),this.targetWithTransforms=ue()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),fu(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),_i(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=ue(),this.relativeTargetOrigin=ue(),Vt(this.relativeTargetOrigin,this.target,m.target),Pe(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ie.value&&qe.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||sr(this.parent.latestValues)||Oi(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 a=this.getLead(),l=Boolean(this.resumingFrom)||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ge.timestamp&&(u=!1),u)return;const{layout:c,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||!(c||f))return;Pe(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,m=this.treeScale.y;du(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=ue());const{target:v}=a;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(so(this.prevProjectionDelta.x,this.projectionDelta.x),so(this.prevProjectionDelta.y,this.projectionDelta.y)),Dt(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==m||!mo(this.projectionDelta.x,this.prevProjectionDelta.x)||!mo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),Ie.value&&qe.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ot(),this.projectionDelta=ot(),this.projectionDeltaWithTransform=ot()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},f=ot();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=ue(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,y=m!==v,w=this.getStack(),b=!w||w.members.length<=1,C=Boolean(y&&!b&&this.options.crossfade===!0&&!this.path.some(af));this.animationProgress=0;let P;this.mixTargetDelta=L=>{const g=L/1e3;wo(f.x,o.x,g),wo(f.y,o.y,g),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vt(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),of(this.relativeTarget,this.relativeTargetOrigin,h,g),P&&Wu(this.relativeTarget,P)&&(this.isProjectionDirty=!1),P||(P=ue()),Pe(P,this.relativeTarget)),y&&(this.animationValues=c,Iu(c,u,this.latestValues,g,C,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},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&&(Ne(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ne.update(()=>{Qt.hasAnimatedSinceResize=!0,Pt.layout++,this.currentAnimation=Vu(0,go,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},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(go),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Eo(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ue();const f=xe(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=xe(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Pe(a,l),lt(a,c),Dt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zu),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(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:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&ur("z",o,u,this.animationValues);for(let c=0;c<cr.length;c++)ur(`rotate${cr[c]}`,o,u,this.animationValues),ur(`skew${cr[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Ku;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=zt(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;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=zt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!He(this.latestValues)&&(y.transform=c?c({},""):"none",this.hasProjected=!1),y}const h=f.animationValues||f.latestValues;this.applyTransformsToTarget(),u.transform=Yu(this.projectionDeltaWithTransform,this.treeScale,h),c&&(u.transform=c(h,u.transform));const{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,f.animationValues?u.opacity=f===this?(l=(a=h.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:u.opacity=f===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in mt){if(h[y]===void 0)continue;const{correct:w,applyTo:b,isCSSVariable:C}=mt[y],P=u.transform==="none"?h[y]:w(h[y],f);if(b){const L=b.length;for(let g=0;g<L;g++)u[b[g]]=P}else C?this.options.visualElement.renderState.vars[y]=P:u[y]=P}return this.options.layoutId&&(u.pointerEvents=f===this?zt(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(xo),this.root.sharedNodes.clear()}}}function qu(e){e.updateLayout()}function Gu(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"?Ce(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(h);h.min=r[f].min,h.max=h.min+m}):Eo(i,n.layoutBox,r)&&Ce(f=>{const h=o?n.measuredBox[f]:n.layoutBox[f],m=xe(r[f]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+m)});const a=ot();Dt(a,r,n.layoutBox);const l=ot();o?Dt(l,e.applyTransform(s,!0),n.measuredBox):Dt(l,r,n.layoutBox);const u=!co(a);let c=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:m}=f;if(h&&m){const v=ue();Vt(v,n.layoutBox,h.layoutBox);const y=ue();Vt(y,r,m.layoutBox),ho(v,y)||(c=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=v,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Xu(e){Ie.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 Zu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ju(e){e.clearSnapshot()}function xo(e){e.clearMeasurements()}function Qu(e){e.isLayoutDirty=!1}function ef(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tf(e){e.resolveTargetDelta()}function nf(e){e.calcProjection()}function rf(e){e.resetSkewAndRotation()}function sf(e){e.removeLeadSnapshot()}function wo(e,t,n){e.translate=re(t.translate,0,n),e.scale=re(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function To(e,t,n,r){e.min=re(t.min,n.min,r),e.max=re(t.max,n.max,r)}function of(e,t,n,r){To(e.x,t.x,n.x,r),To(e.y,t.y,n.y,r)}function af(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lf={duration:.45,ease:[.4,0,.1,1]},So=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Co=So("applewebkit/")&&!So("chrome/")?Math.round:Te;function Po(e){e.min=Co(e.min),e.max=Co(e.max)}function cf(e){Po(e.x),Po(e.y)}function Eo(e,t,n){return e==="position"||e==="preserve-aspect"&&!uu(po(t),po(n),.2)}function uf(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const ff=vo({attachResizeListener:(e,t)=>At(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),fr={current:void 0},jo=vo({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!fr.current){const e=new ff({});e.mount(window),e.setOptions({layoutScroll:!0}),fr.current=e}return fr.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>Boolean(window.getComputedStyle(e).position==="fixed")}),df={pan:{Feature:ju},drag:{Feature:Eu,ProjectionNode:jo,MeasureLayout:Zi}};function Ao(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&&ne.postRender(()=>i(t,Mt(t)))}class hf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=ul(t,(n,r)=>(Ao(this.node,r,"Start"),s=>Ao(this.node,s,"End"))))}unmount(){}}class pf extends $e{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=Et(At(this.node.current,"focus",()=>this.onFocus()),At(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Mo(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&&ne.postRender(()=>i(t,Mt(t)))}class mf extends $e{mount(){const{current:t}=this.node;t&&(this.unmount=pl(t,(n,r)=>(Mo(this.node,r,"Start"),(s,{success:i})=>Mo(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dr=new WeakMap,hr=new WeakMap,gf=e=>{const t=dr.get(e.target);t&&t(e)},yf=e=>{e.forEach(gf)};function vf({root:e,...t}){const n=e||document;hr.has(n)||hr.set(n,{});const r=hr.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(yf,{root:e,...t})),r[s]}function xf(e,t,n){const r=vf(t);return dr.set(e,n),r.observe(e),()=>{dr.delete(e),r.unobserve(e)}}const bf={some:0,all:1};class wf extends $e{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:bf[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:f}=this.node.getProps(),h=u?c:f;h&&h(l)};return xf(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Tf(t,n))&&this.startObserver()}unmount(){}}function Tf({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Sf={inView:{Feature:wf},tap:{Feature:mf},focus:{Feature:pf},hover:{Feature:hf}},Cf={layout:{ProjectionNode:jo,MeasureLayout:Zi}},pr={current:null},Do={current:!1};function Pf(){if(Do.current=!0,!!ln)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>pr.current=e.matches;e.addListener(t),t()}else pr.current=!1}const Ef=[...ri,ve,Be],jf=e=>Ef.find(ni(e)),Af=new WeakMap;function Mf(e,t,n){for(const r in t){const s=t[r],i=n[r];if(ye(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(ye(i))e.addValue(r,wt(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,wt(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Vo=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Df{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Hn,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Ve.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ne.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=o;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Ut(n),this.isVariantNode=Zr(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 v=h[m];l[m]!==void 0&&ye(v)&&v.set(l[m],!1)}}mount(t){this.current=t,Af.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)),Do.current||Pf(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pr.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(),Ne(this.notifyUpdate),Ne(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=We.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&ne.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 Qe){const n=Qe[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):ue()}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<Vo.length;r++){const s=Vo[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=Mf(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=wt(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"&&(ei(s)||$s(s))?s=parseFloat(s):!jf(s)&&Be.test(n)&&(s=qs(t,n)),this.setBaseTarget(t,ye(s)?s.get():s)),ye(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=Sn(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&&!ye(i)?i:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kn),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Ro extends Df{constructor(){super(...arguments),this.KeyframeResolver=ii}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;ye(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Vf(e){return window.getComputedStyle(e)}class Rf extends Ro{constructor(){super(...arguments),this.type="html",this.renderInstance=hs}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}else{const r=Vf(t),s=(mn(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Bi(t,n)}build(t,n,r){vn(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Pn(t,n,r)}}class Of extends Ro{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ue,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&ds(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(We.has(n)){const r=zn(n);return r&&r.default||0}return n=ps.has(n)?n:hn(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return gs(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&ne.postRender(this.updateDimensions)}build(t,n,r){wn(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){ms(t,n,r,s)}mount(t){this.isSVGTag=Tn(t.tagName),super.mount(t)}}const Lf=(e,t)=>bn(e)?new Of(t):new Rf(t,{allowProjection:e!==x.Fragment}),kf=rl({...nu,...Sf,...df,...Cf},Lf),mr=ba(kf),_f=({isOpen:e,onClose:t,onConfirm:n,header:r,question:s})=>e?p.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:p.exports.jsx("div",{className:"relative p-4 w-full max-w-2xl max-h-full",children:p.exports.jsxs("div",{className:"relative bg-white rounded-lg shadow-sm dark:bg-gray-700",children:[p.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:[p.exports.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-white",children:[r," "]}),p.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:[p.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:p.exports.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"})}),p.exports.jsx("span",{className:"sr-only",children:"Close modal"})]})]}),p.exports.jsx("div",{className:"p-4 md:p-5 space-y-4",children:p.exports.jsxs("p",{className:"text-base leading-relaxed text-gray-500 dark:text-gray-400",children:[s," "]})}),p.exports.jsxs("div",{className:"flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600",children:[p.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 "}),p.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,If=({items:e,isVisible:t,position:n,messageId:r,isCurrentUserMessage:s})=>{const i=x.useRef(null),[o,a]=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)),a(!0),()=>{i.current&&!t&&(document.body.removeChild(i.current),i.current=null)}),[t]),!i.current||!o?null:Ue.createPortal(p.exports.jsx(zr,{children:t&&p.exports.jsx(mr.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((l,u)=>l!=null&&l.onlyCurrentUserMessage&&!s?null:p.exports.jsxs("button",{disabled:l==null?void 0:l.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:()=>l.onClick(r),children:[x.cloneElement(l.icon,{className:"text-black",size:18}),p.exports.jsx("span",{className:"ml-2 text-black",children:l.name})]},u))})}),i.current)},Nf=(e,t)=>{if(!t.current)return 0;const n=window.getComputedStyle(t.current),r=parseInt(n.lineHeight,10)||20;return Math.ceil(t.current.scrollHeight/r)-1},Ff=e=>{const t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},Bf=()=>p.exports.jsx("svg",{width:"21",height:"22",viewBox:"0 0 21 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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=()=>p.exports.jsx("svg",{width:"14",height:"20",viewBox:"0 0 14 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),gr=()=>p.exports.jsx("svg",{width:"17",height:"17",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:p.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"})}),en=e=>p.exports.jsx("svg",{width:"17px",height:"22px",viewBox:"0 0 9 20",...e,children:p.exports.jsxs("g",{fill:"none",children:[p.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"}),p.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"}),p.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"}),p.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"})]})}),Uf=({onSendMessage:e,onEditMessage:t,onSendVoice:n,onImageSend:r,onVideoSend:s,onFileSend:i,dynamicSymbolAssignments:o,messageToEdit:a,setMessageToEdit:l})=>{const[u,c]=x.useState(""),[f,h]=x.useState(!1),[m,v]=x.useState(0),[y,w]=x.useState(null),[b,C]=x.useState(null),[P,L]=x.useState(0),g=x.useRef(null),O=x.useRef([]),Y=x.useRef(null),R=x.useRef(null),Q=x.useRef(null),[F,I]=x.useState(!1),oe=150,ee=41.6;x.useEffect(()=>{const D=document.getElementById("static-display");D&&!D.textContent&&(a!=null&&a.text)&&(D.textContent=a==null?void 0:a.text)},[a==null?void 0:a.text]);const ae=D=>{const E=D.target.value;a?l(k=>k?new Xe({...k,text:E,isEdited:!0}):void 0):c(E);const A=E.match(/(\S+)$/);if(Se(A),console.log("numberOfLineBreaks",Nf(E,R)),R.current){const k=R.current.scrollHeight,B=Math.ceil(R.current.scrollHeight/k)-1;console.log(B),k>ee?k>oe?(R.current.style.height=`${oe}px`,R.current.style.overflowY="auto"):(R.current.style.height=`${k}px`,R.current.style.overflowY="hidden"):(console.log("buy"),R.current.style.height=`${ee}px`,R.current.style.overflowY="hidden")}},Se=D=>{if(D){const E=D[0];if(y){const A=D[0].split(y)[1];C(A)}o!=null&&o.some(A=>A.symbol===E)&&w(E)}else w(null),C(null)},pe=(D,E)=>{a?l(A=>A?new Xe({...A,text:A.text+E+" "}):void 0):c(A=>A+E+" "),w(null),C(null),R.current.focus()},q=()=>{if(a){if(a.text.trim()==="")return;t(a),l(void 0)}else{if(u.trim()==="")return;e(u),c("")}w(null),C(null),R.current&&(R.current.style.height=`${ee}px`)},le=async()=>{h(!0),v(0),O.current=[],Y.current=setInterval(()=>{v(A=>A+1)},1e3);const D=await navigator.mediaDevices.getUserMedia({audio:!0}),E=new MediaRecorder(D);g.current=E,E.ondataavailable=A=>{A.data.size>0&&O.current.push(A.data)},E.onstop=()=>{clearInterval(Y.current);const A=new Blob(O.current,{type:"audio/mp3"});n(A),h(!1)},E.start()},K=()=>{var D;(D=g.current)==null||D.stop()},T=D=>{const{scrollTop:E,scrollHeight:A,clientHeight:k}=D.currentTarget;if(E>P){if(E+k>=A-1){const _=o==null?void 0:o.find(ce=>ce.symbol===y);_&&(_!=null&&_.updatePageNumber)&&(I(!0),_==null||_.updatePageNumber(_.pagNumber+1),L(E),setTimeout(()=>{I(!1)},500))}}else L(E)},V=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"]),W=()=>{var D;(D=Q.current)==null||D.click()},$=D=>{var k,B;const E=(k=D.target.files)==null?void 0:k[0];if(!E)return;let A="";if(E.type){const _=E.type.split("/");_.length===2&&(A=_[1])}A||(A=((B=E.name.split(".").pop())==null?void 0:B.toLowerCase())||""),V.has(A)?r(E):z.has(A)?s(E):i(E)};return p.exports.jsxs("div",{className:"absolute bottom-0 w-full flex items-center p-2 pr-4 z-10",children:[f?p.exports.jsxs("div",{className:"w-full flex justify-between items-center bg-white p-2 pl-4 h-11 rounded-3xl ",children:[p.exports.jsx("span",{className:"text-blue-400 font-bold flex-1",children:Ff(m)}),p.exports.jsx("button",{className:"cursor-pointer p-2 flex justify-center items-center bg-green-500 text-white rounded-full",onClick:K,children:p.exports.jsx(gr,{})})]}):a?p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] relative h-10",children:[p.exports.jsxs("div",{className:" h-12 absolute bottom-10 w-full flex justify-between items-center px-2 border-t border-x border-gray-300 bg-white rounded-t-lg ",children:[p.exports.jsx("span",{id:"static-display",className:"text-gray-400 whitespace-nowrap truncate"}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700 -mt-4",onClick:()=>l(void 0),children:"✕"})]}),p.exports.jsx("textarea",{className:"w-full resize-none h-[41.6px] absolute bottom-0 bg-white flex-1 p-2 pl-4 border border-gray-300 outline-none rounded-bl-3xl ",placeholder:"Type a message...",value:a.text,onChange:ae,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),q())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.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:q,children:p.exports.jsx(gr,{})})]}):p.exports.jsxs(p.exports.Fragment,{children:[p.exports.jsxs("div",{className:"w-[90%] h-10 relative ",children:[p.exports.jsx("div",{onClick:W,className:"cursor-pointer z-10 absolute right-4 top-[11px]",children:p.exports.jsx(Bf,{})}),p.exports.jsx("input",{type:"file",ref:Q,style:{display:"none"},onChange:$}),p.exports.jsx("textarea",{ref:R,className:"w-full absolute bottom-0 resize-none bg-white flex-1 p-2 pr-10 pl-4 border border-gray-300 outline-none rounded-tl-3xl rounded-tr-2xl rounded-bl-3xl ",style:{height:ee},placeholder:"Type a message...",value:u,onChange:ae,onKeyDown:D=>{D.key==="Enter"&&!D.shiftKey&&(D.preventDefault(),q())}}),p.exports.jsx(en,{className:"rotate-180 absolute -right-[11.4px] top-[18.4px]"})]}),p.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:u?q:le,children:u?p.exports.jsx(gr,{}):p.exports.jsx($f,{})})]}),y&&p.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:T,children:[p.exports.jsxs("div",{className:"flex justify-between items-center border-b pb-2 mb-2",children:[p.exports.jsxs("h3",{className:"text-lg font-semibold text-gray-800",children:["Select an item for"," ",p.exports.jsx("span",{className:"text-blue-500",children:y})]}),p.exports.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:()=>w(null),children:"✕"})]}),p.exports.jsxs("div",{className:"space-y-2",children:[o?o.filter(D=>D.symbol===y).map(D=>{var k;const{component:E,lists:A}=D;return E?b?(k=A==null?void 0:A.filter(B=>B==null?void 0:B.name.includes(b)))==null?void 0:k.map((B,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:B,onClick:(ce,j)=>pe(ce,j)})},_)):A==null?void 0:A.map((B,_)=>p.exports.jsx("div",{className:"hover:bg-gray-100 rounded-md p-2 cursor-pointer",children:p.exports.jsx(E,{listsProps:B,onClick:(ce,j)=>pe(ce,j)})},_)):null}):null,p.exports.jsx("div",{className:"h-8",children:F&&"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||{}),ie=(e=>(e[e.Telegram=0]="Telegram",e[e.Simple=1]="Simple",e))(ie||{});const yr=({progress:e,size:t=100,strokeWidth:n=10,circleColor:r="#e0e0e0",progressColor:s="#3b82f6",animationDuration:i=1e3,showCancel:o=!1,onCancelClick:a,className:l})=>{const[u,c]=x.useState(0),f=(t-n)/2,h=2*Math.PI*f,m=h-u/100*h;return x.useEffect(()=>{const v=Date.now(),y=v+i,w=()=>{const b=Date.now(),P=Math.min(1,(b-v)/i)*e;c(P),b<y?requestAnimationFrame(w):c(e)};requestAnimationFrame(w)},[e,i]),p.exports.jsxs("div",{className:`relative flex items-center justify-center ${l}`,style:{width:t,height:t},children:[p.exports.jsxs("svg",{className:"absolute animate-[spin_2s_ease-in-out_infinite] ",width:t,height:t,children:[p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:r,strokeWidth:n}),p.exports.jsx("circle",{cx:t/2,cy:t/2,r:f,fill:"transparent",stroke:s,strokeWidth:n,strokeDasharray:h,strokeDashoffset:m,strokeLinecap:"round",transform:`rotate(-90 ${t/2} ${t/2})`,className:"transition-all ease-linear duration-1000"})]}),o?p.exports.jsx("button",{onClick:a,className:"absolute flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Cancel",children:p.exports.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:s,children:p.exports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}):p.exports.jsxs("span",{className:"absolute text-lg font-bold",style:{color:s},children:[Math.round(u),"%"]})]})},Oo=({fileName:e,fileSize:t,format:n,src:r,them:s,uploadProgres:i,onCancelClick:o})=>{const a=()=>{const u={rar:p.exports.jsx("p",{className:"p-2 text-green-500 font-bold",children:n}),zip:p.exports.jsx("p",{className:"p-2 text-blue-500 font-bold",children:n}),pdf:p.exports.jsx("p",{className:"p-2 text-red-500 font-bold",children:n}),doc:p.exports.jsx("p",{className:"p-2 text-blue-400 font-bold",children:n}),vid:p.exports.jsx("p",{className:"p-2 text-orange-400 font-bold",children:n}),txt:p.exports.jsx("p",{className:"p-2 text-purple-500 font-bold",children:n}),xls:p.exports.jsx("p",{className:"p-2 text-green-400 font-bold",children:n}),ppt:p.exports.jsx("p",{className:"p-2 text-yellow-500 font-bold",children:n}),png:p.exports.jsx("p",{className:"p-2 text-pink-500 font-bold",children:n}),jpg:p.exports.jsx("p",{className:"p-2 text-indigo-500 font-bold",children:n}),mp3:p.exports.jsx("p",{className:"p-2 text-teal-500 font-bold",children:n}),mp4:p.exports.jsx("p",{className:"p-2 text-gray-500 font-bold",children:n}),exe:p.exports.jsx("p",{className:"p-2 text-red-400 font-bold",children:n}),html:p.exports.jsx("p",{className:"p-2 text-orange-500 font-bold",children:n}),css:p.exports.jsx("p",{className:"p-2 text-blue-300 font-bold",children:n}),js:p.exports.jsx("p",{className:"p-2 text-yellow-400 font-bold",children:n}),json:p.exports.jsx("p",{className:"p-2 text-purple-400 font-bold",children:n}),xml:p.exports.jsx("p",{className:"p-2 text-green-300 font-bold",children:n}),svg:p.exports.jsx("p",{className:"p-2 text-pink-400 font-bold",children:n}),gif:p.exports.jsx("p",{className:"p-2 text-indigo-400 font-bold",children:n}),csv:p.exports.jsx("p",{className:"p-2 text-teal-400 font-bold",children:n}),sql:p.exports.jsx("p",{className:"p-2 text-gray-400 font-bold",children:n})};return n&&u[n]?u[n]:p.exports.jsx("p",{className:"p-2 text-black ",children:n??"UN"})},l=u=>u>1048576?(u/1048576).toFixed(1)+" MB":(u/1024).toFixed(1)+" KB";return p.exports.jsxs("div",{className:"flex items-center rounded-lg",children:[i?p.exports.jsx("div",{className:" w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(yr,{progress:(i==null?void 0:i.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:o,circleColor:"#ddd",progressColor:"#4caf50"})}):p.exports.jsx("div",{className:` border ${s===ie.Simple?" border-white ":s===ie.Telegram?" border-green-900":""} w-14 h-14 mr-3 flex items-center justify-center relative rounded-md p-3`,children:a()}),p.exports.jsxs("div",{className:"flex flex-col flex-grow",children:[p.exports.jsx("a",{href:r,download:e,className:`${s===ie.Simple?"text-white":s===ie.Telegram?"text-gray-900":""} font-medium hover:underline`,children:e}),p.exports.jsx("span",{className:`${s===ie.Simple?"text-gray-800":s===ie.Telegram?"text-gray-900":""} text-sm`,children:l(t)})]}),p.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"})]})},Wf=e=>p.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:p.exports.jsx("polygon",{points:"6 3 20 12 6 21 6 3"})}),zf=e=>p.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:[p.exports.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"}),p.exports.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"})]});let Ot=null;const Yf=({src:e,className:t,uploadProgres:n,onCancelClick:r})=>{const[s,i]=x.useState(!1),[o,a]=x.useState(0),l=x.useRef(null);x.useEffect(()=>{const c=l.current;if(!c)return;const f=()=>{a(c.currentTime/c.duration*100)},h=()=>i(!0),m=()=>i(!1),v=()=>{i(!1),a(0)};return c.addEventListener("timeupdate",f),c.addEventListener("play",h),c.addEventListener("pause",m),c.addEventListener("ended",v),()=>{c.removeEventListener("timeupdate",f),c.removeEventListener("play",h),c.removeEventListener("pause",m),c.removeEventListener("ended",v)}},[]);const u=()=>{const c=l.current;c&&(s?c.pause():(Ot&&Ot!==c&&(Ot.pause(),Ot.currentTime=0),c.play(),Ot=c))};return p.exports.jsxs("div",{className:`flex items-center gap-2 py-2 pl-1 text-white rounded-xl w-full max-w-sm ${t}`,children:[n?p.exports.jsx("div",{className:" w-9 h-9 mr-3 flex items-center justify-center relative rounded-md p-3",children:p.exports.jsx(yr,{progress:(n==null?void 0:n.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:r,circleColor:"#ddd",progressColor:"#4caf50"})}):p.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:u,children:s?p.exports.jsx(zf,{}):p.exports.jsx(Wf,{})}),p.exports.jsx("div",{className:"relative flex-1 h-2 bg-gray-700 rounded-full overflow-hidden",children:p.exports.jsx("div",{className:"h-full bg-blue-500 transition-all",style:{width:`${o}%`}})}),p.exports.jsx("audio",{ref:l,src:e})]})},Kf=({attachmentUrl:e,attachmentType:t,attachmentFormat:n,them:r,uploadProgres:s,cancellationToken:i})=>e?t===Re.Voice?p.exports.jsx("div",{className:"w-full",children:p.exports.jsx(Yf,{onCancelClick:i,uploadProgres:s,src:e})}):t===Re.Image?p.exports.jsxs("div",{className:"relative w-full",children:[s?p.exports.jsx(yr,{progress:(s==null?void 0:s.progres)??0,size:50,strokeWidth:4,showCancel:!0,onCancelClick:i,circleColor:"#ddd",progressColor:"#286b2a",className:"!absolute z-[1] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"}):null,p.exports.jsx("img",{className:`transition-all ${s?"filter blur-lg":" blur-none"}`,src:e})]}):t===Re.File?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Oo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e,uploadProgres:s,onCancelClick:i})}):t===Re.Video?p.exports.jsx("div",{className:"w-full mt-1",children:p.exports.jsx(Oo,{fileName:"productivity",fileSize:23e3,format:n??"UN",src:e,uploadProgres:s,onCancelClick:i})}):null:null,Hf=({message:e,showUserProfile:t,handleContextMenu:n,media:r,them:s,maxWidth:i})=>{var o,a,l,u,c,f,h,m,v,y;return p.exports.jsxs(p.exports.Fragment,{children:[t?p.exports.jsx("img",{src:e.user.profileImageUrl,className:"w-12 h-12 bg-gray-300 rounded-full"}):null,p.exports.jsxs(mr.div,{initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:w=>n(w,e),className:`relative ${r?"w-3/4":i?"max-w-[400px] w-fit":"max-w-[75%] w-fit"} flex flex-col gap-1 break-words p-2 pt-5 rounded-lg ${s===ie.Simple?"bg-[#f8fbff]":s===ie.Telegram?"bg-blue-200 ":""} `,children:[p.exports.jsx("span",{title:(o=e.user)!=null&&o.fullName&&((l=(a=e.user)==null?void 0:a.fullName)==null?void 0:l.length)>16?(u=e.user)==null?void 0:u.firstName:(c=e.user)==null?void 0:c.fullName,className:"relative -top-3 h-4 -mb-3 overflow-y-visible text-xs text-orange-700 whitespace-nowrap truncate max-w-[100px] overflow-visible",children:(f=e.user)!=null&&f.fullName&&((m=(h=e.user)==null?void 0:h.fullName)==null?void 0:m.length)>16?(v=e.user)==null?void 0:v.firstName:(y=e.user)==null?void 0:y.fullName}),r||null,p.exports.jsx("span",{children:e.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(e.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(e.createdDate).toLocaleTimeString().split(":")[1]}),e.isEdited?p.exports.jsx("span",{className:`text-xs italic ${s===ie.Simple?"text-gray-700":s===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:` ${s===ie.Simple?"[&>g>path]:fill-[#f8fbff]":s===ie.Telegram?"[&>g>path]:fill-blue-200":""} -rotate-180 scale-x-[-1] transition-discrete absolute -left-2 bottom-0 `})]})]})},qf=({className:e})=>p.exports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[p.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"}),p.exports.jsx("path",{fillRule:"evenodd",clipRule:"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"})]}),Lo=({size:e=24,color:t="text-current",className:n})=>p.exports.jsx("div",{className:` ${n} animate-spin inline-flex items-center justify-center`,children:p.exports.jsxs("svg",{width:e,height:e,viewBox:"0 0 36 36",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[p.exports.jsx("defs",{children:p.exports.jsxs("linearGradient",{x1:"0%",y1:"100%",x2:"100%",y2:"100%",id:"linearGradient-1",children:[p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0",offset:"0%"}),p.exports.jsx("stop",{stopColor:"currentColor",stopOpacity:"0.50",offset:"39.9430698%"}),p.exports.jsx("stop",{stopColor:"currentColor",offset:"100%"})]})}),p.exports.jsxs("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:[p.exports.jsx("rect",{fillOpacity:"0.01",fill:"none",x:"0",y:"0",width:"36",height:"36"}),p.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"})]})]})}),Gf=({handleContextMenu:e,media:t,message:n,them:r,maxWidth:s})=>p.exports.jsxs(mr.div,{style:{background:"red !important"},initial:{opacity:0,y:50},animate:{opacity:1,y:0},exit:{opacity:0,y:50},transition:{duration:.3},onContextMenu:i=>e(i,n),className:`relative self-end ${t?"w-3/4":s?" max-w-[400px]":"max-w-[75%]"} flex flex-col justify-center break-words p-2 rounded-lg ${r===ie.Telegram?" bg-green-200":ie.Simple?" bg-[#4F46E5] text-white":""}`,children:[t||null,p.exports.jsx("span",{className:"",children:n.text}),p.exports.jsxs("div",{className:"w-full flex gap-1 items-center justify-end",children:[p.exports.jsx("span",{className:"text-[10px]",children:new Date(n.createdDate).toLocaleTimeString().split(":")[0]+":"+new Date(n.createdDate).toLocaleTimeString().split(":")[1]}),n.isSending?p.exports.jsx(Lo,{size:13,color:"text-black"}):p.exports.jsx(qf,{className:r===ie.Telegram?" ":ie.Simple?" [&>path]:fill-white":""}),n.isEdited?p.exports.jsx("span",{className:`text-xs italic ${r===ie.Simple?"text-gray-200":r===ie.Telegram?"text-gray-600 ":""}`,children:"edited"}):""]}),p.exports.jsx(en,{className:`fill-blue-200 rotate-180 absolute -right-2 bottom-0 ${r===ie.Telegram?"[&>g>path]:fill-green-200":ie.Simple?"[&>g>path]:fill-[#4F46E5]":""} `})]});var me={exports:{}},vr={exports:{}},Z={};var ko;function Xf(){if(ko)return Z;ko=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,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=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,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(g){if(typeof g=="object"&&g!==null){var O=g.$$typeof;switch(O){case t:switch(g=g.type,g){case l:case u:case r:case i:case s:case f:return g;default:switch(g=g&&g.$$typeof,g){case a:case c:case v:case m:case o:return g;default:return O}}case n:return O}}}function L(g){return P(g)===u}return Z.AsyncMode=l,Z.ConcurrentMode=u,Z.ContextConsumer=a,Z.ContextProvider=o,Z.Element=t,Z.ForwardRef=c,Z.Fragment=r,Z.Lazy=v,Z.Memo=m,Z.Portal=n,Z.Profiler=i,Z.StrictMode=s,Z.Suspense=f,Z.isAsyncMode=function(g){return L(g)||P(g)===l},Z.isConcurrentMode=L,Z.isContextConsumer=function(g){return P(g)===a},Z.isContextProvider=function(g){return P(g)===o},Z.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===t},Z.isForwardRef=function(g){return P(g)===c},Z.isFragment=function(g){return P(g)===r},Z.isLazy=function(g){return P(g)===v},Z.isMemo=function(g){return P(g)===m},Z.isPortal=function(g){return P(g)===n},Z.isProfiler=function(g){return P(g)===i},Z.isStrictMode=function(g){return P(g)===s},Z.isSuspense=function(g){return P(g)===f},Z.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===u||g===i||g===s||g===f||g===h||typeof g=="object"&&g!==null&&(g.$$typeof===v||g.$$typeof===m||g.$$typeof===o||g.$$typeof===a||g.$$typeof===c||g.$$typeof===w||g.$$typeof===b||g.$$typeof===C||g.$$typeof===y)},Z.typeOf=P,Z}var J={};var _o;function Zf(){return _o||(_o=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,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=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,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,w=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function P(j){return typeof j=="string"||typeof j=="function"||j===r||j===u||j===i||j===s||j===f||j===h||typeof j=="object"&&j!==null&&(j.$$typeof===v||j.$$typeof===m||j.$$typeof===o||j.$$typeof===a||j.$$typeof===c||j.$$typeof===w||j.$$typeof===b||j.$$typeof===C||j.$$typeof===y)}function L(j){if(typeof j=="object"&&j!==null){var Ee=j.$$typeof;switch(Ee){case t:var ct=j.type;switch(ct){case l:case u:case r:case i:case s:case f:return ct;default:var Ge=ct&&ct.$$typeof;switch(Ge){case a:case c:case v:case m:case o:return Ge;default:return Ee}}case n:return Ee}}}var g=l,O=u,Y=a,R=o,Q=t,F=c,I=r,oe=v,ee=m,ae=n,Se=i,pe=s,q=f,le=!1;function K(j){return le||(le=!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)||L(j)===l}function T(j){return L(j)===u}function V(j){return L(j)===a}function z(j){return L(j)===o}function W(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function $(j){return L(j)===c}function D(j){return L(j)===r}function E(j){return L(j)===v}function A(j){return L(j)===m}function k(j){return L(j)===n}function B(j){return L(j)===i}function _(j){return L(j)===s}function ce(j){return L(j)===f}J.AsyncMode=g,J.ConcurrentMode=O,J.ContextConsumer=Y,J.ContextProvider=R,J.Element=Q,J.ForwardRef=F,J.Fragment=I,J.Lazy=oe,J.Memo=ee,J.Portal=ae,J.Profiler=Se,J.StrictMode=pe,J.Suspense=q,J.isAsyncMode=K,J.isConcurrentMode=T,J.isContextConsumer=V,J.isContextProvider=z,J.isElement=W,J.isForwardRef=$,J.isFragment=D,J.isLazy=E,J.isMemo=A,J.isPortal=k,J.isProfiler=B,J.isStrictMode=_,J.isSuspense=ce,J.isValidElementType=P,J.typeOf=L}()),J}var Io;function No(){return Io||(Io=1,function(e){process.env.NODE_ENV==="production"?e.exports=Xf():e.exports=Zf()}(vr)),vr.exports}var xr,Fo;function Jf(){if(Fo)return xr;Fo=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={},a=0;a<10;a++)o["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(o).map(function(c){return o[c]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(c){u[c]=c}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return xr=s()?Object.assign:function(i,o){for(var a,l=r(i),u,c=1;c<arguments.length;c++){a=Object(arguments[c]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},xr}var br,Bo;function wr(){if(Bo)return br;Bo=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return br=e,br}var Tr,$o;function Uo(){return $o||($o=1,Tr=Function.call.bind(Object.prototype.hasOwnProperty)),Tr}var Sr,Wo;function Qf(){if(Wo)return Sr;Wo=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=wr(),n={},r=Uo();e=function(i){var o="Warning: "+i;typeof console<"u"&&console.error(o);try{throw new Error(o)}catch{}}}function s(i,o,a,l,u){if(process.env.NODE_ENV!=="production"){for(var c in i)if(r(i,c)){var f;try{if(typeof i[c]!="function"){var h=Error((l||"React class")+": "+a+" type `"+c+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[c]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[c](o,c,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+c+"` 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=u?u():"";e("Failed "+a+" type: "+f.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Sr=s,Sr}var Cr,zo;function ed(){if(zo)return Cr;zo=1;var e=No(),t=Jf(),n=wr(),r=Uo(),s=Qf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function o(){return null}return Cr=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,c="@@iterator";function f(T){var V=T&&(u&&T[u]||T[c]);if(typeof V=="function")return V}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:C(),arrayOf:P,element:L(),elementType:g(),instanceOf:O,node:F(),objectOf:R,oneOf:Y,oneOfType:Q,shape:oe,exact:ee};function v(T,V){return T===V?T!==0||1/T===1/V:T!==T&&V!==V}function y(T,V){this.message=T,this.data=V&&typeof V=="object"?V:{},this.stack=""}y.prototype=Error.prototype;function w(T){if(process.env.NODE_ENV!=="production")var V={},z=0;function W(D,E,A,k,B,_,ce){if(k=k||h,_=_||A,ce!==n){if(l){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 Ee=k+":"+A;!V[Ee]&&z<3&&(i("You are manually calling a React.PropTypes validation function for the `"+_+"` prop on `"+k+"`. 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."),V[Ee]=!0,z++)}}return E[A]==null?D?E[A]===null?new y("The "+B+" `"+_+"` is marked as required "+("in `"+k+"`, but its value is `null`.")):new y("The "+B+" `"+_+"` is marked as required in "+("`"+k+"`, but its value is `undefined`.")):null:T(E,A,k,B,_)}var $=W.bind(null,!1);return $.isRequired=W.bind(null,!0),$}function b(T){function V(z,W,$,D,E,A){var k=z[W],B=pe(k);if(B!==T){var _=q(k);return new y("Invalid "+D+" `"+E+"` of type "+("`"+_+"` supplied to `"+$+"`, expected ")+("`"+T+"`."),{expectedType:T})}return null}return w(V)}function C(){return w(o)}function P(T){function V(z,W,$,D,E){if(typeof T!="function")return new y("Property `"+E+"` of component `"+$+"` has invalid PropType notation inside arrayOf.");var A=z[W];if(!Array.isArray(A)){var k=pe(A);return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an array."))}for(var B=0;B<A.length;B++){var _=T(A,B,$,D,E+"["+B+"]",n);if(_ instanceof Error)return _}return null}return w(V)}function L(){function T(V,z,W,$,D){var E=V[z];if(!a(E)){var A=pe(E);return new y("Invalid "+$+" `"+D+"` of type "+("`"+A+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return w(T)}function g(){function T(V,z,W,$,D){var E=V[z];if(!e.isValidElementType(E)){var A=pe(E);return new y("Invalid "+$+" `"+D+"` of type "+("`"+A+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return w(T)}function O(T){function V(z,W,$,D,E){if(!(z[W]instanceof T)){var A=T.name||h,k=K(z[W]);return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected ")+("instance of `"+A+"`."))}return null}return w(V)}function Y(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 V(z,W,$,D,E){for(var A=z[W],k=0;k<T.length;k++)if(v(A,T[k]))return null;var B=JSON.stringify(T,function(ce,j){var Ee=q(j);return Ee==="symbol"?String(j):j});return new y("Invalid "+D+" `"+E+"` of value `"+String(A)+"` "+("supplied to `"+$+"`, expected one of "+B+"."))}return w(V)}function R(T){function V(z,W,$,D,E){if(typeof T!="function")return new y("Property `"+E+"` of component `"+$+"` has invalid PropType notation inside objectOf.");var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type "+("`"+k+"` supplied to `"+$+"`, expected an object."));for(var B in A)if(r(A,B)){var _=T(A,B,$,D,E+"."+B,n);if(_ instanceof Error)return _}return null}return w(V)}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 V=0;V<T.length;V++){var z=T[V];if(typeof z!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+le(z)+" at index "+V+"."),o}function W($,D,E,A,k){for(var B=[],_=0;_<T.length;_++){var ce=T[_],j=ce($,D,E,A,k,n);if(j==null)return null;j.data&&r(j.data,"expectedType")&&B.push(j.data.expectedType)}var Ee=B.length>0?", expected one of type ["+B.join(", ")+"]":"";return new y("Invalid "+A+" `"+k+"` supplied to "+("`"+E+"`"+Ee+"."))}return w(W)}function F(){function T(V,z,W,$,D){return ae(V[z])?null:new y("Invalid "+$+" `"+D+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return w(T)}function I(T,V,z,W,$){return new y((T||"React class")+": "+V+" type `"+z+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+$+"`.")}function oe(T){function V(z,W,$,D,E){var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));for(var B in T){var _=T[B];if(typeof _!="function")return I($,D,E,B,q(_));var ce=_(A,B,$,D,E+"."+B,n);if(ce)return ce}return null}return w(V)}function ee(T){function V(z,W,$,D,E){var A=z[W],k=pe(A);if(k!=="object")return new y("Invalid "+D+" `"+E+"` of type `"+k+"` "+("supplied to `"+$+"`, expected `object`."));var B=t({},z[W],T);for(var _ in B){var ce=T[_];if(r(T,_)&&typeof ce!="function")return I($,D,E,_,q(ce));if(!ce)return new y("Invalid "+D+" `"+E+"` key `"+_+"` supplied to `"+$+"`.\nBad object: "+JSON.stringify(z[W],null," ")+`
20
+ Valid keys: `+JSON.stringify(Object.keys(T),null," "));var j=ce(A,_,$,D,E+"."+_,n);if(j)return j}return null}return w(V)}function ae(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(ae);if(T===null||a(T))return!0;var V=f(T);if(V){var z=V.call(T),W;if(V!==T.entries){for(;!(W=z.next()).done;)if(!ae(W.value))return!1}else for(;!(W=z.next()).done;){var $=W.value;if($&&!ae($[1]))return!1}}else return!1;return!0;default:return!1}}function Se(T,V){return T==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function pe(T){var V=typeof T;return Array.isArray(T)?"array":T instanceof RegExp?"object":Se(V,T)?"symbol":V}function q(T){if(typeof T>"u"||T===null)return""+T;var V=pe(T);if(V==="object"){if(T instanceof Date)return"date";if(T instanceof RegExp)return"regexp"}return V}function le(T){var V=q(T);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function K(T){return!T.constructor||!T.constructor.name?h:T.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},Cr}var Pr,Yo;function td(){if(Yo)return Pr;Yo=1;var e=wr();function t(){}function n(){}return n.resetWarningCache=t,Pr=function(){function r(o,a,l,u,c,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},Pr}if(process.env.NODE_ENV!=="production"){var nd=No(),rd=!0;me.exports=ed()(nd.isElement,rd)}else me.exports=td()();function Er(){return Er=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},Er.apply(this,arguments)}function sd(e,t){if(e==null)return{};var n=id(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 id(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=sd(e,["color","size"]);return x.createElement("svg",Er({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"}))});jr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},jr.displayName="Check";const od=jr;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 ad(e,t){if(e==null)return{};var n=ld(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 ld(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 Mr=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=ad(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("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"}))});Mr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Mr.displayName="Copy";const cd=Mr;function Dr(){return Dr=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},Dr.apply(this,arguments)}function ud(e,t){if(e==null)return{};var n=fd(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 fd(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 Vr=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",Dr({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"}))});Vr.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Vr.displayName="Edit";const dd=Vr;function Rr(){return Rr=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},Rr.apply(this,arguments)}function hd(e,t){if(e==null)return{};var n=pd(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 pd(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 Or=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=hd(e,["color","size"]);return x.createElement("svg",Rr({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"}))});Or.propTypes={color:me.exports.string,size:me.exports.oneOfType([me.exports.string,me.exports.number])},Or.displayName="Trash";const md=Or,gd=({user:e,messages:t,updateMessages:n,onMessageSent:r,onEditMessage:s,isSendingDefultForNewMessage:i,isSendingDefultForEdited:o,onDeleteMessage:a})=>{const l=x.useRef(null),[u,c]=x.useState(!1),[f,h]=x.useState(null),[m,v]=x.useState(),[y,w]=x.useState(null),b=()=>{setTimeout(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},100)};x.useEffect(()=>{const F=()=>{w(null)};return window.addEventListener("scroll",F,!0),()=>{window.removeEventListener("scroll",F,!0)}},[w]);const C=(F,I)=>{F.preventDefault();const oe=window.scrollX,ee=window.scrollY;w({x:F.clientX+oe,y:F.clientY+ee,message:I})},P=()=>{w(null)},L=F=>{const I=new Xe({id:new Date().toString(),text:F,user:e,isRightSided:!0,isSending:i,createdDate:new Date().toString()});n([...t,I]),r(I),b()},g=F=>{n(t.map(I=>I.id===F.id?(F.updateIsSending(Boolean(o)),F):I)),s(F)},O=F=>{const I=URL.createObjectURL(F),oe=new Xe({id:new Date().toString(),text:"",attachmentUrl:I,attachmentType:Re.Voice,attachmentBlob:F,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,oe]),r(oe),b()},Y=(F,I)=>{const oe=URL.createObjectURL(F),ee=new Xe({id:new Date().toString(),text:"",attachmentUrl:oe,attachmentBlob:F,attachmentType:I,user:e,isRightSided:!0,createdDate:new Date().toString()});n([...t,ee]),r(ee),b()};return{handleDeleteConfirmation:()=>{f&&(a(f),h(null)),c(!1)},handleCloseContextMenu:P,contextMenuItems:[{name:"Edit",icon:p.exports.jsx(dd,{className:"text-gray-600"}),onlyCurrentUserMessage:!0,onClick:F=>{v(t.find(I=>I.id===F)),P()}},{name:"Delete",icon:p.exports.jsx(md,{className:"text-red-600"}),onlyCurrentUserMessage:!0,onClick:F=>{h(F),c(!0),P()}},{name:"Select",icon:p.exports.jsx(od,{className:"text-green-600"}),disabled:!0,onClick:()=>{console.log("Select clicked"),P()}},{name:"Copy",icon:p.exports.jsx(cd,{className:"text-blue-600"}),onClick:F=>{const I=t.find(oe=>oe.id===F);I&&navigator.clipboard.writeText(I.text),P()}}],handleSendFile:Y,handleSendVoice:O,handleSendMessage:L,handleContextMenu:C,isModalOpen:u,contextMenu:y,chatRef:l,setIsModalOpen:c,messageToEdit:m,setMessageToEdit:v,handleEditMessage:g}},yd=({width:e="400px",height:t="600px",isLoadingChat:n,className:r,style:s,messages:i,user:o,updateMessages:a,onMessageSent:l,onDeleteMessage:u,onEditMessage:c,dynamicSymbolAssignments:f,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m,backgroundImage:v,messageBubbleBiggerSize:y,uploadProgress:w,onUploadCancellationToken:b,them:C=ie.Telegram})=>{var q,le;const{handleDeleteConfirmation:P,handleCloseContextMenu:L,handleSendFile:g,handleSendVoice:O,handleSendMessage:Y,handleContextMenu:R,contextMenuItems:Q,isModalOpen:F,contextMenu:I,chatRef:oe,setIsModalOpen:ee,messageToEdit:ae,setMessageToEdit:Se,handleEditMessage:pe}=gd({user:o,messages:i,updateMessages:a,onMessageSent:l,onEditMessage:c,onDeleteMessage:u,isSendingDefultForNewMessage:h,isSendingDefultForEdited:m});return p.exports.jsxs("div",{className:`flex flex-col !bg-cover ${r}`,style:{width:e,height:t,background:"url("+v+")",...s},onClick:L,children:[p.exports.jsx("div",{ref:oe,className:`flex flex-col gap-2 flex-1 p-3 pb-16 ${I?"overflow-hidden pr-[22px]":"overflow-y-scroll"}`,children:n?p.exports.jsx(Lo,{className:"mt-3",size:27,color:"text-gray-800"}):p.exports.jsx(zr,{children:i.length>0?i.map((K,T)=>{var W,$,D;const V=K!=null&&K.attachmentUrl?p.exports.jsx(Kf,{attachmentUrl:K.attachmentUrl,attachmentType:K==null?void 0:K.attachmentType,attachmentFormat:K==null?void 0:K.attachmentFormat,uploadProgres:w==null?void 0:w.find(E=>E.messageId===K.id),cancellationToken:()=>b?b(K.id):null},T):null;if(K.isRightSided)return p.exports.jsx(Gf,{maxWidth:y,media:V,handleContextMenu:R,message:K,them:C},T);const z=(($=(W=i[T-1])==null?void 0:W.user)==null?void 0:$.id)!==((D=K==null?void 0:K.user)==null?void 0:D.id);return p.exports.jsx(Hf,{maxWidth:y,showUserProfile:z,media:V,handleContextMenu:R,message:K,them:C},T)}):null})}),p.exports.jsx(_f,{isOpen:F,onClose:()=>ee(!1),onConfirm:P,header:"Confirm Delete",question:"Are you sure you want to delete this message?"}),I&&((q=I==null?void 0:I.message)!=null&&q.id)?p.exports.jsx(If,{items:Q,isVisible:Boolean(I),messageId:String(I==null?void 0:I.message.id),isCurrentUserMessage:((le=I==null?void 0:I.message)==null?void 0:le.user.id)===o.id,position:{x:I==null?void 0:I.x,y:I==null?void 0:I.y}}):null,p.exports.jsx(Uf,{onSendVoice:O,onSendMessage:Y,onFileSend:K=>g(K,Re.File),onImageSend:K=>g(K,Re.Image),onVideoSend:K=>g(K,Re.Video),dynamicSymbolAssignments:f,messageToEdit:ae,setMessageToEdit:Se,onEditMessage:pe})]})};he.AttachmentTypeEnum=Re,he.Button=la,he.Chat=yd,he.ChatThemEntity=ie,he.MessageEntity=Xe,he.SymbolsListComponent=ca,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
21
21
  //# sourceMappingURL=index.umd.js.map