diff --git a/example/src/main.tsx b/example/src/main.tsx index 6be81be..1159980 100644 --- a/example/src/main.tsx +++ b/example/src/main.tsx @@ -8,6 +8,7 @@ ReactDOM.createRoot( ).render( {/* @ts-ignore */} - + + {/* 1258 */} ); diff --git a/example/vanilla-js/script.js b/example/vanilla-js/script.js index 0b57f90..f83e0f0 100644 --- a/example/vanilla-js/script.js +++ b/example/vanilla-js/script.js @@ -1,4 +1,4 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rr={},ed={get exports(){return rr},set exports(e){rr=e}},Il={},A={},td={get exports(){return A},set exports(e){A=e}},U={};/** +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function xa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var or={},rd={get exports(){return or},set exports(e){or=e}},jl={},A={},ld={get exports(){return A},set exports(e){A=e}},U={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Er=Symbol.for("react.element"),nd=Symbol.for("react.portal"),rd=Symbol.for("react.fragment"),ld=Symbol.for("react.strict_mode"),id=Symbol.for("react.profiler"),od=Symbol.for("react.provider"),sd=Symbol.for("react.context"),ud=Symbol.for("react.forward_ref"),ad=Symbol.for("react.suspense"),cd=Symbol.for("react.memo"),fd=Symbol.for("react.lazy"),bs=Symbol.iterator;function dd(e){return e===null||typeof e!="object"?null:(e=bs&&e[bs]||e["@@iterator"],typeof e=="function"?e:null)}var Sa={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ka=Object.assign,xa={};function Ln(e,t,n){this.props=e,this.context=t,this.refs=xa,this.updater=n||Sa}Ln.prototype.isReactComponent={};Ln.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ln.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ea(){}Ea.prototype=Ln.prototype;function Do(e,t,n){this.props=e,this.context=t,this.refs=xa,this.updater=n||Sa}var Fo=Do.prototype=new Ea;Fo.constructor=Do;ka(Fo,Ln.prototype);Fo.isPureReactComponent=!0;var eu=Array.isArray,_a=Object.prototype.hasOwnProperty,Mo={current:null},Ca={key:!0,ref:!0,__self:!0,__source:!0};function Na(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)_a.call(t,r)&&!Ca.hasOwnProperty(r)&&(l[r]=t[r]);var s=arguments.length-2;if(s===1)l.children=n;else if(1>>1,V=T[j];if(0>>1;jl(Ue,M))Xl(se,Ue)?(T[j]=se,T[X]=M,j=X):(T[j]=Ue,T[ge]=M,j=ge);else if(Xl(se,M))T[j]=se,T[X]=M,j=X;else break e}}return F}function l(T,F){var M=T.sortIndex-F.sortIndex;return M!==0?M:T.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],a=[],d=1,h=null,g=3,x=!1,w=!1,S=!1,D=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(T){for(var F=n(a);F!==null;){if(F.callback===null)r(a);else if(F.startTime<=T)r(a),F.sortIndex=F.expirationTime,t(u,F);else break;F=n(a)}}function m(T){if(S=!1,p(T),!w)if(n(u)!==null)w=!0,ie(N);else{var F=n(a);F!==null&&K(m,F.startTime-T)}}function N(T,F){w=!1,S&&(S=!1,f(L),L=-1),x=!0;var M=g;try{for(p(F),h=n(u);h!==null&&(!(h.expirationTime>F)||T&&!W());){var j=h.callback;if(typeof j=="function"){h.callback=null,g=h.priorityLevel;var V=j(h.expirationTime<=F);F=e.unstable_now(),typeof V=="function"?h.callback=V:h===n(u)&&r(u),p(F)}else r(u);h=n(u)}if(h!==null)var ze=!0;else{var ge=n(a);ge!==null&&K(m,ge.startTime-F),ze=!1}return ze}finally{h=null,g=M,x=!1}}var R=!1,P=null,L=-1,B=5,k=-1;function W(){return!(e.unstable_now()-kT||125j?(T.sortIndex=M,t(a,T),n(u)===null&&T===n(a)&&(S?(f(L),L=-1):S=!0,K(m,M-j))):(T.sortIndex=V,t(u,T),w||x||(w=!0,ie(N))),T},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(T){var F=g;return function(){var M=g;g=F;try{return T.apply(this,arguments)}finally{g=M}}}})(Ta);(function(e){e.exports=Ta})(Cd);/** + */(function(e){function t(L,D){var F=L.length;L.push(D);e:for(;0>>1,W=L[j];if(0>>1;jl(Ue,F))Yl(se,Ue)?(L[j]=se,L[Y]=F,j=Y):(L[j]=Ue,L[ge]=F,j=ge);else if(Yl(se,F))L[j]=se,L[Y]=F,j=Y;else break e}}return D}function l(L,D){var F=L.sortIndex-D.sortIndex;return F!==0?F:L.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var u=[],c=[],p=1,y=null,a=3,E=!1,v=!1,S=!1,I=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(L){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=L)r(c),D.sortIndex=D.expirationTime,t(u,D);else break;D=n(c)}}function k(L){if(S=!1,m(L),!v)if(n(u)!==null)v=!0,ie(P);else{var D=n(c);D!==null&&K(k,D.startTime-L)}}function P(L,D){v=!1,S&&(S=!1,d(R),R=-1),E=!0;var F=a;try{for(m(D),y=n(u);y!==null&&(!(y.expirationTime>D)||L&&!V());){var j=y.callback;if(typeof j=="function"){y.callback=null,a=y.priorityLevel;var W=j(y.expirationTime<=D);D=e.unstable_now(),typeof W=="function"?y.callback=W:y===n(u)&&r(u),m(D)}else r(u);y=n(u)}if(y!==null)var ze=!0;else{var ge=n(c);ge!==null&&K(k,ge.startTime-D),ze=!1}return ze}finally{y=null,a=F,E=!1}}var T=!1,w=null,R=-1,B=5,x=-1;function V(){return!(e.unstable_now()-xL||125j?(L.sortIndex=F,t(c,L),n(u)===null&&L===n(c)&&(S?(d(R),R=-1):S=!0,K(k,F-j))):(L.sortIndex=W,t(u,L),v||E||(v=!0,ie(P))),L},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(L){var D=a;return function(){var F=a;a=D;try{return L.apply(this,arguments)}finally{a=F}}}})(Oa);(function(e){e.exports=Oa})(Ld);/** * @license React * react-dom.production.min.js * @@ -30,19 +30,19 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ra=A,Ae=Fi;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mi=Object.prototype.hasOwnProperty,Nd=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,nu={},ru={};function Pd(e){return Mi.call(ru,e)?!0:Mi.call(nu,e)?!1:Nd.test(e)?ru[e]=!0:(nu[e]=!0,!1)}function Td(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Rd(e,t,n,r){if(t===null||typeof t>"u"||Td(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ce(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ye[e]=new Ce(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ye[t]=new Ce(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ye[e]=new Ce(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ye[e]=new Ce(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ye[e]=new Ce(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ye[e]=new Ce(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ye[e]=new Ce(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ye[e]=new Ce(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ye[e]=new Ce(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ao=/[\-:]([a-z])/g;function Bo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ao,Bo);ye[t]=new Ce(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ao,Bo);ye[t]=new Ce(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ao,Bo);ye[t]=new Ce(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ye[e]=new Ce(e,1,!1,e.toLowerCase(),null,!1,!1)});ye.xlinkHref=new Ce("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ye[e]=new Ce(e,1,!1,e.toLowerCase(),null,!0,!0)});function jo(e,t,n,r){var l=ye.hasOwnProperty(t)?ye[t]:null;(l!==null?l.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bi=Object.prototype.hasOwnProperty,Td=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,lu={},iu={};function Rd(e){return Bi.call(iu,e)?!0:Bi.call(lu,e)?!1:Td.test(e)?iu[e]=!0:(lu[e]=!0,!1)}function Od(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function zd(e,t,n,r){if(t===null||typeof t>"u"||Od(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ne(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var ye={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ye[e]=new Ne(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ye[t]=new Ne(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ye[e]=new Ne(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ye[e]=new Ne(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ye[e]=new Ne(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ye[e]=new Ne(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ye[e]=new Ne(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ye[e]=new Ne(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ye[e]=new Ne(e,5,!1,e.toLowerCase(),null,!1,!1)});var $o=/[\-:]([a-z])/g;function Ho(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace($o,Ho);ye[t]=new Ne(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace($o,Ho);ye[t]=new Ne(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace($o,Ho);ye[t]=new Ne(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ye[e]=new Ne(e,1,!1,e.toLowerCase(),null,!1,!1)});ye.xlinkHref=new Ne("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ye[e]=new Ne(e,1,!1,e.toLowerCase(),null,!0,!0)});function Vo(e,t,n,r){var l=ye.hasOwnProperty(t)?ye[t]:null;(l!==null?l.type!==0:r||!(2s||l[o]!==i[s]){var u=` -`+l[o].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=s);break}}}finally{ii=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Vn(e):""}function Ld(e){switch(e.tag){case 5:return Vn(e.type);case 16:return Vn("Lazy");case 13:return Vn("Suspense");case 19:return Vn("SuspenseList");case 0:case 2:case 15:return e=oi(e.type,!1),e;case 11:return e=oi(e.type.render,!1),e;case 1:return e=oi(e.type,!0),e;default:return""}}function ji(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ln:return"Fragment";case rn:return"Portal";case Ii:return"Profiler";case Uo:return"StrictMode";case Ai:return"Suspense";case Bi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case za:return(e.displayName||"Context")+".Consumer";case Oa:return(e._context.displayName||"Context")+".Provider";case $o:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ho:return t=e.displayName||null,t!==null?t:ji(e.type)||"Memo";case xt:t=e._payload,e=e._init;try{return ji(e(t))}catch{}}return null}function Od(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ji(t);case 8:return t===Uo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function It(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zd(e){var t=Fa(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function zr(e){e._valueTracker||(e._valueTracker=zd(e))}function Ma(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Fa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ui(e,t){var n=t.checked;return te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function iu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=It(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ia(e,t){t=t.checked,t!=null&&jo(e,"checked",t,!1)}function $i(e,t){Ia(e,t);var n=It(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Hi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Hi(e,t.type,It(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ou(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Hi(e,t,n){(t!=="number"||fl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Qn=Array.isArray;function yn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Dr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ir(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Dd=["Webkit","ms","Moz","O"];Object.keys(Xn).forEach(function(e){Dd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xn[t]=Xn[e]})});function Ua(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xn.hasOwnProperty(e)&&Xn[e]?(""+t).trim():t+"px"}function $a(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Ua(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Fd=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Qi(e,t){if(t){if(Fd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(C(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(C(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(C(61))}if(t.style!=null&&typeof t.style!="object")throw Error(C(62))}}function Ki(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Yi=null;function Wo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xi=null,gn=null,vn=null;function au(e){if(e=Nr(e)){if(typeof Xi!="function")throw Error(C(280));var t=e.stateNode;t&&(t=$l(t),Xi(e.stateNode,e.type,t))}}function Ha(e){gn?vn?vn.push(e):vn=[e]:gn=e}function Wa(){if(gn){var e=gn,t=vn;if(vn=gn=null,au(e),t)for(e=0;e>>=0,e===0?32:31-(Qd(e)/Kd|0)|0}var Fr=64,Mr=4194304;function Kn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~l;s!==0?r=Kn(s):(i&=o,i!==0&&(r=Kn(i)))}else o=n&~l,o!==0?r=Kn(o):i!==0&&(r=Kn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function _r(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ze(t),e[t]=n}function Gd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Gn),vu=String.fromCharCode(32),wu=!1;function ac(e,t){switch(e){case"keyup":return _p.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var on=!1;function Np(e,t){switch(e){case"compositionend":return cc(t);case"keypress":return t.which!==32?null:(wu=!0,vu);case"textInput":return e=t.data,e===vu&&wu?null:e;default:return null}}function Pp(e,t){if(on)return e==="compositionend"||!Zo&&ac(e,t)?(e=sc(),Zr=Xo=Nt=null,on=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Eu(n)}}function mc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hc(){for(var e=window,t=fl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fl(e.document)}return t}function qo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Ip(e){var t=hc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&mc(n.ownerDocument.documentElement,n)){if(r!==null&&qo(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=_u(n,i);var o=_u(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,sn=null,eo=null,qn=null,to=!1;function Cu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;to||sn==null||sn!==fl(r)||(r=sn,"selectionStart"in r&&qo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qn&&fr(qn,r)||(qn=r,r=vl(eo,"onSelect"),0cn||(e.current=so[cn],so[cn]=null,cn--)}function Y(e,t){cn++,so[cn]=e.current,e.current=t}var At={},ke=Ut(At),Re=Ut(!1),Jt=At;function En(e,t){var n=e.type.contextTypes;if(!n)return At;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Le(e){return e=e.childContextTypes,e!=null}function Sl(){G(Re),G(ke)}function zu(e,t,n){if(ke.current!==At)throw Error(C(168));Y(ke,t),Y(Re,n)}function _c(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(C(108,Od(e)||"Unknown",l));return te({},n,r)}function kl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||At,Jt=ke.current,Y(ke,e),Y(Re,Re.current),!0}function Du(e,t,n){var r=e.stateNode;if(!r)throw Error(C(169));n?(e=_c(e,t,Jt),r.__reactInternalMemoizedMergedChildContext=e,G(Re),G(ke),Y(ke,e)):G(Re),Y(Re,n)}var at=null,Hl=!1,Si=!1;function Cc(e){at===null?at=[e]:at.push(e)}function Xp(e){Hl=!0,Cc(e)}function $t(){if(!Si&&at!==null){Si=!0;var e=0,t=Q;try{var n=at;for(Q=1;e>=o,l-=o,ct=1<<32-Ze(t)+l|n<L?(B=P,P=null):B=P.sibling;var k=g(f,P,p[L],m);if(k===null){P===null&&(P=B);break}e&&P&&k.alternate===null&&t(f,P),c=i(k,c,L),R===null?N=k:R.sibling=k,R=k,P=B}if(L===p.length)return n(f,P),q&&Ht(f,L),N;if(P===null){for(;LL?(B=P,P=null):B=P.sibling;var W=g(f,P,k.value,m);if(W===null){P===null&&(P=B);break}e&&P&&W.alternate===null&&t(f,P),c=i(W,c,L),R===null?N=W:R.sibling=W,R=W,P=B}if(k.done)return n(f,P),q&&Ht(f,L),N;if(P===null){for(;!k.done;L++,k=p.next())k=h(f,k.value,m),k!==null&&(c=i(k,c,L),R===null?N=k:R.sibling=k,R=k);return q&&Ht(f,L),N}for(P=r(f,P);!k.done;L++,k=p.next())k=x(P,f,L,k.value,m),k!==null&&(e&&k.alternate!==null&&P.delete(k.key===null?L:k.key),c=i(k,c,L),R===null?N=k:R.sibling=k,R=k);return e&&P.forEach(function(Z){return t(f,Z)}),q&&Ht(f,L),N}function D(f,c,p,m){if(typeof p=="object"&&p!==null&&p.type===ln&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Or:e:{for(var N=p.key,R=c;R!==null;){if(R.key===N){if(N=p.type,N===ln){if(R.tag===7){n(f,R.sibling),c=l(R,p.props.children),c.return=f,f=c;break e}}else if(R.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===xt&&Uu(N)===R.type){n(f,R.sibling),c=l(R,p.props),c.ref=jn(f,R,p),c.return=f,f=c;break e}n(f,R);break}else t(f,R);R=R.sibling}p.type===ln?(c=Xt(p.props.children,f.mode,m,p.key),c.return=f,f=c):(m=il(p.type,p.key,p.props,null,f.mode,m),m.ref=jn(f,c,p),m.return=f,f=m)}return o(f);case rn:e:{for(R=p.key;c!==null;){if(c.key===R)if(c.tag===4&&c.stateNode.containerInfo===p.containerInfo&&c.stateNode.implementation===p.implementation){n(f,c.sibling),c=l(c,p.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=Ti(p,f.mode,m),c.return=f,f=c}return o(f);case xt:return R=p._init,D(f,c,R(p._payload),m)}if(Qn(p))return w(f,c,p,m);if(Fn(p))return S(f,c,p,m);Hr(f,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,p),c.return=f,f=c):(n(f,c),c=Pi(p,f.mode,m),c.return=f,f=c),o(f)):n(f,c)}return D}var Cn=Dc(!0),Fc=Dc(!1),Pr={},ot=Ut(Pr),hr=Ut(Pr),yr=Ut(Pr);function Kt(e){if(e===Pr)throw Error(C(174));return e}function ss(e,t){switch(Y(yr,t),Y(hr,e),Y(ot,Pr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Vi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Vi(t,e)}G(ot),Y(ot,t)}function Nn(){G(ot),G(hr),G(yr)}function Mc(e){Kt(yr.current);var t=Kt(ot.current),n=Vi(t,e.type);t!==n&&(Y(hr,e),Y(ot,n))}function us(e){hr.current===e&&(G(ot),G(hr))}var b=Ut(0);function Pl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ki=[];function as(){for(var e=0;en?n:4,e(!0);var r=xi.transition;xi.transition={};try{e(!1),t()}finally{Q=n,xi.transition=r}}function Zc(){return Ke().memoizedState}function qp(e,t,n){var r=Ft(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},qc(e))bc(t,n);else if(n=Rc(e,t,n,r),n!==null){var l=Ee();qe(n,e,r,l),ef(n,t,r)}}function bp(e,t,n){var r=Ft(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(qc(e))bc(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,n);if(l.hasEagerState=!0,l.eagerState=s,be(s,o)){var u=t.interleaved;u===null?(l.next=l,is(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Rc(e,t,l,r),n!==null&&(l=Ee(),qe(n,e,r,l),ef(n,t,r))}}function qc(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function bc(e,t){bn=Tl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ef(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qo(e,n)}}var Rl={readContext:Qe,useCallback:ve,useContext:ve,useEffect:ve,useImperativeHandle:ve,useInsertionEffect:ve,useLayoutEffect:ve,useMemo:ve,useReducer:ve,useRef:ve,useState:ve,useDebugValue:ve,useDeferredValue:ve,useTransition:ve,useMutableSource:ve,useSyncExternalStore:ve,useId:ve,unstable_isNewReconciler:!1},em={readContext:Qe,useCallback:function(e,t){return nt().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:Hu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,tl(4194308,4,Kc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return tl(4,2,e,t)},useMemo:function(e,t){var n=nt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qp.bind(null,ee,e),[r.memoizedState,e]},useRef:function(e){var t=nt();return e={current:e},t.memoizedState=e},useState:$u,useDebugValue:ms,useDeferredValue:function(e){return nt().memoizedState=e},useTransition:function(){var e=$u(!1),t=e[0];return e=Zp.bind(null,e[1]),nt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ee,l=nt();if(q){if(n===void 0)throw Error(C(407));n=n()}else{if(n=t(),pe===null)throw Error(C(349));Zt&30||Bc(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Hu(Uc.bind(null,r,i,e),[e]),r.flags|=2048,wr(9,jc.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=nt(),t=pe.identifierPrefix;if(q){var n=ft,r=ct;n=(r&~(1<<32-Ze(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=gr++,0")&&(u=u.replace("",e.displayName)),u}while(1<=o&&0<=s);break}}}finally{ui=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Zn(e):""}function Md(e){switch(e.tag){case 5:return Zn(e.type);case 16:return Zn("Lazy");case 13:return Zn("Suspense");case 19:return Zn("SuspenseList");case 0:case 2:case 15:return e=ai(e.type,!1),e;case 11:return e=ai(e.type.render,!1),e;case 1:return e=ai(e.type,!0),e;default:return""}}function Hi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ln:return"Fragment";case rn:return"Portal";case ji:return"Profiler";case Wo:return"StrictMode";case Ui:return"Suspense";case $i:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Da:return(e.displayName||"Context")+".Consumer";case Ia:return(e._context.displayName||"Context")+".Provider";case Qo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ko:return t=e.displayName||null,t!==null?t:Hi(e.type)||"Memo";case xt:t=e._payload,e=e._init;try{return Hi(e(t))}catch{}}return null}function Id(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Hi(t);case 8:return t===Wo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Ft(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Aa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Dd(e){var t=Aa(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dr(e){e._valueTracker||(e._valueTracker=Dd(e))}function Ba(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Aa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ml(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Vi(e,t){var n=t.checked;return te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function su(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ft(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ja(e,t){t=t.checked,t!=null&&Vo(e,"checked",t,!1)}function Wi(e,t){ja(e,t);var n=Ft(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Qi(e,t.type,n):t.hasOwnProperty("defaultValue")&&Qi(e,t.type,Ft(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function uu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Qi(e,t,n){(t!=="number"||ml(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yn=Array.isArray;function yn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Fr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ur(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Fd=["Webkit","ms","Moz","O"];Object.keys(Gn).forEach(function(e){Fd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gn[t]=Gn[e]})});function Va(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gn.hasOwnProperty(e)&&Gn[e]?(""+t).trim():t+"px"}function Wa(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Va(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ad=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yi(e,t){if(t){if(Ad[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Ji(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xi=null;function Zo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gi=null,gn=null,vn=null;function fu(e){if(e=Tr(e)){if(typeof Gi!="function")throw Error(N(280));var t=e.stateNode;t&&(t=Wl(t),Gi(e.stateNode,e.type,t))}}function Qa(e){gn?vn?vn.push(e):vn=[e]:gn=e}function Ka(){if(gn){var e=gn,t=vn;if(vn=gn=null,fu(e),t)for(e=0;e>>=0,e===0?32:31-(Yd(e)/Jd|0)|0}var Ar=64,Br=4194304;function Jn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~l;s!==0?r=Jn(s):(i&=o,i!==0&&(r=Jn(i)))}else o=n&~l,o!==0?r=Jn(o):i!==0&&(r=Jn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Pr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ge(t),e[t]=n}function bd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=bn),Su=String.fromCharCode(32),ku=!1;function dc(e,t){switch(e){case"keyup":return Pp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var on=!1;function Tp(e,t){switch(e){case"compositionend":return pc(t);case"keypress":return t.which!==32?null:(ku=!0,Su);case"textInput":return e=t.data,e===Su&&ku?null:e;default:return null}}function Rp(e,t){if(on)return e==="compositionend"||!ts&&dc(e,t)?(e=cc(),el=qo=Nt=null,on=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_u(n)}}function gc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vc(){for(var e=window,t=ml();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ml(e.document)}return t}function ns(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function jp(e){var t=vc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&gc(n.ownerDocument.documentElement,n)){if(r!==null&&ns(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=Nu(n,i);var o=Nu(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,sn=null,ro=null,tr=null,lo=!1;function Pu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lo||sn==null||sn!==ml(r)||(r=sn,"selectionStart"in r&&ns(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),tr&&mr(tr,r)||(tr=r,r=kl(ro,"onSelect"),0cn||(e.current=co[cn],co[cn]=null,cn--)}function Z(e,t){cn++,co[cn]=e.current,e.current=t}var At={},ke=Ut(At),Te=Ut(!1),Jt=At;function En(e,t){var n=e.type.contextTypes;if(!n)return At;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Re(e){return e=e.childContextTypes,e!=null}function El(){X(Te),X(ke)}function Iu(e,t,n){if(ke.current!==At)throw Error(N(168));Z(ke,t),Z(Te,n)}function Pc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(N(108,Id(e)||"Unknown",l));return te({},n,r)}function Cl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||At,Jt=ke.current,Z(ke,e),Z(Te,Te.current),!0}function Du(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=Pc(e,t,Jt),r.__reactInternalMemoizedMergedChildContext=e,X(Te),X(ke),Z(ke,e)):X(Te),Z(Te,n)}var at=null,Ql=!1,Ei=!1;function Lc(e){at===null?at=[e]:at.push(e)}function Gp(e){Ql=!0,Lc(e)}function $t(){if(!Ei&&at!==null){Ei=!0;var e=0,t=Q;try{var n=at;for(Q=1;e>=o,l-=o,ct=1<<32-Ge(t)+l|n<R?(B=w,w=null):B=w.sibling;var x=a(d,w,m[R],k);if(x===null){w===null&&(w=B);break}e&&w&&x.alternate===null&&t(d,w),f=i(x,f,R),T===null?P=x:T.sibling=x,T=x,w=B}if(R===m.length)return n(d,w),q&&Ht(d,R),P;if(w===null){for(;RR?(B=w,w=null):B=w.sibling;var V=a(d,w,x.value,k);if(V===null){w===null&&(w=B);break}e&&w&&V.alternate===null&&t(d,w),f=i(V,f,R),T===null?P=V:T.sibling=V,T=V,w=B}if(x.done)return n(d,w),q&&Ht(d,R),P;if(w===null){for(;!x.done;R++,x=m.next())x=y(d,x.value,k),x!==null&&(f=i(x,f,R),T===null?P=x:T.sibling=x,T=x);return q&&Ht(d,R),P}for(w=r(d,w);!x.done;R++,x=m.next())x=E(w,d,R,x.value,k),x!==null&&(e&&x.alternate!==null&&w.delete(x.key===null?R:x.key),f=i(x,f,R),T===null?P=x:T.sibling=x,T=x);return e&&w.forEach(function(G){return t(d,G)}),q&&Ht(d,R),P}function I(d,f,m,k){if(typeof m=="object"&&m!==null&&m.type===ln&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ir:e:{for(var P=m.key,T=f;T!==null;){if(T.key===P){if(P=m.type,P===ln){if(T.tag===7){n(d,T.sibling),f=l(T,m.props.children),f.return=d,d=f;break e}}else if(T.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===xt&&Hu(P)===T.type){n(d,T.sibling),f=l(T,m.props),f.ref=Hn(d,T,m),f.return=d,d=f;break e}n(d,T);break}else t(d,T);T=T.sibling}m.type===ln?(f=Yt(m.props.children,d.mode,k,m.key),f.return=d,d=f):(k=ul(m.type,m.key,m.props,null,d.mode,k),k.ref=Hn(d,f,m),k.return=d,d=k)}return o(d);case rn:e:{for(T=m.key;f!==null;){if(f.key===T)if(f.tag===4&&f.stateNode.containerInfo===m.containerInfo&&f.stateNode.implementation===m.implementation){n(d,f.sibling),f=l(f,m.children||[]),f.return=d,d=f;break e}else{n(d,f);break}else t(d,f);f=f.sibling}f=Oi(m,d.mode,k),f.return=d,d=f}return o(d);case xt:return T=m._init,I(d,f,T(m._payload),k)}if(Yn(m))return v(d,f,m,k);if(An(m))return S(d,f,m,k);Qr(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,f!==null&&f.tag===6?(n(d,f.sibling),f=l(f,m),f.return=d,d=f):(n(d,f),f=Ri(m,d.mode,k),f.return=d,d=f),o(d)):n(d,f)}return I}var _n=Fc(!0),Ac=Fc(!1),Rr={},ot=Ut(Rr),vr=Ut(Rr),wr=Ut(Rr);function Kt(e){if(e===Rr)throw Error(N(174));return e}function fs(e,t){switch(Z(wr,t),Z(vr,e),Z(ot,Rr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Zi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Zi(t,e)}X(ot),Z(ot,t)}function Nn(){X(ot),X(vr),X(wr)}function Bc(e){Kt(wr.current);var t=Kt(ot.current),n=Zi(t,e.type);t!==n&&(Z(vr,e),Z(ot,n))}function ds(e){vr.current===e&&(X(ot),X(vr))}var b=Ut(0);function Rl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ci=[];function ps(){for(var e=0;en?n:4,e(!0);var r=_i.transition;_i.transition={};try{e(!1),t()}finally{Q=n,_i.transition=r}}function ef(){return Ke().memoizedState}function t0(e,t,n){var r=It(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},tf(e))nf(t,n);else if(n=zc(e,t,n,r),n!==null){var l=Ce();qe(n,e,r,l),rf(n,t,r)}}function n0(e,t,n){var r=It(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(tf(e))nf(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,n);if(l.hasEagerState=!0,l.eagerState=s,be(s,o)){var u=t.interleaved;u===null?(l.next=l,as(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=zc(e,t,l,r),n!==null&&(l=Ce(),qe(n,e,r,l),rf(n,t,r))}}function tf(e){var t=e.alternate;return e===ee||t!==null&&t===ee}function nf(e,t){nr=Ol=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function rf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Jo(e,n)}}var zl={readContext:Qe,useCallback:ve,useContext:ve,useEffect:ve,useImperativeHandle:ve,useInsertionEffect:ve,useLayoutEffect:ve,useMemo:ve,useReducer:ve,useRef:ve,useState:ve,useDebugValue:ve,useDeferredValue:ve,useTransition:ve,useMutableSource:ve,useSyncExternalStore:ve,useId:ve,unstable_isNewReconciler:!1},r0={readContext:Qe,useCallback:function(e,t){return nt().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:Wu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ll(4194308,4,Jc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ll(4194308,4,e,t)},useInsertionEffect:function(e,t){return ll(4,2,e,t)},useMemo:function(e,t){var n=nt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=t0.bind(null,ee,e),[r.memoizedState,e]},useRef:function(e){var t=nt();return e={current:e},t.memoizedState=e},useState:Vu,useDebugValue:vs,useDeferredValue:function(e){return nt().memoizedState=e},useTransition:function(){var e=Vu(!1),t=e[0];return e=e0.bind(null,e[1]),nt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ee,l=nt();if(q){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),pe===null)throw Error(N(349));Gt&30||$c(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Wu(Vc.bind(null,r,i,e),[e]),r.flags|=2048,xr(9,Hc.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=nt(),t=pe.identifierPrefix;if(q){var n=ft,r=ct;n=(r&~(1<<32-Ge(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Sr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[rt]=t,e[mr]=r,cf(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ki(n,r),n){case"dialog":J("cancel",e),J("close",e),l=r;break;case"iframe":case"object":case"embed":J("load",e),l=r;break;case"video":case"audio":for(l=0;lTn&&(t.flags|=128,r=!0,Un(i,!1),t.lanes=4194304)}else{if(!r)if(e=Pl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Un(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!q)return we(t),null}else 2*le()-i.renderingStartTime>Tn&&n!==1073741824&&(t.flags|=128,r=!0,Un(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=le(),t.sibling=null,n=b.current,Y(b,r?n&1|2:n&1),t):(we(t),null);case 22:case 23:return Ss(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Fe&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(C(156,t.tag))}function um(e,t){switch(es(t),t.tag){case 1:return Le(t.type)&&Sl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nn(),G(Re),G(ke),as(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return us(t),null;case 13:if(G(b),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(C(340));_n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(b),null;case 4:return Nn(),null;case 10:return ls(t.type._context),null;case 22:case 23:return Ss(),null;case 24:return null;default:return null}}var Vr=!1,Se=!1,am=typeof WeakSet=="function"?WeakSet:Set,z=null;function mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ne(e,t,r)}else n.current=null}function So(e,t,n){try{n()}catch(r){ne(e,t,r)}}var Zu=!1;function cm(e,t){if(no=yl,e=hc(),qo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,s=-1,u=-1,a=0,d=0,h=e,g=null;t:for(;;){for(var x;h!==n||l!==0&&h.nodeType!==3||(s=o+l),h!==i||r!==0&&h.nodeType!==3||(u=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(x=h.firstChild)!==null;)g=h,h=x;for(;;){if(h===e)break t;if(g===n&&++a===l&&(s=o),g===i&&++d===r&&(u=o),(x=h.nextSibling)!==null)break;h=g,g=h.parentNode}h=x}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(ro={focusedElem:e,selectionRange:n},yl=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,D=w.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?S:Xe(t.type,S),D);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(C(163))}}catch(m){ne(t,t.return,m)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return w=Zu,Zu=!1,w}function er(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&So(t,n,i)}l=l.next}while(l!==r)}}function Ql(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ko(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function pf(e){var t=e.alternate;t!==null&&(e.alternate=null,pf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[rt],delete t[mr],delete t[oo],delete t[Kp],delete t[Yp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function mf(e){return e.tag===5||e.tag===3||e.tag===4}function qu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||mf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function xo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=wl));else if(r!==4&&(e=e.child,e!==null))for(xo(e,t,n),e=e.sibling;e!==null;)xo(e,t,n),e=e.sibling}function Eo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Eo(e,t,n),e=e.sibling;e!==null;)Eo(e,t,n),e=e.sibling}var me=null,Je=!1;function St(e,t,n){for(n=n.child;n!==null;)hf(e,t,n),n=n.sibling}function hf(e,t,n){if(it&&typeof it.onCommitFiberUnmount=="function")try{it.onCommitFiberUnmount(Al,n)}catch{}switch(n.tag){case 5:Se||mn(n,t);case 6:var r=me,l=Je;me=null,St(e,t,n),me=r,Je=l,me!==null&&(Je?(e=me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):me.removeChild(n.stateNode));break;case 18:me!==null&&(Je?(e=me,n=n.stateNode,e.nodeType===8?wi(e.parentNode,n):e.nodeType===1&&wi(e,n),ar(e)):wi(me,n.stateNode));break;case 4:r=me,l=Je,me=n.stateNode.containerInfo,Je=!0,St(e,t,n),me=r,Je=l;break;case 0:case 11:case 14:case 15:if(!Se&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&So(n,t,o),l=l.next}while(l!==r)}St(e,t,n);break;case 1:if(!Se&&(mn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ne(n,t,s)}St(e,t,n);break;case 21:St(e,t,n);break;case 22:n.mode&1?(Se=(r=Se)||n.memoizedState!==null,St(e,t,n),Se=r):St(e,t,n);break;default:St(e,t,n)}}function bu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new am),t.forEach(function(r){var l=wm.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Ye(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*dm(r/1960))-r,10e?16:e,Pt===null)var r=!1;else{if(e=Pt,Pt=null,zl=0,H&6)throw Error(C(331));var l=H;for(H|=4,z=e.current;z!==null;){var i=z,o=i.child;if(z.flags&16){var s=i.deletions;if(s!==null){for(var u=0;ule()-vs?Yt(e,0):gs|=n),Oe(e,t)}function Ef(e,t){t===0&&(e.mode&1?(t=Mr,Mr<<=1,!(Mr&130023424)&&(Mr=4194304)):t=1);var n=Ee();e=yt(e,t),e!==null&&(_r(e,t,n),Oe(e,n))}function vm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ef(e,n)}function wm(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(C(314))}r!==null&&r.delete(t),Ef(e,n)}var _f;_f=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Re.current)Te=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Te=!1,om(e,t,n);Te=!!(e.flags&131072)}else Te=!1,q&&t.flags&1048576&&Nc(t,El,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;nl(e,t),e=t.pendingProps;var l=En(t,ke.current);Sn(t,n),l=fs(null,t,r,e,l,n);var i=ds();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Le(r)?(i=!0,kl(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,os(t),l.updater=Wl,t.stateNode=l,l._reactInternals=t,po(t,r,e,n),t=yo(null,t,r,!0,i,n)):(t.tag=0,q&&i&&bo(t),xe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(nl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=km(r),e=Xe(r,e),l){case 0:t=ho(null,t,r,e,n);break e;case 1:t=Xu(null,t,r,e,n);break e;case 11:t=Ku(null,t,r,e,n);break e;case 14:t=Yu(null,t,r,Xe(r.type,e),n);break e}throw Error(C(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Xe(r,l),ho(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Xe(r,l),Xu(e,t,r,l,n);case 3:e:{if(sf(t),e===null)throw Error(C(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Lc(e,t),Nl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Pn(Error(C(423)),t),t=Ju(e,t,r,n,l);break e}else if(r!==l){l=Pn(Error(C(424)),t),t=Ju(e,t,r,n,l);break e}else for(Me=Ot(t.stateNode.containerInfo.firstChild),Ie=t,q=!0,Ge=null,n=Fc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_n(),r===l){t=gt(e,t,n);break e}xe(e,t,r,n)}t=t.child}return t;case 5:return Mc(t),e===null&&ao(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,lo(r,l)?o=null:i!==null&&lo(r,i)&&(t.flags|=32),of(e,t),xe(e,t,o,n),t.child;case 6:return e===null&&ao(t),null;case 13:return uf(e,t,n);case 4:return ss(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Cn(t,null,r,n):xe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Xe(r,l),Ku(e,t,r,l,n);case 7:return xe(e,t,t.pendingProps,n),t.child;case 8:return xe(e,t,t.pendingProps.children,n),t.child;case 12:return xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,Y(_l,r._currentValue),r._currentValue=o,i!==null)if(be(i.value,o)){if(i.children===l.children&&!Re.current){t=gt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=dt(-1,n&-n),u.tag=2;var a=i.updateQueue;if(a!==null){a=a.shared;var d=a.pending;d===null?u.next=u:(u.next=d.next,d.next=u),a.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),co(i.return,n,t),s.lanes|=n;break}u=u.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(C(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),co(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}xe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Sn(t,n),l=Qe(l),r=r(l),t.flags|=1,xe(e,t,r,n),t.child;case 14:return r=t.type,l=Xe(r,t.pendingProps),l=Xe(r.type,l),Yu(e,t,r,l,n);case 15:return rf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Xe(r,l),nl(e,t),t.tag=1,Le(r)?(e=!0,kl(t)):e=!1,Sn(t,n),zc(t,r,l),po(t,r,l,n),yo(null,t,r,!0,e,n);case 19:return af(e,t,n);case 22:return lf(e,t,n)}throw Error(C(156,t.tag))};function Cf(e,t){return Ga(e,t)}function Sm(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function We(e,t,n,r){return new Sm(e,t,n,r)}function xs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function km(e){if(typeof e=="function")return xs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===$o)return 11;if(e===Ho)return 14}return 2}function Mt(e,t){var n=e.alternate;return n===null?(n=We(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function il(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")xs(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ln:return Xt(n.children,l,i,t);case Uo:o=8,l|=8;break;case Ii:return e=We(12,n,t,l|2),e.elementType=Ii,e.lanes=i,e;case Ai:return e=We(13,n,t,l),e.elementType=Ai,e.lanes=i,e;case Bi:return e=We(19,n,t,l),e.elementType=Bi,e.lanes=i,e;case Da:return Yl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Oa:o=10;break e;case za:o=9;break e;case $o:o=11;break e;case Ho:o=14;break e;case xt:o=16,r=null;break e}throw Error(C(130,e==null?e:typeof e,""))}return t=We(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Xt(e,t,n,r){return e=We(7,e,r,t),e.lanes=n,e}function Yl(e,t,n,r){return e=We(22,e,r,t),e.elementType=Da,e.lanes=n,e.stateNode={isHidden:!1},e}function Pi(e,t,n){return e=We(6,e,null,t),e.lanes=n,e}function Ti(e,t,n){return t=We(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xm(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ui(0),this.expirationTimes=ui(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Es(e,t,n,r,l,i,o,s,u){return e=new xm(e,t,n,s,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=We(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},os(i),e}function Em(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Be})(_d);const Tm=wa(cl);var sa=cl;Di.createRoot=sa.createRoot,Di.hydrateRoot=sa.hydrateRoot;function Rf(e,t){return function(){return e.apply(t,arguments)}}const{toString:Lf}=Object.prototype,{getPrototypeOf:Ps}=Object,Ts=(e=>t=>{const n=Lf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),wt=e=>(e=e.toLowerCase(),t=>Ts(t)===e),ql=e=>t=>typeof t===e,{isArray:Dn}=Array,kr=ql("undefined");function Rm(e){return e!==null&&!kr(e)&&e.constructor!==null&&!kr(e.constructor)&&Bt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Of=wt("ArrayBuffer");function Lm(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Of(e.buffer),t}const Om=ql("string"),Bt=ql("function"),zf=ql("number"),Rs=e=>e!==null&&typeof e=="object",zm=e=>e===!0||e===!1,ol=e=>{if(Ts(e)!=="object")return!1;const t=Ps(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Dm=wt("Date"),Fm=wt("File"),Mm=wt("Blob"),Im=wt("FileList"),Am=e=>Rs(e)&&Bt(e.pipe),Bm=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||Lf.call(e)===t||Bt(e.toString)&&e.toString()===t)},jm=wt("URLSearchParams"),Um=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Tr(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,l;if(typeof e!="object"&&(e=[e]),Dn(e))for(r=0,l=e.length;r0;)if(l=n[r],t===l.toLowerCase())return l;return null}const Ff=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Mf=e=>!kr(e)&&e!==Ff;function To(){const{caseless:e}=Mf(this)&&this||{},t={},n=(r,l)=>{const i=e&&Df(t,l)||l;ol(t[i])&&ol(r)?t[i]=To(t[i],r):ol(r)?t[i]=To({},r):Dn(r)?t[i]=r.slice():t[i]=r};for(let r=0,l=arguments.length;r(Tr(t,(l,i)=>{n&&Bt(l)?e[i]=Rf(l,n):e[i]=l},{allOwnKeys:r}),e),Hm=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Wm=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Vm=(e,t,n,r)=>{let l,i,o;const s={};if(t=t||{},e==null)return t;do{for(l=Object.getOwnPropertyNames(e),i=l.length;i-- >0;)o=l[i],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Ps(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Qm=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Km=e=>{if(!e)return null;if(Dn(e))return e;let t=e.length;if(!zf(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ym=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ps(Uint8Array)),Xm=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let l;for(;(l=r.next())&&!l.done;){const i=l.value;t.call(e,i[0],i[1])}},Jm=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Gm=wt("HTMLFormElement"),Zm=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,l){return r.toUpperCase()+l}),ua=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qm=wt("RegExp"),If=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Tr(n,(l,i)=>{t(l,i,e)!==!1&&(r[i]=l)}),Object.defineProperties(e,r)},bm=e=>{If(e,(t,n)=>{if(Bt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Bt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},e0=(e,t)=>{const n={},r=l=>{l.forEach(i=>{n[i]=!0})};return Dn(e)?r(e):r(String(e).split(t)),n},t0=()=>{},n0=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Ri="abcdefghijklmnopqrstuvwxyz",aa="0123456789",Af={DIGIT:aa,ALPHA:Ri,ALPHA_DIGIT:Ri+Ri.toUpperCase()+aa},r0=(e=16,t=Af.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function l0(e){return!!(e&&Bt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const i0=e=>{const t=new Array(10),n=(r,l)=>{if(Rs(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[l]=r;const i=Dn(r)?[]:{};return Tr(r,(o,s)=>{const u=n(o,l+1);!kr(u)&&(i[s]=u)}),t[l]=void 0,i}}return r};return n(e,0)},_={isArray:Dn,isArrayBuffer:Of,isBuffer:Rm,isFormData:Bm,isArrayBufferView:Lm,isString:Om,isNumber:zf,isBoolean:zm,isObject:Rs,isPlainObject:ol,isUndefined:kr,isDate:Dm,isFile:Fm,isBlob:Mm,isRegExp:qm,isFunction:Bt,isStream:Am,isURLSearchParams:jm,isTypedArray:Ym,isFileList:Im,forEach:Tr,merge:To,extend:$m,trim:Um,stripBOM:Hm,inherits:Wm,toFlatObject:Vm,kindOf:Ts,kindOfTest:wt,endsWith:Qm,toArray:Km,forEachEntry:Xm,matchAll:Jm,isHTMLForm:Gm,hasOwnProperty:ua,hasOwnProp:ua,reduceDescriptors:If,freezeMethods:bm,toObjectSet:e0,toCamelCase:Zm,noop:t0,toFiniteNumber:n0,findKey:Df,global:Ff,isContextDefined:Mf,ALPHABET:Af,generateString:r0,isSpecCompliantForm:l0,toJSONObject:i0};function $(e,t,n,r,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),l&&(this.response=l)}_.inherits($,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Bf=$.prototype,jf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{jf[e]={value:e}});Object.defineProperties($,jf);Object.defineProperty(Bf,"isAxiosError",{value:!0});$.from=(e,t,n,r,l,i)=>{const o=Object.create(Bf);return _.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError"),$.call(o,e.message,t,n,r,l),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const o0=null;function Ro(e){return _.isPlainObject(e)||_.isArray(e)}function Uf(e){return _.endsWith(e,"[]")?e.slice(0,-2):e}function ca(e,t,n){return e?e.concat(t).map(function(l,i){return l=Uf(l),!n&&i?"["+l+"]":l}).join(n?".":""):t}function s0(e){return _.isArray(e)&&!e.some(Ro)}const u0=_.toFlatObject(_,{},null,function(t){return/^is[A-Z]/.test(t)});function bl(e,t,n){if(!_.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,D){return!_.isUndefined(D[S])});const r=n.metaTokens,l=n.visitor||d,i=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(t);if(!_.isFunction(l))throw new TypeError("visitor must be a function");function a(w){if(w===null)return"";if(_.isDate(w))return w.toISOString();if(!u&&_.isBlob(w))throw new $("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(w)||_.isTypedArray(w)?u&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function d(w,S,D){let f=w;if(w&&!D&&typeof w=="object"){if(_.endsWith(S,"{}"))S=r?S:S.slice(0,-2),w=JSON.stringify(w);else if(_.isArray(w)&&s0(w)||(_.isFileList(w)||_.endsWith(S,"[]"))&&(f=_.toArray(w)))return S=Uf(S),f.forEach(function(p,m){!(_.isUndefined(p)||p===null)&&t.append(o===!0?ca([S],m,i):o===null?S:S+"[]",a(p))}),!1}return Ro(w)?!0:(t.append(ca(D,S,i),a(w)),!1)}const h=[],g=Object.assign(u0,{defaultVisitor:d,convertValue:a,isVisitable:Ro});function x(w,S){if(!_.isUndefined(w)){if(h.indexOf(w)!==-1)throw Error("Circular reference detected in "+S.join("."));h.push(w),_.forEach(w,function(f,c){(!(_.isUndefined(f)||f===null)&&l.call(t,f,_.isString(c)?c.trim():c,S,g))===!0&&x(f,S?S.concat(c):[c])}),h.pop()}}if(!_.isObject(e))throw new TypeError("data must be an object");return x(e),t}function fa(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ls(e,t){this._pairs=[],e&&bl(e,this,t)}const $f=Ls.prototype;$f.append=function(t,n){this._pairs.push([t,n])};$f.toString=function(t){const n=t?function(r){return t.call(this,r,fa)}:fa;return this._pairs.map(function(l){return n(l[0])+"="+n(l[1])},"").join("&")};function a0(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Hf(e,t,n){if(!t)return e;const r=n&&n.encode||a0,l=n&&n.serialize;let i;if(l?i=l(t,n):i=_.isURLSearchParams(t)?t.toString():new Ls(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class c0{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){_.forEach(this.handlers,function(r){r!==null&&t(r)})}}const da=c0,Wf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},f0=typeof URLSearchParams<"u"?URLSearchParams:Ls,d0=typeof FormData<"u"?FormData:null,p0=typeof Blob<"u"?Blob:null,m0=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),h0=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),lt={isBrowser:!0,classes:{URLSearchParams:f0,FormData:d0,Blob:p0},isStandardBrowserEnv:m0,isStandardBrowserWebWorkerEnv:h0,protocols:["http","https","file","blob","url","data"]};function y0(e,t){return bl(e,new lt.classes.URLSearchParams,Object.assign({visitor:function(n,r,l,i){return lt.isNode&&_.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function g0(e){return _.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function v0(e){const t={},n=Object.keys(e);let r;const l=n.length;let i;for(r=0;r=n.length;return o=!o&&_.isArray(l)?l.length:o,u?(_.hasOwnProp(l,o)?l[o]=[l[o],r]:l[o]=r,!s):((!l[o]||!_.isObject(l[o]))&&(l[o]=[]),t(n,r,l[o],i)&&_.isArray(l[o])&&(l[o]=v0(l[o])),!s)}if(_.isFormData(e)&&_.isFunction(e.entries)){const n={};return _.forEachEntry(e,(r,l)=>{t(g0(r),l,n,0)}),n}return null}const w0={"Content-Type":void 0};function S0(e,t,n){if(_.isString(e))try{return(t||JSON.parse)(e),_.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ei={transitional:Wf,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",l=r.indexOf("application/json")>-1,i=_.isObject(t);if(i&&_.isHTMLForm(t)&&(t=new FormData(t)),_.isFormData(t))return l&&l?JSON.stringify(Vf(t)):t;if(_.isArrayBuffer(t)||_.isBuffer(t)||_.isStream(t)||_.isFile(t)||_.isBlob(t))return t;if(_.isArrayBufferView(t))return t.buffer;if(_.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return y0(t,this.formSerializer).toString();if((s=_.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return bl(s?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||l?(n.setContentType("application/json",!1),S0(t)):t}],transformResponse:[function(t){const n=this.transitional||ei.transitional,r=n&&n.forcedJSONParsing,l=this.responseType==="json";if(t&&_.isString(t)&&(r&&!this.responseType||l)){const o=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?$.from(s,$.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:lt.classes.FormData,Blob:lt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_.forEach(["delete","get","head"],function(t){ei.headers[t]={}});_.forEach(["post","put","patch"],function(t){ei.headers[t]=_.merge(w0)});const Os=ei,k0=_.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),x0=e=>{const t={};let n,r,l;return e&&e.split(` -`).forEach(function(o){l=o.indexOf(":"),n=o.substring(0,l).trim().toLowerCase(),r=o.substring(l+1).trim(),!(!n||t[n]&&k0[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},pa=Symbol("internals");function Hn(e){return e&&String(e).trim().toLowerCase()}function sl(e){return e===!1||e==null?e:_.isArray(e)?e.map(sl):String(e)}function E0(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function _0(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function Li(e,t,n,r,l){if(_.isFunction(r))return r.call(this,t,n);if(l&&(t=n),!!_.isString(t)){if(_.isString(r))return t.indexOf(r)!==-1;if(_.isRegExp(r))return r.test(t)}}function C0(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function N0(e,t){const n=_.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(l,i,o){return this[r].call(this,t,l,i,o)},configurable:!0})})}class ti{constructor(t){t&&this.set(t)}set(t,n,r){const l=this;function i(s,u,a){const d=Hn(u);if(!d)throw new Error("header name must be a non-empty string");const h=_.findKey(l,d);(!h||l[h]===void 0||a===!0||a===void 0&&l[h]!==!1)&&(l[h||u]=sl(s))}const o=(s,u)=>_.forEach(s,(a,d)=>i(a,d,u));return _.isPlainObject(t)||t instanceof this.constructor?o(t,n):_.isString(t)&&(t=t.trim())&&!_0(t)?o(x0(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Hn(t),t){const r=_.findKey(this,t);if(r){const l=this[r];if(!n)return l;if(n===!0)return E0(l);if(_.isFunction(n))return n.call(this,l,r);if(_.isRegExp(n))return n.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Hn(t),t){const r=_.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Li(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let l=!1;function i(o){if(o=Hn(o),o){const s=_.findKey(r,o);s&&(!n||Li(r,r[s],s,n))&&(delete r[s],l=!0)}}return _.isArray(t)?t.forEach(i):i(t),l}clear(t){const n=Object.keys(this);let r=n.length,l=!1;for(;r--;){const i=n[r];(!t||Li(this,this[i],i,t,!0))&&(delete this[i],l=!0)}return l}normalize(t){const n=this,r={};return _.forEach(this,(l,i)=>{const o=_.findKey(r,i);if(o){n[o]=sl(l),delete n[i];return}const s=t?C0(i):String(i).trim();s!==i&&delete n[i],n[s]=sl(l),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return _.forEach(this,(r,l)=>{r!=null&&r!==!1&&(n[l]=t&&_.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(l=>r.set(l)),r}static accessor(t){const r=(this[pa]=this[pa]={accessors:{}}).accessors,l=this.prototype;function i(o){const s=Hn(o);r[s]||(N0(l,o),r[s]=!0)}return _.isArray(t)?t.forEach(i):i(t),this}}ti.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.freezeMethods(ti.prototype);_.freezeMethods(ti);const pt=ti;function Oi(e,t){const n=this||Os,r=t||n,l=pt.from(r.headers);let i=r.data;return _.forEach(e,function(s){i=s.call(n,i,l.normalize(),t?t.status:void 0)}),l.normalize(),i}function Qf(e){return!!(e&&e.__CANCEL__)}function Rr(e,t,n){$.call(this,e??"canceled",$.ERR_CANCELED,t,n),this.name="CanceledError"}_.inherits(Rr,$,{__CANCEL__:!0});function P0(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new $("Request failed with status code "+n.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const T0=lt.isStandardBrowserEnv?function(){return{write:function(n,r,l,i,o,s){const u=[];u.push(n+"="+encodeURIComponent(r)),_.isNumber(l)&&u.push("expires="+new Date(l).toGMTString()),_.isString(i)&&u.push("path="+i),_.isString(o)&&u.push("domain="+o),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function R0(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function L0(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Kf(e,t){return e&&!R0(t)?L0(e,t):t}const O0=lt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function l(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=l(window.location.href),function(o){const s=_.isString(o)?l(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}();function z0(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function D0(e,t){e=e||10;const n=new Array(e),r=new Array(e);let l=0,i=0,o;return t=t!==void 0?t:1e3,function(u){const a=Date.now(),d=r[i];o||(o=a),n[l]=u,r[l]=a;let h=i,g=0;for(;h!==l;)g+=n[h++],h=h%e;if(l=(l+1)%e,l===i&&(i=(i+1)%e),a-o{const i=l.loaded,o=l.lengthComputable?l.total:void 0,s=i-n,u=r(s),a=i<=o;n=i;const d={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a?(o-i)/u:void 0,event:l};d[t?"download":"upload"]=!0,e(d)}}const F0=typeof XMLHttpRequest<"u",M0=F0&&function(e){return new Promise(function(n,r){let l=e.data;const i=pt.from(e.headers).normalize(),o=e.responseType;let s;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}_.isFormData(l)&&(lt.isStandardBrowserEnv||lt.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let a=new XMLHttpRequest;if(e.auth){const x=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(x+":"+w))}const d=Kf(e.baseURL,e.url);a.open(e.method.toUpperCase(),Hf(d,e.params,e.paramsSerializer),!0),a.timeout=e.timeout;function h(){if(!a)return;const x=pt.from("getAllResponseHeaders"in a&&a.getAllResponseHeaders()),S={data:!o||o==="text"||o==="json"?a.responseText:a.response,status:a.status,statusText:a.statusText,headers:x,config:e,request:a};P0(function(f){n(f),u()},function(f){r(f),u()},S),a=null}if("onloadend"in a?a.onloadend=h:a.onreadystatechange=function(){!a||a.readyState!==4||a.status===0&&!(a.responseURL&&a.responseURL.indexOf("file:")===0)||setTimeout(h)},a.onabort=function(){a&&(r(new $("Request aborted",$.ECONNABORTED,e,a)),a=null)},a.onerror=function(){r(new $("Network Error",$.ERR_NETWORK,e,a)),a=null},a.ontimeout=function(){let w=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const S=e.transitional||Wf;e.timeoutErrorMessage&&(w=e.timeoutErrorMessage),r(new $(w,S.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,e,a)),a=null},lt.isStandardBrowserEnv){const x=(e.withCredentials||O0(d))&&e.xsrfCookieName&&T0.read(e.xsrfCookieName);x&&i.set(e.xsrfHeaderName,x)}l===void 0&&i.setContentType(null),"setRequestHeader"in a&&_.forEach(i.toJSON(),function(w,S){a.setRequestHeader(S,w)}),_.isUndefined(e.withCredentials)||(a.withCredentials=!!e.withCredentials),o&&o!=="json"&&(a.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&a.addEventListener("progress",ma(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&a.upload&&a.upload.addEventListener("progress",ma(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=x=>{a&&(r(!x||x.type?new Rr(null,e,a):x),a.abort(),a=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const g=z0(d);if(g&<.protocols.indexOf(g)===-1){r(new $("Unsupported protocol "+g+":",$.ERR_BAD_REQUEST,e));return}a.send(l||null)})},ul={http:o0,xhr:M0};_.forEach(ul,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const I0={getAdapter:e=>{e=_.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let l=0;le instanceof pt?e.toJSON():e;function Rn(e,t){t=t||{};const n={};function r(a,d,h){return _.isPlainObject(a)&&_.isPlainObject(d)?_.merge.call({caseless:h},a,d):_.isPlainObject(d)?_.merge({},d):_.isArray(d)?d.slice():d}function l(a,d,h){if(_.isUndefined(d)){if(!_.isUndefined(a))return r(void 0,a,h)}else return r(a,d,h)}function i(a,d){if(!_.isUndefined(d))return r(void 0,d)}function o(a,d){if(_.isUndefined(d)){if(!_.isUndefined(a))return r(void 0,a)}else return r(void 0,d)}function s(a,d,h){if(h in t)return r(a,d);if(h in e)return r(void 0,a)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(a,d)=>l(ya(a),ya(d),!0)};return _.forEach(Object.keys(e).concat(Object.keys(t)),function(d){const h=u[d]||l,g=h(e[d],t[d],d);_.isUndefined(g)&&h!==s||(n[d]=g)}),n}const Yf="1.3.4",zs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{zs[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ga={};zs.transitional=function(t,n,r){function l(i,o){return"[Axios v"+Yf+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(t===!1)throw new $(l(o," has been removed"+(n?" in "+n:"")),$.ERR_DEPRECATED);return n&&!ga[o]&&(ga[o]=!0,console.warn(l(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,s):!0}};function A0(e,t,n){if(typeof e!="object")throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let l=r.length;for(;l-- >0;){const i=r[l],o=t[i];if(o){const s=e[i],u=s===void 0||o(s,i,e);if(u!==!0)throw new $("option "+i+" must be "+u,$.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new $("Unknown option "+i,$.ERR_BAD_OPTION)}}const Lo={assertOptions:A0,validators:zs},kt=Lo.validators;class Ml{constructor(t){this.defaults=t,this.interceptors={request:new da,response:new da}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Rn(this.defaults,n);const{transitional:r,paramsSerializer:l,headers:i}=n;r!==void 0&&Lo.assertOptions(r,{silentJSONParsing:kt.transitional(kt.boolean),forcedJSONParsing:kt.transitional(kt.boolean),clarifyTimeoutError:kt.transitional(kt.boolean)},!1),l!==void 0&&Lo.assertOptions(l,{encode:kt.function,serialize:kt.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=i&&_.merge(i.common,i[n.method]),o&&_.forEach(["delete","get","head","post","put","patch","common"],w=>{delete i[w]}),n.headers=pt.concat(o,i);const s=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(u=u&&S.synchronous,s.unshift(S.fulfilled,S.rejected))});const a=[];this.interceptors.response.forEach(function(S){a.push(S.fulfilled,S.rejected)});let d,h=0,g;if(!u){const w=[ha.bind(this),void 0];for(w.unshift.apply(w,s),w.push.apply(w,a),g=w.length,d=Promise.resolve(n);h{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](l);r._listeners=null}),this.promise.then=l=>{let i;const o=new Promise(s=>{r.subscribe(s),i=s}).then(l);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,s){r.reason||(r.reason=new Rr(i,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Ds(function(l){t=l}),cancel:t}}}const B0=Ds;function j0(e){return function(n){return e.apply(null,n)}}function U0(e){return _.isObject(e)&&e.isAxiosError===!0}const Oo={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Oo).forEach(([e,t])=>{Oo[t]=e});const $0=Oo;function Xf(e){const t=new al(e),n=Rf(al.prototype.request,t);return _.extend(n,al.prototype,t,{allOwnKeys:!0}),_.extend(n,t,null,{allOwnKeys:!0}),n.create=function(l){return Xf(Rn(e,l))},n}const ce=Xf(Os);ce.Axios=al;ce.CanceledError=Rr;ce.CancelToken=B0;ce.isCancel=Qf;ce.VERSION=Yf;ce.toFormData=bl;ce.AxiosError=$;ce.Cancel=ce.CanceledError;ce.all=function(t){return Promise.all(t)};ce.spread=j0;ce.isAxiosError=U0;ce.mergeConfig=Rn;ce.AxiosHeaders=pt;ce.formToJSON=e=>Vf(_.isHTMLForm(e)?new FormData(e):e);ce.HttpStatusCode=$0;ce.default=ce;const Jf=ce,Fs=({size:e,style:t,className:n})=>v("svg",{width:e??24,height:e??24,viewBox:"0 0 24 24",className:n,style:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v("path",{fill:"currentColor",d:"M13.06 12l6.224-6.216a.76.76 0 00-1.069-1.068L12 10.94 5.784 4.716a.76.76 0 00-1.069 1.068L10.94 12l-6.225 6.216a.76.76 0 000 1.068.768.768 0 001.07 0L12 13.06l6.215 6.225a.768.768 0 001.07 0 .76.76 0 000-1.068L13.058 12z"})}),H0=({size:e,style:t,className:n})=>v("svg",{width:e??24,height:e??24,viewBox:"0 0 24 24",className:n,style:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12.375 20.25H4.472a.712.712 0 01-.722-.722v-7.903A8.625 8.625 0 0112.375 3v0A8.625 8.625 0 0121 11.625v0a8.624 8.624 0 01-8.625 8.625v0zM9.375 10.5H15M9.375 13.5H15"})}),W0=({size:e,className:t,style:n})=>I("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",enableBackground:"new 0 0 128 128",height:e??20,className:t,style:n,id:"Layer_1",version:"1.1",viewBox:"0 0 128 128",width:e??20,xmlSpace:"preserve",children:[v("path",{fill:"currentColor",d:"M74.508,108.239c-0.772,0-1.479-0.445-1.81-1.148l-16.863-35.84L20.732,55.116c-0.734-0.337-1.193-1.083-1.164-1.891 c0.03-0.808,0.543-1.518,1.3-1.8l83.312-31.107c0.729-0.271,1.552-0.096,2.105,0.452c0.555,0.548,0.739,1.369,0.475,2.102 l-30.371,84.047c-0.274,0.761-0.98,1.28-1.788,1.318C74.569,108.238,74.538,108.239,74.508,108.239z M26.772,53.49l31.396,14.432 c0.429,0.197,0.774,0.539,0.975,0.965l15.122,32.139l27.264-75.448L26.772,53.49z"}),v("path",{fill:"currentColor",d:"M57.334,71.738c-0.512,0-1.023-0.195-1.414-0.586c-0.781-0.78-0.781-2.047,0-2.828l47.545-47.546 c0.781-0.781,2.047-0.781,2.828,0c0.781,0.781,0.781,2.047,0,2.828L58.748,71.152C58.357,71.543,57.846,71.738,57.334,71.738z"})]}),Gf=({className:e,size:t})=>I("svg",{className:e,width:t??"7",height:t??"14",viewBox:"0 0 7 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[v("path",{d:"M1 14L1 -4.02383e-07",stroke:"currentColor",strokeWidth:"1.5"}),v("path",{d:"M6.24615 14V1.26655e-06",stroke:"currentColor",strokeWidth:"1.5"})]}),zo=({className:e,size:t})=>v("svg",{width:t??"12",height:t??"16",className:e,viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v("path",{d:"M10.7391 6.92845C11.3389 7.31537 11.3519 8.18793 10.7639 8.59253L1.56691 14.9217C0.903442 15.3783 -5.96046e-08 14.9033 -5.96046e-08 14.0979L-5.96046e-08 1.83521C-5.96046e-08 1.04331 0.876694 0.565606 1.54212 0.994914L10.7391 6.92845Z",fill:"currentColor"})}),V0=({className:e,size:t})=>v("svg",{width:t??"23",height:t??"23",className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:v("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2 7V2h5m15 5V2h-5M7 22H2v-5m15 5h5v-5"})}),Q0=({className:e,size:t})=>I("svg",{viewBox:"0 0 34 34",height:t??"34",width:t??"34",className:e,preserveAspectRatio:"xMidYMid meet",version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 34 34",xmlSpace:"preserve",children:[v("path",{fill:"currentColor",d:"M17,2c8.3,0,15,6.7,15,15s-6.7,15-15,15S2,25.3,2,17S8.7,2,17,2 M17,1C8.2,1,1,8.2,1,17 s7.2,16,16,16s16-7.2,16-16S25.8,1,17,1L17,1z"}),v("path",{fill:"currentColor",d:"M22.4,17.5h-3.2v-6.8c0-0.4-0.3-0.7-0.7-0.7h-3.2c-0.4,0-0.7,0.3-0.7,0.7v6.8h-3.2 c-0.6,0-0.8,0.4-0.4,0.8l5,5.3c0.5,0.7,1,0.5,1.5,0l5-5.3C23.2,17.8,23,17.5,22.4,17.5z"})]});const K0=({label:e,mode:t,onClick:n,disabled:r})=>v("button",{className:"sarufi-flex-center",onClick:()=>{r||n&&n()},disabled:r??!1,style:{cursor:r?"default":"pointer",opacity:r?.4:1,fontSize:".9rem",padding:".7rem 1rem",position:"absolute",overflow:"hidden",transition:".3s linear",zIndex:100001,right:"5px",border:"none",...t==="dark"?{backgroundColor:"transparent",color:"white"}:{}},children:e}),Y0=({disabled:e,autoComplete:t="",value:n,name:r,onChange:l,required:i,autoFocus:o=!1,placeholder:s,maxLength:u=1024,save:a,mode:d,primaryColor:h})=>{const g=S=>{S.keyCode==13&&S.shiftKey==!1&&(a&&S.preventDefault(),a&&a(S))},[x,w]=A.useState(!0);return v("div",{className:"sarufi-field-group",style:{marginBottom:"1.5rem"},children:v("div",{className:"input-group",style:{position:"relative"},children:v("label",{className:"sarufi-flex-start",style:{},children:v("textarea",{onKeyDown:g,id:r,autoFocus:o,name:r,maxLength:u,disabled:e,placeholder:s,className:"scroll-bar sarufi-textarea",onChange:l,autoComplete:t,value:n,onFocus:()=>w(!0),onBlur:()=>w(!1),style:{padding:".7rem .7rem",paddingRight:45,height:60,minHeight:60,maxHeight:60,borderRadius:"0.3rem",fontFamily:"var(--sarufi-font-family)",...d==="dark"?{color:"white"}:{},...d==="dark"&&x?{borderColor:h}:{}},required:i},r)})})})},xr=({fromPlay:e})=>I("div",{className:"sarufi-chat-loader",children:[v("div",{className:"sarufi-bounce1"}),v("div",{className:"sarufi-bounce2"}),!e&&v("div",{className:"sarufi-bounce3"})]}),Zf=({closeWithBackdrop:e,close:t,open:n,children:r,mode:l})=>(A.useLayoutEffect(()=>{n?document.body.classList.add("sarufi-no-scrolling"):document.body.classList.remove("sarufi-no-scrolling")},[n]),Tm.createPortal(I("div",{className:`sarufi-modal ${n?"open":""} sarufi-flex-center`,style:{zIndex:2e5},children:[n&&v("div",{className:`sarufi-modal-backdrop ${n?"open":""}`,onClick:()=>{e&&t()}}),I("div",{className:`sarufi-container ${n?"open":""} sarufi-scroll-bar`,style:{color:l==="dark"?"rgba(255,255,255,.7)":"rgba(0,0,0,.7)"},onClick:()=>{e&&t()},children:[v("div",{className:"sarufi-flex-end sarufi-close-modal",style:{position:"absolute",left:0,width:"100vw",height:"50px"},children:v("button",{onClick:i=>{i.stopPropagation(),i.nativeEvent.stopImmediatePropagation(),t()},title:"Close",className:"sarufi-cursor-pointer",style:{background:"none",border:"none",cursor:"pointer",color:"rgba(255,255,255,.8)",padding:"1rem 2rem"},children:v(Fs,{})})}),v("div",{className:"sarufi-flex-center",style:{height:"100%",width:"100%"},children:v("div",{onClick:i=>{i.stopPropagation(),i.nativeEvent.stopImmediatePropagation()},style:{width:"max-content"},children:r})})]})]}),document.getElementById("sarufi-modal"))),X0=({url:e,fontSize:t,mediaId:n,mode:r})=>{var y,re,ie,K,T;const[l,i]=A.useState(!1),[o,s]=A.useState(0),[u,a]=A.useState(0),[d,h]=A.useState(0),[g,x]=A.useState(0),[w,S]=A.useState(0),[D,f]=A.useState(0),[c,p]=A.useState(0),[m,N]=A.useState(!1),[R,P]=A.useState(0),[L,B]=A.useState(!0),k=document.querySelector(`audio#${n}`),W=()=>{if(k&&c)if(k.paused){k.play(),i(!0);const F=document.getElementsByTagName("audio");for(let j=0;j{let{value:M}=F.target;f(M/1e3),k&&c&&(k.currentTime=M/1e3)};A.useEffect(()=>{P(D/c*100)},[D]),A.useEffect(()=>{k&&(k.onwaiting=()=>{N(!0)},k.onplaying=()=>{N(!1)},k.onerror=()=>{B(!1)},k.onloadeddata=()=>{s(k.currentTime%60),a(k.currentTime/60%60),x(k.duration%60),S(k.duration/60%60),p(k.duration),f(k.currentTime),B(!1),N(!1)},k.ontimeupdate=()=>{var F,M;k&&k.currentTime&&(s(k.currentTime%60),a(k.currentTime/60%60),f(k.currentTime),P(D/c*100)),k&&k.duration&&(x((k==null?void 0:k.duration)%60),S((k==null?void 0:k.duration)/60%60),p(k.duration),h((M=k==null?void 0:k.buffered)==null?void 0:M.end(((F=k==null?void 0:k.buffered)==null?void 0:F.length)-1)))},k.onended=()=>{f(0),s(0),a(0),P(0),h(0),i(!1)})},[l,k]),A.useEffect(()=>{k&&(k.played&&i(!0),k.paused&&i(!1))},[k==null?void 0:k.played,k==null?void 0:k.paused]);const E={"--sarufi-audio-seek-before-width":R+"%","--sarufi-audio-buffer-before-width":d/c*100+"%"};return I(Pe,{children:[L?v("div",{style:{padding:".5rem",fontSize:14,display:"flex",justifyContent:"center"},children:v(xr,{})}):null,k!=null&&k.duration&&!((y=k==null?void 0:k.error)!=null&&y.code)&&!L?v("div",{style:{...E},className:"sarufi-audio-player",children:I("div",{style:{margin:".5rem 0 .5rem",width:"100%"},className:"sarufi-flex-start",children:[v("button",{className:"sarufi-flex-start sarufi-button",onClick:W,style:{background:"none",border:"none",height:"40px",width:"40px",color:"var(--sarufi-sent-boxt-color)",cursor:"pointer"},accessKey:"Space",type:"button",children:v("span",{title:l?"Pause":"Play",children:m?v(Pe,{children:v(xr,{fromPlay:!0})}):v(Pe,{children:l?v(Gf,{}):v(zo,{})})})}),I("div",{style:{width:"calc( 100% - 50px )"},children:[v("div",{className:"sarufi-bar sarufi-duration__bar",children:v("input",{type:"range",id:"progress",disabled:!c,step:1e-4,value:D&&D*1e3,max:c&&c*1e3,onChange:Z})}),c>0&&v("div",{className:"",style:{fontSize:Number(t)*.8},children:I("div",{className:"sarufi-flex-wide sarufi-duration",children:[l&&I("div",{children:[v("span",{children:u<10?`0${Math.floor(u)}`:Math.floor(u)})," : ",v("span",{children:o<10?`0${Math.floor(o)}`:`${Math.floor(o)}`})]}),!l&&I("div",{children:[v("span",{children:w<10?`0${Math.floor(w)}`:Math.floor(w)})," : ",v("span",{children:g<10?`0${Math.floor(g)}`:`${Math.floor(g)}`})]})]})})]})]})}):null,(k==null?void 0:k.error)&&!(k!=null&&k.duration)&&!L&&v("div",{style:{color:r==="dark"?"#e76262":"red",borderRadius:".3rem",padding:".3rem 0",fontSize:14},children:((re=k==null?void 0:k.error)==null?void 0:re.code)===1?"Loading audio resorces was aborted":((ie=k==null?void 0:k.error)==null?void 0:ie.code)===2?"Failed to play audio due to network error":((K=k==null?void 0:k.error)==null?void 0:K.code)===3?"Failed to decode audio resorces":((T=k==null?void 0:k.error)==null?void 0:T.code)===4?"Audio resources not supported":"Failed to load audio resources"}),v("audio",{id:n,src:e??"",style:{display:"none"}},e)]})},J0=({url:e,caption:t,fontFamily:n,fontSize:r,mediaId:l,mode:i})=>{var M,j,V,ze,ge,Ue;const[o,s]=A.useState(!1),[u,a]=A.useState(0),[d,h]=A.useState(0),[g,x]=A.useState(0),[w,S]=A.useState(0),[D,f]=A.useState(0),[c,p]=A.useState(0),[m,N]=A.useState(!1),[R,P]=A.useState(0),[L,B]=A.useState(0),[k,W]=A.useState(!0),[Z,E]=A.useState(!0),y=document.querySelector(`video#${l}-preview`),re=()=>{if(!m&&y){N(!0),y.play();const X=document.getElementsByTagName("video");for(let De=0;De{let{value:se}=X.target;y&&(f(se/1e3),y.currentTime=se/1e3)},K=()=>{y&&(N(!m),y==null||y.requestFullscreen())};A.useEffect(()=>{P(D/c*100)},[D]),A.useEffect(()=>{y&&(y.onerror=()=>{W(!1)},y.onwaiting=()=>{E(!0)},y.onplaying=()=>{E(!1)},y.onloadeddata=()=>{a((y==null?void 0:y.currentTime)%60),h((y==null?void 0:y.currentTime)/60%60),x((y==null?void 0:y.duration)%60),S((y==null?void 0:y.duration)/60%60),p(y==null?void 0:y.duration),f(y==null?void 0:y.currentTime),W(!1),E(!1)},y.ontimeupdate=()=>{y&&(y!=null&&y.currentTime)&&(a((y==null?void 0:y.currentTime)%60),h((y==null?void 0:y.currentTime)/60%60),f(y==null?void 0:y.currentTime),P(y.currentTime/y.duration*100)),y&&(y!=null&&y.duration)&&(x((y==null?void 0:y.duration)%60),S((y==null?void 0:y.duration)/60%60),p(y==null?void 0:y.duration))},y.onended=()=>{f(0),a(0),h(0),P(0),B(0),s(!1)})},[o,y]),A.useEffect(()=>{y&&(y!=null&&y.played&&s(!0),y!=null&&y.paused&&s(!1))},[y==null?void 0:y.played,y==null?void 0:y.paused,m]),A.useEffect(()=>{if(!m&&y){s(!1),y.pause();return}else m&&y&&y.play()},[m]);const T={"--sarufi-video-seek-before-width":R+"%","--sarufi-video-buffer-before-width":L/c*100+"%","--sarufi-font-family":n==="InterRegular"?"'Inter', sans-serif":n==="PoppinsRegular"?"'Poppins', sans-serif":n==="inherit"?"inherit":"'Inter', sans-serif","--sarufi-font-size":r},F=({showBottomControllers:X})=>{var se;return v(Pe,{children:y!=null&&y.duration&&!((se=y==null?void 0:y.error)!=null&&se.code)&&!k?I("div",{className:"sarufi-video-controls",onClick:()=>{m||re()},style:{height:m?"50px":"100%",position:m?"relative":"absolute",...m?{backgroundColor:"rgba(0, 0, 0, .6)"}:{top:0,left:0,cursor:"pointer"}},children:[!X&&v("div",{className:`sarufi-center-controls ${o?"":"sarufi-video-not-playing"}`,children:v(Pe,{children:v("button",{title:o?"Pause":"Play",style:{background:"rgba(11,20,26,.35)",border:"none",color:"white",borderRadius:"50%",height:"30px",width:"30px",cursor:"pointer"},onClick:re,className:"sarufi-flex-center sarufi-button",children:v(zo,{size:20})})})}),X&&v("div",{className:"sarufi-video-more-controls",children:I("div",{className:"sarufi-more-controls-container",children:[I("div",{className:"sarufi-flex-wide",style:{padding:"0 .5rem"},children:[I("div",{className:"sarufi-video-time-controls sarufi-flex-start",children:[v("button",{title:o?"Pause":"Play",style:{background:"rgba(11,20,26,.35)",border:"none",color:"white",borderRadius:"50%",height:"30px",width:"30px",cursor:"pointer","--sarufi-received-box-color":"white"},onClick:re,className:"sarufi-flex-center sarufi-button",children:Z?v(Pe,{children:v(xr,{fromPlay:!0})}):v(Pe,{children:o?v(Gf,{size:14}):v(zo,{size:14})})}),v("span",{style:{transform:"scale(0.8)"},children:d<10?`0${Math.floor(d)}`:Math.floor(d)})," : ",v("span",{style:{transform:"scale(0.8)"},children:u<10?`0${Math.floor(u)}`:`${Math.floor(u)}`})," / ",v("span",{style:{transform:"scale(0.8)"},children:w<10?`0${Math.floor(w)}`:Math.floor(w)})," : ",v("span",{style:{transform:"scale(0.8)"},children:g<10?`0${Math.floor(g)}`:`${Math.floor(g)}`})]}),v("button",{className:"sarufi-video-full-screen-toggle sarufi-button",onClick:K,style:{cursor:"pointer",background:"none",border:"none",color:"currentcolor"},children:v(V0,{size:14})})]}),v("div",{style:{...T},className:"sarufi-bar sarufi-duration__bar",children:v("input",{type:"range",id:"progress",disabled:!c,step:1e-4,value:D&&D*1e3,max:c&&c*1e3,onChange:ie})})]})})]}):null})};return I(Pe,{children:[k?v("div",{style:{background:i==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".5rem",fontSize:14,display:"flex",justifyContent:"center"},children:v(xr,{})}):null,I("div",{className:"sarufi-video-player",style:{...T},children:[I("video",{id:l,disablePictureInPicture:!0,controlsList:"nodownload",src:e,onContextMenu:X=>{X.preventDefault()},style:{maxWidth:"100%",height:k||!(y!=null&&y.duration)||(M=y==null?void 0:y.error)!=null&&M.code||!y?"0":"auto",display:k||!(y!=null&&y.duration)||(j=y==null?void 0:y.error)!=null&&j.code||!y?"none":"block",width:"100%",objectFit:"cover",borderRadius:".3rem"},children:[v("source",{src:e,type:"video/mp4"}),v("span",{children:"Your Browser does not support this video format"})]},e),y!=null&&y.duration?v(F,{showBottomControllers:!1}):null,v(Zf,{mode:i??"light",open:m,close:()=>N(!1),closeWithBackdrop:!0,children:I("div",{className:"sarufi-video-player",style:{maxWidth:"calc( 100vw - 30px )",maxHeight:"calc( 100vh - 180px )",width:"100%",height:"auto",...T},children:[I("video",{id:l+"-preview",disablePictureInPicture:!0,controlsList:"nodownload",src:e,onContextMenu:X=>{X.preventDefault()},onClick:re,style:{maxWidth:"calc( 100vw - 30px )",maxHeight:"calc( 100vh - 180px )",width:"100%",height:"auto",objectFit:"cover",display:"block"},children:[v("source",{src:e,type:"video/mp4"}),v("span",{children:"Your Browser does not support this video format"})]},e),v(F,{showBottomControllers:!0}),v("div",{className:"sarufi-flex-center",children:v("div",{style:{textAlign:"center",fontFamily:n==="InterRegular"?"'Inter', sans-serif":n==="PoppinsRegular"?"'Poppins', sans-serif":n==="inherit"?"inherit":"'Inter', sans-serif",fontSize:r,color:"white",marginTop:".3rem"},children:t})})]})})]}),(y==null?void 0:y.error)&&!(y!=null&&y.duration)&&!k&&v("div",{style:{color:i==="dark"?"#e76262":"red",background:i==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".5rem",fontSize:14},children:((V=y==null?void 0:y.error)==null?void 0:V.code)===1?"Loading video resorces was aborted":((ze=y==null?void 0:y.error)==null?void 0:ze.code)===2?"Failed to play video due to network error":((ge=y==null?void 0:y.error)==null?void 0:ge.code)===3?"Failed to decode video resorces":((Ue=y==null?void 0:y.error)==null?void 0:Ue.code)===4?"Video resources not supported":"Failed to load video resources"})]})},va=({url:e,caption:t,openFullScreen:n,isFullScreen:r,fontFamily:l,fontSize:i})=>v("div",{style:{"--sarufi-font-family":l==="InterRegular"?"'Inter', sans-serif":l==="PoppinsRegular"?"'Poppins', sans-serif":l==="inherit"?"inherit":"'Inter', sans-serif","--sarufi-font-size":i},children:I("figure",{style:{marginInlineStart:0,marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0},children:[v("picture",{className:"sarufi-flex-center",onClick:n,tabIndex:0,children:v("img",{src:e,alt:"Preview Image",style:{borderRadius:".3rem",...r?{maxHeight:"calc( 100vh - 180px )",maxWidth:"calc( 100vw - 30px )",objectFit:"contain"}:{width:"100%",height:"auto",objectFit:"cover"}}})}),t&&r&&v("figcaption",{className:`${r?"sarufi-flex-center":""}`,style:{marginTop:".5rem"},children:v("span",{style:{textAlign:r?"center":"left",color:"white"},children:t})})]})});const Wn=({type:e,url:t="",caption:n="",mode:r,fontFamily:l,fontSize:i,index:o,chat:s,mediaId:u,location:a,showArrow:d,style:h})=>{const[g,x]=A.useState(!1),w=["images","stickers","videos","audios","documents","locations"],S=w.findIndex(f=>f===e),D=w.findIndex(f=>{var c,p,m,N,R,P,L,B,k,W,Z,E,y,re,ie;return f==="images"&&((m=(p=(c=s==null?void 0:s.actions)==null?void 0:c.find(K=>K.send_images))==null?void 0:p.send_images)==null?void 0:m.length)>0||f==="stickers"&&((P=(R=(N=s==null?void 0:s.actions)==null?void 0:N.find(K=>K.send_stickers))==null?void 0:R.send_stickers)==null?void 0:P.length)>0||f==="audios"&&((k=(B=(L=s==null?void 0:s.actions)==null?void 0:L.find(K=>K.send_audios))==null?void 0:B.send_audios)==null?void 0:k.length)>0||f==="videos"&&((E=(Z=(W=s==null?void 0:s.actions)==null?void 0:W.find(K=>K.send_videos))==null?void 0:Z.send_videos)==null?void 0:E.length)>0?!0:f==="documents"&&((ie=(re=(y=s==null?void 0:s.actions)==null?void 0:y.find(K=>K.send_documents))==null?void 0:re.send_documents)==null?void 0:ie.length)>0});return I("div",{className:`sarufi-media-preview sarufi-message-body ${S<=D&&!o||d?"sarufi-message-body-w-arrow":""}`,style:{background:"var(--sarufi-received-box-bg)",maxWidth:280,padding:"6px 8px 8px 9px",marginTop:S<=D&&!o?".7rem":"0",marginBottom:".3rem",position:"relative",borderTopLeftRadius:S<=D?"7.5px":"0",borderTopRightRadius:S<=D?"7.5px":"0",...h},children:[I(Pe,{children:[(e==="images"||e==="stickers")&&v(va,{url:t,caption:n,openFullScreen:()=>x(!0),isFullScreen:!1,fontFamily:l,fontSize:i}),e==="audios"&&v("div",{style:{background:r==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".1rem .5rem"},children:v(X0,{url:t,fontSize:i,mode:r,mediaId:u})}),e==="videos"&&v(J0,{url:t,caption:n,fontFamily:l,fontSize:i,mediaId:u,mode:r}),e==="documents"&&v("div",{style:{background:r==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".1rem .5rem"},children:v(G0,{url:t})}),e==="locations"&&I("div",{style:{margin:".5rem"},children:[v("div",{style:{marginBottom:".4rem"},children:"Location:"}),I("div",{children:[(a==null?void 0:a.latitude)&&v("div",{children:I("p",{style:{},children:[v("span",{style:{opacity:.7},children:"Latitude:"})," ",a==null?void 0:a.latitude]})}),(a==null?void 0:a.longitude)&&v("div",{children:I("p",{style:{marginTop:".2rem"},children:[v("span",{style:{opacity:.7},children:"Longitude:"})," ",a==null?void 0:a.longitude]})}),(a==null?void 0:a.name)&&v("div",{children:I("p",{style:{marginTop:".2rem"},children:[v("span",{style:{opacity:.7},children:"Name:"})," ",a==null?void 0:a.name]})}),(a==null?void 0:a.address)&&v("div",{children:I("p",{style:{marginTop:".2rem"},children:[v("span",{style:{opacity:.7},children:"Address:"})," ",a==null?void 0:a.address]})})]})]})]}),v(Zf,{close:()=>x(!1),open:g,closeWithBackdrop:!0,mode:r,children:v(Pe,{children:(e==="images"||e==="stickers")&&v(va,{url:t,caption:n,openFullScreen:()=>x(!0),isFullScreen:g,fontFamily:l,fontSize:i})})}),n&&v("p",{style:{margin:".5rem 0 .7rem",color:"var(--sarufi-received-box-color)",fontFamily:"var(--sarufi-font-family)"},children:bf(qf(n))})]})},G0=({url:e})=>I("div",{style:{margin:".5rem .5rem .5rem 0rem"},className:"sarufi-flex-wide",children:[v("div",{style:{width:"calc( 100% - 50px )",transform:"scale(0.9)"},children:v("span",{className:"sarufi-flex-start",style:{width:"100%",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},children:v("span",{children:e})})}),v("button",{style:{background:"none",border:"none",cursor:"pointer",color:"var(--sent-box-text-color)"},className:"sarufi-button",onClick:()=>Z0(e),children:v(Q0,{})})]});function Z0(e){const t=document.createElement("a");t.href=e,t.download="sarufi_document",t.download=e.replace(/^.*[\\\/]/,""),document.body.appendChild(t),t.click(),t.remove()}const q0=({chat:e,mode:t,fontFamily:n,fontSize:r,messageIndex:l})=>{var i,o,s,u,a,d,h,g,x,w,S,D,f,c,p,m,N,R,P,L,B,k,W,Z;return I(Pe,{children:[((i=e==null?void 0:e.actions)==null?void 0:i.find(E=>E==null?void 0:E.send_images))&&((u=(s=(o=e==null?void 0:e.actions)==null?void 0:o.find(E=>E==null?void 0:E.send_images))==null?void 0:s.send_images)==null?void 0:u.map((E,y)=>v(Wn,{url:E.link,caption:(E==null?void 0:E.caption)??"",type:"images",mode:t,fontFamily:n,fontSize:r,index:y,mediaId:`sarufi-images-player-${l}-${y}`,chat:e},y))),((a=e==null?void 0:e.actions)==null?void 0:a.find(E=>E==null?void 0:E.send_stickers))&&((g=(h=(d=e==null?void 0:e.actions)==null?void 0:d.find(E=>E==null?void 0:E.send_stickers))==null?void 0:h.send_stickers)==null?void 0:g.map((E,y)=>v(Wn,{url:E.link,caption:(E==null?void 0:E.caption)??"",type:"stickers",mode:t,fontFamily:n,fontSize:r,index:y,mediaId:`sarufi-stickers-player-${l}-${y}`,chat:e},y))),((x=e==null?void 0:e.actions)==null?void 0:x.find(E=>E==null?void 0:E.send_videos))&&((D=(S=(w=e==null?void 0:e.actions)==null?void 0:w.find(E=>E==null?void 0:E.send_videos))==null?void 0:S.send_videos)==null?void 0:D.map((E,y)=>v(Wn,{url:E.link,caption:(E==null?void 0:E.caption)??"",type:"videos",mode:t,fontFamily:n,fontSize:r,index:y,mediaId:`sarufi-videos-player-${l}-${y}`,chat:e},y))),((f=e==null?void 0:e.actions)==null?void 0:f.find(E=>E==null?void 0:E.send_audios))&&((m=(p=(c=e==null?void 0:e.actions)==null?void 0:c.find(E=>E==null?void 0:E.send_audios))==null?void 0:p.send_audios)==null?void 0:m.map((E,y)=>v(Wn,{url:E.link,caption:(E==null?void 0:E.caption)??"",type:"audios",mode:t,fontFamily:n,fontSize:r,index:y,mediaId:`sarufi-audios-player-${l}-${y}`,chat:e},y))),((N=e==null?void 0:e.actions)==null?void 0:N.find(E=>E==null?void 0:E.send_documents))&&((L=(P=(R=e==null?void 0:e.actions)==null?void 0:R.find(E=>E==null?void 0:E.send_documents))==null?void 0:P.send_documents)==null?void 0:L.map((E,y)=>v(Wn,{url:E.link,caption:(E==null?void 0:E.caption)??"",type:"documents",mode:t,fontFamily:n,fontSize:r,index:y,mediaId:`sarufi-documents-player-${l}-${y}`,chat:e},y))),((B=e==null?void 0:e.actions)==null?void 0:B.find(E=>E==null?void 0:E.send_locations))&&((Z=(W=(k=e==null?void 0:e.actions)==null?void 0:k.find(E=>E==null?void 0:E.send_locations))==null?void 0:W.send_locations)==null?void 0:Z.map((E,y)=>v("div",{style:{fontSize:"calc(var(--sarufi-font-size) * 0.9 )",background:t==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".1rem .5rem"},children:I("div",{style:{margin:".5rem"},children:[v("div",{style:{marginBottom:".4rem"},children:"Location:"}),I("div",{children:[(E==null?void 0:E.latitude)&&v("div",{children:I("p",{style:{marginTop:".2rem"},children:[v("span",{style:{opacity:.7},children:"Latitude:"})," ",E==null?void 0:E.latitude]})}),(E==null?void 0:E.longitude)&&v("div",{children:I("p",{style:{marginTop:".2rem"},children:[v("span",{style:{opacity:.7},children:"Longitude:"})," ",E==null?void 0:E.longitude]})}),(E==null?void 0:E.name)&&v("div",{children:I("p",{style:{marginTop:".2rem"},children:[v("span",{style:{opacity:.7},children:"Name:"})," ",E==null?void 0:E.name]})}),(E==null?void 0:E.address)&&v("div",{children:I("p",{style:{marginTop:".2rem"},children:[v("span",{style:{opacity:.7},children:"Address:"})," ",E==null?void 0:E.address]})})]})]})},y)))]})},b0=({id:e,open:t,botId:n,API_URL:r,mode:l,primaryColor:i,token:o,fontFamily:s,fontSize:u})=>{const[a,d]=A.useState([]),[h,g]=A.useState(""),[x,w]=A.useState(!1),S=A.useRef(null),D=(f,c,p)=>{f&&(d(m=>[...m,{message:f,sent:!0}]),g(""),w(!0),Jf.post(`${r}${o?"/conversation/whatsapp":"/plugin/conversation/"+n}`,{message:p??f,chat_id:e,bot_id:n,message_type:c??"text"},{headers:{"Content-Type":"application/json",...o?{Authorization:"Bearer "+o}:{}}}).then(m=>{d(N=>{var R,P,L,B,k,W,Z,E,y,re,ie,K,T,F,M,j,V,ze,ge,Ue,X,se,De,st;return[...N,{message:typeof((R=m==null?void 0:m.data)==null?void 0:R.actions)=="object"&&((B=(L=(P=m==null?void 0:m.data)==null?void 0:P.actions)==null?void 0:L.find(fe=>fe==null?void 0:fe.send_message))!=null&&B.send_message)?(Z=(W=(k=m==null?void 0:m.data)==null?void 0:k.actions)==null?void 0:W.find(fe=>fe==null?void 0:fe.send_message))==null?void 0:Z.send_message:typeof((E=m==null?void 0:m.data)==null?void 0:E.message)=="string"?(y=m==null?void 0:m.data)==null?void 0:y.message:(ie=(re=m==null?void 0:m.data)==null?void 0:re.response)!=null&&ie.find(fe=>Object.keys(fe)[0]==="send_message")?(M=(F=(T=(K=m==null?void 0:m.data)==null?void 0:K.response)==null?void 0:T.find(fe=>Object.keys(fe)[0]==="send_message"))==null?void 0:F.send_message)==null?void 0:M.join(` -`):(V=(j=m==null?void 0:m.data)==null?void 0:j.message)==null?void 0:V.join(` -`),received:!0,chat:m==null?void 0:m.data,type:(ze=m==null?void 0:m.data)!=null&&ze.actions?(se=(X=(Ue=(ge=m==null?void 0:m.data)==null?void 0:ge.actions)==null?void 0:Ue.find(fe=>fe==null?void 0:fe.send_reply_button))==null?void 0:X.send_reply_button)==null?void 0:se.type:"",actions:(De=m==null?void 0:m.data)==null?void 0:De.actions,next_state:(st=m==null?void 0:m.data)==null?void 0:st.next_state}]}),w(!1)}).catch(m=>{d(N=>{var R,P,L,B,k,W,Z,E,y,re,ie,K,T;return[...N,{message:typeof((P=(R=m==null?void 0:m.response)==null?void 0:R.data)==null?void 0:P.detail)=="string"?(B=(L=m==null?void 0:m.response)==null?void 0:L.data)==null?void 0:B.detail:typeof((W=(k=m==null?void 0:m.response)==null?void 0:k.data)==null?void 0:W.detail)=="object"?(y=(E=(Z=m==null?void 0:m.response)==null?void 0:Z.data)==null?void 0:E.detail[0])==null?void 0:y.msg:typeof((ie=(re=m==null?void 0:m.response)==null?void 0:re.data)==null?void 0:ie.message)=="string"?(T=(K=m==null?void 0:m.response)==null?void 0:K.data)==null?void 0:T.message:m==null?void 0:m.message}]}),w(!1)}))};return A.useEffect(()=>{var f;S.current&&(S.current.scrollTop=((f=S.current)==null?void 0:f.scrollHeight)-S.current.clientHeight)},[a]),A.useEffect(()=>{d([]),g("")},[t]),I(Pe,{children:[v("div",{ref:S,id:"sarufi-chat-container",style:{background:"var(--sarufi-chatbox-bg)",height:"calc( 100% - 100px )",overflowY:"auto",position:"relative"},className:"sarufi-scroll-bar",children:I("div",{style:{position:"relative",padding:"1rem"},children:[v("div",{className:"sarufi-message-body sarufi-message-body-w-arrow",style:{maxWidth:280,background:"var(--sarufi-received-box-bg)",padding:"6px 8px 8px 9px",marginTop:".7rem",position:"relative",borderRadius:".3rem"},children:v("p",{style:{fontFamily:"var(--sarufi-font-family)"},children:'Send a message to initiate conversation i.e "Hello"'})}),I("ul",{children:[a==null?void 0:a.map((f,c)=>v(eh,{chat:f,onSubmit:D,mode:l,fontFamily:s,fontSize:u,index:c},c)),x&&v("div",{className:"sarufi-message-body sarufi-message-body-w-arrow",style:{background:"var(--sarufi-received-box-bg)",padding:"6px 8px 8px 9px",marginTop:".7rem",position:"relative",borderRadius:".3rem",maxWidth:100},children:v(xr,{})})]})]})}),I("form",{style:{position:"absolute",background:l==="light"?"white":"var(--sarufi-primary-color)"},onSubmit:f=>{f.preventDefault(),D(h)},children:[v(Y0,{value:h,mode:l,primaryColor:i,autoFocus:!0,placeholder:"Compose a message",save:()=>D(h),onChange:f=>{g(f.target.value)}}),v(K0,{mode:l,label:v("span",{className:"sarufi-flex-center",children:v(W0,{size:30})})})]})]})},eh=({chat:e,onSubmit:t,mode:n,fontFamily:r,fontSize:l,index:i})=>{var g,x,w,S,D,f,c,p,m,N,R,P,L,B,k,W,Z,E,y,re,ie,K,T,F,M,j,V,ze,ge,Ue,X,se,De,st,fe,Ms,Is,As,Bs,js,Us;let o=(e==null?void 0:e.type)==="button"?(S=(w=(x=(g=e==null?void 0:e.actions)==null?void 0:g.find(O=>O==null?void 0:O.send_reply_button))==null?void 0:x.send_reply_button)==null?void 0:w.body)==null?void 0:S.text:e==null?void 0:e.message,s=(D=e==null?void 0:e.actions)==null?void 0:D.find(O=>Object.keys(O)[0]==="send_button");const[u,a]=A.useState(!1);A.useEffect(()=>{let O=document.getElementById("sarufi-chat-container");u&&O&&(O.style.overflowY="hidden"),!u&&O&&(O.style.overflowY="auto")},[u]);const d=O=>{if(O.key==="Escape")return a(!1)};A.useEffect(()=>(document.addEventListener("keydown",d,!1),()=>{document.removeEventListener("keydown",d,!1)}),[]);let h=!1;return(f=e==null?void 0:e.actions)!=null&&f.find(O=>O.send_audios&&O.send_audios.length>0||O.send_images&&O.send_images.length>0||O.send_videos&&O.send_videos.length>0||O.send_documents&&O.send_documents.length>0||O.send_stickers&&O.send_stickers.length>0||O.send_locations&&O.send_locations.length>0)&&(h=!0),I("li",{className:`${e!=null&&e.sent?"sarufi-flex-end":""}`,style:{position:"relative"},children:[!(e!=null&&e.sent)&&v("div",{style:{maxWidth:280,width:"80%"},children:v(q0,{chat:e,mode:n,fontFamily:r,fontSize:l,messageIndex:i})}),I("div",{className:`sarufi-message-body ${h?"":"sarufi-message-body-w-arrow"} ${e!=null&&e.sent?"sent":""}`,style:{background:e!=null&&e.sent?"var(--sarufi-sent-box-bg)":"var(--sarufi-received-box-bg)",maxWidth:280,width:h?"100%":"max-content",minWidth:"50px",padding:"6px 8px 8px 9px",marginTop:h?"0":"12px",position:"relative",borderRadius:((R=(N=(m=(p=(c=e==null?void 0:e.actions)==null?void 0:c.find(O=>O==null?void 0:O.send_reply_button))==null?void 0:p.send_reply_button)==null?void 0:m.action)==null?void 0:N.buttons)==null?void 0:R.length)>0||(!o||typeof o!="string")&&(e!=null&&e.actions)&&s?"0rem":".3rem",...!h&&!(e!=null&&e.sent)?{borderTopRightRadius:".3rem"}:{}},children:[(!o||typeof o!="string")&&(e==null?void 0:e.actions)&&s&&I(Pe,{children:[((P=s.send_button)==null?void 0:P.header)&&v(Yr,{message:(L=s.send_button)==null?void 0:L.header,style:{marginBottom:"1rem"}}),((B=s.send_button)==null?void 0:B.body)&&v(Yr,{message:(k=s.send_button)==null?void 0:k.body}),((W=s.send_button)==null?void 0:W.footer)&&v(Yr,{message:(Z=s.send_button)==null?void 0:Z.footer,style:{marginTop:"1rem",fontSize:".9em",opacity:.7}})]}),((e==null?void 0:e.type)||o)&&!s&&v(Yr,{message:typeof o=="string"?o:o==null?void 0:o.join(` -`)})]}),(e==null?void 0:e.type)==="button"&&v("ul",{className:"sarufi-flex-wide sarufi-flex-wrap",style:{maxWidth:280},children:(K=(ie=(re=(y=(E=e==null?void 0:e.actions)==null?void 0:E.find(O=>O==null?void 0:O.send_reply_button))==null?void 0:y.send_reply_button)==null?void 0:re.action)==null?void 0:ie.buttons)==null?void 0:K.map((O,ni)=>{var $s,Hs,Ws,Vs,Qs,Ks,Ys,Xs,Js,Gs,Zs;return v("li",{style:{width:"100%",marginTop:"2px",background:"var(--sarufi-received-box-bg)",borderBottomLeftRadius:ni===((Qs=(Vs=(Ws=(Hs=($s=e==null?void 0:e.actions)==null?void 0:$s.find(et=>et==null?void 0:et.send_reply_button))==null?void 0:Hs.send_reply_button)==null?void 0:Ws.action)==null?void 0:Vs.buttons)==null?void 0:Qs.length)-1?".3rem":"0",borderBottomRightRadius:ni===((Gs=(Js=(Xs=(Ys=(Ks=e==null?void 0:e.actions)==null?void 0:Ks.find(et=>et==null?void 0:et.send_reply_button))==null?void 0:Ys.send_reply_button)==null?void 0:Xs.action)==null?void 0:Js.buttons)==null?void 0:Gs.length)-1?".3rem":"0"},children:v("button",{onClick:()=>{var et,qs;return t((et=O==null?void 0:O.reply)==null?void 0:et.title,(e==null?void 0:e.type)!=="text"?"interactive":"text",(qs=O==null?void 0:O.reply)==null?void 0:qs.id)},style:{width:"100%",height:"100%",background:"none",border:"none",color:"var(--sarufi-received-box-link-color)",cursor:"pointer",fontSize:"inherit",padding:"10px",fontFamily:"var(--sarufi-font-family)"},className:"sarufi-flex-center sarufi-flex-wrap",children:(Zs=O==null?void 0:O.reply)==null?void 0:Zs.title})},ni)})}),(!o||typeof o!="string")&&(e==null?void 0:e.actions)&&s&&v("div",{className:"bg-neutral-0 sarufi-flex-center",style:{maxWidth:280,marginTop:"2px",background:"var(--sarufi-received-box-bg)",borderBottomLeftRadius:".3rem",borderBottomRightRadius:".3rem"},children:v("button",{onClick:()=>a(!0),className:"link text-small-100 sarufi-flex-center cursor-pointer",style:{width:"100%",height:"100%",background:"none",border:"none",color:"var(--sarufi-received-box-link-color)",cursor:"pointer",fontSize:"inherit",padding:"10px",fontFamily:"var(--sarufi-font-family)"},children:((T=s.send_button)==null?void 0:T.button)??((M=(F=s.send_button)==null?void 0:F.action)==null?void 0:M.button)})}),(!o||typeof o!="string")&&(e==null?void 0:e.actions)&&s&&u&&I("div",{className:"choices",style:{position:"fixed",zIndex:100004,transition:"0.35s linear"},children:[v("div",{className:"sarufi-backdrop",style:{position:"fixed",background:"rgba(0, 0, 0, 0.6)",zIndex:100004,transition:"0.35s linear"},onClick:()=>a(!1)}),I("div",{className:"sarufi-options sarufi-scroll-bar",style:{zIndex:100005,background:"var(--sarufi-received-box-bg)",color:"var(--sarufi-received-box-color)",borderRadius:".3rem"},children:[I("div",{className:"sarufi-flex-start",style:{padding:"1rem",paddingBottom:".5rem",marginBottom:"1rem"},children:[v("button",{onClick:()=>a(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--sarufi-received-box-color)"},className:"sarufi-button",children:v(Fs,{size:18})}),((ze=(V=(j=s.send_button)==null?void 0:j.action)==null?void 0:V.sections[0])==null?void 0:ze.title)&&v("p",{style:{width:"100%",marginLeft:"1rem",paddingRight:"2rem",textAlign:"center",fontFamily:"var(--sarufi-font-family)"},children:(X=(Ue=(ge=s.send_button)==null?void 0:ge.action)==null?void 0:Ue.sections[0])==null?void 0:X.title})]}),v("ul",{style:{padding:"1rem",paddingTop:"0"},children:((Ms=(fe=(st=(De=(se=s.send_button)==null?void 0:se.action)==null?void 0:De.sections[0])==null?void 0:st.rows)==null?void 0:fe.filter(O=>O==null?void 0:O.title))==null?void 0:Ms.length)>0&&((Us=(js=(Bs=(As=(Is=s.send_button)==null?void 0:Is.action)==null?void 0:As.sections[0])==null?void 0:Bs.rows)==null?void 0:js.filter(O=>O==null?void 0:O.title))==null?void 0:Us.map(O=>I("li",{className:"sarufi-flex-wide ",style:{marginBottom:"1.5rem",cursor:"pointer"},onClick:()=>{t(O==null?void 0:O.title,"interactive",O==null?void 0:O.id),a(!1)},children:[I("div",{children:[v("p",{className:"text-small-200",style:{fontFamily:"var(--sarufi-font-family)"},children:O==null?void 0:O.title}),v("p",{style:{opacity:".7",fontSize:".9em",fontFamily:"var(--sarufi-font-family)"},children:O==null?void 0:O.description})]}),v("div",{children:v("span",{className:"sarufi-flex-center",style:{height:15,width:15,borderRadius:"50%",border:"1px solid var(--sarufi-received-box-color)",marginLeft:"1rem"}})})]},O==null?void 0:O.title)))})]})]})]})},Yr=({message:e,className:t,style:n})=>v(Pe,{children:typeof e=="string"&&v("p",{style:{fontFamily:"var(--sarufi-font-family)",width:"100%",...n},className:t??"",dangerouslySetInnerHTML:{__html:qf(bf(e))}})}),qf=e=>{const t=/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g;let n=[];return e.split(" ").forEach(l=>{let i=l.split(` -`),o=[];i.forEach(s=>{if(!s.includes("."))return o=[...o,s];if(!t.test(s))return o=[...o,s];const a=/^(?:(?:https?|ftp):\/\/)/i.test(s)?s:"http://"+s;return o=[...o,''+s+""]}),n=[...n,o.join(` -`)]}),n.join(" ")},bf=e=>{var t,n,r;return e&&typeof e=="string"?(r=(n=(t=e==null?void 0:e.replace(/(?:\*)([^*]*)(?:\*)/gm,"$1 "))==null?void 0:t.replace(/(?:_)([^_]*)(?:_)/gm,"$1 "))==null?void 0:n.replace(/(?:~)([^~]*)(?:~)/gm,"$1 "))==null?void 0:r.replace(/(?:```)([^```]*)(?:```)/gm,"$1 "):e},th=({botId:e,token:t,theme:n})=>{const[r,l]=A.useState(!1),[i,o]=A.useState(new Date().valueOf()),[s,u]=A.useState({primaryColor:"#2776EA",borderColor:"lightgray",fontSize:"14",fontFamily:"InterRegular",sentBoxBg:"#D8F9D4",receivedBoxBg:"white",sentBoxColor:"black",receivedBoxColor:"black",chatboxBg:"#EDECE1",receivedBoxLinkColor:"blue",sentBoxLinkColor:"white",buttonSize:"md",mode:"light",title:"Chat",placement:"right",height:500,width:400}),a="https://api.sarufi.io",d=document.createElement("div");d.id="sarufi-modal",document.getElementById("sarufi-modal")||document.body.appendChild(d);const h=async()=>{if(n)return u(n);try{const{data:x}=await Jf.get(`${a}/plugin/${(window==null?void 0:window.botId)??e}/unauthenticated`);u(x==null?void 0:x.theme_config)}catch{}};A.useEffect(()=>{h()},[n]);const g={"--sarufi-primary-color":(s==null?void 0:s.mode)==="dark"?"#202C33":(s==null?void 0:s.primaryColor)??"#2776EA","--sarufi-font-size":`${(s==null?void 0:s.fontSize)??14}px`,"--sarufi-font-family":(s==null?void 0:s.fontFamily)==="InterRegular"?"'Inter', sans-serif":(s==null?void 0:s.fontFamily)==="PoppinsRegular"?"'Poppins', sans-serif":(s==null?void 0:s.fontFamily)==="inherit"?"inherit":"'Inter', sans-serif","--sarufi-border-color":(s==null?void 0:s.borderColor)??"lightgray","--sarufi-sent-box-bg":(s==null?void 0:s.mode)==="dark"?"#005C4B":(s==null?void 0:s.sentBoxBg)??"#D8F9D4","--sarufi-received-box-bg":(s==null?void 0:s.mode)==="dark"?"#202C33":(s==null?void 0:s.receivedBoxBg)??"white","--sarufi-sent-box-color":(s==null?void 0:s.mode)==="dark"?"white":(s==null?void 0:s.sentBoxColor)??"black","--sarufi-received-box-color":(s==null?void 0:s.mode)==="dark"?"white":(s==null?void 0:s.receivedBoxColor)??"black","--sarufi-sent-box-link-color":(s==null?void 0:s.mode)==="dark"?"#53BDEB":(s==null?void 0:s.sentBoxLinkColor)??"black","--sarufi-received-box-link-color":(s==null?void 0:s.mode)==="dark"?"#53BDEB":(s==null?void 0:s.receivedBoxLinkColor)??"black","--sarufi-chatbox-bg":(s==null?void 0:s.mode)==="dark"?"#0B141A":(s==null?void 0:s.chatboxBg)??"#EDECE1","--sarufi-chatbox-height":s!=null&&s.height?(s==null?void 0:s.height)+"px":"500px","--sarufi-chatbox-width":s!=null&&s.width?(s==null?void 0:s.width)+"px":"400px"};return I("div",{className:`sarufi-chat-container ${(s==null?void 0:s.placement)==="left"?"sarufi-left-align":"sarufi-right-align"} ${r?"open":""} - ${r?"sarufi-shadow-xl":"sarufi-flex-center"}`,style:{position:"fixed",fontFamily:(s==null?void 0:s.fontFamily)==="InterRegular"?"'Inter', sans-serif":(s==null?void 0:s.fontFamily)==="PoppinsRegular"?"'Poppins', sans-serif":(s==null?void 0:s.fontFamily)==="inherit"?"inherit":"'Inter', sans-serif",...r?{}:{height:(s==null?void 0:s.buttonSize)==="lg"?"70px":"50px",width:(s==null?void 0:s.buttonSize)==="lg"?"70px":"50px"},...g},children:[!r&&v("button",{className:"sarufi-shadow-xl sarufi-button",style:{display:"inline-flex",justifyContent:"center",alignItems:"center",position:"relative",cursor:"pointer",borderRadius:"50%",height:(s==null?void 0:s.buttonSize)==="lg"?"70px":(s==null?void 0:s.buttonSize)==="sm"?"30px":"50px",width:(s==null?void 0:s.buttonSize)==="lg"?"70px":(s==null?void 0:s.buttonSize)==="sm"?"30px":"50px",background:(s==null?void 0:s.primaryColor)??"#2776EA",color:"white",border:"none"},onClick:()=>l(!0),children:v(H0,{size:(s==null?void 0:s.buttonSize)==="sm"?20:30})}),r&&I("div",{style:{height:"100%",borderRadius:".5rem",overflow:"hidden"},children:[I("div",{className:"sarufi-flex-wide text-neutral-0",style:{height:"42px",paddingLeft:"1rem",paddingRight:"1rem",background:"var(--sarufi-primary-color)",color:"white"},children:[v("p",{className:"sarufi-ellipsed-text",style:{fontWeight:600,fontFamily:"var(--sarufi-font-family)",fontSize:s!=null&&s.fontSize?Number(s==null?void 0:s.fontSize)*1.1:"1.1em"},children:s==null?void 0:s.title}),v("button",{className:"flex-center sarufi-button",onClick:()=>{l(!1),o(new Date().valueOf())},style:{border:"none",background:"none",color:"white",cursor:"pointer"},children:v(Fs,{size:18,className:"text-neutral-0"})})]}),v(b0,{open:r,id:i,mode:(s==null?void 0:s.mode)??"light",primaryColor:(s==null?void 0:s.primaryColor)??"#2776EA",fontFamily:s.fontFamily??"inherit",fontSize:s.fontSize??16,botId:(window==null?void 0:window.botId)??e,token:t,API_URL:a})]})]})};Di.createRoot(document.getElementById("sarufi-chatbox")).render(v(gd.StrictMode,{children:v(th,{botId:(window==null?void 0:window.botId)??16})})); +`+i.stack}return{value:e,source:t,stack:l,digest:null}}function Li(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function go(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var o0=typeof WeakMap=="function"?WeakMap:Map;function lf(e,t,n){n=dt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Il||(Il=!0,Po=r),go(e,t)},n}function of(e,t,n){n=dt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){go(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){go(e,t),typeof r!="function"&&(Mt===null?Mt=new Set([this]):Mt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new o0;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=S0.bind(null,e,t,n),t.then(e,e))}function Ku(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zu(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=dt(-1,1),t.tag=2,zt(n,t,1))),n.lanes|=1),e)}var s0=vt.ReactCurrentOwner,Le=!1;function xe(e,t,n,r){t.child=e===null?Ac(t,null,n,r):_n(t,e.child,n,r)}function Yu(e,t,n,r,l){n=n.render;var i=t.ref;return Sn(t,l),r=hs(e,t,n,r,i,l),n=ys(),e!==null&&!Le?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,gt(e,t,l)):(q&&n&&rs(t),t.flags|=1,xe(e,t,r,l),t.child)}function Ju(e,t,n,r,l){if(e===null){var i=n.type;return typeof i=="function"&&!Ns(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,sf(e,t,i,r,l)):(e=ul(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&l)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:mr,n(o,r)&&e.ref===t.ref)return gt(e,t,l)}return t.flags|=1,e=Dt(i,r),e.ref=t.ref,e.return=t,t.child=e}function sf(e,t,n,r,l){if(e!==null){var i=e.memoizedProps;if(mr(i,r)&&e.ref===t.ref)if(Le=!1,t.pendingProps=r=i,(e.lanes&l)!==0)e.flags&131072&&(Le=!0);else return t.lanes=e.lanes,gt(e,t,l)}return vo(e,t,n,r,l)}function uf(e,t,n){var r=t.pendingProps,l=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Z(hn,Ie),Ie|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Z(hn,Ie),Ie|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Z(hn,Ie),Ie|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Z(hn,Ie),Ie|=r;return xe(e,t,l,n),t.child}function af(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function vo(e,t,n,r,l){var i=Re(n)?Jt:ke.current;return i=En(t,i),Sn(t,l),n=hs(e,t,n,r,i,l),r=ys(),e!==null&&!Le?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,gt(e,t,l)):(q&&r&&rs(t),t.flags|=1,xe(e,t,n,l),t.child)}function Xu(e,t,n,r,l){if(Re(n)){var i=!0;Cl(t)}else i=!1;if(Sn(t,l),t.stateNode===null)il(e,t),Dc(t,n,r),yo(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var u=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Qe(c):(c=Re(n)?Jt:ke.current,c=En(t,c));var p=n.getDerivedStateFromProps,y=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function";y||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==r||u!==c)&&$u(t,o,r,c),Et=!1;var a=t.memoizedState;o.state=a,Tl(t,r,o,l),u=t.memoizedState,s!==r||a!==u||Te.current||Et?(typeof p=="function"&&(ho(t,n,p,r),u=t.memoizedState),(s=Et||Uu(t,n,s,r,a,u,c))?(y||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=c,r=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Mc(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Ye(t.type,s),o.props=c,y=t.pendingProps,a=o.context,u=n.contextType,typeof u=="object"&&u!==null?u=Qe(u):(u=Re(n)?Jt:ke.current,u=En(t,u));var E=n.getDerivedStateFromProps;(p=typeof E=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==y||a!==u)&&$u(t,o,r,u),Et=!1,a=t.memoizedState,o.state=a,Tl(t,r,o,l);var v=t.memoizedState;s!==y||a!==v||Te.current||Et?(typeof E=="function"&&(ho(t,n,E,r),v=t.memoizedState),(c=Et||Uu(t,n,c,r,a,v,u)||!1)?(p||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,u)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&a===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&a===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),o.props=r,o.state=v,o.context=u,r=c):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&a===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&a===e.memoizedState||(t.flags|=1024),r=!1)}return wo(e,t,n,r,i,l)}function wo(e,t,n,r,l,i){af(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&Du(t,n,!1),gt(e,t,i);r=t.stateNode,s0.current=t;var s=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=_n(t,e.child,null,i),t.child=_n(t,null,s,i)):xe(e,t,s,i),t.memoizedState=r.state,l&&Du(t,n,!0),t.child}function cf(e){var t=e.stateNode;t.pendingContext?Iu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Iu(e,t.context,!1),fs(e,t.containerInfo)}function Gu(e,t,n,r,l){return Cn(),is(l),t.flags|=256,xe(e,t,n,r),t.child}var So={dehydrated:null,treeContext:null,retryLane:0};function ko(e){return{baseLanes:e,cachePool:null,transitions:null}}function ff(e,t,n){var r=t.pendingProps,l=b.current,i=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(l&2)!==0),s?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),Z(b,l&1),e===null)return po(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Xl(o,r,0,null),e=Yt(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ko(n),t.memoizedState=So,e):ws(t,o));if(l=e.memoizedState,l!==null&&(s=l.dehydrated,s!==null))return u0(e,t,o,r,s,l,n);if(i){i=r.fallback,o=t.mode,l=e.child,s=l.sibling;var u={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Dt(l,u),r.subtreeFlags=l.subtreeFlags&14680064),s!==null?i=Dt(s,i):(i=Yt(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?ko(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=So,r}return i=e.child,e=i.sibling,r=Dt(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ws(e,t){return t=Xl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Kr(e,t,n,r){return r!==null&&is(r),_n(t,e.child,null,n),e=ws(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function u0(e,t,n,r,l,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Li(Error(N(422))),Kr(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,l=t.mode,r=Xl({mode:"visible",children:r.children},l,0,null),i=Yt(i,l,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&_n(t,e.child,null,o),t.child.memoizedState=ko(o),t.memoizedState=So,i);if(!(t.mode&1))return Kr(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var s=r.dgst;return r=s,i=Error(N(419)),r=Li(i,r,void 0),Kr(e,t,o,r)}if(s=(o&e.childLanes)!==0,Le||s){if(r=pe,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==i.retryLane&&(i.retryLane=l,yt(e,l),qe(r,e,l,-1))}return _s(),r=Li(Error(N(421))),Kr(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=k0.bind(null,e),l._reactRetry=t,null):(e=i.treeContext,De=Ot(l.nextSibling),Fe=t,q=!0,Xe=null,e!==null&&($e[He++]=ct,$e[He++]=ft,$e[He++]=Xt,ct=e.id,ft=e.overflow,Xt=t),t=ws(t,r.children),t.flags|=4096,t)}function qu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),mo(e.return,t,n)}function Ti(e,t,n,r,l){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=l)}function df(e,t,n){var r=t.pendingProps,l=r.revealOrder,i=r.tail;if(xe(e,t,r.children,n),r=b.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&qu(e,n,t);else if(e.tag===19)qu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Z(b,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Rl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Ti(t,!1,l,n,i);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Rl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Ti(t,!0,n,null,i);break;case"together":Ti(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function il(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),qt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(N(153));if(t.child!==null){for(e=t.child,n=Dt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Dt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function a0(e,t,n){switch(t.tag){case 3:cf(t),Cn();break;case 5:Bc(t);break;case 1:Re(t.type)&&Cl(t);break;case 4:fs(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;Z(Pl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Z(b,b.current&1),t.flags|=128,null):n&t.child.childLanes?ff(e,t,n):(Z(b,b.current&1),e=gt(e,t,n),e!==null?e.sibling:null);Z(b,b.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return df(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),Z(b,b.current),r)break;return null;case 22:case 23:return t.lanes=0,uf(e,t,n)}return gt(e,t,n)}var pf,xo,mf,hf;pf=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};xo=function(){};mf=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Kt(ot.current);var i=null;switch(n){case"input":l=Vi(e,l),r=Vi(e,r),i=[];break;case"select":l=te({},l,{value:void 0}),r=te({},r,{value:void 0}),i=[];break;case"textarea":l=Ki(e,l),r=Ki(e,r),i=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=xl)}Yi(n,r);var o;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var s=l[c];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(sr.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var u=r[c];if(s=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&u!==s&&(u!=null||s!=null))if(c==="style")if(s){for(o in s)!s.hasOwnProperty(o)||u&&u.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in u)u.hasOwnProperty(o)&&s[o]!==u[o]&&(n||(n={}),n[o]=u[o])}else n||(i||(i=[]),i.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,s=s?s.__html:void 0,u!=null&&s!==u&&(i=i||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(sr.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&J("scroll",e),i||s===u||(i=[])):(i=i||[]).push(c,u))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};hf=function(e,t,n,r){n!==r&&(t.flags|=4)};function Vn(e,t){if(!q)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function we(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function c0(e,t,n){var r=t.pendingProps;switch(ls(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return we(t),null;case 1:return Re(t.type)&&El(),we(t),null;case 3:return r=t.stateNode,Nn(),X(Te),X(ke),ps(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Wr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xe!==null&&(Ro(Xe),Xe=null))),xo(e,t),we(t),null;case 5:ds(t);var l=Kt(wr.current);if(n=t.type,e!==null&&t.stateNode!=null)mf(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(N(166));return we(t),null}if(e=Kt(ot.current),Wr(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[rt]=t,r[gr]=i,e=(t.mode&1)!==0,n){case"dialog":J("cancel",r),J("close",r);break;case"iframe":case"object":case"embed":J("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[rt]=t,e[gr]=r,pf(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ji(n,r),n){case"dialog":J("cancel",e),J("close",e),l=r;break;case"iframe":case"object":case"embed":J("load",e),l=r;break;case"video":case"audio":for(l=0;lLn&&(t.flags|=128,r=!0,Vn(i,!1),t.lanes=4194304)}else{if(!r)if(e=Rl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Vn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!q)return we(t),null}else 2*le()-i.renderingStartTime>Ln&&n!==1073741824&&(t.flags|=128,r=!0,Vn(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=le(),t.sibling=null,n=b.current,Z(b,r?n&1|2:n&1),t):(we(t),null);case 22:case 23:return Cs(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ie&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function f0(e,t){switch(ls(t),t.tag){case 1:return Re(t.type)&&El(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nn(),X(Te),X(ke),ps(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ds(t),null;case 13:if(X(b),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));Cn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(b),null;case 4:return Nn(),null;case 10:return us(t.type._context),null;case 22:case 23:return Cs(),null;case 24:return null;default:return null}}var Zr=!1,Se=!1,d0=typeof WeakSet=="function"?WeakSet:Set,z=null;function mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ne(e,t,r)}else n.current=null}function Eo(e,t,n){try{n()}catch(r){ne(e,t,r)}}var bu=!1;function p0(e,t){if(io=wl,e=vc(),ns(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,s=-1,u=-1,c=0,p=0,y=e,a=null;t:for(;;){for(var E;y!==n||l!==0&&y.nodeType!==3||(s=o+l),y!==i||r!==0&&y.nodeType!==3||(u=o+r),y.nodeType===3&&(o+=y.nodeValue.length),(E=y.firstChild)!==null;)a=y,y=E;for(;;){if(y===e)break t;if(a===n&&++c===l&&(s=o),a===i&&++p===r&&(u=o),(E=y.nextSibling)!==null)break;y=a,a=y.parentNode}y=E}n=s===-1||u===-1?null:{start:s,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(oo={focusedElem:e,selectionRange:n},wl=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var S=v.memoizedProps,I=v.memoizedState,d=t.stateNode,f=d.getSnapshotBeforeUpdate(t.elementType===t.type?S:Ye(t.type,S),I);d.__reactInternalSnapshotBeforeUpdate=f}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(k){ne(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return v=bu,bu=!1,v}function rr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Eo(t,n,i)}l=l.next}while(l!==r)}}function Yl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Co(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function yf(e){var t=e.alternate;t!==null&&(e.alternate=null,yf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[rt],delete t[gr],delete t[ao],delete t[Jp],delete t[Xp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function gf(e){return e.tag===5||e.tag===3||e.tag===4}function ea(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _o(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xl));else if(r!==4&&(e=e.child,e!==null))for(_o(e,t,n),e=e.sibling;e!==null;)_o(e,t,n),e=e.sibling}function No(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(No(e,t,n),e=e.sibling;e!==null;)No(e,t,n),e=e.sibling}var me=null,Je=!1;function St(e,t,n){for(n=n.child;n!==null;)vf(e,t,n),n=n.sibling}function vf(e,t,n){if(it&&typeof it.onCommitFiberUnmount=="function")try{it.onCommitFiberUnmount(Ul,n)}catch{}switch(n.tag){case 5:Se||mn(n,t);case 6:var r=me,l=Je;me=null,St(e,t,n),me=r,Je=l,me!==null&&(Je?(e=me,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):me.removeChild(n.stateNode));break;case 18:me!==null&&(Je?(e=me,n=n.stateNode,e.nodeType===8?xi(e.parentNode,n):e.nodeType===1&&xi(e,n),dr(e)):xi(me,n.stateNode));break;case 4:r=me,l=Je,me=n.stateNode.containerInfo,Je=!0,St(e,t,n),me=r,Je=l;break;case 0:case 11:case 14:case 15:if(!Se&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Eo(n,t,o),l=l.next}while(l!==r)}St(e,t,n);break;case 1:if(!Se&&(mn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){ne(n,t,s)}St(e,t,n);break;case 21:St(e,t,n);break;case 22:n.mode&1?(Se=(r=Se)||n.memoizedState!==null,St(e,t,n),Se=r):St(e,t,n);break;default:St(e,t,n)}}function ta(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new d0),t.forEach(function(r){var l=x0.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Ze(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=le()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*h0(r/1960))-r,10e?16:e,Pt===null)var r=!1;else{if(e=Pt,Pt=null,Dl=0,H&6)throw Error(N(331));var l=H;for(H|=4,z=e.current;z!==null;){var i=z,o=i.child;if(z.flags&16){var s=i.deletions;if(s!==null){for(var u=0;ule()-xs?Zt(e,0):ks|=n),Oe(e,t)}function Nf(e,t){t===0&&(e.mode&1?(t=Br,Br<<=1,!(Br&130023424)&&(Br=4194304)):t=1);var n=Ce();e=yt(e,t),e!==null&&(Pr(e,t,n),Oe(e,n))}function k0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Nf(e,n)}function x0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Nf(e,n)}var Pf;Pf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Te.current)Le=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Le=!1,a0(e,t,n);Le=!!(e.flags&131072)}else Le=!1,q&&t.flags&1048576&&Tc(t,Nl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;il(e,t),e=t.pendingProps;var l=En(t,ke.current);Sn(t,n),l=hs(null,t,r,e,l,n);var i=ys();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Re(r)?(i=!0,Cl(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,cs(t),l.updater=Kl,t.stateNode=l,l._reactInternals=t,yo(t,r,e,n),t=wo(null,t,r,!0,i,n)):(t.tag=0,q&&i&&rs(t),xe(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(il(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=C0(r),e=Ye(r,e),l){case 0:t=vo(null,t,r,e,n);break e;case 1:t=Xu(null,t,r,e,n);break e;case 11:t=Yu(null,t,r,e,n);break e;case 14:t=Ju(null,t,r,Ye(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ye(r,l),vo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ye(r,l),Xu(e,t,r,l,n);case 3:e:{if(cf(t),e===null)throw Error(N(387));r=t.pendingProps,i=t.memoizedState,l=i.element,Mc(e,t),Tl(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Pn(Error(N(423)),t),t=Gu(e,t,r,n,l);break e}else if(r!==l){l=Pn(Error(N(424)),t),t=Gu(e,t,r,n,l);break e}else for(De=Ot(t.stateNode.containerInfo.firstChild),Fe=t,q=!0,Xe=null,n=Ac(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Cn(),r===l){t=gt(e,t,n);break e}xe(e,t,r,n)}t=t.child}return t;case 5:return Bc(t),e===null&&po(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,so(r,l)?o=null:i!==null&&so(r,i)&&(t.flags|=32),af(e,t),xe(e,t,o,n),t.child;case 6:return e===null&&po(t),null;case 13:return ff(e,t,n);case 4:return fs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=_n(t,null,r,n):xe(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ye(r,l),Yu(e,t,r,l,n);case 7:return xe(e,t,t.pendingProps,n),t.child;case 8:return xe(e,t,t.pendingProps.children,n),t.child;case 12:return xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,Z(Pl,r._currentValue),r._currentValue=o,i!==null)if(be(i.value,o)){if(i.children===l.children&&!Te.current){t=gt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var u=s.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=dt(-1,n&-n),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?u.next=u:(u.next=p.next,p.next=u),c.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),mo(i.return,n,t),s.lanes|=n;break}u=u.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(N(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),mo(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}xe(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Sn(t,n),l=Qe(l),r=r(l),t.flags|=1,xe(e,t,r,n),t.child;case 14:return r=t.type,l=Ye(r,t.pendingProps),l=Ye(r.type,l),Ju(e,t,r,l,n);case 15:return sf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ye(r,l),il(e,t),t.tag=1,Re(r)?(e=!0,Cl(t)):e=!1,Sn(t,n),Dc(t,r,l),yo(t,r,l,n),wo(null,t,r,!0,e,n);case 19:return df(e,t,n);case 22:return uf(e,t,n)}throw Error(N(156,t.tag))};function Lf(e,t){return ba(e,t)}function E0(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ve(e,t,n,r){return new E0(e,t,n,r)}function Ns(e){return e=e.prototype,!(!e||!e.isReactComponent)}function C0(e){if(typeof e=="function")return Ns(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qo)return 11;if(e===Ko)return 14}return 2}function Dt(e,t){var n=e.alternate;return n===null?(n=Ve(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ul(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")Ns(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ln:return Yt(n.children,l,i,t);case Wo:o=8,l|=8;break;case ji:return e=Ve(12,n,t,l|2),e.elementType=ji,e.lanes=i,e;case Ui:return e=Ve(13,n,t,l),e.elementType=Ui,e.lanes=i,e;case $i:return e=Ve(19,n,t,l),e.elementType=$i,e.lanes=i,e;case Fa:return Xl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ia:o=10;break e;case Da:o=9;break e;case Qo:o=11;break e;case Ko:o=14;break e;case xt:o=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=Ve(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Yt(e,t,n,r){return e=Ve(7,e,r,t),e.lanes=n,e}function Xl(e,t,n,r){return e=Ve(22,e,r,t),e.elementType=Fa,e.lanes=n,e.stateNode={isHidden:!1},e}function Ri(e,t,n){return e=Ve(6,e,null,t),e.lanes=n,e}function Oi(e,t,n){return t=Ve(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _0(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fi(0),this.expirationTimes=fi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fi(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ps(e,t,n,r,l,i,o,s,u){return e=new _0(e,t,n,s,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ve(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},cs(i),e}function N0(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Be})(Pd);const O0=xa(pl);var aa=pl;Fi.createRoot=aa.createRoot,Fi.hydrateRoot=aa.hydrateRoot;function zf(e,t){return function(){return e.apply(t,arguments)}}const{toString:Mf}=Object.prototype,{getPrototypeOf:Os}=Object,zs=(e=>t=>{const n=Mf.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),wt=e=>(e=e.toLowerCase(),t=>zs(t)===e),ti=e=>t=>typeof t===e,{isArray:Mn}=Array,Cr=ti("undefined");function z0(e){return e!==null&&!Cr(e)&&e.constructor!==null&&!Cr(e.constructor)&&Bt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const If=wt("ArrayBuffer");function M0(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&If(e.buffer),t}const I0=ti("string"),Bt=ti("function"),Df=ti("number"),Ms=e=>e!==null&&typeof e=="object",D0=e=>e===!0||e===!1,al=e=>{if(zs(e)!=="object")return!1;const t=Os(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},F0=wt("Date"),A0=wt("File"),B0=wt("Blob"),j0=wt("FileList"),U0=e=>Ms(e)&&Bt(e.pipe),$0=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||Mf.call(e)===t||Bt(e.toString)&&e.toString()===t)},H0=wt("URLSearchParams"),V0=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Or(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,l;if(typeof e!="object"&&(e=[e]),Mn(e))for(r=0,l=e.length;r0;)if(l=n[r],t===l.toLowerCase())return l;return null}const Af=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Bf=e=>!Cr(e)&&e!==Af;function Oo(){const{caseless:e}=Bf(this)&&this||{},t={},n=(r,l)=>{const i=e&&Ff(t,l)||l;al(t[i])&&al(r)?t[i]=Oo(t[i],r):al(r)?t[i]=Oo({},r):Mn(r)?t[i]=r.slice():t[i]=r};for(let r=0,l=arguments.length;r(Or(t,(l,i)=>{n&&Bt(l)?e[i]=zf(l,n):e[i]=l},{allOwnKeys:r}),e),Q0=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),K0=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Z0=(e,t,n,r)=>{let l,i,o;const s={};if(t=t||{},e==null)return t;do{for(l=Object.getOwnPropertyNames(e),i=l.length;i-- >0;)o=l[i],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Os(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Y0=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},J0=e=>{if(!e)return null;if(Mn(e))return e;let t=e.length;if(!Df(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},X0=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Os(Uint8Array)),G0=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let l;for(;(l=r.next())&&!l.done;){const i=l.value;t.call(e,i[0],i[1])}},q0=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},b0=wt("HTMLFormElement"),e1=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,l){return r.toUpperCase()+l}),ca=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),t1=wt("RegExp"),jf=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Or(n,(l,i)=>{t(l,i,e)!==!1&&(r[i]=l)}),Object.defineProperties(e,r)},n1=e=>{jf(e,(t,n)=>{if(Bt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Bt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},r1=(e,t)=>{const n={},r=l=>{l.forEach(i=>{n[i]=!0})};return Mn(e)?r(e):r(String(e).split(t)),n},l1=()=>{},i1=(e,t)=>(e=+e,Number.isFinite(e)?e:t),zi="abcdefghijklmnopqrstuvwxyz",fa="0123456789",Uf={DIGIT:fa,ALPHA:zi,ALPHA_DIGIT:zi+zi.toUpperCase()+fa},o1=(e=16,t=Uf.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function s1(e){return!!(e&&Bt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const u1=e=>{const t=new Array(10),n=(r,l)=>{if(Ms(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[l]=r;const i=Mn(r)?[]:{};return Or(r,(o,s)=>{const u=n(o,l+1);!Cr(u)&&(i[s]=u)}),t[l]=void 0,i}}return r};return n(e,0)},_={isArray:Mn,isArrayBuffer:If,isBuffer:z0,isFormData:$0,isArrayBufferView:M0,isString:I0,isNumber:Df,isBoolean:D0,isObject:Ms,isPlainObject:al,isUndefined:Cr,isDate:F0,isFile:A0,isBlob:B0,isRegExp:t1,isFunction:Bt,isStream:U0,isURLSearchParams:H0,isTypedArray:X0,isFileList:j0,forEach:Or,merge:Oo,extend:W0,trim:V0,stripBOM:Q0,inherits:K0,toFlatObject:Z0,kindOf:zs,kindOfTest:wt,endsWith:Y0,toArray:J0,forEachEntry:G0,matchAll:q0,isHTMLForm:b0,hasOwnProperty:ca,hasOwnProp:ca,reduceDescriptors:jf,freezeMethods:n1,toObjectSet:r1,toCamelCase:e1,noop:l1,toFiniteNumber:i1,findKey:Ff,global:Af,isContextDefined:Bf,ALPHABET:Uf,generateString:o1,isSpecCompliantForm:s1,toJSONObject:u1};function $(e,t,n,r,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),l&&(this.response=l)}_.inherits($,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:_.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const $f=$.prototype,Hf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Hf[e]={value:e}});Object.defineProperties($,Hf);Object.defineProperty($f,"isAxiosError",{value:!0});$.from=(e,t,n,r,l,i)=>{const o=Object.create($f);return _.toFlatObject(e,o,function(u){return u!==Error.prototype},s=>s!=="isAxiosError"),$.call(o,e.message,t,n,r,l),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const a1=null;function zo(e){return _.isPlainObject(e)||_.isArray(e)}function Vf(e){return _.endsWith(e,"[]")?e.slice(0,-2):e}function da(e,t,n){return e?e.concat(t).map(function(l,i){return l=Vf(l),!n&&i?"["+l+"]":l}).join(n?".":""):t}function c1(e){return _.isArray(e)&&!e.some(zo)}const f1=_.toFlatObject(_,{},null,function(t){return/^is[A-Z]/.test(t)});function ni(e,t,n){if(!_.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=_.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,I){return!_.isUndefined(I[S])});const r=n.metaTokens,l=n.visitor||p,i=n.dots,o=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&_.isSpecCompliantForm(t);if(!_.isFunction(l))throw new TypeError("visitor must be a function");function c(v){if(v===null)return"";if(_.isDate(v))return v.toISOString();if(!u&&_.isBlob(v))throw new $("Blob is not supported. Use a Buffer instead.");return _.isArrayBuffer(v)||_.isTypedArray(v)?u&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function p(v,S,I){let d=v;if(v&&!I&&typeof v=="object"){if(_.endsWith(S,"{}"))S=r?S:S.slice(0,-2),v=JSON.stringify(v);else if(_.isArray(v)&&c1(v)||(_.isFileList(v)||_.endsWith(S,"[]"))&&(d=_.toArray(v)))return S=Vf(S),d.forEach(function(m,k){!(_.isUndefined(m)||m===null)&&t.append(o===!0?da([S],k,i):o===null?S:S+"[]",c(m))}),!1}return zo(v)?!0:(t.append(da(I,S,i),c(v)),!1)}const y=[],a=Object.assign(f1,{defaultVisitor:p,convertValue:c,isVisitable:zo});function E(v,S){if(!_.isUndefined(v)){if(y.indexOf(v)!==-1)throw Error("Circular reference detected in "+S.join("."));y.push(v),_.forEach(v,function(d,f){(!(_.isUndefined(d)||d===null)&&l.call(t,d,_.isString(f)?f.trim():f,S,a))===!0&&E(d,S?S.concat(f):[f])}),y.pop()}}if(!_.isObject(e))throw new TypeError("data must be an object");return E(e),t}function pa(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Is(e,t){this._pairs=[],e&&ni(e,this,t)}const Wf=Is.prototype;Wf.append=function(t,n){this._pairs.push([t,n])};Wf.toString=function(t){const n=t?function(r){return t.call(this,r,pa)}:pa;return this._pairs.map(function(l){return n(l[0])+"="+n(l[1])},"").join("&")};function d1(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Qf(e,t,n){if(!t)return e;const r=n&&n.encode||d1,l=n&&n.serialize;let i;if(l?i=l(t,n):i=_.isURLSearchParams(t)?t.toString():new Is(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class p1{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){_.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ma=p1,Kf={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},m1=typeof URLSearchParams<"u"?URLSearchParams:Is,h1=typeof FormData<"u"?FormData:null,y1=typeof Blob<"u"?Blob:null,g1=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),v1=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),lt={isBrowser:!0,classes:{URLSearchParams:m1,FormData:h1,Blob:y1},isStandardBrowserEnv:g1,isStandardBrowserWebWorkerEnv:v1,protocols:["http","https","file","blob","url","data"]};function w1(e,t){return ni(e,new lt.classes.URLSearchParams,Object.assign({visitor:function(n,r,l,i){return lt.isNode&&_.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function S1(e){return _.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function k1(e){const t={},n=Object.keys(e);let r;const l=n.length;let i;for(r=0;r=n.length;return o=!o&&_.isArray(l)?l.length:o,u?(_.hasOwnProp(l,o)?l[o]=[l[o],r]:l[o]=r,!s):((!l[o]||!_.isObject(l[o]))&&(l[o]=[]),t(n,r,l[o],i)&&_.isArray(l[o])&&(l[o]=k1(l[o])),!s)}if(_.isFormData(e)&&_.isFunction(e.entries)){const n={};return _.forEachEntry(e,(r,l)=>{t(S1(r),l,n,0)}),n}return null}const x1={"Content-Type":void 0};function E1(e,t,n){if(_.isString(e))try{return(t||JSON.parse)(e),_.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ri={transitional:Kf,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",l=r.indexOf("application/json")>-1,i=_.isObject(t);if(i&&_.isHTMLForm(t)&&(t=new FormData(t)),_.isFormData(t))return l&&l?JSON.stringify(Zf(t)):t;if(_.isArrayBuffer(t)||_.isBuffer(t)||_.isStream(t)||_.isFile(t)||_.isBlob(t))return t;if(_.isArrayBufferView(t))return t.buffer;if(_.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return w1(t,this.formSerializer).toString();if((s=_.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return ni(s?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||l?(n.setContentType("application/json",!1),E1(t)):t}],transformResponse:[function(t){const n=this.transitional||ri.transitional,r=n&&n.forcedJSONParsing,l=this.responseType==="json";if(t&&_.isString(t)&&(r&&!this.responseType||l)){const o=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?$.from(s,$.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:lt.classes.FormData,Blob:lt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_.forEach(["delete","get","head"],function(t){ri.headers[t]={}});_.forEach(["post","put","patch"],function(t){ri.headers[t]=_.merge(x1)});const Ds=ri,C1=_.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_1=e=>{const t={};let n,r,l;return e&&e.split(` +`).forEach(function(o){l=o.indexOf(":"),n=o.substring(0,l).trim().toLowerCase(),r=o.substring(l+1).trim(),!(!n||t[n]&&C1[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ha=Symbol("internals");function Qn(e){return e&&String(e).trim().toLowerCase()}function cl(e){return e===!1||e==null?e:_.isArray(e)?e.map(cl):String(e)}function N1(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function P1(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function Mi(e,t,n,r,l){if(_.isFunction(r))return r.call(this,t,n);if(l&&(t=n),!!_.isString(t)){if(_.isString(r))return t.indexOf(r)!==-1;if(_.isRegExp(r))return r.test(t)}}function L1(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function T1(e,t){const n=_.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(l,i,o){return this[r].call(this,t,l,i,o)},configurable:!0})})}class li{constructor(t){t&&this.set(t)}set(t,n,r){const l=this;function i(s,u,c){const p=Qn(u);if(!p)throw new Error("header name must be a non-empty string");const y=_.findKey(l,p);(!y||l[y]===void 0||c===!0||c===void 0&&l[y]!==!1)&&(l[y||u]=cl(s))}const o=(s,u)=>_.forEach(s,(c,p)=>i(c,p,u));return _.isPlainObject(t)||t instanceof this.constructor?o(t,n):_.isString(t)&&(t=t.trim())&&!P1(t)?o(_1(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Qn(t),t){const r=_.findKey(this,t);if(r){const l=this[r];if(!n)return l;if(n===!0)return N1(l);if(_.isFunction(n))return n.call(this,l,r);if(_.isRegExp(n))return n.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Qn(t),t){const r=_.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Mi(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let l=!1;function i(o){if(o=Qn(o),o){const s=_.findKey(r,o);s&&(!n||Mi(r,r[s],s,n))&&(delete r[s],l=!0)}}return _.isArray(t)?t.forEach(i):i(t),l}clear(t){const n=Object.keys(this);let r=n.length,l=!1;for(;r--;){const i=n[r];(!t||Mi(this,this[i],i,t,!0))&&(delete this[i],l=!0)}return l}normalize(t){const n=this,r={};return _.forEach(this,(l,i)=>{const o=_.findKey(r,i);if(o){n[o]=cl(l),delete n[i];return}const s=t?L1(i):String(i).trim();s!==i&&delete n[i],n[s]=cl(l),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return _.forEach(this,(r,l)=>{r!=null&&r!==!1&&(n[l]=t&&_.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(l=>r.set(l)),r}static accessor(t){const r=(this[ha]=this[ha]={accessors:{}}).accessors,l=this.prototype;function i(o){const s=Qn(o);r[s]||(T1(l,o),r[s]=!0)}return _.isArray(t)?t.forEach(i):i(t),this}}li.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);_.freezeMethods(li.prototype);_.freezeMethods(li);const pt=li;function Ii(e,t){const n=this||Ds,r=t||n,l=pt.from(r.headers);let i=r.data;return _.forEach(e,function(s){i=s.call(n,i,l.normalize(),t?t.status:void 0)}),l.normalize(),i}function Yf(e){return!!(e&&e.__CANCEL__)}function zr(e,t,n){$.call(this,e??"canceled",$.ERR_CANCELED,t,n),this.name="CanceledError"}_.inherits(zr,$,{__CANCEL__:!0});function R1(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new $("Request failed with status code "+n.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const O1=lt.isStandardBrowserEnv?function(){return{write:function(n,r,l,i,o,s){const u=[];u.push(n+"="+encodeURIComponent(r)),_.isNumber(l)&&u.push("expires="+new Date(l).toGMTString()),_.isString(i)&&u.push("path="+i),_.isString(o)&&u.push("domain="+o),s===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function z1(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function M1(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Jf(e,t){return e&&!z1(t)?M1(e,t):t}const I1=lt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function l(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=l(window.location.href),function(o){const s=_.isString(o)?l(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}();function D1(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function F1(e,t){e=e||10;const n=new Array(e),r=new Array(e);let l=0,i=0,o;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),p=r[i];o||(o=c),n[l]=u,r[l]=c;let y=i,a=0;for(;y!==l;)a+=n[y++],y=y%e;if(l=(l+1)%e,l===i&&(i=(i+1)%e),c-o{const i=l.loaded,o=l.lengthComputable?l.total:void 0,s=i-n,u=r(s),c=i<=o;n=i;const p={loaded:i,total:o,progress:o?i/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&c?(o-i)/u:void 0,event:l};p[t?"download":"upload"]=!0,e(p)}}const A1=typeof XMLHttpRequest<"u",B1=A1&&function(e){return new Promise(function(n,r){let l=e.data;const i=pt.from(e.headers).normalize(),o=e.responseType;let s;function u(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}_.isFormData(l)&&(lt.isStandardBrowserEnv||lt.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const E=e.auth.username||"",v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(E+":"+v))}const p=Jf(e.baseURL,e.url);c.open(e.method.toUpperCase(),Qf(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function y(){if(!c)return;const E=pt.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),S={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:E,config:e,request:c};R1(function(d){n(d),u()},function(d){r(d),u()},S),c=null}if("onloadend"in c?c.onloadend=y:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(y)},c.onabort=function(){c&&(r(new $("Request aborted",$.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new $("Network Error",$.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let v=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const S=e.transitional||Kf;e.timeoutErrorMessage&&(v=e.timeoutErrorMessage),r(new $(v,S.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,e,c)),c=null},lt.isStandardBrowserEnv){const E=(e.withCredentials||I1(p))&&e.xsrfCookieName&&O1.read(e.xsrfCookieName);E&&i.set(e.xsrfHeaderName,E)}l===void 0&&i.setContentType(null),"setRequestHeader"in c&&_.forEach(i.toJSON(),function(v,S){c.setRequestHeader(S,v)}),_.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",ya(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",ya(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=E=>{c&&(r(!E||E.type?new zr(null,e,c):E),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const a=D1(p);if(a&<.protocols.indexOf(a)===-1){r(new $("Unsupported protocol "+a+":",$.ERR_BAD_REQUEST,e));return}c.send(l||null)})},fl={http:a1,xhr:B1};_.forEach(fl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const j1={getAdapter:e=>{e=_.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let l=0;le instanceof pt?e.toJSON():e;function Tn(e,t){t=t||{};const n={};function r(c,p,y){return _.isPlainObject(c)&&_.isPlainObject(p)?_.merge.call({caseless:y},c,p):_.isPlainObject(p)?_.merge({},p):_.isArray(p)?p.slice():p}function l(c,p,y){if(_.isUndefined(p)){if(!_.isUndefined(c))return r(void 0,c,y)}else return r(c,p,y)}function i(c,p){if(!_.isUndefined(p))return r(void 0,p)}function o(c,p){if(_.isUndefined(p)){if(!_.isUndefined(c))return r(void 0,c)}else return r(void 0,p)}function s(c,p,y){if(y in t)return r(c,p);if(y in e)return r(void 0,c)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(c,p)=>l(va(c),va(p),!0)};return _.forEach(Object.keys(e).concat(Object.keys(t)),function(p){const y=u[p]||l,a=y(e[p],t[p],p);_.isUndefined(a)&&y!==s||(n[p]=a)}),n}const Xf="1.3.4",Fs={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Fs[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const wa={};Fs.transitional=function(t,n,r){function l(i,o){return"[Axios v"+Xf+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,s)=>{if(t===!1)throw new $(l(o," has been removed"+(n?" in "+n:"")),$.ERR_DEPRECATED);return n&&!wa[o]&&(wa[o]=!0,console.warn(l(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,s):!0}};function U1(e,t,n){if(typeof e!="object")throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let l=r.length;for(;l-- >0;){const i=r[l],o=t[i];if(o){const s=e[i],u=s===void 0||o(s,i,e);if(u!==!0)throw new $("option "+i+" must be "+u,$.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new $("Unknown option "+i,$.ERR_BAD_OPTION)}}const Mo={assertOptions:U1,validators:Fs},kt=Mo.validators;class Bl{constructor(t){this.defaults=t,this.interceptors={request:new ma,response:new ma}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Tn(this.defaults,n);const{transitional:r,paramsSerializer:l,headers:i}=n;r!==void 0&&Mo.assertOptions(r,{silentJSONParsing:kt.transitional(kt.boolean),forcedJSONParsing:kt.transitional(kt.boolean),clarifyTimeoutError:kt.transitional(kt.boolean)},!1),l!==void 0&&Mo.assertOptions(l,{encode:kt.function,serialize:kt.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=i&&_.merge(i.common,i[n.method]),o&&_.forEach(["delete","get","head","post","put","patch","common"],v=>{delete i[v]}),n.headers=pt.concat(o,i);const s=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(u=u&&S.synchronous,s.unshift(S.fulfilled,S.rejected))});const c=[];this.interceptors.response.forEach(function(S){c.push(S.fulfilled,S.rejected)});let p,y=0,a;if(!u){const v=[ga.bind(this),void 0];for(v.unshift.apply(v,s),v.push.apply(v,c),a=v.length,p=Promise.resolve(n);y{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](l);r._listeners=null}),this.promise.then=l=>{let i;const o=new Promise(s=>{r.subscribe(s),i=s}).then(l);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,s){r.reason||(r.reason=new zr(i,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new As(function(l){t=l}),cancel:t}}}const $1=As;function H1(e){return function(n){return e.apply(null,n)}}function V1(e){return _.isObject(e)&&e.isAxiosError===!0}const Io={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Io).forEach(([e,t])=>{Io[t]=e});const W1=Io;function Gf(e){const t=new dl(e),n=zf(dl.prototype.request,t);return _.extend(n,dl.prototype,t,{allOwnKeys:!0}),_.extend(n,t,null,{allOwnKeys:!0}),n.create=function(l){return Gf(Tn(e,l))},n}const ce=Gf(Ds);ce.Axios=dl;ce.CanceledError=zr;ce.CancelToken=$1;ce.isCancel=Yf;ce.VERSION=Xf;ce.toFormData=ni;ce.AxiosError=$;ce.Cancel=ce.CanceledError;ce.all=function(t){return Promise.all(t)};ce.spread=H1;ce.isAxiosError=V1;ce.mergeConfig=Tn;ce.AxiosHeaders=pt;ce.formToJSON=e=>Zf(_.isHTMLForm(e)?new FormData(e):e);ce.HttpStatusCode=W1;ce.default=ce;const qf=ce;const Q1=({label:e,mode:t,onClick:n,disabled:r})=>h("button",{className:"sarufi-flex-center",onClick:()=>{r||n&&n()},disabled:r??!1,style:{cursor:r?"default":"pointer",opacity:r?.4:1,fontSize:".9rem",overflow:"hidden",transition:".3s linear",zIndex:100001,border:"none",backgroundColor:"transparent",...t==="dark"?{color:"white"}:{}},children:e}),K1=({disabled:e,autoComplete:t="",value:n,name:r,onChange:l,required:i,autoFocus:o=!1,placeholder:s,maxLength:u=1024,save:c,mode:p,primaryColor:y})=>{const a=S=>{S.keyCode==13&&S.shiftKey==!1&&(c&&S.preventDefault(),c&&c(S))},[E,v]=A.useState(!0);return h("div",{className:"sarufi-field-group",children:h("div",{className:"input-group",children:h("label",{className:"sarufi-flex-start",children:h("textarea",{onKeyDown:a,id:r,autoFocus:o,name:r,maxLength:u,disabled:e,placeholder:s,className:"sarufi-scroll-bar sarufi-textarea",onChange:l,autoComplete:t,value:n,onFocus:()=>v(!0),onBlur:()=>v(!1),rows:1,style:{width:"100%",height:"100%",resize:"none",transition:"0.25s",padding:".7rem .7rem",paddingRight:45,border:"1px solid transparent",borderRadius:"0.3rem",fontFamily:"var(--sarufi-font-family)",backgroundColor:"transparent",...p==="dark"?{color:"white"}:{},...p==="dark"&&E?{borderColor:y}:{}},required:i},r)})})})},_r=({fromPlay:e})=>M("div",{className:"sarufi-chat-loader",children:[h("div",{className:"sarufi-bounce1"}),h("div",{className:"sarufi-bounce2"}),!e&&h("div",{className:"sarufi-bounce3"})]}),Z1=({size:e,style:t,className:n})=>h("svg",{width:e??24,height:e??24,viewBox:"0 0 13 14",fill:"none",className:n,style:t,children:h("path",{d:"M10.8331 2.5998H9.0998V1.7998H8.23314V2.5998H4.76647V1.7998H3.8998V2.5998H2.16647C1.6898 2.5998 1.2998 2.9598 1.2998 3.3998V11.3998C1.2998 11.8398 1.6898 12.1998 2.16647 12.1998H10.8331C11.3098 12.1998 11.6998 11.8398 11.6998 11.3998V3.3998C11.6998 2.9598 11.3098 2.5998 10.8331 2.5998ZM10.8331 11.3998H2.16647V5.7998H10.8331V11.3998ZM10.8331 4.9998H2.16647V3.3998H3.8998V4.1998H4.76647V3.3998H8.23314V4.1998H9.0998V3.3998H10.8331V4.9998Z",fill:"currentColor"})}),Bs=({size:e,style:t,className:n})=>h("svg",{width:e??24,height:e??24,viewBox:"0 0 24 24",className:n,style:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h("path",{fill:"currentColor",d:"M13.06 12l6.224-6.216a.76.76 0 00-1.069-1.068L12 10.94 5.784 4.716a.76.76 0 00-1.069 1.068L10.94 12l-6.225 6.216a.76.76 0 000 1.068.768.768 0 001.07 0L12 13.06l6.215 6.225a.768.768 0 001.07 0 .76.76 0 000-1.068L13.058 12z"})}),Y1=({size:e,className:t,style:n})=>h("svg",{width:e??24,height:e??24,className:t,style:n,viewBox:"0 0 18 18",fill:"none",children:h("path",{d:"M0.649965 0.000468815C0.542544 0.00447137 0.437632 0.0340679 0.343957 0.0867961C0.250282 0.139524 0.170552 0.213859 0.111401 0.303617C0.0522503 0.393375 0.0153887 0.495961 0.00388277 0.602839C-0.00762314 0.709717 0.00655937 0.817797 0.0452505 0.918088L2.52036 7.3089C2.56296 7.41854 2.63346 7.51514 2.72488 7.58914C2.81631 7.66314 2.92547 7.71197 3.04158 7.7308L9.76551 8.82245C9.93302 8.84961 9.91669 8.89797 9.91669 9C9.91669 9.10202 9.93302 9.15038 9.76551 9.17754L3.04158 10.2692C2.92547 10.288 2.81631 10.3368 2.72488 10.4109C2.63346 10.4849 2.56296 10.5815 2.52036 10.6911L0.0452505 17.0819C-0.00373964 17.2089 -0.0132051 17.3477 0.0180957 17.4802C0.0493965 17.6126 0.120002 17.7325 0.22065 17.8241C0.321298 17.9158 0.447288 17.9748 0.582093 17.9936C0.716899 18.0123 0.854223 17.9899 0.976054 17.9292L17.6268 9.60383C17.7389 9.54776 17.8333 9.46158 17.8992 9.35492C17.9651 9.24827 18 9.12537 18 9C18 8.87462 17.9651 8.75172 17.8992 8.64507C17.8333 8.53841 17.7389 8.45223 17.6268 8.39616L0.976054 0.0707845C0.874951 0.0204373 0.762832 -0.00373935 0.649965 0.000468815Z",fill:"currentColor"})}),J1=({size:e,className:t,style:n})=>h("svg",{width:e??16,height:e??2,className:t,style:n,viewBox:"0 0 16 2",fill:"none",children:h("rect",{x:"0.799805",y:"0.0996094",width:"14.4",height:"1.8",fill:"currentColor"})}),bf=({className:e,size:t})=>M("svg",{className:e,width:t??"7",height:t??"14",viewBox:"0 0 7 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[h("path",{d:"M1 14L1 -4.02383e-07",stroke:"currentColor",strokeWidth:"1.5"}),h("path",{d:"M6.24615 14V1.26655e-06",stroke:"currentColor",strokeWidth:"1.5"})]}),Do=({className:e,size:t})=>h("svg",{width:t??"12",height:t??"16",className:e,viewBox:"0 0 12 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h("path",{d:"M10.7391 6.92845C11.3389 7.31537 11.3519 8.18793 10.7639 8.59253L1.56691 14.9217C0.903442 15.3783 -5.96046e-08 14.9033 -5.96046e-08 14.0979L-5.96046e-08 1.83521C-5.96046e-08 1.04331 0.876694 0.565606 1.54212 0.994914L10.7391 6.92845Z",fill:"currentColor"})}),X1=({className:e,size:t})=>h("svg",{width:t??"23",height:t??"23",className:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M2 7V2h5m15 5V2h-5M7 22H2v-5m15 5h5v-5"})}),G1=({className:e,size:t})=>M("svg",{viewBox:"0 0 34 34",height:t??"34",width:t??"34",className:e,preserveAspectRatio:"xMidYMid meet",version:"1.1",x:"0px",y:"0px",enableBackground:"new 0 0 34 34",xmlSpace:"preserve",children:[h("path",{fill:"currentColor",d:"M17,2c8.3,0,15,6.7,15,15s-6.7,15-15,15S2,25.3,2,17S8.7,2,17,2 M17,1C8.2,1,1,8.2,1,17 s7.2,16,16,16s16-7.2,16-16S25.8,1,17,1L17,1z"}),h("path",{fill:"currentColor",d:"M22.4,17.5h-3.2v-6.8c0-0.4-0.3-0.7-0.7-0.7h-3.2c-0.4,0-0.7,0.3-0.7,0.7v6.8h-3.2 c-0.6,0-0.8,0.4-0.4,0.8l5,5.3c0.5,0.7,1,0.5,1.5,0l5-5.3C23.2,17.8,23,17.5,22.4,17.5z"})]}),Fo=({size:e,style:t,className:n})=>M("svg",{width:e??32,height:e??32,style:t,className:n,viewBox:"0 0 32 32",fill:"none",children:[h("path",{d:"M26.8632 10.3902L25.4496 10.9596L25.8102 11.8546L26.7738 11.911L26.8632 10.3902ZM26.8738 19.8307L26.7758 18.3105L25.8153 18.3719L25.4582 19.2664L26.8738 19.8307ZM26.2704 23.0754L27.7196 22.6056L27.7155 22.5934L26.2704 23.0754ZM27.5047 26.8849L28.9747 26.4831L28.9655 26.4491L28.9543 26.4151L27.5047 26.8849ZM26.8703 27.5198L26.4533 28.9857L26.4614 28.9878L26.469 28.9898L26.8703 27.5198ZM22.7784 26.3556L23.1954 24.8903L23.1715 24.8837L23.1481 24.8776L22.7784 26.3556ZM20.6267 26.5324L19.9746 25.1549L19.9598 25.162L19.9451 25.1691L20.6267 26.5324ZM14.7362 27.8022L14.787 26.2789H14.7814H14.7763L14.7362 27.8022ZM3.31123 19.8322L4.72278 19.2573L4.35808 18.3618L3.3925 18.3105L3.31123 19.8322ZM3.29904 10.3902L3.38996 11.9115L4.35453 11.8536L4.71364 10.9566L3.29904 10.3902ZM15.8999 2.44053L15.7998 3.96129L15.8069 3.9618L15.8999 2.44053ZM30.1637 12.2762C30.1637 10.4588 28.7446 8.9741 26.9526 8.86896L26.7738 11.911C26.9643 11.9227 27.1161 12.0822 27.1161 12.2762H30.1637ZM30.1637 17.9453V12.2762H27.1161V17.9453H30.1637ZM26.9714 21.3515C28.7542 21.2367 30.1637 19.756 30.1637 17.9453H27.1161C27.1161 18.1388 26.9653 18.2983 26.7758 18.3105L26.9714 21.3515ZM27.8095 21.4647C27.9832 21.1173 28.1432 20.7602 28.2889 20.3955L25.4582 19.2664C25.3444 19.5519 25.2195 19.8302 25.0839 20.1014L27.8095 21.4647ZM27.7155 22.5934C27.6017 22.252 27.6302 21.8233 27.8095 21.4647L25.0839 20.1014C24.5577 21.1534 24.4444 22.4176 24.8248 23.5574L27.7155 22.5934ZM28.9543 26.4151L27.7196 22.6056L24.8208 23.5452L26.055 27.3548L28.9543 26.4151ZM26.469 28.9898C27.9933 29.4058 29.3922 28.01 28.9747 26.4831L26.0352 27.2872C25.8295 26.5355 26.5223 25.8457 27.271 26.0499L26.469 28.9898ZM22.3613 27.8215L26.4533 28.9857L27.2868 26.0544L23.1954 24.8903L22.3613 27.8215ZM21.2789 27.9094C21.5806 27.7667 21.988 27.7291 22.4086 27.8342L23.1481 24.8776C22.1577 24.6302 21.0128 24.6632 19.9746 25.1549L21.2789 27.9094ZM14.6854 29.325C17.056 29.4043 19.3178 28.8902 21.3084 27.8952L19.9451 25.1691C18.4081 25.9381 16.6491 26.3414 14.787 26.2789L14.6854 29.325ZM1.90019 20.4072C3.96951 25.4871 8.92341 29.1737 14.6961 29.3255L14.7763 26.2789C10.2715 26.1601 6.35783 23.272 4.72278 19.2573L1.90019 20.4072ZM0 17.9453C0 19.7692 1.42984 21.258 3.23047 21.354L3.3925 18.3105C3.20101 18.3003 3.04761 18.1403 3.04761 17.9453H0ZM0 12.2762V17.9453H3.04761V12.2762H0ZM3.20863 8.86896C1.41816 8.97562 0 10.4598 0 12.2762H3.04761C3.04761 12.0822 3.19948 11.9227 3.38996 11.9115L3.20863 8.86896ZM16.0005 0.920279C9.61623 0.498693 4.08685 4.32344 1.88444 9.82388L4.71364 10.9566C6.44976 6.62134 10.7951 3.63062 15.7998 3.96129L16.0005 0.920279ZM28.2762 9.82083C26.2821 4.87049 21.5715 1.2606 15.9929 0.919771L15.8069 3.9618C20.164 4.22795 23.8765 7.05512 25.4496 10.9596L28.2762 9.82083Z",fill:"currentColor"}),h("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.0814 24.5586C20.2999 24.5586 24.53 20.3285 24.53 15.1105C24.53 9.89247 20.2999 5.66238 15.0814 5.66238C9.86339 5.66238 5.6333 9.89247 5.6333 15.1105C5.6333 20.3285 9.86339 24.5586 15.0814 24.5586ZM10.3576 14.9154C11.1403 14.9154 11.7747 14.281 11.7747 13.4983C11.7747 12.7156 11.1403 12.0812 10.3576 12.0812C9.57488 12.0812 8.94047 12.7156 8.94047 13.4983C8.94047 14.281 9.57488 14.9154 10.3576 14.9154ZM21.2229 13.4983C21.2229 14.281 20.5884 14.9154 19.8057 14.9154C19.023 14.9154 18.3886 14.281 18.3886 13.4983C18.3886 12.7156 19.023 12.0812 19.8057 12.0812C20.5884 12.0812 21.2229 12.7156 21.2229 13.4983ZM15.0814 20.1238C16.3863 20.1238 17.4438 19.0663 17.4438 17.7619H12.7195V17.7711C12.7246 19.0714 13.7801 20.1238 15.0814 20.1238Z",fill:"currentColor"})]}),ed=({closeWithBackdrop:e,close:t,open:n,children:r,mode:l})=>(A.useLayoutEffect(()=>{n?document.body.classList.add("sarufi-no-scrolling"):document.body.classList.remove("sarufi-no-scrolling")},[n]),O0.createPortal(M("div",{className:`sarufi-modal ${n?"open":""} sarufi-flex-center`,style:{zIndex:2e5},children:[n&&h("div",{className:`sarufi-modal-backdrop ${n?"open":""}`,onClick:()=>{e&&t()}}),M("div",{className:`sarufi-container ${n?"open":""} sarufi-scroll-bar`,style:{color:l==="dark"?"rgba(255,255,255,.7)":"rgba(0,0,0,.7)"},onClick:()=>{e&&t()},children:[h("div",{className:"sarufi-flex-end sarufi-close-modal",style:{position:"absolute",left:0,width:"100vw",height:"50px"},children:h("button",{onClick:i=>{i.stopPropagation(),i.nativeEvent.stopImmediatePropagation(),t()},title:"Close",className:"sarufi-cursor-pointer",style:{background:"none",border:"none",cursor:"pointer",color:"rgba(255,255,255,.8)",padding:"1rem 2rem"},children:h(Bs,{})})}),h("div",{className:"sarufi-flex-center",style:{height:"100%",width:"100%"},children:h("div",{onClick:i=>{i.stopPropagation(),i.nativeEvent.stopImmediatePropagation()},style:{width:"max-content"},children:r})})]})]}),document.getElementById("sarufi-modal"))),q1=({url:e,fontSize:t,mediaId:n,mode:r})=>{var g,re,ie,K,L;const[l,i]=A.useState(!1),[o,s]=A.useState(0),[u,c]=A.useState(0),[p,y]=A.useState(0),[a,E]=A.useState(0),[v,S]=A.useState(0),[I,d]=A.useState(0),[f,m]=A.useState(0),[k,P]=A.useState(!1),[T,w]=A.useState(0),[R,B]=A.useState(!0),x=document.querySelector(`audio#${n}`),V=()=>{if(x&&f)if(x.paused){x.play(),i(!0);const D=document.getElementsByTagName("audio");for(let j=0;j{let{value:F}=D.target;d(F/1e3),x&&f&&(x.currentTime=F/1e3)};A.useEffect(()=>{w(I/f*100)},[I]),A.useEffect(()=>{x&&(x.onwaiting=()=>{P(!0)},x.onplaying=()=>{P(!1)},x.onerror=()=>{B(!1)},x.onloadeddata=()=>{s(x.currentTime%60),c(x.currentTime/60%60),E(x.duration%60),S(x.duration/60%60),m(x.duration),d(x.currentTime),B(!1),P(!1)},x.ontimeupdate=()=>{var D,F;x&&x.currentTime&&(s(x.currentTime%60),c(x.currentTime/60%60),d(x.currentTime),w(I/f*100)),x&&x.duration&&(E((x==null?void 0:x.duration)%60),S((x==null?void 0:x.duration)/60%60),m(x.duration),y((F=x==null?void 0:x.buffered)==null?void 0:F.end(((D=x==null?void 0:x.buffered)==null?void 0:D.length)-1)))},x.onended=()=>{d(0),s(0),c(0),w(0),y(0),i(!1)})},[l,x]),A.useEffect(()=>{x&&(x.played&&i(!0),x.paused&&i(!1))},[x==null?void 0:x.played,x==null?void 0:x.paused]);const C={"--sarufi-audio-seek-before-width":T+"%","--sarufi-audio-buffer-before-width":p/f*100+"%"};return M(Ee,{children:[R?h("div",{style:{padding:".5rem",fontSize:14,display:"flex",justifyContent:"center"},children:h(_r,{})}):null,x!=null&&x.duration&&!((g=x==null?void 0:x.error)!=null&&g.code)&&!R?h("div",{style:{...C},className:"sarufi-audio-player",children:M("div",{style:{margin:".5rem 0 .5rem",width:"100%"},className:"sarufi-flex-start",children:[h("button",{className:"sarufi-flex-start sarufi-button",onClick:V,style:{background:"none",border:"none",height:"40px",width:"40px",color:"var(--sarufi-sent-boxt-color)",cursor:"pointer"},accessKey:"Space",type:"button",children:h("span",{title:l?"Pause":"Play",children:k?h(Ee,{children:h(_r,{fromPlay:!0})}):h(Ee,{children:l?h(bf,{}):h(Do,{})})})}),M("div",{style:{width:"calc( 100% - 50px )"},children:[h("div",{className:"sarufi-bar sarufi-duration__bar",children:h("input",{type:"range",id:"progress",disabled:!f,step:1e-4,value:I&&I*1e3,max:f&&f*1e3,onChange:G})}),f>0&&h("div",{className:"",style:{fontSize:Number(t)*.8},children:M("div",{className:"sarufi-flex-wide sarufi-duration",children:[l&&M("div",{children:[h("span",{children:u<10?`0${Math.floor(u)}`:Math.floor(u)})," : ",h("span",{children:o<10?`0${Math.floor(o)}`:`${Math.floor(o)}`})]}),!l&&M("div",{children:[h("span",{children:v<10?`0${Math.floor(v)}`:Math.floor(v)})," : ",h("span",{children:a<10?`0${Math.floor(a)}`:`${Math.floor(a)}`})]})]})})]})]})}):null,(x==null?void 0:x.error)&&!(x!=null&&x.duration)&&!R&&h("div",{style:{color:r==="dark"?"#e76262":"red",borderRadius:".3rem",padding:".3rem 0",fontSize:14},children:((re=x==null?void 0:x.error)==null?void 0:re.code)===1?"Loading audio resorces was aborted":((ie=x==null?void 0:x.error)==null?void 0:ie.code)===2?"Failed to play audio due to network error":((K=x==null?void 0:x.error)==null?void 0:K.code)===3?"Failed to decode audio resorces":((L=x==null?void 0:x.error)==null?void 0:L.code)===4?"Audio resources not supported":"Failed to load audio resources"}),h("audio",{id:n,src:e??"",style:{display:"none"}},e)]})},b1=({url:e,caption:t,fontFamily:n,fontSize:r,mediaId:l,mode:i})=>{var F,j,W,ze,ge,Ue;const[o,s]=A.useState(!1),[u,c]=A.useState(0),[p,y]=A.useState(0),[a,E]=A.useState(0),[v,S]=A.useState(0),[I,d]=A.useState(0),[f,m]=A.useState(0),[k,P]=A.useState(!1),[T,w]=A.useState(0),[R,B]=A.useState(0),[x,V]=A.useState(!0),[G,C]=A.useState(!0),g=document.querySelector(`video#${l}-preview`),re=()=>{if(!k&&g){P(!0),g.play();const Y=document.getElementsByTagName("video");for(let Me=0;Me{let{value:se}=Y.target;g&&(d(se/1e3),g.currentTime=se/1e3)},K=()=>{g&&(P(!k),g==null||g.requestFullscreen())};A.useEffect(()=>{w(I/f*100)},[I]),A.useEffect(()=>{g&&(g.onerror=()=>{V(!1)},g.onwaiting=()=>{C(!0)},g.onplaying=()=>{C(!1)},g.onloadeddata=()=>{c((g==null?void 0:g.currentTime)%60),y((g==null?void 0:g.currentTime)/60%60),E((g==null?void 0:g.duration)%60),S((g==null?void 0:g.duration)/60%60),m(g==null?void 0:g.duration),d(g==null?void 0:g.currentTime),V(!1),C(!1)},g.ontimeupdate=()=>{g&&(g!=null&&g.currentTime)&&(c((g==null?void 0:g.currentTime)%60),y((g==null?void 0:g.currentTime)/60%60),d(g==null?void 0:g.currentTime),w(g.currentTime/g.duration*100)),g&&(g!=null&&g.duration)&&(E((g==null?void 0:g.duration)%60),S((g==null?void 0:g.duration)/60%60),m(g==null?void 0:g.duration))},g.onended=()=>{d(0),c(0),y(0),w(0),B(0),s(!1)})},[o,g]),A.useEffect(()=>{g&&(g!=null&&g.played&&s(!0),g!=null&&g.paused&&s(!1))},[g==null?void 0:g.played,g==null?void 0:g.paused,k]),A.useEffect(()=>{if(!k&&g){s(!1),g.pause();return}else k&&g&&g.play()},[k]);const L={"--sarufi-video-seek-before-width":T+"%","--sarufi-video-buffer-before-width":R/f*100+"%","--sarufi-font-family":n==="InterRegular"?"'Inter', sans-serif":n==="PoppinsRegular"?"'Poppins', sans-serif":n==="inherit"?"inherit":"'Inter', sans-serif","--sarufi-font-size":r},D=({showBottomControllers:Y})=>{var se;return h(Ee,{children:g!=null&&g.duration&&!((se=g==null?void 0:g.error)!=null&&se.code)&&!x?M("div",{className:"sarufi-video-controls",onClick:()=>{k||re()},style:{height:k?"50px":"100%",position:k?"relative":"absolute",...k?{backgroundColor:"rgba(0, 0, 0, .6)"}:{top:0,left:0,cursor:"pointer"}},children:[!Y&&h("div",{className:`sarufi-center-controls ${o?"":"sarufi-video-not-playing"}`,children:h(Ee,{children:h("button",{title:o?"Pause":"Play",style:{background:"rgba(11,20,26,.35)",border:"none",color:"white",borderRadius:"50%",height:"30px",width:"30px",cursor:"pointer"},onClick:re,className:"sarufi-flex-center sarufi-button",children:h(Do,{size:20})})})}),Y&&h("div",{className:"sarufi-video-more-controls",children:M("div",{className:"sarufi-more-controls-container",children:[M("div",{className:"sarufi-flex-wide",style:{padding:"0 .5rem"},children:[M("div",{className:"sarufi-video-time-controls sarufi-flex-start",children:[h("button",{title:o?"Pause":"Play",style:{background:"rgba(11,20,26,.35)",border:"none",color:"white",borderRadius:"50%",height:"30px",width:"30px",cursor:"pointer","--sarufi-received-box-color":"white"},onClick:re,className:"sarufi-flex-center sarufi-button",children:G?h(Ee,{children:h(_r,{fromPlay:!0})}):h(Ee,{children:o?h(bf,{size:14}):h(Do,{size:14})})}),h("span",{style:{transform:"scale(0.8)"},children:p<10?`0${Math.floor(p)}`:Math.floor(p)})," : ",h("span",{style:{transform:"scale(0.8)"},children:u<10?`0${Math.floor(u)}`:`${Math.floor(u)}`})," / ",h("span",{style:{transform:"scale(0.8)"},children:v<10?`0${Math.floor(v)}`:Math.floor(v)})," : ",h("span",{style:{transform:"scale(0.8)"},children:a<10?`0${Math.floor(a)}`:`${Math.floor(a)}`})]}),h("button",{className:"sarufi-video-full-screen-toggle sarufi-button",onClick:K,style:{cursor:"pointer",background:"none",border:"none",color:"currentcolor"},children:h(X1,{size:14})})]}),h("div",{style:{...L},className:"sarufi-bar sarufi-duration__bar",children:h("input",{type:"range",id:"progress",disabled:!f,step:1e-4,value:I&&I*1e3,max:f&&f*1e3,onChange:ie})})]})})]}):null})};return M(Ee,{children:[x?h("div",{style:{background:i==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".5rem",fontSize:14,display:"flex",justifyContent:"center"},children:h(_r,{})}):null,M("div",{className:"sarufi-video-player",style:{...L},children:[M("video",{id:l,disablePictureInPicture:!0,controlsList:"nodownload",src:e,onContextMenu:Y=>{Y.preventDefault()},style:{maxWidth:"100%",height:x||!(g!=null&&g.duration)||(F=g==null?void 0:g.error)!=null&&F.code||!g?"0":"auto",display:x||!(g!=null&&g.duration)||(j=g==null?void 0:g.error)!=null&&j.code||!g?"none":"block",width:"100%",objectFit:"cover",borderRadius:".3rem"},children:[h("source",{src:e,type:"video/mp4"}),h("span",{children:"Your Browser does not support this video format"})]},e),g!=null&&g.duration?h(D,{showBottomControllers:!1}):null,h(ed,{mode:i??"light",open:k,close:()=>P(!1),closeWithBackdrop:!0,children:M("div",{className:"sarufi-video-player",style:{maxWidth:"calc( 100vw - 30px )",maxHeight:"calc( 100vh - 180px )",width:"100%",height:"auto",...L},children:[M("video",{id:l+"-preview",disablePictureInPicture:!0,controlsList:"nodownload",src:e,onContextMenu:Y=>{Y.preventDefault()},onClick:re,style:{maxWidth:"calc( 100vw - 30px )",maxHeight:"calc( 100vh - 180px )",width:"100%",height:"auto",objectFit:"cover",display:"block"},children:[h("source",{src:e,type:"video/mp4"}),h("span",{children:"Your Browser does not support this video format"})]},e),h(D,{showBottomControllers:!0}),h("div",{className:"sarufi-flex-center",children:h("div",{style:{textAlign:"center",fontFamily:n==="InterRegular"?"'Inter', sans-serif":n==="PoppinsRegular"?"'Poppins', sans-serif":n==="inherit"?"inherit":"'Inter', sans-serif",fontSize:r,color:"white",marginTop:".3rem"},children:t})})]})})]}),(g==null?void 0:g.error)&&!(g!=null&&g.duration)&&!x&&h("div",{style:{color:i==="dark"?"#e76262":"red",background:i==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".5rem",fontSize:14},children:((W=g==null?void 0:g.error)==null?void 0:W.code)===1?"Loading video resorces was aborted":((ze=g==null?void 0:g.error)==null?void 0:ze.code)===2?"Failed to play video due to network error":((ge=g==null?void 0:g.error)==null?void 0:ge.code)===3?"Failed to decode video resorces":((Ue=g==null?void 0:g.error)==null?void 0:Ue.code)===4?"Video resources not supported":"Failed to load video resources"})]})},Sa=({url:e,caption:t,openFullScreen:n,isFullScreen:r,fontFamily:l,fontSize:i})=>h("div",{style:{"--sarufi-font-family":l==="InterRegular"?"'Inter', sans-serif":l==="PoppinsRegular"?"'Poppins', sans-serif":l==="inherit"?"inherit":"'Inter', sans-serif","--sarufi-font-size":i},children:M("figure",{style:{marginInlineStart:0,marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0},children:[h("picture",{className:"sarufi-flex-center",onClick:n,tabIndex:0,children:h("img",{src:e,alt:"Preview Image",style:{borderRadius:".3rem",...r?{maxHeight:"calc( 100vh - 180px )",maxWidth:"calc( 100vw - 30px )",objectFit:"contain"}:{width:"100%",height:"auto",objectFit:"cover"}}})}),t&&r&&h("figcaption",{className:`${r?"sarufi-flex-center":""}`,style:{marginTop:".5rem"},children:h("span",{style:{textAlign:r?"center":"left",color:"white"},children:t})})]})});const Kn=({type:e,url:t="",caption:n="",mode:r,fontFamily:l,fontSize:i,index:o,chat:s,mediaId:u,location:c,showArrow:p,style:y})=>{const[a,E]=A.useState(!1),v=["images","stickers","videos","audios","documents","locations"],S=v.findIndex(d=>d===e),I=v.findIndex(d=>{var f,m,k,P,T,w,R,B,x,V,G,C,g,re,ie;return d==="images"&&((k=(m=(f=s==null?void 0:s.actions)==null?void 0:f.find(K=>K.send_images))==null?void 0:m.send_images)==null?void 0:k.length)>0||d==="stickers"&&((w=(T=(P=s==null?void 0:s.actions)==null?void 0:P.find(K=>K.send_stickers))==null?void 0:T.send_stickers)==null?void 0:w.length)>0||d==="audios"&&((x=(B=(R=s==null?void 0:s.actions)==null?void 0:R.find(K=>K.send_audios))==null?void 0:B.send_audios)==null?void 0:x.length)>0||d==="videos"&&((C=(G=(V=s==null?void 0:s.actions)==null?void 0:V.find(K=>K.send_videos))==null?void 0:G.send_videos)==null?void 0:C.length)>0?!0:d==="documents"&&((ie=(re=(g=s==null?void 0:s.actions)==null?void 0:g.find(K=>K.send_documents))==null?void 0:re.send_documents)==null?void 0:ie.length)>0});return M("div",{className:`sarufi-media-preview sarufi-message-body ${S<=I&&!o||p?"sarufi-message-body-w-arrow":""}`,style:{background:"var(--sarufi-received-box-bg)",maxWidth:280,padding:"6px 8px 8px 9px",marginTop:S<=I&&!o?".7rem":"0",marginBottom:".3rem",position:"relative",borderTopLeftRadius:S<=I?"7.5px":"0",borderTopRightRadius:S<=I?"7.5px":"0",...y},children:[M(Ee,{children:[(e==="images"||e==="stickers")&&h(Sa,{url:t,caption:n,openFullScreen:()=>E(!0),isFullScreen:!1,fontFamily:l,fontSize:i}),e==="audios"&&h("div",{style:{background:r==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".1rem .5rem"},children:h(q1,{url:t,fontSize:i,mode:r,mediaId:u})}),e==="videos"&&h(b1,{url:t,caption:n,fontFamily:l,fontSize:i,mediaId:u,mode:r}),e==="documents"&&h("div",{style:{background:r==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".1rem .5rem"},children:h(em,{url:t})}),e==="locations"&&M("div",{style:{margin:".5rem"},children:[h("div",{style:{marginBottom:".4rem"},children:"Location:"}),M("div",{children:[(c==null?void 0:c.latitude)&&h("div",{children:M("p",{style:{},children:[h("span",{style:{opacity:.7},children:"Latitude:"})," ",c==null?void 0:c.latitude]})}),(c==null?void 0:c.longitude)&&h("div",{children:M("p",{style:{marginTop:".2rem"},children:[h("span",{style:{opacity:.7},children:"Longitude:"})," ",c==null?void 0:c.longitude]})}),(c==null?void 0:c.name)&&h("div",{children:M("p",{style:{marginTop:".2rem"},children:[h("span",{style:{opacity:.7},children:"Name:"})," ",c==null?void 0:c.name]})}),(c==null?void 0:c.address)&&h("div",{children:M("p",{style:{marginTop:".2rem"},children:[h("span",{style:{opacity:.7},children:"Address:"})," ",c==null?void 0:c.address]})})]})]})]}),h(ed,{close:()=>E(!1),open:a,closeWithBackdrop:!0,mode:r,children:h(Ee,{children:(e==="images"||e==="stickers")&&h(Sa,{url:t,caption:n,openFullScreen:()=>E(!0),isFullScreen:a,fontFamily:l,fontSize:i})})}),n&&h("p",{style:{margin:".5rem 0 .7rem",color:"var(--sarufi-received-box-color)",fontFamily:"var(--sarufi-font-family)"},children:nd(td(n))})]})},em=({url:e})=>M("div",{style:{margin:".5rem .5rem .5rem 0rem"},className:"sarufi-flex-wide",children:[h("div",{style:{width:"calc( 100% - 50px )",transform:"scale(0.9)"},children:h("span",{className:"sarufi-flex-start",style:{width:"100%",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},children:h("span",{children:e})})}),h("button",{style:{background:"none",border:"none",cursor:"pointer",color:"var(--sent-box-text-color)"},className:"sarufi-button",onClick:()=>tm(e),children:h(G1,{})})]});function tm(e){const t=document.createElement("a");t.href=e,t.download="sarufi_document",t.download=e.replace(/^.*[\\\/]/,""),document.body.appendChild(t),t.click(),t.remove()}const nm=({chat:e,mode:t,fontFamily:n,fontSize:r,messageIndex:l})=>{var i,o,s,u,c,p,y,a,E,v,S,I,d,f,m,k,P,T,w,R,B,x,V,G;return M(Ee,{children:[((i=e==null?void 0:e.actions)==null?void 0:i.find(C=>C==null?void 0:C.send_images))&&((u=(s=(o=e==null?void 0:e.actions)==null?void 0:o.find(C=>C==null?void 0:C.send_images))==null?void 0:s.send_images)==null?void 0:u.map((C,g)=>h(Kn,{url:C.link,caption:(C==null?void 0:C.caption)??"",type:"images",mode:t,fontFamily:n,fontSize:r,index:g,mediaId:`sarufi-images-player-${l}-${g}`,chat:e},g))),((c=e==null?void 0:e.actions)==null?void 0:c.find(C=>C==null?void 0:C.send_stickers))&&((a=(y=(p=e==null?void 0:e.actions)==null?void 0:p.find(C=>C==null?void 0:C.send_stickers))==null?void 0:y.send_stickers)==null?void 0:a.map((C,g)=>h(Kn,{url:C.link,caption:(C==null?void 0:C.caption)??"",type:"stickers",mode:t,fontFamily:n,fontSize:r,index:g,mediaId:`sarufi-stickers-player-${l}-${g}`,chat:e},g))),((E=e==null?void 0:e.actions)==null?void 0:E.find(C=>C==null?void 0:C.send_videos))&&((I=(S=(v=e==null?void 0:e.actions)==null?void 0:v.find(C=>C==null?void 0:C.send_videos))==null?void 0:S.send_videos)==null?void 0:I.map((C,g)=>h(Kn,{url:C.link,caption:(C==null?void 0:C.caption)??"",type:"videos",mode:t,fontFamily:n,fontSize:r,index:g,mediaId:`sarufi-videos-player-${l}-${g}`,chat:e},g))),((d=e==null?void 0:e.actions)==null?void 0:d.find(C=>C==null?void 0:C.send_audios))&&((k=(m=(f=e==null?void 0:e.actions)==null?void 0:f.find(C=>C==null?void 0:C.send_audios))==null?void 0:m.send_audios)==null?void 0:k.map((C,g)=>h(Kn,{url:C.link,caption:(C==null?void 0:C.caption)??"",type:"audios",mode:t,fontFamily:n,fontSize:r,index:g,mediaId:`sarufi-audios-player-${l}-${g}`,chat:e},g))),((P=e==null?void 0:e.actions)==null?void 0:P.find(C=>C==null?void 0:C.send_documents))&&((R=(w=(T=e==null?void 0:e.actions)==null?void 0:T.find(C=>C==null?void 0:C.send_documents))==null?void 0:w.send_documents)==null?void 0:R.map((C,g)=>h(Kn,{url:C.link,caption:(C==null?void 0:C.caption)??"",type:"documents",mode:t,fontFamily:n,fontSize:r,index:g,mediaId:`sarufi-documents-player-${l}-${g}`,chat:e},g))),((B=e==null?void 0:e.actions)==null?void 0:B.find(C=>C==null?void 0:C.send_locations))&&((G=(V=(x=e==null?void 0:e.actions)==null?void 0:x.find(C=>C==null?void 0:C.send_locations))==null?void 0:V.send_locations)==null?void 0:G.map((C,g)=>h("div",{style:{fontSize:"calc(var(--sarufi-font-size) * 0.9 )",background:t==="dark"?"rgba(255, 255, 255, .1)":"rgba(0,0,0,.1)",borderRadius:".3rem",padding:".1rem .5rem"},children:M("div",{style:{margin:".5rem"},children:[h("div",{style:{marginBottom:".4rem"},children:"Location:"}),M("div",{children:[(C==null?void 0:C.latitude)&&h("div",{children:M("p",{style:{marginTop:".2rem"},children:[h("span",{style:{opacity:.7},children:"Latitude:"})," ",C==null?void 0:C.latitude]})}),(C==null?void 0:C.longitude)&&h("div",{children:M("p",{style:{marginTop:".2rem"},children:[h("span",{style:{opacity:.7},children:"Longitude:"})," ",C==null?void 0:C.longitude]})}),(C==null?void 0:C.name)&&h("div",{children:M("p",{style:{marginTop:".2rem"},children:[h("span",{style:{opacity:.7},children:"Name:"})," ",C==null?void 0:C.name]})}),(C==null?void 0:C.address)&&h("div",{children:M("p",{style:{marginTop:".2rem"},children:[h("span",{style:{opacity:.7},children:"Address:"})," ",C==null?void 0:C.address]})})]})]})},g)))]})};const rm=({styles:e,selectedDate:t,onSelect:n,contraints:r})=>{var s,u;const[l,i]=A.useState(t||new Date),o=c=>{i(c),n(c)};return M("div",{className:"datepicker-toggle",style:e,children:[h(Z1,{size:20,className:"datepicker-toggle-button"}),h("input",{type:"date",className:"datepicker-input",value:l.toISOString().split("T")[0],onChange:c=>c.target.value&&o(new Date(c.target.value)),min:(s=r==null?void 0:r.minDate)==null?void 0:s.toISOString().split("T")[0],max:(u=r==null?void 0:r.maxDate)==null?void 0:u.toISOString().split("T")[0]})]})},lm=({id:e,open:t,botId:n,API_URL:r,mode:l,primaryColor:i,token:o,fontFamily:s,fontSize:u})=>{const[c,p]=A.useState([]),[y,a]=A.useState(""),[E,v]=A.useState(!1),S=A.useRef(null),[I,d]=A.useState(e),[f]=A.useState(!1),m=(k,P,T)=>{k&&(p(w=>[...w,{message:k,sent:!0}]),a(""),v(!0),qf.post(`${r}${o?"/conversation/whatsapp":"/plugin/conversation/"+n}`,{message:T??k,chat_id:I,bot_id:n,message_type:P??"text"},{headers:{"Content-Type":"application/json",...o?{Authorization:"Bearer "+o}:{}}}).then(w=>{p(R=>{var B,x,V,G,C,g,re,ie,K,L,D,F,j,W,ze,ge,Ue,Y,se,Me,st,In,Dn,Fn;return[...R,{message:typeof((B=w==null?void 0:w.data)==null?void 0:B.actions)=="object"&&((G=(V=(x=w==null?void 0:w.data)==null?void 0:x.actions)==null?void 0:V.find(fe=>fe==null?void 0:fe.send_message))!=null&&G.send_message)?(re=(g=(C=w==null?void 0:w.data)==null?void 0:C.actions)==null?void 0:g.find(fe=>fe==null?void 0:fe.send_message))==null?void 0:re.send_message:typeof((ie=w==null?void 0:w.data)==null?void 0:ie.message)=="string"?(K=w==null?void 0:w.data)==null?void 0:K.message:(D=(L=w==null?void 0:w.data)==null?void 0:L.response)!=null&&D.find(fe=>Object.keys(fe)[0]==="send_message")?(ze=(W=(j=(F=w==null?void 0:w.data)==null?void 0:F.response)==null?void 0:j.find(fe=>Object.keys(fe)[0]==="send_message"))==null?void 0:W.send_message)==null?void 0:ze.join(` +`):(Ue=(ge=w==null?void 0:w.data)==null?void 0:ge.message)==null?void 0:Ue.join(` +`),received:!0,chat:w==null?void 0:w.data,type:(Y=w==null?void 0:w.data)!=null&&Y.actions?(In=(st=(Me=(se=w==null?void 0:w.data)==null?void 0:se.actions)==null?void 0:Me.find(fe=>fe==null?void 0:fe.send_reply_button))==null?void 0:st.send_reply_button)==null?void 0:In.type:"",actions:(Dn=w==null?void 0:w.data)==null?void 0:Dn.actions,next_state:(Fn=w==null?void 0:w.data)==null?void 0:Fn.next_state}]}),v(!1)}).catch(w=>{p(R=>{var B,x,V,G,C,g,re,ie,K,L,D,F,j;return[...R,{message:typeof((x=(B=w==null?void 0:w.response)==null?void 0:B.data)==null?void 0:x.detail)=="string"?(G=(V=w==null?void 0:w.response)==null?void 0:V.data)==null?void 0:G.detail:typeof((g=(C=w==null?void 0:w.response)==null?void 0:C.data)==null?void 0:g.detail)=="object"?(K=(ie=(re=w==null?void 0:w.response)==null?void 0:re.data)==null?void 0:ie.detail[0])==null?void 0:K.msg:typeof((D=(L=w==null?void 0:w.response)==null?void 0:L.data)==null?void 0:D.message)=="string"?(j=(F=w==null?void 0:w.response)==null?void 0:F.data)==null?void 0:j.message:w==null?void 0:w.message}]}),v(!1)}))};return A.useEffect(()=>{var k;S.current&&(S.current.scrollTop=((k=S.current)==null?void 0:k.scrollHeight)-S.current.clientHeight)},[c]),A.useEffect(()=>{I!==e&&(d(e),p([]),a(""))},[t]),M(Ee,{children:[h("div",{ref:S,id:"sarufi-chat-container",style:{background:"var(--sarufi-chatbox-bg)",height:"calc( 100% - 160px )",overflowY:"auto",position:"relative"},className:"sarufi-scroll-bar",children:M("div",{style:{position:"relative",padding:"1rem"},children:[h("div",{className:"sarufi-message-body",style:{maxWidth:280,background:"var(--sarufi-received-box-bg)",padding:"6px 8px 8px 9px",marginTop:".7rem",position:"relative",borderRadius:".3rem"},children:h("p",{style:{fontFamily:"var(--sarufi-font-family)"},children:'Send a message to initiate conversation i.e "Hello"'})}),M("ul",{children:[c==null?void 0:c.map((k,P)=>h(im,{chat:k,onSubmit:m,primaryColor:i,mode:l,fontFamily:s,fontSize:u,index:P},P)),E&&h("div",{className:"sarufi-message-body",style:{background:"var(--sarufi-received-box-bg)",padding:"6px 8px 8px 9px",marginTop:".7rem",position:"relative",borderRadius:".3rem",maxWidth:100},children:h(_r,{})})]})]})}),M("div",{className:"sarufi-flex-wide",style:{background:"var(--sarufi-secondary-color)",padding:".5rem"},children:[!f&&M("form",{style:{position:"relative",marginRight:".5rem",width:"100%",background:l==="light"?"white":"var(--sarufi-primary-color)"},onSubmit:k=>{k.preventDefault(),m(y)},children:[h(K1,{value:y,mode:l,primaryColor:i,autoFocus:!0,placeholder:"Compose a message",save:()=>m(y),onChange:k=>{a(k.target.value)}}),h(Q1,{mode:l,label:h("span",{className:"sarufi-flex-center",children:h(Y1,{size:24})})})]}),h("div",{className:"sarufi-flex-center message-actions",style:{color:l==="light"?"#525252":"white",width:f?"100%":"auto"},children:!f&&h(Ee,{children:h(rm,{onSelect:k=>a(`${k.getDate()}/${k.getMonth()+1}/${k.getFullYear()}`),styles:{margin:"0 .3rem"}})})})]}),M("p",{style:{fontSize:".7rem",textAlign:"center",padding:"5px 0",color:l==="dark"?"white":"",background:l==="light"?"white":"var(--sarufi-primary-color)"},children:["Powered by"," ",h("a",{href:"https://sarufi.io",target:"_blank",style:{textDecoration:"none",fontWeight:"700",color:"#2776EA"},children:"Sarufi"})]})]})},im=({chat:e,onSubmit:t,mode:n,fontFamily:r,fontSize:l,index:i,primaryColor:o})=>{var E,v,S,I,d,f,m,k,P,T,w,R,B,x,V,G,C,g,re,ie,K,L,D,F,j,W,ze,ge,Ue,Y,se,Me,st,In,Dn,Fn,fe,js,Us,$s,Hs;let s=(e==null?void 0:e.type)==="button"?(I=(S=(v=(E=e==null?void 0:e.actions)==null?void 0:E.find(O=>O==null?void 0:O.send_reply_button))==null?void 0:v.send_reply_button)==null?void 0:S.body)==null?void 0:I.text:e==null?void 0:e.message,u=(d=e==null?void 0:e.actions)==null?void 0:d.find(O=>Object.keys(O)[0]==="send_button");const[c,p]=A.useState(!1);A.useEffect(()=>{let O=document.getElementById("sarufi-chat-container");c&&O&&(O.style.overflowY="hidden"),!c&&O&&(O.style.overflowY="auto")},[c]);const y=O=>{if(O.key==="Escape")return p(!1)};A.useEffect(()=>(document.addEventListener("keydown",y,!1),()=>{document.removeEventListener("keydown",y,!1)}),[]);let a=!1;return(f=e==null?void 0:e.actions)!=null&&f.find(O=>O.send_audios&&O.send_audios.length>0||O.send_images&&O.send_images.length>0||O.send_videos&&O.send_videos.length>0||O.send_documents&&O.send_documents.length>0||O.send_stickers&&O.send_stickers.length>0||O.send_locations&&O.send_locations.length>0)&&(a=!0),M("li",{className:`${e!=null&&e.sent?"sarufi-flex-end":""}`,style:{position:"relative",display:"flex",alignItems:"flex-end"},children:[!(e!=null&&e.sent)&&h("div",{style:{marginRight:"5px"},children:h(Fo,{size:20,style:{color:o}})}),M("div",{children:[h(nm,{chat:e,mode:n,fontFamily:r,fontSize:l,messageIndex:i}),M("div",{className:`sarufi-message-body ${e!=null&&e.sent?"sent":""}`,style:{background:e!=null&&e.sent?"var(--sarufi-sent-box-bg)":"var(--sarufi-received-box-bg)",maxWidth:280,width:a?"100%":"max-content",minWidth:"50px",padding:"6px 8px 8px 9px",marginTop:a?"0":"12px",position:"relative",borderRadius:((w=(T=(P=(k=(m=e==null?void 0:e.actions)==null?void 0:m.find(O=>O==null?void 0:O.send_reply_button))==null?void 0:k.send_reply_button)==null?void 0:P.action)==null?void 0:T.buttons)==null?void 0:w.length)>0||(!s||typeof s!="string")&&(e!=null&&e.actions)&&u?"0rem":".3rem",...!a&&!(e!=null&&e.sent)?{borderTopRightRadius:".3rem"}:{}},children:[(!s||typeof s!="string")&&(e==null?void 0:e.actions)&&u&&M(Ee,{children:[((R=u.send_button)==null?void 0:R.header)&&h(Xr,{message:(B=u.send_button)==null?void 0:B.header,style:{marginBottom:"1rem"}}),((x=u.send_button)==null?void 0:x.body)&&h(Xr,{message:(V=u.send_button)==null?void 0:V.body}),((G=u.send_button)==null?void 0:G.footer)&&h(Xr,{message:(C=u.send_button)==null?void 0:C.footer,style:{marginTop:"1rem",fontSize:".9em",opacity:.7}})]}),((e==null?void 0:e.type)||s)&&!u&&h(Xr,{message:typeof s=="string"?s:s==null?void 0:s.join(` +`)})]}),(e==null?void 0:e.type)==="button"&&h("ul",{className:"sarufi-flex-wide sarufi-flex-wrap",style:{maxWidth:280},children:(L=(K=(ie=(re=(g=e==null?void 0:e.actions)==null?void 0:g.find(O=>O==null?void 0:O.send_reply_button))==null?void 0:re.send_reply_button)==null?void 0:ie.action)==null?void 0:K.buttons)==null?void 0:L.map((O,ii)=>{var Vs,Ws,Qs,Ks,Zs,Ys,Js,Xs,Gs,qs,bs;return h("li",{style:{width:"100%",marginTop:"2px",background:"var(--sarufi-received-box-bg)",borderBottomLeftRadius:ii===((Zs=(Ks=(Qs=(Ws=(Vs=e==null?void 0:e.actions)==null?void 0:Vs.find(et=>et==null?void 0:et.send_reply_button))==null?void 0:Ws.send_reply_button)==null?void 0:Qs.action)==null?void 0:Ks.buttons)==null?void 0:Zs.length)-1?".3rem":"0",borderBottomRightRadius:ii===((qs=(Gs=(Xs=(Js=(Ys=e==null?void 0:e.actions)==null?void 0:Ys.find(et=>et==null?void 0:et.send_reply_button))==null?void 0:Js.send_reply_button)==null?void 0:Xs.action)==null?void 0:Gs.buttons)==null?void 0:qs.length)-1?".3rem":"0"},children:h("button",{onClick:()=>{var et,eu;return t((et=O==null?void 0:O.reply)==null?void 0:et.title,(e==null?void 0:e.type)!=="text"?"interactive":"text",(eu=O==null?void 0:O.reply)==null?void 0:eu.id)},style:{width:"100%",height:"100%",background:"none",border:"none",color:"var(--sarufi-received-box-link-color)",cursor:"pointer",fontSize:"inherit",padding:"10px",fontFamily:"var(--sarufi-font-family)"},className:"sarufi-flex-center sarufi-flex-wrap",children:(bs=O==null?void 0:O.reply)==null?void 0:bs.title})},ii)})}),(!s||typeof s!="string")&&(e==null?void 0:e.actions)&&u&&h("div",{className:"bg-neutral-0 sarufi-flex-center",style:{maxWidth:280,marginTop:"2px",background:"var(--sarufi-received-box-bg)",borderBottomLeftRadius:".3rem",borderBottomRightRadius:".3rem"},children:h("button",{onClick:()=>p(!0),className:"link text-small-100 sarufi-flex-center cursor-pointer",style:{width:"100%",height:"100%",background:"none",border:"none",color:"var(--sarufi-received-box-link-color)",cursor:"pointer",fontSize:"inherit",padding:"10px",fontFamily:"var(--sarufi-font-family)"},children:((D=u.send_button)==null?void 0:D.button)??((j=(F=u.send_button)==null?void 0:F.action)==null?void 0:j.button)})}),(!s||typeof s!="string")&&(e==null?void 0:e.actions)&&u&&c&&M("div",{className:"choices",style:{position:"fixed",zIndex:100004,transition:"0.35s linear"},children:[h("div",{className:"sarufi-backdrop",style:{position:"fixed",background:"rgba(0, 0, 0, 0.6)",zIndex:100004,transition:"0.35s linear"},onClick:()=>p(!1)}),M("div",{className:"sarufi-options sarufi-scroll-bar",style:{zIndex:100005,background:"var(--sarufi-received-box-bg)",color:"var(--sarufi-received-box-color)",borderRadius:".3rem"},children:[M("div",{className:"sarufi-flex-start",style:{padding:"1rem",paddingBottom:".5rem",marginBottom:"1rem"},children:[h("button",{onClick:()=>p(!1),style:{background:"none",border:"none",cursor:"pointer",color:"var(--sarufi-received-box-color)"},className:"sarufi-button",children:h(Bs,{size:18})}),((ge=(ze=(W=u.send_button)==null?void 0:W.action)==null?void 0:ze.sections[0])==null?void 0:ge.title)&&h("p",{style:{width:"100%",marginLeft:"1rem",paddingRight:"2rem",textAlign:"center",fontFamily:"var(--sarufi-font-family)"},children:(se=(Y=(Ue=u.send_button)==null?void 0:Ue.action)==null?void 0:Y.sections[0])==null?void 0:se.title})]}),h("ul",{style:{padding:"1rem",paddingTop:"0"},children:((Fn=(Dn=(In=(st=(Me=u.send_button)==null?void 0:Me.action)==null?void 0:st.sections[0])==null?void 0:In.rows)==null?void 0:Dn.filter(O=>O==null?void 0:O.title))==null?void 0:Fn.length)>0&&((Hs=($s=(Us=(js=(fe=u.send_button)==null?void 0:fe.action)==null?void 0:js.sections[0])==null?void 0:Us.rows)==null?void 0:$s.filter(O=>O==null?void 0:O.title))==null?void 0:Hs.map(O=>M("li",{className:"sarufi-flex-wide ",style:{marginBottom:"1.5rem",cursor:"pointer"},onClick:()=>{t(O==null?void 0:O.title,"interactive",O==null?void 0:O.id),p(!1)},children:[M("div",{children:[h("p",{className:"text-small-200",style:{fontFamily:"var(--sarufi-font-family)"},children:O==null?void 0:O.title}),h("p",{style:{opacity:".7",fontSize:".9em",fontFamily:"var(--sarufi-font-family)"},children:O==null?void 0:O.description})]}),h("div",{children:h("span",{className:"sarufi-flex-center",style:{height:15,width:15,borderRadius:"50%",border:"1px solid var(--sarufi-received-box-color)",marginLeft:"1rem"}})})]},O==null?void 0:O.title)))})]})]})]})]})},Xr=({message:e,className:t,style:n})=>h(Ee,{children:typeof e=="string"&&h("p",{style:{fontFamily:"var(--sarufi-font-family)",width:"100%",...n},className:t??"",dangerouslySetInnerHTML:{__html:td(nd(e))}})}),td=e=>{const t=/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g;let n=[];return e.split(" ").forEach(l=>{let i=l.split(` +`),o=[];i.forEach(s=>{if(!s.includes("."))return o=[...o,s];if(!t.test(s))return o=[...o,s];const c=/^(?:(?:https?|ftp):\/\/)/i.test(s)?s:"http://"+s;return o=[...o,''+s+""]}),n=[...n,o.join(` +`)]}),n.join(" ")},nd=e=>{var t,n,r;return e&&typeof e=="string"?(r=(n=(t=e==null?void 0:e.replace(/(?:\*)([^*]*)(?:\*)/gm,"$1 "))==null?void 0:t.replace(/(?:_)([^_]*)(?:_)/gm,"$1 "))==null?void 0:n.replace(/(?:~)([^~]*)(?:~)/gm,"$1 "))==null?void 0:r.replace(/(?:```)([^```]*)(?:```)/gm,"$1 "):e},ka=(e=!1)=>{const t=localStorage.getItem("sarufi-chatId");if(t&&!e)return t;const n=new Date().valueOf().toLocaleString();return localStorage.setItem("sarufi-chatId",n),n},om=({botId:e,token:t,theme:n,popUpShow:r=!0})=>{const[l,i]=A.useState(!1),[o,s]=A.useState(ka()),[u,c]=A.useState(!1),[p,y]=A.useState(!1),[a,E]=A.useState({primaryColor:"#2776EA",borderColor:"lightgray",fontSize:"14",fontFamily:"InterRegular",sentBoxBg:"#D8F9D4",receivedBoxBg:"white",sentBoxColor:"black",receivedBoxColor:"black",chatboxBg:"#EDECE1",receivedBoxLinkColor:"blue",sentBoxLinkColor:"white",buttonSize:"md",mode:"light",title:"Chat",placement:"right",height:500,width:400}),v="https://api.sarufi.io",S=document.createElement("div");S.id="sarufi-modal",document.getElementById("sarufi-modal")||document.body.appendChild(S);const I=async()=>{if(n)return E(n);try{const{data:f}=await qf.get(`${v}/plugin/${(window==null?void 0:window.botId)??e}/unauthenticated`);if(Object.keys(f.theme_config).length===0)return;E(f==null?void 0:f.theme_config)}catch{}};A.useEffect(()=>{I()},[n]),A.useEffect(()=>{p||!r||u||setTimeout(()=>{c(!u)},5e3)},[u]);const d={"--sarufi-primary-color":(a==null?void 0:a.mode)==="dark"?"#202C33":(a==null?void 0:a.primaryColor)??"#2776EA","--sarufi-secondary-color":(a==null?void 0:a.mode)==="dark"?"#202C33":(a==null?void 0:a.secondaryColor)??"#EDECE1","--sarufi-font-size":`${(a==null?void 0:a.fontSize)??14}px`,"--sarufi-font-family":(a==null?void 0:a.fontFamily)==="InterRegular"?"'Inter', sans-serif":(a==null?void 0:a.fontFamily)==="PoppinsRegular"?"'Poppins', sans-serif":(a==null?void 0:a.fontFamily)==="inherit"?"inherit":"'Inter', sans-serif","--sarufi-border-color":(a==null?void 0:a.borderColor)??"lightgray","--sarufi-sent-box-bg":(a==null?void 0:a.mode)==="dark"?"#005C4B":(a==null?void 0:a.primaryColor)??"#2776EA","--sarufi-received-box-bg":(a==null?void 0:a.mode)==="dark"?"#202C33":(a==null?void 0:a.secondaryColor)??"#EDECE1","--sarufi-sent-box-color":((a==null?void 0:a.mode)==="dark","white"),"--sarufi-received-box-color":(a==null?void 0:a.mode)==="dark"?"white":(a==null?void 0:a.receivedBoxColor)??"black","--sarufi-sent-box-link-color":(a==null?void 0:a.mode)==="dark"?"#53BDEB":(a==null?void 0:a.sentBoxLinkColor)??"black","--sarufi-received-box-link-color":(a==null?void 0:a.mode)==="dark"?"#53BDEB":(a==null?void 0:a.receivedBoxLinkColor)??"black","--sarufi-chatbox-bg":(a==null?void 0:a.mode)==="dark"?"#0B141A":"white","--sarufi-chatbox-height":a!=null&&a.height?(a==null?void 0:a.height)+"px":"500px","--sarufi-chatbox-width":a!=null&&a.width?(a==null?void 0:a.width)+"px":"400px"};return M("div",{className:`sarufi-chat-container ${(a==null?void 0:a.placement)==="left"?"sarufi-left-align":"sarufi-right-align"} ${l?"open":""} + ${l?"sarufi-shadow-xl":"sarufi-flex-center"}`,style:{position:"fixed",fontFamily:(a==null?void 0:a.fontFamily)==="InterRegular"?"'Inter', sans-serif":(a==null?void 0:a.fontFamily)==="PoppinsRegular"?"'Poppins', sans-serif":(a==null?void 0:a.fontFamily)==="inherit"?"inherit":"'Inter', sans-serif",...l?{}:{height:(a==null?void 0:a.buttonSize)==="lg"?"70px":"50px",width:u?"fit-content":(a==null?void 0:a.buttonSize)==="lg"?"70px":"50px"},...d},children:[!l&&M("button",{className:`sarufi-shadow-xl ${u&&"sarufi-floating"}`,style:{display:u?"flex":"inline-flex",justifyContent:"center",alignItems:"center",position:"relative",cursor:"pointer",borderRadius:u?"50px":"50%",padding:u?".5rem 1rem":void 0,height:(a==null?void 0:a.buttonSize)==="lg"?"70px":(a==null?void 0:a.buttonSize)==="sm"?"30px":"50px",width:u?"100%":(a==null?void 0:a.buttonSize)==="lg"?"70px":(a==null?void 0:a.buttonSize)==="sm"?"30px":"50px",background:(a==null?void 0:a.primaryColor)??"#2776EA",color:"white",border:"none"},onClick:()=>{i(!0),c(!1),y(!0)},children:[h(Fo,{size:(a==null?void 0:a.buttonSize)==="lg"?40:(a==null?void 0:a.buttonSize)==="sm"?20:30}),M("div",{style:{display:u?"block":"none",width:"fit-content",opacity:u?1:0,marginLeft:"5px",textAlign:"start",fontSize:`${(a==null?void 0:a.buttonSize)==="sm"?"10px":"var(--sarufi-font-size)"}`},children:[h("p",{style:{fontWeight:"bold"},children:(a==null?void 0:a.bubbleTitle)??"Need Help?"}),h("p",{children:(a==null?void 0:a.bubbleSubTitle)??"Ask me"})]})]}),M("div",{style:{height:"100%",display:l?"block":"none"},children:[M("div",{className:"sarufi-flex-wide text-neutral-0",style:{borderTopLeftRadius:"18px",borderTopRightRadius:"18px",padding:"1rem",paddingLeft:"1rem",paddingRight:"1rem",background:"var(--sarufi-primary-color)",color:"white"},children:[M("div",{className:"sarufi-flex sarufi-align-center",children:[M("div",{className:"sarufi-flex-center",style:{background:(a==null?void 0:a.mode)==="dark"?a==null?void 0:a.secondaryColor:"var(--sarufi-secondary-color)",borderRadius:"50%",padding:".5rem",marginRight:"10px",position:"relative"},children:[h(Fo,{style:{color:(a==null?void 0:a.mode)==="dark"?a==null?void 0:a.primaryColor:"var(--sarufi-primary-color)"},size:(a==null?void 0:a.buttonSize)==="lg"?40:(a==null?void 0:a.buttonSize)==="sm"?20:30}),h("div",{style:{position:"absolute",bottom:"0",right:"1px",background:"#02B272",borderRadius:"50%",width:"10px",height:"10px"}})]}),M("div",{children:[h("p",{className:"sarufi-ellipsed-text",style:{fontWeight:600,marginBottom:"3px",fontFamily:"var(--sarufi-font-family)",fontSize:a!=null&&a.fontSize?Number(a==null?void 0:a.fontSize)*1.1:"1.1em"},children:a==null?void 0:a.title}),h("p",{style:{fontFamily:"var(--sarufi-font-family)",fontSize:"12px"},children:"Online"})]})]}),M("div",{className:"flex-center",children:[h("button",{className:"flex-center sarufi-button",onClick:()=>i(!1),style:{border:"none",background:"none",color:"white",cursor:"pointer",marginRight:"20px"},children:h(J1,{size:16,className:"text-neutral-0"})}),h("button",{className:"flex-center sarufi-button",onClick:()=>{i(!1),s(ka(!0))},style:{border:"none",background:"none",color:"white",cursor:"pointer"},children:h(Bs,{size:18,className:"text-neutral-0"})})]})]}),h(lm,{open:l,id:o,mode:(a==null?void 0:a.mode)??"light",primaryColor:(a==null?void 0:a.primaryColor)??"#2776EA",fontFamily:a.fontFamily??"inherit",fontSize:a.fontSize??16,botId:(window==null?void 0:window.botId)??e,token:t,API_URL:v})]})]})};Fi.createRoot(document.getElementById("sarufi-chatbox")).render(h(Sd.StrictMode,{children:h(om,{botId:(window==null?void 0:window.botId)??4107})})); diff --git a/example/vanilla-js/style.css b/example/vanilla-js/style.css index fbc7f81..1b5da72 100644 --- a/example/vanilla-js/style.css +++ b/example/vanilla-js/style.css @@ -1 +1 @@ -@import"https://fonts.googleapis.com/css2?family=Inter&family=Poppins&display=swap";.sarufi-chat-container{height:50px;width:50px;z-index:100000;-webkit-transition:height .25s;transition:height .25s;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:var(--sarufi-font-family);font-size:var(--sarufi-font-size);bottom:1rem}.sarufi-chat-container.sarufi-left-align,.sarufi-chat-container.sarufi-left-align .choices,.sarufi-chat-container.sarufi-left-align .sarufi-backdrop{left:1rem}.sarufi-chat-container.sarufi-left-align .sarufi-options{left:2rem}.sarufi-chat-container.sarufi-right-align,.sarufi-chat-container.sarufi-right-align .choices,.sarufi-chat-container.sarufi-right-align .sarufi-backdrop{right:1rem}.sarufi-chat-container.sarufi-right-align .sarufi-options{right:2rem}.sarufi-chat-container.open{height:var(--sarufi-chatbox-height);width:var(--sarufi-chatbox-width);max-width:100%;max-height:100%;border-radius:10px 10px 0 0;bottom:1rem;right:1rem;background:var(--clr-neutral-0)}.sarufi-chat-container button:focus{outline-color:transparent}.sarufi-chat-container a:hover{text-decoration:underline}.sarufi-chat-container p{margin:0;overflow-wrap:break-word;white-space:pre-wrap}.sarufi-chat-container ul{-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;list-style:none;-webkit-padding-start:0;padding-inline-start:0}.sarufi-chat-container form{width:100%;bottom:0;height:60px;-webkit-box-sizing:border-box;box-sizing:border-box}.sarufi-chat-container form button{position:absolute;height:50px;width:50px;max-width:50px!important;bottom:5px;right:5px;padding:1rem;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sarufi-primary-color)}.sarufi-chat-container .choices{height:calc(var(--sarufi-chatbox-height) - 82px - .5rem);max-height:calc(100% - 92px - .5rem);width:var(--sarufi-chatbox-width);max-width:100%;bottom:calc(40px + .2.2rem)}.sarufi-chat-container .sarufi-backdrop{height:calc(var(--sarufi-chatbox-height) - 95px - .5rem);max-height:calc(100% - 105px - .5rem);width:var(--sarufi-chatbox-width);max-width:100%;bottom:calc(69px + .5rem)}.sarufi-chat-container .sarufi-options{height:calc(var(--sarufi-chatbox-height) - 115px - .5rem);max-height:calc(100% - 94px - .5rem);width:calc(var(--sarufi-chatbox-width) - 32px);max-width:100%;overflow-y:auto;position:fixed;bottom:calc(80px + .5rem);margin-top:1rem}.sarufi-field-group{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%}.sarufi-field-group .input-group{position:relative;display:block!important;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.sarufi-field-group .input-group textarea{resize:none;background-color:transparent;width:100%;height:100%;border:1px solid transparent;-webkit-transition:.25s;transition:.25s;font-family:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:inherit}.sarufi-field-group .input-group textarea:focus,.sarufi-field-group .input-group textarea:hover{border-color:var(--sarufi-primary-color);border-width:1px;outline:transparent!important}.sarufi-field-group .input-group textarea:disabled{border-color:#4a535b;color:#4a535b}.sarufi-chat-loader div{width:9px;height:9px;background-color:var(--sarufi-received-box-color);border-radius:50%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s ease-in-out infinite;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-box-sizing:border-box;box-sizing:border-box}.sarufi-chat-loader .sarufi-bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}.sarufi-chat-loader .sarufi-bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}80%{transform:scale(0);-webkit-transform:scale(0)}to{transform:scale(0);-webkit-transform:scale(0)}}@keyframes bouncedelay{0%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}80%{transform:scale(0);-webkit-transform:scale(0)}to{transform:scale(0);-webkit-transform:scale(0)}}@media screen and (max-width: 500px){.sarufi-chat-container.sarufi-left-align .sarufi-backdrop,.sarufi-chat-container.sarufi-left-align .sarufi-options{left:0!important}.sarufi-chat-container.sarufi-right-align .sarufi-backdrop,.sarufi-chat-container.sarufi-right-align .sarufi-options{right:0!important}.sarufi-chat-container.open{width:100%;bottom:0;right:0}.sarufi-chat-container.open.sarufi-left-align{left:0rem}.sarufi-chat-container .sarufi-backdrop{width:100%;bottom:calc(53.5px + .5rem)}.sarufi-chat-container .sarufi-options{width:100%;max-width:100%;bottom:calc(65px + .5rem)}}@media screen and (max-height: 600px){.sarufi-chat-container.sarufi-left-align .sarufi-backdrop{left:1rem!important}.sarufi-chat-container.sarufi-left-align .sarufi-options{left:2rem!important}.sarufi-chat-container.sarufi-right-align .sarufi-backdrop{right:1rem!important}.sarufi-chat-container.sarufi-right-align .sarufi-options{right:2rem}.sarufi-chat-container.open{bottom:0;right:0;height:calc(100% - 50px);max-height:100%}.sarufi-chat-container.open.sarufi-right-align{right:1rem}.sarufi-chat-container.open.sarufi-left-align{left:1rem}.sarufi-chat-container .sarufi-backdrop{height:calc(100%px - 144px - .5rem);max-height:calc(100% - 144px - .5rem);width:var(--sarufi-chatbox-width);max-width:100%;bottom:calc(52px + .5rem)}.sarufi-chat-container .sarufi-options{height:calc(100% - 155px - .5rem);max-height:calc(100% - 140px - .5rem);width:calc(var(--sarufi-chatbox-width) - 32px);max-width:100%;bottom:calc(60px + .5rem)}}@media (max-width: 500px) and (max-height: 600px){.sarufi-chat-container.sarufi-left-align .sarufi-backdrop,.sarufi-chat-container.sarufi-left-align .sarufi-options{left:0rem!important}.sarufi-chat-container.sarufi-right-align .sarufi-backdrop,.sarufi-chat-container.sarufi-right-align .sarufi-options{right:0rem!important}.sarufi-chat-container.open{height:calc(100% - 50px)}.sarufi-chat-container.open.sarufi-right-align{right:0rem}.sarufi-chat-container.open.sarufi-left-align{left:0rem}.sarufi-chat-container .sarufi-backdrop{height:calc(100%px - 144px - .5rem);max-height:calc(100% - 144px - .5rem);width:var(--sarufi-chatbox-width);max-width:100%}.sarufi-chat-container .sarufi-options{height:calc(100% - 155px - .5rem);max-height:calc(100% - 140px - .5rem);width:calc(var(--sarufi-chatbox-width) - 32px);max-width:100%;bottom:calc(60px + .5rem);margin-top:1rem}}body.sarufi-no-scrolling{overflow-y:hidden}.sarufi-flex{display:-webkit-box;display:-ms-flexbox;display:flex}.sarufi-flex-center{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.sarufi-flex-wide{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sarufi-flex-end{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.sarufi-flex-start{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.sarufi-flex-around{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.sarufi-flex-even{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:space-evenly;-ms-flex-pack:space-evenly;justify-content:space-evenly}.sarufi-flex-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.sarufi-flex-row{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.sarufi-align-start{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.sarufi-align-end{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.sarufi-align-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.sarufi-flex-wrap{-ms-flex-wrap:wrap;flex-wrap:wrap}.sarufi-scroll-bar::-webkit-scrollbar{width:.4rem;height:.4rem}.sarufi-scroll-bar::-webkit-scrollbar-thumb{background:var(--sarufi-border-color);border-radius:.7em}.sarufi-shadow-xl{-webkit-box-shadow:0px 20px 25px -5px rgba(0,0,0,.1),0px 10px 10px -5px rgba(0,0,0,.04);box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a}.sarufi-ellipsed-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical}.sarufi-message-body{position:relative;border-top-left-radius:0!important;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:inherit;color:var(--sarufi-received-box-color);-webkit-transition:.45s all;transition:.45s all}.sarufi-button{padding:0!important}.sarufi-message-body a{color:var(--sarufi-received-box-link-color);text-decoration:none}.sarufi-message-body.sarufi-message-body-w-arrow:before{content:"";position:absolute;left:-11px;top:0;width:0;height:0;border-style:solid;border-width:0 11px 9px 0;border-color:transparent var(--sarufi-received-box-bg) transparent transparent}.sarufi-message-body.sent{border-top-left-radius:.3rem!important;border-top-right-radius:0!important;color:var(--sarufi-sent-box-color)}.sarufi-message-body.sent a{color:var(--sarufi-sent-box-link-color)}.sarufi-message-body.sent.sarufi-message-body-w-arrow:before{left:100%;width:0;height:0;border-style:solid;border-width:9px 11px 0 0;border-color:var(--sarufi-sent-box-bg) transparent transparent transparent}.sarufi-media-preview p,.sarufi-media-preview span,.sarufi-media-preview li,.sarufi-media-preview figcaption,.sarufi-media-preview button{font-family:var(--sarufi-font-family)}.sarufi-modal{position:fixed;top:0;left:0;width:100vw;max-width:100vw;max-height:100vh;height:100vh;-webkit-box-align:center;-ms-flex-align:center;align-items:center;opacity:0;pointer-events:none}.sarufi-modal.open{pointer-events:all;opacity:1}.sarufi-modal .sarufi-container{padding:0;position:relative;z-index:901;width:100vw;max-width:100vw;overflow:hidden;max-height:100vh;height:100vh;margin:0}.sarufi-modal .sarufi-container p,.sarufi-modal .sarufi-container span,.sarufi-modal .sarufi-container li,.sarufi-modal .sarufi-container figcaption,.sarufi-modal .sarufi-container button{font-family:var(--sarufi-font-family)!important}.sarufi-modal .sarufi-modal-backdrop{position:fixed;background:rgba(0,0,0,.95);height:100vh;width:100vw;top:0;left:0;z-index:8;opacity:0;pointer-events:none;-webkit-transition:.35s linear;transition:.35s linear}.sarufi-modal .sarufi-modal-backdrop.open{opacity:1;pointer-events:all}@media screen and (max-width: 767px){.sarufi-modal .sarufi-container{padding:2rem 1rem;margin:2rem 0}.sarufi-modal .sarufi-close-modal{top:1rem}}.sarufi-chat-container input[type=range],.sarufi-modal input[type=range]{-webkit-appearance:none;width:calc(100% - 90px);background:transparent;border-radius:5px}.sarufi-chat-container input[type=range],.sarufi-modal input[type=range]{-webkit-appearance:none;width:100%;background:transparent}.sarufi-chat-container input[type=range]::-webkit-slider-thumb,.sarufi-modal input[type=range]::-webkit-slider-thumb{visibility:hidden}.sarufi-chat-container input[type=range]:focus,.sarufi-modal input[type=range]:focus{outline:none}.sarufi-chat-container input[type=range]::-ms-track,.sarufi-modal input[type=range]::-ms-track{width:100%;cursor:pointer;background:transparent;border-color:transparent;color:transparent}.sarufi-chat-container input[type=range]:active::-webkit-slider-thumb,.sarufi-modal input[type=range]:active::-webkit-slider-thumb{visibility:hidden}.sarufi-chat-container input[type=range]::-moz-range-thumb,.sarufi-modal input[type=range]::-moz-range-thumb{visibility:hidden}.sarufi-chat-container input[type=range]::-ms-thumb,.sarufi-modal input[type=range]::-ms-thumb{visibility:hidden}.sarufi-chat-container input[type=range]::-webkit-slider-runnable-track,.sarufi-modal input[type=range]::-webkit-slider-runnable-track{width:100%;height:5px;cursor:pointer;margin-top:-2px;background:lightgray;border-radius:5px}.sarufi-chat-container input[type=range]::-moz-range-track,.sarufi-modal input[type=range]::-moz-range-track{width:100%;height:5px;cursor:pointer;margin-top:-2px;background:gray;border-radius:5px}.sarufi-chat-container input[type=range]::-ms-track,.sarufi-modal input[type=range]::-ms-track{width:100%;height:5px;cursor:pointer;margin-top:-2px;background:gray;border-radius:5px}.sarufi-chat-container input[type=range]::-ms-fill-lower,.sarufi-modal input[type=range]::-ms-fill-lower{background:gray}.sarufi-chat-container input[type=range]:focus::-ms-fill-lower,.sarufi-modal input[type=range]:focus::-ms-fill-lower{background:gray}.sarufi-chat-container input[type=range]::-ms-fill-upper,.sarufi-modal input[type=range]::-ms-fill-upper{background:gray}.sarufi-chat-container input[type=range]:focus::-ms-fill-upper,.sarufi-modal input[type=range]:focus::-ms-fill-upper{background:gray}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar,.sarufi-modal .sarufi-bar.sarufi-duration__bar{width:100%;border-radius:5px}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input,.sarufi-modal .sarufi-bar.sarufi-duration__bar input{width:calc(100% - 4px);border-radius:5px;position:relative;-webkit-transition:.05s;transition:.05s}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input:before,.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input:after,.sarufi-modal .sarufi-bar.sarufi-duration__bar input:before,.sarufi-modal .sarufi-bar.sarufi-duration__bar input:after{position:absolute;content:"";top:-2px;left:0;z-index:1;cursor:pointer;height:5px;border-radius:5px;-webkit-transition:.05s;transition:.05s}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input:before,.sarufi-modal .sarufi-bar.sarufi-duration__bar input:before{background-color:gray;cursor:pointer}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input:after,.sarufi-modal .sarufi-bar.sarufi-duration__bar input:after{left:10px;background-color:#d3d3d3;opacity:0}.sarufi-chat-container .sarufi-audio-player,.sarufi-modal .sarufi-audio-player{width:100%;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.sarufi-chat-container .sarufi-audio-player .sarufi-bar.sarufi-duration__bar input:before,.sarufi-modal .sarufi-audio-player .sarufi-bar.sarufi-duration__bar input:before{width:calc(var(--sarufi-audio-seek-before-width) + 2.5px)}.sarufi-chat-container .sarufi-video-player,.sarufi-modal .sarufi-video-player{width:100%;position:relative}.sarufi-chat-container .sarufi-video-player .sarufi-bar.sarufi-duration__bar input:before,.sarufi-modal .sarufi-video-player .sarufi-bar.sarufi-duration__bar input:before{width:calc(var(--sarufi-video-seek-before-width) + 2.5px)}.sarufi-chat-container .sarufi-video-player .sarufi-video-controls,.sarufi-modal .sarufi-video-player .sarufi-video-controls{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:colum;flex-direction:colum}.sarufi-chat-container .sarufi-video-player .sarufi-video-controls .sarufi-video-more-controls,.sarufi-modal .sarufi-video-player .sarufi-video-controls .sarufi-video-more-controls{cursor:default;bottom:0;height:100%;width:100%;position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-transition:.2s;transition:.2s}.sarufi-chat-container .sarufi-video-player .sarufi-video-controls .sarufi-more-controls-container,.sarufi-modal .sarufi-video-player .sarufi-video-controls .sarufi-more-controls-container{width:100%;position:absolute;bottom:0;left:0;padding:.5rem 0 0;color:#fff} +@import"https://fonts.googleapis.com/css2?family=Inter&family=Poppins&display=swap";.sarufi-chat-container{height:50px;width:50px;z-index:100000;-webkit-transition:height .25s;transition:height .25s;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:var(--sarufi-font-family);font-size:var(--sarufi-font-size);bottom:1rem}.sarufi-chat-container.sarufi-left-align,.sarufi-chat-container.sarufi-left-align .choices,.sarufi-chat-container.sarufi-left-align .sarufi-backdrop{left:1rem}.sarufi-chat-container.sarufi-left-align .sarufi-options{left:2rem}.sarufi-chat-container.sarufi-right-align,.sarufi-chat-container.sarufi-right-align .choices,.sarufi-chat-container.sarufi-right-align .sarufi-backdrop{right:1rem}.sarufi-chat-container.sarufi-right-align .sarufi-options{right:2rem}.sarufi-chat-container.open{height:var(--sarufi-chatbox-height);width:var(--sarufi-chatbox-width);max-width:100%;max-height:100%;border-radius:10px 10px 18px 18px;bottom:1rem;right:1rem;background:var(--clr-neutral-0)}.sarufi-chat-container button:focus{outline-color:transparent}.sarufi-chat-container a:hover{text-decoration:underline}.sarufi-chat-container p{margin:0;overflow-wrap:break-word;white-space:pre-wrap}.sarufi-chat-container ul{-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;list-style:none;-webkit-padding-start:0;padding-inline-start:0}.sarufi-chat-container form button{position:absolute;top:7px;right:5px;color:var(--sarufi-primary-color)}.sarufi-chat-container .choices{height:calc(var(--sarufi-chatbox-height) - 82px - .5rem);max-height:calc(100% - 92px - .5rem);width:var(--sarufi-chatbox-width);max-width:100%;bottom:calc(40px + .2.2rem)}.sarufi-chat-container .sarufi-backdrop{height:calc(var(--sarufi-chatbox-height) - 95px - .5rem);max-height:calc(100% - 105px - .5rem);width:var(--sarufi-chatbox-width);max-width:100%;bottom:calc(69px + .5rem)}.sarufi-chat-container .sarufi-options{height:calc(var(--sarufi-chatbox-height) - 115px - .5rem);max-height:calc(100% - 94px - .5rem);width:calc(var(--sarufi-chatbox-width) - 32px);max-width:100%;overflow-y:auto;position:fixed;bottom:calc(80px + .5rem);margin-top:1rem}.sarufi-chat-container .message-actions button{border:none;background:none;cursor:pointer}.sarufi-field-group{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%}.sarufi-field-group .input-group{display:block!important;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.sarufi-field-group .input-group textarea:focus,.sarufi-field-group .input-group textarea:hover{outline:transparent!important}.sarufi-field-group .input-group textarea:disabled{border-color:#4a535b;color:#4a535b}.sarufi-chat-loader div{width:9px;height:9px;background-color:var(--sarufi-received-box-color);border-radius:50%;display:inline-block;-webkit-animation:bouncedelay 1.4s infinite ease-in-out;animation:bouncedelay 1.4s ease-in-out infinite;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-box-sizing:border-box;box-sizing:border-box}.sarufi-chat-loader .sarufi-bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}.sarufi-chat-loader .sarufi-bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes bouncedelay{0%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}80%{transform:scale(0);-webkit-transform:scale(0)}to{transform:scale(0);-webkit-transform:scale(0)}}@keyframes bouncedelay{0%{transform:scale(0);-webkit-transform:scale(0)}40%{transform:scale(1);-webkit-transform:scale(1)}80%{transform:scale(0);-webkit-transform:scale(0)}to{transform:scale(0);-webkit-transform:scale(0)}}@media screen and (max-width: 500px){.sarufi-chat-container.sarufi-left-align .sarufi-backdrop,.sarufi-chat-container.sarufi-left-align .sarufi-options{left:0!important}.sarufi-chat-container.sarufi-right-align .sarufi-backdrop,.sarufi-chat-container.sarufi-right-align .sarufi-options{right:0!important}.sarufi-chat-container.open{width:100%;bottom:0;right:0}.sarufi-chat-container.open.sarufi-left-align{left:0rem}.sarufi-chat-container .sarufi-backdrop{width:100%;bottom:calc(53.5px + .5rem)}.sarufi-chat-container .sarufi-options{width:100%;max-width:100%;bottom:calc(65px + .5rem)}}@media screen and (max-height: 600px){.sarufi-chat-container.sarufi-left-align .sarufi-backdrop{left:1rem!important}.sarufi-chat-container.sarufi-left-align .sarufi-options{left:2rem!important}.sarufi-chat-container.sarufi-right-align .sarufi-backdrop{right:1rem!important}.sarufi-chat-container.sarufi-right-align .sarufi-options{right:2rem}.sarufi-chat-container.open{bottom:0;right:0;height:calc(100% - 50px);max-height:100%}.sarufi-chat-container.open.sarufi-right-align{right:1rem}.sarufi-chat-container.open.sarufi-left-align{left:1rem}.sarufi-chat-container .sarufi-backdrop{height:calc(100%px - 144px - .5rem);max-height:calc(100% - 144px - .5rem);width:var(--sarufi-chatbox-width);max-width:100%;bottom:calc(52px + .5rem)}.sarufi-chat-container .sarufi-options{height:calc(100% - 155px - .5rem);max-height:calc(100% - 140px - .5rem);width:calc(var(--sarufi-chatbox-width) - 32px);max-width:100%;bottom:calc(60px + .5rem)}}@media (max-width: 500px) and (max-height: 600px){.sarufi-chat-container.sarufi-left-align .sarufi-backdrop,.sarufi-chat-container.sarufi-left-align .sarufi-options{left:0rem!important}.sarufi-chat-container.sarufi-right-align .sarufi-backdrop,.sarufi-chat-container.sarufi-right-align .sarufi-options{right:0rem!important}.sarufi-chat-container.open{height:calc(100% - 50px)}.sarufi-chat-container.open.sarufi-right-align{right:0rem}.sarufi-chat-container.open.sarufi-left-align{left:0rem}.sarufi-chat-container .sarufi-backdrop{height:calc(100%px - 144px - .5rem);max-height:calc(100% - 144px - .5rem);width:var(--sarufi-chatbox-width);max-width:100%}.sarufi-chat-container .sarufi-options{height:calc(100% - 155px - .5rem);max-height:calc(100% - 140px - .5rem);width:calc(var(--sarufi-chatbox-width) - 32px);max-width:100%;bottom:calc(60px + .5rem);margin-top:1rem}}body.sarufi-no-scrolling{overflow-y:hidden}.sarufi-flex{display:-webkit-box;display:-ms-flexbox;display:flex}.sarufi-flex-center{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.sarufi-flex-wide{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.sarufi-flex-end{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.sarufi-flex-start{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.sarufi-flex-around{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.sarufi-flex-even{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:space-evenly;-ms-flex-pack:space-evenly;justify-content:space-evenly}.sarufi-flex-column{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.sarufi-flex-row{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.sarufi-align-start{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.sarufi-align-end{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.sarufi-align-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.sarufi-flex-wrap{-ms-flex-wrap:wrap;flex-wrap:wrap}.sarufi-scroll-bar::-webkit-scrollbar{width:.4rem;height:.4rem}.sarufi-scroll-bar::-webkit-scrollbar-thumb{background:var(--sarufi-border-color);border-radius:.7em}.sarufi-shadow-xl{-webkit-box-shadow:0px 20px 25px -5px rgba(0,0,0,.1),0px 10px 10px -5px rgba(0,0,0,.04);box-shadow:0 20px 25px -5px #0000001a,0 10px 10px -5px #0000000a}.sarufi-ellipsed-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical}.sarufi-message-body{position:relative;border-top-left-radius:0!important;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:inherit;color:var(--sarufi-received-box-color);-webkit-transition:.45s all;transition:.45s all}.sarufi-button{padding:0!important}.sarufi-message-body a{color:var(--sarufi-received-box-link-color);text-decoration:none}.sarufi-message-body.sarufi-message-body-w-arrow:before{content:"";position:absolute;left:-11px;top:0;width:0;height:0;border-style:solid;border-width:0 11px 9px 0;border-color:transparent var(--sarufi-received-box-bg) transparent transparent}.sarufi-message-body.sent{border-top-left-radius:.3rem!important;border-top-right-radius:0!important;color:var(--sarufi-sent-box-color)}.sarufi-message-body.sent a{color:var(--sarufi-sent-box-link-color)}.sarufi-message-body.sent.sarufi-message-body-w-arrow:before{left:100%;width:0;height:0;border-style:solid;border-width:9px 11px 0 0;border-color:var(--sarufi-sent-box-bg) transparent transparent transparent}.sarufi-media-preview p,.sarufi-media-preview span,.sarufi-media-preview li,.sarufi-media-preview figcaption,.sarufi-media-preview button{font-family:var(--sarufi-font-family)}.sarufi-modal{position:fixed;top:0;left:0;width:100vw;max-width:100vw;max-height:100vh;height:100vh;-webkit-box-align:center;-ms-flex-align:center;align-items:center;opacity:0;pointer-events:none}.sarufi-modal.open{pointer-events:all;opacity:1}.sarufi-modal .sarufi-container{padding:0;position:relative;z-index:901;width:100vw;max-width:100vw;overflow:hidden;max-height:100vh;height:100vh;margin:0}.sarufi-modal .sarufi-container p,.sarufi-modal .sarufi-container span,.sarufi-modal .sarufi-container li,.sarufi-modal .sarufi-container figcaption,.sarufi-modal .sarufi-container button{font-family:var(--sarufi-font-family)!important}.sarufi-modal .sarufi-modal-backdrop{position:fixed;background:rgba(0,0,0,.95);height:100vh;width:100vw;top:0;left:0;z-index:8;opacity:0;pointer-events:none;-webkit-transition:.35s linear;transition:.35s linear}.sarufi-modal .sarufi-modal-backdrop.open{opacity:1;pointer-events:all}@media screen and (max-width: 767px){.sarufi-modal .sarufi-container{padding:2rem 1rem;margin:2rem 0}.sarufi-modal .sarufi-close-modal{top:1rem}}.sarufi-chat-container input[type=range],.sarufi-modal input[type=range]{-webkit-appearance:none;width:calc(100% - 90px);background:transparent;border-radius:5px}.sarufi-chat-container input[type=range],.sarufi-modal input[type=range]{-webkit-appearance:none;width:100%;background:transparent}.sarufi-chat-container input[type=range]::-webkit-slider-thumb,.sarufi-modal input[type=range]::-webkit-slider-thumb{visibility:hidden}.sarufi-chat-container input[type=range]:focus,.sarufi-modal input[type=range]:focus{outline:none}.sarufi-chat-container input[type=range]::-ms-track,.sarufi-modal input[type=range]::-ms-track{width:100%;cursor:pointer;background:transparent;border-color:transparent;color:transparent}.sarufi-chat-container input[type=range]:active::-webkit-slider-thumb,.sarufi-modal input[type=range]:active::-webkit-slider-thumb{visibility:hidden}.sarufi-chat-container input[type=range]::-moz-range-thumb,.sarufi-modal input[type=range]::-moz-range-thumb{visibility:hidden}.sarufi-chat-container input[type=range]::-ms-thumb,.sarufi-modal input[type=range]::-ms-thumb{visibility:hidden}.sarufi-chat-container input[type=range]::-webkit-slider-runnable-track,.sarufi-modal input[type=range]::-webkit-slider-runnable-track{width:100%;height:5px;cursor:pointer;margin-top:-2px;background:lightgray;border-radius:5px}.sarufi-chat-container input[type=range]::-moz-range-track,.sarufi-modal input[type=range]::-moz-range-track{width:100%;height:5px;cursor:pointer;margin-top:-2px;background:gray;border-radius:5px}.sarufi-chat-container input[type=range]::-ms-track,.sarufi-modal input[type=range]::-ms-track{width:100%;height:5px;cursor:pointer;margin-top:-2px;background:gray;border-radius:5px}.sarufi-chat-container input[type=range]::-ms-fill-lower,.sarufi-modal input[type=range]::-ms-fill-lower{background:gray}.sarufi-chat-container input[type=range]:focus::-ms-fill-lower,.sarufi-modal input[type=range]:focus::-ms-fill-lower{background:gray}.sarufi-chat-container input[type=range]::-ms-fill-upper,.sarufi-modal input[type=range]::-ms-fill-upper{background:gray}.sarufi-chat-container input[type=range]:focus::-ms-fill-upper,.sarufi-modal input[type=range]:focus::-ms-fill-upper{background:gray}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar,.sarufi-modal .sarufi-bar.sarufi-duration__bar{width:100%;border-radius:5px}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input,.sarufi-modal .sarufi-bar.sarufi-duration__bar input{width:calc(100% - 4px);border-radius:5px;position:relative;-webkit-transition:.05s;transition:.05s}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input:before,.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input:after,.sarufi-modal .sarufi-bar.sarufi-duration__bar input:before,.sarufi-modal .sarufi-bar.sarufi-duration__bar input:after{position:absolute;content:"";top:-2px;left:0;z-index:1;cursor:pointer;height:5px;border-radius:5px;-webkit-transition:.05s;transition:.05s}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input:before,.sarufi-modal .sarufi-bar.sarufi-duration__bar input:before{background-color:gray;cursor:pointer}.sarufi-chat-container .sarufi-bar.sarufi-duration__bar input:after,.sarufi-modal .sarufi-bar.sarufi-duration__bar input:after{left:10px;background-color:#d3d3d3;opacity:0}.sarufi-chat-container .sarufi-audio-player,.sarufi-modal .sarufi-audio-player{width:100%;position:relative;display:-webkit-box;display:-ms-flexbox;display:flex}.sarufi-chat-container .sarufi-audio-player .sarufi-bar.sarufi-duration__bar input:before,.sarufi-modal .sarufi-audio-player .sarufi-bar.sarufi-duration__bar input:before{width:calc(var(--sarufi-audio-seek-before-width) + 2.5px)}.sarufi-chat-container .sarufi-video-player,.sarufi-modal .sarufi-video-player{width:100%;position:relative}.sarufi-chat-container .sarufi-video-player .sarufi-bar.sarufi-duration__bar input:before,.sarufi-modal .sarufi-video-player .sarufi-bar.sarufi-duration__bar input:before{width:calc(var(--sarufi-video-seek-before-width) + 2.5px)}.sarufi-chat-container .sarufi-video-player .sarufi-video-controls,.sarufi-modal .sarufi-video-player .sarufi-video-controls{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:colum;flex-direction:colum}.sarufi-chat-container .sarufi-video-player .sarufi-video-controls .sarufi-video-more-controls,.sarufi-modal .sarufi-video-player .sarufi-video-controls .sarufi-video-more-controls{cursor:default;bottom:0;height:100%;width:100%;position:absolute;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-transition:.2s;transition:.2s}.sarufi-chat-container .sarufi-video-player .sarufi-video-controls .sarufi-more-controls-container,.sarufi-modal .sarufi-video-player .sarufi-video-controls .sarufi-more-controls-container{width:100%;position:absolute;bottom:0;left:0;padding:.5rem 0 0;color:#fff}.datepicker-toggle{display:inline-block;position:relative;width:20px;height:21px;margin:0 .3rem}.datepicker-toggle-button{position:absolute;left:0;top:0;width:100%;height:100%}.datepicker-input{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;cursor:pointer;box-sizing:border-box}.datepicker-input::-webkit-calendar-picker-indicator{position:absolute;left:0;top:0;width:100%;height:100%;margin:0;padding:0;cursor:pointer} diff --git a/package-lock.json b/package-lock.json index 3987da9..4c3ea24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-sarufi-chatbox", - "version": "0.3.6", + "version": "0.4.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "react-sarufi-chatbox", - "version": "0.3.6", + "version": "0.4.8", "license": "ISC", "dependencies": { "axios": "^1.3.4" diff --git a/src/assets/icons/index.tsx b/src/assets/icons/index.tsx index 4aa9e99..840abb8 100644 --- a/src/assets/icons/index.tsx +++ b/src/assets/icons/index.tsx @@ -1,11 +1,69 @@ import React, { CSSProperties, FC } from "react"; -interface IconProps { +export interface IconProps { size?: number | string; className?: string; style?: CSSProperties; } +export const Attachment: FC = ({ size, style, className }) => ( + + + +); + +export const Calendar: FC = ({ size, style, className }) => ( + + + +); + +export const CancelRecordIcon = ({ size, className, style }: IconProps) => ( + + {/* */} + + +); + // that x icon export const Close: FC = ({ size, style, className }) => { return ( @@ -26,6 +84,32 @@ export const Close: FC = ({ size, style, className }) => { ); }; +export const RecordingAudioIcon = ({ size, className, style }: IconProps) => ( + + + + + +); + export const TextComponent: FC = ({ size, style, className }) => { return ( = ({ size, style, className }) => { export const SendIcon: FC = ({ size, className, style }) => { return ( - ); }; +export const MicIcon: FC = ({ size, className, style }) => ( + + + +); + +export const MinusIcon: FC = ({ size, className, style }) => ( + + + +); + export const Pause: FC = ({ className, size }) => { return ( = ({ size, style, className }) => ( + + + + +); diff --git a/src/chat/button.tsx b/src/chat/button.tsx index ec74f0a..20d6328 100644 --- a/src/chat/button.tsx +++ b/src/chat/button.tsx @@ -21,16 +21,13 @@ const Button: FC = ({ label, mode, onClick, disabled }) => { cursor: disabled ? "default" : "pointer", opacity: disabled ? 0.4 : 1, fontSize: ".9rem", - padding: ".7rem 1rem", - position: "absolute", overflow: "hidden", transition: ".3s linear", zIndex: 100001, - right: "5px", border: "none", + backgroundColor: "transparent", ...(mode === "dark" ? { - backgroundColor: "transparent", color: "white", } : {}), diff --git a/src/chat/chat.css b/src/chat/chat.css index 1e25106..05589ca 100644 --- a/src/chat/chat.css +++ b/src/chat/chat.css @@ -2,10 +2,10 @@ height: 50px; width: 50px; z-index: 100000; - -webkit-transition: height .25s; - transition: height .25s; + -webkit-transition: height 0.25s; + transition: height 0.25s; -webkit-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; font-family: var(--sarufi-font-family); font-size: var(--sarufi-font-size); bottom: 1rem; @@ -48,7 +48,9 @@ width: var(--sarufi-chatbox-width); max-width: 100%; max-height: 100%; - border-radius: 0; + border-radius: 18px; + /* overflow: hidden; */ + /* border: 1px solid blue; */ bottom: 1rem; right: 1rem; background: var(--clr-neutral-0); @@ -72,94 +74,94 @@ .sarufi-chat-container ul { -webkit-margin-before: 0; - margin-block-start: 0; + margin-block-start: 0; -webkit-margin-after: 0; - margin-block-end: 0; + margin-block-end: 0; list-style: none; -webkit-padding-start: 0; - padding-inline-start: 0; -} - -.sarufi-chat-container form { - width: 100%; - bottom: 0; - height: 60px; - -webkit-box-sizing: border-box; - box-sizing: border-box; + padding-inline-start: 0; } .sarufi-chat-container form button { position: absolute; - height: 50px; - width: 50px; - max-width: 50px !important; - bottom: 5px; + /* height: 50px; */ + /* width: 50px; */ + /* max-width: 50px !important; */ + /* bottom: 5px; */ + top: 7px; right: 5px; - padding: 1rem; - -webkit-box-sizing: border-box; - box-sizing: border-box; + /* padding: 1rem; */ + /* -webkit-box-sizing: border-box; + box-sizing: border-box; */ color: var(--sarufi-primary-color); } .sarufi-chat-container .choices { - height: calc( var(--sarufi-chatbox-height) - 82px - .5rem); - max-height: calc( 100% - 92px - .5rem); + height: calc(var(--sarufi-chatbox-height) - 82px - 0.5rem); + max-height: calc(100% - 92px - 0.5rem); width: var(--sarufi-chatbox-width); max-width: 100%; - bottom: calc( 40px + .2.2rem); + bottom: calc(40px + 0.2.2rem); } .sarufi-chat-container .sarufi-backdrop { - height: calc( var(--sarufi-chatbox-height) - 95px - .5rem); - max-height: calc( 100% - 105px - .5rem); + height: calc(var(--sarufi-chatbox-height) - 95px - 0.5rem); + max-height: calc(100% - 105px - 0.5rem); width: var(--sarufi-chatbox-width); max-width: 100%; - bottom: calc( 69px + .5rem); + bottom: calc(69px + 0.5rem); } .sarufi-chat-container .sarufi-options { - height: calc( var(--sarufi-chatbox-height) - 115px - .5rem); - max-height: calc( 100% - 94px - .5rem); - width: calc( var(--sarufi-chatbox-width) - 32px); + height: calc(var(--sarufi-chatbox-height) - 115px - 0.5rem); + max-height: calc(100% - 94px - 0.5rem); + width: calc(var(--sarufi-chatbox-width) - 32px); max-width: 100%; overflow-y: auto; position: fixed; - bottom: calc( 80px + .5rem); + bottom: calc(80px + 0.5rem); margin-top: 1rem; } +.sarufi-chat-container .message-actions button { + border: none; + background: none; + cursor: pointer; +} + .sarufi-field-group { width: 100%; -webkit-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; height: 100%; } .sarufi-field-group .input-group { - position: relative; + /* position: relative; */ display: block !important; width: 100%; -webkit-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; } -.sarufi-field-group .input-group textarea { +/* .sarufi-field-group .input-group textarea { resize: none; background-color: transparent; width: 100%; height: 100%; border: 1px solid transparent; - -webkit-transition: .25s; - transition: .25s; + -webkit-transition: 0.25s; + transition: 0.25s; font-family: inherit; -webkit-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; font-size: inherit; -} +} */ -.sarufi-field-group .input-group textarea:focus, .sarufi-field-group .input-group textarea:hover { - border-color: var(--sarufi-primary-color); - border-width: 1px; +.sarufi-field-group .input-group textarea:focus, +.sarufi-field-group .input-group textarea:hover { + /* border-color: var(--sarufi-primary-color); */ + /* border-width: 1px; */ outline: transparent !important; } @@ -180,7 +182,7 @@ -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-box-sizing: border-box; - box-sizing: border-box; + box-sizing: border-box; } .sarufi-chat-loader .sarufi-bounce1 { @@ -254,12 +256,12 @@ } .sarufi-chat-container .sarufi-backdrop { width: 100%; - bottom: calc( 53.5px + .5rem); + bottom: calc(53.5px + 0.5rem); } .sarufi-chat-container .sarufi-options { width: 100%; max-width: 100%; - bottom: calc( 65px + .5rem); + bottom: calc(65px + 0.5rem); } } @@ -279,7 +281,7 @@ .sarufi-chat-container.open { bottom: 0; right: 0; - height: calc( 100% - 50px); + height: calc(100% - 50px); max-height: 100%; } .sarufi-chat-container.open.sarufi-right-align { @@ -289,18 +291,18 @@ left: 1rem; } .sarufi-chat-container .sarufi-backdrop { - height: calc( 100%px - 144px - .5rem); - max-height: calc( 100% - 144px - .5rem); + height: calc(100%px - 144px - 0.5rem); + max-height: calc(100% - 144px - 0.5rem); width: var(--sarufi-chatbox-width); max-width: 100%; - bottom: calc( 52px + .5rem); + bottom: calc(52px + 0.5rem); } .sarufi-chat-container .sarufi-options { - height: calc( 100% - 155px - .5rem); - max-height: calc( 100% - 140px - .5rem); - width: calc( var(--sarufi-chatbox-width) - 32px); + height: calc(100% - 155px - 0.5rem); + max-height: calc(100% - 140px - 0.5rem); + width: calc(var(--sarufi-chatbox-width) - 32px); max-width: 100%; - bottom: calc( 60px + .5rem); + bottom: calc(60px + 0.5rem); } } @@ -318,7 +320,7 @@ right: 0rem !important; } .sarufi-chat-container.open { - height: calc( 100% - 50px); + height: calc(100% - 50px); } .sarufi-chat-container.open.sarufi-right-align { right: 0rem; @@ -327,18 +329,18 @@ left: 0rem; } .sarufi-chat-container .sarufi-backdrop { - height: calc( 100%px - 144px - .5rem); - max-height: calc( 100% - 144px - .5rem); + height: calc(100%px - 144px - 0.5rem); + max-height: calc(100% - 144px - 0.5rem); width: var(--sarufi-chatbox-width); max-width: 100%; } .sarufi-chat-container .sarufi-options { - height: calc( 100% - 155px - .5rem); - max-height: calc( 100% - 140px - .5rem); - width: calc( var(--sarufi-chatbox-width) - 32px); + height: calc(100% - 155px - 0.5rem); + max-height: calc(100% - 140px - 0.5rem); + width: calc(var(--sarufi-chatbox-width) - 32px); max-width: 100%; - bottom: calc( 60px + .5rem); + bottom: calc(60px + 0.5rem); margin-top: 1rem; } } -/*# sourceMappingURL=chat.css.map */ \ No newline at end of file +/*# sourceMappingURL=chat.css.map */ diff --git a/src/chat/chat.sass b/src/chat/chat.sass index 2e856e1..fe05a91 100644 --- a/src/chat/chat.sass +++ b/src/chat/chat.sass @@ -51,7 +51,7 @@ form width: 100% bottom: 0 - height: 60px + // height: 60px box-sizing: border-box button position: absolute diff --git a/src/chat/chat.tsx b/src/chat/chat.tsx index 0931463..2e9eb64 100644 --- a/src/chat/chat.tsx +++ b/src/chat/chat.tsx @@ -1,8 +1,12 @@ import axios from "axios"; import React, { CSSProperties, useEffect, useState } from "react"; -import { Close, TextComponent } from "../assets/icons"; + +// Local imports import "./chat.css"; import Chatbox from "./chatbox"; +import { Close, MinusIcon } from "../assets/icons"; +import { SarufiIcon } from "../assets/illustrations"; +import { getChatId } from "./services/chat-id-handler"; interface ThemeType { buttonSize?: "sm" | "md" | "lg"; @@ -22,17 +26,35 @@ interface ThemeType { placement?: "left" | "right"; height?: string | number; width?: string | number; + secondaryColor?: string; + bubbleTitle?: string; + bubbleSubTitle?: string; } +export type PluginDBData = { + id: string | number; + bot_id: string; + theme_config: ThemeType; + approved_domain: string; +}; + export type SarufiChatboxType = { botId: string | number; token?: string; theme?: ThemeType; + popUpShow?: boolean; }; -const Chat = ({ botId, token, theme: defaultTheme }: SarufiChatboxType) => { +const Chat = ({ + botId, + token, + theme: defaultTheme, + popUpShow = true, +}: SarufiChatboxType) => { const [open, setOpen] = useState(false); - const [id, setId] = useState(new Date().valueOf()); + const [id, setId] = useState(getChatId()); + const [showPopup, setShowPopup] = useState(false); + const [dontShowPopup, setDontShowPopup] = useState(false); const [theme, setThemeConfig] = useState({ primaryColor: "#2776EA", borderColor: "lightgray", @@ -66,10 +88,11 @@ const Chat = ({ botId, token, theme: defaultTheme }: SarufiChatboxType) => { return setThemeConfig(defaultTheme); } try { - const { data } = await axios.get( + const { data }: { data: PluginDBData } = await axios.get( // @ts-ignore `${api_url}/plugin/${window?.botId ?? botId}/unauthenticated` ); + if (Object.keys(data.theme_config).length === 0) return; setThemeConfig(data?.theme_config); } catch (error: any) {} }; @@ -78,10 +101,22 @@ const Chat = ({ botId, token, theme: defaultTheme }: SarufiChatboxType) => { fetchTheme(); }, [defaultTheme]); + useEffect(() => { + if (dontShowPopup || !popUpShow) return; + if (showPopup) return; + + // Show popup after 5 seconds + setTimeout(() => { + setShowPopup(!showPopup); + }, 5000); + }, [showPopup]); + // set up styles const style = { "--sarufi-primary-color": theme?.mode === "dark" ? "#202C33" : theme?.primaryColor ?? "#2776EA", + "--sarufi-secondary-color": + theme?.mode === "dark" ? "#202C33" : theme?.secondaryColor ?? "#EDECE1", "--sarufi-font-size": `${theme?.fontSize ?? 14}px`, "--sarufi-font-family": theme?.fontFamily === "InterRegular" @@ -93,11 +128,10 @@ const Chat = ({ botId, token, theme: defaultTheme }: SarufiChatboxType) => { : "'Inter', sans-serif", "--sarufi-border-color": theme?.borderColor ?? "lightgray", "--sarufi-sent-box-bg": - theme?.mode === "dark" ? "#005C4B" : theme?.sentBoxBg ?? "#D8F9D4", + theme?.mode === "dark" ? "#005C4B" : theme?.primaryColor ?? "#2776EA", "--sarufi-received-box-bg": - theme?.mode === "dark" ? "#202C33" : theme?.receivedBoxBg ?? "white", - "--sarufi-sent-box-color": - theme?.mode === "dark" ? "white" : theme?.sentBoxColor ?? "black", + theme?.mode === "dark" ? "#202C33" : theme?.secondaryColor ?? "#EDECE1", + "--sarufi-sent-box-color": theme?.mode === "dark" ? "white" : "white", "--sarufi-received-box-color": theme?.mode === "dark" ? "white" : theme?.receivedBoxColor ?? "black", "--sarufi-sent-box-link-color": @@ -106,8 +140,7 @@ const Chat = ({ botId, token, theme: defaultTheme }: SarufiChatboxType) => { theme?.mode === "dark" ? "#53BDEB" : theme?.receivedBoxLinkColor ?? "black", - "--sarufi-chatbox-bg": - theme?.mode === "dark" ? "#0B141A" : theme?.chatboxBg ?? "#EDECE1", + "--sarufi-chatbox-bg": theme?.mode === "dark" ? "#0B141A" : "white", "--sarufi-chatbox-height": theme?.height ? theme?.height + "px" : "500px", "--sarufi-chatbox-width": theme?.width ? theme?.width + "px" : "400px", } as CSSProperties; @@ -120,6 +153,7 @@ const Chat = ({ botId, token, theme: defaultTheme }: SarufiChatboxType) => { ${open ? "sarufi-shadow-xl" : "sarufi-flex-center"}`} style={{ position: "fixed", + // border: "2px solid #000", fontFamily: theme?.fontFamily === "InterRegular" ? "'Inter', sans-serif" @@ -131,7 +165,11 @@ const Chat = ({ botId, token, theme: defaultTheme }: SarufiChatboxType) => { ...(!open ? { height: theme?.buttonSize === "lg" ? "70px" : "50px", - width: theme?.buttonSize === "lg" ? "70px" : "50px", + width: showPopup + ? "fit-content" + : theme?.buttonSize === "lg" + ? "70px" + : "50px", } : {}), ...style, @@ -139,70 +177,171 @@ const Chat = ({ botId, token, theme: defaultTheme }: SarufiChatboxType) => { > {!open && (
+

