@alfatech/livechat 2026.4.0-2.1 → 2026.4.0-9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +28 -28
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var kg=e=>{throw TypeError(e)};var UC=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ju=(e,t,n)=>t.has(e)||kg("Cannot "+n);var T=(e,t,n)=>(Ju(e,t,"read from private field"),n?n.call(e):t.get(e)),me=(e,t,n)=>t.has(e)?kg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),oe=(e,t,n,r)=>(Ju(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),be=(e,t,n)=>(Ju(e,t,"access private method"),n);var hl=(e,t,n,r)=>({set _(i){oe(e,t,i,n)},get _(){return T(e,t,r)}});var zB=UC((rn,sn)=>{function HC(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ch=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Vx={exports:{}},iu={},Ux={exports:{}},Ce={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var bg=e=>{throw TypeError(e)};var zC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Ja=Symbol.for("react.element"),WC=Symbol.for("react.portal"),qC=Symbol.for("react.fragment"),GC=Symbol.for("react.strict_mode"),YC=Symbol.for("react.profiler"),QC=Symbol.for("react.provider"),KC=Symbol.for("react.context"),XC=Symbol.for("react.forward_ref"),ZC=Symbol.for("react.suspense"),JC=Symbol.for("react.memo"),e2=Symbol.for("react.lazy"),Sg=Symbol.iterator;function t2(e){return e===null||typeof e!="object"?null:(e=Sg&&e[Sg]||e["@@iterator"],typeof e=="function"?e:null)}var Hx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wx=Object.assign,qx={};function ko(e,t,n){this.props=e,this.context=t,this.refs=qx,this.updater=n||Hx}ko.prototype.isReactComponent={};ko.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")};ko.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Gx(){}Gx.prototype=ko.prototype;function uh(e,t,n){this.props=e,this.context=t,this.refs=qx,this.updater=n||Hx}var dh=uh.prototype=new Gx;dh.constructor=uh;Wx(dh,ko.prototype);dh.isPureReactComponent=!0;var Cg=Array.isArray,Yx=Object.prototype.hasOwnProperty,fh={current:null},Qx={key:!0,ref:!0,__self:!0,__source:!0};function Kx(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Yx.call(t,r)&&!Qx.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Ja,type:e,key:s,ref:o,props:i,_owner:fh.current}}function n2(e,t){return{$$typeof:Ja,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ph(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ja}function r2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _g=/\/+/g;function ed(e,t){return typeof e=="object"&&e!==null&&e.key!=null?r2(""+e.key):t.toString(36)}function Wl(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ja:case WC:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+ed(o,0):r,Cg(i)?(n="",e!=null&&(n=e.replace(_g,"$&/")+"/"),Wl(i,t,n,"",function(c){return c})):i!=null&&(ph(i)&&(i=n2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(_g,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Cg(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+ed(s,a);o+=Wl(s,t,n,l,i)}else if(l=t2(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+ed(s,a++),o+=Wl(s,t,n,l,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function ml(e,t,n){if(e==null)return e;var r=[],i=0;return Wl(e,r,"","",function(s){return t.call(n,s,i++)}),r}function i2(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Lt={current:null},ql={transition:null},s2={ReactCurrentDispatcher:Lt,ReactCurrentBatchConfig:ql,ReactCurrentOwner:fh};function Xx(){throw Error("act(...) is not supported in production builds of React.")}Ce.Children={map:ml,forEach:function(e,t,n){ml(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ml(e,function(){t++}),t},toArray:function(e){return ml(e,function(t){return t})||[]},only:function(e){if(!ph(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ce.Component=ko;Ce.Fragment=qC;Ce.Profiler=YC;Ce.PureComponent=uh;Ce.StrictMode=GC;Ce.Suspense=ZC;Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=s2;Ce.act=Xx;Ce.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Wx({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=fh.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Yx.call(t,l)&&!Qx.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Ja,type:e.type,key:i,ref:s,props:r,_owner:o}};Ce.createContext=function(e){return e={$$typeof:KC,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:QC,_context:e},e.Consumer=e};Ce.createElement=Kx;Ce.createFactory=function(e){var t=Kx.bind(null,e);return t.type=e,t};Ce.createRef=function(){return{current:null}};Ce.forwardRef=function(e){return{$$typeof:XC,render:e}};Ce.isValidElement=ph;Ce.lazy=function(e){return{$$typeof:e2,_payload:{_status:-1,_result:e},_init:i2}};Ce.memo=function(e,t){return{$$typeof:JC,type:e,compare:t===void 0?null:t}};Ce.startTransition=function(e){var t=ql.transition;ql.transition={};try{e()}finally{ql.transition=t}};Ce.unstable_act=Xx;Ce.useCallback=function(e,t){return Lt.current.useCallback(e,t)};Ce.useContext=function(e){return Lt.current.useContext(e)};Ce.useDebugValue=function(){};Ce.useDeferredValue=function(e){return Lt.current.useDeferredValue(e)};Ce.useEffect=function(e,t){return Lt.current.useEffect(e,t)};Ce.useId=function(){return Lt.current.useId()};Ce.useImperativeHandle=function(e,t,n){return Lt.current.useImperativeHandle(e,t,n)};Ce.useInsertionEffect=function(e,t){return Lt.current.useInsertionEffect(e,t)};Ce.useLayoutEffect=function(e,t){return Lt.current.useLayoutEffect(e,t)};Ce.useMemo=function(e,t){return Lt.current.useMemo(e,t)};Ce.useReducer=function(e,t,n){return Lt.current.useReducer(e,t,n)};Ce.useRef=function(e){return Lt.current.useRef(e)};Ce.useState=function(e){return Lt.current.useState(e)};Ce.useSyncExternalStore=function(e,t,n){return Lt.current.useSyncExternalStore(e,t,n)};Ce.useTransition=function(){return Lt.current.useTransition()};Ce.version="18.3.1";Ux.exports=Ce;var v=Ux.exports;const J=Rr(v),o2=HC({__proto__:null,default:J},[v]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var bg=e=>{throw TypeError(e)};var zC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var a2=v,l2=Symbol.for("react.element"),c2=Symbol.for("react.fragment"),u2=Object.prototype.hasOwnProperty,d2=a2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f2={key:!0,ref:!0,__self:!0,__source:!0};function Zx(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)u2.call(t,r)&&!f2.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:l2,type:e,key:s,ref:o,props:i,_owner:d2.current}}iu.Fragment=c2;iu.jsx=Zx;iu.jsxs=Zx;Vx.exports=iu;var f=Vx.exports,Jx={exports:{}},ln={},e1={exports:{}},t1={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var bg=e=>{throw TypeError(e)};var zC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(
|
|
25
|
+
*/(function(e){function t(P,B){var U=P.length;P.push(B);e:for(;0<U;){var W=U-1>>>1,q=P[W];if(0<i(q,B))P[W]=B,P[U]=q,U=W;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var B=P[0],U=P.pop();if(U!==B){P[0]=U;e:for(var W=0,q=P.length,se=q>>>1;W<se;){var ie=2*(W+1)-1,pe=P[ie],ce=ie+1,_e=P[ce];if(0>i(pe,U))ce<q&&0>i(_e,pe)?(P[W]=_e,P[ce]=U,W=ce):(P[W]=pe,P[ie]=U,W=ie);else if(ce<q&&0>i(_e,U))P[W]=_e,P[ce]=U,W=ce;else break e}}return B}function i(P,B){var U=P.sortIndex-B.sortIndex;return U!==0?U:P.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,u=null,p=3,h=!1,y=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(P){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=P)r(c),B.sortIndex=B.expirationTime,t(l,B);else break;B=n(c)}}function C(P){if(x=!1,b(P),!y)if(n(l)!==null)y=!0,N(S);else{var B=n(c);B!==null&&M(C,B.startTime-P)}}function S(P,B){y=!1,x&&(x=!1,m(A),A=-1),h=!0;var U=p;try{for(b(B),u=n(l);u!==null&&(!(u.expirationTime>B)||P&&!F());){var W=u.callback;if(typeof W=="function"){u.callback=null,p=u.priorityLevel;var q=W(u.expirationTime<=B);B=e.unstable_now(),typeof q=="function"?u.callback=q:u===n(l)&&r(l),b(B)}else r(l);u=n(l)}if(u!==null)var se=!0;else{var ie=n(c);ie!==null&&M(C,ie.startTime-B),se=!1}return se}finally{u=null,p=U,h=!1}}var _=!1,j=null,A=-1,E=5,L=-1;function F(){return!(e.unstable_now()-L<E)}function D(){if(j!==null){var P=e.unstable_now();L=P;var B=!0;try{B=j(!0,P)}finally{B?G():(_=!1,j=null)}}else _=!1}var G;if(typeof g=="function")G=function(){g(D)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,$=z.port2;z.port1.onmessage=D,G=function(){$.postMessage(null)}}else G=function(){w(D,0)};function N(P){j=P,_||(_=!0,G())}function M(P,B){A=w(function(){P(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,N(S))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(P){switch(p){case 1:case 2:case 3:var B=3;break;default:B=p}var U=p;p=B;try{return P()}finally{p=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,B){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var U=p;p=P;try{return B()}finally{p=U}},e.unstable_scheduleCallback=function(P,B,U){var W=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?W+U:W):U=W,P){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=U+q,P={id:d++,callback:B,priorityLevel:P,startTime:U,expirationTime:q,sortIndex:-1},U>W?(P.sortIndex=U,t(c,P),n(l)===null&&P===n(c)&&(x?(m(A),A=-1):x=!0,M(C,U-W))):(P.sortIndex=q,t(l,P),y||h||(y=!0,N(S))),P},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(P){var B=p;return function(){var U=p;p=B;try{return P.apply(this,arguments)}finally{p=U}}}})(t1);e1.exports=t1;var p2=e1.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var bg=e=>{throw TypeError(e)};var zC=(e,t)=>()=>(t||e((t={exports:{}}).exports,
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
34
|
-
`+
|
|
33
|
+
*/var h2=v,an=p2;function Q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n1=new Set,va={};function ss(e,t){oo(e,t),oo(e+"Capture",t)}function oo(e,t){for(va[e]=t,e=0;e<t.length;e++)n1.add(t[e])}var Cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lf=Object.prototype.hasOwnProperty,m2=/^[: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]*$/,Tg={},Eg={};function g2(e){return lf.call(Eg,e)?!0:lf.call(Tg,e)?!1:m2.test(e)?Eg[e]=!0:(Tg[e]=!0,!1)}function v2(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 y2(e,t,n,r){if(t===null||typeof t>"u"||v2(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 Ft(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Ft(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Ft(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Ft(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Ft(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){kt[e]=new Ft(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Ft(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Ft(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Ft(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Ft(e,5,!1,e.toLowerCase(),null,!1,!1)});var hh=/[\-:]([a-z])/g;function mh(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(hh,mh);kt[t]=new Ft(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(hh,mh);kt[t]=new Ft(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(hh,mh);kt[t]=new Ft(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Ft(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Ft("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Ft(e,1,!1,e.toLowerCase(),null,!0,!0)});function gh(e,t,n,r){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(y2(t,n,i,r)&&(n=null),r||i===null?g2(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Pr=h2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,gl=Symbol.for("react.element"),ks=Symbol.for("react.portal"),Ss=Symbol.for("react.fragment"),vh=Symbol.for("react.strict_mode"),cf=Symbol.for("react.profiler"),r1=Symbol.for("react.provider"),i1=Symbol.for("react.context"),yh=Symbol.for("react.forward_ref"),uf=Symbol.for("react.suspense"),df=Symbol.for("react.suspense_list"),xh=Symbol.for("react.memo"),Fr=Symbol.for("react.lazy"),s1=Symbol.for("react.offscreen"),Ag=Symbol.iterator;function Oo(e){return e===null||typeof e!="object"?null:(e=Ag&&e[Ag]||e["@@iterator"],typeof e=="function"?e:null)}var Xe=Object.assign,td;function Wo(e){if(td===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);td=t&&t[1]||""}return`
|
|
34
|
+
`+td+e}var nd=!1;function rd(e,t){if(!e||nd)return"";nd=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
35
|
`),s=r.stack.split(`
|
|
36
36
|
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
|
|
37
|
-
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{td=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ho(e):""}function v2(e){switch(e.tag){case 5:return Ho(e.type);case 16:return Ho("Lazy");case 13:return Ho("Suspense");case 19:return Ho("SuspenseList");case 0:case 2:case 15:return e=nd(e.type,!1),e;case 11:return e=nd(e.type.render,!1),e;case 1:return e=nd(e.type,!0),e;default:return""}}function df(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 Ss:return"Fragment";case ks:return"Portal";case lf:return"Profiler";case gh:return"StrictMode";case cf:return"Suspense";case uf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n1:return(e.displayName||"Context")+".Consumer";case t1:return(e._context.displayName||"Context")+".Provider";case vh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yh:return t=e.displayName||null,t!==null?t:df(e.type)||"Memo";case Fr:t=e._payload,e=e._init;try{return df(e(t))}catch{}}return null}function y2(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 df(t);case 8:return t===gh?"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 di(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function i1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function x2(e){var t=i1(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 i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.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 gl(e){e._valueTracker||(e._valueTracker=x2(e))}function s1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=i1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function pc(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 ff(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=di(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 o1(e,t){t=t.checked,t!=null&&mh(e,"checked",t,!1)}function pf(e,t){o1(e,t);var n=di(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")?hf(e,t.type,n):t.hasOwnProperty("defaultValue")&&hf(e,t.type,di(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ag(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 hf(e,t,n){(t!=="number"||pc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wo=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+di(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function mf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Y(91));return Qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Rg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Y(92));if(Wo(n)){if(1<n.length)throw Error(Y(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:di(n)}}function a1(e,t){var n=di(t.value),r=di(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Pg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function l1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?l1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vl,c1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vl=vl||document.createElement("div"),vl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function va(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Jo={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},w2=["Webkit","ms","Moz","O"];Object.keys(Jo).forEach(function(e){w2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jo[t]=Jo[e]})});function u1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Jo.hasOwnProperty(e)&&Jo[e]?(""+t).trim():t+"px"}function d1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=u1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var b2=Qe({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 vf(e,t){if(t){if(b2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Y(62))}}function yf(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 xf=null;function xh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wf=null,zs=null,Vs=null;function Mg(e){if(e=tl(e)){if(typeof wf!="function")throw Error(Y(280));var t=e.stateNode;t&&(t=lu(t),wf(e.stateNode,e.type,t))}}function f1(e){zs?Vs?Vs.push(e):Vs=[e]:zs=e}function p1(){if(zs){var e=zs,t=Vs;if(Vs=zs=null,Mg(e),t)for(e=0;e<t.length;e++)Mg(t[e])}}function h1(e,t){return e(t)}function m1(){}var rd=!1;function g1(e,t,n){if(rd)return e(t,n);rd=!0;try{return h1(e,t,n)}finally{rd=!1,(zs!==null||Vs!==null)&&(m1(),p1())}}function ya(e,t){var n=e.stateNode;if(n===null)return null;var r=lu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Y(231,t,typeof n));return n}var bf=!1;if(Cr)try{var No={};Object.defineProperty(No,"passive",{get:function(){bf=!0}}),window.addEventListener("test",No,No),window.removeEventListener("test",No,No)}catch{bf=!1}function k2(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var ea=!1,hc=null,mc=!1,kf=null,S2={onError:function(e){ea=!0,hc=e}};function C2(e,t,n,r,i,s,o,a,l){ea=!1,hc=null,k2.apply(S2,arguments)}function T2(e,t,n,r,i,s,o,a,l){if(C2.apply(this,arguments),ea){if(ea){var c=hc;ea=!1,hc=null}else throw Error(Y(198));mc||(mc=!0,kf=c)}}function os(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Og(e){if(os(e)!==e)throw Error(Y(188))}function _2(e){var t=e.alternate;if(!t){if(t=os(e),t===null)throw Error(Y(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Og(i),e;if(s===r)return Og(i),t;s=s.sibling}throw Error(Y(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(Y(189))}}if(n.alternate!==r)throw Error(Y(190))}if(n.tag!==3)throw Error(Y(188));return n.stateNode.current===n?e:t}function y1(e){return e=_2(e),e!==null?x1(e):null}function x1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=x1(e);if(t!==null)return t;e=e.sibling}return null}var w1=on.unstable_scheduleCallback,Ng=on.unstable_cancelCallback,E2=on.unstable_shouldYield,j2=on.unstable_requestPaint,nt=on.unstable_now,A2=on.unstable_getCurrentPriorityLevel,wh=on.unstable_ImmediatePriority,b1=on.unstable_UserBlockingPriority,gc=on.unstable_NormalPriority,R2=on.unstable_LowPriority,k1=on.unstable_IdlePriority,iu=null,tr=null;function P2(e){if(tr&&typeof tr.onCommitFiberRoot=="function")try{tr.onCommitFiberRoot(iu,e,void 0,(e.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:N2,M2=Math.log,O2=Math.LN2;function N2(e){return e>>>=0,e===0?32:31-(M2(e)/O2|0)|0}var yl=64,xl=4194304;function qo(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 vc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=qo(a):(s&=o,s!==0&&(r=qo(s)))}else o=n&~i,o!==0?r=qo(o):s!==0&&(r=qo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Fn(t),i=1<<n,r|=e[n],t&=~i;return r}function D2(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function I2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Fn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=D2(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Sf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function S1(){var e=yl;return yl<<=1,!(yl&4194240)&&(yl=64),e}function id(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ja(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fn(t),e[t]=n}function L2(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<n;){var i=31-Fn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function bh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Re=0;function C1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var T1,kh,_1,E1,j1,Cf=!1,wl=[],ti=null,ni=null,ri=null,xa=new Map,wa=new Map,zr=[],F2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Dg(e,t){switch(e){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":xa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wa.delete(t.pointerId)}}function Do(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=tl(t),t!==null&&kh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function B2(e,t,n,r,i){switch(t){case"focusin":return ti=Do(ti,e,t,n,r,i),!0;case"dragenter":return ni=Do(ni,e,t,n,r,i),!0;case"mouseover":return ri=Do(ri,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return xa.set(s,Do(xa.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,wa.set(s,Do(wa.get(s)||null,e,t,n,r,i)),!0}return!1}function A1(e){var t=Pi(e.target);if(t!==null){var n=os(t);if(n!==null){if(t=n.tag,t===13){if(t=v1(n),t!==null){e.blockedOn=t,j1(e.priority,function(){_1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ql(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xf=r,n.target.dispatchEvent(r),xf=null}else return t=tl(n),t!==null&&kh(t),e.blockedOn=n,!1;t.shift()}return!0}function Ig(e,t,n){ql(e)&&n.delete(t)}function $2(){Cf=!1,ti!==null&&ql(ti)&&(ti=null),ni!==null&&ql(ni)&&(ni=null),ri!==null&&ql(ri)&&(ri=null),xa.forEach(Ig),wa.forEach(Ig)}function Io(e,t){e.blockedOn===t&&(e.blockedOn=null,Cf||(Cf=!0,on.unstable_scheduleCallback(on.unstable_NormalPriority,$2)))}function ba(e){function t(i){return Io(i,e)}if(0<wl.length){Io(wl[0],e);for(var n=1;n<wl.length;n++){var r=wl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ti!==null&&Io(ti,e),ni!==null&&Io(ni,e),ri!==null&&Io(ri,e),xa.forEach(t),wa.forEach(t),n=0;n<zr.length;n++)r=zr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<zr.length&&(n=zr[0],n.blockedOn===null);)A1(n),n.blockedOn===null&&zr.shift()}var Us=Pr.ReactCurrentBatchConfig,yc=!0;function z2(e,t,n,r){var i=Re,s=Us.transition;Us.transition=null;try{Re=1,Sh(e,t,n,r)}finally{Re=i,Us.transition=s}}function V2(e,t,n,r){var i=Re,s=Us.transition;Us.transition=null;try{Re=4,Sh(e,t,n,r)}finally{Re=i,Us.transition=s}}function Sh(e,t,n,r){if(yc){var i=Tf(e,t,n,r);if(i===null)hd(e,t,r,xc,n),Dg(e,r);else if(B2(i,e,t,n,r))r.stopPropagation();else if(Dg(e,r),t&4&&-1<F2.indexOf(e)){for(;i!==null;){var s=tl(i);if(s!==null&&T1(s),s=Tf(e,t,n,r),s===null&&hd(e,t,r,xc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else hd(e,t,r,null,n)}}var xc=null;function Tf(e,t,n,r){if(xc=null,e=xh(r),e=Pi(e),e!==null)if(t=os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=v1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return xc=e,null}function R1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(A2()){case wh:return 1;case b1:return 4;case gc:case R2:return 16;case k1:return 536870912;default:return 16}default:return 16}}var Zr=null,Ch=null,Gl=null;function P1(){if(Gl)return Gl;var e,t=Ch,n=t.length,r,i="value"in Zr?Zr.value:Zr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return Gl=i.slice(e,1<r?1-r:void 0)}function Yl(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function bl(){return!0}function Lg(){return!1}function ln(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?bl:Lg,this.isPropagationStopped=Lg,this}return Qe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),t}var So={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Th=ln(So),el=Qe({},So,{view:0,detail:0}),U2=ln(el),sd,od,Lo,su=Qe({},el,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_h,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Lo&&(Lo&&e.type==="mousemove"?(sd=e.screenX-Lo.screenX,od=e.screenY-Lo.screenY):od=sd=0,Lo=e),sd)},movementY:function(e){return"movementY"in e?e.movementY:od}}),Fg=ln(su),H2=Qe({},su,{dataTransfer:0}),W2=ln(H2),q2=Qe({},el,{relatedTarget:0}),ad=ln(q2),G2=Qe({},So,{animationName:0,elapsedTime:0,pseudoElement:0}),Y2=ln(G2),Q2=Qe({},So,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),K2=ln(Q2),X2=Qe({},So,{data:0}),Bg=ln(X2),Z2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tT(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=eT[e])?!!t[e]:!1}function _h(){return tT}var nT=Qe({},el,{key:function(e){if(e.key){var t=Z2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_h,charCode:function(e){return e.type==="keypress"?Yl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),rT=ln(nT),iT=Qe({},su,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$g=ln(iT),sT=Qe({},el,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_h}),oT=ln(sT),aT=Qe({},So,{propertyName:0,elapsedTime:0,pseudoElement:0}),lT=ln(aT),cT=Qe({},su,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),uT=ln(cT),dT=[9,13,27,32],Eh=Cr&&"CompositionEvent"in window,ta=null;Cr&&"documentMode"in document&&(ta=document.documentMode);var fT=Cr&&"TextEvent"in window&&!ta,M1=Cr&&(!Eh||ta&&8<ta&&11>=ta),zg=" ",Vg=!1;function O1(e,t){switch(e){case"keyup":return dT.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function pT(e,t){switch(e){case"compositionend":return N1(t);case"keypress":return t.which!==32?null:(Vg=!0,zg);case"textInput":return e=t.data,e===zg&&Vg?null:e;default:return null}}function hT(e,t){if(Cs)return e==="compositionend"||!Eh&&O1(e,t)?(e=P1(),Gl=Ch=Zr=null,Cs=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return M1&&t.locale!=="ko"?null:t.data;default:return null}}var mT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ug(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mT[e.type]:t==="textarea"}function D1(e,t,n,r){f1(r),t=wc(t,"onChange"),0<t.length&&(n=new Th("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var na=null,ka=null;function gT(e){q1(e,0)}function ou(e){var t=Es(e);if(s1(t))return e}function vT(e,t){if(e==="change")return t}var I1=!1;if(Cr){var ld;if(Cr){var cd="oninput"in document;if(!cd){var Hg=document.createElement("div");Hg.setAttribute("oninput","return;"),cd=typeof Hg.oninput=="function"}ld=cd}else ld=!1;I1=ld&&(!document.documentMode||9<document.documentMode)}function Wg(){na&&(na.detachEvent("onpropertychange",L1),ka=na=null)}function L1(e){if(e.propertyName==="value"&&ou(ka)){var t=[];D1(t,ka,e,xh(e)),g1(gT,t)}}function yT(e,t,n){e==="focusin"?(Wg(),na=t,ka=n,na.attachEvent("onpropertychange",L1)):e==="focusout"&&Wg()}function xT(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ou(ka)}function wT(e,t){if(e==="click")return ou(t)}function bT(e,t){if(e==="input"||e==="change")return ou(t)}function kT(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zn=typeof Object.is=="function"?Object.is:kT;function Sa(e,t){if(zn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!af.call(t,i)||!zn(e[i],t[i]))return!1}return!0}function qg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gg(e,t){var n=qg(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=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=qg(n)}}function F1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?F1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function B1(){for(var e=window,t=pc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pc(e.document)}return t}function jh(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 ST(e){var t=B1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&F1(n.ownerDocument.documentElement,n)){if(r!==null&&jh(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 i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Gg(n,s);var o=Gg(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>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<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var CT=Cr&&"documentMode"in document&&11>=document.documentMode,Ts=null,_f=null,ra=null,Ef=!1;function Yg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ef||Ts==null||Ts!==pc(r)||(r=Ts,"selectionStart"in r&&jh(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}),ra&&Sa(ra,r)||(ra=r,r=wc(_f,"onSelect"),0<r.length&&(t=new Th("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ts)))}function kl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _s={animationend:kl("Animation","AnimationEnd"),animationiteration:kl("Animation","AnimationIteration"),animationstart:kl("Animation","AnimationStart"),transitionend:kl("Transition","TransitionEnd")},ud={},$1={};Cr&&($1=document.createElement("div").style,"AnimationEvent"in window||(delete _s.animationend.animation,delete _s.animationiteration.animation,delete _s.animationstart.animation),"TransitionEvent"in window||delete _s.transitionend.transition);function au(e){if(ud[e])return ud[e];if(!_s[e])return e;var t=_s[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $1)return ud[e]=t[n];return e}var z1=au("animationend"),V1=au("animationiteration"),U1=au("animationstart"),H1=au("transitionend"),W1=new Map,Qg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function vi(e,t){W1.set(e,t),ss(t,[e])}for(var dd=0;dd<Qg.length;dd++){var fd=Qg[dd],TT=fd.toLowerCase(),_T=fd[0].toUpperCase()+fd.slice(1);vi(TT,"on"+_T)}vi(z1,"onAnimationEnd");vi(V1,"onAnimationIteration");vi(U1,"onAnimationStart");vi("dblclick","onDoubleClick");vi("focusin","onFocus");vi("focusout","onBlur");vi(H1,"onTransitionEnd");oo("onMouseEnter",["mouseout","mouseover"]);oo("onMouseLeave",["mouseout","mouseover"]);oo("onPointerEnter",["pointerout","pointerover"]);oo("onPointerLeave",["pointerout","pointerover"]);ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ss("onBeforeInput",["compositionend","keypress","textInput","paste"]);ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Go="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ET=new Set("cancel close invalid load scroll toggle".split(" ").concat(Go));function Kg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,T2(r,t,void 0,e),e.currentTarget=null}function q1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Kg(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Kg(i,a,c),s=l}}}if(mc)throw e=kf,mc=!1,kf=null,e}function Fe(e,t){var n=t[Mf];n===void 0&&(n=t[Mf]=new Set);var r=e+"__bubble";n.has(r)||(G1(t,e,2,!1),n.add(r))}function pd(e,t,n){var r=0;t&&(r|=4),G1(n,e,r,t)}var Sl="_reactListening"+Math.random().toString(36).slice(2);function Ca(e){if(!e[Sl]){e[Sl]=!0,e1.forEach(function(n){n!=="selectionchange"&&(ET.has(n)||pd(n,!1,e),pd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Sl]||(t[Sl]=!0,pd("selectionchange",!1,t))}}function G1(e,t,n,r){switch(R1(t)){case 1:var i=z2;break;case 4:i=V2;break;default:i=Sh}n=i.bind(null,t,n,e),i=void 0,!bf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function hd(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Pi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}g1(function(){var c=s,d=xh(n),u=[];e:{var p=W1.get(e);if(p!==void 0){var m=Th,y=e;switch(e){case"keypress":if(Yl(n)===0)break e;case"keydown":case"keyup":m=rT;break;case"focusin":y="focus",m=ad;break;case"focusout":y="blur",m=ad;break;case"beforeblur":case"afterblur":m=ad;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Fg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=W2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=oT;break;case z1:case V1:case U1:m=Y2;break;case H1:m=lT;break;case"scroll":m=U2;break;case"wheel":m=uT;break;case"copy":case"cut":case"paste":m=K2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=$g}var w=(t&4)!==0,x=!w&&e==="scroll",h=w?p!==null?p+"Capture":null:p;w=[];for(var g=c,k;g!==null;){k=g;var C=k.stateNode;if(k.tag===5&&C!==null&&(k=C,h!==null&&(C=ya(g,h),C!=null&&w.push(Ta(g,C,k)))),x)break;g=g.return}0<w.length&&(p=new m(p,y,null,n,d),u.push({event:p,listeners:w}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&n!==xf&&(y=n.relatedTarget||n.fromElement)&&(Pi(y)||y[Tr]))break e;if((m||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=c,y=y?Pi(y):null,y!==null&&(x=os(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=c),m!==y)){if(w=Fg,C="onMouseLeave",h="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(w=$g,C="onPointerLeave",h="onPointerEnter",g="pointer"),x=m==null?p:Es(m),k=y==null?p:Es(y),p=new w(C,g+"leave",m,n,d),p.target=x,p.relatedTarget=k,C=null,Pi(d)===c&&(w=new w(h,g+"enter",y,n,d),w.target=k,w.relatedTarget=x,C=w),x=C,m&&y)t:{for(w=m,h=y,g=0,k=w;k;k=ws(k))g++;for(k=0,C=h;C;C=ws(C))k++;for(;0<g-k;)w=ws(w),g--;for(;0<k-g;)h=ws(h),k--;for(;g--;){if(w===h||h!==null&&w===h.alternate)break t;w=ws(w),h=ws(h)}w=null}else w=null;m!==null&&Xg(u,p,m,w,!1),y!==null&&x!==null&&Xg(u,x,y,w,!0)}}e:{if(p=c?Es(c):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var S=vT;else if(Ug(p))if(I1)S=bT;else{S=xT;var T=yT}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=wT);if(S&&(S=S(e,c))){D1(u,S,n,d);break e}T&&T(e,p,c),e==="focusout"&&(T=p._wrapperState)&&T.controlled&&p.type==="number"&&hf(p,"number",p.value)}switch(T=c?Es(c):window,e){case"focusin":(Ug(T)||T.contentEditable==="true")&&(Ts=T,_f=c,ra=null);break;case"focusout":ra=_f=Ts=null;break;case"mousedown":Ef=!0;break;case"contextmenu":case"mouseup":case"dragend":Ef=!1,Yg(u,n,d);break;case"selectionchange":if(CT)break;case"keydown":case"keyup":Yg(u,n,d)}var j;if(Eh)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Cs?O1(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(M1&&n.locale!=="ko"&&(Cs||E!=="onCompositionStart"?E==="onCompositionEnd"&&Cs&&(j=P1()):(Zr=d,Ch="value"in Zr?Zr.value:Zr.textContent,Cs=!0)),T=wc(c,E),0<T.length&&(E=new Bg(E,e,null,n,d),u.push({event:E,listeners:T}),j?E.data=j:(j=N1(n),j!==null&&(E.data=j)))),(j=fT?pT(e,n):hT(e,n))&&(c=wc(c,"onBeforeInput"),0<c.length&&(d=new Bg("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=j))}q1(u,t)})}function Ta(e,t,n){return{instance:e,listener:t,currentTarget:n}}function wc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=ya(e,n),s!=null&&r.unshift(Ta(e,s,i)),s=ya(e,t),s!=null&&r.push(Ta(e,s,i))),e=e.return}return r}function ws(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Xg(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=ya(n,s),l!=null&&o.unshift(Ta(n,l,a))):i||(l=ya(n,s),l!=null&&o.push(Ta(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var jT=/\r\n?/g,AT=/\u0000|\uFFFD/g;function Zg(e){return(typeof e=="string"?e:""+e).replace(jT,`
|
|
38
|
-
`).replace(AT,"")}function Cl(e,t,n){if(t=Zg(t),Zg(e)!==t&&n)throw Error(Y(425))}function bc(){}var jf=null,Af=null;function Rf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Pf=typeof setTimeout=="function"?setTimeout:void 0,RT=typeof clearTimeout=="function"?clearTimeout:void 0,Jg=typeof Promise=="function"?Promise:void 0,PT=typeof queueMicrotask=="function"?queueMicrotask:typeof Jg<"u"?function(e){return Jg.resolve(null).then(e).catch(MT)}:Pf;function MT(e){setTimeout(function(){throw e})}function md(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ba(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ba(t)}function ii(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function ev(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Co=Math.random().toString(36).slice(2),Jn="__reactFiber$"+Co,_a="__reactProps$"+Co,Tr="__reactContainer$"+Co,Mf="__reactEvents$"+Co,OT="__reactListeners$"+Co,NT="__reactHandles$"+Co;function Pi(e){var t=e[Jn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Tr]||n[Jn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ev(e);e!==null;){if(n=e[Jn])return n;e=ev(e)}return t}e=n,n=e.parentNode}return null}function tl(e){return e=e[Jn]||e[Tr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Y(33))}function lu(e){return e[_a]||null}var Of=[],js=-1;function yi(e){return{current:e}}function $e(e){0>js||(e.current=Of[js],Of[js]=null,js--)}function Ie(e,t){js++,Of[js]=e.current,e.current=t}var fi={},Pt=yi(fi),Gt=yi(!1),Xi=fi;function ao(e,t){var n=e.type.contextTypes;if(!n)return fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yt(e){return e=e.childContextTypes,e!=null}function kc(){$e(Gt),$e(Pt)}function tv(e,t,n){if(Pt.current!==fi)throw Error(Y(168));Ie(Pt,t),Ie(Gt,n)}function Y1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Y(108,y2(e)||"Unknown",i));return Qe({},n,r)}function Sc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,Xi=Pt.current,Ie(Pt,e),Ie(Gt,Gt.current),!0}function nv(e,t,n){var r=e.stateNode;if(!r)throw Error(Y(169));n?(e=Y1(e,t,Xi),r.__reactInternalMemoizedMergedChildContext=e,$e(Gt),$e(Pt),Ie(Pt,e)):$e(Gt),Ie(Gt,n)}var vr=null,cu=!1,gd=!1;function Q1(e){vr===null?vr=[e]:vr.push(e)}function DT(e){cu=!0,Q1(e)}function xi(){if(!gd&&vr!==null){gd=!0;var e=0,t=Re;try{var n=vr;for(Re=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vr=null,cu=!1}catch(i){throw vr!==null&&(vr=vr.slice(e+1)),w1(wh,xi),i}finally{Re=t,gd=!1}}return null}var As=[],Rs=0,Cc=null,Tc=0,yn=[],xn=0,Zi=null,wr=1,br="";function _i(e,t){As[Rs++]=Tc,As[Rs++]=Cc,Cc=e,Tc=t}function K1(e,t,n){yn[xn++]=wr,yn[xn++]=br,yn[xn++]=Zi,Zi=e;var r=wr;e=br;var i=32-Fn(r)-1;r&=~(1<<i),n+=1;var s=32-Fn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wr=1<<32-Fn(t)+i|n<<i|r,br=s+e}else wr=1<<s|n<<i|r,br=e}function Ah(e){e.return!==null&&(_i(e,1),K1(e,1,0))}function Rh(e){for(;e===Cc;)Cc=As[--Rs],As[Rs]=null,Tc=As[--Rs],As[Rs]=null;for(;e===Zi;)Zi=yn[--xn],yn[xn]=null,br=yn[--xn],yn[xn]=null,wr=yn[--xn],yn[xn]=null}var sn=null,tn=null,Ue=!1,Dn=null;function X1(e,t){var n=bn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function rv(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,sn=e,tn=ii(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,sn=e,tn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zi!==null?{id:wr,overflow:br}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=bn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,sn=e,tn=null,!0):!1;default:return!1}}function Nf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Df(e){if(Ue){var t=tn;if(t){var n=t;if(!rv(e,t)){if(Nf(e))throw Error(Y(418));t=ii(n.nextSibling);var r=sn;t&&rv(e,t)?X1(r,n):(e.flags=e.flags&-4097|2,Ue=!1,sn=e)}}else{if(Nf(e))throw Error(Y(418));e.flags=e.flags&-4097|2,Ue=!1,sn=e}}}function iv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;sn=e}function Tl(e){if(e!==sn)return!1;if(!Ue)return iv(e),Ue=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Rf(e.type,e.memoizedProps)),t&&(t=tn)){if(Nf(e))throw Z1(),Error(Y(418));for(;t;)X1(e,t),t=ii(t.nextSibling)}if(iv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Y(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){tn=ii(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tn=null}}else tn=sn?ii(e.stateNode.nextSibling):null;return!0}function Z1(){for(var e=tn;e;)e=ii(e.nextSibling)}function lo(){tn=sn=null,Ue=!1}function Ph(e){Dn===null?Dn=[e]:Dn.push(e)}var IT=Pr.ReactCurrentBatchConfig;function Fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Y(309));var r=n.stateNode}if(!r)throw Error(Y(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(Y(284));if(!n._owner)throw Error(Y(290,e))}return e}function _l(e,t){throw e=Object.prototype.toString.call(t),Error(Y(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function sv(e){var t=e._init;return t(e._payload)}function J1(e){function t(h,g){if(e){var k=h.deletions;k===null?(h.deletions=[g],h.flags|=16):k.push(g)}}function n(h,g){if(!e)return null;for(;g!==null;)t(h,g),g=g.sibling;return null}function r(h,g){for(h=new Map;g!==null;)g.key!==null?h.set(g.key,g):h.set(g.index,g),g=g.sibling;return h}function i(h,g){return h=li(h,g),h.index=0,h.sibling=null,h}function s(h,g,k){return h.index=k,e?(k=h.alternate,k!==null?(k=k.index,k<g?(h.flags|=2,g):k):(h.flags|=2,g)):(h.flags|=1048576,g)}function o(h){return e&&h.alternate===null&&(h.flags|=2),h}function a(h,g,k,C){return g===null||g.tag!==6?(g=Sd(k,h.mode,C),g.return=h,g):(g=i(g,k),g.return=h,g)}function l(h,g,k,C){var S=k.type;return S===Ss?d(h,g,k.props.children,C,k.key):g!==null&&(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fr&&sv(S)===g.type)?(C=i(g,k.props),C.ref=Fo(h,g,k),C.return=h,C):(C=tc(k.type,k.key,k.props,null,h.mode,C),C.ref=Fo(h,g,k),C.return=h,C)}function c(h,g,k,C){return g===null||g.tag!==4||g.stateNode.containerInfo!==k.containerInfo||g.stateNode.implementation!==k.implementation?(g=Cd(k,h.mode,C),g.return=h,g):(g=i(g,k.children||[]),g.return=h,g)}function d(h,g,k,C,S){return g===null||g.tag!==7?(g=Wi(k,h.mode,C,S),g.return=h,g):(g=i(g,k),g.return=h,g)}function u(h,g,k){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Sd(""+g,h.mode,k),g.return=h,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ml:return k=tc(g.type,g.key,g.props,null,h.mode,k),k.ref=Fo(h,null,g),k.return=h,k;case ks:return g=Cd(g,h.mode,k),g.return=h,g;case Fr:var C=g._init;return u(h,C(g._payload),k)}if(Wo(g)||Oo(g))return g=Wi(g,h.mode,k,null),g.return=h,g;_l(h,g)}return null}function p(h,g,k,C){var S=g!==null?g.key:null;if(typeof k=="string"&&k!==""||typeof k=="number")return S!==null?null:a(h,g,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case ml:return k.key===S?l(h,g,k,C):null;case ks:return k.key===S?c(h,g,k,C):null;case Fr:return S=k._init,p(h,g,S(k._payload),C)}if(Wo(k)||Oo(k))return S!==null?null:d(h,g,k,C,null);_l(h,k)}return null}function m(h,g,k,C,S){if(typeof C=="string"&&C!==""||typeof C=="number")return h=h.get(k)||null,a(g,h,""+C,S);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case ml:return h=h.get(C.key===null?k:C.key)||null,l(g,h,C,S);case ks:return h=h.get(C.key===null?k:C.key)||null,c(g,h,C,S);case Fr:var T=C._init;return m(h,g,k,T(C._payload),S)}if(Wo(C)||Oo(C))return h=h.get(k)||null,d(g,h,C,S,null);_l(g,C)}return null}function y(h,g,k,C){for(var S=null,T=null,j=g,E=g=0,A=null;j!==null&&E<k.length;E++){j.index>E?(A=j,j=null):A=j.sibling;var I=p(h,j,k[E],C);if(I===null){j===null&&(j=A);break}e&&j&&I.alternate===null&&t(h,j),g=s(I,g,E),T===null?S=I:T.sibling=I,T=I,j=A}if(E===k.length)return n(h,j),Ue&&_i(h,E),S;if(j===null){for(;E<k.length;E++)j=u(h,k[E],C),j!==null&&(g=s(j,g,E),T===null?S=j:T.sibling=j,T=j);return Ue&&_i(h,E),S}for(j=r(h,j);E<k.length;E++)A=m(j,h,E,k[E],C),A!==null&&(e&&A.alternate!==null&&j.delete(A.key===null?E:A.key),g=s(A,g,E),T===null?S=A:T.sibling=A,T=A);return e&&j.forEach(function(N){return t(h,N)}),Ue&&_i(h,E),S}function w(h,g,k,C){var S=Oo(k);if(typeof S!="function")throw Error(Y(150));if(k=S.call(k),k==null)throw Error(Y(151));for(var T=S=null,j=g,E=g=0,A=null,I=k.next();j!==null&&!I.done;E++,I=k.next()){j.index>E?(A=j,j=null):A=j.sibling;var N=p(h,j,I.value,C);if(N===null){j===null&&(j=A);break}e&&j&&N.alternate===null&&t(h,j),g=s(N,g,E),T===null?S=N:T.sibling=N,T=N,j=A}if(I.done)return n(h,j),Ue&&_i(h,E),S;if(j===null){for(;!I.done;E++,I=k.next())I=u(h,I.value,C),I!==null&&(g=s(I,g,E),T===null?S=I:T.sibling=I,T=I);return Ue&&_i(h,E),S}for(j=r(h,j);!I.done;E++,I=k.next())I=m(j,h,E,I.value,C),I!==null&&(e&&I.alternate!==null&&j.delete(I.key===null?E:I.key),g=s(I,g,E),T===null?S=I:T.sibling=I,T=I);return e&&j.forEach(function(D){return t(h,D)}),Ue&&_i(h,E),S}function x(h,g,k,C){if(typeof k=="object"&&k!==null&&k.type===Ss&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case ml:e:{for(var S=k.key,T=g;T!==null;){if(T.key===S){if(S=k.type,S===Ss){if(T.tag===7){n(h,T.sibling),g=i(T,k.props.children),g.return=h,h=g;break e}}else if(T.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fr&&sv(S)===T.type){n(h,T.sibling),g=i(T,k.props),g.ref=Fo(h,T,k),g.return=h,h=g;break e}n(h,T);break}else t(h,T);T=T.sibling}k.type===Ss?(g=Wi(k.props.children,h.mode,C,k.key),g.return=h,h=g):(C=tc(k.type,k.key,k.props,null,h.mode,C),C.ref=Fo(h,g,k),C.return=h,h=C)}return o(h);case ks:e:{for(T=k.key;g!==null;){if(g.key===T)if(g.tag===4&&g.stateNode.containerInfo===k.containerInfo&&g.stateNode.implementation===k.implementation){n(h,g.sibling),g=i(g,k.children||[]),g.return=h,h=g;break e}else{n(h,g);break}else t(h,g);g=g.sibling}g=Cd(k,h.mode,C),g.return=h,h=g}return o(h);case Fr:return T=k._init,x(h,g,T(k._payload),C)}if(Wo(k))return y(h,g,k,C);if(Oo(k))return w(h,g,k,C);_l(h,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,g!==null&&g.tag===6?(n(h,g.sibling),g=i(g,k),g.return=h,h=g):(n(h,g),g=Sd(k,h.mode,C),g.return=h,h=g),o(h)):n(h,g)}return x}var co=J1(!0),ew=J1(!1),_c=yi(null),Ec=null,Ps=null,Mh=null;function Oh(){Mh=Ps=Ec=null}function Nh(e){var t=_c.current;$e(_c),e._currentValue=t}function If(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hs(e,t){Ec=e,Mh=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qt=!0),e.firstContext=null)}function Cn(e){var t=e._currentValue;if(Mh!==e)if(e={context:e,memoizedValue:t,next:null},Ps===null){if(Ec===null)throw Error(Y(308));Ps=e,Ec.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return t}var Mi=null;function Dh(e){Mi===null?Mi=[e]:Mi.push(e)}function tw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Dh(t)):(n.next=i.next,i.next=n),t.interleaved=n,_r(e,r)}function _r(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Br=!1;function Ih(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,je&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,_r(e,n)}return i=r.interleaved,i===null?(t.next=t,Dh(r)):(t.next=i.next,i.next=t),r.interleaved=t,_r(e,n)}function Ql(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bh(e,n)}}function ov(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jc(e,t,n,r){var i=e.updateQueue;Br=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var u=i.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,m=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,w=a;switch(p=t,m=n,w.tag){case 1:if(y=w.payload,typeof y=="function"){u=y.call(m,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=w.payload,p=typeof y=="function"?y.call(m,u,p):y,p==null)break e;u=Qe({},u,p);break e;case 2:Br=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else m={eventTime:m,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=m,l=u):d=d.next=m,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);es|=o,e.lanes=o,e.memoizedState=u}}function av(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Y(191,i));i.call(r)}}}var nl={},nr=yi(nl),Ea=yi(nl),ja=yi(nl);function Oi(e){if(e===nl)throw Error(Y(174));return e}function Lh(e,t){switch(Ie(ja,t),Ie(Ea,e),Ie(nr,nl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gf(t,e)}$e(nr),Ie(nr,t)}function uo(){$e(nr),$e(Ea),$e(ja)}function rw(e){Oi(ja.current);var t=Oi(nr.current),n=gf(t,e.type);t!==n&&(Ie(Ea,e),Ie(nr,n))}function Fh(e){Ea.current===e&&($e(nr),$e(Ea))}var qe=yi(0);function Ac(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 vd=[];function Bh(){for(var e=0;e<vd.length;e++)vd[e]._workInProgressVersionPrimary=null;vd.length=0}var Kl=Pr.ReactCurrentDispatcher,yd=Pr.ReactCurrentBatchConfig,Ji=0,Ye=null,lt=null,pt=null,Rc=!1,ia=!1,Aa=0,LT=0;function Ct(){throw Error(Y(321))}function $h(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zn(e[n],t[n]))return!1;return!0}function zh(e,t,n,r,i,s){if(Ji=s,Ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Kl.current=e===null||e.memoizedState===null?zT:VT,e=n(r,i),ia){s=0;do{if(ia=!1,Aa=0,25<=s)throw Error(Y(301));s+=1,pt=lt=null,t.updateQueue=null,Kl.current=UT,e=n(r,i)}while(ia)}if(Kl.current=Pc,t=lt!==null&<.next!==null,Ji=0,pt=lt=Ye=null,Rc=!1,t)throw Error(Y(300));return e}function Vh(){var e=Aa!==0;return Aa=0,e}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Ye.memoizedState=pt=e:pt=pt.next=e,pt}function Tn(){if(lt===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=pt===null?Ye.memoizedState:pt.next;if(t!==null)pt=t,lt=e;else{if(e===null)throw Error(Y(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},pt===null?Ye.memoizedState=pt=e:pt=pt.next=e}return pt}function Ra(e,t){return typeof t=="function"?t(e):t}function xd(e){var t=Tn(),n=t.queue;if(n===null)throw Error(Y(311));n.lastRenderedReducer=e;var r=lt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((Ji&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=u,o=r):l=l.next=u,Ye.lanes|=d,es|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,zn(r,t.memoizedState)||(qt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ye.lanes|=s,es|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function wd(e){var t=Tn(),n=t.queue;if(n===null)throw Error(Y(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);zn(s,t.memoizedState)||(qt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function iw(){}function sw(e,t){var n=Ye,r=Tn(),i=t(),s=!zn(r.memoizedState,i);if(s&&(r.memoizedState=i,qt=!0),r=r.queue,Uh(lw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||pt!==null&&pt.memoizedState.tag&1){if(n.flags|=2048,Pa(9,aw.bind(null,n,r,i,t),void 0,null),ht===null)throw Error(Y(349));Ji&30||ow(n,t,i)}return i}function ow(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function aw(e,t,n,r){t.value=n,t.getSnapshot=r,cw(t)&&uw(e)}function lw(e,t,n){return n(function(){cw(t)&&uw(e)})}function cw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zn(e,n)}catch{return!0}}function uw(e){var t=_r(e,1);t!==null&&Bn(t,e,1,-1)}function lv(e){var t=Gn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ra,lastRenderedState:e},t.queue=e,e=e.dispatch=$T.bind(null,Ye,e),[t.memoizedState,e]}function Pa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ye.updateQueue,t===null?(t={lastEffect:null,stores:null},Ye.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function dw(){return Tn().memoizedState}function Xl(e,t,n,r){var i=Gn();Ye.flags|=e,i.memoizedState=Pa(1|t,n,void 0,r===void 0?null:r)}function uu(e,t,n,r){var i=Tn();r=r===void 0?null:r;var s=void 0;if(lt!==null){var o=lt.memoizedState;if(s=o.destroy,r!==null&&$h(r,o.deps)){i.memoizedState=Pa(t,n,s,r);return}}Ye.flags|=e,i.memoizedState=Pa(1|t,n,s,r)}function cv(e,t){return Xl(8390656,8,e,t)}function Uh(e,t){return uu(2048,8,e,t)}function fw(e,t){return uu(4,2,e,t)}function pw(e,t){return uu(4,4,e,t)}function hw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function mw(e,t,n){return n=n!=null?n.concat([e]):null,uu(4,4,hw.bind(null,t,e),n)}function Hh(){}function gw(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&$h(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vw(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&$h(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yw(e,t,n){return Ji&21?(zn(n,t)||(n=S1(),Ye.lanes|=n,es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qt=!0),e.memoizedState=n)}function FT(e,t){var n=Re;Re=n!==0&&4>n?n:4,e(!0);var r=yd.transition;yd.transition={};try{e(!1),t()}finally{Re=n,yd.transition=r}}function xw(){return Tn().memoizedState}function BT(e,t,n){var r=ai(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ww(e))bw(t,n);else if(n=tw(e,t,n,r),n!==null){var i=It();Bn(n,e,r,i),kw(n,t,r)}}function $T(e,t,n){var r=ai(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ww(e))bw(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,zn(a,o)){var l=t.interleaved;l===null?(i.next=i,Dh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=tw(e,t,i,r),n!==null&&(i=It(),Bn(n,e,r,i),kw(n,t,r))}}function ww(e){var t=e.alternate;return e===Ye||t!==null&&t===Ye}function bw(e,t){ia=Rc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bh(e,n)}}var Pc={readContext:Cn,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},zT={readContext:Cn,useCallback:function(e,t){return Gn().memoizedState=[e,t===void 0?null:t],e},useContext:Cn,useEffect:cv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Xl(4194308,4,hw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xl(4,2,e,t)},useMemo:function(e,t){var n=Gn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gn();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=BT.bind(null,Ye,e),[r.memoizedState,e]},useRef:function(e){var t=Gn();return e={current:e},t.memoizedState=e},useState:lv,useDebugValue:Hh,useDeferredValue:function(e){return Gn().memoizedState=e},useTransition:function(){var e=lv(!1),t=e[0];return e=FT.bind(null,e[1]),Gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ye,i=Gn();if(Ue){if(n===void 0)throw Error(Y(407));n=n()}else{if(n=t(),ht===null)throw Error(Y(349));Ji&30||ow(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,cv(lw.bind(null,r,s,e),[e]),r.flags|=2048,Pa(9,aw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Gn(),t=ht.identifierPrefix;if(Ue){var n=br,r=wr;n=(r&~(1<<32-Fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Aa++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=LT++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},VT={readContext:Cn,useCallback:gw,useContext:Cn,useEffect:Uh,useImperativeHandle:mw,useInsertionEffect:fw,useLayoutEffect:pw,useMemo:vw,useReducer:xd,useRef:dw,useState:function(){return xd(Ra)},useDebugValue:Hh,useDeferredValue:function(e){var t=Tn();return yw(t,lt.memoizedState,e)},useTransition:function(){var e=xd(Ra)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:iw,useSyncExternalStore:sw,useId:xw,unstable_isNewReconciler:!1},UT={readContext:Cn,useCallback:gw,useContext:Cn,useEffect:Uh,useImperativeHandle:mw,useInsertionEffect:fw,useLayoutEffect:pw,useMemo:vw,useReducer:wd,useRef:dw,useState:function(){return wd(Ra)},useDebugValue:Hh,useDeferredValue:function(e){var t=Tn();return lt===null?t.memoizedState=e:yw(t,lt.memoizedState,e)},useTransition:function(){var e=wd(Ra)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:iw,useSyncExternalStore:sw,useId:xw,unstable_isNewReconciler:!1};function Pn(e,t){if(e&&e.defaultProps){t=Qe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Lf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Qe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var du={isMounted:function(e){return(e=e._reactInternals)?os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=It(),i=ai(e),s=kr(r,i);s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&(Bn(t,e,i,r),Ql(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=It(),i=ai(e),s=kr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&(Bn(t,e,i,r),Ql(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=It(),r=ai(e),i=kr(n,r);i.tag=2,t!=null&&(i.callback=t),t=si(e,i,r),t!==null&&(Bn(t,e,r,n),Ql(t,e,r))}};function uv(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Sa(n,r)||!Sa(i,s):!0}function Sw(e,t,n){var r=!1,i=fi,s=t.contextType;return typeof s=="object"&&s!==null?s=Cn(s):(i=Yt(t)?Xi:Pt.current,r=t.contextTypes,s=(r=r!=null)?ao(e,i):fi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=du,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function dv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&du.enqueueReplaceState(t,t.state,null)}function Ff(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Ih(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Cn(s):(s=Yt(t)?Xi:Pt.current,i.context=ao(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Lf(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&du.enqueueReplaceState(i,i.state,null),jc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function fo(e,t){try{var n="",r=t;do n+=v2(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{nd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wo(e):""}function x2(e){switch(e.tag){case 5:return Wo(e.type);case 16:return Wo("Lazy");case 13:return Wo("Suspense");case 19:return Wo("SuspenseList");case 0:case 2:case 15:return e=rd(e.type,!1),e;case 11:return e=rd(e.type.render,!1),e;case 1:return e=rd(e.type,!0),e;default:return""}}function ff(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 Ss:return"Fragment";case ks:return"Portal";case cf:return"Profiler";case vh:return"StrictMode";case uf:return"Suspense";case df:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case i1:return(e.displayName||"Context")+".Consumer";case r1:return(e._context.displayName||"Context")+".Provider";case yh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xh:return t=e.displayName||null,t!==null?t:ff(e.type)||"Memo";case Fr:t=e._payload,e=e._init;try{return ff(e(t))}catch{}}return null}function w2(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 ff(t);case 8:return t===vh?"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 di(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function o1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function b2(e){var t=o1(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 i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.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 vl(e){e._valueTracker||(e._valueTracker=b2(e))}function a1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=o1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function hc(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 pf(e,t){var n=t.checked;return Xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=di(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 l1(e,t){t=t.checked,t!=null&&gh(e,"checked",t,!1)}function hf(e,t){l1(e,t);var n=di(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")?mf(e,t.type,n):t.hasOwnProperty("defaultValue")&&mf(e,t.type,di(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rg(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 mf(e,t,n){(t!=="number"||hc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var qo=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+di(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function gf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return Xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pg(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Q(92));if(qo(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:di(n)}}function c1(e,t){var n=di(t.value),r=di(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Mg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function u1(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function vf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?u1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var yl,d1=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(yl=yl||document.createElement("div"),yl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=yl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ya(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ea={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},k2=["Webkit","ms","Moz","O"];Object.keys(ea).forEach(function(e){k2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ea[t]=ea[e]})});function f1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ea.hasOwnProperty(e)&&ea[e]?(""+t).trim():t+"px"}function p1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=f1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var S2=Xe({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 yf(e,t){if(t){if(S2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function xf(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 wf=null;function wh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bf=null,zs=null,Vs=null;function Og(e){if(e=nl(e)){if(typeof bf!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=cu(t),bf(e.stateNode,e.type,t))}}function h1(e){zs?Vs?Vs.push(e):Vs=[e]:zs=e}function m1(){if(zs){var e=zs,t=Vs;if(Vs=zs=null,Og(e),t)for(e=0;e<t.length;e++)Og(t[e])}}function g1(e,t){return e(t)}function v1(){}var id=!1;function y1(e,t,n){if(id)return e(t,n);id=!0;try{return g1(e,t,n)}finally{id=!1,(zs!==null||Vs!==null)&&(v1(),m1())}}function xa(e,t){var n=e.stateNode;if(n===null)return null;var r=cu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Q(231,t,typeof n));return n}var kf=!1;if(Cr)try{var No={};Object.defineProperty(No,"passive",{get:function(){kf=!0}}),window.addEventListener("test",No,No),window.removeEventListener("test",No,No)}catch{kf=!1}function C2(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var ta=!1,mc=null,gc=!1,Sf=null,_2={onError:function(e){ta=!0,mc=e}};function T2(e,t,n,r,i,s,o,a,l){ta=!1,mc=null,C2.apply(_2,arguments)}function E2(e,t,n,r,i,s,o,a,l){if(T2.apply(this,arguments),ta){if(ta){var c=mc;ta=!1,mc=null}else throw Error(Q(198));gc||(gc=!0,Sf=c)}}function os(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function x1(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ng(e){if(os(e)!==e)throw Error(Q(188))}function A2(e){var t=e.alternate;if(!t){if(t=os(e),t===null)throw Error(Q(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Ng(i),e;if(s===r)return Ng(i),t;s=s.sibling}throw Error(Q(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(Q(189))}}if(n.alternate!==r)throw Error(Q(190))}if(n.tag!==3)throw Error(Q(188));return n.stateNode.current===n?e:t}function w1(e){return e=A2(e),e!==null?b1(e):null}function b1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=b1(e);if(t!==null)return t;e=e.sibling}return null}var k1=an.unstable_scheduleCallback,Dg=an.unstable_cancelCallback,j2=an.unstable_shouldYield,R2=an.unstable_requestPaint,it=an.unstable_now,P2=an.unstable_getCurrentPriorityLevel,bh=an.unstable_ImmediatePriority,S1=an.unstable_UserBlockingPriority,vc=an.unstable_NormalPriority,M2=an.unstable_LowPriority,C1=an.unstable_IdlePriority,su=null,tr=null;function O2(e){if(tr&&typeof tr.onCommitFiberRoot=="function")try{tr.onCommitFiberRoot(su,e,void 0,(e.current.flags&128)===128)}catch{}}var Bn=Math.clz32?Math.clz32:I2,N2=Math.log,D2=Math.LN2;function I2(e){return e>>>=0,e===0?32:31-(N2(e)/D2|0)|0}var xl=64,wl=4194304;function Go(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 yc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Go(a):(s&=o,s!==0&&(r=Go(s)))}else o=n&~i,o!==0?r=Go(o):s!==0&&(r=Go(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Bn(t),i=1<<n,r|=e[n],t&=~i;return r}function L2(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function F2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Bn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=L2(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Cf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function _1(){var e=xl;return xl<<=1,!(xl&4194240)&&(xl=64),e}function sd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function el(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Bn(t),e[t]=n}function B2(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<n;){var i=31-Bn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function kh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Bn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Pe=0;function T1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var E1,Sh,A1,j1,R1,_f=!1,bl=[],ti=null,ni=null,ri=null,wa=new Map,ba=new Map,zr=[],$2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ig(e,t){switch(e){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":wa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ba.delete(t.pointerId)}}function Do(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=nl(t),t!==null&&Sh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function z2(e,t,n,r,i){switch(t){case"focusin":return ti=Do(ti,e,t,n,r,i),!0;case"dragenter":return ni=Do(ni,e,t,n,r,i),!0;case"mouseover":return ri=Do(ri,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return wa.set(s,Do(wa.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ba.set(s,Do(ba.get(s)||null,e,t,n,r,i)),!0}return!1}function P1(e){var t=Pi(e.target);if(t!==null){var n=os(t);if(n!==null){if(t=n.tag,t===13){if(t=x1(n),t!==null){e.blockedOn=t,R1(e.priority,function(){A1(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Gl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);wf=r,n.target.dispatchEvent(r),wf=null}else return t=nl(n),t!==null&&Sh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lg(e,t,n){Gl(e)&&n.delete(t)}function V2(){_f=!1,ti!==null&&Gl(ti)&&(ti=null),ni!==null&&Gl(ni)&&(ni=null),ri!==null&&Gl(ri)&&(ri=null),wa.forEach(Lg),ba.forEach(Lg)}function Io(e,t){e.blockedOn===t&&(e.blockedOn=null,_f||(_f=!0,an.unstable_scheduleCallback(an.unstable_NormalPriority,V2)))}function ka(e){function t(i){return Io(i,e)}if(0<bl.length){Io(bl[0],e);for(var n=1;n<bl.length;n++){var r=bl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ti!==null&&Io(ti,e),ni!==null&&Io(ni,e),ri!==null&&Io(ri,e),wa.forEach(t),ba.forEach(t),n=0;n<zr.length;n++)r=zr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<zr.length&&(n=zr[0],n.blockedOn===null);)P1(n),n.blockedOn===null&&zr.shift()}var Us=Pr.ReactCurrentBatchConfig,xc=!0;function U2(e,t,n,r){var i=Pe,s=Us.transition;Us.transition=null;try{Pe=1,Ch(e,t,n,r)}finally{Pe=i,Us.transition=s}}function H2(e,t,n,r){var i=Pe,s=Us.transition;Us.transition=null;try{Pe=4,Ch(e,t,n,r)}finally{Pe=i,Us.transition=s}}function Ch(e,t,n,r){if(xc){var i=Tf(e,t,n,r);if(i===null)md(e,t,r,wc,n),Ig(e,r);else if(z2(i,e,t,n,r))r.stopPropagation();else if(Ig(e,r),t&4&&-1<$2.indexOf(e)){for(;i!==null;){var s=nl(i);if(s!==null&&E1(s),s=Tf(e,t,n,r),s===null&&md(e,t,r,wc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else md(e,t,r,null,n)}}var wc=null;function Tf(e,t,n,r){if(wc=null,e=wh(r),e=Pi(e),e!==null)if(t=os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=x1(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return wc=e,null}function M1(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(P2()){case bh:return 1;case S1:return 4;case vc:case M2:return 16;case C1:return 536870912;default:return 16}default:return 16}}var Zr=null,_h=null,Yl=null;function O1(){if(Yl)return Yl;var e,t=_h,n=t.length,r,i="value"in Zr?Zr.value:Zr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return Yl=i.slice(e,1<r?1-r:void 0)}function Ql(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function kl(){return!0}function Fg(){return!1}function cn(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?kl:Fg,this.isPropagationStopped=Fg,this}return Xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=kl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),t}var So={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Th=cn(So),tl=Xe({},So,{view:0,detail:0}),W2=cn(tl),od,ad,Lo,ou=Xe({},tl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Eh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Lo&&(Lo&&e.type==="mousemove"?(od=e.screenX-Lo.screenX,ad=e.screenY-Lo.screenY):ad=od=0,Lo=e),od)},movementY:function(e){return"movementY"in e?e.movementY:ad}}),Bg=cn(ou),q2=Xe({},ou,{dataTransfer:0}),G2=cn(q2),Y2=Xe({},tl,{relatedTarget:0}),ld=cn(Y2),Q2=Xe({},So,{animationName:0,elapsedTime:0,pseudoElement:0}),K2=cn(Q2),X2=Xe({},So,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Z2=cn(X2),J2=Xe({},So,{data:0}),$g=cn(J2),e_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},t_={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},n_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function r_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=n_[e])?!!t[e]:!1}function Eh(){return r_}var i_=Xe({},tl,{key:function(e){if(e.key){var t=e_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ql(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?t_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Eh,charCode:function(e){return e.type==="keypress"?Ql(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ql(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),s_=cn(i_),o_=Xe({},ou,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zg=cn(o_),a_=Xe({},tl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Eh}),l_=cn(a_),c_=Xe({},So,{propertyName:0,elapsedTime:0,pseudoElement:0}),u_=cn(c_),d_=Xe({},ou,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),f_=cn(d_),p_=[9,13,27,32],Ah=Cr&&"CompositionEvent"in window,na=null;Cr&&"documentMode"in document&&(na=document.documentMode);var h_=Cr&&"TextEvent"in window&&!na,N1=Cr&&(!Ah||na&&8<na&&11>=na),Vg=" ",Ug=!1;function D1(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 I1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cs=!1;function m_(e,t){switch(e){case"compositionend":return I1(t);case"keypress":return t.which!==32?null:(Ug=!0,Vg);case"textInput":return e=t.data,e===Vg&&Ug?null:e;default:return null}}function g_(e,t){if(Cs)return e==="compositionend"||!Ah&&D1(e,t)?(e=O1(),Yl=_h=Zr=null,Cs=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return N1&&t.locale!=="ko"?null:t.data;default:return null}}var v_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Hg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!v_[e.type]:t==="textarea"}function L1(e,t,n,r){h1(r),t=bc(t,"onChange"),0<t.length&&(n=new Th("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ra=null,Sa=null;function y_(e){Y1(e,0)}function au(e){var t=Es(e);if(a1(t))return e}function x_(e,t){if(e==="change")return t}var F1=!1;if(Cr){var cd;if(Cr){var ud="oninput"in document;if(!ud){var Wg=document.createElement("div");Wg.setAttribute("oninput","return;"),ud=typeof Wg.oninput=="function"}cd=ud}else cd=!1;F1=cd&&(!document.documentMode||9<document.documentMode)}function qg(){ra&&(ra.detachEvent("onpropertychange",B1),Sa=ra=null)}function B1(e){if(e.propertyName==="value"&&au(Sa)){var t=[];L1(t,Sa,e,wh(e)),y1(y_,t)}}function w_(e,t,n){e==="focusin"?(qg(),ra=t,Sa=n,ra.attachEvent("onpropertychange",B1)):e==="focusout"&&qg()}function b_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return au(Sa)}function k_(e,t){if(e==="click")return au(t)}function S_(e,t){if(e==="input"||e==="change")return au(t)}function C_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vn=typeof Object.is=="function"?Object.is:C_;function Ca(e,t){if(Vn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!lf.call(t,i)||!Vn(e[i],t[i]))return!1}return!0}function Gg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yg(e,t){var n=Gg(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=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=Gg(n)}}function $1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function z1(){for(var e=window,t=hc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=hc(e.document)}return t}function jh(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 __(e){var t=z1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$1(n.ownerDocument.documentElement,n)){if(r!==null&&jh(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 i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Yg(n,s);var o=Yg(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>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<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var T_=Cr&&"documentMode"in document&&11>=document.documentMode,_s=null,Ef=null,ia=null,Af=!1;function Qg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Af||_s==null||_s!==hc(r)||(r=_s,"selectionStart"in r&&jh(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}),ia&&Ca(ia,r)||(ia=r,r=bc(Ef,"onSelect"),0<r.length&&(t=new Th("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=_s)))}function Sl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ts={animationend:Sl("Animation","AnimationEnd"),animationiteration:Sl("Animation","AnimationIteration"),animationstart:Sl("Animation","AnimationStart"),transitionend:Sl("Transition","TransitionEnd")},dd={},V1={};Cr&&(V1=document.createElement("div").style,"AnimationEvent"in window||(delete Ts.animationend.animation,delete Ts.animationiteration.animation,delete Ts.animationstart.animation),"TransitionEvent"in window||delete Ts.transitionend.transition);function lu(e){if(dd[e])return dd[e];if(!Ts[e])return e;var t=Ts[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in V1)return dd[e]=t[n];return e}var U1=lu("animationend"),H1=lu("animationiteration"),W1=lu("animationstart"),q1=lu("transitionend"),G1=new Map,Kg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function vi(e,t){G1.set(e,t),ss(t,[e])}for(var fd=0;fd<Kg.length;fd++){var pd=Kg[fd],E_=pd.toLowerCase(),A_=pd[0].toUpperCase()+pd.slice(1);vi(E_,"on"+A_)}vi(U1,"onAnimationEnd");vi(H1,"onAnimationIteration");vi(W1,"onAnimationStart");vi("dblclick","onDoubleClick");vi("focusin","onFocus");vi("focusout","onBlur");vi(q1,"onTransitionEnd");oo("onMouseEnter",["mouseout","mouseover"]);oo("onMouseLeave",["mouseout","mouseover"]);oo("onPointerEnter",["pointerout","pointerover"]);oo("onPointerLeave",["pointerout","pointerover"]);ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ss("onBeforeInput",["compositionend","keypress","textInput","paste"]);ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),j_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yo));function Xg(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,E2(r,t,void 0,e),e.currentTarget=null}function Y1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Xg(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Xg(i,a,c),s=l}}}if(gc)throw e=Sf,gc=!1,Sf=null,e}function Be(e,t){var n=t[Of];n===void 0&&(n=t[Of]=new Set);var r=e+"__bubble";n.has(r)||(Q1(t,e,2,!1),n.add(r))}function hd(e,t,n){var r=0;t&&(r|=4),Q1(n,e,r,t)}var Cl="_reactListening"+Math.random().toString(36).slice(2);function _a(e){if(!e[Cl]){e[Cl]=!0,n1.forEach(function(n){n!=="selectionchange"&&(j_.has(n)||hd(n,!1,e),hd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Cl]||(t[Cl]=!0,hd("selectionchange",!1,t))}}function Q1(e,t,n,r){switch(M1(t)){case 1:var i=U2;break;case 4:i=H2;break;default:i=Ch}n=i.bind(null,t,n,e),i=void 0,!kf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function md(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Pi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}y1(function(){var c=s,d=wh(n),u=[];e:{var p=G1.get(e);if(p!==void 0){var h=Th,y=e;switch(e){case"keypress":if(Ql(n)===0)break e;case"keydown":case"keyup":h=s_;break;case"focusin":y="focus",h=ld;break;case"focusout":y="blur",h=ld;break;case"beforeblur":case"afterblur":h=ld;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Bg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=G2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=l_;break;case U1:case H1:case W1:h=K2;break;case q1:h=u_;break;case"scroll":h=W2;break;case"wheel":h=f_;break;case"copy":case"cut":case"paste":h=Z2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=zg}var x=(t&4)!==0,w=!x&&e==="scroll",m=x?p!==null?p+"Capture":null:p;x=[];for(var g=c,b;g!==null;){b=g;var C=b.stateNode;if(b.tag===5&&C!==null&&(b=C,m!==null&&(C=xa(g,m),C!=null&&x.push(Ta(g,C,b)))),w)break;g=g.return}0<x.length&&(p=new h(p,y,null,n,d),u.push({event:p,listeners:x}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==wf&&(y=n.relatedTarget||n.fromElement)&&(Pi(y)||y[_r]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=c,y=y?Pi(y):null,y!==null&&(w=os(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=c),h!==y)){if(x=Bg,C="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(x=zg,C="onPointerLeave",m="onPointerEnter",g="pointer"),w=h==null?p:Es(h),b=y==null?p:Es(y),p=new x(C,g+"leave",h,n,d),p.target=w,p.relatedTarget=b,C=null,Pi(d)===c&&(x=new x(m,g+"enter",y,n,d),x.target=b,x.relatedTarget=w,C=x),w=C,h&&y)t:{for(x=h,m=y,g=0,b=x;b;b=ws(b))g++;for(b=0,C=m;C;C=ws(C))b++;for(;0<g-b;)x=ws(x),g--;for(;0<b-g;)m=ws(m),b--;for(;g--;){if(x===m||m!==null&&x===m.alternate)break t;x=ws(x),m=ws(m)}x=null}else x=null;h!==null&&Zg(u,p,h,x,!1),y!==null&&w!==null&&Zg(u,w,y,x,!0)}}e:{if(p=c?Es(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var S=x_;else if(Hg(p))if(F1)S=S_;else{S=b_;var _=w_}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=k_);if(S&&(S=S(e,c))){L1(u,S,n,d);break e}_&&_(e,p,c),e==="focusout"&&(_=p._wrapperState)&&_.controlled&&p.type==="number"&&mf(p,"number",p.value)}switch(_=c?Es(c):window,e){case"focusin":(Hg(_)||_.contentEditable==="true")&&(_s=_,Ef=c,ia=null);break;case"focusout":ia=Ef=_s=null;break;case"mousedown":Af=!0;break;case"contextmenu":case"mouseup":case"dragend":Af=!1,Qg(u,n,d);break;case"selectionchange":if(T_)break;case"keydown":case"keyup":Qg(u,n,d)}var j;if(Ah)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Cs?D1(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(N1&&n.locale!=="ko"&&(Cs||A!=="onCompositionStart"?A==="onCompositionEnd"&&Cs&&(j=O1()):(Zr=d,_h="value"in Zr?Zr.value:Zr.textContent,Cs=!0)),_=bc(c,A),0<_.length&&(A=new $g(A,e,null,n,d),u.push({event:A,listeners:_}),j?A.data=j:(j=I1(n),j!==null&&(A.data=j)))),(j=h_?m_(e,n):g_(e,n))&&(c=bc(c,"onBeforeInput"),0<c.length&&(d=new $g("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=j))}Y1(u,t)})}function Ta(e,t,n){return{instance:e,listener:t,currentTarget:n}}function bc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=xa(e,n),s!=null&&r.unshift(Ta(e,s,i)),s=xa(e,t),s!=null&&r.push(Ta(e,s,i))),e=e.return}return r}function ws(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Zg(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=xa(n,s),l!=null&&o.unshift(Ta(n,l,a))):i||(l=xa(n,s),l!=null&&o.push(Ta(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var R_=/\r\n?/g,P_=/\u0000|\uFFFD/g;function Jg(e){return(typeof e=="string"?e:""+e).replace(R_,`
|
|
38
|
+
`).replace(P_,"")}function _l(e,t,n){if(t=Jg(t),Jg(e)!==t&&n)throw Error(Q(425))}function kc(){}var jf=null,Rf=null;function Pf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Mf=typeof setTimeout=="function"?setTimeout:void 0,M_=typeof clearTimeout=="function"?clearTimeout:void 0,ev=typeof Promise=="function"?Promise:void 0,O_=typeof queueMicrotask=="function"?queueMicrotask:typeof ev<"u"?function(e){return ev.resolve(null).then(e).catch(N_)}:Mf;function N_(e){setTimeout(function(){throw e})}function gd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ka(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ka(t)}function ii(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Co=Math.random().toString(36).slice(2),er="__reactFiber$"+Co,Ea="__reactProps$"+Co,_r="__reactContainer$"+Co,Of="__reactEvents$"+Co,D_="__reactListeners$"+Co,I_="__reactHandles$"+Co;function Pi(e){var t=e[er];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_r]||n[er]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tv(e);e!==null;){if(n=e[er])return n;e=tv(e)}return t}e=n,n=e.parentNode}return null}function nl(e){return e=e[er]||e[_r],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function cu(e){return e[Ea]||null}var Nf=[],As=-1;function yi(e){return{current:e}}function ze(e){0>As||(e.current=Nf[As],Nf[As]=null,As--)}function Le(e,t){As++,Nf[As]=e.current,e.current=t}var fi={},Pt=yi(fi),Gt=yi(!1),Xi=fi;function ao(e,t){var n=e.type.contextTypes;if(!n)return fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Yt(e){return e=e.childContextTypes,e!=null}function Sc(){ze(Gt),ze(Pt)}function nv(e,t,n){if(Pt.current!==fi)throw Error(Q(168));Le(Pt,t),Le(Gt,n)}function K1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Q(108,w2(e)||"Unknown",i));return Xe({},n,r)}function Cc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,Xi=Pt.current,Le(Pt,e),Le(Gt,Gt.current),!0}function rv(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=K1(e,t,Xi),r.__reactInternalMemoizedMergedChildContext=e,ze(Gt),ze(Pt),Le(Pt,e)):ze(Gt),Le(Gt,n)}var vr=null,uu=!1,vd=!1;function X1(e){vr===null?vr=[e]:vr.push(e)}function L_(e){uu=!0,X1(e)}function xi(){if(!vd&&vr!==null){vd=!0;var e=0,t=Pe;try{var n=vr;for(Pe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vr=null,uu=!1}catch(i){throw vr!==null&&(vr=vr.slice(e+1)),k1(bh,xi),i}finally{Pe=t,vd=!1}}return null}var js=[],Rs=0,_c=null,Tc=0,xn=[],wn=0,Zi=null,wr=1,br="";function Ti(e,t){js[Rs++]=Tc,js[Rs++]=_c,_c=e,Tc=t}function Z1(e,t,n){xn[wn++]=wr,xn[wn++]=br,xn[wn++]=Zi,Zi=e;var r=wr;e=br;var i=32-Bn(r)-1;r&=~(1<<i),n+=1;var s=32-Bn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,wr=1<<32-Bn(t)+i|n<<i|r,br=s+e}else wr=1<<s|n<<i|r,br=e}function Rh(e){e.return!==null&&(Ti(e,1),Z1(e,1,0))}function Ph(e){for(;e===_c;)_c=js[--Rs],js[Rs]=null,Tc=js[--Rs],js[Rs]=null;for(;e===Zi;)Zi=xn[--wn],xn[wn]=null,br=xn[--wn],xn[wn]=null,wr=xn[--wn],xn[wn]=null}var on=null,nn=null,We=!1,In=null;function J1(e,t){var n=kn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function iv(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,on=e,nn=ii(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,on=e,nn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zi!==null?{id:wr,overflow:br}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=kn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,on=e,nn=null,!0):!1;default:return!1}}function Df(e){return(e.mode&1)!==0&&(e.flags&128)===0}function If(e){if(We){var t=nn;if(t){var n=t;if(!iv(e,t)){if(Df(e))throw Error(Q(418));t=ii(n.nextSibling);var r=on;t&&iv(e,t)?J1(r,n):(e.flags=e.flags&-4097|2,We=!1,on=e)}}else{if(Df(e))throw Error(Q(418));e.flags=e.flags&-4097|2,We=!1,on=e}}}function sv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;on=e}function Tl(e){if(e!==on)return!1;if(!We)return sv(e),We=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pf(e.type,e.memoizedProps)),t&&(t=nn)){if(Df(e))throw ew(),Error(Q(418));for(;t;)J1(e,t),t=ii(t.nextSibling)}if(sv(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){nn=ii(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}nn=null}}else nn=on?ii(e.stateNode.nextSibling):null;return!0}function ew(){for(var e=nn;e;)e=ii(e.nextSibling)}function lo(){nn=on=null,We=!1}function Mh(e){In===null?In=[e]:In.push(e)}var F_=Pr.ReactCurrentBatchConfig;function Fo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Q(309));var r=n.stateNode}if(!r)throw Error(Q(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(Q(284));if(!n._owner)throw Error(Q(290,e))}return e}function El(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ov(e){var t=e._init;return t(e._payload)}function tw(e){function t(m,g){if(e){var b=m.deletions;b===null?(m.deletions=[g],m.flags|=16):b.push(g)}}function n(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function r(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function i(m,g){return m=li(m,g),m.index=0,m.sibling=null,m}function s(m,g,b){return m.index=b,e?(b=m.alternate,b!==null?(b=b.index,b<g?(m.flags|=2,g):b):(m.flags|=2,g)):(m.flags|=1048576,g)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,g,b,C){return g===null||g.tag!==6?(g=Cd(b,m.mode,C),g.return=m,g):(g=i(g,b),g.return=m,g)}function l(m,g,b,C){var S=b.type;return S===Ss?d(m,g,b.props.children,C,b.key):g!==null&&(g.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fr&&ov(S)===g.type)?(C=i(g,b.props),C.ref=Fo(m,g,b),C.return=m,C):(C=nc(b.type,b.key,b.props,null,m.mode,C),C.ref=Fo(m,g,b),C.return=m,C)}function c(m,g,b,C){return g===null||g.tag!==4||g.stateNode.containerInfo!==b.containerInfo||g.stateNode.implementation!==b.implementation?(g=_d(b,m.mode,C),g.return=m,g):(g=i(g,b.children||[]),g.return=m,g)}function d(m,g,b,C,S){return g===null||g.tag!==7?(g=Wi(b,m.mode,C,S),g.return=m,g):(g=i(g,b),g.return=m,g)}function u(m,g,b){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Cd(""+g,m.mode,b),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case gl:return b=nc(g.type,g.key,g.props,null,m.mode,b),b.ref=Fo(m,null,g),b.return=m,b;case ks:return g=_d(g,m.mode,b),g.return=m,g;case Fr:var C=g._init;return u(m,C(g._payload),b)}if(qo(g)||Oo(g))return g=Wi(g,m.mode,b,null),g.return=m,g;El(m,g)}return null}function p(m,g,b,C){var S=g!==null?g.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return S!==null?null:a(m,g,""+b,C);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case gl:return b.key===S?l(m,g,b,C):null;case ks:return b.key===S?c(m,g,b,C):null;case Fr:return S=b._init,p(m,g,S(b._payload),C)}if(qo(b)||Oo(b))return S!==null?null:d(m,g,b,C,null);El(m,b)}return null}function h(m,g,b,C,S){if(typeof C=="string"&&C!==""||typeof C=="number")return m=m.get(b)||null,a(g,m,""+C,S);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case gl:return m=m.get(C.key===null?b:C.key)||null,l(g,m,C,S);case ks:return m=m.get(C.key===null?b:C.key)||null,c(g,m,C,S);case Fr:var _=C._init;return h(m,g,b,_(C._payload),S)}if(qo(C)||Oo(C))return m=m.get(b)||null,d(g,m,C,S,null);El(g,C)}return null}function y(m,g,b,C){for(var S=null,_=null,j=g,A=g=0,E=null;j!==null&&A<b.length;A++){j.index>A?(E=j,j=null):E=j.sibling;var L=p(m,j,b[A],C);if(L===null){j===null&&(j=E);break}e&&j&&L.alternate===null&&t(m,j),g=s(L,g,A),_===null?S=L:_.sibling=L,_=L,j=E}if(A===b.length)return n(m,j),We&&Ti(m,A),S;if(j===null){for(;A<b.length;A++)j=u(m,b[A],C),j!==null&&(g=s(j,g,A),_===null?S=j:_.sibling=j,_=j);return We&&Ti(m,A),S}for(j=r(m,j);A<b.length;A++)E=h(j,m,A,b[A],C),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?A:E.key),g=s(E,g,A),_===null?S=E:_.sibling=E,_=E);return e&&j.forEach(function(F){return t(m,F)}),We&&Ti(m,A),S}function x(m,g,b,C){var S=Oo(b);if(typeof S!="function")throw Error(Q(150));if(b=S.call(b),b==null)throw Error(Q(151));for(var _=S=null,j=g,A=g=0,E=null,L=b.next();j!==null&&!L.done;A++,L=b.next()){j.index>A?(E=j,j=null):E=j.sibling;var F=p(m,j,L.value,C);if(F===null){j===null&&(j=E);break}e&&j&&F.alternate===null&&t(m,j),g=s(F,g,A),_===null?S=F:_.sibling=F,_=F,j=E}if(L.done)return n(m,j),We&&Ti(m,A),S;if(j===null){for(;!L.done;A++,L=b.next())L=u(m,L.value,C),L!==null&&(g=s(L,g,A),_===null?S=L:_.sibling=L,_=L);return We&&Ti(m,A),S}for(j=r(m,j);!L.done;A++,L=b.next())L=h(j,m,A,L.value,C),L!==null&&(e&&L.alternate!==null&&j.delete(L.key===null?A:L.key),g=s(L,g,A),_===null?S=L:_.sibling=L,_=L);return e&&j.forEach(function(D){return t(m,D)}),We&&Ti(m,A),S}function w(m,g,b,C){if(typeof b=="object"&&b!==null&&b.type===Ss&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case gl:e:{for(var S=b.key,_=g;_!==null;){if(_.key===S){if(S=b.type,S===Ss){if(_.tag===7){n(m,_.sibling),g=i(_,b.props.children),g.return=m,m=g;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fr&&ov(S)===_.type){n(m,_.sibling),g=i(_,b.props),g.ref=Fo(m,_,b),g.return=m,m=g;break e}n(m,_);break}else t(m,_);_=_.sibling}b.type===Ss?(g=Wi(b.props.children,m.mode,C,b.key),g.return=m,m=g):(C=nc(b.type,b.key,b.props,null,m.mode,C),C.ref=Fo(m,g,b),C.return=m,m=C)}return o(m);case ks:e:{for(_=b.key;g!==null;){if(g.key===_)if(g.tag===4&&g.stateNode.containerInfo===b.containerInfo&&g.stateNode.implementation===b.implementation){n(m,g.sibling),g=i(g,b.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else t(m,g);g=g.sibling}g=_d(b,m.mode,C),g.return=m,m=g}return o(m);case Fr:return _=b._init,w(m,g,_(b._payload),C)}if(qo(b))return y(m,g,b,C);if(Oo(b))return x(m,g,b,C);El(m,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,g!==null&&g.tag===6?(n(m,g.sibling),g=i(g,b),g.return=m,m=g):(n(m,g),g=Cd(b,m.mode,C),g.return=m,m=g),o(m)):n(m,g)}return w}var co=tw(!0),nw=tw(!1),Ec=yi(null),Ac=null,Ps=null,Oh=null;function Nh(){Oh=Ps=Ac=null}function Dh(e){var t=Ec.current;ze(Ec),e._currentValue=t}function Lf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hs(e,t){Ac=e,Oh=Ps=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qt=!0),e.firstContext=null)}function _n(e){var t=e._currentValue;if(Oh!==e)if(e={context:e,memoizedValue:t,next:null},Ps===null){if(Ac===null)throw Error(Q(308));Ps=e,Ac.dependencies={lanes:0,firstContext:e}}else Ps=Ps.next=e;return t}var Mi=null;function Ih(e){Mi===null?Mi=[e]:Mi.push(e)}function rw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ih(t)):(n.next=i.next,i.next=n),t.interleaved=n,Tr(e,r)}function Tr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Br=!1;function Lh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function iw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ae&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Tr(e,n)}return i=r.interleaved,i===null?(t.next=t,Ih(r)):(t.next=i.next,i.next=t),r.interleaved=t,Tr(e,n)}function Kl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,kh(e,n)}}function av(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function jc(e,t,n,r){var i=e.updateQueue;Br=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var u=i.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,h=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,x=a;switch(p=t,h=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){u=y.call(h,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,p=typeof y=="function"?y.call(h,u,p):y,p==null)break e;u=Xe({},u,p);break e;case 2:Br=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=u):d=d.next=h,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(d===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);es|=o,e.lanes=o,e.memoizedState=u}}function lv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Q(191,i));i.call(r)}}}var rl={},nr=yi(rl),Aa=yi(rl),ja=yi(rl);function Oi(e){if(e===rl)throw Error(Q(174));return e}function Fh(e,t){switch(Le(ja,t),Le(Aa,e),Le(nr,rl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:vf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=vf(t,e)}ze(nr),Le(nr,t)}function uo(){ze(nr),ze(Aa),ze(ja)}function sw(e){Oi(ja.current);var t=Oi(nr.current),n=vf(t,e.type);t!==n&&(Le(Aa,e),Le(nr,n))}function Bh(e){Aa.current===e&&(ze(nr),ze(Aa))}var Ye=yi(0);function Rc(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 yd=[];function $h(){for(var e=0;e<yd.length;e++)yd[e]._workInProgressVersionPrimary=null;yd.length=0}var Xl=Pr.ReactCurrentDispatcher,xd=Pr.ReactCurrentBatchConfig,Ji=0,Ke=null,ct=null,ht=null,Pc=!1,sa=!1,Ra=0,B_=0;function Ct(){throw Error(Q(321))}function zh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vn(e[n],t[n]))return!1;return!0}function Vh(e,t,n,r,i,s){if(Ji=s,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Xl.current=e===null||e.memoizedState===null?U_:H_,e=n(r,i),sa){s=0;do{if(sa=!1,Ra=0,25<=s)throw Error(Q(301));s+=1,ht=ct=null,t.updateQueue=null,Xl.current=W_,e=n(r,i)}while(sa)}if(Xl.current=Mc,t=ct!==null&&ct.next!==null,Ji=0,ht=ct=Ke=null,Pc=!1,t)throw Error(Q(300));return e}function Uh(){var e=Ra!==0;return Ra=0,e}function Yn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Ke.memoizedState=ht=e:ht=ht.next=e,ht}function Tn(){if(ct===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=ht===null?Ke.memoizedState:ht.next;if(t!==null)ht=t,ct=e;else{if(e===null)throw Error(Q(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},ht===null?Ke.memoizedState=ht=e:ht=ht.next=e}return ht}function Pa(e,t){return typeof t=="function"?t(e):t}function wd(e){var t=Tn(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=ct,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var d=c.lane;if((Ji&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var u={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=u,o=r):l=l.next=u,Ke.lanes|=d,es|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Vn(r,t.memoizedState)||(qt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ke.lanes|=s,es|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function bd(e){var t=Tn(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Vn(s,t.memoizedState)||(qt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function ow(){}function aw(e,t){var n=Ke,r=Tn(),i=t(),s=!Vn(r.memoizedState,i);if(s&&(r.memoizedState=i,qt=!0),r=r.queue,Hh(uw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||ht!==null&&ht.memoizedState.tag&1){if(n.flags|=2048,Ma(9,cw.bind(null,n,r,i,t),void 0,null),mt===null)throw Error(Q(349));Ji&30||lw(n,t,i)}return i}function lw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cw(e,t,n,r){t.value=n,t.getSnapshot=r,dw(t)&&fw(e)}function uw(e,t,n){return n(function(){dw(t)&&fw(e)})}function dw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vn(e,n)}catch{return!0}}function fw(e){var t=Tr(e,1);t!==null&&$n(t,e,1,-1)}function cv(e){var t=Yn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pa,lastRenderedState:e},t.queue=e,e=e.dispatch=V_.bind(null,Ke,e),[t.memoizedState,e]}function Ma(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function pw(){return Tn().memoizedState}function Zl(e,t,n,r){var i=Yn();Ke.flags|=e,i.memoizedState=Ma(1|t,n,void 0,r===void 0?null:r)}function du(e,t,n,r){var i=Tn();r=r===void 0?null:r;var s=void 0;if(ct!==null){var o=ct.memoizedState;if(s=o.destroy,r!==null&&zh(r,o.deps)){i.memoizedState=Ma(t,n,s,r);return}}Ke.flags|=e,i.memoizedState=Ma(1|t,n,s,r)}function uv(e,t){return Zl(8390656,8,e,t)}function Hh(e,t){return du(2048,8,e,t)}function hw(e,t){return du(4,2,e,t)}function mw(e,t){return du(4,4,e,t)}function gw(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vw(e,t,n){return n=n!=null?n.concat([e]):null,du(4,4,gw.bind(null,t,e),n)}function Wh(){}function yw(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xw(e,t){var n=Tn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ww(e,t,n){return Ji&21?(Vn(n,t)||(n=_1(),Ke.lanes|=n,es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qt=!0),e.memoizedState=n)}function $_(e,t){var n=Pe;Pe=n!==0&&4>n?n:4,e(!0);var r=xd.transition;xd.transition={};try{e(!1),t()}finally{Pe=n,xd.transition=r}}function bw(){return Tn().memoizedState}function z_(e,t,n){var r=ai(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},kw(e))Sw(t,n);else if(n=rw(e,t,n,r),n!==null){var i=It();$n(n,e,r,i),Cw(n,t,r)}}function V_(e,t,n){var r=ai(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(kw(e))Sw(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Vn(a,o)){var l=t.interleaved;l===null?(i.next=i,Ih(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=rw(e,t,i,r),n!==null&&(i=It(),$n(n,e,r,i),Cw(n,t,r))}}function kw(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function Sw(e,t){sa=Pc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,kh(e,n)}}var Mc={readContext:_n,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useInsertionEffect:Ct,useLayoutEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useMutableSource:Ct,useSyncExternalStore:Ct,useId:Ct,unstable_isNewReconciler:!1},U_={readContext:_n,useCallback:function(e,t){return Yn().memoizedState=[e,t===void 0?null:t],e},useContext:_n,useEffect:uv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zl(4194308,4,gw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zl(4,2,e,t)},useMemo:function(e,t){var n=Yn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yn();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=z_.bind(null,Ke,e),[r.memoizedState,e]},useRef:function(e){var t=Yn();return e={current:e},t.memoizedState=e},useState:cv,useDebugValue:Wh,useDeferredValue:function(e){return Yn().memoizedState=e},useTransition:function(){var e=cv(!1),t=e[0];return e=$_.bind(null,e[1]),Yn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ke,i=Yn();if(We){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),mt===null)throw Error(Q(349));Ji&30||lw(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,uv(uw.bind(null,r,s,e),[e]),r.flags|=2048,Ma(9,cw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Yn(),t=mt.identifierPrefix;if(We){var n=br,r=wr;n=(r&~(1<<32-Bn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ra++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=B_++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},H_={readContext:_n,useCallback:yw,useContext:_n,useEffect:Hh,useImperativeHandle:vw,useInsertionEffect:hw,useLayoutEffect:mw,useMemo:xw,useReducer:wd,useRef:pw,useState:function(){return wd(Pa)},useDebugValue:Wh,useDeferredValue:function(e){var t=Tn();return ww(t,ct.memoizedState,e)},useTransition:function(){var e=wd(Pa)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:ow,useSyncExternalStore:aw,useId:bw,unstable_isNewReconciler:!1},W_={readContext:_n,useCallback:yw,useContext:_n,useEffect:Hh,useImperativeHandle:vw,useInsertionEffect:hw,useLayoutEffect:mw,useMemo:xw,useReducer:bd,useRef:pw,useState:function(){return bd(Pa)},useDebugValue:Wh,useDeferredValue:function(e){var t=Tn();return ct===null?t.memoizedState=e:ww(t,ct.memoizedState,e)},useTransition:function(){var e=bd(Pa)[0],t=Tn().memoizedState;return[e,t]},useMutableSource:ow,useSyncExternalStore:aw,useId:bw,unstable_isNewReconciler:!1};function Mn(e,t){if(e&&e.defaultProps){t=Xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ff(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fu={isMounted:function(e){return(e=e._reactInternals)?os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=It(),i=ai(e),s=kr(r,i);s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&($n(t,e,i,r),Kl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=It(),i=ai(e),s=kr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&($n(t,e,i,r),Kl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=It(),r=ai(e),i=kr(n,r);i.tag=2,t!=null&&(i.callback=t),t=si(e,i,r),t!==null&&($n(t,e,r,n),Kl(t,e,r))}};function dv(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!Ca(n,r)||!Ca(i,s):!0}function _w(e,t,n){var r=!1,i=fi,s=t.contextType;return typeof s=="object"&&s!==null?s=_n(s):(i=Yt(t)?Xi:Pt.current,r=t.contextTypes,s=(r=r!=null)?ao(e,i):fi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=fu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function fv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&fu.enqueueReplaceState(t,t.state,null)}function Bf(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Lh(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=_n(s):(s=Yt(t)?Xi:Pt.current,i.context=ao(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Ff(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&fu.enqueueReplaceState(i,i.state,null),jc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function fo(e,t){try{var n="",r=t;do n+=x2(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
39
|
Error generating stack: `+s.message+`
|
|
40
|
-
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function bd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Bf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var HT=typeof WeakMap=="function"?WeakMap:Map;function Cw(e,t,n){n=kr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Oc||(Oc=!0,Qf=r),Bf(e,t)},n}function Tw(e,t,n){n=kr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Bf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Bf(e,t),typeof r!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function fv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new HT;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=i_.bind(null,e,t,n),t.then(e,e))}function pv(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 hv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=kr(-1,1),t.tag=2,si(n,t,1))),n.lanes|=1),e)}var WT=Pr.ReactCurrentOwner,qt=!1;function Nt(e,t,n,r){t.child=e===null?ew(t,null,n,r):co(t,e.child,n,r)}function mv(e,t,n,r,i){n=n.render;var s=t.ref;return Hs(t,i),r=zh(e,t,n,r,s,i),n=Vh(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(Ue&&n&&Ah(t),t.flags|=1,Nt(e,t,r,i),t.child)}function gv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Zh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,_w(e,t,s,r,i)):(e=tc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Sa,n(o,r)&&e.ref===t.ref)return Er(e,t,i)}return t.flags|=1,e=li(s,r),e.ref=t.ref,e.return=t,t.child=e}function _w(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Sa(s,r)&&e.ref===t.ref)if(qt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(qt=!0);else return t.lanes=e.lanes,Er(e,t,i)}return $f(e,t,n,r,i)}function Ew(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ie(Os,Jt),Jt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ie(Os,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ie(Os,Jt),Jt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ie(Os,Jt),Jt|=r;return Nt(e,t,i,n),t.child}function jw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $f(e,t,n,r,i){var s=Yt(n)?Xi:Pt.current;return s=ao(t,s),Hs(t,i),n=zh(e,t,n,r,s,i),r=Vh(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(Ue&&r&&Ah(t),t.flags|=1,Nt(e,t,n,i),t.child)}function vv(e,t,n,r,i){if(Yt(n)){var s=!0;Sc(t)}else s=!1;if(Hs(t,i),t.stateNode===null)Zl(e,t),Sw(t,n,r),Ff(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Cn(c):(c=Yt(n)?Xi:Pt.current,c=ao(t,c));var d=n.getDerivedStateFromProps,u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&dv(t,o,r,c),Br=!1;var p=t.memoizedState;o.state=p,jc(t,r,o,i),l=t.memoizedState,a!==r||p!==l||Gt.current||Br?(typeof d=="function"&&(Lf(t,n,d,r),l=t.memoizedState),(a=Br||uv(t,n,a,r,p,l,c))?(u||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=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,nw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Pn(t.type,a),o.props=c,u=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Cn(l):(l=Yt(n)?Xi:Pt.current,l=ao(t,l));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||p!==l)&&dv(t,o,r,l),Br=!1,p=t.memoizedState,o.state=p,jc(t,r,o,i);var y=t.memoizedState;a!==u||p!==y||Gt.current||Br?(typeof m=="function"&&(Lf(t,n,m,r),y=t.memoizedState),(c=Br||uv(t,n,c,r,p,y,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return zf(e,t,n,r,s,i)}function zf(e,t,n,r,i,s){jw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&nv(t,n,!1),Er(e,t,s);r=t.stateNode,WT.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=co(t,e.child,null,s),t.child=co(t,null,a,s)):Nt(e,t,a,s),t.memoizedState=r.state,i&&nv(t,n,!0),t.child}function Aw(e){var t=e.stateNode;t.pendingContext?tv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tv(e,t.context,!1),Lh(e,t.containerInfo)}function yv(e,t,n,r,i){return lo(),Ph(i),t.flags|=256,Nt(e,t,n,r),t.child}var Vf={dehydrated:null,treeContext:null,retryLane:0};function Uf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rw(e,t,n){var r=t.pendingProps,i=qe.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ie(qe,i&1),e===null)return Df(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,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=hu(o,r,0,null),e=Wi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Uf(n),t.memoizedState=Vf,e):Wh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return qT(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=li(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=li(a,s):(s=Wi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Uf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Vf,r}return s=e.child,e=s.sibling,r=li(s,{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 Wh(e,t){return t=hu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function El(e,t,n,r){return r!==null&&Ph(r),co(t,e.child,null,n),e=Wh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qT(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=bd(Error(Y(422))),El(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=hu({mode:"visible",children:r.children},i,0,null),s=Wi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&co(t,e.child,null,o),t.child.memoizedState=Uf(o),t.memoizedState=Vf,s);if(!(t.mode&1))return El(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Y(419)),r=bd(s,r,void 0),El(e,t,o,r)}if(a=(o&e.childLanes)!==0,qt||a){if(r=ht,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,_r(e,i),Bn(r,e,i,-1))}return Xh(),r=bd(Error(Y(421))),El(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=s_.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,tn=ii(i.nextSibling),sn=t,Ue=!0,Dn=null,e!==null&&(yn[xn++]=wr,yn[xn++]=br,yn[xn++]=Zi,wr=e.id,br=e.overflow,Zi=t),t=Wh(t,r.children),t.flags|=4096,t)}function xv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),If(e.return,t,n)}function kd(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Pw(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Nt(e,t,r.children,n),r=qe.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&&xv(e,n,t);else if(e.tag===19)xv(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(Ie(qe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ac(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kd(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ac(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kd(t,!0,n,null,s);break;case"together":kd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Zl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Er(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Y(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function GT(e,t,n){switch(t.tag){case 3:Aw(t),lo();break;case 5:rw(t);break;case 1:Yt(t.type)&&Sc(t);break;case 4:Lh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ie(_c,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ie(qe,qe.current&1),t.flags|=128,null):n&t.child.childLanes?Rw(e,t,n):(Ie(qe,qe.current&1),e=Er(e,t,n),e!==null?e.sibling:null);Ie(qe,qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Pw(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ie(qe,qe.current),r)break;return null;case 22:case 23:return t.lanes=0,Ew(e,t,n)}return Er(e,t,n)}var Mw,Hf,Ow,Nw;Mw=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}};Hf=function(){};Ow=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Oi(nr.current);var s=null;switch(n){case"input":i=ff(e,i),r=ff(e,r),s=[];break;case"select":i=Qe({},i,{value:void 0}),r=Qe({},r,{value:void 0}),s=[];break;case"textarea":i=mf(e,i),r=mf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=bc)}vf(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ga.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ga.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Fe("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Nw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Bo(e,t){if(!Ue)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 Tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function YT(e,t,n){var r=t.pendingProps;switch(Rh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tt(t),null;case 1:return Yt(t.type)&&kc(),Tt(t),null;case 3:return r=t.stateNode,uo(),$e(Gt),$e(Pt),Bh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Tl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dn!==null&&(Zf(Dn),Dn=null))),Hf(e,t),Tt(t),null;case 5:Fh(t);var i=Oi(ja.current);if(n=t.type,e!==null&&t.stateNode!=null)Ow(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Y(166));return Tt(t),null}if(e=Oi(nr.current),Tl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Jn]=t,r[_a]=s,e=(t.mode&1)!==0,n){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(i=0;i<Go.length;i++)Fe(Go[i],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":jg(r,s),Fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Fe("invalid",r);break;case"textarea":Rg(r,s),Fe("invalid",r)}vf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Cl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Cl(r.textContent,a,e),i=["children",""+a]):ga.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Fe("scroll",r)}switch(n){case"input":gl(r),Ag(r,s,!0);break;case"textarea":gl(r),Pg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=bc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=l1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/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[Jn]=t,e[_a]=r,Mw(e,t,!1,!1),t.stateNode=e;e:{switch(o=yf(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),i=r;break;case"iframe":case"object":case"embed":Fe("load",e),i=r;break;case"video":case"audio":for(i=0;i<Go.length;i++)Fe(Go[i],e);i=r;break;case"source":Fe("error",e),i=r;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),i=r;break;case"details":Fe("toggle",e),i=r;break;case"input":jg(e,r),i=ff(e,r),Fe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Qe({},r,{value:void 0}),Fe("invalid",e);break;case"textarea":Rg(e,r),i=mf(e,r),Fe("invalid",e);break;default:i=r}vf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?d1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&c1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&va(e,l):typeof l=="number"&&va(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ga.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Fe("scroll",e):l!=null&&mh(e,s,l,o))}switch(n){case"input":gl(e),Ag(e,r,!1);break;case"textarea":gl(e),Pg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+di(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?$s(e,!!r.multiple,s,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=bc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Tt(t),null;case 6:if(e&&t.stateNode!=null)Nw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Y(166));if(n=Oi(ja.current),Oi(nr.current),Tl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Jn]=t,(s=r.nodeValue!==n)&&(e=sn,e!==null))switch(e.tag){case 3:Cl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Cl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Jn]=t,t.stateNode=r}return Tt(t),null;case 13:if($e(qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ue&&tn!==null&&t.mode&1&&!(t.flags&128))Z1(),lo(),t.flags|=98560,s=!1;else if(s=Tl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(Y(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Y(317));s[Jn]=t}else lo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tt(t),s=!1}else Dn!==null&&(Zf(Dn),Dn=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||qe.current&1?ut===0&&(ut=3):Xh())),t.updateQueue!==null&&(t.flags|=4),Tt(t),null);case 4:return uo(),Hf(e,t),e===null&&Ca(t.stateNode.containerInfo),Tt(t),null;case 10:return Nh(t.type._context),Tt(t),null;case 17:return Yt(t.type)&&kc(),Tt(t),null;case 19:if($e(qe),s=t.memoizedState,s===null)return Tt(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Bo(s,!1);else{if(ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ac(e),o!==null){for(t.flags|=128,Bo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ie(qe,qe.current&1|2),t.child}e=e.sibling}s.tail!==null&&nt()>po&&(t.flags|=128,r=!0,Bo(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ac(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ue)return Tt(t),null}else 2*nt()-s.renderingStartTime>po&&n!==1073741824&&(t.flags|=128,r=!0,Bo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=nt(),t.sibling=null,n=qe.current,Ie(qe,r?n&1|2:n&1),t):(Tt(t),null);case 22:case 23:return Kh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jt&1073741824&&(Tt(t),t.subtreeFlags&6&&(t.flags|=8192)):Tt(t),null;case 24:return null;case 25:return null}throw Error(Y(156,t.tag))}function QT(e,t){switch(Rh(t),t.tag){case 1:return Yt(t.type)&&kc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),$e(Gt),$e(Pt),Bh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Fh(t),null;case 13:if($e(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Y(340));lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $e(qe),null;case 4:return uo(),null;case 10:return Nh(t.type._context),null;case 22:case 23:return Kh(),null;case 24:return null;default:return null}}var jl=!1,jt=!1,KT=typeof WeakSet=="function"?WeakSet:Set,ce=null;function Ms(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ze(e,t,r)}else n.current=null}function Wf(e,t,n){try{n()}catch(r){Ze(e,t,r)}}var wv=!1;function XT(e,t){if(jf=yc,e=B1(),jh(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 i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,u=e,p=null;t:for(;;){for(var m;u!==n||i!==0&&u.nodeType!==3||(a=o+i),u!==s||r!==0&&u.nodeType!==3||(l=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(m=u.firstChild)!==null;)p=u,u=m;for(;;){if(u===e)break t;if(p===n&&++c===i&&(a=o),p===s&&++d===r&&(l=o),(m=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Af={focusedElem:e,selectionRange:n},yc=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var w=y.memoizedProps,x=y.memoizedState,h=t.stateNode,g=h.getSnapshotBeforeUpdate(t.elementType===t.type?w:Pn(t.type,w),x);h.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var k=t.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Y(163))}}catch(C){Ze(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return y=wv,wv=!1,y}function sa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Wf(t,n,s)}i=i.next}while(i!==r)}}function fu(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 qf(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 Dw(e){var t=e.alternate;t!==null&&(e.alternate=null,Dw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Jn],delete t[_a],delete t[Mf],delete t[OT],delete t[NT])),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 Iw(e){return e.tag===5||e.tag===3||e.tag===4}function bv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Iw(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 Gf(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=bc));else if(r!==4&&(e=e.child,e!==null))for(Gf(e,t,n),e=e.sibling;e!==null;)Gf(e,t,n),e=e.sibling}function Yf(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(Yf(e,t,n),e=e.sibling;e!==null;)Yf(e,t,n),e=e.sibling}var xt=null,On=!1;function Dr(e,t,n){for(n=n.child;n!==null;)Lw(e,t,n),n=n.sibling}function Lw(e,t,n){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(iu,n)}catch{}switch(n.tag){case 5:jt||Ms(n,t);case 6:var r=xt,i=On;xt=null,Dr(e,t,n),xt=r,On=i,xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(On?(e=xt,n=n.stateNode,e.nodeType===8?md(e.parentNode,n):e.nodeType===1&&md(e,n),ba(e)):md(xt,n.stateNode));break;case 4:r=xt,i=On,xt=n.stateNode.containerInfo,On=!0,Dr(e,t,n),xt=r,On=i;break;case 0:case 11:case 14:case 15:if(!jt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Wf(n,t,o),i=i.next}while(i!==r)}Dr(e,t,n);break;case 1:if(!jt&&(Ms(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ze(n,t,a)}Dr(e,t,n);break;case 21:Dr(e,t,n);break;case 22:n.mode&1?(jt=(r=jt)||n.memoizedState!==null,Dr(e,t,n),jt=r):Dr(e,t,n);break;default:Dr(e,t,n)}}function kv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new KT),t.forEach(function(r){var i=o_.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:xt=a.stateNode,On=!1;break e;case 3:xt=a.stateNode.containerInfo,On=!0;break e;case 4:xt=a.stateNode.containerInfo,On=!0;break e}a=a.return}if(xt===null)throw Error(Y(160));Lw(s,o,i),xt=null,On=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Ze(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Fw(t,e),t=t.sibling}function Fw(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(t,e),Hn(e),r&4){try{sa(3,e,e.return),fu(3,e)}catch(w){Ze(e,e.return,w)}try{sa(5,e,e.return)}catch(w){Ze(e,e.return,w)}}break;case 1:jn(t,e),Hn(e),r&512&&n!==null&&Ms(n,n.return);break;case 5:if(jn(t,e),Hn(e),r&512&&n!==null&&Ms(n,n.return),e.flags&32){var i=e.stateNode;try{va(i,"")}catch(w){Ze(e,e.return,w)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&o1(i,s),yf(a,o);var c=yf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?d1(i,u):d==="dangerouslySetInnerHTML"?c1(i,u):d==="children"?va(i,u):mh(i,d,u,c)}switch(a){case"input":pf(i,s);break;case"textarea":a1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?$s(i,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?$s(i,!!s.multiple,s.defaultValue,!0):$s(i,!!s.multiple,s.multiple?[]:"",!1))}i[_a]=s}catch(w){Ze(e,e.return,w)}}break;case 6:if(jn(t,e),Hn(e),r&4){if(e.stateNode===null)throw Error(Y(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(w){Ze(e,e.return,w)}}break;case 3:if(jn(t,e),Hn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ba(t.containerInfo)}catch(w){Ze(e,e.return,w)}break;case 4:jn(t,e),Hn(e);break;case 13:jn(t,e),Hn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Yh=nt())),r&4&&kv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(jt=(c=jt)||d,jn(t,e),jt=c):jn(t,e),Hn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(ce=e,d=e.child;d!==null;){for(u=ce=d;ce!==null;){switch(p=ce,m=p.child,p.tag){case 0:case 11:case 14:case 15:sa(4,p,p.return);break;case 1:Ms(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(w){Ze(r,n,w)}}break;case 5:Ms(p,p.return);break;case 22:if(p.memoizedState!==null){Cv(u);continue}}m!==null?(m.return=p,ce=m):Cv(u)}d=d.sibling}e:for(d=null,u=e;;){if(u.tag===5){if(d===null){d=u;try{i=u.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=u.stateNode,l=u.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=u1("display",o))}catch(w){Ze(e,e.return,w)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(w){Ze(e,e.return,w)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;d===u&&(d=null),u=u.return}d===u&&(d=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:jn(t,e),Hn(e),r&4&&kv(e);break;case 21:break;default:jn(t,e),Hn(e)}}function Hn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Iw(n)){var r=n;break e}n=n.return}throw Error(Y(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(va(i,""),r.flags&=-33);var s=bv(e);Yf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=bv(e);Gf(e,a,o);break;default:throw Error(Y(161))}}catch(l){Ze(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ZT(e,t,n){ce=e,Bw(e)}function Bw(e,t,n){for(var r=(e.mode&1)!==0;ce!==null;){var i=ce,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||jl;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||jt;a=jl;var c=jt;if(jl=o,(jt=l)&&!c)for(ce=i;ce!==null;)o=ce,l=o.child,o.tag===22&&o.memoizedState!==null?Tv(i):l!==null?(l.return=o,ce=l):Tv(i);for(;s!==null;)ce=s,Bw(s),s=s.sibling;ce=i,jl=a,jt=c}Sv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,ce=s):Sv(e)}}function Sv(e){for(;ce!==null;){var t=ce;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:jt||fu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!jt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Pn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&av(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}av(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var u=d.dehydrated;u!==null&&ba(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Y(163))}jt||t.flags&512&&qf(t)}catch(p){Ze(t,t.return,p)}}if(t===e){ce=null;break}if(n=t.sibling,n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Cv(e){for(;ce!==null;){var t=ce;if(t===e){ce=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Tv(e){for(;ce!==null;){var t=ce;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fu(4,t)}catch(l){Ze(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Ze(t,i,l)}}var s=t.return;try{qf(t)}catch(l){Ze(t,s,l)}break;case 5:var o=t.return;try{qf(t)}catch(l){Ze(t,o,l)}}}catch(l){Ze(t,t.return,l)}if(t===e){ce=null;break}var a=t.sibling;if(a!==null){a.return=t.return,ce=a;break}ce=t.return}}var JT=Math.ceil,Mc=Pr.ReactCurrentDispatcher,qh=Pr.ReactCurrentOwner,kn=Pr.ReactCurrentBatchConfig,je=0,ht=null,it=null,bt=0,Jt=0,Os=yi(0),ut=0,Ma=null,es=0,pu=0,Gh=0,oa=null,Ht=null,Yh=0,po=1/0,gr=null,Oc=!1,Qf=null,oi=null,Al=!1,Jr=null,Nc=0,aa=0,Kf=null,Jl=-1,ec=0;function It(){return je&6?nt():Jl!==-1?Jl:Jl=nt()}function ai(e){return e.mode&1?je&2&&bt!==0?bt&-bt:IT.transition!==null?(ec===0&&(ec=S1()),ec):(e=Re,e!==0||(e=window.event,e=e===void 0?16:R1(e.type)),e):1}function Bn(e,t,n,r){if(50<aa)throw aa=0,Kf=null,Error(Y(185));Ja(e,n,r),(!(je&2)||e!==ht)&&(e===ht&&(!(je&2)&&(pu|=n),ut===4&&Vr(e,bt)),Qt(e,r),n===1&&je===0&&!(t.mode&1)&&(po=nt()+500,cu&&xi()))}function Qt(e,t){var n=e.callbackNode;I2(e,t);var r=vc(e,e===ht?bt:0);if(r===0)n!==null&&Ng(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ng(n),t===1)e.tag===0?DT(_v.bind(null,e)):Q1(_v.bind(null,e)),PT(function(){!(je&6)&&xi()}),n=null;else{switch(C1(r)){case 1:n=wh;break;case 4:n=b1;break;case 16:n=gc;break;case 536870912:n=k1;break;default:n=gc}n=Gw(n,$w.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $w(e,t){if(Jl=-1,ec=0,je&6)throw Error(Y(327));var n=e.callbackNode;if(Ws()&&e.callbackNode!==n)return null;var r=vc(e,e===ht?bt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Dc(e,r);else{t=r;var i=je;je|=2;var s=Vw();(ht!==e||bt!==t)&&(gr=null,po=nt()+500,Hi(e,t));do try{n_();break}catch(a){zw(e,a)}while(!0);Oh(),Mc.current=s,je=i,it!==null?t=0:(ht=null,bt=0,t=ut)}if(t!==0){if(t===2&&(i=Sf(e),i!==0&&(r=i,t=Xf(e,i))),t===1)throw n=Ma,Hi(e,0),Vr(e,r),Qt(e,nt()),n;if(t===6)Vr(e,r);else{if(i=e.current.alternate,!(r&30)&&!e_(i)&&(t=Dc(e,r),t===2&&(s=Sf(e),s!==0&&(r=s,t=Xf(e,s))),t===1))throw n=Ma,Hi(e,0),Vr(e,r),Qt(e,nt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Y(345));case 2:Ei(e,Ht,gr);break;case 3:if(Vr(e,r),(r&130023424)===r&&(t=Yh+500-nt(),10<t)){if(vc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){It(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Pf(Ei.bind(null,e,Ht,gr),t);break}Ei(e,Ht,gr);break;case 4:if(Vr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Fn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*JT(r/1960))-r,10<r){e.timeoutHandle=Pf(Ei.bind(null,e,Ht,gr),r);break}Ei(e,Ht,gr);break;case 5:Ei(e,Ht,gr);break;default:throw Error(Y(329))}}}return Qt(e,nt()),e.callbackNode===n?$w.bind(null,e):null}function Xf(e,t){var n=oa;return e.current.memoizedState.isDehydrated&&(Hi(e,t).flags|=256),e=Dc(e,t),e!==2&&(t=Ht,Ht=n,t!==null&&Zf(t)),e}function Zf(e){Ht===null?Ht=e:Ht.push.apply(Ht,e)}function e_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!zn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vr(e,t){for(t&=~Gh,t&=~pu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fn(t),r=1<<n;e[n]=-1,t&=~r}}function _v(e){if(je&6)throw Error(Y(327));Ws();var t=vc(e,0);if(!(t&1))return Qt(e,nt()),null;var n=Dc(e,t);if(e.tag!==0&&n===2){var r=Sf(e);r!==0&&(t=r,n=Xf(e,r))}if(n===1)throw n=Ma,Hi(e,0),Vr(e,t),Qt(e,nt()),n;if(n===6)throw Error(Y(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ei(e,Ht,gr),Qt(e,nt()),null}function Qh(e,t){var n=je;je|=1;try{return e(t)}finally{je=n,je===0&&(po=nt()+500,cu&&xi())}}function ts(e){Jr!==null&&Jr.tag===0&&!(je&6)&&Ws();var t=je;je|=1;var n=kn.transition,r=Re;try{if(kn.transition=null,Re=1,e)return e()}finally{Re=r,kn.transition=n,je=t,!(je&6)&&xi()}}function Kh(){Jt=Os.current,$e(Os)}function Hi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,RT(n)),it!==null)for(n=it.return;n!==null;){var r=n;switch(Rh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&kc();break;case 3:uo(),$e(Gt),$e(Pt),Bh();break;case 5:Fh(r);break;case 4:uo();break;case 13:$e(qe);break;case 19:$e(qe);break;case 10:Nh(r.type._context);break;case 22:case 23:Kh()}n=n.return}if(ht=e,it=e=li(e.current,null),bt=Jt=t,ut=0,Ma=null,Gh=pu=es=0,Ht=oa=null,Mi!==null){for(t=0;t<Mi.length;t++)if(n=Mi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Mi=null}return e}function zw(e,t){do{var n=it;try{if(Oh(),Kl.current=Pc,Rc){for(var r=Ye.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Rc=!1}if(Ji=0,pt=lt=Ye=null,ia=!1,Aa=0,qh.current=null,n===null||n.return===null){ut=1,Ma=t,it=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=bt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,u=d.tag;if(!(d.mode&1)&&(u===0||u===11||u===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=pv(o);if(m!==null){m.flags&=-257,hv(m,o,a,s,t),m.mode&1&&fv(s,c,t),t=m,l=c;var y=t.updateQueue;if(y===null){var w=new Set;w.add(l),t.updateQueue=w}else y.add(l);break e}else{if(!(t&1)){fv(s,c,t),Xh();break e}l=Error(Y(426))}}else if(Ue&&a.mode&1){var x=pv(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),hv(x,o,a,s,t),Ph(fo(l,a));break e}}s=l=fo(l,a),ut!==4&&(ut=2),oa===null?oa=[s]:oa.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var h=Cw(s,l,t);ov(s,h);break e;case 1:a=l;var g=s.type,k=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(oi===null||!oi.has(k)))){s.flags|=65536,t&=-t,s.lanes|=t;var C=Tw(s,a,t);ov(s,C);break e}}s=s.return}while(s!==null)}Hw(n)}catch(S){t=S,it===n&&n!==null&&(it=n=n.return);continue}break}while(!0)}function Vw(){var e=Mc.current;return Mc.current=Pc,e===null?Pc:e}function Xh(){(ut===0||ut===3||ut===2)&&(ut=4),ht===null||!(es&268435455)&&!(pu&268435455)||Vr(ht,bt)}function Dc(e,t){var n=je;je|=2;var r=Vw();(ht!==e||bt!==t)&&(gr=null,Hi(e,t));do try{t_();break}catch(i){zw(e,i)}while(!0);if(Oh(),je=n,Mc.current=r,it!==null)throw Error(Y(261));return ht=null,bt=0,ut}function t_(){for(;it!==null;)Uw(it)}function n_(){for(;it!==null&&!E2();)Uw(it)}function Uw(e){var t=qw(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?Hw(e):it=t,qh.current=null}function Hw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=QT(n,t),n!==null){n.flags&=32767,it=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,it=null;return}}else if(n=YT(n,t,Jt),n!==null){it=n;return}if(t=t.sibling,t!==null){it=t;return}it=t=e}while(t!==null);ut===0&&(ut=5)}function Ei(e,t,n){var r=Re,i=kn.transition;try{kn.transition=null,Re=1,r_(e,t,n,r)}finally{kn.transition=i,Re=r}return null}function r_(e,t,n,r){do Ws();while(Jr!==null);if(je&6)throw Error(Y(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Y(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(L2(e,s),e===ht&&(it=ht=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Al||(Al=!0,Gw(gc,function(){return Ws(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=kn.transition,kn.transition=null;var o=Re;Re=1;var a=je;je|=4,qh.current=null,XT(e,n),Fw(n,e),ST(Af),yc=!!jf,Af=jf=null,e.current=n,ZT(n),j2(),je=a,Re=o,kn.transition=s}else e.current=n;if(Al&&(Al=!1,Jr=e,Nc=i),s=e.pendingLanes,s===0&&(oi=null),P2(n.stateNode),Qt(e,nt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Oc)throw Oc=!1,e=Qf,Qf=null,e;return Nc&1&&e.tag!==0&&Ws(),s=e.pendingLanes,s&1?e===Kf?aa++:(aa=0,Kf=e):aa=0,xi(),null}function Ws(){if(Jr!==null){var e=C1(Nc),t=kn.transition,n=Re;try{if(kn.transition=null,Re=16>e?16:e,Jr===null)var r=!1;else{if(e=Jr,Jr=null,Nc=0,je&6)throw Error(Y(331));var i=je;for(je|=4,ce=e.current;ce!==null;){var s=ce,o=s.child;if(ce.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(ce=c;ce!==null;){var d=ce;switch(d.tag){case 0:case 11:case 15:sa(8,d,s)}var u=d.child;if(u!==null)u.return=d,ce=u;else for(;ce!==null;){d=ce;var p=d.sibling,m=d.return;if(Dw(d),d===c){ce=null;break}if(p!==null){p.return=m,ce=p;break}ce=m}}}var y=s.alternate;if(y!==null){var w=y.child;if(w!==null){y.child=null;do{var x=w.sibling;w.sibling=null,w=x}while(w!==null)}}ce=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,ce=o;else e:for(;ce!==null;){if(s=ce,s.flags&2048)switch(s.tag){case 0:case 11:case 15:sa(9,s,s.return)}var h=s.sibling;if(h!==null){h.return=s.return,ce=h;break e}ce=s.return}}var g=e.current;for(ce=g;ce!==null;){o=ce;var k=o.child;if(o.subtreeFlags&2064&&k!==null)k.return=o,ce=k;else e:for(o=g;ce!==null;){if(a=ce,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:fu(9,a)}}catch(S){Ze(a,a.return,S)}if(a===o){ce=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,ce=C;break e}ce=a.return}}if(je=i,xi(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(iu,e)}catch{}r=!0}return r}finally{Re=n,kn.transition=t}}return!1}function Ev(e,t,n){t=fo(n,t),t=Cw(e,t,1),e=si(e,t,1),t=It(),e!==null&&(Ja(e,1,t),Qt(e,t))}function Ze(e,t,n){if(e.tag===3)Ev(e,e,n);else for(;t!==null;){if(t.tag===3){Ev(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(oi===null||!oi.has(r))){e=fo(n,e),e=Tw(t,e,1),t=si(t,e,1),e=It(),t!==null&&(Ja(t,1,e),Qt(t,e));break}}t=t.return}}function i_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=It(),e.pingedLanes|=e.suspendedLanes&n,ht===e&&(bt&n)===n&&(ut===4||ut===3&&(bt&130023424)===bt&&500>nt()-Yh?Hi(e,0):Gh|=n),Qt(e,t)}function Ww(e,t){t===0&&(e.mode&1?(t=xl,xl<<=1,!(xl&130023424)&&(xl=4194304)):t=1);var n=It();e=_r(e,t),e!==null&&(Ja(e,t,n),Qt(e,n))}function s_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ww(e,n)}function o_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Y(314))}r!==null&&r.delete(t),Ww(e,n)}var qw;qw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gt.current)qt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qt=!1,GT(e,t,n);qt=!!(e.flags&131072)}else qt=!1,Ue&&t.flags&1048576&&K1(t,Tc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Zl(e,t),e=t.pendingProps;var i=ao(t,Pt.current);Hs(t,n),i=zh(null,t,r,e,i,n);var s=Vh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yt(r)?(s=!0,Sc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ih(t),i.updater=du,t.stateNode=i,i._reactInternals=t,Ff(t,r,e,n),t=zf(null,t,r,!0,s,n)):(t.tag=0,Ue&&s&&Ah(t),Nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Zl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=l_(r),e=Pn(r,e),i){case 0:t=$f(null,t,r,e,n);break e;case 1:t=vv(null,t,r,e,n);break e;case 11:t=mv(null,t,r,e,n);break e;case 14:t=gv(null,t,r,Pn(r.type,e),n);break e}throw Error(Y(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),$f(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),vv(e,t,r,i,n);case 3:e:{if(Aw(t),e===null)throw Error(Y(387));r=t.pendingProps,s=t.memoizedState,i=s.element,nw(e,t),jc(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=fo(Error(Y(423)),t),t=yv(e,t,r,n,i);break e}else if(r!==i){i=fo(Error(Y(424)),t),t=yv(e,t,r,n,i);break e}else for(tn=ii(t.stateNode.containerInfo.firstChild),sn=t,Ue=!0,Dn=null,n=ew(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lo(),r===i){t=Er(e,t,n);break e}Nt(e,t,r,n)}t=t.child}return t;case 5:return rw(t),e===null&&Df(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Rf(r,i)?o=null:s!==null&&Rf(r,s)&&(t.flags|=32),jw(e,t),Nt(e,t,o,n),t.child;case 6:return e===null&&Df(t),null;case 13:return Rw(e,t,n);case 4:return Lh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),mv(e,t,r,i,n);case 7:return Nt(e,t,t.pendingProps,n),t.child;case 8:return Nt(e,t,t.pendingProps.children,n),t.child;case 12:return Nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Ie(_c,r._currentValue),r._currentValue=o,s!==null)if(zn(s.value,o)){if(s.children===i.children&&!Gt.current){t=Er(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=kr(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),If(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Y(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),If(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hs(t,n),i=Cn(i),r=r(i),t.flags|=1,Nt(e,t,r,n),t.child;case 14:return r=t.type,i=Pn(r,t.pendingProps),i=Pn(r.type,i),gv(e,t,r,i,n);case 15:return _w(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Pn(r,i),Zl(e,t),t.tag=1,Yt(r)?(e=!0,Sc(t)):e=!1,Hs(t,n),Sw(t,r,i),Ff(t,r,i,n),zf(null,t,r,!0,e,n);case 19:return Pw(e,t,n);case 22:return Ew(e,t,n)}throw Error(Y(156,t.tag))};function Gw(e,t){return w1(e,t)}function a_(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 bn(e,t,n,r){return new a_(e,t,n,r)}function Zh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function l_(e){if(typeof e=="function")return Zh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vh)return 11;if(e===yh)return 14}return 2}function li(e,t){var n=e.alternate;return n===null?(n=bn(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 tc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Zh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return Wi(n.children,i,s,t);case gh:o=8,i|=8;break;case lf:return e=bn(12,n,t,i|2),e.elementType=lf,e.lanes=s,e;case cf:return e=bn(13,n,t,i),e.elementType=cf,e.lanes=s,e;case uf:return e=bn(19,n,t,i),e.elementType=uf,e.lanes=s,e;case r1:return hu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case t1:o=10;break e;case n1:o=9;break e;case vh:o=11;break e;case yh:o=14;break e;case Fr:o=16,r=null;break e}throw Error(Y(130,e==null?e:typeof e,""))}return t=bn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Wi(e,t,n,r){return e=bn(7,e,r,t),e.lanes=n,e}function hu(e,t,n,r){return e=bn(22,e,r,t),e.elementType=r1,e.lanes=n,e.stateNode={isHidden:!1},e}function Sd(e,t,n){return e=bn(6,e,null,t),e.lanes=n,e}function Cd(e,t,n){return t=bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function c_(e,t,n,r,i){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=id(0),this.expirationTimes=id(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=id(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Jh(e,t,n,r,i,s,o,a,l){return e=new c_(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=bn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ih(s),e}function u_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Yw(e){if(!e)return fi;e=e._reactInternals;e:{if(os(e)!==e||e.tag!==1)throw Error(Y(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Y(171))}if(e.tag===1){var n=e.type;if(Yt(n))return Y1(e,n,t)}return t}function Qw(e,t,n,r,i,s,o,a,l){return e=Jh(n,r,!0,e,i,s,o,a,l),e.context=Yw(null),n=e.current,r=It(),i=ai(n),s=kr(r,i),s.callback=t??null,si(n,s,i),e.current.lanes=i,Ja(e,i,r),Qt(e,r),e}function mu(e,t,n,r){var i=t.current,s=It(),o=ai(i);return n=Yw(n),t.context===null?t.context=n:t.pendingContext=n,t=kr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=si(i,t,o),e!==null&&(Bn(e,i,o,s),Ql(e,i,o)),o}function Ic(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function jv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function em(e,t){jv(e,t),(e=e.alternate)&&jv(e,t)}function d_(){return null}var Kw=typeof reportError=="function"?reportError:function(e){console.error(e)};function tm(e){this._internalRoot=e}gu.prototype.render=tm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Y(409));mu(e,t,null,null)};gu.prototype.unmount=tm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){mu(null,e,null,null)}),t[Tr]=null}};function gu(e){this._internalRoot=e}gu.prototype.unstable_scheduleHydration=function(e){if(e){var t=E1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zr.length&&t!==0&&t<zr[n].priority;n++);zr.splice(n,0,e),n===0&&A1(e)}};function nm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Av(){}function f_(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Ic(o);s.call(c)}}var o=Qw(t,r,e,0,null,!1,!1,"",Av);return e._reactRootContainer=o,e[Tr]=o.current,Ca(e.nodeType===8?e.parentNode:e),ts(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Ic(l);a.call(c)}}var l=Jh(e,0,!1,null,null,!1,!1,"",Av);return e._reactRootContainer=l,e[Tr]=l.current,Ca(e.nodeType===8?e.parentNode:e),ts(function(){mu(t,l,n,r)}),l}function yu(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Ic(o);a.call(l)}}mu(t,o,e,i)}else o=f_(n,t,e,i,r);return Ic(o)}T1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=qo(t.pendingLanes);n!==0&&(bh(t,n|1),Qt(t,nt()),!(je&6)&&(po=nt()+500,xi()))}break;case 13:ts(function(){var r=_r(e,1);if(r!==null){var i=It();Bn(r,e,1,i)}}),em(e,1)}};kh=function(e){if(e.tag===13){var t=_r(e,134217728);if(t!==null){var n=It();Bn(t,e,134217728,n)}em(e,134217728)}};_1=function(e){if(e.tag===13){var t=ai(e),n=_r(e,t);if(n!==null){var r=It();Bn(n,e,t,r)}em(e,t)}};E1=function(){return Re};j1=function(e,t){var n=Re;try{return Re=e,t()}finally{Re=n}};wf=function(e,t,n){switch(t){case"input":if(pf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=lu(r);if(!i)throw Error(Y(90));s1(r),pf(r,i)}}}break;case"textarea":a1(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};h1=Qh;m1=ts;var p_={usingClientEntryPoint:!1,Events:[tl,Es,lu,f1,p1,Qh]},$o={findFiberByHostInstance:Pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},h_={bundleType:$o.bundleType,version:$o.version,rendererPackageName:$o.rendererPackageName,rendererConfig:$o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Pr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=y1(e),e===null?null:e.stateNode},findFiberByHostInstance:$o.findFiberByHostInstance||d_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rl.isDisabled&&Rl.supportsFiber)try{iu=Rl.inject(h_),tr=Rl}catch{}}an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p_;an.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nm(t))throw Error(Y(200));return u_(e,t,null,n)};an.createRoot=function(e,t){if(!nm(e))throw Error(Y(299));var n=!1,r="",i=Kw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Jh(e,1,!1,null,null,n,!1,r,i),e[Tr]=t.current,Ca(e.nodeType===8?e.parentNode:e),new tm(t)};an.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Y(188)):(e=Object.keys(e).join(","),Error(Y(268,e)));return e=y1(t),e=e===null?null:e.stateNode,e};an.flushSync=function(e){return ts(e)};an.hydrate=function(e,t,n){if(!vu(t))throw Error(Y(200));return yu(null,e,t,!0,n)};an.hydrateRoot=function(e,t,n){if(!nm(e))throw Error(Y(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Kw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Qw(t,null,e,1,n??null,i,!1,s,o),e[Tr]=t.current,Ca(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new gu(t)};an.render=function(e,t,n){if(!vu(t))throw Error(Y(200));return yu(null,e,t,!1,n)};an.unmountComponentAtNode=function(e){if(!vu(e))throw Error(Y(40));return e._reactRootContainer?(ts(function(){yu(null,null,e,!1,function(){e._reactRootContainer=null,e[Tr]=null})}),!0):!1};an.unstable_batchedUpdates=Qh;an.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vu(n))throw Error(Y(200));if(e==null||e._reactInternals===void 0)throw Error(Y(38));return yu(e,t,n,!1,r)};an.version="18.3.1-next-f1338f8080-20240426";function Xw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xw)}catch(e){console.error(e)}}Xw(),Xx.exports=an;var Zw=Xx.exports;const m_=Rr(Zw);var Jw,Rv=Zw;Jw=Rv.createRoot,Rv.hydrateRoot;const g_="@alfatech/livechat",v_="v2026.04.02.1",y_="module",x_="https://api.chatier.app",w_="wss://api.chatier.app",b_=["dist","README.md","component/chatier.js"],k_="dist/widget.js",S_={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},C_={dev:"vite",dev2:"vite --config vite.config.2.ts",build:"tsc -b && vite build",lint:"biome lint --write",prepare:"husky",format:"biome format --write && yarn lint",preview:"vite preview","build:mobile":"tsc -b && vite build --config vite.config.app.ts && mv dist-app/index-app.html dist-app/index.html","preview:mobile":"vite preview --config vite.config.app.ts --outDir dist-app","dev:mobile":"vite --config vite.config.app.ts"},T_={"@headlessui/react":"^2.2.2","@tailwindcss/vite":"^4.1.4","@tanstack/react-query":"^5.59.20",classnames:"^2.5.1",dayjs:"^1.11.13",formik:"^2.4.6","framer-motion":"^12.7.4","lucide-react":"^0.511.0",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.8","react-router-dom":"^6.26.2","socket.io-client":"^4.8.1",sonner:"^2.0.1",yup:"^1.4.0",zustand:"^4.5.5"},__={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},eb={name:g_,private:!1,version:v_,type:y_,apiURL:x_,wsURL:w_,files:b_,main:k_,author:S_,scripts:C_,dependencies:T_,devDependencies:__,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},tb=eb.apiURL,E_=eb.wsURL,j_=e=>[{limit:Number.parseInt(e.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(e.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(e.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(e.headers.get("Retry-After")||"0")},429],A_=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],R_={429:j_,404:A_};async function Mr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${tb}/${e}`,{...t,credentials:"include",headers:{...t.headers,...n}}).catch(s=>new Response(null,{status:500}));if(!r.ok){let s={};try{return s=await r.json(),[s,r.status]}catch{}const o=R_[r.status];return o?o(r,s):[{},r.status]}const i=r.headers.get("Content-Type");return i&&i.includes("application/json")?[await r.json(),r.status]:[await r.text(),r.status]}const $n=e=>[200,201,204].includes(e),P_=(e,{arrayWithBrackets:t=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(e)){if(Array.isArray(s)){for(const o in s)t?r.append(`${i}[]`,s[o]):n?r.append(`${i}[${o}]`,s[o]):r.append(i,s[o]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var To=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ns=typeof window>"u"||"Deno"in globalThis;function vn(){}function M_(e,t){return typeof e=="function"?e(t):e}function Jf(e){return typeof e=="number"&&e>=0&&e!==1/0}function nb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qs(e,t){return typeof e=="function"?e(t):e}function In(e,t){return typeof e=="function"?e(t):e}function Pv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==rm(o,t.options))return!1}else if(!Oa(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Mv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(rs(t.options.mutationKey)!==rs(s))return!1}else if(!Oa(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function rm(e,t){return((t==null?void 0:t.queryKeyHashFn)||rs)(e)}function rs(e){return JSON.stringify(e,(t,n)=>ep(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Oa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Oa(e[n],t[n])):!1}function rb(e,t){if(e===t)return e;const n=Ov(e)&&Ov(t);if(n||ep(e)&&ep(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let c=0;c<o;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=rb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Lc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ov(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ep(e){if(!Nv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Nv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Nv(e){return Object.prototype.toString.call(e)==="[object Object]"}function O_(e){return new Promise(t=>{setTimeout(t,e)})}function tp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?rb(e,t):t}function N_(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function D_(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var im=Symbol();function ib(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===im?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Li,Ur,Gs,Rx,I_=(Rx=class extends To{constructor(){super();pe(this,Li);pe(this,Ur);pe(this,Gs);le(this,Gs,t=>{if(!ns&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Ur)||this.setEventListener(_(this,Gs))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Ur))==null||t.call(this),le(this,Ur,void 0))}setEventListener(t){var n;le(this,Gs,t),(n=_(this,Ur))==null||n.call(this),le(this,Ur,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,Li)!==t&&(le(this,Li,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,Li)=="boolean"?_(this,Li):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Li=new WeakMap,Ur=new WeakMap,Gs=new WeakMap,Rx),sm=new I_,Ys,Hr,Qs,Px,L_=(Px=class extends To{constructor(){super();pe(this,Ys,!0);pe(this,Hr);pe(this,Qs);le(this,Qs,t=>{if(!ns&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,Hr)||this.setEventListener(_(this,Qs))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Hr))==null||t.call(this),le(this,Hr,void 0))}setEventListener(t){var n;le(this,Qs,t),(n=_(this,Hr))==null||n.call(this),le(this,Hr,t(this.setOnline.bind(this)))}setOnline(t){_(this,Ys)!==t&&(le(this,Ys,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,Ys)}},Ys=new WeakMap,Hr=new WeakMap,Qs=new WeakMap,Px),Fc=new L_;function np(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function F_(e){return Math.min(1e3*2**e,3e4)}function sb(e){return(e??"online")==="online"?Fc.isOnline():!0}var ob=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Td(e){return e instanceof ob}function ab(e){let t=!1,n=0,r=!1,i;const s=np(),o=w=>{var x;r||(p(new ob(w)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>sm.isFocused()&&(e.networkMode==="always"||Fc.isOnline())&&e.canRun(),d=()=>sb(e.networkMode)&&e.canRun(),u=w=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,w),i==null||i(),s.resolve(w))},p=w=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,w),i==null||i(),s.reject(w))},m=()=>new Promise(w=>{var x;i=h=>{(r||c())&&w(h)},(x=e.onPause)==null||x.call(e)}).then(()=>{var w;i=void 0,r||(w=e.onContinue)==null||w.call(e)}),y=()=>{if(r)return;let w;const x=n===0?e.initialPromise:void 0;try{w=x??e.fn()}catch(h){w=Promise.reject(h)}Promise.resolve(w).then(u).catch(h=>{var T;if(r)return;const g=e.retry??(ns?0:3),k=e.retryDelay??F_,C=typeof k=="function"?k(n,h):k,S=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,h);if(t||!S){p(h);return}n++,(T=e.onFail)==null||T.call(e,n,h),O_(C).then(()=>c()?void 0:m()).then(()=>{t?p(h):y()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():m().then(y),s)}}function B_(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var ct=B_(),Fi,Mx,lb=(Mx=class{constructor(){pe(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jf(this.gcTime)&&le(this,Fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ns?1/0:5*60*1e3))}clearGcTimeout(){_(this,Fi)&&(clearTimeout(_(this,Fi)),le(this,Fi,void 0))}},Fi=new WeakMap,Mx),Ks,Xs,gn,_t,Ya,Bi,Mn,hr,Ox,$_=(Ox=class extends lb{constructor(t){super();pe(this,Mn);pe(this,Ks);pe(this,Xs);pe(this,gn);pe(this,_t);pe(this,Ya);pe(this,Bi);le(this,Bi,!1),le(this,Ya,t.defaultOptions),this.setOptions(t.options),this.observers=[],le(this,gn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,le(this,Ks,z_(this.options)),this.state=t.state??_(this,Ks),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,_t))==null?void 0:t.promise}setOptions(t){this.options={..._(this,Ya),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,gn).remove(this)}setData(t,n){const r=tp(this.state.data,t,this.options);return ke(this,Mn,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ke(this,Mn,hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=_(this,_t))==null?void 0:r.promise;return(i=_(this,_t))==null||i.cancel(t),n?n.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Ks))}isActive(){return this.observers.some(t=>In(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===im||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!nb(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,_t))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,_t))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,gn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,_t)&&(_(this,Bi)?_(this,_t).cancel({revert:!0}):_(this,_t).cancelRetry()),this.scheduleGc()),_(this,gn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ke(this,Mn,hr).call(this,{type:"invalidate"})}fetch(t,n){var l,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,_t))return _(this,_t).continueRetry(),_(this,_t).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(p=>p.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(le(this,Bi,!0),r.signal)})},s=()=>{const u=ib(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),le(this,Bi,!1),this.options.persister?this.options.persister(u,p,this):u(p)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),le(this,Xs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&ke(this,Mn,hr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,m,y,w;Td(u)&&u.silent||ke(this,Mn,hr).call(this,{type:"error",error:u}),Td(u)||((m=(p=_(this,gn).config).onError)==null||m.call(p,u,this),(w=(y=_(this,gn).config).onSettled)==null||w.call(y,this.state.data,u,this)),this.scheduleGc()};return le(this,_t,ab({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var p,m,y,w;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(x){a(x);return}(m=(p=_(this,gn).config).onSuccess)==null||m.call(p,u,this),(w=(y=_(this,gn).config).onSettled)==null||w.call(y,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{ke(this,Mn,hr).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{ke(this,Mn,hr).call(this,{type:"pause"})},onContinue:()=>{ke(this,Mn,hr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),_(this,_t).start()}},Ks=new WeakMap,Xs=new WeakMap,gn=new WeakMap,_t=new WeakMap,Ya=new WeakMap,Bi=new WeakMap,Mn=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...cb(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Td(i)&&i.revert&&_(this,Xs)?{..._(this,Xs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ct.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,gn).notify({query:this,type:"updated",action:t})})},Ox);function cb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function z_(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qn,Nx,V_=(Nx=class extends To{constructor(t={}){super();pe(this,Qn);this.config=t,le(this,Qn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??rm(i,n);let o=this.get(s);return o||(o=new $_({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){_(this,Qn).has(t.queryHash)||(_(this,Qn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,Qn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,Qn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Qn).get(t)}getAll(){return[..._(this,Qn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Pv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Pv(t,r)):n}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ct.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ct.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Qn=new WeakMap,Nx),Kn,Mt,$i,Xn,Ir,Dx,U_=(Dx=class extends lb{constructor(t){super();pe(this,Xn);pe(this,Kn);pe(this,Mt);pe(this,$i);this.mutationId=t.mutationId,le(this,Mt,t.mutationCache),le(this,Kn,[]),this.state=t.state||ub(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,Kn).includes(t)||(_(this,Kn).push(t),this.clearGcTimeout(),_(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){le(this,Kn,_(this,Kn).filter(n=>n!==t)),this.scheduleGc(),_(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,Kn).length||(this.state.status==="pending"?this.scheduleGc():_(this,Mt).remove(this))}continue(){var t;return((t=_(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,p,m,y,w,x,h,g,k,C,S,T,j;le(this,$i,ab({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,A)=>{ke(this,Xn,Ir).call(this,{type:"failed",failureCount:E,error:A})},onPause:()=>{ke(this,Xn,Ir).call(this,{type:"pause"})},onContinue:()=>{ke(this,Xn,Ir).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,Mt).canRun(this)}));const n=this.state.status==="pending",r=!_(this,$i).canStart();try{if(!n){ke(this,Xn,Ir).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=_(this,Mt).config).onMutate)==null?void 0:s.call(i,t,this));const A=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));A!==this.state.context&&ke(this,Xn,Ir).call(this,{type:"pending",context:A,variables:t,isPaused:r})}const E=await _(this,$i).start();return await((c=(l=_(this,Mt).config).onSuccess)==null?void 0:c.call(l,E,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,E,t,this.state.context)),await((m=(p=_(this,Mt).config).onSettled)==null?void 0:m.call(p,E,null,this.state.variables,this.state.context,this)),await((w=(y=this.options).onSettled)==null?void 0:w.call(y,E,null,t,this.state.context)),ke(this,Xn,Ir).call(this,{type:"success",data:E}),E}catch(E){try{throw await((h=(x=_(this,Mt).config).onError)==null?void 0:h.call(x,E,t,this.state.context,this)),await((k=(g=this.options).onError)==null?void 0:k.call(g,E,t,this.state.context)),await((S=(C=_(this,Mt).config).onSettled)==null?void 0:S.call(C,void 0,E,this.state.variables,this.state.context,this)),await((j=(T=this.options).onSettled)==null?void 0:j.call(T,void 0,E,t,this.state.context)),E}finally{ke(this,Xn,Ir).call(this,{type:"error",error:E})}}finally{_(this,Mt).runNext(this)}}},Kn=new WeakMap,Mt=new WeakMap,$i=new WeakMap,Xn=new WeakSet,Ir=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ct.batch(()=>{_(this,Kn).forEach(r=>{r.onMutationUpdate(t)}),_(this,Mt).notify({mutation:this,type:"updated",action:t})})},Dx);function ub(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zt,Qa,Ix,H_=(Ix=class extends To{constructor(t={}){super();pe(this,Zt);pe(this,Qa);this.config=t,le(this,Zt,new Map),le(this,Qa,Date.now())}build(t,n,r){const i=new U_({mutationCache:this,mutationId:++pl(this,Qa)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Pl(t),r=_(this,Zt).get(n)??[];r.push(t),_(this,Zt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Pl(t);if(_(this,Zt).has(n)){const i=(r=_(this,Zt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?_(this,Zt).delete(n):_(this,Zt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=_(this,Zt).get(Pl(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=_(this,Zt).get(Pl(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[..._(this,Zt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Mv(n,r))}findAll(t={}){return this.getAll().filter(n=>Mv(t,n))}notify(t){ct.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ct.batch(()=>Promise.all(t.map(n=>n.continue().catch(vn))))}},Zt=new WeakMap,Qa=new WeakMap,Ix);function Pl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Dv(e){return{onFetch:(t,n)=>{var d,u,p,m,y;const r=t.options,i=(p=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:p.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let w=!1;const x=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(t.signal.aborted?w=!0:t.signal.addEventListener("abort",()=>{w=!0}),t.signal)})},h=ib(t.options,t.fetchOptions),g=async(k,C,S)=>{if(w)return Promise.reject();if(C==null&&k.pages.length)return Promise.resolve(k);const T={queryKey:t.queryKey,pageParam:C,direction:S?"backward":"forward",meta:t.options.meta};x(T);const j=await h(T),{maxPages:E}=t.options,A=S?D_:N_;return{pages:A(k.pages,j,E),pageParams:A(k.pageParams,C,E)}};if(i&&s.length){const k=i==="backward",C=k?W_:Iv,S={pages:s,pageParams:o},T=C(r,S);a=await g(S,T,k)}else{const k=e??s.length;do{const C=l===0?o[0]??r.initialPageParam:Iv(r,a);if(l>0&&C==null)break;a=await g(a,C),l++}while(l<k)}return a};t.options.persister?t.fetchFn=()=>{var w,x;return(x=(w=t.options).persister)==null?void 0:x.call(w,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Iv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function W_(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ke,Wr,qr,Zs,Js,Gr,eo,to,Lx,q_=(Lx=class{constructor(e={}){pe(this,Ke);pe(this,Wr);pe(this,qr);pe(this,Zs);pe(this,Js);pe(this,Gr);pe(this,eo);pe(this,to);le(this,Ke,e.queryCache||new V_),le(this,Wr,e.mutationCache||new H_),le(this,qr,e.defaultOptions||{}),le(this,Zs,new Map),le(this,Js,new Map),le(this,Gr,0)}mount(){pl(this,Gr)._++,_(this,Gr)===1&&(le(this,eo,sm.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ke).onFocus())})),le(this,to,Fc.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ke).onOnline())})))}unmount(){var e,t;pl(this,Gr)._--,_(this,Gr)===0&&((e=_(this,eo))==null||e.call(this),le(this,eo,void 0),(t=_(this,to))==null||t.call(this),le(this,to,void 0))}isFetching(e){return _(this,Ke).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Wr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ke).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=_(this,Ke).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(qs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return _(this,Ke).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=_(this,Ke).get(r.queryHash),s=i==null?void 0:i.state.data,o=M_(t,s);if(o!==void 0)return _(this,Ke).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ct.batch(()=>_(this,Ke).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ke).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,Ke);ct.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,Ke),r={type:"active",...e};return ct.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ct.batch(()=>_(this,Ke).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(vn).catch(vn)}invalidateQueries(e,t={}){return ct.batch(()=>{if(_(this,Ke).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ct.batch(()=>_(this,Ke).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(vn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,Ke).build(this,t);return n.isStaleByTime(qs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e.behavior=Dv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e.behavior=Dv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Fc.isOnline()?_(this,Wr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,Ke)}getMutationCache(){return _(this,Wr)}getDefaultOptions(){return _(this,qr)}setDefaultOptions(e){le(this,qr,e)}setQueryDefaults(e,t){_(this,Zs).set(rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Zs).values()],n={};return t.forEach(r=>{Oa(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){_(this,Js).set(rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Js).values()];let n={};return t.forEach(r=>{Oa(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,qr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===im&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,qr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,Ke).clear(),_(this,Wr).clear()}},Ke=new WeakMap,Wr=new WeakMap,qr=new WeakMap,Zs=new WeakMap,Js=new WeakMap,Gr=new WeakMap,eo=new WeakMap,to=new WeakMap,Lx),zt,_e,Ka,Ot,zi,no,Yr,Zn,Xa,ro,io,Vi,Ui,Qr,so,Ae,Yo,rp,ip,sp,op,ap,lp,cp,db,Fx,G_=(Fx=class extends To{constructor(t,n){super();pe(this,Ae);pe(this,zt);pe(this,_e);pe(this,Ka);pe(this,Ot);pe(this,zi);pe(this,no);pe(this,Yr);pe(this,Zn);pe(this,Xa);pe(this,ro);pe(this,io);pe(this,Vi);pe(this,Ui);pe(this,Qr);pe(this,so,new Set);this.options=n,le(this,zt,t),le(this,Zn,null),le(this,Yr,np()),this.options.experimental_prefetchInRender||_(this,Yr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,_e).addObserver(this),Lv(_(this,_e),this.options)?ke(this,Ae,Yo).call(this):this.updateResult(),ke(this,Ae,op).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return up(_(this,_e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return up(_(this,_e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ke(this,Ae,ap).call(this),ke(this,Ae,lp).call(this),_(this,_e).removeObserver(this)}setOptions(t,n){const r=this.options,i=_(this,_e);if(this.options=_(this,zt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof In(this.options.enabled,_(this,_e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ke(this,Ae,cp).call(this),_(this,_e).setOptions(this.options),r._defaulted&&!Lc(this.options,r)&&_(this,zt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,_e),observer:this});const s=this.hasListeners();s&&Fv(_(this,_e),i,this.options,r)&&ke(this,Ae,Yo).call(this),this.updateResult(n),s&&(_(this,_e)!==i||In(this.options.enabled,_(this,_e))!==In(r.enabled,_(this,_e))||qs(this.options.staleTime,_(this,_e))!==qs(r.staleTime,_(this,_e)))&&ke(this,Ae,rp).call(this);const o=ke(this,Ae,ip).call(this);s&&(_(this,_e)!==i||In(this.options.enabled,_(this,_e))!==In(r.enabled,_(this,_e))||o!==_(this,Qr))&&ke(this,Ae,sp).call(this,o)}getOptimisticResult(t){const n=_(this,zt).getQueryCache().build(_(this,zt),t),r=this.createResult(n,t);return Q_(this,r)&&(le(this,Ot,r),le(this,no,this.options),le(this,zi,_(this,_e).state)),r}getCurrentResult(){return _(this,Ot)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){_(this,so).add(t)}getCurrentQuery(){return _(this,_e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,zt).defaultQueryOptions(t),r=_(this,zt).getQueryCache().build(_(this,zt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ke(this,Ae,Yo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Ot)))}createResult(t,n){var E;const r=_(this,_e),i=this.options,s=_(this,Ot),o=_(this,zi),a=_(this,no),c=t!==r?t.state:_(this,Ka),{state:d}=t;let u={...d},p=!1,m;if(n._optimisticResults){const A=this.hasListeners(),I=!A&&Lv(t,n),N=A&&Fv(t,r,n,i);(I||N)&&(u={...u,...cb(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:w,status:x}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===_(this,Xa))m=_(this,ro);else try{le(this,Xa,n.select),m=n.select(u.data),m=tp(s==null?void 0:s.data,m,n),le(this,ro,m),le(this,Zn,null)}catch(A){le(this,Zn,A)}else m=u.data;if(n.placeholderData!==void 0&&m===void 0&&x==="pending"){let A;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))A=s.data;else if(A=typeof n.placeholderData=="function"?n.placeholderData((E=_(this,io))==null?void 0:E.state.data,_(this,io)):n.placeholderData,n.select&&A!==void 0)try{A=n.select(A),le(this,Zn,null)}catch(I){le(this,Zn,I)}A!==void 0&&(x="success",m=tp(s==null?void 0:s.data,A,n),p=!0)}_(this,Zn)&&(y=_(this,Zn),m=_(this,ro),w=Date.now(),x="error");const h=u.fetchStatus==="fetching",g=x==="pending",k=x==="error",C=g&&h,S=m!==void 0,j={status:x,fetchStatus:u.fetchStatus,isPending:g,isSuccess:x==="success",isError:k,isInitialLoading:C,isLoading:C,data:m,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:w,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:h,isRefetching:h&&!g,isLoadingError:k&&!S,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:k&&S,isStale:om(t,n),refetch:this.refetch,promise:_(this,Yr)};if(this.options.experimental_prefetchInRender){const A=D=>{j.status==="error"?D.reject(j.error):j.data!==void 0&&D.resolve(j.data)},I=()=>{const D=le(this,Yr,j.promise=np());A(D)},N=_(this,Yr);switch(N.status){case"pending":t.queryHash===r.queryHash&&A(N);break;case"fulfilled":(j.status==="error"||j.data!==N.value)&&I();break;case"rejected":(j.status!=="error"||j.error!==N.reason)&&I();break}}return j}updateResult(t){const n=_(this,Ot),r=this.createResult(_(this,_e),this.options);if(le(this,zi,_(this,_e).state),le(this,no,this.options),_(this,zi).data!==void 0&&le(this,io,_(this,_e)),Lc(r,n))return;le(this,Ot,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!_(this,so).size)return!0;const l=new Set(a??_(this,so));return this.options.throwOnError&&l.add("error"),Object.keys(_(this,Ot)).some(c=>{const d=c;return _(this,Ot)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),ke(this,Ae,db).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ke(this,Ae,op).call(this)}},zt=new WeakMap,_e=new WeakMap,Ka=new WeakMap,Ot=new WeakMap,zi=new WeakMap,no=new WeakMap,Yr=new WeakMap,Zn=new WeakMap,Xa=new WeakMap,ro=new WeakMap,io=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,Qr=new WeakMap,so=new WeakMap,Ae=new WeakSet,Yo=function(t){ke(this,Ae,cp).call(this);let n=_(this,_e).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vn)),n},rp=function(){ke(this,Ae,ap).call(this);const t=qs(this.options.staleTime,_(this,_e));if(ns||_(this,Ot).isStale||!Jf(t))return;const r=nb(_(this,Ot).dataUpdatedAt,t)+1;le(this,Vi,setTimeout(()=>{_(this,Ot).isStale||this.updateResult()},r))},ip=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,_e)):this.options.refetchInterval)??!1},sp=function(t){ke(this,Ae,lp).call(this),le(this,Qr,t),!(ns||In(this.options.enabled,_(this,_e))===!1||!Jf(_(this,Qr))||_(this,Qr)===0)&&le(this,Ui,setInterval(()=>{(this.options.refetchIntervalInBackground||sm.isFocused())&&ke(this,Ae,Yo).call(this)},_(this,Qr)))},op=function(){ke(this,Ae,rp).call(this),ke(this,Ae,sp).call(this,ke(this,Ae,ip).call(this))},ap=function(){_(this,Vi)&&(clearTimeout(_(this,Vi)),le(this,Vi,void 0))},lp=function(){_(this,Ui)&&(clearInterval(_(this,Ui)),le(this,Ui,void 0))},cp=function(){const t=_(this,zt).getQueryCache().build(_(this,zt),this.options);if(t===_(this,_e))return;const n=_(this,_e);le(this,_e,t),le(this,Ka,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},db=function(t){ct.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,Ot))}),_(this,zt).getQueryCache().notify({query:_(this,_e),type:"observerResultsUpdated"})})},Fx);function Y_(e,t){return In(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Lv(e,t){return Y_(e,t)||e.state.data!==void 0&&up(e,t,t.refetchOnMount)}function up(e,t,n){if(In(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&om(e,t)}return!1}function Fv(e,t,n,r){return(e!==t||In(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&om(e,n)}function om(e,t){return In(t.enabled,e)!==!1&&e.isStaleByTime(qs(t.staleTime,e))}function Q_(e,t){return!Lc(e.getCurrentResult(),t)}var Kr,Xr,Vt,xr,Sr,nc,dp,Bx,K_=(Bx=class extends To{constructor(t,n){super();pe(this,Sr);pe(this,Kr);pe(this,Xr);pe(this,Vt);pe(this,xr);le(this,Kr,t),this.setOptions(n),this.bindMethods(),ke(this,Sr,nc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=_(this,Kr).defaultMutationOptions(t),Lc(this.options,n)||_(this,Kr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rs(n.mutationKey)!==rs(this.options.mutationKey)?this.reset():((r=_(this,Vt))==null?void 0:r.state.status)==="pending"&&_(this,Vt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=_(this,Vt))==null||t.removeObserver(this)}onMutationUpdate(t){ke(this,Sr,nc).call(this),ke(this,Sr,dp).call(this,t)}getCurrentResult(){return _(this,Xr)}reset(){var t;(t=_(this,Vt))==null||t.removeObserver(this),le(this,Vt,void 0),ke(this,Sr,nc).call(this),ke(this,Sr,dp).call(this)}mutate(t,n){var r;return le(this,xr,n),(r=_(this,Vt))==null||r.removeObserver(this),le(this,Vt,_(this,Kr).getMutationCache().build(_(this,Kr),this.options)),_(this,Vt).addObserver(this),_(this,Vt).execute(t)}},Kr=new WeakMap,Xr=new WeakMap,Vt=new WeakMap,xr=new WeakMap,Sr=new WeakSet,nc=function(){var n;const t=((n=_(this,Vt))==null?void 0:n.state)??ub();le(this,Xr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},dp=function(t){ct.batch(()=>{var n,r,i,s,o,a,l,c;if(_(this,xr)&&this.hasListeners()){const d=_(this,Xr).variables,u=_(this,Xr).context;(t==null?void 0:t.type)==="success"?((r=(n=_(this,xr)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=_(this,xr)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=_(this,xr)).onError)==null||a.call(o,t.error,d,u),(c=(l=_(this,xr)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(_(this,Xr))})})},Bx),fb=v.createContext(void 0),pb=e=>{const t=v.useContext(fb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},X_=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(fb.Provider,{value:e,children:t})),hb=v.createContext(!1),Z_=()=>v.useContext(hb);hb.Provider;function J_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var eE=v.createContext(J_()),tE=()=>v.useContext(eE);function mb(e,t){return typeof e=="function"?e(...t):!!e}function fp(){}var nE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},rE=e=>{v.useEffect(()=>{e.clearReset()},[e])},iE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&mb(n,[e.error,r]),sE=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},oE=(e,t)=>e.isLoading&&e.isFetching&&!t,aE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Bv=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function lE(e,t,n){var d,u,p,m,y;const r=pb(),i=Z_(),s=tE(),o=r.defaultQueryOptions(e);(u=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||u.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",sE(o),nE(o,s),rE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(w=>{const x=i?fp:l.subscribe(ct.batchCalls(w));return l.updateResult(),x},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),aE(o,c))throw Bv(o,l,s);if(iE({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;if((m=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||m.call(p,o,c),o.experimental_prefetchInRender&&!ns&&oE(c,i)){const w=a?Bv(o,l,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;w==null||w.catch(fp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function gb(e,t){return lE(e,G_)}function am(e,t){const n=pb(),[r]=v.useState(()=>new K_(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(ct.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(fp)},[r]);if(i.error&&mb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const cE=(e,t)=>gb({queryKey:["widgets",e,t],queryFn:()=>uE(e,t),retry:!1,throwOnError:!1}),uE=async(e,t)=>{const n=`widgets/with-link/${e}${t?`?device_id=${t}`:""}`,[r,i]=await Mr(n);if(i===204)throw new Error("User is banned");return r};var b=(e=>(e.Border="widget_border",e.Background="widget_background",e.InputBackground="widget_input_background",e.InputText="widget_input_text",e.InputBorder="widget_input_border",e.ButtonBackground="widget_button_background",e.ButtonText="widget_button_text",e.TooltipBackground="widget_tooltip_background",e.TooltipText="widget_tooltip_text",e.TooltipBorder="widget_tooltip_border",e.HeaderBackground="widget_header_background",e.HeaderText="widget_header_text",e.HeaderBorder="widget_header_border",e.FooterBackground="widget_footer_background",e.FooterText="widget_footer_text",e.FooterBorder="widget_footer_border",e.MessageAdminBackground="widget_message_admin_background",e.MessageAdminText="widget_message_admin_text",e.MessageVisitorBackground="widget_message_visitor_background",e.MessageVisitorText="widget_message_visitor_text",e.MessageAgentBackground="widget_message_agent_background",e.MessageAgentText="widget_message_agent_text",e.GreeterTopBackground="widget_greeter_top_background",e.GreeterTopText="widget_greeter_top_text",e.GreeterBackground="widget_greeter_background",e.GreeterText="widget_greeter_text",e.GreeterBorder="widget_greeter_border",e.GreeterButtonBackground="widget_greeter_button_background",e.GreeterButtonText="widget_greeter_button_text",e.CloseButtonBackground="widget_close_button_background",e.CloseButtonText="widget_close_button_text",e.CloseButtonHover="widget_close_button_hover",e.IconColor="widget_icon_color",e.IconBackground="widget_icon_background",e.ErrorBackground="widget_error_background",e.ErrorText="widget_error_text",e.ErrorBorder="widget_error_border",e.SuccessBackground="widget_success_background",e.SuccessText="widget_success_text",e.SuccessBorder="widget_success_border",e.WarningBackground="widget_warning_background",e.WarningText="widget_warning_text",e.WarningBorder="widget_warning_border",e.LinkColor="widget_link_color",e.LinkHoverColor="widget_link_hover_color",e.DividerColor="widget_divider_color",e.ShadowColor="widget_shadow_color",e.StarActiveColor="widget_star_active_color",e.StarInactiveColor="widget_star_inactive_color",e.ModalOverlayColor="widget_modal_overlay_color",e.ChatCloseConfirmText="widget_chat_close_confirm_text",e.RatingHeaderBackground="widget_rating_header_background",e.RatingHeaderText="widget_rating_header_text",e.RatingSuccessBackground="widget_rating_success_background",e.RatingSuccessText="widget_rating_success_text",e.RatingRateConversationText="widget_rating_rate_conversation_text",e))(b||{}),re=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.ChatCloseConfirm="chat_close_confirm",e.ChatCloseWarning="chat_close_warning",e.ChatSettings="chat_settings",e.ChatEndConversation="chat_end_conversation",e.CancelAction="cancel_action",e.CloseAction="close_action",e.QuickActions="quick_actions",e.GreetingStartChat="greeting_start_chat",e.RateLimitMessage="rate_limit_message",e.RatingHeaderEvaluate="rating_header_evaluate",e.RatingHeaderThanks="rating_header_thanks",e.RatingDescription="rating_description",e.RatingRateConversation="rating_rate_conversation",e.RatingComment="rating_comment",e.RatingCommentPlaceholder="rating_comment_placeholder",e.RatingSubmit="rating_submit",e.RatingNewConversation="rating_new_conversation",e.RatingThankYouTitle="rating_thank_you_title",e.RatingThankYouDescription="rating_thank_you_description",e.RatingCountdown="rating_countdown",e.RatingMinimumError="rating_minimum_error",e.RatingYourScore="rating_your_score",e.PoweredBy="powered_by",e.NotificationSoundOn="notification_sound_on",e.NotificationSoundOff="notification_sound_off",e))(re||{}),Ne=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(Ne||{});function dE(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
|
|
40
|
+
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function kd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function $f(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var q_=typeof WeakMap=="function"?WeakMap:Map;function Tw(e,t,n){n=kr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Nc||(Nc=!0,Kf=r),$f(e,t)},n}function Ew(e,t,n){n=kr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){$f(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){$f(e,t),typeof r!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function pv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new q_;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=oT.bind(null,e,t,n),t.then(e,e))}function hv(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 mv(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=kr(-1,1),t.tag=2,si(n,t,1))),n.lanes|=1),e)}var G_=Pr.ReactCurrentOwner,qt=!1;function Nt(e,t,n,r){t.child=e===null?nw(t,null,n,r):co(t,e.child,n,r)}function gv(e,t,n,r,i){n=n.render;var s=t.ref;return Hs(t,i),r=Vh(e,t,n,r,s,i),n=Uh(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(We&&n&&Rh(t),t.flags|=1,Nt(e,t,r,i),t.child)}function vv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!Jh(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Aw(e,t,s,r,i)):(e=nc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ca,n(o,r)&&e.ref===t.ref)return Er(e,t,i)}return t.flags|=1,e=li(s,r),e.ref=t.ref,e.return=t,t.child=e}function Aw(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Ca(s,r)&&e.ref===t.ref)if(qt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(qt=!0);else return t.lanes=e.lanes,Er(e,t,i)}return zf(e,t,n,r,i)}function jw(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Le(Os,Jt),Jt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Le(Os,Jt),Jt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Le(Os,Jt),Jt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Le(Os,Jt),Jt|=r;return Nt(e,t,i,n),t.child}function Rw(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zf(e,t,n,r,i){var s=Yt(n)?Xi:Pt.current;return s=ao(t,s),Hs(t,i),n=Vh(e,t,n,r,s,i),r=Uh(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Er(e,t,i)):(We&&r&&Rh(t),t.flags|=1,Nt(e,t,n,i),t.child)}function yv(e,t,n,r,i){if(Yt(n)){var s=!0;Cc(t)}else s=!1;if(Hs(t,i),t.stateNode===null)Jl(e,t),_w(t,n,r),Bf(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=_n(c):(c=Yt(n)?Xi:Pt.current,c=ao(t,c));var d=n.getDerivedStateFromProps,u=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";u||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&fv(t,o,r,c),Br=!1;var p=t.memoizedState;o.state=p,jc(t,r,o,i),l=t.memoizedState,a!==r||p!==l||Gt.current||Br?(typeof d=="function"&&(Ff(t,n,d,r),l=t.memoizedState),(a=Br||dv(t,n,a,r,p,l,c))?(u||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=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,iw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Mn(t.type,a),o.props=c,u=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=_n(l):(l=Yt(n)?Xi:Pt.current,l=ao(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==u||p!==l)&&fv(t,o,r,l),Br=!1,p=t.memoizedState,o.state=p,jc(t,r,o,i);var y=t.memoizedState;a!==u||p!==y||Gt.current||Br?(typeof h=="function"&&(Ff(t,n,h,r),y=t.memoizedState),(c=Br||dv(t,n,c,r,p,y,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,y,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),o.props=r,o.state=y,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Vf(e,t,n,r,s,i)}function Vf(e,t,n,r,i,s){Rw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&rv(t,n,!1),Er(e,t,s);r=t.stateNode,G_.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=co(t,e.child,null,s),t.child=co(t,null,a,s)):Nt(e,t,a,s),t.memoizedState=r.state,i&&rv(t,n,!0),t.child}function Pw(e){var t=e.stateNode;t.pendingContext?nv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nv(e,t.context,!1),Fh(e,t.containerInfo)}function xv(e,t,n,r,i){return lo(),Mh(i),t.flags|=256,Nt(e,t,n,r),t.child}var Uf={dehydrated:null,treeContext:null,retryLane:0};function Hf(e){return{baseLanes:e,cachePool:null,transitions:null}}function Mw(e,t,n){var r=t.pendingProps,i=Ye.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Le(Ye,i&1),e===null)return If(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,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=mu(o,r,0,null),e=Wi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Hf(n),t.memoizedState=Uf,e):qh(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return Y_(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=li(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=li(a,s):(s=Wi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Hf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Uf,r}return s=e.child,e=s.sibling,r=li(s,{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 qh(e,t){return t=mu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Al(e,t,n,r){return r!==null&&Mh(r),co(t,e.child,null,n),e=qh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Y_(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=kd(Error(Q(422))),Al(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=mu({mode:"visible",children:r.children},i,0,null),s=Wi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&co(t,e.child,null,o),t.child.memoizedState=Hf(o),t.memoizedState=Uf,s);if(!(t.mode&1))return Al(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(Q(419)),r=kd(s,r,void 0),Al(e,t,o,r)}if(a=(o&e.childLanes)!==0,qt||a){if(r=mt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Tr(e,i),$n(r,e,i,-1))}return Zh(),r=kd(Error(Q(421))),Al(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=aT.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,nn=ii(i.nextSibling),on=t,We=!0,In=null,e!==null&&(xn[wn++]=wr,xn[wn++]=br,xn[wn++]=Zi,wr=e.id,br=e.overflow,Zi=t),t=qh(t,r.children),t.flags|=4096,t)}function wv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Lf(e.return,t,n)}function Sd(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Ow(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Nt(e,t,r.children,n),r=Ye.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&&wv(e,n,t);else if(e.tag===19)wv(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(Le(Ye,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Rc(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sd(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Rc(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sd(t,!0,n,null,s);break;case"together":Sd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Jl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Er(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Q(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Q_(e,t,n){switch(t.tag){case 3:Pw(t),lo();break;case 5:sw(t);break;case 1:Yt(t.type)&&Cc(t);break;case 4:Fh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Le(Ec,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Le(Ye,Ye.current&1),t.flags|=128,null):n&t.child.childLanes?Mw(e,t,n):(Le(Ye,Ye.current&1),e=Er(e,t,n),e!==null?e.sibling:null);Le(Ye,Ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ow(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Le(Ye,Ye.current),r)break;return null;case 22:case 23:return t.lanes=0,jw(e,t,n)}return Er(e,t,n)}var Nw,Wf,Dw,Iw;Nw=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}};Wf=function(){};Dw=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Oi(nr.current);var s=null;switch(n){case"input":i=pf(e,i),r=pf(e,r),s=[];break;case"select":i=Xe({},i,{value:void 0}),r=Xe({},r,{value:void 0}),s=[];break;case"textarea":i=gf(e,i),r=gf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=kc)}yf(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(va.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(va.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Be("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};Iw=function(e,t,n,r){n!==r&&(t.flags|=4)};function Bo(e,t){if(!We)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 _t(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function K_(e,t,n){var r=t.pendingProps;switch(Ph(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(t),null;case 1:return Yt(t.type)&&Sc(),_t(t),null;case 3:return r=t.stateNode,uo(),ze(Gt),ze(Pt),$h(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Tl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,In!==null&&(Jf(In),In=null))),Wf(e,t),_t(t),null;case 5:Bh(t);var i=Oi(ja.current);if(n=t.type,e!==null&&t.stateNode!=null)Dw(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Q(166));return _t(t),null}if(e=Oi(nr.current),Tl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[er]=t,r[Ea]=s,e=(t.mode&1)!==0,n){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(i=0;i<Yo.length;i++)Be(Yo[i],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":jg(r,s),Be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Be("invalid",r);break;case"textarea":Pg(r,s),Be("invalid",r)}yf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&_l(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&_l(r.textContent,a,e),i=["children",""+a]):va.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Be("scroll",r)}switch(n){case"input":vl(r),Rg(r,s,!0);break;case"textarea":vl(r),Mg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=kc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=u1(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/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[er]=t,e[Ea]=r,Nw(e,t,!1,!1),t.stateNode=e;e:{switch(o=xf(n,r),n){case"dialog":Be("cancel",e),Be("close",e),i=r;break;case"iframe":case"object":case"embed":Be("load",e),i=r;break;case"video":case"audio":for(i=0;i<Yo.length;i++)Be(Yo[i],e);i=r;break;case"source":Be("error",e),i=r;break;case"img":case"image":case"link":Be("error",e),Be("load",e),i=r;break;case"details":Be("toggle",e),i=r;break;case"input":jg(e,r),i=pf(e,r),Be("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Xe({},r,{value:void 0}),Be("invalid",e);break;case"textarea":Pg(e,r),i=gf(e,r),Be("invalid",e);break;default:i=r}yf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?p1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&d1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ya(e,l):typeof l=="number"&&ya(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(va.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Be("scroll",e):l!=null&&gh(e,s,l,o))}switch(n){case"input":vl(e),Rg(e,r,!1);break;case"textarea":vl(e),Mg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+di(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?$s(e,!!r.multiple,s,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=kc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return _t(t),null;case 6:if(e&&t.stateNode!=null)Iw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=Oi(ja.current),Oi(nr.current),Tl(t)){if(r=t.stateNode,n=t.memoizedProps,r[er]=t,(s=r.nodeValue!==n)&&(e=on,e!==null))switch(e.tag){case 3:_l(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_l(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[er]=t,t.stateNode=r}return _t(t),null;case 13:if(ze(Ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&nn!==null&&t.mode&1&&!(t.flags&128))ew(),lo(),t.flags|=98560,s=!1;else if(s=Tl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(Q(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(Q(317));s[er]=t}else lo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;_t(t),s=!1}else In!==null&&(Jf(In),In=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ye.current&1?dt===0&&(dt=3):Zh())),t.updateQueue!==null&&(t.flags|=4),_t(t),null);case 4:return uo(),Wf(e,t),e===null&&_a(t.stateNode.containerInfo),_t(t),null;case 10:return Dh(t.type._context),_t(t),null;case 17:return Yt(t.type)&&Sc(),_t(t),null;case 19:if(ze(Ye),s=t.memoizedState,s===null)return _t(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Bo(s,!1);else{if(dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Rc(e),o!==null){for(t.flags|=128,Bo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Le(Ye,Ye.current&1|2),t.child}e=e.sibling}s.tail!==null&&it()>po&&(t.flags|=128,r=!0,Bo(s,!1),t.lanes=4194304)}else{if(!r)if(e=Rc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!We)return _t(t),null}else 2*it()-s.renderingStartTime>po&&n!==1073741824&&(t.flags|=128,r=!0,Bo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=it(),t.sibling=null,n=Ye.current,Le(Ye,r?n&1|2:n&1),t):(_t(t),null);case 22:case 23:return Xh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jt&1073741824&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function X_(e,t){switch(Ph(t),t.tag){case 1:return Yt(t.type)&&Sc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return uo(),ze(Gt),ze(Pt),$h(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bh(t),null;case 13:if(ze(Ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));lo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Ye),null;case 4:return uo(),null;case 10:return Dh(t.type._context),null;case 22:case 23:return Xh(),null;case 24:return null;default:return null}}var jl=!1,At=!1,Z_=typeof WeakSet=="function"?WeakSet:Set,le=null;function Ms(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){tt(e,t,r)}else n.current=null}function qf(e,t,n){try{n()}catch(r){tt(e,t,r)}}var bv=!1;function J_(e,t){if(jf=xc,e=z1(),jh(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 i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,u=e,p=null;t:for(;;){for(var h;u!==n||i!==0&&u.nodeType!==3||(a=o+i),u!==s||r!==0&&u.nodeType!==3||(l=o+r),u.nodeType===3&&(o+=u.nodeValue.length),(h=u.firstChild)!==null;)p=u,u=h;for(;;){if(u===e)break t;if(p===n&&++c===i&&(a=o),p===s&&++d===r&&(l=o),(h=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Rf={focusedElem:e,selectionRange:n},xc=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,w=y.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?x:Mn(t.type,x),w);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(C){tt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return y=bv,bv=!1,y}function oa(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&qf(t,n,s)}i=i.next}while(i!==r)}}function pu(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 Gf(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 Lw(e){var t=e.alternate;t!==null&&(e.alternate=null,Lw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[er],delete t[Ea],delete t[Of],delete t[D_],delete t[I_])),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 Fw(e){return e.tag===5||e.tag===3||e.tag===4}function kv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fw(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 Yf(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=kc));else if(r!==4&&(e=e.child,e!==null))for(Yf(e,t,n),e=e.sibling;e!==null;)Yf(e,t,n),e=e.sibling}function Qf(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(Qf(e,t,n),e=e.sibling;e!==null;)Qf(e,t,n),e=e.sibling}var xt=null,Nn=!1;function Dr(e,t,n){for(n=n.child;n!==null;)Bw(e,t,n),n=n.sibling}function Bw(e,t,n){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(su,n)}catch{}switch(n.tag){case 5:At||Ms(n,t);case 6:var r=xt,i=Nn;xt=null,Dr(e,t,n),xt=r,Nn=i,xt!==null&&(Nn?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(Nn?(e=xt,n=n.stateNode,e.nodeType===8?gd(e.parentNode,n):e.nodeType===1&&gd(e,n),ka(e)):gd(xt,n.stateNode));break;case 4:r=xt,i=Nn,xt=n.stateNode.containerInfo,Nn=!0,Dr(e,t,n),xt=r,Nn=i;break;case 0:case 11:case 14:case 15:if(!At&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&qf(n,t,o),i=i.next}while(i!==r)}Dr(e,t,n);break;case 1:if(!At&&(Ms(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){tt(n,t,a)}Dr(e,t,n);break;case 21:Dr(e,t,n);break;case 22:n.mode&1?(At=(r=At)||n.memoizedState!==null,Dr(e,t,n),At=r):Dr(e,t,n);break;default:Dr(e,t,n)}}function Sv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Z_),t.forEach(function(r){var i=lT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:xt=a.stateNode,Nn=!1;break e;case 3:xt=a.stateNode.containerInfo,Nn=!0;break e;case 4:xt=a.stateNode.containerInfo,Nn=!0;break e}a=a.return}if(xt===null)throw Error(Q(160));Bw(s,o,i),xt=null,Nn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){tt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$w(t,e),t=t.sibling}function $w(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jn(t,e),Wn(e),r&4){try{oa(3,e,e.return),pu(3,e)}catch(x){tt(e,e.return,x)}try{oa(5,e,e.return)}catch(x){tt(e,e.return,x)}}break;case 1:jn(t,e),Wn(e),r&512&&n!==null&&Ms(n,n.return);break;case 5:if(jn(t,e),Wn(e),r&512&&n!==null&&Ms(n,n.return),e.flags&32){var i=e.stateNode;try{ya(i,"")}catch(x){tt(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&l1(i,s),xf(a,o);var c=xf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?p1(i,u):d==="dangerouslySetInnerHTML"?d1(i,u):d==="children"?ya(i,u):gh(i,d,u,c)}switch(a){case"input":hf(i,s);break;case"textarea":c1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?$s(i,!!s.multiple,h,!1):p!==!!s.multiple&&(s.defaultValue!=null?$s(i,!!s.multiple,s.defaultValue,!0):$s(i,!!s.multiple,s.multiple?[]:"",!1))}i[Ea]=s}catch(x){tt(e,e.return,x)}}break;case 6:if(jn(t,e),Wn(e),r&4){if(e.stateNode===null)throw Error(Q(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(x){tt(e,e.return,x)}}break;case 3:if(jn(t,e),Wn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ka(t.containerInfo)}catch(x){tt(e,e.return,x)}break;case 4:jn(t,e),Wn(e);break;case 13:jn(t,e),Wn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Qh=it())),r&4&&Sv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(At=(c=At)||d,jn(t,e),At=c):jn(t,e),Wn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(le=e,d=e.child;d!==null;){for(u=le=d;le!==null;){switch(p=le,h=p.child,p.tag){case 0:case 11:case 14:case 15:oa(4,p,p.return);break;case 1:Ms(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){tt(r,n,x)}}break;case 5:Ms(p,p.return);break;case 22:if(p.memoizedState!==null){_v(u);continue}}h!==null?(h.return=p,le=h):_v(u)}d=d.sibling}e:for(d=null,u=e;;){if(u.tag===5){if(d===null){d=u;try{i=u.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=u.stateNode,l=u.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=f1("display",o))}catch(x){tt(e,e.return,x)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(x){tt(e,e.return,x)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;d===u&&(d=null),u=u.return}d===u&&(d=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:jn(t,e),Wn(e),r&4&&Sv(e);break;case 21:break;default:jn(t,e),Wn(e)}}function Wn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Fw(n)){var r=n;break e}n=n.return}throw Error(Q(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ya(i,""),r.flags&=-33);var s=kv(e);Qf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=kv(e);Yf(e,a,o);break;default:throw Error(Q(161))}}catch(l){tt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function eT(e,t,n){le=e,zw(e)}function zw(e,t,n){for(var r=(e.mode&1)!==0;le!==null;){var i=le,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||jl;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||At;a=jl;var c=At;if(jl=o,(At=l)&&!c)for(le=i;le!==null;)o=le,l=o.child,o.tag===22&&o.memoizedState!==null?Tv(i):l!==null?(l.return=o,le=l):Tv(i);for(;s!==null;)le=s,zw(s),s=s.sibling;le=i,jl=a,At=c}Cv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,le=s):Cv(e)}}function Cv(e){for(;le!==null;){var t=le;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:At||pu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!At)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Mn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&lv(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lv(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var u=d.dehydrated;u!==null&&ka(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}At||t.flags&512&&Gf(t)}catch(p){tt(t,t.return,p)}}if(t===e){le=null;break}if(n=t.sibling,n!==null){n.return=t.return,le=n;break}le=t.return}}function _v(e){for(;le!==null;){var t=le;if(t===e){le=null;break}var n=t.sibling;if(n!==null){n.return=t.return,le=n;break}le=t.return}}function Tv(e){for(;le!==null;){var t=le;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pu(4,t)}catch(l){tt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){tt(t,i,l)}}var s=t.return;try{Gf(t)}catch(l){tt(t,s,l)}break;case 5:var o=t.return;try{Gf(t)}catch(l){tt(t,o,l)}}}catch(l){tt(t,t.return,l)}if(t===e){le=null;break}var a=t.sibling;if(a!==null){a.return=t.return,le=a;break}le=t.return}}var tT=Math.ceil,Oc=Pr.ReactCurrentDispatcher,Gh=Pr.ReactCurrentOwner,Sn=Pr.ReactCurrentBatchConfig,Ae=0,mt=null,ot=null,bt=0,Jt=0,Os=yi(0),dt=0,Oa=null,es=0,hu=0,Yh=0,aa=null,Ht=null,Qh=0,po=1/0,gr=null,Nc=!1,Kf=null,oi=null,Rl=!1,Jr=null,Dc=0,la=0,Xf=null,ec=-1,tc=0;function It(){return Ae&6?it():ec!==-1?ec:ec=it()}function ai(e){return e.mode&1?Ae&2&&bt!==0?bt&-bt:F_.transition!==null?(tc===0&&(tc=_1()),tc):(e=Pe,e!==0||(e=window.event,e=e===void 0?16:M1(e.type)),e):1}function $n(e,t,n,r){if(50<la)throw la=0,Xf=null,Error(Q(185));el(e,n,r),(!(Ae&2)||e!==mt)&&(e===mt&&(!(Ae&2)&&(hu|=n),dt===4&&Vr(e,bt)),Qt(e,r),n===1&&Ae===0&&!(t.mode&1)&&(po=it()+500,uu&&xi()))}function Qt(e,t){var n=e.callbackNode;F2(e,t);var r=yc(e,e===mt?bt:0);if(r===0)n!==null&&Dg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Dg(n),t===1)e.tag===0?L_(Ev.bind(null,e)):X1(Ev.bind(null,e)),O_(function(){!(Ae&6)&&xi()}),n=null;else{switch(T1(r)){case 1:n=bh;break;case 4:n=S1;break;case 16:n=vc;break;case 536870912:n=C1;break;default:n=vc}n=Qw(n,Vw.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Vw(e,t){if(ec=-1,tc=0,Ae&6)throw Error(Q(327));var n=e.callbackNode;if(Ws()&&e.callbackNode!==n)return null;var r=yc(e,e===mt?bt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ic(e,r);else{t=r;var i=Ae;Ae|=2;var s=Hw();(mt!==e||bt!==t)&&(gr=null,po=it()+500,Hi(e,t));do try{iT();break}catch(a){Uw(e,a)}while(!0);Nh(),Oc.current=s,Ae=i,ot!==null?t=0:(mt=null,bt=0,t=dt)}if(t!==0){if(t===2&&(i=Cf(e),i!==0&&(r=i,t=Zf(e,i))),t===1)throw n=Oa,Hi(e,0),Vr(e,r),Qt(e,it()),n;if(t===6)Vr(e,r);else{if(i=e.current.alternate,!(r&30)&&!nT(i)&&(t=Ic(e,r),t===2&&(s=Cf(e),s!==0&&(r=s,t=Zf(e,s))),t===1))throw n=Oa,Hi(e,0),Vr(e,r),Qt(e,it()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:Ei(e,Ht,gr);break;case 3:if(Vr(e,r),(r&130023424)===r&&(t=Qh+500-it(),10<t)){if(yc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){It(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Mf(Ei.bind(null,e,Ht,gr),t);break}Ei(e,Ht,gr);break;case 4:if(Vr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Bn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=it()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*tT(r/1960))-r,10<r){e.timeoutHandle=Mf(Ei.bind(null,e,Ht,gr),r);break}Ei(e,Ht,gr);break;case 5:Ei(e,Ht,gr);break;default:throw Error(Q(329))}}}return Qt(e,it()),e.callbackNode===n?Vw.bind(null,e):null}function Zf(e,t){var n=aa;return e.current.memoizedState.isDehydrated&&(Hi(e,t).flags|=256),e=Ic(e,t),e!==2&&(t=Ht,Ht=n,t!==null&&Jf(t)),e}function Jf(e){Ht===null?Ht=e:Ht.push.apply(Ht,e)}function nT(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Vn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vr(e,t){for(t&=~Yh,t&=~hu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Bn(t),r=1<<n;e[n]=-1,t&=~r}}function Ev(e){if(Ae&6)throw Error(Q(327));Ws();var t=yc(e,0);if(!(t&1))return Qt(e,it()),null;var n=Ic(e,t);if(e.tag!==0&&n===2){var r=Cf(e);r!==0&&(t=r,n=Zf(e,r))}if(n===1)throw n=Oa,Hi(e,0),Vr(e,t),Qt(e,it()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ei(e,Ht,gr),Qt(e,it()),null}function Kh(e,t){var n=Ae;Ae|=1;try{return e(t)}finally{Ae=n,Ae===0&&(po=it()+500,uu&&xi())}}function ts(e){Jr!==null&&Jr.tag===0&&!(Ae&6)&&Ws();var t=Ae;Ae|=1;var n=Sn.transition,r=Pe;try{if(Sn.transition=null,Pe=1,e)return e()}finally{Pe=r,Sn.transition=n,Ae=t,!(Ae&6)&&xi()}}function Xh(){Jt=Os.current,ze(Os)}function Hi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,M_(n)),ot!==null)for(n=ot.return;n!==null;){var r=n;switch(Ph(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Sc();break;case 3:uo(),ze(Gt),ze(Pt),$h();break;case 5:Bh(r);break;case 4:uo();break;case 13:ze(Ye);break;case 19:ze(Ye);break;case 10:Dh(r.type._context);break;case 22:case 23:Xh()}n=n.return}if(mt=e,ot=e=li(e.current,null),bt=Jt=t,dt=0,Oa=null,Yh=hu=es=0,Ht=aa=null,Mi!==null){for(t=0;t<Mi.length;t++)if(n=Mi[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Mi=null}return e}function Uw(e,t){do{var n=ot;try{if(Nh(),Xl.current=Mc,Pc){for(var r=Ke.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Pc=!1}if(Ji=0,ht=ct=Ke=null,sa=!1,Ra=0,Gh.current=null,n===null||n.return===null){dt=1,Oa=t,ot=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=bt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,u=d.tag;if(!(d.mode&1)&&(u===0||u===11||u===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=hv(o);if(h!==null){h.flags&=-257,mv(h,o,a,s,t),h.mode&1&&pv(s,c,t),t=h,l=c;var y=t.updateQueue;if(y===null){var x=new Set;x.add(l),t.updateQueue=x}else y.add(l);break e}else{if(!(t&1)){pv(s,c,t),Zh();break e}l=Error(Q(426))}}else if(We&&a.mode&1){var w=hv(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),mv(w,o,a,s,t),Mh(fo(l,a));break e}}s=l=fo(l,a),dt!==4&&(dt=2),aa===null?aa=[s]:aa.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=Tw(s,l,t);av(s,m);break e;case 1:a=l;var g=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(oi===null||!oi.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var C=Ew(s,a,t);av(s,C);break e}}s=s.return}while(s!==null)}qw(n)}catch(S){t=S,ot===n&&n!==null&&(ot=n=n.return);continue}break}while(!0)}function Hw(){var e=Oc.current;return Oc.current=Mc,e===null?Mc:e}function Zh(){(dt===0||dt===3||dt===2)&&(dt=4),mt===null||!(es&268435455)&&!(hu&268435455)||Vr(mt,bt)}function Ic(e,t){var n=Ae;Ae|=2;var r=Hw();(mt!==e||bt!==t)&&(gr=null,Hi(e,t));do try{rT();break}catch(i){Uw(e,i)}while(!0);if(Nh(),Ae=n,Oc.current=r,ot!==null)throw Error(Q(261));return mt=null,bt=0,dt}function rT(){for(;ot!==null;)Ww(ot)}function iT(){for(;ot!==null&&!j2();)Ww(ot)}function Ww(e){var t=Yw(e.alternate,e,Jt);e.memoizedProps=e.pendingProps,t===null?qw(e):ot=t,Gh.current=null}function qw(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=X_(n,t),n!==null){n.flags&=32767,ot=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{dt=6,ot=null;return}}else if(n=K_(n,t,Jt),n!==null){ot=n;return}if(t=t.sibling,t!==null){ot=t;return}ot=t=e}while(t!==null);dt===0&&(dt=5)}function Ei(e,t,n){var r=Pe,i=Sn.transition;try{Sn.transition=null,Pe=1,sT(e,t,n,r)}finally{Sn.transition=i,Pe=r}return null}function sT(e,t,n,r){do Ws();while(Jr!==null);if(Ae&6)throw Error(Q(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Q(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(B2(e,s),e===mt&&(ot=mt=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Rl||(Rl=!0,Qw(vc,function(){return Ws(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Sn.transition,Sn.transition=null;var o=Pe;Pe=1;var a=Ae;Ae|=4,Gh.current=null,J_(e,n),$w(n,e),__(Rf),xc=!!jf,Rf=jf=null,e.current=n,eT(n),R2(),Ae=a,Pe=o,Sn.transition=s}else e.current=n;if(Rl&&(Rl=!1,Jr=e,Dc=i),s=e.pendingLanes,s===0&&(oi=null),O2(n.stateNode),Qt(e,it()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Nc)throw Nc=!1,e=Kf,Kf=null,e;return Dc&1&&e.tag!==0&&Ws(),s=e.pendingLanes,s&1?e===Xf?la++:(la=0,Xf=e):la=0,xi(),null}function Ws(){if(Jr!==null){var e=T1(Dc),t=Sn.transition,n=Pe;try{if(Sn.transition=null,Pe=16>e?16:e,Jr===null)var r=!1;else{if(e=Jr,Jr=null,Dc=0,Ae&6)throw Error(Q(331));var i=Ae;for(Ae|=4,le=e.current;le!==null;){var s=le,o=s.child;if(le.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(le=c;le!==null;){var d=le;switch(d.tag){case 0:case 11:case 15:oa(8,d,s)}var u=d.child;if(u!==null)u.return=d,le=u;else for(;le!==null;){d=le;var p=d.sibling,h=d.return;if(Lw(d),d===c){le=null;break}if(p!==null){p.return=h,le=p;break}le=h}}}var y=s.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var w=x.sibling;x.sibling=null,x=w}while(x!==null)}}le=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,le=o;else e:for(;le!==null;){if(s=le,s.flags&2048)switch(s.tag){case 0:case 11:case 15:oa(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,le=m;break e}le=s.return}}var g=e.current;for(le=g;le!==null;){o=le;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,le=b;else e:for(o=g;le!==null;){if(a=le,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:pu(9,a)}}catch(S){tt(a,a.return,S)}if(a===o){le=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,le=C;break e}le=a.return}}if(Ae=i,xi(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(su,e)}catch{}r=!0}return r}finally{Pe=n,Sn.transition=t}}return!1}function Av(e,t,n){t=fo(n,t),t=Tw(e,t,1),e=si(e,t,1),t=It(),e!==null&&(el(e,1,t),Qt(e,t))}function tt(e,t,n){if(e.tag===3)Av(e,e,n);else for(;t!==null;){if(t.tag===3){Av(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(oi===null||!oi.has(r))){e=fo(n,e),e=Ew(t,e,1),t=si(t,e,1),e=It(),t!==null&&(el(t,1,e),Qt(t,e));break}}t=t.return}}function oT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=It(),e.pingedLanes|=e.suspendedLanes&n,mt===e&&(bt&n)===n&&(dt===4||dt===3&&(bt&130023424)===bt&&500>it()-Qh?Hi(e,0):Yh|=n),Qt(e,t)}function Gw(e,t){t===0&&(e.mode&1?(t=wl,wl<<=1,!(wl&130023424)&&(wl=4194304)):t=1);var n=It();e=Tr(e,t),e!==null&&(el(e,t,n),Qt(e,n))}function aT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gw(e,n)}function lT(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Q(314))}r!==null&&r.delete(t),Gw(e,n)}var Yw;Yw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gt.current)qt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qt=!1,Q_(e,t,n);qt=!!(e.flags&131072)}else qt=!1,We&&t.flags&1048576&&Z1(t,Tc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Jl(e,t),e=t.pendingProps;var i=ao(t,Pt.current);Hs(t,n),i=Vh(null,t,r,e,i,n);var s=Uh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Yt(r)?(s=!0,Cc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Lh(t),i.updater=fu,t.stateNode=i,i._reactInternals=t,Bf(t,r,e,n),t=Vf(null,t,r,!0,s,n)):(t.tag=0,We&&s&&Rh(t),Nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Jl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=uT(r),e=Mn(r,e),i){case 0:t=zf(null,t,r,e,n);break e;case 1:t=yv(null,t,r,e,n);break e;case 11:t=gv(null,t,r,e,n);break e;case 14:t=vv(null,t,r,Mn(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mn(r,i),zf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mn(r,i),yv(e,t,r,i,n);case 3:e:{if(Pw(t),e===null)throw Error(Q(387));r=t.pendingProps,s=t.memoizedState,i=s.element,iw(e,t),jc(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=fo(Error(Q(423)),t),t=xv(e,t,r,n,i);break e}else if(r!==i){i=fo(Error(Q(424)),t),t=xv(e,t,r,n,i);break e}else for(nn=ii(t.stateNode.containerInfo.firstChild),on=t,We=!0,In=null,n=nw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(lo(),r===i){t=Er(e,t,n);break e}Nt(e,t,r,n)}t=t.child}return t;case 5:return sw(t),e===null&&If(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Pf(r,i)?o=null:s!==null&&Pf(r,s)&&(t.flags|=32),Rw(e,t),Nt(e,t,o,n),t.child;case 6:return e===null&&If(t),null;case 13:return Mw(e,t,n);case 4:return Fh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=co(t,null,r,n):Nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mn(r,i),gv(e,t,r,i,n);case 7:return Nt(e,t,t.pendingProps,n),t.child;case 8:return Nt(e,t,t.pendingProps.children,n),t.child;case 12:return Nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Le(Ec,r._currentValue),r._currentValue=o,s!==null)if(Vn(s.value,o)){if(s.children===i.children&&!Gt.current){t=Er(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=kr(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Lf(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Q(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Lf(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hs(t,n),i=_n(i),r=r(i),t.flags|=1,Nt(e,t,r,n),t.child;case 14:return r=t.type,i=Mn(r,t.pendingProps),i=Mn(r.type,i),vv(e,t,r,i,n);case 15:return Aw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Mn(r,i),Jl(e,t),t.tag=1,Yt(r)?(e=!0,Cc(t)):e=!1,Hs(t,n),_w(t,r,i),Bf(t,r,i,n),Vf(null,t,r,!0,e,n);case 19:return Ow(e,t,n);case 22:return jw(e,t,n)}throw Error(Q(156,t.tag))};function Qw(e,t){return k1(e,t)}function cT(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 kn(e,t,n,r){return new cT(e,t,n,r)}function Jh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function uT(e){if(typeof e=="function")return Jh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yh)return 11;if(e===xh)return 14}return 2}function li(e,t){var n=e.alternate;return n===null?(n=kn(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 nc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")Jh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ss:return Wi(n.children,i,s,t);case vh:o=8,i|=8;break;case cf:return e=kn(12,n,t,i|2),e.elementType=cf,e.lanes=s,e;case uf:return e=kn(13,n,t,i),e.elementType=uf,e.lanes=s,e;case df:return e=kn(19,n,t,i),e.elementType=df,e.lanes=s,e;case s1:return mu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case r1:o=10;break e;case i1:o=9;break e;case yh:o=11;break e;case xh:o=14;break e;case Fr:o=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=kn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Wi(e,t,n,r){return e=kn(7,e,r,t),e.lanes=n,e}function mu(e,t,n,r){return e=kn(22,e,r,t),e.elementType=s1,e.lanes=n,e.stateNode={isHidden:!1},e}function Cd(e,t,n){return e=kn(6,e,null,t),e.lanes=n,e}function _d(e,t,n){return t=kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dT(e,t,n,r,i){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=sd(0),this.expirationTimes=sd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function em(e,t,n,r,i,s,o,a,l){return e=new dT(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=kn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lh(s),e}function fT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ks,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Kw(e){if(!e)return fi;e=e._reactInternals;e:{if(os(e)!==e||e.tag!==1)throw Error(Q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Yt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Q(171))}if(e.tag===1){var n=e.type;if(Yt(n))return K1(e,n,t)}return t}function Xw(e,t,n,r,i,s,o,a,l){return e=em(n,r,!0,e,i,s,o,a,l),e.context=Kw(null),n=e.current,r=It(),i=ai(n),s=kr(r,i),s.callback=t??null,si(n,s,i),e.current.lanes=i,el(e,i,r),Qt(e,r),e}function gu(e,t,n,r){var i=t.current,s=It(),o=ai(i);return n=Kw(n),t.context===null?t.context=n:t.pendingContext=n,t=kr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=si(i,t,o),e!==null&&($n(e,i,o,s),Kl(e,i,o)),o}function Lc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function jv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function tm(e,t){jv(e,t),(e=e.alternate)&&jv(e,t)}function pT(){return null}var Zw=typeof reportError=="function"?reportError:function(e){console.error(e)};function nm(e){this._internalRoot=e}vu.prototype.render=nm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));gu(e,t,null,null)};vu.prototype.unmount=nm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){gu(null,e,null,null)}),t[_r]=null}};function vu(e){this._internalRoot=e}vu.prototype.unstable_scheduleHydration=function(e){if(e){var t=j1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zr.length&&t!==0&&t<zr[n].priority;n++);zr.splice(n,0,e),n===0&&P1(e)}};function rm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function yu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rv(){}function hT(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Lc(o);s.call(c)}}var o=Xw(t,r,e,0,null,!1,!1,"",Rv);return e._reactRootContainer=o,e[_r]=o.current,_a(e.nodeType===8?e.parentNode:e),ts(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Lc(l);a.call(c)}}var l=em(e,0,!1,null,null,!1,!1,"",Rv);return e._reactRootContainer=l,e[_r]=l.current,_a(e.nodeType===8?e.parentNode:e),ts(function(){gu(t,l,n,r)}),l}function xu(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Lc(o);a.call(l)}}gu(t,o,e,i)}else o=hT(n,t,e,i,r);return Lc(o)}E1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Go(t.pendingLanes);n!==0&&(kh(t,n|1),Qt(t,it()),!(Ae&6)&&(po=it()+500,xi()))}break;case 13:ts(function(){var r=Tr(e,1);if(r!==null){var i=It();$n(r,e,1,i)}}),tm(e,1)}};Sh=function(e){if(e.tag===13){var t=Tr(e,134217728);if(t!==null){var n=It();$n(t,e,134217728,n)}tm(e,134217728)}};A1=function(e){if(e.tag===13){var t=ai(e),n=Tr(e,t);if(n!==null){var r=It();$n(n,e,t,r)}tm(e,t)}};j1=function(){return Pe};R1=function(e,t){var n=Pe;try{return Pe=e,t()}finally{Pe=n}};bf=function(e,t,n){switch(t){case"input":if(hf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=cu(r);if(!i)throw Error(Q(90));a1(r),hf(r,i)}}}break;case"textarea":c1(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};g1=Kh;v1=ts;var mT={usingClientEntryPoint:!1,Events:[nl,Es,cu,h1,m1,Kh]},$o={findFiberByHostInstance:Pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gT={bundleType:$o.bundleType,version:$o.version,rendererPackageName:$o.rendererPackageName,rendererConfig:$o.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Pr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=w1(e),e===null?null:e.stateNode},findFiberByHostInstance:$o.findFiberByHostInstance||pT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pl.isDisabled&&Pl.supportsFiber)try{su=Pl.inject(gT),tr=Pl}catch{}}ln.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mT;ln.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rm(t))throw Error(Q(200));return fT(e,t,null,n)};ln.createRoot=function(e,t){if(!rm(e))throw Error(Q(299));var n=!1,r="",i=Zw;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=em(e,1,!1,null,null,n,!1,r,i),e[_r]=t.current,_a(e.nodeType===8?e.parentNode:e),new nm(t)};ln.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Q(188)):(e=Object.keys(e).join(","),Error(Q(268,e)));return e=w1(t),e=e===null?null:e.stateNode,e};ln.flushSync=function(e){return ts(e)};ln.hydrate=function(e,t,n){if(!yu(t))throw Error(Q(200));return xu(null,e,t,!0,n)};ln.hydrateRoot=function(e,t,n){if(!rm(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Zw;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Xw(t,null,e,1,n??null,i,!1,s,o),e[_r]=t.current,_a(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new vu(t)};ln.render=function(e,t,n){if(!yu(t))throw Error(Q(200));return xu(null,e,t,!1,n)};ln.unmountComponentAtNode=function(e){if(!yu(e))throw Error(Q(40));return e._reactRootContainer?(ts(function(){xu(null,null,e,!1,function(){e._reactRootContainer=null,e[_r]=null})}),!0):!1};ln.unstable_batchedUpdates=Kh;ln.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!yu(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return xu(e,t,n,!1,r)};ln.version="18.3.1-next-f1338f8080-20240426";function Jw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jw)}catch(e){console.error(e)}}Jw(),Jx.exports=ln;var eb=Jx.exports;const vT=Rr(eb);var tb,Pv=eb;tb=Pv.createRoot,Pv.hydrateRoot;const yT="@alfatech/livechat",xT="v2026.04.09.1",wT="module",bT="https://api.chatier.app",kT="wss://api.chatier.app",ST=["dist","README.md","component/chatier.js"],CT="dist/widget.js",_T={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},TT={dev:"vite",dev2:"vite --config vite.config.2.ts",build:"tsc -b && vite build",lint:"biome lint --write",prepare:"husky",format:"biome format --write && yarn lint",preview:"vite preview","build:mobile":"tsc -b && vite build --config vite.config.app.ts && mv dist-app/index-app.html dist-app/index.html","preview:mobile":"vite preview --config vite.config.app.ts --outDir dist-app","dev:mobile":"vite --config vite.config.app.ts"},ET={"@headlessui/react":"^2.2.2","@tailwindcss/vite":"^4.1.4","@tanstack/react-query":"^5.59.20",classnames:"^2.5.1",dayjs:"^1.11.13",formik:"^2.4.6","framer-motion":"^12.7.4","lucide-react":"^0.511.0",react:"^18.3.1","react-dom":"^18.3.1","react-dropzone":"^14.3.8","react-router-dom":"^6.26.2","socket.io-client":"^4.8.1",sonner:"^2.0.1",yup:"^1.4.0",zustand:"^4.5.5"},AT={"@biomejs/biome":"^1.8.3","@types/node":"^22.5.4","@types/react":"^18.3.3","@types/react-dom":"^18.3.0","@vitejs/plugin-react-swc":"^3.5.0",globals:"^15.9.0",husky:"^9.1.5",tailwindcss:"^4.1.4",typescript:"^5.5.3",vite:"^5.4.1"},nb={name:yT,private:!1,version:xT,type:wT,apiURL:bT,wsURL:kT,files:ST,main:CT,author:_T,scripts:TT,dependencies:ET,devDependencies:AT,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},rb=nb.apiURL,jT=nb.wsURL,RT=e=>[{limit:Number.parseInt(e.headers.get("X-Ratelimit-Limit")||"0"),remaining:Number.parseInt(e.headers.get("X-Ratelimit-Remaining")||"0"),reset:Number.parseInt(e.headers.get("X-Ratelimit-Reset")||"0"),retryAfter:Number.parseInt(e.headers.get("Retry-After")||"0")},429],PT=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],MT={429:RT,404:PT};async function Mr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${rb}/${e}`,{...t,credentials:"include",headers:{...t.headers,...n}}).catch(s=>new Response(null,{status:500}));if(!r.ok){let s={};try{return s=await r.json(),[s,r.status]}catch{}const o=MT[r.status];return o?o(r,s):[{},r.status]}const i=r.headers.get("Content-Type");return i&&i.includes("application/json")?[await r.json(),r.status]:[await r.text(),r.status]}const zn=e=>[200,201,204].includes(e),OT=(e,{arrayWithBrackets:t=!1,arrayWithBracketAndIndex:n=!0}={})=>{const r=new FormData;for(const[i,s]of Object.entries(e)){if(Array.isArray(s)){for(const o in s)t?r.append(`${i}[]`,s[o]):n?r.append(`${i}[${o}]`,s[o]):r.append(i,s[o]);continue}typeof s<"u"&&s!==null&&r.append(i,s)}return r};var _o=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ns=typeof window>"u"||"Deno"in globalThis;function yn(){}function NT(e,t){return typeof e=="function"?e(t):e}function ep(e){return typeof e=="number"&&e>=0&&e!==1/0}function ib(e,t){return Math.max(e+(t||0)-Date.now(),0)}function qs(e,t){return typeof e=="function"?e(t):e}function Ln(e,t){return typeof e=="function"?e(t):e}function Mv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==im(o,t.options))return!1}else if(!Na(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Ov(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(rs(t.options.mutationKey)!==rs(s))return!1}else if(!Na(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function im(e,t){return((t==null?void 0:t.queryKeyHashFn)||rs)(e)}function rs(e){return JSON.stringify(e,(t,n)=>tp(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Na(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Na(e[n],t[n])):!1}function sb(e,t){if(e===t)return e;const n=Nv(e)&&Nv(t);if(n||tp(e)&&tp(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let c=0;c<o;c++){const d=n?c:s[c];(!n&&r.includes(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=sb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Fc(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Nv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function tp(e){if(!Dv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Dv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Dv(e){return Object.prototype.toString.call(e)==="[object Object]"}function DT(e){return new Promise(t=>{setTimeout(t,e)})}function np(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?sb(e,t):t}function IT(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function LT(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var sm=Symbol();function ob(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===sm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Li,Ur,Gs,Mx,FT=(Mx=class extends _o{constructor(){super();me(this,Li);me(this,Ur);me(this,Gs);oe(this,Gs,t=>{if(!ns&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,Ur)||this.setEventListener(T(this,Gs))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Ur))==null||t.call(this),oe(this,Ur,void 0))}setEventListener(t){var n;oe(this,Gs,t),(n=T(this,Ur))==null||n.call(this),oe(this,Ur,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,Li)!==t&&(oe(this,Li,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,Li)=="boolean"?T(this,Li):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Li=new WeakMap,Ur=new WeakMap,Gs=new WeakMap,Mx),om=new FT,Ys,Hr,Qs,Ox,BT=(Ox=class extends _o{constructor(){super();me(this,Ys,!0);me(this,Hr);me(this,Qs);oe(this,Qs,t=>{if(!ns&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,Hr)||this.setEventListener(T(this,Qs))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Hr))==null||t.call(this),oe(this,Hr,void 0))}setEventListener(t){var n;oe(this,Qs,t),(n=T(this,Hr))==null||n.call(this),oe(this,Hr,t(this.setOnline.bind(this)))}setOnline(t){T(this,Ys)!==t&&(oe(this,Ys,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,Ys)}},Ys=new WeakMap,Hr=new WeakMap,Qs=new WeakMap,Ox),Bc=new BT;function rp(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function $T(e){return Math.min(1e3*2**e,3e4)}function ab(e){return(e??"online")==="online"?Bc.isOnline():!0}var lb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Td(e){return e instanceof lb}function cb(e){let t=!1,n=0,r=!1,i;const s=rp(),o=x=>{var w;r||(p(new lb(x)),(w=e.abort)==null||w.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>om.isFocused()&&(e.networkMode==="always"||Bc.isOnline())&&e.canRun(),d=()=>ab(e.networkMode)&&e.canRun(),u=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),i==null||i(),s.resolve(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),i==null||i(),s.reject(x))},h=()=>new Promise(x=>{var w;i=m=>{(r||c())&&x(m)},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;i=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;const w=n===0?e.initialPromise:void 0;try{x=w??e.fn()}catch(m){x=Promise.reject(m)}Promise.resolve(x).then(u).catch(m=>{var _;if(r)return;const g=e.retry??(ns?0:3),b=e.retryDelay??$T,C=typeof b=="function"?b(n,m):b,S=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,m);if(t||!S){p(m);return}n++,(_=e.onFail)==null||_.call(e,n,m),DT(C).then(()=>c()?void 0:h()).then(()=>{t?p(m):y()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():h().then(y),s)}}function zT(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var ut=zT(),Fi,Nx,ub=(Nx=class{constructor(){me(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ep(this.gcTime)&&oe(this,Fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ns?1/0:5*60*1e3))}clearGcTimeout(){T(this,Fi)&&(clearTimeout(T(this,Fi)),oe(this,Fi,void 0))}},Fi=new WeakMap,Nx),Ks,Xs,vn,Tt,Qa,Bi,On,hr,Dx,VT=(Dx=class extends ub{constructor(t){super();me(this,On);me(this,Ks);me(this,Xs);me(this,vn);me(this,Tt);me(this,Qa);me(this,Bi);oe(this,Bi,!1),oe(this,Qa,t.defaultOptions),this.setOptions(t.options),this.observers=[],oe(this,vn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,oe(this,Ks,UT(this.options)),this.state=t.state??T(this,Ks),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,Tt))==null?void 0:t.promise}setOptions(t){this.options={...T(this,Qa),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,vn).remove(this)}setData(t,n){const r=np(this.state.data,t,this.options);return be(this,On,hr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){be(this,On,hr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=T(this,Tt))==null?void 0:r.promise;return(i=T(this,Tt))==null||i.cancel(t),n?n.then(yn).catch(yn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,Ks))}isActive(){return this.observers.some(t=>Ln(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!ib(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Tt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,Tt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,vn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,Tt)&&(T(this,Bi)?T(this,Tt).cancel({revert:!0}):T(this,Tt).cancelRetry()),this.scheduleGc()),T(this,vn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||be(this,On,hr).call(this,{type:"invalidate"})}fetch(t,n){var l,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,Tt))return T(this,Tt).continueRetry(),T(this,Tt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(p=>p.options.queryFn);u&&this.setOptions(u.options)}const r=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(oe(this,Bi,!0),r.signal)})},s=()=>{const u=ob(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),oe(this,Bi,!1),this.options.persister?this.options.persister(u,p,this):u(p)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),oe(this,Xs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&be(this,On,hr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,h,y,x;Td(u)&&u.silent||be(this,On,hr).call(this,{type:"error",error:u}),Td(u)||((h=(p=T(this,vn).config).onError)==null||h.call(p,u,this),(x=(y=T(this,vn).config).onSettled)==null||x.call(y,this.state.data,u,this)),this.scheduleGc()};return oe(this,Tt,cb({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var p,h,y,x;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(w){a(w);return}(h=(p=T(this,vn).config).onSuccess)==null||h.call(p,u,this),(x=(y=T(this,vn).config).onSettled)==null||x.call(y,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{be(this,On,hr).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{be(this,On,hr).call(this,{type:"pause"})},onContinue:()=>{be(this,On,hr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),T(this,Tt).start()}},Ks=new WeakMap,Xs=new WeakMap,vn=new WeakMap,Tt=new WeakMap,Qa=new WeakMap,Bi=new WeakMap,On=new WeakSet,hr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...db(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Td(i)&&i.revert&&T(this,Xs)?{...T(this,Xs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,vn).notify({query:this,type:"updated",action:t})})},Dx);function db(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ab(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function UT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Kn,Ix,HT=(Ix=class extends _o{constructor(t={}){super();me(this,Kn);this.config=t,oe(this,Kn,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??im(i,n);let o=this.get(s);return o||(o=new VT({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){T(this,Kn).has(t.queryHash)||(T(this,Kn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,Kn).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,Kn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,Kn).get(t)}getAll(){return[...T(this,Kn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Mv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Mv(t,r)):n}notify(t){ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Kn=new WeakMap,Ix),Xn,Mt,$i,Zn,Ir,Lx,WT=(Lx=class extends ub{constructor(t){super();me(this,Zn);me(this,Xn);me(this,Mt);me(this,$i);this.mutationId=t.mutationId,oe(this,Mt,t.mutationCache),oe(this,Xn,[]),this.state=t.state||fb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Xn).includes(t)||(T(this,Xn).push(t),this.clearGcTimeout(),T(this,Mt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){oe(this,Xn,T(this,Xn).filter(n=>n!==t)),this.scheduleGc(),T(this,Mt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Xn).length||(this.state.status==="pending"?this.scheduleGc():T(this,Mt).remove(this))}continue(){var t;return((t=T(this,$i))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,p,h,y,x,w,m,g,b,C,S,_,j;oe(this,$i,cb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,E)=>{be(this,Zn,Ir).call(this,{type:"failed",failureCount:A,error:E})},onPause:()=>{be(this,Zn,Ir).call(this,{type:"pause"})},onContinue:()=>{be(this,Zn,Ir).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Mt).canRun(this)}));const n=this.state.status==="pending",r=!T(this,$i).canStart();try{if(!n){be(this,Zn,Ir).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=T(this,Mt).config).onMutate)==null?void 0:s.call(i,t,this));const E=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));E!==this.state.context&&be(this,Zn,Ir).call(this,{type:"pending",context:E,variables:t,isPaused:r})}const A=await T(this,$i).start();return await((c=(l=T(this,Mt).config).onSuccess)==null?void 0:c.call(l,A,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,A,t,this.state.context)),await((h=(p=T(this,Mt).config).onSettled)==null?void 0:h.call(p,A,null,this.state.variables,this.state.context,this)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,A,null,t,this.state.context)),be(this,Zn,Ir).call(this,{type:"success",data:A}),A}catch(A){try{throw await((m=(w=T(this,Mt).config).onError)==null?void 0:m.call(w,A,t,this.state.context,this)),await((b=(g=this.options).onError)==null?void 0:b.call(g,A,t,this.state.context)),await((S=(C=T(this,Mt).config).onSettled)==null?void 0:S.call(C,void 0,A,this.state.variables,this.state.context,this)),await((j=(_=this.options).onSettled)==null?void 0:j.call(_,void 0,A,t,this.state.context)),A}finally{be(this,Zn,Ir).call(this,{type:"error",error:A})}}finally{T(this,Mt).runNext(this)}}},Xn=new WeakMap,Mt=new WeakMap,$i=new WeakMap,Zn=new WeakSet,Ir=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ut.batch(()=>{T(this,Xn).forEach(r=>{r.onMutationUpdate(t)}),T(this,Mt).notify({mutation:this,type:"updated",action:t})})},Lx);function fb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Zt,Ka,Fx,qT=(Fx=class extends _o{constructor(t={}){super();me(this,Zt);me(this,Ka);this.config=t,oe(this,Zt,new Map),oe(this,Ka,Date.now())}build(t,n,r){const i=new WT({mutationCache:this,mutationId:++hl(this,Ka)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=Ml(t),r=T(this,Zt).get(n)??[];r.push(t),T(this,Zt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Ml(t);if(T(this,Zt).has(n)){const i=(r=T(this,Zt).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?T(this,Zt).delete(n):T(this,Zt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=T(this,Zt).get(Ml(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=T(this,Zt).get(Ml(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...T(this,Zt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Ov(n,r))}findAll(t={}){return this.getAll().filter(n=>Ov(t,n))}notify(t){ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ut.batch(()=>Promise.all(t.map(n=>n.continue().catch(yn))))}},Zt=new WeakMap,Ka=new WeakMap,Fx);function Ml(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Iv(e){return{onFetch:(t,n)=>{var d,u,p,h,y;const r=t.options,i=(p=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:p.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let x=!1;const w=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},m=ob(t.options,t.fetchOptions),g=async(b,C,S)=>{if(x)return Promise.reject();if(C==null&&b.pages.length)return Promise.resolve(b);const _={queryKey:t.queryKey,pageParam:C,direction:S?"backward":"forward",meta:t.options.meta};w(_);const j=await m(_),{maxPages:A}=t.options,E=S?LT:IT;return{pages:E(b.pages,j,A),pageParams:E(b.pageParams,C,A)}};if(i&&s.length){const b=i==="backward",C=b?GT:Lv,S={pages:s,pageParams:o},_=C(r,S);a=await g(S,_,b)}else{const b=e??s.length;do{const C=l===0?o[0]??r.initialPageParam:Lv(r,a);if(l>0&&C==null)break;a=await g(a,C),l++}while(l<b)}return a};t.options.persister?t.fetchFn=()=>{var x,w;return(w=(x=t.options).persister)==null?void 0:w.call(x,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Lv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function GT(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Je,Wr,qr,Zs,Js,Gr,eo,to,Bx,YT=(Bx=class{constructor(e={}){me(this,Je);me(this,Wr);me(this,qr);me(this,Zs);me(this,Js);me(this,Gr);me(this,eo);me(this,to);oe(this,Je,e.queryCache||new HT),oe(this,Wr,e.mutationCache||new qT),oe(this,qr,e.defaultOptions||{}),oe(this,Zs,new Map),oe(this,Js,new Map),oe(this,Gr,0)}mount(){hl(this,Gr)._++,T(this,Gr)===1&&(oe(this,eo,om.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Je).onFocus())})),oe(this,to,Bc.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Je).onOnline())})))}unmount(){var e,t;hl(this,Gr)._--,T(this,Gr)===0&&((e=T(this,eo))==null||e.call(this),oe(this,eo,void 0),(t=T(this,to))==null||t.call(this),oe(this,to,void 0))}isFetching(e){return T(this,Je).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,Wr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Je).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=T(this,Je).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(qs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return T(this,Je).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=T(this,Je).get(r.queryHash),s=i==null?void 0:i.state.data,o=NT(t,s);if(o!==void 0)return T(this,Je).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return ut.batch(()=>T(this,Je).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Je).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,Je);ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,Je),r={type:"active",...e};return ut.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ut.batch(()=>T(this,Je).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(yn).catch(yn)}invalidateQueries(e,t={}){return ut.batch(()=>{if(T(this,Je).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ut.batch(()=>T(this,Je).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(yn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(yn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,Je).build(this,t);return n.isStaleByTime(qs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yn).catch(yn)}fetchInfiniteQuery(e){return e.behavior=Iv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yn).catch(yn)}ensureInfiniteQueryData(e){return e.behavior=Iv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Bc.isOnline()?T(this,Wr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Je)}getMutationCache(){return T(this,Wr)}getDefaultOptions(){return T(this,qr)}setDefaultOptions(e){oe(this,qr,e)}setQueryDefaults(e,t){T(this,Zs).set(rs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,Zs).values()],n={};return t.forEach(r=>{Na(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,Js).set(rs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,Js).values()];let n={};return t.forEach(r=>{Na(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,qr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=im(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===sm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,qr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,Je).clear(),T(this,Wr).clear()}},Je=new WeakMap,Wr=new WeakMap,qr=new WeakMap,Zs=new WeakMap,Js=new WeakMap,Gr=new WeakMap,eo=new WeakMap,to=new WeakMap,Bx),zt,Te,Xa,Ot,zi,no,Yr,Jn,Za,ro,io,Vi,Ui,Qr,so,je,Qo,ip,sp,op,ap,lp,cp,up,pb,$x,QT=($x=class extends _o{constructor(t,n){super();me(this,je);me(this,zt);me(this,Te);me(this,Xa);me(this,Ot);me(this,zi);me(this,no);me(this,Yr);me(this,Jn);me(this,Za);me(this,ro);me(this,io);me(this,Vi);me(this,Ui);me(this,Qr);me(this,so,new Set);this.options=n,oe(this,zt,t),oe(this,Jn,null),oe(this,Yr,rp()),this.options.experimental_prefetchInRender||T(this,Yr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Te).addObserver(this),Fv(T(this,Te),this.options)?be(this,je,Qo).call(this):this.updateResult(),be(this,je,ap).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dp(T(this,Te),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dp(T(this,Te),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,be(this,je,lp).call(this),be(this,je,cp).call(this),T(this,Te).removeObserver(this)}setOptions(t,n){const r=this.options,i=T(this,Te);if(this.options=T(this,zt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ln(this.options.enabled,T(this,Te))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");be(this,je,up).call(this),T(this,Te).setOptions(this.options),r._defaulted&&!Fc(this.options,r)&&T(this,zt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Te),observer:this});const s=this.hasListeners();s&&Bv(T(this,Te),i,this.options,r)&&be(this,je,Qo).call(this),this.updateResult(n),s&&(T(this,Te)!==i||Ln(this.options.enabled,T(this,Te))!==Ln(r.enabled,T(this,Te))||qs(this.options.staleTime,T(this,Te))!==qs(r.staleTime,T(this,Te)))&&be(this,je,ip).call(this);const o=be(this,je,sp).call(this);s&&(T(this,Te)!==i||Ln(this.options.enabled,T(this,Te))!==Ln(r.enabled,T(this,Te))||o!==T(this,Qr))&&be(this,je,op).call(this,o)}getOptimisticResult(t){const n=T(this,zt).getQueryCache().build(T(this,zt),t),r=this.createResult(n,t);return XT(this,r)&&(oe(this,Ot,r),oe(this,no,this.options),oe(this,zi,T(this,Te).state)),r}getCurrentResult(){return T(this,Ot)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){T(this,so).add(t)}getCurrentQuery(){return T(this,Te)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,zt).defaultQueryOptions(t),r=T(this,zt).getQueryCache().build(T(this,zt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return be(this,je,Qo).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Ot)))}createResult(t,n){var A;const r=T(this,Te),i=this.options,s=T(this,Ot),o=T(this,zi),a=T(this,no),c=t!==r?t.state:T(this,Xa),{state:d}=t;let u={...d},p=!1,h;if(n._optimisticResults){const E=this.hasListeners(),L=!E&&Fv(t,n),F=E&&Bv(t,r,n,i);(L||F)&&(u={...u,...db(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:w}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===T(this,Za))h=T(this,ro);else try{oe(this,Za,n.select),h=n.select(u.data),h=np(s==null?void 0:s.data,h,n),oe(this,ro,h),oe(this,Jn,null)}catch(E){oe(this,Jn,E)}else h=u.data;if(n.placeholderData!==void 0&&h===void 0&&w==="pending"){let E;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))E=s.data;else if(E=typeof n.placeholderData=="function"?n.placeholderData((A=T(this,io))==null?void 0:A.state.data,T(this,io)):n.placeholderData,n.select&&E!==void 0)try{E=n.select(E),oe(this,Jn,null)}catch(L){oe(this,Jn,L)}E!==void 0&&(w="success",h=np(s==null?void 0:s.data,E,n),p=!0)}T(this,Jn)&&(y=T(this,Jn),h=T(this,ro),x=Date.now(),w="error");const m=u.fetchStatus==="fetching",g=w==="pending",b=w==="error",C=g&&m,S=h!==void 0,j={status:w,fetchStatus:u.fetchStatus,isPending:g,isSuccess:w==="success",isError:b,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!g,isLoadingError:b&&!S,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:b&&S,isStale:am(t,n),refetch:this.refetch,promise:T(this,Yr)};if(this.options.experimental_prefetchInRender){const E=D=>{j.status==="error"?D.reject(j.error):j.data!==void 0&&D.resolve(j.data)},L=()=>{const D=oe(this,Yr,j.promise=rp());E(D)},F=T(this,Yr);switch(F.status){case"pending":t.queryHash===r.queryHash&&E(F);break;case"fulfilled":(j.status==="error"||j.data!==F.value)&&L();break;case"rejected":(j.status!=="error"||j.error!==F.reason)&&L();break}}return j}updateResult(t){const n=T(this,Ot),r=this.createResult(T(this,Te),this.options);if(oe(this,zi,T(this,Te).state),oe(this,no,this.options),T(this,zi).data!==void 0&&oe(this,io,T(this,Te)),Fc(r,n))return;oe(this,Ot,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!T(this,so).size)return!0;const l=new Set(a??T(this,so));return this.options.throwOnError&&l.add("error"),Object.keys(T(this,Ot)).some(c=>{const d=c;return T(this,Ot)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),be(this,je,pb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&be(this,je,ap).call(this)}},zt=new WeakMap,Te=new WeakMap,Xa=new WeakMap,Ot=new WeakMap,zi=new WeakMap,no=new WeakMap,Yr=new WeakMap,Jn=new WeakMap,Za=new WeakMap,ro=new WeakMap,io=new WeakMap,Vi=new WeakMap,Ui=new WeakMap,Qr=new WeakMap,so=new WeakMap,je=new WeakSet,Qo=function(t){be(this,je,up).call(this);let n=T(this,Te).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(yn)),n},ip=function(){be(this,je,lp).call(this);const t=qs(this.options.staleTime,T(this,Te));if(ns||T(this,Ot).isStale||!ep(t))return;const r=ib(T(this,Ot).dataUpdatedAt,t)+1;oe(this,Vi,setTimeout(()=>{T(this,Ot).isStale||this.updateResult()},r))},sp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Te)):this.options.refetchInterval)??!1},op=function(t){be(this,je,cp).call(this),oe(this,Qr,t),!(ns||Ln(this.options.enabled,T(this,Te))===!1||!ep(T(this,Qr))||T(this,Qr)===0)&&oe(this,Ui,setInterval(()=>{(this.options.refetchIntervalInBackground||om.isFocused())&&be(this,je,Qo).call(this)},T(this,Qr)))},ap=function(){be(this,je,ip).call(this),be(this,je,op).call(this,be(this,je,sp).call(this))},lp=function(){T(this,Vi)&&(clearTimeout(T(this,Vi)),oe(this,Vi,void 0))},cp=function(){T(this,Ui)&&(clearInterval(T(this,Ui)),oe(this,Ui,void 0))},up=function(){const t=T(this,zt).getQueryCache().build(T(this,zt),this.options);if(t===T(this,Te))return;const n=T(this,Te);oe(this,Te,t),oe(this,Xa,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},pb=function(t){ut.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,Ot))}),T(this,zt).getQueryCache().notify({query:T(this,Te),type:"observerResultsUpdated"})})},$x);function KT(e,t){return Ln(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Fv(e,t){return KT(e,t)||e.state.data!==void 0&&dp(e,t,t.refetchOnMount)}function dp(e,t,n){if(Ln(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&am(e,t)}return!1}function Bv(e,t,n,r){return(e!==t||Ln(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&am(e,n)}function am(e,t){return Ln(t.enabled,e)!==!1&&e.isStaleByTime(qs(t.staleTime,e))}function XT(e,t){return!Fc(e.getCurrentResult(),t)}var Kr,Xr,Vt,xr,Sr,rc,fp,zx,ZT=(zx=class extends _o{constructor(t,n){super();me(this,Sr);me(this,Kr);me(this,Xr);me(this,Vt);me(this,xr);oe(this,Kr,t),this.setOptions(n),this.bindMethods(),be(this,Sr,rc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const n=this.options;this.options=T(this,Kr).defaultMutationOptions(t),Fc(this.options,n)||T(this,Kr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Vt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rs(n.mutationKey)!==rs(this.options.mutationKey)?this.reset():((r=T(this,Vt))==null?void 0:r.state.status)==="pending"&&T(this,Vt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=T(this,Vt))==null||t.removeObserver(this)}onMutationUpdate(t){be(this,Sr,rc).call(this),be(this,Sr,fp).call(this,t)}getCurrentResult(){return T(this,Xr)}reset(){var t;(t=T(this,Vt))==null||t.removeObserver(this),oe(this,Vt,void 0),be(this,Sr,rc).call(this),be(this,Sr,fp).call(this)}mutate(t,n){var r;return oe(this,xr,n),(r=T(this,Vt))==null||r.removeObserver(this),oe(this,Vt,T(this,Kr).getMutationCache().build(T(this,Kr),this.options)),T(this,Vt).addObserver(this),T(this,Vt).execute(t)}},Kr=new WeakMap,Xr=new WeakMap,Vt=new WeakMap,xr=new WeakMap,Sr=new WeakSet,rc=function(){var n;const t=((n=T(this,Vt))==null?void 0:n.state)??fb();oe(this,Xr,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},fp=function(t){ut.batch(()=>{var n,r,i,s,o,a,l,c;if(T(this,xr)&&this.hasListeners()){const d=T(this,Xr).variables,u=T(this,Xr).context;(t==null?void 0:t.type)==="success"?((r=(n=T(this,xr)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=T(this,xr)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=T(this,xr)).onError)==null||a.call(o,t.error,d,u),(c=(l=T(this,xr)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(T(this,Xr))})})},zx),hb=v.createContext(void 0),mb=e=>{const t=v.useContext(hb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},JT=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(hb.Provider,{value:e,children:t})),gb=v.createContext(!1),eE=()=>v.useContext(gb);gb.Provider;function tE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var nE=v.createContext(tE()),rE=()=>v.useContext(nE);function vb(e,t){return typeof e=="function"?e(...t):!!e}function pp(){}var iE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},sE=e=>{v.useEffect(()=>{e.clearReset()},[e])},oE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&vb(n,[e.error,r]),aE=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},lE=(e,t)=>e.isLoading&&e.isFetching&&!t,cE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,$v=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function uE(e,t,n){var d,u,p,h,y;const r=mb(),i=eE(),s=rE(),o=r.defaultQueryOptions(e);(u=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||u.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",aE(o),iE(o,s),sE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(x=>{const w=i?pp:l.subscribe(ut.batchCalls(x));return l.updateResult(),w},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),cE(o,c))throw $v(o,l,s);if(oE({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash)}))throw c.error;if((h=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||h.call(p,o,c),o.experimental_prefetchInRender&&!ns&&lE(c,i)){const x=a?$v(o,l,s):(y=r.getQueryCache().get(o.queryHash))==null?void 0:y.promise;x==null||x.catch(pp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function yb(e,t){return uE(e,QT)}function lm(e,t){const n=mb(),[r]=v.useState(()=>new ZT(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(ut.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(pp)},[r]);if(i.error&&vb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const dE=(e,t)=>yb({queryKey:["widgets",e,t],queryFn:()=>fE(e,t),retry:!1,throwOnError:!1}),fE=async(e,t)=>{const n=`widgets/with-link/${e}${t?`?device_id=${t}`:""}`,[r,i]=await Mr(n);if(i===204)throw new Error("User is banned");return r};var k=(e=>(e.Border="widget_border",e.Background="widget_background",e.InputBackground="widget_input_background",e.InputText="widget_input_text",e.InputBorder="widget_input_border",e.ButtonBackground="widget_button_background",e.ButtonText="widget_button_text",e.TooltipBackground="widget_tooltip_background",e.TooltipText="widget_tooltip_text",e.TooltipBorder="widget_tooltip_border",e.HeaderBackground="widget_header_background",e.HeaderText="widget_header_text",e.HeaderBorder="widget_header_border",e.FooterBackground="widget_footer_background",e.FooterText="widget_footer_text",e.FooterBorder="widget_footer_border",e.MessageAdminBackground="widget_message_admin_background",e.MessageAdminText="widget_message_admin_text",e.MessageVisitorBackground="widget_message_visitor_background",e.MessageVisitorText="widget_message_visitor_text",e.MessageAgentBackground="widget_message_agent_background",e.MessageAgentText="widget_message_agent_text",e.GreeterTopBackground="widget_greeter_top_background",e.GreeterTopText="widget_greeter_top_text",e.GreeterBackground="widget_greeter_background",e.GreeterText="widget_greeter_text",e.GreeterBorder="widget_greeter_border",e.GreeterButtonBackground="widget_greeter_button_background",e.GreeterButtonText="widget_greeter_button_text",e.CloseButtonBackground="widget_close_button_background",e.CloseButtonText="widget_close_button_text",e.CloseButtonHover="widget_close_button_hover",e.IconColor="widget_icon_color",e.IconBackground="widget_icon_background",e.ErrorBackground="widget_error_background",e.ErrorText="widget_error_text",e.ErrorBorder="widget_error_border",e.SuccessBackground="widget_success_background",e.SuccessText="widget_success_text",e.SuccessBorder="widget_success_border",e.WarningBackground="widget_warning_background",e.WarningText="widget_warning_text",e.WarningBorder="widget_warning_border",e.LinkColor="widget_link_color",e.LinkHoverColor="widget_link_hover_color",e.DividerColor="widget_divider_color",e.ShadowColor="widget_shadow_color",e.StarActiveColor="widget_star_active_color",e.StarInactiveColor="widget_star_inactive_color",e.ModalOverlayColor="widget_modal_overlay_color",e.ChatCloseConfirmText="widget_chat_close_confirm_text",e.RatingHeaderBackground="widget_rating_header_background",e.RatingHeaderText="widget_rating_header_text",e.RatingSuccessBackground="widget_rating_success_background",e.RatingSuccessText="widget_rating_success_text",e.RatingRateConversationText="widget_rating_rate_conversation_text",e))(k||{}),ne=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.ChatCloseConfirm="chat_close_confirm",e.ChatCloseWarning="chat_close_warning",e.ChatSettings="chat_settings",e.ChatEndConversation="chat_end_conversation",e.CancelAction="cancel_action",e.CloseAction="close_action",e.QuickActions="quick_actions",e.GreetingStartChat="greeting_start_chat",e.RateLimitMessage="rate_limit_message",e.RatingHeaderEvaluate="rating_header_evaluate",e.RatingHeaderThanks="rating_header_thanks",e.RatingDescription="rating_description",e.RatingRateConversation="rating_rate_conversation",e.RatingComment="rating_comment",e.RatingCommentPlaceholder="rating_comment_placeholder",e.RatingSubmit="rating_submit",e.RatingNewConversation="rating_new_conversation",e.RatingThankYouTitle="rating_thank_you_title",e.RatingThankYouDescription="rating_thank_you_description",e.RatingCountdown="rating_countdown",e.RatingMinimumError="rating_minimum_error",e.RatingYourScore="rating_your_score",e.PoweredBy="powered_by",e.NotificationSoundOn="notification_sound_on",e.NotificationSoundOff="notification_sound_off",e))(ne||{}),De=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(De||{});function pE(e){return!!e&&typeof e.public_id=="string"&&typeof e.link_id=="string"&&typeof e.name=="string"&&typeof e.is_browser_notification_enabled=="boolean"&&typeof e.is_hidden_on_offline=="boolean"&&typeof e.is_upload_disabled=="boolean"}/**
|
|
41
41
|
* @remix-run/router v1.21.0
|
|
42
42
|
*
|
|
43
43
|
* Copyright (c) Remix Software Inc.
|
|
@@ -46,7 +46,7 @@ Error generating stack: `+s.message+`
|
|
|
46
46
|
* LICENSE.md file in the root directory of this source tree.
|
|
47
47
|
*
|
|
48
48
|
* @license MIT
|
|
49
|
-
*/function
|
|
49
|
+
*/function $c(){return $c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$c.apply(this,arguments)}var ei;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ei||(ei={}));function hE(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((h,y)=>d(h,typeof h=="string"?null:h.state,y===0?"default":void 0));let s=l(n??i.length-1),o=ei.Pop,a=null;function l(h){return Math.min(Math.max(h,0),i.length-1)}function c(){return i[s]}function d(h,y,x){y===void 0&&(y=null);let w=gE(i?c().pathname:"/",h,y,x);return cm(w.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(h)),w}function u(h){return typeof h=="string"?h:vE(h)}return{get index(){return s},get action(){return o},get location(){return c()},createHref:u,createURL(h){return new URL(u(h),"http://localhost")},encodeLocation(h){let y=typeof h=="string"?as(h):h;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(h,y){o=ei.Push;let x=d(h,y);s+=1,i.splice(s,i.length,x),r&&a&&a({action:o,location:x,delta:1})},replace(h,y){o=ei.Replace;let x=d(h,y);i[s]=x,r&&a&&a({action:o,location:x,delta:0})},go(h){o=ei.Pop;let y=l(s+h),x=i[y];s=y,a&&a({action:o,location:x,delta:h})},listen(h){return a=h,()=>{a=null}}}}function gt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function cm(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function mE(){return Math.random().toString(36).substr(2,8)}function gE(e,t,n,r){return n===void 0&&(n=null),$c({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?as(t):t,{state:n,key:t&&t.key||r||mE()})}function vE(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function as(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var zv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(zv||(zv={}));function yE(e,t,n){return n===void 0&&(n="/"),xE(e,t,n,!1)}function xE(e,t,n,r){let i=typeof t=="string"?as(t):t,s=bb(i.pathname||"/",n);if(s==null)return null;let o=xb(e);wE(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=PE(s);a=jE(o[l],c,r)}return a}function xb(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(gt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=qi([r,l.relativePath]),d=n.concat(l);s.children&&s.children.length>0&&(gt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),xb(s.children,t,d,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:EE(c,s.index),routesMeta:d})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of wb(s.path))i(s,o,l)}),t}function wb(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=wb(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function wE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:AE(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const bE=/^:[\w-]+$/,kE=3,SE=2,CE=1,_E=10,TE=-2,Vv=e=>e==="*";function EE(e,t){let n=e.split("/"),r=n.length;return n.some(Vv)&&(r+=TE),t&&(r+=SE),n.filter(i=>!Vv(i)).reduce((i,s)=>i+(bE.test(s)?kE:s===""?CE:_E),r)}function AE(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function jE(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",u=Uv({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),p=l.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Uv({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:qi([s,u.pathname]),pathnameBase:LE(qi([s,u.pathnameBase])),route:p}),u.pathnameBase!=="/"&&(s=qi([s,u.pathnameBase]))}return o}function Uv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=RE(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,d,u)=>{let{paramName:p,isOptional:h}=d;if(p==="*"){let x=a[u]||"";o=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const y=a[u];return h&&!y?c[p]=void 0:c[p]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function RE(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),cm(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function PE(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return cm(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function bb(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function ME(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?as(e):e;return{pathname:n?n.startsWith("/")?n:OE(n,t):t,search:FE(r),hash:BE(i)}}function OE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Ed(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function NE(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function DE(e,t){let n=NE(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function IE(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=as(e):(i=$c({},e),gt(!i.pathname||!i.pathname.includes("?"),Ed("?","pathname","search",i)),gt(!i.pathname||!i.pathname.includes("#"),Ed("#","pathname","hash",i)),gt(!i.search||!i.search.includes("#"),Ed("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let u=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),u-=1;i.pathname=p.join("/")}a=u>=0?t[u]:"/"}let l=ME(i,a),c=o&&o!=="/"&&o.endsWith("/"),d=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const qi=e=>e.join("/").replace(/\/\/+/g,"/"),LE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),FE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,BE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function $E(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const kb=["post","put","patch","delete"];new Set(kb);const zE=["get",...kb];new Set(zE);/**
|
|
50
50
|
* React Router v6.28.0
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,11 +55,11 @@ Error generating stack: `+s.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function
|
|
58
|
+
*/function Da(){return Da=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Da.apply(this,arguments)}const um=v.createContext(null),VE=v.createContext(null),wu=v.createContext(null),bu=v.createContext(null),To=v.createContext({outlet:null,matches:[],isDataRoute:!1}),Sb=v.createContext(null);function ku(){return v.useContext(bu)!=null}function dm(){return ku()||gt(!1),v.useContext(bu).location}function Cb(e){v.useContext(wu).static||v.useLayoutEffect(e)}function UE(){let{isDataRoute:e}=v.useContext(To);return e?nA():HE()}function HE(){ku()||gt(!1);let e=v.useContext(um),{basename:t,future:n,navigator:r}=v.useContext(wu),{matches:i}=v.useContext(To),{pathname:s}=dm(),o=JSON.stringify(DE(i,n.v7_relativeSplatPath)),a=v.useRef(!1);return Cb(()=>{a.current=!0}),v.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let u=IE(c,JSON.parse(o),s,d.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:qi([t,u.pathname])),(d.replace?r.replace:r.push)(u,d.state,d)},[t,r,o,s,e])}function WE(e,t){return qE(e,t)}function qE(e,t,n,r){ku()||gt(!1);let{navigator:i}=v.useContext(wu),{matches:s}=v.useContext(To),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=dm(),d;if(t){var u;let w=typeof t=="string"?as(t):t;l==="/"||(u=w.pathname)!=null&&u.startsWith(l)||gt(!1),d=w}else d=c;let p=d.pathname||"/",h=p;if(l!=="/"){let w=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=yE(e,{pathname:h}),x=XE(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:qi([l,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:qi([l,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),s,n,r);return t&&x?v.createElement(bu.Provider,{value:{location:Da({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ei.Pop}},x):x}function GE(){let e=tA(),t=$E(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:i},n):null,null)}const YE=v.createElement(GE,null);class QE extends v.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?v.createElement(To.Provider,{value:this.props.routeContext},v.createElement(Sb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function KE(e){let{routeContext:t,match:n,children:r}=e,i=v.useContext(um);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(To.Provider,{value:t},r)}function XE(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let d=o.findIndex(u=>u.route.id&&(a==null?void 0:a[u.route.id])!==void 0);d>=0||gt(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let u=o[d];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(c=d),u.route.id){let{loaderData:p,errors:h}=n,y=u.route.loader&&p[u.route.id]===void 0&&(!h||h[u.route.id]===void 0);if(u.route.lazy||y){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,u,p)=>{let h,y=!1,x=null,w=null;n&&(h=a&&u.route.id?a[u.route.id]:void 0,x=u.route.errorElement||YE,l&&(c<0&&p===0?(y=!0,w=null):c===p&&(y=!0,w=u.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,p+1)),g=()=>{let b;return h?b=x:y?b=w:u.route.Component?b=v.createElement(u.route.Component,null):u.route.element?b=u.route.element:b=d,v.createElement(KE,{match:u,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:b})};return n&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?v.createElement(QE,{location:n.location,revalidation:n.revalidation,component:x,error:h,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()},null)}var _b=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(_b||{}),zc=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(zc||{});function ZE(e){let t=v.useContext(um);return t||gt(!1),t}function JE(e){let t=v.useContext(VE);return t||gt(!1),t}function eA(e){let t=v.useContext(To);return t||gt(!1),t}function Tb(e){let t=eA(),n=t.matches[t.matches.length-1];return n.route.id||gt(!1),n.route.id}function tA(){var e;let t=v.useContext(Sb),n=JE(zc.UseRouteError),r=Tb(zc.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function nA(){let{router:e}=ZE(_b.UseNavigateStable),t=Tb(zc.UseNavigateStable),n=v.useRef(!1);return Cb(()=>{n.current=!0}),v.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Da({fromRouteId:t},s)))},[e,t])}const Hv={};function rA(e,t){Hv[t]||(Hv[t]=!0,console.warn(t))}const Wv=(e,t,n)=>rA(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function iA(e,t){e!=null&&e.v7_startTransition||Wv("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&!t&&Wv("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}const sA="startTransition",qv=o2[sA];function oA(e){let{basename:t,children:n,initialEntries:r,initialIndex:i,future:s}=e,o=v.useRef();o.current==null&&(o.current=hE({initialEntries:r,initialIndex:i,v5Compat:!0}));let a=o.current,[l,c]=v.useState({action:a.action,location:a.location}),{v7_startTransition:d}=s||{},u=v.useCallback(p=>{d&&qv?qv(()=>c(p)):c(p)},[c,d]);return v.useLayoutEffect(()=>a.listen(u),[a,u]),v.useEffect(()=>iA(s),[s]),v.createElement(aA,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:s})}function hp(e){gt(!1)}function aA(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ei.Pop,navigator:s,static:o=!1,future:a}=e;ku()&>(!1);let l=t.replace(/^\/*/,"/"),c=v.useMemo(()=>({basename:l,navigator:s,static:o,future:Da({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=as(r));let{pathname:d="/",search:u="",hash:p="",state:h=null,key:y="default"}=r,x=v.useMemo(()=>{let w=bb(d,l);return w==null?null:{location:{pathname:w,search:u,hash:p,state:h,key:y},navigationType:i}},[l,d,u,p,h,y,i]);return x==null?null:v.createElement(wu.Provider,{value:c},v.createElement(bu.Provider,{children:n,value:x}))}function lA(e){let{children:t,location:n}=e;return WE(mp(t),n)}new Promise(()=>{});function mp(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let s=[...t,i];if(r.type===v.Fragment){n.push.apply(n,mp(r.props.children,s));return}r.type!==hp&>(!1),!r.props.index||!r.props.children||gt(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=mp(r.props.children,s)),n.push(o)}),n}var Eb={exports:{}};/*!
|
|
59
59
|
Copyright (c) 2018 Jed Watson.
|
|
60
60
|
Licensed under the MIT License (MIT), see
|
|
61
61
|
http://jedwatson.github.io/classnames
|
|
62
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Tb);var aj=Tb.exports;const ze=Rr(aj);function lj(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const cj=e=>{switch(e){case"success":return fj;case"info":return hj;case"warning":return pj;case"error":return mj;default:return null}},uj=Array(12).fill(0),dj=({visible:e,className:t})=>J.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},uj.map((n,r)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),fj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),pj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),hj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),mj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),gj=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),vj=()=>{const[e,t]=J.useState(document.hidden);return J.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let mp=1;class yj{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:mp++,o=this.toasts.find(l=>l.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...t,id:s,title:r}),{...l,...t,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],J.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(wj(c)&&!c.ok){s=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...m})}else if(c instanceof Error){s=!1;const u=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...m})}else if(n.success!==void 0){s=!1;const u=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,m=typeof u=="object"?u:{message:u};this.create({id:r,type:"success",description:p,...m})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,p=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:u,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||mp++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ut=new yj,xj=(e,t)=>{const n=(t==null?void 0:t.id)||mp++;return Ut.addToast({title:e,...t,id:n}),n},wj=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",bj=xj,kj=()=>Ut.toasts,Sj=()=>Ut.getActiveToasts(),_b=Object.assign(bj,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:kj,getToasts:Sj});lj("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ml(e){return e.label!==void 0}const Cj=3,Tj="24px",_j="16px",qv=4e3,Ej=356,jj=14,Aj=45,Rj=200;function Wn(...e){return e.filter(Boolean).join(" ")}function Pj(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const Mj=e=>{var t,n,r,i,s,o,a,l,c;const{invert:d,toast:u,unstyled:p,interacting:m,setHeights:y,visibleToasts:w,heights:x,index:h,toasts:g,expanded:k,removeToast:C,defaultRichColors:S,closeButton:T,style:j,cancelButtonStyle:E,actionButtonStyle:A,className:I="",descriptionClassName:N="",duration:D,position:G,gap:B,expandByDefault:F,classNames:M,icons:$,closeButtonAriaLabel:R="Close toast"}=e,[z,U]=J.useState(null),[W,q]=J.useState(null),[ne,oe]=J.useState(!1),[me,ue]=J.useState(!1),[Q,de]=J.useState(!1),[H,te]=J.useState(!1),[O,ee]=J.useState(!1),[K,xe]=J.useState(0),[ge,He]=J.useState(0),ot=J.useRef(u.duration||D||qv),Bt=J.useRef(null),se=J.useRef(null),ve=h===0,Je=h+1<=w,P=u.type,Z=u.dismissible!==!1,L=u.className||"",V=u.descriptionClassName||"",ae=J.useMemo(()=>x.findIndex(be=>be.toastId===u.id)||0,[x,u.id]),fe=J.useMemo(()=>{var be;return(be=u.closeButton)!=null?be:T},[u.closeButton,T]),Ce=J.useMemo(()=>u.duration||D||qv,[u.duration,D]),at=J.useRef(0),vt=J.useRef(0),Vn=J.useRef(0),un=J.useRef(null),[ys,fr]=G.split("-"),Nr=J.useMemo(()=>x.reduce((be,dt,St)=>St>=ae?be:be+dt.height,0),[x,ae]),xs=vj(),Mo=u.invert||d,ki=P==="loading";vt.current=J.useMemo(()=>ae*B+Nr,[ae,Nr]),J.useEffect(()=>{ot.current=Ce},[Ce]),J.useEffect(()=>{oe(!0)},[]),J.useEffect(()=>{const be=se.current;if(be){const dt=be.getBoundingClientRect().height;return He(dt),y(St=>[{toastId:u.id,height:dt,position:u.position},...St]),()=>y(St=>St.filter(Kt=>Kt.toastId!==u.id))}},[y,u.id]),J.useLayoutEffect(()=>{if(!ne)return;const be=se.current,dt=be.style.height;be.style.height="auto";const St=be.getBoundingClientRect().height;be.style.height=dt,He(St),y(Kt=>Kt.find(yt=>yt.toastId===u.id)?Kt.map(yt=>yt.toastId===u.id?{...yt,height:St}:yt):[{toastId:u.id,height:St,position:u.position},...Kt])},[ne,u.title,u.description,y,u.id]);const Un=J.useCallback(()=>{ue(!0),xe(vt.current),y(be=>be.filter(dt=>dt.toastId!==u.id)),setTimeout(()=>{C(u)},Rj)},[u,C,y,vt]);J.useEffect(()=>{if(u.promise&&P==="loading"||u.duration===1/0||u.type==="loading")return;let be;return k||m||xs?(()=>{if(Vn.current<at.current){const Kt=new Date().getTime()-at.current;ot.current=ot.current-Kt}Vn.current=new Date().getTime()})():(()=>{ot.current!==1/0&&(at.current=new Date().getTime(),be=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Un()},ot.current))})(),()=>clearTimeout(be)},[k,m,u,P,xs,Un]),J.useEffect(()=>{u.delete&&Un()},[Un,u.delete]);function $C(){var be;if($!=null&&$.loading){var dt;return J.createElement("div",{className:Wn(M==null?void 0:M.loader,u==null||(dt=u.classNames)==null?void 0:dt.loader,"sonner-loader"),"data-visible":P==="loading"},$.loading)}return J.createElement(dj,{className:Wn(M==null?void 0:M.loader,u==null||(be=u.classNames)==null?void 0:be.loader),visible:P==="loading"})}var yg,xg;return J.createElement("li",{tabIndex:0,ref:se,className:Wn(I,L,M==null?void 0:M.toast,u==null||(t=u.classNames)==null?void 0:t.toast,M==null?void 0:M.default,M==null?void 0:M[P],u==null||(n=u.classNames)==null?void 0:n[P]),"data-sonner-toast":"","data-rich-colors":(yg=u.richColors)!=null?yg:S,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":ne,"data-promise":!!u.promise,"data-swiped":O,"data-removed":me,"data-visible":Je,"data-y-position":ys,"data-x-position":fr,"data-index":h,"data-front":ve,"data-swiping":Q,"data-dismissible":Z,"data-type":P,"data-invert":Mo,"data-swipe-out":H,"data-swipe-direction":W,"data-expanded":!!(k||F&&ne),style:{"--index":h,"--toasts-before":h,"--z-index":g.length-h,"--offset":`${me?K:vt.current}px`,"--initial-height":F?"auto":`${ge}px`,...j,...u.style},onDragEnd:()=>{de(!1),U(null),un.current=null},onPointerDown:be=>{ki||!Z||(Bt.current=new Date,xe(vt.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(de(!0),un.current={x:be.clientX,y:be.clientY}))},onPointerUp:()=>{var be,dt,St;if(H||!Z)return;un.current=null;const Kt=Number(((be=se.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dl=Number(((dt=se.current)==null?void 0:dt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((St=Bt.current)==null?void 0:St.getTime()),dn=z==="x"?Kt:dl,fl=Math.abs(dn)/yt;if(Math.abs(dn)>=Aj||fl>.11){xe(vt.current),u.onDismiss==null||u.onDismiss.call(u,u),q(z==="x"?Kt>0?"right":"left":dl>0?"down":"up"),Un(),te(!0);return}else{var _n,En;(_n=se.current)==null||_n.style.setProperty("--swipe-amount-x","0px"),(En=se.current)==null||En.style.setProperty("--swipe-amount-y","0px")}ee(!1),de(!1),U(null)},onPointerMove:be=>{var dt,St,Kt;if(!un.current||!Z||((dt=window.getSelection())==null?void 0:dt.toString().length)>0)return;const yt=be.clientY-un.current.y,dn=be.clientX-un.current.x;var fl;const _n=(fl=e.swipeDirections)!=null?fl:Pj(G);!z&&(Math.abs(dn)>1||Math.abs(yt)>1)&&U(Math.abs(dn)>Math.abs(yt)?"x":"y");let En={x:0,y:0};const wg=Si=>1/(1.5+Math.abs(Si)/20);if(z==="y"){if(_n.includes("top")||_n.includes("bottom"))if(_n.includes("top")&&yt<0||_n.includes("bottom")&&yt>0)En.y=yt;else{const Si=yt*wg(yt);En.y=Math.abs(Si)<Math.abs(yt)?Si:yt}}else if(z==="x"&&(_n.includes("left")||_n.includes("right")))if(_n.includes("left")&&dn<0||_n.includes("right")&&dn>0)En.x=dn;else{const Si=dn*wg(dn);En.x=Math.abs(Si)<Math.abs(dn)?Si:dn}(Math.abs(En.x)>0||Math.abs(En.y)>0)&&ee(!0),(St=se.current)==null||St.style.setProperty("--swipe-amount-x",`${En.x}px`),(Kt=se.current)==null||Kt.style.setProperty("--swipe-amount-y",`${En.y}px`)}},fe&&!u.jsx&&P!=="loading"?J.createElement("button",{"aria-label":R,"data-disabled":ki,"data-close-button":!0,onClick:ki||!Z?()=>{}:()=>{Un(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Wn(M==null?void 0:M.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(xg=$==null?void 0:$.close)!=null?xg:gj):null,P||u.icon||u.promise?J.createElement("div",{"data-icon":"",className:Wn(M==null?void 0:M.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||$C():null,u.type!=="loading"?u.icon||($==null?void 0:$[P])||cj(P):null):null,J.createElement("div",{"data-content":"",className:Wn(M==null?void 0:M.content,u==null||(s=u.classNames)==null?void 0:s.content)},J.createElement("div",{"data-title":"",className:Wn(M==null?void 0:M.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?J.createElement("div",{"data-description":"",className:Wn(N,V,M==null?void 0:M.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),J.isValidElement(u.cancel)?u.cancel:u.cancel&&Ml(u.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||E,onClick:be=>{Ml(u.cancel)&&Z&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,be),Un())},className:Wn(M==null?void 0:M.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,J.isValidElement(u.action)?u.action:u.action&&Ml(u.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||A,onClick:be=>{Ml(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,be),!be.defaultPrevented&&Un())},className:Wn(M==null?void 0:M.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function Gv(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Oj(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?_j:Tj;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const Nj=J.forwardRef(function(t,n){const{invert:r,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:p,duration:m,style:y,visibleToasts:w=Cj,toastOptions:x,dir:h=Gv(),gap:g=jj,icons:k,containerAriaLabel:C="Notifications"}=t,[S,T]=J.useState([]),j=J.useMemo(()=>Array.from(new Set([i].concat(S.filter(W=>W.position).map(W=>W.position)))),[S,i]),[E,A]=J.useState([]),[I,N]=J.useState(!1),[D,G]=J.useState(!1),[B,F]=J.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=J.useRef(null),$=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=J.useRef(null),z=J.useRef(!1),U=J.useCallback(W=>{T(q=>{var ne;return(ne=q.find(oe=>oe.id===W.id))!=null&&ne.delete||Ut.dismiss(W.id),q.filter(({id:oe})=>oe!==W.id)})},[]);return J.useEffect(()=>Ut.subscribe(W=>{if(W.dismiss){const q=S.map(ne=>ne.id===W.id?{...ne,delete:!0}:ne);requestAnimationFrame(()=>{T(q)});return}setTimeout(()=>{m_.flushSync(()=>{T(q=>{const ne=q.findIndex(oe=>oe.id===W.id);return ne!==-1?[...q.slice(0,ne),{...q[ne],...W},...q.slice(ne+1)]:[W,...q]})})})}),[S]),J.useEffect(()=>{if(u!=="system"){F(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?F("dark"):F("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:q})=>{F(q?"dark":"light")})}catch{W.addListener(({matches:ne})=>{try{F(ne?"dark":"light")}catch(oe){console.error(oe)}})}},[u]),J.useEffect(()=>{S.length<=1&&N(!1)},[S]),J.useEffect(()=>{const W=q=>{var ne;if(s.every(ue=>q[ue]||q.code===ue)){var me;N(!0),(me=M.current)==null||me.focus()}q.code==="Escape"&&(document.activeElement===M.current||(ne=M.current)!=null&&ne.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[s]),J.useEffect(()=>{if(M.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,z.current=!1)}},[M.current]),J.createElement("section",{ref:n,"aria-label":`${C} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((W,q)=>{var ne;const[oe,me]=W.split("-");return S.length?J.createElement("ol",{key:W,dir:h==="auto"?Gv():h,tabIndex:-1,ref:M,className:l,"data-sonner-toaster":!0,"data-sonner-theme":B,"data-y-position":oe,"data-lifted":I&&S.length>1&&!o,"data-x-position":me,style:{"--front-toast-height":`${((ne=E[0])==null?void 0:ne.height)||0}px`,"--width":`${Ej}px`,"--gap":`${g}px`,...y,...Oj(c,d)},onBlur:ue=>{z.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(z.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||z.current||(z.current=!0,R.current=ue.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{D||N(!1)},onDragEnd:()=>N(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},S.filter(ue=>!ue.position&&q===0||ue.position===W).map((ue,Q)=>{var de,H;return J.createElement(Mj,{key:ue.id,icons:k,index:Q,toast:ue,defaultRichColors:p,duration:(de=x==null?void 0:x.duration)!=null?de:m,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:r,visibleToasts:w,closeButton:(H=x==null?void 0:x.closeButton)!=null?H:a,interacting:D,position:W,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,closeButtonAriaLabel:x==null?void 0:x.closeButtonAriaLabel,removeToast:U,toasts:S.filter(te=>te.position==ue.position),heights:E.filter(te=>te.position==ue.position),setHeights:A,expandByDefault:o,gap:g,expanded:I,swipeDirections:t.swipeDirections})})):null}))});function er(e){return _b.custom(t=>f.jsx(Dj,{id:t,title:e.title,description:e.description,variant:e.variant}))}const Ed={success:{bg:"bg-green-100 border-green-200",text:"text-green-800"},error:{bg:"bg-red-100 border-red-200",text:"text-red-800"},warning:{bg:"bg-orange-100 border-orange-200",text:"text-orange-800"},info:{bg:"bg-blue-100 border-blue-200",text:"text-blue-800"}};function Dj(e){const{title:t,description:n,button:r,id:i,variant:s}=e;return f.jsxs("div",{className:ze("flex rounded-lg shadow-lg ring-1 ring-black/5 w-full md:max-w-[364px] items-center p-3 backdrop-blur-sm border mb-2",Ed[s||"info"].bg),children:[f.jsx("div",{className:"flex flex-1 items-center",children:f.jsxs("div",{className:"w-full",children:[t&&f.jsx("p",{className:ze("text-sm font-medium",Ed[s||"info"].text),children:t}),f.jsx("p",{className:ze("text-sm",Ed[s||"info"].text,{"mt-1":!!t}),children:n})]})}),r&&f.jsx("div",{className:"ml-5 shrink-0 rounded-md text-sm font-medium text-indigo-600 hover:text-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden",children:f.jsx("button",{className:"rounded bg-indigo-50 px-3 py-1 text-sm font-semibold text-indigo-600 hover:bg-indigo-100",onClick:()=>{r.onClick(),_b.dismiss(i)},children:r.label})})]})}function Ij(e){return Array.isArray(e)&&e[0].field!==void 0}const ho=(e,t)=>{var n;if(Ij(e)){for(const r of e)(n=t==null?void 0:t.form)==null||n.setFieldError(r.field,r.message);return}if(e&&e.message){t!=null&&t.noToast||er({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||er({description:e.error,variant:"error"});return}},Lj=[{code:429,text:"Çok fazla istek gönderdiniz. Lütfen biraz bekleyin"},{code:401,text:"Bu işlemi yapabilmek için giriş yapmalısınız"},{code:403,text:"Bu işlemi yapabilmek için yetkiniz yok"},{code:500,text:"Sunucu hatası oluştu"},{code:422,text:"Form doğrulaması başarısız oldu"},{code:413,text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],Fj=[{code:"FST_REQ_FILE_TOO_LARGE",text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],Bj=(e,t)=>{if($n(t))return!1;if(e===null)return er({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=Fj.find(s=>s.code===r);if(i)return er({description:i.text,variant:"error"}),!0}if(e.message)return er({description:e.message,variant:"error"}),!0}const n=Lj.find(r=>r.code===t);return er({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},$j={xs:{default:"!p-1",rounded:"!p-1"},sm:{default:"text-xs px-2 py-1.5",rounded:"p-1.5"},md:{default:"text-xs px-3 py-1.5",rounded:"p-2"},lg:{default:"text-sm px-4 py-2",rounded:"p-2.5"},xl:{default:"text-base px-5 py-3",rounded:"p-3"}},Yv={primary:{solid:"!border !border-transparent transition-colors",outline:"!bg-transparent !border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},secondary:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},danger:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},success:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},warning:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"}},dm=v.createContext({});function ku(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const fm=typeof window<"u",Eb=fm?v.useLayoutEffect:v.useEffect,Su=v.createContext(null),pm=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class zj extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Vj({children:e,isPresent:t,anchorX:n}){const r=v.useId(),i=v.useRef(null),s=v.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=v.useContext(pm);return v.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:d,right:u}=s.current;if(t||!i.current||!a||!l)return;const p=n==="left"?`left: ${d}`:`right: ${u}`;i.current.dataset.motionPopId=r;const m=document.createElement("style");return o&&(m.nonce=o),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
|
|
62
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Eb);var cA=Eb.exports;const Ve=Rr(cA);function uA(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const dA=e=>{switch(e){case"success":return hA;case"info":return gA;case"warning":return mA;case"error":return vA;default:return null}},fA=Array(12).fill(0),pA=({visible:e,className:t})=>J.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},J.createElement("div",{className:"sonner-spinner"},fA.map((n,r)=>J.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),hA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),mA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),gA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),vA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},J.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),yA=J.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},J.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),J.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),xA=()=>{const[e,t]=J.useState(document.hidden);return J.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let gp=1;class wA{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:gp++,o=this.toasts.find(l=>l.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...t,id:s,title:r}),{...l,...t,id:s,dismissible:a,title:r}):l):this.addToast({title:r,...i,dismissible:a,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0}))),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let s=r!==void 0,o;const a=i.then(async c=>{if(o=["resolve",c],J.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(kA(c)&&!c.ok){s=!1;const u=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...h})}else if(c instanceof Error){s=!1;const u=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"error",description:p,...h})}else if(n.success!==void 0){s=!1;const u=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,h=typeof u=="object"?u:{message:u};this.create({id:r,type:"success",description:p,...h})}}).catch(async c=>{if(o=["reject",c],n.error!==void 0){s=!1;const d=typeof n.error=="function"?await n.error(c):n.error,u=typeof n.description=="function"?await n.description(c):n.description,p=typeof d=="object"?d:{message:d};this.create({id:r,type:"error",description:u,...p})}}).finally(()=>{s&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),l=()=>new Promise((c,d)=>a.then(()=>o[0]==="reject"?d(o[1]):c(o[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||gp++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Ut=new wA,bA=(e,t)=>{const n=(t==null?void 0:t.id)||gp++;return Ut.addToast({title:e,...t,id:n}),n},kA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",SA=bA,CA=()=>Ut.toasts,_A=()=>Ut.getActiveToasts(),Ab=Object.assign(SA,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:CA,getToasts:_A});uA("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ol(e){return e.label!==void 0}const TA=3,EA="24px",AA="16px",Gv=4e3,jA=356,RA=14,PA=45,MA=200;function qn(...e){return e.filter(Boolean).join(" ")}function OA(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const NA=e=>{var t,n,r,i,s,o,a,l,c;const{invert:d,toast:u,unstyled:p,interacting:h,setHeights:y,visibleToasts:x,heights:w,index:m,toasts:g,expanded:b,removeToast:C,defaultRichColors:S,closeButton:_,style:j,cancelButtonStyle:A,actionButtonStyle:E,className:L="",descriptionClassName:F="",duration:D,position:G,gap:z,expandByDefault:$,classNames:N,icons:M,closeButtonAriaLabel:P="Close toast"}=e,[B,U]=J.useState(null),[W,q]=J.useState(null),[se,ie]=J.useState(!1),[pe,ce]=J.useState(!1),[_e,Re]=J.useState(!1),[Y,V]=J.useState(!1),[Z,ue]=J.useState(!1),[O,ae]=J.useState(0),[ee,ke]=J.useState(0),he=J.useRef(u.duration||D||Gv),Ze=J.useRef(null),qe=J.useRef(null),Bt=m===0,fe=m+1<=x,R=u.type,K=u.dismissible!==!1,I=u.className||"",H=u.descriptionClassName||"",te=J.useMemo(()=>w.findIndex(we=>we.toastId===u.id)||0,[w,u.id]),de=J.useMemo(()=>{var we;return(we=u.closeButton)!=null?we:_},[u.closeButton,_]),xe=J.useMemo(()=>u.duration||D||Gv,[u.duration,D]),Ue=J.useRef(0),lt=J.useRef(0),Un=J.useRef(0),dn=J.useRef(null),[ys,fr]=G.split("-"),Nr=J.useMemo(()=>w.reduce((we,ft,St)=>St>=te?we:we+ft.height,0),[w,te]),xs=xA(),Mo=u.invert||d,ki=R==="loading";lt.current=J.useMemo(()=>te*z+Nr,[te,Nr]),J.useEffect(()=>{he.current=xe},[xe]),J.useEffect(()=>{ie(!0)},[]),J.useEffect(()=>{const we=qe.current;if(we){const ft=we.getBoundingClientRect().height;return ke(ft),y(St=>[{toastId:u.id,height:ft,position:u.position},...St]),()=>y(St=>St.filter(Kt=>Kt.toastId!==u.id))}},[y,u.id]),J.useLayoutEffect(()=>{if(!se)return;const we=qe.current,ft=we.style.height;we.style.height="auto";const St=we.getBoundingClientRect().height;we.style.height=ft,ke(St),y(Kt=>Kt.find(yt=>yt.toastId===u.id)?Kt.map(yt=>yt.toastId===u.id?{...yt,height:St}:yt):[{toastId:u.id,height:St,position:u.position},...Kt])},[se,u.title,u.description,y,u.id]);const Hn=J.useCallback(()=>{ce(!0),ae(lt.current),y(we=>we.filter(ft=>ft.toastId!==u.id)),setTimeout(()=>{C(u)},MA)},[u,C,y,lt]);J.useEffect(()=>{if(u.promise&&R==="loading"||u.duration===1/0||u.type==="loading")return;let we;return b||h||xs?(()=>{if(Un.current<Ue.current){const Kt=new Date().getTime()-Ue.current;he.current=he.current-Kt}Un.current=new Date().getTime()})():(()=>{he.current!==1/0&&(Ue.current=new Date().getTime(),we=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),Hn()},he.current))})(),()=>clearTimeout(we)},[b,h,u,R,xs,Hn]),J.useEffect(()=>{u.delete&&Hn()},[Hn,u.delete]);function VC(){var we;if(M!=null&&M.loading){var ft;return J.createElement("div",{className:qn(N==null?void 0:N.loader,u==null||(ft=u.classNames)==null?void 0:ft.loader,"sonner-loader"),"data-visible":R==="loading"},M.loading)}return J.createElement(pA,{className:qn(N==null?void 0:N.loader,u==null||(we=u.classNames)==null?void 0:we.loader),visible:R==="loading"})}var xg,wg;return J.createElement("li",{tabIndex:0,ref:qe,className:qn(L,I,N==null?void 0:N.toast,u==null||(t=u.classNames)==null?void 0:t.toast,N==null?void 0:N.default,N==null?void 0:N[R],u==null||(n=u.classNames)==null?void 0:n[R]),"data-sonner-toast":"","data-rich-colors":(xg=u.richColors)!=null?xg:S,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":se,"data-promise":!!u.promise,"data-swiped":Z,"data-removed":pe,"data-visible":fe,"data-y-position":ys,"data-x-position":fr,"data-index":m,"data-front":Bt,"data-swiping":_e,"data-dismissible":K,"data-type":R,"data-invert":Mo,"data-swipe-out":Y,"data-swipe-direction":W,"data-expanded":!!(b||$&&se),style:{"--index":m,"--toasts-before":m,"--z-index":g.length-m,"--offset":`${pe?O:lt.current}px`,"--initial-height":$?"auto":`${ee}px`,...j,...u.style},onDragEnd:()=>{Re(!1),U(null),dn.current=null},onPointerDown:we=>{ki||!K||(Ze.current=new Date,ae(lt.current),we.target.setPointerCapture(we.pointerId),we.target.tagName!=="BUTTON"&&(Re(!0),dn.current={x:we.clientX,y:we.clientY}))},onPointerUp:()=>{var we,ft,St;if(Y||!K)return;dn.current=null;const Kt=Number(((we=qe.current)==null?void 0:we.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),fl=Number(((ft=qe.current)==null?void 0:ft.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),yt=new Date().getTime()-((St=Ze.current)==null?void 0:St.getTime()),fn=B==="x"?Kt:fl,pl=Math.abs(fn)/yt;if(Math.abs(fn)>=PA||pl>.11){ae(lt.current),u.onDismiss==null||u.onDismiss.call(u,u),q(B==="x"?Kt>0?"right":"left":fl>0?"down":"up"),Hn(),V(!0);return}else{var En,An;(En=qe.current)==null||En.style.setProperty("--swipe-amount-x","0px"),(An=qe.current)==null||An.style.setProperty("--swipe-amount-y","0px")}ue(!1),Re(!1),U(null)},onPointerMove:we=>{var ft,St,Kt;if(!dn.current||!K||((ft=window.getSelection())==null?void 0:ft.toString().length)>0)return;const yt=we.clientY-dn.current.y,fn=we.clientX-dn.current.x;var pl;const En=(pl=e.swipeDirections)!=null?pl:OA(G);!B&&(Math.abs(fn)>1||Math.abs(yt)>1)&&U(Math.abs(fn)>Math.abs(yt)?"x":"y");let An={x:0,y:0};const bg=Si=>1/(1.5+Math.abs(Si)/20);if(B==="y"){if(En.includes("top")||En.includes("bottom"))if(En.includes("top")&&yt<0||En.includes("bottom")&&yt>0)An.y=yt;else{const Si=yt*bg(yt);An.y=Math.abs(Si)<Math.abs(yt)?Si:yt}}else if(B==="x"&&(En.includes("left")||En.includes("right")))if(En.includes("left")&&fn<0||En.includes("right")&&fn>0)An.x=fn;else{const Si=fn*bg(fn);An.x=Math.abs(Si)<Math.abs(fn)?Si:fn}(Math.abs(An.x)>0||Math.abs(An.y)>0)&&ue(!0),(St=qe.current)==null||St.style.setProperty("--swipe-amount-x",`${An.x}px`),(Kt=qe.current)==null||Kt.style.setProperty("--swipe-amount-y",`${An.y}px`)}},de&&!u.jsx&&R!=="loading"?J.createElement("button",{"aria-label":P,"data-disabled":ki,"data-close-button":!0,onClick:ki||!K?()=>{}:()=>{Hn(),u.onDismiss==null||u.onDismiss.call(u,u)},className:qn(N==null?void 0:N.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(wg=M==null?void 0:M.close)!=null?wg:yA):null,R||u.icon||u.promise?J.createElement("div",{"data-icon":"",className:qn(N==null?void 0:N.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||VC():null,u.type!=="loading"?u.icon||(M==null?void 0:M[R])||dA(R):null):null,J.createElement("div",{"data-content":"",className:qn(N==null?void 0:N.content,u==null||(s=u.classNames)==null?void 0:s.content)},J.createElement("div",{"data-title":"",className:qn(N==null?void 0:N.title,u==null||(o=u.classNames)==null?void 0:o.title)},u.jsx?u.jsx:typeof u.title=="function"?u.title():u.title),u.description?J.createElement("div",{"data-description":"",className:qn(F,H,N==null?void 0:N.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),J.isValidElement(u.cancel)?u.cancel:u.cancel&&Ol(u.cancel)?J.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:we=>{Ol(u.cancel)&&K&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,we),Hn())},className:qn(N==null?void 0:N.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,J.isValidElement(u.action)?u.action:u.action&&Ol(u.action)?J.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||E,onClick:we=>{Ol(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,we),!we.defaultPrevented&&Hn())},className:qn(N==null?void 0:N.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function Yv(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function DA(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?AA:EA;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}const IA=J.forwardRef(function(t,n){const{invert:r,position:i="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:p,duration:h,style:y,visibleToasts:x=TA,toastOptions:w,dir:m=Yv(),gap:g=RA,icons:b,containerAriaLabel:C="Notifications"}=t,[S,_]=J.useState([]),j=J.useMemo(()=>Array.from(new Set([i].concat(S.filter(W=>W.position).map(W=>W.position)))),[S,i]),[A,E]=J.useState([]),[L,F]=J.useState(!1),[D,G]=J.useState(!1),[z,$]=J.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),N=J.useRef(null),M=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=J.useRef(null),B=J.useRef(!1),U=J.useCallback(W=>{_(q=>{var se;return(se=q.find(ie=>ie.id===W.id))!=null&&se.delete||Ut.dismiss(W.id),q.filter(({id:ie})=>ie!==W.id)})},[]);return J.useEffect(()=>Ut.subscribe(W=>{if(W.dismiss){const q=S.map(se=>se.id===W.id?{...se,delete:!0}:se);requestAnimationFrame(()=>{_(q)});return}setTimeout(()=>{vT.flushSync(()=>{_(q=>{const se=q.findIndex(ie=>ie.id===W.id);return se!==-1?[...q.slice(0,se),{...q[se],...W},...q.slice(se+1)]:[W,...q]})})})}),[S]),J.useEffect(()=>{if(u!=="system"){$(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:q})=>{$(q?"dark":"light")})}catch{W.addListener(({matches:se})=>{try{$(se?"dark":"light")}catch(ie){console.error(ie)}})}},[u]),J.useEffect(()=>{S.length<=1&&F(!1)},[S]),J.useEffect(()=>{const W=q=>{var se;if(s.every(ce=>q[ce]||q.code===ce)){var pe;F(!0),(pe=N.current)==null||pe.focus()}q.code==="Escape"&&(document.activeElement===N.current||(se=N.current)!=null&&se.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[s]),J.useEffect(()=>{if(N.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,B.current=!1)}},[N.current]),J.createElement("section",{ref:n,"aria-label":`${C} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((W,q)=>{var se;const[ie,pe]=W.split("-");return S.length?J.createElement("ol",{key:W,dir:m==="auto"?Yv():m,tabIndex:-1,ref:N,className:l,"data-sonner-toaster":!0,"data-sonner-theme":z,"data-y-position":ie,"data-lifted":L&&S.length>1&&!o,"data-x-position":pe,style:{"--front-toast-height":`${((se=A[0])==null?void 0:se.height)||0}px`,"--width":`${jA}px`,"--gap":`${g}px`,...y,...DA(c,d)},onBlur:ce=>{B.current&&!ce.currentTarget.contains(ce.relatedTarget)&&(B.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||B.current||(B.current=!0,P.current=ce.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{D||F(!1)},onDragEnd:()=>F(!1),onPointerDown:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},S.filter(ce=>!ce.position&&q===0||ce.position===W).map((ce,_e)=>{var Re,Y;return J.createElement(NA,{key:ce.id,icons:b,index:_e,toast:ce,defaultRichColors:p,duration:(Re=w==null?void 0:w.duration)!=null?Re:h,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:r,visibleToasts:x,closeButton:(Y=w==null?void 0:w.closeButton)!=null?Y:a,interacting:D,position:W,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,closeButtonAriaLabel:w==null?void 0:w.closeButtonAriaLabel,removeToast:U,toasts:S.filter(V=>V.position==ce.position),heights:A.filter(V=>V.position==ce.position),setHeights:E,expandByDefault:o,gap:g,expanded:L,swipeDirections:t.swipeDirections})})):null}))});function en(e){return Ab.custom(t=>f.jsx(LA,{id:t,title:e.title,description:e.description,variant:e.variant}))}const Ad={success:{bg:"bg-green-100 border-green-200",text:"text-green-800"},error:{bg:"bg-red-100 border-red-200",text:"text-red-800"},warning:{bg:"bg-orange-100 border-orange-200",text:"text-orange-800"},info:{bg:"bg-blue-100 border-blue-200",text:"text-blue-800"}};function LA(e){const{title:t,description:n,button:r,id:i,variant:s}=e;return f.jsxs("div",{className:Ve("flex rounded-lg shadow-lg ring-1 ring-black/5 w-full md:max-w-[364px] items-center p-3 backdrop-blur-sm border mb-2",Ad[s||"info"].bg),children:[f.jsx("div",{className:"flex flex-1 items-center",children:f.jsxs("div",{className:"w-full",children:[t&&f.jsx("p",{className:Ve("text-sm font-medium",Ad[s||"info"].text),children:t}),f.jsx("p",{className:Ve("text-sm",Ad[s||"info"].text,{"mt-1":!!t}),children:n})]})}),r&&f.jsx("div",{className:"ml-5 shrink-0 rounded-md text-sm font-medium text-indigo-600 hover:text-indigo-500 focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 focus:outline-hidden",children:f.jsx("button",{className:"rounded bg-indigo-50 px-3 py-1 text-sm font-semibold text-indigo-600 hover:bg-indigo-100",onClick:()=>{r.onClick(),Ab.dismiss(i)},children:r.label})})]})}function FA(e){return Array.isArray(e)&&e[0].field!==void 0}const ho=(e,t)=>{var n;if(FA(e)){for(const r of e)(n=t==null?void 0:t.form)==null||n.setFieldError(r.field,r.message);return}if(e&&e.message){t!=null&&t.noToast||en({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||en({description:e.error,variant:"error"});return}},BA=[{code:429,text:"Çok fazla istek gönderdiniz. Lütfen biraz bekleyin"},{code:401,text:"Bu işlemi yapabilmek için giriş yapmalısınız"},{code:403,text:"Bu işlemi yapabilmek için yetkiniz yok"},{code:500,text:"Sunucu hatası oluştu"},{code:422,text:"Form doğrulaması başarısız oldu"},{code:413,text:"Yüklenen dosya boyutu izin verilen sınırı aştı"}],$A=[{code:"FST_REQ_FILE_TOO_LARGE",text:"Yüklenen dosya boyutu izin verilen sınırı aştı"},{code:"AUTH_TOKEN_NOT_PRESENT",text:"Oturum bilgisi bulunamadı. Lütfen sohbeti yeniden başlatın"},{code:"AUTH_TOKEN_NOT_VALID",text:"Oturum süreniz dolmuş olabilir. Lütfen sohbeti yeniden başlatın"},{code:"AUTH_VERIFY_REQUIRED",text:"Hesap doğrulaması gerekiyor. Lütfen doğrulama adımını tamamlayın"},{code:"AUTH_INVALID_OWNER_TYPE",text:"Bu işlem için geçerli ziyaretçi oturumu bulunamadı"}],zo=(e,t)=>t?`${e} (Kod: ${t})`:e,zA=(e,t)=>{if(zn(t))return!1;if(e===null)return en({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=$A.find(s=>s.code===r);if(i)return en({description:zo(i.text,r),variant:"error"}),!0}if(t===401){if(e.tokenNotPresent)return en({description:zo("Oturum bilgisi bulunamadı. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_PRESENT"),variant:"error"}),!0;if(e.tokenNotValid)return en({description:zo("Oturum süreniz dolmuş olabilir. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_VALID"),variant:"error"}),!0;if(e.verifyRequired)return en({description:zo("Hesap doğrulaması gerekiyor. Lütfen doğrulama adımını tamamlayın","AUTH_VERIFY_REQUIRED"),variant:"error"}),!0}if(e.message)return en({description:zo(e.message,r),variant:"error"}),!0}const n=BA.find(r=>r.code===t);return en({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},VA={xs:{default:"!p-1",rounded:"!p-1"},sm:{default:"text-xs px-2 py-1.5",rounded:"p-1.5"},md:{default:"text-xs px-3 py-1.5",rounded:"p-2"},lg:{default:"text-sm px-4 py-2",rounded:"p-2.5"},xl:{default:"text-base px-5 py-3",rounded:"p-3"}},Qv={primary:{solid:"!border !border-transparent transition-colors",outline:"!bg-transparent !border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},secondary:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},danger:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},success:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"},warning:{solid:"border border-transparent transition-colors",outline:"bg-transparent border transition-colors",subtle:"border border-transparent transition-colors",link:"hover:underline px-1.5 py-0 bg-transparent !border-none transition-colors"}},fm=v.createContext({});function Su(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const pm=typeof window<"u",jb=pm?v.useLayoutEffect:v.useEffect,Cu=v.createContext(null),hm=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class UA extends v.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=r instanceof HTMLElement&&r.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=i-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function HA({children:e,isPresent:t,anchorX:n}){const r=v.useId(),i=v.useRef(null),s=v.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=v.useContext(hm);return v.useInsertionEffect(()=>{const{width:a,height:l,top:c,left:d,right:u}=s.current;if(t||!i.current||!a||!l)return;const p=n==="left"?`left: ${d}`:`right: ${u}`;i.current.dataset.motionPopId=r;const h=document.createElement("style");return o&&(h.nonce=o),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
|
63
63
|
[data-motion-pop-id="${r}"] {
|
|
64
64
|
position: absolute !important;
|
|
65
65
|
width: ${a}px !important;
|
|
@@ -67,7 +67,7 @@ Error generating stack: `+s.message+`
|
|
|
67
67
|
${p}px !important;
|
|
68
68
|
top: ${c}px !important;
|
|
69
69
|
}
|
|
70
|
-
`),()=>{document.head.removeChild(m)}},[t]),f.jsx(zj,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const Uj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=ku(Hj),c=v.useId();let d=!0,u=v.useMemo(()=>(d=!1,{id:c,initial:t,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const m of l.values())if(!m)return;r&&r()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,r]);return s&&d&&(u={...u}),v.useMemo(()=>{l.forEach((p,m)=>l.set(m,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=f.jsx(Vj,{isPresent:n,anchorX:a,children:e})),f.jsx(Su.Provider,{value:u,children:e})};function Hj(){return new Map}function jb(e=!0){const t=v.useContext(Su);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=v.useId();v.useEffect(()=>{if(e)return i(s)},[e]);const o=v.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Ol=e=>e.key||"";function Qv(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const jr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=jb(o),d=v.useMemo(()=>Qv(e),[e]),u=o&&!l?[]:d.map(Ol),p=v.useRef(!0),m=v.useRef(d),y=ku(()=>new Map),[w,x]=v.useState(d),[h,g]=v.useState(d);Eb(()=>{p.current=!1,m.current=d;for(let S=0;S<h.length;S++){const T=Ol(h[S]);u.includes(T)?y.delete(T):y.get(T)!==!0&&y.set(T,!1)}},[h,u.length,u.join("-")]);const k=[];if(d!==w){let S=[...d];for(let T=0;T<h.length;T++){const j=h[T],E=Ol(j);u.includes(E)||(S.splice(T,0,j),k.push(j))}return s==="wait"&&k.length&&(S=k),g(Qv(S)),x(d),null}const{forceRender:C}=v.useContext(dm);return f.jsx(f.Fragment,{children:h.map(S=>{const T=Ol(S),j=o&&!l?!1:d===h||u.includes(T),E=()=>{if(y.has(T))y.set(T,!0);else return;let A=!0;y.forEach(I=>{I||(A=!1)}),A&&(C==null||C(),g(m.current),o&&(c==null||c()),r&&r())};return f.jsx(Uj,{isPresent:j,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:j?void 0:E,anchorX:a,children:S},T)})})};function hm(e,t){e.indexOf(t)===-1&&e.push(t)}function mm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let gp=()=>{};const vp={skipAnimations:!1,useManualTiming:!1};function gm(e){let t;return()=>(t===void 0&&(t=e()),t)}const Sn=e=>e,Da=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class vm{constructor(){this.subscriptions=[]}add(t){return hm(this.subscriptions,t),()=>mm(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rr=e=>e*1e3,ir=e=>e/1e3;function Ab(e,t){return t?e*(1e3/t):0}const Wj=gm(()=>window.ScrollTimeline!==void 0);class qj{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Wj()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Gj extends qj{then(t,n){return this.finished.finally(t).then(()=>{})}}const Kv={value:null,addProjectionMetrics:null},ym=e=>Array.isArray(e)&&typeof e[0]=="number",Yj={};function Qj(e,t){const n=gm(e);return()=>Yj[t]??n()}const Ia=Qj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Rb=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Qo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,yp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qo([0,.65,.55,1]),circOut:Qo([.55,0,1,.45]),backIn:Qo([.31,.01,.66,-.59]),backOut:Qo([.33,1.53,.69,.99])};function Pb(e,t){if(e)return typeof e=="function"&&Ia()?Rb(e,t):ym(e)?Qo(e):Array.isArray(e)?e.map(n=>Pb(n,t)||yp.easeOut):yp[e]}function Kj(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const u=Pb(a,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:c})}function xm(e){return typeof e=="function"&&"applyToOptions"in e}function wm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zc=2e4;function bm(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zc;)t+=n,r=e.next(t);return t>=zc?1/0:t}function Xj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(bm(r),zc);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:ir(i)}}function Mb(e){return!!(typeof e=="function"&&Ia()||!e||typeof e=="string"&&(e in yp||Ia())||ym(e)||Array.isArray(e)&&e.every(Mb))}function Xv(e,t){e.timeline=t,e.onfinish=null}const Nl=["read","resolveKeyframes","update","preRender","render","postRender"];function Zj(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(u){o.has(u)&&(d.schedule(u),e()),l++,u(a)}const d={schedule:(u,p=!1,m=!1)=>{const w=m&&i?n:r;return p&&o.add(u),w.has(u)||w.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&Kv.value&&Kv.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const Jj=40;function Ob(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Nl.reduce((h,g)=>(h[g]=Zj(s,t?g:void 0),h),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=o,m=()=>{const h=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(h-i.timestamp,Jj),1),i.timestamp=h,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),u.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},y=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:Nl.reduce((h,g)=>{const k=o[g];return h[g]=(C,S=!1,T=!1)=>(n||y(),k.schedule(C,S,T)),h},{}),cancel:h=>{for(let g=0;g<Nl.length;g++)o[Nl[g]].cancel(h)},state:i,steps:o}}const{schedule:km,cancel:VB}=Ob(queueMicrotask,!1),{schedule:Le,cancel:pi,state:wt,steps:jd}=Ob(typeof requestAnimationFrame<"u"?requestAnimationFrame:Sn,!0);let rc;function eA(){rc=void 0}const sr={now:()=>(rc===void 0&&sr.set(wt.isProcessing||vp.useManualTiming?wt.timestamp:performance.now()),rc),set:e=>{rc=e,queueMicrotask(eA)}},Rn={x:!1,y:!1};function Nb(){return Rn.x||Rn.y}function tA(e){return e==="x"||e==="y"?Rn[e]?null:(Rn[e]=!0,()=>{Rn[e]=!1}):Rn.x||Rn.y?null:(Rn.x=Rn.y=!0,()=>{Rn.x=Rn.y=!1})}function nA(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Db(e,t){const n=nA(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Zv(e){return!(e.pointerType==="touch"||Nb())}function rA(e,t,n={}){const[r,i,s]=Db(e,n),o=a=>{if(!Zv(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{Zv(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Ib=(e,t)=>t?e===t?!0:Ib(e,t.parentElement):!1,Sm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,iA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function sA(e){return iA.has(e.tagName)||e.tabIndex!==-1}const Ko=new WeakSet;function Jv(e){return t=>{t.key==="Enter"&&e(t)}}function Ad(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const oA=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Jv(()=>{if(Ko.has(n))return;Ad(n,"down");const i=Jv(()=>{Ad(n,"up")}),s=()=>Ad(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ey(e){return Sm(e)&&!Nb()}function aA(e,t,n={}){const[r,i,s]=Db(e,n),o=a=>{const l=a.currentTarget;if(!ey(a)||Ko.has(l))return;Ko.add(l);const c=t(l,a),d=(m,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!ey(m)||!Ko.has(l))&&(Ko.delete(l),typeof c=="function"&&c(m,{success:y}))},u=m=>{d(m,l===window||l===document||n.useGlobalTarget||Ib(l,m.target))},p=m=>{d(m,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>oA(c,i)),!sA(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const ty=30,lA=e=>!isNaN(parseFloat(e));class cA{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=sr.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lA(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new vm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Le.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ty)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ty);return Ab(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function La(e,t){return new cA(e,t)}const Lb=v.createContext({strict:!1}),ny={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mo={};for(const e in ny)mo[e]={isEnabled:t=>ny[e].some(n=>!!t[n])};function uA(e){for(const t in e)mo[t]={...mo[t],...e[t]}}const dA=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Vc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||dA.has(e)}let Fb=e=>!Vc(e);function fA(e){e&&(Fb=t=>t.startsWith("on")?!Vc(t):e(t))}try{fA(require("@emotion/is-prop-valid").default)}catch{}function pA(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Fb(i)||n===!0&&Vc(i)||!t&&!Vc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function hA(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Cu=v.createContext({});function Tu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Fa(e){return typeof e=="string"||Array.isArray(e)}const Cm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tm=["initial",...Cm];function _u(e){return Tu(e.animate)||Tm.some(t=>Fa(e[t]))}function Bb(e){return!!(_u(e)||e.variants)}function mA(e,t){if(_u(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Fa(n)?n:void 0,animate:Fa(r)?r:void 0}}return e.inherit!==!1?t:{}}function gA(e){const{initial:t,animate:n}=mA(e,v.useContext(Cu));return v.useMemo(()=>({initial:t,animate:n}),[ry(t),ry(n)])}function ry(e){return Array.isArray(e)?e.join(" "):e}const vA=Symbol.for("motionComponentSymbol");function Ns(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function yA(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ns(n)&&(n.current=r))},[t])}const _m=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xA="framerAppearId",$b="data-"+_m(xA),zb=v.createContext({});function wA(e,t,n,r,i){var w,x;const{visualElement:s}=v.useContext(Cu),o=v.useContext(Lb),a=v.useContext(Su),l=v.useContext(pm).reducedMotion,c=v.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=v.useContext(zb);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&bA(c.current,n,i,u);const p=v.useRef(!1);v.useInsertionEffect(()=>{d&&p.current&&d.update(n,a)});const m=n[$b],y=v.useRef(!!m&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,m))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,m)));return Eb(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),km.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var h;(h=window.MotionHandoffMarkAsComplete)==null||h.call(window,m)}),y.current=!1))}),d}function bA(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Vb(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ns(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function Vb(e){if(e)return e.options.allowProjection!==!1?e.projection:Vb(e.parent)}function kA({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&uA(e);function s(a,l){let c;const d={...v.useContext(pm),...a,layoutId:SA(a)},{isStatic:u}=d,p=gA(a),m=r(a,u);if(!u&&fm){CA();const y=TA(d);c=y.MeasureLayout,p.visualElement=wA(i,m,d,t,y.ProjectionNode)}return f.jsxs(Cu.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,n(i,a,yA(m,p.visualElement,l),m,u,p.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=v.forwardRef(s);return o[vA]=i,o}function SA({layoutId:e}){const t=v.useContext(dm).id;return t&&e!==void 0?t+"-"+e:e}function CA(e,t){v.useContext(Lb).strict}function TA(e){const{drag:t,layout:n}=mo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Ub=e=>t=>typeof t=="string"&&t.startsWith(e),Em=Ub("--"),_A=Ub("var(--"),jm=e=>_A(e)?EA.test(e.split("/*")[0].trim()):!1,EA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ba={};function jA(e){for(const t in e)Ba[t]=e[t],Em(t)&&(Ba[t].isCSSVariable=!0)}const Eo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ls=new Set(Eo);function Hb(e,{layout:t,layoutId:n}){return ls.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ba[e]||e==="opacity")}const At=e=>!!(e&&e.getVelocity),Wb=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Ar=(e,t,n)=>n>t?t:n<e?e:n,jo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},$a={...jo,transform:e=>Ar(0,1,e)},Dl={...jo,default:1},rl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Lr=rl("deg"),or=rl("%"),he=rl("px"),AA=rl("vh"),RA=rl("vw"),iy={...or,parse:e=>or.parse(e)/100,transform:e=>or.transform(e*100)},PA={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he},MA={rotate:Lr,rotateX:Lr,rotateY:Lr,rotateZ:Lr,scale:Dl,scaleX:Dl,scaleY:Dl,scaleZ:Dl,skew:Lr,skewX:Lr,skewY:Lr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:$a,originX:iy,originY:iy,originZ:he},sy={...jo,transform:Math.round},Am={...PA,...MA,zIndex:sy,size:he,fillOpacity:$a,strokeOpacity:$a,numOctaves:sy},OA={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},NA=Eo.length;function DA(e,t,n){let r="",i=!0;for(let s=0;s<NA;s++){const o=Eo[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Wb(a,Am[o]);if(!l){i=!1;const d=OA[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Rm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(ls.has(l)){o=!0;continue}else if(Em(l)){i[l]=c;continue}else{const d=Wb(c,Am[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=DA(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${c} ${d}`}}const Pm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function qb(e,t,n){for(const r in t)!At(t[r])&&!Hb(r,n)&&(e[r]=t[r])}function IA({transformTemplate:e},t){return v.useMemo(()=>{const n=Pm();return Rm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function LA(e,t){const n=e.style||{},r={};return qb(r,n,e),Object.assign(r,IA(e,t)),r}function FA(e,t){const n={},r=LA(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const BA=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Mm(e){return typeof e!="string"||e.includes("-")?!1:!!(BA.indexOf(e)>-1||/[A-Z]/u.test(e))}const $A={offset:"stroke-dashoffset",array:"stroke-dasharray"},zA={offset:"strokeDashoffset",array:"strokeDasharray"};function VA(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?$A:zA;e[s.offset]=he.transform(-r);const o=he.transform(t),a=he.transform(n);e[s.array]=`${o} ${a}`}function oy(e,t,n){return typeof e=="string"?e:he.transform(t+n*e)}function UA(e,t,n){const r=oy(t,e.x,e.width),i=oy(n,e.y,e.height);return`${r} ${i}`}function Om(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Rm(e,c,u),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:y}=e;p.transform&&(y&&(m.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=UA(y,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&VA(p,o,a,l,!1)}const Gb=()=>({...Pm(),attrs:{}}),Nm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function HA(e,t,n,r){const i=v.useMemo(()=>{const s=Gb();return Om(s,t,Nm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};qb(s,e.style,e),i.style={...s,...i.style}}return i}function WA(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Mm(n)?HA:FA)(r,s,o,n),c=pA(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,p=v.useMemo(()=>At(u)?u.get():u,[u]);return v.createElement(n,{...d,children:p})}}function ay(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Dm(e,t,n,r){if(typeof t=="function"){const[i,s]=ay(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=ay(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const xp=e=>Array.isArray(e),qA=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),GA=e=>xp(e)?e[e.length-1]||0:e;function ic(e){const t=At(e)?e.get():e;return qA(t)?t.toValue():t}function YA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:QA(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Yb=e=>(t,n)=>{const r=v.useContext(Cu),i=v.useContext(Su),s=()=>YA(e,t,r,i);return n?s():ku(s)};function QA(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=ic(s[p]);let{initial:o,animate:a}=e;const l=_u(e),c=Bb(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const u=d?a:o;if(u&&typeof u!="boolean"&&!Tu(u)){const p=Array.isArray(u)?u:[u];for(let m=0;m<p.length;m++){const y=Dm(e,p[m]);if(y){const{transitionEnd:w,transition:x,...h}=y;for(const g in h){let k=h[g];if(Array.isArray(k)){const C=d?k.length-1:0;k=k[C]}k!==null&&(i[g]=k)}for(const g in w)i[g]=w[g]}}}return i}function Im(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(At(r[o])||t.style&&At(t.style[o])||Hb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const KA={useVisualState:Yb({scrapeMotionValuesFromProps:Im,createRenderState:Pm})};function Qb(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function Kb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Xb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Zb(e,t,n,r){Kb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Xb.has(i)?i:_m(i),t.attrs[i])}function Jb(e,t,n){const r=Im(e,t,n);for(const i in e)if(At(e[i])||At(t[i])){const s=Eo.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const ly=["x","y","width","height","cx","cy","r"],XA={useVisualState:Yb({scrapeMotionValuesFromProps:Jb,createRenderState:Gb,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(ls.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<ly.length;a++){const l=ly[a];e[l]!==t[l]&&(o=!0)}o&&Le.read(()=>{Qb(n,r),Le.render(()=>{Om(r,i,Nm(n.tagName),e.transformTemplate),Zb(n,r)})})}})};function ZA(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Mm(r)?XA:KA,preloadedFeatures:e,useRender:WA(i),createVisualElement:t,Component:r};return kA(o)}}function za(e,t,n){const r=e.getProps();return Dm(r,t,n!==void 0?n:r.custom,e)}const ek=new Set(["width","height","top","left","right","bottom",...Eo]);function JA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,La(n))}function e5(e,t){const n=za(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=GA(s[o]);JA(e,o,a)}}function t5(e){return!!(At(e)&&e.add)}function wp(e,t){const n=e.getValue("willChange");if(t5(n))return n.add(t);if(!n&&vp.WillChange){const r=new vp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function tk(e){return e.props[$b]}const nk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,n5=1e-7,r5=12;function i5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=nk(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>n5&&++a<r5);return o}function il(e,t,n,r){if(e===t&&n===r)return Sn;const i=s=>i5(s,0,1,e,n);return s=>s===0||s===1?s:nk(i(s),t,r)}const rk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ik=e=>t=>1-e(1-t),sk=il(.33,1.53,.69,.99),Lm=ik(sk),ok=rk(Lm),ak=e=>(e*=2)<1?.5*Lm(e):.5*(2-Math.pow(2,-10*(e-1))),Fm=e=>1-Math.sin(Math.acos(e)),lk=ik(Fm),ck=rk(Fm),uk=e=>/^0[^.\s]+$/u.test(e);function s5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||uk(e):!0}const la=e=>Math.round(e*1e5)/1e5,Bm=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function o5(e){return e==null}const a5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$m=(e,t)=>n=>!!(typeof n=="string"&&a5.test(n)&&n.startsWith(e)||t&&!o5(n)&&Object.prototype.hasOwnProperty.call(n,t)),dk=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(Bm);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},l5=e=>Ar(0,255,e),Rd={...jo,transform:e=>Math.round(l5(e))},Ni={test:$m("rgb","red"),parse:dk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Rd.transform(e)+", "+Rd.transform(t)+", "+Rd.transform(n)+", "+la($a.transform(r))+")"};function c5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const bp={test:$m("#"),parse:c5,transform:Ni.transform},Ds={test:$m("hsl","hue"),parse:dk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+or.transform(la(t))+", "+or.transform(la(n))+", "+la($a.transform(r))+")"},Et={test:e=>Ni.test(e)||bp.test(e)||Ds.test(e),parse:e=>Ni.test(e)?Ni.parse(e):Ds.test(e)?Ds.parse(e):bp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ni.transform(e):Ds.transform(e)},u5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function d5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Bm))==null?void 0:t.length)||0)+(((n=e.match(u5))==null?void 0:n.length)||0)>0}const fk="number",pk="color",f5="var",p5="var(",cy="${}",h5=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Va(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(h5,l=>(Et.test(l)?(r.color.push(s),i.push(pk),n.push(Et.parse(l))):l.startsWith(p5)?(r.var.push(s),i.push(f5),n.push(l)):(r.number.push(s),i.push(fk),n.push(parseFloat(l))),++s,cy)).split(cy);return{values:n,split:a,indexes:r,types:i}}function hk(e){return Va(e).values}function mk(e){const{split:t,types:n}=Va(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===fk?s+=la(i[o]):a===pk?s+=Et.transform(i[o]):s+=i[o]}return s}}const m5=e=>typeof e=="number"?0:e;function g5(e){const t=hk(e);return mk(e)(t.map(m5))}const hi={test:d5,parse:hk,createTransformer:mk,getAnimatableNone:g5},v5=new Set(["brightness","contrast","saturate","opacity"]);function y5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Bm)||[];if(!r)return e;const i=n.replace(r,"");let s=v5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const x5=/\b([a-z-]*)\(.*?\)/gu,kp={...hi,getAnimatableNone:e=>{const t=e.match(x5);return t?t.map(y5).join(" "):e}},w5={...Am,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:kp,WebkitFilter:kp},gk=e=>w5[e];function vk(e,t){let n=gk(e);return n!==kp&&(n=hi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const b5=new Set(["auto","none","0"]);function k5(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!b5.has(s)&&Va(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=vk(n,i)}const Di=e=>e*180/Math.PI,Sp=e=>{const t=Di(Math.atan2(e[1],e[0]));return Cp(t)},S5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Sp,rotateZ:Sp,skewX:e=>Di(Math.atan(e[1])),skewY:e=>Di(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Cp=e=>(e=e%360,e<0&&(e+=360),e),uy=Sp,dy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),fy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),C5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:dy,scaleY:fy,scale:e=>(dy(e)+fy(e))/2,rotateX:e=>Cp(Di(Math.atan2(e[6],e[5]))),rotateY:e=>Cp(Di(Math.atan2(-e[2],e[0]))),rotateZ:uy,rotate:uy,skewX:e=>Di(Math.atan(e[4])),skewY:e=>Di(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function py(e){return e.includes("scale")?1:0}function Tp(e,t){if(!e||e==="none")return py(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=C5,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=S5,i=a}if(!i)return py(t);const s=r[t],o=i[1].split(",").map(_5);return typeof s=="function"?s(o):o[s]}const T5=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Tp(n,t)};function _5(e){return parseFloat(e.trim())}const hy=e=>e===jo||e===he,E5=new Set(["x","y","z"]),j5=Eo.filter(e=>!E5.has(e));function A5(e){const t=[];return j5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const go={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Tp(t,"x"),y:(e,{transform:t})=>Tp(t,"y")};go.translateX=go.x;go.translateY=go.y;const Gi=new Set;let _p=!1,Ep=!1;function yk(){if(Ep){const e=Array.from(Gi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=A5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ep=!1,_p=!1,Gi.forEach(e=>e.complete()),Gi.clear()}function xk(){Gi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ep=!0)})}function R5(){xk(),yk()}class zm{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gi.add(this),_p||(_p=!0,Le.read(xk),Le.resolveKeyframes(yk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Gi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Gi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const wk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),P5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function M5(e){const t=P5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function bk(e,t,n=1){const[r,i]=M5(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return wk(o)?parseFloat(o):o}return jm(i)?bk(i,t,n+1):i}const kk=e=>t=>t.test(e),O5={test:e=>e==="auto",parse:e=>e},Sk=[jo,he,or,Lr,RA,AA,O5],my=e=>Sk.find(kk(e));class Ck extends zm{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),jm(c))){const d=bk(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!ek.has(r)||t.length!==2)return;const[i,s]=t,o=my(i),a=my(s);if(o!==a)if(hy(o)&&hy(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)s5(t[i])&&r.push(i);r.length&&k5(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=go[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=go[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const gy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hi.test(e)||e==="0")&&!e.startsWith("url("));function N5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function D5(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=gy(i,t),a=gy(s,t);return!o||!a?!1:N5(e)||(n==="spring"||xm(n))&&r}const I5=e=>e!==null;function Eu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(I5),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const L5=40;class Tk{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=sr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>L5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&R5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=sr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!D5(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Eu(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Ge=(e,t,n)=>e+(t-e)*n;function Pd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function F5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Pd(l,a,e+1/3),s=Pd(l,a,e),o=Pd(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Uc(e,t){return n=>n>0?t:e}const Md=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},B5=[bp,Ni,Ds],$5=e=>B5.find(t=>t.test(e));function vy(e){const t=$5(e);if(!t)return!1;let n=t.parse(e);return t===Ds&&(n=F5(n)),n}const yy=(e,t)=>{const n=vy(e),r=vy(t);if(!n||!r)return Uc(e,t);const i={...n};return s=>(i.red=Md(n.red,r.red,s),i.green=Md(n.green,r.green,s),i.blue=Md(n.blue,r.blue,s),i.alpha=Ge(n.alpha,r.alpha,s),Ni.transform(i))},z5=(e,t)=>n=>t(e(n)),sl=(...e)=>e.reduce(z5),jp=new Set(["none","hidden"]);function V5(e,t){return jp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function U5(e,t){return n=>Ge(e,t,n)}function Vm(e){return typeof e=="number"?U5:typeof e=="string"?jm(e)?Uc:Et.test(e)?yy:q5:Array.isArray(e)?_k:typeof e=="object"?Et.test(e)?yy:H5:Uc}function _k(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Vm(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function H5(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Vm(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function W5(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const q5=(e,t)=>{const n=hi.createTransformer(t),r=Va(e),i=Va(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?jp.has(e)&&!i.values.length||jp.has(t)&&!r.values.length?V5(e,t):sl(_k(W5(r,i),i.values),n):Uc(e,t)};function Ek(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ge(e,t,n):Vm(e)(e,t)}const G5=5;function jk(e,t,n){const r=Math.max(t-G5,0);return Ab(n-e(r),t-r)}const Xe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Od=.001;function Y5({duration:e=Xe.duration,bounce:t=Xe.bounce,velocity:n=Xe.velocity,mass:r=Xe.mass}){let i,s,o=1-t;o=Ar(Xe.minDamping,Xe.maxDamping,o),e=Ar(Xe.minDuration,Xe.maxDuration,ir(e)),o<1?(i=c=>{const d=c*o,u=d*e,p=d-n,m=Ap(c,o),y=Math.exp(-u);return Od-p/m*y},s=c=>{const u=c*o*e,p=u*n+n,m=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-u),w=Ap(Math.pow(c,2),o);return(-i(c)+Od>0?-1:1)*((p-m)*y)/w}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Od+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=K5(i,s,a);if(e=rr(e),isNaN(l))return{stiffness:Xe.stiffness,damping:Xe.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const Q5=12;function K5(e,t,n){let r=n;for(let i=1;i<Q5;i++)r=r-e(r)/t(r);return r}function Ap(e,t){return e*Math.sqrt(1-t*t)}const X5=["duration","bounce"],Z5=["stiffness","damping","mass"];function xy(e,t){return t.some(n=>e[n]!==void 0)}function J5(e){let t={velocity:Xe.velocity,stiffness:Xe.stiffness,damping:Xe.damping,mass:Xe.mass,isResolvedFromDuration:!1,...e};if(!xy(e,Z5)&&xy(e,X5))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Ar(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Xe.mass,stiffness:i,damping:s}}else{const n=Y5(e);t={...t,...n,mass:Xe.mass},t.isResolvedFromDuration=!0}return t}function Hc(e=Xe.visualDuration,t=Xe.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:u,velocity:p,isResolvedFromDuration:m}=J5({...n,velocity:-ir(n.velocity||0)}),y=p||0,w=c/(2*Math.sqrt(l*d)),x=o-s,h=ir(Math.sqrt(l/d)),g=Math.abs(x)<5;r||(r=g?Xe.restSpeed.granular:Xe.restSpeed.default),i||(i=g?Xe.restDelta.granular:Xe.restDelta.default);let k;if(w<1){const S=Ap(h,w);k=T=>{const j=Math.exp(-w*h*T);return o-j*((y+w*h*x)/S*Math.sin(S*T)+x*Math.cos(S*T))}}else if(w===1)k=S=>o-Math.exp(-h*S)*(x+(y+h*x)*S);else{const S=h*Math.sqrt(w*w-1);k=T=>{const j=Math.exp(-w*h*T),E=Math.min(S*T,300);return o-j*((y+w*h*x)*Math.sinh(E)+S*x*Math.cosh(E))/S}}const C={calculatedDuration:m&&u||null,next:S=>{const T=k(S);if(m)a.done=S>=u;else{let j=0;w<1&&(j=S===0?rr(y):jk(k,S,T));const E=Math.abs(j)<=r,A=Math.abs(o-T)<=i;a.done=E&&A}return a.value=a.done?o:T,a},toString:()=>{const S=Math.min(bm(C),zc),T=Rb(j=>C.next(S*j).value,S,30);return S+"ms "+T},toTransition:()=>{}};return C}Hc.applyToOptions=e=>{const t=Xj(e,100,Hc);return e.ease=Ia()?t.ease:"easeOut",e.duration=rr(t.duration),e.type="keyframes",e};function wy({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],p={done:!1,value:u},m=E=>a!==void 0&&E<a||l!==void 0&&E>l,y=E=>a===void 0?l:l===void 0||Math.abs(a-E)<Math.abs(l-E)?a:l;let w=n*t;const x=u+w,h=o===void 0?x:o(x);h!==x&&(w=h-u);const g=E=>-w*Math.exp(-E/r),k=E=>h+g(E),C=E=>{const A=g(E),I=k(E);p.done=Math.abs(A)<=c,p.value=p.done?h:I};let S,T;const j=E=>{m(p.value)&&(S=E,T=Hc({keyframes:[p.value,y(p.value)],velocity:jk(k,E,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return j(0),{calculatedDuration:null,next:E=>{let A=!1;return!T&&S===void 0&&(A=!0,C(E),j(E)),S!==void 0&&E>=S?T.next(E-S):(!A&&C(E),p)}}}const e3=il(.42,0,1,1),t3=il(0,0,.58,1),Ak=il(.42,0,.58,1),n3=e=>Array.isArray(e)&&typeof e[0]!="number",by={linear:Sn,easeIn:e3,easeInOut:Ak,easeOut:t3,circIn:Fm,circInOut:ck,circOut:lk,backIn:Lm,backInOut:ok,backOut:sk,anticipate:ak},ky=e=>{if(ym(e)){gp(e.length===4);const[t,n,r,i]=e;return il(t,n,r,i)}else if(typeof e=="string")return gp(by[e]!==void 0),by[e];return e};function r3(e,t,n){const r=[],i=n||Ek,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Sn:t;a=sl(l,a)}r.push(a)}return r}function i3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(gp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=r3(t,r,i),l=a.length,c=d=>{if(o&&d<e[0])return t[0];let u=0;if(l>1)for(;u<e.length-2&&!(d<e[u+1]);u++);const p=Da(e[u],e[u+1],d);return a[u](p)};return n?d=>c(Ar(e[0],e[s-1],d)):c}function s3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Da(0,t,r);e.push(Ge(n,1,i))}}function o3(e){const t=[0];return s3(t,e.length-1),t}function a3(e,t){return e.map(n=>n*t)}function l3(e,t){return e.map(()=>t||Ak).splice(0,e.length-1)}function Wc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=n3(r)?r.map(ky):ky(r),s={done:!1,value:t[0]},o=a3(n&&n.length===t.length?n:o3(t),e),a=i3(o,t,{ease:Array.isArray(i)?i:l3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const c3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Le.update(t,!0),stop:()=>pi(t),now:()=>wt.isProcessing?wt.timestamp:sr.now()}},u3={decay:wy,inertia:wy,tween:Wc,keyframes:Wc,spring:Hc},d3=e=>e/100;class Um extends Tk{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||zm,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=xm(n)?n:u3[n]||Wc;let l,c;a!==Wc&&typeof t[0]!="number"&&(l=sl(d3,Ek(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=bm(d));const{calculatedDuration:u}=d,p=u+i,m=p*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:u,resolvedDuration:p,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:E}=this.options;return{done:!0,value:E[E.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:d,resolvedDuration:u}=r;if(this.startTime===null)return s.next(0);const{delay:p,repeat:m,repeatType:y,repeatDelay:w,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const h=this.currentTime-p*(this.speed>=0?1:-1),g=this.speed>=0?h<0:h>d;this.currentTime=Math.max(h,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let k=this.currentTime,C=s;if(m){const E=Math.min(this.currentTime,d)/u;let A=Math.floor(E),I=E%1;!I&&E>=1&&(I=1),I===1&&A--,A=Math.min(A,m+1),!!(A%2)&&(y==="reverse"?(I=1-I,w&&(I-=w/u)):y==="mirror"&&(C=o)),k=Ar(0,1,I)*u}const S=g?{done:!1,value:l[0]}:C.next(k);a&&(S.value=a(S.value));let{done:T}=S;!g&&c!==null&&(T=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return j&&i!==void 0&&(S.value=Eu(l,this.options,i)),x&&x(S.value),j&&this.finish(),S}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=rr(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=c3,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const f3=new Set(["opacity","clipPath","filter","transform"]),p3=gm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),qc=10,h3=2e4;function m3(e){return xm(e.type)||e.type==="spring"||!Mb(e.ease)}function g3(e,t){const n=new Um({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<h3;)r=n.sample(s),i.push(r.value),s+=qc;return{times:void 0,keyframes:i,duration:s-qc,ease:"linear"}}const Rk={anticipate:ak,backInOut:ok,circInOut:ck};function v3(e){return e in Rk}class Sy extends Tk{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Ck(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&Ia()&&v3(s)&&(s=Rk[s]),m3(this.options)){const{onComplete:u,onUpdate:p,motionValue:m,element:y,...w}=this.options,x=g3(t,w);t=x.keyframes,t.length===1&&(t[1]=t[0]),r=x.duration,i=x.times,s=x.ease,o="keyframes"}const d=Kj(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(Xv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Eu(t,this.options,n)),u&&u(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=rr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Sn;const{animation:r}=n;Xv(r,t)}return Sn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:d,onComplete:u,element:p,...m}=this.options,y=new Um({...m,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),w=rr(this.time);c.setWithVelocity(y.sample(w-qc).value,y.sample(w).value,qc)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return p3()&&r&&f3.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const y3={type:"spring",stiffness:500,damping:25,restSpeed:10},x3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),w3={type:"keyframes",duration:.8},b3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},k3=(e,{keyframes:t})=>t.length>2?w3:ls.has(e)?e.startsWith("scale")?x3(t[1]):y3:b3;function S3({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Hm=(e,t,n,r={},i,s)=>o=>{const a=wm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-rr(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};S3(a)||(d={...d,...k3(e,d)}),d.duration&&(d.duration=rr(d.duration)),d.repeatDelay&&(d.repeatDelay=rr(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),d.allowFlatten=!a.type&&!a.ease,u&&!s&&t.get()!==void 0){const p=Eu(d.keyframes,a);if(p!==void 0)return Le.update(()=>{d.onUpdate(p),d.onComplete()}),new Gj([])}return!s&&Sy.supports(d)?new Sy(d):new Um(d)};function C3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Pk(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const u=e.getValue(d,e.latestValues[d]??null),p=a[d];if(p===void 0||c&&C3(c,d))continue;const m={delay:n,...wm(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const x=tk(e);if(x){const h=window.MotionHandoffAnimation(x,d,Le);h!==null&&(m.startTime=h,y=!0)}}wp(e,d),u.start(Hm(d,u,p,e.shouldReduceMotion&&ek.has(d)?{type:!1}:m,e,y));const w=u.animation;w&&l.push(w)}return o&&Promise.all(l).then(()=>{Le.update(()=>{o&&e5(e,o)})}),l}function Rp(e,t,n={}){var l;const r=za(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Pk(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=i;return T3(e,t,d+c,u,p,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,d]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function T3(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(_3).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Rp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function _3(e,t){return e.sortNodePosition(t)}function E3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Rp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Rp(e,t,n);else{const i=typeof t=="function"?za(e,t,n.custom):t;r=Promise.all(Pk(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Mk(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const j3=Tm.length;function Ok(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Ok(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<j3;n++){const r=Tm[n],i=e.props[r];(Fa(i)||i===!1)&&(t[r]=i)}return t}const A3=[...Cm].reverse(),R3=Cm.length;function P3(e){return t=>Promise.all(t.map(({animation:n,options:r})=>E3(e,n,r)))}function M3(e){let t=P3(e),n=Cy(),r=!0;const i=l=>(c,d)=>{var p;const u=za(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:m,transitionEnd:y,...w}=u;c={...c,...w,...y}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=Ok(e.parent)||{},u=[],p=new Set;let m={},y=1/0;for(let x=0;x<R3;x++){const h=A3[x],g=n[h],k=c[h]!==void 0?c[h]:d[h],C=Fa(k),S=h===l?g.isActive:null;S===!1&&(y=x);let T=k===d[h]&&k!==c[h]&&C;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),g.protectedKeys={...m},!g.isActive&&S===null||!k&&!g.prevProp||Tu(k)||typeof k=="boolean")continue;const j=O3(g.prevProp,k);let E=j||h===l&&g.isActive&&!T&&C||x>y&&C,A=!1;const I=Array.isArray(k)?k:[k];let N=I.reduce(i(h),{});S===!1&&(N={});const{prevResolvedValues:D={}}=g,G={...D,...N},B=$=>{E=!0,p.has($)&&(A=!0,p.delete($)),g.needsAnimating[$]=!0;const R=e.getValue($);R&&(R.liveStyle=!1)};for(const $ in G){const R=N[$],z=D[$];if(m.hasOwnProperty($))continue;let U=!1;xp(R)&&xp(z)?U=!Mk(R,z):U=R!==z,U?R!=null?B($):p.add($):R!==void 0&&p.has($)?B($):g.protectedKeys[$]=!0}g.prevProp=k,g.prevResolvedValues=N,g.isActive&&(m={...m,...N}),r&&e.blockInitialAnimation&&(E=!1),E&&(!(T&&j)||A)&&u.push(...I.map($=>({animation:$,options:{type:h}})))}if(p.size){const x={};if(typeof c.initial!="boolean"){const h=za(e,Array.isArray(c.initial)?c.initial[0]:c.initial);h&&h.transition&&(x.transition=h.transition)}p.forEach(h=>{const g=e.getBaseTarget(h),k=e.getValue(h);k&&(k.liveStyle=!0),x[h]=g??null}),u.push({animation:x})}let w=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Cy(),r=!0}}}function O3(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Mk(t,e):!1}function Ci(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Cy(){return{animate:Ci(!0),whileInView:Ci(),whileHover:Ci(),whileTap:Ci(),whileDrag:Ci(),whileFocus:Ci(),exit:Ci()}}class wi{constructor(t){this.isMounted=!1,this.node=t}update(){}}class N3 extends wi{constructor(t){super(t),t.animationState||(t.animationState=M3(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Tu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let D3=0;class I3 extends wi{constructor(){super(...arguments),this.id=D3++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const L3={animation:{Feature:N3},exit:{Feature:I3}};function Ua(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ol(e){return{point:{x:e.pageX,y:e.pageY}}}const F3=e=>t=>Sm(t)&&e(t,ol(t));function ca(e,t,n,r){return Ua(e,t,F3(n),r)}function Nk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function B3({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $3(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Dk=1e-4,z3=1-Dk,V3=1+Dk,Ik=.01,U3=0-Ik,H3=0+Ik;function Dt(e){return e.max-e.min}function W3(e,t,n){return Math.abs(e-t)<=n}function Ty(e,t,n,r=.5){e.origin=r,e.originPoint=Ge(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=Ge(n.min,n.max,e.origin)-e.originPoint,(e.scale>=z3&&e.scale<=V3||isNaN(e.scale))&&(e.scale=1),(e.translate>=U3&&e.translate<=H3||isNaN(e.translate))&&(e.translate=0)}function ua(e,t,n,r){Ty(e.x,t.x,n.x,r?r.originX:void 0),Ty(e.y,t.y,n.y,r?r.originY:void 0)}function _y(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function q3(e,t,n){_y(e.x,t.x,n.x),_y(e.y,t.y,n.y)}function Ey(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function da(e,t,n){Ey(e.x,t.x,n.x),Ey(e.y,t.y,n.y)}const jy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Is=()=>({x:jy(),y:jy()}),Ay=()=>({min:0,max:0}),et=()=>({x:Ay(),y:Ay()});function hn(e){return[e("x"),e("y")]}function Nd(e){return e===void 0||e===1}function Pp({scale:e,scaleX:t,scaleY:n}){return!Nd(e)||!Nd(t)||!Nd(n)}function ji(e){return Pp(e)||Lk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Lk(e){return Ry(e.x)||Ry(e.y)}function Ry(e){return e&&e!=="0%"}function Gc(e,t,n){const r=e-n,i=t*r;return n+i}function Py(e,t,n,r,i){return i!==void 0&&(e=Gc(e,i,r)),Gc(e,n,r)+t}function Mp(e,t=0,n=1,r,i){e.min=Py(e.min,t,n,r,i),e.max=Py(e.max,t,n,r,i)}function Fk(e,{x:t,y:n}){Mp(e.x,t.translate,t.scale,t.originPoint),Mp(e.y,n.translate,n.scale,n.originPoint)}const My=.999999999999,Oy=1.0000000000001;function G3(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Fs(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Fk(e,o)),r&&ji(s.latestValues)&&Fs(e,s.latestValues))}t.x<Oy&&t.x>My&&(t.x=1),t.y<Oy&&t.y>My&&(t.y=1)}function Ls(e,t){e.min=e.min+t,e.max=e.max+t}function Ny(e,t,n,r,i=.5){const s=Ge(e.min,e.max,i);Mp(e,t,n,s,r)}function Fs(e,t){Ny(e.x,t.x,t.scaleX,t.scale,t.originX),Ny(e.y,t.y,t.scaleY,t.scale,t.originY)}function Bk(e,t){return Nk($3(e.getBoundingClientRect(),t))}function Y3(e,t,n){const r=Bk(e,n),{scroll:i}=t;return i&&(Ls(r.x,i.offset.x),Ls(r.y,i.offset.y)),r}const $k=({current:e})=>e?e.ownerDocument.defaultView:null,Dy=(e,t)=>Math.abs(e-t);function Q3(e,t){const n=Dy(e.x,t.x),r=Dy(e.y,t.y);return Math.sqrt(n**2+r**2)}class zk{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Id(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Q3(u.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:y}=u,{timestamp:w}=wt;this.history.push({...y,timestamp:w});const{onStart:x,onMove:h}=this.handlers;p||(x&&x(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),h&&h(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Dd(p,this.transformPagePoint),Le.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Id(u.type==="pointercancel"?this.lastMoveEventInfo:Dd(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(u,x),y&&y(u,x)},!Sm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=ol(t),a=Dd(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=wt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Id(a,this.history)),this.removeListeners=sl(ca(this.contextWindow,"pointermove",this.handlePointerMove),ca(this.contextWindow,"pointerup",this.handlePointerUp),ca(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pi(this.updatePoint)}}function Dd(e,t){return t?{point:t(e.point)}:e}function Iy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Id({point:e},t){return{point:e,delta:Iy(e,Vk(t)),offset:Iy(e,K3(t)),velocity:X3(t,.1)}}function K3(e){return e[0]}function Vk(e){return e[e.length-1]}function X3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Vk(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>rr(t)));)n--;if(!r)return{x:0,y:0};const s=ir(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Z3(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ge(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ge(n,e,r.max):Math.min(e,n)),e}function Ly(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function J3(e,{top:t,left:n,bottom:r,right:i}){return{x:Ly(e.x,n,i),y:Ly(e.y,t,r)}}function Fy(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function eR(e,t){return{x:Fy(e.x,t.x),y:Fy(e.y,t.y)}}function tR(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=Da(t.min,t.max-r,e.min):r>i&&(n=Da(e.min,e.max-i,t.min)),Ar(0,1,n)}function nR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Op=.35;function rR(e=Op){return e===!1?e=0:e===!0&&(e=Op),{x:By(e,"left","right"),y:By(e,"top","bottom")}}function By(e,t,n){return{min:$y(e,t),max:$y(e,n)}}function $y(e,t){return typeof e=="number"?e:e[t]||0}const iR=new WeakMap;class sR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ol(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=tA(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),hn(x=>{let h=this.getAxisMotionValue(x).get()||0;if(or.test(h)){const{projection:g}=this.visualElement;if(g&&g.layout){const k=g.layout.layoutBox[x];k&&(h=Dt(k)*(parseFloat(h)/100))}}this.originPoint[x]=h}),y&&Le.postRender(()=>y(d,u)),wp(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:w}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=u;if(m&&this.currentDirection===null){this.currentDirection=oR(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,x),this.updateAxis("y",u.point,x),this.visualElement.render(),w&&w(d,u)},a=(d,u)=>this.stop(d,u),l=()=>hn(d=>{var u;return this.getAnimationState(d)==="paused"&&((u=this.getAxisMotionValue(d).animation)==null?void 0:u.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new zk(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:$k(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Le.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Il(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Z3(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ns(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=J3(r.layoutBox,t):this.constraints=!1,this.elastic=rR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&hn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=nR(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ns(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Y3(r,i.root,this.visualElement.getTransformPagePoint());let o=eR(i.layout.layoutBox,s);if(n){const a=n(B3(o));this.hasMutatedConstraints=!!a,a&&(o=Nk(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=hn(d=>{if(!Il(d,n,this.currentDirection))return;let u=l&&l[d]||{};o&&(u={min:0,max:0});const p=i?200:1e6,m=i?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return wp(this.visualElement,t),r.start(Hm(t,r,0,n,this.visualElement,!1))}stopAnimation(){hn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){hn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){hn(n=>{const{drag:r}=this.getProps();if(!Il(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Ge(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ns(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};hn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=tR({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),hn(o=>{if(!Il(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Ge(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;iR.set(this.visualElement,this);const t=this.visualElement.current,n=ca(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ns(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Le.read(r);const o=Ua(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(hn(d=>{const u=this.getAxisMotionValue(d);u&&(this.originPoint[d]+=l[d].translate,u.set(u.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Op,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Il(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function oR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class aR extends wi{constructor(t){super(t),this.removeGroupControls=Sn,this.removeListeners=Sn,this.controls=new sR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Sn}unmount(){this.removeGroupControls(),this.removeListeners()}}const zy=e=>(t,n)=>{e&&Le.postRender(()=>e(t,n))};class lR extends wi{constructor(){super(...arguments),this.removePointerDownListener=Sn}onPointerDown(t){this.session=new zk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$k(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:zy(t),onStart:zy(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Le.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ca(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Vy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const zo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=Vy(e,t.target.x),r=Vy(e,t.target.y);return`${n}% ${r}%`}},cR={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hi.parse(e);if(i.length>5)return r;const s=hi.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=Ge(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class uR extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;jA(dR),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Le.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),km.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Uk(e){const[t,n]=jb(),r=v.useContext(dm);return f.jsx(uR,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(zb),isPresent:t,safeToRemove:n})}const dR={borderRadius:{...zo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:zo,borderTopRightRadius:zo,borderBottomLeftRadius:zo,borderBottomRightRadius:zo,boxShadow:cR};function fR(e,t,n){const r=At(e)?e:La(e);return r.start(Hm("",r,t,n)),r.animation}function pR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const hR=(e,t)=>e.depth-t.depth;class mR{constructor(){this.children=[],this.isDirty=!1}add(t){hm(this.children,t),this.isDirty=!0}remove(t){mm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hR),this.isDirty=!1,this.children.forEach(t)}}function gR(e,t){const n=sr.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(pi(r),e(s-t))};return Le.read(r,!0),()=>pi(r)}const Hk=["TopLeft","TopRight","BottomLeft","BottomRight"],vR=Hk.length,Uy=e=>typeof e=="string"?parseFloat(e):e,Hy=e=>typeof e=="number"||he.test(e);function yR(e,t,n,r,i,s){i?(e.opacity=Ge(0,n.opacity??1,xR(r)),e.opacityExit=Ge(t.opacity??1,0,wR(r))):s&&(e.opacity=Ge(t.opacity??1,n.opacity??1,r));for(let o=0;o<vR;o++){const a=`border${Hk[o]}Radius`;let l=Wy(t,a),c=Wy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Hy(l)===Hy(c)?(e[a]=Math.max(Ge(Uy(l),Uy(c),r),0),(or.test(c)||or.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ge(t.rotate||0,n.rotate||0,r))}function Wy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const xR=Wk(0,.5,lk),wR=Wk(.5,.95,Sn);function Wk(e,t,n){return r=>r<e?0:r>t?1:n(Da(e,t,r))}function qy(e,t){e.min=t.min,e.max=t.max}function fn(e,t){qy(e.x,t.x),qy(e.y,t.y)}function Gy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Yy(e,t,n,r,i){return e-=t,e=Gc(e,1/n,r),i!==void 0&&(e=Gc(e,1/i,r)),e}function bR(e,t=0,n=1,r=.5,i,s=e,o=e){if(or.test(t)&&(t=parseFloat(t),t=Ge(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Ge(s.min,s.max,r);e===s&&(a-=t),e.min=Yy(e.min,t,n,a,i),e.max=Yy(e.max,t,n,a,i)}function Qy(e,t,[n,r,i],s,o){bR(e,t[n],t[r],t[i],t.scale,s,o)}const kR=["x","scaleX","originX"],SR=["y","scaleY","originY"];function Ky(e,t,n,r){Qy(e.x,t,kR,n?n.x:void 0,r?r.x:void 0),Qy(e.y,t,SR,n?n.y:void 0,r?r.y:void 0)}function Xy(e){return e.translate===0&&e.scale===1}function qk(e){return Xy(e.x)&&Xy(e.y)}function Zy(e,t){return e.min===t.min&&e.max===t.max}function CR(e,t){return Zy(e.x,t.x)&&Zy(e.y,t.y)}function Jy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gk(e,t){return Jy(e.x,t.x)&&Jy(e.y,t.y)}function e0(e){return Dt(e.x)/Dt(e.y)}function t0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class TR{constructor(){this.members=[]}add(t){hm(this.members,t),t.scheduleRender()}remove(t){if(mm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function _R(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:u,rotateY:p,skewX:m,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),u&&(r+=`rotateX(${u}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ld=["","X","Y","Z"],ER={visibility:"hidden"},n0=1e3;let jR=0;function Fd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Yk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=tk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Le,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Yk(r)}function Qk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=jR++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(PR),this.nodes.forEach(IR),this.nodes.forEach(LR),this.nodes.forEach(MR)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new mR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new vm),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=pR(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let u;const p=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=gR(p,250),sc.hasAnimatedSinceResize&&(sc.hasAnimatedSinceResize=!1,this.nodes.forEach(i0))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||d.getDefaultTransition()||VR,{onLayoutAnimationStart:x,onLayoutAnimationComplete:h}=d.getProps(),g=!this.targetLayout||!Gk(this.targetLayout,y),k=!p&&m;if(this.options.layoutRoot||this.resumeFrom||k||p&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,k);const C={...wm(w,"layout"),onPlay:x,onComplete:h};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else p||i0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,pi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(FR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Yk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(r0);return}this.isUpdating||this.nodes.forEach(NR),this.isUpdating=!1,this.nodes.forEach(DR),this.nodes.forEach(AR),this.nodes.forEach(RR),this.clearAllSnapshots();const a=sr.now();wt.delta=Ar(0,1e3/60,a-wt.timestamp),wt.timestamp=a,wt.isProcessing=!0,jd.update.process(wt),jd.preRender.process(wt),jd.render.process(wt),wt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,km.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(OR),this.sharedNodes.forEach(BR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Le.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Le.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!qk(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||ji(this.latestValues)||d)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),UR(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return et();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(HR))){const{scroll:d}=this.root;d&&(Ls(a.x,d.offset.x),Ls(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=et();if(fn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:u,options:p}=d;d!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&fn(a,o),Ls(a.x,u.offset.x),Ls(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=et();fn(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Fs(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ji(d.latestValues)&&Fs(l,d.latestValues)}return ji(this.latestValues)&&Fs(l,this.latestValues),l}removeTransform(o){const a=et();fn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!ji(c.latestValues))continue;Pp(c.latestValues)&&c.updateSnapshot();const d=et(),u=c.measurePageBox();fn(d,u),Ky(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return ji(this.latestValues)&&Ky(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=wt.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),da(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),fn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=et(),this.targetWithTransforms=et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),q3(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):fn(this.target,this.layout.layoutBox),Fk(this.target,this.targetDelta)):fn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=et(),this.relativeTargetOrigin=et(),da(this.relativeTargetOrigin,this.target,m.target),fn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Pp(this.parent.latestValues)||Lk(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var y;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===wt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;fn(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;G3(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=et());const{target:m}=o;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gy(this.prevProjectionDelta.x,this.projectionDelta.x),Gy(this.prevProjectionDelta.y,this.projectionDelta.y)),ua(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!t0(this.projectionDelta.x,this.prevProjectionDelta.x)||!t0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Is(),this.projectionDelta=Is(),this.projectionDeltaWithTransform=Is()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Is();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=et(),m=l?l.source:void 0,y=this.layout?this.layout.source:void 0,w=m!==y,x=this.getStack(),h=!x||x.members.length<=1,g=!!(w&&!h&&this.options.crossfade===!0&&!this.path.some(zR));this.animationProgress=0;let k;this.mixTargetDelta=C=>{const S=C/1e3;s0(u.x,o.x,S),s0(u.y,o.y,S),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(da(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),$R(this.relativeTarget,this.relativeTargetOrigin,p,S),k&&CR(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=et()),fn(k,this.relativeTarget)),w&&(this.animationValues=d,yR(d,c,this.latestValues,S,g,h)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Le.update(()=>{sc.hasAnimatedSinceResize=!0,this.currentAnimation=fR(0,n0,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(n0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Kk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||et();const u=Dt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=Dt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}fn(a,l),Fs(a,d),ua(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new TR),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Fd("z",o,c,this.animationValues);for(let d=0;d<Ld.length;d++)Fd(`rotate${Ld[d]}`,o,c,this.animationValues),Fd(`skew${Ld[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return ER;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=ic(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=ic(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!ji(this.latestValues)&&(m.transform=l?l({},""):"none",this.hasProjected=!1),m}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=_R(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:u,y:p}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in Ba){if(d[m]===void 0)continue;const{correct:y,applyTo:w,isCSSVariable:x}=Ba[m],h=a.transform==="none"?d[m]:y(d[m],c);if(w){const g=w.length;for(let k=0;k<g;k++)a[w[k]]=h}else x?this.options.visualElement.renderState.vars[m]=h:a[m]=h}return this.options.layoutId&&(a.pointerEvents=c===this?ic(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(r0),this.root.sharedNodes.clear()}}}function AR(e){e.updateLayout()}function RR(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?hn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],m=Dt(p);p.min=r[u].min,p.max=p.min+m}):Kk(s,t.layoutBox,r)&&hn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],m=Dt(r[u]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+m)});const a=Is();ua(a,r,t.layoutBox);const l=Is();o?ua(l,e.applyTransform(i,!0),t.measuredBox):ua(l,r,t.layoutBox);const c=!qk(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:m}=u;if(p&&m){const y=et();da(y,t.layoutBox,p.layoutBox);const w=et();da(w,r,m.layoutBox),Gk(y,w)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function PR(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function MR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function OR(e){e.clearSnapshot()}function r0(e){e.clearMeasurements()}function NR(e){e.isLayoutDirty=!1}function DR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function i0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function IR(e){e.resolveTargetDelta()}function LR(e){e.calcProjection()}function FR(e){e.resetSkewAndRotation()}function BR(e){e.removeLeadSnapshot()}function s0(e,t,n){e.translate=Ge(t.translate,0,n),e.scale=Ge(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function o0(e,t,n,r){e.min=Ge(t.min,n.min,r),e.max=Ge(t.max,n.max,r)}function $R(e,t,n,r){o0(e.x,t.x,n.x,r),o0(e.y,t.y,n.y,r)}function zR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const VR={duration:.45,ease:[.4,0,.1,1]},a0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),l0=a0("applewebkit/")&&!a0("chrome/")?Math.round:Sn;function c0(e){e.min=l0(e.min),e.max=l0(e.max)}function UR(e){c0(e.x),c0(e.y)}function Kk(e,t,n){return e==="position"||e==="preserve-aspect"&&!W3(e0(t),e0(n),.2)}function HR(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const WR=Qk({attachResizeListener:(e,t)=>Ua(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Bd={current:void 0},Xk=Qk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Bd.current){const e=new WR({});e.mount(window),e.setOptions({layoutScroll:!0}),Bd.current=e}return Bd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),qR={pan:{Feature:lR},drag:{Feature:aR,ProjectionNode:Xk,MeasureLayout:Uk}};function u0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Le.postRender(()=>s(t,ol(t)))}class GR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=rA(t,(n,r)=>(u0(this.node,r,"Start"),i=>u0(this.node,i,"End"))))}unmount(){}}class YR extends wi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=sl(Ua(this.node.current,"focus",()=>this.onFocus()),Ua(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function d0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Le.postRender(()=>s(t,ol(t)))}class QR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=aA(t,(n,r)=>(d0(this.node,r,"Start"),(i,{success:s})=>d0(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Np=new WeakMap,$d=new WeakMap,KR=e=>{const t=Np.get(e.target);t&&t(e)},XR=e=>{e.forEach(KR)};function ZR({root:e,...t}){const n=e||document;$d.has(n)||$d.set(n,{});const r=$d.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(XR,{root:e,...t})),r[i]}function JR(e,t,n){const r=ZR(t);return Np.set(e,n),r.observe(e),()=>{Np.delete(e),r.unobserve(e)}}const eP={some:0,all:1};class tP extends wi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:eP[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),p=c?d:u;p&&p(l)};return JR(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(nP(t,n))&&this.startObserver()}unmount(){}}function nP({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const rP={inView:{Feature:tP},tap:{Feature:QR},focus:{Feature:YR},hover:{Feature:GR}},iP={layout:{ProjectionNode:Xk,MeasureLayout:Uk}},Dp={current:null},Zk={current:!1};function sP(){if(Zk.current=!0,!!fm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Dp.current=e.matches;e.addListener(t),t()}else Dp.current=!1}const oP=[...Sk,Et,hi],aP=e=>oP.find(kk(e)),lP=new WeakMap;function cP(e,t,n){for(const r in t){const i=t[r],s=n[r];if(At(i))e.addValue(r,i);else if(At(s))e.addValue(r,La(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,La(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const f0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=zm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=sr.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Le.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:d}=o;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=_u(n),this.isVariantNode=Bb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const y=p[m];l[m]!==void 0&&At(y)&&y.set(l[m],!1)}}mount(t){this.current=t,lP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Zk.current||sP(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Dp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),pi(this.notifyUpdate),pi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ls.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Le.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in mo){const n=mo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):et()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<f0.length;r++){const i=f0[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=cP(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=La(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(wk(r)||uk(r))?r=parseFloat(r):!aP(r)&&hi.test(n)&&(r=vk(t,n)),this.setBaseTarget(t,At(r)?r.get():r)),At(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Dm(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!At(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new vm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Jk extends uP{constructor(){super(...arguments),this.KeyframeResolver=Ck}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;At(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function dP(e){return window.getComputedStyle(e)}class fP extends Jk{constructor(){super(...arguments),this.type="html",this.renderInstance=Kb}readValueFromInstance(t,n){if(ls.has(n))return T5(t,n);{const r=dP(t),i=(Em(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Bk(t,n)}build(t,n,r){Rm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Im(t,n,r)}}class pP extends Jk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=et,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Qb(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ls.has(n)){const r=gk(n);return r&&r.default||0}return n=Xb.has(n)?n:_m(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Jb(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Le.postRender(this.updateDimensions)}build(t,n,r){Om(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){Zb(t,n,r,i)}mount(t){this.isSVGTag=Nm(t.tagName),super.mount(t)}}const hP=(e,t)=>Mm(e)?new pP(t):new fP(t,{allowProjection:e!==v.Fragment}),mP=ZA({...L3,...rP,...qR,...iP},hP),Pe=hA(mP);class gP{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const vP=()=>new gP;function yP(){return ku(vP)}var $r=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))($r||{});const eS=v.createContext({}),xP={[re.TooltipDefault]:"Bizimle sohbet edin!",[re.TooltipActive]:"Yeni mesajlar var!",[re.CloseButtonAria]:"Kapat",[re.MessagePlaceholder]:"Mesajınızı yazın",[re.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[re.NewMessagesNotification]:"Yeni mesajlar var!",[re.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[re.ChatCloseWarning]:"Bu işlem geri alınamaz.",[re.ChatSettings]:"Sohbet Ayarları",[re.ChatEndConversation]:"Sohbeti Sonlandır",[re.CancelAction]:"Vazgeç",[re.CloseAction]:"Kapat",[re.QuickActions]:"Hızlı işlemler",[re.GreetingStartChat]:"Sohbete başla",[re.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[re.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[re.RatingHeaderThanks]:"Teşekkürler!",[re.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[re.RatingRateConversation]:"Görüşmeyi puanlayın",[re.RatingComment]:"Yorumunuz (İsteğe bağlı)",[re.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[re.RatingSubmit]:"Değerlendirmeyi Gönder",[re.RatingNewConversation]:"Yeni Görüşme Başlat",[re.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[re.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[re.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[re.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[re.RatingYourScore]:"Puanınız: {score}",[re.PoweredBy]:"Powered by",[re.NotificationSoundOn]:"Bildirim sesi aç",[re.NotificationSoundOff]:"Bildirim sesi kapat"},wP={[b.Background]:"#ffffff",[b.Border]:"#e2e8f0",[b.TooltipText]:"#1e40af",[b.TooltipBackground]:"#dbeafe",[b.TooltipBorder]:"#3b82f6",[b.HeaderBackground]:"#ffffff",[b.HeaderBorder]:"#e2e8f0",[b.HeaderText]:"#1e293b",[b.FooterBackground]:"#f8fafc",[b.FooterBorder]:"#e2e8f0",[b.FooterText]:"#475569",[b.MessageAdminBackground]:"#f1f5f9",[b.MessageAdminText]:"#334155",[b.MessageVisitorBackground]:"#3b82f6",[b.MessageVisitorText]:"#ffffff",[b.MessageAgentBackground]:"#ede9fe",[b.MessageAgentText]:"#5b21b6",[b.GreeterBackground]:"#ffffff",[b.GreeterText]:"#334155",[b.GreeterBorder]:"#e2e8f0",[b.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[b.GreeterTopText]:"#ffffff",[b.GreeterButtonBackground]:"#3b82f6",[b.GreeterButtonText]:"#ffffff",[b.ButtonBackground]:"#3b82f6",[b.ButtonText]:"#ffffff",[b.InputBackground]:"#f8fafc",[b.InputText]:"#1e293b",[b.InputBorder]:"#e2e8f0",[b.CloseButtonBackground]:"#f1f5f9",[b.CloseButtonText]:"#475569",[b.CloseButtonHover]:"#e2e8f0",[b.IconColor]:"#64748b",[b.IconBackground]:"transparent",[b.ErrorBackground]:"#fef2f2",[b.ErrorText]:"#dc2626",[b.ErrorBorder]:"#fca5a5",[b.SuccessBackground]:"#f0fdf4",[b.SuccessText]:"#16a34a",[b.SuccessBorder]:"#86efac",[b.WarningBackground]:"#fffbeb",[b.WarningText]:"#d97706",[b.WarningBorder]:"#fcd34d",[b.LinkColor]:"#2563eb",[b.LinkHoverColor]:"#1d4ed8",[b.DividerColor]:"#e2e8f0",[b.ShadowColor]:"rgba(0, 0, 0, 0.1)",[b.StarActiveColor]:"#f59e0b",[b.StarInactiveColor]:"#e2e8f0",[b.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[b.ChatCloseConfirmText]:"#dc2626",[b.RatingHeaderBackground]:"#3b82f6",[b.RatingHeaderText]:"#ffffff",[b.RatingSuccessBackground]:"#ffffff",[b.RatingSuccessText]:"#334155",[b.RatingRateConversationText]:"#1e293b"},bP={[b.Background]:"#0a0a0a",[b.Border]:"#262626",[b.TooltipText]:"#e5e5e5",[b.TooltipBackground]:"#262626",[b.TooltipBorder]:"#404040",[b.HeaderBackground]:"#171717",[b.HeaderBorder]:"#262626",[b.HeaderText]:"#fafafa",[b.FooterBackground]:"#0a0a0a",[b.FooterBorder]:"#262626",[b.FooterText]:"#a3a3a3",[b.MessageAdminBackground]:"#262626",[b.MessageAdminText]:"#e5e5e5",[b.MessageVisitorBackground]:"#171717",[b.MessageVisitorText]:"#e5e5e5",[b.MessageAgentBackground]:"#5b21b6",[b.MessageAgentText]:"#e9d5ff",[b.GreeterBackground]:"#171717",[b.GreeterText]:"#e5e5e5",[b.GreeterBorder]:"#262626",[b.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[b.GreeterTopText]:"#fafafa",[b.GreeterButtonBackground]:"#3b82f6",[b.GreeterButtonText]:"#ffffff",[b.ButtonBackground]:"#3b82f6",[b.ButtonText]:"#ffffff",[b.InputBackground]:"#171717",[b.InputText]:"#e5e5e5",[b.InputBorder]:"#3f3f3f",[b.CloseButtonBackground]:"#262626",[b.CloseButtonText]:"#a3a3a3",[b.CloseButtonHover]:"#404040",[b.IconColor]:"#a3a3a3",[b.IconBackground]:"transparent",[b.ErrorBackground]:"#450a0a",[b.ErrorText]:"#fca5a5",[b.ErrorBorder]:"#7f1d1d",[b.SuccessBackground]:"#052e16",[b.SuccessText]:"#86efac",[b.SuccessBorder]:"#14532d",[b.WarningBackground]:"#451a03",[b.WarningText]:"#fcd34d",[b.WarningBorder]:"#78350f",[b.LinkColor]:"#3b82f6",[b.LinkHoverColor]:"#60a5fa",[b.DividerColor]:"#262626",[b.ShadowColor]:"rgba(0, 0, 0, 0.4)",[b.StarActiveColor]:"#f59e0b",[b.StarInactiveColor]:"#404040",[b.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[b.ChatCloseConfirmText]:"#fca5a5",[b.RatingHeaderBackground]:"#171717",[b.RatingHeaderText]:"#fafafa",[b.RatingSuccessBackground]:"#171717",[b.RatingSuccessText]:"#e5e5e5",[b.RatingRateConversationText]:"#e5e5e5"},kP={[$r.None]:"0px",[$r.Sm]:"var(--radius-sm)",[$r.Md]:"var(--radius-md)",[$r.Lg]:"var(--radius-lg)",[$r.Xl]:"var(--radius-lg)",[$r.Full]:"calc(infinity * 1px)"},SP=e=>{const t={...xP};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.texts)return t;for(const n in e.appearance.design.texts){const r=n;e.appearance.design.texts[r]&&(t[r]=e.appearance.design.texts[r])}return t};function CP(e,t){const n=e.replace(/^#/,"");if(n.length!==6)return e;const r=Math.max(0,Math.round(Number.parseInt(n.slice(0,2),16)*(1-t))),i=Math.max(0,Math.round(Number.parseInt(n.slice(2,4),16)*(1-t))),s=Math.max(0,Math.round(Number.parseInt(n.slice(4,6),16)*(1-t)));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}const zd="#ffffff";function TP(e){const t=CP(e,.2);return{[b.ButtonBackground]:t,[b.ButtonText]:zd,[b.GreeterButtonBackground]:t,[b.GreeterButtonText]:zd,[b.MessageVisitorBackground]:t,[b.MessageVisitorText]:zd}}const _P=(e,t)=>{var i,s;const r={...t==="dark"?bP:wP};if(t==="dark")return r;if((s=(i=e==null?void 0:e.appearance)==null?void 0:i.design)!=null&&s.colors){const o=e.appearance.design.colors,a=o.main_color;if(a){const l=TP(a);for(const c of Object.keys(l))l[c]&&(r[c]=l[c])}for(const l in o){if(l==="main_color"||l==="secondary_color"||l==="accent_color")continue;const c=l;o[l]&&l in r&&(r[c]=o[l])}}return r},tS="lc:theme:mode";function EP(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function jP(){try{const e=localStorage.getItem(tS);if(e==="light"||e==="dark"||e==="system")return e}catch{}return Ne.System}function AP({children:e,widget:t}){const[n,r]=v.useState(jP),[i,s]=v.useState(EP);v.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),w=x=>{s(x.matches?"dark":"light")};return y.addEventListener("change",w),()=>y.removeEventListener("change",w)},[]);const o=n===Ne.System?i:n,a=v.useCallback(y=>{r(y);try{localStorage.setItem(tS,y)}catch{}},[]),l=_P(t,o),c=SP(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:$r.Md,u=y=>l[y],p=y=>c[y],m=()=>kP[d];return f.jsx(eS.Provider,{value:{colors:l,texts:c,getColor:u,getText:p,getRadius:m,mode:n,resolvedMode:o,setMode:a},children:e})}const Se=()=>v.useContext(eS),cs=()=>Se().getText;function Rt({children:e,type:t="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:o=!1,className:a,style:l,textKey:c=b.ButtonText,bgKey:d=b.ButtonBackground,animations:u={},withoutTheming:p,...m}){const y=Se();return f.jsx(Pe.button,{type:t,className:ze("flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-0 font-medium transition-opacity",{"rounded-full":o&&i!=="xs","rounded-lg":!o,"opacity-50 cursor-not-allowed":s,"hover:opacity-90 active:opacity-95":!s},a,Yv[n]&&Yv[n][r],$j[i][o?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!p&&{color:y.getColor(c),backgroundColor:y.getColor(d),...o?{}:{borderRadius:y.getRadius()}},...l},...u,...m,children:e})}function X(){}X.Home=function(t){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 00.707-1.707l-9-9a.999.999 0 00-1.414 0l-9 9A1 1 0 003 13zm7 7v-5h4v5h-4zm2-15.586l6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z"})})};X.Chat=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});X.Menu=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});X.MessageTyping=({className:e="size-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});X.Check=function(t){return f.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M12.736 3.97a.733.733 0 011.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 01-1.065.02L3.217 8.384a.757.757 0 010-1.06.733.733 0 011.047 0l3.052 3.093 5.4-6.425a.247.247 0 01.02-.022z"})})};X.Website=function(t){return f.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14 7a1 1 0 00-1 1v8a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1h-4zm3 2h-2v6h2V9z",clipRule:"evenodd"}),f.jsx("path",{fill:"currentColor",d:"M6 7a1 1 0 000 2h4a1 1 0 100-2H6zM6 11a1 1 0 100 2h4a1 1 0 100-2H6zM5 16a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z"}),f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 3a3 3 0 00-3 3v12a3 3 0 003 3h16a3 3 0 003-3V6a3 3 0 00-3-3H4zm16 2H4a1 1 0 00-1 1v12a1 1 0 001 1h16a1 1 0 001-1V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})};X.ArrowDown=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});X.ArrowDown2=e=>f.jsxs("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:[f.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_iconCarrier",children:f.jsx("path",{d:"M903.232 256l56.768 50.432L512 768 64 306.432 120.768 256 512 659.072z",fill:"currentColor"})})]});X.ArrowLeft=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})});X.XCircle=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});X.X=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});X.PaperAirplane=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})});X.Spin=function(t){return f.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M6.804 15a1 1 0 00-1.366-.366l-1.732 1a1 1 0 001 1.732l1.732-1A1 1 0 006.804 15zM3.706 8.366l1.732 1a1 1 0 101-1.732l-1.732-1a1 1 0 00-1 1.732zM6 12a1 1 0 00-1-1H3a1 1 0 000 2h2a1 1 0 001-1zm11.196-3a1 1 0 001.366.366l1.732-1a1 1 0 10-1-1.732l-1.732 1A1 1 0 0017.196 9zM15 6.804a1 1 0 001.366-.366l1-1.732a1 1 0 10-1.732-1l-1 1.732A1 1 0 0015 6.804zm5.294 8.83l-1.732-1a1 1 0 10-1 1.732l1.732 1a1 1 0 001-1.732zm-3.928 1.928a1 1 0 10-1.732 1l1 1.732a1 1 0 101.732-1zM21 11h-2a1 1 0 000 2h2a1 1 0 000-2zm-9 7a1 1 0 00-1 1v2a1 1 0 002 0v-2a1 1 0 00-1-1zm-3-.804a1 1 0 00-1.366.366l-1 1.732a1 1 0 001.732 1l1-1.732A1 1 0 009 17.196zM12 2a1 1 0 00-1 1v2a1 1 0 002 0V3a1 1 0 00-1-1z"})})};X.ExternalLink=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})});X.Phone=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"})});X.Mail=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})});X.Star=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})});X.Plus=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})});X.History=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});X.Eye=e=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});X.Lock=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})});X.User=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})});X.Emoji=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.182 15.182a4.5 4.5 0 0 1-6.364 0M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Z"})});X.Paperclip=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})});X.Sparkles=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})});X.Sun=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75v-2.25m-4.773 4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})});X.Moon=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})});X.Monitor=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"})});X.Volume2=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 0 1 0 12.728M16.463 8.288a5.25 5.25 0 0 1 0 7.424M6.75 8.25l4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});X.VolumeX=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75 19.5 12m0 0 2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6 4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});X.Bot=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})});function Ip(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var rt=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e.AIAgentMode="lc:agent:mode",e.AIAgent="lc:agent:data",e.AIAgentSessionId="lc:agent:session",e.HumanNeedRequested="lc:agent:human_need",e))(rt||{});const Ln=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},Xo=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},fa=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),Wm(e)},nS=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},Ll=(e,t,n,r,i)=>{const s=`${e}:`;t&&(n||i)?(localStorage.setItem(`${s}lc:agent:mode`,"true"),localStorage.setItem(`${s}lc:agent:data`,JSON.stringify(t)),r&&localStorage.setItem(`${s}lc:agent:session`,r),i!==void 0&&(i?localStorage.setItem(`${s}lc:agent:human_need`,"true"):localStorage.removeItem(`${s}lc:agent:human_need`))):Wm(e)},mr=e=>{const t=`${e}:`,n=localStorage.getItem(`${t}lc:agent:mode`)==="true",r=localStorage.getItem(`${t}lc:agent:data`),i=localStorage.getItem(`${t}lc:agent:session`),s=localStorage.getItem(`${t}lc:agent:human_need`)==="true";let o=null;if(r)try{o=JSON.parse(r)}catch{o=null}return{isAgentMode:n,agent:o,sessionId:i,humanNeedRequested:s}},Wm=e=>{const t=`${e}:`;localStorage.removeItem(`${t}lc:agent:mode`),localStorage.removeItem(`${t}lc:agent:data`),localStorage.removeItem(`${t}lc:agent:session`),localStorage.removeItem(`${t}lc:agent:human_need`)},mi=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=Ip(),localStorage.setItem(t,n)),n},RP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},p0=e=>{let t;const n=new Set,r=(d,u)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const m=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(RP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,l);return l},PP=e=>e?p0(e):p0;var rS={exports:{}},iS={},sS={exports:{}},oS={};/**
|
|
70
|
+
`),()=>{document.head.removeChild(h)}},[t]),f.jsx(UA,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const WA=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=Su(qA),c=v.useId();let d=!0,u=v.useMemo(()=>(d=!1,{id:c,initial:t,isPresent:n,custom:i,onExitComplete:p=>{l.set(p,!0);for(const h of l.values())if(!h)return;r&&r()},register:p=>(l.set(p,!1),()=>l.delete(p))}),[n,l,r]);return s&&d&&(u={...u}),v.useMemo(()=>{l.forEach((p,h)=>l.set(h,!1))},[n]),v.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),o==="popLayout"&&(e=f.jsx(HA,{isPresent:n,anchorX:a,children:e})),f.jsx(Cu.Provider,{value:u,children:e})};function qA(){return new Map}function Rb(e=!0){const t=v.useContext(Cu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=v.useId();v.useEffect(()=>{if(e)return i(s)},[e]);const o=v.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Nl=e=>e.key||"";function Kv(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Ar=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=Rb(o),d=v.useMemo(()=>Kv(e),[e]),u=o&&!l?[]:d.map(Nl),p=v.useRef(!0),h=v.useRef(d),y=Su(()=>new Map),[x,w]=v.useState(d),[m,g]=v.useState(d);jb(()=>{p.current=!1,h.current=d;for(let S=0;S<m.length;S++){const _=Nl(m[S]);u.includes(_)?y.delete(_):y.get(_)!==!0&&y.set(_,!1)}},[m,u.length,u.join("-")]);const b=[];if(d!==x){let S=[...d];for(let _=0;_<m.length;_++){const j=m[_],A=Nl(j);u.includes(A)||(S.splice(_,0,j),b.push(j))}return s==="wait"&&b.length&&(S=b),g(Kv(S)),w(d),null}const{forceRender:C}=v.useContext(fm);return f.jsx(f.Fragment,{children:m.map(S=>{const _=Nl(S),j=o&&!l?!1:d===m||u.includes(_),A=()=>{if(y.has(_))y.set(_,!0);else return;let E=!0;y.forEach(L=>{L||(E=!1)}),E&&(C==null||C(),g(h.current),o&&(c==null||c()),r&&r())};return f.jsx(WA,{isPresent:j,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:j?void 0:A,anchorX:a,children:S},_)})})};function mm(e,t){e.indexOf(t)===-1&&e.push(t)}function gm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let vp=()=>{};const yp={skipAnimations:!1,useManualTiming:!1};function vm(e){let t;return()=>(t===void 0&&(t=e()),t)}const Cn=e=>e,Ia=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class ym{constructor(){this.subscriptions=[]}add(t){return mm(this.subscriptions,t),()=>gm(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const rr=e=>e*1e3,ir=e=>e/1e3;function Pb(e,t){return t?e*(1e3/t):0}const GA=vm(()=>window.ScrollTimeline!==void 0);class YA{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(GA()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class QA extends YA{then(t,n){return this.finished.finally(t).then(()=>{})}}const Xv={value:null,addProjectionMetrics:null},xm=e=>Array.isArray(e)&&typeof e[0]=="number",KA={};function XA(e,t){const n=vm(e);return()=>KA[t]??n()}const La=XA(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Mb=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(s/(i-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Ko=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,xp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ko([0,.65,.55,1]),circOut:Ko([.55,0,1,.45]),backIn:Ko([.31,.01,.66,-.59]),backOut:Ko([.33,1.53,.69,.99])};function Ob(e,t){if(e)return typeof e=="function"&&La()?Mb(e,t):xm(e)?Ko(e):Array.isArray(e)?e.map(n=>Ob(n,t)||xp.easeOut):xp[e]}function ZA(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const u=Ob(a,i);return Array.isArray(u)&&(d.easing=u),e.animate(d,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal",pseudoElement:c})}function wm(e){return typeof e=="function"&&"applyToOptions"in e}function bm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Vc=2e4;function km(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Vc;)t+=n,r=e.next(t);return t>=Vc?1/0:t}function JA(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(km(r),Vc);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:ir(i)}}function Nb(e){return!!(typeof e=="function"&&La()||!e||typeof e=="string"&&(e in xp||La())||xm(e)||Array.isArray(e)&&e.every(Nb))}function Zv(e,t){e.timeline=t,e.onfinish=null}const Dl=["read","resolveKeyframes","update","preRender","render","postRender"];function ej(e,t){let n=new Set,r=new Set,i=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(u){o.has(u)&&(d.schedule(u),e()),l++,u(a)}const d={schedule:(u,p=!1,h=!1)=>{const x=h&&i?n:r;return p&&o.add(u),x.has(u)||x.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(c),t&&Xv.value&&Xv.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const tj=40;function Db(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Dl.reduce((m,g)=>(m[g]=ej(s,t?g:void 0),m),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=o,h=()=>{const m=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(m-i.timestamp,tj),1),i.timestamp=m,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),u.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},y=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Dl.reduce((m,g)=>{const b=o[g];return m[g]=(C,S=!1,_=!1)=>(n||y(),b.schedule(C,S,_)),m},{}),cancel:m=>{for(let g=0;g<Dl.length;g++)o[Dl[g]].cancel(m)},state:i,steps:o}}const{schedule:Sm,cancel:HB}=Db(queueMicrotask,!1),{schedule:Fe,cancel:pi,state:wt,steps:jd}=Db(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cn,!0);let ic;function nj(){ic=void 0}const sr={now:()=>(ic===void 0&&sr.set(wt.isProcessing||yp.useManualTiming?wt.timestamp:performance.now()),ic),set:e=>{ic=e,queueMicrotask(nj)}},Pn={x:!1,y:!1};function Ib(){return Pn.x||Pn.y}function rj(e){return e==="x"||e==="y"?Pn[e]?null:(Pn[e]=!0,()=>{Pn[e]=!1}):Pn.x||Pn.y?null:(Pn.x=Pn.y=!0,()=>{Pn.x=Pn.y=!1})}function ij(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}function Lb(e,t){const n=ij(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Jv(e){return!(e.pointerType==="touch"||Ib())}function sj(e,t,n={}){const[r,i,s]=Lb(e,n),o=a=>{if(!Jv(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{Jv(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Fb=(e,t)=>t?e===t?!0:Fb(e,t.parentElement):!1,Cm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,oj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function aj(e){return oj.has(e.tagName)||e.tabIndex!==-1}const Xo=new WeakSet;function ey(e){return t=>{t.key==="Enter"&&e(t)}}function Rd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const lj=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=ey(()=>{if(Xo.has(n))return;Rd(n,"down");const i=ey(()=>{Rd(n,"up")}),s=()=>Rd(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function ty(e){return Cm(e)&&!Ib()}function cj(e,t,n={}){const[r,i,s]=Lb(e,n),o=a=>{const l=a.currentTarget;if(!ty(a)||Xo.has(l))return;Xo.add(l);const c=t(l,a),d=(h,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!ty(h)||!Xo.has(l))&&(Xo.delete(l),typeof c=="function"&&c(h,{success:y}))},u=h=>{d(h,l===window||l===document||n.useGlobalTarget||Fb(l,h.target))},p=h=>{d(h,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a instanceof HTMLElement&&(a.addEventListener("focus",c=>lj(c,i)),!aj(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const ny=30,uj=e=>!isNaN(parseFloat(e));class dj{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=sr.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=uj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new ym);const r=this.events[t].add(n);return t==="change"?()=>{r(),Fe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ny)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ny);return Pb(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Fa(e,t){return new dj(e,t)}const Bb=v.createContext({strict:!1}),ry={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},mo={};for(const e in ry)mo[e]={isEnabled:t=>ry[e].some(n=>!!t[n])};function fj(e){for(const t in e)mo[t]={...mo[t],...e[t]}}const pj=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Uc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||pj.has(e)}let $b=e=>!Uc(e);function hj(e){e&&($b=t=>t.startsWith("on")?!Uc(t):e(t))}try{hj(require("@emotion/is-prop-valid").default)}catch{}function mj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||($b(i)||n===!0&&Uc(i)||!t&&!Uc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function gj(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const _u=v.createContext({});function Tu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ba(e){return typeof e=="string"||Array.isArray(e)}const _m=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Tm=["initial",..._m];function Eu(e){return Tu(e.animate)||Tm.some(t=>Ba(e[t]))}function zb(e){return!!(Eu(e)||e.variants)}function vj(e,t){if(Eu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ba(n)?n:void 0,animate:Ba(r)?r:void 0}}return e.inherit!==!1?t:{}}function yj(e){const{initial:t,animate:n}=vj(e,v.useContext(_u));return v.useMemo(()=>({initial:t,animate:n}),[iy(t),iy(n)])}function iy(e){return Array.isArray(e)?e.join(" "):e}const xj=Symbol.for("motionComponentSymbol");function Ns(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function wj(e,t,n){return v.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ns(n)&&(n.current=r))},[t])}const Em=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),bj="framerAppearId",Vb="data-"+Em(bj),Ub=v.createContext({});function kj(e,t,n,r,i){var x,w;const{visualElement:s}=v.useContext(_u),o=v.useContext(Bb),a=v.useContext(Cu),l=v.useContext(hm).reducedMotion,c=v.useRef(null);r=r||o.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:s,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=c.current,u=v.useContext(Ub);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&Sj(c.current,n,i,u);const p=v.useRef(!1);v.useInsertionEffect(()=>{d&&p.current&&d.update(n,a)});const h=n[Vb],y=v.useRef(!!h&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,h))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,h)));return jb(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Sm.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,h)}),y.current=!1))}),d}function Sj(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Hb(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ns(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function Hb(e){if(e)return e.options.allowProjection!==!1?e.projection:Hb(e.parent)}function Cj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&fj(e);function s(a,l){let c;const d={...v.useContext(hm),...a,layoutId:_j(a)},{isStatic:u}=d,p=yj(a),h=r(a,u);if(!u&&pm){Tj();const y=Ej(d);c=y.MeasureLayout,p.visualElement=kj(i,h,d,t,y.ProjectionNode)}return f.jsxs(_u.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,n(i,a,wj(h,p.visualElement,l),h,u,p.visualElement)]})}s.displayName=`motion.${typeof i=="string"?i:`create(${i.displayName??i.name??""})`}`;const o=v.forwardRef(s);return o[xj]=i,o}function _j({layoutId:e}){const t=v.useContext(fm).id;return t&&e!==void 0?t+"-"+e:e}function Tj(e,t){v.useContext(Bb).strict}function Ej(e){const{drag:t,layout:n}=mo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Wb=e=>t=>typeof t=="string"&&t.startsWith(e),Am=Wb("--"),Aj=Wb("var(--"),jm=e=>Aj(e)?jj.test(e.split("/*")[0].trim()):!1,jj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,$a={};function Rj(e){for(const t in e)$a[t]=e[t],Am(t)&&($a[t].isCSSVariable=!0)}const Eo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ls=new Set(Eo);function qb(e,{layout:t,layoutId:n}){return ls.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!$a[e]||e==="opacity")}const jt=e=>!!(e&&e.getVelocity),Gb=(e,t)=>t&&typeof e=="number"?t.transform(e):e,jr=(e,t,n)=>n>t?t:n<e?e:n,Ao={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},za={...Ao,transform:e=>jr(0,1,e)},Il={...Ao,default:1},il=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Lr=il("deg"),or=il("%"),ge=il("px"),Pj=il("vh"),Mj=il("vw"),sy={...or,parse:e=>or.parse(e)/100,transform:e=>or.transform(e*100)},Oj={borderWidth:ge,borderTopWidth:ge,borderRightWidth:ge,borderBottomWidth:ge,borderLeftWidth:ge,borderRadius:ge,radius:ge,borderTopLeftRadius:ge,borderTopRightRadius:ge,borderBottomRightRadius:ge,borderBottomLeftRadius:ge,width:ge,maxWidth:ge,height:ge,maxHeight:ge,top:ge,right:ge,bottom:ge,left:ge,padding:ge,paddingTop:ge,paddingRight:ge,paddingBottom:ge,paddingLeft:ge,margin:ge,marginTop:ge,marginRight:ge,marginBottom:ge,marginLeft:ge,backgroundPositionX:ge,backgroundPositionY:ge},Nj={rotate:Lr,rotateX:Lr,rotateY:Lr,rotateZ:Lr,scale:Il,scaleX:Il,scaleY:Il,scaleZ:Il,skew:Lr,skewX:Lr,skewY:Lr,distance:ge,translateX:ge,translateY:ge,translateZ:ge,x:ge,y:ge,z:ge,perspective:ge,transformPerspective:ge,opacity:za,originX:sy,originY:sy,originZ:ge},oy={...Ao,transform:Math.round},Rm={...Oj,...Nj,zIndex:oy,size:ge,fillOpacity:za,strokeOpacity:za,numOctaves:oy},Dj={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ij=Eo.length;function Lj(e,t,n){let r="",i=!0;for(let s=0;s<Ij;s++){const o=Eo[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=Gb(a,Rm[o]);if(!l){i=!1;const d=Dj[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Pm(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(ls.has(l)){o=!0;continue}else if(Am(l)){i[l]=c;continue}else{const d=Gb(c,Rm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=Lj(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=s;r.transformOrigin=`${l} ${c} ${d}`}}const Mm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Yb(e,t,n){for(const r in t)!jt(t[r])&&!qb(r,n)&&(e[r]=t[r])}function Fj({transformTemplate:e},t){return v.useMemo(()=>{const n=Mm();return Pm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Bj(e,t){const n=e.style||{},r={};return Yb(r,n,e),Object.assign(r,Fj(e,t)),r}function $j(e,t){const n={},r=Bj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const zj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Om(e){return typeof e!="string"||e.includes("-")?!1:!!(zj.indexOf(e)>-1||/[A-Z]/u.test(e))}const Vj={offset:"stroke-dashoffset",array:"stroke-dasharray"},Uj={offset:"strokeDashoffset",array:"strokeDasharray"};function Hj(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Vj:Uj;e[s.offset]=ge.transform(-r);const o=ge.transform(t),a=ge.transform(n);e[s.array]=`${o} ${a}`}function ay(e,t,n){return typeof e=="string"?e:ge.transform(t+n*e)}function Wj(e,t,n){const r=ay(t,e.x,e.width),i=ay(n,e.y,e.height);return`${r} ${i}`}function Nm(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Pm(e,c,u),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:y}=e;p.transform&&(y&&(h.transform=p.transform),delete p.transform),y&&(i!==void 0||s!==void 0||h.transform)&&(h.transformOrigin=Wj(y,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&Hj(p,o,a,l,!1)}const Qb=()=>({...Mm(),attrs:{}}),Dm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qj(e,t,n,r){const i=v.useMemo(()=>{const s=Qb();return Nm(s,t,Dm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Yb(s,e.style,e),i.style={...s,...i.style}}return i}function Gj(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Om(n)?qj:$j)(r,s,o,n),c=mj(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,p=v.useMemo(()=>jt(u)?u.get():u,[u]);return v.createElement(n,{...d,children:p})}}function ly(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Im(e,t,n,r){if(typeof t=="function"){const[i,s]=ly(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=ly(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const wp=e=>Array.isArray(e),Yj=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Qj=e=>wp(e)?e[e.length-1]||0:e;function sc(e){const t=jt(e)?e.get():e;return Yj(t)?t.toValue():t}function Kj({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:Xj(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const Kb=e=>(t,n)=>{const r=v.useContext(_u),i=v.useContext(Cu),s=()=>Kj(e,t,r,i);return n?s():Su(s)};function Xj(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=sc(s[p]);let{initial:o,animate:a}=e;const l=Eu(e),c=zb(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const u=d?a:o;if(u&&typeof u!="boolean"&&!Tu(u)){const p=Array.isArray(u)?u:[u];for(let h=0;h<p.length;h++){const y=Im(e,p[h]);if(y){const{transitionEnd:x,transition:w,...m}=y;for(const g in m){let b=m[g];if(Array.isArray(b)){const C=d?b.length-1:0;b=b[C]}b!==null&&(i[g]=b)}for(const g in x)i[g]=x[g]}}}return i}function Lm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(jt(r[o])||t.style&&jt(t.style[o])||qb(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const Zj={useVisualState:Kb({scrapeMotionValuesFromProps:Lm,createRenderState:Mm})};function Xb(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function Zb(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const Jb=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ek(e,t,n,r){Zb(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(Jb.has(i)?i:Em(i),t.attrs[i])}function tk(e,t,n){const r=Lm(e,t,n);for(const i in e)if(jt(e[i])||jt(t[i])){const s=Eo.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const cy=["x","y","width","height","cx","cy","r"],Jj={useVisualState:Kb({scrapeMotionValuesFromProps:tk,createRenderState:Qb,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(ls.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<cy.length;a++){const l=cy[a];e[l]!==t[l]&&(o=!0)}o&&Fe.read(()=>{Xb(n,r),Fe.render(()=>{Nm(r,i,Dm(n.tagName),e.transformTemplate),ek(n,r)})})}})};function e5(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Om(r)?Jj:Zj,preloadedFeatures:e,useRender:Gj(i),createVisualElement:t,Component:r};return Cj(o)}}function Va(e,t,n){const r=e.getProps();return Im(r,t,n!==void 0?n:r.custom,e)}const nk=new Set(["width","height","top","left","right","bottom",...Eo]);function t5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Fa(n))}function n5(e,t){const n=Va(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=Qj(s[o]);t5(e,o,a)}}function r5(e){return!!(jt(e)&&e.add)}function bp(e,t){const n=e.getValue("willChange");if(r5(n))return n.add(t);if(!n&&yp.WillChange){const r=new yp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function rk(e){return e.props[Vb]}const ik=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,i5=1e-7,s5=12;function o5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=ik(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>i5&&++a<s5);return o}function sl(e,t,n,r){if(e===t&&n===r)return Cn;const i=s=>o5(s,0,1,e,n);return s=>s===0||s===1?s:ik(i(s),t,r)}const sk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ok=e=>t=>1-e(1-t),ak=sl(.33,1.53,.69,.99),Fm=ok(ak),lk=sk(Fm),ck=e=>(e*=2)<1?.5*Fm(e):.5*(2-Math.pow(2,-10*(e-1))),Bm=e=>1-Math.sin(Math.acos(e)),uk=ok(Bm),dk=sk(Bm),fk=e=>/^0[^.\s]+$/u.test(e);function a5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fk(e):!0}const ca=e=>Math.round(e*1e5)/1e5,$m=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function l5(e){return e==null}const c5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zm=(e,t)=>n=>!!(typeof n=="string"&&c5.test(n)&&n.startsWith(e)||t&&!l5(n)&&Object.prototype.hasOwnProperty.call(n,t)),pk=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match($m);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},u5=e=>jr(0,255,e),Pd={...Ao,transform:e=>Math.round(u5(e))},Ni={test:zm("rgb","red"),parse:pk("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Pd.transform(e)+", "+Pd.transform(t)+", "+Pd.transform(n)+", "+ca(za.transform(r))+")"};function d5(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const kp={test:zm("#"),parse:d5,transform:Ni.transform},Ds={test:zm("hsl","hue"),parse:pk("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+or.transform(ca(t))+", "+or.transform(ca(n))+", "+ca(za.transform(r))+")"},Et={test:e=>Ni.test(e)||kp.test(e)||Ds.test(e),parse:e=>Ni.test(e)?Ni.parse(e):Ds.test(e)?Ds.parse(e):kp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ni.transform(e):Ds.transform(e)},f5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function p5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match($m))==null?void 0:t.length)||0)+(((n=e.match(f5))==null?void 0:n.length)||0)>0}const hk="number",mk="color",h5="var",m5="var(",uy="${}",g5=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ua(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(g5,l=>(Et.test(l)?(r.color.push(s),i.push(mk),n.push(Et.parse(l))):l.startsWith(m5)?(r.var.push(s),i.push(h5),n.push(l)):(r.number.push(s),i.push(hk),n.push(parseFloat(l))),++s,uy)).split(uy);return{values:n,split:a,indexes:r,types:i}}function gk(e){return Ua(e).values}function vk(e){const{split:t,types:n}=Ua(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===hk?s+=ca(i[o]):a===mk?s+=Et.transform(i[o]):s+=i[o]}return s}}const v5=e=>typeof e=="number"?0:e;function y5(e){const t=gk(e);return vk(e)(t.map(v5))}const hi={test:p5,parse:gk,createTransformer:vk,getAnimatableNone:y5},x5=new Set(["brightness","contrast","saturate","opacity"]);function w5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match($m)||[];if(!r)return e;const i=n.replace(r,"");let s=x5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const b5=/\b([a-z-]*)\(.*?\)/gu,Sp={...hi,getAnimatableNone:e=>{const t=e.match(b5);return t?t.map(w5).join(" "):e}},k5={...Rm,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:Sp,WebkitFilter:Sp},yk=e=>k5[e];function xk(e,t){let n=yk(e);return n!==Sp&&(n=hi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const S5=new Set(["auto","none","0"]);function C5(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!S5.has(s)&&Ua(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=xk(n,i)}const Di=e=>e*180/Math.PI,Cp=e=>{const t=Di(Math.atan2(e[1],e[0]));return _p(t)},_5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Cp,rotateZ:Cp,skewX:e=>Di(Math.atan(e[1])),skewY:e=>Di(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},_p=e=>(e=e%360,e<0&&(e+=360),e),dy=Cp,fy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),py=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),T5={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:fy,scaleY:py,scale:e=>(fy(e)+py(e))/2,rotateX:e=>_p(Di(Math.atan2(e[6],e[5]))),rotateY:e=>_p(Di(Math.atan2(-e[2],e[0]))),rotateZ:dy,rotate:dy,skewX:e=>Di(Math.atan(e[4])),skewY:e=>Di(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function hy(e){return e.includes("scale")?1:0}function Tp(e,t){if(!e||e==="none")return hy(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=T5,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_5,i=a}if(!i)return hy(t);const s=r[t],o=i[1].split(",").map(A5);return typeof s=="function"?s(o):o[s]}const E5=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Tp(n,t)};function A5(e){return parseFloat(e.trim())}const my=e=>e===Ao||e===ge,j5=new Set(["x","y","z"]),R5=Eo.filter(e=>!j5.has(e));function P5(e){const t=[];return R5.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const go={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Tp(t,"x"),y:(e,{transform:t})=>Tp(t,"y")};go.translateX=go.x;go.translateY=go.y;const Gi=new Set;let Ep=!1,Ap=!1;function wk(){if(Ap){const e=Array.from(Gi).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=P5(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ap=!1,Ep=!1,Gi.forEach(e=>e.complete()),Gi.clear()}function bk(){Gi.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ap=!0)})}function M5(){bk(),wk()}class Vm{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gi.add(this),Ep||(Ep=!0,Fe.read(bk),Fe.resolveKeyframes(wk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Gi.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Gi.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const kk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),O5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function N5(e){const t=O5.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function Sk(e,t,n=1){const[r,i]=N5(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return kk(o)?parseFloat(o):o}return jm(i)?Sk(i,t,n+1):i}const Ck=e=>t=>t.test(e),D5={test:e=>e==="auto",parse:e=>e},_k=[Ao,ge,or,Lr,Mj,Pj,D5],gy=e=>_k.find(Ck(e));class Tk extends Vm{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),jm(c))){const d=Sk(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!nk.has(r)||t.length!==2)return;const[i,s]=t,o=gy(i),a=gy(s);if(o!==a)if(my(o)&&my(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)a5(t[i])&&r.push(i);r.length&&C5(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=go[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,o=r[s];r[s]=go[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const vy=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hi.test(e)||e==="0")&&!e.startsWith("url("));function I5(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function L5(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=vy(i,t),a=vy(s,t);return!o||!a?!1:I5(e)||(n==="spring"||wm(n))&&r}const F5=e=>e!==null;function Au(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(F5),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const B5=40;class Ek{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=sr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>B5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&M5(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=sr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!L5(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Au(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Qe=(e,t,n)=>e+(t-e)*n;function Md(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $5({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Md(l,a,e+1/3),s=Md(l,a,e),o=Md(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function Hc(e,t){return n=>n>0?t:e}const Od=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},z5=[kp,Ni,Ds],V5=e=>z5.find(t=>t.test(e));function yy(e){const t=V5(e);if(!t)return!1;let n=t.parse(e);return t===Ds&&(n=$5(n)),n}const xy=(e,t)=>{const n=yy(e),r=yy(t);if(!n||!r)return Hc(e,t);const i={...n};return s=>(i.red=Od(n.red,r.red,s),i.green=Od(n.green,r.green,s),i.blue=Od(n.blue,r.blue,s),i.alpha=Qe(n.alpha,r.alpha,s),Ni.transform(i))},U5=(e,t)=>n=>t(e(n)),ol=(...e)=>e.reduce(U5),jp=new Set(["none","hidden"]);function H5(e,t){return jp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function W5(e,t){return n=>Qe(e,t,n)}function Um(e){return typeof e=="number"?W5:typeof e=="string"?jm(e)?Hc:Et.test(e)?xy:Y5:Array.isArray(e)?Ak:typeof e=="object"?Et.test(e)?xy:q5:Hc}function Ak(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>Um(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function q5(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Um(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function G5(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],o=e.indexes[s][r[s]],a=e.values[o]??0;n[i]=a,r[s]++}return n}const Y5=(e,t)=>{const n=hi.createTransformer(t),r=Ua(e),i=Ua(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?jp.has(e)&&!i.values.length||jp.has(t)&&!r.values.length?H5(e,t):ol(Ak(G5(r,i),i.values),n):Hc(e,t)};function jk(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Qe(e,t,n):Um(e)(e,t)}const Q5=5;function Rk(e,t,n){const r=Math.max(t-Q5,0);return Pb(n-e(r),t-r)}const et={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Nd=.001;function K5({duration:e=et.duration,bounce:t=et.bounce,velocity:n=et.velocity,mass:r=et.mass}){let i,s,o=1-t;o=jr(et.minDamping,et.maxDamping,o),e=jr(et.minDuration,et.maxDuration,ir(e)),o<1?(i=c=>{const d=c*o,u=d*e,p=d-n,h=Rp(c,o),y=Math.exp(-u);return Nd-p/h*y},s=c=>{const u=c*o*e,p=u*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-u),x=Rp(Math.pow(c,2),o);return(-i(c)+Nd>0?-1:1)*((p-h)*y)/x}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Nd+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=Z5(i,s,a);if(e=rr(e),isNaN(l))return{stiffness:et.stiffness,damping:et.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const X5=12;function Z5(e,t,n){let r=n;for(let i=1;i<X5;i++)r=r-e(r)/t(r);return r}function Rp(e,t){return e*Math.sqrt(1-t*t)}const J5=["duration","bounce"],e3=["stiffness","damping","mass"];function wy(e,t){return t.some(n=>e[n]!==void 0)}function t3(e){let t={velocity:et.velocity,stiffness:et.stiffness,damping:et.damping,mass:et.mass,isResolvedFromDuration:!1,...e};if(!wy(e,e3)&&wy(e,J5))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*jr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:et.mass,stiffness:i,damping:s}}else{const n=K5(e);t={...t,...n,mass:et.mass},t.isResolvedFromDuration=!0}return t}function Wc(e=et.visualDuration,t=et.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:d,duration:u,velocity:p,isResolvedFromDuration:h}=t3({...n,velocity:-ir(n.velocity||0)}),y=p||0,x=c/(2*Math.sqrt(l*d)),w=o-s,m=ir(Math.sqrt(l/d)),g=Math.abs(w)<5;r||(r=g?et.restSpeed.granular:et.restSpeed.default),i||(i=g?et.restDelta.granular:et.restDelta.default);let b;if(x<1){const S=Rp(m,x);b=_=>{const j=Math.exp(-x*m*_);return o-j*((y+x*m*w)/S*Math.sin(S*_)+w*Math.cos(S*_))}}else if(x===1)b=S=>o-Math.exp(-m*S)*(w+(y+m*w)*S);else{const S=m*Math.sqrt(x*x-1);b=_=>{const j=Math.exp(-x*m*_),A=Math.min(S*_,300);return o-j*((y+x*m*w)*Math.sinh(A)+S*w*Math.cosh(A))/S}}const C={calculatedDuration:h&&u||null,next:S=>{const _=b(S);if(h)a.done=S>=u;else{let j=0;x<1&&(j=S===0?rr(y):Rk(b,S,_));const A=Math.abs(j)<=r,E=Math.abs(o-_)<=i;a.done=A&&E}return a.value=a.done?o:_,a},toString:()=>{const S=Math.min(km(C),Vc),_=Mb(j=>C.next(S*j).value,S,30);return S+"ms "+_},toTransition:()=>{}};return C}Wc.applyToOptions=e=>{const t=JA(e,100,Wc);return e.ease=La()?t.ease:"easeOut",e.duration=rr(t.duration),e.type="keyframes",e};function by({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const u=e[0],p={done:!1,value:u},h=A=>a!==void 0&&A<a||l!==void 0&&A>l,y=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let x=n*t;const w=u+x,m=o===void 0?w:o(w);m!==w&&(x=m-u);const g=A=>-x*Math.exp(-A/r),b=A=>m+g(A),C=A=>{const E=g(A),L=b(A);p.done=Math.abs(E)<=c,p.value=p.done?m:L};let S,_;const j=A=>{h(p.value)&&(S=A,_=Wc({keyframes:[p.value,y(p.value)],velocity:Rk(b,A,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return j(0),{calculatedDuration:null,next:A=>{let E=!1;return!_&&S===void 0&&(E=!0,C(A),j(A)),S!==void 0&&A>=S?_.next(A-S):(!E&&C(A),p)}}}const n3=sl(.42,0,1,1),r3=sl(0,0,.58,1),Pk=sl(.42,0,.58,1),i3=e=>Array.isArray(e)&&typeof e[0]!="number",ky={linear:Cn,easeIn:n3,easeInOut:Pk,easeOut:r3,circIn:Bm,circInOut:dk,circOut:uk,backIn:Fm,backInOut:lk,backOut:ak,anticipate:ck},Sy=e=>{if(xm(e)){vp(e.length===4);const[t,n,r,i]=e;return sl(t,n,r,i)}else if(typeof e=="string")return vp(ky[e]!==void 0),ky[e];return e};function s3(e,t,n){const r=[],i=n||jk,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Cn:t;a=ol(l,a)}r.push(a)}return r}function o3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(vp(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=s3(t,r,i),l=a.length,c=d=>{if(o&&d<e[0])return t[0];let u=0;if(l>1)for(;u<e.length-2&&!(d<e[u+1]);u++);const p=Ia(e[u],e[u+1],d);return a[u](p)};return n?d=>c(jr(e[0],e[s-1],d)):c}function a3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ia(0,t,r);e.push(Qe(n,1,i))}}function l3(e){const t=[0];return a3(t,e.length-1),t}function c3(e,t){return e.map(n=>n*t)}function u3(e,t){return e.map(()=>t||Pk).splice(0,e.length-1)}function qc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=i3(r)?r.map(Sy):Sy(r),s={done:!1,value:t[0]},o=c3(n&&n.length===t.length?n:l3(t),e),a=o3(o,t,{ease:Array.isArray(i)?i:u3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const d3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Fe.update(t,!0),stop:()=>pi(t),now:()=>wt.isProcessing?wt.timestamp:sr.now()}},f3={decay:by,inertia:by,tween:qc,keyframes:qc,spring:Wc},p3=e=>e/100;class Hm extends Ek{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||Vm,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=wm(n)?n:f3[n]||qc;let l,c;a!==qc&&typeof t[0]!="number"&&(l=ol(p3,jk(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=km(d));const{calculatedDuration:u}=d,p=u+i,h=p*(r+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:u,resolvedDuration:p,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:d,resolvedDuration:u}=r;if(this.startTime===null)return s.next(0);const{delay:p,repeat:h,repeatType:y,repeatDelay:x,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const m=this.currentTime-p*(this.speed>=0?1:-1),g=this.speed>=0?m<0:m>d;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,C=s;if(h){const A=Math.min(this.currentTime,d)/u;let E=Math.floor(A),L=A%1;!L&&A>=1&&(L=1),L===1&&E--,E=Math.min(E,h+1),!!(E%2)&&(y==="reverse"?(L=1-L,x&&(L-=x/u)):y==="mirror"&&(C=o)),b=jr(0,1,L)*u}const S=g?{done:!1,value:l[0]}:C.next(b);a&&(S.value=a(S.value));let{done:_}=S;!g&&c!==null&&(_=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return j&&i!==void 0&&(S.value=Au(l,this.options,i)),w&&w(S.value),j&&this.finish(),S}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=rr(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=d3,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const h3=new Set(["opacity","clipPath","filter","transform"]),m3=vm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Gc=10,g3=2e4;function v3(e){return wm(e.type)||e.type==="spring"||!Nb(e.ease)}function y3(e,t){const n=new Hm({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<g3;)r=n.sample(s),i.push(r.value),s+=Gc;return{times:void 0,keyframes:i,duration:s-Gc,ease:"linear"}}const Mk={anticipate:ck,backInOut:lk,circInOut:dk};function x3(e){return e in Mk}class Cy extends Ek{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new Tk(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&La()&&x3(s)&&(s=Mk[s]),v3(this.options)){const{onComplete:u,onUpdate:p,motionValue:h,element:y,...x}=this.options,w=y3(t,x);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,i=w.times,s=w.ease,o="keyframes"}const d=ZA(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(Zv(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Au(t,this.options,n)),u&&u(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=rr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Cn;const{animation:r}=n;Zv(r,t)}return Cn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:d,onComplete:u,element:p,...h}=this.options,y=new Hm({...h,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),x=rr(this.time);c.setWithVelocity(y.sample(x-Gc).value,y.sample(x).value,Gc)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return m3()&&r&&h3.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const w3={type:"spring",stiffness:500,damping:25,restSpeed:10},b3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),k3={type:"keyframes",duration:.8},S3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},C3=(e,{keyframes:t})=>t.length>2?k3:ls.has(e)?e.startsWith("scale")?b3(t[1]):w3:S3;function _3({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Wm=(e,t,n,r={},i,s)=>o=>{const a=bm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-rr(l);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};_3(a)||(d={...d,...C3(e,d)}),d.duration&&(d.duration=rr(d.duration)),d.repeatDelay&&(d.repeatDelay=rr(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),d.allowFlatten=!a.type&&!a.ease,u&&!s&&t.get()!==void 0){const p=Au(d.keyframes,a);if(p!==void 0)return Fe.update(()=>{d.onUpdate(p),d.onComplete()}),new QA([])}return!s&&Cy.supports(d)?new Cy(d):new Hm(d)};function T3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ok(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=t;r&&(s=r);const l=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in a){const u=e.getValue(d,e.latestValues[d]??null),p=a[d];if(p===void 0||c&&T3(c,d))continue;const h={delay:n,...bm(s||{},d)};let y=!1;if(window.MotionHandoffAnimation){const w=rk(e);if(w){const m=window.MotionHandoffAnimation(w,d,Fe);m!==null&&(h.startTime=m,y=!0)}}bp(e,d),u.start(Wm(d,u,p,e.shouldReduceMotion&&nk.has(d)?{type:!1}:h,e,y));const x=u.animation;x&&l.push(x)}return o&&Promise.all(l).then(()=>{Fe.update(()=>{o&&n5(e,o)})}),l}function Pp(e,t,n={}){var l;const r=Va(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Ok(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=i;return E3(e,t,d+c,u,p,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,d]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>d())}else return Promise.all([s(),o(n.delay)])}function E3(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(A3).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Pp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function A3(e,t){return e.sortNodePosition(t)}function j3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Pp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Pp(e,t,n);else{const i=typeof t=="function"?Va(e,t,n.custom):t;r=Promise.all(Ok(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Nk(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const R3=Tm.length;function Dk(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Dk(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<R3;n++){const r=Tm[n],i=e.props[r];(Ba(i)||i===!1)&&(t[r]=i)}return t}const P3=[..._m].reverse(),M3=_m.length;function O3(e){return t=>Promise.all(t.map(({animation:n,options:r})=>j3(e,n,r)))}function N3(e){let t=O3(e),n=_y(),r=!0;const i=l=>(c,d)=>{var p;const u=Va(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:h,transitionEnd:y,...x}=u;c={...c,...x,...y}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=Dk(e.parent)||{},u=[],p=new Set;let h={},y=1/0;for(let w=0;w<M3;w++){const m=P3[w],g=n[m],b=c[m]!==void 0?c[m]:d[m],C=Ba(b),S=m===l?g.isActive:null;S===!1&&(y=w);let _=b===d[m]&&b!==c[m]&&C;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),g.protectedKeys={...h},!g.isActive&&S===null||!b&&!g.prevProp||Tu(b)||typeof b=="boolean")continue;const j=D3(g.prevProp,b);let A=j||m===l&&g.isActive&&!_&&C||w>y&&C,E=!1;const L=Array.isArray(b)?b:[b];let F=L.reduce(i(m),{});S===!1&&(F={});const{prevResolvedValues:D={}}=g,G={...D,...F},z=M=>{A=!0,p.has(M)&&(E=!0,p.delete(M)),g.needsAnimating[M]=!0;const P=e.getValue(M);P&&(P.liveStyle=!1)};for(const M in G){const P=F[M],B=D[M];if(h.hasOwnProperty(M))continue;let U=!1;wp(P)&&wp(B)?U=!Nk(P,B):U=P!==B,U?P!=null?z(M):p.add(M):P!==void 0&&p.has(M)?z(M):g.protectedKeys[M]=!0}g.prevProp=b,g.prevResolvedValues=F,g.isActive&&(h={...h,...F}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(_&&j)||E)&&u.push(...L.map(M=>({animation:M,options:{type:m}})))}if(p.size){const w={};if(typeof c.initial!="boolean"){const m=Va(e,Array.isArray(c.initial)?c.initial[0]:c.initial);m&&m.transition&&(w.transition=m.transition)}p.forEach(m=>{const g=e.getBaseTarget(m),b=e.getValue(m);b&&(b.liveStyle=!0),w[m]=g??null}),u.push({animation:w})}let x=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(x=!1),r=!1,x?t(u):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(p=>{var h;return(h=p.animationState)==null?void 0:h.setActive(l,c)}),n[l].isActive=c;const d=o(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=_y(),r=!0}}}function D3(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Nk(t,e):!1}function Ci(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _y(){return{animate:Ci(!0),whileInView:Ci(),whileHover:Ci(),whileTap:Ci(),whileDrag:Ci(),whileFocus:Ci(),exit:Ci()}}class wi{constructor(t){this.isMounted=!1,this.node=t}update(){}}class I3 extends wi{constructor(t){super(t),t.animationState||(t.animationState=N3(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Tu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let L3=0;class F3 extends wi{constructor(){super(...arguments),this.id=L3++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const B3={animation:{Feature:I3},exit:{Feature:F3}};function Ha(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function al(e){return{point:{x:e.pageX,y:e.pageY}}}const $3=e=>t=>Cm(t)&&e(t,al(t));function ua(e,t,n,r){return Ha(e,t,$3(n),r)}function Ik({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function z3({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function V3(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Lk=1e-4,U3=1-Lk,H3=1+Lk,Fk=.01,W3=0-Fk,q3=0+Fk;function Dt(e){return e.max-e.min}function G3(e,t,n){return Math.abs(e-t)<=n}function Ty(e,t,n,r=.5){e.origin=r,e.originPoint=Qe(t.min,t.max,e.origin),e.scale=Dt(n)/Dt(t),e.translate=Qe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=U3&&e.scale<=H3||isNaN(e.scale))&&(e.scale=1),(e.translate>=W3&&e.translate<=q3||isNaN(e.translate))&&(e.translate=0)}function da(e,t,n,r){Ty(e.x,t.x,n.x,r?r.originX:void 0),Ty(e.y,t.y,n.y,r?r.originY:void 0)}function Ey(e,t,n){e.min=n.min+t.min,e.max=e.min+Dt(t)}function Y3(e,t,n){Ey(e.x,t.x,n.x),Ey(e.y,t.y,n.y)}function Ay(e,t,n){e.min=t.min-n.min,e.max=e.min+Dt(t)}function fa(e,t,n){Ay(e.x,t.x,n.x),Ay(e.y,t.y,n.y)}const jy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Is=()=>({x:jy(),y:jy()}),Ry=()=>({min:0,max:0}),nt=()=>({x:Ry(),y:Ry()});function mn(e){return[e("x"),e("y")]}function Dd(e){return e===void 0||e===1}function Mp({scale:e,scaleX:t,scaleY:n}){return!Dd(e)||!Dd(t)||!Dd(n)}function Ai(e){return Mp(e)||Bk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Bk(e){return Py(e.x)||Py(e.y)}function Py(e){return e&&e!=="0%"}function Yc(e,t,n){const r=e-n,i=t*r;return n+i}function My(e,t,n,r,i){return i!==void 0&&(e=Yc(e,i,r)),Yc(e,n,r)+t}function Op(e,t=0,n=1,r,i){e.min=My(e.min,t,n,r,i),e.max=My(e.max,t,n,r,i)}function $k(e,{x:t,y:n}){Op(e.x,t.translate,t.scale,t.originPoint),Op(e.y,n.translate,n.scale,n.originPoint)}const Oy=.999999999999,Ny=1.0000000000001;function Q3(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Fs(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,$k(e,o)),r&&Ai(s.latestValues)&&Fs(e,s.latestValues))}t.x<Ny&&t.x>Oy&&(t.x=1),t.y<Ny&&t.y>Oy&&(t.y=1)}function Ls(e,t){e.min=e.min+t,e.max=e.max+t}function Dy(e,t,n,r,i=.5){const s=Qe(e.min,e.max,i);Op(e,t,n,s,r)}function Fs(e,t){Dy(e.x,t.x,t.scaleX,t.scale,t.originX),Dy(e.y,t.y,t.scaleY,t.scale,t.originY)}function zk(e,t){return Ik(V3(e.getBoundingClientRect(),t))}function K3(e,t,n){const r=zk(e,n),{scroll:i}=t;return i&&(Ls(r.x,i.offset.x),Ls(r.y,i.offset.y)),r}const Vk=({current:e})=>e?e.ownerDocument.defaultView:null,Iy=(e,t)=>Math.abs(e-t);function X3(e,t){const n=Iy(e.x,t.x),r=Iy(e.y,t.y);return Math.sqrt(n**2+r**2)}class Uk{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=Ld(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=X3(u.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:y}=u,{timestamp:x}=wt;this.history.push({...y,timestamp:x});const{onStart:w,onMove:m}=this.handlers;p||(w&&w(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=Id(p,this.transformPagePoint),Fe.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:h,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Ld(u.type==="pointercancel"?this.lastMoveEventInfo:Id(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,w),y&&y(u,w)},!Cm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=al(t),a=Id(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=wt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Ld(a,this.history)),this.removeListeners=ol(ua(this.contextWindow,"pointermove",this.handlePointerMove),ua(this.contextWindow,"pointerup",this.handlePointerUp),ua(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pi(this.updatePoint)}}function Id(e,t){return t?{point:t(e.point)}:e}function Ly(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ld({point:e},t){return{point:e,delta:Ly(e,Hk(t)),offset:Ly(e,Z3(t)),velocity:J3(t,.1)}}function Z3(e){return e[0]}function Hk(e){return e[e.length-1]}function J3(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Hk(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>rr(t)));)n--;if(!r)return{x:0,y:0};const s=ir(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function eR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Qe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Qe(n,e,r.max):Math.min(e,n)),e}function Fy(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function tR(e,{top:t,left:n,bottom:r,right:i}){return{x:Fy(e.x,n,i),y:Fy(e.y,t,r)}}function By(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function nR(e,t){return{x:By(e.x,t.x),y:By(e.y,t.y)}}function rR(e,t){let n=.5;const r=Dt(e),i=Dt(t);return i>r?n=Ia(t.min,t.max-r,e.min):r>i&&(n=Ia(e.min,e.max-i,t.min)),jr(0,1,n)}function iR(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Np=.35;function sR(e=Np){return e===!1?e=0:e===!0&&(e=Np),{x:$y(e,"left","right"),y:$y(e,"top","bottom")}}function $y(e,t,n){return{min:zy(e,t),max:zy(e,n)}}function zy(e,t){return typeof e=="number"?e:e[t]||0}const oR=new WeakMap;class aR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=nt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(al(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:h,onDragStart:y}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rj(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),mn(w=>{let m=this.getAxisMotionValue(w).get()||0;if(or.test(m)){const{projection:g}=this.visualElement;if(g&&g.layout){const b=g.layout.layoutBox[w];b&&(m=Dt(b)*(parseFloat(m)/100))}}this.originPoint[w]=m}),y&&Fe.postRender(()=>y(d,u)),bp(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:y,onDrag:x}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:w}=u;if(h&&this.currentDirection===null){this.currentDirection=lR(w),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,w),this.updateAxis("y",u.point,w),this.visualElement.render(),x&&x(d,u)},a=(d,u)=>this.stop(d,u),l=()=>mn(d=>{var u;return this.getAnimationState(d)==="paused"&&((u=this.getAxisMotionValue(d).animation)==null?void 0:u.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new Uk(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:Vk(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Fe.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Ll(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=eR(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Ns(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=tR(r.layoutBox,t):this.constraints=!1,this.elastic=sR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&mn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=iR(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ns(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=K3(r,i.root,this.visualElement.getTransformPagePoint());let o=nR(i.layout.layoutBox,s);if(n){const a=n(z3(o));this.hasMutatedConstraints=!!a,a&&(o=Ik(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=mn(d=>{if(!Ll(d,n,this.currentDirection))return;let u=l&&l[d]||{};o&&(u={min:0,max:0});const p=i?200:1e6,h=i?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return bp(this.visualElement,t),r.start(Wm(t,r,0,n,this.visualElement,!1))}stopAnimation(){mn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){mn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){mn(n=>{const{drag:r}=this.getProps();if(!Ll(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Qe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ns(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};mn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=rR({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),mn(o=>{if(!Ll(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Qe(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;oR.set(this.visualElement,this);const t=this.visualElement.current,n=ua(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ns(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Fe.read(r);const o=Ha(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(mn(d=>{const u=this.getAxisMotionValue(d);u&&(this.originPoint[d]+=l[d].translate,u.set(u.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Np,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Ll(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function lR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class cR extends wi{constructor(t){super(t),this.removeGroupControls=Cn,this.removeListeners=Cn,this.controls=new aR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Vy=e=>(t,n)=>{e&&Fe.postRender(()=>e(t,n))};class uR extends wi{constructor(){super(...arguments),this.removePointerDownListener=Cn}onPointerDown(t){this.session=new Uk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Vk(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Vy(t),onStart:Vy(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Fe.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ua(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Uy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ge.test(e))e=parseFloat(e);else return e;const n=Uy(e,t.target.x),r=Uy(e,t.target.y);return`${n}% ${r}%`}},dR={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hi.parse(e);if(i.length>5)return r;const s=hi.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=Qe(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};class fR extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Rj(pR),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),oc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Fe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Sm.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Wk(e){const[t,n]=Rb(),r=v.useContext(fm);return f.jsx(fR,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(Ub),isPresent:t,safeToRemove:n})}const pR={borderRadius:{...Vo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vo,borderTopRightRadius:Vo,borderBottomLeftRadius:Vo,borderBottomRightRadius:Vo,boxShadow:dR};function hR(e,t,n){const r=jt(e)?e:Fa(e);return r.start(Wm("",r,t,n)),r.animation}function mR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const gR=(e,t)=>e.depth-t.depth;class vR{constructor(){this.children=[],this.isDirty=!1}add(t){mm(this.children,t),this.isDirty=!0}remove(t){gm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(gR),this.isDirty=!1,this.children.forEach(t)}}function yR(e,t){const n=sr.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(pi(r),e(s-t))};return Fe.read(r,!0),()=>pi(r)}const qk=["TopLeft","TopRight","BottomLeft","BottomRight"],xR=qk.length,Hy=e=>typeof e=="string"?parseFloat(e):e,Wy=e=>typeof e=="number"||ge.test(e);function wR(e,t,n,r,i,s){i?(e.opacity=Qe(0,n.opacity??1,bR(r)),e.opacityExit=Qe(t.opacity??1,0,kR(r))):s&&(e.opacity=Qe(t.opacity??1,n.opacity??1,r));for(let o=0;o<xR;o++){const a=`border${qk[o]}Radius`;let l=qy(t,a),c=qy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Wy(l)===Wy(c)?(e[a]=Math.max(Qe(Hy(l),Hy(c),r),0),(or.test(c)||or.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Qe(t.rotate||0,n.rotate||0,r))}function qy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const bR=Gk(0,.5,uk),kR=Gk(.5,.95,Cn);function Gk(e,t,n){return r=>r<e?0:r>t?1:n(Ia(e,t,r))}function Gy(e,t){e.min=t.min,e.max=t.max}function pn(e,t){Gy(e.x,t.x),Gy(e.y,t.y)}function Yy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Qy(e,t,n,r,i){return e-=t,e=Yc(e,1/n,r),i!==void 0&&(e=Yc(e,1/i,r)),e}function SR(e,t=0,n=1,r=.5,i,s=e,o=e){if(or.test(t)&&(t=parseFloat(t),t=Qe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Qe(s.min,s.max,r);e===s&&(a-=t),e.min=Qy(e.min,t,n,a,i),e.max=Qy(e.max,t,n,a,i)}function Ky(e,t,[n,r,i],s,o){SR(e,t[n],t[r],t[i],t.scale,s,o)}const CR=["x","scaleX","originX"],_R=["y","scaleY","originY"];function Xy(e,t,n,r){Ky(e.x,t,CR,n?n.x:void 0,r?r.x:void 0),Ky(e.y,t,_R,n?n.y:void 0,r?r.y:void 0)}function Zy(e){return e.translate===0&&e.scale===1}function Yk(e){return Zy(e.x)&&Zy(e.y)}function Jy(e,t){return e.min===t.min&&e.max===t.max}function TR(e,t){return Jy(e.x,t.x)&&Jy(e.y,t.y)}function e0(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Qk(e,t){return e0(e.x,t.x)&&e0(e.y,t.y)}function t0(e){return Dt(e.x)/Dt(e.y)}function n0(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class ER{constructor(){this.members=[]}add(t){mm(this.members,t),t.scheduleRender()}remove(t){if(gm(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function AR(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:u,rotateY:p,skewX:h,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),u&&(r+=`rotateX(${u}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Fd=["","X","Y","Z"],jR={visibility:"hidden"},r0=1e3;let RR=0;function Bd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Kk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=rk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Fe,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Kk(r)}function Xk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=RR++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(OR),this.nodes.forEach(FR),this.nodes.forEach(BR),this.nodes.forEach(NR)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new vR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ym),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=mR(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let u;const p=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,u&&u(),u=yR(p,250),oc.hasAnimatedSinceResize&&(oc.hasAnimatedSinceResize=!1,this.nodes.forEach(s0))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||d.getDefaultTransition()||HR,{onLayoutAnimationStart:w,onLayoutAnimationComplete:m}=d.getProps(),g=!this.targetLayout||!Qk(this.targetLayout,y),b=!p&&h;if(this.options.layoutRoot||this.resumeFrom||b||p&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,b);const C={...bm(x,"layout"),onPlay:w,onComplete:m};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else p||s0(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,pi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach($R),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const u=this.path[d];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(i0);return}this.isUpdating||this.nodes.forEach(IR),this.isUpdating=!1,this.nodes.forEach(LR),this.nodes.forEach(PR),this.nodes.forEach(MR),this.clearAllSnapshots();const a=sr.now();wt.delta=jr(0,1e3/60,a-wt.timestamp),wt.timestamp=a,wt.isProcessing=!0,jd.update.process(wt),jd.preRender.process(wt),jd.render.process(wt),wt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Sm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(DR),this.sharedNodes.forEach(zR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Fe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Fe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Dt(this.snapshot.measuredBox.x)&&!Dt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=nt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Yk(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||Ai(this.latestValues)||d)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),WR(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return nt();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(qR))){const{scroll:d}=this.root;d&&(Ls(a.x,d.offset.x),Ls(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=nt();if(pn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:u,options:p}=d;d!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&pn(a,o),Ls(a.x,u.offset.x),Ls(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=nt();pn(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Fs(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Ai(d.latestValues)&&Fs(l,d.latestValues)}return Ai(this.latestValues)&&Fs(l,this.latestValues),l}removeTransform(o){const a=nt();pn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ai(c.latestValues))continue;Mp(c.latestValues)&&c.updateSnapshot();const d=nt(),u=c.measurePageBox();pn(d,u),Xy(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return Ai(this.latestValues)&&Xy(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==wt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:u}=this.options;if(!(!this.layout||!(d||u))){if(this.resolvedRelativeTargetAt=wt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nt(),this.relativeTargetOrigin=nt(),fa(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),pn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=nt(),this.targetWithTransforms=nt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Y3(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):pn(this.target,this.layout.layoutBox),$k(this.target,this.targetDelta)):pn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nt(),this.relativeTargetOrigin=nt(),fa(this.relativeTargetOrigin,this.target,h.target),pn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Mp(this.parent.latestValues)||Bk(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var y;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===wt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;pn(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;Q3(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=nt());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Yy(this.prevProjectionDelta.x,this.projectionDelta.x),Yy(this.prevProjectionDelta.y,this.projectionDelta.y)),da(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!n0(this.projectionDelta.x,this.prevProjectionDelta.x)||!n0(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Is(),this.projectionDelta=Is(),this.projectionDeltaWithTransform=Is()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Is();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=nt(),h=l?l.source:void 0,y=this.layout?this.layout.source:void 0,x=h!==y,w=this.getStack(),m=!w||w.members.length<=1,g=!!(x&&!m&&this.options.crossfade===!0&&!this.path.some(UR));this.animationProgress=0;let b;this.mixTargetDelta=C=>{const S=C/1e3;o0(u.x,o.x,S),o0(u.y,o.y,S),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fa(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),VR(this.relativeTarget,this.relativeTargetOrigin,p,S),b&&TR(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=nt()),pn(b,this.relativeTarget)),x&&(this.animationValues=d,wR(d,c,this.latestValues,S,g,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(pi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Fe.update(()=>{oc.hasAnimatedSinceResize=!0,this.currentAnimation=hR(0,r0,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(r0),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Zk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||nt();const u=Dt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=Dt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}pn(a,l),Fs(a,d),da(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new ER),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Bd("z",o,c,this.animationValues);for(let d=0;d<Fd.length;d++)Bd(`rotate${Fd[d]}`,o,c,this.animationValues),Bd(`skew${Fd[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}getProjectionStyles(o){if(!this.instance||this.isSVG)return;if(!this.isVisible)return jR;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=sc(o==null?void 0:o.pointerEvents)||"",a.transform=l?l(this.latestValues,""):"none",a;const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=sc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Ai(this.latestValues)&&(h.transform=l?l({},""):"none",this.hasProjected=!1),h}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=AR(this.projectionDeltaWithTransform,this.treeScale,d),l&&(a.transform=l(d,a.transform));const{x:u,y:p}=this.projectionDelta;a.transformOrigin=`${u.origin*100}% ${p.origin*100}% 0`,c.animationValues?a.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const h in $a){if(d[h]===void 0)continue;const{correct:y,applyTo:x,isCSSVariable:w}=$a[h],m=a.transform==="none"?d[h]:y(d[h],c);if(x){const g=x.length;for(let b=0;b<g;b++)a[x[b]]=m}else w?this.options.visualElement.renderState.vars[h]=m:a[h]=m}return this.options.layoutId&&(a.pointerEvents=c===this?sc(o==null?void 0:o.pointerEvents)||"":"none"),a}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(i0),this.root.sharedNodes.clear()}}}function PR(e){e.updateLayout()}function MR(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;s==="size"?mn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=Dt(p);p.min=r[u].min,p.max=p.min+h}):Zk(s,t.layoutBox,r)&&mn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=Dt(r[u]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+h)});const a=Is();da(a,r,t.layoutBox);const l=Is();o?da(l,e.applyTransform(i,!0),t.measuredBox):da(l,r,t.layoutBox);const c=!Yk(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:h}=u;if(p&&h){const y=nt();fa(y,t.layoutBox,p.layoutBox);const x=nt();fa(x,r,h.layoutBox),Qk(y,x)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function OR(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function NR(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function DR(e){e.clearSnapshot()}function i0(e){e.clearMeasurements()}function IR(e){e.isLayoutDirty=!1}function LR(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function s0(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function FR(e){e.resolveTargetDelta()}function BR(e){e.calcProjection()}function $R(e){e.resetSkewAndRotation()}function zR(e){e.removeLeadSnapshot()}function o0(e,t,n){e.translate=Qe(t.translate,0,n),e.scale=Qe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function a0(e,t,n,r){e.min=Qe(t.min,n.min,r),e.max=Qe(t.max,n.max,r)}function VR(e,t,n,r){a0(e.x,t.x,n.x,r),a0(e.y,t.y,n.y,r)}function UR(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const HR={duration:.45,ease:[.4,0,.1,1]},l0=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),c0=l0("applewebkit/")&&!l0("chrome/")?Math.round:Cn;function u0(e){e.min=c0(e.min),e.max=c0(e.max)}function WR(e){u0(e.x),u0(e.y)}function Zk(e,t,n){return e==="position"||e==="preserve-aspect"&&!G3(t0(t),t0(n),.2)}function qR(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const GR=Xk({attachResizeListener:(e,t)=>Ha(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$d={current:void 0},Jk=Xk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!$d.current){const e=new GR({});e.mount(window),e.setOptions({layoutScroll:!0}),$d.current=e}return $d.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),YR={pan:{Feature:uR},drag:{Feature:cR,ProjectionNode:Jk,MeasureLayout:Wk}};function d0(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&Fe.postRender(()=>s(t,al(t)))}class QR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=sj(t,(n,r)=>(d0(this.node,r,"Start"),i=>d0(this.node,i,"End"))))}unmount(){}}class KR extends wi{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ol(Ha(this.node.current,"focus",()=>this.onFocus()),Ha(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function f0(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&Fe.postRender(()=>s(t,al(t)))}class XR extends wi{mount(){const{current:t}=this.node;t&&(this.unmount=cj(t,(n,r)=>(f0(this.node,r,"Start"),(i,{success:s})=>f0(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Dp=new WeakMap,zd=new WeakMap,ZR=e=>{const t=Dp.get(e.target);t&&t(e)},JR=e=>{e.forEach(ZR)};function eP({root:e,...t}){const n=e||document;zd.has(n)||zd.set(n,{});const r=zd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(JR,{root:e,...t})),r[i]}function tP(e,t,n){const r=eP(t);return Dp.set(e,n),r.observe(e),()=>{Dp.delete(e),r.unobserve(e)}}const nP={some:0,all:1};class rP extends wi{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:nP[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:d,onViewportLeave:u}=this.node.getProps(),p=c?d:u;p&&p(l)};return tP(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(iP(t,n))&&this.startObserver()}unmount(){}}function iP({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const sP={inView:{Feature:rP},tap:{Feature:XR},focus:{Feature:KR},hover:{Feature:QR}},oP={layout:{ProjectionNode:Jk,MeasureLayout:Wk}},Ip={current:null},eS={current:!1};function aP(){if(eS.current=!0,!!pm)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ip.current=e.matches;e.addListener(t),t()}else Ip.current=!1}const lP=[..._k,Et,hi],cP=e=>lP.find(Ck(e)),uP=new WeakMap;function dP(e,t,n){for(const r in t){const i=t[r],s=n[r];if(jt(i))e.addValue(r,i);else if(jt(s))e.addValue(r,Fa(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Fa(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const p0=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class fP{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Vm,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=sr.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Fe.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:d}=o;this.onUpdate=d,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Eu(n),this.isVariantNode=zb(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const y=p[h];l[h]!==void 0&&jt(y)&&y.set(l[h],!1)}}mount(t){this.current=t,uP.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),eS.current||aP(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ip.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),pi(this.notifyUpdate),pi(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ls.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Fe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in mo){const n=mo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):nt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<p0.length;r++){const i=p0[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=dP(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Fa(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(kk(r)||fk(r))?r=parseFloat(r):!cP(r)&&hi.test(n)&&(r=xk(t,n)),this.setBaseTarget(t,jt(r)?r.get():r)),jt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Im(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!jt(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new ym),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class tS extends fP{constructor(){super(...arguments),this.KeyframeResolver=Tk}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;jt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function pP(e){return window.getComputedStyle(e)}class hP extends tS{constructor(){super(...arguments),this.type="html",this.renderInstance=Zb}readValueFromInstance(t,n){if(ls.has(n))return E5(t,n);{const r=pP(t),i=(Am(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return zk(t,n)}build(t,n,r){Pm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Lm(t,n,r)}}class mP extends tS{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=nt,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Xb(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ls.has(n)){const r=yk(n);return r&&r.default||0}return n=Jb.has(n)?n:Em(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return tk(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Fe.postRender(this.updateDimensions)}build(t,n,r){Nm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){ek(t,n,r,i)}mount(t){this.isSVGTag=Dm(t.tagName),super.mount(t)}}const gP=(e,t)=>Om(e)?new mP(t):new hP(t,{allowProjection:e!==v.Fragment}),vP=e5({...B3,...sP,...YR,...oP},gP),Me=gj(vP);class yP{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(r=>{r.start(t.nativeEvent||t,n)})}}const xP=()=>new yP;function wP(){return Su(xP)}var $r=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))($r||{});const nS=v.createContext({}),bP={[ne.TooltipDefault]:"Bizimle sohbet edin!",[ne.TooltipActive]:"Yeni mesajlar var!",[ne.CloseButtonAria]:"Kapat",[ne.MessagePlaceholder]:"Mesajınızı yazın",[ne.FileUploadDisabled]:"Dosya gönderim izniniz olmadığı için yükleyemezsiniz",[ne.NewMessagesNotification]:"Yeni mesajlar var!",[ne.ChatCloseConfirm]:"Sohbeti kapatmak istediğinizden emin misiniz?",[ne.ChatCloseWarning]:"Bu işlem geri alınamaz.",[ne.ChatSettings]:"Sohbet Ayarları",[ne.ChatEndConversation]:"Sohbeti Sonlandır",[ne.CancelAction]:"Vazgeç",[ne.CloseAction]:"Kapat",[ne.QuickActions]:"Hızlı işlemler",[ne.GreetingStartChat]:"Sohbete başla",[ne.RateLimitMessage]:"Çok fazla mesaj gönderdiniz. Lütfen {seconds} saniye bekleyin.",[ne.RatingHeaderEvaluate]:"Görüşmenizi Değerlendirin",[ne.RatingHeaderThanks]:"Teşekkürler!",[ne.RatingDescription]:"Lütfen hizmetimizi değerlendirin. Görüşleriniz bizim için önemli.",[ne.RatingRateConversation]:"Görüşmeyi puanlayın",[ne.RatingComment]:"Yorumunuz (İsteğe bağlı)",[ne.RatingCommentPlaceholder]:"Görüşme hakkında düşüncelerinizi paylaşın...",[ne.RatingSubmit]:"Değerlendirmeyi Gönder",[ne.RatingNewConversation]:"Yeni Görüşme Başlat",[ne.RatingThankYouTitle]:"Değerlendirmeniz için teşekkürler!",[ne.RatingThankYouDescription]:"Geri bildiriminiz bizim için çok değerli.",[ne.RatingCountdown]:"Ekran {seconds} saniye içinde kapanacaktır.",[ne.RatingMinimumError]:"Lütfen en az 1 yıldız seçiniz.",[ne.RatingYourScore]:"Puanınız: {score}",[ne.PoweredBy]:"Powered by",[ne.NotificationSoundOn]:"Bildirim sesi aç",[ne.NotificationSoundOff]:"Bildirim sesi kapat"},kP={[k.Background]:"#ffffff",[k.Border]:"#e2e8f0",[k.TooltipText]:"#1e40af",[k.TooltipBackground]:"#dbeafe",[k.TooltipBorder]:"#3b82f6",[k.HeaderBackground]:"#ffffff",[k.HeaderBorder]:"#e2e8f0",[k.HeaderText]:"#1e293b",[k.FooterBackground]:"#f8fafc",[k.FooterBorder]:"#e2e8f0",[k.FooterText]:"#475569",[k.MessageAdminBackground]:"#f1f5f9",[k.MessageAdminText]:"#334155",[k.MessageVisitorBackground]:"#3b82f6",[k.MessageVisitorText]:"#ffffff",[k.MessageAgentBackground]:"#ede9fe",[k.MessageAgentText]:"#5b21b6",[k.GreeterBackground]:"#ffffff",[k.GreeterText]:"#334155",[k.GreeterBorder]:"#e2e8f0",[k.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[k.GreeterTopText]:"#ffffff",[k.GreeterButtonBackground]:"#3b82f6",[k.GreeterButtonText]:"#ffffff",[k.ButtonBackground]:"#3b82f6",[k.ButtonText]:"#ffffff",[k.InputBackground]:"#f8fafc",[k.InputText]:"#1e293b",[k.InputBorder]:"#e2e8f0",[k.CloseButtonBackground]:"#f1f5f9",[k.CloseButtonText]:"#475569",[k.CloseButtonHover]:"#e2e8f0",[k.IconColor]:"#64748b",[k.IconBackground]:"transparent",[k.ErrorBackground]:"#fef2f2",[k.ErrorText]:"#dc2626",[k.ErrorBorder]:"#fca5a5",[k.SuccessBackground]:"#f0fdf4",[k.SuccessText]:"#16a34a",[k.SuccessBorder]:"#86efac",[k.WarningBackground]:"#fffbeb",[k.WarningText]:"#d97706",[k.WarningBorder]:"#fcd34d",[k.LinkColor]:"#2563eb",[k.LinkHoverColor]:"#1d4ed8",[k.DividerColor]:"#e2e8f0",[k.ShadowColor]:"rgba(0, 0, 0, 0.1)",[k.StarActiveColor]:"#f59e0b",[k.StarInactiveColor]:"#e2e8f0",[k.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[k.ChatCloseConfirmText]:"#dc2626",[k.RatingHeaderBackground]:"#3b82f6",[k.RatingHeaderText]:"#ffffff",[k.RatingSuccessBackground]:"#ffffff",[k.RatingSuccessText]:"#334155",[k.RatingRateConversationText]:"#1e293b"},SP={[k.Background]:"#0a0a0a",[k.Border]:"#262626",[k.TooltipText]:"#e5e5e5",[k.TooltipBackground]:"#262626",[k.TooltipBorder]:"#404040",[k.HeaderBackground]:"#171717",[k.HeaderBorder]:"#262626",[k.HeaderText]:"#fafafa",[k.FooterBackground]:"#0a0a0a",[k.FooterBorder]:"#262626",[k.FooterText]:"#a3a3a3",[k.MessageAdminBackground]:"#262626",[k.MessageAdminText]:"#e5e5e5",[k.MessageVisitorBackground]:"#171717",[k.MessageVisitorText]:"#e5e5e5",[k.MessageAgentBackground]:"#5b21b6",[k.MessageAgentText]:"#e9d5ff",[k.GreeterBackground]:"#171717",[k.GreeterText]:"#e5e5e5",[k.GreeterBorder]:"#262626",[k.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[k.GreeterTopText]:"#fafafa",[k.GreeterButtonBackground]:"#3b82f6",[k.GreeterButtonText]:"#ffffff",[k.ButtonBackground]:"#3b82f6",[k.ButtonText]:"#ffffff",[k.InputBackground]:"#171717",[k.InputText]:"#e5e5e5",[k.InputBorder]:"#3f3f3f",[k.CloseButtonBackground]:"#262626",[k.CloseButtonText]:"#a3a3a3",[k.CloseButtonHover]:"#404040",[k.IconColor]:"#a3a3a3",[k.IconBackground]:"transparent",[k.ErrorBackground]:"#450a0a",[k.ErrorText]:"#fca5a5",[k.ErrorBorder]:"#7f1d1d",[k.SuccessBackground]:"#052e16",[k.SuccessText]:"#86efac",[k.SuccessBorder]:"#14532d",[k.WarningBackground]:"#451a03",[k.WarningText]:"#fcd34d",[k.WarningBorder]:"#78350f",[k.LinkColor]:"#3b82f6",[k.LinkHoverColor]:"#60a5fa",[k.DividerColor]:"#262626",[k.ShadowColor]:"rgba(0, 0, 0, 0.4)",[k.StarActiveColor]:"#f59e0b",[k.StarInactiveColor]:"#404040",[k.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[k.ChatCloseConfirmText]:"#fca5a5",[k.RatingHeaderBackground]:"#171717",[k.RatingHeaderText]:"#fafafa",[k.RatingSuccessBackground]:"#171717",[k.RatingSuccessText]:"#e5e5e5",[k.RatingRateConversationText]:"#e5e5e5"},CP={[$r.None]:"0px",[$r.Sm]:"var(--radius-sm)",[$r.Md]:"var(--radius-md)",[$r.Lg]:"var(--radius-lg)",[$r.Xl]:"var(--radius-lg)",[$r.Full]:"calc(infinity * 1px)"},_P=e=>{const t={...bP};if(!e||!e.appearance||!e.appearance.design||!e.appearance.design.texts)return t;for(const n in e.appearance.design.texts){const r=n;e.appearance.design.texts[r]&&(t[r]=e.appearance.design.texts[r])}return t};function TP(e,t){const n=e.replace(/^#/,"");if(n.length!==6)return e;const r=Math.max(0,Math.round(Number.parseInt(n.slice(0,2),16)*(1-t))),i=Math.max(0,Math.round(Number.parseInt(n.slice(2,4),16)*(1-t))),s=Math.max(0,Math.round(Number.parseInt(n.slice(4,6),16)*(1-t)));return`#${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}const Vd="#ffffff";function EP(e){const t=TP(e,.2);return{[k.ButtonBackground]:t,[k.ButtonText]:Vd,[k.GreeterButtonBackground]:t,[k.GreeterButtonText]:Vd,[k.MessageVisitorBackground]:t,[k.MessageVisitorText]:Vd}}const AP=(e,t)=>{var i,s;const r={...t==="dark"?SP:kP};if(t==="dark")return r;if((s=(i=e==null?void 0:e.appearance)==null?void 0:i.design)!=null&&s.colors){const o=e.appearance.design.colors,a=o.main_color;if(a){const l=EP(a);for(const c of Object.keys(l))l[c]&&(r[c]=l[c])}for(const l in o){if(l==="main_color"||l==="secondary_color"||l==="accent_color")continue;const c=l;o[l]&&l in r&&(r[c]=o[l])}}return r},rS="lc:theme:mode";function jP(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function RP(){try{const e=localStorage.getItem(rS);if(e==="light"||e==="dark"||e==="system")return e}catch{}return De.System}function PP({children:e,widget:t}){const[n,r]=v.useState(RP),[i,s]=v.useState(jP);v.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),x=w=>{s(w.matches?"dark":"light")};return y.addEventListener("change",x),()=>y.removeEventListener("change",x)},[]);const o=n===De.System?i:n,a=v.useCallback(y=>{r(y);try{localStorage.setItem(rS,y)}catch{}},[]),l=AP(t,o),c=_P(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:$r.Md,u=y=>l[y],p=y=>c[y],h=()=>CP[d];return f.jsx(nS.Provider,{value:{colors:l,texts:c,getColor:u,getText:p,getRadius:h,mode:n,resolvedMode:o,setMode:a},children:e})}const Se=()=>v.useContext(nS),cs=()=>Se().getText;function Rt({children:e,type:t="button",variant:n="primary",kind:r="solid",size:i="md",disabled:s=!1,rounded:o=!1,className:a,style:l,textKey:c=k.ButtonText,bgKey:d=k.ButtonBackground,animations:u={},withoutTheming:p,...h}){const y=Se();return f.jsx(Me.button,{type:t,className:Ve("flex items-center justify-center focus:outline-none focus:ring-2 focus:ring-offset-0 font-medium transition-opacity",{"rounded-full":o&&i!=="xs","rounded-lg":!o,"opacity-50 cursor-not-allowed":s,"hover:opacity-90 active:opacity-95":!s},a,Qv[n]&&Qv[n][r],VA[i][o?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!p&&{color:y.getColor(c),backgroundColor:y.getColor(d),...o?{}:{borderRadius:y.getRadius()}},...l},...u,...h,children:e})}function X(){}X.Home=function(t){return f.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M3 13h1v7c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-7h1a1 1 0 00.707-1.707l-9-9a.999.999 0 00-1.414 0l-9 9A1 1 0 003 13zm7 7v-5h4v5h-4zm2-15.586l6 6V15l.001 5H16v-5c0-1.103-.897-2-2-2h-4c-1.103 0-2 .897-2 2v5H6v-9.586l6-6z"})})};X.Chat=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});X.Menu=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})});X.MessageTyping=({className:e="size-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.625 9.75a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375m-13.5 3.01c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.184-4.183a1.14 1.14 0 0 1 .778-.332 48.294 48.294 0 0 0 5.83-.498c1.585-.233 2.708-1.626 2.708-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})});X.Check=function(t){return f.jsx("svg",{fill:"currentColor",viewBox:"0 0 16 16",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M12.736 3.97a.733.733 0 011.047 0c.286.289.29.756.01 1.05L7.88 12.01a.733.733 0 01-1.065.02L3.217 8.384a.757.757 0 010-1.06.733.733 0 011.047 0l3.052 3.093 5.4-6.425a.247.247 0 01.02-.022z"})})};X.Website=function(t){return f.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",height:"1em",width:"1em",...t,children:[f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14 7a1 1 0 00-1 1v8a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1h-4zm3 2h-2v6h2V9z",clipRule:"evenodd"}),f.jsx("path",{fill:"currentColor",d:"M6 7a1 1 0 000 2h4a1 1 0 100-2H6zM6 11a1 1 0 100 2h4a1 1 0 100-2H6zM5 16a1 1 0 011-1h4a1 1 0 110 2H6a1 1 0 01-1-1z"}),f.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 3a3 3 0 00-3 3v12a3 3 0 003 3h16a3 3 0 003-3V6a3 3 0 00-3-3H4zm16 2H4a1 1 0 00-1 1v12a1 1 0 001 1h16a1 1 0 001-1V6a1 1 0 00-1-1z",clipRule:"evenodd"})]})};X.ArrowDown=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})});X.ArrowDown2=e=>f.jsxs("svg",{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:[f.jsx("g",{id:"SVGRepo_bgCarrier",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_tracerCarrier",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),f.jsx("g",{id:"SVGRepo_iconCarrier",children:f.jsx("path",{d:"M903.232 256l56.768 50.432L512 768 64 306.432 120.768 256 512 659.072z",fill:"currentColor"})})]});X.ArrowLeft=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})});X.XCircle=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});X.X=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})});X.PaperAirplane=({className:e="e-5",...t})=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e,...t,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})});X.Spin=function(t){return f.jsx("svg",{"data-name":"Layer 1",viewBox:"0 0 24 24",fill:"currentColor",height:"1em",width:"1em",...t,children:f.jsx("path",{d:"M6.804 15a1 1 0 00-1.366-.366l-1.732 1a1 1 0 001 1.732l1.732-1A1 1 0 006.804 15zM3.706 8.366l1.732 1a1 1 0 101-1.732l-1.732-1a1 1 0 00-1 1.732zM6 12a1 1 0 00-1-1H3a1 1 0 000 2h2a1 1 0 001-1zm11.196-3a1 1 0 001.366.366l1.732-1a1 1 0 10-1-1.732l-1.732 1A1 1 0 0017.196 9zM15 6.804a1 1 0 001.366-.366l1-1.732a1 1 0 10-1.732-1l-1 1.732A1 1 0 0015 6.804zm5.294 8.83l-1.732-1a1 1 0 10-1 1.732l1.732 1a1 1 0 001-1.732zm-3.928 1.928a1 1 0 10-1.732 1l1 1.732a1 1 0 101.732-1zM21 11h-2a1 1 0 000 2h2a1 1 0 000-2zm-9 7a1 1 0 00-1 1v2a1 1 0 002 0v-2a1 1 0 00-1-1zm-3-.804a1 1 0 00-1.366.366l-1 1.732a1 1 0 001.732 1l1-1.732A1 1 0 009 17.196zM12 2a1 1 0 00-1 1v2a1 1 0 002 0V3a1 1 0 00-1-1z"})})};X.ExternalLink=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})});X.Phone=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"})});X.Mail=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})});X.Star=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})});X.Plus=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})});X.History=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})});X.Eye=e=>f.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:[f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]});X.Lock=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 119 0v3.75M3.75 21.75h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H3.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})});X.User=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})});X.Emoji=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.182 15.182a4.5 4.5 0 0 1-6.364 0M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0ZM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75Zm-.375 0h.008v.015h-.008V9.75Z"})});X.Paperclip=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})});X.Sparkles=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})});X.Sun=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75v-2.25m-4.773 4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})});X.Moon=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})});X.Monitor=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"})});X.Volume2=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 0 1 0 12.728M16.463 8.288a5.25 5.25 0 0 1 0 7.424M6.75 8.25l4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});X.VolumeX=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75 19.5 12m0 0 2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6 4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z"})});X.Bot=e=>f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",...e,children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})});function Lp(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var st=(e=>(e.CustomerToken="lc:customer:token",e.CustomerRefreshToken="lc:customer:refresh_token",e.DeviceId="lc:device:id",e.AIAgentMode="lc:agent:mode",e.AIAgent="lc:agent:data",e.AIAgentSessionId="lc:agent:session",e.HumanNeedRequested="lc:agent:human_need",e))(st||{});const Fn=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},Zo=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},pa=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),qm(e)},iS=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},Fl=(e,t,n,r,i)=>{const s=`${e}:`;t&&(n||i)?(localStorage.setItem(`${s}lc:agent:mode`,"true"),localStorage.setItem(`${s}lc:agent:data`,JSON.stringify(t)),r&&localStorage.setItem(`${s}lc:agent:session`,r),i!==void 0&&(i?localStorage.setItem(`${s}lc:agent:human_need`,"true"):localStorage.removeItem(`${s}lc:agent:human_need`))):qm(e)},mr=e=>{const t=`${e}:`,n=localStorage.getItem(`${t}lc:agent:mode`)==="true",r=localStorage.getItem(`${t}lc:agent:data`),i=localStorage.getItem(`${t}lc:agent:session`),s=localStorage.getItem(`${t}lc:agent:human_need`)==="true";let o=null;if(r)try{o=JSON.parse(r)}catch{o=null}return{isAgentMode:n,agent:o,sessionId:i,humanNeedRequested:s}},qm=e=>{const t=`${e}:`;localStorage.removeItem(`${t}lc:agent:mode`),localStorage.removeItem(`${t}lc:agent:data`),localStorage.removeItem(`${t}lc:agent:session`),localStorage.removeItem(`${t}lc:agent:human_need`)},mi=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=Lp(),localStorage.setItem(t,n)),n},MP={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},h0=e=>{let t;const n=new Set,r=(d,u)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const h=t;t=u??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(MP?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,i,l);return l},OP=e=>e?h0(e):h0;var sS={exports:{}},oS={},aS={exports:{}},lS={};/**
|
|
71
71
|
* @license React
|
|
72
72
|
* use-sync-external-store-shim.production.min.js
|
|
73
73
|
*
|
|
@@ -75,7 +75,7 @@ Error generating stack: `+s.message+`
|
|
|
75
75
|
*
|
|
76
76
|
* This source code is licensed under the MIT license found in the
|
|
77
77
|
* LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/var vo=v;function
|
|
78
|
+
*/var vo=v;function NP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var DP=typeof Object.is=="function"?Object.is:NP,IP=vo.useState,LP=vo.useEffect,FP=vo.useLayoutEffect,BP=vo.useDebugValue;function $P(e,t){var n=t(),r=IP({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return FP(function(){i.value=n,i.getSnapshot=t,Ud(i)&&s({inst:i})},[e,n,t]),LP(function(){return Ud(i)&&s({inst:i}),e(function(){Ud(i)&&s({inst:i})})},[e]),BP(n),n}function Ud(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!DP(e,n)}catch{return!0}}function zP(e,t){return t()}var VP=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zP:$P;lS.useSyncExternalStore=vo.useSyncExternalStore!==void 0?vo.useSyncExternalStore:VP;aS.exports=lS;var UP=aS.exports;/**
|
|
79
79
|
* @license React
|
|
80
80
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
81
81
|
*
|
|
@@ -83,49 +83,49 @@ Error generating stack: `+s.message+`
|
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the MIT license found in the
|
|
85
85
|
* LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var ju=v,VP=zP;function UP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HP=typeof Object.is=="function"?Object.is:UP,WP=VP.useSyncExternalStore,qP=ju.useRef,GP=ju.useEffect,YP=ju.useMemo,QP=ju.useDebugValue;iS.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=qP(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=YP(function(){function l(m){if(!c){if(c=!0,d=m,m=r(m),i!==void 0&&o.hasValue){var y=o.value;if(i(y,m))return u=y}return u=m}if(y=u,HP(d,m))return y;var w=r(m);return i!==void 0&&i(y,w)?y:(d=m,u=w)}var c=!1,d,u,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var a=WP(e,s[0],s[1]);return GP(function(){o.hasValue=!0,o.value=a},[a]),QP(a),a};rS.exports=iS;var KP=rS.exports;const XP=Rr(KP),aS={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:ZP}=J,{useSyncExternalStoreWithSelector:JP}=XP;let h0=!1;const eM=e=>e;function tM(e,t=eM,n){(aS?"production":void 0)!=="production"&&n&&!h0&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),h0=!0);const r=JP(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return ZP(r),r}const m0=e=>{(aS?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?PP(e):e,n=(r,i)=>tM(t,r,i);return Object.assign(n,t),n},nM=e=>e?m0(e):m0,ie=nM(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",defaultValues:{},soundPath:void 0,isTooltipVisible:!0,onTooltipClose:void 0,anyAdmin:!0,showActionButtons:!1,setIsTooltipVisible:t=>e({isTooltipVisible:t}),setOnTooltipClose:t=>e({onTooltipClose:t}),setOpen:t=>{e({open:t})},setAnyAdmin:t=>e({anyAdmin:t}),setWidget:t=>e({widget:t}),setDefaultValues:t=>e({defaultValues:t}),setIsHaveChat:t=>{var n;if(e({isHaveChat:t}),localStorage.setItem("lc:widget:isHaveChat",t.toString()),!t){e({showActionButtons:!1});const r=(n=ie.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setSoundPath:t=>{e({soundPath:t})},onOpen:void 0,onClose:void 0,setOnOpen:t=>e({onOpen:t}),setOnClose:t=>e({onClose:t}),setIsInputFocused:t=>e({isInputFocused:t}),historyChat:null,setHistoryChat:t=>e({historyChat:t}),historyMessages:null,setHistoryMessages:t=>e({historyMessages:t}),showHistoryOnRegistration:!1,setShowHistoryOnRegistration:t=>e({showHistoryOnRegistration:t}),aiAgent:null,setAIAgent:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Ll(r,t,n.isAIAgentMode,n.aiAgentSessionId,n.humanNeedRequested),{aiAgent:t}}),isAIAgentMode:!1,setIsAIAgentMode:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Ll(r,n.aiAgent,t,n.aiAgentSessionId,n.humanNeedRequested),{isAIAgentMode:t}}),aiAgentSessionId:null,setAIAgentSessionId:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Ll(r,n.aiAgent,n.isAIAgentMode,t,n.humanNeedRequested),{aiAgentSessionId:t}}),humanNeedRequested:!1,setHumanNeedRequested:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;if(r){const s=`${r}:`;t?localStorage.setItem(`${s}${rt.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${rt.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&Ll(r,n.aiAgent,n.isAIAgentMode,n.aiAgentSessionId,t)}return{humanNeedRequested:t}}),aiAgentMessages:[],setAIAgentMessages:t=>e(n=>({aiAgentMessages:typeof t=="function"?t(n.aiAgentMessages):t})),addAIAgentMessage:t=>e(n=>({aiAgentMessages:[...n.aiAgentMessages,t]})),clearAIAgentState:()=>e(t=>{var r;const n=(r=t.widget)==null?void 0:r.link_id;return n&&Wm(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1}}),connectingToOperator:!1,setConnectingToOperator:t=>e({connectingToOperator:t}),showOperatorForm:!1,setShowOperatorForm:t=>e({showOperatorForm:t}),setShowActionButtons:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&localStorage.setItem(`${r}:showActionButtons`,t.toString()),{showActionButtons:t}})})),rM=e=>({accessToken:localStorage.getItem(`${e}:${rt.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${rt.CustomerRefreshToken}`)||""}),al=()=>{const{widget:e}=ie();return e?rM(e.link_id):null},Yi=e=>{if(!e)return{};const{accessToken:t,refreshToken:n}=e,r={};return t&&(r["X-Customer-Token"]=t),n&&(r["X-Customer-Refresh-Token"]=n),{...r}};function Lp(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const qm=()=>am({mutationFn:e=>Mr(`clients/${e.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:e.inputs,client_id:void 0,widget_id:e.widget_id,history:e.history,device_id:e.device_id,is_agent_mode:e.is_agent_mode,widget_version:"2026.01.05-1"})})}),iM=(e,t)=>Mr(`clients/${e}/chats`,{headers:t}),oc=(e,t)=>Mr(`clients/${e}/chats`,{method:"DELETE",headers:t}),sM=(e,t,n)=>Mr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{...n,"X-Device-Id":Xo(rt.DeviceId,"")||""}}),oM=()=>{const e=al();return am({mutationFn:t=>sM(t.rating,t.comment,Yi(e))})},aM=e=>{const t=al();return am({mutationFn:n=>Mr(`clients/${e}/chats/files`,{method:"POST",headers:Yi(t),body:P_({files:n},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function lM(e){return e&&typeof e=="object"&&"file_urls"in e}const cM=e=>{const t=`${tb}/visitors/identify`,n=JSON.stringify(e);try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,credentials:"include"}).catch(()=>{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}})}catch{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}}},uM=(e,t)=>gb({queryKey:["visitors","history",e,t],queryFn:()=>Mr(`visitors/history?widget_id=${e}&device_id=${t}`),enabled:!!e&&!!t}),dM=(e,t,n)=>Mr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`);async function fM(e){const[t,n]=await Mr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function us(e){this._maxSize=e,this.clear()}us.prototype.clear=function(){this._size=0,this._values=Object.create(null)};us.prototype.get=function(e){return this._values[e]};us.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var pM=/[^.^\]^[]+|(?=\[\]|\.\.)/g,lS=/^\d+$/,hM=/^\d/,mM=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,gM=/^\s*(['"]?)(.*?)(\1)\s*$/,Gm=512,g0=new us(Gm),v0=new us(Gm),y0=new us(Gm),Qi={Cache:us,split:Fp,normalizePath:Ud,setter:function(e){var t=Ud(e);return v0.get(e)||v0.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Ud(e);return y0.get(e)||y0.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Ym(n)||lS.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){vM(Array.isArray(e)?e:Fp(e),t,n)}};function Ud(e){return g0.get(e)||g0.set(e,Fp(e).map(function(t){return t.replace(gM,"$2")}))}function Fp(e){return e.match(pM)||[""]}function vM(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(wM(i)&&(i='"'+i+'"'),a=Ym(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Ym(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function yM(e){return e.match(hM)&&!e.match(lS)}function xM(e){return mM.test(e)}function wM(e){return!Ym(e)&&(yM(e)||xM(e))}const bM=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Au=e=>e.match(bM)||[],Ru=e=>e[0].toUpperCase()+e.slice(1),Qm=(e,t)=>Au(e).join(t).toLowerCase(),cS=e=>Au(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),kM=e=>Ru(cS(e)),SM=e=>Qm(e,"_"),CM=e=>Qm(e,"-"),TM=e=>Ru(Qm(e," ")),_M=e=>Au(e).map(Ru).join(" ");var Hd={words:Au,upperFirst:Ru,camelCase:cS,pascalCase:kM,snakeCase:SM,kebabCase:CM,sentenceCase:TM,titleCase:_M},Km={exports:{}};Km.exports=function(e){return uS(EM(e),e)};Km.exports.array=uS;function uS(e,t){var n=e.length,r=new Array(n),i={},s=n,o=jM(t),a=AM(e);for(t.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||l(e[s],s,new Set);return r;function l(c,d,u){if(u.has(c)){var p;try{p=", node was:"+JSON.stringify(c)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!i[d]){i[d]=!0;var m=o.get(c)||new Set;if(m=Array.from(m),d=m.length){u.add(c);do{var y=m[--d];l(y,a.get(y),u)}while(d);u.delete(c)}r[--n]=c}}}function EM(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function jM(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function AM(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var RM=Km.exports;const PM=Rr(RM),MM=Object.prototype.toString,OM=Error.prototype.toString,NM=RegExp.prototype.toString,DM=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",IM=/^Symbol\((.*)\)(.*)$/;function LM(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function x0(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return LM(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return DM.call(e).replace(IM,"Symbol($1)");const r=MM.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+OM.call(e)+"]":r==="RegExp"?NM.call(e):null}function ci(e,t){let n=x0(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=x0(this[r],t);return s!==null?s:i},2)}function dS(e){return e==null?[]:[].concat(e)}let fS,pS,hS,FM=/\$\{\s*(\w+)\s*\}/g;fS=Symbol.toStringTag;class w0{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[fS]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],dS(t).forEach(s=>{if(Wt.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}pS=Symbol.hasInstance;hS=Symbol.toStringTag;class Wt extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(FM,(i,s)=>ci(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new w0(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[hS]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Wt)}static[pS](t){return w0[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Yn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${ci(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ci(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${ci(n,!0)}\``+i}},$t={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},BM={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Bp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},$M={isValue:"${path} field must be ${value}"},ac={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},zM={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},VM={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${ci(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${ci(n,!0)}\``}return Wt.formatError(Yn.notType,e)}};Object.assign(Object.create(null),{mixed:Yn,string:$t,number:BM,date:Bp,object:ac,array:zM,boolean:$M,tuple:VM});const Xm=e=>e&&e.__isYupSchema__;class Yc{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Yc(t,(a,l)=>{var c;let d=o(...a)?i:s;return(c=d==null?void 0:d(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Xm(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Fl={context:"$",value:"."};class ds{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Fl.context,this.isValue=this.key[0]===Fl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Fl.context:this.isValue?Fl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Qi.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ds.prototype.__isYupRef=!0;const Ii=e=>e==null;function bs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:c,test:d,params:u,message:p,skipAbsent:m}=e;let{parent:y,context:w,abortEarly:x=o.spec.abortEarly,disableStackTrace:h=o.spec.disableStackTrace}=i;function g(N){return ds.isRef(N)?N.getValue(n,y,w):N}function k(N={}){const D=Object.assign({value:n,originalValue:s,label:o.spec.label,path:N.path||r,spec:o.spec,disableStackTrace:N.disableStackTrace||h},u,N.params);for(const B of Object.keys(D))D[B]=g(D[B]);const G=new Wt(Wt.formatError(N.message||p,D),n,D.path,N.type||c,D.disableStackTrace);return G.params=D,G}const C=x?a:l;let S={path:r,parent:y,type:c,from:i.from,createError:k,resolve:g,options:i,originalValue:s,schema:o};const T=N=>{Wt.isError(N)?C(N):N?l(null):C(k())},j=N=>{Wt.isError(N)?C(N):a(N)};if(m&&Ii(n))return T(!0);let A;try{var I;if(A=d.call(S,n,S),typeof((I=A)==null?void 0:I.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${S.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(A).then(T,j)}}catch(N){j(N);return}T(A)}return t.OPTIONS=e,t}function UM(e,t,n,r=n){let i,s,o;return t?(Qi.forEach(t,(a,l,c)=>{let d=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let u=e.type==="tuple",p=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[p],e=u?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}s=d,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Qc extends Set{describe(){const t=[];for(const n of this.values())t.push(ds.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Qc(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Bs(e,t=new Map){if(Xm(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Bs(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Bs(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Bs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Bs(i,t)}else throw Error(`Unable to clone ${e}`);return n}class lr{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Qc,this._blacklist=new Qc,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Yn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Bs(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&Ii(s))return s;let o=ci(t),a=ci(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
86
|
+
*/var ju=v,HP=UP;function WP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qP=typeof Object.is=="function"?Object.is:WP,GP=HP.useSyncExternalStore,YP=ju.useRef,QP=ju.useEffect,KP=ju.useMemo,XP=ju.useDebugValue;oS.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=YP(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=KP(function(){function l(h){if(!c){if(c=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var y=o.value;if(i(y,h))return u=y}return u=h}if(y=u,qP(d,h))return y;var x=r(h);return i!==void 0&&i(y,x)?y:(d=h,u=x)}var c=!1,d,u,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,i]);var a=GP(e,s[0],s[1]);return QP(function(){o.hasValue=!0,o.value=a},[a]),XP(a),a};sS.exports=oS;var ZP=sS.exports;const JP=Rr(ZP),cS={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:eM}=J,{useSyncExternalStoreWithSelector:tM}=JP;let m0=!1;const nM=e=>e;function rM(e,t=nM,n){(cS?"production":void 0)!=="production"&&n&&!m0&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),m0=!0);const r=tM(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return eM(r),r}const g0=e=>{(cS?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?OP(e):e,n=(r,i)=>rM(t,r,i);return Object.assign(n,t),n},iM=e=>e?g0(e):g0,re=iM(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",defaultValues:{},soundPath:void 0,isTooltipVisible:!0,onTooltipClose:void 0,anyAdmin:!0,showActionButtons:!1,setIsTooltipVisible:t=>e({isTooltipVisible:t}),setOnTooltipClose:t=>e({onTooltipClose:t}),setOpen:t=>{e({open:t})},setAnyAdmin:t=>e({anyAdmin:t}),setWidget:t=>e({widget:t}),setDefaultValues:t=>e({defaultValues:t}),setIsHaveChat:t=>{var n;if(e({isHaveChat:t}),localStorage.setItem("lc:widget:isHaveChat",t.toString()),!t){e({showActionButtons:!1});const r=(n=re.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setSoundPath:t=>{e({soundPath:t})},onOpen:void 0,onClose:void 0,setOnOpen:t=>e({onOpen:t}),setOnClose:t=>e({onClose:t}),setIsInputFocused:t=>e({isInputFocused:t}),historyChat:null,setHistoryChat:t=>e({historyChat:t}),historyMessages:null,setHistoryMessages:t=>e({historyMessages:t}),showHistoryOnRegistration:!1,setShowHistoryOnRegistration:t=>e({showHistoryOnRegistration:t}),aiAgent:null,setAIAgent:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Fl(r,t,n.isAIAgentMode,n.aiAgentSessionId,n.humanNeedRequested),{aiAgent:t}}),isAIAgentMode:!1,setIsAIAgentMode:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Fl(r,n.aiAgent,t,n.aiAgentSessionId,n.humanNeedRequested),{isAIAgentMode:t}}),aiAgentSessionId:null,setAIAgentSessionId:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&Fl(r,n.aiAgent,n.isAIAgentMode,t,n.humanNeedRequested),{aiAgentSessionId:t}}),humanNeedRequested:!1,setHumanNeedRequested:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;if(r){const s=`${r}:`;t?localStorage.setItem(`${s}${st.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${st.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&Fl(r,n.aiAgent,n.isAIAgentMode,n.aiAgentSessionId,t)}return{humanNeedRequested:t}}),aiAgentMessages:[],setAIAgentMessages:t=>e(n=>({aiAgentMessages:typeof t=="function"?t(n.aiAgentMessages):t})),addAIAgentMessage:t=>e(n=>({aiAgentMessages:[...n.aiAgentMessages,t]})),clearAIAgentState:()=>e(t=>{var r;const n=(r=t.widget)==null?void 0:r.link_id;return n&&qm(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1}}),connectingToOperator:!1,setConnectingToOperator:t=>e({connectingToOperator:t}),showOperatorForm:!1,setShowOperatorForm:t=>e({showOperatorForm:t}),setShowActionButtons:t=>e(n=>{var i;const r=(i=n.widget)==null?void 0:i.link_id;return r&&localStorage.setItem(`${r}:showActionButtons`,t.toString()),{showActionButtons:t}})})),sM=e=>({accessToken:localStorage.getItem(`${e}:${st.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${st.CustomerRefreshToken}`)||""}),ll=()=>{const{widget:e}=re();return e?sM(e.link_id):null},Yi=e=>{if(!e)return{};const{accessToken:t,refreshToken:n}=e,r={};return t&&(r["X-Customer-Token"]=t),n&&(r["X-Customer-Refresh-Token"]=n),{...r}};function Fp(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const Gm=()=>lm({mutationFn:e=>Mr(`clients/${e.client_id}/chats`,{method:"POST",body:JSON.stringify({inputs:e.inputs,client_id:void 0,widget_id:e.widget_id,history:e.history,device_id:e.device_id,is_agent_mode:e.is_agent_mode,widget_version:"2026.01.05-1"})})}),oM=(e,t)=>Mr(`clients/${e}/chats`,{headers:t}),ac=(e,t)=>Mr(`clients/${e}/chats`,{method:"DELETE",headers:t}),aM=(e,t,n)=>Mr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:{...n,"X-Device-Id":Zo(st.DeviceId,"")||""}}),lM=()=>{const e=ll();return lm({mutationFn:t=>aM(t.rating,t.comment,Yi(e))})},cM=e=>{const t=ll();return lm({mutationFn:n=>Mr(`clients/${e}/chats/files`,{method:"POST",headers:Yi(t),body:OT({files:n},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function uM(e){return e&&typeof e=="object"&&"file_urls"in e}const dM=e=>{const t=`${rb}/visitors/identify`,n=JSON.stringify(e);try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0,credentials:"include"}).catch(()=>{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}})}catch{if(navigator.sendBeacon){const r=new Blob([n],{type:"application/json"});navigator.sendBeacon(t,r)}}},fM=(e,t)=>yb({queryKey:["visitors","history",e,t],queryFn:()=>Mr(`visitors/history?widget_id=${e}&device_id=${t}`),enabled:!!e&&!!t}),pM=(e,t,n)=>Mr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`);async function hM(e){const[t,n]=await Mr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function us(e){this._maxSize=e,this.clear()}us.prototype.clear=function(){this._size=0,this._values=Object.create(null)};us.prototype.get=function(e){return this._values[e]};us.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var mM=/[^.^\]^[]+|(?=\[\]|\.\.)/g,uS=/^\d+$/,gM=/^\d/,vM=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,yM=/^\s*(['"]?)(.*?)(\1)\s*$/,Ym=512,v0=new us(Ym),y0=new us(Ym),x0=new us(Ym),Qi={Cache:us,split:Bp,normalizePath:Hd,setter:function(e){var t=Hd(e);return y0.get(e)||y0.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var l=t[s];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=Hd(e);return x0.get(e)||x0.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Qm(n)||uS.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){xM(Array.isArray(e)?e:Bp(e),t,n)}};function Hd(e){return v0.get(e)||v0.set(e,Bp(e).map(function(t){return t.replace(yM,"$2")}))}function Bp(e){return e.match(mM)||[""]}function xM(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(kM(i)&&(i='"'+i+'"'),a=Qm(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Qm(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function wM(e){return e.match(gM)&&!e.match(uS)}function bM(e){return vM.test(e)}function kM(e){return!Qm(e)&&(wM(e)||bM(e))}const SM=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Ru=e=>e.match(SM)||[],Pu=e=>e[0].toUpperCase()+e.slice(1),Km=(e,t)=>Ru(e).join(t).toLowerCase(),dS=e=>Ru(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),CM=e=>Pu(dS(e)),_M=e=>Km(e,"_"),TM=e=>Km(e,"-"),EM=e=>Pu(Km(e," ")),AM=e=>Ru(e).map(Pu).join(" ");var Wd={words:Ru,upperFirst:Pu,camelCase:dS,pascalCase:CM,snakeCase:_M,kebabCase:TM,sentenceCase:EM,titleCase:AM},Xm={exports:{}};Xm.exports=function(e){return fS(jM(e),e)};Xm.exports.array=fS;function fS(e,t){var n=e.length,r=new Array(n),i={},s=n,o=RM(t),a=PM(e);for(t.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||l(e[s],s,new Set);return r;function l(c,d,u){if(u.has(c)){var p;try{p=", node was:"+JSON.stringify(c)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!i[d]){i[d]=!0;var h=o.get(c)||new Set;if(h=Array.from(h),d=h.length){u.add(c);do{var y=h[--d];l(y,a.get(y),u)}while(d);u.delete(c)}r[--n]=c}}}function jM(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function RM(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function PM(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var MM=Xm.exports;const OM=Rr(MM),NM=Object.prototype.toString,DM=Error.prototype.toString,IM=RegExp.prototype.toString,LM=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",FM=/^Symbol\((.*)\)(.*)$/;function BM(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function w0(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return BM(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return LM.call(e).replace(FM,"Symbol($1)");const r=NM.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+DM.call(e)+"]":r==="RegExp"?IM.call(e):null}function ci(e,t){let n=w0(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=w0(this[r],t);return s!==null?s:i},2)}function pS(e){return e==null?[]:[].concat(e)}let hS,mS,gS,$M=/\$\{\s*(\w+)\s*\}/g;hS=Symbol.toStringTag;class b0{constructor(t,n,r,i){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[hS]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],pS(t).forEach(s=>{if(Wt.isError(s)){this.errors.push(...s.errors);const o=s.inner.length?s.inner:[s];this.inner.push(...o)}else this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}mS=Symbol.hasInstance;gS=Symbol.toStringTag;class Wt extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace($M,(i,s)=>ci(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i,s){const o=new b0(t,n,r,i);if(s)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[gS]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,Wt)}static[mS](t){return b0[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let Qn={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const i=r!=null&&r!==n?` (cast from the value \`${ci(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${ci(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${ci(n,!0)}\``+i}},$t={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},zM={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},$p={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},VM={isValue:"${path} field must be ${value}"},lc={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},UM={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},HM={notType:e=>{const{path:t,value:n,spec:r}=e,i=r.types.length;if(Array.isArray(n)){if(n.length<i)return`${t} tuple value has too few items, expected a length of ${i} but got ${n.length} for value: \`${ci(n,!0)}\``;if(n.length>i)return`${t} tuple value has too many items, expected a length of ${i} but got ${n.length} for value: \`${ci(n,!0)}\``}return Wt.formatError(Qn.notType,e)}};Object.assign(Object.create(null),{mixed:Qn,string:$t,number:zM,date:$p,object:lc,array:UM,boolean:VM,tuple:HM});const Zm=e=>e&&e.__isYupSchema__;class Qc{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new Qc(t,(a,l)=>{var c;let d=o(...a)?i:s;return(c=d==null?void 0:d(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(s=>s.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),i=this.fn(r,t,n);if(i===void 0||i===t)return t;if(!Zm(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Bl={context:"$",value:"."};class ds{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Bl.context,this.isValue=this.key[0]===Bl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Bl.context:this.isValue?Bl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Qi.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ds.prototype.__isYupRef=!0;const Ii=e=>e==null;function bs(e){function t({value:n,path:r="",options:i,originalValue:s,schema:o},a,l){const{name:c,test:d,params:u,message:p,skipAbsent:h}=e;let{parent:y,context:x,abortEarly:w=o.spec.abortEarly,disableStackTrace:m=o.spec.disableStackTrace}=i;function g(F){return ds.isRef(F)?F.getValue(n,y,x):F}function b(F={}){const D=Object.assign({value:n,originalValue:s,label:o.spec.label,path:F.path||r,spec:o.spec,disableStackTrace:F.disableStackTrace||m},u,F.params);for(const z of Object.keys(D))D[z]=g(D[z]);const G=new Wt(Wt.formatError(F.message||p,D),n,D.path,F.type||c,D.disableStackTrace);return G.params=D,G}const C=w?a:l;let S={path:r,parent:y,type:c,from:i.from,createError:b,resolve:g,options:i,originalValue:s,schema:o};const _=F=>{Wt.isError(F)?C(F):F?l(null):C(b())},j=F=>{Wt.isError(F)?C(F):a(F)};if(h&&Ii(n))return _(!0);let E;try{var L;if(E=d.call(S,n,S),typeof((L=E)==null?void 0:L.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${S.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(E).then(_,j)}}catch(F){j(F);return}_(E)}return t.OPTIONS=e,t}function WM(e,t,n,r=n){let i,s,o;return t?(Qi.forEach(t,(a,l,c)=>{let d=l?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:i,value:n});let u=e.type==="tuple",p=c?parseInt(d,10):0;if(e.innerType||u){if(u&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&p>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[p],e=u?e.spec.types[p]:e.innerType}if(!c){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);i=n,n=n&&n[d],e=e.fields[d]}s=d,o=l?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class Kc extends Set{describe(){const t=[];for(const n of this.values())t.push(ds.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Kc(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Bs(e,t=new Map){if(Zm(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Bs(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,i]of e.entries())n.set(r,Bs(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Bs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Bs(i,t)}else throw Error(`Unable to clone ${e}`);return n}class lr{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Kc,this._blacklist=new Kc,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Qn.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Bs(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Object.assign({},n.spec,r.spec);return r.spec=i,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,i,s;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(i=t.recursive)!=null?i:this.spec.recursive,disableStackTrace:(s=t.disableStackTrace)!=null?s:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),i=n.assert==="ignore-optionality",s=r._cast(t,n);if(n.assert!==!1&&!r.isType(s)){if(i&&Ii(s))return s;let o=ci(t),a=ci(s);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
87
87
|
|
|
88
88
|
attempted value: ${o}
|
|
89
|
-
`+(a!==o?`result of cast: ${a}`:""))}return s}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:s,originalValue:o=t,strict:a=this.spec.strict}=n,l=t;a||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let d of Object.values(this.internalTests))d&&c.push(d);this.runTests({path:s,value:l,originalValue:o,options:n,tests:c},r,d=>{if(d.length)return i(d,l);this.runTests({path:s,value:l,originalValue:o,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:s,value:o,originalValue:a,path:l,options:c}=t,d=w=>{i||(i=!0,n(w,o))},u=w=>{i||(i=!0,r(w,o))},p=s.length,m=[];if(!p)return u([]);let y={value:o,originalValue:a,path:l,options:c,schema:this};for(let w=0;w<s.length;w++){const x=s[w];x(y,d,function(g){g&&(Array.isArray(g)?m.push(...g):m.push(g)),--p<=0&&u(m)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:s,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let c=r[a];const d=Object.assign({},o,{strict:!0,parent:r,value:c,originalValue:s[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(u,p,m)=>this.resolve(d)._validate(c,d,p,m)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((o,a)=>i._validate(t,n,(l,c)=>{Wt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Wt(l,c,void 0,void 0,s)):o(c)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(a,l)=>{throw Wt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Wt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Wt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Wt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Bs(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=bs({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=bs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Yn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Yn.notNull){return this.nullability(!1,t)}required(t=Yn.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Yn.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=bs(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=dS(t).map(s=>new ds(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Yc(i,n):Yc.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=bs({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Yn.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=bs({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),r}notOneOf(t,n=Yn.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=bs({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:s,nullable:o}=n.spec;return{meta:i,label:r,optional:s,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,d)=>d.findIndex(u=>u.name===l.name)===c)}}}lr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])lr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=UM(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])lr.prototype[e]=lr.prototype.oneOf;for(const e of["not","nope"])lr.prototype[e]=lr.prototype.notOneOf;const HM=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function WM(e){const t=$p(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function $p(e){var t,n;const r=HM.exec(e);return r?{year:pr(r[1]),month:pr(r[2],1)-1,day:pr(r[3],1),hour:pr(r[4]),minute:pr(r[5]),second:pr(r[6]),millisecond:r[7]?pr(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:pr(r[10]),minuteOffset:pr(r[11])}:null}function pr(e,t=0){return Number(e)||t}let qM=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,GM=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,YM=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,QM="^\\d{4}-\\d{2}-\\d{2}",KM="\\d{2}:\\d{2}:\\d{2}",XM="(([+-]\\d{2}(:?\\d{2})?)|Z)",ZM=new RegExp(`${QM}T${KM}(\\.\\d+)?${XM}$`),JM=e=>Ii(e)||e===e.trim(),eO={}.toString();function Kc(){return new mS}class mS extends lr{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===eO?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Yn.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=$t.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=$t.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=$t.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||$t.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=$t.email){return this.matches(qM,{name:"email",message:t,excludeEmptyString:!0})}url(t=$t.url){return this.matches(GM,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$t.uuid){return this.matches(YM,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(ZM,{name:"datetime",message:n||$t.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||$t.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=$p(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||$t.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=$p(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$t.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:JM})}lowercase(t=$t.lowercase){return this.transform(n=>Ii(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toLowerCase()})}uppercase(t=$t.uppercase){return this.transform(n=>Ii(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toUpperCase()})}}Kc.prototype=mS.prototype;let tO=new Date(""),nO=e=>Object.prototype.toString.call(e)==="[object Date]";class Pu extends lr{constructor(){super({type:"date",check(t){return nO(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=WM(t),isNaN(t)?Pu.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ds.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Bp.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=Bp.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}Pu.INVALID_DATE=tO;Pu.prototype;function rO(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Qi.split(o)[0];r.add(l),i.has(`${a}-${l}`)||n.push([a,l])}for(const o of Object.keys(e)){let a=e[o];r.add(o),ds.isRef(a)&&a.isSibling?s(a.path,o):Xm(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return PM.array(Array.from(r),n).reverse()}function b0(e,t){let n=1/0;return e.some((r,i)=>{var s;if((s=t.path)!=null&&s.includes(r))return n=i,!0}),n}function gS(e){return(t,n)=>b0(e,t)-b0(e,n)}const iO=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function lc(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=lc(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=lc(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(lc)}):"optional"in e?e.optional():e}const sO=(e,t)=>{const n=[...Qi.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Qi.getter(Qi.join(n),!0)(e);return!!(i&&r in i)};let k0=e=>Object.prototype.toString.call(e)==="[object Object]";function S0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const oO=gS([]);function Zm(e){return new vS(e)}class vS extends lr{constructor(t){super({type:"object",check(n){return k0(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=oO,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(u=>!this._nodes.includes(u))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const u of a){let p=s[u],m=u in i;if(p){let y,w=i[u];c.path=(n.path?`${n.path}.`:"")+u,p=p.resolve({value:w,context:n.context,parent:l});let x=p instanceof lr?p.spec:void 0,h=x==null?void 0:x.strict;if(x!=null&&x.strip){d=d||u in i;continue}y=!n.__validating||!h?p.cast(i[u],c):i[u],y!==void 0&&(l[u]=y)}else m&&!o&&(l[u]=i[u]);(m!==u in l||l[u]!==i[u])&&(d=!0)}return d?l:i}_validate(t,n={},r,i){let{from:s=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,c)=>{if(!a||!k0(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let p=this.fields[u];!p||ds.isRef(p)||d.push(p.asNestedTest({options:n,key:u,parent:c,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:c,originalValue:o,options:n},r,u=>{i(u.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];r[i]=o===void 0?s:o}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=rO(t,n),r._sortErrors=gS(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return lc(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=Qi.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return sO(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(iO)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||ac.exact,test(n){if(n==null)return!0;const r=S0(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=ac.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=S0(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=ac.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Hd.camelCase)}snakeCase(){return this.transformKeys(Hd.snakeCase)}constantCase(){return this.transformKeys(t=>Hd.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}Zm.prototype=vS.prototype;var aO=function(t){return lO(t)&&!cO(t)};function lO(e){return!!e&&typeof e=="object"}function cO(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||fO(e)}var uO=typeof Symbol=="function"&&Symbol.for,dO=uO?Symbol.for("react.element"):60103;function fO(e){return e.$$typeof===dO}function pO(e){return Array.isArray(e)?[]:{}}function Xc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ha(pO(e),e,t):e}function hO(e,t,n){return e.concat(t).map(function(r){return Xc(r,n)})}function mO(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=Xc(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Xc(t[i],n):r[i]=Ha(e[i],t[i],n)}),r}function Ha(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||hO,n.isMergeableObject=n.isMergeableObject||aO;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):mO(e,t,n):Xc(t,n)}Ha.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Ha(r,i,n)},{})};var zp=Ha,yS=typeof global=="object"&&global&&global.Object===Object&&global,gO=typeof self=="object"&&self&&self.Object===Object&&self,ur=yS||gO||Function("return this")(),gi=ur.Symbol,xS=Object.prototype,vO=xS.hasOwnProperty,yO=xS.toString,Vo=gi?gi.toStringTag:void 0;function xO(e){var t=vO.call(e,Vo),n=e[Vo];try{e[Vo]=void 0;var r=!0}catch{}var i=yO.call(e);return r&&(t?e[Vo]=n:delete e[Vo]),i}var wO=Object.prototype,bO=wO.toString;function kO(e){return bO.call(e)}var SO="[object Null]",CO="[object Undefined]",C0=gi?gi.toStringTag:void 0;function fs(e){return e==null?e===void 0?CO:SO:C0&&C0 in Object(e)?xO(e):kO(e)}function wS(e,t){return function(n){return e(t(n))}}var Jm=wS(Object.getPrototypeOf,Object);function ps(e){return e!=null&&typeof e=="object"}var TO="[object Object]",_O=Function.prototype,EO=Object.prototype,bS=_O.toString,jO=EO.hasOwnProperty,AO=bS.call(Object);function T0(e){if(!ps(e)||fs(e)!=TO)return!1;var t=Jm(e);if(t===null)return!0;var n=jO.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&bS.call(n)==AO}function RO(){this.__data__=[],this.size=0}function kS(e,t){return e===t||e!==e&&t!==t}function Mu(e,t){for(var n=e.length;n--;)if(kS(e[n][0],t))return n;return-1}var PO=Array.prototype,MO=PO.splice;function OO(e){var t=this.__data__,n=Mu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():MO.call(t,n,1),--this.size,!0}function NO(e){var t=this.__data__,n=Mu(t,e);return n<0?void 0:t[n][1]}function DO(e){return Mu(this.__data__,e)>-1}function IO(e,t){var n=this.__data__,r=Mu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Or.prototype.clear=RO;Or.prototype.delete=OO;Or.prototype.get=NO;Or.prototype.has=DO;Or.prototype.set=IO;function LO(){this.__data__=new Or,this.size=0}function FO(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function BO(e){return this.__data__.get(e)}function $O(e){return this.__data__.has(e)}function ll(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var zO="[object AsyncFunction]",VO="[object Function]",UO="[object GeneratorFunction]",HO="[object Proxy]";function SS(e){if(!ll(e))return!1;var t=fs(e);return t==VO||t==UO||t==zO||t==HO}var Wd=ur["__core-js_shared__"],_0=function(){var e=/[^.]+$/.exec(Wd&&Wd.keys&&Wd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function WO(e){return!!_0&&_0 in e}var qO=Function.prototype,GO=qO.toString;function hs(e){if(e!=null){try{return GO.call(e)}catch{}try{return e+""}catch{}}return""}var YO=/[\\^$.*+?()[\]{}|]/g,QO=/^\[object .+?Constructor\]$/,KO=Function.prototype,XO=Object.prototype,ZO=KO.toString,JO=XO.hasOwnProperty,eN=RegExp("^"+ZO.call(JO).replace(YO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tN(e){if(!ll(e)||WO(e))return!1;var t=SS(e)?eN:QO;return t.test(hs(e))}function nN(e,t){return e==null?void 0:e[t]}function ms(e,t){var n=nN(e,t);return tN(n)?n:void 0}var Wa=ms(ur,"Map"),qa=ms(Object,"create");function rN(){this.__data__=qa?qa(null):{},this.size=0}function iN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var sN="__lodash_hash_undefined__",oN=Object.prototype,aN=oN.hasOwnProperty;function lN(e){var t=this.__data__;if(qa){var n=t[e];return n===sN?void 0:n}return aN.call(t,e)?t[e]:void 0}var cN=Object.prototype,uN=cN.hasOwnProperty;function dN(e){var t=this.__data__;return qa?t[e]!==void 0:uN.call(t,e)}var fN="__lodash_hash_undefined__";function pN(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=qa&&t===void 0?fN:t,this}function is(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}is.prototype.clear=rN;is.prototype.delete=iN;is.prototype.get=lN;is.prototype.has=dN;is.prototype.set=pN;function hN(){this.size=0,this.__data__={hash:new is,map:new(Wa||Or),string:new is}}function mN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ou(e,t){var n=e.__data__;return mN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function gN(e){var t=Ou(this,e).delete(e);return this.size-=t?1:0,t}function vN(e){return Ou(this,e).get(e)}function yN(e){return Ou(this,e).has(e)}function xN(e,t){var n=Ou(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function bi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bi.prototype.clear=hN;bi.prototype.delete=gN;bi.prototype.get=vN;bi.prototype.has=yN;bi.prototype.set=xN;var wN=200;function bN(e,t){var n=this.__data__;if(n instanceof Or){var r=n.__data__;if(!Wa||r.length<wN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bi(r)}return n.set(e,t),this.size=n.size,this}function Ao(e){var t=this.__data__=new Or(e);this.size=t.size}Ao.prototype.clear=LO;Ao.prototype.delete=FO;Ao.prototype.get=BO;Ao.prototype.has=$O;Ao.prototype.set=bN;function kN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var E0=function(){try{var e=ms(Object,"defineProperty");return e({},"",{}),e}catch{}}();function CS(e,t,n){t=="__proto__"&&E0?E0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var SN=Object.prototype,CN=SN.hasOwnProperty;function TS(e,t,n){var r=e[t];(!(CN.call(e,t)&&kS(r,n))||n===void 0&&!(t in e))&&CS(e,t,n)}function Nu(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=void 0;l===void 0&&(l=e[a]),i?CS(n,a,l):TS(n,a,l)}return n}function TN(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var _N="[object Arguments]";function j0(e){return ps(e)&&fs(e)==_N}var _S=Object.prototype,EN=_S.hasOwnProperty,jN=_S.propertyIsEnumerable,AN=j0(function(){return arguments}())?j0:function(e){return ps(e)&&EN.call(e,"callee")&&!jN.call(e,"callee")},cl=Array.isArray;function RN(){return!1}var ES=typeof nn=="object"&&nn&&!nn.nodeType&&nn,A0=ES&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,PN=A0&&A0.exports===ES,R0=PN?ur.Buffer:void 0,MN=R0?R0.isBuffer:void 0,jS=MN||RN,ON=9007199254740991,NN=/^(?:0|[1-9]\d*)$/;function DN(e,t){var n=typeof e;return t=t??ON,!!t&&(n=="number"||n!="symbol"&&NN.test(e))&&e>-1&&e%1==0&&e<t}var IN=9007199254740991;function AS(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=IN}var LN="[object Arguments]",FN="[object Array]",BN="[object Boolean]",$N="[object Date]",zN="[object Error]",VN="[object Function]",UN="[object Map]",HN="[object Number]",WN="[object Object]",qN="[object RegExp]",GN="[object Set]",YN="[object String]",QN="[object WeakMap]",KN="[object ArrayBuffer]",XN="[object DataView]",ZN="[object Float32Array]",JN="[object Float64Array]",e4="[object Int8Array]",t4="[object Int16Array]",n4="[object Int32Array]",r4="[object Uint8Array]",i4="[object Uint8ClampedArray]",s4="[object Uint16Array]",o4="[object Uint32Array]",Be={};Be[ZN]=Be[JN]=Be[e4]=Be[t4]=Be[n4]=Be[r4]=Be[i4]=Be[s4]=Be[o4]=!0;Be[LN]=Be[FN]=Be[KN]=Be[BN]=Be[XN]=Be[$N]=Be[zN]=Be[VN]=Be[UN]=Be[HN]=Be[WN]=Be[qN]=Be[GN]=Be[YN]=Be[QN]=!1;function a4(e){return ps(e)&&AS(e.length)&&!!Be[fs(e)]}function eg(e){return function(t){return e(t)}}var RS=typeof nn=="object"&&nn&&!nn.nodeType&&nn,pa=RS&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,l4=pa&&pa.exports===RS,qd=l4&&yS.process,yo=function(){try{var e=pa&&pa.require&&pa.require("util").types;return e||qd&&qd.binding&&qd.binding("util")}catch{}}(),P0=yo&&yo.isTypedArray,c4=P0?eg(P0):a4,u4=Object.prototype,d4=u4.hasOwnProperty;function PS(e,t){var n=cl(e),r=!n&&AN(e),i=!n&&!r&&jS(e),s=!n&&!r&&!i&&c4(e),o=n||r||i||s,a=o?TN(e.length,String):[],l=a.length;for(var c in e)(t||d4.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||DN(c,l)))&&a.push(c);return a}var f4=Object.prototype;function tg(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||f4;return e===n}var p4=wS(Object.keys,Object),h4=Object.prototype,m4=h4.hasOwnProperty;function g4(e){if(!tg(e))return p4(e);var t=[];for(var n in Object(e))m4.call(e,n)&&n!="constructor"&&t.push(n);return t}function MS(e){return e!=null&&AS(e.length)&&!SS(e)}function ng(e){return MS(e)?PS(e):g4(e)}function v4(e,t){return e&&Nu(t,ng(t),e)}function y4(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var x4=Object.prototype,w4=x4.hasOwnProperty;function b4(e){if(!ll(e))return y4(e);var t=tg(e),n=[];for(var r in e)r=="constructor"&&(t||!w4.call(e,r))||n.push(r);return n}function rg(e){return MS(e)?PS(e,!0):b4(e)}function k4(e,t){return e&&Nu(t,rg(t),e)}var OS=typeof nn=="object"&&nn&&!nn.nodeType&&nn,M0=OS&&typeof rn=="object"&&rn&&!rn.nodeType&&rn,S4=M0&&M0.exports===OS,O0=S4?ur.Buffer:void 0,N0=O0?O0.allocUnsafe:void 0;function C4(e,t){if(t)return e.slice();var n=e.length,r=N0?N0(n):new e.constructor(n);return e.copy(r),r}function NS(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function T4(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}function DS(){return[]}var _4=Object.prototype,E4=_4.propertyIsEnumerable,D0=Object.getOwnPropertySymbols,ig=D0?function(e){return e==null?[]:(e=Object(e),T4(D0(e),function(t){return E4.call(e,t)}))}:DS;function j4(e,t){return Nu(e,ig(e),t)}function IS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var A4=Object.getOwnPropertySymbols,LS=A4?function(e){for(var t=[];e;)IS(t,ig(e)),e=Jm(e);return t}:DS;function R4(e,t){return Nu(e,LS(e),t)}function FS(e,t,n){var r=t(e);return cl(e)?r:IS(r,n(e))}function P4(e){return FS(e,ng,ig)}function M4(e){return FS(e,rg,LS)}var Vp=ms(ur,"DataView"),Up=ms(ur,"Promise"),Hp=ms(ur,"Set"),Wp=ms(ur,"WeakMap"),I0="[object Map]",O4="[object Object]",L0="[object Promise]",F0="[object Set]",B0="[object WeakMap]",$0="[object DataView]",N4=hs(Vp),D4=hs(Wa),I4=hs(Up),L4=hs(Hp),F4=hs(Wp),yr=fs;(Vp&&yr(new Vp(new ArrayBuffer(1)))!=$0||Wa&&yr(new Wa)!=I0||Up&&yr(Up.resolve())!=L0||Hp&&yr(new Hp)!=F0||Wp&&yr(new Wp)!=B0)&&(yr=function(e){var t=fs(e),n=t==O4?e.constructor:void 0,r=n?hs(n):"";if(r)switch(r){case N4:return $0;case D4:return I0;case I4:return L0;case L4:return F0;case F4:return B0}return t});var B4=Object.prototype,$4=B4.hasOwnProperty;function z4(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&$4.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var z0=ur.Uint8Array;function sg(e){var t=new e.constructor(e.byteLength);return new z0(t).set(new z0(e)),t}function V4(e,t){var n=t?sg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var U4=/\w*$/;function H4(e){var t=new e.constructor(e.source,U4.exec(e));return t.lastIndex=e.lastIndex,t}var V0=gi?gi.prototype:void 0,U0=V0?V0.valueOf:void 0;function W4(e){return U0?Object(U0.call(e)):{}}function q4(e,t){var n=t?sg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var G4="[object Boolean]",Y4="[object Date]",Q4="[object Map]",K4="[object Number]",X4="[object RegExp]",Z4="[object Set]",J4="[object String]",eD="[object Symbol]",tD="[object ArrayBuffer]",nD="[object DataView]",rD="[object Float32Array]",iD="[object Float64Array]",sD="[object Int8Array]",oD="[object Int16Array]",aD="[object Int32Array]",lD="[object Uint8Array]",cD="[object Uint8ClampedArray]",uD="[object Uint16Array]",dD="[object Uint32Array]";function fD(e,t,n){var r=e.constructor;switch(t){case tD:return sg(e);case G4:case Y4:return new r(+e);case nD:return V4(e,n);case rD:case iD:case sD:case oD:case aD:case lD:case cD:case uD:case dD:return q4(e,n);case Q4:return new r;case K4:case J4:return new r(e);case X4:return H4(e);case Z4:return new r;case eD:return W4(e)}}var H0=Object.create,pD=function(){function e(){}return function(t){if(!ll(t))return{};if(H0)return H0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function hD(e){return typeof e.constructor=="function"&&!tg(e)?pD(Jm(e)):{}}var mD="[object Map]";function gD(e){return ps(e)&&yr(e)==mD}var W0=yo&&yo.isMap,vD=W0?eg(W0):gD,yD="[object Set]";function xD(e){return ps(e)&&yr(e)==yD}var q0=yo&&yo.isSet,wD=q0?eg(q0):xD,bD=1,kD=2,SD=4,BS="[object Arguments]",CD="[object Array]",TD="[object Boolean]",_D="[object Date]",ED="[object Error]",$S="[object Function]",jD="[object GeneratorFunction]",AD="[object Map]",RD="[object Number]",zS="[object Object]",PD="[object RegExp]",MD="[object Set]",OD="[object String]",ND="[object Symbol]",DD="[object WeakMap]",ID="[object ArrayBuffer]",LD="[object DataView]",FD="[object Float32Array]",BD="[object Float64Array]",$D="[object Int8Array]",zD="[object Int16Array]",VD="[object Int32Array]",UD="[object Uint8Array]",HD="[object Uint8ClampedArray]",WD="[object Uint16Array]",qD="[object Uint32Array]",De={};De[BS]=De[CD]=De[ID]=De[LD]=De[TD]=De[_D]=De[FD]=De[BD]=De[$D]=De[zD]=De[VD]=De[AD]=De[RD]=De[zS]=De[PD]=De[MD]=De[OD]=De[ND]=De[UD]=De[HD]=De[WD]=De[qD]=!0;De[ED]=De[$S]=De[DD]=!1;function ha(e,t,n,r,i,s){var o,a=t&bD,l=t&kD,c=t&SD;if(o!==void 0)return o;if(!ll(e))return e;var d=cl(e);if(d){if(o=z4(e),!a)return NS(e,o)}else{var u=yr(e),p=u==$S||u==jD;if(jS(e))return C4(e,a);if(u==zS||u==BS||p&&!i){if(o=l||p?{}:hD(e),!a)return l?R4(e,k4(o,e)):j4(e,v4(o,e))}else{if(!De[u])return i?e:{};o=fD(e,u,a)}}s||(s=new Ao);var m=s.get(e);if(m)return m;s.set(e,o),wD(e)?e.forEach(function(x){o.add(ha(x,t,n,x,e,s))}):vD(e)&&e.forEach(function(x,h){o.set(h,ha(x,t,n,h,e,s))});var y=c?l?M4:P4:l?rg:ng,w=d?void 0:y(e);return kN(w||e,function(x,h){w&&(h=x,x=e[h]),TS(o,h,ha(x,t,n,h,e,s))}),o}var GD=1,YD=4;function Bl(e){return ha(e,GD|YD)}var G0=Array.isArray,Y0=Object.keys,QD=Object.prototype.hasOwnProperty,KD=typeof Element<"u";function qp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=G0(e),r=G0(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!qp(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var a=e instanceof Date,l=t instanceof Date;if(a!=l)return!1;if(a&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,d=t instanceof RegExp;if(c!=d)return!1;if(c&&d)return e.toString()==t.toString();var u=Y0(e);if(s=u.length,s!==Y0(t).length)return!1;for(i=s;i--!==0;)if(!QD.call(t,u[i]))return!1;if(KD&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!qp(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var XD=function(t,n){try{return qp(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const Ai=Rr(XD);var ZD=4;function Q0(e){return ha(e,ZD)}function VS(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var JD="[object Symbol]";function og(e){return typeof e=="symbol"||ps(e)&&fs(e)==JD}var eI="Expected a function";function ag(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(eI);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(ag.Cache||bi),n}ag.Cache=bi;var tI=500;function nI(e){var t=ag(e,function(r){return n.size===tI&&n.clear(),r}),n=t.cache;return t}var rI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iI=/\\(\\)?/g,sI=nI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(rI,function(n,r,i,s){t.push(i?s.replace(iI,"$1"):r||n)}),t}),oI=1/0;function aI(e){if(typeof e=="string"||og(e))return e;var t=e+"";return t=="0"&&1/e==-oI?"-0":t}var lI=1/0,K0=gi?gi.prototype:void 0,X0=K0?K0.toString:void 0;function US(e){if(typeof e=="string")return e;if(cl(e))return VS(e,US)+"";if(og(e))return X0?X0.call(e):"";var t=e+"";return t=="0"&&1/e==-lI?"-0":t}function cI(e){return e==null?"":US(e)}function HS(e){return cl(e)?VS(e,aI):og(e)?[e]:NS(sI(cI(e)))}var WS={exports:{}},Me={};/** @license React v16.13.1
|
|
89
|
+
`+(a!==o?`result of cast: ${a}`:""))}return s}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,i){let{path:s,originalValue:o=t,strict:a=this.spec.strict}=n,l=t;a||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let d of Object.values(this.internalTests))d&&c.push(d);this.runTests({path:s,value:l,originalValue:o,options:n,tests:c},r,d=>{if(d.length)return i(d,l);this.runTests({path:s,value:l,originalValue:o,options:n,tests:this.tests},r,i)})}runTests(t,n,r){let i=!1,{tests:s,value:o,originalValue:a,path:l,options:c}=t,d=x=>{i||(i=!0,n(x,o))},u=x=>{i||(i=!0,r(x,o))},p=s.length,h=[];if(!p)return u([]);let y={value:o,originalValue:a,path:l,options:c,schema:this};for(let x=0;x<s.length;x++){const w=s[x];w(y,d,function(g){g&&(Array.isArray(g)?h.push(...g):h.push(g)),--p<=0&&u(h)})}}asNestedTest({key:t,index:n,parent:r,parentPath:i,originalParent:s,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let c=r[a];const d=Object.assign({},o,{strict:!0,parent:r,value:c,originalValue:s[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${i||""}[${l?a:`"${a}"`}]`:(i?`${i}.`:"")+t});return(u,p,h)=>this.resolve(d)._validate(c,d,p,h)}validate(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return new Promise((o,a)=>i._validate(t,n,(l,c)=>{Wt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Wt(l,c,void 0,void 0,s)):o(c)}))}validateSync(t,n){var r;let i=this.resolve(Object.assign({},n,{value:t})),s,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:i.spec.disableStackTrace;return i._validate(t,Object.assign({},n,{sync:!0}),(a,l)=>{throw Wt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Wt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Wt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Wt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Bs(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=bs({message:n,name:"nullable",test(i){return i===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=bs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=Qn.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=Qn.notNull){return this.nullability(!1,t)}required(t=Qn.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Qn.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=bs(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=pS(t).map(s=>new ds(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new Qc(i,n):Qc.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=bs({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=Qn.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=bs({message:n,name:"oneOf",skipAbsent:!0,test(i){let s=this.schema._whitelist,o=s.resolveAll(this.resolve);return o.includes(i)?!0:this.createError({params:{values:Array.from(s).join(", "),resolved:o}})}}),r}notOneOf(t,n=Qn.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=bs({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist,o=s.resolveAll(this.resolve);return o.includes(i)?this.createError({params:{values:Array.from(s).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:i,optional:s,nullable:o}=n.spec;return{meta:i,label:r,optional:s,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,d)=>d.findIndex(u=>u.name===l.name)===c)}}}lr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])lr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=WM(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])lr.prototype[e]=lr.prototype.oneOf;for(const e of["not","nope"])lr.prototype[e]=lr.prototype.notOneOf;const qM=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function GM(e){const t=zp(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function zp(e){var t,n;const r=qM.exec(e);return r?{year:pr(r[1]),month:pr(r[2],1)-1,day:pr(r[3],1),hour:pr(r[4]),minute:pr(r[5]),second:pr(r[6]),millisecond:r[7]?pr(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:pr(r[10]),minuteOffset:pr(r[11])}:null}function pr(e,t=0){return Number(e)||t}let YM=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,QM=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,KM=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,XM="^\\d{4}-\\d{2}-\\d{2}",ZM="\\d{2}:\\d{2}:\\d{2}",JM="(([+-]\\d{2}(:?\\d{2})?)|Z)",eO=new RegExp(`${XM}T${ZM}(\\.\\d+)?${JM}$`),tO=e=>Ii(e)||e===e.trim(),nO={}.toString();function Xc(){return new vS}class vS extends lr{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const i=t!=null&&t.toString?t.toString():t;return i===nO?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||Qn.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=$t.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=$t.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=$t.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||$t.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=$t.email){return this.matches(YM,{name:"email",message:t,excludeEmptyString:!0})}url(t=$t.url){return this.matches(QM,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=$t.uuid){return this.matches(KM,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,i;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:i=void 0}=t:n=t),this.matches(eO,{name:"datetime",message:n||$t.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||$t.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=zp(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||$t.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=zp(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=$t.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:tO})}lowercase(t=$t.lowercase){return this.transform(n=>Ii(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toLowerCase()})}uppercase(t=$t.uppercase){return this.transform(n=>Ii(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ii(n)||n===n.toUpperCase()})}}Xc.prototype=vS.prototype;let rO=new Date(""),iO=e=>Object.prototype.toString.call(e)==="[object Date]";class Mu extends lr{constructor(){super({type:"date",check(t){return iO(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=GM(t),isNaN(t)?Mu.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ds.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=$p.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(i){return i>=this.resolve(r)}})}max(t,n=$p.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(i){return i<=this.resolve(r)}})}}Mu.INVALID_DATE=rO;Mu.prototype;function sO(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Qi.split(o)[0];r.add(l),i.has(`${a}-${l}`)||n.push([a,l])}for(const o of Object.keys(e)){let a=e[o];r.add(o),ds.isRef(a)&&a.isSibling?s(a.path,o):Zm(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return OM.array(Array.from(r),n).reverse()}function k0(e,t){let n=1/0;return e.some((r,i)=>{var s;if((s=t.path)!=null&&s.includes(r))return n=i,!0}),n}function yS(e){return(t,n)=>k0(e,t)-k0(e,n)}const oO=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function cc(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=cc(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=cc(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(cc)}):"optional"in e?e.optional():e}const aO=(e,t)=>{const n=[...Qi.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Qi.getter(Qi.join(n),!0)(e);return!!(i&&r in i)};let S0=e=>Object.prototype.toString.call(e)==="[object Object]";function C0(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const lO=yS([]);function Jm(e){return new xS(e)}class xS extends lr{constructor(t){super({type:"object",check(n){return S0(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=lO,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault(n);if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(i).filter(u=>!this._nodes.includes(u))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),d=!1;for(const u of a){let p=s[u],h=u in i;if(p){let y,x=i[u];c.path=(n.path?`${n.path}.`:"")+u,p=p.resolve({value:x,context:n.context,parent:l});let w=p instanceof lr?p.spec:void 0,m=w==null?void 0:w.strict;if(w!=null&&w.strip){d=d||u in i;continue}y=!n.__validating||!m?p.cast(i[u],c):i[u],y!==void 0&&(l[u]=y)}else h&&!o&&(l[u]=i[u]);(h!==u in l||l[u]!==i[u])&&(d=!0)}return d?l:i}_validate(t,n={},r,i){let{from:s=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...s],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,c)=>{if(!a||!S0(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let p=this.fields[u];!p||ds.isRef(p)||d.push(p.asNestedTest({options:n,key:u,parent:c,parentPath:n.path,originalParent:o}))}this.runTests({tests:d,value:c,originalValue:o,options:n},r,u=>{i(u.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];r[i]=o===void 0?s:o}return n.withMutation(i=>i.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var i;const s=this.fields[r];let o=t;(i=o)!=null&&i.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=s&&"getDefault"in s?s.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=sO(t,n),r._sortErrors=yS(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let i=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),i=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),i)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return cc(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,i])=>t.includes(r)&&t.includes(i)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let i=Qi.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return aO(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(oO)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||lc.exact,test(n){if(n==null)return!0;const r=C0(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=lc.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=C0(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=lc.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const i of Object.keys(n))r[t(i)]=n[i];return r})}camelCase(){return this.transformKeys(Wd.camelCase)}snakeCase(){return this.transformKeys(Wd.snakeCase)}constantCase(){return this.transformKeys(t=>Wd.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[s,o]of Object.entries(n.fields)){var i;let a=t;(i=a)!=null&&i.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[s]})),r.fields[s]=o.describe(a)}return r}}Jm.prototype=xS.prototype;var cO=function(t){return uO(t)&&!dO(t)};function uO(e){return!!e&&typeof e=="object"}function dO(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||hO(e)}var fO=typeof Symbol=="function"&&Symbol.for,pO=fO?Symbol.for("react.element"):60103;function hO(e){return e.$$typeof===pO}function mO(e){return Array.isArray(e)?[]:{}}function Zc(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Wa(mO(e),e,t):e}function gO(e,t,n){return e.concat(t).map(function(r){return Zc(r,n)})}function vO(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=Zc(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=Zc(t[i],n):r[i]=Wa(e[i],t[i],n)}),r}function Wa(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||gO,n.isMergeableObject=n.isMergeableObject||cO;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):vO(e,t,n):Zc(t,n)}Wa.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Wa(r,i,n)},{})};var Vp=Wa,wS=typeof global=="object"&&global&&global.Object===Object&&global,yO=typeof self=="object"&&self&&self.Object===Object&&self,ur=wS||yO||Function("return this")(),gi=ur.Symbol,bS=Object.prototype,xO=bS.hasOwnProperty,wO=bS.toString,Uo=gi?gi.toStringTag:void 0;function bO(e){var t=xO.call(e,Uo),n=e[Uo];try{e[Uo]=void 0;var r=!0}catch{}var i=wO.call(e);return r&&(t?e[Uo]=n:delete e[Uo]),i}var kO=Object.prototype,SO=kO.toString;function CO(e){return SO.call(e)}var _O="[object Null]",TO="[object Undefined]",_0=gi?gi.toStringTag:void 0;function fs(e){return e==null?e===void 0?TO:_O:_0&&_0 in Object(e)?bO(e):CO(e)}function kS(e,t){return function(n){return e(t(n))}}var eg=kS(Object.getPrototypeOf,Object);function ps(e){return e!=null&&typeof e=="object"}var EO="[object Object]",AO=Function.prototype,jO=Object.prototype,SS=AO.toString,RO=jO.hasOwnProperty,PO=SS.call(Object);function T0(e){if(!ps(e)||fs(e)!=EO)return!1;var t=eg(e);if(t===null)return!0;var n=RO.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&SS.call(n)==PO}function MO(){this.__data__=[],this.size=0}function CS(e,t){return e===t||e!==e&&t!==t}function Ou(e,t){for(var n=e.length;n--;)if(CS(e[n][0],t))return n;return-1}var OO=Array.prototype,NO=OO.splice;function DO(e){var t=this.__data__,n=Ou(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():NO.call(t,n,1),--this.size,!0}function IO(e){var t=this.__data__,n=Ou(t,e);return n<0?void 0:t[n][1]}function LO(e){return Ou(this.__data__,e)>-1}function FO(e,t){var n=this.__data__,r=Ou(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Or.prototype.clear=MO;Or.prototype.delete=DO;Or.prototype.get=IO;Or.prototype.has=LO;Or.prototype.set=FO;function BO(){this.__data__=new Or,this.size=0}function $O(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function zO(e){return this.__data__.get(e)}function VO(e){return this.__data__.has(e)}function cl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var UO="[object AsyncFunction]",HO="[object Function]",WO="[object GeneratorFunction]",qO="[object Proxy]";function _S(e){if(!cl(e))return!1;var t=fs(e);return t==HO||t==WO||t==UO||t==qO}var qd=ur["__core-js_shared__"],E0=function(){var e=/[^.]+$/.exec(qd&&qd.keys&&qd.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function GO(e){return!!E0&&E0 in e}var YO=Function.prototype,QO=YO.toString;function hs(e){if(e!=null){try{return QO.call(e)}catch{}try{return e+""}catch{}}return""}var KO=/[\\^$.*+?()[\]{}|]/g,XO=/^\[object .+?Constructor\]$/,ZO=Function.prototype,JO=Object.prototype,eN=ZO.toString,tN=JO.hasOwnProperty,nN=RegExp("^"+eN.call(tN).replace(KO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rN(e){if(!cl(e)||GO(e))return!1;var t=_S(e)?nN:XO;return t.test(hs(e))}function iN(e,t){return e==null?void 0:e[t]}function ms(e,t){var n=iN(e,t);return rN(n)?n:void 0}var qa=ms(ur,"Map"),Ga=ms(Object,"create");function sN(){this.__data__=Ga?Ga(null):{},this.size=0}function oN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var aN="__lodash_hash_undefined__",lN=Object.prototype,cN=lN.hasOwnProperty;function uN(e){var t=this.__data__;if(Ga){var n=t[e];return n===aN?void 0:n}return cN.call(t,e)?t[e]:void 0}var dN=Object.prototype,fN=dN.hasOwnProperty;function pN(e){var t=this.__data__;return Ga?t[e]!==void 0:fN.call(t,e)}var hN="__lodash_hash_undefined__";function mN(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Ga&&t===void 0?hN:t,this}function is(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}is.prototype.clear=sN;is.prototype.delete=oN;is.prototype.get=uN;is.prototype.has=pN;is.prototype.set=mN;function gN(){this.size=0,this.__data__={hash:new is,map:new(qa||Or),string:new is}}function vN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Nu(e,t){var n=e.__data__;return vN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function yN(e){var t=Nu(this,e).delete(e);return this.size-=t?1:0,t}function xN(e){return Nu(this,e).get(e)}function wN(e){return Nu(this,e).has(e)}function bN(e,t){var n=Nu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function bi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bi.prototype.clear=gN;bi.prototype.delete=yN;bi.prototype.get=xN;bi.prototype.has=wN;bi.prototype.set=bN;var kN=200;function SN(e,t){var n=this.__data__;if(n instanceof Or){var r=n.__data__;if(!qa||r.length<kN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new bi(r)}return n.set(e,t),this.size=n.size,this}function jo(e){var t=this.__data__=new Or(e);this.size=t.size}jo.prototype.clear=BO;jo.prototype.delete=$O;jo.prototype.get=zO;jo.prototype.has=VO;jo.prototype.set=SN;function CN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var A0=function(){try{var e=ms(Object,"defineProperty");return e({},"",{}),e}catch{}}();function TS(e,t,n){t=="__proto__"&&A0?A0(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var _N=Object.prototype,TN=_N.hasOwnProperty;function ES(e,t,n){var r=e[t];(!(TN.call(e,t)&&CS(r,n))||n===void 0&&!(t in e))&&TS(e,t,n)}function Du(e,t,n,r){var i=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var a=t[s],l=void 0;l===void 0&&(l=e[a]),i?TS(n,a,l):ES(n,a,l)}return n}function EN(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var AN="[object Arguments]";function j0(e){return ps(e)&&fs(e)==AN}var AS=Object.prototype,jN=AS.hasOwnProperty,RN=AS.propertyIsEnumerable,PN=j0(function(){return arguments}())?j0:function(e){return ps(e)&&jN.call(e,"callee")&&!RN.call(e,"callee")},ul=Array.isArray;function MN(){return!1}var jS=typeof rn=="object"&&rn&&!rn.nodeType&&rn,R0=jS&&typeof sn=="object"&&sn&&!sn.nodeType&&sn,ON=R0&&R0.exports===jS,P0=ON?ur.Buffer:void 0,NN=P0?P0.isBuffer:void 0,RS=NN||MN,DN=9007199254740991,IN=/^(?:0|[1-9]\d*)$/;function LN(e,t){var n=typeof e;return t=t??DN,!!t&&(n=="number"||n!="symbol"&&IN.test(e))&&e>-1&&e%1==0&&e<t}var FN=9007199254740991;function PS(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=FN}var BN="[object Arguments]",$N="[object Array]",zN="[object Boolean]",VN="[object Date]",UN="[object Error]",HN="[object Function]",WN="[object Map]",qN="[object Number]",GN="[object Object]",YN="[object RegExp]",QN="[object Set]",KN="[object String]",XN="[object WeakMap]",ZN="[object ArrayBuffer]",JN="[object DataView]",e4="[object Float32Array]",t4="[object Float64Array]",n4="[object Int8Array]",r4="[object Int16Array]",i4="[object Int32Array]",s4="[object Uint8Array]",o4="[object Uint8ClampedArray]",a4="[object Uint16Array]",l4="[object Uint32Array]",$e={};$e[e4]=$e[t4]=$e[n4]=$e[r4]=$e[i4]=$e[s4]=$e[o4]=$e[a4]=$e[l4]=!0;$e[BN]=$e[$N]=$e[ZN]=$e[zN]=$e[JN]=$e[VN]=$e[UN]=$e[HN]=$e[WN]=$e[qN]=$e[GN]=$e[YN]=$e[QN]=$e[KN]=$e[XN]=!1;function c4(e){return ps(e)&&PS(e.length)&&!!$e[fs(e)]}function tg(e){return function(t){return e(t)}}var MS=typeof rn=="object"&&rn&&!rn.nodeType&&rn,ha=MS&&typeof sn=="object"&&sn&&!sn.nodeType&&sn,u4=ha&&ha.exports===MS,Gd=u4&&wS.process,yo=function(){try{var e=ha&&ha.require&&ha.require("util").types;return e||Gd&&Gd.binding&&Gd.binding("util")}catch{}}(),M0=yo&&yo.isTypedArray,d4=M0?tg(M0):c4,f4=Object.prototype,p4=f4.hasOwnProperty;function OS(e,t){var n=ul(e),r=!n&&PN(e),i=!n&&!r&&RS(e),s=!n&&!r&&!i&&d4(e),o=n||r||i||s,a=o?EN(e.length,String):[],l=a.length;for(var c in e)(t||p4.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||LN(c,l)))&&a.push(c);return a}var h4=Object.prototype;function ng(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||h4;return e===n}var m4=kS(Object.keys,Object),g4=Object.prototype,v4=g4.hasOwnProperty;function y4(e){if(!ng(e))return m4(e);var t=[];for(var n in Object(e))v4.call(e,n)&&n!="constructor"&&t.push(n);return t}function NS(e){return e!=null&&PS(e.length)&&!_S(e)}function rg(e){return NS(e)?OS(e):y4(e)}function x4(e,t){return e&&Du(t,rg(t),e)}function w4(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var b4=Object.prototype,k4=b4.hasOwnProperty;function S4(e){if(!cl(e))return w4(e);var t=ng(e),n=[];for(var r in e)r=="constructor"&&(t||!k4.call(e,r))||n.push(r);return n}function ig(e){return NS(e)?OS(e,!0):S4(e)}function C4(e,t){return e&&Du(t,ig(t),e)}var DS=typeof rn=="object"&&rn&&!rn.nodeType&&rn,O0=DS&&typeof sn=="object"&&sn&&!sn.nodeType&&sn,_4=O0&&O0.exports===DS,N0=_4?ur.Buffer:void 0,D0=N0?N0.allocUnsafe:void 0;function T4(e,t){if(t)return e.slice();var n=e.length,r=D0?D0(n):new e.constructor(n);return e.copy(r),r}function IS(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function E4(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s}function LS(){return[]}var A4=Object.prototype,j4=A4.propertyIsEnumerable,I0=Object.getOwnPropertySymbols,sg=I0?function(e){return e==null?[]:(e=Object(e),E4(I0(e),function(t){return j4.call(e,t)}))}:LS;function R4(e,t){return Du(e,sg(e),t)}function FS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var P4=Object.getOwnPropertySymbols,BS=P4?function(e){for(var t=[];e;)FS(t,sg(e)),e=eg(e);return t}:LS;function M4(e,t){return Du(e,BS(e),t)}function $S(e,t,n){var r=t(e);return ul(e)?r:FS(r,n(e))}function O4(e){return $S(e,rg,sg)}function N4(e){return $S(e,ig,BS)}var Up=ms(ur,"DataView"),Hp=ms(ur,"Promise"),Wp=ms(ur,"Set"),qp=ms(ur,"WeakMap"),L0="[object Map]",D4="[object Object]",F0="[object Promise]",B0="[object Set]",$0="[object WeakMap]",z0="[object DataView]",I4=hs(Up),L4=hs(qa),F4=hs(Hp),B4=hs(Wp),$4=hs(qp),yr=fs;(Up&&yr(new Up(new ArrayBuffer(1)))!=z0||qa&&yr(new qa)!=L0||Hp&&yr(Hp.resolve())!=F0||Wp&&yr(new Wp)!=B0||qp&&yr(new qp)!=$0)&&(yr=function(e){var t=fs(e),n=t==D4?e.constructor:void 0,r=n?hs(n):"";if(r)switch(r){case I4:return z0;case L4:return L0;case F4:return F0;case B4:return B0;case $4:return $0}return t});var z4=Object.prototype,V4=z4.hasOwnProperty;function U4(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&V4.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var V0=ur.Uint8Array;function og(e){var t=new e.constructor(e.byteLength);return new V0(t).set(new V0(e)),t}function H4(e,t){var n=t?og(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var W4=/\w*$/;function q4(e){var t=new e.constructor(e.source,W4.exec(e));return t.lastIndex=e.lastIndex,t}var U0=gi?gi.prototype:void 0,H0=U0?U0.valueOf:void 0;function G4(e){return H0?Object(H0.call(e)):{}}function Y4(e,t){var n=t?og(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Q4="[object Boolean]",K4="[object Date]",X4="[object Map]",Z4="[object Number]",J4="[object RegExp]",eD="[object Set]",tD="[object String]",nD="[object Symbol]",rD="[object ArrayBuffer]",iD="[object DataView]",sD="[object Float32Array]",oD="[object Float64Array]",aD="[object Int8Array]",lD="[object Int16Array]",cD="[object Int32Array]",uD="[object Uint8Array]",dD="[object Uint8ClampedArray]",fD="[object Uint16Array]",pD="[object Uint32Array]";function hD(e,t,n){var r=e.constructor;switch(t){case rD:return og(e);case Q4:case K4:return new r(+e);case iD:return H4(e,n);case sD:case oD:case aD:case lD:case cD:case uD:case dD:case fD:case pD:return Y4(e,n);case X4:return new r;case Z4:case tD:return new r(e);case J4:return q4(e);case eD:return new r;case nD:return G4(e)}}var W0=Object.create,mD=function(){function e(){}return function(t){if(!cl(t))return{};if(W0)return W0(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function gD(e){return typeof e.constructor=="function"&&!ng(e)?mD(eg(e)):{}}var vD="[object Map]";function yD(e){return ps(e)&&yr(e)==vD}var q0=yo&&yo.isMap,xD=q0?tg(q0):yD,wD="[object Set]";function bD(e){return ps(e)&&yr(e)==wD}var G0=yo&&yo.isSet,kD=G0?tg(G0):bD,SD=1,CD=2,_D=4,zS="[object Arguments]",TD="[object Array]",ED="[object Boolean]",AD="[object Date]",jD="[object Error]",VS="[object Function]",RD="[object GeneratorFunction]",PD="[object Map]",MD="[object Number]",US="[object Object]",OD="[object RegExp]",ND="[object Set]",DD="[object String]",ID="[object Symbol]",LD="[object WeakMap]",FD="[object ArrayBuffer]",BD="[object DataView]",$D="[object Float32Array]",zD="[object Float64Array]",VD="[object Int8Array]",UD="[object Int16Array]",HD="[object Int32Array]",WD="[object Uint8Array]",qD="[object Uint8ClampedArray]",GD="[object Uint16Array]",YD="[object Uint32Array]",Ie={};Ie[zS]=Ie[TD]=Ie[FD]=Ie[BD]=Ie[ED]=Ie[AD]=Ie[$D]=Ie[zD]=Ie[VD]=Ie[UD]=Ie[HD]=Ie[PD]=Ie[MD]=Ie[US]=Ie[OD]=Ie[ND]=Ie[DD]=Ie[ID]=Ie[WD]=Ie[qD]=Ie[GD]=Ie[YD]=!0;Ie[jD]=Ie[VS]=Ie[LD]=!1;function ma(e,t,n,r,i,s){var o,a=t&SD,l=t&CD,c=t&_D;if(o!==void 0)return o;if(!cl(e))return e;var d=ul(e);if(d){if(o=U4(e),!a)return IS(e,o)}else{var u=yr(e),p=u==VS||u==RD;if(RS(e))return T4(e,a);if(u==US||u==zS||p&&!i){if(o=l||p?{}:gD(e),!a)return l?M4(e,C4(o,e)):R4(e,x4(o,e))}else{if(!Ie[u])return i?e:{};o=hD(e,u,a)}}s||(s=new jo);var h=s.get(e);if(h)return h;s.set(e,o),kD(e)?e.forEach(function(w){o.add(ma(w,t,n,w,e,s))}):xD(e)&&e.forEach(function(w,m){o.set(m,ma(w,t,n,m,e,s))});var y=c?l?N4:O4:l?ig:rg,x=d?void 0:y(e);return CN(x||e,function(w,m){x&&(m=w,w=e[m]),ES(o,m,ma(w,t,n,m,e,s))}),o}var QD=1,KD=4;function $l(e){return ma(e,QD|KD)}var Y0=Array.isArray,Q0=Object.keys,XD=Object.prototype.hasOwnProperty,ZD=typeof Element<"u";function Gp(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=Y0(e),r=Y0(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!Gp(e[i],t[i]))return!1;return!0}if(n!=r)return!1;var a=e instanceof Date,l=t instanceof Date;if(a!=l)return!1;if(a&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,d=t instanceof RegExp;if(c!=d)return!1;if(c&&d)return e.toString()==t.toString();var u=Q0(e);if(s=u.length,s!==Q0(t).length)return!1;for(i=s;i--!==0;)if(!XD.call(t,u[i]))return!1;if(ZD&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!Gp(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var JD=function(t,n){try{return Gp(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const ji=Rr(JD);var eI=4;function K0(e){return ma(e,eI)}function HS(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var tI="[object Symbol]";function ag(e){return typeof e=="symbol"||ps(e)&&fs(e)==tI}var nI="Expected a function";function lg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(nI);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(lg.Cache||bi),n}lg.Cache=bi;var rI=500;function iI(e){var t=lg(e,function(r){return n.size===rI&&n.clear(),r}),n=t.cache;return t}var sI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oI=/\\(\\)?/g,aI=iI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sI,function(n,r,i,s){t.push(i?s.replace(oI,"$1"):r||n)}),t}),lI=1/0;function cI(e){if(typeof e=="string"||ag(e))return e;var t=e+"";return t=="0"&&1/e==-lI?"-0":t}var uI=1/0,X0=gi?gi.prototype:void 0,Z0=X0?X0.toString:void 0;function WS(e){if(typeof e=="string")return e;if(ul(e))return HS(e,WS)+"";if(ag(e))return Z0?Z0.call(e):"";var t=e+"";return t=="0"&&1/e==-uI?"-0":t}function dI(e){return e==null?"":WS(e)}function qS(e){return ul(e)?HS(e,cI):ag(e)?[e]:IS(aI(dI(e)))}var GS={exports:{}},Oe={};/** @license React v16.13.1
|
|
90
90
|
* react-is.production.min.js
|
|
91
91
|
*
|
|
92
92
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the MIT license found in the
|
|
95
95
|
* LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/var gt=typeof Symbol=="function"&&Symbol.for,lg=gt?Symbol.for("react.element"):60103,cg=gt?Symbol.for("react.portal"):60106,Du=gt?Symbol.for("react.fragment"):60107,Iu=gt?Symbol.for("react.strict_mode"):60108,Lu=gt?Symbol.for("react.profiler"):60114,Fu=gt?Symbol.for("react.provider"):60109,Bu=gt?Symbol.for("react.context"):60110,ug=gt?Symbol.for("react.async_mode"):60111,$u=gt?Symbol.for("react.concurrent_mode"):60111,zu=gt?Symbol.for("react.forward_ref"):60112,Vu=gt?Symbol.for("react.suspense"):60113,uI=gt?Symbol.for("react.suspense_list"):60120,Uu=gt?Symbol.for("react.memo"):60115,Hu=gt?Symbol.for("react.lazy"):60116,dI=gt?Symbol.for("react.block"):60121,fI=gt?Symbol.for("react.fundamental"):60117,pI=gt?Symbol.for("react.responder"):60118,hI=gt?Symbol.for("react.scope"):60119;function cn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case lg:switch(e=e.type,e){case ug:case $u:case Du:case Lu:case Iu:case Vu:return e;default:switch(e=e&&e.$$typeof,e){case Bu:case zu:case Hu:case Uu:case Fu:return e;default:return t}}case cg:return t}}}function qS(e){return cn(e)===$u}Me.AsyncMode=ug;Me.ConcurrentMode=$u;Me.ContextConsumer=Bu;Me.ContextProvider=Fu;Me.Element=lg;Me.ForwardRef=zu;Me.Fragment=Du;Me.Lazy=Hu;Me.Memo=Uu;Me.Portal=cg;Me.Profiler=Lu;Me.StrictMode=Iu;Me.Suspense=Vu;Me.isAsyncMode=function(e){return qS(e)||cn(e)===ug};Me.isConcurrentMode=qS;Me.isContextConsumer=function(e){return cn(e)===Bu};Me.isContextProvider=function(e){return cn(e)===Fu};Me.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===lg};Me.isForwardRef=function(e){return cn(e)===zu};Me.isFragment=function(e){return cn(e)===Du};Me.isLazy=function(e){return cn(e)===Hu};Me.isMemo=function(e){return cn(e)===Uu};Me.isPortal=function(e){return cn(e)===cg};Me.isProfiler=function(e){return cn(e)===Lu};Me.isStrictMode=function(e){return cn(e)===Iu};Me.isSuspense=function(e){return cn(e)===Vu};Me.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Du||e===$u||e===Lu||e===Iu||e===Vu||e===uI||typeof e=="object"&&e!==null&&(e.$$typeof===Hu||e.$$typeof===Uu||e.$$typeof===Fu||e.$$typeof===Bu||e.$$typeof===zu||e.$$typeof===fI||e.$$typeof===pI||e.$$typeof===hI||e.$$typeof===dI)};Me.typeOf=cn;WS.exports=Me;var mI=WS.exports,GS=mI,gI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},vI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},YS={};YS[GS.ForwardRef]=gI;YS[GS.Memo]=vI;function ft(){return ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ft.apply(this,arguments)}function QS(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Wu=v.createContext(void 0);Wu.displayName="FormikContext";Wu.Provider;Wu.Consumer;function yI(){var e=v.useContext(Wu);return e}var An=function(t){return typeof t=="function"},qu=function(t){return t!==null&&typeof t=="object"},xI=function(t){return String(Math.floor(Number(t)))===t},Gd=function(t){return Object.prototype.toString.call(t)==="[object String]"},Yd=function(t){return qu(t)&&An(t.then)};function Xt(e,t,n,r){r===void 0&&(r=0);for(var i=HS(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function Ki(e,t,n){for(var r=Q0(e),i=r,s=0,o=HS(t);s<o.length-1;s++){var a=o[s],l=Xt(e,o.slice(0,s+1));if(l&&(qu(l)||Array.isArray(l)))i=i[a]=Q0(l);else{var c=o[s+1];i=i[a]=xI(c)&&Number(c)>=0?[]:{}}}return(s===0?e:i)[o[s]]===n?e:(n===void 0?delete i[o[s]]:i[o[s]]=n,s===0&&n===void 0&&delete r[o[s]],r)}function KS(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,s=Object.keys(e);i<s.length;i++){var o=s[i],a=e[o];qu(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},KS(a,t,n,r[o])):r[o]=t}return r}function wI(e,t){switch(t.type){case"SET_VALUES":return ft({},e,{values:t.payload});case"SET_TOUCHED":return ft({},e,{touched:t.payload});case"SET_ERRORS":return Ai(e.errors,t.payload)?e:ft({},e,{errors:t.payload});case"SET_STATUS":return ft({},e,{status:t.payload});case"SET_ISSUBMITTING":return ft({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ft({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ft({},e,{values:Ki(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ft({},e,{touched:Ki(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ft({},e,{errors:Ki(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ft({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ft({},e,{touched:KS(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ft({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ft({},e,{isSubmitting:!1});default:return e}}var Ti={},$l={};function bI(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,s=e.validateOnMount,o=s===void 0?!1:s,a=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,d=e.onSubmit,u=QS(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=ft({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},u),m=v.useRef(p.initialValues),y=v.useRef(p.initialErrors||Ti),w=v.useRef(p.initialTouched||$l),x=v.useRef(p.initialStatus),h=v.useRef(!1),g=v.useRef({});v.useEffect(function(){return h.current=!0,function(){h.current=!1}},[]);var k=v.useState(0),C=k[1],S=v.useRef({values:Bl(p.initialValues),errors:Bl(p.initialErrors)||Ti,touched:Bl(p.initialTouched)||$l,status:Bl(p.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),T=S.current,j=v.useCallback(function(P){var Z=S.current;S.current=wI(Z,P),Z!==S.current&&C(function(L){return L+1})},[]),E=v.useCallback(function(P,Z){return new Promise(function(L,V){var ae=p.validate(P,Z);ae==null?L(Ti):Yd(ae)?ae.then(function(fe){L(fe||Ti)},function(fe){V(fe)}):L(ae)})},[p.validate]),A=v.useCallback(function(P,Z){var L=p.validationSchema,V=An(L)?L(Z):L,ae=Z&&V.validateAt?V.validateAt(Z,P):SI(P,V);return new Promise(function(fe,Ce){ae.then(function(){fe(Ti)},function(at){at.name==="ValidationError"?fe(kI(at)):Ce(at)})})},[p.validationSchema]),I=v.useCallback(function(P,Z){return new Promise(function(L){return L(g.current[P].validate(Z))})},[]),N=v.useCallback(function(P){var Z=Object.keys(g.current).filter(function(V){return An(g.current[V].validate)}),L=Z.length>0?Z.map(function(V){return I(V,Xt(P,V))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(L).then(function(V){return V.reduce(function(ae,fe,Ce){return fe==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||fe&&(ae=Ki(ae,Z[Ce],fe)),ae},{})})},[I]),D=v.useCallback(function(P){return Promise.all([N(P),p.validationSchema?A(P):{},p.validate?E(P):{}]).then(function(Z){var L=Z[0],V=Z[1],ae=Z[2],fe=zp.all([L,V,ae],{arrayMerge:CI});return fe})},[p.validate,p.validationSchema,N,E,A]),G=pn(function(P){return P===void 0&&(P=T.values),j({type:"SET_ISVALIDATING",payload:!0}),D(P).then(function(Z){return h.current&&(j({type:"SET_ISVALIDATING",payload:!1}),j({type:"SET_ERRORS",payload:Z})),Z})});v.useEffect(function(){o&&h.current===!0&&Ai(m.current,p.initialValues)&&G(m.current)},[o,G]);var B=v.useCallback(function(P){var Z=P&&P.values?P.values:m.current,L=P&&P.errors?P.errors:y.current?y.current:p.initialErrors||{},V=P&&P.touched?P.touched:w.current?w.current:p.initialTouched||{},ae=P&&P.status?P.status:x.current?x.current:p.initialStatus;m.current=Z,y.current=L,w.current=V,x.current=ae;var fe=function(){j({type:"RESET_FORM",payload:{isSubmitting:!!P&&!!P.isSubmitting,errors:L,touched:V,status:ae,values:Z,isValidating:!!P&&!!P.isValidating,submitCount:P&&P.submitCount&&typeof P.submitCount=="number"?P.submitCount:0}})};if(p.onReset){var Ce=p.onReset(T.values,K);Yd(Ce)?Ce.then(fe):fe()}else fe()},[p.initialErrors,p.initialStatus,p.initialTouched,p.onReset]);v.useEffect(function(){h.current===!0&&!Ai(m.current,p.initialValues)&&c&&(m.current=p.initialValues,B(),o&&G(m.current))},[c,p.initialValues,B,o,G]),v.useEffect(function(){c&&h.current===!0&&!Ai(y.current,p.initialErrors)&&(y.current=p.initialErrors||Ti,j({type:"SET_ERRORS",payload:p.initialErrors||Ti}))},[c,p.initialErrors]),v.useEffect(function(){c&&h.current===!0&&!Ai(w.current,p.initialTouched)&&(w.current=p.initialTouched||$l,j({type:"SET_TOUCHED",payload:p.initialTouched||$l}))},[c,p.initialTouched]),v.useEffect(function(){c&&h.current===!0&&!Ai(x.current,p.initialStatus)&&(x.current=p.initialStatus,j({type:"SET_STATUS",payload:p.initialStatus}))},[c,p.initialStatus,p.initialTouched]);var F=pn(function(P){if(g.current[P]&&An(g.current[P].validate)){var Z=Xt(T.values,P),L=g.current[P].validate(Z);return Yd(L)?(j({type:"SET_ISVALIDATING",payload:!0}),L.then(function(V){return V}).then(function(V){j({type:"SET_FIELD_ERROR",payload:{field:P,value:V}}),j({type:"SET_ISVALIDATING",payload:!1})})):(j({type:"SET_FIELD_ERROR",payload:{field:P,value:L}}),Promise.resolve(L))}else if(p.validationSchema)return j({type:"SET_ISVALIDATING",payload:!0}),A(T.values,P).then(function(V){return V}).then(function(V){j({type:"SET_FIELD_ERROR",payload:{field:P,value:Xt(V,P)}}),j({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),M=v.useCallback(function(P,Z){var L=Z.validate;g.current[P]={validate:L}},[]),$=v.useCallback(function(P){delete g.current[P]},[]),R=pn(function(P,Z){j({type:"SET_TOUCHED",payload:P});var L=Z===void 0?i:Z;return L?G(T.values):Promise.resolve()}),z=v.useCallback(function(P){j({type:"SET_ERRORS",payload:P})},[]),U=pn(function(P,Z){var L=An(P)?P(T.values):P;j({type:"SET_VALUES",payload:L});var V=Z===void 0?n:Z;return V?G(L):Promise.resolve()}),W=v.useCallback(function(P,Z){j({type:"SET_FIELD_ERROR",payload:{field:P,value:Z}})},[]),q=pn(function(P,Z,L){j({type:"SET_FIELD_VALUE",payload:{field:P,value:Z}});var V=L===void 0?n:L;return V?G(Ki(T.values,P,Z)):Promise.resolve()}),ne=v.useCallback(function(P,Z){var L=Z,V=P,ae;if(!Gd(P)){P.persist&&P.persist();var fe=P.target?P.target:P.currentTarget,Ce=fe.type,at=fe.name,vt=fe.id,Vn=fe.value,un=fe.checked,ys=fe.outerHTML,fr=fe.options,Nr=fe.multiple;L=Z||at||vt,V=/number|range/.test(Ce)?(ae=parseFloat(Vn),isNaN(ae)?"":ae):/checkbox/.test(Ce)?_I(Xt(T.values,L),un,Vn):fr&&Nr?TI(fr):Vn}L&&q(L,V)},[q,T.values]),oe=pn(function(P){if(Gd(P))return function(Z){return ne(Z,P)};ne(P)}),me=pn(function(P,Z,L){Z===void 0&&(Z=!0),j({type:"SET_FIELD_TOUCHED",payload:{field:P,value:Z}});var V=L===void 0?i:L;return V?G(T.values):Promise.resolve()}),ue=v.useCallback(function(P,Z){P.persist&&P.persist();var L=P.target,V=L.name,ae=L.id,fe=L.outerHTML,Ce=Z||V||ae;me(Ce,!0)},[me]),Q=pn(function(P){if(Gd(P))return function(Z){return ue(Z,P)};ue(P)}),de=v.useCallback(function(P){An(P)?j({type:"SET_FORMIK_STATE",payload:P}):j({type:"SET_FORMIK_STATE",payload:function(){return P}})},[]),H=v.useCallback(function(P){j({type:"SET_STATUS",payload:P})},[]),te=v.useCallback(function(P){j({type:"SET_ISSUBMITTING",payload:P})},[]),O=pn(function(){return j({type:"SUBMIT_ATTEMPT"}),G().then(function(P){var Z=P instanceof Error,L=!Z&&Object.keys(P).length===0;if(L){var V;try{if(V=xe(),V===void 0)return}catch(ae){throw ae}return Promise.resolve(V).then(function(ae){return h.current&&j({type:"SUBMIT_SUCCESS"}),ae}).catch(function(ae){if(h.current)throw j({type:"SUBMIT_FAILURE"}),ae})}else if(h.current&&(j({type:"SUBMIT_FAILURE"}),Z))throw P})}),ee=pn(function(P){P&&P.preventDefault&&An(P.preventDefault)&&P.preventDefault(),P&&P.stopPropagation&&An(P.stopPropagation)&&P.stopPropagation(),O().catch(function(Z){console.warn("Warning: An unhandled error was caught from submitForm()",Z)})}),K={resetForm:B,validateForm:G,validateField:F,setErrors:z,setFieldError:W,setFieldTouched:me,setFieldValue:q,setStatus:H,setSubmitting:te,setTouched:R,setValues:U,setFormikState:de,submitForm:O},xe=pn(function(){return d(T.values,K)}),ge=pn(function(P){P&&P.preventDefault&&An(P.preventDefault)&&P.preventDefault(),P&&P.stopPropagation&&An(P.stopPropagation)&&P.stopPropagation(),B()}),He=v.useCallback(function(P){return{value:Xt(T.values,P),error:Xt(T.errors,P),touched:!!Xt(T.touched,P),initialValue:Xt(m.current,P),initialTouched:!!Xt(w.current,P),initialError:Xt(y.current,P)}},[T.errors,T.touched,T.values]),ot=v.useCallback(function(P){return{setValue:function(L,V){return q(P,L,V)},setTouched:function(L,V){return me(P,L,V)},setError:function(L){return W(P,L)}}},[q,me,W]),Bt=v.useCallback(function(P){var Z=qu(P),L=Z?P.name:P,V=Xt(T.values,L),ae={name:L,value:V,onChange:oe,onBlur:Q};if(Z){var fe=P.type,Ce=P.value,at=P.as,vt=P.multiple;fe==="checkbox"?Ce===void 0?ae.checked=!!V:(ae.checked=!!(Array.isArray(V)&&~V.indexOf(Ce)),ae.value=Ce):fe==="radio"?(ae.checked=V===Ce,ae.value=Ce):at==="select"&&vt&&(ae.value=ae.value||[],ae.multiple=!0)}return ae},[Q,oe,T.values]),se=v.useMemo(function(){return!Ai(m.current,T.values)},[m.current,T.values]),ve=v.useMemo(function(){return typeof a<"u"?se?T.errors&&Object.keys(T.errors).length===0:a!==!1&&An(a)?a(p):a:T.errors&&Object.keys(T.errors).length===0},[a,se,T.errors,p]),Je=ft({},T,{initialValues:m.current,initialErrors:y.current,initialTouched:w.current,initialStatus:x.current,handleBlur:Q,handleChange:oe,handleReset:ge,handleSubmit:ee,resetForm:B,setErrors:z,setFormikState:de,setFieldTouched:me,setFieldValue:q,setFieldError:W,setStatus:H,setSubmitting:te,setTouched:R,setValues:U,submitForm:O,validateForm:G,validateField:F,isValid:ve,dirty:se,unregisterField:$,registerField:M,getFieldProps:Bt,getFieldMeta:He,getFieldHelpers:ot,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return Je}function kI(e){var t={};if(e.inner){if(e.inner.length===0)return Ki(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var s;if(n){if(r>=i.length)break;s=i[r++]}else{if(r=i.next(),r.done)break;s=r.value}var o=s;Xt(t,o.path)||(t=Ki(t,o.path,o.message))}}return t}function SI(e,t,n,r){n===void 0&&(n=!1);var i=Gp(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function Gp(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||T0(i)?Gp(i):i!==""?i:void 0}):T0(e[r])?t[r]=Gp(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function CI(e,t,n){var r=e.slice();return t.forEach(function(s,o){if(typeof r[o]>"u"){var a=n.clone!==!1,l=a&&n.isMergeableObject(s);r[o]=l?zp(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[o]=zp(e[o],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function TI(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function _I(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),i=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,s).concat(r.slice(s+1)):r}var EI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function pn(e){var t=v.useRef(e);return EI(function(){t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}var jI=v.forwardRef(function(e,t){var n=e.action,r=QS(e,["action"]),i=n??"#",s=yI(),o=s.handleReset,a=s.handleSubmit;return v.createElement("form",ft({onSubmit:a,ref:t,onReset:o,action:i},r))});jI.displayName="Form";const XS=({init:e,schema:t,action:n,validateOnBlur:r=!1})=>bI({initialValues:e,validationSchema:t,validateOnBlur:r,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:i=>{n(i)}});function dg({id:e,text:t,className:n,required:r}){const i=Se();return t?f.jsxs("label",{htmlFor:e,className:ze("mb-1 block text-sm font-medium",n),style:{color:i.getColor(b.InputText)},children:[t,r&&f.jsx("span",{className:"ml-1",style:{color:i.getColor(b.ErrorText)},children:"*"})]}):null}const Qd={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function AI({id:e,label:t,suffix:n,prefix:r,size:i="md",type:s="text",noMargin:o=!1,required:a=!1,error:l,ariaDescribedBy:c,className:d,ariaInvalid:u,ariaLabel:p,autoFocus:m,...y}){const w=Se(),x=w.getRadius(),h=l?w.getColor(b.ErrorBorder):w.getColor(b.InputBorder),g=w.getColor(b.LinkColor);return f.jsxs("div",{className:ze({"mb-2":!o},d),style:{"--focus-ring":g},children:[f.jsx(dg,{id:e,text:t,required:a}),f.jsxs("div",{className:"flex items-center",children:[r&&f.jsx("span",{className:ze("inline-block border border-solid border-r-0 rounded-l-md",Qd[i]),style:{borderColor:l?w.getColor(b.ErrorBorder):w.getColor(b.InputBorder),backgroundColor:w.getColor(b.InputBackground),borderRadius:x},children:r}),f.jsx("input",{id:e,autoFocus:m,className:ze("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",Qd[i],{"rounded-l-none":!!r,"rounded-r-none":!!n}),type:s,required:a,"aria-describedby":c,"aria-invalid":u,"aria-label":p,style:{fontSize:"16px",color:l?w.getColor(b.ErrorText):w.getColor(b.InputText),backgroundColor:w.getColor(b.InputBackground),borderColor:h,borderRadius:x,"--tw-ring-color":g},...y}),n&&f.jsx("span",{className:ze("inline-block border border-solid border-l-0 rounded-r-md",Qd[i]),style:{borderColor:l?w.getColor(b.ErrorBorder):w.getColor(b.InputBorder),backgroundColor:w.getColor(b.InputBackground),borderRadius:x},children:n})]}),!!l&&f.jsx("p",{className:"mt-1 text-xs",style:{color:w.getColor(b.ErrorText)},children:l})]})}const Z0=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},ZS=v.createContext({}),RI=()=>`${window.location.pathname}_$$_${document.title}`,PI=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},MI=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function OI({children:e}){const[t,n]=v.useState("/"),[r,i]=v.useState(MI());function s(){i([]),localStorage.removeItem("p-history")}const o=a=>{n(a),i(l=>[...new Set([...l,a])]),localStorage.setItem("page",a),localStorage.setItem("p-history",JSON.stringify(r))};return f.jsx(ZS.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function Gu(){return v.useContext(ZS)}const ma=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};function NI({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){const c=Se();return f.jsxs("div",{className:r,children:[e&&f.jsx(dg,{id:t,required:o,text:e}),f.jsxs("select",{id:t,"aria-placeholder":i,value:n,"aria-label":e,className:"block w-full rounded-lg border border-solid px-3 py-2 text-sm outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0",style:{backgroundColor:c.getColor(b.InputBackground),color:c.getColor(b.InputText),borderColor:a?c.getColor(b.ErrorBorder):c.getColor(b.InputBorder),borderRadius:c.getRadius(),"--tw-ring-color":c.getColor(b.LinkColor)},onChange:l.onChange,required:o,...l,children:[i&&f.jsx("option",{value:"",disabled:!0,children:i}),s]}),!!a&&f.jsx("p",{className:"mt-1 text-xs",style:{color:c.getColor(b.ErrorText)},children:a})]})}const J0={ring:{label:"",input:"relative before:content[''] before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-y-2/4 before:-translate-x-2/4 before:rounded-full before:bg-blue-gray-500 before:opacity-0 before:transition-opacity hover:before:opacity-10"},hover:{label:"hover:bg-secondary transition-colors duration-200 px-2 py-1 rounded-md",input:""}},DI={sm:"h-4 w-4 lg:h-3 lg:w-3",md:"h-6 w-6 lg:h-5 lg:w-5",lg:"h-8 w-8 lg:h-7 lg:w-7"},II={sm:"h-3 w-3 lg:h-2.5 lg:w-2.5",md:"h-5 w-5 lg:h-4 lg:w-4",lg:"h-7 w-7 lg:h-6 lg:w-6"};function LI({children:e,name:t,required:n,value:r,checked:i,onChange:s,onBlur:o,red:a,id:l=t,size:c="md",effect:d="ring",reversed:u=!1,error:p,...m}){const y=Se(),w=y.getColor(b.InputText),x=y.getColor(b.LinkColor),h=y.getColor(b.InputBorder),g=y.getColor(b.InputBackground),k=y.getColor(b.ErrorText);return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center justify-between gap-2 ${u?"flex-row-reverse":""} ${J0[d].label}`,children:[f.jsxs("label",{className:"disable-highlight relative flex cursor-pointer items-center rounded-md",htmlFor:l,children:[f.jsx("input",{id:l,name:t,type:"checkbox",className:`peer cursor-pointer appearance-none rounded-md border-2 border-solid transition-all ${DI[c]} ${J0[d].input}`,style:{borderColor:i?x:h,backgroundColor:i?x:g},required:n,checked:i,value:r,onChange:C=>s==null?void 0:s(C.target.checked),onBlur:C=>o==null?void 0:o(C.target.checked),...m}),f.jsx("div",{className:"pointer-events-none absolute left-2/4 top-2/4 -translate-x-1/2 -translate-y-1/2 text-white opacity-0 transition-opacity peer-checked:opacity-100",children:f.jsx(X.Check,{className:II[c]})})]}),f.jsx("label",{className:"disable-highlight flex grow cursor-pointer select-none items-center text-sm",style:{color:w},htmlFor:l,children:e})]}),(a||p)&&f.jsx("small",{className:"text-xs",style:{color:k},children:p||a})]})}function FI({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){const a=Se(),l=a.getColor(b.InputText),c=a.getColor(b.LinkColor);return f.jsxs("label",{htmlFor:e,className:ze("relative flex cursor-pointer items-center gap-2 rounded-md focus-within:outline-none",{"opacity-60 cursor-not-allowed":s},o),children:[f.jsx("input",{type:"radio",id:e,name:n,value:e,checked:t,onChange:d=>r==null?void 0:r(d.target.checked),className:"h-4 w-4 min-w-4 cursor-pointer appearance-none border-2 transition-all focus:ring-0 focus:ring-offset-0",style:{borderRadius:"50%",borderColor:t?c:a.getColor(b.InputBorder),backgroundColor:t?c:a.getColor(b.InputBackground),boxShadow:t?`inset 0 0 0 3px ${a.getColor(b.Background)}`:void 0},disabled:s}),f.jsx("span",{className:"text-sm font-medium",style:{color:l},children:i})]})}function BI({id:e,label:t,children:n,required:r,className:i,error:s}){const o=Se(),a=o.getColor(b.InputText),l=o.getColor(b.ErrorText);return f.jsxs("fieldset",{id:e,className:i,children:[t&&f.jsxs("legend",{className:"mb-1.5 block text-sm font-medium",style:{color:a},children:[t,r&&f.jsx("span",{style:{color:l,marginLeft:4},children:"*"})]}),f.jsx("div",{className:"flex flex-col gap-2",children:n}),s&&f.jsx("p",{className:"mt-1 text-xs",style:{color:l},children:s})]})}const ex=Object.assign(FI,{Group:BI});function Yu({id:e,label:t,suffix:n,prefix:r,className:i,noMargin:s,rows:o=3,type:a="text",required:l=!1,error:c,ariaInvalid:d,inputRef:u,autoFocus:p=!1,style:m,borderless:y=!1,...w}){const x=Se();return f.jsxs("div",{className:ze({"mb-2":!s},i),children:[t&&f.jsx(dg,{id:e,text:t,required:l}),f.jsx("textarea",{className:ze("resize-none max-h-36 w-full py-2 px-3 block outline-none transition-[border-color,box-shadow] duration-200 rounded-lg",{"border border-solid focus:ring-2 focus:ring-offset-0":!y,"border-none bg-transparent":y}),id:e,rows:o,"aria-invalid":d,...w,ref:u,autoFocus:p,style:{...m,fontSize:"14px",color:c?x.getColor(b.ErrorText):x.getColor(b.InputText),...!y&&{backgroundColor:x.getColor(b.InputBackground),borderColor:c?x.getColor(b.ErrorBorder):x.getColor(b.InputBorder),borderRadius:x.getRadius(),"--tw-ring-color":x.getColor(b.LinkColor)}}}),!!c&&f.jsx("p",{className:"mt-1 text-xs",style:{color:x.getColor(b.ErrorText)},children:c})]})}function xo({variant:e="block",className:t=""}){const n=Se(),r=n.getText,a=`text-[10px] flex items-center justify-center gap-1 transition-opacity hover:opacity-80 ${e==="block"?"w-full py-1.5 px-3 text-center":""} ${t}`.trim(),l=e==="block"?{color:n.getColor(b.FooterText)}:{color:n.getColor(b.FooterText)};return f.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:a,style:l,children:[f.jsx("span",{children:r(re.PoweredBy)}),f.jsx("span",{className:"font-semibold",children:"Chatier"})]})}function $I({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var T,j,E,A,I,N;const l=Se(),{defaultValues:c,widget:d,setIsHaveChat:u}=ie(),[p,m]=v.useState(!1),y=v.useRef(null);v.useEffect(()=>{const D=setTimeout(()=>{var B;const G=(B=y.current)==null?void 0:B.querySelector('input:not([type="hidden"]), select, textarea');G==null||G.focus()},150);return()=>clearTimeout(D)},[]);const w=Gu(),x=qm(),h=!!c&&"username"in c,g=(j=(T=r==null?void 0:r.body)==null?void 0:T.inputs)==null?void 0:j.reduce((D,G)=>{let B=G.remember?ma(G.name):c==null?void 0:c[G.name];return G.options&&B&&!G.options.includes(B)&&(B=void 0),G.name==="username"&&h&&(B=c.username),D[G.name]=B||"",D},{}),k=Zm((A=(E=r==null?void 0:r.body)==null?void 0:E.inputs)==null?void 0:A.reduce((D,G)=>(D[G.name]=G.required?Kc().required(`${G.label} alanı zorunludur`):Kc(),D),{})),C=XS({init:{...g},schema:k,validateOnBlur:!1,action:async D=>{var G,B;if(!(p||a)){m(!0);try{h&&(D.username=c.username),c!=null&&c.secret_data&&(D.secret_data=c.secret_data);for(const $ in D)typeof D[$]=="string"&&(D[$]=D[$].trim());if(o){for(const $ of((G=r==null?void 0:r.body)==null?void 0:G.inputs)||[])$.remember&&Z0($.name,D[$.name]);o(D);return}const[F,M]=await x.mutateAsync({inputs:D,history:w.history,client_id:t,widget_id:n,device_id:mi((d==null?void 0:d.link_id)||""),is_agent_mode:i});if($n(M)){Lp(F)&&(Ln(rt.CustomerToken,F.customer_token,(d==null?void 0:d.link_id)||""),Ln(rt.CustomerRefreshToken,F.customer_refresh_token,(d==null?void 0:d.link_id)||""),Ln(rt.DeviceId,F.device_id,(d==null?void 0:d.link_id)||"")),w.clearHistory();for(const $ of((B=r==null?void 0:r.body)==null?void 0:B.inputs)||[])$.remember&&Z0($.name,D[$.name]);u(!0),i?s==null||s():e==null||e();return}ho(F,{form:C})}catch(F){console.error("Chat creation error:",F)}finally{m(!1)}}}}),S=l.getColor(b.GreeterBackground);return f.jsxs("section",{className:"h-full overflow-y-auto px-5",style:{backgroundColor:S},children:[f.jsxs("form",{ref:y,autoComplete:"off",className:"grid grid-cols-1 gap-4",onSubmit:C.handleSubmit,children:[(N=(I=r==null?void 0:r.body)==null?void 0:I.inputs)==null?void 0:N.map((D,G)=>{var F,M;const B=G===0;if(["text","email","phone"].includes(D.type))return f.jsx(AI,{id:D.name,name:D.name,type:D.type,label:D.label,value:C.values[D.name],onChange:C.handleChange,onBlur:C.handleBlur,disabled:D.name==="username"&&h,readOnly:D.name==="username"&&h,autoComplete:"off",placeholder:D.placeholder,error:C.errors[D.name],ariaInvalid:C.errors.name?!0:void 0,required:D.required,noMargin:!0,autoFocus:B},D.name);if(D.type==="select")return f.jsx(NI,{id:D.name,name:D.name,value:C.values[D.name],onChange:C.handleChange,label:D.label,error:C.errors[D.name],required:D.required,placeholder:D.placeholder,autoFocus:B,children:(F=D.options)==null?void 0:F.map($=>f.jsx("option",{value:$,children:$},$))},D.name);if(D.type==="checkbox")return f.jsx(LI,{id:D.name,name:D.name,value:C.values[D.name],checked:C.values[D.name]==="true",onChange:C.handleChange,required:D.required,error:C.errors[D.name],children:D.label},D.name);if(D.type==="radio")return f.jsx(ex.Group,{id:D.name,label:D.label,required:D.required,error:C.errors[D.name],children:(M=D.options)==null?void 0:M.map($=>f.jsx(ex,{onChange:R=>{R?C.setFieldValue(D.name,$):C.setFieldValue(D.name,"")},id:$,name:D.name,value:$===C.values[D.name],children:$},$))},D.name);if(D.type==="textarea")return f.jsx(Yu,{id:D.name,name:D.name,value:C.values[D.name],onChange:C.handleChange,onBlur:C.handleBlur,placeholder:D.placeholder,error:C.errors[D.name],required:D.required,label:D.label,noMargin:!0,autoFocus:B},D.name)}),f.jsx(Rt,{textKey:b.GreeterButtonText,bgKey:b.GreeterButtonBackground,type:"submit",size:"lg",disabled:p||a,className:"transition-all duration-300 hover:opacity-90 transform hover:translate-y-[-1px] shadow-sm",children:p||a?f.jsxs("div",{className:"flex items-center justify-center",children:[f.jsx("span",{className:"mr-2",children:o?"Bağlanıyor":"Yükleniyor"}),f.jsx("span",{className:"animate-pulse",children:"..."})]}):o?"Canlı Desteğe Bağlan":"Sohbet Oluştur"})]}),f.jsx(xo,{variant:"block",className:"py-2"})]})}var en=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(en||{}),mn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e))(mn||{}),we=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(we||{});const gs=e=>{const t=zE(),n=(r,i)=>{var o;const s=((o=MB.find(a=>a.name===r))==null?void 0:o.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((a,[l,c])=>a.replace(`:${l}`,c),s):i?`${s}?${i}`:s};return{push:(r,i)=>{t(n(r,i),e)},path:n}};var zI={exports:{}},Kd={exports:{}},tx;function JS(){return tx||(tx=1,function(e,t){(function(n,r){e.exports=r()})(lh,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",d="week",u="month",p="quarter",m="year",y="date",w="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(B){var F=["th","st","nd","rd"],M=B%100;return"["+B+(F[(M-20)%10]||F[M]||F[0])+"]"}},k=function(B,F,M){var $=String(B);return!$||$.length>=F?B:""+Array(F+1-$.length).join(M)+B},C={s:k,z:function(B){var F=-B.utcOffset(),M=Math.abs(F),$=Math.floor(M/60),R=M%60;return(F<=0?"+":"-")+k($,2,"0")+":"+k(R,2,"0")},m:function B(F,M){if(F.date()<M.date())return-B(M,F);var $=12*(M.year()-F.year())+(M.month()-F.month()),R=F.clone().add($,u),z=M-R<0,U=F.clone().add($+(z?-1:1),u);return+(-($+(M-R)/(z?R-U:U-R))||0)},a:function(B){return B<0?Math.ceil(B)||0:Math.floor(B)},p:function(B){return{M:u,y:m,w:d,d:c,D:y,h:l,m:a,s:o,ms:s,Q:p}[B]||String(B||"").toLowerCase().replace(/s$/,"")},u:function(B){return B===void 0}},S="en",T={};T[S]=g;var j="$isDayjsObject",E=function(B){return B instanceof D||!(!B||!B[j])},A=function B(F,M,$){var R;if(!F)return S;if(typeof F=="string"){var z=F.toLowerCase();T[z]&&(R=z),M&&(T[z]=M,R=z);var U=F.split("-");if(!R&&U.length>1)return B(U[0])}else{var W=F.name;T[W]=F,R=W}return!$&&R&&(S=R),R||!$&&S},I=function(B,F){if(E(B))return B.clone();var M=typeof F=="object"?F:{};return M.date=B,M.args=arguments,new D(M)},N=C;N.l=A,N.i=E,N.w=function(B,F){return I(B,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var D=function(){function B(M){this.$L=A(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[j]=!0}var F=B.prototype;return F.parse=function(M){this.$d=function($){var R=$.date,z=$.utc;if(R===null)return new Date(NaN);if(N.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var U=R.match(x);if(U){var W=U[2]-1||0,q=(U[7]||"0").substring(0,3);return z?new Date(Date.UTC(U[1],W,U[3]||1,U[4]||0,U[5]||0,U[6]||0,q)):new Date(U[1],W,U[3]||1,U[4]||0,U[5]||0,U[6]||0,q)}}return new Date(R)}(M),this.init()},F.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},F.$utils=function(){return N},F.isValid=function(){return this.$d.toString()!==w},F.isSame=function(M,$){var R=I(M);return this.startOf($)<=R&&R<=this.endOf($)},F.isAfter=function(M,$){return I(M)<this.startOf($)},F.isBefore=function(M,$){return this.endOf($)<I(M)},F.$g=function(M,$,R){return N.u(M)?this[$]:this.set(R,M)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(M,$){var R=this,z=!!N.u($)||$,U=N.p(M),W=function(H,te){var O=N.w(R.$u?Date.UTC(R.$y,te,H):new Date(R.$y,te,H),R);return z?O:O.endOf(c)},q=function(H,te){return N.w(R.toDate()[H].apply(R.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(te)),R)},ne=this.$W,oe=this.$M,me=this.$D,ue="set"+(this.$u?"UTC":"");switch(U){case m:return z?W(1,0):W(31,11);case u:return z?W(1,oe):W(0,oe+1);case d:var Q=this.$locale().weekStart||0,de=(ne<Q?ne+7:ne)-Q;return W(z?me-de:me+(6-de),oe);case c:case y:return q(ue+"Hours",0);case l:return q(ue+"Minutes",1);case a:return q(ue+"Seconds",2);case o:return q(ue+"Milliseconds",3);default:return this.clone()}},F.endOf=function(M){return this.startOf(M,!1)},F.$set=function(M,$){var R,z=N.p(M),U="set"+(this.$u?"UTC":""),W=(R={},R[c]=U+"Date",R[y]=U+"Date",R[u]=U+"Month",R[m]=U+"FullYear",R[l]=U+"Hours",R[a]=U+"Minutes",R[o]=U+"Seconds",R[s]=U+"Milliseconds",R)[z],q=z===c?this.$D+($-this.$W):$;if(z===u||z===m){var ne=this.clone().set(y,1);ne.$d[W](q),ne.init(),this.$d=ne.set(y,Math.min(this.$D,ne.daysInMonth())).$d}else W&&this.$d[W](q);return this.init(),this},F.set=function(M,$){return this.clone().$set(M,$)},F.get=function(M){return this[N.p(M)]()},F.add=function(M,$){var R,z=this;M=Number(M);var U=N.p($),W=function(oe){var me=I(z);return N.w(me.date(me.date()+Math.round(oe*M)),z)};if(U===u)return this.set(u,this.$M+M);if(U===m)return this.set(m,this.$y+M);if(U===c)return W(1);if(U===d)return W(7);var q=(R={},R[a]=r,R[l]=i,R[o]=n,R)[U]||1,ne=this.$d.getTime()+M*q;return N.w(ne,this)},F.subtract=function(M,$){return this.add(-1*M,$)},F.format=function(M){var $=this,R=this.$locale();if(!this.isValid())return R.invalidDate||w;var z=M||"YYYY-MM-DDTHH:mm:ssZ",U=N.z(this),W=this.$H,q=this.$m,ne=this.$M,oe=R.weekdays,me=R.months,ue=R.meridiem,Q=function(te,O,ee,K){return te&&(te[O]||te($,z))||ee[O].slice(0,K)},de=function(te){return N.s(W%12||12,te,"0")},H=ue||function(te,O,ee){var K=te<12?"AM":"PM";return ee?K.toLowerCase():K};return z.replace(h,function(te,O){return O||function(ee){switch(ee){case"YY":return String($.$y).slice(-2);case"YYYY":return N.s($.$y,4,"0");case"M":return ne+1;case"MM":return N.s(ne+1,2,"0");case"MMM":return Q(R.monthsShort,ne,me,3);case"MMMM":return Q(me,ne);case"D":return $.$D;case"DD":return N.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Q(R.weekdaysMin,$.$W,oe,2);case"ddd":return Q(R.weekdaysShort,$.$W,oe,3);case"dddd":return oe[$.$W];case"H":return String(W);case"HH":return N.s(W,2,"0");case"h":return de(1);case"hh":return de(2);case"a":return H(W,q,!0);case"A":return H(W,q,!1);case"m":return String(q);case"mm":return N.s(q,2,"0");case"s":return String($.$s);case"ss":return N.s($.$s,2,"0");case"SSS":return N.s($.$ms,3,"0");case"Z":return U}return null}(te)||U.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(M,$,R){var z,U=this,W=N.p($),q=I(M),ne=(q.utcOffset()-this.utcOffset())*r,oe=this-q,me=function(){return N.m(U,q)};switch(W){case m:z=me()/12;break;case u:z=me();break;case p:z=me()/3;break;case d:z=(oe-ne)/6048e5;break;case c:z=(oe-ne)/864e5;break;case l:z=oe/i;break;case a:z=oe/r;break;case o:z=oe/n;break;default:z=oe}return R?z:N.a(z)},F.daysInMonth=function(){return this.endOf(u).$D},F.$locale=function(){return T[this.$L]},F.locale=function(M,$){if(!M)return this.$L;var R=this.clone(),z=A(M,$,!0);return z&&(R.$L=z),R},F.clone=function(){return N.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},B}(),G=D.prototype;return I.prototype=G,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",m],["$D",y]].forEach(function(B){G[B[1]]=function(F){return this.$g(F,B[0],B[1])}}),I.extend=function(B,F){return B.$i||(B(F,D,I),B.$i=!0),I},I.locale=A,I.isDayjs=E,I.unix=function(B){return I(1e3*B)},I.en=T[S],I.Ls=T,I.p={},I})}(Kd)),Kd.exports}(function(e,t){(function(n,r){e.exports=r(JS())})(lh,function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var i=r(n),s={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(o){return o+"."}};return i.default.locale(s,null,!0),s})})(zI);var eC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(lh,function(){return function(n,r,i){n=n||{};var s=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(c,d,u,p){return s.fromToBase(c,d,u,p)}i.en.relativeTime=o,s.fromToBase=function(c,d,u,p,m){for(var y,w,x,h=u.$locale().relativeTime||o,g=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],k=g.length,C=0;C<k;C+=1){var S=g[C];S.d&&(y=p?i(c).diff(u,S.d,!0):u.diff(c,S.d,!0));var T=(n.rounding||Math.round)(Math.abs(y));if(x=y>0,T<=S.r||!S.r){T<=1&&C>0&&(S=g[C-1]);var j=h[S.l];m&&(T=m(""+T)),w=typeof j=="string"?j.replace("%d",T):j(T,d,S.l,x);break}}if(d)return w;var E=x?h.future:h.past;return typeof E=="function"?E(w):E.replace("%s",w)},s.to=function(c,d){return a(c,d,this,!0)},s.from=function(c,d){return a(c,d,this)};var l=function(c){return c.$u?i.utc():i()};s.toNow=function(c){return this.to(l(this),c)},s.fromNow=function(c){return this.from(l(this),c)}}})})(eC);var VI=eC.exports;const UI=Rr(VI);var HI=JS();const Xd=Rr(HI),WI=(e="tr")=>(Xd.extend(UI),Xd.locale(e),Xd);function qI({onHasHistory:e,emptyStateText:t}){const n=ie(g=>g.widget),r=ie(g=>g.setHistoryChat),i=ie(g=>g.setHistoryMessages),s=Se(),o=gs(),[a,l]=v.useState(null),c=WI(),d=v.useRef(!1),u=n!=null&&n.link_id?mi(n.link_id):null,{data:p,isLoading:m}=uM((n==null?void 0:n.link_id)||"",u||"");if(v.useEffect(()=>{if(!m&&p){const[g,k]=p,C=$n(k)&&Array.isArray(g)&&g.length>0;if(C&&!d.current){const S=g[0];if(S.status===en.Open||S.status===en.Pending){console.log("ChatHistoryList: Auto-joining active chat",S._id),d.current=!0,r(S),i(null),o.push("chat");return}}e&&e(C)}},[m,p,e,o,r,i]),!(n!=null&&n.link_id))return null;if(m)return f.jsx("div",{className:"p-4 text-center text-xs opacity-50",children:"Yükleniyor..."});if(!p)return null;const[y,w]=p;if(!$n(w)||!Array.isArray(y))return null;const x=g=>c(g).fromNow(),h=g=>{var k;return g.who_joined_details&&Array.isArray(g.who_joined_details)&&g.who_joined_details.length>0?g.who_joined_details[0].name||"Atanmamış":g.participant_logs&&Array.isArray(g.participant_logs)&&g.participant_logs.length>0?g.participant_logs[0].name||"Atanmamış":(k=g.archive_summary)!=null&&k.admin_name?g.archive_summary.admin_name:"Atanmamış"};return y.length===0?f.jsx("div",{className:"h-full flex items-center justify-center p-6 text-center",children:f.jsxs("div",{className:"max-w-xs",children:[f.jsx("div",{className:"text-sm font-medium opacity-80",children:"Henüz sohbet yok"}),f.jsx("div",{className:"mt-2 text-xs opacity-60",children:t||"Yeni bir sohbet başlatmak için aşağıdaki butonu kullanabilirsiniz."})]})}):f.jsx("div",{className:"flex flex-col h-full",children:f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0 min-h-0",children:y.map(g=>f.jsxs("button",{type:"button",className:"w-full flex justify-between items-center gap-2 p-5 text-left transition-colors",style:{color:s.getColor(b.InputText),backgroundColor:a===g._id?s.getColor(b.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>l(g._id),onMouseLeave:()=>l(null),onClick:()=>{r(g),i(null),o.push("chat")},children:[f.jsx("span",{className:"font-medium text-sm truncate flex-1 min-w-0",children:h(g)}),f.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:s.getColor(b.FooterText)},children:x(g.created_at)})]},g._id))})})}const Zd=[Ne.Light,Ne.Dark,Ne.System];function GI(e){switch(e){case Ne.Light:return X.Sun;case Ne.Dark:return X.Moon;case Ne.System:return X.Monitor;default:return X.Monitor}}function YI(){const e=Se(),{mode:t,setMode:n}=e,r=()=>{const s=Zd.indexOf(t),o=Zd[(s+1)%Zd.length];n(o)},i=GI(t);return f.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:e.getColor(b.HeaderText)},title:t===Ne.Light?"Açık tema":t===Ne.Dark?"Koyu tema":"Sistem",children:f.jsx(i,{className:"size-5"})})}const cr=Object.create(null);cr.open="0";cr.close="1";cr.ping="2";cr.pong="3";cr.message="4";cr.upgrade="5";cr.noop="6";const cc=Object.create(null);Object.keys(cr).forEach(e=>{cc[cr[e]]=e});const Yp={type:"error",data:"parser error"},tC=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",nC=typeof ArrayBuffer=="function",rC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,fg=({type:e,data:t},n,r)=>tC&&t instanceof Blob?n?r(t):nx(t,r):nC&&(t instanceof ArrayBuffer||rC(t))?n?r(t):nx(new Blob([t]),r):r(cr[e]+(t||"")),nx=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function rx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Jd;function QI(e,t){if(tC&&e.data instanceof Blob)return e.data.arrayBuffer().then(rx).then(t);if(nC&&(e.data instanceof ArrayBuffer||rC(e.data)))return t(rx(e.data));fg(e,!1,n=>{Jd||(Jd=new TextEncoder),t(Jd.encode(n))})}const ix="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<ix.length;e++)Zo[ix.charCodeAt(e)]=e;const KI=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=Zo[e.charCodeAt(r)],o=Zo[e.charCodeAt(r+1)],a=Zo[e.charCodeAt(r+2)],l=Zo[e.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},XI=typeof ArrayBuffer=="function",pg=(e,t)=>{if(typeof e!="string")return{type:"message",data:iC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:ZI(e.substring(1),t)}:cc[n]?e.length>1?{type:cc[n],data:e.substring(1)}:{type:cc[n]}:Yp},ZI=(e,t)=>{if(XI){const n=KI(e);return iC(n,t)}else return{base64:!0,data:e}},iC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},sC="",JI=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{fg(s,!1,a=>{r[o]=a,++i===n&&t(r.join(sC))})})},eL=(e,t)=>{const n=e.split(sC),r=[];for(let i=0;i<n.length;i++){const s=pg(n[i],t);if(r.push(s),s.type==="error")break}return r};function tL(){return new TransformStream({transform(e,t){QI(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let ef;function zl(e){return e.reduce((t,n)=>t+n.length,0)}function Vl(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function nL(e,t){ef||(ef=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(zl(n)<1)break;const l=Vl(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(zl(n)<2)break;const l=Vl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(zl(n)<8)break;const l=Vl(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Yp);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(zl(n)<i)break;const l=Vl(n,i);a.enqueue(pg(s?l:ef.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Yp);break}}}})}const oC=4;function st(e){if(e)return rL(e)}function rL(e){for(var t in st.prototype)e[t]=st.prototype[t];return e}st.prototype.on=st.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};st.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};st.prototype.off=st.prototype.removeListener=st.prototype.removeAllListeners=st.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};st.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};st.prototype.emitReserved=st.prototype.emit;st.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};st.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Qu=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),wn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),iL="arraybuffer";function aC(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const sL=wn.setTimeout,oL=wn.clearTimeout;function Ku(e,t){t.useNativeTimers?(e.setTimeoutFn=sL.bind(wn),e.clearTimeoutFn=oL.bind(wn)):(e.setTimeoutFn=wn.setTimeout.bind(wn),e.clearTimeoutFn=wn.clearTimeout.bind(wn))}const aL=1.33;function lL(e){return typeof e=="string"?cL(e):Math.ceil((e.byteLength||e.size)*aL)}function cL(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function lC(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function dL(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class fL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class hg extends st{constructor(t){super(),this.writable=!1,Ku(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new fL(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=pg(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=uL(t);return n.length?"?"+n:""}}class pL extends hg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};eL(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,JI(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=lC()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let cC=!1;try{cC=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hL=cC;function mL(){}class gL extends pL{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ar extends st{constructor(t,n,r){super(),this.createRequest=t,Ku(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=aC(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ar.requestsCount++,ar.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=mL,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ar.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ar.requestsCount=0;ar.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",sx);else if(typeof addEventListener=="function"){const e="onpagehide"in wn?"pagehide":"unload";addEventListener(e,sx,!1)}}function sx(){for(let e in ar.requests)ar.requests.hasOwnProperty(e)&&ar.requests[e].abort()}const vL=function(){const e=uC({xdomain:!1});return e&&e.responseType!==null}();class yL extends gL{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=vL&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ar(uC,this.uri(),t)}}function uC(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hL))return new XMLHttpRequest}catch{}if(!t)try{return new wn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const dC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class xL extends hg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=dC?{}:aC(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;fg(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Qu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=lC()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const tf=wn.WebSocket||wn.MozWebSocket;class wL extends xL{createSocket(t,n,r){return dC?new tf(t,n,r):n?new tf(t,n):new tf(t)}doWrite(t,n){this.ws.send(n)}}class bL extends hg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=nL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=tL();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Qu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const kL={websocket:wL,webtransport:bL,polling:yL},SL=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,CL=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Qp(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=SL.exec(e||""),s={},o=14;for(;o--;)s[CL[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=TL(s,s.path),s.queryKey=_L(s,s.query),s}function TL(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function _L(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Kp=typeof addEventListener=="function"&&typeof removeEventListener=="function",uc=[];Kp&&addEventListener("offline",()=>{uc.forEach(e=>e())},!1);class ui extends st{constructor(t,n){if(super(),this.binaryType=iL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Qp(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Qp(n.host).host);Ku(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=dL(this.opts.query)),Kp&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},uc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=oC,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ui.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ui.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=lL(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Qu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ui.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Kp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=uc.indexOf(this._offlineEventListener);r!==-1&&uc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ui.protocol=oC;class EL extends ui{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ui.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ui.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=u=>{const p=new Error("probe error: "+u);p.transport=n.name,s(),this.emitReserved("upgradeError",p)};function a(){o("transport closed")}function l(){o("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let jL=class extends EL{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>kL[i]).filter(i=>!!i)),super(t,r)}};function AL(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Qp(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const RL=typeof ArrayBuffer=="function",PL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,fC=Object.prototype.toString,ML=typeof Blob=="function"||typeof Blob<"u"&&fC.call(Blob)==="[object BlobConstructor]",OL=typeof File=="function"||typeof File<"u"&&fC.call(File)==="[object FileConstructor]";function mg(e){return RL&&(e instanceof ArrayBuffer||PL(e))||ML&&e instanceof Blob||OL&&e instanceof File}function dc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(dc(e[n]))return!0;return!1}if(mg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return dc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&dc(e[n]))return!0;return!1}function NL(e){const t=[],n=e.data,r=e;return r.data=Xp(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Xp(e,t){if(!e)return e;if(mg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Xp(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Xp(e[r],t));return n}return e}function DL(e,t){return e.data=Zp(e.data,t),delete e.attachments,e}function Zp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Zp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Zp(e[n],t));return e}const IL=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],LL=5;var Ee;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ee||(Ee={}));class FL{constructor(t){this.replacer=t}encode(t){return(t.type===Ee.EVENT||t.type===Ee.ACK)&&dc(t)?this.encodeAsBinary({type:t.type===Ee.EVENT?Ee.BINARY_EVENT:Ee.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ee.BINARY_EVENT||t.type===Ee.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=NL(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function ox(e){return Object.prototype.toString.call(e)==="[object Object]"}class gg extends st{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ee.BINARY_EVENT;r||n.type===Ee.BINARY_ACK?(n.type=r?Ee.EVENT:Ee.ACK,this.reconstructor=new BL(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(mg(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ee[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ee.BINARY_EVENT||r.type===Ee.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(gg.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ee.CONNECT:return ox(n);case Ee.DISCONNECT:return n===void 0;case Ee.CONNECT_ERROR:return typeof n=="string"||ox(n);case Ee.EVENT:case Ee.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&IL.indexOf(n[0])===-1);case Ee.ACK:case Ee.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class BL{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=DL(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const $L=Object.freeze(Object.defineProperty({__proto__:null,Decoder:gg,Encoder:FL,get PacketType(){return Ee},protocol:LL},Symbol.toStringTag,{value:"Module"}));function Nn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const zL=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class pC extends st{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Nn(t,"open",this.onopen.bind(this)),Nn(t,"packet",this.onpacket.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(zL.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Ee.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ee.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(t);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(t);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Ee.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ro(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ro.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Ro.prototype.reset=function(){this.attempts=0};Ro.prototype.setMin=function(e){this.ms=e};Ro.prototype.setMax=function(e){this.max=e};Ro.prototype.setJitter=function(e){this.jitter=e};class Jp extends st{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ku(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ro({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||$L;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new jL(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Nn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Nn(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Nn(t,"ping",this.onping.bind(this)),Nn(t,"data",this.ondata.bind(this)),Nn(t,"error",this.onerror.bind(this)),Nn(t,"close",this.onclose.bind(this)),Nn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Qu(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new pC(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Uo={};function fc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=AL(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Uo[i]&&s in Uo[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Jp(r,t):(Uo[i]||(Uo[i]=new Jp(r,t)),l=Uo[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(fc,{Manager:Jp,Socket:pC,io:fc,connect:fc});const hC=v.createContext(null),dr=()=>{const e=v.useContext(hC);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},VL=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=ie(),i=v.useRef(null),s=v.useRef(!1),o=v.useRef(!1),a=v.useRef(null),[l,c]=v.useState(!1),[d,u]=v.useState(!1),p=v.useCallback(S=>{var T;console.log("WS: cleanupSocket called",{reason:S,hasSocket:!!i.current,isConnected:(T=i.current)==null?void 0:T.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",S||""),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),c(!1),u(!1),o.current=!1,s.current=!1,a.current=null},[]),m=v.useCallback((S,T,j)=>{if(a.current===S&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!T&&!j){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const E=Xo(rt.CustomerToken,S)||ma("customer_token"),A=Xo(rt.CustomerRefreshToken,S)||ma("customer_refresh_token");if(!E||!A){if(console.log("WS: Connect skipped - missing required tokens"),T){console.log("WS: Clearing stale isHaveChat flag due to missing tokens"),localStorage.removeItem("lc:widget:isHaveChat");try{ie.getState().setIsHaveChat(!1)}catch{}}return}if(i.current&&!i.current.connected&&(console.log("WS: Cleaning up disconnected/failed socket before new connection"),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),i.current&&i.current.connected){console.log("WS: Already connected, skipping new connection");return}console.log("WS: Attempting to connect...",{linkId:S,tokenPrefix:`${E==null?void 0:E.substring(0,20)}...`,refreshTokenPrefix:`${A==null?void 0:A.substring(0,20)}...`,deviceId:Xo(rt.DeviceId,S)}),o.current=!0,a.current=S;const I=fc(E_,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:E,device_id:Xo(rt.DeviceId,S)||ma("device_id"),customer_refresh_token:A}});i.current=I,I.on("error",N=>{console.error("WS: Websocket error",N),o.current=!1}),I.on("connect_error",N=>{console.error("WS: Connect error",N),o.current=!1,c(!1),u(!1),i.current===I&&(i.current=null,a.current=null);const D=(N==null?void 0:N.message)||String(N);if(D.toLowerCase().includes("unauthorized")||D.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),S&&nS(S),localStorage.removeItem("lc:widget:isHaveChat");try{ie.getState().setIsHaveChat(!1)}catch{}}}),I.on("disconnect",N=>{var G;console.log("WS: Disconnected",N),c(!1),u(!1),o.current=!1,s.current=!1,i.current===I&&(i.current=null,a.current=null);const D=ie.getState();N==="io server disconnect"&&((G=D.widget)!=null&&G.link_id)&&(D.isHaveChat||D.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{m(D.widget.link_id,D.isHaveChat,D.isAIAgentMode)},500))}),I.on("connect",()=>{console.log("WS: Connected successfully"),c(!0),o.current=!1}),I.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,u(!0)})},[]);v.useEffect(()=>{const S=t==null?void 0:t.link_id;return S&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),m(S,n,r)):!n&&!r&&(console.log("WS: Auto-disconnect due to no isHaveChat and no isAIAgentMode"),p("no active chat flags")),()=>{}},[t==null?void 0:t.link_id,n,r,m,p]),v.useEffect(()=>()=>{console.log("WS: Provider unmounting, cleaning up"),p("provider unmount")},[p]),v.useEffect(()=>{const S=()=>{console.log("WS: Page unloading, disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)},T=()=>{console.log("WS: Page hidden (pagehide), disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)};return window.addEventListener("beforeunload",S),window.addEventListener("pagehide",T),()=>{window.removeEventListener("beforeunload",S),window.removeEventListener("pagehide",T)}},[]);const y=v.useCallback(()=>{const S=t==null?void 0:t.link_id;S?m(S,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,m]),w=v.useCallback(()=>{console.log("WS: Reconnecting..."),p("manual reconnect");const S=t==null?void 0:t.link_id;S&&setTimeout(()=>{m(S,n,r)},100)},[t==null?void 0:t.link_id,n,r,m,p]),x=v.useCallback(()=>{console.log("WS: Manual disconnect"),p("manual disconnect")},[p]),h=v.useCallback((S,T)=>{var j;(j=i.current)==null||j.on(S,T)},[]),g=v.useCallback((S,T)=>{var j;(j=i.current)==null||j.off(S,T)},[]),k=v.useCallback((S,T,j)=>{i.current&&i.current.connected?i.current.emit(S,T,j):console.warn(`WS: Cannot emit event '${S}', socket not connected.`)},[]),C=v.useMemo(()=>({connectionReady:d,connected:l,connect:y,reconnect:w,disconnect:x,on:h,off:g,emit:k}),[l,d,y,w,x,h,g,k]);return f.jsx(hC.Provider,{value:C,children:e})},Zc=(e,t,n)=>{const r=typeof window<"u"?window:void 0;v.useEffect(()=>(r.addEventListener(e,t),()=>{r.removeEventListener(e,t,!1)}),[e,t,r])},Po=()=>{let e=!1,t=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true",t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent)),e||t},UL=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},Xu=()=>v.useMemo(()=>typeof window>"u"||new URLSearchParams(window.location.search).get("fullscreen")==="true"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent),[]);var Ve=(e=>(e.ChatView="chat:user:view",e.ChatClose="chat:user:close",e.MessageList="message:list",e.MessageCreate="message:create",e.MessageTyping="message:typing",e.WidgetOpen="widget:open",e.WidgetClose="widget:close",e.PageChange="page-change",e.MessageRead="message:read",e.AgentRequestHuman="agent:request:human",e.AgentMessageCreate="agent:message:create",e.ChatUpdateInputs="chat:update:inputs",e))(Ve||{}),ye=(e=>(e.Connect="connect",e.Disconnect="disconnect",e.ConnectionReady="connection:ready",e.MessageAgentCreate="message:agent:create",e.MessageUserCreate="message:user:create",e.MessageCustomerCreate="message:customer:create",e.MessageAgentTyping="message:agent:typing",e.Banned="banned",e.ChatUserClose="chat:user:close",e.ChatUserAssignee="chat:user:assignee",e.ChatToggleUpload="chat:user:upload:toggle",e.ChatUserShowButton="chat:user:show-button",e.ChatUserLeave="chat:user:leave",e.ChatUserJoin="chat:user:join",e.AgentMessageChunk="agent:message:chunk",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(ye||{});function HL(){const e=Gu(),t=v.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return Zc("popstate",t),null}function WL(){const e=dr(),t=Gu(),n=v.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(Ve.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return Zc("popstate",n),v.useEffect(()=>{if(!e)return;const r=PI(),i=RI();r!==i&&(e.emit(Ve.PageChange,{page:i}),t.setPage(i))},[e]),null}function qL(){return HL(),null}const ax=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function GL(){var me,ue,Q,de;const e=Se(),t=ie(H=>H.widget),n=ie(H=>H.setOpen),r=ie(H=>H.setAIAgent),i=ie(H=>H.setIsAIAgentMode),s=ie(H=>H.setIsHaveChat),o=ie(H=>H.isHaveChat),a=ie(H=>H.humanNeedRequested),l=ie(H=>H.setHumanNeedRequested),c=ie(H=>H.aiAgent),d=ie(H=>H.setShowActionButtons),[u,p]=v.useState(!1),[m,y]=v.useState(!1),[w,x]=v.useState(null),h=gs(),g=Po(),k=Xu(),[C,S]=v.useState(!0),[T,j]=v.useState(!1),E=Gu(),A=qm(),I=dr(),[N,D]=v.useState(null),G=v.useRef(!1),B=v.useRef(!1),F=v.useRef(!1),M=al(),$=v.useCallback(async()=>{var te,O,ee;if(!t)return;x(null),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),ie.getState().clearAIAgentState(),d(!1);const H=(((ee=(O=(te=t.appearance)==null?void 0:te.body)==null?void 0:O.inputs)==null?void 0:ee.length)||0)>0;if(N){if(F.current)return;F.current=!0;try{const[K,xe]=await A.mutateAsync({inputs:{username:"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`},history:E.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id),is_agent_mode:!0});$n(xe)&&Lp(K)?(Ln(rt.CustomerToken,K.customer_token,t.link_id),Ln(rt.CustomerRefreshToken,K.customer_refresh_token,t.link_id),Ln(rt.DeviceId,K.device_id,t.link_id),E.clearHistory(),s(!0),r(N),i(!0),h.push("chat")):(ho(K),(K==null?void 0:K.statusCode)===403&&x((K==null?void 0:K.message)||"Sohbet başlatılamadı."))}catch(K){console.error("Error creating chat for AI agent:",K)}finally{F.current=!1}return}if(!H){if(F.current)return;F.current=!0;try{const[K,xe]=await A.mutateAsync({inputs:{},history:E.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id)});$n(xe)&&Lp(K)?(Ln(rt.CustomerToken,K.customer_token,t.link_id),Ln(rt.CustomerRefreshToken,K.customer_refresh_token,t.link_id),Ln(rt.DeviceId,K.device_id,t.link_id),E.clearHistory(),s(!0),h.push("chat")):(ho(K),(K==null?void 0:K.statusCode)===403&&x((K==null?void 0:K.message)||"Sohbet başlatılamadı."))}catch(K){console.error("Error creating chat:",K)}finally{F.current=!1}return}S(!1)},[t,N,A,E,s,r,i,h,d]),R=v.useCallback(H=>{j(H)},[]);if(!t)return null;const z=()=>{n(!1)};v.useEffect(()=>{var O,ee,K;if(!t||G.current)return;G.current=!0;const H=mr(t.link_id);if(H.isAgentMode&&H.agent&&(M!=null&&M.accessToken)){if(r(H.agent),i(!0),H.sessionId&&ie.getState().setAIAgentSessionId(H.sessionId),H.humanNeedRequested){if(ie.getState().setHumanNeedRequested(!0),!((((K=(ee=(O=t.appearance)==null?void 0:O.body)==null?void 0:ee.inputs)==null?void 0:K.length)||0)>0)){h.push("chat");return}return}D(H.agent),h.push("chat");return}(async()=>{try{const[xe,ge]=await fM(t.link_id);ge===200&&xe&&xe.is_active&&D(xe)}catch(xe){console.error("Failed to check AI agent:",xe)}})()},[t,M==null?void 0:M.accessToken,M==null?void 0:M.refreshToken,h,r,i]),v.useEffect(()=>{if(u||!t||!M||!M.accessToken){B.current=!1;return}if(B.current||a)return;if(o){h.push("chat");return}const H=mr(t.link_id);H.isAgentMode&&H.agent&&!H.humanNeedRequested||(B.current=!0,iM(t.client_id,Yi(M)).then(([te,O])=>{if($n(O))a||h.push("chat");else if(O===403){const ee=mr(t.link_id);if(ee.isAgentMode&&ee.agent){if(ee.humanNeedRequested){r(ee.agent),i(!1),ee.sessionId&&ie.getState().setAIAgentSessionId(ee.sessionId),ie.getState().setHumanNeedRequested(!0);return}r(ee.agent),i(!0),ee.sessionId&&ie.getState().setAIAgentSessionId(ee.sessionId),h.push("chat")}else fa(t.link_id||""),p(!0)}else O===404?(fa(t.link_id||""),p(!0)):O===401?(nS(t.link_id||""),p(!0)):h.push("chat")}).catch(()=>h.push("chat")))},[u,h,r,i,t,M==null?void 0:M.accessToken,M==null?void 0:M.refreshToken,o,a]);const U=ax(((ue=(me=t.appearance)==null?void 0:me.head)==null?void 0:ue.elements)||[],"text"),W=ax(((de=(Q=t.appearance)==null?void 0:Q.head)==null?void 0:de.elements)||[],"title"),q=()=>{if(a&&t){let H=c;if(!H){const te=mr(t.link_id);te.agent&&(H=te.agent,r(te.agent),D(te.agent))}if(H){i(!0),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat");return}}S(!0)},ne=()=>{N&&(r(N),i(!0),ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat"))},oe=v.useCallback(H=>{if(!I||m)return;y(!0);const te=()=>{I.emit(Ve.AgentRequestHuman,{},O=>{y(!1),O!=null&&O.success&&(ie.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),ie.getState().clearAIAgentState(),h.push("chat"))})};H&&Object.keys(H).length>0?I.emit(Ve.ChatUpdateInputs,{inputs:H},O=>{O!=null&&O.success?te():y(!1)}):te()},[I,m,i,l,h]);return v.useEffect(()=>{var H,te,O;if(a){if(!c&&t){const ee=mr(t.link_id);ee.agent&&(r(ee.agent),D(ee.agent))}(c||mr((t==null?void 0:t.link_id)||"").agent)&&((((O=(te=(H=t==null?void 0:t.appearance)==null?void 0:H.body)==null?void 0:te.inputs)==null?void 0:O.length)||0)>0?S(!1):oe())}},[a,c,t,oe,r]),f.jsxs("div",{className:"h-full w-full flex flex-col relative overflow-hidden",children:[f.jsxs("header",{className:"flex items-center justify-between px-4 py-3 flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:e.getColor(b.HeaderBackground),color:e.getColor(b.HeaderText),borderColor:e.getColor(b.HeaderBorder),...g?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!C&&(T||a&&(c||t&&mr(t.link_id).agent))&&f.jsx("button",{type:"button",onClick:q,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.ArrowLeft,{className:"w-5 h-5"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-sm font-semibold truncate",children:C?"Geçmiş sohbetler":W||"Müşteri Hizmetleri"}),!C&&U&&f.jsx("div",{className:"text-xs opacity-90 truncate",children:U})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[f.jsx(YI,{}),k&&f.jsx("button",{type:"button",onClick:z,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(b.Background)},children:C?f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:f.jsx(qI,{onHasHistory:R,emptyStateText:w||void 0})}):f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx($I,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!N&&!a,onAIAgentStart:ne,onOk:()=>{a&&c||(ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),h.push("chat"))},onOperatorConnect:a&&(c||mr(t.link_id).agent)?oe:void 0,isConnectingToOperator:m})})}),C&&f.jsxs("div",{className:"flex-shrink-0",style:{backgroundColor:e.getColor(b.Background)},children:[f.jsx("div",{className:"px-5 py-2",children:f.jsxs(Rt,{onClick:$,size:"lg",className:"w-full flex items-center justify-center gap-2",children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]})}),f.jsx(xo,{variant:"block"})]})]})}function YL(){return f.jsxs(f.Fragment,{children:[f.jsx(GL,{}),f.jsx(qL,{})]})}const QL=[{path:"/",component:YL,name:"registration"}];function tt({className:e="",style:t}){const n=Se();return f.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(b.MessageAdminBackground),opacity:.6,...t}})}function KL(){const e=Se();return f.jsxs("section",{className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto",children:[f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(tt,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(tt,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(tt,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function XL(){const e=Se();return f.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(b.FooterBackground),borderRadius:e.getRadius()},children:[f.jsx("div",{className:"grow",children:f.jsx(tt,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.InputBackground)}})}),f.jsx(tt,{className:"h-12 w-12 rounded-full"})]})}function ZL(){const e=Se();return f.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(b.HeaderBackground),borderBottom:`1px solid ${e.getColor(b.HeaderBorder)}`},children:[f.jsx(tt,{className:"h-5 w-36"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(tt,{className:"h-5 w-5 rounded"}),f.jsx(tt,{className:"h-5 w-5 rounded"})]})]})}function JL(){const e=Se();return f.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(b.GreeterBackground)},children:f.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-20 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-24 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(tt,{className:"h-4 w-16 mb-1"}),f.jsx(tt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.InputBackground)}})]}),f.jsx(tt,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(b.GreeterButtonBackground),opacity:.5}})]})})}function eF(){const e=Se();return f.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(b.GreeterTopBackground)},children:[f.jsx(tt,{className:"h-7 w-40"}),f.jsx(tt,{className:"h-4 w-56"})]})}function mC(){const e=Se();return f.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(b.Background)},children:[f.jsx(ZL,{}),f.jsx(KL,{}),f.jsx(XL,{}),f.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(b.FooterBorder)}`,backgroundColor:e.getColor(b.FooterBackground)},children:[f.jsx(tt,{className:"h-3 w-20"}),f.jsx(tt,{className:"h-3.5 w-3.5 rounded"})]})]})}function eh(){const e=Se(),t=typeof window<"u"&&window.innerWidth<768;return f.jsxs("div",{className:`h-full w-full relative overflow-hidden ${t?"":"rounded-xl"}`,style:{backgroundColor:e.getColor(b.GreeterBackground)},children:[f.jsx(eF,{}),f.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:f.jsx(JL,{})})]})}const tF="/notify.mp3",vg="lc:notification_sound_muted",gC=()=>{try{return sessionStorage.getItem(vg)==="1"}catch{return!1}},vC=e=>{try{sessionStorage.setItem(vg,e?"1":"0")}catch{}},nF=async e=>{try{if(sessionStorage.getItem(vg)==="1")return}catch{}await new Audio(e||tF).play()},nf=[Ne.Light,Ne.Dark,Ne.System];function rF(e){switch(e){case Ne.Light:return X.Sun;case Ne.Dark:return X.Moon;case Ne.System:return X.Monitor;default:return X.Monitor}}function iF({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>gC()),a=v.useRef(null),l=v.useRef(null),c=Se(),d=cs(),u=dr(),{setShowActionButtons:p}=ie(),{mode:m,setMode:y}=c,w=()=>{u==null||u.emit(Ve.ChatClose,{}),p(!1),e()},x=()=>{const k=nf.indexOf(m),C=nf[(k+1)%nf.length];y(C)},h=()=>{const k=!s;vC(k),o(k)};v.useEffect(()=>{if(!r)return;const k=C=>{var S,T;(S=l.current)!=null&&S.contains(C.target)||(T=a.current)!=null&&T.contains(C.target)||i(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[r]);const g=r&&f.jsxs(Pe.div,{ref:l,onMouseDown:k=>k.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(b.Background),borderColor:c.getColor(b.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(b.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(b.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0"}),d(re.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(b.InputText)},onClick:h,children:[s?f.jsx(X.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(X.Volume2,{className:"size-4 flex-shrink-0"}),d(s?re.NotificationSoundOn:re.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(b.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(b.InputText)},onClick:x,children:[(()=>{const k=rF(m);return f.jsx(k,{className:"size-4 flex-shrink-0"})})(),m===Ne.Light?"Açık tema":m===Ne.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(jr,{children:t&&f.jsx(Pe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(b.ModalOverlayColor)},children:f.jsxs(Pe.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(b.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(b.ChatCloseConfirmText)},children:d(re.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(b.FooterText)},children:d(re.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(b.GreeterBackground),color:c.getColor(b.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(re.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(b.ErrorBackground),color:c.getColor(b.ErrorText),borderRadius:c.getRadius()},onClick:w,children:d(re.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(k=>!k),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(b.HeaderText)},title:d(re.ChatSettings),"aria-expanded":r,children:f.jsx(X.Menu,{className:"size-5"})}),f.jsx(jr,{children:g})]})]})}function sF(e){let t=e.replace(/<hr\b[^>]*>/gi,""),n;do n=t,t=t.replace(/<p\b[^>]*>(?:\s| | |�*[aA]0;|�*[aA]0;|<br\s*\/?>)*<\/p>/gi,"");while(t!==n);return t}function lx({text:e}){const n=Se().getColor(b.LinkColor),i=(s=>{const o=sF(s),a=/(https?:\/\/(?:[-\w.])+(?:\:[0-9]+)?(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?|(?:www\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?)/gi,l=o.split(/(<[^>]*>)/g);let c="",d=!1;for(let u=0;u<l.length;u++){const p=l[u];if(p.startsWith("<")&&p.endsWith(">"))if(p.match(/^<a\s/i)){if(p.includes("style="))c+=p;else{const m=p.replace(/^(<a\s[^>]*)(>)$/i,`$1 style="color: ${n}; text-decoration: underline;"$2`);c+=m}d=!0}else p.match(/^<\/a>/i)?(c+=p,d=!1):c+=p;else if(!d&&p.trim()){const m=p.replace(a,y=>{const w=y.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(w)?w:`https://${w}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${w}</a>`});c+=m}else c+=p}return c})(e);return f.jsx("div",{className:"linkified !text-sm w-full min-w-0",dangerouslySetInnerHTML:{__html:i}})}const cx="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function yC({files:e,className:t,onDelete:n,hideName:r}){const i=Po(),[s,o]=v.useState(new Map);v.useEffect(()=>{const y=new Map;for(let w=0;w<e.length;w++){const x=e[w];if(x instanceof File){const h=URL.createObjectURL(x);y.set(w,h)}}return o(y),()=>{for(const w of y.values())URL.revokeObjectURL(w)}},[e]);const a=y=>{var x;return((x=(y instanceof File?y.name:y).split(".").pop())==null?void 0:x.toLowerCase())||""},l=y=>y instanceof File?y.name:y.split("/").pop()||y,c=y=>{const[w,x]=y.split(".");return w.length>10?`${w.slice(0,10)}...${x}`:y},d=y=>{const w=["jpg","jpeg","png","gif","bmp","webp","svg"],x=a(y);return w.includes(x)},u=(y,w)=>{if(y instanceof File){const x=s.get(w);x&&window.open(x,"_blank")}else window.open(y,"_blank")},p=(y,w)=>{y.stopPropagation(),n==null||n(w)},m=(y,w)=>y instanceof File?s.get(w)||"":y;return f.jsx("div",{className:ze("flex gap-2 w-full overflow-x-auto",t),children:e.map((y,w)=>{const x=l(y),h=a(y),g=d(y),k=m(y,w);return f.jsxs("div",{onClick:()=>u(y,w),className:"min-w-20 max-w-20 cursor-pointer group/item border border-gray-200 rounded-lg p-1.5 hover:shadow-md transition-all duration-200 hover:border-gray-300 bg-white relative",children:[n&&f.jsx("button",{onClick:C=>p(C,w),className:ze("absolute top-1 right-1 w-5 h-5 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-opacity duration-200 z-10",{"opacity-0 group-hover/item:opacity-100":!i}),children:f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})}),g?f.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:f.jsx("img",{src:k,alt:x,className:"w-16 h-16 min-h-16 min-w-16 object-cover group-hover/item:scale-105 transition-transform duration-200"})}):f.jsx("div",{className:"min-w-16 aspect-square w-full mb-0.5 flex items-center justify-center bg-gray-50 rounded group-hover/item:bg-gray-100 transition-colors duration-200",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 bg-blue-100 rounded flex items-center justify-center",children:f.jsx("svg",{className:"w-3 h-3 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}),f.jsx("div",{className:ze("text-[10px] font-medium text-gray-600 uppercase",{[cx]:r}),children:h||"file"})]})}),f.jsx("div",{className:ze("max-w-16 text-[10px] text-gray-700 font-medium truncate text-ellipsis overflow-hidden",{[cx]:r}),title:x,children:c(x)})]},w)})})}const oF={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},aF={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function lF({buttons:e,className:t=""}){const n=Se();if(!e||e.length===0)return null;const r=s=>{s.startsWith("http://")||s.startsWith("https://")?window.open(s,"_blank","noopener,noreferrer"):s.startsWith("tel:")||s.startsWith("mailto:")?window.location.href=s:console.log("Custom action:",s)},i=s=>s.startsWith("http://")||s.startsWith("https://")?f.jsx(X.ExternalLink,{className:"size-4"}):s.startsWith("tel:")?f.jsx(X.Phone,{className:"size-4"}):s.startsWith("mailto:")?f.jsx(X.Mail,{className:"size-4"}):null;return f.jsx(Pe.div,{className:ze(t,"mt-2"),initial:"hidden",animate:"visible",variants:oF,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:f.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${n.getColor(b.Background)}f0`},children:f.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((s,o)=>f.jsxs(Pe.button,{variants:aF,transition:{duration:.25,ease:"easeOut"},whileHover:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:{scale:.98,transition:{duration:.1}},onClick:()=>r(s.url),className:"group inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 relative overflow-hidden cursor-pointer",style:{backgroundColor:n.getColor(b.GreeterBackground),color:n.getColor(b.GreeterText),borderRadius:n.getRadius(),border:`1px solid ${n.getColor(b.DividerColor)}`,boxShadow:`0 1px 3px ${n.getColor(b.ShadowColor)}30`},onMouseEnter:a=>{a.currentTarget.style.backgroundColor=n.getColor(b.ButtonBackground),a.currentTarget.style.color=n.getColor(b.ButtonText),a.currentTarget.style.borderColor=n.getColor(b.ButtonBackground),a.currentTarget.style.boxShadow=`0 4px 12px ${n.getColor(b.ShadowColor)}40`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=n.getColor(b.GreeterBackground),a.currentTarget.style.color=n.getColor(b.GreeterText),a.currentTarget.style.borderColor=n.getColor(b.DividerColor),a.currentTarget.style.boxShadow=`0 1px 3px ${n.getColor(b.ShadowColor)}30`},children:[f.jsxs("span",{className:"flex items-center gap-2",children:[i(s.url),f.jsx("span",{className:"font-medium",children:s.label})]}),f.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(45deg, transparent 30%, ${n.getColor(b.ButtonText)}10 50%, transparent 70%)`,borderRadius:n.getRadius()}})]},`${s.label}-${o}`))})})})}const ux=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"",dx=["Düşünüyorum...","Araştırıyorum...","Cevapları karşılaştırıyorum...","En iyi cevabı hazırlıyorum...","Bilgileri derliyorum...","Kaynakları tarıyorum...","Analiz ediyorum...","Yanıtı oluşturuyorum..."];function xC({messages:e,isTyping:t,chat:n,streamingContent:r}){var C,S,T,j;const i=v.useRef(null),s=v.useRef(null),[o,a]=v.useState(!0),l=v.useRef(!0),{widget:c,showActionButtons:d}=ie(),u=Se(),p=v.useRef(!0),m=v.useRef(new Set),[y,w]=v.useState(0);v.useEffect(()=>{e.length>0&&p.current&&requestAnimationFrame(()=>{p.current=!1})},[e]),v.useEffect(()=>{e.length===0&&m.current.clear()},[e.length]),v.useEffect(()=>{if(!t||r===void 0||r)return;const E=setInterval(()=>{w(A=>(A+1)%dx.length)},2500);return()=>clearInterval(E)},[t,r]);const x=()=>{const E=s.current;E&&(E.scrollTop=E.scrollHeight)},h=()=>{if(s.current){const{scrollTop:E,scrollHeight:A,clientHeight:I}=s.current,N=A-E<=I+10;l.current=N,a(N)}};v.useEffect(()=>{(l.current||t)&&x()},[e,t,r]);const g=(E,A)=>{if(p.current)return{initial:!1,animate:{}};const I=E.id||"";return m.current.has(I)?A===we.Customer?{initial:!1,animate:{opacity:1,x:0}}:{initial:!1,animate:{}}:(m.current.add(I),A===we.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:{initial:!1,animate:{}})},k=E=>E===we.Customer?"18px 18px 4px 18px":E===we.User||E===we.Agent?"18px 18px 18px 4px":u.getRadius();return f.jsxs("section",{onScroll:h,ref:s,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden scrollbar",children:[((S=(C=c==null?void 0:c.appearance)==null?void 0:C.design)==null?void 0:S.greeting_message)&&f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx("div",{className:"max-w-[80%] whitespace-pre-wrap border-0 px-3 py-2 !text-sm",style:{backgroundColor:u.getColor(b.MessageAdminBackground),color:u.getColor(b.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(j=(T=c==null?void 0:c.appearance)==null?void 0:T.design)==null?void 0:j.greeting_message})}),f.jsx(jr,{children:Array.isArray(e)&&e.filter(A=>{var I;return A!=null&&(!!A.content||(((I=A.files)==null?void 0:I.length)??0)>0)&&A.content!==`
|
|
97
|
-
`}).map((
|
|
96
|
+
*/var vt=typeof Symbol=="function"&&Symbol.for,cg=vt?Symbol.for("react.element"):60103,ug=vt?Symbol.for("react.portal"):60106,Iu=vt?Symbol.for("react.fragment"):60107,Lu=vt?Symbol.for("react.strict_mode"):60108,Fu=vt?Symbol.for("react.profiler"):60114,Bu=vt?Symbol.for("react.provider"):60109,$u=vt?Symbol.for("react.context"):60110,dg=vt?Symbol.for("react.async_mode"):60111,zu=vt?Symbol.for("react.concurrent_mode"):60111,Vu=vt?Symbol.for("react.forward_ref"):60112,Uu=vt?Symbol.for("react.suspense"):60113,fI=vt?Symbol.for("react.suspense_list"):60120,Hu=vt?Symbol.for("react.memo"):60115,Wu=vt?Symbol.for("react.lazy"):60116,pI=vt?Symbol.for("react.block"):60121,hI=vt?Symbol.for("react.fundamental"):60117,mI=vt?Symbol.for("react.responder"):60118,gI=vt?Symbol.for("react.scope"):60119;function un(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case cg:switch(e=e.type,e){case dg:case zu:case Iu:case Fu:case Lu:case Uu:return e;default:switch(e=e&&e.$$typeof,e){case $u:case Vu:case Wu:case Hu:case Bu:return e;default:return t}}case ug:return t}}}function YS(e){return un(e)===zu}Oe.AsyncMode=dg;Oe.ConcurrentMode=zu;Oe.ContextConsumer=$u;Oe.ContextProvider=Bu;Oe.Element=cg;Oe.ForwardRef=Vu;Oe.Fragment=Iu;Oe.Lazy=Wu;Oe.Memo=Hu;Oe.Portal=ug;Oe.Profiler=Fu;Oe.StrictMode=Lu;Oe.Suspense=Uu;Oe.isAsyncMode=function(e){return YS(e)||un(e)===dg};Oe.isConcurrentMode=YS;Oe.isContextConsumer=function(e){return un(e)===$u};Oe.isContextProvider=function(e){return un(e)===Bu};Oe.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===cg};Oe.isForwardRef=function(e){return un(e)===Vu};Oe.isFragment=function(e){return un(e)===Iu};Oe.isLazy=function(e){return un(e)===Wu};Oe.isMemo=function(e){return un(e)===Hu};Oe.isPortal=function(e){return un(e)===ug};Oe.isProfiler=function(e){return un(e)===Fu};Oe.isStrictMode=function(e){return un(e)===Lu};Oe.isSuspense=function(e){return un(e)===Uu};Oe.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Iu||e===zu||e===Fu||e===Lu||e===Uu||e===fI||typeof e=="object"&&e!==null&&(e.$$typeof===Wu||e.$$typeof===Hu||e.$$typeof===Bu||e.$$typeof===$u||e.$$typeof===Vu||e.$$typeof===hI||e.$$typeof===mI||e.$$typeof===gI||e.$$typeof===pI)};Oe.typeOf=un;GS.exports=Oe;var vI=GS.exports,QS=vI,yI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},xI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},KS={};KS[QS.ForwardRef]=yI;KS[QS.Memo]=xI;function pt(){return pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pt.apply(this,arguments)}function XS(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var qu=v.createContext(void 0);qu.displayName="FormikContext";qu.Provider;qu.Consumer;function wI(){var e=v.useContext(qu);return e}var Rn=function(t){return typeof t=="function"},Gu=function(t){return t!==null&&typeof t=="object"},bI=function(t){return String(Math.floor(Number(t)))===t},Yd=function(t){return Object.prototype.toString.call(t)==="[object String]"},Qd=function(t){return Gu(t)&&Rn(t.then)};function Xt(e,t,n,r){r===void 0&&(r=0);for(var i=qS(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function Ki(e,t,n){for(var r=K0(e),i=r,s=0,o=qS(t);s<o.length-1;s++){var a=o[s],l=Xt(e,o.slice(0,s+1));if(l&&(Gu(l)||Array.isArray(l)))i=i[a]=K0(l);else{var c=o[s+1];i=i[a]=bI(c)&&Number(c)>=0?[]:{}}}return(s===0?e:i)[o[s]]===n?e:(n===void 0?delete i[o[s]]:i[o[s]]=n,s===0&&n===void 0&&delete r[o[s]],r)}function ZS(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var i=0,s=Object.keys(e);i<s.length;i++){var o=s[i],a=e[o];Gu(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},ZS(a,t,n,r[o])):r[o]=t}return r}function kI(e,t){switch(t.type){case"SET_VALUES":return pt({},e,{values:t.payload});case"SET_TOUCHED":return pt({},e,{touched:t.payload});case"SET_ERRORS":return ji(e.errors,t.payload)?e:pt({},e,{errors:t.payload});case"SET_STATUS":return pt({},e,{status:t.payload});case"SET_ISSUBMITTING":return pt({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return pt({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return pt({},e,{values:Ki(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return pt({},e,{touched:Ki(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return pt({},e,{errors:Ki(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return pt({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return pt({},e,{touched:ZS(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return pt({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return pt({},e,{isSubmitting:!1});default:return e}}var _i={},zl={};function SI(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,i=r===void 0?!0:r,s=e.validateOnMount,o=s===void 0?!1:s,a=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,d=e.onSubmit,u=XS(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=pt({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},u),h=v.useRef(p.initialValues),y=v.useRef(p.initialErrors||_i),x=v.useRef(p.initialTouched||zl),w=v.useRef(p.initialStatus),m=v.useRef(!1),g=v.useRef({});v.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var b=v.useState(0),C=b[1],S=v.useRef({values:$l(p.initialValues),errors:$l(p.initialErrors)||_i,touched:$l(p.initialTouched)||zl,status:$l(p.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),_=S.current,j=v.useCallback(function(R){var K=S.current;S.current=kI(K,R),K!==S.current&&C(function(I){return I+1})},[]),A=v.useCallback(function(R,K){return new Promise(function(I,H){var te=p.validate(R,K);te==null?I(_i):Qd(te)?te.then(function(de){I(de||_i)},function(de){H(de)}):I(te)})},[p.validate]),E=v.useCallback(function(R,K){var I=p.validationSchema,H=Rn(I)?I(K):I,te=K&&H.validateAt?H.validateAt(K,R):_I(R,H);return new Promise(function(de,xe){te.then(function(){de(_i)},function(Ue){Ue.name==="ValidationError"?de(CI(Ue)):xe(Ue)})})},[p.validationSchema]),L=v.useCallback(function(R,K){return new Promise(function(I){return I(g.current[R].validate(K))})},[]),F=v.useCallback(function(R){var K=Object.keys(g.current).filter(function(H){return Rn(g.current[H].validate)}),I=K.length>0?K.map(function(H){return L(H,Xt(R,H))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(I).then(function(H){return H.reduce(function(te,de,xe){return de==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||de&&(te=Ki(te,K[xe],de)),te},{})})},[L]),D=v.useCallback(function(R){return Promise.all([F(R),p.validationSchema?E(R):{},p.validate?A(R):{}]).then(function(K){var I=K[0],H=K[1],te=K[2],de=Vp.all([I,H,te],{arrayMerge:TI});return de})},[p.validate,p.validationSchema,F,A,E]),G=hn(function(R){return R===void 0&&(R=_.values),j({type:"SET_ISVALIDATING",payload:!0}),D(R).then(function(K){return m.current&&(j({type:"SET_ISVALIDATING",payload:!1}),j({type:"SET_ERRORS",payload:K})),K})});v.useEffect(function(){o&&m.current===!0&&ji(h.current,p.initialValues)&&G(h.current)},[o,G]);var z=v.useCallback(function(R){var K=R&&R.values?R.values:h.current,I=R&&R.errors?R.errors:y.current?y.current:p.initialErrors||{},H=R&&R.touched?R.touched:x.current?x.current:p.initialTouched||{},te=R&&R.status?R.status:w.current?w.current:p.initialStatus;h.current=K,y.current=I,x.current=H,w.current=te;var de=function(){j({type:"RESET_FORM",payload:{isSubmitting:!!R&&!!R.isSubmitting,errors:I,touched:H,status:te,values:K,isValidating:!!R&&!!R.isValidating,submitCount:R&&R.submitCount&&typeof R.submitCount=="number"?R.submitCount:0}})};if(p.onReset){var xe=p.onReset(_.values,O);Qd(xe)?xe.then(de):de()}else de()},[p.initialErrors,p.initialStatus,p.initialTouched,p.onReset]);v.useEffect(function(){m.current===!0&&!ji(h.current,p.initialValues)&&c&&(h.current=p.initialValues,z(),o&&G(h.current))},[c,p.initialValues,z,o,G]),v.useEffect(function(){c&&m.current===!0&&!ji(y.current,p.initialErrors)&&(y.current=p.initialErrors||_i,j({type:"SET_ERRORS",payload:p.initialErrors||_i}))},[c,p.initialErrors]),v.useEffect(function(){c&&m.current===!0&&!ji(x.current,p.initialTouched)&&(x.current=p.initialTouched||zl,j({type:"SET_TOUCHED",payload:p.initialTouched||zl}))},[c,p.initialTouched]),v.useEffect(function(){c&&m.current===!0&&!ji(w.current,p.initialStatus)&&(w.current=p.initialStatus,j({type:"SET_STATUS",payload:p.initialStatus}))},[c,p.initialStatus,p.initialTouched]);var $=hn(function(R){if(g.current[R]&&Rn(g.current[R].validate)){var K=Xt(_.values,R),I=g.current[R].validate(K);return Qd(I)?(j({type:"SET_ISVALIDATING",payload:!0}),I.then(function(H){return H}).then(function(H){j({type:"SET_FIELD_ERROR",payload:{field:R,value:H}}),j({type:"SET_ISVALIDATING",payload:!1})})):(j({type:"SET_FIELD_ERROR",payload:{field:R,value:I}}),Promise.resolve(I))}else if(p.validationSchema)return j({type:"SET_ISVALIDATING",payload:!0}),E(_.values,R).then(function(H){return H}).then(function(H){j({type:"SET_FIELD_ERROR",payload:{field:R,value:Xt(H,R)}}),j({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),N=v.useCallback(function(R,K){var I=K.validate;g.current[R]={validate:I}},[]),M=v.useCallback(function(R){delete g.current[R]},[]),P=hn(function(R,K){j({type:"SET_TOUCHED",payload:R});var I=K===void 0?i:K;return I?G(_.values):Promise.resolve()}),B=v.useCallback(function(R){j({type:"SET_ERRORS",payload:R})},[]),U=hn(function(R,K){var I=Rn(R)?R(_.values):R;j({type:"SET_VALUES",payload:I});var H=K===void 0?n:K;return H?G(I):Promise.resolve()}),W=v.useCallback(function(R,K){j({type:"SET_FIELD_ERROR",payload:{field:R,value:K}})},[]),q=hn(function(R,K,I){j({type:"SET_FIELD_VALUE",payload:{field:R,value:K}});var H=I===void 0?n:I;return H?G(Ki(_.values,R,K)):Promise.resolve()}),se=v.useCallback(function(R,K){var I=K,H=R,te;if(!Yd(R)){R.persist&&R.persist();var de=R.target?R.target:R.currentTarget,xe=de.type,Ue=de.name,lt=de.id,Un=de.value,dn=de.checked,ys=de.outerHTML,fr=de.options,Nr=de.multiple;I=K||Ue||lt,H=/number|range/.test(xe)?(te=parseFloat(Un),isNaN(te)?"":te):/checkbox/.test(xe)?AI(Xt(_.values,I),dn,Un):fr&&Nr?EI(fr):Un}I&&q(I,H)},[q,_.values]),ie=hn(function(R){if(Yd(R))return function(K){return se(K,R)};se(R)}),pe=hn(function(R,K,I){K===void 0&&(K=!0),j({type:"SET_FIELD_TOUCHED",payload:{field:R,value:K}});var H=I===void 0?i:I;return H?G(_.values):Promise.resolve()}),ce=v.useCallback(function(R,K){R.persist&&R.persist();var I=R.target,H=I.name,te=I.id,de=I.outerHTML,xe=K||H||te;pe(xe,!0)},[pe]),_e=hn(function(R){if(Yd(R))return function(K){return ce(K,R)};ce(R)}),Re=v.useCallback(function(R){Rn(R)?j({type:"SET_FORMIK_STATE",payload:R}):j({type:"SET_FORMIK_STATE",payload:function(){return R}})},[]),Y=v.useCallback(function(R){j({type:"SET_STATUS",payload:R})},[]),V=v.useCallback(function(R){j({type:"SET_ISSUBMITTING",payload:R})},[]),Z=hn(function(){return j({type:"SUBMIT_ATTEMPT"}),G().then(function(R){var K=R instanceof Error,I=!K&&Object.keys(R).length===0;if(I){var H;try{if(H=ae(),H===void 0)return}catch(te){throw te}return Promise.resolve(H).then(function(te){return m.current&&j({type:"SUBMIT_SUCCESS"}),te}).catch(function(te){if(m.current)throw j({type:"SUBMIT_FAILURE"}),te})}else if(m.current&&(j({type:"SUBMIT_FAILURE"}),K))throw R})}),ue=hn(function(R){R&&R.preventDefault&&Rn(R.preventDefault)&&R.preventDefault(),R&&R.stopPropagation&&Rn(R.stopPropagation)&&R.stopPropagation(),Z().catch(function(K){console.warn("Warning: An unhandled error was caught from submitForm()",K)})}),O={resetForm:z,validateForm:G,validateField:$,setErrors:B,setFieldError:W,setFieldTouched:pe,setFieldValue:q,setStatus:Y,setSubmitting:V,setTouched:P,setValues:U,setFormikState:Re,submitForm:Z},ae=hn(function(){return d(_.values,O)}),ee=hn(function(R){R&&R.preventDefault&&Rn(R.preventDefault)&&R.preventDefault(),R&&R.stopPropagation&&Rn(R.stopPropagation)&&R.stopPropagation(),z()}),ke=v.useCallback(function(R){return{value:Xt(_.values,R),error:Xt(_.errors,R),touched:!!Xt(_.touched,R),initialValue:Xt(h.current,R),initialTouched:!!Xt(x.current,R),initialError:Xt(y.current,R)}},[_.errors,_.touched,_.values]),he=v.useCallback(function(R){return{setValue:function(I,H){return q(R,I,H)},setTouched:function(I,H){return pe(R,I,H)},setError:function(I){return W(R,I)}}},[q,pe,W]),Ze=v.useCallback(function(R){var K=Gu(R),I=K?R.name:R,H=Xt(_.values,I),te={name:I,value:H,onChange:ie,onBlur:_e};if(K){var de=R.type,xe=R.value,Ue=R.as,lt=R.multiple;de==="checkbox"?xe===void 0?te.checked=!!H:(te.checked=!!(Array.isArray(H)&&~H.indexOf(xe)),te.value=xe):de==="radio"?(te.checked=H===xe,te.value=xe):Ue==="select"&<&&(te.value=te.value||[],te.multiple=!0)}return te},[_e,ie,_.values]),qe=v.useMemo(function(){return!ji(h.current,_.values)},[h.current,_.values]),Bt=v.useMemo(function(){return typeof a<"u"?qe?_.errors&&Object.keys(_.errors).length===0:a!==!1&&Rn(a)?a(p):a:_.errors&&Object.keys(_.errors).length===0},[a,qe,_.errors,p]),fe=pt({},_,{initialValues:h.current,initialErrors:y.current,initialTouched:x.current,initialStatus:w.current,handleBlur:_e,handleChange:ie,handleReset:ee,handleSubmit:ue,resetForm:z,setErrors:B,setFormikState:Re,setFieldTouched:pe,setFieldValue:q,setFieldError:W,setStatus:Y,setSubmitting:V,setTouched:P,setValues:U,submitForm:Z,validateForm:G,validateField:$,isValid:Bt,dirty:qe,unregisterField:M,registerField:N,getFieldProps:Ze,getFieldMeta:ke,getFieldHelpers:he,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return fe}function CI(e){var t={};if(e.inner){if(e.inner.length===0)return Ki(t,e.path,e.message);for(var i=e.inner,n=Array.isArray(i),r=0,i=n?i:i[Symbol.iterator]();;){var s;if(n){if(r>=i.length)break;s=i[r++]}else{if(r=i.next(),r.done)break;s=r.value}var o=s;Xt(t,o.path)||(t=Ki(t,o.path,o.message))}}return t}function _I(e,t,n,r){n===void 0&&(n=!1);var i=Yp(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function Yp(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(i){return Array.isArray(i)===!0||T0(i)?Yp(i):i!==""?i:void 0}):T0(e[r])?t[r]=Yp(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function TI(e,t,n){var r=e.slice();return t.forEach(function(s,o){if(typeof r[o]>"u"){var a=n.clone!==!1,l=a&&n.isMergeableObject(s);r[o]=l?Vp(Array.isArray(s)?[]:{},s,n):s}else n.isMergeableObject(s)?r[o]=Vp(e[o],s,n):e.indexOf(s)===-1&&r.push(s)}),r}function EI(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function AI(e,t,n){if(typeof e=="boolean")return!!t;var r=[],i=!1,s=-1;if(Array.isArray(e))r=e,s=e.indexOf(n),i=s>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!i?r.concat(n):i?r.slice(0,s).concat(r.slice(s+1)):r}var jI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function hn(e){var t=v.useRef(e);return jI(function(){t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current.apply(void 0,r)},[])}var RI=v.forwardRef(function(e,t){var n=e.action,r=XS(e,["action"]),i=n??"#",s=wI(),o=s.handleReset,a=s.handleSubmit;return v.createElement("form",pt({onSubmit:a,ref:t,onReset:o,action:i},r))});RI.displayName="Form";const JS=({init:e,schema:t,action:n,validateOnBlur:r=!1})=>SI({initialValues:e,validationSchema:t,validateOnBlur:r,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:i=>{n(i)}});function fg({id:e,text:t,className:n,required:r}){const i=Se();return t?f.jsxs("label",{htmlFor:e,className:Ve("mb-1 block text-sm font-medium",n),style:{color:i.getColor(k.InputText)},children:[t,r&&f.jsx("span",{className:"ml-1",style:{color:i.getColor(k.ErrorText)},children:"*"})]}):null}const Kd={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function PI({id:e,label:t,suffix:n,prefix:r,size:i="md",type:s="text",noMargin:o=!1,required:a=!1,error:l,ariaDescribedBy:c,className:d,ariaInvalid:u,ariaLabel:p,autoFocus:h,...y}){const x=Se(),w=x.getRadius(),m=l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),g=x.getColor(k.LinkColor);return f.jsxs("div",{className:Ve({"mb-2":!o},d),style:{"--focus-ring":g},children:[f.jsx(fg,{id:e,text:t,required:a}),f.jsxs("div",{className:"flex items-center",children:[r&&f.jsx("span",{className:Ve("inline-block border border-solid border-r-0 rounded-l-md",Kd[i]),style:{borderColor:l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),backgroundColor:x.getColor(k.InputBackground),borderRadius:w},children:r}),f.jsx("input",{id:e,autoFocus:h,className:Ve("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",Kd[i],{"rounded-l-none":!!r,"rounded-r-none":!!n}),type:s,required:a,"aria-describedby":c,"aria-invalid":u,"aria-label":p,style:{fontSize:"16px",color:l?x.getColor(k.ErrorText):x.getColor(k.InputText),backgroundColor:x.getColor(k.InputBackground),borderColor:m,borderRadius:w,"--tw-ring-color":g},...y}),n&&f.jsx("span",{className:Ve("inline-block border border-solid border-l-0 rounded-r-md",Kd[i]),style:{borderColor:l?x.getColor(k.ErrorBorder):x.getColor(k.InputBorder),backgroundColor:x.getColor(k.InputBackground),borderRadius:w},children:n})]}),!!l&&f.jsx("p",{className:"mt-1 text-xs",style:{color:x.getColor(k.ErrorText)},children:l})]})}const J0=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},eC=v.createContext({}),MI=()=>`${window.location.pathname}_$$_${document.title}`,OI=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},NI=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function DI({children:e}){const[t,n]=v.useState("/"),[r,i]=v.useState(NI());function s(){i([]),localStorage.removeItem("p-history")}const o=a=>{n(a),i(l=>[...new Set([...l,a])]),localStorage.setItem("page",a),localStorage.setItem("p-history",JSON.stringify(r))};return f.jsx(eC.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function Yu(){return v.useContext(eC)}const ga=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null};function II({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){const c=Se();return f.jsxs("div",{className:r,children:[e&&f.jsx(fg,{id:t,required:o,text:e}),f.jsxs("select",{id:t,"aria-placeholder":i,value:n,"aria-label":e,className:"block w-full rounded-lg border border-solid px-3 py-2 text-sm outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0",style:{backgroundColor:c.getColor(k.InputBackground),color:c.getColor(k.InputText),borderColor:a?c.getColor(k.ErrorBorder):c.getColor(k.InputBorder),borderRadius:c.getRadius(),"--tw-ring-color":c.getColor(k.LinkColor)},onChange:l.onChange,required:o,...l,children:[i&&f.jsx("option",{value:"",disabled:!0,children:i}),s]}),!!a&&f.jsx("p",{className:"mt-1 text-xs",style:{color:c.getColor(k.ErrorText)},children:a})]})}const ex={ring:{label:"",input:"relative before:content[''] before:absolute before:top-2/4 before:left-2/4 before:block before:h-12 before:w-12 before:-translate-y-2/4 before:-translate-x-2/4 before:rounded-full before:bg-blue-gray-500 before:opacity-0 before:transition-opacity hover:before:opacity-10"},hover:{label:"hover:bg-secondary transition-colors duration-200 px-2 py-1 rounded-md",input:""}},LI={sm:"h-4 w-4 lg:h-3 lg:w-3",md:"h-6 w-6 lg:h-5 lg:w-5",lg:"h-8 w-8 lg:h-7 lg:w-7"},FI={sm:"h-3 w-3 lg:h-2.5 lg:w-2.5",md:"h-5 w-5 lg:h-4 lg:w-4",lg:"h-7 w-7 lg:h-6 lg:w-6"};function BI({children:e,name:t,required:n,value:r,checked:i,onChange:s,onBlur:o,red:a,id:l=t,size:c="md",effect:d="ring",reversed:u=!1,error:p,...h}){const y=Se(),x=y.getColor(k.InputText),w=y.getColor(k.LinkColor),m=y.getColor(k.InputBorder),g=y.getColor(k.InputBackground),b=y.getColor(k.ErrorText);return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center justify-between gap-2 ${u?"flex-row-reverse":""} ${ex[d].label}`,children:[f.jsxs("label",{className:"disable-highlight relative flex cursor-pointer items-center rounded-md",htmlFor:l,children:[f.jsx("input",{id:l,name:t,type:"checkbox",className:`peer cursor-pointer appearance-none rounded-md border-2 border-solid transition-all ${LI[c]} ${ex[d].input}`,style:{borderColor:i?w:m,backgroundColor:i?w:g},required:n,checked:i,value:r,onChange:C=>s==null?void 0:s(C.target.checked),onBlur:C=>o==null?void 0:o(C.target.checked),...h}),f.jsx("div",{className:"pointer-events-none absolute left-2/4 top-2/4 -translate-x-1/2 -translate-y-1/2 text-white opacity-0 transition-opacity peer-checked:opacity-100",children:f.jsx(X.Check,{className:FI[c]})})]}),f.jsx("label",{className:"disable-highlight flex grow cursor-pointer select-none items-center text-sm",style:{color:x},htmlFor:l,children:e})]}),(a||p)&&f.jsx("small",{className:"text-xs",style:{color:b},children:p||a})]})}function $I({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){const a=Se(),l=a.getColor(k.InputText),c=a.getColor(k.LinkColor);return f.jsxs("label",{htmlFor:e,className:Ve("relative flex cursor-pointer items-center gap-2 rounded-md focus-within:outline-none",{"opacity-60 cursor-not-allowed":s},o),children:[f.jsx("input",{type:"radio",id:e,name:n,value:e,checked:t,onChange:d=>r==null?void 0:r(d.target.checked),className:"h-4 w-4 min-w-4 cursor-pointer appearance-none border-2 transition-all focus:ring-0 focus:ring-offset-0",style:{borderRadius:"50%",borderColor:t?c:a.getColor(k.InputBorder),backgroundColor:t?c:a.getColor(k.InputBackground),boxShadow:t?`inset 0 0 0 3px ${a.getColor(k.Background)}`:void 0},disabled:s}),f.jsx("span",{className:"text-sm font-medium",style:{color:l},children:i})]})}function zI({id:e,label:t,children:n,required:r,className:i,error:s}){const o=Se(),a=o.getColor(k.InputText),l=o.getColor(k.ErrorText);return f.jsxs("fieldset",{id:e,className:i,children:[t&&f.jsxs("legend",{className:"mb-1.5 block text-sm font-medium",style:{color:a},children:[t,r&&f.jsx("span",{style:{color:l,marginLeft:4},children:"*"})]}),f.jsx("div",{className:"flex flex-col gap-2",children:n}),s&&f.jsx("p",{className:"mt-1 text-xs",style:{color:l},children:s})]})}const tx=Object.assign($I,{Group:zI});function Qu({id:e,label:t,suffix:n,prefix:r,className:i,noMargin:s,rows:o=3,type:a="text",required:l=!1,error:c,ariaInvalid:d,inputRef:u,autoFocus:p=!1,style:h,borderless:y=!1,...x}){const w=Se();return f.jsxs("div",{className:Ve({"mb-2":!s},i),children:[t&&f.jsx(fg,{id:e,text:t,required:l}),f.jsx("textarea",{className:Ve("resize-none max-h-36 w-full py-2 px-3 block outline-none transition-[border-color,box-shadow] duration-200 rounded-lg",{"border border-solid focus:ring-2 focus:ring-offset-0":!y,"border-none bg-transparent":y}),id:e,rows:o,"aria-invalid":d,...x,ref:u,autoFocus:p,style:{...h,fontSize:"14px",color:c?w.getColor(k.ErrorText):w.getColor(k.InputText),...!y&&{backgroundColor:w.getColor(k.InputBackground),borderColor:c?w.getColor(k.ErrorBorder):w.getColor(k.InputBorder),borderRadius:w.getRadius(),"--tw-ring-color":w.getColor(k.LinkColor)}}}),!!c&&f.jsx("p",{className:"mt-1 text-xs",style:{color:w.getColor(k.ErrorText)},children:c})]})}function xo({variant:e="block",className:t=""}){const n=Se(),r=n.getText,a=`text-[10px] flex items-center justify-center gap-1 transition-opacity hover:opacity-80 ${e==="block"?"w-full py-1.5 px-3 text-center":""} ${t}`.trim(),l=e==="block"?{color:n.getColor(k.FooterText)}:{color:n.getColor(k.FooterText)};return f.jsxs("a",{href:"https://www.chatier.app",target:"_blank",rel:"noopener noreferrer",className:a,style:l,children:[f.jsx("span",{children:r(ne.PoweredBy)}),f.jsx("span",{className:"font-semibold",children:"Chatier"})]})}function VI({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var _,j,A,E,L,F;const l=Se(),{defaultValues:c,widget:d,setIsHaveChat:u}=re(),[p,h]=v.useState(!1),y=v.useRef(null);v.useEffect(()=>{const D=setTimeout(()=>{var z;const G=(z=y.current)==null?void 0:z.querySelector('input:not([type="hidden"]), select, textarea');G==null||G.focus()},150);return()=>clearTimeout(D)},[]);const x=Yu(),w=Gm(),m=!!c&&"username"in c,g=(j=(_=r==null?void 0:r.body)==null?void 0:_.inputs)==null?void 0:j.reduce((D,G)=>{let z=G.remember?ga(G.name):c==null?void 0:c[G.name];return G.options&&z&&!G.options.includes(z)&&(z=void 0),G.name==="username"&&m&&(z=c.username),D[G.name]=z||"",D},{}),b=Jm((E=(A=r==null?void 0:r.body)==null?void 0:A.inputs)==null?void 0:E.reduce((D,G)=>(D[G.name]=G.required?Xc().required(`${G.label} alanı zorunludur`):Xc(),D),{})),C=JS({init:{...g},schema:b,validateOnBlur:!1,action:async D=>{var G,z;if(!(p||a)){h(!0);try{m&&(D.username=c.username),c!=null&&c.secret_data&&(D.secret_data=c.secret_data);for(const M in D)typeof D[M]=="string"&&(D[M]=D[M].trim());if(o){for(const M of((G=r==null?void 0:r.body)==null?void 0:G.inputs)||[])M.remember&&J0(M.name,D[M.name]);o(D);return}const[$,N]=await w.mutateAsync({inputs:D,history:x.history,client_id:t,widget_id:n,device_id:mi((d==null?void 0:d.link_id)||""),is_agent_mode:i});if(zn(N)){Fp($)&&(Fn(st.CustomerToken,$.customer_token,(d==null?void 0:d.link_id)||""),Fn(st.CustomerRefreshToken,$.customer_refresh_token,(d==null?void 0:d.link_id)||""),Fn(st.DeviceId,$.device_id,(d==null?void 0:d.link_id)||"")),x.clearHistory();for(const M of((z=r==null?void 0:r.body)==null?void 0:z.inputs)||[])M.remember&&J0(M.name,D[M.name]);u(!0),i?s==null||s():e==null||e();return}ho($,{form:C})}catch($){console.error("Chat creation error:",$)}finally{h(!1)}}}}),S=l.getColor(k.GreeterBackground);return f.jsxs("section",{className:"h-full overflow-y-auto px-5",style:{backgroundColor:S},children:[f.jsxs("form",{ref:y,autoComplete:"off",className:"grid grid-cols-1 gap-4",onSubmit:C.handleSubmit,children:[(F=(L=r==null?void 0:r.body)==null?void 0:L.inputs)==null?void 0:F.map((D,G)=>{var $,N;const z=G===0;if(["text","email","phone"].includes(D.type))return f.jsx(PI,{id:D.name,name:D.name,type:D.type,label:D.label,value:C.values[D.name],onChange:C.handleChange,onBlur:C.handleBlur,disabled:D.name==="username"&&m,readOnly:D.name==="username"&&m,autoComplete:"off",placeholder:D.placeholder,error:C.errors[D.name],ariaInvalid:C.errors.name?!0:void 0,required:D.required,noMargin:!0,autoFocus:z},D.name);if(D.type==="select")return f.jsx(II,{id:D.name,name:D.name,value:C.values[D.name],onChange:C.handleChange,label:D.label,error:C.errors[D.name],required:D.required,placeholder:D.placeholder,autoFocus:z,children:($=D.options)==null?void 0:$.map(M=>f.jsx("option",{value:M,children:M},M))},D.name);if(D.type==="checkbox")return f.jsx(BI,{id:D.name,name:D.name,value:C.values[D.name],checked:C.values[D.name]==="true",onChange:C.handleChange,required:D.required,error:C.errors[D.name],children:D.label},D.name);if(D.type==="radio")return f.jsx(tx.Group,{id:D.name,label:D.label,required:D.required,error:C.errors[D.name],children:(N=D.options)==null?void 0:N.map(M=>f.jsx(tx,{onChange:P=>{P?C.setFieldValue(D.name,M):C.setFieldValue(D.name,"")},id:M,name:D.name,value:M===C.values[D.name],children:M},M))},D.name);if(D.type==="textarea")return f.jsx(Qu,{id:D.name,name:D.name,value:C.values[D.name],onChange:C.handleChange,onBlur:C.handleBlur,placeholder:D.placeholder,error:C.errors[D.name],required:D.required,label:D.label,noMargin:!0,autoFocus:z},D.name)}),f.jsx(Rt,{textKey:k.GreeterButtonText,bgKey:k.GreeterButtonBackground,type:"submit",size:"lg",disabled:p||a,className:"transition-all duration-300 hover:opacity-90 transform hover:translate-y-[-1px] shadow-sm",children:p||a?f.jsxs("div",{className:"flex items-center justify-center",children:[f.jsx("span",{className:"mr-2",children:o?"Bağlanıyor":"Yükleniyor"}),f.jsx("span",{className:"animate-pulse",children:"..."})]}):o?"Canlı Desteğe Bağlan":"Sohbet Oluştur"})]}),f.jsx(xo,{variant:"block",className:"py-2"})]})}var tn=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(tn||{}),gn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e))(gn||{}),ye=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(ye||{});const gs=e=>{const t=UE(),n=(r,i)=>{var o;const s=((o=NB.find(a=>a.name===r))==null?void 0:o.path)??"/";return typeof i=="object"&&s.includes(":")?Object.entries(i).reduce((a,[l,c])=>a.replace(`:${l}`,c),s):i?`${s}?${i}`:s};return{push:(r,i)=>{t(n(r,i),e)},path:n}};var UI={exports:{}},Xd={exports:{}},nx;function tC(){return nx||(nx=1,function(e,t){(function(n,r){e.exports=r()})(ch,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",d="week",u="month",p="quarter",h="year",y="date",x="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(z){var $=["th","st","nd","rd"],N=z%100;return"["+z+($[(N-20)%10]||$[N]||$[0])+"]"}},b=function(z,$,N){var M=String(z);return!M||M.length>=$?z:""+Array($+1-M.length).join(N)+z},C={s:b,z:function(z){var $=-z.utcOffset(),N=Math.abs($),M=Math.floor(N/60),P=N%60;return($<=0?"+":"-")+b(M,2,"0")+":"+b(P,2,"0")},m:function z($,N){if($.date()<N.date())return-z(N,$);var M=12*(N.year()-$.year())+(N.month()-$.month()),P=$.clone().add(M,u),B=N-P<0,U=$.clone().add(M+(B?-1:1),u);return+(-(M+(N-P)/(B?P-U:U-P))||0)},a:function(z){return z<0?Math.ceil(z)||0:Math.floor(z)},p:function(z){return{M:u,y:h,w:d,d:c,D:y,h:l,m:a,s:o,ms:s,Q:p}[z]||String(z||"").toLowerCase().replace(/s$/,"")},u:function(z){return z===void 0}},S="en",_={};_[S]=g;var j="$isDayjsObject",A=function(z){return z instanceof D||!(!z||!z[j])},E=function z($,N,M){var P;if(!$)return S;if(typeof $=="string"){var B=$.toLowerCase();_[B]&&(P=B),N&&(_[B]=N,P=B);var U=$.split("-");if(!P&&U.length>1)return z(U[0])}else{var W=$.name;_[W]=$,P=W}return!M&&P&&(S=P),P||!M&&S},L=function(z,$){if(A(z))return z.clone();var N=typeof $=="object"?$:{};return N.date=z,N.args=arguments,new D(N)},F=C;F.l=E,F.i=A,F.w=function(z,$){return L(z,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var D=function(){function z(N){this.$L=E(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[j]=!0}var $=z.prototype;return $.parse=function(N){this.$d=function(M){var P=M.date,B=M.utc;if(P===null)return new Date(NaN);if(F.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var U=P.match(w);if(U){var W=U[2]-1||0,q=(U[7]||"0").substring(0,3);return B?new Date(Date.UTC(U[1],W,U[3]||1,U[4]||0,U[5]||0,U[6]||0,q)):new Date(U[1],W,U[3]||1,U[4]||0,U[5]||0,U[6]||0,q)}}return new Date(P)}(N),this.init()},$.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},$.$utils=function(){return F},$.isValid=function(){return this.$d.toString()!==x},$.isSame=function(N,M){var P=L(N);return this.startOf(M)<=P&&P<=this.endOf(M)},$.isAfter=function(N,M){return L(N)<this.startOf(M)},$.isBefore=function(N,M){return this.endOf(M)<L(N)},$.$g=function(N,M,P){return F.u(N)?this[M]:this.set(P,N)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(N,M){var P=this,B=!!F.u(M)||M,U=F.p(N),W=function(Y,V){var Z=F.w(P.$u?Date.UTC(P.$y,V,Y):new Date(P.$y,V,Y),P);return B?Z:Z.endOf(c)},q=function(Y,V){return F.w(P.toDate()[Y].apply(P.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(V)),P)},se=this.$W,ie=this.$M,pe=this.$D,ce="set"+(this.$u?"UTC":"");switch(U){case h:return B?W(1,0):W(31,11);case u:return B?W(1,ie):W(0,ie+1);case d:var _e=this.$locale().weekStart||0,Re=(se<_e?se+7:se)-_e;return W(B?pe-Re:pe+(6-Re),ie);case c:case y:return q(ce+"Hours",0);case l:return q(ce+"Minutes",1);case a:return q(ce+"Seconds",2);case o:return q(ce+"Milliseconds",3);default:return this.clone()}},$.endOf=function(N){return this.startOf(N,!1)},$.$set=function(N,M){var P,B=F.p(N),U="set"+(this.$u?"UTC":""),W=(P={},P[c]=U+"Date",P[y]=U+"Date",P[u]=U+"Month",P[h]=U+"FullYear",P[l]=U+"Hours",P[a]=U+"Minutes",P[o]=U+"Seconds",P[s]=U+"Milliseconds",P)[B],q=B===c?this.$D+(M-this.$W):M;if(B===u||B===h){var se=this.clone().set(y,1);se.$d[W](q),se.init(),this.$d=se.set(y,Math.min(this.$D,se.daysInMonth())).$d}else W&&this.$d[W](q);return this.init(),this},$.set=function(N,M){return this.clone().$set(N,M)},$.get=function(N){return this[F.p(N)]()},$.add=function(N,M){var P,B=this;N=Number(N);var U=F.p(M),W=function(ie){var pe=L(B);return F.w(pe.date(pe.date()+Math.round(ie*N)),B)};if(U===u)return this.set(u,this.$M+N);if(U===h)return this.set(h,this.$y+N);if(U===c)return W(1);if(U===d)return W(7);var q=(P={},P[a]=r,P[l]=i,P[o]=n,P)[U]||1,se=this.$d.getTime()+N*q;return F.w(se,this)},$.subtract=function(N,M){return this.add(-1*N,M)},$.format=function(N){var M=this,P=this.$locale();if(!this.isValid())return P.invalidDate||x;var B=N||"YYYY-MM-DDTHH:mm:ssZ",U=F.z(this),W=this.$H,q=this.$m,se=this.$M,ie=P.weekdays,pe=P.months,ce=P.meridiem,_e=function(V,Z,ue,O){return V&&(V[Z]||V(M,B))||ue[Z].slice(0,O)},Re=function(V){return F.s(W%12||12,V,"0")},Y=ce||function(V,Z,ue){var O=V<12?"AM":"PM";return ue?O.toLowerCase():O};return B.replace(m,function(V,Z){return Z||function(ue){switch(ue){case"YY":return String(M.$y).slice(-2);case"YYYY":return F.s(M.$y,4,"0");case"M":return se+1;case"MM":return F.s(se+1,2,"0");case"MMM":return _e(P.monthsShort,se,pe,3);case"MMMM":return _e(pe,se);case"D":return M.$D;case"DD":return F.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return _e(P.weekdaysMin,M.$W,ie,2);case"ddd":return _e(P.weekdaysShort,M.$W,ie,3);case"dddd":return ie[M.$W];case"H":return String(W);case"HH":return F.s(W,2,"0");case"h":return Re(1);case"hh":return Re(2);case"a":return Y(W,q,!0);case"A":return Y(W,q,!1);case"m":return String(q);case"mm":return F.s(q,2,"0");case"s":return String(M.$s);case"ss":return F.s(M.$s,2,"0");case"SSS":return F.s(M.$ms,3,"0");case"Z":return U}return null}(V)||U.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(N,M,P){var B,U=this,W=F.p(M),q=L(N),se=(q.utcOffset()-this.utcOffset())*r,ie=this-q,pe=function(){return F.m(U,q)};switch(W){case h:B=pe()/12;break;case u:B=pe();break;case p:B=pe()/3;break;case d:B=(ie-se)/6048e5;break;case c:B=(ie-se)/864e5;break;case l:B=ie/i;break;case a:B=ie/r;break;case o:B=ie/n;break;default:B=ie}return P?B:F.a(B)},$.daysInMonth=function(){return this.endOf(u).$D},$.$locale=function(){return _[this.$L]},$.locale=function(N,M){if(!N)return this.$L;var P=this.clone(),B=E(N,M,!0);return B&&(P.$L=B),P},$.clone=function(){return F.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},z}(),G=D.prototype;return L.prototype=G,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",h],["$D",y]].forEach(function(z){G[z[1]]=function($){return this.$g($,z[0],z[1])}}),L.extend=function(z,$){return z.$i||(z($,D,L),z.$i=!0),L},L.locale=E,L.isDayjs=A,L.unix=function(z){return L(1e3*z)},L.en=_[S],L.Ls=_,L.p={},L})}(Xd)),Xd.exports}(function(e,t){(function(n,r){e.exports=r(tC())})(ch,function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var i=r(n),s={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(o){return o+"."}};return i.default.locale(s,null,!0),s})})(UI);var nC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ch,function(){return function(n,r,i){n=n||{};var s=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(c,d,u,p){return s.fromToBase(c,d,u,p)}i.en.relativeTime=o,s.fromToBase=function(c,d,u,p,h){for(var y,x,w,m=u.$locale().relativeTime||o,g=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],b=g.length,C=0;C<b;C+=1){var S=g[C];S.d&&(y=p?i(c).diff(u,S.d,!0):u.diff(c,S.d,!0));var _=(n.rounding||Math.round)(Math.abs(y));if(w=y>0,_<=S.r||!S.r){_<=1&&C>0&&(S=g[C-1]);var j=m[S.l];h&&(_=h(""+_)),x=typeof j=="string"?j.replace("%d",_):j(_,d,S.l,w);break}}if(d)return x;var A=w?m.future:m.past;return typeof A=="function"?A(x):A.replace("%s",x)},s.to=function(c,d){return a(c,d,this,!0)},s.from=function(c,d){return a(c,d,this)};var l=function(c){return c.$u?i.utc():i()};s.toNow=function(c){return this.to(l(this),c)},s.fromNow=function(c){return this.from(l(this),c)}}})})(nC);var HI=nC.exports;const WI=Rr(HI);var qI=tC();const Zd=Rr(qI),GI=(e="tr")=>(Zd.extend(WI),Zd.locale(e),Zd);function YI({onHasHistory:e,emptyStateText:t}){const n=re(g=>g.widget),r=re(g=>g.setHistoryChat),i=re(g=>g.setHistoryMessages),s=Se(),o=gs(),[a,l]=v.useState(null),c=GI(),d=v.useRef(!1),u=n!=null&&n.link_id?mi(n.link_id):null,{data:p,isLoading:h}=fM((n==null?void 0:n.link_id)||"",u||"");if(v.useEffect(()=>{if(!h&&p){const[g,b]=p,C=zn(b)&&Array.isArray(g)&&g.length>0;if(C&&!d.current){const S=g[0];if(S.status===tn.Open||S.status===tn.Pending){console.log("ChatHistoryList: Auto-joining active chat",S._id),d.current=!0,r(S),i(null),o.push("chat");return}}e&&e(C)}},[h,p,e,o,r,i]),!(n!=null&&n.link_id))return null;if(h)return f.jsx("div",{className:"p-4 text-center text-xs opacity-50",children:"Yükleniyor..."});if(!p)return null;const[y,x]=p;if(!zn(x)||!Array.isArray(y))return null;const w=g=>c(g).fromNow(),m=g=>{var b;return g.who_joined_details&&Array.isArray(g.who_joined_details)&&g.who_joined_details.length>0?g.who_joined_details[0].name||"Atanmamış":g.participant_logs&&Array.isArray(g.participant_logs)&&g.participant_logs.length>0?g.participant_logs[0].name||"Atanmamış":(b=g.archive_summary)!=null&&b.admin_name?g.archive_summary.admin_name:"Atanmamış"};return y.length===0?f.jsx("div",{className:"h-full flex items-center justify-center p-6 text-center",children:f.jsxs("div",{className:"max-w-xs",children:[f.jsx("div",{className:"text-sm font-medium opacity-80",children:"Henüz sohbet yok"}),f.jsx("div",{className:"mt-2 text-xs opacity-60",children:t||"Yeni bir sohbet başlatmak için aşağıdaki butonu kullanabilirsiniz."})]})}):f.jsx("div",{className:"flex flex-col h-full",children:f.jsx("div",{className:"flex-1 overflow-y-auto space-y-0 min-h-0",children:y.map(g=>f.jsxs("button",{type:"button",className:"w-full flex justify-between items-center gap-2 p-5 text-left transition-colors",style:{color:s.getColor(k.InputText),backgroundColor:a===g._id?s.getColor(k.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>l(g._id),onMouseLeave:()=>l(null),onClick:()=>{r(g),i(null),o.push("chat")},children:[f.jsx("span",{className:"font-medium text-sm truncate flex-1 min-w-0",children:m(g)}),f.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:s.getColor(k.FooterText)},children:w(g.created_at)})]},g._id))})})}const Jd=[De.Light,De.Dark,De.System];function QI(e){switch(e){case De.Light:return X.Sun;case De.Dark:return X.Moon;case De.System:return X.Monitor;default:return X.Monitor}}function KI(){const e=Se(),{mode:t,setMode:n}=e,r=()=>{const s=Jd.indexOf(t),o=Jd[(s+1)%Jd.length];n(o)},i=QI(t);return f.jsx("button",{type:"button",onClick:r,className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:e.getColor(k.HeaderText)},title:t===De.Light?"Açık tema":t===De.Dark?"Koyu tema":"Sistem",children:f.jsx(i,{className:"size-5"})})}const cr=Object.create(null);cr.open="0";cr.close="1";cr.ping="2";cr.pong="3";cr.message="4";cr.upgrade="5";cr.noop="6";const uc=Object.create(null);Object.keys(cr).forEach(e=>{uc[cr[e]]=e});const Qp={type:"error",data:"parser error"},rC=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",iC=typeof ArrayBuffer=="function",sC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,pg=({type:e,data:t},n,r)=>rC&&t instanceof Blob?n?r(t):rx(t,r):iC&&(t instanceof ArrayBuffer||sC(t))?n?r(t):rx(new Blob([t]),r):r(cr[e]+(t||"")),rx=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function ix(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ef;function XI(e,t){if(rC&&e.data instanceof Blob)return e.data.arrayBuffer().then(ix).then(t);if(iC&&(e.data instanceof ArrayBuffer||sC(e.data)))return t(ix(e.data));pg(e,!1,n=>{ef||(ef=new TextEncoder),t(ef.encode(n))})}const sx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<sx.length;e++)Jo[sx.charCodeAt(e)]=e;const ZI=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)s=Jo[e.charCodeAt(r)],o=Jo[e.charCodeAt(r+1)],a=Jo[e.charCodeAt(r+2)],l=Jo[e.charCodeAt(r+3)],d[i++]=s<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},JI=typeof ArrayBuffer=="function",hg=(e,t)=>{if(typeof e!="string")return{type:"message",data:oC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:eL(e.substring(1),t)}:uc[n]?e.length>1?{type:uc[n],data:e.substring(1)}:{type:uc[n]}:Qp},eL=(e,t)=>{if(JI){const n=ZI(e);return oC(n,t)}else return{base64:!0,data:e}},oC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},aC="",tL=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{pg(s,!1,a=>{r[o]=a,++i===n&&t(r.join(aC))})})},nL=(e,t)=>{const n=e.split(aC),r=[];for(let i=0;i<n.length;i++){const s=hg(n[i],t);if(r.push(s),s.type==="error")break}return r};function rL(){return new TransformStream({transform(e,t){XI(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,r)}else{i=new Uint8Array(9);const s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let tf;function Vl(e){return e.reduce((t,n)=>t+n.length,0)}function Ul(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function iL(e,t){tf||(tf=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(Vl(n)<1)break;const l=Ul(n,1);s=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(Vl(n)<2)break;const l=Ul(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Vl(n)<8)break;const l=Ul(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(Qp);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Vl(n)<i)break;const l=Ul(n,i);a.enqueue(hg(s?l:tf.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(Qp);break}}}})}const lC=4;function at(e){if(e)return sL(e)}function sL(e){for(var t in at.prototype)e[t]=at.prototype[t];return e}at.prototype.on=at.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};at.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};at.prototype.off=at.prototype.removeListener=at.prototype.removeAllListeners=at.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};at.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};at.prototype.emitReserved=at.prototype.emit;at.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};at.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Ku=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),bn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),oL="arraybuffer";function cC(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const aL=bn.setTimeout,lL=bn.clearTimeout;function Xu(e,t){t.useNativeTimers?(e.setTimeoutFn=aL.bind(bn),e.clearTimeoutFn=lL.bind(bn)):(e.setTimeoutFn=bn.setTimeout.bind(bn),e.clearTimeoutFn=bn.clearTimeout.bind(bn))}const cL=1.33;function uL(e){return typeof e=="string"?dL(e):Math.ceil((e.byteLength||e.size)*cL)}function dL(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function uC(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function fL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function pL(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}class hL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class mg extends at{constructor(t){super(),this.writable=!1,Xu(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new hL(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=hg(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=fL(t);return n.length?"?"+n:""}}class mL extends mg{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};nL(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,tL(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=uC()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let dC=!1;try{dC=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const gL=dC;function vL(){}class yL extends mL{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ar extends at{constructor(t,n,r){super(),this.createRequest=t,Xu(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=cC(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=ar.requestsCount++,ar.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=vL,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete ar.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}ar.requestsCount=0;ar.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ox);else if(typeof addEventListener=="function"){const e="onpagehide"in bn?"pagehide":"unload";addEventListener(e,ox,!1)}}function ox(){for(let e in ar.requests)ar.requests.hasOwnProperty(e)&&ar.requests[e].abort()}const xL=function(){const e=fC({xdomain:!1});return e&&e.responseType!==null}();class wL extends yL{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=xL&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new ar(fC,this.uri(),t)}}function fC(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||gL))return new XMLHttpRequest}catch{}if(!t)try{return new bn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const pC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bL extends mg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=pC?{}:cC(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;pg(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&Ku(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=uC()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const nf=bn.WebSocket||bn.MozWebSocket;class kL extends bL{createSocket(t,n,r){return pC?new nf(t,n,r):n?new nf(t,n):new nf(t)}doWrite(t,n){this.ws.send(n)}}class SL extends mg{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=iL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=rL();i.readable.pipeTo(t.writable),this._writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),s())}).catch(a=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this._writer.write(r).then(()=>{i&&Ku(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const CL={websocket:kL,webtransport:SL,polling:wL},_L=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,TL=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Kp(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=_L.exec(e||""),s={},o=14;for(;o--;)s[TL[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=EL(s,s.path),s.queryKey=AL(s,s.query),s}function EL(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function AL(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Xp=typeof addEventListener=="function"&&typeof removeEventListener=="function",dc=[];Xp&&addEventListener("offline",()=>{dc.forEach(e=>e())},!1);class ui extends at{constructor(t,n){if(super(),this.binaryType=oL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Kp(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Kp(n.host).host);Xu(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=pL(this.opts.query)),Xp&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},dc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=lC,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ui.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ui.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=uL(i)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,Ku(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(ui.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Xp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=dc.indexOf(this._offlineEventListener);r!==-1&&dc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ui.protocol=lC;class jL extends ui{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;ui.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ui.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function s(){r||(r=!0,d(),n.close(),n=null)}const o=u=>{const p=new Error("probe error: "+u);p.transport=n.name,s(),this.emitReserved("upgradeError",p)};function a(){o("transport closed")}function l(){o("socket closed")}function c(u){n&&u.name!==n.name&&s()}const d=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let RL=class extends jL{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>CL[i]).filter(i=>!!i)),super(t,r)}};function PL(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Kp(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}const ML=typeof ArrayBuffer=="function",OL=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,hC=Object.prototype.toString,NL=typeof Blob=="function"||typeof Blob<"u"&&hC.call(Blob)==="[object BlobConstructor]",DL=typeof File=="function"||typeof File<"u"&&hC.call(File)==="[object FileConstructor]";function gg(e){return ML&&(e instanceof ArrayBuffer||OL(e))||NL&&e instanceof Blob||DL&&e instanceof File}function fc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(fc(e[n]))return!0;return!1}if(gg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return fc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&fc(e[n]))return!0;return!1}function IL(e){const t=[],n=e.data,r=e;return r.data=Zp(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Zp(e,t){if(!e)return e;if(gg(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Zp(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Zp(e[r],t));return n}return e}function LL(e,t){return e.data=Jp(e.data,t),delete e.attachments,e}function Jp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Jp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Jp(e[n],t));return e}const FL=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],BL=5;var Ee;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Ee||(Ee={}));class $L{constructor(t){this.replacer=t}encode(t){return(t.type===Ee.EVENT||t.type===Ee.ACK)&&fc(t)?this.encodeAsBinary({type:t.type===Ee.EVENT?Ee.BINARY_EVENT:Ee.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Ee.BINARY_EVENT||t.type===Ee.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=IL(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function ax(e){return Object.prototype.toString.call(e)==="[object Object]"}class vg extends at{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Ee.BINARY_EVENT;r||n.type===Ee.BINARY_ACK?(n.type=r?Ee.EVENT:Ee.ACK,this.reconstructor=new zL(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(gg(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Ee[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Ee.BINARY_EVENT||r.type===Ee.BINARY_ACK){const s=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(s,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const s=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(s,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const s=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(s,n+1))}if(t.charAt(++n)){const s=this.tryParse(t.substr(n));if(vg.isPayloadValid(r.type,s))r.data=s;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Ee.CONNECT:return ax(n);case Ee.DISCONNECT:return n===void 0;case Ee.CONNECT_ERROR:return typeof n=="string"||ax(n);case Ee.EVENT:case Ee.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&FL.indexOf(n[0])===-1);case Ee.ACK:case Ee.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class zL{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=LL(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const VL=Object.freeze(Object.defineProperty({__proto__:null,Decoder:vg,Encoder:$L,get PacketType(){return Ee},protocol:BL},Symbol.toStringTag,{value:"Module"}));function Dn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const UL=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class mC extends at{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Dn(t,"open",this.onopen.bind(this)),Dn(t,"packet",this.onpacket.bind(this)),Dn(t,"error",this.onerror.bind(this)),Dn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,i,s;if(UL.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:Ee.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const d=this.ids++,u=n.pop();this._registerAckCallback(d,u),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,l=this.connected&&!(!((s=this.io.engine)===null||s===void 0)&&s._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(s),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,i)=>{const s=(o,a)=>o?i(o):r(a);s.withError=!0,n.push(s),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Ee.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Ee.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Ee.EVENT:case Ee.BINARY_EVENT:this.onevent(t);break;case Ee.ACK:case Ee.BINARY_ACK:this.onack(t);break;case Ee.DISCONNECT:this.ondisconnect();break;case Ee.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Ee.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ee.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Ro(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ro.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Ro.prototype.reset=function(){this.attempts=0};Ro.prototype.setMin=function(e){this.ms=e};Ro.prototype.setMax=function(e){this.max=e};Ro.prototype.setJitter=function(e){this.jitter=e};class eh extends at{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Xu(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Ro({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||VL;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new RL(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Dn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Dn(n,"error",s);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Dn(t,"ping",this.onping.bind(this)),Dn(t,"data",this.ondata.bind(this)),Dn(t,"error",this.onerror.bind(this)),Dn(t,"close",this.onclose.bind(this)),Dn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Ku(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new mC(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ho={};function pc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=PL(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Ho[i]&&s in Ho[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new eh(r,t):(Ho[i]||(Ho[i]=new eh(r,t)),l=Ho[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(pc,{Manager:eh,Socket:mC,io:pc,connect:pc});const gC=v.createContext(null),dr=()=>{const e=v.useContext(gC);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},HL=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=re(),i=v.useRef(null),s=v.useRef(!1),o=v.useRef(!1),a=v.useRef(null),[l,c]=v.useState(!1),[d,u]=v.useState(!1),p=v.useCallback(S=>{var _;console.log("WS: cleanupSocket called",{reason:S,hasSocket:!!i.current,isConnected:(_=i.current)==null?void 0:_.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",S||""),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),c(!1),u(!1),o.current=!1,s.current=!1,a.current=null},[]),h=v.useCallback((S,_,j)=>{if(a.current===S&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!_&&!j){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const A=Zo(st.CustomerToken,S)||ga("customer_token"),E=Zo(st.CustomerRefreshToken,S)||ga("customer_refresh_token");if(!A||!E){if(console.log("WS: Connect skipped - missing required tokens"),_){console.log("WS: Clearing stale isHaveChat flag due to missing tokens"),localStorage.removeItem("lc:widget:isHaveChat");try{re.getState().setIsHaveChat(!1)}catch{}}return}if(i.current&&!i.current.connected&&(console.log("WS: Cleaning up disconnected/failed socket before new connection"),i.current.removeAllListeners(),i.current.disconnect(),i.current=null),i.current&&i.current.connected){console.log("WS: Already connected, skipping new connection");return}console.log("WS: Attempting to connect...",{linkId:S,tokenPrefix:`${A==null?void 0:A.substring(0,20)}...`,refreshTokenPrefix:`${E==null?void 0:E.substring(0,20)}...`,deviceId:Zo(st.DeviceId,S)}),o.current=!0,a.current=S;const L=pc(jT,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:A,device_id:Zo(st.DeviceId,S)||ga("device_id"),customer_refresh_token:E}});i.current=L,L.on("error",F=>{console.error("WS: Websocket error",F),o.current=!1}),L.on("connect_error",F=>{console.error("WS: Connect error",F),o.current=!1,c(!1),u(!1),i.current===L&&(i.current=null,a.current=null);const D=(F==null?void 0:F.message)||String(F);if(D.toLowerCase().includes("unauthorized")||D.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),S&&iS(S),localStorage.removeItem("lc:widget:isHaveChat");try{re.getState().setIsHaveChat(!1)}catch{}}}),L.on("disconnect",F=>{var G;console.log("WS: Disconnected",F),c(!1),u(!1),o.current=!1,s.current=!1,i.current===L&&(i.current=null,a.current=null);const D=re.getState();F==="io server disconnect"&&((G=D.widget)!=null&&G.link_id)&&(D.isHaveChat||D.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{h(D.widget.link_id,D.isHaveChat,D.isAIAgentMode)},500))}),L.on("connect",()=>{console.log("WS: Connected successfully"),c(!0),o.current=!1}),L.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,u(!0)})},[]);v.useEffect(()=>{const S=t==null?void 0:t.link_id;return S&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),h(S,n,r)):!n&&!r&&(console.log("WS: Auto-disconnect due to no isHaveChat and no isAIAgentMode"),p("no active chat flags")),()=>{}},[t==null?void 0:t.link_id,n,r,h,p]),v.useEffect(()=>()=>{console.log("WS: Provider unmounting, cleaning up"),p("provider unmount")},[p]),v.useEffect(()=>{const S=()=>{console.log("WS: Page unloading, disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)},_=()=>{console.log("WS: Page hidden (pagehide), disconnecting socket"),i.current&&(i.current.disconnect(),i.current=null)};return window.addEventListener("beforeunload",S),window.addEventListener("pagehide",_),()=>{window.removeEventListener("beforeunload",S),window.removeEventListener("pagehide",_)}},[]);const y=v.useCallback(()=>{const S=t==null?void 0:t.link_id;S?h(S,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,h]),x=v.useCallback(()=>{console.log("WS: Reconnecting..."),p("manual reconnect");const S=t==null?void 0:t.link_id;S&&setTimeout(()=>{h(S,n,r)},100)},[t==null?void 0:t.link_id,n,r,h,p]),w=v.useCallback(()=>{console.log("WS: Manual disconnect"),p("manual disconnect")},[p]),m=v.useCallback((S,_)=>{var j;(j=i.current)==null||j.on(S,_)},[]),g=v.useCallback((S,_)=>{var j;(j=i.current)==null||j.off(S,_)},[]),b=v.useCallback((S,_,j)=>{i.current&&i.current.connected?i.current.emit(S,_,j):console.warn(`WS: Cannot emit event '${S}', socket not connected.`)},[]),C=v.useMemo(()=>({connectionReady:d,connected:l,connect:y,reconnect:x,disconnect:w,on:m,off:g,emit:b}),[l,d,y,x,w,m,g,b]);return f.jsx(gC.Provider,{value:C,children:e})},Jc=(e,t,n)=>{const r=typeof window<"u"?window:void 0;v.useEffect(()=>(r.addEventListener(e,t),()=>{r.removeEventListener(e,t,!1)}),[e,t,r])},Po=()=>{let e=!1,t=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true",t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent)),e||t},WL=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},Zu=()=>v.useMemo(()=>typeof window>"u"||new URLSearchParams(window.location.search).get("fullscreen")==="true"?!1:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent),[]);var He=(e=>(e.ChatView="chat:user:view",e.ChatClose="chat:user:close",e.MessageList="message:list",e.MessageCreate="message:create",e.MessageTyping="message:typing",e.WidgetOpen="widget:open",e.WidgetClose="widget:close",e.PageChange="page-change",e.MessageRead="message:read",e.AgentRequestHuman="agent:request:human",e.AgentMessageCreate="agent:message:create",e.ChatUpdateInputs="chat:update:inputs",e))(He||{}),ve=(e=>(e.Connect="connect",e.Disconnect="disconnect",e.ConnectionReady="connection:ready",e.MessageAgentCreate="message:agent:create",e.MessageUserCreate="message:user:create",e.MessageCustomerCreate="message:customer:create",e.MessageAgentTyping="message:agent:typing",e.Banned="banned",e.ChatUserClose="chat:user:close",e.ChatUserAssignee="chat:user:assignee",e.ChatToggleUpload="chat:user:upload:toggle",e.ChatUserShowButton="chat:user:show-button",e.ChatUserLeave="chat:user:leave",e.ChatUserJoin="chat:user:join",e.AgentMessageChunk="agent:message:chunk",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(ve||{});function qL(){const e=Yu(),t=v.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return Jc("popstate",t),null}function GL(){const e=dr(),t=Yu(),n=v.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(He.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return Jc("popstate",n),v.useEffect(()=>{if(!e)return;const r=OI(),i=MI();r!==i&&(e.emit(He.PageChange,{page:i}),t.setPage(i))},[e]),null}function YL(){return qL(),null}const lx=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function QL(){var ce,_e,Re,Y;const e=Se(),t=re(V=>V.widget),n=re(V=>V.setOpen),r=re(V=>V.setAIAgent),i=re(V=>V.setIsAIAgentMode),s=re(V=>V.setIsHaveChat),o=re(V=>V.isHaveChat),a=re(V=>V.humanNeedRequested),l=re(V=>V.setHumanNeedRequested),c=re(V=>V.aiAgent),d=re(V=>V.setShowActionButtons),u=re(V=>V.defaultValues),[p,h]=v.useState(!1),[y,x]=v.useState(!1),[w,m]=v.useState(null),g=gs(),b=Po(),C=Zu(),[S,_]=v.useState(!0),[j,A]=v.useState(!1),E=Yu(),L=Gm(),F=dr(),[D,G]=v.useState(null),z=v.useRef(!1),$=v.useRef(!1),N=v.useRef(!1),M=ll(),P=v.useCallback(async()=>{var Z,ue,O;if(!t)return;m(null),re.getState().setHistoryChat(null),re.getState().setHistoryMessages(null),re.getState().clearAIAgentState(),d(!1);const V=(((O=(ue=(Z=t.appearance)==null?void 0:Z.body)==null?void 0:ue.inputs)==null?void 0:O.length)||0)>0;if(D){if(N.current)return;N.current=!0;try{const ae={username:(u==null?void 0:u.username)||"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`};u!=null&&u.secret_data&&(ae.secret_data=u.secret_data);const[ee,ke]=await L.mutateAsync({inputs:ae,history:E.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id),is_agent_mode:!0});zn(ke)&&Fp(ee)?(Fn(st.CustomerToken,ee.customer_token,t.link_id),Fn(st.CustomerRefreshToken,ee.customer_refresh_token,t.link_id),Fn(st.DeviceId,ee.device_id,t.link_id),E.clearHistory(),s(!0),r(D),i(!0),g.push("chat")):(ho(ee),(ee==null?void 0:ee.statusCode)===403&&m((ee==null?void 0:ee.message)||"Sohbet başlatılamadı."))}catch(ae){console.error("Error creating chat for AI agent:",ae)}finally{N.current=!1}return}if(!V){if(N.current)return;N.current=!0;try{const ae={};u!=null&&u.secret_data&&(ae.secret_data=u.secret_data),u!=null&&u.username&&(ae.username=u.username);const[ee,ke]=await L.mutateAsync({inputs:ae,history:E.history,client_id:t.client_id,widget_id:t.link_id,device_id:mi(t.link_id)});zn(ke)&&Fp(ee)?(Fn(st.CustomerToken,ee.customer_token,t.link_id),Fn(st.CustomerRefreshToken,ee.customer_refresh_token,t.link_id),Fn(st.DeviceId,ee.device_id,t.link_id),E.clearHistory(),s(!0),g.push("chat")):(ho(ee),(ee==null?void 0:ee.statusCode)===403&&m((ee==null?void 0:ee.message)||"Sohbet başlatılamadı."))}catch(ae){console.error("Error creating chat:",ae)}finally{N.current=!1}return}_(!1)},[t,D,L,E,u==null?void 0:u.secret_data,u==null?void 0:u.username,s,r,i,g,d]),B=v.useCallback(V=>{A(V)},[]);if(!t)return null;const U=()=>{n(!1)};v.useEffect(()=>{var ue,O,ae;if(!t||z.current)return;z.current=!0;const V=mr(t.link_id);if(V.isAgentMode&&V.agent&&(M!=null&&M.accessToken)){if(r(V.agent),i(!0),V.sessionId&&re.getState().setAIAgentSessionId(V.sessionId),V.humanNeedRequested){if(re.getState().setHumanNeedRequested(!0),!((((ae=(O=(ue=t.appearance)==null?void 0:ue.body)==null?void 0:O.inputs)==null?void 0:ae.length)||0)>0)){g.push("chat");return}return}G(V.agent),g.push("chat");return}(async()=>{try{const[ee,ke]=await hM(t.link_id);ke===200&&ee&&ee.is_active&&G(ee)}catch(ee){console.error("Failed to check AI agent:",ee)}})()},[t,M==null?void 0:M.accessToken,M==null?void 0:M.refreshToken,g,r,i]),v.useEffect(()=>{if(p||!t||!M||!M.accessToken){$.current=!1;return}if($.current||a)return;if(o){g.push("chat");return}const V=mr(t.link_id);V.isAgentMode&&V.agent&&!V.humanNeedRequested||($.current=!0,oM(t.client_id,Yi(M)).then(([Z,ue])=>{if(zn(ue))a||g.push("chat");else if(ue===403){const O=mr(t.link_id);if(O.isAgentMode&&O.agent){if(O.humanNeedRequested){r(O.agent),i(!1),O.sessionId&&re.getState().setAIAgentSessionId(O.sessionId),re.getState().setHumanNeedRequested(!0);return}r(O.agent),i(!0),O.sessionId&&re.getState().setAIAgentSessionId(O.sessionId),g.push("chat")}else pa(t.link_id||""),h(!0)}else ue===404?(pa(t.link_id||""),h(!0)):ue===401?(iS(t.link_id||""),h(!0)):g.push("chat")}).catch(()=>g.push("chat")))},[p,g,r,i,t,M==null?void 0:M.accessToken,M==null?void 0:M.refreshToken,o,a]);const W=lx(((_e=(ce=t.appearance)==null?void 0:ce.head)==null?void 0:_e.elements)||[],"text"),q=lx(((Y=(Re=t.appearance)==null?void 0:Re.head)==null?void 0:Y.elements)||[],"title"),se=()=>{if(a&&t){let V=c;if(!V){const Z=mr(t.link_id);Z.agent&&(V=Z.agent,r(Z.agent),G(Z.agent))}if(V){i(!0),re.getState().setHistoryChat(null),re.getState().setHistoryMessages(null),g.push("chat");return}}_(!0)},ie=()=>{D&&(r(D),i(!0),re.getState().setHistoryChat(null),re.getState().setHistoryMessages(null),g.push("chat"))},pe=v.useCallback(V=>{if(!F||y)return;x(!0);const Z=()=>{F.emit(He.AgentRequestHuman,{},ue=>{x(!1),ue!=null&&ue.success&&(re.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),re.getState().clearAIAgentState(),g.push("chat"))})};V&&Object.keys(V).length>0?F.emit(He.ChatUpdateInputs,{inputs:V},ue=>{ue!=null&&ue.success?Z():x(!1)}):Z()},[F,y,i,l,g]);return v.useEffect(()=>{var V,Z,ue;if(a){if(!c&&t){const O=mr(t.link_id);O.agent&&(r(O.agent),G(O.agent))}(c||mr((t==null?void 0:t.link_id)||"").agent)&&((((ue=(Z=(V=t==null?void 0:t.appearance)==null?void 0:V.body)==null?void 0:Z.inputs)==null?void 0:ue.length)||0)>0?_(!1):pe())}},[a,c,t,pe,r]),f.jsxs("div",{className:"h-full w-full flex flex-col relative overflow-hidden",children:[f.jsxs("header",{className:"flex items-center justify-between px-4 py-3 flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:e.getColor(k.HeaderBackground),color:e.getColor(k.HeaderText),borderColor:e.getColor(k.HeaderBorder),...b?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!S&&(j||a&&(c||t&&mr(t.link_id).agent))&&f.jsx("button",{type:"button",onClick:se,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.ArrowLeft,{className:"w-5 h-5"})}),f.jsxs("div",{className:"flex-1 min-w-0",children:[f.jsx("div",{className:"text-sm font-semibold truncate",children:S?"Geçmiş sohbetler":q||"Müşteri Hizmetleri"}),!S&&W&&f.jsx("div",{className:"text-xs opacity-90 truncate",children:W})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[f.jsx(KI,{}),C&&f.jsx("button",{type:"button",onClick:U,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(k.Background)},children:S?f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:f.jsx(YI,{onHasHistory:B,emptyStateText:w||void 0})}):f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx(VI,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!D&&!a,onAIAgentStart:ie,onOk:()=>{a&&c||(re.getState().setHistoryChat(null),re.getState().setHistoryMessages(null),g.push("chat"))},onOperatorConnect:a&&(c||mr(t.link_id).agent)?pe:void 0,isConnectingToOperator:y})})}),S&&f.jsxs("div",{className:"flex-shrink-0",style:{backgroundColor:e.getColor(k.Background)},children:[f.jsx("div",{className:"px-5 py-2",children:f.jsxs(Rt,{onClick:P,size:"lg",className:"w-full flex items-center justify-center gap-2",children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]})}),f.jsx(xo,{variant:"block"})]})]})}function KL(){return f.jsxs(f.Fragment,{children:[f.jsx(QL,{}),f.jsx(YL,{})]})}const XL=[{path:"/",component:KL,name:"registration"}];function rt({className:e="",style:t}){const n=Se();return f.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(k.MessageAdminBackground),opacity:.6,...t}})}function ZL(){const e=Se();return f.jsxs("section",{className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto",children:[f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(rt,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(rt,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(rt,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(rt,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(rt,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function JL(){const e=Se();return f.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(k.FooterBackground),borderRadius:e.getRadius()},children:[f.jsx("div",{className:"grow",children:f.jsx(rt,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})}),f.jsx(rt,{className:"h-12 w-12 rounded-full"})]})}function eF(){const e=Se();return f.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(k.HeaderBackground),borderBottom:`1px solid ${e.getColor(k.HeaderBorder)}`},children:[f.jsx(rt,{className:"h-5 w-36"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(rt,{className:"h-5 w-5 rounded"}),f.jsx(rt,{className:"h-5 w-5 rounded"})]})]})}function tF(){const e=Se();return f.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(k.GreeterBackground)},children:f.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[f.jsxs("div",{children:[f.jsx(rt,{className:"h-4 w-20 mb-1"}),f.jsx(rt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(rt,{className:"h-4 w-24 mb-1"}),f.jsx(rt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(rt,{className:"h-4 w-16 mb-1"}),f.jsx(rt,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.InputBackground)}})]}),f.jsx(rt,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(k.GreeterButtonBackground),opacity:.5}})]})})}function nF(){const e=Se();return f.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(k.GreeterTopBackground)},children:[f.jsx(rt,{className:"h-7 w-40"}),f.jsx(rt,{className:"h-4 w-56"})]})}function vC(){const e=Se();return f.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(k.Background)},children:[f.jsx(eF,{}),f.jsx(ZL,{}),f.jsx(JL,{}),f.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(k.FooterBorder)}`,backgroundColor:e.getColor(k.FooterBackground)},children:[f.jsx(rt,{className:"h-3 w-20"}),f.jsx(rt,{className:"h-3.5 w-3.5 rounded"})]})]})}function th(){const e=Se(),t=typeof window<"u"&&window.innerWidth<768;return f.jsxs("div",{className:`h-full w-full relative overflow-hidden ${t?"":"rounded-xl"}`,style:{backgroundColor:e.getColor(k.GreeterBackground)},children:[f.jsx(nF,{}),f.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:f.jsx(tF,{})})]})}const rF="/notify.mp3",yg="lc:notification_sound_muted",yC=()=>{try{return sessionStorage.getItem(yg)==="1"}catch{return!1}},xC=e=>{try{sessionStorage.setItem(yg,e?"1":"0")}catch{}},iF=async e=>{try{if(sessionStorage.getItem(yg)==="1")return}catch{}await new Audio(e||rF).play()},rf=[De.Light,De.Dark,De.System];function sF(e){switch(e){case De.Light:return X.Sun;case De.Dark:return X.Moon;case De.System:return X.Monitor;default:return X.Monitor}}function oF({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>yC()),a=v.useRef(null),l=v.useRef(null),c=Se(),d=cs(),u=dr(),{setShowActionButtons:p}=re(),{mode:h,setMode:y}=c,x=()=>{u==null||u.emit(He.ChatClose,{}),p(!1),e()},w=()=>{const b=rf.indexOf(h),C=rf[(b+1)%rf.length];y(C)},m=()=>{const b=!s;xC(b),o(b)};v.useEffect(()=>{if(!r)return;const b=C=>{var S,_;(S=l.current)!=null&&S.contains(C.target)||(_=a.current)!=null&&_.contains(C.target)||i(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[r]);const g=r&&f.jsxs(Me.div,{ref:l,onMouseDown:b=>b.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(k.Background),borderColor:c.getColor(k.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(k.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0"}),d(ne.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:m,children:[s?f.jsx(X.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(X.Volume2,{className:"size-4 flex-shrink-0"}),d(s?ne.NotificationSoundOn:ne.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(k.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:w,children:[(()=>{const b=sF(h);return f.jsx(b,{className:"size-4 flex-shrink-0"})})(),h===De.Light?"Açık tema":h===De.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Ar,{children:t&&f.jsx(Me.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(k.ModalOverlayColor)},children:f.jsxs(Me.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(k.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(k.ChatCloseConfirmText)},children:d(ne.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(k.FooterText)},children:d(ne.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.GreeterBackground),color:c.getColor(k.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(ne.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.ErrorBackground),color:c.getColor(k.ErrorText),borderRadius:c.getRadius()},onClick:x,children:d(ne.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(b=>!b),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(k.HeaderText)},title:d(ne.ChatSettings),"aria-expanded":r,children:f.jsx(X.Menu,{className:"size-5"})}),f.jsx(Ar,{children:g})]})]})}function aF(e){let t=e.replace(/<hr\b[^>]*>/gi,""),n;do n=t,t=t.replace(/<p\b[^>]*>(?:\s| | |�*[aA]0;|�*[aA]0;|<br\s*\/?>)*<\/p>/gi,"");while(t!==n);return t}function cx({text:e}){const n=Se().getColor(k.LinkColor),i=(s=>{const o=aF(s),a=/(https?:\/\/(?:[-\w.])+(?:\:[0-9]+)?(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?|(?:www\.)?(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}(?:\/(?:[\w\/_.\-~!$&'()*+,;=:@])*(?:\?(?:[\w&=%.\-~!$'()*+,;=:@/])*)?(?:\#(?:[\w.\-~!$&'()*+,;=:@/])*)?)?)/gi,l=o.split(/(<[^>]*>)/g);let c="",d=!1;for(let u=0;u<l.length;u++){const p=l[u];if(p.startsWith("<")&&p.endsWith(">"))if(p.match(/^<a\s/i)){if(p.includes("style="))c+=p;else{const h=p.replace(/^(<a\s[^>]*)(>)$/i,`$1 style="color: ${n}; text-decoration: underline;"$2`);c+=h}d=!0}else p.match(/^<\/a>/i)?(c+=p,d=!1):c+=p;else if(!d&&p.trim()){const h=p.replace(a,y=>{const x=y.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(x)?x:`https://${x}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${x}</a>`});c+=h}else c+=p}return c})(e);return f.jsx("div",{className:"linkified !text-sm w-full min-w-0",dangerouslySetInnerHTML:{__html:i}})}const ux="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function wC({files:e,className:t,onDelete:n,hideName:r}){const i=Po(),[s,o]=v.useState(new Map);v.useEffect(()=>{const y=new Map;for(let x=0;x<e.length;x++){const w=e[x];if(w instanceof File){const m=URL.createObjectURL(w);y.set(x,m)}}return o(y),()=>{for(const x of y.values())URL.revokeObjectURL(x)}},[e]);const a=y=>{var w;return((w=(y instanceof File?y.name:y).split(".").pop())==null?void 0:w.toLowerCase())||""},l=y=>y instanceof File?y.name:y.split("/").pop()||y,c=y=>{const[x,w]=y.split(".");return x.length>10?`${x.slice(0,10)}...${w}`:y},d=y=>{const x=["jpg","jpeg","png","gif","bmp","webp","svg"],w=a(y);return x.includes(w)},u=(y,x)=>{if(y instanceof File){const w=s.get(x);w&&window.open(w,"_blank")}else window.open(y,"_blank")},p=(y,x)=>{y.stopPropagation(),n==null||n(x)},h=(y,x)=>y instanceof File?s.get(x)||"":y;return f.jsx("div",{className:Ve("flex gap-2 w-full overflow-x-auto",t),children:e.map((y,x)=>{const w=l(y),m=a(y),g=d(y),b=h(y,x);return f.jsxs("div",{onClick:()=>u(y,x),className:"min-w-20 max-w-20 cursor-pointer group/item border border-gray-200 rounded-lg p-1.5 hover:shadow-md transition-all duration-200 hover:border-gray-300 bg-white relative",children:[n&&f.jsx("button",{onClick:C=>p(C,x),className:Ve("absolute top-1 right-1 w-5 h-5 bg-red-500 hover:bg-red-600 text-white rounded-full flex items-center justify-center transition-opacity duration-200 z-10",{"opacity-0 group-hover/item:opacity-100":!i}),children:f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})}),g?f.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:f.jsx("img",{src:b,alt:w,className:"w-16 h-16 min-h-16 min-w-16 object-cover group-hover/item:scale-105 transition-transform duration-200"})}):f.jsx("div",{className:"min-w-16 aspect-square w-full mb-0.5 flex items-center justify-center bg-gray-50 rounded group-hover/item:bg-gray-100 transition-colors duration-200",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 bg-blue-100 rounded flex items-center justify-center",children:f.jsx("svg",{className:"w-3 h-3 text-blue-600",fill:"currentColor",viewBox:"0 0 20 20",children:f.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}),f.jsx("div",{className:Ve("text-[10px] font-medium text-gray-600 uppercase",{[ux]:r}),children:m||"file"})]})}),f.jsx("div",{className:Ve("max-w-16 text-[10px] text-gray-700 font-medium truncate text-ellipsis overflow-hidden",{[ux]:r}),title:w,children:c(w)})]},x)})})}const lF={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},cF={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function uF({buttons:e,className:t=""}){const n=Se();if(!e||e.length===0)return null;const r=s=>{s.startsWith("http://")||s.startsWith("https://")?window.open(s,"_blank","noopener,noreferrer"):s.startsWith("tel:")||s.startsWith("mailto:")?window.location.href=s:console.log("Custom action:",s)},i=s=>s.startsWith("http://")||s.startsWith("https://")?f.jsx(X.ExternalLink,{className:"size-4"}):s.startsWith("tel:")?f.jsx(X.Phone,{className:"size-4"}):s.startsWith("mailto:")?f.jsx(X.Mail,{className:"size-4"}):null;return f.jsx(Me.div,{className:Ve(t,"mt-2"),initial:"hidden",animate:"visible",variants:lF,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:f.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${n.getColor(k.Background)}f0`},children:f.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((s,o)=>f.jsxs(Me.button,{variants:cF,transition:{duration:.25,ease:"easeOut"},whileHover:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:{scale:.98,transition:{duration:.1}},onClick:()=>r(s.url),className:"group inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 relative overflow-hidden cursor-pointer",style:{backgroundColor:n.getColor(k.GreeterBackground),color:n.getColor(k.GreeterText),borderRadius:n.getRadius(),border:`1px solid ${n.getColor(k.DividerColor)}`,boxShadow:`0 1px 3px ${n.getColor(k.ShadowColor)}30`},onMouseEnter:a=>{a.currentTarget.style.backgroundColor=n.getColor(k.ButtonBackground),a.currentTarget.style.color=n.getColor(k.ButtonText),a.currentTarget.style.borderColor=n.getColor(k.ButtonBackground),a.currentTarget.style.boxShadow=`0 4px 12px ${n.getColor(k.ShadowColor)}40`},onMouseLeave:a=>{a.currentTarget.style.backgroundColor=n.getColor(k.GreeterBackground),a.currentTarget.style.color=n.getColor(k.GreeterText),a.currentTarget.style.borderColor=n.getColor(k.DividerColor),a.currentTarget.style.boxShadow=`0 1px 3px ${n.getColor(k.ShadowColor)}30`},children:[f.jsxs("span",{className:"flex items-center gap-2",children:[i(s.url),f.jsx("span",{className:"font-medium",children:s.label})]}),f.jsx("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",style:{background:`linear-gradient(45deg, transparent 30%, ${n.getColor(k.ButtonText)}10 50%, transparent 70%)`,borderRadius:n.getRadius()}})]},`${s.label}-${o}`))})})})}const dx=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"",fx=["Düşünüyorum...","Araştırıyorum...","Cevapları karşılaştırıyorum...","En iyi cevabı hazırlıyorum...","Bilgileri derliyorum...","Kaynakları tarıyorum...","Analiz ediyorum...","Yanıtı oluşturuyorum..."];function bC({messages:e,isTyping:t,chat:n,streamingContent:r}){var C,S,_,j;const i=v.useRef(null),s=v.useRef(null),[o,a]=v.useState(!0),l=v.useRef(!0),{widget:c,showActionButtons:d}=re(),u=Se(),p=v.useRef(!0),h=v.useRef(new Set),[y,x]=v.useState(0);v.useEffect(()=>{e.length>0&&p.current&&requestAnimationFrame(()=>{p.current=!1})},[e]),v.useEffect(()=>{e.length===0&&h.current.clear()},[e.length]),v.useEffect(()=>{if(!t||r===void 0||r)return;const A=setInterval(()=>{x(E=>(E+1)%fx.length)},2500);return()=>clearInterval(A)},[t,r]);const w=()=>{const A=s.current;A&&(A.scrollTop=A.scrollHeight)},m=()=>{if(s.current){const{scrollTop:A,scrollHeight:E,clientHeight:L}=s.current,F=E-A<=L+10;l.current=F,a(F)}};v.useEffect(()=>{(l.current||t)&&w()},[e,t,r]);const g=(A,E)=>{if(p.current)return{initial:!1,animate:{}};const L=A.id||"";return h.current.has(L)?E===ye.Customer?{initial:!1,animate:{opacity:1,x:0}}:{initial:!1,animate:{}}:(h.current.add(L),E===ye.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:{initial:!1,animate:{}})},b=A=>A===ye.Customer?"18px 18px 4px 18px":A===ye.User||A===ye.Agent?"18px 18px 18px 4px":u.getRadius();return f.jsxs("section",{onScroll:m,ref:s,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden scrollbar",children:[((S=(C=c==null?void 0:c.appearance)==null?void 0:C.design)==null?void 0:S.greeting_message)&&f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx("div",{className:"max-w-[80%] whitespace-pre-wrap border-0 px-3 py-2 !text-sm",style:{backgroundColor:u.getColor(k.MessageAdminBackground),color:u.getColor(k.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(j=(_=c==null?void 0:c.appearance)==null?void 0:_.design)==null?void 0:j.greeting_message})}),f.jsx(Ar,{children:Array.isArray(e)&&e.filter(E=>{var L;return E!=null&&(!!E.content||(((L=E.files)==null?void 0:L.length)??0)>0)&&E.content!==`
|
|
97
|
+
`}).map((E,L)=>{var D;const F=g(E,E.sender_type);return f.jsxs(Me.div,{initial:F.initial,animate:F.animate,transition:{duration:.25,ease:"easeOut"},className:Ve("flex flex-col w-full min-w-0 justify-center break-words",{"items-end":E.sender_type===ye.Customer||E.activity_type===gn.ChatCreated,"items-start":E.sender_type===ye.User||E.sender_type===ye.Agent,"items-center":E.sender_type===ye.System||E.sender_type===ye.Activity}),children:[E.sender_type===ye.System&&f.jsx("div",{className:"max-w-full whitespace-pre-wrap break-words overflow-hidden px-3 py-1.5 text-sm",style:{backgroundColor:u.getColor(k.MessageAdminBackground),color:u.getColor(k.MessageAdminText),borderRadius:u.getRadius()},children:E.content}),([ye.Customer,ye.User,ye.Agent].includes(E.sender_type)||E.activity_type===gn.ChatCreated)&&f.jsxs("div",{className:Ve("max-w-[80%] border-0 px-3 py-2",{"whitespace-pre-wrap !text-sm":E.sender_type===ye.Customer||E.activity_type===gn.ChatCreated||E.sender_type===ye.Agent&&!((D=E.content)!=null&&D.includes('id="chaty"'))}),style:{backgroundColor:E.sender_type===ye.User||E.sender_type===ye.Agent?u.getColor(k.MessageAdminBackground):u.getColor(k.MessageVisitorBackground),color:E.sender_type===ye.User||E.sender_type===ye.Agent?u.getColor(k.MessageAdminText):u.getColor(k.MessageVisitorText),borderRadius:b(E.sender_type)},children:[E.files&&E.files.length>0&&f.jsx(wC,{files:E.files,className:"mb-1",hideName:!0}),E.sender_type===ye.User||E.sender_type===ye.Agent?f.jsx(cx,{text:E.content}):E.content,E.created_at&&f.jsx("div",{className:"text-[0.5rem] text-right opacity-70 mt-1",style:{color:E.sender_type===ye.User||E.sender_type===ye.Agent?u.getColor(k.MessageAdminText):u.getColor(k.MessageVisitorText)},children:dx(E.created_at)})]}),([ye.Customer,ye.User,ye.Agent].includes(E.sender_type)||E.activity_type===gn.ChatCreated)&&E.buttons&&E.buttons.length>0&&f.jsx("div",{className:Ve("w-full",{"flex justify-end":E.sender_type===ye.Customer||E.activity_type===gn.ChatCreated,"flex justify-start":E.sender_type===ye.User||E.sender_type===ye.Agent}),children:f.jsx("div",{className:"max-w-[80%]",children:f.jsx(uF,{buttons:E.buttons})})}),E.sender_type===ye.Activity&&E.activity_type!==gn.ChatCreated&&f.jsx("div",{className:"max-w-full border-0 rounded-full px-3 py-1 text-xs shadow-none break-words overflow-hidden",style:{backgroundColor:u.getColor(k.MessageAdminBackground),color:u.getColor(k.MessageAdminText)},children:E.activity_type===gn.AdminLeave?`${E.content.split("_")[2]} odadan ayrıldı`:E.activity_type===gn.AdminJoin?`${E.content.split("_")[2]} odaya katıldı`:E.activity_type===gn.AdminToggleUpload?E.content.includes("is_customer_uploadable:true")?"Dosya gönderim izni açıldı":"Dosya gönderim izni kapatıldı":E.content}),ye.System===E.sender_type&&f.jsx("div",{className:"text-xs",style:{color:u.getColor(k.MessageAdminText)},children:E.created_at&&dx(E.created_at)})]},E.id||L)})}),t&&f.jsx(Me.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.2},className:"flex w-full items-center justify-start mt-1",children:r!==void 0?f.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap min-w-[4rem] !text-sm",style:{backgroundColor:u.getColor(k.MessageAdminBackground),color:u.getColor(k.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:r?f.jsx(cx,{text:r}):f.jsxs("div",{className:"flex items-center gap-2 py-1",children:[f.jsx(X.Sparkles,{className:"size-4 flex-shrink-0 sparkle-pulse",style:{color:u.getColor(k.MessageAdminText)}}),f.jsx(Ar,{mode:"wait",children:f.jsx(Me.span,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2},className:"!text-sm",style:{color:u.getColor(k.MessageAdminText)},children:fx[y]},y)})]})}):f.jsx("div",{className:"flex items-center rounded-full px-4 py-2",style:{backgroundColor:u.getColor(k.MessageAdminBackground)},children:f.jsxs("div",{className:"flex space-x-1",children:[f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:u.getColor(k.MessageAdminText),animationDelay:"0ms"}}),f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:u.getColor(k.MessageAdminText),animationDelay:"150ms"}}),f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:u.getColor(k.MessageAdminText),animationDelay:"300ms"}})]})})}),!o&&f.jsx("div",{className:"absolute right-4 z-10 transition-all duration-200",style:{bottom:d?"8rem":"7rem"},children:f.jsx(Rt,{type:"button",variant:"primary",kind:"solid",rounded:!0,className:"size-10 flex items-center justify-center p-0! shadow-md",onClick:()=>{var A,E;(E=s.current)==null||E.scrollTo({top:(A=s.current)==null?void 0:A.scrollHeight,behavior:"smooth"})},children:f.jsx(X.ArrowDown,{className:"size-4"})})}),f.jsx("div",{ref:i})]})}/**
|
|
98
98
|
* @license lucide-react v0.511.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const
|
|
102
|
+
*/const dF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fF=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),px=e=>{const t=fF(e);return t.charAt(0).toUpperCase()+t.slice(1)},kC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),pF=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
103
103
|
* @license lucide-react v0.511.0 - ISC
|
|
104
104
|
*
|
|
105
105
|
* This source code is licensed under the ISC license.
|
|
106
106
|
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/var
|
|
107
|
+
*/var hF={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
108
108
|
* @license lucide-react v0.511.0 - ISC
|
|
109
109
|
*
|
|
110
110
|
* This source code is licensed under the ISC license.
|
|
111
111
|
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const
|
|
112
|
+
*/const mF=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>v.createElement("svg",{ref:l,...hF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:kC("lucide",i),...!s&&!pF(a)&&{"aria-hidden":"true"},...a},[...o.map(([c,d])=>v.createElement(c,d)),...Array.isArray(s)?s:[s]]));/**
|
|
113
113
|
* @license lucide-react v0.511.0 - ISC
|
|
114
114
|
*
|
|
115
115
|
* This source code is licensed under the ISC license.
|
|
116
116
|
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const
|
|
117
|
+
*/const SC=(e,t)=>{const n=v.forwardRef(({className:r,...i},s)=>v.createElement(mF,{ref:s,iconNode:t,className:kC(`lucide-${dF(px(e))}`,`lucide-${e}`,r),...i}));return n.displayName=px(e),n};/**
|
|
118
118
|
* @license lucide-react v0.511.0 - ISC
|
|
119
119
|
*
|
|
120
120
|
* This source code is licensed under the ISC license.
|
|
121
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const
|
|
122
|
+
*/const gF=[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]],vF=SC("cloud-upload",gF);/**
|
|
123
123
|
* @license lucide-react v0.511.0 - ISC
|
|
124
124
|
*
|
|
125
125
|
* This source code is licensed under the ISC license.
|
|
126
126
|
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const gF=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],vF=bC("paperclip",gF);var kC={exports:{}},yF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",xF=yF,wF=xF;function SC(){}function CC(){}CC.resetWarningCache=SC;var bF=function(){function e(r,i,s,o,a,l){if(l!==wF){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:CC,resetWarningCache:SC};return n.PropTypes=n,n};kC.exports=bF();var kF=kC.exports;const Oe=Rr(kF);function vs(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{c(r.next(d))}catch(u){o(u)}}function l(d){try{c(r.throw(d))}catch(u){o(u)}}function c(d){d.done?s(d.value):i(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}const SF=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function wo(e,t,n){const r=CF(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&px(r,"path",s),px(r,"relativePath",s),r}function CF(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=SF.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function px(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const TF=[".DS_Store","Thumbs.db"];function _F(e){return vs(this,void 0,void 0,function*(){return Jc(e)&&EF(e.dataTransfer)?PF(e.dataTransfer,e.type):jF(e)?AF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?RF(e):[]})}function EF(e){return Jc(e)}function jF(e){return Jc(e)&&Jc(e.target)}function Jc(e){return typeof e=="object"&&e!==null}function AF(e){return th(e.target.files).map(t=>wo(t))}function RF(e){return vs(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>wo(n))})}function PF(e,t){return vs(this,void 0,void 0,function*(){if(e.items){const n=th(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(MF));return hx(TC(r))}return hx(th(e.files).map(n=>wo(n)))})}function hx(e){return e.filter(t=>TF.indexOf(t.name)===-1)}function th(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function MF(e){if(typeof e.webkitGetAsEntry!="function")return mx(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?_C(t):mx(e,t)}function TC(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?TC(n):[n]],[])}function mx(e,t){return vs(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,wo(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return wo(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function OF(e){return vs(this,void 0,void 0,function*(){return e.isDirectory?_C(e):NF(e)})}function _C(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>vs(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(OF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function NF(e){return vs(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=wo(r,e.fullPath);t(i)},r=>{n(r)})})})}var rf=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):i===a})}return!0};function gx(e){return LF(e)||IF(e)||jC(e)||DF()}function DF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
128
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
129
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
130
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
131
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OC(e,t){if(e){if(typeof e=="string")return rh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rh(e,t)}}function rh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function pB(e){if(Array.isArray(e))return e}function kx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function We(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kx(Object(n),!0).forEach(function(r){ih(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ih(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tu(e,t){if(e==null)return{};var n=hB(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function hB(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var ul=v.forwardRef(function(e,t){var n=e.children,r=tu(e,rB),i=mB(r),s=i.open,o=tu(i,iB);return v.useImperativeHandle(t,function(){return{open:s}},[s]),J.createElement(v.Fragment,null,n(We(We({},o),{},{open:s})))});ul.displayName="Dropzone";var NC={disabled:!1,getFilesFromEvent:_F,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};ul.defaultProps=NC;ul.propTypes={children:Oe.func,accept:Oe.objectOf(Oe.arrayOf(Oe.string)),multiple:Oe.bool,preventDropOnDocument:Oe.bool,noClick:Oe.bool,noKeyboard:Oe.bool,noDrag:Oe.bool,noDragEventsBubbling:Oe.bool,minSize:Oe.number,maxSize:Oe.number,maxFiles:Oe.number,disabled:Oe.bool,getFilesFromEvent:Oe.func,onFileDialogCancel:Oe.func,onFileDialogOpen:Oe.func,useFsAccessApi:Oe.bool,autoFocus:Oe.bool,onDragEnter:Oe.func,onDragLeave:Oe.func,onDragOver:Oe.func,onDrop:Oe.func,onDropAccepted:Oe.func,onDropRejected:Oe.func,onError:Oe.func,validator:Oe.func};var sh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=We(We({},NC),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,o=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,u=t.onDragOver,p=t.onDrop,m=t.onDropAccepted,y=t.onDropRejected,w=t.onFileDialogCancel,x=t.onFileDialogOpen,h=t.useFsAccessApi,g=t.autoFocus,k=t.preventDropOnDocument,C=t.noClick,S=t.noKeyboard,T=t.noDrag,j=t.noDragEventsBubbling,E=t.onError,A=t.validator,I=v.useMemo(function(){return eB(n)},[n]),N=v.useMemo(function(){return JF(n)},[n]),D=v.useMemo(function(){return typeof x=="function"?x:Sx},[x]),G=v.useMemo(function(){return typeof w=="function"?w:Sx},[w]),B=v.useRef(null),F=v.useRef(null),M=v.useReducer(gB,sh),$=sf(M,2),R=$[0],z=$[1],U=R.isFocused,W=R.isFileDialogActive,q=v.useRef(typeof window<"u"&&window.isSecureContext&&h&&ZF()),ne=function(){!q.current&&W&&setTimeout(function(){if(F.current){var V=F.current.files;V.length||(z({type:"closeDialog"}),G())}},300)};v.useEffect(function(){return window.addEventListener("focus",ne,!1),function(){window.removeEventListener("focus",ne,!1)}},[F,W,G,q]);var oe=v.useRef([]),me=function(V){B.current&&B.current.contains(V.target)||(V.preventDefault(),oe.current=[])};v.useEffect(function(){return k&&(document.addEventListener("dragover",bx,!1),document.addEventListener("drop",me,!1)),function(){k&&(document.removeEventListener("dragover",bx),document.removeEventListener("drop",me))}},[B,k]),v.useEffect(function(){return!r&&g&&B.current&&B.current.focus(),function(){}},[B,g,r]);var ue=v.useCallback(function(L){E?E(L):console.error(L)},[E]),Q=v.useCallback(function(L){L.preventDefault(),L.persist(),ve(L),oe.current=[].concat(aB(oe.current),[L.target]),Ul(L)&&Promise.resolve(i(L)).then(function(V){if(!(eu(L)&&!j)){var ae=V.length,fe=ae>0&&YF({files:V,accept:I,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:A}),Ce=ae>0&&!fe;z({isDragAccept:fe,isDragReject:Ce,isDragActive:!0,type:"setDraggedFiles"}),c&&c(L)}}).catch(function(V){return ue(V)})},[i,c,ue,j,I,o,s,a,l,A]),de=v.useCallback(function(L){L.preventDefault(),L.persist(),ve(L);var V=Ul(L);if(V&&L.dataTransfer)try{L.dataTransfer.dropEffect="copy"}catch{}return V&&u&&u(L),!1},[u,j]),H=v.useCallback(function(L){L.preventDefault(),L.persist(),ve(L);var V=oe.current.filter(function(fe){return B.current&&B.current.contains(fe)}),ae=V.indexOf(L.target);ae!==-1&&V.splice(ae,1),oe.current=V,!(V.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ul(L)&&d&&d(L))},[B,d,j]),te=v.useCallback(function(L,V){var ae=[],fe=[];L.forEach(function(Ce){var at=AC(Ce,I),vt=sf(at,2),Vn=vt[0],un=vt[1],ys=RC(Ce,o,s),fr=sf(ys,2),Nr=fr[0],xs=fr[1],Mo=A?A(Ce):null;if(Vn&&Nr&&!Mo)ae.push(Ce);else{var ki=[un,xs];Mo&&(ki=ki.concat(Mo)),fe.push({file:Ce,errors:ki.filter(function(Un){return Un})})}}),(!a&&ae.length>1||a&&l>=1&&ae.length>l)&&(ae.forEach(function(Ce){fe.push({file:Ce,errors:[GF]})}),ae.splice(0)),z({acceptedFiles:ae,fileRejections:fe,isDragReject:fe.length>0,type:"setFiles"}),p&&p(ae,fe,V),fe.length>0&&y&&y(fe,V),ae.length>0&&m&&m(ae,V)},[z,a,I,o,s,l,p,m,y,A]),O=v.useCallback(function(L){L.preventDefault(),L.persist(),ve(L),oe.current=[],Ul(L)&&Promise.resolve(i(L)).then(function(V){eu(L)&&!j||te(V,L)}).catch(function(V){return ue(V)}),z({type:"reset"})},[i,te,ue,j]),ee=v.useCallback(function(){if(q.current){z({type:"openDialog"}),D();var L={multiple:a,types:N};window.showOpenFilePicker(L).then(function(V){return i(V)}).then(function(V){te(V,null),z({type:"closeDialog"})}).catch(function(V){tB(V)?(G(V),z({type:"closeDialog"})):nB(V)?(q.current=!1,F.current?(F.current.value=null,F.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ue(V)});return}F.current&&(z({type:"openDialog"}),D(),F.current.value=null,F.current.click())},[z,D,G,h,te,ue,N,a]),K=v.useCallback(function(L){!B.current||!B.current.isEqualNode(L.target)||(L.key===" "||L.key==="Enter"||L.keyCode===32||L.keyCode===13)&&(L.preventDefault(),ee())},[B,ee]),xe=v.useCallback(function(){z({type:"focus"})},[]),ge=v.useCallback(function(){z({type:"blur"})},[]),He=v.useCallback(function(){C||(XF()?setTimeout(ee,0):ee())},[C,ee]),ot=function(V){return r?null:V},Bt=function(V){return S?null:ot(V)},se=function(V){return T?null:ot(V)},ve=function(V){j&&V.stopPropagation()},Je=v.useMemo(function(){return function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=L.refKey,ae=V===void 0?"ref":V,fe=L.role,Ce=L.onKeyDown,at=L.onFocus,vt=L.onBlur,Vn=L.onClick,un=L.onDragEnter,ys=L.onDragOver,fr=L.onDragLeave,Nr=L.onDrop,xs=tu(L,sB);return We(We(ih({onKeyDown:Bt(qn(Ce,K)),onFocus:Bt(qn(at,xe)),onBlur:Bt(qn(vt,ge)),onClick:ot(qn(Vn,He)),onDragEnter:se(qn(un,Q)),onDragOver:se(qn(ys,de)),onDragLeave:se(qn(fr,H)),onDrop:se(qn(Nr,O)),role:typeof fe=="string"&&fe!==""?fe:"presentation"},ae,B),!r&&!S?{tabIndex:0}:{}),xs)}},[B,K,xe,ge,He,Q,de,H,O,S,T,r]),P=v.useCallback(function(L){L.stopPropagation()},[]),Z=v.useMemo(function(){return function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=L.refKey,ae=V===void 0?"ref":V,fe=L.onChange,Ce=L.onClick,at=tu(L,oB),vt=ih({accept:I,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ot(qn(fe,O)),onClick:ot(qn(Ce,P)),tabIndex:-1},ae,F);return We(We({},vt),at)}},[F,n,a,O,r]);return We(We({},R),{},{isFocused:U&&!r,getRootProps:Je,getInputProps:Z,rootRef:B,inputRef:F,open:ot(ee)})}function gB(e,t){switch(t.type){case"focus":return We(We({},e),{},{isFocused:!0});case"blur":return We(We({},e),{},{isFocused:!1});case"openDialog":return We(We({},sh),{},{isFileDialogActive:!0});case"closeDialog":return We(We({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return We(We({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return We(We({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return We({},sh);default:return e}}function Sx(){}const DC=5*1024*1024,bo={"text/plain":[".txt"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"],"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],"image/svg+xml":[".svg"]},Cx=Object.values(bo).flat();function vB(e){var r;if(e.size>DC)return{isValid:!1,error:`Dosya boyutu 5MB'dan büyük olamaz. Seçilen dosya: ${(e.size/1024/1024).toFixed(2)}MB`};const t=`.${(r=e.name.split(".").pop())==null?void 0:r.toLowerCase()}`;return Object.keys(bo).includes(e.type)||Cx.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Cx.join(", ")}`}}function nu(e){for(const t of e){const n=vB(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function IC({onDrop:e}){const t=n=>{const r=nu(n);if(!r.isValid){alert(r.error);return}e(n)};return f.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:f.jsx(ul,{onDrop:t,accept:Object.keys(bo).reduce((n,r)=>(n[r]=bo[r],n),{}),maxSize:DC,children:({getRootProps:n,getInputProps:r})=>f.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[f.jsx("input",{...r()}),f.jsx("div",{className:"mb-3",children:f.jsx(mF,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),f.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",f.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}IC.Button=({onDrop:e})=>{const t=Se(),n=r=>{const i=nu(r);if(!i.isValid){er({description:i.error,variant:"error"});return}e(r)};return f.jsx(ul,{onDrop:n,accept:Object.keys(bo).reduce((r,i)=>(r[i]=bo[i],r),{}),children:({getRootProps:r,getInputProps:i})=>f.jsxs("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-center dz-message needsclick cursor-pointer",...r(),children:[f.jsx("input",{...i()}),f.jsx(vF,{style:{color:t.getColor(b.IconColor)},className:"size-5"})]})})};const Tx=[{name:"Yüzler",icon:"😊",emojis:["😀","😃","😄","😁","😆","😅","🤣","😂","🙂","😊","😇","🥰","😍","🤩","😘","😗","😚","😙","🥲","😋","😛","😜","🤪","😝","🤑","🤗","🤭","🤫","🤔","🫡","🤐","🤨","😐","😑","😶","🫥","😏","😒","🙄","😬","😮💨","🤥","😌","😔","😪","🤤","😴","😷","🤒","🤕","🤢","🤮","🥴","😵","🤯","🥳","🥸","😎","🤓","🧐","😕","🫤","😟","🙁","😮","😯","😲","😳","🥺","🥹","😦","😧","😨","😰","😥","😢","😭","😱","😖","😣","😞","😓","😩","😫","🥱","😤","😡","😠"]},{name:"El",icon:"👋",emojis:["👋","🤚","🖐️","✋","🖖","🫱","🫲","🫳","🫴","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","🫵","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🤝","🙏","💪","🦾"]},{name:"Kalp",icon:"❤️",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❤️🔥","❤️🩹","❣️","💕","💞","💓","💗","💖","💘","💝","💟","♥️","💋","🫂"]},{name:"Hayvan",icon:"🐱",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐻❄️","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🐤","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🪱","🐛","🦋","🐌","🐞","🐜","🪰","🐢","🐍","🦎","🐙"]},{name:"Yiyecek",icon:"🍕",emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🫐","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🫛","🥦","🥬","🌶️","🫑","🍕","🍔","🍟","🌭","🍿","🧀","🥚","🍳","🥞","🧇","🥓","🍖","🍗","🌮","🌯","🥗","☕","🍵","🧃","🥤","🍺","🍷","🥂","🍰"]},{name:"Aktivite",icon:"⚽",emojis:["⚽","🏀","🏈","⚾","🥎","🎾","🏐","🏉","🥏","🎱","🏓","🏸","🥅","⛳","🎯","🏹","🎣","🤿","🥊","🥋","🎿","⛷️","🏂","🪂","🏋️","🤸","🎮","🕹️","🎲","🧩","🎭","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🎷","🎺"]},{name:"Nesne",icon:"💡",emojis:["⌚","📱","💻","⌨️","🖥️","🖨️","🖱️","💾","💿","📷","📹","🎥","📞","📟","📠","📺","🔋","🔌","💡","🔦","🕯️","🧯","💰","💳","💎","🔧","🔨","🪛","🔩","⚙️","🔑","🗝️","📦","📫","📝","✏️","🖊️","📎","📌","✂️"]}];function LC({onSelect:e,isOpen:t,onClose:n}){const r=Se(),[i,s]=v.useState(0),o=v.useRef(null),a=v.useRef(null);return v.useEffect(()=>{if(!t)return;const l=c=>{o.current&&!o.current.contains(c.target)&&n()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[t,n]),v.useEffect(()=>{a.current&&(a.current.scrollTop=0)},[i]),f.jsx(jr,{children:t&&f.jsxs(Pe.div,{ref:o,onMouseDown:l=>l.stopPropagation(),initial:{opacity:0,y:8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.95},transition:{duration:.15},className:"absolute bottom-full left-0 mb-2 z-50 overflow-hidden",style:{width:"280px",backgroundColor:r.getColor(b.Background),border:`1px solid ${r.getColor(b.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(b.ShadowColor)}`},children:[f.jsx("div",{className:"flex items-center gap-0.5 px-1.5 py-1.5 overflow-x-auto",style:{borderBottom:`1px solid ${r.getColor(b.DividerColor)}`},children:Tx.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>s(c),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base transition-colors",style:{backgroundColor:c===i?r.getColor(b.InputBackground):"transparent"},title:l.name,children:l.icon},l.name))}),f.jsx("div",{ref:a,className:"grid grid-cols-8 gap-0.5 p-1.5 overflow-y-auto",style:{maxHeight:"200px"},children:Tx[i].emojis.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>{e(l),n()},className:"w-8 h-8 flex items-center justify-center rounded-md text-lg hover:scale-110 transition-transform",style:{backgroundColor:"transparent"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor=r.getColor(b.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${c}`))})]})})}function yB({onNewMessage:e,client_id:t,is_uploadable:n,messages:r,onEvaluateChat:i,onNewChat:s,onSendMessage:o,isHistoryMode:a=!1,historyChat:l}){const c=v.useRef(null),d=dr(),u=aM(t),p=Se(),m=cs(),{setIsInputFocused:y,showActionButtons:w,setShowActionButtons:x}=ie(),[h,g]=v.useState(""),[k,C]=v.useState("3rem"),[S,T]=v.useState(!1),[j,E]=v.useState([]),[A,I]=v.useState(0),[N,D]=v.useState(!1),[G,B]=v.useState(0),[F,M]=v.useState(null),[$,R]=v.useState(!1),z=()=>{if(!a||!l||l.status!==en.Closed||!l.closed_at)return!1;const Q=new Date(l.closed_at);return(new Date().getTime()-Q.getTime())/(1e3*60*60)>2},U=a&&(l==null?void 0:l.status)===en.Closed&&z();v.useEffect(()=>{if(r.length>0){const Q=r[r.length-1];Q.id!==F&&(M(Q.id),Q.sender_type===we.User&&(I(0),D(!1)))}},[r,F]),v.useEffect(()=>{let Q;return N&&G>0&&(Q=window.setTimeout(()=>{B(de=>de<=1?(D(!1),I(0),0):de-1)},1e3)),()=>clearTimeout(Q)},[N,G]),v.useEffect(()=>{const Q=c.current;if(Q){const de=()=>y(!0),H=()=>y(!1);return Q.addEventListener("focus",de),Q.addEventListener("blur",H),()=>{Q.removeEventListener("focus",de),Q.removeEventListener("blur",H)}}},[y]),v.useEffect(()=>{const Q=()=>{x(!0)},de=()=>{x(!1)};return d==null||d.on(ye.ChatUserShowButton,Q),d==null||d.on(ye.MessageUserCreate,de),()=>{d==null||d.off(ye.ChatUserShowButton,Q),d==null||d.off(ye.MessageUserCreate,de)}},[d,x]),v.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&x(!1)},[r,x]),Zc("lc:rate-limit",Q=>{const de=Q.detail&&Q.detail.seconds||3;D(!0),B(de),I(0)}),Zc("paste",Q=>{const de=Q.clipboardData.items,H=[];for(const te of de){const O=te.getAsFile();O&&H.push(O)}if(H.length>0&&!n){er({description:m(re.FileUploadDisabled),variant:"error"});return}if(H.length>0){const te=nu(H);if(!te.isValid){er({description:te.error,variant:"error"});return}E([...j,...H])}});const W=async()=>{if(!h.trim()&&(!n||j.length===0))return;if(A>5&&!N){D(!0),B(3);return}if(N||S)return;const Q=h,de=[...j];g(""),E([]),c.current&&(c.current.style.height="3rem",C("3rem")),T(!0);let H;if(n&&de.length>0){const[te,O]=await u.mutateAsync(de);if(!$n(O)){Bj(te,O),T(!1),g(Q),E(de);return}lM(te)&&(H=te.file_urls)}if(o){o(Q,H),T(!1);return}d==null||d.emit(Ve.MessageCreate,{content:Q,files:H},te=>{e(te),T(!1),I(O=>O+1),x(!1)})},q=Q=>{d==null||d.emit(Ve.MessageTyping,{content:Q})},ne=()=>{d==null||d.emit(Ve.ChatClose,{}),x(!1),i==null||i()},oe=()=>{d==null||d.emit(Ve.ChatClose,{}),x(!1),s==null||s()},me=v.useCallback(Q=>{const de=c.current;if(de){const H=de.selectionStart,te=de.selectionEnd,O=h.substring(0,H)+Q+h.substring(te);O.length<=2e3&&(g(O),q(O),setTimeout(()=>{de.selectionStart=de.selectionEnd=H+Q.length,de.focus()},0))}else{const H=h+Q;H.length<=2e3&&(g(H),q(H))}},[h]),ue=a&&(l==null?void 0:l.status)===en.Closed;return U?null:f.jsxs(f.Fragment,{children:[ue&&f.jsxs("div",{className:"px-5 flex flex-col gap-2",children:[f.jsxs("div",{className:"p-3 rounded-lg flex items-center gap-2",style:{backgroundColor:p.getColor(b.InputBackground),borderColor:p.getColor(b.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(X.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:p.getColor(b.FooterText)}}),f.jsx("span",{className:"text-sm",style:{color:p.getColor(b.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),f.jsxs(Rt,{size:"lg",onClick:()=>{s==null||s()},className:"rounded-lg gap-2 transition-all",children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]}),f.jsx(xo,{variant:"block"})]}),N&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 rounded-lg z-[100] p-2 flex items-center justify-center",style:{backgroundColor:p.getColor(b.ErrorBackground),borderColor:p.getColor(b.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 mr-2",style:{color:p.getColor(b.ErrorText)}}),f.jsx("span",{className:"text-sm font-medium",style:{color:p.getColor(b.ErrorText)},children:m(re.RateLimitMessage).replace("{seconds}",G.toString())})]}),w&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex gap-2",children:[f.jsxs(Rt,{className:"flex-1 flex items-center justify-center gap-2",size:"md",variant:"primary",kind:"outline",onClick:ne,style:{borderColor:p.getColor(b.ButtonBackground),color:p.getColor(b.ButtonBackground),backgroundColor:"transparent"},children:[f.jsx(X.Star,{className:"size-4"}),f.jsx("span",{children:"Değerlendir"})]}),f.jsxs(Rt,{size:"md",className:"flex-1 flex items-center justify-center gap-2",onClick:oe,children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet"})]})]}),(!a||a&&(l==null?void 0:l.status)!==en.Closed&&(l==null?void 0:l.status)!==en.Deleted)&&f.jsxs("form",{className:"flex flex-col relative",onSubmit:Q=>{Q.preventDefault(),W()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:p.getColor(b.DividerColor)}}),n&&j&&j.length>0&&f.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:f.jsx(yC,{files:j,onDelete:Q=>{E(j.filter((de,H)=>H!==Q))}})}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Yu,{id:"message",inputRef:c,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:N,style:{height:k,maxHeight:"6rem",opacity:N?.5:1,cursor:N?"not-allowed":"text",boxShadow:"none"},placeholder:N?m(re.RateLimitMessage).replace("{seconds}",G.toString()):m(re.MessagePlaceholder),value:h,maxLength:2e3,onChange:Q=>{if(N)return;const de=Q.target.value;if(de.length<=2e3&&(g(de),q(de)),de.length>0&&Q.currentTarget.scrollHeight>Q.currentTarget.clientHeight){const H=`${Q.currentTarget.scrollHeight}px`;Q.currentTarget.style.height=H,C(H)}else Q.currentTarget.style.height="3rem",C("3rem")},onKeyDown:Q=>{if(N){Q.preventDefault();return}Q.key==="Enter"&&!Q.shiftKey&&(Q.preventDefault(),W())}}),h.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:h.length>=2e3?p.getColor(b.ErrorText):p.getColor(b.FooterText),fontWeight:h.length>=2e3?"600":"normal"},children:2e3-h.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Pe.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",disabled:S||!h.trim()&&j.length===0||N,style:{opacity:1,color:h.trim()||j.length>0?p.getColor(b.ButtonBackground):p.getColor(b.FooterText)},children:S?f.jsx(X.Spin,{className:"size-4 animate-spin"}):N?f.jsx("span",{className:"text-[10px] font-bold",children:G}):f.jsx(X.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(LC,{isOpen:$,onClose:()=>R(!1),onSelect:me}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",onClick:()=>R(!$),className:"p-1.5 rounded-md transition-colors",style:{color:p.getColor(b.IconColor)},children:f.jsx(X.Emoji,{className:"size-5"})}),n&&f.jsx(IC.Button,{onDrop:Q=>{if(Q.length){const de=nu(Q);if(!de.isValid){er({description:de.error,variant:"error"});return}E([...j,...Q])}}})]}),f.jsx(xo,{variant:"inline"})]})]})]})}const _x=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function oh({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=v.useMemo(()=>{const o=e.charCodeAt(0)||0,a=_x[o%_x.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return f.jsxs(Pe.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center",children:[f.jsx("div",{className:"min-w-max",children:f.jsxs("span",{children:[t&&f.jsx("img",{className:"size-10 rounded-full border border-white/20 shadow-sm",src:t,"aria-label":e}),!t&&f.jsx("div",{className:"size-10 rounded-full flex items-center justify-center font-semibold text-white shadow-sm",style:{background:s},children:e.charAt(0).toUpperCase()})]})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:ze("line-clamp-1 font-medium",n),style:r?{color:r}:void 0,children:e}),i&&f.jsx("span",{className:"text-xs opacity-75 line-clamp-1",style:r?{color:r}:void 0,children:i})]})]})}function xB({chat:e,isTyping:t,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s,onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c=!1,spamWarningMessage:d,onDismissSpamWarning:u}){const{widget:p,setOpen:m,open:y,isHaveChat:w,isInputFocused:x}=ie(),h=ie(G=>G.historyChat),g=Se(),k=Po(),C=Xu(),S=dr(),T=gs(),j=v.useRef(new Set),E=v.useRef(!1),A=()=>{m(!1)},I=v.useCallback(()=>{if(!S||!y||!w||!Array.isArray(r))return;const G=r.filter(B=>B.sender_type===we.User&&!j.current.has(B.id)).map(B=>B.id);G.length!==0&&S.emit(Ve.MessageRead,{message_ids:G},B=>{if(B&&B.success===!0)for(const F of G)j.current.add(F)})},[S,r,y,w]);v.useEffect(()=>{y&&(E.current=!0),y&&w&&(x||E.current)&&(I(),E.current=!1)},[y,w,x,I]);const N=()=>{var B,F,M,$;return(($=(M=(F=(B=p==null?void 0:p.appearance)==null?void 0:B.head)==null?void 0:F.elements)==null?void 0:M.find(R=>R.type==="title"))==null?void 0:$.content)||"Müşteri Hizmetleri"},D=()=>{var F,M,$,R,z,U;if(c&&h)return"Geçmiş sohbet";if(e!=null&&e.agent_name)return e.agent_name;const G=(M=(F=p==null?void 0:p.appearance)==null?void 0:F.design)==null?void 0:M.greeting_header;return G||((U=(z=(R=($=p==null?void 0:p.appearance)==null?void 0:$.head)==null?void 0:R.elements)==null?void 0:z.find(W=>W.type==="text"))==null?void 0:U.content)||"Bizimle Sohbet Edin"};return f.jsxs(f.Fragment,{children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:g.getColor(b.HeaderBackground),color:g.getColor(b.HeaderText),borderColor:g.getColor(b.HeaderBorder),...k?{}:{borderTopLeftRadius:g.getRadius(),borderTopRightRadius:g.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[c&&f.jsx("button",{type:"button",onClick:()=>{ie.getState().setHistoryChat(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!0),T.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.ArrowLeft,{className:"w-5 h-5"})}),(()=>{var G,B,F,M;if(c&&h){const $=(G=h.who_joined_details)==null?void 0:G[0],R=(B=h.participant_logs)==null?void 0:B[0],z=($==null?void 0:$.name)||(R==null?void 0:R.name)||((F=h.archive_summary)==null?void 0:F.admin_name);if(z){const U=($==null?void 0:$.avatar)||((M=h.archive_summary)==null?void 0:M.agent_avatar)||void 0;return f.jsx(oh,{name:z,avatar:U,textColor:g.getColor(b.HeaderText)})}}return!c&&(e!=null&&e.agent_name)?f.jsx(oh,{name:e.agent_name,avatar:e.agent_avatar,textColor:g.getColor(b.HeaderText)}):f.jsx("div",{className:"flex-1 min-w-0",children:c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"font-medium truncate",children:N()}),f.jsx("div",{className:"text-sm opacity-90 truncate",children:D()})]}):f.jsx("div",{className:"font-medium truncate",children:D()})})})()]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!c||c&&(e==null?void 0:e.status)!==en.Closed)&&f.jsx(iF,{onChatClose:s}),C&&f.jsx("button",{type:"button",onClick:A,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(xC,{messages:r,isTyping:t||n.length>0,chat:e}),f.jsx(jr,{children:d&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2",style:{backgroundColor:g.getColor(b.ErrorBackground),borderColor:g.getColor(b.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:g.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:g.getColor(b.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:g.getColor(b.ErrorText)},children:d}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:g.getColor(b.ErrorText)},children:f.jsx(X.X,{className:"size-4"})})]})}),f.jsx(yB,{client_id:(p==null?void 0:p.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:G=>{i(G)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c,historyChat:c?ie.getState().historyChat:void 0})]})}function wB({rating:e,onChange:t}){const n=Se();return f.jsx("div",{className:"flex items-center justify-center gap-0.5 my-2",children:[1,2,3,4,5].map(r=>{const i=r<=e,s=!i&&r-.5<=e;return f.jsxs(Pe.div,{className:"relative w-8 h-8 cursor-pointer",whileHover:{scale:1.15},whileTap:{scale:.95},transition:{duration:.15},children:[f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(b.StarInactiveColor),fill:n.getColor(b.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),s&&f.jsx("div",{className:"absolute top-0 left-0 w-4 h-8 overflow-hidden",children:f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(b.StarActiveColor),fill:n.getColor(b.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})}),i&&f.jsx("svg",{className:"w-8 h-8 absolute top-0 left-0",style:{color:n.getColor(b.StarActiveColor),fill:n.getColor(b.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),f.jsxs("div",{className:"absolute inset-0 flex",children:[f.jsx("button",{type:"button",onClick:()=>t(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),f.jsx("button",{type:"button",onClick:()=>t(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function bB({onOk:e}){const t=Se(),n=cs(),r=Xu(),[i,s]=v.useState(0),[o,a]=v.useState(!1),[l,c]=v.useState(10),d=oM(),[u,p]=v.useState(!1);v.useEffect(()=>{if(o){const x=setInterval(()=>{c(h=>h<=1?(clearInterval(x),e(!0),0):h-1)},1e3);return()=>clearInterval(x)}},[o]);const m=Zm({comment:Kc()}),y=XS({init:{comment:""},schema:m,action:async x=>{const[h,g]=await d.mutateAsync({rating:i,comment:x.comment});if($n(g)){a(!0);return}ho(h,{form:y})}}),w=()=>{e(!0)};return f.jsxs(Pe.div,{className:"flex flex-col h-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[f.jsxs("header",{className:"min-h-[48px] flex-shrink-0 overflow-visible flex justify-between items-center z-10 px-5 py-2.5",style:{borderColor:t.getColor(b.HeaderBorder),color:t.getColor(b.HeaderText)},children:[f.jsx("div",{className:"font-medium !text-sm",children:n(o?re.RatingHeaderThanks:re.RatingHeaderEvaluate)}),r&&f.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1.5 rounded-md hover:opacity-70 transition-opacity",style:{color:t.getColor(b.HeaderText)},children:f.jsx(X.X,{className:"size-4"})})]}),f.jsx("div",{className:"flex-1 p-4 overflow-y-auto flex flex-col",children:o?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[f.jsx("div",{className:"mb-3",style:{color:t.getColor(b.SuccessText)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),f.jsx("h2",{className:"text-lg font-semibold mb-1.5",style:{color:t.getColor(b.HeaderText)},children:n(re.RatingThankYouTitle)}),f.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(b.FooterText)},children:n(re.RatingThankYouDescription)}),f.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(b.FooterText)},children:n(re.RatingCountdown).replace("{seconds}",l.toString())}),f.jsx(Rt,{onClick:w,size:"md",className:"w-full max-w-xs",children:n(re.RatingNewConversation)})]}):f.jsxs("div",{className:"flex flex-col",children:[f.jsx("div",{className:"text-center mb-4",children:f.jsx("p",{className:"text-sm",style:{color:t.getColor(b.FooterText)},children:n(re.RatingDescription)})}),f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-center font-medium mb-1.5 text-base",style:{color:t.getColor(b.RatingRateConversationText)},children:n(re.RatingRateConversation)}),f.jsx(wB,{rating:i,onChange:x=>{s(x),x>=1&&p(!1)}}),i>0&&f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(b.FooterText)},children:n(re.RatingYourScore).replace("{score}",Number.isInteger(i)?i.toString():i.toFixed(1))}),i>0&&i<1||u?f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(b.ErrorText)},children:n(re.RatingMinimumError)}):null]}),f.jsxs("form",{onSubmit:y.handleSubmit,className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"comment",className:"block text-xs font-medium mb-1",style:{color:t.getColor(b.InputText)},children:n(re.RatingComment)}),f.jsx(Yu,{id:"comment",onChange:y.handleChange,onBlur:y.handleBlur,value:y.values.comment,placeholder:n(re.RatingCommentPlaceholder),className:"rounded-lg",error:y.errors.comment})]}),f.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[f.jsx(Rt,{type:"submit",size:"lg",onClick:x=>{i<1&&(x.preventDefault(),x.stopPropagation(),p(!0))},className:"w-full",children:n(re.RatingSubmit)}),f.jsx(Rt,{onClick:w,size:"lg",variant:"secondary",kind:"subtle",className:"w-full",bgKey:b.GreeterBackground,textKey:b.GreeterText,children:n(re.RatingNewConversation)})]})]})]})}),f.jsx(xo,{variant:"block"})]})}function kB({onSendMessage:e,disabled:t,loading:n=!1}){const r=v.useRef(null),i=Se(),s=cs(),{setIsInputFocused:o}=ie(),[a,l]=v.useState(""),[c,d]=v.useState("3rem"),[u,p]=v.useState(!1),m=v.useRef(n);v.useEffect(()=>{m.current&&!n&&!t&&setTimeout(()=>{var x;(x=r.current)==null||x.focus()},100),m.current=n},[n,t]),v.useEffect(()=>{t&&p(!1)},[t]);const y=()=>{if(!a.trim()||t)return;const x=a;l(""),r.current&&(r.current.style.height="3rem",d("3rem")),e(x)},w=v.useCallback(x=>{if(t)return;const h=r.current;if(h){const g=h.selectionStart,k=h.selectionEnd,C=a.substring(0,g)+x+a.substring(k);C.length<=2e3&&(l(C),setTimeout(()=>{h.selectionStart=h.selectionEnd=g+x.length,h.focus()},0))}else{const g=a+x;g.length<=2e3&&l(g)}},[a,t]);return f.jsxs("form",{className:"flex flex-col relative",onSubmit:x=>{x.preventDefault(),y()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:i.getColor(b.DividerColor)}}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Yu,{id:"ai-message",inputRef:r,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:t,style:{height:c,maxHeight:"6rem",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},placeholder:s(re.MessagePlaceholder),value:a,maxLength:2e3,onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:x=>{if(t)return;const h=x.target.value;if(h.length<=2e3&&l(h),h.length>0&&x.currentTarget.scrollHeight>x.currentTarget.clientHeight){const g=`${x.currentTarget.scrollHeight}px`;x.currentTarget.style.height=g,d(g)}else x.currentTarget.style.height="3rem",d("3rem")},onKeyDown:x=>{if(t){x.preventDefault();return}x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),y())}}),a.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:a.length>=2e3?i.getColor(b.ErrorText):i.getColor(b.FooterText),fontWeight:a.length>=2e3?"600":"normal"},children:2e3-a.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Pe.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",withoutTheming:!0,disabled:t||!a.trim(),style:{opacity:1,backgroundColor:"transparent",color:a.trim()?i.getColor(b.ButtonBackground):i.getColor(b.FooterText)},children:n?f.jsx(X.Spin,{className:"size-4 animate-spin"}):f.jsx(X.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(LC,{isOpen:u,onClose:()=>p(!1),onSelect:w}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsx("div",{className:"flex items-center gap-1",children:f.jsx("button",{type:"button",disabled:t,onClick:()=>!t&&p(!u),className:"p-1.5 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{color:i.getColor(b.IconColor)},children:f.jsx(X.Emoji,{className:"size-5"})})}),f.jsx(xo,{variant:"inline"})]})]})}const of=[Ne.Light,Ne.Dark,Ne.System];function SB(e){switch(e){case Ne.Light:return X.Sun;case Ne.Dark:return X.Moon;case Ne.System:return X.Monitor;default:return X.Monitor}}function CB({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>gC()),a=v.useRef(null),l=v.useRef(null),c=Se(),d=cs(),{mode:u,setMode:p}=c,m=()=>e(),y=()=>{const h=of.indexOf(u),g=of[(h+1)%of.length];p(g)},w=()=>{const h=!s;vC(h),o(h)};v.useEffect(()=>{if(!r)return;const h=g=>{var k,C;(k=l.current)!=null&&k.contains(g.target)||(C=a.current)!=null&&C.contains(g.target)||i(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r]);const x=r&&f.jsxs(Pe.div,{ref:l,onMouseDown:h=>h.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(b.Background),borderColor:c.getColor(b.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(b.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(b.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0"}),d(re.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(b.InputText)},onClick:w,children:[s?f.jsx(X.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(X.Volume2,{className:"size-4 flex-shrink-0"}),d(s?re.NotificationSoundOn:re.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(b.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(b.InputText)},onClick:y,children:[(()=>{const h=SB(u);return f.jsx(h,{className:"size-4 flex-shrink-0"})})(),u===Ne.Light?"Açık tema":u===Ne.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(jr,{children:t&&f.jsx(Pe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(b.ModalOverlayColor)},children:f.jsxs(Pe.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(b.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(b.ChatCloseConfirmText)},children:d(re.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(b.FooterText)},children:d(re.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(b.GreeterBackground),color:c.getColor(b.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(re.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(b.ErrorBackground),color:c.getColor(b.ErrorText),borderRadius:c.getRadius()},onClick:m,children:d(re.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(h=>!h),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(b.HeaderText)},title:d(re.ChatSettings),"aria-expanded":r,children:f.jsx(X.Menu,{className:"size-5"})}),f.jsx(jr,{children:x})]})]})}function TB({onOperatorConnected:e,onChatClose:t}){var ue,Q,de;const{widget:n,setOpen:r,aiAgent:i,aiAgentMessages:s,addAIAgentMessage:o,setAIAgentMessages:a,aiAgentSessionId:l,setAIAgentSessionId:c,humanNeedRequested:d,setHumanNeedRequested:u,setIsAIAgentMode:p}=ie(),m=Se(),y=Po(),w=Xu(),x=dr(),h=gs(),[g,k]=v.useState(!1),[C,S]=v.useState(!1),[T,j]=v.useState(!1),[E,A]=v.useState(!1),[I,N]=v.useState(""),[D,G]=v.useState(!1),[B,F]=v.useState(0),[M,$]=v.useState(null),R=()=>{r(!1)},z=()=>{u(!1),t()},U=(((de=(Q=(ue=n==null?void 0:n.appearance)==null?void 0:ue.body)==null?void 0:Q.inputs)==null?void 0:de.length)||0)>0,W=v.useRef(!1),q=v.useRef(!1);v.useEffect(()=>{if(!i||W.current)return;if(s.length>0){W.current=!0;return}if(!x||!x.connected){const O=setInterval(()=>{x&&x.connected&&(clearInterval(O),H())},100),ee=setTimeout(()=>{clearInterval(O),W.current||te()},3e3);return()=>{clearInterval(O),clearTimeout(ee)}}H();function H(){W.current||!x||(W.current=!0,x.emit(Ve.MessageList,{},O=>{Array.isArray(O)&&O.length>0?a(O):te()}))}function te(){if(!i)return;const O={id:Ip(),content:`Merhaba! Ben ${i.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:we.User};o(O)}},[x,i,s.length,a,o]),v.useEffect(()=>{if(g)if(I)S(!0);else{const H=setTimeout(()=>S(!0),1e3);return()=>clearTimeout(H)}else S(!1)},[g,I]),v.useEffect(()=>{if(B>0){const H=requestAnimationFrame(()=>F(0));return()=>cancelAnimationFrame(H)}},[B]),v.useEffect(()=>{if(!x)return;const H=({token:K})=>{N(xe=>xe+K)},te=K=>{K!=null&&K.human_need&&u(!0)},O=K=>{K.repeat_count===3&&$(K.message)},ee=()=>{t()};return x.on(ye.AgentMessageChunk,H),x.on(ye.AgentMessageFinalMetadata,te),x.on(ye.AgentSpamWarning,O),x.on(ye.AgentSpamBanned,ee),()=>{x.off(ye.AgentMessageChunk,H),x.off(ye.AgentMessageFinalMetadata,te),x.off(ye.AgentSpamWarning,O),x.off(ye.AgentSpamBanned,ee)}},[x,u,t]);const ne=v.useCallback(H=>{if(!n||!i||!x||d||T||q.current)return;q.current=!0;const te=`temp-${Date.now()}`,O={id:te,content:H,created_at:new Date,files:[],sender_type:we.Customer};o(O),N(""),G(!0),k(!0),j(!0);const ee=l||mi(n.link_id);x.emit(Ve.AgentMessageCreate,{question:H,agent_id:i.id,session_id:ee},K=>{if(q.current=!1,G(!1),N(""),k(!1),j(!1),!K){const xe={id:Ip(),content:"Üzgünüm, bir hata oluştu. Lütfen tekrar deneyin veya canlı destek personelimıze bağlanın.",created_at:new Date,files:[],sender_type:we.System};a(ge=>ge.filter(He=>He.id!==te).concat([xe])),u(!0);return}K.session_id&&c(K.session_id),o(K.agent_message),K.human_need&&u(!0)})},[n,i,d,T,x,l,o,a,c,u]),oe=v.useCallback(H=>{if(!x||E)return;A(!0);const te=()=>{x.emit(Ve.AgentRequestHuman,{},O=>{A(!1),O!=null&&O.success?(ie.getState().setIsHaveChat(!0),p(!1),u(!1),ie.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};H&&Object.keys(H).length>0?x.emit(Ve.ChatUpdateInputs,{inputs:H},O=>{O!=null&&O.success?te():(console.error("Failed to update chat inputs"),A(!1))}):te()},[x,E,p,u,e]),me=()=>{U?h.push("registration"):oe()};return i?f.jsxs("div",{className:"flex flex-col h-full min-h-0 flex-1 w-full",children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:m.getColor(b.HeaderBackground),color:m.getColor(b.HeaderText),borderColor:m.getColor(b.HeaderBorder),...y?{}:{borderTopLeftRadius:m.getRadius(),borderTopRightRadius:m.getRadius()}},children:[f.jsx("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:f.jsx(oh,{name:i.name,avatar:i.avatar,textColor:m.getColor(b.HeaderText),subtitle:"AI Asistan"})}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(CB,{onChatClose:z}),w&&f.jsx("button",{type:"button",onClick:R,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full overflow-hidden",children:[f.jsx(xC,{messages:s,isTyping:C||g&&!!I,streamingContent:D?I:void 0,skipAnimationForLastN:B}),f.jsx(jr,{children:M&&f.jsxs(Pe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2 flex-shrink-0",style:{backgroundColor:m.getColor(b.ErrorBackground),borderColor:m.getColor(b.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:m.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:m.getColor(b.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:m.getColor(b.ErrorText)},children:M}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>$(null),style:{color:m.getColor(b.ErrorText)},children:f.jsx(X.X,{className:"size-4"})})]})}),d?f.jsx(Pe.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},className:"flex-shrink-0 w-full flex flex-col items-stretch justify-center px-4 pt-8 pb-10",style:{backgroundColor:m.getColor(b.Background)},children:f.jsx(Pe.div,{className:"relative w-full max-w-lg mx-auto overflow-hidden",style:{borderRadius:m.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:f.jsx(Rt,{onClick:me,disabled:E,size:"lg",className:"w-full flex items-center justify-center gap-2",children:E?f.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):f.jsxs(f.Fragment,{children:[f.jsx(X.User,{className:"w-5 h-5"}),f.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})}):f.jsx(kB,{onSendMessage:ne,disabled:T,loading:T})]})]}):null}function _B({children:e}){const{widget:t}=ie();return t?f.jsx("section",{className:"h-full w-full relative",children:e}):null}function EB({children:e}){const t=dr(),n=gs(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=ie(),[o,a]=v.useState(!0),[l,c]=v.useState(!1),d=v.useRef(!1);return v.useEffect(()=>{if(r){a(!1);return}if(!t){a(!1);return}const u=()=>{a(!1),c(!1),d.current=!0},p=()=>{i&&s||(c(!0),n.push("registration"))};return t.on(ye.Connect,u),t.on(ye.Disconnect,p),t.connected?(a(!1),d.current=!0):t.connect(),()=>{t.off(ye.Connect,u),t.off(ye.Disconnect,p)}},[t,r,i,s,n]),i&&s||r?e:!t||l?(t||n.push("registration"),f.jsx(eh,{})):d.current&&!t.connected?f.jsx(eh,{}):o||!t.connected?f.jsx(mC,{}):e}function Ex(e,t){const n=new Map;for(const r of t)r!=null&&r.id&&n.set(r.id,r);for(const r of e)r!=null&&r.id&&!n.has(r.id)&&n.set(r.id,r);return Array.from(n.values()).sort((r,i)=>new Date(r.created_at).getTime()-new Date(i.created_at).getTime())}function jB(){const{widget:e,setOpen:t,setIsHaveChat:n,historyChat:r,setHistoryChat:i,historyMessages:s,setHistoryMessages:o,aiAgent:a,isAIAgentMode:l,clearAIAgentState:c}=ie(),d=Se(),u=dr(),{connected:p,connectionReady:m}=u,y=al(),w=gs(),x=Po(),[h,g]=v.useState(null),[k,C]=v.useState([]),[S,T]=v.useState(!1),[j,E]=v.useState([]),[A,I]=v.useState([]),[N,D]=v.useState(!1),G=qm(),B=v.useRef(!1),F=v.useRef(null),M=v.useRef(!1),[$,R]=v.useState(!1),[z,U]=v.useState(null);v.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:p,connectionReady:m,hasChat:!!h,chatViewEmitted:B.current})},[p,m,h]),v.useEffect(()=>{if(h||r||l){R(!1);return}const O=setTimeout(()=>{!h&&!r&&!l&&(console.warn("WS: Connection timeout reached in ChatDetailView"),R(!0))},1e4);return()=>clearTimeout(O)},[h,r,l]),v.useEffect(()=>{if(!r||!e)return;if(g({status:r.status,is_customer_uploadable:!1}),s){C(s);return}const O=mi(e.link_id);dM(r._id,e.link_id,O).then(([ee,K])=>{if($n(K)&&Array.isArray(ee)){const xe=ee.map(ge=>({id:ge._id,content:ge.content,created_at:ge.created_at,files:ge.files,sender_type:ge.sender_type,activity_type:ge.activity_type,answers:ge.answers,reply_id:ge.reply_id,buttons:ge.buttons}));C(xe),o(xe)}}).catch(ee=>{console.error("Failed to load history messages",ee)})},[r,e,s,o]),v.useEffect(()=>{if(!e||l||r)return;const O=mr(e.link_id);O.isAgentMode&&O.agent&&(console.log("ChatDetailView: Recovering AI Agent state from localStorage"),ie.getState().setAIAgent(O.agent),ie.getState().setIsAIAgentMode(!0),O.sessionId&&ie.getState().setAIAgentSessionId(O.sessionId),O.humanNeedRequested&&ie.getState().setHumanNeedRequested(!0))},[e,l,r]);const W=async(O,ee)=>{var Bt;if(!e)return;if(!r){const se=`temp-${Date.now()}`,ve={id:se,content:O,created_at:new Date,files:ee||[],sender_type:we.Customer,answers:[],reply_id:void 0,buttons:[]};C(Je=>[...Je,ve]),u==null||u.emit(Ve.MessageCreate,{content:O,files:ee},Je=>{const P=Array.isArray(Je)?Je[0]:Je;if(P&&P.isError){C(L=>L.filter(V=>V.id!==se));const Z=(P==null?void 0:P.error)||(P==null?void 0:P.message);(!Z||!/too\s+many/i.test(Z))&&ho(P),typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:3}}));return}C(Z=>Z.map(L=>L.id===se?P:L))});return}const K={},xe=e.appearance;if((Bt=xe==null?void 0:xe.body)!=null&&Bt.inputs){for(const se of xe.body.inputs)if(se.required||se.remember){const ve=ma(se.name);ve&&(K[se.name]=ve)}}const ge=ie.getState().defaultValues;if(ge){ge.username&&(K.username=ge.username),ge.secret_data&&(K.secret_data=ge.secret_data);for(const se in ge)K[se]||(K[se]=ge[se])}const[He,ot]=await G.mutateAsync({inputs:K,history:[],client_id:e.client_id,widget_id:e.link_id,device_id:mi(e.link_id)});if($n(ot)){i(null),n(!0),He&&typeof He=="object"&&"customer_token"in He&&(Ln(rt.CustomerToken,He.customer_token,e.link_id),Ln(rt.CustomerRefreshToken,He.customer_refresh_token,e.link_id));let se=0;const ve=20,Je=`temp-${Date.now()}`,P={id:Je,content:O,created_at:new Date,files:ee||[],sender_type:we.Customer,answers:[],reply_id:void 0,buttons:[]};C(L=>[...L,P]);const Z=setInterval(()=>{se+=1,u!=null&&u.connected?(u.emit(Ve.MessageCreate,{content:O,files:ee},L=>{const V=Array.isArray(L)?L[0]:L;if(V&&V.isError){C(fe=>fe.filter(Ce=>Ce.id!==Je));const ae=(V==null?void 0:V.error)||(V==null?void 0:V.message);(!ae||!/too\s+many/i.test(ae))&&ho(V),typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:3}}));return}C(ae=>ae.map(fe=>fe.id===Je?V:fe))}),clearInterval(Z)):se>=ve&&clearInterval(Z)},200)}},q=O=>{!O&&!x&&t(!1),D(!0),fa((e==null?void 0:e.link_id)||""),n(!1),g(null),C([]),E([]),i(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!1),c(),oc(e.client_id,Yi(y)).then(()=>{u==null||u.disconnect(),w.push("registration")})},ne=()=>{h?(localStorage.setItem("showActionButtons","false"),g({...h,status:en.Closed})):q(!1)};v.useEffect(()=>{if(u&&!(l&&a)){if(r){B.current=!1,M.current=!1;return}if(!p||!m){p||(M.current=!1,B.current=!1,F.current=null);return}M.current=!0,!(!e||B.current)&&(B.current=!0,console.log("ChatView: Emitting chat:view request"),u.emit(Ve.ChatView,{},O=>{if(console.log("ChatView: Received response",{chatReceived:O!==null,chatStatus:O==null?void 0:O.status,hasAgentName:!!(O!=null&&O.agent_name),hasError:O&&"error"in O}),ie.getState().historyChat){B.current=!1;return}if(O===null||O&&"error"in O||!(O!=null&&O.status)){console.log("ChatView returned invalid chat (null, error, or missing status), cleaning up and redirecting to registration",{chat:O}),t(!1),n(!1),oc(e.client_id,Yi(y)),C([]),E([]),i(null),ie.getState().setHistoryMessages(null),c(),fa((e==null?void 0:e.link_id)||""),u.disconnect(),w.push("registration"),B.current=!1;return}console.log("ChatView: Setting chat state",{status:O.status}),g(O),n(!0)}))}},[r,u,e,p,m,y,w,t,n,i,l,a,c]);const oe=()=>{ne()},me=()=>{q(!0)},[ue,Q]=v.useState(!1),de=v.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),B.current=!1,F.current=null,M.current=!1;const O=ie.getState().aiAgentMessages;O.length>0&&C(O),Q(!0)},[]);v.useEffect(()=>{if(ue){if(!u||!p||!m){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:p,connectionReady:m});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),B.current){Q(!1);return}B.current=!0,u.emit(Ve.ChatView,{},O=>{console.log("handleOperatorConnected: ChatView result",O),O&&!("error"in O)&&O.status?(g(O),n(!0),u.emit(Ve.MessageList,{},K=>{console.log("handleOperatorConnected: MessageList result",K),Array.isArray(K)&&C(xe=>Ex(xe,K))})):(console.log("handleOperatorConnected: Invalid chat result, clearing state",O),n(!1)),Q(!1)})}},[ue,u,p,m,n]);const H=()=>{c(),x||t(!1),D(!0),fa((e==null?void 0:e.link_id)||""),n(!1),g(null),C([]),E([]),i(null),ie.getState().setHistoryMessages(null),ie.getState().setShowHistoryOnRegistration(!1),oc(e.client_id,Yi(y)).then(()=>{u==null||u.disconnect(),w.push("registration")})},te=v.useCallback(O=>{if(l&&a&&!r){const{aiAgentMessages:ee,addAIAgentMessage:K}=ie.getState();if(ee.some(xe=>xe.id===O.id))return;K(O);return}h&&![en.Closed,en.Deleted].includes(h.status)&&C(ee=>{const K=ee.filter(ge=>{var He;return!((He=ge.id)!=null&&He.startsWith("temp-")&&ge.content===O.content)});return K.some(ge=>ge.id===O.id)?K:[...K,O]})},[h,l,a,r]);return v.useEffect(()=>{if(!u)return;const O=se=>{const ve={content:se.content,created_at:se.created_at,files:se.files,id:se._id,sender_type:se.sender_type,answers:se.answers,reply_id:se.reply_id,buttons:se.buttons};if(j.length>0){E(Je=>[...Je,ve]);return}se.is_shortcut?E([ve]):te(ve),T(!1)},ee=se=>{const ve={content:se.content,created_at:se.created_at,files:se.files,id:se._id,sender_type:se.sender_type,activity_type:se.activity_type,sender_name:se.sender_name,answers:se.answers,reply_id:se.reply_id,buttons:se.buttons};te(ve)},K=se=>{!se||!se.name?g(ve=>ve?{...ve,agent_name:void 0,agent_avatar:void 0}:null):(g(ve=>ve?{...ve,agent_name:se.name,agent_avatar:se.avatar}:null),I(ve=>ve.includes(se.name)?ve:[...ve,se.name]))},xe=()=>{T(!0)},ge=()=>{ne()},He=({is_customer_uploadable:se})=>{g(ve=>ve?{...ve,is_customer_uploadable:se}:null)},ot=se=>{I(ve=>{const Je=ve.filter(P=>P!==se.name);return se.hasOtherAdmins?Je.length>0&&g(P=>P?{...P,agent_name:Je[0],agent_avatar:void 0}:null):g(P=>P?{...P,agent_name:void 0,agent_avatar:void 0}:null),Je})},Bt=se=>{I(ve=>ve.includes(se.name)?ve:[...ve,se.name]),g(ve=>ve?ve.agent_name?ve:{...ve,agent_name:se.name,agent_avatar:void 0}:null)};return u.on(ye.MessageAgentCreate,O),u.on(ye.MessageUserCreate,ee),u.on(ye.MessageCustomerCreate,ee),u.on(ye.ChatUserAssignee,K),u.on(ye.MessageAgentTyping,xe),u.on(ye.ChatUserClose,ge),u.on(ye.ChatToggleUpload,He),u.on(ye.ChatUserLeave,ot),u.on(ye.ChatUserJoin,Bt),()=>{u.off(ye.MessageAgentCreate,O),u.off(ye.MessageUserCreate,ee),u.off(ye.MessageCustomerCreate,ee),u.off(ye.ChatUserAssignee,K),u.off(ye.MessageAgentTyping,xe),u.off(ye.ChatUserClose,ge),u.off(ye.ChatToggleUpload,He),u.off(ye.ChatUserLeave,ot),u.off(ye.ChatUserJoin,Bt)}},[te,A]),v.useEffect(()=>{if(!u)return;const O=K=>{K.repeat_count===3&&U(K.message)},ee=()=>{u.emit(Ve.ChatClose,{}),ie.getState().setShowActionButtons(!1),ne()};return u.on(ye.AgentSpamWarning,O),u.on(ye.AgentSpamBanned,ee),()=>{u.off(ye.AgentSpamWarning,O),u.off(ye.AgentSpamBanned,ee)}},[u,ne]),v.useEffect(()=>{if(!u||!h||r){F.current=null;return}const O=`${h.status}-${h.agent_name||"no-agent"}`;F.current!==O&&(F.current=O,u.emit(Ve.MessageList,{},ee=>{if(!Array.isArray(ee)){console.warn("MessageList response is not an array:",ee),F.current=null;return}C(ge=>Ex(ge,ee));const K=new Map;for(const ge of ee)ge.sender_type===we.Activity&&(ge.activity_type===mn.AdminJoin&&ge.sender_name?K.set(ge.sender_name,!0):ge.activity_type===mn.AdminLeave&&ge.sender_name&&K.set(ge.sender_name,!1));const xe=Array.from(K.entries()).filter(([ge,He])=>He).map(([ge])=>ge);I(xe)}))},[u,h,r]),v.useEffect(()=>{const O=setTimeout(()=>{T(!1)},2e3);return()=>clearTimeout(O)},[S]),v.useEffect(()=>{if(!e||j.length===0)return;let O=0;e.writing_timeout&&(O=[...j[0].content].length/e.writing_timeout,O<0&&(O=0));const ee=setTimeout(()=>{te(j[0]),E(j.slice(1))},O*1e3);return()=>clearTimeout(ee)},[j,e]),N?f.jsx(eh,{}):l&&a&&!r?f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${x?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:x?"100%":"",minHeight:x?"var(--app-height, 100dvh)":"",maxHeight:x?"var(--app-height, 100dvh)":"",backgroundColor:d.getColor(b.Background)},children:f.jsx(TB,{onOperatorConnected:de,onChatClose:H})})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${x?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:x?"100%":"",minHeight:x?"var(--app-height, 100dvh)":"",maxHeight:x?"var(--app-height, 100dvh)":"",backgroundColor:d.getColor(b.Background)},children:h?h.status===en.Closed&&!r?f.jsx(bB,{onOk:q}):f.jsx(xB,{chat:h,isTyping:S,messages:k,shortcutMessages:j,onNewMessage:te,onChatClose:ne,onEvaluateChat:oe,onNewChat:me,onSendMessage:W,isHistoryMode:!!r,spamWarningMessage:z,onDismissSpamWarning:()=>U(null)}):$?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[f.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:d.getColor(b.InputBorder)},children:f.jsx(X.XCircle,{className:"w-6 h-6 opacity-50"})}),f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Bağlantı Kurulamadı"}),f.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Sunucuyla bağlantı sağlanırken bir sorun oluştu. Lütfen tekrar deneyin."}),f.jsx("button",{type:"button",onClick:()=>q(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:d.getColor(b.ButtonBackground),color:d.getColor(b.ButtonText),borderRadius:d.getRadius()},children:"Tekrar Dene"})]}):f.jsx(mC,{})})]})}function AB(){return WL(),null}function RB(){return f.jsxs(EB,{children:[f.jsx(_B,{children:f.jsx(jB,{})}),f.jsx(AB,{})]})}const PB=[{path:"/chat",component:RB,name:"chat"}],FC=[...PB],BC=[...QL],MB=[...FC,...BC];function ah({text:e}){var c,d,u,p;const{widget:t,isHaveChat:n,isTooltipVisible:r,setIsTooltipVisible:i,onTooltipClose:s}=ie(),o=Se(),a=cs(),l=()=>{i(!1),s&&s()};return r?f.jsxs(Pe.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:ze("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:o.getRadius(),backgroundColor:o.getColor(b.TooltipBackground),color:o.getColor(b.TooltipText)},children:[f.jsx("button",{onClick:l,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":a(re.CloseButtonAria),children:f.jsx(X.X,{className:"size-3"})}),f.jsx(Pe.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:o.getColor(b.TooltipText)},children:e||(n?(d=(c=t==null?void 0:t.appearance)==null?void 0:c.design)==null?void 0:d.tooltip_message_active:(p=(u=t==null?void 0:t.appearance)==null?void 0:u.design)==null?void 0:p.tooltip_message)||a(n?re.TooltipActive:re.TooltipDefault)}),f.jsx("div",{className:"absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5",style:{backgroundColor:o.getColor(b.TooltipBackground)}})]},"widget-tooltip"):null}function jx({fallback:e,fallbackOpen:t}){const[n]=v.useState(window.document.title),r=dr(),{isHaveChat:i,open:s,soundPath:o}=ie(),[a,l]=v.useState(!0),[c,d]=v.useState(0),[u,p]=v.useState(null),m=cs(),y=()=>{nF(o)},w=(x,h)=>{if(u&&clearInterval(u),x||!i||h===0||Number.isNaN(h)){window.document.title=n,p(null);return}const g=setInterval(()=>{if(x||!i||h===0||Number.isNaN(h)){window.document.title=n,clearInterval(g),p(null);return}const k=`${h} ${m(re.NewMessagesNotification)} - ${n}`;window.document.title!==k?window.document.title=k:window.document.title=n},1e3);return p(g),()=>{clearInterval(g),p(null)}};return v.useEffect(()=>w(s&&a,c),[c,s,a]),v.useEffect(()=>{const x=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",x,!1),()=>{document.removeEventListener("visibilitychange",x)}},[]),v.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const x=()=>{!i||s&&a||(d(h=>h+1),y())};return r.on(ye.MessageAgentCreate,x),r.on(ye.ChatUserAssignee,y),()=>{r.off(ye.MessageAgentCreate,x),r.off(ye.ChatUserAssignee,y)}},[r,i,s,a]),s?null:i&&c>0?f.jsx(ah,{text:m(re.NewMessagesNotification)}):!i&&t?e:null}function OB({children:e,border:t}){var $,R,z,U;const n=dr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c,humanNeedRequested:d}=ie(),[u]=v.useState(!0),p=gs(),m=al(),y=um(),w=Se(),{resolvedMode:x}=w,h=Po(),g=UL(),[k,C]=v.useState({x:0,y:0}),S=yP(),T=v.useRef(null),j=v.useRef(null),[E,A]=v.useState(!1),[I,N]=v.useState(!1);v.useEffect(()=>((()=>{A("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{A(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{A(!0)})}),[]),v.useEffect(()=>{o&&y.pathname==="/"&&m&&m.accessToken&&!d&&p.push("chat")},[o,y.pathname,m,p,d]),v.useEffect(()=>{r?requestAnimationFrame(()=>{N(!0)}):N(!1)},[r]);const D=W=>{if(!T.current||!j.current)return W;const q=T.current.getBoundingClientRect(),ne={width:window.innerWidth,height:window.innerHeight},oe={top:20,right:20,bottom:40,left:20};let me=W.x,ue=W.y;return q.right+me-k.x>ne.width-oe.right&&(me=ne.width-oe.right-q.width-(q.left-k.x)),q.left+me-k.x<oe.left&&(me=oe.left-(q.left-k.x)),q.bottom+ue-k.y>ne.height-oe.bottom&&(ue=ne.height-oe.bottom-q.height-(q.top-k.y)),q.top+ue-k.y<oe.top&&(ue=oe.top-(q.top-k.y)),{x:me,y:ue}},G=()=>{i(!0),n&&(n.emit(Ve.WidgetOpen,{}),l&&l())},B=()=>{i(!1),n&&(n.emit(Ve.WidgetClose,{}),c&&c())},F=()=>{i(!1),s(!1),oc(a.client_id,Yi(m)),p.push("registration")};v.useEffect(()=>{if(h&&(o||g)&&G(),!(!n||!a))return n.on(ye.Banned,F),()=>{n.off(ye.Banned,F)}},[]);function M(W){E&&S.start(W)}return f.jsxs("section",{className:"relative w-full h-full",ref:j,"data-theme":x,children:[r&&f.jsx("div",{className:ze("fixed z-300 overflow-hidden transition-all duration-300 ease-out",{"":t&&!h,"bottom-24 right-8 rounded-xl":!h,"!bottom-0 !right-0":h,"opacity-100 scale-100 translate-y-0":I,"opacity-0 scale-95 translate-y-2":!I}),style:{width:h?"100%":((R=($=a==null?void 0:a.appearance)==null?void 0:$.design)==null?void 0:R.width)||"21rem",height:h?"var(--app-height, 100dvh)":((U=(z=a==null?void 0:a.appearance)==null?void 0:z.design)==null?void 0:U.height)||"30rem",left:h?"0":"",right:h?"0px !important":"",maxHeight:h?"var(--app-height, 100dvh)":"",boxShadow:h?"":`0 10px 25px -5px ${w.getColor(b.ShadowColor)}, 0 8px 10px -6px ${w.getColor(b.ShadowColor)}`,backgroundColor:w.getColor(b.Background)},children:e}),!E&&f.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[f.jsx(jx,{fallback:f.jsx(ah,{}),fallbackOpen:u}),!r&&f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:G,children:[f.jsx(Pe.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ze("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:w.getColor(b.ButtonBackground)}}),f.jsx(X.Chat,{className:"size-6"})]},"desktop-open-button"),r&&!h&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:B,children:f.jsx(X.ArrowDown2,{className:"size-6"})},"desktop-close-button")]}),E&&f.jsxs(Pe.div,{ref:T,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:k.x,y:k.y},drag:E,dragControls:S,dragMomentum:!1,dragElastic:0,onDragEnd:(W,q)=>{const ne={x:k.x+q.offset.x,y:k.y+q.offset.y},oe=D(ne);C(oe)},children:[f.jsx(jx,{fallback:f.jsx(ah,{}),fallbackOpen:u}),!r&&f.jsx("div",{className:"cursor-move",onPointerDown:M,children:f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:G,children:[f.jsx(Pe.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:ze("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:w.getColor(b.ButtonBackground)}}),f.jsx(X.Chat,{className:"size-6"})]})},"chat-button"),r&&!h&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:B,children:f.jsx(X.ArrowDown2,{className:"size-6"})},"desktop-close-button")]})]})}function NB(e){const{widget:t}=ie();return f.jsx(AP,{widget:t,children:f.jsx(OB,{...e})})}function DB(){const{isHaveChat:e,isAIAgentMode:t}=ie();return f.jsx(ij,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:f.jsx(NB,{border:!0,children:f.jsxs(oj,{children:[FC.map((n,r)=>f.jsx(pp,{path:n.path,element:f.jsx(n.component,{})},r)),BC.map((n,r)=>f.jsx(pp,{path:n.path,element:f.jsx(n.component,{})},r))]})})})}const IB=v.forwardRef((e,t)=>{const n=localStorage.getItem("lc:device:id"),{data:r,isLoading:i,error:s}=cE(e.link_id,n||void 0),{widget:o,setWidget:a,setSoundPath:l,setDefaultValues:c,setOpen:d,setOnTooltipClose:u,setIsTooltipVisible:p,setOnOpen:m,setOnClose:y,onOpen:w,onClose:x}=ie();return v.useImperativeHandle(t,()=>({open:()=>{d(!0),w&&w()},close:()=>{d(!1),x&&x()}})),v.useEffect(()=>{r&&dE(r)&&a(r),e.soundPath&&l(e.soundPath),e.defaultValues&&c(e.defaultValues),e.onTooltipClose&&u(e.onTooltipClose),e.showTooltip===!1&&p(!1),e.onOpen&&m(e.onOpen),e.onClose&&y(e.onClose)},[r,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),i?f.jsx("div",{children:"Loading..."}):s||!r||!o?null:f.jsx(OI,{children:f.jsx(VL,{children:f.jsx(DB,{})})})}),LB=new q_;let Ax=null;function FB(e){if(!e.container)return;const t=J.createRef();return Ax=Jw(e.container),Ax.render(f.jsxs(X_,{client:LB,children:[f.jsx(IB,{...e,ref:t}),f.jsx(Nj,{richColors:!0,style:{zIndex:999999,position:"fixed",bottom:"20px",right:"20px"},position:"bottom-right"})]})),{open:()=>{var n;return(n=t.current)==null?void 0:n.open()},close:()=>{var n;return(n=t.current)==null?void 0:n.close()},identify:n=>{if(!e.link_id)return;const r=mi(e.link_id);cM({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=FB});export default BB();
|
|
127
|
+
*/const yF=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],xF=SC("paperclip",yF);var CC={exports:{}},wF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",bF=wF,kF=bF;function _C(){}function TC(){}TC.resetWarningCache=_C;var SF=function(){function e(r,i,s,o,a,l){if(l!==kF){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:TC,resetWarningCache:_C};return n.PropTypes=n,n};CC.exports=SF();var CF=CC.exports;const Ne=Rr(CF);function vs(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{c(r.next(d))}catch(u){o(u)}}function l(d){try{c(r.throw(d))}catch(u){o(u)}}function c(d){d.done?s(d.value):i(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}const _F=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function wo(e,t,n){const r=TF(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&hx(r,"path",s),hx(r,"relativePath",s),r}function TF(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=_F.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function hx(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const EF=[".DS_Store","Thumbs.db"];function AF(e){return vs(this,void 0,void 0,function*(){return eu(e)&&jF(e.dataTransfer)?OF(e.dataTransfer,e.type):RF(e)?PF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?MF(e):[]})}function jF(e){return eu(e)}function RF(e){return eu(e)&&eu(e.target)}function eu(e){return typeof e=="object"&&e!==null}function PF(e){return nh(e.target.files).map(t=>wo(t))}function MF(e){return vs(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>wo(n))})}function OF(e,t){return vs(this,void 0,void 0,function*(){if(e.items){const n=nh(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(NF));return mx(EC(r))}return mx(nh(e.files).map(n=>wo(n)))})}function mx(e){return e.filter(t=>EF.indexOf(t.name)===-1)}function nh(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function NF(e){if(typeof e.webkitGetAsEntry!="function")return gx(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?AC(t):gx(e,t)}function EC(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?EC(n):[n]],[])}function gx(e,t){return vs(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,wo(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return wo(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function DF(e){return vs(this,void 0,void 0,function*(){return e.isDirectory?AC(e):IF(e)})}function AC(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>vs(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(DF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function IF(e){return vs(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=wo(r,e.fullPath);t(i)},r=>{n(r)})})})}var sf=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(o){var a=o.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?s===a.replace(/\/.*$/,""):i===a})}return!0};function vx(e){return BF(e)||FF(e)||RC(e)||LF()}function LF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
128
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function BF(e){if(Array.isArray(e))return rh(e)}function yx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yx(Object(n),!0).forEach(function(r){jC(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ya(e,t){return VF(e)||zF(e,t)||RC(e,t)||$F()}function $F(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
129
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RC(e,t){if(e){if(typeof e=="string")return rh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return rh(e,t)}}function rh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function VF(e){if(Array.isArray(e))return e}var UF=typeof sf=="function"?sf:sf.default,HF="file-invalid-type",WF="file-too-large",qF="file-too-small",GF="too-many-files",YF=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:HF,message:"File type must be ".concat(r)}},wx=function(t){return{code:WF,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},bx=function(t){return{code:qF,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},QF={code:GF,message:"Too many files"};function PC(e,t){var n=e.type==="application/x-moz-file"||UF(e,t);return[n,n?null:YF(t)]}function MC(e,t,n){if(Ri(e.size))if(Ri(t)&&Ri(n)){if(e.size>n)return[!1,wx(n)];if(e.size<t)return[!1,bx(t)]}else{if(Ri(t)&&e.size<t)return[!1,bx(t)];if(Ri(n)&&e.size>n)return[!1,wx(n)]}return[!0,null]}function Ri(e){return e!=null}function KF(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,o=e.maxFiles,a=e.validator;return!s&&t.length>1||s&&o>=1&&t.length>o?!1:t.every(function(l){var c=PC(l,n),d=Ya(c,1),u=d[0],p=MC(l,r,i),h=Ya(p,1),y=h[0],x=a?a(l):null;return u&&y&&!x})}function tu(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Hl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function kx(e){e.preventDefault()}function XF(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function ZF(e){return e.indexOf("Edge/")!==-1}function JF(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return XF(e)||ZF(e)}function Gn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return t.some(function(a){return!tu(r)&&a&&a.apply(void 0,[r].concat(s)),tu(r)})}}function eB(){return"showOpenFilePicker"in window}function tB(e){if(Ri(e)){var t=Object.entries(e).filter(function(n){var r=Ya(n,2),i=r[0],s=r[1],o=!0;return OC(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(s)||!s.every(NC))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=Ya(r,2),s=i[0],o=i[1];return xx(xx({},n),{},jC({},s,o))},{});return[{description:"Files",accept:t}]}return e}function nB(e){if(Ri(e))return Object.entries(e).reduce(function(t,n){var r=Ya(n,2),i=r[0],s=r[1];return[].concat(vx(t),[i],vx(s))},[]).filter(function(t){return OC(t)||NC(t)}).join(",")}function rB(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function iB(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function OC(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function NC(e){return/^.*\.[\w]+$/.test(e)}var sB=["children"],oB=["open"],aB=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],lB=["refKey","onChange","onClick"];function cB(e){return fB(e)||dB(e)||DC(e)||uB()}function uB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
130
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fB(e){if(Array.isArray(e))return ih(e)}function of(e,t){return mB(e)||hB(e,t)||DC(e,t)||pB()}function pB(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
131
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DC(e,t){if(e){if(typeof e=="string")return ih(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ih(e,t)}}function ih(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function hB(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,a;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(l){s=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw a}}return r}}function mB(e){if(Array.isArray(e))return e}function Sx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ge(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sx(Object(n),!0).forEach(function(r){sh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nu(e,t){if(e==null)return{};var n=gB(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gB(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var dl=v.forwardRef(function(e,t){var n=e.children,r=nu(e,sB),i=vB(r),s=i.open,o=nu(i,oB);return v.useImperativeHandle(t,function(){return{open:s}},[s]),J.createElement(v.Fragment,null,n(Ge(Ge({},o),{},{open:s})))});dl.displayName="Dropzone";var IC={disabled:!1,getFilesFromEvent:AF,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};dl.defaultProps=IC;dl.propTypes={children:Ne.func,accept:Ne.objectOf(Ne.arrayOf(Ne.string)),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,autoFocus:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,onError:Ne.func,validator:Ne.func};var oh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function vB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Ge(Ge({},IC),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,o=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,d=t.onDragLeave,u=t.onDragOver,p=t.onDrop,h=t.onDropAccepted,y=t.onDropRejected,x=t.onFileDialogCancel,w=t.onFileDialogOpen,m=t.useFsAccessApi,g=t.autoFocus,b=t.preventDropOnDocument,C=t.noClick,S=t.noKeyboard,_=t.noDrag,j=t.noDragEventsBubbling,A=t.onError,E=t.validator,L=v.useMemo(function(){return nB(n)},[n]),F=v.useMemo(function(){return tB(n)},[n]),D=v.useMemo(function(){return typeof w=="function"?w:Cx},[w]),G=v.useMemo(function(){return typeof x=="function"?x:Cx},[x]),z=v.useRef(null),$=v.useRef(null),N=v.useReducer(yB,oh),M=of(N,2),P=M[0],B=M[1],U=P.isFocused,W=P.isFileDialogActive,q=v.useRef(typeof window<"u"&&window.isSecureContext&&m&&eB()),se=function(){!q.current&&W&&setTimeout(function(){if($.current){var H=$.current.files;H.length||(B({type:"closeDialog"}),G())}},300)};v.useEffect(function(){return window.addEventListener("focus",se,!1),function(){window.removeEventListener("focus",se,!1)}},[$,W,G,q]);var ie=v.useRef([]),pe=function(H){z.current&&z.current.contains(H.target)||(H.preventDefault(),ie.current=[])};v.useEffect(function(){return b&&(document.addEventListener("dragover",kx,!1),document.addEventListener("drop",pe,!1)),function(){b&&(document.removeEventListener("dragover",kx),document.removeEventListener("drop",pe))}},[z,b]),v.useEffect(function(){return!r&&g&&z.current&&z.current.focus(),function(){}},[z,g,r]);var ce=v.useCallback(function(I){A?A(I):console.error(I)},[A]),_e=v.useCallback(function(I){I.preventDefault(),I.persist(),Bt(I),ie.current=[].concat(cB(ie.current),[I.target]),Hl(I)&&Promise.resolve(i(I)).then(function(H){if(!(tu(I)&&!j)){var te=H.length,de=te>0&&KF({files:H,accept:L,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:E}),xe=te>0&&!de;B({isDragAccept:de,isDragReject:xe,isDragActive:!0,type:"setDraggedFiles"}),c&&c(I)}}).catch(function(H){return ce(H)})},[i,c,ce,j,L,o,s,a,l,E]),Re=v.useCallback(function(I){I.preventDefault(),I.persist(),Bt(I);var H=Hl(I);if(H&&I.dataTransfer)try{I.dataTransfer.dropEffect="copy"}catch{}return H&&u&&u(I),!1},[u,j]),Y=v.useCallback(function(I){I.preventDefault(),I.persist(),Bt(I);var H=ie.current.filter(function(de){return z.current&&z.current.contains(de)}),te=H.indexOf(I.target);te!==-1&&H.splice(te,1),ie.current=H,!(H.length>0)&&(B({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Hl(I)&&d&&d(I))},[z,d,j]),V=v.useCallback(function(I,H){var te=[],de=[];I.forEach(function(xe){var Ue=PC(xe,L),lt=of(Ue,2),Un=lt[0],dn=lt[1],ys=MC(xe,o,s),fr=of(ys,2),Nr=fr[0],xs=fr[1],Mo=E?E(xe):null;if(Un&&Nr&&!Mo)te.push(xe);else{var ki=[dn,xs];Mo&&(ki=ki.concat(Mo)),de.push({file:xe,errors:ki.filter(function(Hn){return Hn})})}}),(!a&&te.length>1||a&&l>=1&&te.length>l)&&(te.forEach(function(xe){de.push({file:xe,errors:[QF]})}),te.splice(0)),B({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),p&&p(te,de,H),de.length>0&&y&&y(de,H),te.length>0&&h&&h(te,H)},[B,a,L,o,s,l,p,h,y,E]),Z=v.useCallback(function(I){I.preventDefault(),I.persist(),Bt(I),ie.current=[],Hl(I)&&Promise.resolve(i(I)).then(function(H){tu(I)&&!j||V(H,I)}).catch(function(H){return ce(H)}),B({type:"reset"})},[i,V,ce,j]),ue=v.useCallback(function(){if(q.current){B({type:"openDialog"}),D();var I={multiple:a,types:F};window.showOpenFilePicker(I).then(function(H){return i(H)}).then(function(H){V(H,null),B({type:"closeDialog"})}).catch(function(H){rB(H)?(G(H),B({type:"closeDialog"})):iB(H)?(q.current=!1,$.current?($.current.value=null,$.current.click()):ce(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ce(H)});return}$.current&&(B({type:"openDialog"}),D(),$.current.value=null,$.current.click())},[B,D,G,m,V,ce,F,a]),O=v.useCallback(function(I){!z.current||!z.current.isEqualNode(I.target)||(I.key===" "||I.key==="Enter"||I.keyCode===32||I.keyCode===13)&&(I.preventDefault(),ue())},[z,ue]),ae=v.useCallback(function(){B({type:"focus"})},[]),ee=v.useCallback(function(){B({type:"blur"})},[]),ke=v.useCallback(function(){C||(JF()?setTimeout(ue,0):ue())},[C,ue]),he=function(H){return r?null:H},Ze=function(H){return S?null:he(H)},qe=function(H){return _?null:he(H)},Bt=function(H){j&&H.stopPropagation()},fe=v.useMemo(function(){return function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=I.refKey,te=H===void 0?"ref":H,de=I.role,xe=I.onKeyDown,Ue=I.onFocus,lt=I.onBlur,Un=I.onClick,dn=I.onDragEnter,ys=I.onDragOver,fr=I.onDragLeave,Nr=I.onDrop,xs=nu(I,aB);return Ge(Ge(sh({onKeyDown:Ze(Gn(xe,O)),onFocus:Ze(Gn(Ue,ae)),onBlur:Ze(Gn(lt,ee)),onClick:he(Gn(Un,ke)),onDragEnter:qe(Gn(dn,_e)),onDragOver:qe(Gn(ys,Re)),onDragLeave:qe(Gn(fr,Y)),onDrop:qe(Gn(Nr,Z)),role:typeof de=="string"&&de!==""?de:"presentation"},te,z),!r&&!S?{tabIndex:0}:{}),xs)}},[z,O,ae,ee,ke,_e,Re,Y,Z,S,_,r]),R=v.useCallback(function(I){I.stopPropagation()},[]),K=v.useMemo(function(){return function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=I.refKey,te=H===void 0?"ref":H,de=I.onChange,xe=I.onClick,Ue=nu(I,lB),lt=sh({accept:L,multiple:a,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:he(Gn(de,Z)),onClick:he(Gn(xe,R)),tabIndex:-1},te,$);return Ge(Ge({},lt),Ue)}},[$,n,a,Z,r]);return Ge(Ge({},P),{},{isFocused:U&&!r,getRootProps:fe,getInputProps:K,rootRef:z,inputRef:$,open:he(ue)})}function yB(e,t){switch(t.type){case"focus":return Ge(Ge({},e),{},{isFocused:!0});case"blur":return Ge(Ge({},e),{},{isFocused:!1});case"openDialog":return Ge(Ge({},oh),{},{isFileDialogActive:!0});case"closeDialog":return Ge(Ge({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Ge(Ge({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ge(Ge({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Ge({},oh);default:return e}}function Cx(){}const LC=5*1024*1024,bo={"text/plain":[".txt"],"application/pdf":[".pdf"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/msword":[".doc"],"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/gif":[".gif"],"image/webp":[".webp"],"image/svg+xml":[".svg"]},_x=Object.values(bo).flat();function xB(e){var r;if(e.size>LC)return{isValid:!1,error:`Dosya boyutu 5MB'dan büyük olamaz. Seçilen dosya: ${(e.size/1024/1024).toFixed(2)}MB`};const t=`.${(r=e.name.split(".").pop())==null?void 0:r.toLowerCase()}`;return Object.keys(bo).includes(e.type)||_x.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${_x.join(", ")}`}}function ru(e){for(const t of e){const n=xB(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function FC({onDrop:e}){const t=n=>{const r=ru(n);if(!r.isValid){alert(r.error);return}e(n)};return f.jsx("div",{className:"flex items-center justify-center border rounded-md cursor-pointer bg-slate-100 dropzone border-slate-200 dz-clickable",children:f.jsx(dl,{onDrop:t,accept:Object.keys(bo).reduce((n,r)=>(n[r]=bo[r],n),{}),maxSize:LC,children:({getRootProps:n,getInputProps:r})=>f.jsxs("div",{className:"w-full py-5 text-lg text-center dz-message needsclick",...n(),children:[f.jsx("input",{...r()}),f.jsx("div",{className:"mb-3",children:f.jsx(vF,{className:"block size-12 mx-auto text-slate-500 fill-slate-200"})}),f.jsxs("h5",{className:"mb-0 font-normal text-slate-500 text-15",children:["Yüklemek istediğiniz görseli buraya sürükleyin veya"," ",f.jsx("span",{className:"text-custom-500",children:"seçmek için tıklayın"})]})]})})})}FC.Button=({onDrop:e})=>{const t=Se(),n=r=>{const i=ru(r);if(!i.isValid){en({description:i.error,variant:"error"});return}e(r)};return f.jsx(dl,{onDrop:n,accept:Object.keys(bo).reduce((r,i)=>(r[i]=bo[i],r),{}),children:({getRootProps:r,getInputProps:i})=>f.jsxs("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center text-center dz-message needsclick cursor-pointer",...r(),children:[f.jsx("input",{...i()}),f.jsx(xF,{style:{color:t.getColor(k.IconColor)},className:"size-5"})]})})};const Tx=[{name:"Yüzler",icon:"😊",emojis:["😀","😃","😄","😁","😆","😅","🤣","😂","🙂","😊","😇","🥰","😍","🤩","😘","😗","😚","😙","🥲","😋","😛","😜","🤪","😝","🤑","🤗","🤭","🤫","🤔","🫡","🤐","🤨","😐","😑","😶","🫥","😏","😒","🙄","😬","😮💨","🤥","😌","😔","😪","🤤","😴","😷","🤒","🤕","🤢","🤮","🥴","😵","🤯","🥳","🥸","😎","🤓","🧐","😕","🫤","😟","🙁","😮","😯","😲","😳","🥺","🥹","😦","😧","😨","😰","😥","😢","😭","😱","😖","😣","😞","😓","😩","😫","🥱","😤","😡","😠"]},{name:"El",icon:"👋",emojis:["👋","🤚","🖐️","✋","🖖","🫱","🫲","🫳","🫴","👌","🤌","🤏","✌️","🤞","🫰","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","🫵","👍","👎","✊","👊","🤛","🤜","👏","🙌","🫶","👐","🤲","🤝","🙏","💪","🦾"]},{name:"Kalp",icon:"❤️",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❤️🔥","❤️🩹","❣️","💕","💞","💓","💗","💖","💘","💝","💟","♥️","💋","🫂"]},{name:"Hayvan",icon:"🐱",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐻❄️","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🐤","🦆","🦅","🦉","🦇","🐺","🐗","🐴","🦄","🐝","🪱","🐛","🦋","🐌","🐞","🐜","🪰","🐢","🐍","🦎","🐙"]},{name:"Yiyecek",icon:"🍕",emojis:["🍎","🍐","🍊","🍋","🍌","🍉","🍇","🍓","🫐","🍈","🍒","🍑","🥭","🍍","🥥","🥝","🍅","🍆","🥑","🫛","🥦","🥬","🌶️","🫑","🍕","🍔","🍟","🌭","🍿","🧀","🥚","🍳","🥞","🧇","🥓","🍖","🍗","🌮","🌯","🥗","☕","🍵","🧃","🥤","🍺","🍷","🥂","🍰"]},{name:"Aktivite",icon:"⚽",emojis:["⚽","🏀","🏈","⚾","🥎","🎾","🏐","🏉","🥏","🎱","🏓","🏸","🥅","⛳","🎯","🏹","🎣","🤿","🥊","🥋","🎿","⛷️","🏂","🪂","🏋️","🤸","🎮","🕹️","🎲","🧩","🎭","🎨","🎬","🎤","🎧","🎼","🎹","🥁","🎷","🎺"]},{name:"Nesne",icon:"💡",emojis:["⌚","📱","💻","⌨️","🖥️","🖨️","🖱️","💾","💿","📷","📹","🎥","📞","📟","📠","📺","🔋","🔌","💡","🔦","🕯️","🧯","💰","💳","💎","🔧","🔨","🪛","🔩","⚙️","🔑","🗝️","📦","📫","📝","✏️","🖊️","📎","📌","✂️"]}];function BC({onSelect:e,isOpen:t,onClose:n}){const r=Se(),[i,s]=v.useState(0),o=v.useRef(null),a=v.useRef(null);return v.useEffect(()=>{if(!t)return;const l=c=>{o.current&&!o.current.contains(c.target)&&n()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[t,n]),v.useEffect(()=>{a.current&&(a.current.scrollTop=0)},[i]),f.jsx(Ar,{children:t&&f.jsxs(Me.div,{ref:o,onMouseDown:l=>l.stopPropagation(),initial:{opacity:0,y:8,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:8,scale:.95},transition:{duration:.15},className:"absolute bottom-full left-0 mb-2 z-50 overflow-hidden",style:{width:"280px",backgroundColor:r.getColor(k.Background),border:`1px solid ${r.getColor(k.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(k.ShadowColor)}`},children:[f.jsx("div",{className:"flex items-center gap-0.5 px-1.5 py-1.5 overflow-x-auto",style:{borderBottom:`1px solid ${r.getColor(k.DividerColor)}`},children:Tx.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>s(c),className:"flex-shrink-0 w-8 h-8 flex items-center justify-center rounded-md text-base transition-colors",style:{backgroundColor:c===i?r.getColor(k.InputBackground):"transparent"},title:l.name,children:l.icon},l.name))}),f.jsx("div",{ref:a,className:"grid grid-cols-8 gap-0.5 p-1.5 overflow-y-auto",style:{maxHeight:"200px"},children:Tx[i].emojis.map((l,c)=>f.jsx("button",{type:"button",onClick:()=>{e(l),n()},className:"w-8 h-8 flex items-center justify-center rounded-md text-lg hover:scale-110 transition-transform",style:{backgroundColor:"transparent"},onMouseEnter:d=>{d.currentTarget.style.backgroundColor=r.getColor(k.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${c}`))})]})})}const Ex=2;function wB({onNewMessage:e,client_id:t,is_uploadable:n,messages:r,onEvaluateChat:i,onNewChat:s,onSendMessage:o,isHistoryMode:a=!1,historyChat:l}){const c=v.useRef(null),d=dr(),u=cM(t),p=Se(),h=cs(),{setIsInputFocused:y,showActionButtons:x,setShowActionButtons:w}=re(),[m,g]=v.useState(""),[b,C]=v.useState("3rem"),[S,_]=v.useState(!1),[j,A]=v.useState([]),[E,L]=v.useState(0),[F,D]=v.useState(!1),[G,z]=v.useState(0),[$,N]=v.useState(null),[M,P]=v.useState(!1),B=()=>{if(!a||!l||l.status!==tn.Closed||!l.closed_at)return!1;const Y=new Date(l.closed_at);return(new Date().getTime()-Y.getTime())/(1e3*60*60)>2},U=a&&(l==null?void 0:l.status)===tn.Closed&&B();v.useEffect(()=>{if(r.length>0){const Y=r[r.length-1];Y.id!==$&&(N(Y.id),Y.sender_type===ye.User&&(L(0),D(!1)))}},[r,$]),v.useEffect(()=>{let Y;return F&&G>0&&(Y=window.setTimeout(()=>{z(V=>V<=1?(D(!1),L(0),0):V-1)},1e3)),()=>clearTimeout(Y)},[F,G]),v.useEffect(()=>{const Y=c.current;if(Y){const V=()=>y(!0),Z=()=>y(!1);return Y.addEventListener("focus",V),Y.addEventListener("blur",Z),()=>{Y.removeEventListener("focus",V),Y.removeEventListener("blur",Z)}}},[y]),v.useEffect(()=>{const Y=()=>{w(!0)},V=()=>{w(!1)};return d==null||d.on(ve.ChatUserShowButton,Y),d==null||d.on(ve.MessageUserCreate,V),()=>{d==null||d.off(ve.ChatUserShowButton,Y),d==null||d.off(ve.MessageUserCreate,V)}},[d,w]),v.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&w(!1)},[r,w]),Jc("lc:rate-limit",Y=>{const V=Y.detail&&Y.detail.seconds||3;D(!0),z(V),L(0)}),Jc("paste",Y=>{const V=Y.clipboardData.items,Z=[];for(const ue of V){const O=ue.getAsFile();O&&Z.push(O)}if(Z.length>0&&!n){en({description:h(ne.FileUploadDisabled),variant:"error"});return}if(Z.length>0){const ue=ru(Z);if(!ue.isValid){en({description:ue.error,variant:"error"});return}A([...j,...Z])}});const W=async()=>{const Y=m.trim(),V=!!n&&j.length>0,Z=Y.length>0&&Y.length<Ex;if(!Y&&!V||Z)return;if(E>5&&!F){D(!0),z(3);return}if(F||S)return;const ue=m,O=[...j];g(""),A([]),c.current&&(c.current.style.height="3rem",C("3rem")),_(!0);let ae;if(n&&O.length>0){const[ee,ke]=await u.mutateAsync(O);if(!zn(ke)){zA(ee,ke),_(!1),g(ue),A(O);return}uM(ee)&&(ae=ee.file_urls)}if(o){o(ue,ae),_(!1);return}d==null||d.emit(He.MessageCreate,{content:ue,files:ae},ee=>{e(ee),_(!1),L(ke=>ke+1),w(!1)})},se=(m.trim().length>=Ex||j.length>0)&&!S&&!F,ie=Y=>{d==null||d.emit(He.MessageTyping,{content:Y})},pe=()=>{d==null||d.emit(He.ChatClose,{}),w(!1),i==null||i()},ce=()=>{d==null||d.emit(He.ChatClose,{}),w(!1),s==null||s()},_e=v.useCallback(Y=>{const V=c.current;if(V){const Z=V.selectionStart,ue=V.selectionEnd,O=m.substring(0,Z)+Y+m.substring(ue);O.length<=2e3&&(g(O),ie(O),setTimeout(()=>{V.selectionStart=V.selectionEnd=Z+Y.length,V.focus()},0))}else{const Z=m+Y;Z.length<=2e3&&(g(Z),ie(Z))}},[m]),Re=a&&(l==null?void 0:l.status)===tn.Closed;return U?null:f.jsxs(f.Fragment,{children:[Re&&f.jsxs("div",{className:"px-5 flex flex-col gap-2",children:[f.jsxs("div",{className:"p-3 rounded-lg flex items-center gap-2",style:{backgroundColor:p.getColor(k.InputBackground),borderColor:p.getColor(k.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(X.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:p.getColor(k.FooterText)}}),f.jsx("span",{className:"text-sm",style:{color:p.getColor(k.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),f.jsxs(Rt,{size:"lg",onClick:()=>{s==null||s()},className:"rounded-lg gap-2 transition-all",children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]}),f.jsx(xo,{variant:"block"})]}),F&&f.jsxs(Me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 rounded-lg z-[100] p-2 flex items-center justify-center",style:{backgroundColor:p.getColor(k.ErrorBackground),borderColor:p.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 mr-2",style:{color:p.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm font-medium",style:{color:p.getColor(k.ErrorText)},children:h(ne.RateLimitMessage).replace("{seconds}",G.toString())})]}),x&&f.jsxs(Me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex gap-2",children:[f.jsxs(Rt,{className:"flex-1 flex items-center justify-center gap-2",size:"md",variant:"primary",kind:"outline",onClick:pe,style:{borderColor:p.getColor(k.ButtonBackground),color:p.getColor(k.ButtonBackground),backgroundColor:"transparent"},children:[f.jsx(X.Star,{className:"size-4"}),f.jsx("span",{children:"Değerlendir"})]}),f.jsxs(Rt,{size:"md",className:"flex-1 flex items-center justify-center gap-2",onClick:ce,children:[f.jsx(X.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet"})]})]}),(!a||a&&(l==null?void 0:l.status)!==tn.Closed&&(l==null?void 0:l.status)!==tn.Deleted)&&f.jsxs("form",{className:"flex flex-col relative",onSubmit:Y=>{Y.preventDefault(),W()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:p.getColor(k.DividerColor)}}),n&&j&&j.length>0&&f.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:f.jsx(wC,{files:j,onDelete:Y=>{A(j.filter((V,Z)=>Z!==Y))}})}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Qu,{id:"message",inputRef:c,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:F,style:{height:b,maxHeight:"6rem",opacity:F?.5:1,cursor:F?"not-allowed":"text",boxShadow:"none"},placeholder:F?h(ne.RateLimitMessage).replace("{seconds}",G.toString()):h(ne.MessagePlaceholder),value:m,maxLength:2e3,onChange:Y=>{if(F)return;const V=Y.target.value;if(V.length<=2e3&&(g(V),ie(V)),V.length>0&&Y.currentTarget.scrollHeight>Y.currentTarget.clientHeight){const Z=`${Y.currentTarget.scrollHeight}px`;Y.currentTarget.style.height=Z,C(Z)}else Y.currentTarget.style.height="3rem",C("3rem")},onKeyDown:Y=>{if(F){Y.preventDefault();return}Y.key==="Enter"&&!Y.shiftKey&&(Y.preventDefault(),W())}}),m.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:m.length>=2e3?p.getColor(k.ErrorText):p.getColor(k.FooterText),fontWeight:m.length>=2e3?"600":"normal"},children:2e3-m.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Me.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",disabled:!se,style:{opacity:1,color:se?p.getColor(k.ButtonBackground):p.getColor(k.FooterText)},children:S?f.jsx(X.Spin,{className:"size-4 animate-spin"}):F?f.jsx("span",{className:"text-[10px] font-bold",children:G}):f.jsx(X.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(BC,{isOpen:M,onClose:()=>P(!1),onSelect:_e}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx("button",{type:"button",onClick:()=>P(!M),className:"p-1.5 rounded-md transition-colors",style:{color:p.getColor(k.IconColor)},children:f.jsx(X.Emoji,{className:"size-5"})}),n&&f.jsx(FC.Button,{onDrop:Y=>{if(Y.length){const V=ru(Y);if(!V.isValid){en({description:V.error,variant:"error"});return}A([...j,...Y])}}})]}),f.jsx(xo,{variant:"inline"})]})]})]})}const Ax=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function ah({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=v.useMemo(()=>{const o=e.charCodeAt(0)||0,a=Ax[o%Ax.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return f.jsxs(Me.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center",children:[f.jsx("div",{className:"min-w-max",children:f.jsxs("span",{children:[t&&f.jsx("img",{className:"size-10 rounded-full border border-white/20 shadow-sm",src:t,"aria-label":e}),!t&&f.jsx("div",{className:"size-10 rounded-full flex items-center justify-center font-semibold text-white shadow-sm",style:{background:s},children:e.charAt(0).toUpperCase()})]})}),f.jsxs("div",{className:"flex flex-col",children:[f.jsx("span",{className:Ve("line-clamp-1 font-medium",n),style:r?{color:r}:void 0,children:e}),i&&f.jsx("span",{className:"text-xs opacity-75 line-clamp-1",style:r?{color:r}:void 0,children:i})]})]})}function bB({chat:e,isTyping:t,shortcutMessages:n,messages:r,onNewMessage:i,onChatClose:s,onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c=!1,spamWarningMessage:d,onDismissSpamWarning:u}){const{widget:p,setOpen:h,open:y,isHaveChat:x,isInputFocused:w}=re(),m=re(G=>G.historyChat),g=Se(),b=Po(),C=Zu(),S=dr(),_=gs(),j=v.useRef(new Set),A=v.useRef(!1),E=()=>{h(!1)},L=v.useCallback(()=>{if(!S||!y||!x||!Array.isArray(r))return;const G=r.filter(z=>z.sender_type===ye.User&&!j.current.has(z.id)).map(z=>z.id);G.length!==0&&S.emit(He.MessageRead,{message_ids:G},z=>{if(z&&z.success===!0)for(const $ of G)j.current.add($)})},[S,r,y,x]);v.useEffect(()=>{y&&(A.current=!0),y&&x&&(w||A.current)&&(L(),A.current=!1)},[y,x,w,L]);const F=()=>{var z,$,N,M;return((M=(N=($=(z=p==null?void 0:p.appearance)==null?void 0:z.head)==null?void 0:$.elements)==null?void 0:N.find(P=>P.type==="title"))==null?void 0:M.content)||"Müşteri Hizmetleri"},D=()=>{var $,N,M,P,B,U;if(c&&m)return"Geçmiş sohbet";if(e!=null&&e.agent_name)return e.agent_name;const G=(N=($=p==null?void 0:p.appearance)==null?void 0:$.design)==null?void 0:N.greeting_header;return G||((U=(B=(P=(M=p==null?void 0:p.appearance)==null?void 0:M.head)==null?void 0:P.elements)==null?void 0:B.find(W=>W.type==="text"))==null?void 0:U.content)||"Bizimle Sohbet Edin"};return f.jsxs(f.Fragment,{children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:g.getColor(k.HeaderBackground),color:g.getColor(k.HeaderText),borderColor:g.getColor(k.HeaderBorder),...b?{}:{borderTopLeftRadius:g.getRadius(),borderTopRightRadius:g.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[c&&f.jsx("button",{type:"button",onClick:()=>{re.getState().setHistoryChat(null),re.getState().setHistoryMessages(null),re.getState().setShowHistoryOnRegistration(!0),_.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.ArrowLeft,{className:"w-5 h-5"})}),(()=>{var G,z,$,N;if(c&&m){const M=(G=m.who_joined_details)==null?void 0:G[0],P=(z=m.participant_logs)==null?void 0:z[0],B=(M==null?void 0:M.name)||(P==null?void 0:P.name)||(($=m.archive_summary)==null?void 0:$.admin_name);if(B){const U=(M==null?void 0:M.avatar)||((N=m.archive_summary)==null?void 0:N.agent_avatar)||void 0;return f.jsx(ah,{name:B,avatar:U,textColor:g.getColor(k.HeaderText)})}}return!c&&(e!=null&&e.agent_name)?f.jsx(ah,{name:e.agent_name,avatar:e.agent_avatar,textColor:g.getColor(k.HeaderText)}):f.jsx("div",{className:"flex-1 min-w-0",children:c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"font-medium truncate",children:F()}),f.jsx("div",{className:"text-sm opacity-90 truncate",children:D()})]}):f.jsx("div",{className:"font-medium truncate",children:D()})})})()]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!c||c&&(e==null?void 0:e.status)!==tn.Closed)&&f.jsx(oF,{onChatClose:s}),C&&f.jsx("button",{type:"button",onClick:E,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(bC,{messages:r,isTyping:t||n.length>0,chat:e}),f.jsx(Ar,{children:d&&f.jsxs(Me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2",style:{backgroundColor:g.getColor(k.ErrorBackground),borderColor:g.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:g.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:g.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:g.getColor(k.ErrorText)},children:d}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:g.getColor(k.ErrorText)},children:f.jsx(X.X,{className:"size-4"})})]})}),f.jsx(wB,{client_id:(p==null?void 0:p.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:G=>{i(G)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c,historyChat:c?re.getState().historyChat:void 0})]})}function kB({rating:e,onChange:t}){const n=Se();return f.jsx("div",{className:"flex items-center justify-center gap-0.5 my-2",children:[1,2,3,4,5].map(r=>{const i=r<=e,s=!i&&r-.5<=e;return f.jsxs(Me.div,{className:"relative w-8 h-8 cursor-pointer",whileHover:{scale:1.15},whileTap:{scale:.95},transition:{duration:.15},children:[f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(k.StarInactiveColor),fill:n.getColor(k.StarInactiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),s&&f.jsx("div",{className:"absolute top-0 left-0 w-4 h-8 overflow-hidden",children:f.jsx("svg",{className:"w-8 h-8",style:{color:n.getColor(k.StarActiveColor),fill:n.getColor(k.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})})}),i&&f.jsx("svg",{className:"w-8 h-8 absolute top-0 left-0",style:{color:n.getColor(k.StarActiveColor),fill:n.getColor(k.StarActiveColor)},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:"1",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),f.jsxs("div",{className:"absolute inset-0 flex",children:[f.jsx("button",{type:"button",onClick:()=>t(r-.5),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r-.5} stars`}),f.jsx("button",{type:"button",onClick:()=>t(r),className:"w-1/2 h-full cursor-pointer focus:outline-none","aria-label":`${r} stars`})]})]},r)})})}function SB({onOk:e}){const t=Se(),n=cs(),r=Zu(),[i,s]=v.useState(0),[o,a]=v.useState(!1),[l,c]=v.useState(10),d=lM(),[u,p]=v.useState(!1);v.useEffect(()=>{if(o){const w=setInterval(()=>{c(m=>m<=1?(clearInterval(w),e(!0),0):m-1)},1e3);return()=>clearInterval(w)}},[o]);const h=Jm({comment:Xc()}),y=JS({init:{comment:""},schema:h,action:async w=>{const[m,g]=await d.mutateAsync({rating:i,comment:w.comment});if(zn(g)){a(!0);return}ho(m,{form:y})}}),x=()=>{e(!0)};return f.jsxs(Me.div,{className:"flex flex-col h-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[f.jsxs("header",{className:"min-h-[48px] flex-shrink-0 overflow-visible flex justify-between items-center z-10 px-5 py-2.5",style:{borderColor:t.getColor(k.HeaderBorder),color:t.getColor(k.HeaderText)},children:[f.jsx("div",{className:"font-medium !text-sm",children:n(o?ne.RatingHeaderThanks:ne.RatingHeaderEvaluate)}),r&&f.jsx("button",{type:"button",onClick:()=>e(!1),className:"p-1.5 rounded-md hover:opacity-70 transition-opacity",style:{color:t.getColor(k.HeaderText)},children:f.jsx(X.X,{className:"size-4"})})]}),f.jsx("div",{className:"flex-1 p-4 overflow-y-auto flex flex-col",children:o?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[f.jsx("div",{className:"mb-3",style:{color:t.getColor(k.SuccessText)},children:f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:f.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),f.jsx("h2",{className:"text-lg font-semibold mb-1.5",style:{color:t.getColor(k.HeaderText)},children:n(ne.RatingThankYouTitle)}),f.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(k.FooterText)},children:n(ne.RatingThankYouDescription)}),f.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(k.FooterText)},children:n(ne.RatingCountdown).replace("{seconds}",l.toString())}),f.jsx(Rt,{onClick:x,size:"md",className:"w-full max-w-xs",children:n(ne.RatingNewConversation)})]}):f.jsxs("div",{className:"flex flex-col",children:[f.jsx("div",{className:"text-center mb-4",children:f.jsx("p",{className:"text-sm",style:{color:t.getColor(k.FooterText)},children:n(ne.RatingDescription)})}),f.jsxs("div",{className:"mb-4",children:[f.jsx("h3",{className:"text-center font-medium mb-1.5 text-base",style:{color:t.getColor(k.RatingRateConversationText)},children:n(ne.RatingRateConversation)}),f.jsx(kB,{rating:i,onChange:w=>{s(w),w>=1&&p(!1)}}),i>0&&f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(k.FooterText)},children:n(ne.RatingYourScore).replace("{score}",Number.isInteger(i)?i.toString():i.toFixed(1))}),i>0&&i<1||u?f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(k.ErrorText)},children:n(ne.RatingMinimumError)}):null]}),f.jsxs("form",{onSubmit:y.handleSubmit,className:"space-y-4",children:[f.jsxs("div",{children:[f.jsx("label",{htmlFor:"comment",className:"block text-xs font-medium mb-1",style:{color:t.getColor(k.InputText)},children:n(ne.RatingComment)}),f.jsx(Qu,{id:"comment",onChange:y.handleChange,onBlur:y.handleBlur,value:y.values.comment,placeholder:n(ne.RatingCommentPlaceholder),className:"rounded-lg",error:y.errors.comment})]}),f.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[f.jsx(Rt,{type:"submit",size:"lg",onClick:w=>{i<1&&(w.preventDefault(),w.stopPropagation(),p(!0))},className:"w-full",children:n(ne.RatingSubmit)}),f.jsx(Rt,{onClick:x,size:"lg",variant:"secondary",kind:"subtle",className:"w-full",bgKey:k.GreeterBackground,textKey:k.GreeterText,children:n(ne.RatingNewConversation)})]})]})]})}),f.jsx(xo,{variant:"block"})]})}function CB({onSendMessage:e,disabled:t,loading:n=!1}){const r=v.useRef(null),i=Se(),s=cs(),{setIsInputFocused:o}=re(),[a,l]=v.useState(""),[c,d]=v.useState("3rem"),[u,p]=v.useState(!1),h=v.useRef(n);v.useEffect(()=>{h.current&&!n&&!t&&setTimeout(()=>{var w;(w=r.current)==null||w.focus()},100),h.current=n},[n,t]),v.useEffect(()=>{t&&p(!1)},[t]);const y=()=>{if(!a.trim()||t)return;const w=a;l(""),r.current&&(r.current.style.height="3rem",d("3rem")),e(w)},x=v.useCallback(w=>{if(t)return;const m=r.current;if(m){const g=m.selectionStart,b=m.selectionEnd,C=a.substring(0,g)+w+a.substring(b);C.length<=2e3&&(l(C),setTimeout(()=>{m.selectionStart=m.selectionEnd=g+w.length,m.focus()},0))}else{const g=a+w;g.length<=2e3&&l(g)}},[a,t]);return f.jsxs("form",{className:"flex flex-col relative",onSubmit:w=>{w.preventDefault(),y()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:i.getColor(k.DividerColor)}}),f.jsxs("div",{className:"flex gap-2 px-3 py-1 w-full",children:[f.jsxs("div",{className:"flex-1 min-w-0 relative",children:[f.jsx(Qu,{id:"ai-message",inputRef:r,className:"grow",noMargin:!0,borderless:!0,autoComplete:"off",disabled:t,style:{height:c,maxHeight:"6rem",opacity:t?.5:1,cursor:t?"not-allowed":"text",boxShadow:"none"},placeholder:s(ne.MessagePlaceholder),value:a,maxLength:2e3,onFocus:()=>o(!0),onBlur:()=>o(!1),onChange:w=>{if(t)return;const m=w.target.value;if(m.length<=2e3&&l(m),m.length>0&&w.currentTarget.scrollHeight>w.currentTarget.clientHeight){const g=`${w.currentTarget.scrollHeight}px`;w.currentTarget.style.height=g,d(g)}else w.currentTarget.style.height="3rem",d("3rem")},onKeyDown:w=>{if(t){w.preventDefault();return}w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),y())}}),a.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:a.length>=2e3?i.getColor(k.ErrorText):i.getColor(k.FooterText),fontWeight:a.length>=2e3?"600":"normal"},children:2e3-a.length})]}),f.jsx("div",{className:"flex items-center gap-1 flex-shrink-0 pb-0.5",children:f.jsx(Me.div,{whileTap:{scale:.9},children:f.jsx(Rt,{className:"!bg-transparent rounded-full w-8 h-8 min-w-8 flex items-center justify-center transition-colors disabled:!opacity-100",type:"submit",size:"xs",withoutTheming:!0,disabled:t||!a.trim(),style:{opacity:1,backgroundColor:"transparent",color:a.trim()?i.getColor(k.ButtonBackground):i.getColor(k.FooterText)},children:n?f.jsx(X.Spin,{className:"size-4 animate-spin"}):f.jsx(X.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(BC,{isOpen:u,onClose:()=>p(!1),onSelect:x}),f.jsxs("div",{className:"px-3 pb-1.5 flex items-center justify-between",children:[f.jsx("div",{className:"flex items-center gap-1",children:f.jsx("button",{type:"button",disabled:t,onClick:()=>!t&&p(!u),className:"p-1.5 rounded-md transition-colors disabled:opacity-50 disabled:cursor-not-allowed",style:{color:i.getColor(k.IconColor)},children:f.jsx(X.Emoji,{className:"size-5"})})}),f.jsx(xo,{variant:"inline"})]})]})}const af=[De.Light,De.Dark,De.System];function _B(e){switch(e){case De.Light:return X.Sun;case De.Dark:return X.Moon;case De.System:return X.Monitor;default:return X.Monitor}}function TB({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>yC()),a=v.useRef(null),l=v.useRef(null),c=Se(),d=cs(),{mode:u,setMode:p}=c,h=()=>e(),y=()=>{const m=af.indexOf(u),g=af[(m+1)%af.length];p(g)},x=()=>{const m=!s;xC(m),o(m)};v.useEffect(()=>{if(!r)return;const m=g=>{var b,C;(b=l.current)!=null&&b.contains(g.target)||(C=a.current)!=null&&C.contains(g.target)||i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[r]);const w=r&&f.jsxs(Me.div,{ref:l,onMouseDown:m=>m.stopPropagation(),initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},transition:{duration:.15},className:"absolute right-0 top-full z-[9999] mt-1.5 py-1 min-w-[175px] rounded-lg shadow-lg !text-sm",style:{backgroundColor:c.getColor(k.Background),borderColor:c.getColor(k.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(k.ShadowColor)}`},children:[f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-t-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0"}),d(ne.ChatEndConversation)]}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:x,children:[s?f.jsx(X.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(X.Volume2,{className:"size-4 flex-shrink-0"}),d(s?ne.NotificationSoundOn:ne.NotificationSoundOff)]}),f.jsx("div",{className:"my-1 h-px",style:{backgroundColor:c.getColor(k.DividerColor)}}),f.jsxs("button",{type:"button",className:"w-full px-3 py-2 text-left text-sm flex items-center gap-2 rounded-b-lg hover:opacity-80 transition-opacity",style:{color:c.getColor(k.InputText)},onClick:y,children:[(()=>{const m=_B(u);return f.jsx(m,{className:"size-4 flex-shrink-0"})})(),u===De.Light?"Açık tema":u===De.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Ar,{children:t&&f.jsx(Me.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"absolute inset-0 z-50 flex items-center justify-center p-4",style:{backgroundColor:c.getColor(k.ModalOverlayColor)},children:f.jsxs(Me.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},transition:{duration:.2},className:"p-5 rounded-xl shadow-lg max-w-xs w-full",style:{backgroundColor:c.getColor(k.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(k.ChatCloseConfirmText)},children:d(ne.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(k.FooterText)},children:d(ne.ChatCloseWarning)}),f.jsxs("div",{className:"flex justify-end gap-2",children:[f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.GreeterBackground),color:c.getColor(k.GreeterText),borderRadius:c.getRadius()},onClick:()=>n(!1),children:d(ne.CancelAction)}),f.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-lg transition-opacity hover:opacity-90",style:{backgroundColor:c.getColor(k.ErrorBackground),color:c.getColor(k.ErrorText),borderRadius:c.getRadius()},onClick:h,children:d(ne.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(m=>!m),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(k.HeaderText)},title:d(ne.ChatSettings),"aria-expanded":r,children:f.jsx(X.Menu,{className:"size-5"})}),f.jsx(Ar,{children:w})]})]})}function EB({onOperatorConnected:e,onChatClose:t}){var ce,_e,Re;const{widget:n,setOpen:r,aiAgent:i,aiAgentMessages:s,addAIAgentMessage:o,setAIAgentMessages:a,aiAgentSessionId:l,setAIAgentSessionId:c,humanNeedRequested:d,setHumanNeedRequested:u,setIsAIAgentMode:p}=re(),h=Se(),y=Po(),x=Zu(),w=dr(),m=gs(),[g,b]=v.useState(!1),[C,S]=v.useState(!1),[_,j]=v.useState(!1),[A,E]=v.useState(!1),[L,F]=v.useState(""),[D,G]=v.useState(!1),[z,$]=v.useState(0),[N,M]=v.useState(null),P=()=>{r(!1)},B=()=>{u(!1),t()},U=(((Re=(_e=(ce=n==null?void 0:n.appearance)==null?void 0:ce.body)==null?void 0:_e.inputs)==null?void 0:Re.length)||0)>0,W=v.useRef(!1),q=v.useRef(!1);v.useEffect(()=>{if(!i||W.current)return;if(s.length>0){W.current=!0;return}if(!w||!w.connected){const Z=setInterval(()=>{w&&w.connected&&(clearInterval(Z),Y())},100),ue=setTimeout(()=>{clearInterval(Z),W.current||V()},3e3);return()=>{clearInterval(Z),clearTimeout(ue)}}Y();function Y(){W.current||!w||(W.current=!0,w.emit(He.MessageList,{},Z=>{Array.isArray(Z)&&Z.length>0?a(Z):V()}))}function V(){if(!i)return;const Z={id:Lp(),content:`Merhaba! Ben ${i.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:ye.User};o(Z)}},[w,i,s.length,a,o]),v.useEffect(()=>{if(g)if(L)S(!0);else{const Y=setTimeout(()=>S(!0),1e3);return()=>clearTimeout(Y)}else S(!1)},[g,L]),v.useEffect(()=>{if(z>0){const Y=requestAnimationFrame(()=>$(0));return()=>cancelAnimationFrame(Y)}},[z]),v.useEffect(()=>{if(!w)return;const Y=({token:O})=>{F(ae=>ae+O)},V=O=>{O!=null&&O.human_need&&u(!0)},Z=O=>{O.repeat_count===3&&M(O.message)},ue=()=>{t()};return w.on(ve.AgentMessageChunk,Y),w.on(ve.AgentMessageFinalMetadata,V),w.on(ve.AgentSpamWarning,Z),w.on(ve.AgentSpamBanned,ue),()=>{w.off(ve.AgentMessageChunk,Y),w.off(ve.AgentMessageFinalMetadata,V),w.off(ve.AgentSpamWarning,Z),w.off(ve.AgentSpamBanned,ue)}},[w,u,t]);const se=v.useCallback(Y=>{if(!n||!i||!w||d||_||q.current)return;q.current=!0;const V=`temp-${Date.now()}`,Z={id:V,content:Y,created_at:new Date,files:[],sender_type:ye.Customer};o(Z),F(""),G(!0),b(!0),j(!0);const ue=l||mi(n.link_id);w.emit(He.AgentMessageCreate,{question:Y,agent_id:i.id,session_id:ue},O=>{if(q.current=!1,G(!1),F(""),b(!1),j(!1),!O){const ae={id:Lp(),content:"Üzgünüm, bir hata oluştu. Lütfen tekrar deneyin veya canlı destek personelimıze bağlanın.",created_at:new Date,files:[],sender_type:ye.System};a(ee=>ee.filter(ke=>ke.id!==V).concat([ae])),u(!0);return}O.session_id&&c(O.session_id),o(O.agent_message),O.human_need&&u(!0)})},[n,i,d,_,w,l,o,a,c,u]),ie=v.useCallback(Y=>{if(!w||A)return;E(!0);const V=()=>{w.emit(He.AgentRequestHuman,{},Z=>{E(!1),Z!=null&&Z.success?(re.getState().setIsHaveChat(!0),p(!1),u(!1),re.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};Y&&Object.keys(Y).length>0?w.emit(He.ChatUpdateInputs,{inputs:Y},Z=>{Z!=null&&Z.success?V():(console.error("Failed to update chat inputs"),E(!1))}):V()},[w,A,p,u,e]),pe=()=>{U?m.push("registration"):ie()};return i?f.jsxs("div",{className:"flex flex-col h-full min-h-0 flex-1 w-full",children:[f.jsxs("header",{className:"px-4 py-3 flex items-center justify-between flex-shrink-0 overflow-visible min-h-[52px]",style:{backgroundColor:h.getColor(k.HeaderBackground),color:h.getColor(k.HeaderText),borderColor:h.getColor(k.HeaderBorder),...y?{}:{borderTopLeftRadius:h.getRadius(),borderTopRightRadius:h.getRadius()}},children:[f.jsx("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:f.jsx(ah,{name:i.name,avatar:i.avatar,textColor:h.getColor(k.HeaderText),subtitle:"AI Asistan"})}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(TB,{onChatClose:B}),x&&f.jsx("button",{type:"button",onClick:P,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(X.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full overflow-hidden",children:[f.jsx(bC,{messages:s,isTyping:C||g&&!!L,streamingContent:D?L:void 0,skipAnimationForLastN:z}),f.jsx(Ar,{children:N&&f.jsxs(Me.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{duration:.2},className:"mx-3 mb-2 p-3 rounded-lg flex items-start gap-2 flex-shrink-0",style:{backgroundColor:h.getColor(k.ErrorBackground),borderColor:h.getColor(k.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:h.getRadius()},children:[f.jsx(X.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:h.getColor(k.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:h.getColor(k.ErrorText)},children:N}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>M(null),style:{color:h.getColor(k.ErrorText)},children:f.jsx(X.X,{className:"size-4"})})]})}),d?f.jsx(Me.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},className:"flex-shrink-0 w-full flex flex-col items-stretch justify-center px-4 pt-8 pb-10",style:{backgroundColor:h.getColor(k.Background)},children:f.jsx(Me.div,{className:"relative w-full max-w-lg mx-auto overflow-hidden",style:{borderRadius:h.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:f.jsx(Rt,{onClick:pe,disabled:A,size:"lg",className:"w-full flex items-center justify-center gap-2",children:A?f.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):f.jsxs(f.Fragment,{children:[f.jsx(X.User,{className:"w-5 h-5"}),f.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})}):f.jsx(CB,{onSendMessage:se,disabled:_,loading:_})]})]}):null}function AB({children:e}){const{widget:t}=re();return t?f.jsx("section",{className:"h-full w-full relative",children:e}):null}function jB({children:e}){const t=dr(),n=gs(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=re(),[o,a]=v.useState(!0),[l,c]=v.useState(!1),d=v.useRef(!1);return v.useEffect(()=>{if(r){a(!1);return}if(!t){a(!1);return}const u=()=>{a(!1),c(!1),d.current=!0},p=()=>{i&&s||(c(!0),n.push("registration"))};return t.on(ve.Connect,u),t.on(ve.Disconnect,p),t.connected?(a(!1),d.current=!0):t.connect(),()=>{t.off(ve.Connect,u),t.off(ve.Disconnect,p)}},[t,r,i,s,n]),i&&s||r?e:!t||l?(t||n.push("registration"),f.jsx(th,{})):d.current&&!t.connected?f.jsx(th,{}):o||!t.connected?f.jsx(vC,{}):e}function jx(e,t){const n=new Map;for(const r of t)r!=null&&r.id&&n.set(r.id,r);for(const r of e)r!=null&&r.id&&!n.has(r.id)&&n.set(r.id,r);return Array.from(n.values()).sort((r,i)=>new Date(r.created_at).getTime()-new Date(i.created_at).getTime())}function RB(){const e=O=>{if(!O||typeof O!="object")return!1;const ae=String((O==null?void 0:O.error)||(O==null?void 0:O.message)||"").toLowerCase(),ee=Number((O==null?void 0:O.status)||(O==null?void 0:O.statusCode)||0);return(O==null?void 0:O.retryAfter)!==void 0||ee===429||/too\s+many|rate\s*limit|çok\s+fazla/.test(ae)},t=O=>{const ae=Number((O==null?void 0:O.retryAfter)??(O==null?void 0:O.seconds));return Number.isFinite(ae)&&ae>0?ae:3},{widget:n,setOpen:r,setIsHaveChat:i,historyChat:s,setHistoryChat:o,historyMessages:a,setHistoryMessages:l,aiAgent:c,isAIAgentMode:d,clearAIAgentState:u}=re(),p=Se(),h=dr(),{connected:y,connectionReady:x}=h,w=ll(),m=gs(),g=Po(),[b,C]=v.useState(null),[S,_]=v.useState([]),[j,A]=v.useState(!1),[E,L]=v.useState([]),[F,D]=v.useState([]),[G,z]=v.useState(!1),$=Gm(),N=v.useRef(!1),M=v.useRef(null),P=v.useRef(!1),[B,U]=v.useState(!1),[W,q]=v.useState(null);v.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:y,connectionReady:x,hasChat:!!b,chatViewEmitted:N.current})},[y,x,b]),v.useEffect(()=>{if(b||s||d){U(!1);return}const O=setTimeout(()=>{!b&&!s&&!d&&(console.warn("WS: Connection timeout reached in ChatDetailView"),U(!0))},1e4);return()=>clearTimeout(O)},[b,s,d]),v.useEffect(()=>{if(!s||!n)return;if(C({status:s.status,is_customer_uploadable:!1}),a){_(a);return}const O=mi(n.link_id);pM(s._id,n.link_id,O).then(([ae,ee])=>{if(zn(ee)&&Array.isArray(ae)){const ke=ae.map(he=>({id:he._id,content:he.content,created_at:he.created_at,files:he.files,sender_type:he.sender_type,activity_type:he.activity_type,answers:he.answers,reply_id:he.reply_id,buttons:he.buttons}));_(ke),l(ke)}}).catch(ae=>{console.error("Failed to load history messages",ae)})},[s,n,a,l]),v.useEffect(()=>{if(!n||d||s)return;const O=mr(n.link_id);O.isAgentMode&&O.agent&&(console.log("ChatDetailView: Recovering AI Agent state from localStorage"),re.getState().setAIAgent(O.agent),re.getState().setIsAIAgentMode(!0),O.sessionId&&re.getState().setAIAgentSessionId(O.sessionId),O.humanNeedRequested&&re.getState().setHumanNeedRequested(!0))},[n,d,s]);const se=async(O,ae)=>{var Bt;if(!n)return;if(!s){const fe=`temp-${Date.now()}`,R={id:fe,content:O,created_at:new Date,files:ae||[],sender_type:ye.Customer,answers:[],reply_id:void 0,buttons:[]};_(K=>[...K,R]),h==null||h.emit(He.MessageCreate,{content:O,files:ae},K=>{const I=Array.isArray(K)?K[0]:K;if(I&&I.isError){_(te=>te.filter(de=>de.id!==fe));const H=e(I);H||ho(I),H&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(I)}}));return}_(H=>H.map(te=>te.id===fe?I:te))});return}const ee={},ke=n.appearance;if((Bt=ke==null?void 0:ke.body)!=null&&Bt.inputs){for(const fe of ke.body.inputs)if(fe.required||fe.remember){const R=ga(fe.name);R&&(ee[fe.name]=R)}}const he=re.getState().defaultValues;if(he){he.username&&(ee.username=he.username),he.secret_data&&(ee.secret_data=he.secret_data);for(const fe in he)ee[fe]||(ee[fe]=he[fe])}const[Ze,qe]=await $.mutateAsync({inputs:ee,history:[],client_id:n.client_id,widget_id:n.link_id,device_id:mi(n.link_id)});if(zn(qe)){o(null),i(!0),Ze&&typeof Ze=="object"&&"customer_token"in Ze&&(Fn(st.CustomerToken,Ze.customer_token,n.link_id),Fn(st.CustomerRefreshToken,Ze.customer_refresh_token,n.link_id));let fe=0;const R=20,K=`temp-${Date.now()}`,I={id:K,content:O,created_at:new Date,files:ae||[],sender_type:ye.Customer,answers:[],reply_id:void 0,buttons:[]};_(te=>[...te,I]);const H=setInterval(()=>{fe+=1,h!=null&&h.connected?(h.emit(He.MessageCreate,{content:O,files:ae},te=>{const de=Array.isArray(te)?te[0]:te;if(de&&de.isError){_(Ue=>Ue.filter(lt=>lt.id!==K));const xe=e(de);xe||ho(de),xe&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(de)}}));return}_(xe=>xe.map(Ue=>Ue.id===K?de:Ue))}),clearInterval(H)):fe>=R&&clearInterval(H)},200)}},ie=O=>{!O&&!g&&r(!1),z(!0),pa((n==null?void 0:n.link_id)||""),i(!1),C(null),_([]),L([]),o(null),re.getState().setHistoryMessages(null),re.getState().setShowHistoryOnRegistration(!1),u(),ac(n.client_id,Yi(w)).then(()=>{h==null||h.disconnect(),m.push("registration")})},pe=()=>{b?(localStorage.setItem("showActionButtons","false"),C({...b,status:tn.Closed})):ie(!1)};v.useEffect(()=>{if(h&&!(d&&c)){if(s){N.current=!1,P.current=!1;return}if(!y||!x){y||(P.current=!1,N.current=!1,M.current=null);return}P.current=!0,!(!n||N.current)&&(N.current=!0,console.log("ChatView: Emitting chat:view request"),h.emit(He.ChatView,{},O=>{if(console.log("ChatView: Received response",{chatReceived:O!==null,chatStatus:O==null?void 0:O.status,hasAgentName:!!(O!=null&&O.agent_name),hasError:O&&"error"in O}),re.getState().historyChat){N.current=!1;return}if(O===null||O&&"error"in O||!(O!=null&&O.status)){console.log("ChatView returned invalid chat (null, error, or missing status), cleaning up and redirecting to registration",{chat:O}),r(!1),i(!1),ac(n.client_id,Yi(w)),_([]),L([]),o(null),re.getState().setHistoryMessages(null),u(),pa((n==null?void 0:n.link_id)||""),h.disconnect(),m.push("registration"),N.current=!1;return}console.log("ChatView: Setting chat state",{status:O.status}),C(O),i(!0)}))}},[s,h,n,y,x,w,m,r,i,o,d,c,u]);const ce=()=>{pe()},_e=()=>{ie(!0)},[Re,Y]=v.useState(!1),V=v.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),N.current=!1,M.current=null,P.current=!1;const O=re.getState().aiAgentMessages;O.length>0&&_(O),Y(!0)},[]);v.useEffect(()=>{if(Re){if(!h||!y||!x){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:y,connectionReady:x});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),N.current){Y(!1);return}N.current=!0,h.emit(He.ChatView,{},O=>{console.log("handleOperatorConnected: ChatView result",O),O&&!("error"in O)&&O.status?(C(O),i(!0),h.emit(He.MessageList,{},ee=>{console.log("handleOperatorConnected: MessageList result",ee),Array.isArray(ee)&&_(ke=>jx(ke,ee))})):(console.log("handleOperatorConnected: Invalid chat result, clearing state",O),i(!1)),Y(!1)})}},[Re,h,y,x,i]);const Z=()=>{u(),g||r(!1),z(!0),pa((n==null?void 0:n.link_id)||""),i(!1),C(null),_([]),L([]),o(null),re.getState().setHistoryMessages(null),re.getState().setShowHistoryOnRegistration(!1),ac(n.client_id,Yi(w)).then(()=>{h==null||h.disconnect(),m.push("registration")})},ue=v.useCallback(O=>{if(d&&c&&!s){const{aiAgentMessages:ae,addAIAgentMessage:ee}=re.getState();if(ae.some(ke=>ke.id===O.id))return;ee(O);return}b&&![tn.Closed,tn.Deleted].includes(b.status)&&_(ae=>{const ee=ae.filter(he=>{var Ze;return!((Ze=he.id)!=null&&Ze.startsWith("temp-")&&he.content===O.content)});return ee.some(he=>he.id===O.id)?ee:[...ee,O]})},[b,d,c,s]);return v.useEffect(()=>{if(!h)return;const O=fe=>{const R={content:fe.content,created_at:fe.created_at,files:fe.files,id:fe._id,sender_type:fe.sender_type,answers:fe.answers,reply_id:fe.reply_id,buttons:fe.buttons};if(E.length>0){L(K=>[...K,R]);return}fe.is_shortcut?L([R]):ue(R),A(!1)},ae=fe=>{const R={content:fe.content,created_at:fe.created_at,files:fe.files,id:fe._id,sender_type:fe.sender_type,activity_type:fe.activity_type,sender_name:fe.sender_name,answers:fe.answers,reply_id:fe.reply_id,buttons:fe.buttons};ue(R)},ee=fe=>{!fe||!fe.name?C(R=>R?{...R,agent_name:void 0,agent_avatar:void 0}:null):(C(R=>R?{...R,agent_name:fe.name,agent_avatar:fe.avatar}:null),D(R=>R.includes(fe.name)?R:[...R,fe.name]))},ke=()=>{A(!0)},he=()=>{pe()},Ze=({is_customer_uploadable:fe})=>{C(R=>R?{...R,is_customer_uploadable:fe}:null)},qe=fe=>{D(R=>{const K=R.filter(I=>I!==fe.name);return fe.hasOtherAdmins?K.length>0&&C(I=>I?{...I,agent_name:K[0],agent_avatar:void 0}:null):C(I=>I?{...I,agent_name:void 0,agent_avatar:void 0}:null),K})},Bt=fe=>{D(R=>R.includes(fe.name)?R:[...R,fe.name]),C(R=>R?R.agent_name?R:{...R,agent_name:fe.name,agent_avatar:void 0}:null)};return h.on(ve.MessageAgentCreate,O),h.on(ve.MessageUserCreate,ae),h.on(ve.MessageCustomerCreate,ae),h.on(ve.ChatUserAssignee,ee),h.on(ve.MessageAgentTyping,ke),h.on(ve.ChatUserClose,he),h.on(ve.ChatToggleUpload,Ze),h.on(ve.ChatUserLeave,qe),h.on(ve.ChatUserJoin,Bt),()=>{h.off(ve.MessageAgentCreate,O),h.off(ve.MessageUserCreate,ae),h.off(ve.MessageCustomerCreate,ae),h.off(ve.ChatUserAssignee,ee),h.off(ve.MessageAgentTyping,ke),h.off(ve.ChatUserClose,he),h.off(ve.ChatToggleUpload,Ze),h.off(ve.ChatUserLeave,qe),h.off(ve.ChatUserJoin,Bt)}},[ue,F]),v.useEffect(()=>{if(!h)return;const O=ee=>{ee.repeat_count===3&&q(ee.message)},ae=()=>{h.emit(He.ChatClose,{}),re.getState().setShowActionButtons(!1),pe()};return h.on(ve.AgentSpamWarning,O),h.on(ve.AgentSpamBanned,ae),()=>{h.off(ve.AgentSpamWarning,O),h.off(ve.AgentSpamBanned,ae)}},[h,pe]),v.useEffect(()=>{if(!h||!b||s){M.current=null;return}const O=`${b.status}-${b.agent_name||"no-agent"}`;M.current!==O&&(M.current=O,h.emit(He.MessageList,{},ae=>{if(!Array.isArray(ae)){console.warn("MessageList response is not an array:",ae),M.current=null;return}_(he=>jx(he,ae));const ee=new Map;for(const he of ae)he.sender_type===ye.Activity&&(he.activity_type===gn.AdminJoin&&he.sender_name?ee.set(he.sender_name,!0):he.activity_type===gn.AdminLeave&&he.sender_name&&ee.set(he.sender_name,!1));const ke=Array.from(ee.entries()).filter(([he,Ze])=>Ze).map(([he])=>he);D(ke)}))},[h,b,s]),v.useEffect(()=>{const O=setTimeout(()=>{A(!1)},2e3);return()=>clearTimeout(O)},[j]),v.useEffect(()=>{if(!n||E.length===0)return;let O=0;n.writing_timeout&&(O=[...E[0].content].length/n.writing_timeout,O<0&&(O=0));const ae=setTimeout(()=>{ue(E[0]),L(E.slice(1))},O*1e3);return()=>clearTimeout(ae)},[E,n]),G?f.jsx(th,{}):d&&c&&!s?f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${g?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:g?"100%":"",minHeight:g?"var(--app-height, 100dvh)":"",maxHeight:g?"var(--app-height, 100dvh)":"",backgroundColor:p.getColor(k.Background)},children:f.jsx(EB,{onOperatorConnected:V,onChatClose:Z})})]}):f.jsxs(f.Fragment,{children:[f.jsx("div",{id:"chat-alert-portal"}),f.jsx("div",{className:`h-full w-full ${g?"":"rounded-xl"} shadow-sm flex flex-col overflow-hidden`,style:{height:g?"100%":"",minHeight:g?"var(--app-height, 100dvh)":"",maxHeight:g?"var(--app-height, 100dvh)":"",backgroundColor:p.getColor(k.Background)},children:b?b.status===tn.Closed&&!s?f.jsx(SB,{onOk:ie}):f.jsx(bB,{chat:b,isTyping:j,messages:S,shortcutMessages:E,onNewMessage:ue,onChatClose:pe,onEvaluateChat:ce,onNewChat:_e,onSendMessage:se,isHistoryMode:!!s,spamWarningMessage:W,onDismissSpamWarning:()=>q(null)}):B?f.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-6 text-center",children:[f.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center mb-4",style:{backgroundColor:p.getColor(k.InputBorder)},children:f.jsx(X.XCircle,{className:"w-6 h-6 opacity-50"})}),f.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Bağlantı Kurulamadı"}),f.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Sunucuyla bağlantı sağlanırken bir sorun oluştu. Lütfen tekrar deneyin."}),f.jsx("button",{type:"button",onClick:()=>ie(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:p.getColor(k.ButtonBackground),color:p.getColor(k.ButtonText),borderRadius:p.getRadius()},children:"Tekrar Dene"})]}):f.jsx(vC,{})})]})}function PB(){return GL(),null}function MB(){return f.jsxs(jB,{children:[f.jsx(AB,{children:f.jsx(RB,{})}),f.jsx(PB,{})]})}const OB=[{path:"/chat",component:MB,name:"chat"}],$C=[...OB],zC=[...XL],NB=[...$C,...zC];function lh({text:e}){var c,d,u,p;const{widget:t,isHaveChat:n,isTooltipVisible:r,setIsTooltipVisible:i,onTooltipClose:s}=re(),o=Se(),a=cs(),l=()=>{i(!1),s&&s()};return r?f.jsxs(Me.div,{initial:{opacity:0,scale:.8,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:10},transition:{type:"spring",damping:20,stiffness:300},className:Ve("absolute bottom-full mb-3 p-3 shadow-lg whitespace-nowrap","w-auto right-0"),style:{borderRadius:o.getRadius(),backgroundColor:o.getColor(k.TooltipBackground),color:o.getColor(k.TooltipText)},children:[f.jsx("button",{onClick:l,className:"absolute top-2 right-2 p-1 rounded-full hover:bg-black/10 transition-colors","aria-label":a(ne.CloseButtonAria),children:f.jsx(X.X,{className:"size-3"})}),f.jsx(Me.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1,duration:.3},className:"text-sm font-medium pr-5",style:{color:o.getColor(k.TooltipText)},children:e||(n?(d=(c=t==null?void 0:t.appearance)==null?void 0:c.design)==null?void 0:d.tooltip_message_active:(p=(u=t==null?void 0:t.appearance)==null?void 0:u.design)==null?void 0:p.tooltip_message)||a(n?ne.TooltipActive:ne.TooltipDefault)}),f.jsx("div",{className:"absolute bottom-0 right-4 w-3 h-3 transform rotate-45 translate-y-1.5",style:{backgroundColor:o.getColor(k.TooltipBackground)}})]},"widget-tooltip"):null}function Rx({fallback:e,fallbackOpen:t}){const[n]=v.useState(window.document.title),r=dr(),{isHaveChat:i,open:s,soundPath:o}=re(),[a,l]=v.useState(!0),[c,d]=v.useState(0),[u,p]=v.useState(null),h=cs(),y=()=>{iF(o)},x=(w,m)=>{if(u&&clearInterval(u),w||!i||m===0||Number.isNaN(m)){window.document.title=n,p(null);return}const g=setInterval(()=>{if(w||!i||m===0||Number.isNaN(m)){window.document.title=n,clearInterval(g),p(null);return}const b=`${m} ${h(ne.NewMessagesNotification)} - ${n}`;window.document.title!==b?window.document.title=b:window.document.title=n},1e3);return p(g),()=>{clearInterval(g),p(null)}};return v.useEffect(()=>x(s&&a,c),[c,s,a]),v.useEffect(()=>{const w=()=>{l(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",w,!1),()=>{document.removeEventListener("visibilitychange",w)}},[]),v.useEffect(()=>{if(i&&s&&a&&d(0),!r||!i||s&&a)return;const w=()=>{!i||s&&a||(d(m=>m+1),y())};return r.on(ve.MessageAgentCreate,w),r.on(ve.ChatUserAssignee,y),()=>{r.off(ve.MessageAgentCreate,w),r.off(ve.ChatUserAssignee,y)}},[r,i,s,a]),s?null:i&&c>0?f.jsx(lh,{text:h(ne.NewMessagesNotification)}):!i&&t?e:null}function DB({children:e,border:t}){var M,P,B,U;const n=dr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c,humanNeedRequested:d}=re(),[u]=v.useState(!0),p=gs(),h=ll(),y=dm(),x=Se(),{resolvedMode:w}=x,m=Po(),g=WL(),[b,C]=v.useState({x:0,y:0}),S=wP(),_=v.useRef(null),j=v.useRef(null),[A,E]=v.useState(!1),[L,F]=v.useState(!1);v.useEffect(()=>((()=>{E("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{E(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{E(!0)})}),[]),v.useEffect(()=>{o&&y.pathname==="/"&&h&&h.accessToken&&!d&&p.push("chat")},[o,y.pathname,h,p,d]),v.useEffect(()=>{r?requestAnimationFrame(()=>{F(!0)}):F(!1)},[r]);const D=W=>{if(!_.current||!j.current)return W;const q=_.current.getBoundingClientRect(),se={width:window.innerWidth,height:window.innerHeight},ie={top:20,right:20,bottom:40,left:20};let pe=W.x,ce=W.y;return q.right+pe-b.x>se.width-ie.right&&(pe=se.width-ie.right-q.width-(q.left-b.x)),q.left+pe-b.x<ie.left&&(pe=ie.left-(q.left-b.x)),q.bottom+ce-b.y>se.height-ie.bottom&&(ce=se.height-ie.bottom-q.height-(q.top-b.y)),q.top+ce-b.y<ie.top&&(ce=ie.top-(q.top-b.y)),{x:pe,y:ce}},G=()=>{i(!0),n&&(n.emit(He.WidgetOpen,{}),l&&l())},z=()=>{i(!1),n&&(n.emit(He.WidgetClose,{}),c&&c())},$=()=>{i(!1),s(!1),ac(a.client_id,Yi(h)),p.push("registration")};v.useEffect(()=>{if(m&&(o||g)&&G(),!(!n||!a))return n.on(ve.Banned,$),()=>{n.off(ve.Banned,$)}},[]);function N(W){A&&S.start(W)}return f.jsxs("section",{className:"relative w-full h-full",ref:j,"data-theme":w,children:[r&&f.jsx("div",{className:Ve("fixed z-300 overflow-hidden transition-all duration-300 ease-out",{"":t&&!m,"bottom-24 right-8 rounded-xl":!m,"!bottom-0 !right-0":m,"opacity-100 scale-100 translate-y-0":L,"opacity-0 scale-95 translate-y-2":!L}),style:{width:m?"100%":((P=(M=a==null?void 0:a.appearance)==null?void 0:M.design)==null?void 0:P.width)||"21rem",height:m?"var(--app-height, 100dvh)":((U=(B=a==null?void 0:a.appearance)==null?void 0:B.design)==null?void 0:U.height)||"30rem",left:m?"0":"",right:m?"0px !important":"",maxHeight:m?"var(--app-height, 100dvh)":"",boxShadow:m?"":`0 10px 25px -5px ${x.getColor(k.ShadowColor)}, 0 8px 10px -6px ${x.getColor(k.ShadowColor)}`,backgroundColor:x.getColor(k.Background)},children:e}),!A&&f.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[f.jsx(Rx,{fallback:f.jsx(lh,{}),fallbackOpen:u}),!r&&f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:G,children:[f.jsx(Me.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:Ve("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:x.getColor(k.ButtonBackground)}}),f.jsx(X.Chat,{className:"size-6"})]},"desktop-open-button"),r&&!m&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:z,children:f.jsx(X.ArrowDown2,{className:"size-6"})},"desktop-close-button")]}),A&&f.jsxs(Me.div,{ref:_,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:b.x,y:b.y},drag:A,dragControls:S,dragMomentum:!1,dragElastic:0,onDragEnd:(W,q)=>{const se={x:b.x+q.offset.x,y:b.y+q.offset.y},ie=D(se);C(ie)},children:[f.jsx(Rx,{fallback:f.jsx(lh,{}),fallbackOpen:u}),!r&&f.jsx("div",{className:"cursor-move",onPointerDown:N,children:f.jsxs(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,className:"relative",onClick:G,children:[f.jsx(Me.span,{initial:{scale:.8,opacity:0},animate:{scale:[1,1.2,1],opacity:[.7,0,.7]},transition:{duration:2,repeat:Number.POSITIVE_INFINITY,repeatType:"loop"},className:Ve("absolute -z-10 w-full h-full rounded-full opacity-30"),style:{backgroundColor:x.getColor(k.ButtonBackground)}}),f.jsx(X.Chat,{className:"size-6"})]})},"chat-button"),r&&!m&&f.jsx(Rt,{animations:{whileHover:{scale:1.1},whileTap:{scale:.95}},size:"lg",rounded:!0,onClick:z,children:f.jsx(X.ArrowDown2,{className:"size-6"})},"desktop-close-button")]})]})}function IB(e){const{widget:t}=re();return f.jsx(PP,{widget:t,children:f.jsx(DB,{...e})})}function LB(){const{isHaveChat:e,isAIAgentMode:t}=re();return f.jsx(oA,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:f.jsx(IB,{border:!0,children:f.jsxs(lA,{children:[$C.map((n,r)=>f.jsx(hp,{path:n.path,element:f.jsx(n.component,{})},r)),zC.map((n,r)=>f.jsx(hp,{path:n.path,element:f.jsx(n.component,{})},r))]})})})}const FB=v.forwardRef((e,t)=>{const n=localStorage.getItem("lc:device:id"),{data:r,isLoading:i,error:s}=dE(e.link_id,n||void 0),{widget:o,setWidget:a,setSoundPath:l,setDefaultValues:c,setOpen:d,setOnTooltipClose:u,setIsTooltipVisible:p,setOnOpen:h,setOnClose:y,onOpen:x,onClose:w}=re();return v.useImperativeHandle(t,()=>({open:()=>{d(!0),x&&x()},close:()=>{d(!1),w&&w()}})),v.useEffect(()=>{r&&pE(r)&&a(r),e.soundPath&&l(e.soundPath),e.defaultValues&&c(e.defaultValues),e.onTooltipClose&&u(e.onTooltipClose),e.showTooltip===!1&&p(!1),e.onOpen&&h(e.onOpen),e.onClose&&y(e.onClose)},[r,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),i?f.jsx("div",{children:"Loading..."}):s||!r||!o?null:f.jsx(DI,{children:f.jsx(HL,{children:f.jsx(LB,{})})})}),BB=new YT;let Px=null;function $B(e){if(!e.container)return;const t=J.createRef();return Px=tb(e.container),Px.render(f.jsxs(JT,{client:BB,children:[f.jsx(FB,{...e,ref:t}),f.jsx(IA,{richColors:!0,style:{zIndex:999999,position:"fixed",bottom:"20px",right:"20px"},position:"bottom-right"})]})),{open:()=>{var n;return(n=t.current)==null?void 0:n.open()},close:()=>{var n;return(n=t.current)==null?void 0:n.close()},identify:n=>{if(!e.link_id)return;const r=mi(e.link_id);dM({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=$B});export default zB();
|