+ {theme?.bubbleTitle ?? "Need Help?"} +

+

{theme?.bubbleSubTitle ?? "Ask me"}

+
)} - {open && ( +
-
-

+

- {theme?.title} -

+ +
+
+
+

+ {theme?.title} +

+

+ Online +

+
+
+
+
-
- )} + +
); }; diff --git a/src/chat/chatbox.tsx b/src/chat/chatbox.tsx index b38acfd..2d8617e 100644 --- a/src/chat/chatbox.tsx +++ b/src/chat/chatbox.tsx @@ -1,11 +1,26 @@ import React from "react"; import axios from "axios"; import { CSSProperties, useEffect, useRef, useState } from "react"; + +// Local imports import Button from "./button"; import Input from "./input"; import ChatLoader from "./chat-loader"; -import Media from "./media"; import { Close, SendIcon } from "../assets/icons"; +import { SarufiIcon } from "../assets/illustrations"; +import Media from "./media"; +import DatePicker from "./message-actions/date-picker"; +// import RecordAudio from "./message-actions/audio-record"; + +type ChatType = { + message: string; + sent?: boolean; + received?: boolean; + chat: any; + type: string; + actions: any; + next_state: string; +}; const Chatbox = ({ id, @@ -28,10 +43,12 @@ const Chatbox = ({ fontFamily: string; fontSize: string | number; }) => { - const [chats, setChats] = useState([]); + const [chats, setChats] = useState([]); const [value, setValue] = useState(""); const [loading, setLoading] = useState(false); const ref = useRef(null); + const [chatId, setChatId] = useState(id); + const [isRecording] = useState(false); const onSubmit = (message: string, type?: string, itemId?: string) => { if (!message) return; @@ -47,7 +64,7 @@ const Chatbox = ({ }`, { message: itemId ?? message, - chat_id: id, + chat_id: chatId, bot_id: botId, message_type: type ?? "text", }, @@ -123,8 +140,11 @@ const Chatbox = ({ }, [chats]); useEffect(() => { - setChats([]); - setValue(""); + if (chatId !== id) { + setChatId(id); + setChats([]); + setValue(""); + } }, [open]); return ( @@ -134,7 +154,8 @@ const Chatbox = ({ id="sarufi-chat-container" style={{ background: "var(--sarufi-chatbox-bg)", - height: "calc( 100% - 100px )", + height: "calc( 100% - 160px )", + // height: "100%", overflowY: "auto", position: "relative", }} @@ -147,7 +168,7 @@ const Chatbox = ({ }} >
-
+ {!isRecording && ( + { + e.preventDefault(); + onSubmit(value); + }} + > + onSubmit(value)} + onChange={(e) => { + setValue(e.target.value); + }} + /> +
*/} + + setValue( + `${d.getDate()}/${d.getMonth() + 1}/${d.getFullYear()}` + ) + } + styles={{ + margin: "0 .3rem", + }} + /> + + )} + {/* alert("We don't support this feature yet.")} + saveIsRecording={(record) => setIsRecording(record)} + /> */} + + +

{ - e.preventDefault(); - onSubmit(value); - }} > - onSubmit(value)} - onChange={(e) => { - setValue(e.target.value); + Powered by{" "} + - - - ))} - - )} - {(!message || typeof message !== "string") && chat?.actions && menu && ( +

+
action?.send_reply_button) + ?.send_reply_button?.action?.buttons?.length > 0 || + ((!message || typeof message !== "string") && + chat?.actions && + menu) + ? "0rem" + : ".3rem", + ...(!hasMedia && !chat?.sent + ? { borderTopRightRadius: ".3rem" } + : {}), }} > -
+ {chat?.type === "button" && ( +
    - {menu["send_button"]?.button ?? menu["send_button"]?.action?.button} - -
- )} - {(!message || typeof message !== "string") && - chat?.actions && - menu && - openChoices && ( + {chat?.actions + ?.find((action: any) => action?.send_reply_button) + ?.send_reply_button?.action?.buttons?.map( + (el: any, i: number) => ( +
  • action?.send_reply_button + )?.send_reply_button?.action?.buttons?.length - + 1 + ? ".3rem" + : "0", + borderBottomRightRadius: + i === + chat?.actions?.find( + (action: any) => action?.send_reply_button + )?.send_reply_button?.action?.buttons?.length - + 1 + ? ".3rem" + : "0", + }} + key={i} + > + +
  • + ) + )} + + )} + {(!message || typeof message !== "string") && chat?.actions && menu && (
    + +
    + )} + {(!message || typeof message !== "string") && + chat?.actions && + menu && + openChoices && (
    setOpenChoices(false)} - /> -
    setOpenChoices(false)} + /> +
    - - {menu["send_button"]?.action?.sections[0]?.title && ( -

    setOpenChoices(false)} style={{ - width: "100%", - marginLeft: "1rem", - paddingRight: "2rem", - textAlign: "center", - fontFamily: "var(--sarufi-font-family)", + background: "none", + border: "none", + cursor: "pointer", + color: "var(--sarufi-received-box-color)", }} + className="sarufi-button" > - {menu["send_button"]?.action?.sections[0]?.title} -

    - )} + + + {menu["send_button"]?.action?.sections[0]?.title && ( +

    + {menu["send_button"]?.action?.sections[0]?.title} +

    + )} +
    +
      + {menu["send_button"]?.action?.sections[0]?.rows?.filter( + (el: any) => el?.title + )?.length > 0 && + menu["send_button"]?.action?.sections[0]?.rows + ?.filter((el: any) => el?.title) + ?.map((row: any) => ( +
    • { + onSubmit(row?.title, "interactive", row?.id); + setOpenChoices(false); + }} + > +
      +

      + {row?.title} +

      +

      + {row?.description} +

      +
      +
      + +
      +
    • + ))} +
    -
      - {menu["send_button"]?.action?.sections[0]?.rows?.filter( - (el: any) => el?.title - )?.length > 0 && - menu["send_button"]?.action?.sections[0]?.rows - ?.filter((el: any) => el?.title) - ?.map((row: any) => ( -
    • { - onSubmit(row?.title, "interactive", row?.id); - setOpenChoices(false); - }} - > -
      -

      - {row?.title} -

      -

      - {row?.description} -

      -
      -
      - -
      -
    • - ))} -
    -
    - )} + )} + ); }; diff --git a/src/chat/input.tsx b/src/chat/input.tsx index eb1e7bb..d55d3e6 100644 --- a/src/chat/input.tsx +++ b/src/chat/input.tsx @@ -40,19 +40,9 @@ const Input: FC = ({ const [isFocused, setFocused] = useState(true); return ( -
    -
    -