@alfatech/livechat 2026.4.2-9.1 → 2026.4.2-9.2
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 +26 -26
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Ig=e=>{throw TypeError(e)};var
|
|
1
|
+
var Ig=e=>{throw TypeError(e)};var y2=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var cd=(e,t,n)=>t.has(e)||Ig("Cannot "+n);var T=(e,t,n)=>(cd(e,t,"read from private field"),n?n.call(e):t.get(e)),ye=(e,t,n)=>t.has(e)?Ig("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),de=(e,t,n,r)=>(cd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Te=(e,t,n)=>(cd(e,t,"access private method"),n);var Sl=(e,t,n,r)=>({set _(i){de(e,t,i,n)},get _(){return T(e,t,r)}});var F8=y2((cn,un)=>{function x2(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 bh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c1={exports:{}},hu={},u1={exports:{}},Ae={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var Ig=e=>{throw TypeError(e)};var v2=(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 ol=Symbol.for("react.element"),
|
|
9
|
+
*/var ol=Symbol.for("react.element"),w2=Symbol.for("react.portal"),b2=Symbol.for("react.fragment"),S2=Symbol.for("react.strict_mode"),k2=Symbol.for("react.profiler"),C2=Symbol.for("react.provider"),_2=Symbol.for("react.context"),T2=Symbol.for("react.forward_ref"),E2=Symbol.for("react.suspense"),A2=Symbol.for("react.memo"),j2=Symbol.for("react.lazy"),Lg=Symbol.iterator;function R2(e){return e===null||typeof e!="object"?null:(e=Lg&&e[Lg]||e["@@iterator"],typeof e=="function"?e:null)}var d1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f1=Object.assign,p1={};function Eo(e,t,n){this.props=e,this.context=t,this.refs=p1,this.updater=n||d1}Eo.prototype.isReactComponent={};Eo.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")};Eo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function h1(){}h1.prototype=Eo.prototype;function Sh(e,t,n){this.props=e,this.context=t,this.refs=p1,this.updater=n||d1}var kh=Sh.prototype=new h1;kh.constructor=Sh;f1(kh,Eo.prototype);kh.isPureReactComponent=!0;var Fg=Array.isArray,m1=Object.prototype.hasOwnProperty,Ch={current:null},g1={key:!0,ref:!0,__self:!0,__source:!0};function v1(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)m1.call(t,r)&&!g1.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:ol,type:e,key:s,ref:o,props:i,_owner:Ch.current}}function M2(e,t){return{$$typeof:ol,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _h(e){return typeof e=="object"&&e!==null&&e.$$typeof===ol}function P2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Bg=/\/+/g;function ud(e,t){return typeof e=="object"&&e!==null&&e.key!=null?P2(""+e.key):t.toString(36)}function ec(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 ol:case w2:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+ud(o,0):r,Fg(i)?(n="",e!=null&&(n=e.replace(Bg,"$&/")+"/"),ec(i,t,n,"",function(c){return c})):i!=null&&(_h(i)&&(i=M2(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Bg,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",Fg(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+ud(s,a);o+=ec(s,t,n,l,i)}else if(l=R2(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+ud(s,a++),o+=ec(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 kl(e,t,n){if(e==null)return e;var r=[],i=0;return ec(e,r,"","",function(s){return t.call(n,s,i++)}),r}function N2(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 Vt={current:null},tc={transition:null},O2={ReactCurrentDispatcher:Vt,ReactCurrentBatchConfig:tc,ReactCurrentOwner:Ch};function y1(){throw Error("act(...) is not supported in production builds of React.")}Ae.Children={map:kl,forEach:function(e,t,n){kl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return kl(e,function(){t++}),t},toArray:function(e){return kl(e,function(t){return t})||[]},only:function(e){if(!_h(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ae.Component=Eo;Ae.Fragment=b2;Ae.Profiler=k2;Ae.PureComponent=Sh;Ae.StrictMode=S2;Ae.Suspense=E2;Ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=O2;Ae.act=y1;Ae.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=f1({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Ch.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)m1.call(t,l)&&!g1.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:ol,type:e.type,key:i,ref:s,props:r,_owner:o}};Ae.createContext=function(e){return e={$$typeof:_2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:C2,_context:e},e.Consumer=e};Ae.createElement=v1;Ae.createFactory=function(e){var t=v1.bind(null,e);return t.type=e,t};Ae.createRef=function(){return{current:null}};Ae.forwardRef=function(e){return{$$typeof:T2,render:e}};Ae.isValidElement=_h;Ae.lazy=function(e){return{$$typeof:j2,_payload:{_status:-1,_result:e},_init:N2}};Ae.memo=function(e,t){return{$$typeof:A2,type:e,compare:t===void 0?null:t}};Ae.startTransition=function(e){var t=tc.transition;tc.transition={};try{e()}finally{tc.transition=t}};Ae.unstable_act=y1;Ae.useCallback=function(e,t){return Vt.current.useCallback(e,t)};Ae.useContext=function(e){return Vt.current.useContext(e)};Ae.useDebugValue=function(){};Ae.useDeferredValue=function(e){return Vt.current.useDeferredValue(e)};Ae.useEffect=function(e,t){return Vt.current.useEffect(e,t)};Ae.useId=function(){return Vt.current.useId()};Ae.useImperativeHandle=function(e,t,n){return Vt.current.useImperativeHandle(e,t,n)};Ae.useInsertionEffect=function(e,t){return Vt.current.useInsertionEffect(e,t)};Ae.useLayoutEffect=function(e,t){return Vt.current.useLayoutEffect(e,t)};Ae.useMemo=function(e,t){return Vt.current.useMemo(e,t)};Ae.useReducer=function(e,t,n){return Vt.current.useReducer(e,t,n)};Ae.useRef=function(e){return Vt.current.useRef(e)};Ae.useState=function(e){return Vt.current.useState(e)};Ae.useSyncExternalStore=function(e,t,n){return Vt.current.useSyncExternalStore(e,t,n)};Ae.useTransition=function(){return Vt.current.useTransition()};Ae.version="18.3.1";u1.exports=Ae;var v=u1.exports;const ne=Ir(v),D2=x2({__proto__:null,default:ne},[v]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var Ig=e=>{throw TypeError(e)};var v2=(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 I2=v,L2=Symbol.for("react.element"),F2=Symbol.for("react.fragment"),B2=Object.prototype.hasOwnProperty,$2=I2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,z2={key:!0,ref:!0,__self:!0,__source:!0};function x1(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)B2.call(t,r)&&!z2.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:$2.current}}hu.Fragment=F2;hu.jsx=x1;hu.jsxs=x1;c1.exports=hu;var f=c1.exports,w1={exports:{}},pn={},b1={exports:{}},S1={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var Ig=e=>{throw TypeError(e)};var v2=(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(j,
|
|
25
|
+
*/(function(e){function t(j,V){var R=j.length;j.push(V);e:for(;0<R;){var G=R-1>>>1,U=j[G];if(0<i(U,V))j[G]=V,j[R]=U,R=G;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var V=j[0],R=j.pop();if(R!==V){j[0]=R;e:for(var G=0,U=j.length,J=U>>>1;G<J;){var ie=2*(G+1)-1,ge=j[ie],te=ie+1,be=j[te];if(0>i(ge,R))te<U&&0>i(be,ge)?(j[G]=be,j[te]=R,G=te):(j[G]=ge,j[ie]=R,G=ie);else if(te<U&&0>i(be,R))j[G]=be,j[te]=R,G=te;else break e}}return V}function i(j,V){var R=j.sortIndex-V.sortIndex;return R!==0?R:j.id-V.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,x=!1,b=!1,S=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 y(j){for(var V=n(c);V!==null;){if(V.callback===null)r(c);else if(V.startTime<=j)r(c),V.sortIndex=V.expirationTime,t(l,V);else break;V=n(c)}}function k(j){if(b=!1,y(j),!x)if(n(l)!==null)x=!0,L(C);else{var V=n(c);V!==null&&B(k,V.startTime-j)}}function C(j,V){x=!1,b&&(b=!1,m(A),A=-1),h=!0;var R=p;try{for(y(V),u=n(l);u!==null&&(!(u.expirationTime>V)||j&&!D());){var G=u.callback;if(typeof G=="function"){u.callback=null,p=u.priorityLevel;var U=G(u.expirationTime<=V);V=e.unstable_now(),typeof U=="function"?u.callback=U:u===n(l)&&r(l),y(V)}else r(l);u=n(l)}if(u!==null)var J=!0;else{var ie=n(c);ie!==null&&B(k,ie.startTime-V),J=!1}return J}finally{u=null,p=R,h=!1}}var _=!1,E=null,A=-1,$=5,I=-1;function D(){return!(e.unstable_now()-I<$)}function P(){if(E!==null){var j=e.unstable_now();I=j;var V=!0;try{V=E(!0,j)}finally{V?z():(_=!1,E=null)}}else _=!1}var z;if(typeof g=="function")z=function(){g(P)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,O=N.port2;N.port1.onmessage=P,z=function(){O.postMessage(null)}}else z=function(){S(P,0)};function L(j){E=j,_||(_=!0,z())}function B(j,V){A=S(function(){j(e.unstable_now())},V)}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(j){j.callback=null},e.unstable_continueExecution=function(){x||h||(x=!0,L(C))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(j){switch(p){case 1:case 2:case 3:var V=3;break;default:V=p}var R=p;p=V;try{return j()}finally{p=R}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,V){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var R=p;p=j;try{return V()}finally{p=R}},e.unstable_scheduleCallback=function(j,V,R){var G=e.unstable_now();switch(typeof R=="object"&&R!==null?(R=R.delay,R=typeof R=="number"&&0<R?G+R:G):R=G,j){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=R+U,j={id:d++,callback:V,priorityLevel:j,startTime:R,expirationTime:U,sortIndex:-1},R>G?(j.sortIndex=R,t(c,j),n(l)===null&&j===n(c)&&(b?(m(A),A=-1):b=!0,B(k,R-G))):(j.sortIndex=U,t(l,j),x||h||(x=!0,L(C))),j},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(j){var V=p;return function(){var R=p;p=V;try{return j.apply(this,arguments)}finally{p=R}}}})(S1);b1.exports=S1;var V2=b1.exports;/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.min.js
|
|
28
28
|
*
|
|
@@ -30,14 +30,14 @@ var Ig=e=>{throw TypeError(e)};var v2=(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
|
|
33
|
+
*/var U2=v,fn=V2;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 k1=new Set,Ca={};function cs(e,t){fo(e,t),fo(e+"Capture",t)}function fo(e,t){for(Ca[e]=t,e=0;e<t.length;e++)k1.add(t[e])}var jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xf=Object.prototype.hasOwnProperty,H2=/^[: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]*$/,$g={},zg={};function W2(e){return xf.call(zg,e)?!0:xf.call($g,e)?!1:H2.test(e)?zg[e]=!0:($g[e]=!0,!1)}function q2(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 G2(e,t,n,r){if(t===null||typeof t>"u"||q2(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 Ut(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 _t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_t[e]=new Ut(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_t[t]=new Ut(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_t[e]=new Ut(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_t[e]=new Ut(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){_t[e]=new Ut(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_t[e]=new Ut(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_t[e]=new Ut(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_t[e]=new Ut(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_t[e]=new Ut(e,5,!1,e.toLowerCase(),null,!1,!1)});var Th=/[\-:]([a-z])/g;function Eh(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(Th,Eh);_t[t]=new Ut(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(Th,Eh);_t[t]=new Ut(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(Th,Eh);_t[t]=new Ut(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_t[e]=new Ut(e,1,!1,e.toLowerCase(),null,!1,!1)});_t.xlinkHref=new Ut("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_t[e]=new Ut(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ah(e,t,n,r){var i=_t.hasOwnProperty(t)?_t[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(G2(t,n,i,r)&&(n=null),r||i===null?W2(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 Lr=U2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Cl=Symbol.for("react.element"),_s=Symbol.for("react.portal"),Ts=Symbol.for("react.fragment"),jh=Symbol.for("react.strict_mode"),wf=Symbol.for("react.profiler"),C1=Symbol.for("react.provider"),_1=Symbol.for("react.context"),Rh=Symbol.for("react.forward_ref"),bf=Symbol.for("react.suspense"),Sf=Symbol.for("react.suspense_list"),Mh=Symbol.for("react.memo"),Vr=Symbol.for("react.lazy"),T1=Symbol.for("react.offscreen"),Vg=Symbol.iterator;function Bo(e){return e===null||typeof e!="object"?null:(e=Vg&&e[Vg]||e["@@iterator"],typeof e=="function"?e:null)}var Je=Object.assign,dd;function Xo(e){if(dd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dd=t&&t[1]||""}return`
|
|
34
34
|
`+dd+e}var fd=!1;function pd(e,t){if(!e||fd)return"";fd=!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{fd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xo(e):""}function G2(e){switch(e.tag){case 5:return Xo(e.type);case 16:return Xo("Lazy");case 13:return Xo("Suspense");case 19:return Xo("SuspenseList");case 0:case 2:case 15:return e=pd(e.type,!1),e;case 11:return e=pd(e.type.render,!1),e;case 1:return e=pd(e.type,!0),e;default:return""}}function kf(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 Ts:return"Fragment";case _s:return"Portal";case wf:return"Profiler";case jh:return"StrictMode";case bf:return"Suspense";case Sf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _1:return(e.displayName||"Context")+".Consumer";case C1:return(e._context.displayName||"Context")+".Provider";case Rh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Mh:return t=e.displayName||null,t!==null?t:kf(e.type)||"Memo";case Vr:t=e._payload,e=e._init;try{return kf(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 kf(t);case 8:return t===jh?"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 gi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function E1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Q2(e){var t=E1(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 _l(e){e._valueTracker||(e._valueTracker=Q2(e))}function A1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=E1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Cc(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 Cf(e,t){var n=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ug(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gi(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 j1(e,t){t=t.checked,t!=null&&Ah(e,"checked",t,!1)}function _f(e,t){j1(e,t);var n=gi(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")?Tf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tf(e,t.type,gi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hg(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 Tf(e,t,n){(t!=="number"||Cc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zo=Array.isArray;function Hs(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=""+gi(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 Ef(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return Je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wg(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(Zo(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:gi(n)}}function R1(e,t){var n=gi(t.value),r=gi(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 qg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function M1(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 Af(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?M1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Tl,P1=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(Tl=Tl||document.createElement("div"),Tl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Tl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _a(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var la={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(la).forEach(function(e){K2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),la[t]=la[e]})});function N1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||la.hasOwnProperty(e)&&la[e]?(""+t).trim():t+"px"}function O1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=N1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var X2=Je({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 jf(e,t){if(t){if(X2[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 Rf(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 Mf=null;function Ph(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pf=null,Ws=null,qs=null;function Gg(e){if(e=cl(e)){if(typeof Pf!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=xu(t),Pf(e.stateNode,e.type,t))}}function D1(e){Ws?qs?qs.push(e):qs=[e]:Ws=e}function I1(){if(Ws){var e=Ws,t=qs;if(qs=Ws=null,Gg(e),t)for(e=0;e<t.length;e++)Gg(t[e])}}function L1(e,t){return e(t)}function F1(){}var hd=!1;function B1(e,t,n){if(hd)return e(t,n);hd=!0;try{return L1(e,t,n)}finally{hd=!1,(Ws!==null||qs!==null)&&(F1(),I1())}}function Ta(e,t){var n=e.stateNode;if(n===null)return null;var r=xu(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 Nf=!1;if(jr)try{var $o={};Object.defineProperty($o,"passive",{get:function(){Nf=!0}}),window.addEventListener("test",$o,$o),window.removeEventListener("test",$o,$o)}catch{Nf=!1}function Z2(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 ca=!1,_c=null,Tc=!1,Of=null,J2={onError:function(e){ca=!0,_c=e}};function e_(e,t,n,r,i,s,o,a,l){ca=!1,_c=null,Z2.apply(J2,arguments)}function t_(e,t,n,r,i,s,o,a,l){if(e_.apply(this,arguments),ca){if(ca){var c=_c;ca=!1,_c=null}else throw Error(Q(198));Tc||(Tc=!0,Of=c)}}function us(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 $1(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 Yg(e){if(us(e)!==e)throw Error(Q(188))}function n_(e){var t=e.alternate;if(!t){if(t=us(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 Yg(i),e;if(s===r)return Yg(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 z1(e){return e=n_(e),e!==null?V1(e):null}function V1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=V1(e);if(t!==null)return t;e=e.sibling}return null}var U1=fn.unstable_scheduleCallback,Qg=fn.unstable_cancelCallback,r_=fn.unstable_shouldYield,i_=fn.unstable_requestPaint,at=fn.unstable_now,s_=fn.unstable_getCurrentPriorityLevel,Nh=fn.unstable_ImmediatePriority,H1=fn.unstable_UserBlockingPriority,Ec=fn.unstable_NormalPriority,o_=fn.unstable_LowPriority,W1=fn.unstable_IdlePriority,mu=null,or=null;function a_(e){if(or&&typeof or.onCommitFiberRoot=="function")try{or.onCommitFiberRoot(mu,e,void 0,(e.current.flags&128)===128)}catch{}}var Wn=Math.clz32?Math.clz32:u_,l_=Math.log,c_=Math.LN2;function u_(e){return e>>>=0,e===0?32:31-(l_(e)/c_|0)|0}var El=64,Al=4194304;function Jo(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 Ac(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=Jo(a):(s&=o,s!==0&&(r=Jo(s)))}else o=n&~i,o!==0?r=Jo(o):s!==0&&(r=Jo(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-Wn(t),i=1<<n,r|=e[n],t&=~i;return r}function d_(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 f_(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Wn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=d_(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Df(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function q1(){var e=El;return El<<=1,!(El&4194240)&&(El=64),e}function md(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function al(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Wn(t),e[t]=n}function p_(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-Wn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Oh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Wn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ie=0;function G1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Y1,Dh,Q1,K1,X1,If=!1,jl=[],oi=null,ai=null,li=null,Ea=new Map,Aa=new Map,Wr=[],h_="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 Kg(e,t){switch(e){case"focusin":case"focusout":oi=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":li=null;break;case"pointerover":case"pointerout":Ea.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Aa.delete(t.pointerId)}}function zo(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=cl(t),t!==null&&Dh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function m_(e,t,n,r,i){switch(t){case"focusin":return oi=zo(oi,e,t,n,r,i),!0;case"dragenter":return ai=zo(ai,e,t,n,r,i),!0;case"mouseover":return li=zo(li,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ea.set(s,zo(Ea.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Aa.set(s,zo(Aa.get(s)||null,e,t,n,r,i)),!0}return!1}function Z1(e){var t=Oi(e.target);if(t!==null){var n=us(t);if(n!==null){if(t=n.tag,t===13){if(t=$1(n),t!==null){e.blockedOn=t,X1(e.priority,function(){Q1(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 nc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Mf=r,n.target.dispatchEvent(r),Mf=null}else return t=cl(n),t!==null&&Dh(t),e.blockedOn=n,!1;t.shift()}return!0}function Xg(e,t,n){nc(e)&&n.delete(t)}function g_(){If=!1,oi!==null&&nc(oi)&&(oi=null),ai!==null&&nc(ai)&&(ai=null),li!==null&&nc(li)&&(li=null),Ea.forEach(Xg),Aa.forEach(Xg)}function Vo(e,t){e.blockedOn===t&&(e.blockedOn=null,If||(If=!0,fn.unstable_scheduleCallback(fn.unstable_NormalPriority,g_)))}function ja(e){function t(i){return Vo(i,e)}if(0<jl.length){Vo(jl[0],e);for(var n=1;n<jl.length;n++){var r=jl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(oi!==null&&Vo(oi,e),ai!==null&&Vo(ai,e),li!==null&&Vo(li,e),Ea.forEach(t),Aa.forEach(t),n=0;n<Wr.length;n++)r=Wr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wr.length&&(n=Wr[0],n.blockedOn===null);)Z1(n),n.blockedOn===null&&Wr.shift()}var Gs=Lr.ReactCurrentBatchConfig,jc=!0;function v_(e,t,n,r){var i=Ie,s=Gs.transition;Gs.transition=null;try{Ie=1,Ih(e,t,n,r)}finally{Ie=i,Gs.transition=s}}function y_(e,t,n,r){var i=Ie,s=Gs.transition;Gs.transition=null;try{Ie=4,Ih(e,t,n,r)}finally{Ie=i,Gs.transition=s}}function Ih(e,t,n,r){if(jc){var i=Lf(e,t,n,r);if(i===null)_d(e,t,r,Rc,n),Kg(e,r);else if(m_(i,e,t,n,r))r.stopPropagation();else if(Kg(e,r),t&4&&-1<h_.indexOf(e)){for(;i!==null;){var s=cl(i);if(s!==null&&Y1(s),s=Lf(e,t,n,r),s===null&&_d(e,t,r,Rc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else _d(e,t,r,null,n)}}var Rc=null;function Lf(e,t,n,r){if(Rc=null,e=Ph(r),e=Oi(e),e!==null)if(t=us(e),t===null)e=null;else if(n=t.tag,n===13){if(e=$1(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 Rc=e,null}function J1(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(s_()){case Nh:return 1;case H1:return 4;case Ec:case o_:return 16;case W1:return 536870912;default:return 16}default:return 16}}var ri=null,Lh=null,rc=null;function ew(){if(rc)return rc;var e,t=Lh,n=t.length,r,i="value"in ri?ri.value:ri.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 rc=i.slice(e,1<r?1-r:void 0)}function ic(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 Rl(){return!0}function Zg(){return!1}function hn(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)?Rl:Zg,this.isPropagationStopped=Zg,this}return Je(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=Rl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),t}var Ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fh=hn(Ao),ll=Je({},Ao,{view:0,detail:0}),x_=hn(ll),gd,vd,Uo,gu=Je({},ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bh,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!==Uo&&(Uo&&e.type==="mousemove"?(gd=e.screenX-Uo.screenX,vd=e.screenY-Uo.screenY):vd=gd=0,Uo=e),gd)},movementY:function(e){return"movementY"in e?e.movementY:vd}}),Jg=hn(gu),w_=Je({},gu,{dataTransfer:0}),b_=hn(w_),S_=Je({},ll,{relatedTarget:0}),yd=hn(S_),k_=Je({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),C_=hn(k_),__=Je({},Ao,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),T_=hn(__),E_=Je({},Ao,{data:0}),ev=hn(E_),A_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j_={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"},R_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function M_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=R_[e])?!!t[e]:!1}function Bh(){return M_}var P_=Je({},ll,{key:function(e){if(e.key){var t=A_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ic(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?j_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bh,charCode:function(e){return e.type==="keypress"?ic(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ic(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),N_=hn(P_),O_=Je({},gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tv=hn(O_),D_=Je({},ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bh}),I_=hn(D_),L_=Je({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),F_=hn(L_),B_=Je({},gu,{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}),$_=hn(B_),z_=[9,13,27,32],$h=jr&&"CompositionEvent"in window,ua=null;jr&&"documentMode"in document&&(ua=document.documentMode);var V_=jr&&"TextEvent"in window&&!ua,tw=jr&&(!$h||ua&&8<ua&&11>=ua),nv=" ",rv=!1;function nw(e,t){switch(e){case"keyup":return z_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function U_(e,t){switch(e){case"compositionend":return rw(t);case"keypress":return t.which!==32?null:(rv=!0,nv);case"textInput":return e=t.data,e===nv&&rv?null:e;default:return null}}function H_(e,t){if(Es)return e==="compositionend"||!$h&&nw(e,t)?(e=ew(),rc=Lh=ri=null,Es=!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 tw&&t.locale!=="ko"?null:t.data;default:return null}}var W_={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 iv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!W_[e.type]:t==="textarea"}function iw(e,t,n,r){D1(r),t=Mc(t,"onChange"),0<t.length&&(n=new Fh("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var da=null,Ra=null;function q_(e){mw(e,0)}function vu(e){var t=Rs(e);if(A1(t))return e}function G_(e,t){if(e==="change")return t}var sw=!1;if(jr){var xd;if(jr){var wd="oninput"in document;if(!wd){var sv=document.createElement("div");sv.setAttribute("oninput","return;"),wd=typeof sv.oninput=="function"}xd=wd}else xd=!1;sw=xd&&(!document.documentMode||9<document.documentMode)}function ov(){da&&(da.detachEvent("onpropertychange",ow),Ra=da=null)}function ow(e){if(e.propertyName==="value"&&vu(Ra)){var t=[];iw(t,Ra,e,Ph(e)),B1(q_,t)}}function Y_(e,t,n){e==="focusin"?(ov(),da=t,Ra=n,da.attachEvent("onpropertychange",ow)):e==="focusout"&&ov()}function Q_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vu(Ra)}function K_(e,t){if(e==="click")return vu(t)}function X_(e,t){if(e==="input"||e==="change")return vu(t)}function Z_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yn=typeof Object.is=="function"?Object.is:Z_;function Ma(e,t){if(Yn(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(!xf.call(t,i)||!Yn(e[i],t[i]))return!1}return!0}function av(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lv(e,t){var n=av(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=av(n)}}function aw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?aw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lw(){for(var e=window,t=Cc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Cc(e.document)}return t}function zh(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 J_(e){var t=lw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&aw(n.ownerDocument.documentElement,n)){if(r!==null&&zh(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=lv(n,s);var o=lv(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 eT=jr&&"documentMode"in document&&11>=document.documentMode,As=null,Ff=null,fa=null,Bf=!1;function cv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bf||As==null||As!==Cc(r)||(r=As,"selectionStart"in r&&zh(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}),fa&&Ma(fa,r)||(fa=r,r=Mc(Ff,"onSelect"),0<r.length&&(t=new Fh("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=As)))}function Ml(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var js={animationend:Ml("Animation","AnimationEnd"),animationiteration:Ml("Animation","AnimationIteration"),animationstart:Ml("Animation","AnimationStart"),transitionend:Ml("Transition","TransitionEnd")},bd={},cw={};jr&&(cw=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function yu(e){if(bd[e])return bd[e];if(!js[e])return e;var t=js[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cw)return bd[e]=t[n];return e}var uw=yu("animationend"),dw=yu("animationiteration"),fw=yu("animationstart"),pw=yu("transitionend"),hw=new Map,uv="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 bi(e,t){hw.set(e,t),cs(t,[e])}for(var Sd=0;Sd<uv.length;Sd++){var kd=uv[Sd],tT=kd.toLowerCase(),nT=kd[0].toUpperCase()+kd.slice(1);bi(tT,"on"+nT)}bi(uw,"onAnimationEnd");bi(dw,"onAnimationIteration");bi(fw,"onAnimationStart");bi("dblclick","onDoubleClick");bi("focusin","onFocus");bi("focusout","onBlur");bi(pw,"onTransitionEnd");fo("onMouseEnter",["mouseout","mouseover"]);fo("onMouseLeave",["mouseout","mouseover"]);fo("onPointerEnter",["pointerout","pointerover"]);fo("onPointerLeave",["pointerout","pointerover"]);cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cs("onBeforeInput",["compositionend","keypress","textInput","paste"]);cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ea="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(" "),rT=new Set("cancel close invalid load scroll toggle".split(" ").concat(ea));function dv(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,t_(r,t,void 0,e),e.currentTarget=null}function mw(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;dv(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;dv(i,a,c),s=l}}}if(Tc)throw e=Of,Tc=!1,Of=null,e}function He(e,t){var n=t[Hf];n===void 0&&(n=t[Hf]=new Set);var r=e+"__bubble";n.has(r)||(gw(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),gw(n,e,r,t)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function Pa(e){if(!e[Pl]){e[Pl]=!0,k1.forEach(function(n){n!=="selectionchange"&&(rT.has(n)||Cd(n,!1,e),Cd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pl]||(t[Pl]=!0,Cd("selectionchange",!1,t))}}function gw(e,t,n,r){switch(J1(t)){case 1:var i=v_;break;case 4:i=y_;break;default:i=Ih}n=i.bind(null,t,n,e),i=void 0,!Nf||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 _d(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=Oi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}B1(function(){var c=s,d=Ph(n),u=[];e:{var p=hw.get(e);if(p!==void 0){var h=Fh,x=e;switch(e){case"keypress":if(ic(n)===0)break e;case"keydown":case"keyup":h=N_;break;case"focusin":x="focus",h=yd;break;case"focusout":x="blur",h=yd;break;case"beforeblur":case"afterblur":h=yd;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=Jg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=b_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=I_;break;case uw:case dw:case fw:h=C_;break;case pw:h=F_;break;case"scroll":h=x_;break;case"wheel":h=$_;break;case"copy":case"cut":case"paste":h=T_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=tv}var b=(t&4)!==0,S=!b&&e==="scroll",m=b?p!==null?p+"Capture":null:p;b=[];for(var g=c,y;g!==null;){y=g;var C=y.stateNode;if(y.tag===5&&C!==null&&(y=C,m!==null&&(C=Ta(g,m),C!=null&&b.push(Na(g,C,y)))),S)break;g=g.return}0<b.length&&(p=new h(p,x,null,n,d),u.push({event:p,listeners:b}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Mf&&(x=n.relatedTarget||n.fromElement)&&(Oi(x)||x[Rr]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(x=n.relatedTarget||n.toElement,h=c,x=x?Oi(x):null,x!==null&&(S=us(x),x!==S||x.tag!==5&&x.tag!==6)&&(x=null)):(h=null,x=c),h!==x)){if(b=Jg,C="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(b=tv,C="onPointerLeave",m="onPointerEnter",g="pointer"),S=h==null?p:Rs(h),y=x==null?p:Rs(x),p=new b(C,g+"leave",h,n,d),p.target=S,p.relatedTarget=y,C=null,Oi(d)===c&&(b=new b(m,g+"enter",x,n,d),b.target=y,b.relatedTarget=S,C=b),S=C,h&&x)t:{for(b=h,m=x,g=0,y=b;y;y=ks(y))g++;for(y=0,C=m;C;C=ks(C))y++;for(;0<g-y;)b=ks(b),g--;for(;0<y-g;)m=ks(m),y--;for(;g--;){if(b===m||m!==null&&b===m.alternate)break t;b=ks(b),m=ks(m)}b=null}else b=null;h!==null&&fv(u,p,h,b,!1),x!==null&&S!==null&&fv(u,S,x,b,!0)}}e:{if(p=c?Rs(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var k=G_;else if(iv(p))if(sw)k=X_;else{k=Q_;var _=Y_}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(k=K_);if(k&&(k=k(e,c))){iw(u,k,n,d);break e}_&&_(e,p,c),e==="focusout"&&(_=p._wrapperState)&&_.controlled&&p.type==="number"&&Tf(p,"number",p.value)}switch(_=c?Rs(c):window,e){case"focusin":(iv(_)||_.contentEditable==="true")&&(As=_,Ff=c,fa=null);break;case"focusout":fa=Ff=As=null;break;case"mousedown":Bf=!0;break;case"contextmenu":case"mouseup":case"dragend":Bf=!1,cv(u,n,d);break;case"selectionchange":if(eT)break;case"keydown":case"keyup":cv(u,n,d)}var E;if($h)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 Es?nw(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(tw&&n.locale!=="ko"&&(Es||A!=="onCompositionStart"?A==="onCompositionEnd"&&Es&&(E=ew()):(ri=d,Lh="value"in ri?ri.value:ri.textContent,Es=!0)),_=Mc(c,A),0<_.length&&(A=new ev(A,e,null,n,d),u.push({event:A,listeners:_}),E?A.data=E:(E=rw(n),E!==null&&(A.data=E)))),(E=V_?U_(e,n):H_(e,n))&&(c=Mc(c,"onBeforeInput"),0<c.length&&(d=new ev("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=E))}mw(u,t)})}function Na(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Mc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ta(e,n),s!=null&&r.unshift(Na(e,s,i)),s=Ta(e,t),s!=null&&r.push(Na(e,s,i))),e=e.return}return r}function ks(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fv(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=Ta(n,s),l!=null&&o.unshift(Na(n,l,a))):i||(l=Ta(n,s),l!=null&&o.push(Na(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var iT=/\r\n?/g,sT=/\u0000|\uFFFD/g;function pv(e){return(typeof e=="string"?e:""+e).replace(iT,`
|
|
38
|
-
`).replace(sT,"")}function Nl(e,t,n){if(t=pv(t),pv(e)!==t&&n)throw Error(Q(425))}function Pc(){}var $f=null,zf=null;function Vf(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 Uf=typeof setTimeout=="function"?setTimeout:void 0,oT=typeof clearTimeout=="function"?clearTimeout:void 0,hv=typeof Promise=="function"?Promise:void 0,aT=typeof queueMicrotask=="function"?queueMicrotask:typeof hv<"u"?function(e){return hv.resolve(null).then(e).catch(lT)}:Uf;function lT(e){setTimeout(function(){throw e})}function Td(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),ja(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ja(t)}function ci(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 mv(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 jo=Math.random().toString(36).slice(2),sr="__reactFiber$"+jo,Oa="__reactProps$"+jo,Rr="__reactContainer$"+jo,Hf="__reactEvents$"+jo,cT="__reactListeners$"+jo,uT="__reactHandles$"+jo;function Oi(e){var t=e[sr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Rr]||n[sr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mv(e);e!==null;){if(n=e[sr])return n;e=mv(e)}return t}e=n,n=e.parentNode}return null}function cl(e){return e=e[sr]||e[Rr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Rs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function xu(e){return e[Oa]||null}var Wf=[],Ms=-1;function Si(e){return{current:e}}function Ge(e){0>Ms||(e.current=Wf[Ms],Wf[Ms]=null,Ms--)}function Ve(e,t){Ms++,Wf[Ms]=e.current,e.current=t}var vi={},Nt=Si(vi),Zt=Si(!1),ts=vi;function po(e,t){var n=e.type.contextTypes;if(!n)return vi;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 Jt(e){return e=e.childContextTypes,e!=null}function Nc(){Ge(Zt),Ge(Nt)}function gv(e,t,n){if(Nt.current!==vi)throw Error(Q(168));Ve(Nt,t),Ve(Zt,n)}function vw(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,Y2(e)||"Unknown",i));return Je({},n,r)}function Oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vi,ts=Nt.current,Ve(Nt,e),Ve(Zt,Zt.current),!0}function vv(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=vw(e,t,ts),r.__reactInternalMemoizedMergedChildContext=e,Ge(Zt),Ge(Nt),Ve(Nt,e)):Ge(Zt),Ve(Zt,n)}var Sr=null,wu=!1,Ed=!1;function yw(e){Sr===null?Sr=[e]:Sr.push(e)}function dT(e){wu=!0,yw(e)}function ki(){if(!Ed&&Sr!==null){Ed=!0;var e=0,t=Ie;try{var n=Sr;for(Ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Sr=null,wu=!1}catch(i){throw Sr!==null&&(Sr=Sr.slice(e+1)),U1(Nh,ki),i}finally{Ie=t,Ed=!1}}return null}var Ps=[],Ns=0,Dc=null,Ic=0,Cn=[],_n=0,ns=null,_r=1,Tr="";function ji(e,t){Ps[Ns++]=Ic,Ps[Ns++]=Dc,Dc=e,Ic=t}function xw(e,t,n){Cn[_n++]=_r,Cn[_n++]=Tr,Cn[_n++]=ns,ns=e;var r=_r;e=Tr;var i=32-Wn(r)-1;r&=~(1<<i),n+=1;var s=32-Wn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_r=1<<32-Wn(t)+i|n<<i|r,Tr=s+e}else _r=1<<s|n<<i|r,Tr=e}function Vh(e){e.return!==null&&(ji(e,1),xw(e,1,0))}function Uh(e){for(;e===Dc;)Dc=Ps[--Ns],Ps[Ns]=null,Ic=Ps[--Ns],Ps[Ns]=null;for(;e===ns;)ns=Cn[--_n],Cn[_n]=null,Tr=Cn[--_n],Cn[_n]=null,_r=Cn[--_n],Cn[_n]=null}var dn=null,ln=null,Ye=!1,Vn=null;function ww(e,t){var n=En(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 yv(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,dn=e,ln=ci(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dn=e,ln=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ns!==null?{id:_r,overflow:Tr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=En(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dn=e,ln=null,!0):!1;default:return!1}}function qf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gf(e){if(Ye){var t=ln;if(t){var n=t;if(!yv(e,t)){if(qf(e))throw Error(Q(418));t=ci(n.nextSibling);var r=dn;t&&yv(e,t)?ww(r,n):(e.flags=e.flags&-4097|2,Ye=!1,dn=e)}}else{if(qf(e))throw Error(Q(418));e.flags=e.flags&-4097|2,Ye=!1,dn=e}}}function xv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dn=e}function Ol(e){if(e!==dn)return!1;if(!Ye)return xv(e),Ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vf(e.type,e.memoizedProps)),t&&(t=ln)){if(qf(e))throw bw(),Error(Q(418));for(;t;)ww(e,t),t=ci(t.nextSibling)}if(xv(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){ln=ci(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ln=null}}else ln=dn?ci(e.stateNode.nextSibling):null;return!0}function bw(){for(var e=ln;e;)e=ci(e.nextSibling)}function ho(){ln=dn=null,Ye=!1}function Hh(e){Vn===null?Vn=[e]:Vn.push(e)}var fT=Lr.ReactCurrentBatchConfig;function Ho(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 Dl(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function wv(e){var t=e._init;return t(e._payload)}function Sw(e){function t(m,g){if(e){var y=m.deletions;y===null?(m.deletions=[g],m.flags|=16):y.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=pi(m,g),m.index=0,m.sibling=null,m}function s(m,g,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<g?(m.flags|=2,g):y):(m.flags|=2,g)):(m.flags|=1048576,g)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,g,y,C){return g===null||g.tag!==6?(g=Od(y,m.mode,C),g.return=m,g):(g=i(g,y),g.return=m,g)}function l(m,g,y,C){var k=y.type;return k===Ts?d(m,g,y.props.children,C,y.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Vr&&wv(k)===g.type)?(C=i(g,y.props),C.ref=Ho(m,g,y),C.return=m,C):(C=dc(y.type,y.key,y.props,null,m.mode,C),C.ref=Ho(m,g,y),C.return=m,C)}function c(m,g,y,C){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Dd(y,m.mode,C),g.return=m,g):(g=i(g,y.children||[]),g.return=m,g)}function d(m,g,y,C,k){return g===null||g.tag!==7?(g=Yi(y,m.mode,C,k),g.return=m,g):(g=i(g,y),g.return=m,g)}function u(m,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Od(""+g,m.mode,y),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Cl:return y=dc(g.type,g.key,g.props,null,m.mode,y),y.ref=Ho(m,null,g),y.return=m,y;case _s:return g=Dd(g,m.mode,y),g.return=m,g;case Vr:var C=g._init;return u(m,C(g._payload),y)}if(Zo(g)||Bo(g))return g=Yi(g,m.mode,y,null),g.return=m,g;Dl(m,g)}return null}function p(m,g,y,C){var k=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:a(m,g,""+y,C);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Cl:return y.key===k?l(m,g,y,C):null;case _s:return y.key===k?c(m,g,y,C):null;case Vr:return k=y._init,p(m,g,k(y._payload),C)}if(Zo(y)||Bo(y))return k!==null?null:d(m,g,y,C,null);Dl(m,y)}return null}function h(m,g,y,C,k){if(typeof C=="string"&&C!==""||typeof C=="number")return m=m.get(y)||null,a(g,m,""+C,k);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Cl:return m=m.get(C.key===null?y:C.key)||null,l(g,m,C,k);case _s:return m=m.get(C.key===null?y:C.key)||null,c(g,m,C,k);case Vr:var _=C._init;return h(m,g,y,_(C._payload),k)}if(Zo(C)||Bo(C))return m=m.get(y)||null,d(g,m,C,k,null);Dl(g,C)}return null}function x(m,g,y,C){for(var k=null,_=null,E=g,A=g=0,V=null;E!==null&&A<y.length;A++){E.index>A?(V=E,E=null):V=E.sibling;var D=p(m,E,y[A],C);if(D===null){E===null&&(E=V);break}e&&E&&D.alternate===null&&t(m,E),g=s(D,g,A),_===null?k=D:_.sibling=D,_=D,E=V}if(A===y.length)return n(m,E),Ye&&ji(m,A),k;if(E===null){for(;A<y.length;A++)E=u(m,y[A],C),E!==null&&(g=s(E,g,A),_===null?k=E:_.sibling=E,_=E);return Ye&&ji(m,A),k}for(E=r(m,E);A<y.length;A++)V=h(E,m,A,y[A],C),V!==null&&(e&&V.alternate!==null&&E.delete(V.key===null?A:V.key),g=s(V,g,A),_===null?k=V:_.sibling=V,_=V);return e&&E.forEach(function(I){return t(m,I)}),Ye&&ji(m,A),k}function b(m,g,y,C){var k=Bo(y);if(typeof k!="function")throw Error(Q(150));if(y=k.call(y),y==null)throw Error(Q(151));for(var _=k=null,E=g,A=g=0,V=null,D=y.next();E!==null&&!D.done;A++,D=y.next()){E.index>A?(V=E,E=null):V=E.sibling;var I=p(m,E,D.value,C);if(I===null){E===null&&(E=V);break}e&&E&&I.alternate===null&&t(m,E),g=s(I,g,A),_===null?k=I:_.sibling=I,_=I,E=V}if(D.done)return n(m,E),Ye&&ji(m,A),k;if(E===null){for(;!D.done;A++,D=y.next())D=u(m,D.value,C),D!==null&&(g=s(D,g,A),_===null?k=D:_.sibling=D,_=D);return Ye&&ji(m,A),k}for(E=r(m,E);!D.done;A++,D=y.next())D=h(E,m,A,D.value,C),D!==null&&(e&&D.alternate!==null&&E.delete(D.key===null?A:D.key),g=s(D,g,A),_===null?k=D:_.sibling=D,_=D);return e&&E.forEach(function(O){return t(m,O)}),Ye&&ji(m,A),k}function S(m,g,y,C){if(typeof y=="object"&&y!==null&&y.type===Ts&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Cl:e:{for(var k=y.key,_=g;_!==null;){if(_.key===k){if(k=y.type,k===Ts){if(_.tag===7){n(m,_.sibling),g=i(_,y.props.children),g.return=m,m=g;break e}}else if(_.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Vr&&wv(k)===_.type){n(m,_.sibling),g=i(_,y.props),g.ref=Ho(m,_,y),g.return=m,m=g;break e}n(m,_);break}else t(m,_);_=_.sibling}y.type===Ts?(g=Yi(y.props.children,m.mode,C,y.key),g.return=m,m=g):(C=dc(y.type,y.key,y.props,null,m.mode,C),C.ref=Ho(m,g,y),C.return=m,m=C)}return o(m);case _s:e:{for(_=y.key;g!==null;){if(g.key===_)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(m,g.sibling),g=i(g,y.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else t(m,g);g=g.sibling}g=Dd(y,m.mode,C),g.return=m,m=g}return o(m);case Vr:return _=y._init,S(m,g,_(y._payload),C)}if(Zo(y))return x(m,g,y,C);if(Bo(y))return b(m,g,y,C);Dl(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(m,g.sibling),g=i(g,y),g.return=m,m=g):(n(m,g),g=Od(y,m.mode,C),g.return=m,m=g),o(m)):n(m,g)}return S}var mo=Sw(!0),kw=Sw(!1),Lc=Si(null),Fc=null,Os=null,Wh=null;function qh(){Wh=Os=Fc=null}function Gh(e){var t=Lc.current;Ge(Lc),e._currentValue=t}function Yf(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 Ys(e,t){Fc=e,Wh=Os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xt=!0),e.firstContext=null)}function Mn(e){var t=e._currentValue;if(Wh!==e)if(e={context:e,memoizedValue:t,next:null},Os===null){if(Fc===null)throw Error(Q(308));Os=e,Fc.dependencies={lanes:0,firstContext:e}}else Os=Os.next=e;return t}var Di=null;function Yh(e){Di===null?Di=[e]:Di.push(e)}function Cw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Yh(t)):(n.next=i.next,i.next=n),t.interleaved=n,Mr(e,r)}function Mr(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 Ur=!1;function Qh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _w(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 Er(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ui(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Mr(e,n)}return i=r.interleaved,i===null?(t.next=t,Yh(r)):(t.next=i.next,i.next=t),r.interleaved=t,Mr(e,n)}function sc(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,Oh(e,n)}}function bv(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 Bc(e,t,n,r){var i=e.updateQueue;Ur=!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 x=e,b=a;switch(p=t,h=n,b.tag){case 1:if(x=b.payload,typeof x=="function"){u=x.call(h,u,p);break e}u=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=b.payload,p=typeof x=="function"?x.call(h,u,p):x,p==null)break e;u=Je({},u,p);break e;case 2:Ur=!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);is|=o,e.lanes=o,e.memoizedState=u}}function Sv(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 ul={},ar=Si(ul),Da=Si(ul),Ia=Si(ul);function Ii(e){if(e===ul)throw Error(Q(174));return e}function Kh(e,t){switch(Ve(Ia,t),Ve(Da,e),Ve(ar,ul),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Af(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Af(t,e)}Ge(ar),Ve(ar,t)}function go(){Ge(ar),Ge(Da),Ge(Ia)}function Tw(e){Ii(Ia.current);var t=Ii(ar.current),n=Af(t,e.type);t!==n&&(Ve(Da,e),Ve(ar,n))}function Xh(e){Da.current===e&&(Ge(ar),Ge(Da))}var Ke=Si(0);function $c(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 Ad=[];function Zh(){for(var e=0;e<Ad.length;e++)Ad[e]._workInProgressVersionPrimary=null;Ad.length=0}var oc=Lr.ReactCurrentDispatcher,jd=Lr.ReactCurrentBatchConfig,rs=0,Ze=null,ft=null,vt=null,zc=!1,pa=!1,La=0,pT=0;function Et(){throw Error(Q(321))}function Jh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yn(e[n],t[n]))return!1;return!0}function em(e,t,n,r,i,s){if(rs=s,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oc.current=e===null||e.memoizedState===null?vT:yT,e=n(r,i),pa){s=0;do{if(pa=!1,La=0,25<=s)throw Error(Q(301));s+=1,vt=ft=null,t.updateQueue=null,oc.current=xT,e=n(r,i)}while(pa)}if(oc.current=Vc,t=ft!==null&&ft.next!==null,rs=0,vt=ft=Ze=null,zc=!1,t)throw Error(Q(300));return e}function tm(){var e=La!==0;return La=0,e}function Jn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Ze.memoizedState=vt=e:vt=vt.next=e,vt}function Pn(){if(ft===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=vt===null?Ze.memoizedState:vt.next;if(t!==null)vt=t,ft=e;else{if(e===null)throw Error(Q(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},vt===null?Ze.memoizedState=vt=e:vt=vt.next=e}return vt}function Fa(e,t){return typeof t=="function"?t(e):t}function Rd(e){var t=Pn(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=ft,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((rs&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,Ze.lanes|=d,is|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Yn(r,t.memoizedState)||(Xt=!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,Ze.lanes|=s,is|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Md(e){var t=Pn(),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);Yn(s,t.memoizedState)||(Xt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Ew(){}function Aw(e,t){var n=Ze,r=Pn(),i=t(),s=!Yn(r.memoizedState,i);if(s&&(r.memoizedState=i,Xt=!0),r=r.queue,nm(Mw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||vt!==null&&vt.memoizedState.tag&1){if(n.flags|=2048,Ba(9,Rw.bind(null,n,r,i,t),void 0,null),yt===null)throw Error(Q(349));rs&30||jw(n,t,i)}return i}function jw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rw(e,t,n,r){t.value=n,t.getSnapshot=r,Pw(t)&&Nw(e)}function Mw(e,t,n){return n(function(){Pw(t)&&Nw(e)})}function Pw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yn(e,n)}catch{return!0}}function Nw(e){var t=Mr(e,1);t!==null&&qn(t,e,1,-1)}function kv(e){var t=Jn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:e},t.queue=e,e=e.dispatch=gT.bind(null,Ze,e),[t.memoizedState,e]}function Ba(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.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 Ow(){return Pn().memoizedState}function ac(e,t,n,r){var i=Jn();Ze.flags|=e,i.memoizedState=Ba(1|t,n,void 0,r===void 0?null:r)}function bu(e,t,n,r){var i=Pn();r=r===void 0?null:r;var s=void 0;if(ft!==null){var o=ft.memoizedState;if(s=o.destroy,r!==null&&Jh(r,o.deps)){i.memoizedState=Ba(t,n,s,r);return}}Ze.flags|=e,i.memoizedState=Ba(1|t,n,s,r)}function Cv(e,t){return ac(8390656,8,e,t)}function nm(e,t){return bu(2048,8,e,t)}function Dw(e,t){return bu(4,2,e,t)}function Iw(e,t){return bu(4,4,e,t)}function Lw(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 Fw(e,t,n){return n=n!=null?n.concat([e]):null,bu(4,4,Lw.bind(null,t,e),n)}function rm(){}function Bw(e,t){var n=Pn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function $w(e,t){var n=Pn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function zw(e,t,n){return rs&21?(Yn(n,t)||(n=q1(),Ze.lanes|=n,is|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xt=!0),e.memoizedState=n)}function hT(e,t){var n=Ie;Ie=n!==0&&4>n?n:4,e(!0);var r=jd.transition;jd.transition={};try{e(!1),t()}finally{Ie=n,jd.transition=r}}function Vw(){return Pn().memoizedState}function mT(e,t,n){var r=fi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Uw(e))Hw(t,n);else if(n=Cw(e,t,n,r),n!==null){var i=zt();qn(n,e,r,i),Ww(n,t,r)}}function gT(e,t,n){var r=fi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Uw(e))Hw(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,Yn(a,o)){var l=t.interleaved;l===null?(i.next=i,Yh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Cw(e,t,i,r),n!==null&&(i=zt(),qn(n,e,r,i),Ww(n,t,r))}}function Uw(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function Hw(e,t){pa=zc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ww(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Oh(e,n)}}var Vc={readContext:Mn,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useInsertionEffect:Et,useLayoutEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useMutableSource:Et,useSyncExternalStore:Et,useId:Et,unstable_isNewReconciler:!1},vT={readContext:Mn,useCallback:function(e,t){return Jn().memoizedState=[e,t===void 0?null:t],e},useContext:Mn,useEffect:Cv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ac(4194308,4,Lw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ac(4194308,4,e,t)},useInsertionEffect:function(e,t){return ac(4,2,e,t)},useMemo:function(e,t){var n=Jn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jn();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=mT.bind(null,Ze,e),[r.memoizedState,e]},useRef:function(e){var t=Jn();return e={current:e},t.memoizedState=e},useState:kv,useDebugValue:rm,useDeferredValue:function(e){return Jn().memoizedState=e},useTransition:function(){var e=kv(!1),t=e[0];return e=hT.bind(null,e[1]),Jn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ze,i=Jn();if(Ye){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),yt===null)throw Error(Q(349));rs&30||jw(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Cv(Mw.bind(null,r,s,e),[e]),r.flags|=2048,Ba(9,Rw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Jn(),t=yt.identifierPrefix;if(Ye){var n=Tr,r=_r;n=(r&~(1<<32-Wn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=La++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=pT++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},yT={readContext:Mn,useCallback:Bw,useContext:Mn,useEffect:nm,useImperativeHandle:Fw,useInsertionEffect:Dw,useLayoutEffect:Iw,useMemo:$w,useReducer:Rd,useRef:Ow,useState:function(){return Rd(Fa)},useDebugValue:rm,useDeferredValue:function(e){var t=Pn();return zw(t,ft.memoizedState,e)},useTransition:function(){var e=Rd(Fa)[0],t=Pn().memoizedState;return[e,t]},useMutableSource:Ew,useSyncExternalStore:Aw,useId:Vw,unstable_isNewReconciler:!1},xT={readContext:Mn,useCallback:Bw,useContext:Mn,useEffect:nm,useImperativeHandle:Fw,useInsertionEffect:Dw,useLayoutEffect:Iw,useMemo:$w,useReducer:Md,useRef:Ow,useState:function(){return Md(Fa)},useDebugValue:rm,useDeferredValue:function(e){var t=Pn();return ft===null?t.memoizedState=e:zw(t,ft.memoizedState,e)},useTransition:function(){var e=Md(Fa)[0],t=Pn().memoizedState;return[e,t]},useMutableSource:Ew,useSyncExternalStore:Aw,useId:Vw,unstable_isNewReconciler:!1};function Fn(e,t){if(e&&e.defaultProps){t=Je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Qf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Su={isMounted:function(e){return(e=e._reactInternals)?us(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=zt(),i=fi(e),s=Er(r,i);s.payload=t,n!=null&&(s.callback=n),t=ui(e,s,i),t!==null&&(qn(t,e,i,r),sc(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=zt(),i=fi(e),s=Er(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ui(e,s,i),t!==null&&(qn(t,e,i,r),sc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zt(),r=fi(e),i=Er(n,r);i.tag=2,t!=null&&(i.callback=t),t=ui(e,i,r),t!==null&&(qn(t,e,r,n),sc(t,e,r))}};function _v(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?!Ma(n,r)||!Ma(i,s):!0}function qw(e,t,n){var r=!1,i=vi,s=t.contextType;return typeof s=="object"&&s!==null?s=Mn(s):(i=Jt(t)?ts:Nt.current,r=t.contextTypes,s=(r=r!=null)?po(e,i):vi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Su,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Tv(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&&Su.enqueueReplaceState(t,t.state,null)}function Kf(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Qh(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Mn(s):(s=Jt(t)?ts:Nt.current,i.context=po(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Qf(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&&Su.enqueueReplaceState(i,i.state,null),Bc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function vo(e,t){try{var n="",r=t;do n+=G2(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{fd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xo(e):""}function Y2(e){switch(e.tag){case 5:return Xo(e.type);case 16:return Xo("Lazy");case 13:return Xo("Suspense");case 19:return Xo("SuspenseList");case 0:case 2:case 15:return e=pd(e.type,!1),e;case 11:return e=pd(e.type.render,!1),e;case 1:return e=pd(e.type,!0),e;default:return""}}function kf(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 Ts:return"Fragment";case _s:return"Portal";case wf:return"Profiler";case jh:return"StrictMode";case bf:return"Suspense";case Sf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _1:return(e.displayName||"Context")+".Consumer";case C1:return(e._context.displayName||"Context")+".Provider";case Rh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Mh:return t=e.displayName||null,t!==null?t:kf(e.type)||"Memo";case Vr:t=e._payload,e=e._init;try{return kf(e(t))}catch{}}return null}function Q2(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 kf(t);case 8:return t===jh?"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 gi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function E1(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function K2(e){var t=E1(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 _l(e){e._valueTracker||(e._valueTracker=K2(e))}function A1(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=E1(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Cc(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 Cf(e,t){var n=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ug(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gi(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 j1(e,t){t=t.checked,t!=null&&Ah(e,"checked",t,!1)}function _f(e,t){j1(e,t);var n=gi(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")?Tf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tf(e,t.type,gi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hg(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 Tf(e,t,n){(t!=="number"||Cc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Zo=Array.isArray;function Hs(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=""+gi(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 Ef(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Q(91));return Je({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wg(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(Zo(n)){if(1<n.length)throw Error(Q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:gi(n)}}function R1(e,t){var n=gi(t.value),r=gi(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 qg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function M1(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 Af(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?M1(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Tl,P1=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(Tl=Tl||document.createElement("div"),Tl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Tl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function _a(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var la={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},X2=["Webkit","ms","Moz","O"];Object.keys(la).forEach(function(e){X2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),la[t]=la[e]})});function N1(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||la.hasOwnProperty(e)&&la[e]?(""+t).trim():t+"px"}function O1(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=N1(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Z2=Je({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 jf(e,t){if(t){if(Z2[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 Rf(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 Mf=null;function Ph(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pf=null,Ws=null,qs=null;function Gg(e){if(e=cl(e)){if(typeof Pf!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=xu(t),Pf(e.stateNode,e.type,t))}}function D1(e){Ws?qs?qs.push(e):qs=[e]:Ws=e}function I1(){if(Ws){var e=Ws,t=qs;if(qs=Ws=null,Gg(e),t)for(e=0;e<t.length;e++)Gg(t[e])}}function L1(e,t){return e(t)}function F1(){}var hd=!1;function B1(e,t,n){if(hd)return e(t,n);hd=!0;try{return L1(e,t,n)}finally{hd=!1,(Ws!==null||qs!==null)&&(F1(),I1())}}function Ta(e,t){var n=e.stateNode;if(n===null)return null;var r=xu(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 Nf=!1;if(jr)try{var $o={};Object.defineProperty($o,"passive",{get:function(){Nf=!0}}),window.addEventListener("test",$o,$o),window.removeEventListener("test",$o,$o)}catch{Nf=!1}function J2(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 ca=!1,_c=null,Tc=!1,Of=null,e_={onError:function(e){ca=!0,_c=e}};function t_(e,t,n,r,i,s,o,a,l){ca=!1,_c=null,J2.apply(e_,arguments)}function n_(e,t,n,r,i,s,o,a,l){if(t_.apply(this,arguments),ca){if(ca){var c=_c;ca=!1,_c=null}else throw Error(Q(198));Tc||(Tc=!0,Of=c)}}function us(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 $1(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 Yg(e){if(us(e)!==e)throw Error(Q(188))}function r_(e){var t=e.alternate;if(!t){if(t=us(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 Yg(i),e;if(s===r)return Yg(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 z1(e){return e=r_(e),e!==null?V1(e):null}function V1(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=V1(e);if(t!==null)return t;e=e.sibling}return null}var U1=fn.unstable_scheduleCallback,Qg=fn.unstable_cancelCallback,i_=fn.unstable_shouldYield,s_=fn.unstable_requestPaint,at=fn.unstable_now,o_=fn.unstable_getCurrentPriorityLevel,Nh=fn.unstable_ImmediatePriority,H1=fn.unstable_UserBlockingPriority,Ec=fn.unstable_NormalPriority,a_=fn.unstable_LowPriority,W1=fn.unstable_IdlePriority,mu=null,or=null;function l_(e){if(or&&typeof or.onCommitFiberRoot=="function")try{or.onCommitFiberRoot(mu,e,void 0,(e.current.flags&128)===128)}catch{}}var Wn=Math.clz32?Math.clz32:d_,c_=Math.log,u_=Math.LN2;function d_(e){return e>>>=0,e===0?32:31-(c_(e)/u_|0)|0}var El=64,Al=4194304;function Jo(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 Ac(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=Jo(a):(s&=o,s!==0&&(r=Jo(s)))}else o=n&~i,o!==0?r=Jo(o):s!==0&&(r=Jo(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-Wn(t),i=1<<n,r|=e[n],t&=~i;return r}function f_(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 p_(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Wn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=f_(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Df(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function q1(){var e=El;return El<<=1,!(El&4194240)&&(El=64),e}function md(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function al(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Wn(t),e[t]=n}function h_(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-Wn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Oh(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Wn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Ie=0;function G1(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Y1,Dh,Q1,K1,X1,If=!1,jl=[],oi=null,ai=null,li=null,Ea=new Map,Aa=new Map,Wr=[],m_="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 Kg(e,t){switch(e){case"focusin":case"focusout":oi=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":li=null;break;case"pointerover":case"pointerout":Ea.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Aa.delete(t.pointerId)}}function zo(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=cl(t),t!==null&&Dh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function g_(e,t,n,r,i){switch(t){case"focusin":return oi=zo(oi,e,t,n,r,i),!0;case"dragenter":return ai=zo(ai,e,t,n,r,i),!0;case"mouseover":return li=zo(li,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ea.set(s,zo(Ea.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,Aa.set(s,zo(Aa.get(s)||null,e,t,n,r,i)),!0}return!1}function Z1(e){var t=Oi(e.target);if(t!==null){var n=us(t);if(n!==null){if(t=n.tag,t===13){if(t=$1(n),t!==null){e.blockedOn=t,X1(e.priority,function(){Q1(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 nc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Mf=r,n.target.dispatchEvent(r),Mf=null}else return t=cl(n),t!==null&&Dh(t),e.blockedOn=n,!1;t.shift()}return!0}function Xg(e,t,n){nc(e)&&n.delete(t)}function v_(){If=!1,oi!==null&&nc(oi)&&(oi=null),ai!==null&&nc(ai)&&(ai=null),li!==null&&nc(li)&&(li=null),Ea.forEach(Xg),Aa.forEach(Xg)}function Vo(e,t){e.blockedOn===t&&(e.blockedOn=null,If||(If=!0,fn.unstable_scheduleCallback(fn.unstable_NormalPriority,v_)))}function ja(e){function t(i){return Vo(i,e)}if(0<jl.length){Vo(jl[0],e);for(var n=1;n<jl.length;n++){var r=jl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(oi!==null&&Vo(oi,e),ai!==null&&Vo(ai,e),li!==null&&Vo(li,e),Ea.forEach(t),Aa.forEach(t),n=0;n<Wr.length;n++)r=Wr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Wr.length&&(n=Wr[0],n.blockedOn===null);)Z1(n),n.blockedOn===null&&Wr.shift()}var Gs=Lr.ReactCurrentBatchConfig,jc=!0;function y_(e,t,n,r){var i=Ie,s=Gs.transition;Gs.transition=null;try{Ie=1,Ih(e,t,n,r)}finally{Ie=i,Gs.transition=s}}function x_(e,t,n,r){var i=Ie,s=Gs.transition;Gs.transition=null;try{Ie=4,Ih(e,t,n,r)}finally{Ie=i,Gs.transition=s}}function Ih(e,t,n,r){if(jc){var i=Lf(e,t,n,r);if(i===null)_d(e,t,r,Rc,n),Kg(e,r);else if(g_(i,e,t,n,r))r.stopPropagation();else if(Kg(e,r),t&4&&-1<m_.indexOf(e)){for(;i!==null;){var s=cl(i);if(s!==null&&Y1(s),s=Lf(e,t,n,r),s===null&&_d(e,t,r,Rc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else _d(e,t,r,null,n)}}var Rc=null;function Lf(e,t,n,r){if(Rc=null,e=Ph(r),e=Oi(e),e!==null)if(t=us(e),t===null)e=null;else if(n=t.tag,n===13){if(e=$1(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 Rc=e,null}function J1(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(o_()){case Nh:return 1;case H1:return 4;case Ec:case a_:return 16;case W1:return 536870912;default:return 16}default:return 16}}var ri=null,Lh=null,rc=null;function ew(){if(rc)return rc;var e,t=Lh,n=t.length,r,i="value"in ri?ri.value:ri.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 rc=i.slice(e,1<r?1-r:void 0)}function ic(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 Rl(){return!0}function Zg(){return!1}function hn(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)?Rl:Zg,this.isPropagationStopped=Zg,this}return Je(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=Rl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),t}var Ao={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fh=hn(Ao),ll=Je({},Ao,{view:0,detail:0}),w_=hn(ll),gd,vd,Uo,gu=Je({},ll,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bh,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!==Uo&&(Uo&&e.type==="mousemove"?(gd=e.screenX-Uo.screenX,vd=e.screenY-Uo.screenY):vd=gd=0,Uo=e),gd)},movementY:function(e){return"movementY"in e?e.movementY:vd}}),Jg=hn(gu),b_=Je({},gu,{dataTransfer:0}),S_=hn(b_),k_=Je({},ll,{relatedTarget:0}),yd=hn(k_),C_=Je({},Ao,{animationName:0,elapsedTime:0,pseudoElement:0}),__=hn(C_),T_=Je({},Ao,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),E_=hn(T_),A_=Je({},Ao,{data:0}),ev=hn(A_),j_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},R_={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"},M_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function P_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=M_[e])?!!t[e]:!1}function Bh(){return P_}var N_=Je({},ll,{key:function(e){if(e.key){var t=j_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ic(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?R_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bh,charCode:function(e){return e.type==="keypress"?ic(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ic(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),O_=hn(N_),D_=Je({},gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tv=hn(D_),I_=Je({},ll,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bh}),L_=hn(I_),F_=Je({},Ao,{propertyName:0,elapsedTime:0,pseudoElement:0}),B_=hn(F_),$_=Je({},gu,{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}),z_=hn($_),V_=[9,13,27,32],$h=jr&&"CompositionEvent"in window,ua=null;jr&&"documentMode"in document&&(ua=document.documentMode);var U_=jr&&"TextEvent"in window&&!ua,tw=jr&&(!$h||ua&&8<ua&&11>=ua),nv=" ",rv=!1;function nw(e,t){switch(e){case"keyup":return V_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function H_(e,t){switch(e){case"compositionend":return rw(t);case"keypress":return t.which!==32?null:(rv=!0,nv);case"textInput":return e=t.data,e===nv&&rv?null:e;default:return null}}function W_(e,t){if(Es)return e==="compositionend"||!$h&&nw(e,t)?(e=ew(),rc=Lh=ri=null,Es=!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 tw&&t.locale!=="ko"?null:t.data;default:return null}}var q_={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 iv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!q_[e.type]:t==="textarea"}function iw(e,t,n,r){D1(r),t=Mc(t,"onChange"),0<t.length&&(n=new Fh("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var da=null,Ra=null;function G_(e){mw(e,0)}function vu(e){var t=Rs(e);if(A1(t))return e}function Y_(e,t){if(e==="change")return t}var sw=!1;if(jr){var xd;if(jr){var wd="oninput"in document;if(!wd){var sv=document.createElement("div");sv.setAttribute("oninput","return;"),wd=typeof sv.oninput=="function"}xd=wd}else xd=!1;sw=xd&&(!document.documentMode||9<document.documentMode)}function ov(){da&&(da.detachEvent("onpropertychange",ow),Ra=da=null)}function ow(e){if(e.propertyName==="value"&&vu(Ra)){var t=[];iw(t,Ra,e,Ph(e)),B1(G_,t)}}function Q_(e,t,n){e==="focusin"?(ov(),da=t,Ra=n,da.attachEvent("onpropertychange",ow)):e==="focusout"&&ov()}function K_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vu(Ra)}function X_(e,t){if(e==="click")return vu(t)}function Z_(e,t){if(e==="input"||e==="change")return vu(t)}function J_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yn=typeof Object.is=="function"?Object.is:J_;function Ma(e,t){if(Yn(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(!xf.call(t,i)||!Yn(e[i],t[i]))return!1}return!0}function av(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lv(e,t){var n=av(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=av(n)}}function aw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?aw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lw(){for(var e=window,t=Cc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Cc(e.document)}return t}function zh(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 eT(e){var t=lw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&aw(n.ownerDocument.documentElement,n)){if(r!==null&&zh(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=lv(n,s);var o=lv(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 tT=jr&&"documentMode"in document&&11>=document.documentMode,As=null,Ff=null,fa=null,Bf=!1;function cv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Bf||As==null||As!==Cc(r)||(r=As,"selectionStart"in r&&zh(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}),fa&&Ma(fa,r)||(fa=r,r=Mc(Ff,"onSelect"),0<r.length&&(t=new Fh("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=As)))}function Ml(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var js={animationend:Ml("Animation","AnimationEnd"),animationiteration:Ml("Animation","AnimationIteration"),animationstart:Ml("Animation","AnimationStart"),transitionend:Ml("Transition","TransitionEnd")},bd={},cw={};jr&&(cw=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function yu(e){if(bd[e])return bd[e];if(!js[e])return e;var t=js[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cw)return bd[e]=t[n];return e}var uw=yu("animationend"),dw=yu("animationiteration"),fw=yu("animationstart"),pw=yu("transitionend"),hw=new Map,uv="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 bi(e,t){hw.set(e,t),cs(t,[e])}for(var Sd=0;Sd<uv.length;Sd++){var kd=uv[Sd],nT=kd.toLowerCase(),rT=kd[0].toUpperCase()+kd.slice(1);bi(nT,"on"+rT)}bi(uw,"onAnimationEnd");bi(dw,"onAnimationIteration");bi(fw,"onAnimationStart");bi("dblclick","onDoubleClick");bi("focusin","onFocus");bi("focusout","onBlur");bi(pw,"onTransitionEnd");fo("onMouseEnter",["mouseout","mouseover"]);fo("onMouseLeave",["mouseout","mouseover"]);fo("onPointerEnter",["pointerout","pointerover"]);fo("onPointerLeave",["pointerout","pointerover"]);cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cs("onBeforeInput",["compositionend","keypress","textInput","paste"]);cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ea="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(" "),iT=new Set("cancel close invalid load scroll toggle".split(" ").concat(ea));function dv(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,n_(r,t,void 0,e),e.currentTarget=null}function mw(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;dv(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;dv(i,a,c),s=l}}}if(Tc)throw e=Of,Tc=!1,Of=null,e}function He(e,t){var n=t[Hf];n===void 0&&(n=t[Hf]=new Set);var r=e+"__bubble";n.has(r)||(gw(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),gw(n,e,r,t)}var Pl="_reactListening"+Math.random().toString(36).slice(2);function Pa(e){if(!e[Pl]){e[Pl]=!0,k1.forEach(function(n){n!=="selectionchange"&&(iT.has(n)||Cd(n,!1,e),Cd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pl]||(t[Pl]=!0,Cd("selectionchange",!1,t))}}function gw(e,t,n,r){switch(J1(t)){case 1:var i=y_;break;case 4:i=x_;break;default:i=Ih}n=i.bind(null,t,n,e),i=void 0,!Nf||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 _d(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=Oi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}B1(function(){var c=s,d=Ph(n),u=[];e:{var p=hw.get(e);if(p!==void 0){var h=Fh,x=e;switch(e){case"keypress":if(ic(n)===0)break e;case"keydown":case"keyup":h=O_;break;case"focusin":x="focus",h=yd;break;case"focusout":x="blur",h=yd;break;case"beforeblur":case"afterblur":h=yd;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=Jg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=S_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=L_;break;case uw:case dw:case fw:h=__;break;case pw:h=B_;break;case"scroll":h=w_;break;case"wheel":h=z_;break;case"copy":case"cut":case"paste":h=E_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=tv}var b=(t&4)!==0,S=!b&&e==="scroll",m=b?p!==null?p+"Capture":null:p;b=[];for(var g=c,y;g!==null;){y=g;var k=y.stateNode;if(y.tag===5&&k!==null&&(y=k,m!==null&&(k=Ta(g,m),k!=null&&b.push(Na(g,k,y)))),S)break;g=g.return}0<b.length&&(p=new h(p,x,null,n,d),u.push({event:p,listeners:b}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Mf&&(x=n.relatedTarget||n.fromElement)&&(Oi(x)||x[Rr]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(x=n.relatedTarget||n.toElement,h=c,x=x?Oi(x):null,x!==null&&(S=us(x),x!==S||x.tag!==5&&x.tag!==6)&&(x=null)):(h=null,x=c),h!==x)){if(b=Jg,k="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(b=tv,k="onPointerLeave",m="onPointerEnter",g="pointer"),S=h==null?p:Rs(h),y=x==null?p:Rs(x),p=new b(k,g+"leave",h,n,d),p.target=S,p.relatedTarget=y,k=null,Oi(d)===c&&(b=new b(m,g+"enter",x,n,d),b.target=y,b.relatedTarget=S,k=b),S=k,h&&x)t:{for(b=h,m=x,g=0,y=b;y;y=ks(y))g++;for(y=0,k=m;k;k=ks(k))y++;for(;0<g-y;)b=ks(b),g--;for(;0<y-g;)m=ks(m),y--;for(;g--;){if(b===m||m!==null&&b===m.alternate)break t;b=ks(b),m=ks(m)}b=null}else b=null;h!==null&&fv(u,p,h,b,!1),x!==null&&S!==null&&fv(u,S,x,b,!0)}}e:{if(p=c?Rs(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var C=Y_;else if(iv(p))if(sw)C=Z_;else{C=K_;var _=Q_}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(C=X_);if(C&&(C=C(e,c))){iw(u,C,n,d);break e}_&&_(e,p,c),e==="focusout"&&(_=p._wrapperState)&&_.controlled&&p.type==="number"&&Tf(p,"number",p.value)}switch(_=c?Rs(c):window,e){case"focusin":(iv(_)||_.contentEditable==="true")&&(As=_,Ff=c,fa=null);break;case"focusout":fa=Ff=As=null;break;case"mousedown":Bf=!0;break;case"contextmenu":case"mouseup":case"dragend":Bf=!1,cv(u,n,d);break;case"selectionchange":if(tT)break;case"keydown":case"keyup":cv(u,n,d)}var E;if($h)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 Es?nw(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(tw&&n.locale!=="ko"&&(Es||A!=="onCompositionStart"?A==="onCompositionEnd"&&Es&&(E=ew()):(ri=d,Lh="value"in ri?ri.value:ri.textContent,Es=!0)),_=Mc(c,A),0<_.length&&(A=new ev(A,e,null,n,d),u.push({event:A,listeners:_}),E?A.data=E:(E=rw(n),E!==null&&(A.data=E)))),(E=U_?H_(e,n):W_(e,n))&&(c=Mc(c,"onBeforeInput"),0<c.length&&(d=new ev("onBeforeInput","beforeinput",null,n,d),u.push({event:d,listeners:c}),d.data=E))}mw(u,t)})}function Na(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Mc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Ta(e,n),s!=null&&r.unshift(Na(e,s,i)),s=Ta(e,t),s!=null&&r.push(Na(e,s,i))),e=e.return}return r}function ks(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fv(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=Ta(n,s),l!=null&&o.unshift(Na(n,l,a))):i||(l=Ta(n,s),l!=null&&o.push(Na(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sT=/\r\n?/g,oT=/\u0000|\uFFFD/g;function pv(e){return(typeof e=="string"?e:""+e).replace(sT,`
|
|
38
|
+
`).replace(oT,"")}function Nl(e,t,n){if(t=pv(t),pv(e)!==t&&n)throw Error(Q(425))}function Pc(){}var $f=null,zf=null;function Vf(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 Uf=typeof setTimeout=="function"?setTimeout:void 0,aT=typeof clearTimeout=="function"?clearTimeout:void 0,hv=typeof Promise=="function"?Promise:void 0,lT=typeof queueMicrotask=="function"?queueMicrotask:typeof hv<"u"?function(e){return hv.resolve(null).then(e).catch(cT)}:Uf;function cT(e){setTimeout(function(){throw e})}function Td(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),ja(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ja(t)}function ci(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 mv(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 jo=Math.random().toString(36).slice(2),sr="__reactFiber$"+jo,Oa="__reactProps$"+jo,Rr="__reactContainer$"+jo,Hf="__reactEvents$"+jo,uT="__reactListeners$"+jo,dT="__reactHandles$"+jo;function Oi(e){var t=e[sr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Rr]||n[sr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mv(e);e!==null;){if(n=e[sr])return n;e=mv(e)}return t}e=n,n=e.parentNode}return null}function cl(e){return e=e[sr]||e[Rr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Rs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Q(33))}function xu(e){return e[Oa]||null}var Wf=[],Ms=-1;function Si(e){return{current:e}}function Ge(e){0>Ms||(e.current=Wf[Ms],Wf[Ms]=null,Ms--)}function Ve(e,t){Ms++,Wf[Ms]=e.current,e.current=t}var vi={},Nt=Si(vi),Zt=Si(!1),ts=vi;function po(e,t){var n=e.type.contextTypes;if(!n)return vi;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 Jt(e){return e=e.childContextTypes,e!=null}function Nc(){Ge(Zt),Ge(Nt)}function gv(e,t,n){if(Nt.current!==vi)throw Error(Q(168));Ve(Nt,t),Ve(Zt,n)}function vw(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,Q2(e)||"Unknown",i));return Je({},n,r)}function Oc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vi,ts=Nt.current,Ve(Nt,e),Ve(Zt,Zt.current),!0}function vv(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=vw(e,t,ts),r.__reactInternalMemoizedMergedChildContext=e,Ge(Zt),Ge(Nt),Ve(Nt,e)):Ge(Zt),Ve(Zt,n)}var Sr=null,wu=!1,Ed=!1;function yw(e){Sr===null?Sr=[e]:Sr.push(e)}function fT(e){wu=!0,yw(e)}function ki(){if(!Ed&&Sr!==null){Ed=!0;var e=0,t=Ie;try{var n=Sr;for(Ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Sr=null,wu=!1}catch(i){throw Sr!==null&&(Sr=Sr.slice(e+1)),U1(Nh,ki),i}finally{Ie=t,Ed=!1}}return null}var Ps=[],Ns=0,Dc=null,Ic=0,Cn=[],_n=0,ns=null,_r=1,Tr="";function ji(e,t){Ps[Ns++]=Ic,Ps[Ns++]=Dc,Dc=e,Ic=t}function xw(e,t,n){Cn[_n++]=_r,Cn[_n++]=Tr,Cn[_n++]=ns,ns=e;var r=_r;e=Tr;var i=32-Wn(r)-1;r&=~(1<<i),n+=1;var s=32-Wn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_r=1<<32-Wn(t)+i|n<<i|r,Tr=s+e}else _r=1<<s|n<<i|r,Tr=e}function Vh(e){e.return!==null&&(ji(e,1),xw(e,1,0))}function Uh(e){for(;e===Dc;)Dc=Ps[--Ns],Ps[Ns]=null,Ic=Ps[--Ns],Ps[Ns]=null;for(;e===ns;)ns=Cn[--_n],Cn[_n]=null,Tr=Cn[--_n],Cn[_n]=null,_r=Cn[--_n],Cn[_n]=null}var dn=null,ln=null,Ye=!1,Vn=null;function ww(e,t){var n=En(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 yv(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,dn=e,ln=ci(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dn=e,ln=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ns!==null?{id:_r,overflow:Tr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=En(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dn=e,ln=null,!0):!1;default:return!1}}function qf(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gf(e){if(Ye){var t=ln;if(t){var n=t;if(!yv(e,t)){if(qf(e))throw Error(Q(418));t=ci(n.nextSibling);var r=dn;t&&yv(e,t)?ww(r,n):(e.flags=e.flags&-4097|2,Ye=!1,dn=e)}}else{if(qf(e))throw Error(Q(418));e.flags=e.flags&-4097|2,Ye=!1,dn=e}}}function xv(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dn=e}function Ol(e){if(e!==dn)return!1;if(!Ye)return xv(e),Ye=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Vf(e.type,e.memoizedProps)),t&&(t=ln)){if(qf(e))throw bw(),Error(Q(418));for(;t;)ww(e,t),t=ci(t.nextSibling)}if(xv(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){ln=ci(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ln=null}}else ln=dn?ci(e.stateNode.nextSibling):null;return!0}function bw(){for(var e=ln;e;)e=ci(e.nextSibling)}function ho(){ln=dn=null,Ye=!1}function Hh(e){Vn===null?Vn=[e]:Vn.push(e)}var pT=Lr.ReactCurrentBatchConfig;function Ho(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 Dl(e,t){throw e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function wv(e){var t=e._init;return t(e._payload)}function Sw(e){function t(m,g){if(e){var y=m.deletions;y===null?(m.deletions=[g],m.flags|=16):y.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=pi(m,g),m.index=0,m.sibling=null,m}function s(m,g,y){return m.index=y,e?(y=m.alternate,y!==null?(y=y.index,y<g?(m.flags|=2,g):y):(m.flags|=2,g)):(m.flags|=1048576,g)}function o(m){return e&&m.alternate===null&&(m.flags|=2),m}function a(m,g,y,k){return g===null||g.tag!==6?(g=Od(y,m.mode,k),g.return=m,g):(g=i(g,y),g.return=m,g)}function l(m,g,y,k){var C=y.type;return C===Ts?d(m,g,y.props.children,k,y.key):g!==null&&(g.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Vr&&wv(C)===g.type)?(k=i(g,y.props),k.ref=Ho(m,g,y),k.return=m,k):(k=dc(y.type,y.key,y.props,null,m.mode,k),k.ref=Ho(m,g,y),k.return=m,k)}function c(m,g,y,k){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Dd(y,m.mode,k),g.return=m,g):(g=i(g,y.children||[]),g.return=m,g)}function d(m,g,y,k,C){return g===null||g.tag!==7?(g=Yi(y,m.mode,k,C),g.return=m,g):(g=i(g,y),g.return=m,g)}function u(m,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Od(""+g,m.mode,y),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Cl:return y=dc(g.type,g.key,g.props,null,m.mode,y),y.ref=Ho(m,null,g),y.return=m,y;case _s:return g=Dd(g,m.mode,y),g.return=m,g;case Vr:var k=g._init;return u(m,k(g._payload),y)}if(Zo(g)||Bo(g))return g=Yi(g,m.mode,y,null),g.return=m,g;Dl(m,g)}return null}function p(m,g,y,k){var C=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return C!==null?null:a(m,g,""+y,k);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Cl:return y.key===C?l(m,g,y,k):null;case _s:return y.key===C?c(m,g,y,k):null;case Vr:return C=y._init,p(m,g,C(y._payload),k)}if(Zo(y)||Bo(y))return C!==null?null:d(m,g,y,k,null);Dl(m,y)}return null}function h(m,g,y,k,C){if(typeof k=="string"&&k!==""||typeof k=="number")return m=m.get(y)||null,a(g,m,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Cl:return m=m.get(k.key===null?y:k.key)||null,l(g,m,k,C);case _s:return m=m.get(k.key===null?y:k.key)||null,c(g,m,k,C);case Vr:var _=k._init;return h(m,g,y,_(k._payload),C)}if(Zo(k)||Bo(k))return m=m.get(y)||null,d(g,m,k,C,null);Dl(g,k)}return null}function x(m,g,y,k){for(var C=null,_=null,E=g,A=g=0,$=null;E!==null&&A<y.length;A++){E.index>A?($=E,E=null):$=E.sibling;var I=p(m,E,y[A],k);if(I===null){E===null&&(E=$);break}e&&E&&I.alternate===null&&t(m,E),g=s(I,g,A),_===null?C=I:_.sibling=I,_=I,E=$}if(A===y.length)return n(m,E),Ye&&ji(m,A),C;if(E===null){for(;A<y.length;A++)E=u(m,y[A],k),E!==null&&(g=s(E,g,A),_===null?C=E:_.sibling=E,_=E);return Ye&&ji(m,A),C}for(E=r(m,E);A<y.length;A++)$=h(E,m,A,y[A],k),$!==null&&(e&&$.alternate!==null&&E.delete($.key===null?A:$.key),g=s($,g,A),_===null?C=$:_.sibling=$,_=$);return e&&E.forEach(function(D){return t(m,D)}),Ye&&ji(m,A),C}function b(m,g,y,k){var C=Bo(y);if(typeof C!="function")throw Error(Q(150));if(y=C.call(y),y==null)throw Error(Q(151));for(var _=C=null,E=g,A=g=0,$=null,I=y.next();E!==null&&!I.done;A++,I=y.next()){E.index>A?($=E,E=null):$=E.sibling;var D=p(m,E,I.value,k);if(D===null){E===null&&(E=$);break}e&&E&&D.alternate===null&&t(m,E),g=s(D,g,A),_===null?C=D:_.sibling=D,_=D,E=$}if(I.done)return n(m,E),Ye&&ji(m,A),C;if(E===null){for(;!I.done;A++,I=y.next())I=u(m,I.value,k),I!==null&&(g=s(I,g,A),_===null?C=I:_.sibling=I,_=I);return Ye&&ji(m,A),C}for(E=r(m,E);!I.done;A++,I=y.next())I=h(E,m,A,I.value,k),I!==null&&(e&&I.alternate!==null&&E.delete(I.key===null?A:I.key),g=s(I,g,A),_===null?C=I:_.sibling=I,_=I);return e&&E.forEach(function(P){return t(m,P)}),Ye&&ji(m,A),C}function S(m,g,y,k){if(typeof y=="object"&&y!==null&&y.type===Ts&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Cl:e:{for(var C=y.key,_=g;_!==null;){if(_.key===C){if(C=y.type,C===Ts){if(_.tag===7){n(m,_.sibling),g=i(_,y.props.children),g.return=m,m=g;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Vr&&wv(C)===_.type){n(m,_.sibling),g=i(_,y.props),g.ref=Ho(m,_,y),g.return=m,m=g;break e}n(m,_);break}else t(m,_);_=_.sibling}y.type===Ts?(g=Yi(y.props.children,m.mode,k,y.key),g.return=m,m=g):(k=dc(y.type,y.key,y.props,null,m.mode,k),k.ref=Ho(m,g,y),k.return=m,m=k)}return o(m);case _s:e:{for(_=y.key;g!==null;){if(g.key===_)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(m,g.sibling),g=i(g,y.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else t(m,g);g=g.sibling}g=Dd(y,m.mode,k),g.return=m,m=g}return o(m);case Vr:return _=y._init,S(m,g,_(y._payload),k)}if(Zo(y))return x(m,g,y,k);if(Bo(y))return b(m,g,y,k);Dl(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(m,g.sibling),g=i(g,y),g.return=m,m=g):(n(m,g),g=Od(y,m.mode,k),g.return=m,m=g),o(m)):n(m,g)}return S}var mo=Sw(!0),kw=Sw(!1),Lc=Si(null),Fc=null,Os=null,Wh=null;function qh(){Wh=Os=Fc=null}function Gh(e){var t=Lc.current;Ge(Lc),e._currentValue=t}function Yf(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 Ys(e,t){Fc=e,Wh=Os=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Xt=!0),e.firstContext=null)}function Mn(e){var t=e._currentValue;if(Wh!==e)if(e={context:e,memoizedValue:t,next:null},Os===null){if(Fc===null)throw Error(Q(308));Os=e,Fc.dependencies={lanes:0,firstContext:e}}else Os=Os.next=e;return t}var Di=null;function Yh(e){Di===null?Di=[e]:Di.push(e)}function Cw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Yh(t)):(n.next=i.next,i.next=n),t.interleaved=n,Mr(e,r)}function Mr(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 Ur=!1;function Qh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _w(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 Er(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ui(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Mr(e,n)}return i=r.interleaved,i===null?(t.next=t,Yh(r)):(t.next=i.next,i.next=t),r.interleaved=t,Mr(e,n)}function sc(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,Oh(e,n)}}function bv(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 Bc(e,t,n,r){var i=e.updateQueue;Ur=!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 x=e,b=a;switch(p=t,h=n,b.tag){case 1:if(x=b.payload,typeof x=="function"){u=x.call(h,u,p);break e}u=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=b.payload,p=typeof x=="function"?x.call(h,u,p):x,p==null)break e;u=Je({},u,p);break e;case 2:Ur=!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);is|=o,e.lanes=o,e.memoizedState=u}}function Sv(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 ul={},ar=Si(ul),Da=Si(ul),Ia=Si(ul);function Ii(e){if(e===ul)throw Error(Q(174));return e}function Kh(e,t){switch(Ve(Ia,t),Ve(Da,e),Ve(ar,ul),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Af(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Af(t,e)}Ge(ar),Ve(ar,t)}function go(){Ge(ar),Ge(Da),Ge(Ia)}function Tw(e){Ii(Ia.current);var t=Ii(ar.current),n=Af(t,e.type);t!==n&&(Ve(Da,e),Ve(ar,n))}function Xh(e){Da.current===e&&(Ge(ar),Ge(Da))}var Ke=Si(0);function $c(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 Ad=[];function Zh(){for(var e=0;e<Ad.length;e++)Ad[e]._workInProgressVersionPrimary=null;Ad.length=0}var oc=Lr.ReactCurrentDispatcher,jd=Lr.ReactCurrentBatchConfig,rs=0,Ze=null,ft=null,vt=null,zc=!1,pa=!1,La=0,hT=0;function Et(){throw Error(Q(321))}function Jh(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yn(e[n],t[n]))return!1;return!0}function em(e,t,n,r,i,s){if(rs=s,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oc.current=e===null||e.memoizedState===null?yT:xT,e=n(r,i),pa){s=0;do{if(pa=!1,La=0,25<=s)throw Error(Q(301));s+=1,vt=ft=null,t.updateQueue=null,oc.current=wT,e=n(r,i)}while(pa)}if(oc.current=Vc,t=ft!==null&&ft.next!==null,rs=0,vt=ft=Ze=null,zc=!1,t)throw Error(Q(300));return e}function tm(){var e=La!==0;return La=0,e}function Jn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Ze.memoizedState=vt=e:vt=vt.next=e,vt}function Pn(){if(ft===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=ft.next;var t=vt===null?Ze.memoizedState:vt.next;if(t!==null)vt=t,ft=e;else{if(e===null)throw Error(Q(310));ft=e,e={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},vt===null?Ze.memoizedState=vt=e:vt=vt.next=e}return vt}function Fa(e,t){return typeof t=="function"?t(e):t}function Rd(e){var t=Pn(),n=t.queue;if(n===null)throw Error(Q(311));n.lastRenderedReducer=e;var r=ft,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((rs&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,Ze.lanes|=d,is|=d}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Yn(r,t.memoizedState)||(Xt=!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,Ze.lanes|=s,is|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Md(e){var t=Pn(),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);Yn(s,t.memoizedState)||(Xt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Ew(){}function Aw(e,t){var n=Ze,r=Pn(),i=t(),s=!Yn(r.memoizedState,i);if(s&&(r.memoizedState=i,Xt=!0),r=r.queue,nm(Mw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||vt!==null&&vt.memoizedState.tag&1){if(n.flags|=2048,Ba(9,Rw.bind(null,n,r,i,t),void 0,null),yt===null)throw Error(Q(349));rs&30||jw(n,t,i)}return i}function jw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Rw(e,t,n,r){t.value=n,t.getSnapshot=r,Pw(t)&&Nw(e)}function Mw(e,t,n){return n(function(){Pw(t)&&Nw(e)})}function Pw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yn(e,n)}catch{return!0}}function Nw(e){var t=Mr(e,1);t!==null&&qn(t,e,1,-1)}function kv(e){var t=Jn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:e},t.queue=e,e=e.dispatch=vT.bind(null,Ze,e),[t.memoizedState,e]}function Ba(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ze.updateQueue,t===null?(t={lastEffect:null,stores:null},Ze.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 Ow(){return Pn().memoizedState}function ac(e,t,n,r){var i=Jn();Ze.flags|=e,i.memoizedState=Ba(1|t,n,void 0,r===void 0?null:r)}function bu(e,t,n,r){var i=Pn();r=r===void 0?null:r;var s=void 0;if(ft!==null){var o=ft.memoizedState;if(s=o.destroy,r!==null&&Jh(r,o.deps)){i.memoizedState=Ba(t,n,s,r);return}}Ze.flags|=e,i.memoizedState=Ba(1|t,n,s,r)}function Cv(e,t){return ac(8390656,8,e,t)}function nm(e,t){return bu(2048,8,e,t)}function Dw(e,t){return bu(4,2,e,t)}function Iw(e,t){return bu(4,4,e,t)}function Lw(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 Fw(e,t,n){return n=n!=null?n.concat([e]):null,bu(4,4,Lw.bind(null,t,e),n)}function rm(){}function Bw(e,t){var n=Pn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jh(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function $w(e,t){var n=Pn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Jh(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function zw(e,t,n){return rs&21?(Yn(n,t)||(n=q1(),Ze.lanes|=n,is|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Xt=!0),e.memoizedState=n)}function mT(e,t){var n=Ie;Ie=n!==0&&4>n?n:4,e(!0);var r=jd.transition;jd.transition={};try{e(!1),t()}finally{Ie=n,jd.transition=r}}function Vw(){return Pn().memoizedState}function gT(e,t,n){var r=fi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Uw(e))Hw(t,n);else if(n=Cw(e,t,n,r),n!==null){var i=zt();qn(n,e,r,i),Ww(n,t,r)}}function vT(e,t,n){var r=fi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Uw(e))Hw(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,Yn(a,o)){var l=t.interleaved;l===null?(i.next=i,Yh(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Cw(e,t,i,r),n!==null&&(i=zt(),qn(n,e,r,i),Ww(n,t,r))}}function Uw(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function Hw(e,t){pa=zc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ww(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Oh(e,n)}}var Vc={readContext:Mn,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useInsertionEffect:Et,useLayoutEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useMutableSource:Et,useSyncExternalStore:Et,useId:Et,unstable_isNewReconciler:!1},yT={readContext:Mn,useCallback:function(e,t){return Jn().memoizedState=[e,t===void 0?null:t],e},useContext:Mn,useEffect:Cv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ac(4194308,4,Lw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ac(4194308,4,e,t)},useInsertionEffect:function(e,t){return ac(4,2,e,t)},useMemo:function(e,t){var n=Jn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jn();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=gT.bind(null,Ze,e),[r.memoizedState,e]},useRef:function(e){var t=Jn();return e={current:e},t.memoizedState=e},useState:kv,useDebugValue:rm,useDeferredValue:function(e){return Jn().memoizedState=e},useTransition:function(){var e=kv(!1),t=e[0];return e=mT.bind(null,e[1]),Jn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ze,i=Jn();if(Ye){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),yt===null)throw Error(Q(349));rs&30||jw(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Cv(Mw.bind(null,r,s,e),[e]),r.flags|=2048,Ba(9,Rw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Jn(),t=yt.identifierPrefix;if(Ye){var n=Tr,r=_r;n=(r&~(1<<32-Wn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=La++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=hT++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xT={readContext:Mn,useCallback:Bw,useContext:Mn,useEffect:nm,useImperativeHandle:Fw,useInsertionEffect:Dw,useLayoutEffect:Iw,useMemo:$w,useReducer:Rd,useRef:Ow,useState:function(){return Rd(Fa)},useDebugValue:rm,useDeferredValue:function(e){var t=Pn();return zw(t,ft.memoizedState,e)},useTransition:function(){var e=Rd(Fa)[0],t=Pn().memoizedState;return[e,t]},useMutableSource:Ew,useSyncExternalStore:Aw,useId:Vw,unstable_isNewReconciler:!1},wT={readContext:Mn,useCallback:Bw,useContext:Mn,useEffect:nm,useImperativeHandle:Fw,useInsertionEffect:Dw,useLayoutEffect:Iw,useMemo:$w,useReducer:Md,useRef:Ow,useState:function(){return Md(Fa)},useDebugValue:rm,useDeferredValue:function(e){var t=Pn();return ft===null?t.memoizedState=e:zw(t,ft.memoizedState,e)},useTransition:function(){var e=Md(Fa)[0],t=Pn().memoizedState;return[e,t]},useMutableSource:Ew,useSyncExternalStore:Aw,useId:Vw,unstable_isNewReconciler:!1};function Fn(e,t){if(e&&e.defaultProps){t=Je({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Qf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Su={isMounted:function(e){return(e=e._reactInternals)?us(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=zt(),i=fi(e),s=Er(r,i);s.payload=t,n!=null&&(s.callback=n),t=ui(e,s,i),t!==null&&(qn(t,e,i,r),sc(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=zt(),i=fi(e),s=Er(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=ui(e,s,i),t!==null&&(qn(t,e,i,r),sc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zt(),r=fi(e),i=Er(n,r);i.tag=2,t!=null&&(i.callback=t),t=ui(e,i,r),t!==null&&(qn(t,e,r,n),sc(t,e,r))}};function _v(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?!Ma(n,r)||!Ma(i,s):!0}function qw(e,t,n){var r=!1,i=vi,s=t.contextType;return typeof s=="object"&&s!==null?s=Mn(s):(i=Jt(t)?ts:Nt.current,r=t.contextTypes,s=(r=r!=null)?po(e,i):vi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Su,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Tv(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&&Su.enqueueReplaceState(t,t.state,null)}function Kf(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Qh(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Mn(s):(s=Jt(t)?ts:Nt.current,i.context=po(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Qf(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&&Su.enqueueReplaceState(i,i.state,null),Bc(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function vo(e,t){try{var n="",r=t;do n+=Y2(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 Pd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var wT=typeof WeakMap=="function"?WeakMap:Map;function Gw(e,t,n){n=Er(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hc||(Hc=!0,ap=r),Xf(e,t)},n}function Yw(e,t,n){n=Er(-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(){Xf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Xf(e,t),typeof r!="function"&&(di===null?di=new Set([this]):di.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Ev(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new wT;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 Av(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 jv(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=Er(-1,1),t.tag=2,ui(n,t,1))),n.lanes|=1),e)}var bT=Lr.ReactCurrentOwner,Xt=!1;function Bt(e,t,n,r){t.child=e===null?kw(t,null,n,r):mo(t,e.child,n,r)}function Rv(e,t,n,r,i){n=n.render;var s=t.ref;return Ys(t,i),r=em(e,t,n,r,s,i),n=tm(),e!==null&&!Xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Pr(e,t,i)):(Ye&&n&&Vh(t),t.flags|=1,Bt(e,t,r,i),t.child)}function Mv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!dm(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Qw(e,t,s,r,i)):(e=dc(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:Ma,n(o,r)&&e.ref===t.ref)return Pr(e,t,i)}return t.flags|=1,e=pi(s,r),e.ref=t.ref,e.return=t,t.child=e}function Qw(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Ma(s,r)&&e.ref===t.ref)if(Xt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Xt=!0);else return t.lanes=e.lanes,Pr(e,t,i)}return Zf(e,t,n,r,i)}function Kw(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},Ve(Is,sn),sn|=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,Ve(Is,sn),sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ve(Is,sn),sn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ve(Is,sn),sn|=r;return Bt(e,t,i,n),t.child}function Xw(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=Jt(n)?ts:Nt.current;return s=po(t,s),Ys(t,i),n=em(e,t,n,r,s,i),r=tm(),e!==null&&!Xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Pr(e,t,i)):(Ye&&r&&Vh(t),t.flags|=1,Bt(e,t,n,i),t.child)}function Pv(e,t,n,r,i){if(Jt(n)){var s=!0;Oc(t)}else s=!1;if(Ys(t,i),t.stateNode===null)lc(e,t),qw(t,n,r),Kf(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=Mn(c):(c=Jt(n)?ts:Nt.current,c=po(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)&&Tv(t,o,r,c),Ur=!1;var p=t.memoizedState;o.state=p,Bc(t,r,o,i),l=t.memoizedState,a!==r||p!==l||Zt.current||Ur?(typeof d=="function"&&(Qf(t,n,d,r),l=t.memoizedState),(a=Ur||_v(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,_w(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Fn(t.type,a),o.props=c,u=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Mn(l):(l=Jt(n)?ts:Nt.current,l=po(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)&&Tv(t,o,r,l),Ur=!1,p=t.memoizedState,o.state=p,Bc(t,r,o,i);var x=t.memoizedState;a!==u||p!==x||Zt.current||Ur?(typeof h=="function"&&(Qf(t,n,h,r),x=t.memoizedState),(c=Ur||_v(t,n,c,r,p,x,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,x,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,x,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=x),o.props=r,o.state=x,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 Jf(e,t,n,r,s,i)}function Jf(e,t,n,r,i,s){Xw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&vv(t,n,!1),Pr(e,t,s);r=t.stateNode,bT.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=mo(t,e.child,null,s),t.child=mo(t,null,a,s)):Bt(e,t,a,s),t.memoizedState=r.state,i&&vv(t,n,!0),t.child}function Zw(e){var t=e.stateNode;t.pendingContext?gv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gv(e,t.context,!1),Kh(e,t.containerInfo)}function Nv(e,t,n,r,i){return ho(),Hh(i),t.flags|=256,Bt(e,t,n,r),t.child}var ep={dehydrated:null,treeContext:null,retryLane:0};function tp(e){return{baseLanes:e,cachePool:null,transitions:null}}function Jw(e,t,n){var r=t.pendingProps,i=Ke.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),Ve(Ke,i&1),e===null)return Gf(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=_u(o,r,0,null),e=Yi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=tp(n),t.memoizedState=ep,e):im(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return ST(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=pi(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=pi(a,s):(s=Yi(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?tp(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=ep,r}return s=e.child,e=s.sibling,r=pi(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 im(e,t){return t=_u({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Il(e,t,n,r){return r!==null&&Hh(r),mo(t,e.child,null,n),e=im(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ST(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Pd(Error(Q(422))),Il(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=_u({mode:"visible",children:r.children},i,0,null),s=Yi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&mo(t,e.child,null,o),t.child.memoizedState=tp(o),t.memoizedState=ep,s);if(!(t.mode&1))return Il(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=Pd(s,r,void 0),Il(e,t,o,r)}if(a=(o&e.childLanes)!==0,Xt||a){if(r=yt,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,Mr(e,i),qn(r,e,i,-1))}return um(),r=Pd(Error(Q(421))),Il(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=DT.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,ln=ci(i.nextSibling),dn=t,Ye=!0,Vn=null,e!==null&&(Cn[_n++]=_r,Cn[_n++]=Tr,Cn[_n++]=ns,_r=e.id,Tr=e.overflow,ns=t),t=im(t,r.children),t.flags|=4096,t)}function Ov(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yf(e.return,t,n)}function Nd(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 eb(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Bt(e,t,r.children,n),r=Ke.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&&Ov(e,n,t);else if(e.tag===19)Ov(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(Ve(Ke,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&&$c(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Nd(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&&$c(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Nd(t,!0,n,null,s);break;case"together":Nd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function lc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),is|=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=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kT(e,t,n){switch(t.tag){case 3:Zw(t),ho();break;case 5:Tw(t);break;case 1:Jt(t.type)&&Oc(t);break;case 4:Kh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ve(Lc,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ve(Ke,Ke.current&1),t.flags|=128,null):n&t.child.childLanes?Jw(e,t,n):(Ve(Ke,Ke.current&1),e=Pr(e,t,n),e!==null?e.sibling:null);Ve(Ke,Ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return eb(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ve(Ke,Ke.current),r)break;return null;case 22:case 23:return t.lanes=0,Kw(e,t,n)}return Pr(e,t,n)}var tb,np,nb,rb;tb=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}};np=function(){};nb=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ii(ar.current);var s=null;switch(n){case"input":i=Cf(e,i),r=Cf(e,r),s=[];break;case"select":i=Je({},i,{value:void 0}),r=Je({},r,{value:void 0}),s=[];break;case"textarea":i=Ef(e,i),r=Ef(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pc)}jf(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"&&(Ca.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"&&(Ca.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&He("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)}};rb=function(e,t,n,r){n!==r&&(t.flags|=4)};function Wo(e,t){if(!Ye)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 At(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 CT(e,t,n){var r=t.pendingProps;switch(Uh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(t),null;case 1:return Jt(t.type)&&Nc(),At(t),null;case 3:return r=t.stateNode,go(),Ge(Zt),Ge(Nt),Zh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ol(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vn!==null&&(up(Vn),Vn=null))),np(e,t),At(t),null;case 5:Xh(t);var i=Ii(Ia.current);if(n=t.type,e!==null&&t.stateNode!=null)nb(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 At(t),null}if(e=Ii(ar.current),Ol(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[sr]=t,r[Oa]=s,e=(t.mode&1)!==0,n){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(i=0;i<ea.length;i++)He(ea[i],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":Ug(r,s),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},He("invalid",r);break;case"textarea":Wg(r,s),He("invalid",r)}jf(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&&Nl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Nl(r.textContent,a,e),i=["children",""+a]):Ca.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&He("scroll",r)}switch(n){case"input":_l(r),Hg(r,s,!0);break;case"textarea":_l(r),qg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Pc)}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=M1(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[sr]=t,e[Oa]=r,tb(e,t,!1,!1),t.stateNode=e;e:{switch(o=Rf(n,r),n){case"dialog":He("cancel",e),He("close",e),i=r;break;case"iframe":case"object":case"embed":He("load",e),i=r;break;case"video":case"audio":for(i=0;i<ea.length;i++)He(ea[i],e);i=r;break;case"source":He("error",e),i=r;break;case"img":case"image":case"link":He("error",e),He("load",e),i=r;break;case"details":He("toggle",e),i=r;break;case"input":Ug(e,r),i=Cf(e,r),He("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Je({},r,{value:void 0}),He("invalid",e);break;case"textarea":Wg(e,r),i=Ef(e,r),He("invalid",e);break;default:i=r}jf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?O1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&P1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&_a(e,l):typeof l=="number"&&_a(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ca.hasOwnProperty(s)?l!=null&&s==="onScroll"&&He("scroll",e):l!=null&&Ah(e,s,l,o))}switch(n){case"input":_l(e),Hg(e,r,!1);break;case"textarea":_l(e),qg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+gi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Hs(e,!!r.multiple,s,!1):r.defaultValue!=null&&Hs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Pc)}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 At(t),null;case 6:if(e&&t.stateNode!=null)rb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=Ii(Ia.current),Ii(ar.current),Ol(t)){if(r=t.stateNode,n=t.memoizedProps,r[sr]=t,(s=r.nodeValue!==n)&&(e=dn,e!==null))switch(e.tag){case 3:Nl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[sr]=t,t.stateNode=r}return At(t),null;case 13:if(Ge(Ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ye&&ln!==null&&t.mode&1&&!(t.flags&128))bw(),ho(),t.flags|=98560,s=!1;else if(s=Ol(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[sr]=t}else ho(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;At(t),s=!1}else Vn!==null&&(up(Vn),Vn=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||Ke.current&1?ht===0&&(ht=3):um())),t.updateQueue!==null&&(t.flags|=4),At(t),null);case 4:return go(),np(e,t),e===null&&Pa(t.stateNode.containerInfo),At(t),null;case 10:return Gh(t.type._context),At(t),null;case 17:return Jt(t.type)&&Nc(),At(t),null;case 19:if(Ge(Ke),s=t.memoizedState,s===null)return At(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Wo(s,!1);else{if(ht!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=$c(e),o!==null){for(t.flags|=128,Wo(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 Ve(Ke,Ke.current&1|2),t.child}e=e.sibling}s.tail!==null&&at()>yo&&(t.flags|=128,r=!0,Wo(s,!1),t.lanes=4194304)}else{if(!r)if(e=$c(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ye)return At(t),null}else 2*at()-s.renderingStartTime>yo&&n!==1073741824&&(t.flags|=128,r=!0,Wo(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=at(),t.sibling=null,n=Ke.current,Ve(Ke,r?n&1|2:n&1),t):(At(t),null);case 22:case 23:return cm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?sn&1073741824&&(At(t),t.subtreeFlags&6&&(t.flags|=8192)):At(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function _T(e,t){switch(Uh(t),t.tag){case 1:return Jt(t.type)&&Nc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return go(),Ge(Zt),Ge(Nt),Zh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xh(t),null;case 13:if(Ge(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));ho()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(Ke),null;case 4:return go(),null;case 10:return Gh(t.type._context),null;case 22:case 23:return cm(),null;case 24:return null;default:return null}}var Ll=!1,Mt=!1,TT=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Ds(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){rt(e,t,r)}else n.current=null}function rp(e,t,n){try{n()}catch(r){rt(e,t,r)}}var Dv=!1;function ET(e,t){if($f=jc,e=lw(),zh(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(zf={focusedElem:e,selectionRange:n},jc=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var b=x.memoizedProps,S=x.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?b:Fn(t.type,b),S);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(C){rt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return x=Dv,Dv=!1,x}function ha(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&&rp(t,n,s)}i=i.next}while(i!==r)}}function ku(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 ip(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 ib(e){var t=e.alternate;t!==null&&(e.alternate=null,ib(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sr],delete t[Oa],delete t[Hf],delete t[cT],delete t[uT])),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 sb(e){return e.tag===5||e.tag===3||e.tag===4}function Iv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sb(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 sp(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=Pc));else if(r!==4&&(e=e.child,e!==null))for(sp(e,t,n),e=e.sibling;e!==null;)sp(e,t,n),e=e.sibling}function op(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(op(e,t,n),e=e.sibling;e!==null;)op(e,t,n),e=e.sibling}var St=null,$n=!1;function Br(e,t,n){for(n=n.child;n!==null;)ob(e,t,n),n=n.sibling}function ob(e,t,n){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(mu,n)}catch{}switch(n.tag){case 5:Mt||Ds(n,t);case 6:var r=St,i=$n;St=null,Br(e,t,n),St=r,$n=i,St!==null&&($n?(e=St,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):St.removeChild(n.stateNode));break;case 18:St!==null&&($n?(e=St,n=n.stateNode,e.nodeType===8?Td(e.parentNode,n):e.nodeType===1&&Td(e,n),ja(e)):Td(St,n.stateNode));break;case 4:r=St,i=$n,St=n.stateNode.containerInfo,$n=!0,Br(e,t,n),St=r,$n=i;break;case 0:case 11:case 14:case 15:if(!Mt&&(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)&&rp(n,t,o),i=i.next}while(i!==r)}Br(e,t,n);break;case 1:if(!Mt&&(Ds(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){rt(n,t,a)}Br(e,t,n);break;case 21:Br(e,t,n);break;case 22:n.mode&1?(Mt=(r=Mt)||n.memoizedState!==null,Br(e,t,n),Mt=r):Br(e,t,n);break;default:Br(e,t,n)}}function Lv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new TT),t.forEach(function(r){var i=IT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Dn(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:St=a.stateNode,$n=!1;break e;case 3:St=a.stateNode.containerInfo,$n=!0;break e;case 4:St=a.stateNode.containerInfo,$n=!0;break e}a=a.return}if(St===null)throw Error(Q(160));ob(s,o,i),St=null,$n=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){rt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ab(t,e),t=t.sibling}function ab(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Dn(t,e),Qn(e),r&4){try{ha(3,e,e.return),ku(3,e)}catch(b){rt(e,e.return,b)}try{ha(5,e,e.return)}catch(b){rt(e,e.return,b)}}break;case 1:Dn(t,e),Qn(e),r&512&&n!==null&&Ds(n,n.return);break;case 5:if(Dn(t,e),Qn(e),r&512&&n!==null&&Ds(n,n.return),e.flags&32){var i=e.stateNode;try{_a(i,"")}catch(b){rt(e,e.return,b)}}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&&j1(i,s),Rf(a,o);var c=Rf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?O1(i,u):d==="dangerouslySetInnerHTML"?P1(i,u):d==="children"?_a(i,u):Ah(i,d,u,c)}switch(a){case"input":_f(i,s);break;case"textarea":R1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Hs(i,!!s.multiple,h,!1):p!==!!s.multiple&&(s.defaultValue!=null?Hs(i,!!s.multiple,s.defaultValue,!0):Hs(i,!!s.multiple,s.multiple?[]:"",!1))}i[Oa]=s}catch(b){rt(e,e.return,b)}}break;case 6:if(Dn(t,e),Qn(e),r&4){if(e.stateNode===null)throw Error(Q(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(b){rt(e,e.return,b)}}break;case 3:if(Dn(t,e),Qn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ja(t.containerInfo)}catch(b){rt(e,e.return,b)}break;case 4:Dn(t,e),Qn(e);break;case 13:Dn(t,e),Qn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(am=at())),r&4&&Lv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Mt=(c=Mt)||d,Dn(t,e),Mt=c):Dn(t,e),Qn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(fe=e,d=e.child;d!==null;){for(u=fe=d;fe!==null;){switch(p=fe,h=p.child,p.tag){case 0:case 11:case 14:case 15:ha(4,p,p.return);break;case 1:Ds(p,p.return);var x=p.stateNode;if(typeof x.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(b){rt(r,n,b)}}break;case 5:Ds(p,p.return);break;case 22:if(p.memoizedState!==null){Bv(u);continue}}h!==null?(h.return=p,fe=h):Bv(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=N1("display",o))}catch(b){rt(e,e.return,b)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(b){rt(e,e.return,b)}}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:Dn(t,e),Qn(e),r&4&&Lv(e);break;case 21:break;default:Dn(t,e),Qn(e)}}function Qn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(sb(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&&(_a(i,""),r.flags&=-33);var s=Iv(e);op(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Iv(e);sp(e,a,o);break;default:throw Error(Q(161))}}catch(l){rt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function AT(e,t,n){fe=e,lb(e)}function lb(e,t,n){for(var r=(e.mode&1)!==0;fe!==null;){var i=fe,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ll;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Mt;a=Ll;var c=Mt;if(Ll=o,(Mt=l)&&!c)for(fe=i;fe!==null;)o=fe,l=o.child,o.tag===22&&o.memoizedState!==null?$v(i):l!==null?(l.return=o,fe=l):$v(i);for(;s!==null;)fe=s,lb(s),s=s.sibling;fe=i,Ll=a,Mt=c}Fv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,fe=s):Fv(e)}}function Fv(e){for(;fe!==null;){var t=fe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Mt||ku(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Mt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Fn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Sv(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}Sv(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&&ja(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}Mt||t.flags&512&&ip(t)}catch(p){rt(t,t.return,p)}}if(t===e){fe=null;break}if(n=t.sibling,n!==null){n.return=t.return,fe=n;break}fe=t.return}}function Bv(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,fe=n;break}fe=t.return}}function $v(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ku(4,t)}catch(l){rt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){rt(t,i,l)}}var s=t.return;try{ip(t)}catch(l){rt(t,s,l)}break;case 5:var o=t.return;try{ip(t)}catch(l){rt(t,o,l)}}}catch(l){rt(t,t.return,l)}if(t===e){fe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,fe=a;break}fe=t.return}}var jT=Math.ceil,Uc=Lr.ReactCurrentDispatcher,sm=Lr.ReactCurrentOwner,jn=Lr.ReactCurrentBatchConfig,Pe=0,yt=null,ut=null,Ct=0,sn=0,Is=Si(0),ht=0,$a=null,is=0,Cu=0,om=0,ma=null,Qt=null,am=0,yo=1/0,br=null,Hc=!1,ap=null,di=null,Fl=!1,ii=null,Wc=0,ga=0,lp=null,cc=-1,uc=0;function zt(){return Pe&6?at():cc!==-1?cc:cc=at()}function fi(e){return e.mode&1?Pe&2&&Ct!==0?Ct&-Ct:fT.transition!==null?(uc===0&&(uc=q1()),uc):(e=Ie,e!==0||(e=window.event,e=e===void 0?16:J1(e.type)),e):1}function qn(e,t,n,r){if(50<ga)throw ga=0,lp=null,Error(Q(185));al(e,n,r),(!(Pe&2)||e!==yt)&&(e===yt&&(!(Pe&2)&&(Cu|=n),ht===4&&qr(e,Ct)),en(e,r),n===1&&Pe===0&&!(t.mode&1)&&(yo=at()+500,wu&&ki()))}function en(e,t){var n=e.callbackNode;f_(e,t);var r=Ac(e,e===yt?Ct:0);if(r===0)n!==null&&Qg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Qg(n),t===1)e.tag===0?dT(zv.bind(null,e)):yw(zv.bind(null,e)),aT(function(){!(Pe&6)&&ki()}),n=null;else{switch(G1(r)){case 1:n=Nh;break;case 4:n=H1;break;case 16:n=Ec;break;case 536870912:n=W1;break;default:n=Ec}n=gb(n,cb.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cb(e,t){if(cc=-1,uc=0,Pe&6)throw Error(Q(327));var n=e.callbackNode;if(Qs()&&e.callbackNode!==n)return null;var r=Ac(e,e===yt?Ct:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=qc(e,r);else{t=r;var i=Pe;Pe|=2;var s=db();(yt!==e||Ct!==t)&&(br=null,yo=at()+500,Gi(e,t));do try{PT();break}catch(a){ub(e,a)}while(!0);qh(),Uc.current=s,Pe=i,ut!==null?t=0:(yt=null,Ct=0,t=ht)}if(t!==0){if(t===2&&(i=Df(e),i!==0&&(r=i,t=cp(e,i))),t===1)throw n=$a,Gi(e,0),qr(e,r),en(e,at()),n;if(t===6)qr(e,r);else{if(i=e.current.alternate,!(r&30)&&!RT(i)&&(t=qc(e,r),t===2&&(s=Df(e),s!==0&&(r=s,t=cp(e,s))),t===1))throw n=$a,Gi(e,0),qr(e,r),en(e,at()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:Ri(e,Qt,br);break;case 3:if(qr(e,r),(r&130023424)===r&&(t=am+500-at(),10<t)){if(Ac(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){zt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Uf(Ri.bind(null,e,Qt,br),t);break}Ri(e,Qt,br);break;case 4:if(qr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Wn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=at()-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=Uf(Ri.bind(null,e,Qt,br),r);break}Ri(e,Qt,br);break;case 5:Ri(e,Qt,br);break;default:throw Error(Q(329))}}}return en(e,at()),e.callbackNode===n?cb.bind(null,e):null}function cp(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&(Gi(e,t).flags|=256),e=qc(e,t),e!==2&&(t=Qt,Qt=n,t!==null&&up(t)),e}function up(e){Qt===null?Qt=e:Qt.push.apply(Qt,e)}function RT(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(!Yn(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 qr(e,t){for(t&=~om,t&=~Cu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Wn(t),r=1<<n;e[n]=-1,t&=~r}}function zv(e){if(Pe&6)throw Error(Q(327));Qs();var t=Ac(e,0);if(!(t&1))return en(e,at()),null;var n=qc(e,t);if(e.tag!==0&&n===2){var r=Df(e);r!==0&&(t=r,n=cp(e,r))}if(n===1)throw n=$a,Gi(e,0),qr(e,t),en(e,at()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ri(e,Qt,br),en(e,at()),null}function lm(e,t){var n=Pe;Pe|=1;try{return e(t)}finally{Pe=n,Pe===0&&(yo=at()+500,wu&&ki())}}function ss(e){ii!==null&&ii.tag===0&&!(Pe&6)&&Qs();var t=Pe;Pe|=1;var n=jn.transition,r=Ie;try{if(jn.transition=null,Ie=1,e)return e()}finally{Ie=r,jn.transition=n,Pe=t,!(Pe&6)&&ki()}}function cm(){sn=Is.current,Ge(Is)}function Gi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,oT(n)),ut!==null)for(n=ut.return;n!==null;){var r=n;switch(Uh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Nc();break;case 3:go(),Ge(Zt),Ge(Nt),Zh();break;case 5:Xh(r);break;case 4:go();break;case 13:Ge(Ke);break;case 19:Ge(Ke);break;case 10:Gh(r.type._context);break;case 22:case 23:cm()}n=n.return}if(yt=e,ut=e=pi(e.current,null),Ct=sn=t,ht=0,$a=null,om=Cu=is=0,Qt=ma=null,Di!==null){for(t=0;t<Di.length;t++)if(n=Di[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}Di=null}return e}function ub(e,t){do{var n=ut;try{if(qh(),oc.current=Vc,zc){for(var r=Ze.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}zc=!1}if(rs=0,vt=ft=Ze=null,pa=!1,La=0,sm.current=null,n===null||n.return===null){ht=1,$a=t,ut=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=Ct,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=Av(o);if(h!==null){h.flags&=-257,jv(h,o,a,s,t),h.mode&1&&Ev(s,c,t),t=h,l=c;var x=t.updateQueue;if(x===null){var b=new Set;b.add(l),t.updateQueue=b}else x.add(l);break e}else{if(!(t&1)){Ev(s,c,t),um();break e}l=Error(Q(426))}}else if(Ye&&a.mode&1){var S=Av(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),jv(S,o,a,s,t),Hh(vo(l,a));break e}}s=l=vo(l,a),ht!==4&&(ht=2),ma===null?ma=[s]:ma.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=Gw(s,l,t);bv(s,m);break e;case 1:a=l;var g=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(di===null||!di.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var C=Yw(s,a,t);bv(s,C);break e}}s=s.return}while(s!==null)}pb(n)}catch(k){t=k,ut===n&&n!==null&&(ut=n=n.return);continue}break}while(!0)}function db(){var e=Uc.current;return Uc.current=Vc,e===null?Vc:e}function um(){(ht===0||ht===3||ht===2)&&(ht=4),yt===null||!(is&268435455)&&!(Cu&268435455)||qr(yt,Ct)}function qc(e,t){var n=Pe;Pe|=2;var r=db();(yt!==e||Ct!==t)&&(br=null,Gi(e,t));do try{MT();break}catch(i){ub(e,i)}while(!0);if(qh(),Pe=n,Uc.current=r,ut!==null)throw Error(Q(261));return yt=null,Ct=0,ht}function MT(){for(;ut!==null;)fb(ut)}function PT(){for(;ut!==null&&!r_();)fb(ut)}function fb(e){var t=mb(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?pb(e):ut=t,sm.current=null}function pb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=_T(n,t),n!==null){n.flags&=32767,ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ht=6,ut=null;return}}else if(n=CT(n,t,sn),n!==null){ut=n;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);ht===0&&(ht=5)}function Ri(e,t,n){var r=Ie,i=jn.transition;try{jn.transition=null,Ie=1,NT(e,t,n,r)}finally{jn.transition=i,Ie=r}return null}function NT(e,t,n,r){do Qs();while(ii!==null);if(Pe&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(p_(e,s),e===yt&&(ut=yt=null,Ct=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fl||(Fl=!0,gb(Ec,function(){return Qs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=jn.transition,jn.transition=null;var o=Ie;Ie=1;var a=Pe;Pe|=4,sm.current=null,ET(e,n),ab(n,e),J_(zf),jc=!!$f,zf=$f=null,e.current=n,AT(n),i_(),Pe=a,Ie=o,jn.transition=s}else e.current=n;if(Fl&&(Fl=!1,ii=e,Wc=i),s=e.pendingLanes,s===0&&(di=null),a_(n.stateNode),en(e,at()),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(Hc)throw Hc=!1,e=ap,ap=null,e;return Wc&1&&e.tag!==0&&Qs(),s=e.pendingLanes,s&1?e===lp?ga++:(ga=0,lp=e):ga=0,ki(),null}function Qs(){if(ii!==null){var e=G1(Wc),t=jn.transition,n=Ie;try{if(jn.transition=null,Ie=16>e?16:e,ii===null)var r=!1;else{if(e=ii,ii=null,Wc=0,Pe&6)throw Error(Q(331));var i=Pe;for(Pe|=4,fe=e.current;fe!==null;){var s=fe,o=s.child;if(fe.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(fe=c;fe!==null;){var d=fe;switch(d.tag){case 0:case 11:case 15:ha(8,d,s)}var u=d.child;if(u!==null)u.return=d,fe=u;else for(;fe!==null;){d=fe;var p=d.sibling,h=d.return;if(ib(d),d===c){fe=null;break}if(p!==null){p.return=h,fe=p;break}fe=h}}}var x=s.alternate;if(x!==null){var b=x.child;if(b!==null){x.child=null;do{var S=b.sibling;b.sibling=null,b=S}while(b!==null)}}fe=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,fe=o;else e:for(;fe!==null;){if(s=fe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ha(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,fe=m;break e}fe=s.return}}var g=e.current;for(fe=g;fe!==null;){o=fe;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,fe=y;else e:for(o=g;fe!==null;){if(a=fe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ku(9,a)}}catch(k){rt(a,a.return,k)}if(a===o){fe=null;break e}var C=a.sibling;if(C!==null){C.return=a.return,fe=C;break e}fe=a.return}}if(Pe=i,ki(),or&&typeof or.onPostCommitFiberRoot=="function")try{or.onPostCommitFiberRoot(mu,e)}catch{}r=!0}return r}finally{Ie=n,jn.transition=t}}return!1}function Vv(e,t,n){t=vo(n,t),t=Gw(e,t,1),e=ui(e,t,1),t=zt(),e!==null&&(al(e,1,t),en(e,t))}function rt(e,t,n){if(e.tag===3)Vv(e,e,n);else for(;t!==null;){if(t.tag===3){Vv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(di===null||!di.has(r))){e=vo(n,e),e=Yw(t,e,1),t=ui(t,e,1),e=zt(),t!==null&&(al(t,1,e),en(t,e));break}}t=t.return}}function OT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=zt(),e.pingedLanes|=e.suspendedLanes&n,yt===e&&(Ct&n)===n&&(ht===4||ht===3&&(Ct&130023424)===Ct&&500>at()-am?Gi(e,0):om|=n),en(e,t)}function hb(e,t){t===0&&(e.mode&1?(t=Al,Al<<=1,!(Al&130023424)&&(Al=4194304)):t=1);var n=zt();e=Mr(e,t),e!==null&&(al(e,t,n),en(e,n))}function DT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hb(e,n)}function IT(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),hb(e,n)}var mb;mb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Xt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xt=!1,kT(e,t,n);Xt=!!(e.flags&131072)}else Xt=!1,Ye&&t.flags&1048576&&xw(t,Ic,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lc(e,t),e=t.pendingProps;var i=po(t,Nt.current);Ys(t,n),i=em(null,t,r,e,i,n);var s=tm();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,Jt(r)?(s=!0,Oc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Qh(t),i.updater=Su,t.stateNode=i,i._reactInternals=t,Kf(t,r,e,n),t=Jf(null,t,r,!0,s,n)):(t.tag=0,Ye&&s&&Vh(t),Bt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=FT(r),e=Fn(r,e),i){case 0:t=Zf(null,t,r,e,n);break e;case 1:t=Pv(null,t,r,e,n);break e;case 11:t=Rv(null,t,r,e,n);break e;case 14:t=Mv(null,t,r,Fn(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:Fn(r,i),Zf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),Pv(e,t,r,i,n);case 3:e:{if(Zw(t),e===null)throw Error(Q(387));r=t.pendingProps,s=t.memoizedState,i=s.element,_w(e,t),Bc(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=vo(Error(Q(423)),t),t=Nv(e,t,r,n,i);break e}else if(r!==i){i=vo(Error(Q(424)),t),t=Nv(e,t,r,n,i);break e}else for(ln=ci(t.stateNode.containerInfo.firstChild),dn=t,Ye=!0,Vn=null,n=kw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ho(),r===i){t=Pr(e,t,n);break e}Bt(e,t,r,n)}t=t.child}return t;case 5:return Tw(t),e===null&&Gf(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Vf(r,i)?o=null:s!==null&&Vf(r,s)&&(t.flags|=32),Xw(e,t),Bt(e,t,o,n),t.child;case 6:return e===null&&Gf(t),null;case 13:return Jw(e,t,n);case 4:return Kh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):Bt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),Rv(e,t,r,i,n);case 7:return Bt(e,t,t.pendingProps,n),t.child;case 8:return Bt(e,t,t.pendingProps.children,n),t.child;case 12:return Bt(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,Ve(Lc,r._currentValue),r._currentValue=o,s!==null)if(Yn(s.value,o)){if(s.children===i.children&&!Zt.current){t=Pr(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=Er(-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),Yf(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),Yf(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}Bt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ys(t,n),i=Mn(i),r=r(i),t.flags|=1,Bt(e,t,r,n),t.child;case 14:return r=t.type,i=Fn(r,t.pendingProps),i=Fn(r.type,i),Mv(e,t,r,i,n);case 15:return Qw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),lc(e,t),t.tag=1,Jt(r)?(e=!0,Oc(t)):e=!1,Ys(t,n),qw(t,r,i),Kf(t,r,i,n),Jf(null,t,r,!0,e,n);case 19:return eb(e,t,n);case 22:return Kw(e,t,n)}throw Error(Q(156,t.tag))};function gb(e,t){return U1(e,t)}function LT(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 En(e,t,n,r){return new LT(e,t,n,r)}function dm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function FT(e){if(typeof e=="function")return dm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rh)return 11;if(e===Mh)return 14}return 2}function pi(e,t){var n=e.alternate;return n===null?(n=En(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 dc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")dm(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ts:return Yi(n.children,i,s,t);case jh:o=8,i|=8;break;case wf:return e=En(12,n,t,i|2),e.elementType=wf,e.lanes=s,e;case bf:return e=En(13,n,t,i),e.elementType=bf,e.lanes=s,e;case Sf:return e=En(19,n,t,i),e.elementType=Sf,e.lanes=s,e;case T1:return _u(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case C1:o=10;break e;case _1:o=9;break e;case Rh:o=11;break e;case Mh:o=14;break e;case Vr:o=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=En(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Yi(e,t,n,r){return e=En(7,e,r,t),e.lanes=n,e}function _u(e,t,n,r){return e=En(22,e,r,t),e.elementType=T1,e.lanes=n,e.stateNode={isHidden:!1},e}function Od(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function Dd(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function BT(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=md(0),this.expirationTimes=md(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=md(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fm(e,t,n,r,i,s,o,a,l){return e=new BT(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=En(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qh(s),e}function $T(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_s,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function vb(e){if(!e)return vi;e=e._reactInternals;e:{if(us(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(Jt(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(Jt(n))return vw(e,n,t)}return t}function yb(e,t,n,r,i,s,o,a,l){return e=fm(n,r,!0,e,i,s,o,a,l),e.context=vb(null),n=e.current,r=zt(),i=fi(n),s=Er(r,i),s.callback=t??null,ui(n,s,i),e.current.lanes=i,al(e,i,r),en(e,r),e}function Tu(e,t,n,r){var i=t.current,s=zt(),o=fi(i);return n=vb(n),t.context===null?t.context=n:t.pendingContext=n,t=Er(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ui(i,t,o),e!==null&&(qn(e,i,o,s),sc(e,i,o)),o}function Gc(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 Uv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pm(e,t){Uv(e,t),(e=e.alternate)&&Uv(e,t)}function zT(){return null}var xb=typeof reportError=="function"?reportError:function(e){console.error(e)};function hm(e){this._internalRoot=e}Eu.prototype.render=hm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));Tu(e,t,null,null)};Eu.prototype.unmount=hm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ss(function(){Tu(null,e,null,null)}),t[Rr]=null}};function Eu(e){this._internalRoot=e}Eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=K1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wr.length&&t!==0&&t<Wr[n].priority;n++);Wr.splice(n,0,e),n===0&&Z1(e)}};function mm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Au(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Hv(){}function VT(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Gc(o);s.call(c)}}var o=yb(t,r,e,0,null,!1,!1,"",Hv);return e._reactRootContainer=o,e[Rr]=o.current,Pa(e.nodeType===8?e.parentNode:e),ss(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Gc(l);a.call(c)}}var l=fm(e,0,!1,null,null,!1,!1,"",Hv);return e._reactRootContainer=l,e[Rr]=l.current,Pa(e.nodeType===8?e.parentNode:e),ss(function(){Tu(t,l,n,r)}),l}function ju(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=Gc(o);a.call(l)}}Tu(t,o,e,i)}else o=VT(n,t,e,i,r);return Gc(o)}Y1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Jo(t.pendingLanes);n!==0&&(Oh(t,n|1),en(t,at()),!(Pe&6)&&(yo=at()+500,ki()))}break;case 13:ss(function(){var r=Mr(e,1);if(r!==null){var i=zt();qn(r,e,1,i)}}),pm(e,1)}};Dh=function(e){if(e.tag===13){var t=Mr(e,134217728);if(t!==null){var n=zt();qn(t,e,134217728,n)}pm(e,134217728)}};Q1=function(e){if(e.tag===13){var t=fi(e),n=Mr(e,t);if(n!==null){var r=zt();qn(n,e,t,r)}pm(e,t)}};K1=function(){return Ie};X1=function(e,t){var n=Ie;try{return Ie=e,t()}finally{Ie=n}};Pf=function(e,t,n){switch(t){case"input":if(_f(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=xu(r);if(!i)throw Error(Q(90));A1(r),_f(r,i)}}}break;case"textarea":R1(e,n);break;case"select":t=n.value,t!=null&&Hs(e,!!n.multiple,t,!1)}};L1=lm;F1=ss;var UT={usingClientEntryPoint:!1,Events:[cl,Rs,xu,D1,I1,lm]},qo={findFiberByHostInstance:Oi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},HT={bundleType:qo.bundleType,version:qo.version,rendererPackageName:qo.rendererPackageName,rendererConfig:qo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=z1(e),e===null?null:e.stateNode},findFiberByHostInstance:qo.findFiberByHostInstance||zT,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 Bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bl.isDisabled&&Bl.supportsFiber)try{mu=Bl.inject(HT),or=Bl}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=UT;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mm(t))throw Error(Q(200));return $T(e,t,null,n)};pn.createRoot=function(e,t){if(!mm(e))throw Error(Q(299));var n=!1,r="",i=xb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=fm(e,1,!1,null,null,n,!1,r,i),e[Rr]=t.current,Pa(e.nodeType===8?e.parentNode:e),new hm(t)};pn.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=z1(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return ss(e)};pn.hydrate=function(e,t,n){if(!Au(t))throw Error(Q(200));return ju(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!mm(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=xb;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=yb(t,null,e,1,n??null,i,!1,s,o),e[Rr]=t.current,Pa(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 Eu(t)};pn.render=function(e,t,n){if(!Au(t))throw Error(Q(200));return ju(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!Au(e))throw Error(Q(40));return e._reactRootContainer?(ss(function(){ju(null,null,e,!1,function(){e._reactRootContainer=null,e[Rr]=null})}),!0):!1};pn.unstable_batchedUpdates=lm;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Au(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return ju(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function wb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wb)}catch(e){console.error(e)}}wb(),w1.exports=pn;var bb=w1.exports;const WT=Ir(bb);var Sb,Wv=bb;Sb=Wv.createRoot,Wv.hydrateRoot;const qT="@alfatech/livechat",GT="v2026.04.29.1",YT="module",QT="https://api.chatier.app",KT="wss://api.chatier.app",XT=["dist","README.md","component/chatier.js"],ZT="dist/widget.js",JT={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},eE={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"},tE={"@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"},nE={"@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"},kb={name:qT,private:!1,version:GT,type:YT,apiURL:QT,wsURL:KT,files:XT,main:ZT,author:JT,scripts:eE,dependencies:tE,devDependencies:nE,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},Cb=kb.apiURL,rE=kb.wsURL,iE=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],sE=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],oE={429:iE,404:sE};async function pr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${Cb}/${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=oE[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 Gn=e=>[200,201,204].includes(e),aE=(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 Ro=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(){}},os=typeof window>"u"||"Deno"in globalThis;function kn(){}function lE(e,t){return typeof e=="function"?e(t):e}function dp(e){return typeof e=="number"&&e>=0&&e!==1/0}function _b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ks(e,t){return typeof e=="function"?e(t):e}function Un(e,t){return typeof e=="function"?e(t):e}function qv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==gm(o,t.options))return!1}else if(!za(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 Gv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(as(t.options.mutationKey)!==as(s))return!1}else if(!za(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function gm(e,t){return((t==null?void 0:t.queryKeyHashFn)||as)(e)}function as(e){return JSON.stringify(e,(t,n)=>fp(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function za(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!za(e[n],t[n])):!1}function Tb(e,t){if(e===t)return e;const n=Yv(e)&&Yv(t);if(n||fp(e)&&fp(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]=Tb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Yc(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 Yv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fp(e){if(!Qv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Qv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Qv(e){return Object.prototype.toString.call(e)==="[object Object]"}function cE(e){return new Promise(t=>{setTimeout(t,e)})}function pp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Tb(e,t):t}function uE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vm=Symbol();function Eb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===vm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var $i,Yr,Zs,Jx,fE=(Jx=class extends Ro{constructor(){super();ye(this,$i);ye(this,Yr);ye(this,Zs);de(this,Zs,t=>{if(!os&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,Yr)||this.setEventListener(T(this,Zs))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Yr))==null||t.call(this),de(this,Yr,void 0))}setEventListener(t){var n;de(this,Zs,t),(n=T(this,Yr))==null||n.call(this),de(this,Yr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,$i)!==t&&(de(this,$i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,$i)=="boolean"?T(this,$i):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$i=new WeakMap,Yr=new WeakMap,Zs=new WeakMap,Jx),ym=new fE,Js,Qr,eo,e1,pE=(e1=class extends Ro{constructor(){super();ye(this,Js,!0);ye(this,Qr);ye(this,eo);de(this,eo,t=>{if(!os&&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,Qr)||this.setEventListener(T(this,eo))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Qr))==null||t.call(this),de(this,Qr,void 0))}setEventListener(t){var n;de(this,eo,t),(n=T(this,Qr))==null||n.call(this),de(this,Qr,t(this.setOnline.bind(this)))}setOnline(t){T(this,Js)!==t&&(de(this,Js,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,Js)}},Js=new WeakMap,Qr=new WeakMap,eo=new WeakMap,e1),Qc=new pE;function hp(){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 hE(e){return Math.min(1e3*2**e,3e4)}function Ab(e){return(e??"online")==="online"?Qc.isOnline():!0}var jb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Id(e){return e instanceof jb}function Rb(e){let t=!1,n=0,r=!1,i;const s=hp(),o=b=>{var S;r||(p(new jb(b)),(S=e.abort)==null||S.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>ym.isFocused()&&(e.networkMode==="always"||Qc.isOnline())&&e.canRun(),d=()=>Ab(e.networkMode)&&e.canRun(),u=b=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,b),i==null||i(),s.resolve(b))},p=b=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,b),i==null||i(),s.reject(b))},h=()=>new Promise(b=>{var S;i=m=>{(r||c())&&b(m)},(S=e.onPause)==null||S.call(e)}).then(()=>{var b;i=void 0,r||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(r)return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(m){b=Promise.reject(m)}Promise.resolve(b).then(u).catch(m=>{var _;if(r)return;const g=e.retry??(os?0:3),y=e.retryDelay??hE,C=typeof y=="function"?y(n,m):y,k=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,m);if(t||!k){p(m);return}n++,(_=e.onFail)==null||_.call(e,n,m),cE(C).then(()=>c()?void 0:h()).then(()=>{t?p(m):x()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?x():h().then(x),s)}}function mE(){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 pt=mE(),zi,t1,Mb=(t1=class{constructor(){ye(this,zi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dp(this.gcTime)&&de(this,zi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(os?1/0:5*60*1e3))}clearGcTimeout(){T(this,zi)&&(clearTimeout(T(this,zi)),de(this,zi,void 0))}},zi=new WeakMap,t1),to,no,Sn,jt,nl,Vi,Bn,wr,n1,gE=(n1=class extends Mb{constructor(t){super();ye(this,Bn);ye(this,to);ye(this,no);ye(this,Sn);ye(this,jt);ye(this,nl);ye(this,Vi);de(this,Vi,!1),de(this,nl,t.defaultOptions),this.setOptions(t.options),this.observers=[],de(this,Sn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,de(this,to,vE(this.options)),this.state=t.state??T(this,to),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,jt))==null?void 0:t.promise}setOptions(t){this.options={...T(this,nl),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,Sn).remove(this)}setData(t,n){const r=pp(this.state.data,t,this.options);return Te(this,Bn,wr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Te(this,Bn,wr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=T(this,jt))==null?void 0:r.promise;return(i=T(this,jt))==null||i.cancel(t),n?n.then(kn).catch(kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,to))}isActive(){return this.observers.some(t=>Un(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===vm||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||!_b(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,jt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,jt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,Sn).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,jt)&&(T(this,Vi)?T(this,jt).cancel({revert:!0}):T(this,jt).cancelRetry()),this.scheduleGc()),T(this,Sn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,Bn,wr).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,jt))return T(this,jt).continueRetry(),T(this,jt).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:()=>(de(this,Vi,!0),r.signal)})},s=()=>{const u=Eb(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),de(this,Vi,!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),de(this,no,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&Te(this,Bn,wr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,h,x,b;Id(u)&&u.silent||Te(this,Bn,wr).call(this,{type:"error",error:u}),Id(u)||((h=(p=T(this,Sn).config).onError)==null||h.call(p,u,this),(b=(x=T(this,Sn).config).onSettled)==null||b.call(x,this.state.data,u,this)),this.scheduleGc()};return de(this,jt,Rb({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var p,h,x,b;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(S){a(S);return}(h=(p=T(this,Sn).config).onSuccess)==null||h.call(p,u,this),(b=(x=T(this,Sn).config).onSettled)==null||b.call(x,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{Te(this,Bn,wr).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{Te(this,Bn,wr).call(this,{type:"pause"})},onContinue:()=>{Te(this,Bn,wr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),T(this,jt).start()}},to=new WeakMap,no=new WeakMap,Sn=new WeakMap,jt=new WeakMap,nl=new WeakMap,Vi=new WeakMap,Bn=new WeakSet,wr=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,...Pb(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 Id(i)&&i.revert&&T(this,no)?{...T(this,no),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),pt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,Sn).notify({query:this,type:"updated",action:t})})},n1);function Pb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ab(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function vE(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 tr,r1,yE=(r1=class extends Ro{constructor(t={}){super();ye(this,tr);this.config=t,de(this,tr,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??gm(i,n);let o=this.get(s);return o||(o=new gE({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){T(this,tr).has(t.queryHash)||(T(this,tr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,tr).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,tr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,tr).get(t)}getAll(){return[...T(this,tr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>qv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>qv(t,r)):n}notify(t){pt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},tr=new WeakMap,r1),nr,Lt,Ui,rr,$r,i1,xE=(i1=class extends Mb{constructor(t){super();ye(this,rr);ye(this,nr);ye(this,Lt);ye(this,Ui);this.mutationId=t.mutationId,de(this,Lt,t.mutationCache),de(this,nr,[]),this.state=t.state||Nb(),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,nr).includes(t)||(T(this,nr).push(t),this.clearGcTimeout(),T(this,Lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){de(this,nr,T(this,nr).filter(n=>n!==t)),this.scheduleGc(),T(this,Lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,nr).length||(this.state.status==="pending"?this.scheduleGc():T(this,Lt).remove(this))}continue(){var t;return((t=T(this,Ui))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,p,h,x,b,S,m,g,y,C,k,_,E;de(this,Ui,Rb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,V)=>{Te(this,rr,$r).call(this,{type:"failed",failureCount:A,error:V})},onPause:()=>{Te(this,rr,$r).call(this,{type:"pause"})},onContinue:()=>{Te(this,rr,$r).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Lt).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Ui).canStart();try{if(!n){Te(this,rr,$r).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=T(this,Lt).config).onMutate)==null?void 0:s.call(i,t,this));const V=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));V!==this.state.context&&Te(this,rr,$r).call(this,{type:"pending",context:V,variables:t,isPaused:r})}const A=await T(this,Ui).start();return await((c=(l=T(this,Lt).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,Lt).config).onSettled)==null?void 0:h.call(p,A,null,this.state.variables,this.state.context,this)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,A,null,t,this.state.context)),Te(this,rr,$r).call(this,{type:"success",data:A}),A}catch(A){try{throw await((m=(S=T(this,Lt).config).onError)==null?void 0:m.call(S,A,t,this.state.context,this)),await((y=(g=this.options).onError)==null?void 0:y.call(g,A,t,this.state.context)),await((k=(C=T(this,Lt).config).onSettled)==null?void 0:k.call(C,void 0,A,this.state.variables,this.state.context,this)),await((E=(_=this.options).onSettled)==null?void 0:E.call(_,void 0,A,t,this.state.context)),A}finally{Te(this,rr,$r).call(this,{type:"error",error:A})}}finally{T(this,Lt).runNext(this)}}},nr=new WeakMap,Lt=new WeakMap,Ui=new WeakMap,rr=new WeakSet,$r=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),pt.batch(()=>{T(this,nr).forEach(r=>{r.onMutationUpdate(t)}),T(this,Lt).notify({mutation:this,type:"updated",action:t})})},i1);function Nb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nn,rl,s1,wE=(s1=class extends Ro{constructor(t={}){super();ye(this,nn);ye(this,rl);this.config=t,de(this,nn,new Map),de(this,rl,Date.now())}build(t,n,r){const i=new xE({mutationCache:this,mutationId:++Sl(this,rl)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=$l(t),r=T(this,nn).get(n)??[];r.push(t),T(this,nn).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=$l(t);if(T(this,nn).has(n)){const i=(r=T(this,nn).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?T(this,nn).delete(n):T(this,nn).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=T(this,nn).get($l(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=T(this,nn).get($l(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...T(this,nn).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Gv(n,r))}findAll(t={}){return this.getAll().filter(n=>Gv(t,n))}notify(t){pt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pt.batch(()=>Promise.all(t.map(n=>n.continue().catch(kn))))}},nn=new WeakMap,rl=new WeakMap,s1);function $l(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Kv(e){return{onFetch:(t,n)=>{var d,u,p,h,x;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=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const S=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},m=Eb(t.options,t.fetchOptions),g=async(y,C,k)=>{if(b)return Promise.reject();if(C==null&&y.pages.length)return Promise.resolve(y);const _={queryKey:t.queryKey,pageParam:C,direction:k?"backward":"forward",meta:t.options.meta};S(_);const E=await m(_),{maxPages:A}=t.options,V=k?dE:uE;return{pages:V(y.pages,E,A),pageParams:V(y.pageParams,C,A)}};if(i&&s.length){const y=i==="backward",C=y?bE:Xv,k={pages:s,pageParams:o},_=C(r,k);a=await g(k,_,y)}else{const y=e??s.length;do{const C=l===0?o[0]??r.initialPageParam:Xv(r,a);if(l>0&&C==null)break;a=await g(a,C),l++}while(l<y)}return a};t.options.persister?t.fetchFn=()=>{var b,S;return(S=(b=t.options).persister)==null?void 0:S.call(b,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Xv(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 bE(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 tt,Kr,Xr,ro,io,Zr,so,oo,o1,SE=(o1=class{constructor(e={}){ye(this,tt);ye(this,Kr);ye(this,Xr);ye(this,ro);ye(this,io);ye(this,Zr);ye(this,so);ye(this,oo);de(this,tt,e.queryCache||new yE),de(this,Kr,e.mutationCache||new wE),de(this,Xr,e.defaultOptions||{}),de(this,ro,new Map),de(this,io,new Map),de(this,Zr,0)}mount(){Sl(this,Zr)._++,T(this,Zr)===1&&(de(this,so,ym.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,tt).onFocus())})),de(this,oo,Qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,tt).onOnline())})))}unmount(){var e,t;Sl(this,Zr)._--,T(this,Zr)===0&&((e=T(this,so))==null||e.call(this),de(this,so,void 0),(t=T(this,oo))==null||t.call(this),de(this,oo,void 0))}isFetching(e){return T(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,Kr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,tt).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,tt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Ks(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return T(this,tt).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,tt).get(r.queryHash),s=i==null?void 0:i.state.data,o=lE(t,s);if(o!==void 0)return T(this,tt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return pt.batch(()=>T(this,tt).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,tt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,tt);pt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,tt),r={type:"active",...e};return pt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=pt.batch(()=>T(this,tt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(kn).catch(kn)}invalidateQueries(e,t={}){return pt.batch(()=>{if(T(this,tt).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=pt.batch(()=>T(this,tt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(kn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,tt).build(this,t);return n.isStaleByTime(Ks(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kn).catch(kn)}fetchInfiniteQuery(e){return e.behavior=Kv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e.behavior=Kv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qc.isOnline()?T(this,Kr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,tt)}getMutationCache(){return T(this,Kr)}getDefaultOptions(){return T(this,Xr)}setDefaultOptions(e){de(this,Xr,e)}setQueryDefaults(e,t){T(this,ro).set(as(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,ro).values()],n={};return t.forEach(r=>{za(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,io).set(as(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,io).values()];let n={};return t.forEach(r=>{za(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,Xr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gm(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===vm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,Xr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,tt).clear(),T(this,Kr).clear()}},tt=new WeakMap,Kr=new WeakMap,Xr=new WeakMap,ro=new WeakMap,io=new WeakMap,Zr=new WeakMap,so=new WeakMap,oo=new WeakMap,o1),qt,Re,il,Ft,Hi,ao,Jr,ir,sl,lo,co,Wi,qi,ei,uo,De,ta,mp,gp,vp,yp,xp,wp,bp,Ob,a1,kE=(a1=class extends Ro{constructor(t,n){super();ye(this,De);ye(this,qt);ye(this,Re);ye(this,il);ye(this,Ft);ye(this,Hi);ye(this,ao);ye(this,Jr);ye(this,ir);ye(this,sl);ye(this,lo);ye(this,co);ye(this,Wi);ye(this,qi);ye(this,ei);ye(this,uo,new Set);this.options=n,de(this,qt,t),de(this,ir,null),de(this,Jr,hp()),this.options.experimental_prefetchInRender||T(this,Jr).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,Re).addObserver(this),Zv(T(this,Re),this.options)?Te(this,De,ta).call(this):this.updateResult(),Te(this,De,yp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sp(T(this,Re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sp(T(this,Re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,De,xp).call(this),Te(this,De,wp).call(this),T(this,Re).removeObserver(this)}setOptions(t,n){const r=this.options,i=T(this,Re);if(this.options=T(this,qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Un(this.options.enabled,T(this,Re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,De,bp).call(this),T(this,Re).setOptions(this.options),r._defaulted&&!Yc(this.options,r)&&T(this,qt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Re),observer:this});const s=this.hasListeners();s&&Jv(T(this,Re),i,this.options,r)&&Te(this,De,ta).call(this),this.updateResult(n),s&&(T(this,Re)!==i||Un(this.options.enabled,T(this,Re))!==Un(r.enabled,T(this,Re))||Ks(this.options.staleTime,T(this,Re))!==Ks(r.staleTime,T(this,Re)))&&Te(this,De,mp).call(this);const o=Te(this,De,gp).call(this);s&&(T(this,Re)!==i||Un(this.options.enabled,T(this,Re))!==Un(r.enabled,T(this,Re))||o!==T(this,ei))&&Te(this,De,vp).call(this,o)}getOptimisticResult(t){const n=T(this,qt).getQueryCache().build(T(this,qt),t),r=this.createResult(n,t);return _E(this,r)&&(de(this,Ft,r),de(this,ao,this.options),de(this,Hi,T(this,Re).state)),r}getCurrentResult(){return T(this,Ft)}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,uo).add(t)}getCurrentQuery(){return T(this,Re)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,qt).defaultQueryOptions(t),r=T(this,qt).getQueryCache().build(T(this,qt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Te(this,De,ta).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Ft)))}createResult(t,n){var A;const r=T(this,Re),i=this.options,s=T(this,Ft),o=T(this,Hi),a=T(this,ao),c=t!==r?t.state:T(this,il),{state:d}=t;let u={...d},p=!1,h;if(n._optimisticResults){const V=this.hasListeners(),D=!V&&Zv(t,n),I=V&&Jv(t,r,n,i);(D||I)&&(u={...u,...Pb(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:S}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===T(this,sl))h=T(this,lo);else try{de(this,sl,n.select),h=n.select(u.data),h=pp(s==null?void 0:s.data,h,n),de(this,lo,h),de(this,ir,null)}catch(V){de(this,ir,V)}else h=u.data;if(n.placeholderData!==void 0&&h===void 0&&S==="pending"){let V;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))V=s.data;else if(V=typeof n.placeholderData=="function"?n.placeholderData((A=T(this,co))==null?void 0:A.state.data,T(this,co)):n.placeholderData,n.select&&V!==void 0)try{V=n.select(V),de(this,ir,null)}catch(D){de(this,ir,D)}V!==void 0&&(S="success",h=pp(s==null?void 0:s.data,V,n),p=!0)}T(this,ir)&&(x=T(this,ir),h=T(this,lo),b=Date.now(),S="error");const m=u.fetchStatus==="fetching",g=S==="pending",y=S==="error",C=g&&m,k=h!==void 0,E={status:S,fetchStatus:u.fetchStatus,isPending:g,isSuccess:S==="success",isError:y,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:u.dataUpdatedAt,error:x,errorUpdatedAt:b,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:y&&!k,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:y&&k,isStale:xm(t,n),refetch:this.refetch,promise:T(this,Jr)};if(this.options.experimental_prefetchInRender){const V=O=>{E.status==="error"?O.reject(E.error):E.data!==void 0&&O.resolve(E.data)},D=()=>{const O=de(this,Jr,E.promise=hp());V(O)},I=T(this,Jr);switch(I.status){case"pending":t.queryHash===r.queryHash&&V(I);break;case"fulfilled":(E.status==="error"||E.data!==I.value)&&D();break;case"rejected":(E.status!=="error"||E.error!==I.reason)&&D();break}}return E}updateResult(t){const n=T(this,Ft),r=this.createResult(T(this,Re),this.options);if(de(this,Hi,T(this,Re).state),de(this,ao,this.options),T(this,Hi).data!==void 0&&de(this,co,T(this,Re)),Yc(r,n))return;de(this,Ft,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,uo).size)return!0;const l=new Set(a??T(this,uo));return this.options.throwOnError&&l.add("error"),Object.keys(T(this,Ft)).some(c=>{const d=c;return T(this,Ft)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),Te(this,De,Ob).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,De,yp).call(this)}},qt=new WeakMap,Re=new WeakMap,il=new WeakMap,Ft=new WeakMap,Hi=new WeakMap,ao=new WeakMap,Jr=new WeakMap,ir=new WeakMap,sl=new WeakMap,lo=new WeakMap,co=new WeakMap,Wi=new WeakMap,qi=new WeakMap,ei=new WeakMap,uo=new WeakMap,De=new WeakSet,ta=function(t){Te(this,De,bp).call(this);let n=T(this,Re).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kn)),n},mp=function(){Te(this,De,xp).call(this);const t=Ks(this.options.staleTime,T(this,Re));if(os||T(this,Ft).isStale||!dp(t))return;const r=_b(T(this,Ft).dataUpdatedAt,t)+1;de(this,Wi,setTimeout(()=>{T(this,Ft).isStale||this.updateResult()},r))},gp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Re)):this.options.refetchInterval)??!1},vp=function(t){Te(this,De,wp).call(this),de(this,ei,t),!(os||Un(this.options.enabled,T(this,Re))===!1||!dp(T(this,ei))||T(this,ei)===0)&&de(this,qi,setInterval(()=>{(this.options.refetchIntervalInBackground||ym.isFocused())&&Te(this,De,ta).call(this)},T(this,ei)))},yp=function(){Te(this,De,mp).call(this),Te(this,De,vp).call(this,Te(this,De,gp).call(this))},xp=function(){T(this,Wi)&&(clearTimeout(T(this,Wi)),de(this,Wi,void 0))},wp=function(){T(this,qi)&&(clearInterval(T(this,qi)),de(this,qi,void 0))},bp=function(){const t=T(this,qt).getQueryCache().build(T(this,qt),this.options);if(t===T(this,Re))return;const n=T(this,Re);de(this,Re,t),de(this,il,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Ob=function(t){pt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,Ft))}),T(this,qt).getQueryCache().notify({query:T(this,Re),type:"observerResultsUpdated"})})},a1);function CE(e,t){return Un(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zv(e,t){return CE(e,t)||e.state.data!==void 0&&Sp(e,t,t.refetchOnMount)}function Sp(e,t,n){if(Un(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&xm(e,t)}return!1}function Jv(e,t,n,r){return(e!==t||Un(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&xm(e,n)}function xm(e,t){return Un(t.enabled,e)!==!1&&e.isStaleByTime(Ks(t.staleTime,e))}function _E(e,t){return!Yc(e.getCurrentResult(),t)}var ti,ni,Gt,Cr,Ar,fc,kp,l1,TE=(l1=class extends Ro{constructor(t,n){super();ye(this,Ar);ye(this,ti);ye(this,ni);ye(this,Gt);ye(this,Cr);de(this,ti,t),this.setOptions(n),this.bindMethods(),Te(this,Ar,fc).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,ti).defaultMutationOptions(t),Yc(this.options,n)||T(this,ti).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Gt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&as(n.mutationKey)!==as(this.options.mutationKey)?this.reset():((r=T(this,Gt))==null?void 0:r.state.status)==="pending"&&T(this,Gt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=T(this,Gt))==null||t.removeObserver(this)}onMutationUpdate(t){Te(this,Ar,fc).call(this),Te(this,Ar,kp).call(this,t)}getCurrentResult(){return T(this,ni)}reset(){var t;(t=T(this,Gt))==null||t.removeObserver(this),de(this,Gt,void 0),Te(this,Ar,fc).call(this),Te(this,Ar,kp).call(this)}mutate(t,n){var r;return de(this,Cr,n),(r=T(this,Gt))==null||r.removeObserver(this),de(this,Gt,T(this,ti).getMutationCache().build(T(this,ti),this.options)),T(this,Gt).addObserver(this),T(this,Gt).execute(t)}},ti=new WeakMap,ni=new WeakMap,Gt=new WeakMap,Cr=new WeakMap,Ar=new WeakSet,fc=function(){var n;const t=((n=T(this,Gt))==null?void 0:n.state)??Nb();de(this,ni,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},kp=function(t){pt.batch(()=>{var n,r,i,s,o,a,l,c;if(T(this,Cr)&&this.hasListeners()){const d=T(this,ni).variables,u=T(this,ni).context;(t==null?void 0:t.type)==="success"?((r=(n=T(this,Cr)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=T(this,Cr)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=T(this,Cr)).onError)==null||a.call(o,t.error,d,u),(c=(l=T(this,Cr)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(T(this,ni))})})},l1),Db=v.createContext(void 0),wm=e=>{const t=v.useContext(Db);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},EE=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Db.Provider,{value:e,children:t})),Ib=v.createContext(!1),AE=()=>v.useContext(Ib);Ib.Provider;function jE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var RE=v.createContext(jE()),ME=()=>v.useContext(RE);function Lb(e,t){return typeof e=="function"?e(...t):!!e}function Cp(){}var PE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},NE=e=>{v.useEffect(()=>{e.clearReset()},[e])},OE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Lb(n,[e.error,r]),DE=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},IE=(e,t)=>e.isLoading&&e.isFetching&&!t,LE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,e0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function FE(e,t,n){var d,u,p,h,x;const r=wm(),i=AE(),s=ME(),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",DE(o),PE(o,s),NE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(b=>{const S=i?Cp:l.subscribe(pt.batchCalls(b));return l.updateResult(),S},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),LE(o,c))throw e0(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&&!os&&IE(c,i)){const b=a?e0(o,l,s):(x=r.getQueryCache().get(o.queryHash))==null?void 0:x.promise;b==null||b.catch(Cp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function bm(e,t){return FE(e,kE)}function Sm(e,t){const n=wm(),[r]=v.useState(()=>new TE(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(pt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(Cp)},[r]);if(i.error&&Lb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const BE=(e,t)=>bm({queryKey:["widgets",e,t],queryFn:()=>$E(e,t),retry:!1,throwOnError:!1}),$E=async(e,t)=>{const n=`widgets/with-link/${e}${t?`?device_id=${t}`:""}`,[r,i]=await pr(n);if(i===204)throw new Error("User is banned");return r};var w=(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))(w||{}),re=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.TooltipBalloonTitle="tooltip_balloon_title",e.TooltipBalloonSub="tooltip_balloon_sub",e.TooltipBalloonGreeting="tooltip_balloon_greeting",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.MinimizedUnreadMessage="minimized_unread_message",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||{}),Be=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(Be||{});function zE(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 Pd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var bT=typeof WeakMap=="function"?WeakMap:Map;function Gw(e,t,n){n=Er(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hc||(Hc=!0,ap=r),Xf(e,t)},n}function Yw(e,t,n){n=Er(-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(){Xf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Xf(e,t),typeof r!="function"&&(di===null?di=new Set([this]):di.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Ev(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new bT;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=DT.bind(null,e,t,n),t.then(e,e))}function Av(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 jv(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=Er(-1,1),t.tag=2,ui(n,t,1))),n.lanes|=1),e)}var ST=Lr.ReactCurrentOwner,Xt=!1;function Bt(e,t,n,r){t.child=e===null?kw(t,null,n,r):mo(t,e.child,n,r)}function Rv(e,t,n,r,i){n=n.render;var s=t.ref;return Ys(t,i),r=em(e,t,n,r,s,i),n=tm(),e!==null&&!Xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Pr(e,t,i)):(Ye&&n&&Vh(t),t.flags|=1,Bt(e,t,r,i),t.child)}function Mv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!dm(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Qw(e,t,s,r,i)):(e=dc(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:Ma,n(o,r)&&e.ref===t.ref)return Pr(e,t,i)}return t.flags|=1,e=pi(s,r),e.ref=t.ref,e.return=t,t.child=e}function Qw(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(Ma(s,r)&&e.ref===t.ref)if(Xt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Xt=!0);else return t.lanes=e.lanes,Pr(e,t,i)}return Zf(e,t,n,r,i)}function Kw(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},Ve(Is,sn),sn|=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,Ve(Is,sn),sn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Ve(Is,sn),sn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Ve(Is,sn),sn|=r;return Bt(e,t,i,n),t.child}function Xw(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=Jt(n)?ts:Nt.current;return s=po(t,s),Ys(t,i),n=em(e,t,n,r,s,i),r=tm(),e!==null&&!Xt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Pr(e,t,i)):(Ye&&r&&Vh(t),t.flags|=1,Bt(e,t,n,i),t.child)}function Pv(e,t,n,r,i){if(Jt(n)){var s=!0;Oc(t)}else s=!1;if(Ys(t,i),t.stateNode===null)lc(e,t),qw(t,n,r),Kf(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=Mn(c):(c=Jt(n)?ts:Nt.current,c=po(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)&&Tv(t,o,r,c),Ur=!1;var p=t.memoizedState;o.state=p,Bc(t,r,o,i),l=t.memoizedState,a!==r||p!==l||Zt.current||Ur?(typeof d=="function"&&(Qf(t,n,d,r),l=t.memoizedState),(a=Ur||_v(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,_w(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Fn(t.type,a),o.props=c,u=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Mn(l):(l=Jt(n)?ts:Nt.current,l=po(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)&&Tv(t,o,r,l),Ur=!1,p=t.memoizedState,o.state=p,Bc(t,r,o,i);var x=t.memoizedState;a!==u||p!==x||Zt.current||Ur?(typeof h=="function"&&(Qf(t,n,h,r),x=t.memoizedState),(c=Ur||_v(t,n,c,r,p,x,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,x,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,x,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=x),o.props=r,o.state=x,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 Jf(e,t,n,r,s,i)}function Jf(e,t,n,r,i,s){Xw(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&vv(t,n,!1),Pr(e,t,s);r=t.stateNode,ST.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=mo(t,e.child,null,s),t.child=mo(t,null,a,s)):Bt(e,t,a,s),t.memoizedState=r.state,i&&vv(t,n,!0),t.child}function Zw(e){var t=e.stateNode;t.pendingContext?gv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gv(e,t.context,!1),Kh(e,t.containerInfo)}function Nv(e,t,n,r,i){return ho(),Hh(i),t.flags|=256,Bt(e,t,n,r),t.child}var ep={dehydrated:null,treeContext:null,retryLane:0};function tp(e){return{baseLanes:e,cachePool:null,transitions:null}}function Jw(e,t,n){var r=t.pendingProps,i=Ke.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),Ve(Ke,i&1),e===null)return Gf(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=_u(o,r,0,null),e=Yi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=tp(n),t.memoizedState=ep,e):im(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return kT(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=pi(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=pi(a,s):(s=Yi(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?tp(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=ep,r}return s=e.child,e=s.sibling,r=pi(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 im(e,t){return t=_u({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Il(e,t,n,r){return r!==null&&Hh(r),mo(t,e.child,null,n),e=im(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kT(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Pd(Error(Q(422))),Il(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=_u({mode:"visible",children:r.children},i,0,null),s=Yi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&mo(t,e.child,null,o),t.child.memoizedState=tp(o),t.memoizedState=ep,s);if(!(t.mode&1))return Il(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=Pd(s,r,void 0),Il(e,t,o,r)}if(a=(o&e.childLanes)!==0,Xt||a){if(r=yt,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,Mr(e,i),qn(r,e,i,-1))}return um(),r=Pd(Error(Q(421))),Il(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=IT.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,ln=ci(i.nextSibling),dn=t,Ye=!0,Vn=null,e!==null&&(Cn[_n++]=_r,Cn[_n++]=Tr,Cn[_n++]=ns,_r=e.id,Tr=e.overflow,ns=t),t=im(t,r.children),t.flags|=4096,t)}function Ov(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Yf(e.return,t,n)}function Nd(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 eb(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Bt(e,t,r.children,n),r=Ke.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&&Ov(e,n,t);else if(e.tag===19)Ov(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(Ve(Ke,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&&$c(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Nd(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&&$c(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Nd(t,!0,n,null,s);break;case"together":Nd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function lc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),is|=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=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function CT(e,t,n){switch(t.tag){case 3:Zw(t),ho();break;case 5:Tw(t);break;case 1:Jt(t.type)&&Oc(t);break;case 4:Kh(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ve(Lc,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ve(Ke,Ke.current&1),t.flags|=128,null):n&t.child.childLanes?Jw(e,t,n):(Ve(Ke,Ke.current&1),e=Pr(e,t,n),e!==null?e.sibling:null);Ve(Ke,Ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return eb(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ve(Ke,Ke.current),r)break;return null;case 22:case 23:return t.lanes=0,Kw(e,t,n)}return Pr(e,t,n)}var tb,np,nb,rb;tb=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}};np=function(){};nb=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Ii(ar.current);var s=null;switch(n){case"input":i=Cf(e,i),r=Cf(e,r),s=[];break;case"select":i=Je({},i,{value:void 0}),r=Je({},r,{value:void 0}),s=[];break;case"textarea":i=Ef(e,i),r=Ef(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pc)}jf(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"&&(Ca.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"&&(Ca.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&He("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)}};rb=function(e,t,n,r){n!==r&&(t.flags|=4)};function Wo(e,t){if(!Ye)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 At(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 _T(e,t,n){var r=t.pendingProps;switch(Uh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(t),null;case 1:return Jt(t.type)&&Nc(),At(t),null;case 3:return r=t.stateNode,go(),Ge(Zt),Ge(Nt),Zh(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ol(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vn!==null&&(up(Vn),Vn=null))),np(e,t),At(t),null;case 5:Xh(t);var i=Ii(Ia.current);if(n=t.type,e!==null&&t.stateNode!=null)nb(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 At(t),null}if(e=Ii(ar.current),Ol(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[sr]=t,r[Oa]=s,e=(t.mode&1)!==0,n){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(i=0;i<ea.length;i++)He(ea[i],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":Ug(r,s),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},He("invalid",r);break;case"textarea":Wg(r,s),He("invalid",r)}jf(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&&Nl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Nl(r.textContent,a,e),i=["children",""+a]):Ca.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&He("scroll",r)}switch(n){case"input":_l(r),Hg(r,s,!0);break;case"textarea":_l(r),qg(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Pc)}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=M1(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[sr]=t,e[Oa]=r,tb(e,t,!1,!1),t.stateNode=e;e:{switch(o=Rf(n,r),n){case"dialog":He("cancel",e),He("close",e),i=r;break;case"iframe":case"object":case"embed":He("load",e),i=r;break;case"video":case"audio":for(i=0;i<ea.length;i++)He(ea[i],e);i=r;break;case"source":He("error",e),i=r;break;case"img":case"image":case"link":He("error",e),He("load",e),i=r;break;case"details":He("toggle",e),i=r;break;case"input":Ug(e,r),i=Cf(e,r),He("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Je({},r,{value:void 0}),He("invalid",e);break;case"textarea":Wg(e,r),i=Ef(e,r),He("invalid",e);break;default:i=r}jf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?O1(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&P1(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&_a(e,l):typeof l=="number"&&_a(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ca.hasOwnProperty(s)?l!=null&&s==="onScroll"&&He("scroll",e):l!=null&&Ah(e,s,l,o))}switch(n){case"input":_l(e),Hg(e,r,!1);break;case"textarea":_l(e),qg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+gi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Hs(e,!!r.multiple,s,!1):r.defaultValue!=null&&Hs(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Pc)}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 At(t),null;case 6:if(e&&t.stateNode!=null)rb(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Q(166));if(n=Ii(Ia.current),Ii(ar.current),Ol(t)){if(r=t.stateNode,n=t.memoizedProps,r[sr]=t,(s=r.nodeValue!==n)&&(e=dn,e!==null))switch(e.tag){case 3:Nl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[sr]=t,t.stateNode=r}return At(t),null;case 13:if(Ge(Ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ye&&ln!==null&&t.mode&1&&!(t.flags&128))bw(),ho(),t.flags|=98560,s=!1;else if(s=Ol(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[sr]=t}else ho(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;At(t),s=!1}else Vn!==null&&(up(Vn),Vn=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||Ke.current&1?ht===0&&(ht=3):um())),t.updateQueue!==null&&(t.flags|=4),At(t),null);case 4:return go(),np(e,t),e===null&&Pa(t.stateNode.containerInfo),At(t),null;case 10:return Gh(t.type._context),At(t),null;case 17:return Jt(t.type)&&Nc(),At(t),null;case 19:if(Ge(Ke),s=t.memoizedState,s===null)return At(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)Wo(s,!1);else{if(ht!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=$c(e),o!==null){for(t.flags|=128,Wo(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 Ve(Ke,Ke.current&1|2),t.child}e=e.sibling}s.tail!==null&&at()>yo&&(t.flags|=128,r=!0,Wo(s,!1),t.lanes=4194304)}else{if(!r)if(e=$c(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Ye)return At(t),null}else 2*at()-s.renderingStartTime>yo&&n!==1073741824&&(t.flags|=128,r=!0,Wo(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=at(),t.sibling=null,n=Ke.current,Ve(Ke,r?n&1|2:n&1),t):(At(t),null);case 22:case 23:return cm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?sn&1073741824&&(At(t),t.subtreeFlags&6&&(t.flags|=8192)):At(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function TT(e,t){switch(Uh(t),t.tag){case 1:return Jt(t.type)&&Nc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return go(),Ge(Zt),Ge(Nt),Zh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Xh(t),null;case 13:if(Ge(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));ho()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ge(Ke),null;case 4:return go(),null;case 10:return Gh(t.type._context),null;case 22:case 23:return cm(),null;case 24:return null;default:return null}}var Ll=!1,Mt=!1,ET=typeof WeakSet=="function"?WeakSet:Set,fe=null;function Ds(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){rt(e,t,r)}else n.current=null}function rp(e,t,n){try{n()}catch(r){rt(e,t,r)}}var Dv=!1;function AT(e,t){if($f=jc,e=lw(),zh(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(zf={focusedElem:e,selectionRange:n},jc=!1,fe=t;fe!==null;)if(t=fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,fe=e;else for(;fe!==null;){t=fe;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var b=x.memoizedProps,S=x.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?b:Fn(t.type,b),S);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Q(163))}}catch(k){rt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,fe=e;break}fe=t.return}return x=Dv,Dv=!1,x}function ha(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&&rp(t,n,s)}i=i.next}while(i!==r)}}function ku(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 ip(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 ib(e){var t=e.alternate;t!==null&&(e.alternate=null,ib(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[sr],delete t[Oa],delete t[Hf],delete t[uT],delete t[dT])),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 sb(e){return e.tag===5||e.tag===3||e.tag===4}function Iv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sb(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 sp(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=Pc));else if(r!==4&&(e=e.child,e!==null))for(sp(e,t,n),e=e.sibling;e!==null;)sp(e,t,n),e=e.sibling}function op(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(op(e,t,n),e=e.sibling;e!==null;)op(e,t,n),e=e.sibling}var St=null,$n=!1;function Br(e,t,n){for(n=n.child;n!==null;)ob(e,t,n),n=n.sibling}function ob(e,t,n){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(mu,n)}catch{}switch(n.tag){case 5:Mt||Ds(n,t);case 6:var r=St,i=$n;St=null,Br(e,t,n),St=r,$n=i,St!==null&&($n?(e=St,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):St.removeChild(n.stateNode));break;case 18:St!==null&&($n?(e=St,n=n.stateNode,e.nodeType===8?Td(e.parentNode,n):e.nodeType===1&&Td(e,n),ja(e)):Td(St,n.stateNode));break;case 4:r=St,i=$n,St=n.stateNode.containerInfo,$n=!0,Br(e,t,n),St=r,$n=i;break;case 0:case 11:case 14:case 15:if(!Mt&&(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)&&rp(n,t,o),i=i.next}while(i!==r)}Br(e,t,n);break;case 1:if(!Mt&&(Ds(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){rt(n,t,a)}Br(e,t,n);break;case 21:Br(e,t,n);break;case 22:n.mode&1?(Mt=(r=Mt)||n.memoizedState!==null,Br(e,t,n),Mt=r):Br(e,t,n);break;default:Br(e,t,n)}}function Lv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ET),t.forEach(function(r){var i=LT.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Dn(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:St=a.stateNode,$n=!1;break e;case 3:St=a.stateNode.containerInfo,$n=!0;break e;case 4:St=a.stateNode.containerInfo,$n=!0;break e}a=a.return}if(St===null)throw Error(Q(160));ob(s,o,i),St=null,$n=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){rt(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ab(t,e),t=t.sibling}function ab(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Dn(t,e),Qn(e),r&4){try{ha(3,e,e.return),ku(3,e)}catch(b){rt(e,e.return,b)}try{ha(5,e,e.return)}catch(b){rt(e,e.return,b)}}break;case 1:Dn(t,e),Qn(e),r&512&&n!==null&&Ds(n,n.return);break;case 5:if(Dn(t,e),Qn(e),r&512&&n!==null&&Ds(n,n.return),e.flags&32){var i=e.stateNode;try{_a(i,"")}catch(b){rt(e,e.return,b)}}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&&j1(i,s),Rf(a,o);var c=Rf(a,s);for(o=0;o<l.length;o+=2){var d=l[o],u=l[o+1];d==="style"?O1(i,u):d==="dangerouslySetInnerHTML"?P1(i,u):d==="children"?_a(i,u):Ah(i,d,u,c)}switch(a){case"input":_f(i,s);break;case"textarea":R1(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?Hs(i,!!s.multiple,h,!1):p!==!!s.multiple&&(s.defaultValue!=null?Hs(i,!!s.multiple,s.defaultValue,!0):Hs(i,!!s.multiple,s.multiple?[]:"",!1))}i[Oa]=s}catch(b){rt(e,e.return,b)}}break;case 6:if(Dn(t,e),Qn(e),r&4){if(e.stateNode===null)throw Error(Q(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(b){rt(e,e.return,b)}}break;case 3:if(Dn(t,e),Qn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ja(t.containerInfo)}catch(b){rt(e,e.return,b)}break;case 4:Dn(t,e),Qn(e);break;case 13:Dn(t,e),Qn(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(am=at())),r&4&&Lv(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Mt=(c=Mt)||d,Dn(t,e),Mt=c):Dn(t,e),Qn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(fe=e,d=e.child;d!==null;){for(u=fe=d;fe!==null;){switch(p=fe,h=p.child,p.tag){case 0:case 11:case 14:case 15:ha(4,p,p.return);break;case 1:Ds(p,p.return);var x=p.stateNode;if(typeof x.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(b){rt(r,n,b)}}break;case 5:Ds(p,p.return);break;case 22:if(p.memoizedState!==null){Bv(u);continue}}h!==null?(h.return=p,fe=h):Bv(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=N1("display",o))}catch(b){rt(e,e.return,b)}}}else if(u.tag===6){if(d===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(b){rt(e,e.return,b)}}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:Dn(t,e),Qn(e),r&4&&Lv(e);break;case 21:break;default:Dn(t,e),Qn(e)}}function Qn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(sb(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&&(_a(i,""),r.flags&=-33);var s=Iv(e);op(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Iv(e);sp(e,a,o);break;default:throw Error(Q(161))}}catch(l){rt(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function jT(e,t,n){fe=e,lb(e)}function lb(e,t,n){for(var r=(e.mode&1)!==0;fe!==null;){var i=fe,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ll;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Mt;a=Ll;var c=Mt;if(Ll=o,(Mt=l)&&!c)for(fe=i;fe!==null;)o=fe,l=o.child,o.tag===22&&o.memoizedState!==null?$v(i):l!==null?(l.return=o,fe=l):$v(i);for(;s!==null;)fe=s,lb(s),s=s.sibling;fe=i,Ll=a,Mt=c}Fv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,fe=s):Fv(e)}}function Fv(e){for(;fe!==null;){var t=fe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Mt||ku(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Mt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Fn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Sv(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}Sv(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&&ja(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Q(163))}Mt||t.flags&512&&ip(t)}catch(p){rt(t,t.return,p)}}if(t===e){fe=null;break}if(n=t.sibling,n!==null){n.return=t.return,fe=n;break}fe=t.return}}function Bv(e){for(;fe!==null;){var t=fe;if(t===e){fe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,fe=n;break}fe=t.return}}function $v(e){for(;fe!==null;){var t=fe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ku(4,t)}catch(l){rt(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){rt(t,i,l)}}var s=t.return;try{ip(t)}catch(l){rt(t,s,l)}break;case 5:var o=t.return;try{ip(t)}catch(l){rt(t,o,l)}}}catch(l){rt(t,t.return,l)}if(t===e){fe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,fe=a;break}fe=t.return}}var RT=Math.ceil,Uc=Lr.ReactCurrentDispatcher,sm=Lr.ReactCurrentOwner,jn=Lr.ReactCurrentBatchConfig,Pe=0,yt=null,ut=null,Ct=0,sn=0,Is=Si(0),ht=0,$a=null,is=0,Cu=0,om=0,ma=null,Qt=null,am=0,yo=1/0,br=null,Hc=!1,ap=null,di=null,Fl=!1,ii=null,Wc=0,ga=0,lp=null,cc=-1,uc=0;function zt(){return Pe&6?at():cc!==-1?cc:cc=at()}function fi(e){return e.mode&1?Pe&2&&Ct!==0?Ct&-Ct:pT.transition!==null?(uc===0&&(uc=q1()),uc):(e=Ie,e!==0||(e=window.event,e=e===void 0?16:J1(e.type)),e):1}function qn(e,t,n,r){if(50<ga)throw ga=0,lp=null,Error(Q(185));al(e,n,r),(!(Pe&2)||e!==yt)&&(e===yt&&(!(Pe&2)&&(Cu|=n),ht===4&&qr(e,Ct)),en(e,r),n===1&&Pe===0&&!(t.mode&1)&&(yo=at()+500,wu&&ki()))}function en(e,t){var n=e.callbackNode;p_(e,t);var r=Ac(e,e===yt?Ct:0);if(r===0)n!==null&&Qg(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Qg(n),t===1)e.tag===0?fT(zv.bind(null,e)):yw(zv.bind(null,e)),lT(function(){!(Pe&6)&&ki()}),n=null;else{switch(G1(r)){case 1:n=Nh;break;case 4:n=H1;break;case 16:n=Ec;break;case 536870912:n=W1;break;default:n=Ec}n=gb(n,cb.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cb(e,t){if(cc=-1,uc=0,Pe&6)throw Error(Q(327));var n=e.callbackNode;if(Qs()&&e.callbackNode!==n)return null;var r=Ac(e,e===yt?Ct:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=qc(e,r);else{t=r;var i=Pe;Pe|=2;var s=db();(yt!==e||Ct!==t)&&(br=null,yo=at()+500,Gi(e,t));do try{NT();break}catch(a){ub(e,a)}while(!0);qh(),Uc.current=s,Pe=i,ut!==null?t=0:(yt=null,Ct=0,t=ht)}if(t!==0){if(t===2&&(i=Df(e),i!==0&&(r=i,t=cp(e,i))),t===1)throw n=$a,Gi(e,0),qr(e,r),en(e,at()),n;if(t===6)qr(e,r);else{if(i=e.current.alternate,!(r&30)&&!MT(i)&&(t=qc(e,r),t===2&&(s=Df(e),s!==0&&(r=s,t=cp(e,s))),t===1))throw n=$a,Gi(e,0),qr(e,r),en(e,at()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(Q(345));case 2:Ri(e,Qt,br);break;case 3:if(qr(e,r),(r&130023424)===r&&(t=am+500-at(),10<t)){if(Ac(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){zt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Uf(Ri.bind(null,e,Qt,br),t);break}Ri(e,Qt,br);break;case 4:if(qr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Wn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=at()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*RT(r/1960))-r,10<r){e.timeoutHandle=Uf(Ri.bind(null,e,Qt,br),r);break}Ri(e,Qt,br);break;case 5:Ri(e,Qt,br);break;default:throw Error(Q(329))}}}return en(e,at()),e.callbackNode===n?cb.bind(null,e):null}function cp(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&(Gi(e,t).flags|=256),e=qc(e,t),e!==2&&(t=Qt,Qt=n,t!==null&&up(t)),e}function up(e){Qt===null?Qt=e:Qt.push.apply(Qt,e)}function MT(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(!Yn(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 qr(e,t){for(t&=~om,t&=~Cu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Wn(t),r=1<<n;e[n]=-1,t&=~r}}function zv(e){if(Pe&6)throw Error(Q(327));Qs();var t=Ac(e,0);if(!(t&1))return en(e,at()),null;var n=qc(e,t);if(e.tag!==0&&n===2){var r=Df(e);r!==0&&(t=r,n=cp(e,r))}if(n===1)throw n=$a,Gi(e,0),qr(e,t),en(e,at()),n;if(n===6)throw Error(Q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ri(e,Qt,br),en(e,at()),null}function lm(e,t){var n=Pe;Pe|=1;try{return e(t)}finally{Pe=n,Pe===0&&(yo=at()+500,wu&&ki())}}function ss(e){ii!==null&&ii.tag===0&&!(Pe&6)&&Qs();var t=Pe;Pe|=1;var n=jn.transition,r=Ie;try{if(jn.transition=null,Ie=1,e)return e()}finally{Ie=r,jn.transition=n,Pe=t,!(Pe&6)&&ki()}}function cm(){sn=Is.current,Ge(Is)}function Gi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,aT(n)),ut!==null)for(n=ut.return;n!==null;){var r=n;switch(Uh(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Nc();break;case 3:go(),Ge(Zt),Ge(Nt),Zh();break;case 5:Xh(r);break;case 4:go();break;case 13:Ge(Ke);break;case 19:Ge(Ke);break;case 10:Gh(r.type._context);break;case 22:case 23:cm()}n=n.return}if(yt=e,ut=e=pi(e.current,null),Ct=sn=t,ht=0,$a=null,om=Cu=is=0,Qt=ma=null,Di!==null){for(t=0;t<Di.length;t++)if(n=Di[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}Di=null}return e}function ub(e,t){do{var n=ut;try{if(qh(),oc.current=Vc,zc){for(var r=Ze.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}zc=!1}if(rs=0,vt=ft=Ze=null,pa=!1,La=0,sm.current=null,n===null||n.return===null){ht=1,$a=t,ut=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=Ct,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=Av(o);if(h!==null){h.flags&=-257,jv(h,o,a,s,t),h.mode&1&&Ev(s,c,t),t=h,l=c;var x=t.updateQueue;if(x===null){var b=new Set;b.add(l),t.updateQueue=b}else x.add(l);break e}else{if(!(t&1)){Ev(s,c,t),um();break e}l=Error(Q(426))}}else if(Ye&&a.mode&1){var S=Av(o);if(S!==null){!(S.flags&65536)&&(S.flags|=256),jv(S,o,a,s,t),Hh(vo(l,a));break e}}s=l=vo(l,a),ht!==4&&(ht=2),ma===null?ma=[s]:ma.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=Gw(s,l,t);bv(s,m);break e;case 1:a=l;var g=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(di===null||!di.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var k=Yw(s,a,t);bv(s,k);break e}}s=s.return}while(s!==null)}pb(n)}catch(C){t=C,ut===n&&n!==null&&(ut=n=n.return);continue}break}while(!0)}function db(){var e=Uc.current;return Uc.current=Vc,e===null?Vc:e}function um(){(ht===0||ht===3||ht===2)&&(ht=4),yt===null||!(is&268435455)&&!(Cu&268435455)||qr(yt,Ct)}function qc(e,t){var n=Pe;Pe|=2;var r=db();(yt!==e||Ct!==t)&&(br=null,Gi(e,t));do try{PT();break}catch(i){ub(e,i)}while(!0);if(qh(),Pe=n,Uc.current=r,ut!==null)throw Error(Q(261));return yt=null,Ct=0,ht}function PT(){for(;ut!==null;)fb(ut)}function NT(){for(;ut!==null&&!i_();)fb(ut)}function fb(e){var t=mb(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?pb(e):ut=t,sm.current=null}function pb(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=TT(n,t),n!==null){n.flags&=32767,ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ht=6,ut=null;return}}else if(n=_T(n,t,sn),n!==null){ut=n;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);ht===0&&(ht=5)}function Ri(e,t,n){var r=Ie,i=jn.transition;try{jn.transition=null,Ie=1,OT(e,t,n,r)}finally{jn.transition=i,Ie=r}return null}function OT(e,t,n,r){do Qs();while(ii!==null);if(Pe&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(h_(e,s),e===yt&&(ut=yt=null,Ct=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fl||(Fl=!0,gb(Ec,function(){return Qs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=jn.transition,jn.transition=null;var o=Ie;Ie=1;var a=Pe;Pe|=4,sm.current=null,AT(e,n),ab(n,e),eT(zf),jc=!!$f,zf=$f=null,e.current=n,jT(n),s_(),Pe=a,Ie=o,jn.transition=s}else e.current=n;if(Fl&&(Fl=!1,ii=e,Wc=i),s=e.pendingLanes,s===0&&(di=null),l_(n.stateNode),en(e,at()),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(Hc)throw Hc=!1,e=ap,ap=null,e;return Wc&1&&e.tag!==0&&Qs(),s=e.pendingLanes,s&1?e===lp?ga++:(ga=0,lp=e):ga=0,ki(),null}function Qs(){if(ii!==null){var e=G1(Wc),t=jn.transition,n=Ie;try{if(jn.transition=null,Ie=16>e?16:e,ii===null)var r=!1;else{if(e=ii,ii=null,Wc=0,Pe&6)throw Error(Q(331));var i=Pe;for(Pe|=4,fe=e.current;fe!==null;){var s=fe,o=s.child;if(fe.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(fe=c;fe!==null;){var d=fe;switch(d.tag){case 0:case 11:case 15:ha(8,d,s)}var u=d.child;if(u!==null)u.return=d,fe=u;else for(;fe!==null;){d=fe;var p=d.sibling,h=d.return;if(ib(d),d===c){fe=null;break}if(p!==null){p.return=h,fe=p;break}fe=h}}}var x=s.alternate;if(x!==null){var b=x.child;if(b!==null){x.child=null;do{var S=b.sibling;b.sibling=null,b=S}while(b!==null)}}fe=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,fe=o;else e:for(;fe!==null;){if(s=fe,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ha(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,fe=m;break e}fe=s.return}}var g=e.current;for(fe=g;fe!==null;){o=fe;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,fe=y;else e:for(o=g;fe!==null;){if(a=fe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ku(9,a)}}catch(C){rt(a,a.return,C)}if(a===o){fe=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,fe=k;break e}fe=a.return}}if(Pe=i,ki(),or&&typeof or.onPostCommitFiberRoot=="function")try{or.onPostCommitFiberRoot(mu,e)}catch{}r=!0}return r}finally{Ie=n,jn.transition=t}}return!1}function Vv(e,t,n){t=vo(n,t),t=Gw(e,t,1),e=ui(e,t,1),t=zt(),e!==null&&(al(e,1,t),en(e,t))}function rt(e,t,n){if(e.tag===3)Vv(e,e,n);else for(;t!==null;){if(t.tag===3){Vv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(di===null||!di.has(r))){e=vo(n,e),e=Yw(t,e,1),t=ui(t,e,1),e=zt(),t!==null&&(al(t,1,e),en(t,e));break}}t=t.return}}function DT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=zt(),e.pingedLanes|=e.suspendedLanes&n,yt===e&&(Ct&n)===n&&(ht===4||ht===3&&(Ct&130023424)===Ct&&500>at()-am?Gi(e,0):om|=n),en(e,t)}function hb(e,t){t===0&&(e.mode&1?(t=Al,Al<<=1,!(Al&130023424)&&(Al=4194304)):t=1);var n=zt();e=Mr(e,t),e!==null&&(al(e,t,n),en(e,n))}function IT(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hb(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),hb(e,n)}var mb;mb=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Zt.current)Xt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Xt=!1,CT(e,t,n);Xt=!!(e.flags&131072)}else Xt=!1,Ye&&t.flags&1048576&&xw(t,Ic,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;lc(e,t),e=t.pendingProps;var i=po(t,Nt.current);Ys(t,n),i=em(null,t,r,e,i,n);var s=tm();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,Jt(r)?(s=!0,Oc(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Qh(t),i.updater=Su,t.stateNode=i,i._reactInternals=t,Kf(t,r,e,n),t=Jf(null,t,r,!0,s,n)):(t.tag=0,Ye&&s&&Vh(t),Bt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(lc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=BT(r),e=Fn(r,e),i){case 0:t=Zf(null,t,r,e,n);break e;case 1:t=Pv(null,t,r,e,n);break e;case 11:t=Rv(null,t,r,e,n);break e;case 14:t=Mv(null,t,r,Fn(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:Fn(r,i),Zf(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),Pv(e,t,r,i,n);case 3:e:{if(Zw(t),e===null)throw Error(Q(387));r=t.pendingProps,s=t.memoizedState,i=s.element,_w(e,t),Bc(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=vo(Error(Q(423)),t),t=Nv(e,t,r,n,i);break e}else if(r!==i){i=vo(Error(Q(424)),t),t=Nv(e,t,r,n,i);break e}else for(ln=ci(t.stateNode.containerInfo.firstChild),dn=t,Ye=!0,Vn=null,n=kw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ho(),r===i){t=Pr(e,t,n);break e}Bt(e,t,r,n)}t=t.child}return t;case 5:return Tw(t),e===null&&Gf(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Vf(r,i)?o=null:s!==null&&Vf(r,s)&&(t.flags|=32),Xw(e,t),Bt(e,t,o,n),t.child;case 6:return e===null&&Gf(t),null;case 13:return Jw(e,t,n);case 4:return Kh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):Bt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),Rv(e,t,r,i,n);case 7:return Bt(e,t,t.pendingProps,n),t.child;case 8:return Bt(e,t,t.pendingProps.children,n),t.child;case 12:return Bt(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,Ve(Lc,r._currentValue),r._currentValue=o,s!==null)if(Yn(s.value,o)){if(s.children===i.children&&!Zt.current){t=Pr(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=Er(-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),Yf(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),Yf(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}Bt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Ys(t,n),i=Mn(i),r=r(i),t.flags|=1,Bt(e,t,r,n),t.child;case 14:return r=t.type,i=Fn(r,t.pendingProps),i=Fn(r.type,i),Mv(e,t,r,i,n);case 15:return Qw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Fn(r,i),lc(e,t),t.tag=1,Jt(r)?(e=!0,Oc(t)):e=!1,Ys(t,n),qw(t,r,i),Kf(t,r,i,n),Jf(null,t,r,!0,e,n);case 19:return eb(e,t,n);case 22:return Kw(e,t,n)}throw Error(Q(156,t.tag))};function gb(e,t){return U1(e,t)}function FT(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 En(e,t,n,r){return new FT(e,t,n,r)}function dm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function BT(e){if(typeof e=="function")return dm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Rh)return 11;if(e===Mh)return 14}return 2}function pi(e,t){var n=e.alternate;return n===null?(n=En(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 dc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")dm(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ts:return Yi(n.children,i,s,t);case jh:o=8,i|=8;break;case wf:return e=En(12,n,t,i|2),e.elementType=wf,e.lanes=s,e;case bf:return e=En(13,n,t,i),e.elementType=bf,e.lanes=s,e;case Sf:return e=En(19,n,t,i),e.elementType=Sf,e.lanes=s,e;case T1:return _u(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case C1:o=10;break e;case _1:o=9;break e;case Rh:o=11;break e;case Mh:o=14;break e;case Vr:o=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=En(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Yi(e,t,n,r){return e=En(7,e,r,t),e.lanes=n,e}function _u(e,t,n,r){return e=En(22,e,r,t),e.elementType=T1,e.lanes=n,e.stateNode={isHidden:!1},e}function Od(e,t,n){return e=En(6,e,null,t),e.lanes=n,e}function Dd(e,t,n){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function $T(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=md(0),this.expirationTimes=md(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=md(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fm(e,t,n,r,i,s,o,a,l){return e=new $T(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=En(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qh(s),e}function zT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_s,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function vb(e){if(!e)return vi;e=e._reactInternals;e:{if(us(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(Jt(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(Jt(n))return vw(e,n,t)}return t}function yb(e,t,n,r,i,s,o,a,l){return e=fm(n,r,!0,e,i,s,o,a,l),e.context=vb(null),n=e.current,r=zt(),i=fi(n),s=Er(r,i),s.callback=t??null,ui(n,s,i),e.current.lanes=i,al(e,i,r),en(e,r),e}function Tu(e,t,n,r){var i=t.current,s=zt(),o=fi(i);return n=vb(n),t.context===null?t.context=n:t.pendingContext=n,t=Er(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ui(i,t,o),e!==null&&(qn(e,i,o,s),sc(e,i,o)),o}function Gc(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 Uv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function pm(e,t){Uv(e,t),(e=e.alternate)&&Uv(e,t)}function VT(){return null}var xb=typeof reportError=="function"?reportError:function(e){console.error(e)};function hm(e){this._internalRoot=e}Eu.prototype.render=hm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));Tu(e,t,null,null)};Eu.prototype.unmount=hm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ss(function(){Tu(null,e,null,null)}),t[Rr]=null}};function Eu(e){this._internalRoot=e}Eu.prototype.unstable_scheduleHydration=function(e){if(e){var t=K1();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Wr.length&&t!==0&&t<Wr[n].priority;n++);Wr.splice(n,0,e),n===0&&Z1(e)}};function mm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Au(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Hv(){}function UT(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Gc(o);s.call(c)}}var o=yb(t,r,e,0,null,!1,!1,"",Hv);return e._reactRootContainer=o,e[Rr]=o.current,Pa(e.nodeType===8?e.parentNode:e),ss(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Gc(l);a.call(c)}}var l=fm(e,0,!1,null,null,!1,!1,"",Hv);return e._reactRootContainer=l,e[Rr]=l.current,Pa(e.nodeType===8?e.parentNode:e),ss(function(){Tu(t,l,n,r)}),l}function ju(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=Gc(o);a.call(l)}}Tu(t,o,e,i)}else o=UT(n,t,e,i,r);return Gc(o)}Y1=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Jo(t.pendingLanes);n!==0&&(Oh(t,n|1),en(t,at()),!(Pe&6)&&(yo=at()+500,ki()))}break;case 13:ss(function(){var r=Mr(e,1);if(r!==null){var i=zt();qn(r,e,1,i)}}),pm(e,1)}};Dh=function(e){if(e.tag===13){var t=Mr(e,134217728);if(t!==null){var n=zt();qn(t,e,134217728,n)}pm(e,134217728)}};Q1=function(e){if(e.tag===13){var t=fi(e),n=Mr(e,t);if(n!==null){var r=zt();qn(n,e,t,r)}pm(e,t)}};K1=function(){return Ie};X1=function(e,t){var n=Ie;try{return Ie=e,t()}finally{Ie=n}};Pf=function(e,t,n){switch(t){case"input":if(_f(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=xu(r);if(!i)throw Error(Q(90));A1(r),_f(r,i)}}}break;case"textarea":R1(e,n);break;case"select":t=n.value,t!=null&&Hs(e,!!n.multiple,t,!1)}};L1=lm;F1=ss;var HT={usingClientEntryPoint:!1,Events:[cl,Rs,xu,D1,I1,lm]},qo={findFiberByHostInstance:Oi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},WT={bundleType:qo.bundleType,version:qo.version,rendererPackageName:qo.rendererPackageName,rendererConfig:qo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=z1(e),e===null?null:e.stateNode},findFiberByHostInstance:qo.findFiberByHostInstance||VT,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 Bl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bl.isDisabled&&Bl.supportsFiber)try{mu=Bl.inject(WT),or=Bl}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HT;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!mm(t))throw Error(Q(200));return zT(e,t,null,n)};pn.createRoot=function(e,t){if(!mm(e))throw Error(Q(299));var n=!1,r="",i=xb;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=fm(e,1,!1,null,null,n,!1,r,i),e[Rr]=t.current,Pa(e.nodeType===8?e.parentNode:e),new hm(t)};pn.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=z1(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return ss(e)};pn.hydrate=function(e,t,n){if(!Au(t))throw Error(Q(200));return ju(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!mm(e))throw Error(Q(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=xb;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=yb(t,null,e,1,n??null,i,!1,s,o),e[Rr]=t.current,Pa(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 Eu(t)};pn.render=function(e,t,n){if(!Au(t))throw Error(Q(200));return ju(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!Au(e))throw Error(Q(40));return e._reactRootContainer?(ss(function(){ju(null,null,e,!1,function(){e._reactRootContainer=null,e[Rr]=null})}),!0):!1};pn.unstable_batchedUpdates=lm;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Au(n))throw Error(Q(200));if(e==null||e._reactInternals===void 0)throw Error(Q(38));return ju(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function wb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wb)}catch(e){console.error(e)}}wb(),w1.exports=pn;var bb=w1.exports;const qT=Ir(bb);var Sb,Wv=bb;Sb=Wv.createRoot,Wv.hydrateRoot;const GT="@alfatech/livechat",YT="v2026.04.29.2",QT="module",KT="https://api.chatier.app",XT="wss://api.chatier.app",ZT=["dist","README.md","component/chatier.js"],JT="dist/widget.js",eE={name:"Uygar Öztürk Ceylan",email:"uygaroztcyln@gmail.com"},tE={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"},nE={"@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"},rE={"@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"},kb={name:GT,private:!1,version:YT,type:QT,apiURL:KT,wsURL:XT,files:ZT,main:JT,author:eE,scripts:tE,dependencies:nE,devDependencies:rE,"lint-staged":{"./**/*.{js,ts,tsx,json}":["npm run format"]}},Cb=kb.apiURL,iE=kb.wsURL,sE=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],oE=(e,t)=>[{message:"message"in t?t.message:"Not Found"},404],aE={429:sE,404:oE};async function pr(e,t={}){const n={};!(t.body instanceof FormData)&&t.body&&(n["Content-Type"]="application/json");const r=await fetch(`${Cb}/${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=aE[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 Gn=e=>[200,201,204].includes(e),lE=(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 Ro=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(){}},os=typeof window>"u"||"Deno"in globalThis;function kn(){}function cE(e,t){return typeof e=="function"?e(t):e}function dp(e){return typeof e=="number"&&e>=0&&e!==1/0}function _b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ks(e,t){return typeof e=="function"?e(t):e}function Un(e,t){return typeof e=="function"?e(t):e}function qv(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==gm(o,t.options))return!1}else if(!za(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 Gv(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(as(t.options.mutationKey)!==as(s))return!1}else if(!za(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function gm(e,t){return((t==null?void 0:t.queryKeyHashFn)||as)(e)}function as(e){return JSON.stringify(e,(t,n)=>fp(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function za(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!za(e[n],t[n])):!1}function Tb(e,t){if(e===t)return e;const n=Yv(e)&&Yv(t);if(n||fp(e)&&fp(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]=Tb(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function Yc(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 Yv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fp(e){if(!Qv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Qv(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Qv(e){return Object.prototype.toString.call(e)==="[object Object]"}function uE(e){return new Promise(t=>{setTimeout(t,e)})}function pp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Tb(e,t):t}function dE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function fE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var vm=Symbol();function Eb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===vm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var $i,Yr,Zs,Jx,pE=(Jx=class extends Ro{constructor(){super();ye(this,$i);ye(this,Yr);ye(this,Zs);de(this,Zs,t=>{if(!os&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,Yr)||this.setEventListener(T(this,Zs))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Yr))==null||t.call(this),de(this,Yr,void 0))}setEventListener(t){var n;de(this,Zs,t),(n=T(this,Yr))==null||n.call(this),de(this,Yr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,$i)!==t&&(de(this,$i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,$i)=="boolean"?T(this,$i):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$i=new WeakMap,Yr=new WeakMap,Zs=new WeakMap,Jx),ym=new pE,Js,Qr,eo,e1,hE=(e1=class extends Ro{constructor(){super();ye(this,Js,!0);ye(this,Qr);ye(this,eo);de(this,eo,t=>{if(!os&&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,Qr)||this.setEventListener(T(this,eo))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Qr))==null||t.call(this),de(this,Qr,void 0))}setEventListener(t){var n;de(this,eo,t),(n=T(this,Qr))==null||n.call(this),de(this,Qr,t(this.setOnline.bind(this)))}setOnline(t){T(this,Js)!==t&&(de(this,Js,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,Js)}},Js=new WeakMap,Qr=new WeakMap,eo=new WeakMap,e1),Qc=new hE;function hp(){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 mE(e){return Math.min(1e3*2**e,3e4)}function Ab(e){return(e??"online")==="online"?Qc.isOnline():!0}var jb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Id(e){return e instanceof jb}function Rb(e){let t=!1,n=0,r=!1,i;const s=hp(),o=b=>{var S;r||(p(new jb(b)),(S=e.abort)==null||S.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>ym.isFocused()&&(e.networkMode==="always"||Qc.isOnline())&&e.canRun(),d=()=>Ab(e.networkMode)&&e.canRun(),u=b=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,b),i==null||i(),s.resolve(b))},p=b=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,b),i==null||i(),s.reject(b))},h=()=>new Promise(b=>{var S;i=m=>{(r||c())&&b(m)},(S=e.onPause)==null||S.call(e)}).then(()=>{var b;i=void 0,r||(b=e.onContinue)==null||b.call(e)}),x=()=>{if(r)return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(m){b=Promise.reject(m)}Promise.resolve(b).then(u).catch(m=>{var _;if(r)return;const g=e.retry??(os?0:3),y=e.retryDelay??mE,k=typeof y=="function"?y(n,m):y,C=g===!0||typeof g=="number"&&n<g||typeof g=="function"&&g(n,m);if(t||!C){p(m);return}n++,(_=e.onFail)==null||_.call(e,n,m),uE(k).then(()=>c()?void 0:h()).then(()=>{t?p(m):x()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?x():h().then(x),s)}}function gE(){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 pt=gE(),zi,t1,Mb=(t1=class{constructor(){ye(this,zi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dp(this.gcTime)&&de(this,zi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(os?1/0:5*60*1e3))}clearGcTimeout(){T(this,zi)&&(clearTimeout(T(this,zi)),de(this,zi,void 0))}},zi=new WeakMap,t1),to,no,Sn,jt,nl,Vi,Bn,wr,n1,vE=(n1=class extends Mb{constructor(t){super();ye(this,Bn);ye(this,to);ye(this,no);ye(this,Sn);ye(this,jt);ye(this,nl);ye(this,Vi);de(this,Vi,!1),de(this,nl,t.defaultOptions),this.setOptions(t.options),this.observers=[],de(this,Sn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,de(this,to,yE(this.options)),this.state=t.state??T(this,to),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,jt))==null?void 0:t.promise}setOptions(t){this.options={...T(this,nl),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,Sn).remove(this)}setData(t,n){const r=pp(this.state.data,t,this.options);return Te(this,Bn,wr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Te(this,Bn,wr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=T(this,jt))==null?void 0:r.promise;return(i=T(this,jt))==null||i.cancel(t),n?n.then(kn).catch(kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,to))}isActive(){return this.observers.some(t=>Un(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===vm||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||!_b(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,jt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,jt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,Sn).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,jt)&&(T(this,Vi)?T(this,jt).cancel({revert:!0}):T(this,jt).cancelRetry()),this.scheduleGc()),T(this,Sn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,Bn,wr).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,jt))return T(this,jt).continueRetry(),T(this,jt).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:()=>(de(this,Vi,!0),r.signal)})},s=()=>{const u=Eb(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return i(p),de(this,Vi,!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),de(this,no,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&Te(this,Bn,wr).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,h,x,b;Id(u)&&u.silent||Te(this,Bn,wr).call(this,{type:"error",error:u}),Id(u)||((h=(p=T(this,Sn).config).onError)==null||h.call(p,u,this),(b=(x=T(this,Sn).config).onSettled)==null||b.call(x,this.state.data,u,this)),this.scheduleGc()};return de(this,jt,Rb({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:u=>{var p,h,x,b;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(S){a(S);return}(h=(p=T(this,Sn).config).onSuccess)==null||h.call(p,u,this),(b=(x=T(this,Sn).config).onSettled)==null||b.call(x,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{Te(this,Bn,wr).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{Te(this,Bn,wr).call(this,{type:"pause"})},onContinue:()=>{Te(this,Bn,wr).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),T(this,jt).start()}},to=new WeakMap,no=new WeakMap,Sn=new WeakMap,jt=new WeakMap,nl=new WeakMap,Vi=new WeakMap,Bn=new WeakSet,wr=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,...Pb(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 Id(i)&&i.revert&&T(this,no)?{...T(this,no),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),pt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,Sn).notify({query:this,type:"updated",action:t})})},n1);function Pb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ab(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yE(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 tr,r1,xE=(r1=class extends Ro{constructor(t={}){super();ye(this,tr);this.config=t,de(this,tr,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??gm(i,n);let o=this.get(s);return o||(o=new vE({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){T(this,tr).has(t.queryHash)||(T(this,tr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,tr).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,tr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,tr).get(t)}getAll(){return[...T(this,tr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>qv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>qv(t,r)):n}notify(t){pt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){pt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){pt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},tr=new WeakMap,r1),nr,Lt,Ui,rr,$r,i1,wE=(i1=class extends Mb{constructor(t){super();ye(this,rr);ye(this,nr);ye(this,Lt);ye(this,Ui);this.mutationId=t.mutationId,de(this,Lt,t.mutationCache),de(this,nr,[]),this.state=t.state||Nb(),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,nr).includes(t)||(T(this,nr).push(t),this.clearGcTimeout(),T(this,Lt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){de(this,nr,T(this,nr).filter(n=>n!==t)),this.scheduleGc(),T(this,Lt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,nr).length||(this.state.status==="pending"?this.scheduleGc():T(this,Lt).remove(this))}continue(){var t;return((t=T(this,Ui))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,p,h,x,b,S,m,g,y,k,C,_,E;de(this,Ui,Rb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,$)=>{Te(this,rr,$r).call(this,{type:"failed",failureCount:A,error:$})},onPause:()=>{Te(this,rr,$r).call(this,{type:"pause"})},onContinue:()=>{Te(this,rr,$r).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Lt).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Ui).canStart();try{if(!n){Te(this,rr,$r).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=T(this,Lt).config).onMutate)==null?void 0:s.call(i,t,this));const $=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));$!==this.state.context&&Te(this,rr,$r).call(this,{type:"pending",context:$,variables:t,isPaused:r})}const A=await T(this,Ui).start();return await((c=(l=T(this,Lt).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,Lt).config).onSettled)==null?void 0:h.call(p,A,null,this.state.variables,this.state.context,this)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,A,null,t,this.state.context)),Te(this,rr,$r).call(this,{type:"success",data:A}),A}catch(A){try{throw await((m=(S=T(this,Lt).config).onError)==null?void 0:m.call(S,A,t,this.state.context,this)),await((y=(g=this.options).onError)==null?void 0:y.call(g,A,t,this.state.context)),await((C=(k=T(this,Lt).config).onSettled)==null?void 0:C.call(k,void 0,A,this.state.variables,this.state.context,this)),await((E=(_=this.options).onSettled)==null?void 0:E.call(_,void 0,A,t,this.state.context)),A}finally{Te(this,rr,$r).call(this,{type:"error",error:A})}}finally{T(this,Lt).runNext(this)}}},nr=new WeakMap,Lt=new WeakMap,Ui=new WeakMap,rr=new WeakSet,$r=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),pt.batch(()=>{T(this,nr).forEach(r=>{r.onMutationUpdate(t)}),T(this,Lt).notify({mutation:this,type:"updated",action:t})})},i1);function Nb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var nn,rl,s1,bE=(s1=class extends Ro{constructor(t={}){super();ye(this,nn);ye(this,rl);this.config=t,de(this,nn,new Map),de(this,rl,Date.now())}build(t,n,r){const i=new wE({mutationCache:this,mutationId:++Sl(this,rl)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=$l(t),r=T(this,nn).get(n)??[];r.push(t),T(this,nn).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=$l(t);if(T(this,nn).has(n)){const i=(r=T(this,nn).get(n))==null?void 0:r.filter(s=>s!==t);i&&(i.length===0?T(this,nn).delete(n):T(this,nn).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=T(this,nn).get($l(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=T(this,nn).get($l(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...T(this,nn).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Gv(n,r))}findAll(t={}){return this.getAll().filter(n=>Gv(t,n))}notify(t){pt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return pt.batch(()=>Promise.all(t.map(n=>n.continue().catch(kn))))}},nn=new WeakMap,rl=new WeakMap,s1);function $l(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Kv(e){return{onFetch:(t,n)=>{var d,u,p,h,x;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=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const S=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},m=Eb(t.options,t.fetchOptions),g=async(y,k,C)=>{if(b)return Promise.reject();if(k==null&&y.pages.length)return Promise.resolve(y);const _={queryKey:t.queryKey,pageParam:k,direction:C?"backward":"forward",meta:t.options.meta};S(_);const E=await m(_),{maxPages:A}=t.options,$=C?fE:dE;return{pages:$(y.pages,E,A),pageParams:$(y.pageParams,k,A)}};if(i&&s.length){const y=i==="backward",k=y?SE:Xv,C={pages:s,pageParams:o},_=k(r,C);a=await g(C,_,y)}else{const y=e??s.length;do{const k=l===0?o[0]??r.initialPageParam:Xv(r,a);if(l>0&&k==null)break;a=await g(a,k),l++}while(l<y)}return a};t.options.persister?t.fetchFn=()=>{var b,S;return(S=(b=t.options).persister)==null?void 0:S.call(b,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Xv(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 SE(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 tt,Kr,Xr,ro,io,Zr,so,oo,o1,kE=(o1=class{constructor(e={}){ye(this,tt);ye(this,Kr);ye(this,Xr);ye(this,ro);ye(this,io);ye(this,Zr);ye(this,so);ye(this,oo);de(this,tt,e.queryCache||new xE),de(this,Kr,e.mutationCache||new bE),de(this,Xr,e.defaultOptions||{}),de(this,ro,new Map),de(this,io,new Map),de(this,Zr,0)}mount(){Sl(this,Zr)._++,T(this,Zr)===1&&(de(this,so,ym.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,tt).onFocus())})),de(this,oo,Qc.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,tt).onOnline())})))}unmount(){var e,t;Sl(this,Zr)._--,T(this,Zr)===0&&((e=T(this,so))==null||e.call(this),de(this,so,void 0),(t=T(this,oo))==null||t.call(this),de(this,oo,void 0))}isFetching(e){return T(this,tt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,Kr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,tt).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,tt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Ks(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return T(this,tt).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,tt).get(r.queryHash),s=i==null?void 0:i.state.data,o=cE(t,s);if(o!==void 0)return T(this,tt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return pt.batch(()=>T(this,tt).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,tt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,tt);pt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,tt),r={type:"active",...e};return pt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=pt.batch(()=>T(this,tt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(kn).catch(kn)}invalidateQueries(e,t={}){return pt.batch(()=>{if(T(this,tt).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=pt.batch(()=>T(this,tt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(kn)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,tt).build(this,t);return n.isStaleByTime(Ks(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(kn).catch(kn)}fetchInfiniteQuery(e){return e.behavior=Kv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(kn).catch(kn)}ensureInfiniteQueryData(e){return e.behavior=Kv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qc.isOnline()?T(this,Kr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,tt)}getMutationCache(){return T(this,Kr)}getDefaultOptions(){return T(this,Xr)}setDefaultOptions(e){de(this,Xr,e)}setQueryDefaults(e,t){T(this,ro).set(as(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,ro).values()],n={};return t.forEach(r=>{za(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,io).set(as(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,io).values()];let n={};return t.forEach(r=>{za(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,Xr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gm(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===vm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,Xr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,tt).clear(),T(this,Kr).clear()}},tt=new WeakMap,Kr=new WeakMap,Xr=new WeakMap,ro=new WeakMap,io=new WeakMap,Zr=new WeakMap,so=new WeakMap,oo=new WeakMap,o1),qt,Re,il,Ft,Hi,ao,Jr,ir,sl,lo,co,Wi,qi,ei,uo,De,ta,mp,gp,vp,yp,xp,wp,bp,Ob,a1,CE=(a1=class extends Ro{constructor(t,n){super();ye(this,De);ye(this,qt);ye(this,Re);ye(this,il);ye(this,Ft);ye(this,Hi);ye(this,ao);ye(this,Jr);ye(this,ir);ye(this,sl);ye(this,lo);ye(this,co);ye(this,Wi);ye(this,qi);ye(this,ei);ye(this,uo,new Set);this.options=n,de(this,qt,t),de(this,ir,null),de(this,Jr,hp()),this.options.experimental_prefetchInRender||T(this,Jr).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,Re).addObserver(this),Zv(T(this,Re),this.options)?Te(this,De,ta).call(this):this.updateResult(),Te(this,De,yp).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sp(T(this,Re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sp(T(this,Re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,De,xp).call(this),Te(this,De,wp).call(this),T(this,Re).removeObserver(this)}setOptions(t,n){const r=this.options,i=T(this,Re);if(this.options=T(this,qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Un(this.options.enabled,T(this,Re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,De,bp).call(this),T(this,Re).setOptions(this.options),r._defaulted&&!Yc(this.options,r)&&T(this,qt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Re),observer:this});const s=this.hasListeners();s&&Jv(T(this,Re),i,this.options,r)&&Te(this,De,ta).call(this),this.updateResult(n),s&&(T(this,Re)!==i||Un(this.options.enabled,T(this,Re))!==Un(r.enabled,T(this,Re))||Ks(this.options.staleTime,T(this,Re))!==Ks(r.staleTime,T(this,Re)))&&Te(this,De,mp).call(this);const o=Te(this,De,gp).call(this);s&&(T(this,Re)!==i||Un(this.options.enabled,T(this,Re))!==Un(r.enabled,T(this,Re))||o!==T(this,ei))&&Te(this,De,vp).call(this,o)}getOptimisticResult(t){const n=T(this,qt).getQueryCache().build(T(this,qt),t),r=this.createResult(n,t);return TE(this,r)&&(de(this,Ft,r),de(this,ao,this.options),de(this,Hi,T(this,Re).state)),r}getCurrentResult(){return T(this,Ft)}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,uo).add(t)}getCurrentQuery(){return T(this,Re)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,qt).defaultQueryOptions(t),r=T(this,qt).getQueryCache().build(T(this,qt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Te(this,De,ta).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Ft)))}createResult(t,n){var A;const r=T(this,Re),i=this.options,s=T(this,Ft),o=T(this,Hi),a=T(this,ao),c=t!==r?t.state:T(this,il),{state:d}=t;let u={...d},p=!1,h;if(n._optimisticResults){const $=this.hasListeners(),I=!$&&Zv(t,n),D=$&&Jv(t,r,n,i);(I||D)&&(u={...u,...Pb(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:S}=u;if(n.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&n.select===T(this,sl))h=T(this,lo);else try{de(this,sl,n.select),h=n.select(u.data),h=pp(s==null?void 0:s.data,h,n),de(this,lo,h),de(this,ir,null)}catch($){de(this,ir,$)}else h=u.data;if(n.placeholderData!==void 0&&h===void 0&&S==="pending"){let $;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))$=s.data;else if($=typeof n.placeholderData=="function"?n.placeholderData((A=T(this,co))==null?void 0:A.state.data,T(this,co)):n.placeholderData,n.select&&$!==void 0)try{$=n.select($),de(this,ir,null)}catch(I){de(this,ir,I)}$!==void 0&&(S="success",h=pp(s==null?void 0:s.data,$,n),p=!0)}T(this,ir)&&(x=T(this,ir),h=T(this,lo),b=Date.now(),S="error");const m=u.fetchStatus==="fetching",g=S==="pending",y=S==="error",k=g&&m,C=h!==void 0,E={status:S,fetchStatus:u.fetchStatus,isPending:g,isSuccess:S==="success",isError:y,isInitialLoading:k,isLoading:k,data:h,dataUpdatedAt:u.dataUpdatedAt,error:x,errorUpdatedAt:b,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:y&&!C,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:y&&C,isStale:xm(t,n),refetch:this.refetch,promise:T(this,Jr)};if(this.options.experimental_prefetchInRender){const $=P=>{E.status==="error"?P.reject(E.error):E.data!==void 0&&P.resolve(E.data)},I=()=>{const P=de(this,Jr,E.promise=hp());$(P)},D=T(this,Jr);switch(D.status){case"pending":t.queryHash===r.queryHash&&$(D);break;case"fulfilled":(E.status==="error"||E.data!==D.value)&&I();break;case"rejected":(E.status!=="error"||E.error!==D.reason)&&I();break}}return E}updateResult(t){const n=T(this,Ft),r=this.createResult(T(this,Re),this.options);if(de(this,Hi,T(this,Re).state),de(this,ao,this.options),T(this,Hi).data!==void 0&&de(this,co,T(this,Re)),Yc(r,n))return;de(this,Ft,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,uo).size)return!0;const l=new Set(a??T(this,uo));return this.options.throwOnError&&l.add("error"),Object.keys(T(this,Ft)).some(c=>{const d=c;return T(this,Ft)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),Te(this,De,Ob).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,De,yp).call(this)}},qt=new WeakMap,Re=new WeakMap,il=new WeakMap,Ft=new WeakMap,Hi=new WeakMap,ao=new WeakMap,Jr=new WeakMap,ir=new WeakMap,sl=new WeakMap,lo=new WeakMap,co=new WeakMap,Wi=new WeakMap,qi=new WeakMap,ei=new WeakMap,uo=new WeakMap,De=new WeakSet,ta=function(t){Te(this,De,bp).call(this);let n=T(this,Re).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(kn)),n},mp=function(){Te(this,De,xp).call(this);const t=Ks(this.options.staleTime,T(this,Re));if(os||T(this,Ft).isStale||!dp(t))return;const r=_b(T(this,Ft).dataUpdatedAt,t)+1;de(this,Wi,setTimeout(()=>{T(this,Ft).isStale||this.updateResult()},r))},gp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Re)):this.options.refetchInterval)??!1},vp=function(t){Te(this,De,wp).call(this),de(this,ei,t),!(os||Un(this.options.enabled,T(this,Re))===!1||!dp(T(this,ei))||T(this,ei)===0)&&de(this,qi,setInterval(()=>{(this.options.refetchIntervalInBackground||ym.isFocused())&&Te(this,De,ta).call(this)},T(this,ei)))},yp=function(){Te(this,De,mp).call(this),Te(this,De,vp).call(this,Te(this,De,gp).call(this))},xp=function(){T(this,Wi)&&(clearTimeout(T(this,Wi)),de(this,Wi,void 0))},wp=function(){T(this,qi)&&(clearInterval(T(this,qi)),de(this,qi,void 0))},bp=function(){const t=T(this,qt).getQueryCache().build(T(this,qt),this.options);if(t===T(this,Re))return;const n=T(this,Re);de(this,Re,t),de(this,il,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Ob=function(t){pt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,Ft))}),T(this,qt).getQueryCache().notify({query:T(this,Re),type:"observerResultsUpdated"})})},a1);function _E(e,t){return Un(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Zv(e,t){return _E(e,t)||e.state.data!==void 0&&Sp(e,t,t.refetchOnMount)}function Sp(e,t,n){if(Un(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&xm(e,t)}return!1}function Jv(e,t,n,r){return(e!==t||Un(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&xm(e,n)}function xm(e,t){return Un(t.enabled,e)!==!1&&e.isStaleByTime(Ks(t.staleTime,e))}function TE(e,t){return!Yc(e.getCurrentResult(),t)}var ti,ni,Gt,Cr,Ar,fc,kp,l1,EE=(l1=class extends Ro{constructor(t,n){super();ye(this,Ar);ye(this,ti);ye(this,ni);ye(this,Gt);ye(this,Cr);de(this,ti,t),this.setOptions(n),this.bindMethods(),Te(this,Ar,fc).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,ti).defaultMutationOptions(t),Yc(this.options,n)||T(this,ti).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Gt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&as(n.mutationKey)!==as(this.options.mutationKey)?this.reset():((r=T(this,Gt))==null?void 0:r.state.status)==="pending"&&T(this,Gt).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=T(this,Gt))==null||t.removeObserver(this)}onMutationUpdate(t){Te(this,Ar,fc).call(this),Te(this,Ar,kp).call(this,t)}getCurrentResult(){return T(this,ni)}reset(){var t;(t=T(this,Gt))==null||t.removeObserver(this),de(this,Gt,void 0),Te(this,Ar,fc).call(this),Te(this,Ar,kp).call(this)}mutate(t,n){var r;return de(this,Cr,n),(r=T(this,Gt))==null||r.removeObserver(this),de(this,Gt,T(this,ti).getMutationCache().build(T(this,ti),this.options)),T(this,Gt).addObserver(this),T(this,Gt).execute(t)}},ti=new WeakMap,ni=new WeakMap,Gt=new WeakMap,Cr=new WeakMap,Ar=new WeakSet,fc=function(){var n;const t=((n=T(this,Gt))==null?void 0:n.state)??Nb();de(this,ni,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},kp=function(t){pt.batch(()=>{var n,r,i,s,o,a,l,c;if(T(this,Cr)&&this.hasListeners()){const d=T(this,ni).variables,u=T(this,ni).context;(t==null?void 0:t.type)==="success"?((r=(n=T(this,Cr)).onSuccess)==null||r.call(n,t.data,d,u),(s=(i=T(this,Cr)).onSettled)==null||s.call(i,t.data,null,d,u)):(t==null?void 0:t.type)==="error"&&((a=(o=T(this,Cr)).onError)==null||a.call(o,t.error,d,u),(c=(l=T(this,Cr)).onSettled)==null||c.call(l,void 0,t.error,d,u))}this.listeners.forEach(d=>{d(T(this,ni))})})},l1),Db=v.createContext(void 0),wm=e=>{const t=v.useContext(Db);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},AE=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(Db.Provider,{value:e,children:t})),Ib=v.createContext(!1),jE=()=>v.useContext(Ib);Ib.Provider;function RE(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ME=v.createContext(RE()),PE=()=>v.useContext(ME);function Lb(e,t){return typeof e=="function"?e(...t):!!e}function Cp(){}var NE=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},OE=e=>{v.useEffect(()=>{e.clearReset()},[e])},DE=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Lb(n,[e.error,r]),IE=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,FE=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,e0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function BE(e,t,n){var d,u,p,h,x;const r=wm(),i=jE(),s=PE(),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",IE(o),NE(o,s),OE(s);const a=!r.getQueryCache().get(o.queryHash),[l]=v.useState(()=>new t(r,o)),c=l.getOptimisticResult(o);if(v.useSyncExternalStore(v.useCallback(b=>{const S=i?Cp:l.subscribe(pt.batchCalls(b));return l.updateResult(),S},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),v.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),FE(o,c))throw e0(o,l,s);if(DE({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&&!os&&LE(c,i)){const b=a?e0(o,l,s):(x=r.getQueryCache().get(o.queryHash))==null?void 0:x.promise;b==null||b.catch(Cp).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function bm(e,t){return BE(e,CE)}function Sm(e,t){const n=wm(),[r]=v.useState(()=>new EE(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(o=>r.subscribe(pt.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=v.useCallback((o,a)=>{r.mutate(o,a).catch(Cp)},[r]);if(i.error&&Lb(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const $E=(e,t)=>bm({queryKey:["widgets",e,t],queryFn:()=>zE(e,t),retry:!1,throwOnError:!1}),zE=async(e,t)=>{const n=`widgets/with-link/${e}${t?`?device_id=${t}`:""}`,[r,i]=await pr(n);if(i===204)throw new Error("User is banned");return r};var w=(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))(w||{}),re=(e=>(e.TooltipDefault="tooltip_default",e.TooltipActive="tooltip_active",e.TooltipBalloonTitle="tooltip_balloon_title",e.TooltipBalloonSub="tooltip_balloon_sub",e.TooltipBalloonGreeting="tooltip_balloon_greeting",e.CloseButtonAria="close_button_aria",e.MessagePlaceholder="message_placeholder",e.FileUploadDisabled="file_upload_disabled",e.NewMessagesNotification="new_messages_notification",e.MinimizedUnreadMessage="minimized_unread_message",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||{}),Be=(e=>(e.Light="light",e.Dark="dark",e.System="system",e))(Be||{});function VE(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 Kc(){return Kc=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},Kc.apply(this,arguments)}var si;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(si||(si={}));function
|
|
49
|
+
*/function Kc(){return Kc=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},Kc.apply(this,arguments)}var si;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(si||(si={}));function UE(e){e===void 0&&(e={});let{initialEntries:t=["/"],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((h,x)=>d(h,typeof h=="string"?null:h.state,x===0?"default":void 0));let s=l(n??i.length-1),o=si.Pop,a=null;function l(h){return Math.min(Math.max(h,0),i.length-1)}function c(){return i[s]}function d(h,x,b){x===void 0&&(x=null);let S=WE(i?c().pathname:"/",h,x,b);return km(S.pathname.charAt(0)==="/","relative pathnames are not supported in memory history: "+JSON.stringify(h)),S}function u(h){return typeof h=="string"?h:qE(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 x=typeof h=="string"?ds(h):h;return{pathname:x.pathname||"",search:x.search||"",hash:x.hash||""}},push(h,x){o=si.Push;let b=d(h,x);s+=1,i.splice(s,i.length,b),r&&a&&a({action:o,location:b,delta:1})},replace(h,x){o=si.Replace;let b=d(h,x);i[s]=b,r&&a&&a({action:o,location:b,delta:0})},go(h){o=si.Pop;let x=l(s+h),b=i[x];s=x,a&&a({action:o,location:b,delta:h})},listen(h){return a=h,()=>{a=null}}}}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function km(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function HE(){return Math.random().toString(36).substr(2,8)}function WE(e,t,n,r){return n===void 0&&(n=null),Kc({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ds(t):t,{state:n,key:t&&t.key||r||HE()})}function qE(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 ds(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 t0;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(t0||(t0={}));function GE(e,t,n){return n===void 0&&(n="/"),YE(e,t,n,!1)}function YE(e,t,n,r){let i=typeof t=="string"?ds(t):t,s=$b(i.pathname||"/",n);if(s==null)return null;let o=Fb(e);QE(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=oA(s);a=iA(o[l],c,r)}return a}function Fb(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("/")&&(xt(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&&(xt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Fb(s.children,t,d,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:nA(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 Bb(s.path))i(s,o,l)}),t}function Bb(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=Bb(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 QE(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:rA(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const KE=/^:[\w-]+$/,XE=3,ZE=2,JE=1,eA=10,tA=-2,n0=e=>e==="*";function nA(e,t){let n=e.split("/"),r=n.length;return n.some(n0)&&(r+=tA),t&&(r+=ZE),n.filter(i=>!n0(i)).reduce((i,s)=>i+(KE.test(s)?XE:s===""?JE:eA),r)}function rA(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 iA(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=r0({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),p=l.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=r0({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:fA(Qi([s,u.pathnameBase])),route:p}),u.pathnameBase!=="/"&&(s=Qi([s,u.pathnameBase]))}return o}function r0(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=sA(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 b=a[u]||"";o=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const x=a[u];return h&&!x?c[p]=void 0:c[p]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function sA(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),km(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 oA(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return km(!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 $b(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 aA(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ds(e):e;return{pathname:n?n.startsWith("/")?n:lA(n,t):t,search:pA(r),hash:hA(i)}}function lA(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 Ld(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 cA(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function uA(e,t){let n=cA(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function dA(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ds(e):(i=Kc({},e),xt(!i.pathname||!i.pathname.includes("?"),Ld("?","pathname","search",i)),xt(!i.pathname||!i.pathname.includes("#"),Ld("#","pathname","hash",i)),xt(!i.search||!i.search.includes("#"),Ld("#","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=aA(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,"/"),fA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),pA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function mA(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const zb=["post","put","patch","delete"];new Set(zb);const gA=["get",...zb];new Set(gA);/**
|
|
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 Va(){return Va=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},Va.apply(this,arguments)}const Cm=v.createContext(null),
|
|
58
|
+
*/function Va(){return Va=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},Va.apply(this,arguments)}const Cm=v.createContext(null),vA=v.createContext(null),Ru=v.createContext(null),Mu=v.createContext(null),Mo=v.createContext({outlet:null,matches:[],isDataRoute:!1}),Vb=v.createContext(null);function Pu(){return v.useContext(Mu)!=null}function _m(){return Pu()||xt(!1),v.useContext(Mu).location}function Ub(e){v.useContext(Ru).static||v.useLayoutEffect(e)}function yA(){let{isDataRoute:e}=v.useContext(Mo);return e?MA():xA()}function xA(){Pu()||xt(!1);let e=v.useContext(Cm),{basename:t,future:n,navigator:r}=v.useContext(Ru),{matches:i}=v.useContext(Mo),{pathname:s}=_m(),o=JSON.stringify(uA(i,n.v7_relativeSplatPath)),a=v.useRef(!1);return Ub(()=>{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=dA(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 wA(e,t){return bA(e,t)}function bA(e,t,n,r){Pu()||xt(!1);let{navigator:i}=v.useContext(Ru),{matches:s}=v.useContext(Mo),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=_m(),d;if(t){var u;let S=typeof t=="string"?ds(t):t;l==="/"||(u=S.pathname)!=null&&u.startsWith(l)||xt(!1),d=S}else d=c;let p=d.pathname||"/",h=p;if(l!=="/"){let S=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=GE(e,{pathname:h}),b=TA(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:Qi([l,i.encodeLocation?i.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:Qi([l,i.encodeLocation?i.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),s,n,r);return t&&b?v.createElement(Mu.Provider,{value:{location:Va({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:si.Pop}},b):b}function SA(){let e=RA(),t=mA(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 kA=v.createElement(SA,null);class CA 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(Mo.Provider,{value:this.props.routeContext},v.createElement(Vb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _A(e){let{routeContext:t,match:n,children:r}=e,i=v.useContext(Cm);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Mo.Provider,{value:t},r)}function TA(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||xt(!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,x=u.route.loader&&p[u.route.id]===void 0&&(!h||h[u.route.id]===void 0);if(u.route.lazy||x){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,u,p)=>{let h,x=!1,b=null,S=null;n&&(h=a&&u.route.id?a[u.route.id]:void 0,b=u.route.errorElement||kA,l&&(c<0&&p===0?(x=!0,S=null):c===p&&(x=!0,S=u.route.hydrateFallbackElement||null)));let m=t.concat(o.slice(0,p+1)),g=()=>{let y;return h?y=b:x?y=S:u.route.Component?y=v.createElement(u.route.Component,null):u.route.element?y=u.route.element:y=d,v.createElement(_A,{match:u,routeContext:{outlet:d,matches:m,isDataRoute:n!=null},children:y})};return n&&(u.route.ErrorBoundary||u.route.errorElement||p===0)?v.createElement(CA,{location:n.location,revalidation:n.revalidation,component:b,error:h,children:g(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):g()},null)}var Hb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Hb||{}),Xc=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}(Xc||{});function EA(e){let t=v.useContext(Cm);return t||xt(!1),t}function AA(e){let t=v.useContext(vA);return t||xt(!1),t}function jA(e){let t=v.useContext(Mo);return t||xt(!1),t}function Wb(e){let t=jA(),n=t.matches[t.matches.length-1];return n.route.id||xt(!1),n.route.id}function RA(){var e;let t=v.useContext(Vb),n=AA(Xc.UseRouteError),r=Wb(Xc.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function MA(){let{router:e}=EA(Hb.UseNavigateStable),t=Wb(Xc.UseNavigateStable),n=v.useRef(!1);return Ub(()=>{n.current=!0}),v.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Va({fromRouteId:t},s)))},[e,t])}const i0={};function PA(e,t){i0[t]||(i0[t]=!0,console.warn(t))}const s0=(e,t,n)=>PA(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function NA(e,t){e!=null&&e.v7_startTransition||s0("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&&s0("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}const OA="startTransition",o0=D2[OA];function DA(e){let{basename:t,children:n,initialEntries:r,initialIndex:i,future:s}=e,o=v.useRef();o.current==null&&(o.current=UE({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&&o0?o0(()=>c(p)):c(p)},[c,d]);return v.useLayoutEffect(()=>a.listen(u),[a,u]),v.useEffect(()=>NA(s),[s]),v.createElement(IA,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:s})}function _p(e){xt(!1)}function IA(e){let{basename:t="/",children:n=null,location:r,navigationType:i=si.Pop,navigator:s,static:o=!1,future:a}=e;Pu()&&xt(!1);let l=t.replace(/^\/*/,"/"),c=v.useMemo(()=>({basename:l,navigator:s,static:o,future:Va({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=ds(r));let{pathname:d="/",search:u="",hash:p="",state:h=null,key:x="default"}=r,b=v.useMemo(()=>{let S=$b(d,l);return S==null?null:{location:{pathname:S,search:u,hash:p,state:h,key:x},navigationType:i}},[l,d,u,p,h,x,i]);return b==null?null:v.createElement(Ru.Provider,{value:c},v.createElement(Mu.Provider,{children:n,value:b}))}function LA(e){let{children:t,location:n}=e;return wA(Tp(t),n)}new Promise(()=>{});function Tp(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,Tp(r.props.children,s));return}r.type!==_p&&xt(!1),!r.props.index||!r.props.children||xt(!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=Tp(r.props.children,s)),n.push(o)}),n}var qb={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})()})(qb);var LA=qb.exports;const Ne=Ir(LA);function FA(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 BA=e=>{switch(e){case"success":return VA;case"info":return HA;case"warning":return UA;case"error":return WA;default:return null}},$A=Array(12).fill(0),zA=({visible:e,className:t})=>ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ne.createElement("div",{className:"sonner-spinner"},$A.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),VA=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),UA=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.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"})),HA=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),WA=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),qA=ne.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"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),GA=()=>{const[e,t]=ne.useState(document.hidden);return ne.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Ep=1;class YA{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:Ep++,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],ne.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)||Ep++;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 Yt=new YA,QA=(e,t)=>{const n=(t==null?void 0:t.id)||Ep++;return Yt.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",XA=QA,ZA=()=>Yt.toasts,JA=()=>Yt.getActiveToasts(),Gb=Object.assign(XA,{success:Yt.success,info:Yt.info,warning:Yt.warning,error:Yt.error,custom:Yt.custom,message:Yt.message,promise:Yt.promise,dismiss:Yt.dismiss,loading:Yt.loading},{getHistory:ZA,getToasts:JA});FA("[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 zl(e){return e.label!==void 0}const ej=3,tj="24px",nj="16px",a0=4e3,rj=356,ij=14,sj=45,oj=200;function Kn(...e){return e.filter(Boolean).join(" ")}function aj(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const lj=e=>{var t,n,r,i,s,o,a,l,c;const{invert:d,toast:u,unstyled:p,interacting:h,setHeights:x,visibleToasts:b,heights:S,index:m,toasts:g,expanded:y,removeToast:C,defaultRichColors:k,closeButton:_,style:E,cancelButtonStyle:A,actionButtonStyle:V,className:D="",descriptionClassName:I="",duration:O,position:$,gap:P,expandByDefault:N,classNames:L,icons:B,closeButtonAriaLabel:j="Close toast"}=e,[z,R]=ne.useState(null),[G,U]=ne.useState(null),[J,ie]=ne.useState(!1),[ge,te]=ne.useState(!1),[be,je]=ne.useState(!1),[oe,ae]=ne.useState(!1),[H,se]=ne.useState(!1),[X,ke]=ne.useState(0),[q,le]=ne.useState(0),ue=ne.useRef(u.duration||O||a0),Se=ne.useRef(null),Y=ne.useRef(null),he=m===0,pe=m+1<=b,M=u.type,K=u.dismissible!==!1,F=u.className||"",W=u.descriptionClassName||"",ce=ne.useMemo(()=>S.findIndex(Ce=>Ce.toastId===u.id)||0,[S,u.id]),me=ne.useMemo(()=>{var Ce;return(Ce=u.closeButton)!=null?Ce:_},[u.closeButton,_]),_e=ne.useMemo(()=>u.duration||O||a0,[u.duration,O]),et=ne.useRef(0),it=ne.useRef(0),Tt=ne.useRef(0),Ot=ne.useRef(null),[yr,gn]=$.split("-"),Fe=ne.useMemo(()=>S.reduce((Ce,ct,mt)=>mt>=ce?Ce:Ce+ct.height,0),[S,ce]),Dt=GA(),bs=u.invert||d,Ht=M==="loading";it.current=ne.useMemo(()=>ce*P+Fe,[ce,Fe]),ne.useEffect(()=>{ue.current=_e},[_e]),ne.useEffect(()=>{ie(!0)},[]),ne.useEffect(()=>{const Ce=Y.current;if(Ce){const ct=Ce.getBoundingClientRect().height;return le(ct),x(mt=>[{toastId:u.id,height:ct,position:u.position},...mt]),()=>x(mt=>mt.filter(It=>It.toastId!==u.id))}},[x,u.id]),ne.useLayoutEffect(()=>{if(!J)return;const Ce=Y.current,ct=Ce.style.height;Ce.style.height="auto";const mt=Ce.getBoundingClientRect().height;Ce.style.height=ct,le(mt),x(It=>It.find(bt=>bt.toastId===u.id)?It.map(bt=>bt.toastId===u.id?{...bt,height:mt}:bt):[{toastId:u.id,height:mt,position:u.position},...It])},[J,u.title,u.description,x,u.id]);const vn=ne.useCallback(()=>{te(!0),ke(it.current),x(Ce=>Ce.filter(ct=>ct.toastId!==u.id)),setTimeout(()=>{C(u)},oj)},[u,C,x,it]);ne.useEffect(()=>{if(u.promise&&M==="loading"||u.duration===1/0||u.type==="loading")return;let Ce;return y||h||Dt?(()=>{if(Tt.current<et.current){const It=new Date().getTime()-et.current;ue.current=ue.current-It}Tt.current=new Date().getTime()})():(()=>{ue.current!==1/0&&(et.current=new Date().getTime(),Ce=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),vn()},ue.current))})(),()=>clearTimeout(Ce)},[y,h,u,M,Dt,vn]),ne.useEffect(()=>{u.delete&&vn()},[vn,u.delete]);function xl(){var Ce;if(B!=null&&B.loading){var ct;return ne.createElement("div",{className:Kn(L==null?void 0:L.loader,u==null||(ct=u.classNames)==null?void 0:ct.loader,"sonner-loader"),"data-visible":M==="loading"},B.loading)}return ne.createElement(zA,{className:Kn(L==null?void 0:L.loader,u==null||(Ce=u.classNames)==null?void 0:Ce.loader),visible:M==="loading"})}var Ss,Fo;return ne.createElement("li",{tabIndex:0,ref:Y,className:Kn(D,F,L==null?void 0:L.toast,u==null||(t=u.classNames)==null?void 0:t.toast,L==null?void 0:L.default,L==null?void 0:L[M],u==null||(n=u.classNames)==null?void 0:n[M]),"data-sonner-toast":"","data-rich-colors":(Ss=u.richColors)!=null?Ss:k,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":J,"data-promise":!!u.promise,"data-swiped":H,"data-removed":ge,"data-visible":pe,"data-y-position":yr,"data-x-position":gn,"data-index":m,"data-front":he,"data-swiping":be,"data-dismissible":K,"data-type":M,"data-invert":bs,"data-swipe-out":oe,"data-swipe-direction":G,"data-expanded":!!(y||N&&J),style:{"--index":m,"--toasts-before":m,"--z-index":g.length-m,"--offset":`${ge?X:it.current}px`,"--initial-height":N?"auto":`${q}px`,...E,...u.style},onDragEnd:()=>{je(!1),R(null),Ot.current=null},onPointerDown:Ce=>{Ht||!K||(Se.current=new Date,ke(it.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(je(!0),Ot.current={x:Ce.clientX,y:Ce.clientY}))},onPointerUp:()=>{var Ce,ct,mt;if(oe||!K)return;Ot.current=null;const It=Number(((Ce=Y.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wl=Number(((ct=Y.current)==null?void 0:ct.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((mt=Se.current)==null?void 0:mt.getTime()),yn=z==="x"?It:wl,bl=Math.abs(yn)/bt;if(Math.abs(yn)>=sj||bl>.11){ke(it.current),u.onDismiss==null||u.onDismiss.call(u,u),U(z==="x"?It>0?"right":"left":wl>0?"down":"up"),vn(),ae(!0);return}else{var Nn,On;(Nn=Y.current)==null||Nn.style.setProperty("--swipe-amount-x","0px"),(On=Y.current)==null||On.style.setProperty("--swipe-amount-y","0px")}se(!1),je(!1),R(null)},onPointerMove:Ce=>{var ct,mt,It;if(!Ot.current||!K||((ct=window.getSelection())==null?void 0:ct.toString().length)>0)return;const bt=Ce.clientY-Ot.current.y,yn=Ce.clientX-Ot.current.x;var bl;const Nn=(bl=e.swipeDirections)!=null?bl:aj($);!z&&(Math.abs(yn)>1||Math.abs(bt)>1)&&R(Math.abs(yn)>Math.abs(bt)?"x":"y");let On={x:0,y:0};const Dg=Ti=>1/(1.5+Math.abs(Ti)/20);if(z==="y"){if(Nn.includes("top")||Nn.includes("bottom"))if(Nn.includes("top")&&bt<0||Nn.includes("bottom")&&bt>0)On.y=bt;else{const Ti=bt*Dg(bt);On.y=Math.abs(Ti)<Math.abs(bt)?Ti:bt}}else if(z==="x"&&(Nn.includes("left")||Nn.includes("right")))if(Nn.includes("left")&&yn<0||Nn.includes("right")&&yn>0)On.x=yn;else{const Ti=yn*Dg(yn);On.x=Math.abs(Ti)<Math.abs(yn)?Ti:yn}(Math.abs(On.x)>0||Math.abs(On.y)>0)&&se(!0),(mt=Y.current)==null||mt.style.setProperty("--swipe-amount-x",`${On.x}px`),(It=Y.current)==null||It.style.setProperty("--swipe-amount-y",`${On.y}px`)}},me&&!u.jsx&&M!=="loading"?ne.createElement("button",{"aria-label":j,"data-disabled":Ht,"data-close-button":!0,onClick:Ht||!K?()=>{}:()=>{vn(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Kn(L==null?void 0:L.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(Fo=B==null?void 0:B.close)!=null?Fo:qA):null,M||u.icon||u.promise?ne.createElement("div",{"data-icon":"",className:Kn(L==null?void 0:L.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||xl():null,u.type!=="loading"?u.icon||(B==null?void 0:B[M])||BA(M):null):null,ne.createElement("div",{"data-content":"",className:Kn(L==null?void 0:L.content,u==null||(s=u.classNames)==null?void 0:s.content)},ne.createElement("div",{"data-title":"",className:Kn(L==null?void 0:L.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?ne.createElement("div",{"data-description":"",className:Kn(I,W,L==null?void 0:L.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),ne.isValidElement(u.cancel)?u.cancel:u.cancel&&zl(u.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:Ce=>{zl(u.cancel)&&K&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ce),vn())},className:Kn(L==null?void 0:L.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,ne.isValidElement(u.action)?u.action:u.action&&zl(u.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||V,onClick:Ce=>{zl(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ce),!Ce.defaultPrevented&&vn())},className:Kn(L==null?void 0:L.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function l0(){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 cj(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?nj: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 uj=ne.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:x,visibleToasts:b=ej,toastOptions:S,dir:m=l0(),gap:g=ij,icons:y,containerAriaLabel:C="Notifications"}=t,[k,_]=ne.useState([]),E=ne.useMemo(()=>Array.from(new Set([i].concat(k.filter(G=>G.position).map(G=>G.position)))),[k,i]),[A,V]=ne.useState([]),[D,I]=ne.useState(!1),[O,$]=ne.useState(!1),[P,N]=ne.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=ne.useRef(null),B=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=ne.useRef(null),z=ne.useRef(!1),R=ne.useCallback(G=>{_(U=>{var J;return(J=U.find(ie=>ie.id===G.id))!=null&&J.delete||Yt.dismiss(G.id),U.filter(({id:ie})=>ie!==G.id)})},[]);return ne.useEffect(()=>Yt.subscribe(G=>{if(G.dismiss){const U=k.map(J=>J.id===G.id?{...J,delete:!0}:J);requestAnimationFrame(()=>{_(U)});return}setTimeout(()=>{WT.flushSync(()=>{_(U=>{const J=U.findIndex(ie=>ie.id===G.id);return J!==-1?[...U.slice(0,J),{...U[J],...G},...U.slice(J+1)]:[G,...U]})})})}),[k]),ne.useEffect(()=>{if(u!=="system"){N(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?N("dark"):N("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:U})=>{N(U?"dark":"light")})}catch{G.addListener(({matches:J})=>{try{N(J?"dark":"light")}catch(ie){console.error(ie)}})}},[u]),ne.useEffect(()=>{k.length<=1&&I(!1)},[k]),ne.useEffect(()=>{const G=U=>{var J;if(s.every(te=>U[te]||U.code===te)){var ge;I(!0),(ge=L.current)==null||ge.focus()}U.code==="Escape"&&(document.activeElement===L.current||(J=L.current)!=null&&J.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[s]),ne.useEffect(()=>{if(L.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,z.current=!1)}},[L.current]),ne.createElement("section",{ref:n,"aria-label":`${C} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((G,U)=>{var J;const[ie,ge]=G.split("-");return k.length?ne.createElement("ol",{key:G,dir:m==="auto"?l0():m,tabIndex:-1,ref:L,className:l,"data-sonner-toaster":!0,"data-sonner-theme":P,"data-y-position":ie,"data-lifted":D&&k.length>1&&!o,"data-x-position":ge,style:{"--front-toast-height":`${((J=A[0])==null?void 0:J.height)||0}px`,"--width":`${rj}px`,"--gap":`${g}px`,...x,...cj(c,d)},onBlur:te=>{z.current&&!te.currentTarget.contains(te.relatedTarget)&&(z.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||z.current||(z.current=!0,j.current=te.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{O||I(!1)},onDragEnd:()=>I(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},k.filter(te=>!te.position&&U===0||te.position===G).map((te,be)=>{var je,oe;return ne.createElement(lj,{key:te.id,icons:y,index:be,toast:te,defaultRichColors:p,duration:(je=S==null?void 0:S.duration)!=null?je:h,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:r,visibleToasts:b,closeButton:(oe=S==null?void 0:S.closeButton)!=null?oe:a,interacting:O,position:G,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:R,toasts:k.filter(ae=>ae.position==te.position),heights:A.filter(ae=>ae.position==te.position),setHeights:V,expandByDefault:o,gap:g,expanded:D,swipeDirections:t.swipeDirections})})):null}))});function on(e){return Gb.custom(t=>f.jsx(dj,{id:t,title:e.title,description:e.description,variant:e.variant}))}const Fd={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:Ne("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",Fd[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:Ne("text-sm font-medium",Fd[s||"info"].text),children:t}),f.jsx("p",{className:Ne("text-sm",Fd[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(),Gb.dismiss(i)},children:r.label})})]})}function fj(e){return Array.isArray(e)&&e[0].field!==void 0}const xo=(e,t)=>{var n;if(fj(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||on({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||on({description:e.error,variant:"error"});return}},pj=[{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ı"}],hj=[{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ı"}],Go=(e,t)=>t?`${e} (Kod: ${t})`:e,mj=(e,t)=>{if(Gn(t))return!1;if(e===null)return on({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=hj.find(s=>s.code===r);if(i)return on({description:Go(i.text,r),variant:"error"}),!0}if(t===401){if(e.tokenNotPresent)return on({description:Go("Oturum bilgisi bulunamadı. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_PRESENT"),variant:"error"}),!0;if(e.tokenNotValid)return on({description:Go("Oturum süreniz dolmuş olabilir. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_VALID"),variant:"error"}),!0;if(e.verifyRequired)return on({description:Go("Hesap doğrulaması gerekiyor. Lütfen doğrulama adımını tamamlayın","AUTH_VERIFY_REQUIRED"),variant:"error"}),!0}if(e.message)return on({description:Go(e.message,r),variant:"error"}),!0}const n=pj.find(r=>r.code===t);return on({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},gj={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"}},c0={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"}},Tm=v.createContext({});function Nu(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const Em=typeof window<"u",Yb=Em?v.useLayoutEffect:v.useEffect,Ou=v.createContext(null),Am=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class vj 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 yj({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(Am);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(`
|
|
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})()})(qb);var FA=qb.exports;const Ne=Ir(FA);function BA(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 $A=e=>{switch(e){case"success":return UA;case"info":return WA;case"warning":return HA;case"error":return qA;default:return null}},zA=Array(12).fill(0),VA=({visible:e,className:t})=>ne.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},ne.createElement("div",{className:"sonner-spinner"},zA.map((n,r)=>ne.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),UA=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),HA=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ne.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"})),WA=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),qA=ne.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ne.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"})),GA=ne.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"},ne.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ne.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),YA=()=>{const[e,t]=ne.useState(document.hidden);return ne.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Ep=1;class QA{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:Ep++,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],ne.isValidElement(c))s=!1,this.create({id:r,type:"default",message:c});else if(XA(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)||Ep++;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 Yt=new QA,KA=(e,t)=>{const n=(t==null?void 0:t.id)||Ep++;return Yt.addToast({title:e,...t,id:n}),n},XA=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",ZA=KA,JA=()=>Yt.toasts,ej=()=>Yt.getActiveToasts(),Gb=Object.assign(ZA,{success:Yt.success,info:Yt.info,warning:Yt.warning,error:Yt.error,custom:Yt.custom,message:Yt.message,promise:Yt.promise,dismiss:Yt.dismiss,loading:Yt.loading},{getHistory:JA,getToasts:ej});BA("[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 zl(e){return e.label!==void 0}const tj=3,nj="24px",rj="16px",a0=4e3,ij=356,sj=14,oj=45,aj=200;function Kn(...e){return e.filter(Boolean).join(" ")}function lj(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const cj=e=>{var t,n,r,i,s,o,a,l,c;const{invert:d,toast:u,unstyled:p,interacting:h,setHeights:x,visibleToasts:b,heights:S,index:m,toasts:g,expanded:y,removeToast:k,defaultRichColors:C,closeButton:_,style:E,cancelButtonStyle:A,actionButtonStyle:$,className:I="",descriptionClassName:D="",duration:P,position:z,gap:N,expandByDefault:O,classNames:L,icons:B,closeButtonAriaLabel:j="Close toast"}=e,[V,R]=ne.useState(null),[G,U]=ne.useState(null),[J,ie]=ne.useState(!1),[ge,te]=ne.useState(!1),[be,je]=ne.useState(!1),[oe,ae]=ne.useState(!1),[H,se]=ne.useState(!1),[X,ke]=ne.useState(0),[q,le]=ne.useState(0),ue=ne.useRef(u.duration||P||a0),Se=ne.useRef(null),Y=ne.useRef(null),he=m===0,pe=m+1<=b,M=u.type,K=u.dismissible!==!1,F=u.className||"",W=u.descriptionClassName||"",ce=ne.useMemo(()=>S.findIndex(Ce=>Ce.toastId===u.id)||0,[S,u.id]),me=ne.useMemo(()=>{var Ce;return(Ce=u.closeButton)!=null?Ce:_},[u.closeButton,_]),_e=ne.useMemo(()=>u.duration||P||a0,[u.duration,P]),et=ne.useRef(0),it=ne.useRef(0),Tt=ne.useRef(0),Ot=ne.useRef(null),[yr,gn]=z.split("-"),Fe=ne.useMemo(()=>S.reduce((Ce,ct,mt)=>mt>=ce?Ce:Ce+ct.height,0),[S,ce]),Dt=YA(),bs=u.invert||d,Ht=M==="loading";it.current=ne.useMemo(()=>ce*N+Fe,[ce,Fe]),ne.useEffect(()=>{ue.current=_e},[_e]),ne.useEffect(()=>{ie(!0)},[]),ne.useEffect(()=>{const Ce=Y.current;if(Ce){const ct=Ce.getBoundingClientRect().height;return le(ct),x(mt=>[{toastId:u.id,height:ct,position:u.position},...mt]),()=>x(mt=>mt.filter(It=>It.toastId!==u.id))}},[x,u.id]),ne.useLayoutEffect(()=>{if(!J)return;const Ce=Y.current,ct=Ce.style.height;Ce.style.height="auto";const mt=Ce.getBoundingClientRect().height;Ce.style.height=ct,le(mt),x(It=>It.find(bt=>bt.toastId===u.id)?It.map(bt=>bt.toastId===u.id?{...bt,height:mt}:bt):[{toastId:u.id,height:mt,position:u.position},...It])},[J,u.title,u.description,x,u.id]);const vn=ne.useCallback(()=>{te(!0),ke(it.current),x(Ce=>Ce.filter(ct=>ct.toastId!==u.id)),setTimeout(()=>{k(u)},aj)},[u,k,x,it]);ne.useEffect(()=>{if(u.promise&&M==="loading"||u.duration===1/0||u.type==="loading")return;let Ce;return y||h||Dt?(()=>{if(Tt.current<et.current){const It=new Date().getTime()-et.current;ue.current=ue.current-It}Tt.current=new Date().getTime()})():(()=>{ue.current!==1/0&&(et.current=new Date().getTime(),Ce=setTimeout(()=>{u.onAutoClose==null||u.onAutoClose.call(u,u),vn()},ue.current))})(),()=>clearTimeout(Ce)},[y,h,u,M,Dt,vn]),ne.useEffect(()=>{u.delete&&vn()},[vn,u.delete]);function xl(){var Ce;if(B!=null&&B.loading){var ct;return ne.createElement("div",{className:Kn(L==null?void 0:L.loader,u==null||(ct=u.classNames)==null?void 0:ct.loader,"sonner-loader"),"data-visible":M==="loading"},B.loading)}return ne.createElement(VA,{className:Kn(L==null?void 0:L.loader,u==null||(Ce=u.classNames)==null?void 0:Ce.loader),visible:M==="loading"})}var Ss,Fo;return ne.createElement("li",{tabIndex:0,ref:Y,className:Kn(I,F,L==null?void 0:L.toast,u==null||(t=u.classNames)==null?void 0:t.toast,L==null?void 0:L.default,L==null?void 0:L[M],u==null||(n=u.classNames)==null?void 0:n[M]),"data-sonner-toast":"","data-rich-colors":(Ss=u.richColors)!=null?Ss:C,"data-styled":!(u.jsx||u.unstyled||p),"data-mounted":J,"data-promise":!!u.promise,"data-swiped":H,"data-removed":ge,"data-visible":pe,"data-y-position":yr,"data-x-position":gn,"data-index":m,"data-front":he,"data-swiping":be,"data-dismissible":K,"data-type":M,"data-invert":bs,"data-swipe-out":oe,"data-swipe-direction":G,"data-expanded":!!(y||O&&J),style:{"--index":m,"--toasts-before":m,"--z-index":g.length-m,"--offset":`${ge?X:it.current}px`,"--initial-height":O?"auto":`${q}px`,...E,...u.style},onDragEnd:()=>{je(!1),R(null),Ot.current=null},onPointerDown:Ce=>{Ht||!K||(Se.current=new Date,ke(it.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(je(!0),Ot.current={x:Ce.clientX,y:Ce.clientY}))},onPointerUp:()=>{var Ce,ct,mt;if(oe||!K)return;Ot.current=null;const It=Number(((Ce=Y.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),wl=Number(((ct=Y.current)==null?void 0:ct.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),bt=new Date().getTime()-((mt=Se.current)==null?void 0:mt.getTime()),yn=V==="x"?It:wl,bl=Math.abs(yn)/bt;if(Math.abs(yn)>=oj||bl>.11){ke(it.current),u.onDismiss==null||u.onDismiss.call(u,u),U(V==="x"?It>0?"right":"left":wl>0?"down":"up"),vn(),ae(!0);return}else{var Nn,On;(Nn=Y.current)==null||Nn.style.setProperty("--swipe-amount-x","0px"),(On=Y.current)==null||On.style.setProperty("--swipe-amount-y","0px")}se(!1),je(!1),R(null)},onPointerMove:Ce=>{var ct,mt,It;if(!Ot.current||!K||((ct=window.getSelection())==null?void 0:ct.toString().length)>0)return;const bt=Ce.clientY-Ot.current.y,yn=Ce.clientX-Ot.current.x;var bl;const Nn=(bl=e.swipeDirections)!=null?bl:lj(z);!V&&(Math.abs(yn)>1||Math.abs(bt)>1)&&R(Math.abs(yn)>Math.abs(bt)?"x":"y");let On={x:0,y:0};const Dg=Ti=>1/(1.5+Math.abs(Ti)/20);if(V==="y"){if(Nn.includes("top")||Nn.includes("bottom"))if(Nn.includes("top")&&bt<0||Nn.includes("bottom")&&bt>0)On.y=bt;else{const Ti=bt*Dg(bt);On.y=Math.abs(Ti)<Math.abs(bt)?Ti:bt}}else if(V==="x"&&(Nn.includes("left")||Nn.includes("right")))if(Nn.includes("left")&&yn<0||Nn.includes("right")&&yn>0)On.x=yn;else{const Ti=yn*Dg(yn);On.x=Math.abs(Ti)<Math.abs(yn)?Ti:yn}(Math.abs(On.x)>0||Math.abs(On.y)>0)&&se(!0),(mt=Y.current)==null||mt.style.setProperty("--swipe-amount-x",`${On.x}px`),(It=Y.current)==null||It.style.setProperty("--swipe-amount-y",`${On.y}px`)}},me&&!u.jsx&&M!=="loading"?ne.createElement("button",{"aria-label":j,"data-disabled":Ht,"data-close-button":!0,onClick:Ht||!K?()=>{}:()=>{vn(),u.onDismiss==null||u.onDismiss.call(u,u)},className:Kn(L==null?void 0:L.closeButton,u==null||(r=u.classNames)==null?void 0:r.closeButton)},(Fo=B==null?void 0:B.close)!=null?Fo:GA):null,M||u.icon||u.promise?ne.createElement("div",{"data-icon":"",className:Kn(L==null?void 0:L.icon,u==null||(i=u.classNames)==null?void 0:i.icon)},u.promise||u.type==="loading"&&!u.icon?u.icon||xl():null,u.type!=="loading"?u.icon||(B==null?void 0:B[M])||$A(M):null):null,ne.createElement("div",{"data-content":"",className:Kn(L==null?void 0:L.content,u==null||(s=u.classNames)==null?void 0:s.content)},ne.createElement("div",{"data-title":"",className:Kn(L==null?void 0:L.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?ne.createElement("div",{"data-description":"",className:Kn(D,W,L==null?void 0:L.description,u==null||(a=u.classNames)==null?void 0:a.description)},typeof u.description=="function"?u.description():u.description):null),ne.isValidElement(u.cancel)?u.cancel:u.cancel&&zl(u.cancel)?ne.createElement("button",{"data-button":!0,"data-cancel":!0,style:u.cancelButtonStyle||A,onClick:Ce=>{zl(u.cancel)&&K&&(u.cancel.onClick==null||u.cancel.onClick.call(u.cancel,Ce),vn())},className:Kn(L==null?void 0:L.cancelButton,u==null||(l=u.classNames)==null?void 0:l.cancelButton)},u.cancel.label):null,ne.isValidElement(u.action)?u.action:u.action&&zl(u.action)?ne.createElement("button",{"data-button":!0,"data-action":!0,style:u.actionButtonStyle||$,onClick:Ce=>{zl(u.action)&&(u.action.onClick==null||u.action.onClick.call(u.action,Ce),!Ce.defaultPrevented&&vn())},className:Kn(L==null?void 0:L.actionButton,u==null||(c=u.classNames)==null?void 0:c.actionButton)},u.action.label):null)};function l0(){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 uj(e,t){const n={};return[e,t].forEach((r,i)=>{const s=i===1,o=s?"--mobile-offset":"--offset",a=s?rj:nj;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 dj=ne.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:x,visibleToasts:b=tj,toastOptions:S,dir:m=l0(),gap:g=sj,icons:y,containerAriaLabel:k="Notifications"}=t,[C,_]=ne.useState([]),E=ne.useMemo(()=>Array.from(new Set([i].concat(C.filter(G=>G.position).map(G=>G.position)))),[C,i]),[A,$]=ne.useState([]),[I,D]=ne.useState(!1),[P,z]=ne.useState(!1),[N,O]=ne.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),L=ne.useRef(null),B=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=ne.useRef(null),V=ne.useRef(!1),R=ne.useCallback(G=>{_(U=>{var J;return(J=U.find(ie=>ie.id===G.id))!=null&&J.delete||Yt.dismiss(G.id),U.filter(({id:ie})=>ie!==G.id)})},[]);return ne.useEffect(()=>Yt.subscribe(G=>{if(G.dismiss){const U=C.map(J=>J.id===G.id?{...J,delete:!0}:J);requestAnimationFrame(()=>{_(U)});return}setTimeout(()=>{qT.flushSync(()=>{_(U=>{const J=U.findIndex(ie=>ie.id===G.id);return J!==-1?[...U.slice(0,J),{...U[J],...G},...U.slice(J+1)]:[G,...U]})})})}),[C]),ne.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:U})=>{O(U?"dark":"light")})}catch{G.addListener(({matches:J})=>{try{O(J?"dark":"light")}catch(ie){console.error(ie)}})}},[u]),ne.useEffect(()=>{C.length<=1&&D(!1)},[C]),ne.useEffect(()=>{const G=U=>{var J;if(s.every(te=>U[te]||U.code===te)){var ge;D(!0),(ge=L.current)==null||ge.focus()}U.code==="Escape"&&(document.activeElement===L.current||(J=L.current)!=null&&J.contains(document.activeElement))&&D(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[s]),ne.useEffect(()=>{if(L.current)return()=>{j.current&&(j.current.focus({preventScroll:!0}),j.current=null,V.current=!1)}},[L.current]),ne.createElement("section",{ref:n,"aria-label":`${k} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},E.map((G,U)=>{var J;const[ie,ge]=G.split("-");return C.length?ne.createElement("ol",{key:G,dir:m==="auto"?l0():m,tabIndex:-1,ref:L,className:l,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":ie,"data-lifted":I&&C.length>1&&!o,"data-x-position":ge,style:{"--front-toast-height":`${((J=A[0])==null?void 0:J.height)||0}px`,"--width":`${ij}px`,"--gap":`${g}px`,...x,...uj(c,d)},onBlur:te=>{V.current&&!te.currentTarget.contains(te.relatedTarget)&&(V.current=!1,j.current&&(j.current.focus({preventScroll:!0}),j.current=null))},onFocus:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||V.current||(V.current=!0,j.current=te.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{P||D(!1)},onDragEnd:()=>D(!1),onPointerDown:te=>{te.target instanceof HTMLElement&&te.target.dataset.dismissible==="false"||z(!0)},onPointerUp:()=>z(!1)},C.filter(te=>!te.position&&U===0||te.position===G).map((te,be)=>{var je,oe;return ne.createElement(cj,{key:te.id,icons:y,index:be,toast:te,defaultRichColors:p,duration:(je=S==null?void 0:S.duration)!=null?je:h,className:S==null?void 0:S.className,descriptionClassName:S==null?void 0:S.descriptionClassName,invert:r,visibleToasts:b,closeButton:(oe=S==null?void 0:S.closeButton)!=null?oe:a,interacting:P,position:G,style:S==null?void 0:S.style,unstyled:S==null?void 0:S.unstyled,classNames:S==null?void 0:S.classNames,cancelButtonStyle:S==null?void 0:S.cancelButtonStyle,actionButtonStyle:S==null?void 0:S.actionButtonStyle,closeButtonAriaLabel:S==null?void 0:S.closeButtonAriaLabel,removeToast:R,toasts:C.filter(ae=>ae.position==te.position),heights:A.filter(ae=>ae.position==te.position),setHeights:$,expandByDefault:o,gap:g,expanded:I,swipeDirections:t.swipeDirections})})):null}))});function on(e){return Gb.custom(t=>f.jsx(fj,{id:t,title:e.title,description:e.description,variant:e.variant}))}const Fd={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 fj(e){const{title:t,description:n,button:r,id:i,variant:s}=e;return f.jsxs("div",{className:Ne("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",Fd[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:Ne("text-sm font-medium",Fd[s||"info"].text),children:t}),f.jsx("p",{className:Ne("text-sm",Fd[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(),Gb.dismiss(i)},children:r.label})})]})}function pj(e){return Array.isArray(e)&&e[0].field!==void 0}const xo=(e,t)=>{var n;if(pj(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||on({description:e.message,variant:"error"});return}if(e&&e.error){t!=null&&t.noToast||on({description:e.error,variant:"error"});return}},hj=[{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ı"}],mj=[{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ı"}],Go=(e,t)=>t?`${e} (Kod: ${t})`:e,gj=(e,t)=>{if(Gn(t))return!1;if(e===null)return on({description:"Bir hata oluştu",variant:"error"}),!0;if(typeof e=="object"&&e){const r=e.code;if(r){const i=mj.find(s=>s.code===r);if(i)return on({description:Go(i.text,r),variant:"error"}),!0}if(t===401){if(e.tokenNotPresent)return on({description:Go("Oturum bilgisi bulunamadı. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_PRESENT"),variant:"error"}),!0;if(e.tokenNotValid)return on({description:Go("Oturum süreniz dolmuş olabilir. Lütfen sohbeti yeniden başlatın","AUTH_TOKEN_NOT_VALID"),variant:"error"}),!0;if(e.verifyRequired)return on({description:Go("Hesap doğrulaması gerekiyor. Lütfen doğrulama adımını tamamlayın","AUTH_VERIFY_REQUIRED"),variant:"error"}),!0}if(e.message)return on({description:Go(e.message,r),variant:"error"}),!0}const n=hj.find(r=>r.code===t);return on({description:n?n.text:"Bir hata oluştu",variant:"error"}),!0},vj={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"}},c0={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"}},Tm=v.createContext({});function Nu(e){const t=v.useRef(null);return t.current===null&&(t.current=e()),t.current}const Em=typeof window<"u",Yb=Em?v.useLayoutEffect:v.useEffect,Ou=v.createContext(null),Am=v.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class yj 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 xj({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(Am);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(h)}},[t]),f.jsx(vj,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const xj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=Nu(wj),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(yj,{isPresent:n,anchorX:a,children:e})),f.jsx(Ou.Provider,{value:u,children:e})};function wj(){return new Map}function Qb(e=!0){const t=v.useContext(Ou);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 Vl=e=>e.key||"";function u0(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Nr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=Qb(o),d=v.useMemo(()=>u0(e),[e]),u=o&&!l?[]:d.map(Vl),p=v.useRef(!0),h=v.useRef(d),x=Nu(()=>new Map),[b,S]=v.useState(d),[m,g]=v.useState(d);Yb(()=>{p.current=!1,h.current=d;for(let k=0;k<m.length;k++){const _=Vl(m[k]);u.includes(_)?x.delete(_):x.get(_)!==!0&&x.set(_,!1)}},[m,u.length,u.join("-")]);const y=[];if(d!==b){let k=[...d];for(let _=0;_<m.length;_++){const E=m[_],A=Vl(E);u.includes(A)||(k.splice(_,0,E),y.push(E))}return s==="wait"&&y.length&&(k=y),g(u0(k)),S(d),null}const{forceRender:C}=v.useContext(Tm);return f.jsx(f.Fragment,{children:m.map(k=>{const _=Vl(k),E=o&&!l?!1:d===m||u.includes(_),A=()=>{if(x.has(_))x.set(_,!0);else return;let V=!0;x.forEach(D=>{D||(V=!1)}),V&&(C==null||C(),g(h.current),o&&(c==null||c()),r&&r())};return f.jsx(xj,{isPresent:E,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:E?void 0:A,anchorX:a,children:k},_)})})};function jm(e,t){e.indexOf(t)===-1&&e.push(t)}function Rm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let Ap=()=>{};const jp={skipAnimations:!1,useManualTiming:!1};function Mm(e){let t;return()=>(t===void 0&&(t=e()),t)}const Rn=e=>e,Ua=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Pm{constructor(){this.subscriptions=[]}add(t){return jm(this.subscriptions,t),()=>Rm(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 lr=e=>e*1e3,cr=e=>e/1e3;function Kb(e,t){return t?e*(1e3/t):0}const bj=Mm(()=>window.ScrollTimeline!==void 0);class Sj{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(bj()&&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 kj extends Sj{then(t,n){return this.finished.finally(t).then(()=>{})}}const d0={value:null,addProjectionMetrics:null},Nm=e=>Array.isArray(e)&&typeof e[0]=="number",Cj={};function _j(e,t){const n=Mm(e);return()=>Cj[t]??n()}const Ha=_j(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xb=(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)})`},na=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Rp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:na([0,.65,.55,1]),circOut:na([.55,0,1,.45]),backIn:na([.31,.01,.66,-.59]),backOut:na([.33,1.53,.69,.99])};function Zb(e,t){if(e)return typeof e=="function"&&Ha()?Xb(e,t):Nm(e)?na(e):Array.isArray(e)?e.map(n=>Zb(n,t)||Rp.easeOut):Rp[e]}function Tj(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=Zb(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 Om(e){return typeof e=="function"&&"applyToOptions"in e}function Dm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Zc=2e4;function Im(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 Ej(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Im(r),Zc);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:cr(i)}}function Jb(e){return!!(typeof e=="function"&&Ha()||!e||typeof e=="string"&&(e in Rp||Ha())||Nm(e)||Array.isArray(e)&&e.every(Jb))}function f0(e,t){e.timeline=t,e.onfinish=null}const Ul=["read","resolveKeyframes","update","preRender","render","postRender"];function Aj(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 b=h&&i?n:r;return p&&o.add(u),b.has(u)||b.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&&d0.value&&d0.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const jj=40;function eS(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Ul.reduce((m,g)=>(m[g]=Aj(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,jj),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))},x=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Ul.reduce((m,g)=>{const y=o[g];return m[g]=(C,k=!1,_=!1)=>(n||x(),y.schedule(C,k,_)),m},{}),cancel:m=>{for(let g=0;g<Ul.length;g++)o[Ul[g]].cancel(m)},state:i,steps:o}}const{schedule:Lm,cancel:z8}=eS(queueMicrotask,!1),{schedule:Ue,cancel:yi,state:kt,steps:Bd}=eS(typeof requestAnimationFrame<"u"?requestAnimationFrame:Rn,!0);let pc;function Rj(){pc=void 0}const ur={now:()=>(pc===void 0&&ur.set(kt.isProcessing||jp.useManualTiming?kt.timestamp:performance.now()),pc),set:e=>{pc=e,queueMicrotask(Rj)}},Ln={x:!1,y:!1};function tS(){return Ln.x||Ln.y}function Mj(e){return e==="x"||e==="y"?Ln[e]?null:(Ln[e]=!0,()=>{Ln[e]=!1}):Ln.x||Ln.y?null:(Ln.x=Ln.y=!0,()=>{Ln.x=Ln.y=!1})}function Pj(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 nS(e,t){const n=Pj(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function p0(e){return!(e.pointerType==="touch"||tS())}function Nj(e,t,n={}){const[r,i,s]=nS(e,n),o=a=>{if(!p0(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{p0(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const rS=(e,t)=>t?e===t?!0:rS(e,t.parentElement):!1,Fm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Oj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Dj(e){return Oj.has(e.tagName)||e.tabIndex!==-1}const ra=new WeakSet;function h0(e){return t=>{t.key==="Enter"&&e(t)}}function $d(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Ij=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=h0(()=>{if(ra.has(n))return;$d(n,"down");const i=h0(()=>{$d(n,"up")}),s=()=>$d(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 m0(e){return Fm(e)&&!tS()}function Lj(e,t,n={}){const[r,i,s]=nS(e,n),o=a=>{const l=a.currentTarget;if(!m0(a)||ra.has(l))return;ra.add(l);const c=t(l,a),d=(h,x)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!m0(h)||!ra.has(l))&&(ra.delete(l),typeof c=="function"&&c(h,{success:x}))},u=h=>{d(h,l===window||l===document||n.useGlobalTarget||rS(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=>Ij(c,i)),!Dj(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const g0=30,Fj=e=>!isNaN(parseFloat(e));class Bj{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=ur.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=ur.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Fj(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 Pm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.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=ur.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>g0)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,g0);return Kb(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 Wa(e,t){return new Bj(e,t)}const iS=v.createContext({strict:!1}),v0={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"]},wo={};for(const e in v0)wo[e]={isEnabled:t=>v0[e].some(n=>!!t[n])};function $j(e){for(const t in e)wo[t]={...wo[t],...e[t]}}const zj=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 Jc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||zj.has(e)}let sS=e=>!Jc(e);function Vj(e){e&&(sS=t=>t.startsWith("on")?!Jc(t):e(t))}try{Vj(require("@emotion/is-prop-valid").default)}catch{}function Uj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(sS(i)||n===!0&&Jc(i)||!t&&!Jc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Hj(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 Du=v.createContext({});function Iu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function qa(e){return typeof e=="string"||Array.isArray(e)}const Bm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$m=["initial",...Bm];function Lu(e){return Iu(e.animate)||$m.some(t=>qa(e[t]))}function oS(e){return!!(Lu(e)||e.variants)}function Wj(e,t){if(Lu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||qa(n)?n:void 0,animate:qa(r)?r:void 0}}return e.inherit!==!1?t:{}}function qj(e){const{initial:t,animate:n}=Wj(e,v.useContext(Du));return v.useMemo(()=>({initial:t,animate:n}),[y0(t),y0(n)])}function y0(e){return Array.isArray(e)?e.join(" "):e}const Gj=Symbol.for("motionComponentSymbol");function Ls(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Yj(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):Ls(n)&&(n.current=r))},[t])}const zm=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qj="framerAppearId",aS="data-"+zm(Qj),lS=v.createContext({});function Kj(e,t,n,r,i){var b,S;const{visualElement:s}=v.useContext(Du),o=v.useContext(iS),a=v.useContext(Ou),l=v.useContext(Am).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(lS);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&Xj(c.current,n,i,u);const p=v.useRef(!1);v.useInsertionEffect(()=>{d&&p.current&&d.update(n,a)});const h=n[aS],x=v.useRef(!!h&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,h))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,h)));return Yb(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Lm.render(d.render),x.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!x.current&&d.animationState&&d.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,h)}),x.current=!1))}),d}function Xj(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:cS(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ls(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function cS(e){if(e)return e.options.allowProjection!==!1?e.projection:cS(e.parent)}function Zj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&$j(e);function s(a,l){let c;const d={...v.useContext(Am),...a,layoutId:Jj(a)},{isStatic:u}=d,p=qj(a),h=r(a,u);if(!u&&Em){e5();const x=t5(d);c=x.MeasureLayout,p.visualElement=Kj(i,h,d,t,x.ProjectionNode)}return f.jsxs(Du.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,n(i,a,Yj(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[Gj]=i,o}function Jj({layoutId:e}){const t=v.useContext(Tm).id;return t&&e!==void 0?t+"-"+e:e}function e5(e,t){v.useContext(iS).strict}function t5(e){const{drag:t,layout:n}=wo;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 uS=e=>t=>typeof t=="string"&&t.startsWith(e),Vm=uS("--"),n5=uS("var(--"),Um=e=>n5(e)?r5.test(e.split("/*")[0].trim()):!1,r5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ga={};function i5(e){for(const t in e)Ga[t]=e[t],Vm(t)&&(Ga[t].isCSSVariable=!0)}const Po=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fs=new Set(Po);function dS(e,{layout:t,layoutId:n}){return fs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ga[e]||e==="opacity")}const Pt=e=>!!(e&&e.getVelocity),fS=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Or=(e,t,n)=>n>t?t:n<e?e:n,No={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ya={...No,transform:e=>Or(0,1,e)},Hl={...No,default:1},dl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zr=dl("deg"),dr=dl("%"),we=dl("px"),s5=dl("vh"),o5=dl("vw"),x0={...dr,parse:e=>dr.parse(e)/100,transform:e=>dr.transform(e*100)},a5={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,backgroundPositionX:we,backgroundPositionY:we},l5={rotate:zr,rotateX:zr,rotateY:zr,rotateZ:zr,scale:Hl,scaleX:Hl,scaleY:Hl,scaleZ:Hl,skew:zr,skewX:zr,skewY:zr,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:Ya,originX:x0,originY:x0,originZ:we},w0={...No,transform:Math.round},Hm={...a5,...l5,zIndex:w0,size:we,fillOpacity:Ya,strokeOpacity:Ya,numOctaves:w0},c5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},u5=Po.length;function d5(e,t,n){let r="",i=!0;for(let s=0;s<u5;s++){const o=Po[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=fS(a,Hm[o]);if(!l){i=!1;const d=c5[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Wm(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(fs.has(l)){o=!0;continue}else if(Vm(l)){i[l]=c;continue}else{const d=fS(c,Hm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=d5(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 qm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function pS(e,t,n){for(const r in t)!Pt(t[r])&&!dS(r,n)&&(e[r]=t[r])}function f5({transformTemplate:e},t){return v.useMemo(()=>{const n=qm();return Wm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function p5(e,t){const n=e.style||{},r={};return pS(r,n,e),Object.assign(r,f5(e,t)),r}function h5(e,t){const n={},r=p5(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 m5=["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 Gm(e){return typeof e!="string"||e.includes("-")?!1:!!(m5.indexOf(e)>-1||/[A-Z]/u.test(e))}const g5={offset:"stroke-dashoffset",array:"stroke-dasharray"},v5={offset:"strokeDashoffset",array:"strokeDasharray"};function y5(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?g5:v5;e[s.offset]=we.transform(-r);const o=we.transform(t),a=we.transform(n);e[s.array]=`${o} ${a}`}function b0(e,t,n){return typeof e=="string"?e:we.transform(t+n*e)}function x5(e,t,n){const r=b0(t,e.x,e.width),i=b0(n,e.y,e.height);return`${r} ${i}`}function Ym(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Wm(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:x}=e;p.transform&&(x&&(h.transform=p.transform),delete p.transform),x&&(i!==void 0||s!==void 0||h.transform)&&(h.transformOrigin=x5(x,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&&y5(p,o,a,l,!1)}const hS=()=>({...qm(),attrs:{}}),Qm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function w5(e,t,n,r){const i=v.useMemo(()=>{const s=hS();return Ym(s,t,Qm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};pS(s,e.style,e),i.style={...s,...i.style}}return i}function b5(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Gm(n)?w5:h5)(r,s,o,n),c=Uj(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,p=v.useMemo(()=>Pt(u)?u.get():u,[u]);return v.createElement(n,{...d,children:p})}}function S0(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Km(e,t,n,r){if(typeof t=="function"){const[i,s]=S0(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]=S0(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const Mp=e=>Array.isArray(e),S5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),k5=e=>Mp(e)?e[e.length-1]||0:e;function hc(e){const t=Pt(e)?e.get():e;return S5(t)?t.toValue():t}function C5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:_5(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const mS=e=>(t,n)=>{const r=v.useContext(Du),i=v.useContext(Ou),s=()=>C5(e,t,r,i);return n?s():Nu(s)};function _5(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=hc(s[p]);let{initial:o,animate:a}=e;const l=Lu(e),c=oS(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"&&!Iu(u)){const p=Array.isArray(u)?u:[u];for(let h=0;h<p.length;h++){const x=Km(e,p[h]);if(x){const{transitionEnd:b,transition:S,...m}=x;for(const g in m){let y=m[g];if(Array.isArray(y)){const C=d?y.length-1:0;y=y[C]}y!==null&&(i[g]=y)}for(const g in b)i[g]=b[g]}}}return i}function Xm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(Pt(r[o])||t.style&&Pt(t.style[o])||dS(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const T5={useVisualState:mS({scrapeMotionValuesFromProps:Xm,createRenderState:qm})};function gS(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 vS(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 yS=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 xS(e,t,n,r){vS(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(yS.has(i)?i:zm(i),t.attrs[i])}function wS(e,t,n){const r=Xm(e,t,n);for(const i in e)if(Pt(e[i])||Pt(t[i])){const s=Po.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const k0=["x","y","width","height","cx","cy","r"],E5={useVisualState:mS({scrapeMotionValuesFromProps:wS,createRenderState:hS,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(fs.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<k0.length;a++){const l=k0[a];e[l]!==t[l]&&(o=!0)}o&&Ue.read(()=>{gS(n,r),Ue.render(()=>{Ym(r,i,Qm(n.tagName),e.transformTemplate),xS(n,r)})})}})};function A5(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Gm(r)?E5:T5,preloadedFeatures:e,useRender:b5(i),createVisualElement:t,Component:r};return Zj(o)}}function Qa(e,t,n){const r=e.getProps();return Km(r,t,n!==void 0?n:r.custom,e)}const bS=new Set(["width","height","top","left","right","bottom",...Po]);function j5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wa(n))}function R5(e,t){const n=Qa(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=k5(s[o]);j5(e,o,a)}}function M5(e){return!!(Pt(e)&&e.add)}function Pp(e,t){const n=e.getValue("willChange");if(M5(n))return n.add(t);if(!n&&jp.WillChange){const r=new jp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function SS(e){return e.props[aS]}const kS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,P5=1e-7,N5=12;function O5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=kS(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>P5&&++a<N5);return o}function fl(e,t,n,r){if(e===t&&n===r)return Rn;const i=s=>O5(s,0,1,e,n);return s=>s===0||s===1?s:kS(i(s),t,r)}const CS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_S=e=>t=>1-e(1-t),TS=fl(.33,1.53,.69,.99),Zm=_S(TS),ES=CS(Zm),AS=e=>(e*=2)<1?.5*Zm(e):.5*(2-Math.pow(2,-10*(e-1))),Jm=e=>1-Math.sin(Math.acos(e)),jS=_S(Jm),RS=CS(Jm),MS=e=>/^0[^.\s]+$/u.test(e);function D5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||MS(e):!0}const va=e=>Math.round(e*1e5)/1e5,eg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function I5(e){return e==null}const L5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tg=(e,t)=>n=>!!(typeof n=="string"&&L5.test(n)&&n.startsWith(e)||t&&!I5(n)&&Object.prototype.hasOwnProperty.call(n,t)),PS=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(eg);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},F5=e=>Or(0,255,e),zd={...No,transform:e=>Math.round(F5(e))},Li={test:tg("rgb","red"),parse:PS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zd.transform(e)+", "+zd.transform(t)+", "+zd.transform(n)+", "+va(Ya.transform(r))+")"};function B5(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 Np={test:tg("#"),parse:B5,transform:Li.transform},Fs={test:tg("hsl","hue"),parse:PS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dr.transform(va(t))+", "+dr.transform(va(n))+", "+va(Ya.transform(r))+")"},Rt={test:e=>Li.test(e)||Np.test(e)||Fs.test(e),parse:e=>Li.test(e)?Li.parse(e):Fs.test(e)?Fs.parse(e):Np.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Li.transform(e):Fs.transform(e)},$5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function z5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(eg))==null?void 0:t.length)||0)+(((n=e.match($5))==null?void 0:n.length)||0)>0}const NS="number",OS="color",V5="var",U5="var(",C0="${}",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 Ka(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(H5,l=>(Rt.test(l)?(r.color.push(s),i.push(OS),n.push(Rt.parse(l))):l.startsWith(U5)?(r.var.push(s),i.push(V5),n.push(l)):(r.number.push(s),i.push(NS),n.push(parseFloat(l))),++s,C0)).split(C0);return{values:n,split:a,indexes:r,types:i}}function DS(e){return Ka(e).values}function IS(e){const{split:t,types:n}=Ka(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===NS?s+=va(i[o]):a===OS?s+=Rt.transform(i[o]):s+=i[o]}return s}}const W5=e=>typeof e=="number"?0:e;function q5(e){const t=DS(e);return IS(e)(t.map(W5))}const xi={test:z5,parse:DS,createTransformer:IS,getAnimatableNone:q5},G5=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(eg)||[];if(!r)return e;const i=n.replace(r,"");let s=G5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const Q5=/\b([a-z-]*)\(.*?\)/gu,Op={...xi,getAnimatableNone:e=>{const t=e.match(Q5);return t?t.map(Y5).join(" "):e}},K5={...Hm,color:Rt,backgroundColor:Rt,outlineColor:Rt,fill:Rt,stroke:Rt,borderColor:Rt,borderTopColor:Rt,borderRightColor:Rt,borderBottomColor:Rt,borderLeftColor:Rt,filter:Op,WebkitFilter:Op},LS=e=>K5[e];function FS(e,t){let n=LS(e);return n!==Op&&(n=xi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const X5=new Set(["auto","none","0"]);function Z5(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!X5.has(s)&&Ka(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=FS(n,i)}const Fi=e=>e*180/Math.PI,Dp=e=>{const t=Fi(Math.atan2(e[1],e[0]));return Ip(t)},J5={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Dp,rotateZ:Dp,skewX:e=>Fi(Math.atan(e[1])),skewY:e=>Fi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ip=e=>(e=e%360,e<0&&(e+=360),e),_0=Dp,T0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),E0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),e3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:T0,scaleY:E0,scale:e=>(T0(e)+E0(e))/2,rotateX:e=>Ip(Fi(Math.atan2(e[6],e[5]))),rotateY:e=>Ip(Fi(Math.atan2(-e[2],e[0]))),rotateZ:_0,rotate:_0,skewX:e=>Fi(Math.atan(e[4])),skewY:e=>Fi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function A0(e){return e.includes("scale")?1:0}function Lp(e,t){if(!e||e==="none")return A0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=e3,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=J5,i=a}if(!i)return A0(t);const s=r[t],o=i[1].split(",").map(n3);return typeof s=="function"?s(o):o[s]}const t3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Lp(n,t)};function n3(e){return parseFloat(e.trim())}const j0=e=>e===No||e===we,r3=new Set(["x","y","z"]),i3=Po.filter(e=>!r3.has(e));function s3(e){const t=[];return i3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const bo={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})=>Lp(t,"x"),y:(e,{transform:t})=>Lp(t,"y")};bo.translateX=bo.x;bo.translateY=bo.y;const Ki=new Set;let Fp=!1,Bp=!1;function BS(){if(Bp){const e=Array.from(Ki).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=s3(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)})}Bp=!1,Fp=!1,Ki.forEach(e=>e.complete()),Ki.clear()}function $S(){Ki.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bp=!0)})}function o3(){$S(),BS()}class ng{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?(Ki.add(this),Fp||(Fp=!0,Ue.read($S),Ue.resolveKeyframes(BS))):(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),Ki.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ki.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const zS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),a3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function l3(e){const t=a3.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function VS(e,t,n=1){const[r,i]=l3(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return zS(o)?parseFloat(o):o}return Um(i)?VS(i,t,n+1):i}const US=e=>t=>t.test(e),c3={test:e=>e==="auto",parse:e=>e},HS=[No,we,dr,zr,o5,s5,c3],R0=e=>HS.find(US(e));class WS extends ng{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(),Um(c))){const d=VS(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!bS.has(r)||t.length!==2)return;const[i,s]=t,o=R0(i),a=R0(s);if(o!==a)if(j0(o)&&j0(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++)D5(t[i])&&r.push(i);r.length&&Z5(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=bo[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]=bo[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 M0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(xi.test(e)||e==="0")&&!e.startsWith("url("));function u3(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 d3(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=M0(i,t),a=M0(s,t);return!o||!a?!1:u3(e)||(n==="spring"||Om(n))&&r}const f3=e=>e!==null;function Fu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(f3),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const p3=40;class qS{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=ur.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>p3?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&o3(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ur.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!d3(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Fu(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 Xe=(e,t,n)=>e+(t-e)*n;function Vd(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 h3({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=Vd(l,a,e+1/3),s=Vd(l,a,e),o=Vd(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function eu(e,t){return n=>n>0?t:e}const Ud=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},m3=[Np,Li,Fs],g3=e=>m3.find(t=>t.test(e));function P0(e){const t=g3(e);if(!t)return!1;let n=t.parse(e);return t===Fs&&(n=h3(n)),n}const N0=(e,t)=>{const n=P0(e),r=P0(t);if(!n||!r)return eu(e,t);const i={...n};return s=>(i.red=Ud(n.red,r.red,s),i.green=Ud(n.green,r.green,s),i.blue=Ud(n.blue,r.blue,s),i.alpha=Xe(n.alpha,r.alpha,s),Li.transform(i))},v3=(e,t)=>n=>t(e(n)),pl=(...e)=>e.reduce(v3),$p=new Set(["none","hidden"]);function y3(e,t){return $p.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function x3(e,t){return n=>Xe(e,t,n)}function rg(e){return typeof e=="number"?x3:typeof e=="string"?Um(e)?eu:Rt.test(e)?N0:S3:Array.isArray(e)?GS:typeof e=="object"?Rt.test(e)?N0:w3:eu}function GS(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>rg(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function w3(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=rg(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function b3(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 S3=(e,t)=>{const n=xi.createTransformer(t),r=Ka(e),i=Ka(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?$p.has(e)&&!i.values.length||$p.has(t)&&!r.values.length?y3(e,t):pl(GS(b3(r,i),i.values),n):eu(e,t)};function YS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Xe(e,t,n):rg(e)(e,t)}const k3=5;function QS(e,t,n){const r=Math.max(t-k3,0);return Kb(n-e(r),t-r)}const nt={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},Hd=.001;function C3({duration:e=nt.duration,bounce:t=nt.bounce,velocity:n=nt.velocity,mass:r=nt.mass}){let i,s,o=1-t;o=Or(nt.minDamping,nt.maxDamping,o),e=Or(nt.minDuration,nt.maxDuration,cr(e)),o<1?(i=c=>{const d=c*o,u=d*e,p=d-n,h=zp(c,o),x=Math.exp(-u);return Hd-p/h*x},s=c=>{const u=c*o*e,p=u*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,x=Math.exp(-u),b=zp(Math.pow(c,2),o);return(-i(c)+Hd>0?-1:1)*((p-h)*x)/b}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Hd+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=T3(i,s,a);if(e=lr(e),isNaN(l))return{stiffness:nt.stiffness,damping:nt.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const _3=12;function T3(e,t,n){let r=n;for(let i=1;i<_3;i++)r=r-e(r)/t(r);return r}function zp(e,t){return e*Math.sqrt(1-t*t)}const E3=["duration","bounce"],A3=["stiffness","damping","mass"];function O0(e,t){return t.some(n=>e[n]!==void 0)}function j3(e){let t={velocity:nt.velocity,stiffness:nt.stiffness,damping:nt.damping,mass:nt.mass,isResolvedFromDuration:!1,...e};if(!O0(e,A3)&&O0(e,E3))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Or(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:nt.mass,stiffness:i,damping:s}}else{const n=C3(e);t={...t,...n,mass:nt.mass},t.isResolvedFromDuration=!0}return t}function tu(e=nt.visualDuration,t=nt.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}=j3({...n,velocity:-cr(n.velocity||0)}),x=p||0,b=c/(2*Math.sqrt(l*d)),S=o-s,m=cr(Math.sqrt(l/d)),g=Math.abs(S)<5;r||(r=g?nt.restSpeed.granular:nt.restSpeed.default),i||(i=g?nt.restDelta.granular:nt.restDelta.default);let y;if(b<1){const k=zp(m,b);y=_=>{const E=Math.exp(-b*m*_);return o-E*((x+b*m*S)/k*Math.sin(k*_)+S*Math.cos(k*_))}}else if(b===1)y=k=>o-Math.exp(-m*k)*(S+(x+m*S)*k);else{const k=m*Math.sqrt(b*b-1);y=_=>{const E=Math.exp(-b*m*_),A=Math.min(k*_,300);return o-E*((x+b*m*S)*Math.sinh(A)+k*S*Math.cosh(A))/k}}const C={calculatedDuration:h&&u||null,next:k=>{const _=y(k);if(h)a.done=k>=u;else{let E=0;b<1&&(E=k===0?lr(x):QS(y,k,_));const A=Math.abs(E)<=r,V=Math.abs(o-_)<=i;a.done=A&&V}return a.value=a.done?o:_,a},toString:()=>{const k=Math.min(Im(C),Zc),_=Xb(E=>C.next(k*E).value,k,30);return k+"ms "+_},toTransition:()=>{}};return C}tu.applyToOptions=e=>{const t=Ej(e,100,tu);return e.ease=Ha()?t.ease:"easeOut",e.duration=lr(t.duration),e.type="keyframes",e};function D0({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,x=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let b=n*t;const S=u+b,m=o===void 0?S:o(S);m!==S&&(b=m-u);const g=A=>-b*Math.exp(-A/r),y=A=>m+g(A),C=A=>{const V=g(A),D=y(A);p.done=Math.abs(V)<=c,p.value=p.done?m:D};let k,_;const E=A=>{h(p.value)&&(k=A,_=tu({keyframes:[p.value,x(p.value)],velocity:QS(y,A,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return E(0),{calculatedDuration:null,next:A=>{let V=!1;return!_&&k===void 0&&(V=!0,C(A),E(A)),k!==void 0&&A>=k?_.next(A-k):(!V&&C(A),p)}}}const R3=fl(.42,0,1,1),M3=fl(0,0,.58,1),KS=fl(.42,0,.58,1),P3=e=>Array.isArray(e)&&typeof e[0]!="number",I0={linear:Rn,easeIn:R3,easeInOut:KS,easeOut:M3,circIn:Jm,circInOut:RS,circOut:jS,backIn:Zm,backInOut:ES,backOut:TS,anticipate:AS},L0=e=>{if(Nm(e)){Ap(e.length===4);const[t,n,r,i]=e;return fl(t,n,r,i)}else if(typeof e=="string")return Ap(I0[e]!==void 0),I0[e];return e};function N3(e,t,n){const r=[],i=n||YS,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]||Rn:t;a=pl(l,a)}r.push(a)}return r}function O3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Ap(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=N3(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=Ua(e[u],e[u+1],d);return a[u](p)};return n?d=>c(Or(e[0],e[s-1],d)):c}function D3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ua(0,t,r);e.push(Xe(n,1,i))}}function I3(e){const t=[0];return D3(t,e.length-1),t}function L3(e,t){return e.map(n=>n*t)}function F3(e,t){return e.map(()=>t||KS).splice(0,e.length-1)}function nu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=P3(r)?r.map(L0):L0(r),s={done:!1,value:t[0]},o=L3(n&&n.length===t.length?n:I3(t),e),a=O3(o,t,{ease:Array.isArray(i)?i:F3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const B3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ue.update(t,!0),stop:()=>yi(t),now:()=>kt.isProcessing?kt.timestamp:ur.now()}},$3={decay:D0,inertia:D0,tween:nu,keyframes:nu,spring:tu},z3=e=>e/100;class ig extends qS{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)||ng,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=Om(n)?n:$3[n]||nu;let l,c;a!==nu&&typeof t[0]!="number"&&(l=pl(z3,YS(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=Im(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:x,repeatDelay:b,onUpdate:S}=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 y=this.currentTime,C=s;if(h){const A=Math.min(this.currentTime,d)/u;let V=Math.floor(A),D=A%1;!D&&A>=1&&(D=1),D===1&&V--,V=Math.min(V,h+1),!!(V%2)&&(x==="reverse"?(D=1-D,b&&(D-=b/u)):x==="mirror"&&(C=o)),y=Or(0,1,D)*u}const k=g?{done:!1,value:l[0]}:C.next(y);a&&(k.value=a(k.value));let{done:_}=k;!g&&c!==null&&(_=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return E&&i!==void 0&&(k.value=Fu(l,this.options,i)),S&&S(k.value),E&&this.finish(),k}get duration(){const{resolved:t}=this;return t?cr(t.calculatedDuration):0}get time(){return cr(this.currentTime)}set time(t){t=lr(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=cr(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=B3,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 V3=new Set(["opacity","clipPath","filter","transform"]),U3=Mm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ru=10,H3=2e4;function W3(e){return Om(e.type)||e.type==="spring"||!Jb(e.ease)}function q3(e,t){const n=new ig({...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+=ru;return{times:void 0,keyframes:i,duration:s-ru,ease:"linear"}}const XS={anticipate:AS,backInOut:ES,circInOut:RS};function G3(e){return e in XS}class F0 extends qS{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new WS(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"&&Ha()&&G3(s)&&(s=XS[s]),W3(this.options)){const{onComplete:u,onUpdate:p,motionValue:h,element:x,...b}=this.options,S=q3(t,b);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,i=S.times,s=S.ease,o="keyframes"}const d=Tj(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(f0(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Fu(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 cr(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return cr(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=lr(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 Rn;const{animation:r}=n;f0(r,t)}return Rn}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,x=new ig({...h,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=lr(this.time);c.setWithVelocity(x.sample(b-ru).value,x.sample(b).value,ru)}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 U3()&&r&&V3.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const Y3={type:"spring",stiffness:500,damping:25,restSpeed:10},Q3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),K3={type:"keyframes",duration:.8},X3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Z3=(e,{keyframes:t})=>t.length>2?K3:fs.has(e)?e.startsWith("scale")?Q3(t[1]):Y3:X3;function J3({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 sg=(e,t,n,r={},i,s)=>o=>{const a=Dm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-lr(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};J3(a)||(d={...d,...Z3(e,d)}),d.duration&&(d.duration=lr(d.duration)),d.repeatDelay&&(d.repeatDelay=lr(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=Fu(d.keyframes,a);if(p!==void 0)return Ue.update(()=>{d.onUpdate(p),d.onComplete()}),new kj([])}return!s&&F0.supports(d)?new F0(d):new ig(d)};function eR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ZS(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&&eR(c,d))continue;const h={delay:n,...Dm(s||{},d)};let x=!1;if(window.MotionHandoffAnimation){const S=SS(e);if(S){const m=window.MotionHandoffAnimation(S,d,Ue);m!==null&&(h.startTime=m,x=!0)}}Pp(e,d),u.start(sg(d,u,p,e.shouldReduceMotion&&bS.has(d)?{type:!1}:h,e,x));const b=u.animation;b&&l.push(b)}return o&&Promise.all(l).then(()=>{Ue.update(()=>{o&&R5(e,o)})}),l}function Vp(e,t,n={}){var l;const r=Qa(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(ZS(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=i;return tR(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 tR(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(nR).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Vp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function nR(e,t){return e.sortNodePosition(t)}function rR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Vp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Vp(e,t,n);else{const i=typeof t=="function"?Qa(e,t,n.custom):t;r=Promise.all(ZS(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function JS(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 iR=$m.length;function ek(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ek(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<iR;n++){const r=$m[n],i=e.props[r];(qa(i)||i===!1)&&(t[r]=i)}return t}const sR=[...Bm].reverse(),oR=Bm.length;function aR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>rR(e,n,r)))}function lR(e){let t=aR(e),n=B0(),r=!0;const i=l=>(c,d)=>{var p;const u=Qa(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:h,transitionEnd:x,...b}=u;c={...c,...b,...x}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=ek(e.parent)||{},u=[],p=new Set;let h={},x=1/0;for(let S=0;S<oR;S++){const m=sR[S],g=n[m],y=c[m]!==void 0?c[m]:d[m],C=qa(y),k=m===l?g.isActive:null;k===!1&&(x=S);let _=y===d[m]&&y!==c[m]&&C;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),g.protectedKeys={...h},!g.isActive&&k===null||!y&&!g.prevProp||Iu(y)||typeof y=="boolean")continue;const E=cR(g.prevProp,y);let A=E||m===l&&g.isActive&&!_&&C||S>x&&C,V=!1;const D=Array.isArray(y)?y:[y];let I=D.reduce(i(m),{});k===!1&&(I={});const{prevResolvedValues:O={}}=g,$={...O,...I},P=B=>{A=!0,p.has(B)&&(V=!0,p.delete(B)),g.needsAnimating[B]=!0;const j=e.getValue(B);j&&(j.liveStyle=!1)};for(const B in $){const j=I[B],z=O[B];if(h.hasOwnProperty(B))continue;let R=!1;Mp(j)&&Mp(z)?R=!JS(j,z):R=j!==z,R?j!=null?P(B):p.add(B):j!==void 0&&p.has(B)?P(B):g.protectedKeys[B]=!0}g.prevProp=y,g.prevResolvedValues=I,g.isActive&&(h={...h,...I}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(_&&E)||V)&&u.push(...D.map(B=>({animation:B,options:{type:m}})))}if(p.size){const S={};if(typeof c.initial!="boolean"){const m=Qa(e,Array.isArray(c.initial)?c.initial[0]:c.initial);m&&m.transition&&(S.transition=m.transition)}p.forEach(m=>{const g=e.getBaseTarget(m),y=e.getValue(m);y&&(y.liveStyle=!0),S[m]=g??null}),u.push({animation:S})}let b=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?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=B0(),r=!0}}}function cR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!JS(t,e):!1}function Ei(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function B0(){return{animate:Ei(!0),whileInView:Ei(),whileHover:Ei(),whileTap:Ei(),whileDrag:Ei(),whileFocus:Ei(),exit:Ei()}}class Ci{constructor(t){this.isMounted=!1,this.node=t}update(){}}class uR extends Ci{constructor(t){super(t),t.animationState||(t.animationState=lR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Iu(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 dR=0;class fR extends Ci{constructor(){super(...arguments),this.id=dR++}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 pR={animation:{Feature:uR},exit:{Feature:fR}};function Xa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function hl(e){return{point:{x:e.pageX,y:e.pageY}}}const hR=e=>t=>Fm(t)&&e(t,hl(t));function ya(e,t,n,r){return Xa(e,t,hR(n),r)}function tk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function mR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function gR(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 nk=1e-4,vR=1-nk,yR=1+nk,rk=.01,xR=0-rk,wR=0+rk;function $t(e){return e.max-e.min}function bR(e,t,n){return Math.abs(e-t)<=n}function $0(e,t,n,r=.5){e.origin=r,e.originPoint=Xe(t.min,t.max,e.origin),e.scale=$t(n)/$t(t),e.translate=Xe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vR&&e.scale<=yR||isNaN(e.scale))&&(e.scale=1),(e.translate>=xR&&e.translate<=wR||isNaN(e.translate))&&(e.translate=0)}function xa(e,t,n,r){$0(e.x,t.x,n.x,r?r.originX:void 0),$0(e.y,t.y,n.y,r?r.originY:void 0)}function z0(e,t,n){e.min=n.min+t.min,e.max=e.min+$t(t)}function SR(e,t,n){z0(e.x,t.x,n.x),z0(e.y,t.y,n.y)}function V0(e,t,n){e.min=t.min-n.min,e.max=e.min+$t(t)}function wa(e,t,n){V0(e.x,t.x,n.x),V0(e.y,t.y,n.y)}const U0=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bs=()=>({x:U0(),y:U0()}),H0=()=>({min:0,max:0}),st=()=>({x:H0(),y:H0()});function bn(e){return[e("x"),e("y")]}function Wd(e){return e===void 0||e===1}function Up({scale:e,scaleX:t,scaleY:n}){return!Wd(e)||!Wd(t)||!Wd(n)}function Mi(e){return Up(e)||ik(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ik(e){return W0(e.x)||W0(e.y)}function W0(e){return e&&e!=="0%"}function iu(e,t,n){const r=e-n,i=t*r;return n+i}function q0(e,t,n,r,i){return i!==void 0&&(e=iu(e,i,r)),iu(e,n,r)+t}function Hp(e,t=0,n=1,r,i){e.min=q0(e.min,t,n,r,i),e.max=q0(e.max,t,n,r,i)}function sk(e,{x:t,y:n}){Hp(e.x,t.translate,t.scale,t.originPoint),Hp(e.y,n.translate,n.scale,n.originPoint)}const G0=.999999999999,Y0=1.0000000000001;function kR(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&&zs(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,sk(e,o)),r&&Mi(s.latestValues)&&zs(e,s.latestValues))}t.x<Y0&&t.x>G0&&(t.x=1),t.y<Y0&&t.y>G0&&(t.y=1)}function $s(e,t){e.min=e.min+t,e.max=e.max+t}function Q0(e,t,n,r,i=.5){const s=Xe(e.min,e.max,i);Hp(e,t,n,s,r)}function zs(e,t){Q0(e.x,t.x,t.scaleX,t.scale,t.originX),Q0(e.y,t.y,t.scaleY,t.scale,t.originY)}function ok(e,t){return tk(gR(e.getBoundingClientRect(),t))}function CR(e,t,n){const r=ok(e,n),{scroll:i}=t;return i&&($s(r.x,i.offset.x),$s(r.y,i.offset.y)),r}const ak=({current:e})=>e?e.ownerDocument.defaultView:null,K0=(e,t)=>Math.abs(e-t);function _R(e,t){const n=K0(e.x,t.x),r=K0(e.y,t.y);return Math.sqrt(n**2+r**2)}class lk{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=Gd(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=_R(u.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:x}=u,{timestamp:b}=kt;this.history.push({...x,timestamp:b});const{onStart:S,onMove:m}=this.handlers;p||(S&&S(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=qd(p,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:h,onSessionEnd:x,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=Gd(u.type==="pointercancel"?this.lastMoveEventInfo:qd(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,S),x&&x(u,S)},!Fm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=hl(t),a=qd(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=kt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Gd(a,this.history)),this.removeListeners=pl(ya(this.contextWindow,"pointermove",this.handlePointerMove),ya(this.contextWindow,"pointerup",this.handlePointerUp),ya(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),yi(this.updatePoint)}}function qd(e,t){return t?{point:t(e.point)}:e}function X0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Gd({point:e},t){return{point:e,delta:X0(e,ck(t)),offset:X0(e,TR(t)),velocity:ER(t,.1)}}function TR(e){return e[0]}function ck(e){return e[e.length-1]}function ER(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=ck(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>lr(t)));)n--;if(!r)return{x:0,y:0};const s=cr(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 AR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Xe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Xe(n,e,r.max):Math.min(e,n)),e}function Z0(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 jR(e,{top:t,left:n,bottom:r,right:i}){return{x:Z0(e.x,n,i),y:Z0(e.y,t,r)}}function J0(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 RR(e,t){return{x:J0(e.x,t.x),y:J0(e.y,t.y)}}function MR(e,t){let n=.5;const r=$t(e),i=$t(t);return i>r?n=Ua(t.min,t.max-r,e.min):r>i&&(n=Ua(e.min,e.max-i,t.min)),Or(0,1,n)}function PR(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 Wp=.35;function NR(e=Wp){return e===!1?e=0:e===!0&&(e=Wp),{x:ey(e,"left","right"),y:ey(e,"top","bottom")}}function ey(e,t,n){return{min:ty(e,t),max:ty(e,n)}}function ty(e,t){return typeof e=="number"?e:e[t]||0}const OR=new WeakMap;class DR{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=st(),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(hl(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:h,onDragStart:x}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Mj(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),bn(S=>{let m=this.getAxisMotionValue(S).get()||0;if(dr.test(m)){const{projection:g}=this.visualElement;if(g&&g.layout){const y=g.layout.layoutBox[S];y&&(m=$t(y)*(parseFloat(m)/100))}}this.originPoint[S]=m}),x&&Ue.postRender(()=>x(d,u)),Pp(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:x,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:S}=u;if(h&&this.currentDirection===null){this.currentDirection=IR(S),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",u.point,S),this.updateAxis("y",u.point,S),this.visualElement.render(),b&&b(d,u)},a=(d,u)=>this.stop(d,u),l=()=>bn(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 lk(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:ak(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&&Ue.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||!Wl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=AR(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&&Ls(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=jR(r.layoutBox,t):this.constraints=!1,this.elastic=NR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&bn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=PR(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ls(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=CR(r,i.root,this.visualElement.getTransformPagePoint());let o=RR(i.layout.layoutBox,s);if(n){const a=n(mR(o));this.hasMutatedConstraints=!!a,a&&(o=tk(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=bn(d=>{if(!Wl(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,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,x)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Pp(this.visualElement,t),r.start(sg(t,r,0,n,this.visualElement,!1))}stopAnimation(){bn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){bn(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){bn(n=>{const{drag:r}=this.getProps();if(!Wl(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]-Xe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ls(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};bn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=MR({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(),bn(o=>{if(!Wl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Xe(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;OR.set(this.visualElement,this);const t=this.visualElement.current,n=ya(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ls(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()),Ue.read(r);const o=Xa(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(bn(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=Wp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Wl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function IR(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class LR extends Ci{constructor(t){super(t),this.removeGroupControls=Rn,this.removeListeners=Rn,this.controls=new DR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rn}unmount(){this.removeGroupControls(),this.removeListeners()}}const ny=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class FR extends Ci{constructor(){super(...arguments),this.removePointerDownListener=Rn}onPointerDown(t){this.session=new lk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ak(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ny(t),onStart:ny(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Ue.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ya(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 mc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ry(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Yo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(we.test(e))e=parseFloat(e);else return e;const n=ry(e,t.target.x),r=ry(e,t.target.y);return`${n}% ${r}%`}},BR={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=xi.parse(e);if(i.length>5)return r;const s=xi.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=Xe(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 $R extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;i5(zR),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()})),mc.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()||Ue.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Lm.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]=Qb(),r=v.useContext(Tm);return f.jsx($R,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(lS),isPresent:t,safeToRemove:n})}const zR={borderRadius:{...Yo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yo,borderTopRightRadius:Yo,borderBottomLeftRadius:Yo,borderBottomRightRadius:Yo,boxShadow:BR};function VR(e,t,n){const r=Pt(e)?e:Wa(e);return r.start(sg("",r,t,n)),r.animation}function UR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const HR=(e,t)=>e.depth-t.depth;class WR{constructor(){this.children=[],this.isDirty=!1}add(t){jm(this.children,t),this.isDirty=!0}remove(t){Rm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(HR),this.isDirty=!1,this.children.forEach(t)}}function qR(e,t){const n=ur.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(yi(r),e(s-t))};return Ue.read(r,!0),()=>yi(r)}const dk=["TopLeft","TopRight","BottomLeft","BottomRight"],GR=dk.length,iy=e=>typeof e=="string"?parseFloat(e):e,sy=e=>typeof e=="number"||we.test(e);function YR(e,t,n,r,i,s){i?(e.opacity=Xe(0,n.opacity??1,QR(r)),e.opacityExit=Xe(t.opacity??1,0,KR(r))):s&&(e.opacity=Xe(t.opacity??1,n.opacity??1,r));for(let o=0;o<GR;o++){const a=`border${dk[o]}Radius`;let l=oy(t,a),c=oy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||sy(l)===sy(c)?(e[a]=Math.max(Xe(iy(l),iy(c),r),0),(dr.test(c)||dr.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Xe(t.rotate||0,n.rotate||0,r))}function oy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const QR=fk(0,.5,jS),KR=fk(.5,.95,Rn);function fk(e,t,n){return r=>r<e?0:r>t?1:n(Ua(e,t,r))}function ay(e,t){e.min=t.min,e.max=t.max}function xn(e,t){ay(e.x,t.x),ay(e.y,t.y)}function ly(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function cy(e,t,n,r,i){return e-=t,e=iu(e,1/n,r),i!==void 0&&(e=iu(e,1/i,r)),e}function XR(e,t=0,n=1,r=.5,i,s=e,o=e){if(dr.test(t)&&(t=parseFloat(t),t=Xe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Xe(s.min,s.max,r);e===s&&(a-=t),e.min=cy(e.min,t,n,a,i),e.max=cy(e.max,t,n,a,i)}function uy(e,t,[n,r,i],s,o){XR(e,t[n],t[r],t[i],t.scale,s,o)}const ZR=["x","scaleX","originX"],JR=["y","scaleY","originY"];function dy(e,t,n,r){uy(e.x,t,ZR,n?n.x:void 0,r?r.x:void 0),uy(e.y,t,JR,n?n.y:void 0,r?r.y:void 0)}function fy(e){return e.translate===0&&e.scale===1}function pk(e){return fy(e.x)&&fy(e.y)}function py(e,t){return e.min===t.min&&e.max===t.max}function eM(e,t){return py(e.x,t.x)&&py(e.y,t.y)}function hy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function hk(e,t){return hy(e.x,t.x)&&hy(e.y,t.y)}function my(e){return $t(e.x)/$t(e.y)}function gy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class tM{constructor(){this.members=[]}add(t){jm(this.members,t),t.scheduleRender()}remove(t){if(Rm(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 nM(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:x}=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) `),x&&(r+=`skewY(${x}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 Yd=["","X","Y","Z"],rM={visibility:"hidden"},vy=1e3;let iM=0;function Qd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function mk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=SS(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&mk(r)}function gk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=iM++,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(aM),this.nodes.forEach(fM),this.nodes.forEach(pM),this.nodes.forEach(lM)},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 WR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Pm),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=UR(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=qR(p,250),mc.hasAnimatedSinceResize&&(mc.hasAnimatedSinceResize=!1,this.nodes.forEach(xy))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||yM,{onLayoutAnimationStart:S,onLayoutAnimationComplete:m}=d.getProps(),g=!this.targetLayout||!hk(this.targetLayout,x),y=!p&&h;if(this.options.layoutRoot||this.resumeFrom||y||p&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,y);const C={...Dm(b,"layout"),onPlay:S,onComplete:m};(d.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else p||xy(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,yi(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(hM),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&&mk(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(yy);return}this.isUpdating||this.nodes.forEach(uM),this.isUpdating=!1,this.nodes.forEach(dM),this.nodes.forEach(sM),this.nodes.forEach(oM),this.clearAllSnapshots();const a=ur.now();kt.delta=Or(0,1e3/60,a-kt.timestamp),kt.timestamp=a,kt.isProcessing=!0,Bd.update.process(kt),Bd.preRender.process(kt),Bd.render.process(kt),kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Lm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cM),this.sharedNodes.forEach(mM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$t(this.snapshot.measuredBox.x)&&!$t(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=st(),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&&!pk(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||Mi(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)),xM(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return st();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(wM))){const{scroll:d}=this.root;d&&($s(a.x,d.offset.x),$s(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=st();if(xn(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&&xn(a,o),$s(a.x,u.offset.x),$s(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=st();xn(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&&zs(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Mi(d.latestValues)&&zs(l,d.latestValues)}return Mi(this.latestValues)&&zs(l,this.latestValues),l}removeTransform(o){const a=st();xn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Mi(c.latestValues))continue;Up(c.latestValues)&&c.updateSnapshot();const d=st(),u=c.measurePageBox();xn(d,u),dy(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return Mi(this.latestValues)&&dy(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!==kt.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=kt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=st(),this.relativeTargetOrigin=st(),wa(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),xn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=st(),this.targetWithTransforms=st()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),SR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xn(this.target,this.layout.layoutBox),sk(this.target,this.targetDelta)):xn(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=st(),this.relativeTargetOrigin=st(),wa(this.relativeTargetOrigin,this.target,h.target),xn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Up(this.parent.latestValues)||ik(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 x;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===kt.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;xn(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;kR(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=st());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ly(this.prevProjectionDelta.x,this.projectionDelta.x),ly(this.prevProjectionDelta.y,this.projectionDelta.y)),xa(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!gy(this.projectionDelta.x,this.prevProjectionDelta.x)||!gy(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=Bs(),this.projectionDelta=Bs(),this.projectionDeltaWithTransform=Bs()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Bs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=st(),h=l?l.source:void 0,x=this.layout?this.layout.source:void 0,b=h!==x,S=this.getStack(),m=!S||S.members.length<=1,g=!!(b&&!m&&this.options.crossfade===!0&&!this.path.some(vM));this.animationProgress=0;let y;this.mixTargetDelta=C=>{const k=C/1e3;wy(u.x,o.x,k),wy(u.y,o.y,k),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(wa(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),gM(this.relativeTarget,this.relativeTargetOrigin,p,k),y&&eM(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=st()),xn(y,this.relativeTarget)),b&&(this.animationValues=d,YR(d,c,this.latestValues,k,g,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},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&&(yi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{mc.hasAnimatedSinceResize=!0,this.currentAnimation=VR(0,vy,{...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(vy),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&&vk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||st();const u=$t(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=$t(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}xn(a,l),zs(a,d),xa(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new tM),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&&Qd("z",o,c,this.animationValues);for(let d=0;d<Yd.length;d++)Qd(`rotate${Yd[d]}`,o,c,this.animationValues),Qd(`skew${Yd[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 rM;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=hc(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=hc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Mi(this.latestValues)&&(h.transform=l?l({},""):"none",this.hasProjected=!1),h}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=nM(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 Ga){if(d[h]===void 0)continue;const{correct:x,applyTo:b,isCSSVariable:S}=Ga[h],m=a.transform==="none"?d[h]:x(d[h],c);if(b){const g=b.length;for(let y=0;y<g;y++)a[b[y]]=m}else S?this.options.visualElement.renderState.vars[h]=m:a[h]=m}return this.options.layoutId&&(a.pointerEvents=c===this?hc(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(yy),this.root.sharedNodes.clear()}}}function sM(e){e.updateLayout()}function oM(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"?bn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=$t(p);p.min=r[u].min,p.max=p.min+h}):vk(s,t.layoutBox,r)&&bn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=$t(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=Bs();xa(a,r,t.layoutBox);const l=Bs();o?xa(l,e.applyTransform(i,!0),t.measuredBox):xa(l,r,t.layoutBox);const c=!pk(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 x=st();wa(x,t.layoutBox,p.layoutBox);const b=st();wa(b,r,h.layoutBox),hk(x,b)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=x,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 aM(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 lM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cM(e){e.clearSnapshot()}function yy(e){e.clearMeasurements()}function uM(e){e.isLayoutDirty=!1}function dM(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function xy(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function fM(e){e.resolveTargetDelta()}function pM(e){e.calcProjection()}function hM(e){e.resetSkewAndRotation()}function mM(e){e.removeLeadSnapshot()}function wy(e,t,n){e.translate=Xe(t.translate,0,n),e.scale=Xe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function by(e,t,n,r){e.min=Xe(t.min,n.min,r),e.max=Xe(t.max,n.max,r)}function gM(e,t,n,r){by(e.x,t.x,n.x,r),by(e.y,t.y,n.y,r)}function vM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const yM={duration:.45,ease:[.4,0,.1,1]},Sy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ky=Sy("applewebkit/")&&!Sy("chrome/")?Math.round:Rn;function Cy(e){e.min=ky(e.min),e.max=ky(e.max)}function xM(e){Cy(e.x),Cy(e.y)}function vk(e,t,n){return e==="position"||e==="preserve-aspect"&&!bR(my(t),my(n),.2)}function wM(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const bM=gk({attachResizeListener:(e,t)=>Xa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Kd={current:void 0},yk=gk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Kd.current){const e=new bM({});e.mount(window),e.setOptions({layoutScroll:!0}),Kd.current=e}return Kd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),SM={pan:{Feature:FR},drag:{Feature:LR,ProjectionNode:yk,MeasureLayout:uk}};function _y(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&&Ue.postRender(()=>s(t,hl(t)))}class kM extends Ci{mount(){const{current:t}=this.node;t&&(this.unmount=Nj(t,(n,r)=>(_y(this.node,r,"Start"),i=>_y(this.node,i,"End"))))}unmount(){}}class CM extends Ci{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=pl(Xa(this.node.current,"focus",()=>this.onFocus()),Xa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ty(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&&Ue.postRender(()=>s(t,hl(t)))}class _M extends Ci{mount(){const{current:t}=this.node;t&&(this.unmount=Lj(t,(n,r)=>(Ty(this.node,r,"Start"),(i,{success:s})=>Ty(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const qp=new WeakMap,Xd=new WeakMap,TM=e=>{const t=qp.get(e.target);t&&t(e)},EM=e=>{e.forEach(TM)};function AM({root:e,...t}){const n=e||document;Xd.has(n)||Xd.set(n,{});const r=Xd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(EM,{root:e,...t})),r[i]}function jM(e,t,n){const r=AM(t);return qp.set(e,n),r.observe(e),()=>{qp.delete(e),r.unobserve(e)}}const RM={some:0,all:1};class MM extends Ci{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:RM[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 jM(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(PM(t,n))&&this.startObserver()}unmount(){}}function PM({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const NM={inView:{Feature:MM},tap:{Feature:_M},focus:{Feature:CM},hover:{Feature:kM}},OM={layout:{ProjectionNode:yk,MeasureLayout:uk}},Gp={current:null},xk={current:!1};function DM(){if(xk.current=!0,!!Em)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gp.current=e.matches;e.addListener(t),t()}else Gp.current=!1}const IM=[...HS,Rt,xi],LM=e=>IM.find(US(e)),FM=new WeakMap;function BM(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Pt(i))e.addValue(r,i);else if(Pt(s))e.addValue(r,Wa(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,Wa(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ey=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class $M{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=ng,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=ur.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Ue.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=Lu(n),this.isVariantNode=oS(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 x=p[h];l[h]!==void 0&&Pt(x)&&x.set(l[h],!1)}}mount(t){this.current=t,FM.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)),xk.current||DM(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Gp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),yi(this.notifyUpdate),yi(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=fs.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Ue.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 wo){const n=wo[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):st()}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<Ey.length;r++){const i=Ey[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=BM(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=Wa(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"&&(zS(r)||MS(r))?r=parseFloat(r):!LM(r)&&xi.test(n)&&(r=FS(t,n)),this.setBaseTarget(t,Pt(r)?r.get():r)),Pt(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=Km(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&&!Pt(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 Pm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class wk extends $M{constructor(){super(...arguments),this.KeyframeResolver=WS}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;Pt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function zM(e){return window.getComputedStyle(e)}class VM extends wk{constructor(){super(...arguments),this.type="html",this.renderInstance=vS}readValueFromInstance(t,n){if(fs.has(n))return t3(t,n);{const r=zM(t),i=(Vm(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ok(t,n)}build(t,n,r){Wm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Xm(t,n,r)}}class UM extends wk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=st,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&gS(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(fs.has(n)){const r=LS(n);return r&&r.default||0}return n=yS.has(n)?n:zm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return wS(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ue.postRender(this.updateDimensions)}build(t,n,r){Ym(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){xS(t,n,r,i)}mount(t){this.isSVGTag=Qm(t.tagName),super.mount(t)}}const HM=(e,t)=>Gm(e)?new UM(t):new VM(t,{allowProjection:e!==v.Fragment}),WM=A5({...pR,...NM,...SM,...OM},HM),Oe=Hj(WM);class qM{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 GM=()=>new qM;function YM(){return Nu(GM)}var Hr=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(Hr||{});const bk=v.createContext({}),QM={[re.TooltipDefault]:"Bizimle sohbet edin!",[re.TooltipActive]:"Yeni mesajlar var!",[re.TooltipBalloonTitle]:"Canlı Destek",[re.TooltipBalloonSub]:"Size nasıl yardımcı olabilirim?",[re.TooltipBalloonGreeting]:"Merhaba, ben {name} 👋",[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.MinimizedUnreadMessage]:"{count} Yeni Mesaj",[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"},KM={[w.Background]:"#ffffff",[w.Border]:"#e2e8f0",[w.TooltipText]:"#1e40af",[w.TooltipBackground]:"#dbeafe",[w.TooltipBorder]:"#3b82f6",[w.HeaderBackground]:"#ffffff",[w.HeaderBorder]:"#e2e8f0",[w.HeaderText]:"#1e293b",[w.FooterBackground]:"#f8fafc",[w.FooterBorder]:"#e2e8f0",[w.FooterText]:"#475569",[w.MessageAdminBackground]:"#f1f5f9",[w.MessageAdminText]:"#334155",[w.MessageVisitorBackground]:"#3b82f6",[w.MessageVisitorText]:"#ffffff",[w.MessageAgentBackground]:"#ede9fe",[w.MessageAgentText]:"#5b21b6",[w.GreeterBackground]:"#ffffff",[w.GreeterText]:"#334155",[w.GreeterBorder]:"#e2e8f0",[w.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[w.GreeterTopText]:"#ffffff",[w.GreeterButtonBackground]:"#3b82f6",[w.GreeterButtonText]:"#ffffff",[w.ButtonBackground]:"#3b82f6",[w.ButtonText]:"#ffffff",[w.InputBackground]:"#f8fafc",[w.InputText]:"#1e293b",[w.InputBorder]:"#e2e8f0",[w.CloseButtonBackground]:"#f1f5f9",[w.CloseButtonText]:"#475569",[w.CloseButtonHover]:"#e2e8f0",[w.IconColor]:"#64748b",[w.IconBackground]:"transparent",[w.ErrorBackground]:"#fef2f2",[w.ErrorText]:"#dc2626",[w.ErrorBorder]:"#fca5a5",[w.SuccessBackground]:"#f0fdf4",[w.SuccessText]:"#16a34a",[w.SuccessBorder]:"#86efac",[w.WarningBackground]:"#fffbeb",[w.WarningText]:"#d97706",[w.WarningBorder]:"#fcd34d",[w.LinkColor]:"#2563eb",[w.LinkHoverColor]:"#1d4ed8",[w.DividerColor]:"#e2e8f0",[w.ShadowColor]:"rgba(0, 0, 0, 0.1)",[w.StarActiveColor]:"#f59e0b",[w.StarInactiveColor]:"#e2e8f0",[w.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[w.ChatCloseConfirmText]:"#dc2626",[w.RatingHeaderBackground]:"#3b82f6",[w.RatingHeaderText]:"#ffffff",[w.RatingSuccessBackground]:"#ffffff",[w.RatingSuccessText]:"#334155",[w.RatingRateConversationText]:"#1e293b"},XM={[w.Background]:"#0a0a0a",[w.Border]:"#262626",[w.TooltipText]:"#e5e5e5",[w.TooltipBackground]:"#262626",[w.TooltipBorder]:"#404040",[w.HeaderBackground]:"#171717",[w.HeaderBorder]:"#262626",[w.HeaderText]:"#fafafa",[w.FooterBackground]:"#0a0a0a",[w.FooterBorder]:"#262626",[w.FooterText]:"#a3a3a3",[w.MessageAdminBackground]:"#262626",[w.MessageAdminText]:"#e5e5e5",[w.MessageVisitorBackground]:"#171717",[w.MessageVisitorText]:"#e5e5e5",[w.MessageAgentBackground]:"#5b21b6",[w.MessageAgentText]:"#e9d5ff",[w.GreeterBackground]:"#171717",[w.GreeterText]:"#e5e5e5",[w.GreeterBorder]:"#262626",[w.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[w.GreeterTopText]:"#fafafa",[w.GreeterButtonBackground]:"#3b82f6",[w.GreeterButtonText]:"#ffffff",[w.ButtonBackground]:"#3b82f6",[w.ButtonText]:"#ffffff",[w.InputBackground]:"#171717",[w.InputText]:"#e5e5e5",[w.InputBorder]:"#3f3f3f",[w.CloseButtonBackground]:"#262626",[w.CloseButtonText]:"#a3a3a3",[w.CloseButtonHover]:"#404040",[w.IconColor]:"#a3a3a3",[w.IconBackground]:"transparent",[w.ErrorBackground]:"#450a0a",[w.ErrorText]:"#fca5a5",[w.ErrorBorder]:"#7f1d1d",[w.SuccessBackground]:"#052e16",[w.SuccessText]:"#86efac",[w.SuccessBorder]:"#14532d",[w.WarningBackground]:"#451a03",[w.WarningText]:"#fcd34d",[w.WarningBorder]:"#78350f",[w.LinkColor]:"#3b82f6",[w.LinkHoverColor]:"#60a5fa",[w.DividerColor]:"#262626",[w.ShadowColor]:"rgba(0, 0, 0, 0.4)",[w.StarActiveColor]:"#f59e0b",[w.StarInactiveColor]:"#404040",[w.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[w.ChatCloseConfirmText]:"#fca5a5",[w.RatingHeaderBackground]:"#171717",[w.RatingHeaderText]:"#fafafa",[w.RatingSuccessBackground]:"#171717",[w.RatingSuccessText]:"#e5e5e5",[w.RatingRateConversationText]:"#e5e5e5"},ZM={[Hr.None]:"0px",[Hr.Sm]:"var(--radius-sm)",[Hr.Md]:"var(--radius-md)",[Hr.Lg]:"var(--radius-lg)",[Hr.Xl]:"var(--radius-lg)",[Hr.Full]:"calc(infinity * 1px)"},JM=e=>{const t={...QM};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 e4(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 t4(e){const t=e4(e,.2);return{[w.ButtonBackground]:t,[w.ButtonText]:Zd,[w.GreeterButtonBackground]:t,[w.GreeterButtonText]:Zd,[w.MessageVisitorBackground]:t,[w.MessageVisitorText]:Zd}}const n4=(e,t)=>{var i,s;const r={...t==="dark"?XM:KM};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=t4(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},Sk="lc:theme:mode";function kk(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ck(){try{const e=localStorage.getItem(Sk);if(e==="light"||e==="dark"||e==="system")return e}catch{}return Be.System}function Ay(){const e=Ck(),t=kk();return e===Be.System?t:e}function r4({children:e,widget:t}){const[n,r]=v.useState(Ck),[i,s]=v.useState(kk);v.useEffect(()=>{const x=window.matchMedia("(prefers-color-scheme: dark)"),b=S=>{s(S.matches?"dark":"light")};return x.addEventListener("change",b),()=>x.removeEventListener("change",b)},[]);const o=n===Be.System?i:n,a=v.useCallback(x=>{r(x);try{localStorage.setItem(Sk,x)}catch{}},[]),l=n4(t,o),c=JM(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:Hr.Md,u=x=>l[x],p=x=>c[x],h=()=>ZM[d];return f.jsx(bk.Provider,{value:{colors:l,texts:c,getColor:u,getText:p,getRadius:h,mode:n,resolvedMode:o,setMode:a},children:e})}const Ee=()=>v.useContext(bk),Oo=()=>Ee().getText;function An({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=w.ButtonText,bgKey:d=w.ButtonBackground,animations:u={},withoutTheming:p,...h}){const x=Ee();return f.jsx(Oe.button,{type:t,className:Ne("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,c0[n]&&c0[n][r],gj[i][o?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!p&&{color:x.getColor(c),backgroundColor:x.getColor(d),...o?{}:{borderRadius:x.getRadius()}},...l},...u,...h,children:e})}function ee(){}ee.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"})})};ee.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"})});ee.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"})});ee.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"})});ee.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"})})};ee.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"})]})};ee.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"})});ee.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"})})]});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})})};ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})]});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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 gc(){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 lt=(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))(lt||{});const Hn=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},ia=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},ba=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),og(e)},_k=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},ql=(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`))):og(e)},Zn=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}},og=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`)},Dr=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=gc(),localStorage.setItem(t,n)),n},i4={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},jy=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(x=>x(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(i4?"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},s4=e=>e?jy(e):jy;var Tk={exports:{}},Ek={},Ak={exports:{}},jk={};/**
|
|
70
|
+
`),()=>{document.head.removeChild(h)}},[t]),f.jsx(yj,{isPresent:t,childRef:i,sizeRef:s,children:v.cloneElement(e,{ref:i})})}const wj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o,anchorX:a})=>{const l=Nu(bj),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(xj,{isPresent:n,anchorX:a,children:e})),f.jsx(Ou.Provider,{value:u,children:e})};function bj(){return new Map}function Qb(e=!0){const t=v.useContext(Ou);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 Vl=e=>e.key||"";function u0(e){const t=[];return v.Children.forEach(e,n=>{v.isValidElement(n)&&t.push(n)}),t}const Nr=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1,anchorX:a="left"})=>{const[l,c]=Qb(o),d=v.useMemo(()=>u0(e),[e]),u=o&&!l?[]:d.map(Vl),p=v.useRef(!0),h=v.useRef(d),x=Nu(()=>new Map),[b,S]=v.useState(d),[m,g]=v.useState(d);Yb(()=>{p.current=!1,h.current=d;for(let C=0;C<m.length;C++){const _=Vl(m[C]);u.includes(_)?x.delete(_):x.get(_)!==!0&&x.set(_,!1)}},[m,u.length,u.join("-")]);const y=[];if(d!==b){let C=[...d];for(let _=0;_<m.length;_++){const E=m[_],A=Vl(E);u.includes(A)||(C.splice(_,0,E),y.push(E))}return s==="wait"&&y.length&&(C=y),g(u0(C)),S(d),null}const{forceRender:k}=v.useContext(Tm);return f.jsx(f.Fragment,{children:m.map(C=>{const _=Vl(C),E=o&&!l?!1:d===m||u.includes(_),A=()=>{if(x.has(_))x.set(_,!0);else return;let $=!0;x.forEach(I=>{I||($=!1)}),$&&(k==null||k(),g(h.current),o&&(c==null||c()),r&&r())};return f.jsx(wj,{isPresent:E,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,onExitComplete:E?void 0:A,anchorX:a,children:C},_)})})};function jm(e,t){e.indexOf(t)===-1&&e.push(t)}function Rm(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let Ap=()=>{};const jp={skipAnimations:!1,useManualTiming:!1};function Mm(e){let t;return()=>(t===void 0&&(t=e()),t)}const Rn=e=>e,Ua=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Pm{constructor(){this.subscriptions=[]}add(t){return jm(this.subscriptions,t),()=>Rm(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 lr=e=>e*1e3,cr=e=>e/1e3;function Kb(e,t){return t?e*(1e3/t):0}const Sj=Mm(()=>window.ScrollTimeline!==void 0);class kj{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(Sj()&&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 Cj extends kj{then(t,n){return this.finished.finally(t).then(()=>{})}}const d0={value:null,addProjectionMetrics:null},Nm=e=>Array.isArray(e)&&typeof e[0]=="number",_j={};function Tj(e,t){const n=Mm(e);return()=>_j[t]??n()}const Ha=Tj(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xb=(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)})`},na=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Rp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:na([0,.65,.55,1]),circOut:na([.55,0,1,.45]),backIn:na([.31,.01,.66,-.59]),backOut:na([.33,1.53,.69,.99])};function Zb(e,t){if(e)return typeof e=="function"&&Ha()?Xb(e,t):Nm(e)?na(e):Array.isArray(e)?e.map(n=>Zb(n,t)||Rp.easeOut):Rp[e]}function Ej(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=Zb(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 Om(e){return typeof e=="function"&&"applyToOptions"in e}function Dm(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const Zc=2e4;function Im(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 Aj(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(Im(r),Zc);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:cr(i)}}function Jb(e){return!!(typeof e=="function"&&Ha()||!e||typeof e=="string"&&(e in Rp||Ha())||Nm(e)||Array.isArray(e)&&e.every(Jb))}function f0(e,t){e.timeline=t,e.onfinish=null}const Ul=["read","resolveKeyframes","update","preRender","render","postRender"];function jj(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 b=h&&i?n:r;return p&&o.add(u),b.has(u)||b.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&&d0.value&&d0.value.frameloop[t].push(l),l=0,n.clear(),i=!1,s&&(s=!1,d.process(u))}};return d}const Rj=40;function eS(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Ul.reduce((m,g)=>(m[g]=jj(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,Rj),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))},x=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:Ul.reduce((m,g)=>{const y=o[g];return m[g]=(k,C=!1,_=!1)=>(n||x(),y.schedule(k,C,_)),m},{}),cancel:m=>{for(let g=0;g<Ul.length;g++)o[Ul[g]].cancel(m)},state:i,steps:o}}const{schedule:Lm,cancel:z8}=eS(queueMicrotask,!1),{schedule:Ue,cancel:yi,state:kt,steps:Bd}=eS(typeof requestAnimationFrame<"u"?requestAnimationFrame:Rn,!0);let pc;function Mj(){pc=void 0}const ur={now:()=>(pc===void 0&&ur.set(kt.isProcessing||jp.useManualTiming?kt.timestamp:performance.now()),pc),set:e=>{pc=e,queueMicrotask(Mj)}},Ln={x:!1,y:!1};function tS(){return Ln.x||Ln.y}function Pj(e){return e==="x"||e==="y"?Ln[e]?null:(Ln[e]=!0,()=>{Ln[e]=!1}):Ln.x||Ln.y?null:(Ln.x=Ln.y=!0,()=>{Ln.x=Ln.y=!1})}function Nj(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 nS(e,t){const n=Nj(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function p0(e){return!(e.pointerType==="touch"||tS())}function Oj(e,t,n={}){const[r,i,s]=nS(e,n),o=a=>{if(!p0(a))return;const{target:l}=a,c=t(l,a);if(typeof c!="function"||!l)return;const d=u=>{p0(u)&&(c(u),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,i)};return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const rS=(e,t)=>t?e===t?!0:rS(e,t.parentElement):!1,Fm=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Dj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Ij(e){return Dj.has(e.tagName)||e.tabIndex!==-1}const ra=new WeakSet;function h0(e){return t=>{t.key==="Enter"&&e(t)}}function $d(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=h0(()=>{if(ra.has(n))return;$d(n,"down");const i=h0(()=>{$d(n,"up")}),s=()=>$d(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 m0(e){return Fm(e)&&!tS()}function Fj(e,t,n={}){const[r,i,s]=nS(e,n),o=a=>{const l=a.currentTarget;if(!m0(a)||ra.has(l))return;ra.add(l);const c=t(l,a),d=(h,x)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!m0(h)||!ra.has(l))&&(ra.delete(l),typeof c=="function"&&c(h,{success:x}))},u=h=>{d(h,l===window||l===document||n.useGlobalTarget||rS(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)),!Ij(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}const g0=30,Bj=e=>!isNaN(parseFloat(e));class $j{constructor(t,n={}){this.version="12.7.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=ur.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=ur.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Bj(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 Pm);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ue.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=ur.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>g0)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,g0);return Kb(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 Wa(e,t){return new $j(e,t)}const iS=v.createContext({strict:!1}),v0={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"]},wo={};for(const e in v0)wo[e]={isEnabled:t=>v0[e].some(n=>!!t[n])};function zj(e){for(const t in e)wo[t]={...wo[t],...e[t]}}const Vj=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 Jc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Vj.has(e)}let sS=e=>!Jc(e);function Uj(e){e&&(sS=t=>t.startsWith("on")?!Jc(t):e(t))}try{Uj(require("@emotion/is-prop-valid").default)}catch{}function Hj(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(sS(i)||n===!0&&Jc(i)||!t&&!Jc(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Wj(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 Du=v.createContext({});function Iu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function qa(e){return typeof e=="string"||Array.isArray(e)}const Bm=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$m=["initial",...Bm];function Lu(e){return Iu(e.animate)||$m.some(t=>qa(e[t]))}function oS(e){return!!(Lu(e)||e.variants)}function qj(e,t){if(Lu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||qa(n)?n:void 0,animate:qa(r)?r:void 0}}return e.inherit!==!1?t:{}}function Gj(e){const{initial:t,animate:n}=qj(e,v.useContext(Du));return v.useMemo(()=>({initial:t,animate:n}),[y0(t),y0(n)])}function y0(e){return Array.isArray(e)?e.join(" "):e}const Yj=Symbol.for("motionComponentSymbol");function Ls(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Qj(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):Ls(n)&&(n.current=r))},[t])}const zm=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Kj="framerAppearId",aS="data-"+zm(Kj),lS=v.createContext({});function Xj(e,t,n,r,i){var b,S;const{visualElement:s}=v.useContext(Du),o=v.useContext(iS),a=v.useContext(Ou),l=v.useContext(Am).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(lS);d&&!d.projection&&i&&(d.type==="html"||d.type==="svg")&&Zj(c.current,n,i,u);const p=v.useRef(!1);v.useInsertionEffect(()=>{d&&p.current&&d.update(n,a)});const h=n[aS],x=v.useRef(!!h&&!((b=window.MotionHandoffIsComplete)!=null&&b.call(window,h))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,h)));return Yb(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Lm.render(d.render),x.current&&d.animationState&&d.animationState.animateChanges())}),v.useEffect(()=>{d&&(!x.current&&d.animationState&&d.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var m;(m=window.MotionHandoffMarkAsComplete)==null||m.call(window,h)}),x.current=!1))}),d}function Zj(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:cS(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Ls(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:c})}function cS(e){if(e)return e.options.allowProjection!==!1?e.projection:cS(e.parent)}function Jj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&zj(e);function s(a,l){let c;const d={...v.useContext(Am),...a,layoutId:e5(a)},{isStatic:u}=d,p=Gj(a),h=r(a,u);if(!u&&Em){t5();const x=n5(d);c=x.MeasureLayout,p.visualElement=Xj(i,h,d,t,x.ProjectionNode)}return f.jsxs(Du.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,n(i,a,Qj(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[Yj]=i,o}function e5({layoutId:e}){const t=v.useContext(Tm).id;return t&&e!==void 0?t+"-"+e:e}function t5(e,t){v.useContext(iS).strict}function n5(e){const{drag:t,layout:n}=wo;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 uS=e=>t=>typeof t=="string"&&t.startsWith(e),Vm=uS("--"),r5=uS("var(--"),Um=e=>r5(e)?i5.test(e.split("/*")[0].trim()):!1,i5=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ga={};function s5(e){for(const t in e)Ga[t]=e[t],Vm(t)&&(Ga[t].isCSSVariable=!0)}const Po=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],fs=new Set(Po);function dS(e,{layout:t,layoutId:n}){return fs.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ga[e]||e==="opacity")}const Pt=e=>!!(e&&e.getVelocity),fS=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Or=(e,t,n)=>n>t?t:n<e?e:n,No={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ya={...No,transform:e=>Or(0,1,e)},Hl={...No,default:1},dl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zr=dl("deg"),dr=dl("%"),we=dl("px"),o5=dl("vh"),a5=dl("vw"),x0={...dr,parse:e=>dr.parse(e)/100,transform:e=>dr.transform(e*100)},l5={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,backgroundPositionX:we,backgroundPositionY:we},c5={rotate:zr,rotateX:zr,rotateY:zr,rotateZ:zr,scale:Hl,scaleX:Hl,scaleY:Hl,scaleZ:Hl,skew:zr,skewX:zr,skewY:zr,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:Ya,originX:x0,originY:x0,originZ:we},w0={...No,transform:Math.round},Hm={...l5,...c5,zIndex:w0,size:we,fillOpacity:Ya,strokeOpacity:Ya,numOctaves:w0},u5={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},d5=Po.length;function f5(e,t,n){let r="",i=!0;for(let s=0;s<d5;s++){const o=Po[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=fS(a,Hm[o]);if(!l){i=!1;const d=u5[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Wm(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(fs.has(l)){o=!0;continue}else if(Vm(l)){i[l]=c;continue}else{const d=fS(c,Hm[l]);l.startsWith("origin")?(a=!0,s[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=f5(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 qm=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function pS(e,t,n){for(const r in t)!Pt(t[r])&&!dS(r,n)&&(e[r]=t[r])}function p5({transformTemplate:e},t){return v.useMemo(()=>{const n=qm();return Wm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function h5(e,t){const n=e.style||{},r={};return pS(r,n,e),Object.assign(r,p5(e,t)),r}function m5(e,t){const n={},r=h5(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 g5=["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 Gm(e){return typeof e!="string"||e.includes("-")?!1:!!(g5.indexOf(e)>-1||/[A-Z]/u.test(e))}const v5={offset:"stroke-dashoffset",array:"stroke-dasharray"},y5={offset:"strokeDashoffset",array:"strokeDasharray"};function x5(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?v5:y5;e[s.offset]=we.transform(-r);const o=we.transform(t),a=we.transform(n);e[s.array]=`${o} ${a}`}function b0(e,t,n){return typeof e=="string"?e:we.transform(t+n*e)}function w5(e,t,n){const r=b0(t,e.x,e.width),i=b0(n,e.y,e.height);return`${r} ${i}`}function Ym(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},d,u){if(Wm(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:x}=e;p.transform&&(x&&(h.transform=p.transform),delete p.transform),x&&(i!==void 0||s!==void 0||h.transform)&&(h.transformOrigin=w5(x,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&&x5(p,o,a,l,!1)}const hS=()=>({...qm(),attrs:{}}),Qm=e=>typeof e=="string"&&e.toLowerCase()==="svg";function b5(e,t,n,r){const i=v.useMemo(()=>{const s=hS();return Ym(s,t,Qm(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};pS(s,e.style,e),i.style={...s,...i.style}}return i}function S5(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(Gm(n)?b5:m5)(r,s,o,n),c=Hj(r,typeof n=="string",e),d=n!==v.Fragment?{...c,...l,ref:i}:{},{children:u}=r,p=v.useMemo(()=>Pt(u)?u.get():u,[u]);return v.createElement(n,{...d,children:p})}}function S0(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Km(e,t,n,r){if(typeof t=="function"){const[i,s]=S0(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]=S0(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const Mp=e=>Array.isArray(e),k5=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),C5=e=>Mp(e)?e[e.length-1]||0:e;function hc(e){const t=Pt(e)?e.get():e;return k5(t)?t.toValue():t}function _5({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:T5(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const mS=e=>(t,n)=>{const r=v.useContext(Du),i=v.useContext(Ou),s=()=>_5(e,t,r,i);return n?s():Nu(s)};function T5(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=hc(s[p]);let{initial:o,animate:a}=e;const l=Lu(e),c=oS(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"&&!Iu(u)){const p=Array.isArray(u)?u:[u];for(let h=0;h<p.length;h++){const x=Km(e,p[h]);if(x){const{transitionEnd:b,transition:S,...m}=x;for(const g in m){let y=m[g];if(Array.isArray(y)){const k=d?y.length-1:0;y=y[k]}y!==null&&(i[g]=y)}for(const g in b)i[g]=b[g]}}}return i}function Xm(e,t,n){var s;const{style:r}=e,i={};for(const o in r)(Pt(r[o])||t.style&&Pt(t.style[o])||dS(o,e)||((s=n==null?void 0:n.getValue(o))==null?void 0:s.liveStyle)!==void 0)&&(i[o]=r[o]);return i}const E5={useVisualState:mS({scrapeMotionValuesFromProps:Xm,createRenderState:qm})};function gS(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 vS(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 yS=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 xS(e,t,n,r){vS(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(yS.has(i)?i:zm(i),t.attrs[i])}function wS(e,t,n){const r=Xm(e,t,n);for(const i in e)if(Pt(e[i])||Pt(t[i])){const s=Po.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}const k0=["x","y","width","height","cx","cy","r"],A5={useVisualState:mS({scrapeMotionValuesFromProps:wS,createRenderState:hS,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(fs.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<k0.length;a++){const l=k0[a];e[l]!==t[l]&&(o=!0)}o&&Ue.read(()=>{gS(n,r),Ue.render(()=>{Ym(r,i,Qm(n.tagName),e.transformTemplate),xS(n,r)})})}})};function j5(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...Gm(r)?A5:E5,preloadedFeatures:e,useRender:S5(i),createVisualElement:t,Component:r};return Jj(o)}}function Qa(e,t,n){const r=e.getProps();return Km(r,t,n!==void 0?n:r.custom,e)}const bS=new Set(["width","height","top","left","right","bottom",...Po]);function R5(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Wa(n))}function M5(e,t){const n=Qa(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=C5(s[o]);R5(e,o,a)}}function P5(e){return!!(Pt(e)&&e.add)}function Pp(e,t){const n=e.getValue("willChange");if(P5(n))return n.add(t);if(!n&&jp.WillChange){const r=new jp.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function SS(e){return e.props[aS]}const kS=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,N5=1e-7,O5=12;function D5(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=kS(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>N5&&++a<O5);return o}function fl(e,t,n,r){if(e===t&&n===r)return Rn;const i=s=>D5(s,0,1,e,n);return s=>s===0||s===1?s:kS(i(s),t,r)}const CS=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,_S=e=>t=>1-e(1-t),TS=fl(.33,1.53,.69,.99),Zm=_S(TS),ES=CS(Zm),AS=e=>(e*=2)<1?.5*Zm(e):.5*(2-Math.pow(2,-10*(e-1))),Jm=e=>1-Math.sin(Math.acos(e)),jS=_S(Jm),RS=CS(Jm),MS=e=>/^0[^.\s]+$/u.test(e);function I5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||MS(e):!0}const va=e=>Math.round(e*1e5)/1e5,eg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function L5(e){return e==null}const F5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tg=(e,t)=>n=>!!(typeof n=="string"&&F5.test(n)&&n.startsWith(e)||t&&!L5(n)&&Object.prototype.hasOwnProperty.call(n,t)),PS=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(eg);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},B5=e=>Or(0,255,e),zd={...No,transform:e=>Math.round(B5(e))},Li={test:tg("rgb","red"),parse:PS("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+zd.transform(e)+", "+zd.transform(t)+", "+zd.transform(n)+", "+va(Ya.transform(r))+")"};function $5(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 Np={test:tg("#"),parse:$5,transform:Li.transform},Fs={test:tg("hsl","hue"),parse:PS("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+dr.transform(va(t))+", "+dr.transform(va(n))+", "+va(Ya.transform(r))+")"},Rt={test:e=>Li.test(e)||Np.test(e)||Fs.test(e),parse:e=>Li.test(e)?Li.parse(e):Fs.test(e)?Fs.parse(e):Np.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Li.transform(e):Fs.transform(e)},z5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function V5(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(eg))==null?void 0:t.length)||0)+(((n=e.match(z5))==null?void 0:n.length)||0)>0}const NS="number",OS="color",U5="var",H5="var(",C0="${}",W5=/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 Ka(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(W5,l=>(Rt.test(l)?(r.color.push(s),i.push(OS),n.push(Rt.parse(l))):l.startsWith(H5)?(r.var.push(s),i.push(U5),n.push(l)):(r.number.push(s),i.push(NS),n.push(parseFloat(l))),++s,C0)).split(C0);return{values:n,split:a,indexes:r,types:i}}function DS(e){return Ka(e).values}function IS(e){const{split:t,types:n}=Ka(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===NS?s+=va(i[o]):a===OS?s+=Rt.transform(i[o]):s+=i[o]}return s}}const q5=e=>typeof e=="number"?0:e;function G5(e){const t=DS(e);return IS(e)(t.map(q5))}const xi={test:V5,parse:DS,createTransformer:IS,getAnimatableNone:G5},Y5=new Set(["brightness","contrast","saturate","opacity"]);function Q5(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(eg)||[];if(!r)return e;const i=n.replace(r,"");let s=Y5.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const K5=/\b([a-z-]*)\(.*?\)/gu,Op={...xi,getAnimatableNone:e=>{const t=e.match(K5);return t?t.map(Q5).join(" "):e}},X5={...Hm,color:Rt,backgroundColor:Rt,outlineColor:Rt,fill:Rt,stroke:Rt,borderColor:Rt,borderTopColor:Rt,borderRightColor:Rt,borderBottomColor:Rt,borderLeftColor:Rt,filter:Op,WebkitFilter:Op},LS=e=>X5[e];function FS(e,t){let n=LS(e);return n!==Op&&(n=xi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Z5=new Set(["auto","none","0"]);function J5(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!Z5.has(s)&&Ka(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=FS(n,i)}const Fi=e=>e*180/Math.PI,Dp=e=>{const t=Fi(Math.atan2(e[1],e[0]));return Ip(t)},e3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Dp,rotateZ:Dp,skewX:e=>Fi(Math.atan(e[1])),skewY:e=>Fi(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ip=e=>(e=e%360,e<0&&(e+=360),e),_0=Dp,T0=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),E0=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),t3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:T0,scaleY:E0,scale:e=>(T0(e)+E0(e))/2,rotateX:e=>Ip(Fi(Math.atan2(e[6],e[5]))),rotateY:e=>Ip(Fi(Math.atan2(-e[2],e[0]))),rotateZ:_0,rotate:_0,skewX:e=>Fi(Math.atan(e[4])),skewY:e=>Fi(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function A0(e){return e.includes("scale")?1:0}function Lp(e,t){if(!e||e==="none")return A0(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=t3,i=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=e3,i=a}if(!i)return A0(t);const s=r[t],o=i[1].split(",").map(r3);return typeof s=="function"?s(o):o[s]}const n3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Lp(n,t)};function r3(e){return parseFloat(e.trim())}const j0=e=>e===No||e===we,i3=new Set(["x","y","z"]),s3=Po.filter(e=>!i3.has(e));function o3(e){const t=[];return s3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const bo={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})=>Lp(t,"x"),y:(e,{transform:t})=>Lp(t,"y")};bo.translateX=bo.x;bo.translateY=bo.y;const Ki=new Set;let Fp=!1,Bp=!1;function BS(){if(Bp){const e=Array.from(Ki).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=o3(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)})}Bp=!1,Fp=!1,Ki.forEach(e=>e.complete()),Ki.clear()}function $S(){Ki.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Bp=!0)})}function a3(){$S(),BS()}class ng{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?(Ki.add(this),Fp||(Fp=!0,Ue.read($S),Ue.resolveKeyframes(BS))):(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),Ki.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ki.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const zS=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),l3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function c3(e){const t=l3.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function VS(e,t,n=1){const[r,i]=c3(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return zS(o)?parseFloat(o):o}return Um(i)?VS(i,t,n+1):i}const US=e=>t=>t.test(e),u3={test:e=>e==="auto",parse:e=>e},HS=[No,we,dr,zr,a5,o5,u3],R0=e=>HS.find(US(e));class WS extends ng{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(),Um(c))){const d=VS(c,n.current);d!==void 0&&(t[l]=d),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!bS.has(r)||t.length!==2)return;const[i,s]=t,o=R0(i),a=R0(s);if(o!==a)if(j0(o)&&j0(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++)I5(t[i])&&r.push(i);r.length&&J5(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=bo[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]=bo[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 M0=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(xi.test(e)||e==="0")&&!e.startsWith("url("));function d3(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 f3(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=M0(i,t),a=M0(s,t);return!o||!a?!1:d3(e)||(n==="spring"||Om(n))&&r}const p3=e=>e!==null;function Fu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(p3),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const h3=40;class qS{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=ur.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>h3?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&a3(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ur.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!f3(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Fu(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 Xe=(e,t,n)=>e+(t-e)*n;function Vd(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 m3({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=Vd(l,a,e+1/3),s=Vd(l,a,e),o=Vd(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function eu(e,t){return n=>n>0?t:e}const Ud=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},g3=[Np,Li,Fs],v3=e=>g3.find(t=>t.test(e));function P0(e){const t=v3(e);if(!t)return!1;let n=t.parse(e);return t===Fs&&(n=m3(n)),n}const N0=(e,t)=>{const n=P0(e),r=P0(t);if(!n||!r)return eu(e,t);const i={...n};return s=>(i.red=Ud(n.red,r.red,s),i.green=Ud(n.green,r.green,s),i.blue=Ud(n.blue,r.blue,s),i.alpha=Xe(n.alpha,r.alpha,s),Li.transform(i))},y3=(e,t)=>n=>t(e(n)),pl=(...e)=>e.reduce(y3),$p=new Set(["none","hidden"]);function x3(e,t){return $p.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function w3(e,t){return n=>Xe(e,t,n)}function rg(e){return typeof e=="number"?w3:typeof e=="string"?Um(e)?eu:Rt.test(e)?N0:k3:Array.isArray(e)?GS:typeof e=="object"?Rt.test(e)?N0:b3:eu}function GS(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>rg(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function b3(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=rg(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function S3(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 k3=(e,t)=>{const n=xi.createTransformer(t),r=Ka(e),i=Ka(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?$p.has(e)&&!i.values.length||$p.has(t)&&!r.values.length?x3(e,t):pl(GS(S3(r,i),i.values),n):eu(e,t)};function YS(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Xe(e,t,n):rg(e)(e,t)}const C3=5;function QS(e,t,n){const r=Math.max(t-C3,0);return Kb(n-e(r),t-r)}const nt={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},Hd=.001;function _3({duration:e=nt.duration,bounce:t=nt.bounce,velocity:n=nt.velocity,mass:r=nt.mass}){let i,s,o=1-t;o=Or(nt.minDamping,nt.maxDamping,o),e=Or(nt.minDuration,nt.maxDuration,cr(e)),o<1?(i=c=>{const d=c*o,u=d*e,p=d-n,h=zp(c,o),x=Math.exp(-u);return Hd-p/h*x},s=c=>{const u=c*o*e,p=u*n+n,h=Math.pow(o,2)*Math.pow(c,2)*e,x=Math.exp(-u),b=zp(Math.pow(c,2),o);return(-i(c)+Hd>0?-1:1)*((p-h)*x)/b}):(i=c=>{const d=Math.exp(-c*e),u=(c-n)*e+1;return-Hd+d*u},s=c=>{const d=Math.exp(-c*e),u=(n-c)*(e*e);return d*u});const a=5/e,l=E3(i,s,a);if(e=lr(e),isNaN(l))return{stiffness:nt.stiffness,damping:nt.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const T3=12;function E3(e,t,n){let r=n;for(let i=1;i<T3;i++)r=r-e(r)/t(r);return r}function zp(e,t){return e*Math.sqrt(1-t*t)}const A3=["duration","bounce"],j3=["stiffness","damping","mass"];function O0(e,t){return t.some(n=>e[n]!==void 0)}function R3(e){let t={velocity:nt.velocity,stiffness:nt.stiffness,damping:nt.damping,mass:nt.mass,isResolvedFromDuration:!1,...e};if(!O0(e,j3)&&O0(e,A3))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*Or(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:nt.mass,stiffness:i,damping:s}}else{const n=_3(e);t={...t,...n,mass:nt.mass},t.isResolvedFromDuration=!0}return t}function tu(e=nt.visualDuration,t=nt.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}=R3({...n,velocity:-cr(n.velocity||0)}),x=p||0,b=c/(2*Math.sqrt(l*d)),S=o-s,m=cr(Math.sqrt(l/d)),g=Math.abs(S)<5;r||(r=g?nt.restSpeed.granular:nt.restSpeed.default),i||(i=g?nt.restDelta.granular:nt.restDelta.default);let y;if(b<1){const C=zp(m,b);y=_=>{const E=Math.exp(-b*m*_);return o-E*((x+b*m*S)/C*Math.sin(C*_)+S*Math.cos(C*_))}}else if(b===1)y=C=>o-Math.exp(-m*C)*(S+(x+m*S)*C);else{const C=m*Math.sqrt(b*b-1);y=_=>{const E=Math.exp(-b*m*_),A=Math.min(C*_,300);return o-E*((x+b*m*S)*Math.sinh(A)+C*S*Math.cosh(A))/C}}const k={calculatedDuration:h&&u||null,next:C=>{const _=y(C);if(h)a.done=C>=u;else{let E=0;b<1&&(E=C===0?lr(x):QS(y,C,_));const A=Math.abs(E)<=r,$=Math.abs(o-_)<=i;a.done=A&&$}return a.value=a.done?o:_,a},toString:()=>{const C=Math.min(Im(k),Zc),_=Xb(E=>k.next(C*E).value,C,30);return C+"ms "+_},toTransition:()=>{}};return k}tu.applyToOptions=e=>{const t=Aj(e,100,tu);return e.ease=Ha()?t.ease:"easeOut",e.duration=lr(t.duration),e.type="keyframes",e};function D0({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,x=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let b=n*t;const S=u+b,m=o===void 0?S:o(S);m!==S&&(b=m-u);const g=A=>-b*Math.exp(-A/r),y=A=>m+g(A),k=A=>{const $=g(A),I=y(A);p.done=Math.abs($)<=c,p.value=p.done?m:I};let C,_;const E=A=>{h(p.value)&&(C=A,_=tu({keyframes:[p.value,x(p.value)],velocity:QS(y,A,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return E(0),{calculatedDuration:null,next:A=>{let $=!1;return!_&&C===void 0&&($=!0,k(A),E(A)),C!==void 0&&A>=C?_.next(A-C):(!$&&k(A),p)}}}const M3=fl(.42,0,1,1),P3=fl(0,0,.58,1),KS=fl(.42,0,.58,1),N3=e=>Array.isArray(e)&&typeof e[0]!="number",I0={linear:Rn,easeIn:M3,easeInOut:KS,easeOut:P3,circIn:Jm,circInOut:RS,circOut:jS,backIn:Zm,backInOut:ES,backOut:TS,anticipate:AS},L0=e=>{if(Nm(e)){Ap(e.length===4);const[t,n,r,i]=e;return fl(t,n,r,i)}else if(typeof e=="string")return Ap(I0[e]!==void 0),I0[e];return e};function O3(e,t,n){const r=[],i=n||YS,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]||Rn:t;a=pl(l,a)}r.push(a)}return r}function D3(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(Ap(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=O3(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=Ua(e[u],e[u+1],d);return a[u](p)};return n?d=>c(Or(e[0],e[s-1],d)):c}function I3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ua(0,t,r);e.push(Xe(n,1,i))}}function L3(e){const t=[0];return I3(t,e.length-1),t}function F3(e,t){return e.map(n=>n*t)}function B3(e,t){return e.map(()=>t||KS).splice(0,e.length-1)}function nu({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=N3(r)?r.map(L0):L0(r),s={done:!1,value:t[0]},o=F3(n&&n.length===t.length?n:L3(t),e),a=D3(o,t,{ease:Array.isArray(i)?i:B3(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const $3=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Ue.update(t,!0),stop:()=>yi(t),now:()=>kt.isProcessing?kt.timestamp:ur.now()}},z3={decay:D0,inertia:D0,tween:nu,keyframes:nu,spring:tu},V3=e=>e/100;class ig extends qS{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)||ng,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=Om(n)?n:z3[n]||nu;let l,c;a!==nu&&typeof t[0]!="number"&&(l=pl(V3,YS(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=Im(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:x,repeatDelay:b,onUpdate:S}=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 y=this.currentTime,k=s;if(h){const A=Math.min(this.currentTime,d)/u;let $=Math.floor(A),I=A%1;!I&&A>=1&&(I=1),I===1&&$--,$=Math.min($,h+1),!!($%2)&&(x==="reverse"?(I=1-I,b&&(I-=b/u)):x==="mirror"&&(k=o)),y=Or(0,1,I)*u}const C=g?{done:!1,value:l[0]}:k.next(y);a&&(C.value=a(C.value));let{done:_}=C;!g&&c!==null&&(_=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_);return E&&i!==void 0&&(C.value=Fu(l,this.options,i)),S&&S(C.value),E&&this.finish(),C}get duration(){const{resolved:t}=this;return t?cr(t.calculatedDuration):0}get time(){return cr(this.currentTime)}set time(t){t=lr(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=cr(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=$3,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 U3=new Set(["opacity","clipPath","filter","transform"]),H3=Mm(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),ru=10,W3=2e4;function q3(e){return Om(e.type)||e.type==="spring"||!Jb(e.ease)}function G3(e,t){const n=new ig({...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<W3;)r=n.sample(s),i.push(r.value),s+=ru;return{times:void 0,keyframes:i,duration:s-ru,ease:"linear"}}const XS={anticipate:AS,backInOut:ES,circInOut:RS};function Y3(e){return e in XS}class F0 extends qS{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new WS(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"&&Ha()&&Y3(s)&&(s=XS[s]),q3(this.options)){const{onComplete:u,onUpdate:p,motionValue:h,element:x,...b}=this.options,S=G3(t,b);t=S.keyframes,t.length===1&&(t[1]=t[0]),r=S.duration,i=S.times,s=S.ease,o="keyframes"}const d=Ej(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(f0(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:u}=this.options;a.set(Fu(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 cr(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return cr(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=lr(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 Rn;const{animation:r}=n;f0(r,t)}return Rn}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,x=new ig({...h,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),b=lr(this.time);c.setWithVelocity(x.sample(b-ru).value,x.sample(b).value,ru)}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 H3()&&r&&U3.has(r)&&(r!=="transform"||!c)&&!l&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const Q3={type:"spring",stiffness:500,damping:25,restSpeed:10},K3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),X3={type:"keyframes",duration:.8},Z3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},J3=(e,{keyframes:t})=>t.length>2?X3:fs.has(e)?e.startsWith("scale")?K3(t[1]):Q3:Z3;function eR({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 sg=(e,t,n,r={},i,s)=>o=>{const a=Dm(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-lr(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};eR(a)||(d={...d,...J3(e,d)}),d.duration&&(d.duration=lr(d.duration)),d.repeatDelay&&(d.repeatDelay=lr(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=Fu(d.keyframes,a);if(p!==void 0)return Ue.update(()=>{d.onUpdate(p),d.onComplete()}),new Cj([])}return!s&&F0.supports(d)?new F0(d):new ig(d)};function tR({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ZS(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&&tR(c,d))continue;const h={delay:n,...Dm(s||{},d)};let x=!1;if(window.MotionHandoffAnimation){const S=SS(e);if(S){const m=window.MotionHandoffAnimation(S,d,Ue);m!==null&&(h.startTime=m,x=!0)}}Pp(e,d),u.start(sg(d,u,p,e.shouldReduceMotion&&bS.has(d)?{type:!1}:h,e,x));const b=u.animation;b&&l.push(b)}return o&&Promise.all(l).then(()=>{Ue.update(()=>{o&&M5(e,o)})}),l}function Vp(e,t,n={}){var l;const r=Qa(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(ZS(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=i;return nR(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 nR(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(rR).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Vp(c,t,{...s,delay:n+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function rR(e,t){return e.sortNodePosition(t)}function iR(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Vp(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Vp(e,t,n);else{const i=typeof t=="function"?Qa(e,t,n.custom):t;r=Promise.all(ZS(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function JS(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 sR=$m.length;function ek(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?ek(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<sR;n++){const r=$m[n],i=e.props[r];(qa(i)||i===!1)&&(t[r]=i)}return t}const oR=[...Bm].reverse(),aR=Bm.length;function lR(e){return t=>Promise.all(t.map(({animation:n,options:r})=>iR(e,n,r)))}function cR(e){let t=lR(e),n=B0(),r=!0;const i=l=>(c,d)=>{var p;const u=Qa(e,d,l==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:h,transitionEnd:x,...b}=u;c={...c,...b,...x}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=ek(e.parent)||{},u=[],p=new Set;let h={},x=1/0;for(let S=0;S<aR;S++){const m=oR[S],g=n[m],y=c[m]!==void 0?c[m]:d[m],k=qa(y),C=m===l?g.isActive:null;C===!1&&(x=S);let _=y===d[m]&&y!==c[m]&&k;if(_&&r&&e.manuallyAnimateOnMount&&(_=!1),g.protectedKeys={...h},!g.isActive&&C===null||!y&&!g.prevProp||Iu(y)||typeof y=="boolean")continue;const E=uR(g.prevProp,y);let A=E||m===l&&g.isActive&&!_&&k||S>x&&k,$=!1;const I=Array.isArray(y)?y:[y];let D=I.reduce(i(m),{});C===!1&&(D={});const{prevResolvedValues:P={}}=g,z={...P,...D},N=B=>{A=!0,p.has(B)&&($=!0,p.delete(B)),g.needsAnimating[B]=!0;const j=e.getValue(B);j&&(j.liveStyle=!1)};for(const B in z){const j=D[B],V=P[B];if(h.hasOwnProperty(B))continue;let R=!1;Mp(j)&&Mp(V)?R=!JS(j,V):R=j!==V,R?j!=null?N(B):p.add(B):j!==void 0&&p.has(B)?N(B):g.protectedKeys[B]=!0}g.prevProp=y,g.prevResolvedValues=D,g.isActive&&(h={...h,...D}),r&&e.blockInitialAnimation&&(A=!1),A&&(!(_&&E)||$)&&u.push(...I.map(B=>({animation:B,options:{type:m}})))}if(p.size){const S={};if(typeof c.initial!="boolean"){const m=Qa(e,Array.isArray(c.initial)?c.initial[0]:c.initial);m&&m.transition&&(S.transition=m.transition)}p.forEach(m=>{const g=e.getBaseTarget(m),y=e.getValue(m);y&&(y.liveStyle=!0),S[m]=g??null}),u.push({animation:S})}let b=!!u.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,b?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=B0(),r=!0}}}function uR(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!JS(t,e):!1}function Ei(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function B0(){return{animate:Ei(!0),whileInView:Ei(),whileHover:Ei(),whileTap:Ei(),whileDrag:Ei(),whileFocus:Ei(),exit:Ei()}}class Ci{constructor(t){this.isMounted=!1,this.node=t}update(){}}class dR extends Ci{constructor(t){super(t),t.animationState||(t.animationState=cR(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Iu(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 fR=0;class pR extends Ci{constructor(){super(...arguments),this.id=fR++}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 hR={animation:{Feature:dR},exit:{Feature:pR}};function Xa(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function hl(e){return{point:{x:e.pageX,y:e.pageY}}}const mR=e=>t=>Fm(t)&&e(t,hl(t));function ya(e,t,n,r){return Xa(e,t,mR(n),r)}function tk({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function gR({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function vR(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 nk=1e-4,yR=1-nk,xR=1+nk,rk=.01,wR=0-rk,bR=0+rk;function $t(e){return e.max-e.min}function SR(e,t,n){return Math.abs(e-t)<=n}function $0(e,t,n,r=.5){e.origin=r,e.originPoint=Xe(t.min,t.max,e.origin),e.scale=$t(n)/$t(t),e.translate=Xe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=yR&&e.scale<=xR||isNaN(e.scale))&&(e.scale=1),(e.translate>=wR&&e.translate<=bR||isNaN(e.translate))&&(e.translate=0)}function xa(e,t,n,r){$0(e.x,t.x,n.x,r?r.originX:void 0),$0(e.y,t.y,n.y,r?r.originY:void 0)}function z0(e,t,n){e.min=n.min+t.min,e.max=e.min+$t(t)}function kR(e,t,n){z0(e.x,t.x,n.x),z0(e.y,t.y,n.y)}function V0(e,t,n){e.min=t.min-n.min,e.max=e.min+$t(t)}function wa(e,t,n){V0(e.x,t.x,n.x),V0(e.y,t.y,n.y)}const U0=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bs=()=>({x:U0(),y:U0()}),H0=()=>({min:0,max:0}),st=()=>({x:H0(),y:H0()});function bn(e){return[e("x"),e("y")]}function Wd(e){return e===void 0||e===1}function Up({scale:e,scaleX:t,scaleY:n}){return!Wd(e)||!Wd(t)||!Wd(n)}function Mi(e){return Up(e)||ik(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ik(e){return W0(e.x)||W0(e.y)}function W0(e){return e&&e!=="0%"}function iu(e,t,n){const r=e-n,i=t*r;return n+i}function q0(e,t,n,r,i){return i!==void 0&&(e=iu(e,i,r)),iu(e,n,r)+t}function Hp(e,t=0,n=1,r,i){e.min=q0(e.min,t,n,r,i),e.max=q0(e.max,t,n,r,i)}function sk(e,{x:t,y:n}){Hp(e.x,t.translate,t.scale,t.originPoint),Hp(e.y,n.translate,n.scale,n.originPoint)}const G0=.999999999999,Y0=1.0000000000001;function CR(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&&zs(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,sk(e,o)),r&&Mi(s.latestValues)&&zs(e,s.latestValues))}t.x<Y0&&t.x>G0&&(t.x=1),t.y<Y0&&t.y>G0&&(t.y=1)}function $s(e,t){e.min=e.min+t,e.max=e.max+t}function Q0(e,t,n,r,i=.5){const s=Xe(e.min,e.max,i);Hp(e,t,n,s,r)}function zs(e,t){Q0(e.x,t.x,t.scaleX,t.scale,t.originX),Q0(e.y,t.y,t.scaleY,t.scale,t.originY)}function ok(e,t){return tk(vR(e.getBoundingClientRect(),t))}function _R(e,t,n){const r=ok(e,n),{scroll:i}=t;return i&&($s(r.x,i.offset.x),$s(r.y,i.offset.y)),r}const ak=({current:e})=>e?e.ownerDocument.defaultView:null,K0=(e,t)=>Math.abs(e-t);function TR(e,t){const n=K0(e.x,t.x),r=K0(e.y,t.y);return Math.sqrt(n**2+r**2)}class lk{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=Gd(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=TR(u.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:x}=u,{timestamp:b}=kt;this.history.push({...x,timestamp:b});const{onStart:S,onMove:m}=this.handlers;p||(S&&S(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=qd(p,this.transformPagePoint),Ue.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:h,onSessionEnd:x,resumeAnimation:b}=this.handlers;if(this.dragSnapToOrigin&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=Gd(u.type==="pointercancel"?this.lastMoveEventInfo:qd(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,S),x&&x(u,S)},!Fm(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=hl(t),a=qd(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=kt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=n;d&&d(t,Gd(a,this.history)),this.removeListeners=pl(ya(this.contextWindow,"pointermove",this.handlePointerMove),ya(this.contextWindow,"pointerup",this.handlePointerUp),ya(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),yi(this.updatePoint)}}function qd(e,t){return t?{point:t(e.point)}:e}function X0(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Gd({point:e},t){return{point:e,delta:X0(e,ck(t)),offset:X0(e,ER(t)),velocity:AR(t,.1)}}function ER(e){return e[0]}function ck(e){return e[e.length-1]}function AR(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=ck(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>lr(t)));)n--;if(!r)return{x:0,y:0};const s=cr(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 jR(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Xe(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Xe(n,e,r.max):Math.min(e,n)),e}function Z0(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 RR(e,{top:t,left:n,bottom:r,right:i}){return{x:Z0(e.x,n,i),y:Z0(e.y,t,r)}}function J0(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 MR(e,t){return{x:J0(e.x,t.x),y:J0(e.y,t.y)}}function PR(e,t){let n=.5;const r=$t(e),i=$t(t);return i>r?n=Ua(t.min,t.max-r,e.min):r>i&&(n=Ua(e.min,e.max-i,t.min)),Or(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 Wp=.35;function OR(e=Wp){return e===!1?e=0:e===!0&&(e=Wp),{x:ey(e,"left","right"),y:ey(e,"top","bottom")}}function ey(e,t,n){return{min:ty(e,t),max:ty(e,n)}}function ty(e,t){return typeof e=="number"?e:e[t]||0}const DR=new WeakMap;class IR{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=st(),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(hl(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:h,onDragStart:x}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Pj(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),bn(S=>{let m=this.getAxisMotionValue(S).get()||0;if(dr.test(m)){const{projection:g}=this.visualElement;if(g&&g.layout){const y=g.layout.layoutBox[S];y&&(m=$t(y)*(parseFloat(m)/100))}}this.originPoint[S]=m}),x&&Ue.postRender(()=>x(d,u)),Pp(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:x,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:S}=u;if(h&&this.currentDirection===null){this.currentDirection=LR(S),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",u.point,S),this.updateAxis("y",u.point,S),this.visualElement.render(),b&&b(d,u)},a=(d,u)=>this.stop(d,u),l=()=>bn(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 lk(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:ak(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&&Ue.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||!Wl(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=jR(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&&Ls(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=RR(r.layoutBox,t):this.constraints=!1,this.elastic=OR(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&bn(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||!Ls(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=_R(r,i.root,this.visualElement.getTransformPagePoint());let o=MR(i.layout.layoutBox,s);if(n){const a=n(gR(o));this.hasMutatedConstraints=!!a,a&&(o=tk(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=bn(d=>{if(!Wl(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,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,x)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Pp(this.visualElement,t),r.start(sg(t,r,0,n,this.visualElement,!1))}stopAnimation(){bn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){bn(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){bn(n=>{const{drag:r}=this.getProps();if(!Wl(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]-Xe(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ls(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};bn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=PR({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(),bn(o=>{if(!Wl(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(Xe(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;DR.set(this.visualElement,this);const t=this.visualElement.current,n=ya(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ls(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()),Ue.read(r);const o=Xa(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(bn(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=Wp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Wl(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 FR extends Ci{constructor(t){super(t),this.removeGroupControls=Rn,this.removeListeners=Rn,this.controls=new IR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rn}unmount(){this.removeGroupControls(),this.removeListeners()}}const ny=e=>(t,n)=>{e&&Ue.postRender(()=>e(t,n))};class BR extends Ci{constructor(){super(...arguments),this.removePointerDownListener=Rn}onPointerDown(t){this.session=new lk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ak(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:ny(t),onStart:ny(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&Ue.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=ya(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 mc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ry(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Yo={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(we.test(e))e=parseFloat(e);else return e;const n=ry(e,t.target.x),r=ry(e,t.target.y);return`${n}% ${r}%`}},$R={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=xi.parse(e);if(i.length>5)return r;const s=xi.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=Xe(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 zR extends v.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;s5(VR),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()})),mc.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()||Ue.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Lm.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]=Qb(),r=v.useContext(Tm);return f.jsx(zR,{...e,layoutGroup:r,switchLayoutGroup:v.useContext(lS),isPresent:t,safeToRemove:n})}const VR={borderRadius:{...Yo,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yo,borderTopRightRadius:Yo,borderBottomLeftRadius:Yo,borderBottomRightRadius:Yo,boxShadow:$R};function UR(e,t,n){const r=Pt(e)?e:Wa(e);return r.start(sg("",r,t,n)),r.animation}function HR(e){return e instanceof SVGElement&&e.tagName!=="svg"}const WR=(e,t)=>e.depth-t.depth;class qR{constructor(){this.children=[],this.isDirty=!1}add(t){jm(this.children,t),this.isDirty=!0}remove(t){Rm(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(WR),this.isDirty=!1,this.children.forEach(t)}}function GR(e,t){const n=ur.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(yi(r),e(s-t))};return Ue.read(r,!0),()=>yi(r)}const dk=["TopLeft","TopRight","BottomLeft","BottomRight"],YR=dk.length,iy=e=>typeof e=="string"?parseFloat(e):e,sy=e=>typeof e=="number"||we.test(e);function QR(e,t,n,r,i,s){i?(e.opacity=Xe(0,n.opacity??1,KR(r)),e.opacityExit=Xe(t.opacity??1,0,XR(r))):s&&(e.opacity=Xe(t.opacity??1,n.opacity??1,r));for(let o=0;o<YR;o++){const a=`border${dk[o]}Radius`;let l=oy(t,a),c=oy(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||sy(l)===sy(c)?(e[a]=Math.max(Xe(iy(l),iy(c),r),0),(dr.test(c)||dr.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Xe(t.rotate||0,n.rotate||0,r))}function oy(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const KR=fk(0,.5,jS),XR=fk(.5,.95,Rn);function fk(e,t,n){return r=>r<e?0:r>t?1:n(Ua(e,t,r))}function ay(e,t){e.min=t.min,e.max=t.max}function xn(e,t){ay(e.x,t.x),ay(e.y,t.y)}function ly(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function cy(e,t,n,r,i){return e-=t,e=iu(e,1/n,r),i!==void 0&&(e=iu(e,1/i,r)),e}function ZR(e,t=0,n=1,r=.5,i,s=e,o=e){if(dr.test(t)&&(t=parseFloat(t),t=Xe(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Xe(s.min,s.max,r);e===s&&(a-=t),e.min=cy(e.min,t,n,a,i),e.max=cy(e.max,t,n,a,i)}function uy(e,t,[n,r,i],s,o){ZR(e,t[n],t[r],t[i],t.scale,s,o)}const JR=["x","scaleX","originX"],eM=["y","scaleY","originY"];function dy(e,t,n,r){uy(e.x,t,JR,n?n.x:void 0,r?r.x:void 0),uy(e.y,t,eM,n?n.y:void 0,r?r.y:void 0)}function fy(e){return e.translate===0&&e.scale===1}function pk(e){return fy(e.x)&&fy(e.y)}function py(e,t){return e.min===t.min&&e.max===t.max}function tM(e,t){return py(e.x,t.x)&&py(e.y,t.y)}function hy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function hk(e,t){return hy(e.x,t.x)&&hy(e.y,t.y)}function my(e){return $t(e.x)/$t(e.y)}function gy(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class nM{constructor(){this.members=[]}add(t){jm(this.members,t),t.scheduleRender()}remove(t){if(Rm(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 rM(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:x}=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) `),x&&(r+=`skewY(${x}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 Yd=["","X","Y","Z"],iM={visibility:"hidden"},vy=1e3;let sM=0;function Qd(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function mk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=SS(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ue,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&mk(r)}function gk({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=sM++,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(lM),this.nodes.forEach(pM),this.nodes.forEach(hM),this.nodes.forEach(cM)},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 qR)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Pm),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=HR(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),mc.hasAnimatedSinceResize&&(mc.hasAnimatedSinceResize=!1,this.nodes.forEach(xy))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||xM,{onLayoutAnimationStart:S,onLayoutAnimationComplete:m}=d.getProps(),g=!this.targetLayout||!hk(this.targetLayout,x),y=!p&&h;if(this.options.layoutRoot||this.resumeFrom||y||p&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,y);const k={...Dm(b,"layout"),onPlay:S,onComplete:m};(d.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k)}else p||xy(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,yi(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(mM),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&&mk(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(yy);return}this.isUpdating||this.nodes.forEach(dM),this.isUpdating=!1,this.nodes.forEach(fM),this.nodes.forEach(oM),this.nodes.forEach(aM),this.clearAllSnapshots();const a=ur.now();kt.delta=Or(0,1e3/60,a-kt.timestamp),kt.timestamp=a,kt.isProcessing=!0,Bd.update.process(kt),Bd.preRender.process(kt),Bd.render.process(kt),kt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Lm.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(uM),this.sharedNodes.forEach(gM)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Ue.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Ue.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$t(this.snapshot.measuredBox.x)&&!$t(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=st(),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&&!pk(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&(a||Mi(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)),wM(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return st();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(bM))){const{scroll:d}=this.root;d&&($s(a.x,d.offset.x),$s(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=st();if(xn(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&&xn(a,o),$s(a.x,u.offset.x),$s(a.y,u.offset.y))}return a}applyTransform(o,a=!1){const l=st();xn(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&&zs(l,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Mi(d.latestValues)&&zs(l,d.latestValues)}return Mi(this.latestValues)&&zs(l,this.latestValues),l}removeTransform(o){const a=st();xn(a,o);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Mi(c.latestValues))continue;Up(c.latestValues)&&c.updateSnapshot();const d=st(),u=c.measurePageBox();xn(d,u),dy(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,d)}return Mi(this.latestValues)&&dy(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!==kt.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=kt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=st(),this.relativeTargetOrigin=st(),wa(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),xn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=st(),this.targetWithTransforms=st()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),kR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):xn(this.target,this.layout.layoutBox),sk(this.target,this.targetDelta)):xn(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=st(),this.relativeTargetOrigin=st(),wa(this.relativeTargetOrigin,this.target,h.target),xn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Up(this.parent.latestValues)||ik(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 x;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty)&&(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===kt.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;xn(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;CR(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=st());const{target:h}=o;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ly(this.prevProjectionDelta.x,this.projectionDelta.x),ly(this.prevProjectionDelta.y,this.projectionDelta.y)),xa(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!gy(this.projectionDelta.x,this.prevProjectionDelta.x)||!gy(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=Bs(),this.projectionDelta=Bs(),this.projectionDeltaWithTransform=Bs()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},u=Bs();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=st(),h=l?l.source:void 0,x=this.layout?this.layout.source:void 0,b=h!==x,S=this.getStack(),m=!S||S.members.length<=1,g=!!(b&&!m&&this.options.crossfade===!0&&!this.path.some(yM));this.animationProgress=0;let y;this.mixTargetDelta=k=>{const C=k/1e3;wy(u.x,o.x,C),wy(u.y,o.y,C),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(wa(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),vM(this.relativeTarget,this.relativeTargetOrigin,p,C),y&&tM(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=st()),xn(y,this.relativeTarget)),b&&(this.animationValues=d,QR(d,c,this.latestValues,C,g,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},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&&(yi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ue.update(()=>{mc.hasAnimatedSinceResize=!0,this.currentAnimation=UR(0,vy,{...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(vy),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&&vk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||st();const u=$t(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=$t(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}xn(a,l),zs(a,d),xa(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new nM),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&&Qd("z",o,c,this.animationValues);for(let d=0;d<Yd.length;d++)Qd(`rotate${Yd[d]}`,o,c,this.animationValues),Qd(`skew${Yd[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 iM;const a={visibility:""},l=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,a.opacity="",a.pointerEvents=hc(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=hc(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Mi(this.latestValues)&&(h.transform=l?l({},""):"none",this.hasProjected=!1),h}const d=c.animationValues||c.latestValues;this.applyTransformsToTarget(),a.transform=rM(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 Ga){if(d[h]===void 0)continue;const{correct:x,applyTo:b,isCSSVariable:S}=Ga[h],m=a.transform==="none"?d[h]:x(d[h],c);if(b){const g=b.length;for(let y=0;y<g;y++)a[b[y]]=m}else S?this.options.visualElement.renderState.vars[h]=m:a[h]=m}return this.options.layoutId&&(a.pointerEvents=c===this?hc(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(yy),this.root.sharedNodes.clear()}}}function oM(e){e.updateLayout()}function aM(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"?bn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=$t(p);p.min=r[u].min,p.max=p.min+h}):vk(s,t.layoutBox,r)&&bn(u=>{const p=o?t.measuredBox[u]:t.layoutBox[u],h=$t(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=Bs();xa(a,r,t.layoutBox);const l=Bs();o?xa(l,e.applyTransform(i,!0),t.measuredBox):xa(l,r,t.layoutBox);const c=!pk(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 x=st();wa(x,t.layoutBox,p.layoutBox);const b=st();wa(b,r,h.layoutBox),hk(x,b)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=x,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 lM(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 cM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function uM(e){e.clearSnapshot()}function yy(e){e.clearMeasurements()}function dM(e){e.isLayoutDirty=!1}function fM(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function xy(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function pM(e){e.resolveTargetDelta()}function hM(e){e.calcProjection()}function mM(e){e.resetSkewAndRotation()}function gM(e){e.removeLeadSnapshot()}function wy(e,t,n){e.translate=Xe(t.translate,0,n),e.scale=Xe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function by(e,t,n,r){e.min=Xe(t.min,n.min,r),e.max=Xe(t.max,n.max,r)}function vM(e,t,n,r){by(e.x,t.x,n.x,r),by(e.y,t.y,n.y,r)}function yM(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const xM={duration:.45,ease:[.4,0,.1,1]},Sy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ky=Sy("applewebkit/")&&!Sy("chrome/")?Math.round:Rn;function Cy(e){e.min=ky(e.min),e.max=ky(e.max)}function wM(e){Cy(e.x),Cy(e.y)}function vk(e,t,n){return e==="position"||e==="preserve-aspect"&&!SR(my(t),my(n),.2)}function bM(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const SM=gk({attachResizeListener:(e,t)=>Xa(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Kd={current:void 0},yk=gk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Kd.current){const e=new SM({});e.mount(window),e.setOptions({layoutScroll:!0}),Kd.current=e}return Kd.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),kM={pan:{Feature:BR},drag:{Feature:FR,ProjectionNode:yk,MeasureLayout:uk}};function _y(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&&Ue.postRender(()=>s(t,hl(t)))}class CM extends Ci{mount(){const{current:t}=this.node;t&&(this.unmount=Oj(t,(n,r)=>(_y(this.node,r,"Start"),i=>_y(this.node,i,"End"))))}unmount(){}}class _M extends Ci{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=pl(Xa(this.node.current,"focus",()=>this.onFocus()),Xa(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Ty(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&&Ue.postRender(()=>s(t,hl(t)))}class TM extends Ci{mount(){const{current:t}=this.node;t&&(this.unmount=Fj(t,(n,r)=>(Ty(this.node,r,"Start"),(i,{success:s})=>Ty(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const qp=new WeakMap,Xd=new WeakMap,EM=e=>{const t=qp.get(e.target);t&&t(e)},AM=e=>{e.forEach(EM)};function jM({root:e,...t}){const n=e||document;Xd.has(n)||Xd.set(n,{});const r=Xd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(AM,{root:e,...t})),r[i]}function RM(e,t,n){const r=jM(t);return qp.set(e,n),r.observe(e),()=>{qp.delete(e),r.unobserve(e)}}const MM={some:0,all:1};class PM extends Ci{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:MM[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 RM(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(NM(t,n))&&this.startObserver()}unmount(){}}function NM({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const OM={inView:{Feature:PM},tap:{Feature:TM},focus:{Feature:_M},hover:{Feature:CM}},DM={layout:{ProjectionNode:yk,MeasureLayout:uk}},Gp={current:null},xk={current:!1};function IM(){if(xk.current=!0,!!Em)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gp.current=e.matches;e.addListener(t),t()}else Gp.current=!1}const LM=[...HS,Rt,xi],FM=e=>LM.find(US(e)),BM=new WeakMap;function $M(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Pt(i))e.addValue(r,i);else if(Pt(s))e.addValue(r,Wa(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,Wa(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ey=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class zM{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=ng,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=ur.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,Ue.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=Lu(n),this.isVariantNode=oS(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 x=p[h];l[h]!==void 0&&Pt(x)&&x.set(l[h],!1)}}mount(t){this.current=t,BM.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)),xk.current||IM(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Gp.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),yi(this.notifyUpdate),yi(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=fs.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Ue.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 wo){const n=wo[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):st()}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<Ey.length;r++){const i=Ey[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=$M(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=Wa(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"&&(zS(r)||MS(r))?r=parseFloat(r):!FM(r)&&xi.test(n)&&(r=FS(t,n)),this.setBaseTarget(t,Pt(r)?r.get():r)),Pt(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=Km(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&&!Pt(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 Pm),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class wk extends zM{constructor(){super(...arguments),this.KeyframeResolver=WS}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;Pt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function VM(e){return window.getComputedStyle(e)}class UM extends wk{constructor(){super(...arguments),this.type="html",this.renderInstance=vS}readValueFromInstance(t,n){if(fs.has(n))return n3(t,n);{const r=VM(t),i=(Vm(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ok(t,n)}build(t,n,r){Wm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Xm(t,n,r)}}class HM extends wk{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=st,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&gS(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(fs.has(n)){const r=LS(n);return r&&r.default||0}return n=yS.has(n)?n:zm(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return wS(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&Ue.postRender(this.updateDimensions)}build(t,n,r){Ym(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){xS(t,n,r,i)}mount(t){this.isSVGTag=Qm(t.tagName),super.mount(t)}}const WM=(e,t)=>Gm(e)?new HM(t):new UM(t,{allowProjection:e!==v.Fragment}),qM=j5({...hR,...OM,...kM,...DM},WM),Oe=Wj(qM);class GM{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 YM=()=>new GM;function QM(){return Nu(YM)}var Hr=(e=>(e.None="none",e.Sm="sm",e.Md="md",e.Lg="lg",e.Xl="xl",e.Full="full",e))(Hr||{});const bk=v.createContext({}),KM={[re.TooltipDefault]:"Bizimle sohbet edin!",[re.TooltipActive]:"Yeni mesajlar var!",[re.TooltipBalloonTitle]:"Canlı Destek",[re.TooltipBalloonSub]:"Size nasıl yardımcı olabilirim?",[re.TooltipBalloonGreeting]:"Merhaba, ben {name} 👋",[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.MinimizedUnreadMessage]:"{count} Yeni Mesaj",[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"},XM={[w.Background]:"#ffffff",[w.Border]:"#e2e8f0",[w.TooltipText]:"#1e40af",[w.TooltipBackground]:"#dbeafe",[w.TooltipBorder]:"#3b82f6",[w.HeaderBackground]:"#ffffff",[w.HeaderBorder]:"#e2e8f0",[w.HeaderText]:"#1e293b",[w.FooterBackground]:"#f8fafc",[w.FooterBorder]:"#e2e8f0",[w.FooterText]:"#475569",[w.MessageAdminBackground]:"#f1f5f9",[w.MessageAdminText]:"#334155",[w.MessageVisitorBackground]:"#3b82f6",[w.MessageVisitorText]:"#ffffff",[w.MessageAgentBackground]:"#ede9fe",[w.MessageAgentText]:"#5b21b6",[w.GreeterBackground]:"#ffffff",[w.GreeterText]:"#334155",[w.GreeterBorder]:"#e2e8f0",[w.GreeterTopBackground]:"linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)",[w.GreeterTopText]:"#ffffff",[w.GreeterButtonBackground]:"#3b82f6",[w.GreeterButtonText]:"#ffffff",[w.ButtonBackground]:"#3b82f6",[w.ButtonText]:"#ffffff",[w.InputBackground]:"#f8fafc",[w.InputText]:"#1e293b",[w.InputBorder]:"#e2e8f0",[w.CloseButtonBackground]:"#f1f5f9",[w.CloseButtonText]:"#475569",[w.CloseButtonHover]:"#e2e8f0",[w.IconColor]:"#64748b",[w.IconBackground]:"transparent",[w.ErrorBackground]:"#fef2f2",[w.ErrorText]:"#dc2626",[w.ErrorBorder]:"#fca5a5",[w.SuccessBackground]:"#f0fdf4",[w.SuccessText]:"#16a34a",[w.SuccessBorder]:"#86efac",[w.WarningBackground]:"#fffbeb",[w.WarningText]:"#d97706",[w.WarningBorder]:"#fcd34d",[w.LinkColor]:"#2563eb",[w.LinkHoverColor]:"#1d4ed8",[w.DividerColor]:"#e2e8f0",[w.ShadowColor]:"rgba(0, 0, 0, 0.1)",[w.StarActiveColor]:"#f59e0b",[w.StarInactiveColor]:"#e2e8f0",[w.ModalOverlayColor]:"rgba(0, 0, 0, 0.4)",[w.ChatCloseConfirmText]:"#dc2626",[w.RatingHeaderBackground]:"#3b82f6",[w.RatingHeaderText]:"#ffffff",[w.RatingSuccessBackground]:"#ffffff",[w.RatingSuccessText]:"#334155",[w.RatingRateConversationText]:"#1e293b"},ZM={[w.Background]:"#0a0a0a",[w.Border]:"#262626",[w.TooltipText]:"#e5e5e5",[w.TooltipBackground]:"#262626",[w.TooltipBorder]:"#404040",[w.HeaderBackground]:"#171717",[w.HeaderBorder]:"#262626",[w.HeaderText]:"#fafafa",[w.FooterBackground]:"#0a0a0a",[w.FooterBorder]:"#262626",[w.FooterText]:"#a3a3a3",[w.MessageAdminBackground]:"#262626",[w.MessageAdminText]:"#e5e5e5",[w.MessageVisitorBackground]:"#171717",[w.MessageVisitorText]:"#e5e5e5",[w.MessageAgentBackground]:"#5b21b6",[w.MessageAgentText]:"#e9d5ff",[w.GreeterBackground]:"#171717",[w.GreeterText]:"#e5e5e5",[w.GreeterBorder]:"#262626",[w.GreeterTopBackground]:"linear-gradient(135deg, #262626 0%, #171717 100%)",[w.GreeterTopText]:"#fafafa",[w.GreeterButtonBackground]:"#3b82f6",[w.GreeterButtonText]:"#ffffff",[w.ButtonBackground]:"#3b82f6",[w.ButtonText]:"#ffffff",[w.InputBackground]:"#171717",[w.InputText]:"#e5e5e5",[w.InputBorder]:"#3f3f3f",[w.CloseButtonBackground]:"#262626",[w.CloseButtonText]:"#a3a3a3",[w.CloseButtonHover]:"#404040",[w.IconColor]:"#a3a3a3",[w.IconBackground]:"transparent",[w.ErrorBackground]:"#450a0a",[w.ErrorText]:"#fca5a5",[w.ErrorBorder]:"#7f1d1d",[w.SuccessBackground]:"#052e16",[w.SuccessText]:"#86efac",[w.SuccessBorder]:"#14532d",[w.WarningBackground]:"#451a03",[w.WarningText]:"#fcd34d",[w.WarningBorder]:"#78350f",[w.LinkColor]:"#3b82f6",[w.LinkHoverColor]:"#60a5fa",[w.DividerColor]:"#262626",[w.ShadowColor]:"rgba(0, 0, 0, 0.4)",[w.StarActiveColor]:"#f59e0b",[w.StarInactiveColor]:"#404040",[w.ModalOverlayColor]:"rgba(0, 0, 0, 0.7)",[w.ChatCloseConfirmText]:"#fca5a5",[w.RatingHeaderBackground]:"#171717",[w.RatingHeaderText]:"#fafafa",[w.RatingSuccessBackground]:"#171717",[w.RatingSuccessText]:"#e5e5e5",[w.RatingRateConversationText]:"#e5e5e5"},JM={[Hr.None]:"0px",[Hr.Sm]:"var(--radius-sm)",[Hr.Md]:"var(--radius-md)",[Hr.Lg]:"var(--radius-lg)",[Hr.Xl]:"var(--radius-lg)",[Hr.Full]:"calc(infinity * 1px)"},e4=e=>{const t={...KM};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 t4(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 n4(e){const t=t4(e,.2);return{[w.ButtonBackground]:t,[w.ButtonText]:Zd,[w.GreeterButtonBackground]:t,[w.GreeterButtonText]:Zd,[w.MessageVisitorBackground]:t,[w.MessageVisitorText]:Zd}}const r4=(e,t)=>{var i,s;const r={...t==="dark"?ZM:XM};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=n4(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},Sk="lc:theme:mode";function kk(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ck(){try{const e=localStorage.getItem(Sk);if(e==="light"||e==="dark"||e==="system")return e}catch{}return Be.System}function Ay(){const e=Ck(),t=kk();return e===Be.System?t:e}function i4({children:e,widget:t}){const[n,r]=v.useState(Ck),[i,s]=v.useState(kk);v.useEffect(()=>{const x=window.matchMedia("(prefers-color-scheme: dark)"),b=S=>{s(S.matches?"dark":"light")};return x.addEventListener("change",b),()=>x.removeEventListener("change",b)},[]);const o=n===Be.System?i:n,a=v.useCallback(x=>{r(x);try{localStorage.setItem(Sk,x)}catch{}},[]),l=r4(t,o),c=e4(t),d=t&&t.appearance&&t.appearance.design&&t.appearance.design.border_radius?t.appearance.design.border_radius:Hr.Md,u=x=>l[x],p=x=>c[x],h=()=>JM[d];return f.jsx(bk.Provider,{value:{colors:l,texts:c,getColor:u,getText:p,getRadius:h,mode:n,resolvedMode:o,setMode:a},children:e})}const Ee=()=>v.useContext(bk),Oo=()=>Ee().getText;function An({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=w.ButtonText,bgKey:d=w.ButtonBackground,animations:u={},withoutTheming:p,...h}){const x=Ee();return f.jsx(Oe.button,{type:t,className:Ne("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,c0[n]&&c0[n][r],vj[i][o?"rounded":"default"]),disabled:s,style:{transition:"all 0.2s ease",...!p&&{color:x.getColor(c),backgroundColor:x.getColor(d),...o?{}:{borderRadius:x.getRadius()}},...l},...u,...h,children:e})}function ee(){}ee.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"})})};ee.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"})});ee.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"})});ee.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"})});ee.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"})})};ee.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"})]})};ee.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"})});ee.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"})})]});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})})};ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})]});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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"})});ee.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 gc(){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 lt=(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))(lt||{});const Hn=(e,t,n)=>{let r=e;["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(r=`${n}:${e}`),localStorage.setItem(r,t)},ia=(e,t)=>{let n=e;return["lc:customer:token","lc:customer:refresh_token"].includes(e)&&(n=`${t}:${e}`),localStorage.getItem(n)},ba=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`),og(e)},_k=e=>{localStorage.removeItem(`${e}:lc:customer:token`),localStorage.removeItem(`${e}:lc:customer:refresh_token`)},ql=(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`))):og(e)},Zn=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}},og=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`)},Dr=e=>{const t=`${e}:lc:device:id`;let n=localStorage.getItem(t);return n||(n=gc(),localStorage.setItem(t,n)),n},s4={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},jy=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(x=>x(t,h))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(s4?"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},o4=e=>e?jy(e):jy;var Tk={exports:{}},Ek={},Ak={exports:{}},jk={};/**
|
|
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 So=v;function
|
|
78
|
+
*/var So=v;function a4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var l4=typeof Object.is=="function"?Object.is:a4,c4=So.useState,u4=So.useEffect,d4=So.useLayoutEffect,f4=So.useDebugValue;function p4(e,t){var n=t(),r=c4({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return d4(function(){i.value=n,i.getSnapshot=t,Jd(i)&&s({inst:i})},[e,n,t]),u4(function(){return Jd(i)&&s({inst:i}),e(function(){Jd(i)&&s({inst:i})})},[e]),f4(n),n}function Jd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!l4(e,n)}catch{return!0}}function h4(e,t){return t()}var m4=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h4:p4;jk.useSyncExternalStore=So.useSyncExternalStore!==void 0?So.useSyncExternalStore:m4;Ak.exports=jk;var g4=Ak.exports;/**
|
|
79
79
|
* @license React
|
|
80
80
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
81
81
|
*
|
|
@@ -83,23 +83,23 @@ 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 Bu=v,g4=m4;function v4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var y4=typeof Object.is=="function"?Object.is:v4,x4=g4.useSyncExternalStore,w4=Bu.useRef,b4=Bu.useEffect,S4=Bu.useMemo,k4=Bu.useDebugValue;Ek.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=w4(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=S4(function(){function l(h){if(!c){if(c=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return u=x}return u=h}if(x=u,y4(d,h))return x;var b=r(h);return i!==void 0&&i(x,b)?x:(d=h,u=b)}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=x4(e,s[0],s[1]);return b4(function(){o.hasValue=!0,o.value=a},[a]),k4(a),a};Tk.exports=Ek;var C4=Tk.exports;const _4=Ir(C4),Rk={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:T4}=ne,{useSyncExternalStoreWithSelector:E4}=_4;let Ry=!1;const A4=e=>e;function j4(e,t=A4,n){(Rk?"production":void 0)!=="production"&&n&&!Ry&&(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"),Ry=!0);const r=E4(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return T4(r),r}const My=e=>{(Rk?"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"?s4(e):e,n=(r,i)=>j4(t,r,i);return Object.assign(n,t),n},R4=e=>e?My(e):My,Z=R4(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",minimizedAssigneeName:null,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,minimizedAssigneeName:null});const r=(n=Z.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setMinimizedAssigneeName:t=>e({minimizedAssigneeName:t}),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&&ql(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&&ql(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&&ql(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}${lt.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${lt.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&ql(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&&og(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1,aiAgentRequestInFlight:!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}}),aiAgentRequestInFlight:!1,setAIAgentRequestInFlight:t=>e({aiAgentRequestInFlight:t})})),M4=e=>({accessToken:localStorage.getItem(`${e}:${lt.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${lt.CustomerRefreshToken}`)||""}),ml=()=>{const{widget:e}=Z();return e?M4(e.link_id):null},Xi=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}},Xs=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null},P4=e=>ia(lt.DeviceId,e)||Xs("device_id")||Dr(e),Zi=(e,t)=>({...e,"X-Device-Id":P4(t)});function Yp(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const ag=()=>Sm({mutationFn:e=>pr(`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"})})}),N4=(e,t)=>pr(`clients/${e}/chats`,{headers:t}),vc=(e,t)=>pr(`clients/${e}/chats`,{method:"DELETE",headers:t}),O4=(e,t,n,r)=>pr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:Zi(n??{},r)}),D4=()=>{const e=ml(),{widget:t}=Z(),n=(t==null?void 0:t.link_id)??"";return Sm({mutationFn:r=>O4(r.rating,r.comment,Xi(e),n)})},I4=e=>{const t=ml(),{widget:n}=Z(),r=(n==null?void 0:n.link_id)??"";return Sm({mutationFn:i=>pr(`clients/${e}/chats/files`,{method:"POST",headers:Zi(Xi(t),r),body:aE({files:i},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function L4(e){return e&&typeof e=="object"&&"file_urls"in e}const F4=e=>{const t=`${Cb}/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)}}},B4=(e,t)=>bm({queryKey:["visitors","history",e,t],queryFn:async()=>{const n=`visitors/history?widget_id=${e}&device_id=${t}`,r=4;let i=await pr(n);for(let s=0;s<r-1;s++){const[,o]=i;if(o!==429)break;await new Promise(a=>setTimeout(a,Math.min(1e3*2**s,8e3))),i=await pr(n)}return i},enabled:!!e&&!!t}),$4=(e,t,n)=>pr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`),Mk=e=>["widgetAgent",e];async function Pk(e){const[t,n]=await z4(e);if(n===204)return null;if(n===200&&t&&typeof t=="object"&&"id"in t&&"is_active"in t&&t.is_active)return t;throw new Error(`getWidgetAgent: ${n}`)}function Nk(e){return bm({queryKey:Mk(e??""),queryFn:()=>Pk(e),enabled:!!e,retry:(t,n)=>(n instanceof Error?n.message:"").includes("429")?t<4:t<2,retryDelay:t=>Math.min(1e3*2**t,8e3),staleTime:5*60*1e3})}async function z4(e){const[t,n]=await pr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function ps(e){this._maxSize=e,this.clear()}ps.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ps.prototype.get=function(e){return this._values[e]};ps.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var V4=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ok=/^\d+$/,U4=/^\d/,H4=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,W4=/^\s*(['"]?)(.*?)(\1)\s*$/,lg=512,Py=new ps(lg),Ny=new ps(lg),Oy=new ps(lg),Ji={Cache:ps,split:Qp,normalizePath:ef,setter:function(e){var t=ef(e);return Ny.get(e)||Ny.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=ef(e);return Oy.get(e)||Oy.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+(cg(n)||Ok.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){q4(Array.isArray(e)?e:Qp(e),t,n)}};function ef(e){return Py.get(e)||Py.set(e,Qp(e).map(function(t){return t.replace(W4,"$2")}))}function Qp(e){return e.match(V4)||[""]}function q4(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(Q4(i)&&(i='"'+i+'"'),a=cg(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function cg(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function G4(e){return e.match(U4)&&!e.match(Ok)}function Y4(e){return H4.test(e)}function Q4(e){return!cg(e)&&(G4(e)||Y4(e))}const K4=/[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,$u=e=>e.match(K4)||[],zu=e=>e[0].toUpperCase()+e.slice(1),ug=(e,t)=>$u(e).join(t).toLowerCase(),Dk=e=>$u(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),X4=e=>zu(Dk(e)),Z4=e=>ug(e,"_"),J4=e=>ug(e,"-"),eP=e=>zu(ug(e," ")),tP=e=>$u(e).map(zu).join(" ");var tf={words:$u,upperFirst:zu,camelCase:Dk,pascalCase:X4,snakeCase:Z4,kebabCase:J4,sentenceCase:eP,titleCase:tP},dg={exports:{}};dg.exports=function(e){return Ik(nP(e),e)};dg.exports.array=Ik;function Ik(e,t){var n=e.length,r=new Array(n),i={},s=n,o=rP(t),a=iP(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 x=h[--d];l(x,a.get(x),u)}while(d);u.delete(c)}r[--n]=c}}}function nP(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 rP(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 iP(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var sP=dg.exports;const oP=Ir(sP),aP=Object.prototype.toString,lP=Error.prototype.toString,cP=RegExp.prototype.toString,uP=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",dP=/^Symbol\((.*)\)(.*)$/;function fP(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Dy(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return fP(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return uP.call(e).replace(dP,"Symbol($1)");const r=aP.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+lP.call(e)+"]":r==="RegExp"?cP.call(e):null}function hi(e,t){let n=Dy(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=Dy(this[r],t);return s!==null?s:i},2)}function Lk(e){return e==null?[]:[].concat(e)}let Fk,Bk,$k,pP=/\$\{\s*(\w+)\s*\}/g;Fk=Symbol.toStringTag;class Iy{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[Fk]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Lk(t).forEach(s=>{if(Kt.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]}}Bk=Symbol.hasInstance;$k=Symbol.toStringTag;class Kt 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(pP,(i,s)=>hi(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 Iy(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[$k]="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,Kt)}static[Bk](t){return Iy[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let er={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 \`${hi(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${hi(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${hi(n,!0)}\``+i}},Wt={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"},hP={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"},Kp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},mP={isValue:"${path} field must be ${value}"},yc={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},gP={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"},vP={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: \`${hi(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: \`${hi(n,!0)}\``}return Kt.formatError(er.notType,e)}};Object.assign(Object.create(null),{mixed:er,string:Wt,number:hP,date:Kp,object:yc,array:gP,boolean:mP,tuple:vP});const fg=e=>e&&e.__isYupSchema__;class su{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 su(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(!fg(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Gl={context:"$",value:"."};class hs{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]===Gl.context,this.isValue=this.key[0]===Gl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Gl.context:this.isValue?Gl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Ji.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}}hs.prototype.__isYupRef=!0;const Bi=e=>e==null;function Cs(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:x,context:b,abortEarly:S=o.spec.abortEarly,disableStackTrace:m=o.spec.disableStackTrace}=i;function g(I){return hs.isRef(I)?I.getValue(n,x,b):I}function y(I={}){const O=Object.assign({value:n,originalValue:s,label:o.spec.label,path:I.path||r,spec:o.spec,disableStackTrace:I.disableStackTrace||m},u,I.params);for(const P of Object.keys(O))O[P]=g(O[P]);const $=new Kt(Kt.formatError(I.message||p,O),n,O.path,I.type||c,O.disableStackTrace);return $.params=O,$}const C=S?a:l;let k={path:r,parent:x,type:c,from:i.from,createError:y,resolve:g,options:i,originalValue:s,schema:o};const _=I=>{Kt.isError(I)?C(I):I?l(null):C(y())},E=I=>{Kt.isError(I)?C(I):a(I)};if(h&&Bi(n))return _(!0);let V;try{var D;if(V=d.call(k,n,k),typeof((D=V)==null?void 0:D.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(V).then(_,E)}}catch(I){E(I);return}_(V)}return t.OPTIONS=e,t}function yP(e,t,n,r=n){let i,s,o;return t?(Ji.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 ou extends Set{describe(){const t=[];for(const n of this.values())t.push(hs.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 ou(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Vs(e,t=new Map){if(fg(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]=Vs(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,Vs(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Vs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Vs(i,t)}else throw Error(`Unable to clone ${e}`);return n}class hr{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 ou,this._blacklist=new ou,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(er.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=Vs(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&&Bi(s))return s;let o=hi(t),a=hi(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 Bu=v,v4=g4;function y4(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var x4=typeof Object.is=="function"?Object.is:y4,w4=v4.useSyncExternalStore,b4=Bu.useRef,S4=Bu.useEffect,k4=Bu.useMemo,C4=Bu.useDebugValue;Ek.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=b4(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=k4(function(){function l(h){if(!c){if(c=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return u=x}return u=h}if(x=u,x4(d,h))return x;var b=r(h);return i!==void 0&&i(x,b)?x:(d=h,u=b)}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=w4(e,s[0],s[1]);return S4(function(){o.hasValue=!0,o.value=a},[a]),C4(a),a};Tk.exports=Ek;var _4=Tk.exports;const T4=Ir(_4),Rk={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},{useDebugValue:E4}=ne,{useSyncExternalStoreWithSelector:A4}=T4;let Ry=!1;const j4=e=>e;function R4(e,t=j4,n){(Rk?"production":void 0)!=="production"&&n&&!Ry&&(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"),Ry=!0);const r=A4(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return E4(r),r}const My=e=>{(Rk?"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"?o4(e):e,n=(r,i)=>R4(t,r,i);return Object.assign(n,t),n},M4=e=>e?My(e):My,Z=M4(e=>({widget:null,open:localStorage.getItem("lc:widget:isHaveChat")==="true",isInputFocused:!1,isHaveChat:localStorage.getItem("lc:widget:isHaveChat")==="true",minimizedAssigneeName:null,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,minimizedAssigneeName:null});const r=(n=Z.getState().widget)==null?void 0:n.link_id;r&&localStorage.setItem(`${r}:showActionButtons`,"false")}},setMinimizedAssigneeName:t=>e({minimizedAssigneeName:t}),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&&ql(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&&ql(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&&ql(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}${lt.HumanNeedRequested}`,"true"):localStorage.removeItem(`${s}${lt.HumanNeedRequested}`),n.aiAgent&&n.isAIAgentMode&&ql(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&&og(n),{aiAgent:null,isAIAgentMode:!1,aiAgentSessionId:null,humanNeedRequested:!1,aiAgentMessages:[],connectingToOperator:!1,showOperatorForm:!1,aiAgentRequestInFlight:!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}}),aiAgentRequestInFlight:!1,setAIAgentRequestInFlight:t=>e({aiAgentRequestInFlight:t})})),P4=e=>({accessToken:localStorage.getItem(`${e}:${lt.CustomerToken}`)||"",refreshToken:localStorage.getItem(`${e}:${lt.CustomerRefreshToken}`)||""}),ml=()=>{const{widget:e}=Z();return e?P4(e.link_id):null},Xi=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}},Xs=e=>{const t=document.cookie.split(";").find(n=>n.includes(e));return t?t.split("=")[1]:null},N4=e=>ia(lt.DeviceId,e)||Xs("device_id")||Dr(e),Zi=(e,t)=>({...e,"X-Device-Id":N4(t)});function Yp(e){return e&&typeof e=="object"&&"customer_token"in e&&"customer_refresh_token"in e}const ag=()=>Sm({mutationFn:e=>pr(`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"})})}),O4=(e,t)=>pr(`clients/${e}/chats`,{headers:t}),vc=(e,t)=>pr(`clients/${e}/chats`,{method:"DELETE",headers:t}),D4=(e,t,n,r)=>pr("review",{method:"POST",body:JSON.stringify({rating:e,comment:t||void 0}),headers:Zi(n??{},r)}),I4=()=>{const e=ml(),{widget:t}=Z(),n=(t==null?void 0:t.link_id)??"";return Sm({mutationFn:r=>D4(r.rating,r.comment,Xi(e),n)})},L4=e=>{const t=ml(),{widget:n}=Z(),r=(n==null?void 0:n.link_id)??"";return Sm({mutationFn:i=>pr(`clients/${e}/chats/files`,{method:"POST",headers:Zi(Xi(t),r),body:lE({files:i},{arrayWithBracketAndIndex:!1,arrayWithBrackets:!1})})})};function F4(e){return e&&typeof e=="object"&&"file_urls"in e}const B4=e=>{const t=`${Cb}/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)}}},$4=(e,t)=>bm({queryKey:["visitors","history",e,t],queryFn:async()=>{const n=`visitors/history?widget_id=${e}&device_id=${t}`,r=4;let i=await pr(n);for(let s=0;s<r-1;s++){const[,o]=i;if(o!==429)break;await new Promise(a=>setTimeout(a,Math.min(1e3*2**s,8e3))),i=await pr(n)}return i},enabled:!!e&&!!t}),z4=(e,t,n)=>pr(`visitors/chats/${e}/messages?widget_id=${t}&device_id=${n}`),Mk=e=>["widgetAgent",e];async function Pk(e){const[t,n]=await V4(e);if(n===204)return null;if(n===200&&t&&typeof t=="object"&&"id"in t&&"is_active"in t&&t.is_active)return t;throw new Error(`getWidgetAgent: ${n}`)}function Nk(e){return bm({queryKey:Mk(e??""),queryFn:()=>Pk(e),enabled:!!e,retry:(t,n)=>(n instanceof Error?n.message:"").includes("429")?t<4:t<2,retryDelay:t=>Math.min(1e3*2**t,8e3),staleTime:5*60*1e3})}async function V4(e){const[t,n]=await pr(`widgets/${e}/agent`);return n===204?[null,n]:[t,n]}function ps(e){this._maxSize=e,this.clear()}ps.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ps.prototype.get=function(e){return this._values[e]};ps.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var U4=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ok=/^\d+$/,H4=/^\d/,W4=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,q4=/^\s*(['"]?)(.*?)(\1)\s*$/,lg=512,Py=new ps(lg),Ny=new ps(lg),Oy=new ps(lg),Ji={Cache:ps,split:Qp,normalizePath:ef,setter:function(e){var t=ef(e);return Ny.get(e)||Ny.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=ef(e);return Oy.get(e)||Oy.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+(cg(n)||Ok.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){G4(Array.isArray(e)?e:Qp(e),t,n)}};function ef(e){return Py.get(e)||Py.set(e,Qp(e).map(function(t){return t.replace(q4,"$2")}))}function Qp(e){return e.match(U4)||[""]}function G4(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(K4(i)&&(i='"'+i+'"'),a=cg(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function cg(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function Y4(e){return e.match(H4)&&!e.match(Ok)}function Q4(e){return W4.test(e)}function K4(e){return!cg(e)&&(Y4(e)||Q4(e))}const X4=/[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,$u=e=>e.match(X4)||[],zu=e=>e[0].toUpperCase()+e.slice(1),ug=(e,t)=>$u(e).join(t).toLowerCase(),Dk=e=>$u(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),Z4=e=>zu(Dk(e)),J4=e=>ug(e,"_"),eP=e=>ug(e,"-"),tP=e=>zu(ug(e," ")),nP=e=>$u(e).map(zu).join(" ");var tf={words:$u,upperFirst:zu,camelCase:Dk,pascalCase:Z4,snakeCase:J4,kebabCase:eP,sentenceCase:tP,titleCase:nP},dg={exports:{}};dg.exports=function(e){return Ik(rP(e),e)};dg.exports.array=Ik;function Ik(e,t){var n=e.length,r=new Array(n),i={},s=n,o=iP(t),a=sP(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 x=h[--d];l(x,a.get(x),u)}while(d);u.delete(c)}r[--n]=c}}}function rP(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 iP(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 sP(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var oP=dg.exports;const aP=Ir(oP),lP=Object.prototype.toString,cP=Error.prototype.toString,uP=RegExp.prototype.toString,dP=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",fP=/^Symbol\((.*)\)(.*)$/;function pP(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Dy(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return pP(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return dP.call(e).replace(fP,"Symbol($1)");const r=lP.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+cP.call(e)+"]":r==="RegExp"?uP.call(e):null}function hi(e,t){let n=Dy(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=Dy(this[r],t);return s!==null?s:i},2)}function Lk(e){return e==null?[]:[].concat(e)}let Fk,Bk,$k,hP=/\$\{\s*(\w+)\s*\}/g;Fk=Symbol.toStringTag;class Iy{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[Fk]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Lk(t).forEach(s=>{if(Kt.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]}}Bk=Symbol.hasInstance;$k=Symbol.toStringTag;class Kt 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(hP,(i,s)=>hi(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 Iy(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[$k]="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,Kt)}static[Bk](t){return Iy[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let er={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 \`${hi(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${hi(n,!0)}\``+i:`${e} must match the configured type. The validated value was: \`${hi(n,!0)}\``+i}},Wt={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"},mP={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"},Kp={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},gP={isValue:"${path} field must be ${value}"},yc={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},vP={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"},yP={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: \`${hi(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: \`${hi(n,!0)}\``}return Kt.formatError(er.notType,e)}};Object.assign(Object.create(null),{mixed:er,string:Wt,number:mP,date:Kp,object:yc,array:vP,boolean:gP,tuple:yP});const fg=e=>e&&e.__isYupSchema__;class su{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 su(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(!fg(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}const Gl={context:"$",value:"."};class hs{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]===Gl.context,this.isValue=this.key[0]===Gl.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Gl.context:this.isValue?Gl.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Ji.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}}hs.prototype.__isYupRef=!0;const Bi=e=>e==null;function Cs(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:x,context:b,abortEarly:S=o.spec.abortEarly,disableStackTrace:m=o.spec.disableStackTrace}=i;function g(D){return hs.isRef(D)?D.getValue(n,x,b):D}function y(D={}){const P=Object.assign({value:n,originalValue:s,label:o.spec.label,path:D.path||r,spec:o.spec,disableStackTrace:D.disableStackTrace||m},u,D.params);for(const N of Object.keys(P))P[N]=g(P[N]);const z=new Kt(Kt.formatError(D.message||p,P),n,P.path,D.type||c,P.disableStackTrace);return z.params=P,z}const k=S?a:l;let C={path:r,parent:x,type:c,from:i.from,createError:y,resolve:g,options:i,originalValue:s,schema:o};const _=D=>{Kt.isError(D)?k(D):D?l(null):k(y())},E=D=>{Kt.isError(D)?k(D):a(D)};if(h&&Bi(n))return _(!0);let $;try{var I;if($=d.call(C,n,C),typeof((I=$)==null?void 0:I.then)=="function"){if(i.sync)throw new Error(`Validation test of type: "${C.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve($).then(_,E)}}catch(D){E(D);return}_($)}return t.OPTIONS=e,t}function xP(e,t,n,r=n){let i,s,o;return t?(Ji.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 ou extends Set{describe(){const t=[];for(const n of this.values())t.push(hs.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 ou(this.values())}merge(t,n){const r=this.clone();return t.forEach(i=>r.add(i)),n.forEach(i=>r.delete(i)),r}}function Vs(e,t=new Map){if(fg(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]=Vs(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,Vs(i,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Vs(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,i]of Object.entries(e))n[r]=Vs(i,t)}else throw Error(`Unable to clone ${e}`);return n}class hr{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 ou,this._blacklist=new ou,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(er.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=Vs(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&&Bi(s))return s;let o=hi(t),a=hi(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=b=>{i||(i=!0,n(b,o))},u=b=>{i||(i=!0,r(b,o))},p=s.length,h=[];if(!p)return u([]);let x={value:o,originalValue:a,path:l,options:c,schema:this};for(let b=0;b<s.length;b++){const S=s[b];S(x,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)=>{Kt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Kt(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 Kt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Kt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Kt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Kt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Vs(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=Cs({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=Cs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=er.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=er.notNull){return this.nullability(!1,t)}required(t=er.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=er.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Cs(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=Lk(t).map(s=>new hs(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new su(i,n):su.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Cs({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=er.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=Cs({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=er.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=Cs({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)}}}hr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])hr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=yP(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])hr.prototype[e]=hr.prototype.oneOf;for(const e of["not","nope"])hr.prototype[e]=hr.prototype.notOneOf;const xP=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function wP(e){const t=Xp(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 Xp(e){var t,n;const r=xP.exec(e);return r?{year:xr(r[1]),month:xr(r[2],1)-1,day:xr(r[3],1),hour:xr(r[4]),minute:xr(r[5]),second:xr(r[6]),millisecond:r[7]?xr(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:xr(r[10]),minuteOffset:xr(r[11])}:null}function xr(e,t=0){return Number(e)||t}let bP=/^[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])?)*$/,SP=/^((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,kP=/^(?:[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,CP="^\\d{4}-\\d{2}-\\d{2}",_P="\\d{2}:\\d{2}:\\d{2}",TP="(([+-]\\d{2}(:?\\d{2})?)|Z)",EP=new RegExp(`${CP}T${_P}(\\.\\d+)?${TP}$`),AP=e=>Bi(e)||e===e.trim(),jP={}.toString();function au(){return new zk}class zk extends hr{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===jP?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||er.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=Wt.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=Wt.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=Wt.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||Wt.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=Wt.email){return this.matches(bP,{name:"email",message:t,excludeEmptyString:!0})}url(t=Wt.url){return this.matches(SP,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Wt.uuid){return this.matches(kP,{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(EP,{name:"datetime",message:n||Wt.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Wt.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=Xp(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||Wt.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=Xp(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Wt.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:AP})}lowercase(t=Wt.lowercase){return this.transform(n=>Bi(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Bi(n)||n===n.toLowerCase()})}uppercase(t=Wt.uppercase){return this.transform(n=>Bi(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Bi(n)||n===n.toUpperCase()})}}au.prototype=zk.prototype;let RP=new Date(""),MP=e=>Object.prototype.toString.call(e)==="[object Date]";class Vu extends hr{constructor(){super({type:"date",check(t){return MP(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=wP(t),isNaN(t)?Vu.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(hs.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=Kp.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=Kp.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)}})}}Vu.INVALID_DATE=RP;Vu.prototype;function PP(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Ji.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),hs.isRef(a)&&a.isSibling?s(a.path,o):fg(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return oP.array(Array.from(r),n).reverse()}function Ly(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 Vk(e){return(t,n)=>Ly(e,t)-Ly(e,n)}const NP=(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 xc(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=xc(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=xc(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(xc)}):"optional"in e?e.optional():e}const OP=(e,t)=>{const n=[...Ji.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Ji.getter(Ji.join(n),!0)(e);return!!(i&&r in i)};let Fy=e=>Object.prototype.toString.call(e)==="[object Object]";function By(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const DP=Vk([]);function pg(e){return new Uk(e)}class Uk extends hr{constructor(t){super({type:"object",check(n){return Fy(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=DP,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 x,b=i[u];c.path=(n.path?`${n.path}.`:"")+u,p=p.resolve({value:b,context:n.context,parent:l});let S=p instanceof hr?p.spec:void 0,m=S==null?void 0:S.strict;if(S!=null&&S.strip){d=d||u in i;continue}x=!n.__validating||!m?p.cast(i[u],c):i[u],x!==void 0&&(l[u]=x)}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||!Fy(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let p=this.fields[u];!p||hs.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=PP(t,n),r._sortErrors=Vk(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 xc(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=Ji.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return OP(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(NP)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||yc.exact,test(n){if(n==null)return!0;const r=By(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=yc.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=By(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=yc.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(tf.camelCase)}snakeCase(){return this.transformKeys(tf.snakeCase)}constantCase(){return this.transformKeys(t=>tf.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}}pg.prototype=Uk.prototype;var IP=function(t){return LP(t)&&!FP(t)};function LP(e){return!!e&&typeof e=="object"}function FP(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||zP(e)}var BP=typeof Symbol=="function"&&Symbol.for,$P=BP?Symbol.for("react.element"):60103;function zP(e){return e.$$typeof===$P}function VP(e){return Array.isArray(e)?[]:{}}function lu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Za(VP(e),e,t):e}function UP(e,t,n){return e.concat(t).map(function(r){return lu(r,n)})}function HP(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=lu(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=lu(t[i],n):r[i]=Za(e[i],t[i],n)}),r}function Za(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||UP,n.isMergeableObject=n.isMergeableObject||IP;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):HP(e,t,n):lu(t,n)}Za.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Za(r,i,n)},{})};var Zp=Za,Hk=typeof global=="object"&&global&&global.Object===Object&&global,WP=typeof self=="object"&&self&&self.Object===Object&&self,gr=Hk||WP||Function("return this")(),wi=gr.Symbol,Wk=Object.prototype,qP=Wk.hasOwnProperty,GP=Wk.toString,Qo=wi?wi.toStringTag:void 0;function YP(e){var t=qP.call(e,Qo),n=e[Qo];try{e[Qo]=void 0;var r=!0}catch{}var i=GP.call(e);return r&&(t?e[Qo]=n:delete e[Qo]),i}var QP=Object.prototype,KP=QP.toString;function XP(e){return KP.call(e)}var ZP="[object Null]",JP="[object Undefined]",$y=wi?wi.toStringTag:void 0;function ms(e){return e==null?e===void 0?JP:ZP:$y&&$y in Object(e)?YP(e):XP(e)}function qk(e,t){return function(n){return e(t(n))}}var hg=qk(Object.getPrototypeOf,Object);function gs(e){return e!=null&&typeof e=="object"}var eN="[object Object]",tN=Function.prototype,nN=Object.prototype,Gk=tN.toString,rN=nN.hasOwnProperty,iN=Gk.call(Object);function zy(e){if(!gs(e)||ms(e)!=eN)return!1;var t=hg(e);if(t===null)return!0;var n=rN.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Gk.call(n)==iN}function sN(){this.__data__=[],this.size=0}function Yk(e,t){return e===t||e!==e&&t!==t}function Uu(e,t){for(var n=e.length;n--;)if(Yk(e[n][0],t))return n;return-1}var oN=Array.prototype,aN=oN.splice;function lN(e){var t=this.__data__,n=Uu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():aN.call(t,n,1),--this.size,!0}function cN(e){var t=this.__data__,n=Uu(t,e);return n<0?void 0:t[n][1]}function uN(e){return Uu(this.__data__,e)>-1}function dN(e,t){var n=this.__data__,r=Uu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Fr(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])}}Fr.prototype.clear=sN;Fr.prototype.delete=lN;Fr.prototype.get=cN;Fr.prototype.has=uN;Fr.prototype.set=dN;function fN(){this.__data__=new Fr,this.size=0}function pN(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function hN(e){return this.__data__.get(e)}function mN(e){return this.__data__.has(e)}function gl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var gN="[object AsyncFunction]",vN="[object Function]",yN="[object GeneratorFunction]",xN="[object Proxy]";function Qk(e){if(!gl(e))return!1;var t=ms(e);return t==vN||t==yN||t==gN||t==xN}var nf=gr["__core-js_shared__"],Vy=function(){var e=/[^.]+$/.exec(nf&&nf.keys&&nf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function wN(e){return!!Vy&&Vy in e}var bN=Function.prototype,SN=bN.toString;function vs(e){if(e!=null){try{return SN.call(e)}catch{}try{return e+""}catch{}}return""}var kN=/[\\^$.*+?()[\]{}|]/g,CN=/^\[object .+?Constructor\]$/,_N=Function.prototype,TN=Object.prototype,EN=_N.toString,AN=TN.hasOwnProperty,jN=RegExp("^"+EN.call(AN).replace(kN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function RN(e){if(!gl(e)||wN(e))return!1;var t=Qk(e)?jN:CN;return t.test(vs(e))}function MN(e,t){return e==null?void 0:e[t]}function ys(e,t){var n=MN(e,t);return RN(n)?n:void 0}var Ja=ys(gr,"Map"),el=ys(Object,"create");function PN(){this.__data__=el?el(null):{},this.size=0}function NN(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ON="__lodash_hash_undefined__",DN=Object.prototype,IN=DN.hasOwnProperty;function LN(e){var t=this.__data__;if(el){var n=t[e];return n===ON?void 0:n}return IN.call(t,e)?t[e]:void 0}var FN=Object.prototype,BN=FN.hasOwnProperty;function $N(e){var t=this.__data__;return el?t[e]!==void 0:BN.call(t,e)}var zN="__lodash_hash_undefined__";function VN(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=el&&t===void 0?zN:t,this}function ls(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])}}ls.prototype.clear=PN;ls.prototype.delete=NN;ls.prototype.get=LN;ls.prototype.has=$N;ls.prototype.set=VN;function UN(){this.size=0,this.__data__={hash:new ls,map:new(Ja||Fr),string:new ls}}function HN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Hu(e,t){var n=e.__data__;return HN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function WN(e){var t=Hu(this,e).delete(e);return this.size-=t?1:0,t}function qN(e){return Hu(this,e).get(e)}function GN(e){return Hu(this,e).has(e)}function YN(e,t){var n=Hu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function _i(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])}}_i.prototype.clear=UN;_i.prototype.delete=WN;_i.prototype.get=qN;_i.prototype.has=GN;_i.prototype.set=YN;var QN=200;function KN(e,t){var n=this.__data__;if(n instanceof Fr){var r=n.__data__;if(!Ja||r.length<QN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _i(r)}return n.set(e,t),this.size=n.size,this}function Do(e){var t=this.__data__=new Fr(e);this.size=t.size}Do.prototype.clear=fN;Do.prototype.delete=pN;Do.prototype.get=hN;Do.prototype.has=mN;Do.prototype.set=KN;function XN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Uy=function(){try{var e=ys(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Kk(e,t,n){t=="__proto__"&&Uy?Uy(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var ZN=Object.prototype,JN=ZN.hasOwnProperty;function Xk(e,t,n){var r=e[t];(!(JN.call(e,t)&&Yk(r,n))||n===void 0&&!(t in e))&&Kk(e,t,n)}function Wu(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?Kk(n,a,l):Xk(n,a,l)}return n}function eO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var tO="[object Arguments]";function Hy(e){return gs(e)&&ms(e)==tO}var Zk=Object.prototype,nO=Zk.hasOwnProperty,rO=Zk.propertyIsEnumerable,iO=Hy(function(){return arguments}())?Hy:function(e){return gs(e)&&nO.call(e,"callee")&&!rO.call(e,"callee")},vl=Array.isArray;function sO(){return!1}var Jk=typeof cn=="object"&&cn&&!cn.nodeType&&cn,Wy=Jk&&typeof un=="object"&&un&&!un.nodeType&&un,oO=Wy&&Wy.exports===Jk,qy=oO?gr.Buffer:void 0,aO=qy?qy.isBuffer:void 0,eC=aO||sO,lO=9007199254740991,cO=/^(?:0|[1-9]\d*)$/;function uO(e,t){var n=typeof e;return t=t??lO,!!t&&(n=="number"||n!="symbol"&&cO.test(e))&&e>-1&&e%1==0&&e<t}var dO=9007199254740991;function tC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=dO}var fO="[object Arguments]",pO="[object Array]",hO="[object Boolean]",mO="[object Date]",gO="[object Error]",vO="[object Function]",yO="[object Map]",xO="[object Number]",wO="[object Object]",bO="[object RegExp]",SO="[object Set]",kO="[object String]",CO="[object WeakMap]",_O="[object ArrayBuffer]",TO="[object DataView]",EO="[object Float32Array]",AO="[object Float64Array]",jO="[object Int8Array]",RO="[object Int16Array]",MO="[object Int32Array]",PO="[object Uint8Array]",NO="[object Uint8ClampedArray]",OO="[object Uint16Array]",DO="[object Uint32Array]",We={};We[EO]=We[AO]=We[jO]=We[RO]=We[MO]=We[PO]=We[NO]=We[OO]=We[DO]=!0;We[fO]=We[pO]=We[_O]=We[hO]=We[TO]=We[mO]=We[gO]=We[vO]=We[yO]=We[xO]=We[wO]=We[bO]=We[SO]=We[kO]=We[CO]=!1;function IO(e){return gs(e)&&tC(e.length)&&!!We[ms(e)]}function mg(e){return function(t){return e(t)}}var nC=typeof cn=="object"&&cn&&!cn.nodeType&&cn,Sa=nC&&typeof un=="object"&&un&&!un.nodeType&&un,LO=Sa&&Sa.exports===nC,rf=LO&&Hk.process,ko=function(){try{var e=Sa&&Sa.require&&Sa.require("util").types;return e||rf&&rf.binding&&rf.binding("util")}catch{}}(),Gy=ko&&ko.isTypedArray,FO=Gy?mg(Gy):IO,BO=Object.prototype,$O=BO.hasOwnProperty;function rC(e,t){var n=vl(e),r=!n&&iO(e),i=!n&&!r&&eC(e),s=!n&&!r&&!i&&FO(e),o=n||r||i||s,a=o?eO(e.length,String):[],l=a.length;for(var c in e)(t||$O.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||uO(c,l)))&&a.push(c);return a}var zO=Object.prototype;function gg(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zO;return e===n}var VO=qk(Object.keys,Object),UO=Object.prototype,HO=UO.hasOwnProperty;function WO(e){if(!gg(e))return VO(e);var t=[];for(var n in Object(e))HO.call(e,n)&&n!="constructor"&&t.push(n);return t}function iC(e){return e!=null&&tC(e.length)&&!Qk(e)}function vg(e){return iC(e)?rC(e):WO(e)}function qO(e,t){return e&&Wu(t,vg(t),e)}function GO(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var YO=Object.prototype,QO=YO.hasOwnProperty;function KO(e){if(!gl(e))return GO(e);var t=gg(e),n=[];for(var r in e)r=="constructor"&&(t||!QO.call(e,r))||n.push(r);return n}function yg(e){return iC(e)?rC(e,!0):KO(e)}function XO(e,t){return e&&Wu(t,yg(t),e)}var sC=typeof cn=="object"&&cn&&!cn.nodeType&&cn,Yy=sC&&typeof un=="object"&&un&&!un.nodeType&&un,ZO=Yy&&Yy.exports===sC,Qy=ZO?gr.Buffer:void 0,Ky=Qy?Qy.allocUnsafe:void 0;function JO(e,t){if(t)return e.slice();var n=e.length,r=Ky?Ky(n):new e.constructor(n);return e.copy(r),r}function oC(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function eD(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 aC(){return[]}var tD=Object.prototype,nD=tD.propertyIsEnumerable,Xy=Object.getOwnPropertySymbols,xg=Xy?function(e){return e==null?[]:(e=Object(e),eD(Xy(e),function(t){return nD.call(e,t)}))}:aC;function rD(e,t){return Wu(e,xg(e),t)}function lC(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var iD=Object.getOwnPropertySymbols,cC=iD?function(e){for(var t=[];e;)lC(t,xg(e)),e=hg(e);return t}:aC;function sD(e,t){return Wu(e,cC(e),t)}function uC(e,t,n){var r=t(e);return vl(e)?r:lC(r,n(e))}function oD(e){return uC(e,vg,xg)}function aD(e){return uC(e,yg,cC)}var Jp=ys(gr,"DataView"),eh=ys(gr,"Promise"),th=ys(gr,"Set"),nh=ys(gr,"WeakMap"),Zy="[object Map]",lD="[object Object]",Jy="[object Promise]",ex="[object Set]",tx="[object WeakMap]",nx="[object DataView]",cD=vs(Jp),uD=vs(Ja),dD=vs(eh),fD=vs(th),pD=vs(nh),kr=ms;(Jp&&kr(new Jp(new ArrayBuffer(1)))!=nx||Ja&&kr(new Ja)!=Zy||eh&&kr(eh.resolve())!=Jy||th&&kr(new th)!=ex||nh&&kr(new nh)!=tx)&&(kr=function(e){var t=ms(e),n=t==lD?e.constructor:void 0,r=n?vs(n):"";if(r)switch(r){case cD:return nx;case uD:return Zy;case dD:return Jy;case fD:return ex;case pD:return tx}return t});var hD=Object.prototype,mD=hD.hasOwnProperty;function gD(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&mD.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var rx=gr.Uint8Array;function wg(e){var t=new e.constructor(e.byteLength);return new rx(t).set(new rx(e)),t}function vD(e,t){var n=t?wg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var yD=/\w*$/;function xD(e){var t=new e.constructor(e.source,yD.exec(e));return t.lastIndex=e.lastIndex,t}var ix=wi?wi.prototype:void 0,sx=ix?ix.valueOf:void 0;function wD(e){return sx?Object(sx.call(e)):{}}function bD(e,t){var n=t?wg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var SD="[object Boolean]",kD="[object Date]",CD="[object Map]",_D="[object Number]",TD="[object RegExp]",ED="[object Set]",AD="[object String]",jD="[object Symbol]",RD="[object ArrayBuffer]",MD="[object DataView]",PD="[object Float32Array]",ND="[object Float64Array]",OD="[object Int8Array]",DD="[object Int16Array]",ID="[object Int32Array]",LD="[object Uint8Array]",FD="[object Uint8ClampedArray]",BD="[object Uint16Array]",$D="[object Uint32Array]";function zD(e,t,n){var r=e.constructor;switch(t){case RD:return wg(e);case SD:case kD:return new r(+e);case MD:return vD(e,n);case PD:case ND:case OD:case DD:case ID:case LD:case FD:case BD:case $D:return bD(e,n);case CD:return new r;case _D:case AD:return new r(e);case TD:return xD(e);case ED:return new r;case jD:return wD(e)}}var ox=Object.create,VD=function(){function e(){}return function(t){if(!gl(t))return{};if(ox)return ox(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function UD(e){return typeof e.constructor=="function"&&!gg(e)?VD(hg(e)):{}}var HD="[object Map]";function WD(e){return gs(e)&&kr(e)==HD}var ax=ko&&ko.isMap,qD=ax?mg(ax):WD,GD="[object Set]";function YD(e){return gs(e)&&kr(e)==GD}var lx=ko&&ko.isSet,QD=lx?mg(lx):YD,KD=1,XD=2,ZD=4,dC="[object Arguments]",JD="[object Array]",eI="[object Boolean]",tI="[object Date]",nI="[object Error]",fC="[object Function]",rI="[object GeneratorFunction]",iI="[object Map]",sI="[object Number]",pC="[object Object]",oI="[object RegExp]",aI="[object Set]",lI="[object String]",cI="[object Symbol]",uI="[object WeakMap]",dI="[object ArrayBuffer]",fI="[object DataView]",pI="[object Float32Array]",hI="[object Float64Array]",mI="[object Int8Array]",gI="[object Int16Array]",vI="[object Int32Array]",yI="[object Uint8Array]",xI="[object Uint8ClampedArray]",wI="[object Uint16Array]",bI="[object Uint32Array]",ze={};ze[dC]=ze[JD]=ze[dI]=ze[fI]=ze[eI]=ze[tI]=ze[pI]=ze[hI]=ze[mI]=ze[gI]=ze[vI]=ze[iI]=ze[sI]=ze[pC]=ze[oI]=ze[aI]=ze[lI]=ze[cI]=ze[yI]=ze[xI]=ze[wI]=ze[bI]=!0;ze[nI]=ze[fC]=ze[uI]=!1;function ka(e,t,n,r,i,s){var o,a=t&KD,l=t&XD,c=t&ZD;if(o!==void 0)return o;if(!gl(e))return e;var d=vl(e);if(d){if(o=gD(e),!a)return oC(e,o)}else{var u=kr(e),p=u==fC||u==rI;if(eC(e))return JO(e,a);if(u==pC||u==dC||p&&!i){if(o=l||p?{}:UD(e),!a)return l?sD(e,XO(o,e)):rD(e,qO(o,e))}else{if(!ze[u])return i?e:{};o=zD(e,u,a)}}s||(s=new Do);var h=s.get(e);if(h)return h;s.set(e,o),QD(e)?e.forEach(function(S){o.add(ka(S,t,n,S,e,s))}):qD(e)&&e.forEach(function(S,m){o.set(m,ka(S,t,n,m,e,s))});var x=c?l?aD:oD:l?yg:vg,b=d?void 0:x(e);return XN(b||e,function(S,m){b&&(m=S,S=e[m]),Xk(o,m,ka(S,t,n,m,e,s))}),o}var SI=1,kI=4;function Yl(e){return ka(e,SI|kI)}var cx=Array.isArray,ux=Object.keys,CI=Object.prototype.hasOwnProperty,_I=typeof Element<"u";function rh(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=cx(e),r=cx(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!rh(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=ux(e);if(s=u.length,s!==ux(t).length)return!1;for(i=s;i--!==0;)if(!CI.call(t,u[i]))return!1;if(_I&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!rh(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var TI=function(t,n){try{return rh(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 Pi=Ir(TI);var EI=4;function dx(e){return ka(e,EI)}function hC(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 AI="[object Symbol]";function bg(e){return typeof e=="symbol"||gs(e)&&ms(e)==AI}var jI="Expected a function";function Sg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(jI);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(Sg.Cache||_i),n}Sg.Cache=_i;var RI=500;function MI(e){var t=Sg(e,function(r){return n.size===RI&&n.clear(),r}),n=t.cache;return t}var PI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,NI=/\\(\\)?/g,OI=MI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(PI,function(n,r,i,s){t.push(i?s.replace(NI,"$1"):r||n)}),t}),DI=1/0;function II(e){if(typeof e=="string"||bg(e))return e;var t=e+"";return t=="0"&&1/e==-DI?"-0":t}var LI=1/0,fx=wi?wi.prototype:void 0,px=fx?fx.toString:void 0;function mC(e){if(typeof e=="string")return e;if(vl(e))return hC(e,mC)+"";if(bg(e))return px?px.call(e):"";var t=e+"";return t=="0"&&1/e==-LI?"-0":t}function FI(e){return e==null?"":mC(e)}function gC(e){return vl(e)?hC(e,II):bg(e)?[e]:oC(OI(FI(e)))}var vC={exports:{}},Le={};/** @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=b=>{i||(i=!0,n(b,o))},u=b=>{i||(i=!0,r(b,o))},p=s.length,h=[];if(!p)return u([]);let x={value:o,originalValue:a,path:l,options:c,schema:this};for(let b=0;b<s.length;b++){const S=s[b];S(x,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)=>{Kt.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new Kt(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 Kt.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new Kt(a,t,void 0,void 0,o);s=l}),s}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Kt.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Kt.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Vs(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=Cs({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=Cs({message:n,name:"optionality",test(i){return i===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=er.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=er.notNull){return this.nullability(!1,t)}required(t=er.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=er.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Cs(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=Lk(t).map(s=>new hs(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(typeof n=="function"?new su(i,n):su.fromOptions(i,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Cs({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=er.oneOf){let r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r.internalTests.whiteList=Cs({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=er.notOneOf){let r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r.internalTests.blacklist=Cs({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)}}}hr.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])hr.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=xP(this,t,n,r.context);return o[e](i&&i[s],Object.assign({},r,{parent:i,path:t}))};for(const e of["equals","is"])hr.prototype[e]=hr.prototype.oneOf;for(const e of["not","nope"])hr.prototype[e]=hr.prototype.notOneOf;const wP=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function bP(e){const t=Xp(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 Xp(e){var t,n;const r=wP.exec(e);return r?{year:xr(r[1]),month:xr(r[2],1)-1,day:xr(r[3],1),hour:xr(r[4]),minute:xr(r[5]),second:xr(r[6]),millisecond:r[7]?xr(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:xr(r[10]),minuteOffset:xr(r[11])}:null}function xr(e,t=0){return Number(e)||t}let SP=/^[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])?)*$/,kP=/^((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,CP=/^(?:[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,_P="^\\d{4}-\\d{2}-\\d{2}",TP="\\d{2}:\\d{2}:\\d{2}",EP="(([+-]\\d{2}(:?\\d{2})?)|Z)",AP=new RegExp(`${_P}T${TP}(\\.\\d+)?${EP}$`),jP=e=>Bi(e)||e===e.trim(),RP={}.toString();function au(){return new zk}class zk extends hr{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===RP?t:i})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||er.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=Wt.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=Wt.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=Wt.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||Wt.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=Wt.email){return this.matches(SP,{name:"email",message:t,excludeEmptyString:!0})}url(t=Wt.url){return this.matches(kP,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Wt.uuid){return this.matches(CP,{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(AP,{name:"datetime",message:n||Wt.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||Wt.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:s=>{if(!s||r)return!0;const o=Xp(s);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||Wt.datetime_precision,params:{precision:i},skipAbsent:!0,test:s=>{if(!s||i==null)return!0;const o=Xp(s);return o?o.precision===i:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Wt.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:jP})}lowercase(t=Wt.lowercase){return this.transform(n=>Bi(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Bi(n)||n===n.toLowerCase()})}uppercase(t=Wt.uppercase){return this.transform(n=>Bi(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Bi(n)||n===n.toUpperCase()})}}au.prototype=zk.prototype;let MP=new Date(""),PP=e=>Object.prototype.toString.call(e)==="[object Date]";class Vu extends hr{constructor(){super({type:"date",check(t){return PP(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=bP(t),isNaN(t)?Vu.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(hs.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=Kp.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=Kp.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)}})}}Vu.INVALID_DATE=MP;Vu.prototype;function NP(e,t=[]){let n=[],r=new Set,i=new Set(t.map(([o,a])=>`${o}-${a}`));function s(o,a){let l=Ji.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),hs.isRef(a)&&a.isSibling?s(a.path,o):fg(a)&&"deps"in a&&a.deps.forEach(l=>s(l,o))}return aP.array(Array.from(r),n).reverse()}function Ly(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 Vk(e){return(t,n)=>Ly(e,t)-Ly(e,n)}const OP=(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 xc(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=xc(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=xc(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(xc)}):"optional"in e?e.optional():e}const DP=(e,t)=>{const n=[...Ji.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),i=Ji.getter(Ji.join(n),!0)(e);return!!(i&&r in i)};let Fy=e=>Object.prototype.toString.call(e)==="[object Object]";function By(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const IP=Vk([]);function pg(e){return new Uk(e)}class Uk extends hr{constructor(t){super({type:"object",check(n){return Fy(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=IP,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 x,b=i[u];c.path=(n.path?`${n.path}.`:"")+u,p=p.resolve({value:b,context:n.context,parent:l});let S=p instanceof hr?p.spec:void 0,m=S==null?void 0:S.strict;if(S!=null&&S.strip){d=d||u in i;continue}x=!n.__validating||!m?p.cast(i[u],c):i[u],x!==void 0&&(l[u]=x)}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||!Fy(c)){i(l,c);return}o=o||c;let d=[];for(let u of this._nodes){let p=this.fields[u];!p||hs.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=NP(t,n),r._sortErrors=Vk(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 xc(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=Ji.getter(t,!0);return this.transform(s=>{if(!s)return s;let o=s;return DP(s,t)&&(o=Object.assign({},s),r||delete o[t],o[n]=i(s)),o})}json(){return this.transform(OP)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||yc.exact,test(n){if(n==null)return!0;const r=By(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=yc.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=By(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=yc.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(tf.camelCase)}snakeCase(){return this.transformKeys(tf.snakeCase)}constantCase(){return this.transformKeys(t=>tf.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}}pg.prototype=Uk.prototype;var LP=function(t){return FP(t)&&!BP(t)};function FP(e){return!!e&&typeof e=="object"}function BP(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||VP(e)}var $P=typeof Symbol=="function"&&Symbol.for,zP=$P?Symbol.for("react.element"):60103;function VP(e){return e.$$typeof===zP}function UP(e){return Array.isArray(e)?[]:{}}function lu(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Za(UP(e),e,t):e}function HP(e,t,n){return e.concat(t).map(function(r){return lu(r,n)})}function WP(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(i){r[i]=lu(e[i],n)}),Object.keys(t).forEach(function(i){!n.isMergeableObject(t[i])||!e[i]?r[i]=lu(t[i],n):r[i]=Za(e[i],t[i],n)}),r}function Za(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||HP,n.isMergeableObject=n.isMergeableObject||LP;var r=Array.isArray(t),i=Array.isArray(e),s=r===i;return s?r?n.arrayMerge(e,t,n):WP(e,t,n):lu(t,n)}Za.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Za(r,i,n)},{})};var Zp=Za,Hk=typeof global=="object"&&global&&global.Object===Object&&global,qP=typeof self=="object"&&self&&self.Object===Object&&self,gr=Hk||qP||Function("return this")(),wi=gr.Symbol,Wk=Object.prototype,GP=Wk.hasOwnProperty,YP=Wk.toString,Qo=wi?wi.toStringTag:void 0;function QP(e){var t=GP.call(e,Qo),n=e[Qo];try{e[Qo]=void 0;var r=!0}catch{}var i=YP.call(e);return r&&(t?e[Qo]=n:delete e[Qo]),i}var KP=Object.prototype,XP=KP.toString;function ZP(e){return XP.call(e)}var JP="[object Null]",eN="[object Undefined]",$y=wi?wi.toStringTag:void 0;function ms(e){return e==null?e===void 0?eN:JP:$y&&$y in Object(e)?QP(e):ZP(e)}function qk(e,t){return function(n){return e(t(n))}}var hg=qk(Object.getPrototypeOf,Object);function gs(e){return e!=null&&typeof e=="object"}var tN="[object Object]",nN=Function.prototype,rN=Object.prototype,Gk=nN.toString,iN=rN.hasOwnProperty,sN=Gk.call(Object);function zy(e){if(!gs(e)||ms(e)!=tN)return!1;var t=hg(e);if(t===null)return!0;var n=iN.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Gk.call(n)==sN}function oN(){this.__data__=[],this.size=0}function Yk(e,t){return e===t||e!==e&&t!==t}function Uu(e,t){for(var n=e.length;n--;)if(Yk(e[n][0],t))return n;return-1}var aN=Array.prototype,lN=aN.splice;function cN(e){var t=this.__data__,n=Uu(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():lN.call(t,n,1),--this.size,!0}function uN(e){var t=this.__data__,n=Uu(t,e);return n<0?void 0:t[n][1]}function dN(e){return Uu(this.__data__,e)>-1}function fN(e,t){var n=this.__data__,r=Uu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Fr(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])}}Fr.prototype.clear=oN;Fr.prototype.delete=cN;Fr.prototype.get=uN;Fr.prototype.has=dN;Fr.prototype.set=fN;function pN(){this.__data__=new Fr,this.size=0}function hN(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function mN(e){return this.__data__.get(e)}function gN(e){return this.__data__.has(e)}function gl(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var vN="[object AsyncFunction]",yN="[object Function]",xN="[object GeneratorFunction]",wN="[object Proxy]";function Qk(e){if(!gl(e))return!1;var t=ms(e);return t==yN||t==xN||t==vN||t==wN}var nf=gr["__core-js_shared__"],Vy=function(){var e=/[^.]+$/.exec(nf&&nf.keys&&nf.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bN(e){return!!Vy&&Vy in e}var SN=Function.prototype,kN=SN.toString;function vs(e){if(e!=null){try{return kN.call(e)}catch{}try{return e+""}catch{}}return""}var CN=/[\\^$.*+?()[\]{}|]/g,_N=/^\[object .+?Constructor\]$/,TN=Function.prototype,EN=Object.prototype,AN=TN.toString,jN=EN.hasOwnProperty,RN=RegExp("^"+AN.call(jN).replace(CN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function MN(e){if(!gl(e)||bN(e))return!1;var t=Qk(e)?RN:_N;return t.test(vs(e))}function PN(e,t){return e==null?void 0:e[t]}function ys(e,t){var n=PN(e,t);return MN(n)?n:void 0}var Ja=ys(gr,"Map"),el=ys(Object,"create");function NN(){this.__data__=el?el(null):{},this.size=0}function ON(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var DN="__lodash_hash_undefined__",IN=Object.prototype,LN=IN.hasOwnProperty;function FN(e){var t=this.__data__;if(el){var n=t[e];return n===DN?void 0:n}return LN.call(t,e)?t[e]:void 0}var BN=Object.prototype,$N=BN.hasOwnProperty;function zN(e){var t=this.__data__;return el?t[e]!==void 0:$N.call(t,e)}var VN="__lodash_hash_undefined__";function UN(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=el&&t===void 0?VN:t,this}function ls(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])}}ls.prototype.clear=NN;ls.prototype.delete=ON;ls.prototype.get=FN;ls.prototype.has=zN;ls.prototype.set=UN;function HN(){this.size=0,this.__data__={hash:new ls,map:new(Ja||Fr),string:new ls}}function WN(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Hu(e,t){var n=e.__data__;return WN(t)?n[typeof t=="string"?"string":"hash"]:n.map}function qN(e){var t=Hu(this,e).delete(e);return this.size-=t?1:0,t}function GN(e){return Hu(this,e).get(e)}function YN(e){return Hu(this,e).has(e)}function QN(e,t){var n=Hu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function _i(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])}}_i.prototype.clear=HN;_i.prototype.delete=qN;_i.prototype.get=GN;_i.prototype.has=YN;_i.prototype.set=QN;var KN=200;function XN(e,t){var n=this.__data__;if(n instanceof Fr){var r=n.__data__;if(!Ja||r.length<KN-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _i(r)}return n.set(e,t),this.size=n.size,this}function Do(e){var t=this.__data__=new Fr(e);this.size=t.size}Do.prototype.clear=pN;Do.prototype.delete=hN;Do.prototype.get=mN;Do.prototype.has=gN;Do.prototype.set=XN;function ZN(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Uy=function(){try{var e=ys(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Kk(e,t,n){t=="__proto__"&&Uy?Uy(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var JN=Object.prototype,eO=JN.hasOwnProperty;function Xk(e,t,n){var r=e[t];(!(eO.call(e,t)&&Yk(r,n))||n===void 0&&!(t in e))&&Kk(e,t,n)}function Wu(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?Kk(n,a,l):Xk(n,a,l)}return n}function tO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var nO="[object Arguments]";function Hy(e){return gs(e)&&ms(e)==nO}var Zk=Object.prototype,rO=Zk.hasOwnProperty,iO=Zk.propertyIsEnumerable,sO=Hy(function(){return arguments}())?Hy:function(e){return gs(e)&&rO.call(e,"callee")&&!iO.call(e,"callee")},vl=Array.isArray;function oO(){return!1}var Jk=typeof cn=="object"&&cn&&!cn.nodeType&&cn,Wy=Jk&&typeof un=="object"&&un&&!un.nodeType&&un,aO=Wy&&Wy.exports===Jk,qy=aO?gr.Buffer:void 0,lO=qy?qy.isBuffer:void 0,eC=lO||oO,cO=9007199254740991,uO=/^(?:0|[1-9]\d*)$/;function dO(e,t){var n=typeof e;return t=t??cO,!!t&&(n=="number"||n!="symbol"&&uO.test(e))&&e>-1&&e%1==0&&e<t}var fO=9007199254740991;function tC(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=fO}var pO="[object Arguments]",hO="[object Array]",mO="[object Boolean]",gO="[object Date]",vO="[object Error]",yO="[object Function]",xO="[object Map]",wO="[object Number]",bO="[object Object]",SO="[object RegExp]",kO="[object Set]",CO="[object String]",_O="[object WeakMap]",TO="[object ArrayBuffer]",EO="[object DataView]",AO="[object Float32Array]",jO="[object Float64Array]",RO="[object Int8Array]",MO="[object Int16Array]",PO="[object Int32Array]",NO="[object Uint8Array]",OO="[object Uint8ClampedArray]",DO="[object Uint16Array]",IO="[object Uint32Array]",We={};We[AO]=We[jO]=We[RO]=We[MO]=We[PO]=We[NO]=We[OO]=We[DO]=We[IO]=!0;We[pO]=We[hO]=We[TO]=We[mO]=We[EO]=We[gO]=We[vO]=We[yO]=We[xO]=We[wO]=We[bO]=We[SO]=We[kO]=We[CO]=We[_O]=!1;function LO(e){return gs(e)&&tC(e.length)&&!!We[ms(e)]}function mg(e){return function(t){return e(t)}}var nC=typeof cn=="object"&&cn&&!cn.nodeType&&cn,Sa=nC&&typeof un=="object"&&un&&!un.nodeType&&un,FO=Sa&&Sa.exports===nC,rf=FO&&Hk.process,ko=function(){try{var e=Sa&&Sa.require&&Sa.require("util").types;return e||rf&&rf.binding&&rf.binding("util")}catch{}}(),Gy=ko&&ko.isTypedArray,BO=Gy?mg(Gy):LO,$O=Object.prototype,zO=$O.hasOwnProperty;function rC(e,t){var n=vl(e),r=!n&&sO(e),i=!n&&!r&&eC(e),s=!n&&!r&&!i&&BO(e),o=n||r||i||s,a=o?tO(e.length,String):[],l=a.length;for(var c in e)(t||zO.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||dO(c,l)))&&a.push(c);return a}var VO=Object.prototype;function gg(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||VO;return e===n}var UO=qk(Object.keys,Object),HO=Object.prototype,WO=HO.hasOwnProperty;function qO(e){if(!gg(e))return UO(e);var t=[];for(var n in Object(e))WO.call(e,n)&&n!="constructor"&&t.push(n);return t}function iC(e){return e!=null&&tC(e.length)&&!Qk(e)}function vg(e){return iC(e)?rC(e):qO(e)}function GO(e,t){return e&&Wu(t,vg(t),e)}function YO(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var QO=Object.prototype,KO=QO.hasOwnProperty;function XO(e){if(!gl(e))return YO(e);var t=gg(e),n=[];for(var r in e)r=="constructor"&&(t||!KO.call(e,r))||n.push(r);return n}function yg(e){return iC(e)?rC(e,!0):XO(e)}function ZO(e,t){return e&&Wu(t,yg(t),e)}var sC=typeof cn=="object"&&cn&&!cn.nodeType&&cn,Yy=sC&&typeof un=="object"&&un&&!un.nodeType&&un,JO=Yy&&Yy.exports===sC,Qy=JO?gr.Buffer:void 0,Ky=Qy?Qy.allocUnsafe:void 0;function eD(e,t){if(t)return e.slice();var n=e.length,r=Ky?Ky(n):new e.constructor(n);return e.copy(r),r}function oC(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function tD(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 aC(){return[]}var nD=Object.prototype,rD=nD.propertyIsEnumerable,Xy=Object.getOwnPropertySymbols,xg=Xy?function(e){return e==null?[]:(e=Object(e),tD(Xy(e),function(t){return rD.call(e,t)}))}:aC;function iD(e,t){return Wu(e,xg(e),t)}function lC(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var sD=Object.getOwnPropertySymbols,cC=sD?function(e){for(var t=[];e;)lC(t,xg(e)),e=hg(e);return t}:aC;function oD(e,t){return Wu(e,cC(e),t)}function uC(e,t,n){var r=t(e);return vl(e)?r:lC(r,n(e))}function aD(e){return uC(e,vg,xg)}function lD(e){return uC(e,yg,cC)}var Jp=ys(gr,"DataView"),eh=ys(gr,"Promise"),th=ys(gr,"Set"),nh=ys(gr,"WeakMap"),Zy="[object Map]",cD="[object Object]",Jy="[object Promise]",ex="[object Set]",tx="[object WeakMap]",nx="[object DataView]",uD=vs(Jp),dD=vs(Ja),fD=vs(eh),pD=vs(th),hD=vs(nh),kr=ms;(Jp&&kr(new Jp(new ArrayBuffer(1)))!=nx||Ja&&kr(new Ja)!=Zy||eh&&kr(eh.resolve())!=Jy||th&&kr(new th)!=ex||nh&&kr(new nh)!=tx)&&(kr=function(e){var t=ms(e),n=t==cD?e.constructor:void 0,r=n?vs(n):"";if(r)switch(r){case uD:return nx;case dD:return Zy;case fD:return Jy;case pD:return ex;case hD:return tx}return t});var mD=Object.prototype,gD=mD.hasOwnProperty;function vD(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&gD.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var rx=gr.Uint8Array;function wg(e){var t=new e.constructor(e.byteLength);return new rx(t).set(new rx(e)),t}function yD(e,t){var n=t?wg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var xD=/\w*$/;function wD(e){var t=new e.constructor(e.source,xD.exec(e));return t.lastIndex=e.lastIndex,t}var ix=wi?wi.prototype:void 0,sx=ix?ix.valueOf:void 0;function bD(e){return sx?Object(sx.call(e)):{}}function SD(e,t){var n=t?wg(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var kD="[object Boolean]",CD="[object Date]",_D="[object Map]",TD="[object Number]",ED="[object RegExp]",AD="[object Set]",jD="[object String]",RD="[object Symbol]",MD="[object ArrayBuffer]",PD="[object DataView]",ND="[object Float32Array]",OD="[object Float64Array]",DD="[object Int8Array]",ID="[object Int16Array]",LD="[object Int32Array]",FD="[object Uint8Array]",BD="[object Uint8ClampedArray]",$D="[object Uint16Array]",zD="[object Uint32Array]";function VD(e,t,n){var r=e.constructor;switch(t){case MD:return wg(e);case kD:case CD:return new r(+e);case PD:return yD(e,n);case ND:case OD:case DD:case ID:case LD:case FD:case BD:case $D:case zD:return SD(e,n);case _D:return new r;case TD:case jD:return new r(e);case ED:return wD(e);case AD:return new r;case RD:return bD(e)}}var ox=Object.create,UD=function(){function e(){}return function(t){if(!gl(t))return{};if(ox)return ox(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function HD(e){return typeof e.constructor=="function"&&!gg(e)?UD(hg(e)):{}}var WD="[object Map]";function qD(e){return gs(e)&&kr(e)==WD}var ax=ko&&ko.isMap,GD=ax?mg(ax):qD,YD="[object Set]";function QD(e){return gs(e)&&kr(e)==YD}var lx=ko&&ko.isSet,KD=lx?mg(lx):QD,XD=1,ZD=2,JD=4,dC="[object Arguments]",eI="[object Array]",tI="[object Boolean]",nI="[object Date]",rI="[object Error]",fC="[object Function]",iI="[object GeneratorFunction]",sI="[object Map]",oI="[object Number]",pC="[object Object]",aI="[object RegExp]",lI="[object Set]",cI="[object String]",uI="[object Symbol]",dI="[object WeakMap]",fI="[object ArrayBuffer]",pI="[object DataView]",hI="[object Float32Array]",mI="[object Float64Array]",gI="[object Int8Array]",vI="[object Int16Array]",yI="[object Int32Array]",xI="[object Uint8Array]",wI="[object Uint8ClampedArray]",bI="[object Uint16Array]",SI="[object Uint32Array]",ze={};ze[dC]=ze[eI]=ze[fI]=ze[pI]=ze[tI]=ze[nI]=ze[hI]=ze[mI]=ze[gI]=ze[vI]=ze[yI]=ze[sI]=ze[oI]=ze[pC]=ze[aI]=ze[lI]=ze[cI]=ze[uI]=ze[xI]=ze[wI]=ze[bI]=ze[SI]=!0;ze[rI]=ze[fC]=ze[dI]=!1;function ka(e,t,n,r,i,s){var o,a=t&XD,l=t&ZD,c=t&JD;if(o!==void 0)return o;if(!gl(e))return e;var d=vl(e);if(d){if(o=vD(e),!a)return oC(e,o)}else{var u=kr(e),p=u==fC||u==iI;if(eC(e))return eD(e,a);if(u==pC||u==dC||p&&!i){if(o=l||p?{}:HD(e),!a)return l?oD(e,ZO(o,e)):iD(e,GO(o,e))}else{if(!ze[u])return i?e:{};o=VD(e,u,a)}}s||(s=new Do);var h=s.get(e);if(h)return h;s.set(e,o),KD(e)?e.forEach(function(S){o.add(ka(S,t,n,S,e,s))}):GD(e)&&e.forEach(function(S,m){o.set(m,ka(S,t,n,m,e,s))});var x=c?l?lD:aD:l?yg:vg,b=d?void 0:x(e);return ZN(b||e,function(S,m){b&&(m=S,S=e[m]),Xk(o,m,ka(S,t,n,m,e,s))}),o}var kI=1,CI=4;function Yl(e){return ka(e,kI|CI)}var cx=Array.isArray,ux=Object.keys,_I=Object.prototype.hasOwnProperty,TI=typeof Element<"u";function rh(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=cx(e),r=cx(t),i,s,o;if(n&&r){if(s=e.length,s!=t.length)return!1;for(i=s;i--!==0;)if(!rh(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=ux(e);if(s=u.length,s!==ux(t).length)return!1;for(i=s;i--!==0;)if(!_I.call(t,u[i]))return!1;if(TI&&e instanceof Element&&t instanceof Element)return e===t;for(i=s;i--!==0;)if(o=u[i],!(o==="_owner"&&e.$$typeof)&&!rh(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var EI=function(t,n){try{return rh(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 Pi=Ir(EI);var AI=4;function dx(e){return ka(e,AI)}function hC(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 jI="[object Symbol]";function bg(e){return typeof e=="symbol"||gs(e)&&ms(e)==jI}var RI="Expected a function";function Sg(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(RI);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(Sg.Cache||_i),n}Sg.Cache=_i;var MI=500;function PI(e){var t=Sg(e,function(r){return n.size===MI&&n.clear(),r}),n=t.cache;return t}var NI=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,OI=/\\(\\)?/g,DI=PI(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(NI,function(n,r,i,s){t.push(i?s.replace(OI,"$1"):r||n)}),t}),II=1/0;function LI(e){if(typeof e=="string"||bg(e))return e;var t=e+"";return t=="0"&&1/e==-II?"-0":t}var FI=1/0,fx=wi?wi.prototype:void 0,px=fx?fx.toString:void 0;function mC(e){if(typeof e=="string")return e;if(vl(e))return hC(e,mC)+"";if(bg(e))return px?px.call(e):"";var t=e+"";return t=="0"&&1/e==-FI?"-0":t}function BI(e){return e==null?"":mC(e)}function gC(e){return vl(e)?hC(e,LI):bg(e)?[e]:oC(DI(BI(e)))}var vC={exports:{}},Le={};/** @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 wt=typeof Symbol=="function"&&Symbol.for,kg=wt?Symbol.for("react.element"):60103,Cg=wt?Symbol.for("react.portal"):60106,qu=wt?Symbol.for("react.fragment"):60107,Gu=wt?Symbol.for("react.strict_mode"):60108,Yu=wt?Symbol.for("react.profiler"):60114,Qu=wt?Symbol.for("react.provider"):60109,Ku=wt?Symbol.for("react.context"):60110,_g=wt?Symbol.for("react.async_mode"):60111,Xu=wt?Symbol.for("react.concurrent_mode"):60111,Zu=wt?Symbol.for("react.forward_ref"):60112,Ju=wt?Symbol.for("react.suspense"):60113,BI=wt?Symbol.for("react.suspense_list"):60120,ed=wt?Symbol.for("react.memo"):60115,td=wt?Symbol.for("react.lazy"):60116,$I=wt?Symbol.for("react.block"):60121,zI=wt?Symbol.for("react.fundamental"):60117,VI=wt?Symbol.for("react.responder"):60118,UI=wt?Symbol.for("react.scope"):60119;function mn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case kg:switch(e=e.type,e){case _g:case Xu:case qu:case Yu:case Gu:case Ju:return e;default:switch(e=e&&e.$$typeof,e){case Ku:case Zu:case td:case ed:case Qu:return e;default:return t}}case Cg:return t}}}function yC(e){return mn(e)===Xu}Le.AsyncMode=_g;Le.ConcurrentMode=Xu;Le.ContextConsumer=Ku;Le.ContextProvider=Qu;Le.Element=kg;Le.ForwardRef=Zu;Le.Fragment=qu;Le.Lazy=td;Le.Memo=ed;Le.Portal=Cg;Le.Profiler=Yu;Le.StrictMode=Gu;Le.Suspense=Ju;Le.isAsyncMode=function(e){return yC(e)||mn(e)===_g};Le.isConcurrentMode=yC;Le.isContextConsumer=function(e){return mn(e)===Ku};Le.isContextProvider=function(e){return mn(e)===Qu};Le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===kg};Le.isForwardRef=function(e){return mn(e)===Zu};Le.isFragment=function(e){return mn(e)===qu};Le.isLazy=function(e){return mn(e)===td};Le.isMemo=function(e){return mn(e)===ed};Le.isPortal=function(e){return mn(e)===Cg};Le.isProfiler=function(e){return mn(e)===Yu};Le.isStrictMode=function(e){return mn(e)===Gu};Le.isSuspense=function(e){return mn(e)===Ju};Le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===qu||e===Xu||e===Yu||e===Gu||e===Ju||e===BI||typeof e=="object"&&e!==null&&(e.$$typeof===td||e.$$typeof===ed||e.$$typeof===Qu||e.$$typeof===Ku||e.$$typeof===Zu||e.$$typeof===zI||e.$$typeof===VI||e.$$typeof===UI||e.$$typeof===$I)};Le.typeOf=mn;vC.exports=Le;var HI=vC.exports,xC=HI,WI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},qI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},wC={};wC[xC.ForwardRef]=WI;wC[xC.Memo]=qI;function gt(){return gt=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},gt.apply(this,arguments)}function bC(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 nd=v.createContext(void 0);nd.displayName="FormikContext";nd.Provider;nd.Consumer;function GI(){var e=v.useContext(nd);return e}var In=function(t){return typeof t=="function"},rd=function(t){return t!==null&&typeof t=="object"},YI=function(t){return String(Math.floor(Number(t)))===t},sf=function(t){return Object.prototype.toString.call(t)==="[object String]"},of=function(t){return rd(t)&&In(t.then)};function tn(e,t,n,r){r===void 0&&(r=0);for(var i=gC(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function es(e,t,n){for(var r=dx(e),i=r,s=0,o=gC(t);s<o.length-1;s++){var a=o[s],l=tn(e,o.slice(0,s+1));if(l&&(rd(l)||Array.isArray(l)))i=i[a]=dx(l);else{var c=o[s+1];i=i[a]=YI(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 SC(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];rd(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},SC(a,t,n,r[o])):r[o]=t}return r}function QI(e,t){switch(t.type){case"SET_VALUES":return gt({},e,{values:t.payload});case"SET_TOUCHED":return gt({},e,{touched:t.payload});case"SET_ERRORS":return Pi(e.errors,t.payload)?e:gt({},e,{errors:t.payload});case"SET_STATUS":return gt({},e,{status:t.payload});case"SET_ISSUBMITTING":return gt({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return gt({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return gt({},e,{values:es(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return gt({},e,{touched:es(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return gt({},e,{errors:es(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return gt({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return gt({},e,{touched:SC(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return gt({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return gt({},e,{isSubmitting:!1});default:return e}}var Ai={},Ql={};function KI(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=bC(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=gt({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},u),h=v.useRef(p.initialValues),x=v.useRef(p.initialErrors||Ai),b=v.useRef(p.initialTouched||Ql),S=v.useRef(p.initialStatus),m=v.useRef(!1),g=v.useRef({});v.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var y=v.useState(0),C=y[1],k=v.useRef({values:Yl(p.initialValues),errors:Yl(p.initialErrors)||Ai,touched:Yl(p.initialTouched)||Ql,status:Yl(p.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),_=k.current,E=v.useCallback(function(M){var K=k.current;k.current=QI(K,M),K!==k.current&&C(function(F){return F+1})},[]),A=v.useCallback(function(M,K){return new Promise(function(F,W){var ce=p.validate(M,K);ce==null?F(Ai):of(ce)?ce.then(function(me){F(me||Ai)},function(me){W(me)}):F(ce)})},[p.validate]),V=v.useCallback(function(M,K){var F=p.validationSchema,W=In(F)?F(K):F,ce=K&&W.validateAt?W.validateAt(K,M):ZI(M,W);return new Promise(function(me,_e){ce.then(function(){me(Ai)},function(et){et.name==="ValidationError"?me(XI(et)):_e(et)})})},[p.validationSchema]),D=v.useCallback(function(M,K){return new Promise(function(F){return F(g.current[M].validate(K))})},[]),I=v.useCallback(function(M){var K=Object.keys(g.current).filter(function(W){return In(g.current[W].validate)}),F=K.length>0?K.map(function(W){return D(W,tn(M,W))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(F).then(function(W){return W.reduce(function(ce,me,_e){return me==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||me&&(ce=es(ce,K[_e],me)),ce},{})})},[D]),O=v.useCallback(function(M){return Promise.all([I(M),p.validationSchema?V(M):{},p.validate?A(M):{}]).then(function(K){var F=K[0],W=K[1],ce=K[2],me=Zp.all([F,W,ce],{arrayMerge:JI});return me})},[p.validate,p.validationSchema,I,A,V]),$=wn(function(M){return M===void 0&&(M=_.values),E({type:"SET_ISVALIDATING",payload:!0}),O(M).then(function(K){return m.current&&(E({type:"SET_ISVALIDATING",payload:!1}),E({type:"SET_ERRORS",payload:K})),K})});v.useEffect(function(){o&&m.current===!0&&Pi(h.current,p.initialValues)&&$(h.current)},[o,$]);var P=v.useCallback(function(M){var K=M&&M.values?M.values:h.current,F=M&&M.errors?M.errors:x.current?x.current:p.initialErrors||{},W=M&&M.touched?M.touched:b.current?b.current:p.initialTouched||{},ce=M&&M.status?M.status:S.current?S.current:p.initialStatus;h.current=K,x.current=F,b.current=W,S.current=ce;var me=function(){E({type:"RESET_FORM",payload:{isSubmitting:!!M&&!!M.isSubmitting,errors:F,touched:W,status:ce,values:K,isValidating:!!M&&!!M.isValidating,submitCount:M&&M.submitCount&&typeof M.submitCount=="number"?M.submitCount:0}})};if(p.onReset){var _e=p.onReset(_.values,X);of(_e)?_e.then(me):me()}else me()},[p.initialErrors,p.initialStatus,p.initialTouched,p.onReset]);v.useEffect(function(){m.current===!0&&!Pi(h.current,p.initialValues)&&c&&(h.current=p.initialValues,P(),o&&$(h.current))},[c,p.initialValues,P,o,$]),v.useEffect(function(){c&&m.current===!0&&!Pi(x.current,p.initialErrors)&&(x.current=p.initialErrors||Ai,E({type:"SET_ERRORS",payload:p.initialErrors||Ai}))},[c,p.initialErrors]),v.useEffect(function(){c&&m.current===!0&&!Pi(b.current,p.initialTouched)&&(b.current=p.initialTouched||Ql,E({type:"SET_TOUCHED",payload:p.initialTouched||Ql}))},[c,p.initialTouched]),v.useEffect(function(){c&&m.current===!0&&!Pi(S.current,p.initialStatus)&&(S.current=p.initialStatus,E({type:"SET_STATUS",payload:p.initialStatus}))},[c,p.initialStatus,p.initialTouched]);var N=wn(function(M){if(g.current[M]&&In(g.current[M].validate)){var K=tn(_.values,M),F=g.current[M].validate(K);return of(F)?(E({type:"SET_ISVALIDATING",payload:!0}),F.then(function(W){return W}).then(function(W){E({type:"SET_FIELD_ERROR",payload:{field:M,value:W}}),E({type:"SET_ISVALIDATING",payload:!1})})):(E({type:"SET_FIELD_ERROR",payload:{field:M,value:F}}),Promise.resolve(F))}else if(p.validationSchema)return E({type:"SET_ISVALIDATING",payload:!0}),V(_.values,M).then(function(W){return W}).then(function(W){E({type:"SET_FIELD_ERROR",payload:{field:M,value:tn(W,M)}}),E({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),L=v.useCallback(function(M,K){var F=K.validate;g.current[M]={validate:F}},[]),B=v.useCallback(function(M){delete g.current[M]},[]),j=wn(function(M,K){E({type:"SET_TOUCHED",payload:M});var F=K===void 0?i:K;return F?$(_.values):Promise.resolve()}),z=v.useCallback(function(M){E({type:"SET_ERRORS",payload:M})},[]),R=wn(function(M,K){var F=In(M)?M(_.values):M;E({type:"SET_VALUES",payload:F});var W=K===void 0?n:K;return W?$(F):Promise.resolve()}),G=v.useCallback(function(M,K){E({type:"SET_FIELD_ERROR",payload:{field:M,value:K}})},[]),U=wn(function(M,K,F){E({type:"SET_FIELD_VALUE",payload:{field:M,value:K}});var W=F===void 0?n:F;return W?$(es(_.values,M,K)):Promise.resolve()}),J=v.useCallback(function(M,K){var F=K,W=M,ce;if(!sf(M)){M.persist&&M.persist();var me=M.target?M.target:M.currentTarget,_e=me.type,et=me.name,it=me.id,Tt=me.value,Ot=me.checked,yr=me.outerHTML,gn=me.options,Fe=me.multiple;F=K||et||it,W=/number|range/.test(_e)?(ce=parseFloat(Tt),isNaN(ce)?"":ce):/checkbox/.test(_e)?tL(tn(_.values,F),Ot,Tt):gn&&Fe?eL(gn):Tt}F&&U(F,W)},[U,_.values]),ie=wn(function(M){if(sf(M))return function(K){return J(K,M)};J(M)}),ge=wn(function(M,K,F){K===void 0&&(K=!0),E({type:"SET_FIELD_TOUCHED",payload:{field:M,value:K}});var W=F===void 0?i:F;return W?$(_.values):Promise.resolve()}),te=v.useCallback(function(M,K){M.persist&&M.persist();var F=M.target,W=F.name,ce=F.id,me=F.outerHTML,_e=K||W||ce;ge(_e,!0)},[ge]),be=wn(function(M){if(sf(M))return function(K){return te(K,M)};te(M)}),je=v.useCallback(function(M){In(M)?E({type:"SET_FORMIK_STATE",payload:M}):E({type:"SET_FORMIK_STATE",payload:function(){return M}})},[]),oe=v.useCallback(function(M){E({type:"SET_STATUS",payload:M})},[]),ae=v.useCallback(function(M){E({type:"SET_ISSUBMITTING",payload:M})},[]),H=wn(function(){return E({type:"SUBMIT_ATTEMPT"}),$().then(function(M){var K=M instanceof Error,F=!K&&Object.keys(M).length===0;if(F){var W;try{if(W=ke(),W===void 0)return}catch(ce){throw ce}return Promise.resolve(W).then(function(ce){return m.current&&E({type:"SUBMIT_SUCCESS"}),ce}).catch(function(ce){if(m.current)throw E({type:"SUBMIT_FAILURE"}),ce})}else if(m.current&&(E({type:"SUBMIT_FAILURE"}),K))throw M})}),se=wn(function(M){M&&M.preventDefault&&In(M.preventDefault)&&M.preventDefault(),M&&M.stopPropagation&&In(M.stopPropagation)&&M.stopPropagation(),H().catch(function(K){console.warn("Warning: An unhandled error was caught from submitForm()",K)})}),X={resetForm:P,validateForm:$,validateField:N,setErrors:z,setFieldError:G,setFieldTouched:ge,setFieldValue:U,setStatus:oe,setSubmitting:ae,setTouched:j,setValues:R,setFormikState:je,submitForm:H},ke=wn(function(){return d(_.values,X)}),q=wn(function(M){M&&M.preventDefault&&In(M.preventDefault)&&M.preventDefault(),M&&M.stopPropagation&&In(M.stopPropagation)&&M.stopPropagation(),P()}),le=v.useCallback(function(M){return{value:tn(_.values,M),error:tn(_.errors,M),touched:!!tn(_.touched,M),initialValue:tn(h.current,M),initialTouched:!!tn(b.current,M),initialError:tn(x.current,M)}},[_.errors,_.touched,_.values]),ue=v.useCallback(function(M){return{setValue:function(F,W){return U(M,F,W)},setTouched:function(F,W){return ge(M,F,W)},setError:function(F){return G(M,F)}}},[U,ge,G]),Se=v.useCallback(function(M){var K=rd(M),F=K?M.name:M,W=tn(_.values,F),ce={name:F,value:W,onChange:ie,onBlur:be};if(K){var me=M.type,_e=M.value,et=M.as,it=M.multiple;me==="checkbox"?_e===void 0?ce.checked=!!W:(ce.checked=!!(Array.isArray(W)&&~W.indexOf(_e)),ce.value=_e):me==="radio"?(ce.checked=W===_e,ce.value=_e):et==="select"&&it&&(ce.value=ce.value||[],ce.multiple=!0)}return ce},[be,ie,_.values]),Y=v.useMemo(function(){return!Pi(h.current,_.values)},[h.current,_.values]),he=v.useMemo(function(){return typeof a<"u"?Y?_.errors&&Object.keys(_.errors).length===0:a!==!1&&In(a)?a(p):a:_.errors&&Object.keys(_.errors).length===0},[a,Y,_.errors,p]),pe=gt({},_,{initialValues:h.current,initialErrors:x.current,initialTouched:b.current,initialStatus:S.current,handleBlur:be,handleChange:ie,handleReset:q,handleSubmit:se,resetForm:P,setErrors:z,setFormikState:je,setFieldTouched:ge,setFieldValue:U,setFieldError:G,setStatus:oe,setSubmitting:ae,setTouched:j,setValues:R,submitForm:H,validateForm:$,validateField:N,isValid:he,dirty:Y,unregisterField:B,registerField:L,getFieldProps:Se,getFieldMeta:le,getFieldHelpers:ue,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return pe}function XI(e){var t={};if(e.inner){if(e.inner.length===0)return es(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;tn(t,o.path)||(t=es(t,o.path,o.message))}}return t}function ZI(e,t,n,r){n===void 0&&(n=!1);var i=ih(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function ih(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||zy(i)?ih(i):i!==""?i:void 0}):zy(e[r])?t[r]=ih(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function JI(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 eL(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function tL(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 nL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function wn(e){var t=v.useRef(e);return nL(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 rL=v.forwardRef(function(e,t){var n=e.action,r=bC(e,["action"]),i=n??"#",s=GI(),o=s.handleReset,a=s.handleSubmit;return v.createElement("form",gt({onSubmit:a,ref:t,onReset:o,action:i},r))});rL.displayName="Form";const kC=({init:e,schema:t,action:n,validateOnBlur:r=!1})=>KI({initialValues:e,validationSchema:t,validateOnBlur:r,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:i=>{n(i)}});function Tg({id:e,text:t,className:n,required:r}){const i=Ee();return t?f.jsxs("label",{htmlFor:e,className:Ne("mb-1 block text-sm font-medium",n),style:{color:i.getColor(w.InputText)},children:[t,r&&f.jsx("span",{className:"ml-1",style:{color:i.getColor(w.ErrorText)},children:"*"})]}):null}const af={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function iL({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,...x}){const b=Ee(),S=b.getRadius(),m=l?b.getColor(w.ErrorBorder):b.getColor(w.InputBorder),g=b.getColor(w.LinkColor);return f.jsxs("div",{className:Ne({"mb-2":!o},d),style:{"--focus-ring":g},children:[f.jsx(Tg,{id:e,text:t,required:a}),f.jsxs("div",{className:"flex items-center",children:[r&&f.jsx("span",{className:Ne("inline-block border border-solid border-r-0 rounded-l-md",af[i]),style:{borderColor:l?b.getColor(w.ErrorBorder):b.getColor(w.InputBorder),backgroundColor:b.getColor(w.InputBackground),borderRadius:S},children:r}),f.jsx("input",{id:e,autoFocus:h,className:Ne("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",af[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?b.getColor(w.ErrorText):b.getColor(w.InputText),backgroundColor:b.getColor(w.InputBackground),borderColor:m,borderRadius:S,"--tw-ring-color":g},...x}),n&&f.jsx("span",{className:Ne("inline-block border border-solid border-l-0 rounded-r-md",af[i]),style:{borderColor:l?b.getColor(w.ErrorBorder):b.getColor(w.InputBorder),backgroundColor:b.getColor(w.InputBackground),borderRadius:S},children:n})]}),!!l&&f.jsx("p",{className:"mt-1 text-xs",style:{color:b.getColor(w.ErrorText)},children:l})]})}const hx=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},CC=v.createContext({}),sL=()=>`${window.location.pathname}_$$_${document.title}`,oL=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},aL=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function lL({children:e}){const[t,n]=v.useState("/"),[r,i]=v.useState(aL());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(CC.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function id(){return v.useContext(CC)}function cL({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){const c=Ee();return f.jsxs("div",{className:r,children:[e&&f.jsx(Tg,{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(w.InputBackground),color:c.getColor(w.InputText),borderColor:a?c.getColor(w.ErrorBorder):c.getColor(w.InputBorder),borderRadius:c.getRadius(),"--tw-ring-color":c.getColor(w.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(w.ErrorText)},children:a})]})}const mx={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:""}},uL={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"},dL={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 fL({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 x=Ee(),b=x.getColor(w.InputText),S=x.getColor(w.LinkColor),m=x.getColor(w.InputBorder),g=x.getColor(w.InputBackground),y=x.getColor(w.ErrorText);return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center justify-between gap-2 ${u?"flex-row-reverse":""} ${mx[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 ${uL[c]} ${mx[d].input}`,style:{borderColor:i?S:m,backgroundColor:i?S: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(ee.Check,{className:dL[c]})})]}),f.jsx("label",{className:"disable-highlight flex grow cursor-pointer select-none items-center text-sm",style:{color:b},htmlFor:l,children:e})]}),(a||p)&&f.jsx("small",{className:"text-xs",style:{color:y},children:p||a})]})}function pL({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){const a=Ee(),l=a.getColor(w.InputText),c=a.getColor(w.LinkColor);return f.jsxs("label",{htmlFor:e,className:Ne("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(w.InputBorder),backgroundColor:t?c:a.getColor(w.InputBackground),boxShadow:t?`inset 0 0 0 3px ${a.getColor(w.Background)}`:void 0},disabled:s}),f.jsx("span",{className:"text-sm font-medium",style:{color:l},children:i})]})}function hL({id:e,label:t,children:n,required:r,className:i,error:s}){const o=Ee(),a=o.getColor(w.InputText),l=o.getColor(w.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 gx=Object.assign(pL,{Group:hL});function sd({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:x=!1,...b}){const S=Ee();return f.jsxs("div",{className:Ne({"mb-2":!s},i),children:[t&&f.jsx(Tg,{id:e,text:t,required:l}),f.jsx("textarea",{className:Ne("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":!x,"border-none bg-transparent":x}),id:e,rows:o,"aria-invalid":d,...b,ref:u,autoFocus:p,style:{...h,fontSize:"14px",color:c?S.getColor(w.ErrorText):S.getColor(w.InputText),...!x&&{backgroundColor:S.getColor(w.InputBackground),borderColor:c?S.getColor(w.ErrorBorder):S.getColor(w.InputBorder),borderRadius:S.getRadius(),"--tw-ring-color":S.getColor(w.LinkColor)}}}),!!c&&f.jsx("p",{className:"mt-1 text-xs",style:{color:S.getColor(w.ErrorText)},children:c})]})}function Co({variant:e="block",className:t=""}){const n=Ee(),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(w.FooterText)}:{color:n.getColor(w.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 mL({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var _,E,A,V,D,I;const l=Ee(),{defaultValues:c,widget:d,setIsHaveChat:u}=Z(),[p,h]=v.useState(!1),x=v.useRef(null);v.useEffect(()=>{const O=setTimeout(()=>{var P;const $=(P=x.current)==null?void 0:P.querySelector('input:not([type="hidden"]), select, textarea');$==null||$.focus()},150);return()=>clearTimeout(O)},[]);const b=id(),S=ag(),m=!!c&&"username"in c,g=(E=(_=r==null?void 0:r.body)==null?void 0:_.inputs)==null?void 0:E.reduce((O,$)=>{let P=$.remember?Xs($.name):c==null?void 0:c[$.name];return $.options&&P&&!$.options.includes(P)&&(P=void 0),$.name==="username"&&m&&(P=c.username),O[$.name]=P||"",O},{}),y=pg((V=(A=r==null?void 0:r.body)==null?void 0:A.inputs)==null?void 0:V.reduce((O,$)=>(O[$.name]=$.required?au().required(`${$.label} alanı zorunludur`):au(),O),{})),C=kC({init:{...g},schema:y,validateOnBlur:!1,action:async O=>{var $,P;if(!(p||a)){h(!0);try{m&&(O.username=c.username),c!=null&&c.secret_data&&(O.secret_data=c.secret_data);for(const B in O)typeof O[B]=="string"&&(O[B]=O[B].trim());if(o){for(const B of(($=r==null?void 0:r.body)==null?void 0:$.inputs)||[])B.remember&&hx(B.name,O[B.name]);o(O);return}const[N,L]=await S.mutateAsync({inputs:O,history:b.history,client_id:t,widget_id:n,device_id:Dr((d==null?void 0:d.link_id)||""),is_agent_mode:i});if(Gn(L)){Yp(N)&&(Hn(lt.CustomerToken,N.customer_token,(d==null?void 0:d.link_id)||""),Hn(lt.CustomerRefreshToken,N.customer_refresh_token,(d==null?void 0:d.link_id)||""),Hn(lt.DeviceId,N.device_id,(d==null?void 0:d.link_id)||"")),b.clearHistory();for(const B of((P=r==null?void 0:r.body)==null?void 0:P.inputs)||[])B.remember&&hx(B.name,O[B.name]);u(!0),i?s==null||s():e==null||e();return}xo(N,{form:C})}catch(N){console.error("Chat creation error:",N)}finally{h(!1)}}}}),k=l.getColor(w.GreeterBackground);return f.jsxs("section",{className:"h-full overflow-y-auto px-5",style:{backgroundColor:k},children:[f.jsxs("form",{ref:x,autoComplete:"off",className:"grid grid-cols-1 gap-4",onSubmit:C.handleSubmit,children:[(I=(D=r==null?void 0:r.body)==null?void 0:D.inputs)==null?void 0:I.map((O,$)=>{var N,L;const P=$===0;if(["text","email","phone"].includes(O.type))return f.jsx(iL,{id:O.name,name:O.name,type:O.type,label:O.label,value:C.values[O.name],onChange:C.handleChange,onBlur:C.handleBlur,disabled:O.name==="username"&&m,readOnly:O.name==="username"&&m,autoComplete:"off",placeholder:O.placeholder,error:C.errors[O.name],ariaInvalid:C.errors.name?!0:void 0,required:O.required,noMargin:!0,autoFocus:P},O.name);if(O.type==="select")return f.jsx(cL,{id:O.name,name:O.name,value:C.values[O.name],onChange:C.handleChange,label:O.label,error:C.errors[O.name],required:O.required,placeholder:O.placeholder,autoFocus:P,children:(N=O.options)==null?void 0:N.map(B=>f.jsx("option",{value:B,children:B},B))},O.name);if(O.type==="checkbox")return f.jsx(fL,{id:O.name,name:O.name,value:C.values[O.name],checked:C.values[O.name]==="true",onChange:C.handleChange,required:O.required,error:C.errors[O.name],children:O.label},O.name);if(O.type==="radio")return f.jsx(gx.Group,{id:O.name,label:O.label,required:O.required,error:C.errors[O.name],children:(L=O.options)==null?void 0:L.map(B=>f.jsx(gx,{onChange:j=>{j?C.setFieldValue(O.name,B):C.setFieldValue(O.name,"")},id:B,name:O.name,value:B===C.values[O.name],children:B},B))},O.name);if(O.type==="textarea")return f.jsx(sd,{id:O.name,name:O.name,value:C.values[O.name],onChange:C.handleChange,onBlur:C.handleBlur,placeholder:O.placeholder,error:C.errors[O.name],required:O.required,label:O.label,noMargin:!0,autoFocus:P},O.name)}),f.jsx(An,{textKey:w.GreeterButtonText,bgKey:w.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(Co,{variant:"block",className:"py-2"})]})}var an=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(an||{}),rn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e.ChatTransferred="chat_transferred",e))(rn||{}),ve=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(ve||{});const xs=e=>{const t=vA(),n=(r,i)=>{var o;const s=((o=x8.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 gL={exports:{}},lf={exports:{}},vx;function _C(){return vx||(vx=1,function(e,t){(function(n,r){e.exports=r()})(bh,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",x="date",b="Invalid Date",S=/^(\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(P){var N=["th","st","nd","rd"],L=P%100;return"["+P+(N[(L-20)%10]||N[L]||N[0])+"]"}},y=function(P,N,L){var B=String(P);return!B||B.length>=N?P:""+Array(N+1-B.length).join(L)+P},C={s:y,z:function(P){var N=-P.utcOffset(),L=Math.abs(N),B=Math.floor(L/60),j=L%60;return(N<=0?"+":"-")+y(B,2,"0")+":"+y(j,2,"0")},m:function P(N,L){if(N.date()<L.date())return-P(L,N);var B=12*(L.year()-N.year())+(L.month()-N.month()),j=N.clone().add(B,u),z=L-j<0,R=N.clone().add(B+(z?-1:1),u);return+(-(B+(L-j)/(z?j-R:R-j))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:u,y:h,w:d,d:c,D:x,h:l,m:a,s:o,ms:s,Q:p}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},k="en",_={};_[k]=g;var E="$isDayjsObject",A=function(P){return P instanceof O||!(!P||!P[E])},V=function P(N,L,B){var j;if(!N)return k;if(typeof N=="string"){var z=N.toLowerCase();_[z]&&(j=z),L&&(_[z]=L,j=z);var R=N.split("-");if(!j&&R.length>1)return P(R[0])}else{var G=N.name;_[G]=N,j=G}return!B&&j&&(k=j),j||!B&&k},D=function(P,N){if(A(P))return P.clone();var L=typeof N=="object"?N:{};return L.date=P,L.args=arguments,new O(L)},I=C;I.l=V,I.i=A,I.w=function(P,N){return D(P,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var O=function(){function P(L){this.$L=V(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[E]=!0}var N=P.prototype;return N.parse=function(L){this.$d=function(B){var j=B.date,z=B.utc;if(j===null)return new Date(NaN);if(I.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var R=j.match(S);if(R){var G=R[2]-1||0,U=(R[7]||"0").substring(0,3);return z?new Date(Date.UTC(R[1],G,R[3]||1,R[4]||0,R[5]||0,R[6]||0,U)):new Date(R[1],G,R[3]||1,R[4]||0,R[5]||0,R[6]||0,U)}}return new Date(j)}(L),this.init()},N.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},N.$utils=function(){return I},N.isValid=function(){return this.$d.toString()!==b},N.isSame=function(L,B){var j=D(L);return this.startOf(B)<=j&&j<=this.endOf(B)},N.isAfter=function(L,B){return D(L)<this.startOf(B)},N.isBefore=function(L,B){return this.endOf(B)<D(L)},N.$g=function(L,B,j){return I.u(L)?this[B]:this.set(j,L)},N.unix=function(){return Math.floor(this.valueOf()/1e3)},N.valueOf=function(){return this.$d.getTime()},N.startOf=function(L,B){var j=this,z=!!I.u(B)||B,R=I.p(L),G=function(oe,ae){var H=I.w(j.$u?Date.UTC(j.$y,ae,oe):new Date(j.$y,ae,oe),j);return z?H:H.endOf(c)},U=function(oe,ae){return I.w(j.toDate()[oe].apply(j.toDate("s"),(z?[0,0,0,0]:[23,59,59,999]).slice(ae)),j)},J=this.$W,ie=this.$M,ge=this.$D,te="set"+(this.$u?"UTC":"");switch(R){case h:return z?G(1,0):G(31,11);case u:return z?G(1,ie):G(0,ie+1);case d:var be=this.$locale().weekStart||0,je=(J<be?J+7:J)-be;return G(z?ge-je:ge+(6-je),ie);case c:case x:return U(te+"Hours",0);case l:return U(te+"Minutes",1);case a:return U(te+"Seconds",2);case o:return U(te+"Milliseconds",3);default:return this.clone()}},N.endOf=function(L){return this.startOf(L,!1)},N.$set=function(L,B){var j,z=I.p(L),R="set"+(this.$u?"UTC":""),G=(j={},j[c]=R+"Date",j[x]=R+"Date",j[u]=R+"Month",j[h]=R+"FullYear",j[l]=R+"Hours",j[a]=R+"Minutes",j[o]=R+"Seconds",j[s]=R+"Milliseconds",j)[z],U=z===c?this.$D+(B-this.$W):B;if(z===u||z===h){var J=this.clone().set(x,1);J.$d[G](U),J.init(),this.$d=J.set(x,Math.min(this.$D,J.daysInMonth())).$d}else G&&this.$d[G](U);return this.init(),this},N.set=function(L,B){return this.clone().$set(L,B)},N.get=function(L){return this[I.p(L)]()},N.add=function(L,B){var j,z=this;L=Number(L);var R=I.p(B),G=function(ie){var ge=D(z);return I.w(ge.date(ge.date()+Math.round(ie*L)),z)};if(R===u)return this.set(u,this.$M+L);if(R===h)return this.set(h,this.$y+L);if(R===c)return G(1);if(R===d)return G(7);var U=(j={},j[a]=r,j[l]=i,j[o]=n,j)[R]||1,J=this.$d.getTime()+L*U;return I.w(J,this)},N.subtract=function(L,B){return this.add(-1*L,B)},N.format=function(L){var B=this,j=this.$locale();if(!this.isValid())return j.invalidDate||b;var z=L||"YYYY-MM-DDTHH:mm:ssZ",R=I.z(this),G=this.$H,U=this.$m,J=this.$M,ie=j.weekdays,ge=j.months,te=j.meridiem,be=function(ae,H,se,X){return ae&&(ae[H]||ae(B,z))||se[H].slice(0,X)},je=function(ae){return I.s(G%12||12,ae,"0")},oe=te||function(ae,H,se){var X=ae<12?"AM":"PM";return se?X.toLowerCase():X};return z.replace(m,function(ae,H){return H||function(se){switch(se){case"YY":return String(B.$y).slice(-2);case"YYYY":return I.s(B.$y,4,"0");case"M":return J+1;case"MM":return I.s(J+1,2,"0");case"MMM":return be(j.monthsShort,J,ge,3);case"MMMM":return be(ge,J);case"D":return B.$D;case"DD":return I.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return be(j.weekdaysMin,B.$W,ie,2);case"ddd":return be(j.weekdaysShort,B.$W,ie,3);case"dddd":return ie[B.$W];case"H":return String(G);case"HH":return I.s(G,2,"0");case"h":return je(1);case"hh":return je(2);case"a":return oe(G,U,!0);case"A":return oe(G,U,!1);case"m":return String(U);case"mm":return I.s(U,2,"0");case"s":return String(B.$s);case"ss":return I.s(B.$s,2,"0");case"SSS":return I.s(B.$ms,3,"0");case"Z":return R}return null}(ae)||R.replace(":","")})},N.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},N.diff=function(L,B,j){var z,R=this,G=I.p(B),U=D(L),J=(U.utcOffset()-this.utcOffset())*r,ie=this-U,ge=function(){return I.m(R,U)};switch(G){case h:z=ge()/12;break;case u:z=ge();break;case p:z=ge()/3;break;case d:z=(ie-J)/6048e5;break;case c:z=(ie-J)/864e5;break;case l:z=ie/i;break;case a:z=ie/r;break;case o:z=ie/n;break;default:z=ie}return j?z:I.a(z)},N.daysInMonth=function(){return this.endOf(u).$D},N.$locale=function(){return _[this.$L]},N.locale=function(L,B){if(!L)return this.$L;var j=this.clone(),z=V(L,B,!0);return z&&(j.$L=z),j},N.clone=function(){return I.w(this.$d,this)},N.toDate=function(){return new Date(this.valueOf())},N.toJSON=function(){return this.isValid()?this.toISOString():null},N.toISOString=function(){return this.$d.toISOString()},N.toString=function(){return this.$d.toUTCString()},P}(),$=O.prototype;return D.prototype=$,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",h],["$D",x]].forEach(function(P){$[P[1]]=function(N){return this.$g(N,P[0],P[1])}}),D.extend=function(P,N){return P.$i||(P(N,O,D),P.$i=!0),D},D.locale=V,D.isDayjs=A,D.unix=function(P){return D(1e3*P)},D.en=_[k],D.Ls=_,D.p={},D})}(lf)),lf.exports}(function(e,t){(function(n,r){e.exports=r(_C())})(bh,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})})(gL);var TC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(bh,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 x,b,S,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"}],y=g.length,C=0;C<y;C+=1){var k=g[C];k.d&&(x=p?i(c).diff(u,k.d,!0):u.diff(c,k.d,!0));var _=(n.rounding||Math.round)(Math.abs(x));if(S=x>0,_<=k.r||!k.r){_<=1&&C>0&&(k=g[C-1]);var E=m[k.l];h&&(_=h(""+_)),b=typeof E=="string"?E.replace("%d",_):E(_,d,k.l,S);break}}if(d)return b;var A=S?m.future:m.past;return typeof A=="function"?A(b):A.replace("%s",b)},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)}}})})(TC);var vL=TC.exports;const yL=Ir(vL);var xL=_C();const cf=Ir(xL),wL=(e="tr")=>(cf.extend(yL),cf.locale(e),cf);function bL({onHasHistory:e,emptyStateText:t}){const n=Z(y=>y.widget),r=Z(y=>y.setHistoryChat),i=Z(y=>y.setHistoryMessages),s=Ee(),o=xs(),[a,l]=v.useState(null),c=wL(),d=v.useRef(!1),u=n!=null&&n.link_id?Dr(n.link_id):null,{data:p,isLoading:h}=B4((n==null?void 0:n.link_id)||"",u||"");if(v.useEffect(()=>{if(!h&&p){const[y,C]=p,k=Gn(C)&&Array.isArray(y)&&y.length>0;if(k&&!d.current){const _=y[0];if(_.status===an.Open||_.status===an.Pending){console.log("ChatHistoryList: Auto-joining active chat",_._id),d.current=!0,r(_),i(null),o.push("chat");return}}e&&e(k)}},[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[x,b]=p;if(!Gn(b)||!Array.isArray(x))return b===429?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:"Geçmiş şu an yüklenemedi"}),f.jsx("div",{className:"mt-2 text-xs opacity-60",children:"Yeni bir sohbet başlatabilir veya daha sonra tekrar deneyebilirsiniz."})]})}):null;const S=y=>c(y).fromNow(),m=y=>{const C=y.map(_=>typeof _=="string"?_.trim():"").filter(Boolean);if(C.length===0)return"Atanmamış";if(C.length===1)return C[0];if(C.length===2)return`${C[0]} ve ${C[1]}`;if(C.length===3)return`${C[0]}, ${C[1]} ve ${C[2]}`;const k=C.length-2;return`${C[0]}, ${C[1]} ve ${k} kişi daha`},g=y=>{var C;if(y.who_joined_details&&Array.isArray(y.who_joined_details)&&y.who_joined_details.length>0){const k=y.who_joined_details.map(_=>_.name||"");return m(k)}if(y.participant_logs&&Array.isArray(y.participant_logs)&&y.participant_logs.length>0){const k=y.participant_logs.map(_=>_.name||"");return m(k)}return(C=y.archive_summary)!=null&&C.admin_name?y.archive_summary.admin_name:"Atanmamış"};return x.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:x.map(y=>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(w.InputText),backgroundColor:a===y._id?s.getColor(w.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>l(y._id),onMouseLeave:()=>l(null),onClick:()=>{r(y),i(null),o.push("chat")},children:[f.jsx("span",{className:"font-medium text-sm truncate flex-1 min-w-0",children:g(y)}),f.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:s.getColor(w.FooterText)},children:S(y.created_at)})]},y._id))})})}const uf=[Be.Light,Be.Dark,Be.System];function SL(e){switch(e){case Be.Light:return ee.Sun;case Be.Dark:return ee.Moon;case Be.System:return ee.Monitor;default:return ee.Monitor}}function kL(){const e=Ee(),{mode:t,setMode:n}=e,r=()=>{const s=uf.indexOf(t),o=uf[(s+1)%uf.length];n(o)},i=SL(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(w.HeaderText)},title:t===Be.Light?"Açık tema":t===Be.Dark?"Koyu tema":"Sistem",children:f.jsx(i,{className:"size-5"})})}const mr=Object.create(null);mr.open="0";mr.close="1";mr.ping="2";mr.pong="3";mr.message="4";mr.upgrade="5";mr.noop="6";const wc=Object.create(null);Object.keys(mr).forEach(e=>{wc[mr[e]]=e});const sh={type:"error",data:"parser error"},EC=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",AC=typeof ArrayBuffer=="function",jC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Eg=({type:e,data:t},n,r)=>EC&&t instanceof Blob?n?r(t):yx(t,r):AC&&(t instanceof ArrayBuffer||jC(t))?n?r(t):yx(new Blob([t]),r):r(mr[e]+(t||"")),yx=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function xx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let df;function CL(e,t){if(EC&&e.data instanceof Blob)return e.data.arrayBuffer().then(xx).then(t);if(AC&&(e.data instanceof ArrayBuffer||jC(e.data)))return t(xx(e.data));Eg(e,!1,n=>{df||(df=new TextEncoder),t(df.encode(n))})}const wx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<wx.length;e++)sa[wx.charCodeAt(e)]=e;const _L=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=sa[e.charCodeAt(r)],o=sa[e.charCodeAt(r+1)],a=sa[e.charCodeAt(r+2)],l=sa[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},TL=typeof ArrayBuffer=="function",Ag=(e,t)=>{if(typeof e!="string")return{type:"message",data:RC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:EL(e.substring(1),t)}:wc[n]?e.length>1?{type:wc[n],data:e.substring(1)}:{type:wc[n]}:sh},EL=(e,t)=>{if(TL){const n=_L(e);return RC(n,t)}else return{base64:!0,data:e}},RC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},MC="",AL=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Eg(s,!1,a=>{r[o]=a,++i===n&&t(r.join(MC))})})},jL=(e,t)=>{const n=e.split(MC),r=[];for(let i=0;i<n.length;i++){const s=Ag(n[i],t);if(r.push(s),s.type==="error")break}return r};function RL(){return new TransformStream({transform(e,t){CL(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 ff;function Kl(e){return e.reduce((t,n)=>t+n.length,0)}function Xl(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 ML(e,t){ff||(ff=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(Kl(n)<1)break;const l=Xl(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(Kl(n)<2)break;const l=Xl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Kl(n)<8)break;const l=Xl(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(sh);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Kl(n)<i)break;const l=Xl(n,i);a.enqueue(Ag(s?l:ff.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(sh);break}}}})}const PC=4;function dt(e){if(e)return PL(e)}function PL(e){for(var t in dt.prototype)e[t]=dt.prototype[t];return e}dt.prototype.on=dt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};dt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};dt.prototype.off=dt.prototype.removeListener=dt.prototype.removeAllListeners=dt.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};dt.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};dt.prototype.emitReserved=dt.prototype.emit;dt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};dt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const od=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Tn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),NL="arraybuffer";function NC(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const OL=Tn.setTimeout,DL=Tn.clearTimeout;function ad(e,t){t.useNativeTimers?(e.setTimeoutFn=OL.bind(Tn),e.clearTimeoutFn=DL.bind(Tn)):(e.setTimeoutFn=Tn.setTimeout.bind(Tn),e.clearTimeoutFn=Tn.clearTimeout.bind(Tn))}const IL=1.33;function LL(e){return typeof e=="string"?FL(e):Math.ceil((e.byteLength||e.size)*IL)}function FL(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 OC(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function BL(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function $L(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 zL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class jg extends dt{constructor(t){super(),this.writable=!1,ad(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 zL(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=Ag(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=BL(t);return n.length?"?"+n:""}}class VL extends jg{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)};jL(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,AL(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]=OC()),!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 UL=DC;function HL(){}class WL extends VL{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 fr extends dt{constructor(t,n,r){super(),this.createRequest=t,ad(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=NC(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=fr.requestsCount++,fr.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=HL,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete fr.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()}}fr.requestsCount=0;fr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",bx);else if(typeof addEventListener=="function"){const e="onpagehide"in Tn?"pagehide":"unload";addEventListener(e,bx,!1)}}function bx(){for(let e in fr.requests)fr.requests.hasOwnProperty(e)&&fr.requests[e].abort()}const qL=function(){const e=IC({xdomain:!1});return e&&e.responseType!==null}();class GL extends WL{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=qL&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new fr(IC,this.uri(),t)}}function IC(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||UL))return new XMLHttpRequest}catch{}if(!t)try{return new Tn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const LC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class YL extends jg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=LC?{}:NC(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;Eg(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&od(()=>{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]=OC()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const pf=Tn.WebSocket||Tn.MozWebSocket;class QL extends YL{createSocket(t,n,r){return LC?new pf(t,n,r):n?new pf(t,n):new pf(t)}doWrite(t,n){this.ws.send(n)}}class KL extends jg{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=ML(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&&od(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const XL={websocket:QL,webtransport:KL,polling:GL},ZL=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,JL=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function oh(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=ZL.exec(e||""),s={},o=14;for(;o--;)s[JL[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=e6(s,s.path),s.queryKey=t6(s,s.query),s}function e6(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 t6(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const ah=typeof addEventListener=="function"&&typeof removeEventListener=="function",bc=[];ah&&addEventListener("offline",()=>{bc.forEach(e=>e())},!1);class mi extends dt{constructor(t,n){if(super(),this.binaryType=NL,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=oh(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=oh(n.host).host);ad(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=$L(this.opts.query)),ah&&(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"})},bc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=PC,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&&mi.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",mi.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,od(()=>{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(mi.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(),ah&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=bc.indexOf(this._offlineEventListener);r!==-1&&bc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}mi.protocol=PC;class n6 extends mi{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;mi.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;mi.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 r6=class extends n6{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=>XL[i]).filter(i=>!!i)),super(t,r)}};function i6(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=oh(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 s6=typeof ArrayBuffer=="function",o6=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,FC=Object.prototype.toString,a6=typeof Blob=="function"||typeof Blob<"u"&&FC.call(Blob)==="[object BlobConstructor]",l6=typeof File=="function"||typeof File<"u"&&FC.call(File)==="[object FileConstructor]";function Rg(e){return s6&&(e instanceof ArrayBuffer||o6(e))||a6&&e instanceof Blob||l6&&e instanceof File}function Sc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Sc(e[n]))return!0;return!1}if(Rg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Sc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Sc(e[n]))return!0;return!1}function c6(e){const t=[],n=e.data,r=e;return r.data=lh(n,t),r.attachments=t.length,{packet:r,buffers:t}}function lh(e,t){if(!e)return e;if(Rg(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]=lh(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]=lh(e[r],t));return n}return e}function u6(e,t){return e.data=ch(e.data,t),delete e.attachments,e}function ch(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]=ch(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ch(e[n],t));return e}const d6=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],f6=5;var Me;(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"})(Me||(Me={}));class p6{constructor(t){this.replacer=t}encode(t){return(t.type===Me.EVENT||t.type===Me.ACK)&&Sc(t)?this.encodeAsBinary({type:t.type===Me.EVENT?Me.BINARY_EVENT:Me.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Me.BINARY_EVENT||t.type===Me.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=c6(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Sx(e){return Object.prototype.toString.call(e)==="[object Object]"}class Mg extends dt{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===Me.BINARY_EVENT;r||n.type===Me.BINARY_ACK?(n.type=r?Me.EVENT:Me.ACK,this.reconstructor=new h6(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Rg(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(Me[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Me.BINARY_EVENT||r.type===Me.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(Mg.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 Me.CONNECT:return Sx(n);case Me.DISCONNECT:return n===void 0;case Me.CONNECT_ERROR:return typeof n=="string"||Sx(n);case Me.EVENT:case Me.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&d6.indexOf(n[0])===-1);case Me.ACK:case Me.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class h6{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=u6(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const m6=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Mg,Encoder:p6,get PacketType(){return Me},protocol:f6},Symbol.toStringTag,{value:"Module"}));function zn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const g6=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class BC extends dt{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=[zn(t,"open",this.onopen.bind(this)),zn(t,"packet",this.onpacket.bind(this)),zn(t,"error",this.onerror.bind(this)),zn(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(g6.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:Me.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:Me.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 Me.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 Me.EVENT:case Me.BINARY_EVENT:this.onevent(t);break;case Me.ACK:case Me.BINARY_ACK:this.onack(t);break;case Me.DISCONNECT:this.ondisconnect();break;case Me.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:Me.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:Me.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 Io(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}Io.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};Io.prototype.reset=function(){this.attempts=0};Io.prototype.setMin=function(e){this.ms=e};Io.prototype.setMax=function(e){this.max=e};Io.prototype.setJitter=function(e){this.jitter=e};class uh extends dt{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,ad(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 Io({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||m6;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 r6(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=zn(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(zn(t,"ping",this.onping.bind(this)),zn(t,"data",this.ondata.bind(this)),zn(t,"error",this.onerror.bind(this)),zn(t,"close",this.onclose.bind(this)),zn(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){od(()=>{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 BC(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 Ko={};function kc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=i6(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Ko[i]&&s in Ko[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new uh(r,t):(Ko[i]||(Ko[i]=new uh(r,t)),l=Ko[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(kc,{Manager:uh,Socket:BC,io:kc,connect:kc});const $C=v.createContext(null),vr=()=>{const e=v.useContext($C);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},v6=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=Z(),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(k=>{var _;console.log("WS: cleanupSocket called",{reason:k,hasSocket:!!i.current,isConnected:(_=i.current)==null?void 0:_.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",k||""),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((k,_,E)=>{if(a.current===k&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!_&&!E){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const A=ia(lt.CustomerToken,k)||Xs("customer_token"),V=ia(lt.CustomerRefreshToken,k)||Xs("customer_refresh_token");if(!A||!V){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{Z.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:k,tokenPrefix:`${A==null?void 0:A.substring(0,20)}...`,refreshTokenPrefix:`${V==null?void 0:V.substring(0,20)}...`,deviceId:ia(lt.DeviceId,k)}),o.current=!0,a.current=k;const D=kc(rE,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:A,device_id:ia(lt.DeviceId,k)||Xs("device_id"),customer_refresh_token:V}});i.current=D,D.on("error",I=>{console.error("WS: Websocket error",I),o.current=!1}),D.on("connect_error",I=>{console.error("WS: Connect error",I),o.current=!1,c(!1),u(!1),i.current===D&&(i.current=null,a.current=null);const O=(I==null?void 0:I.message)||String(I);if(O.toLowerCase().includes("unauthorized")||O.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),k&&_k(k),localStorage.removeItem("lc:widget:isHaveChat");try{Z.getState().setIsHaveChat(!1)}catch{}}}),D.on("disconnect",I=>{var $;console.log("WS: Disconnected",I),c(!1),u(!1),o.current=!1,s.current=!1,i.current===D&&(i.current=null,a.current=null);const O=Z.getState();I==="io server disconnect"&&(($=O.widget)!=null&&$.link_id)&&(O.isHaveChat||O.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{h(O.widget.link_id,O.isHaveChat,O.isAIAgentMode)},500))}),D.on("connect",()=>{console.log("WS: Connected successfully"),c(!0),o.current=!1}),D.on("connection:ready",()=>{console.log("WS: Connection ready received"),s.current=!0,u(!0)})},[]);v.useEffect(()=>{const k=t==null?void 0:t.link_id;return k&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),h(k,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 k=()=>{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",k),window.addEventListener("pagehide",_),()=>{window.removeEventListener("beforeunload",k),window.removeEventListener("pagehide",_)}},[]);const x=v.useCallback(()=>{const k=t==null?void 0:t.link_id;k?h(k,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,h]),b=v.useCallback(()=>{console.log("WS: Reconnecting..."),p("manual reconnect");const k=t==null?void 0:t.link_id;k&&setTimeout(()=>{h(k,n,r)},100)},[t==null?void 0:t.link_id,n,r,h,p]),S=v.useCallback(()=>{console.log("WS: Manual disconnect"),p("manual disconnect")},[p]),m=v.useCallback((k,_)=>{var E;(E=i.current)==null||E.on(k,_)},[]),g=v.useCallback((k,_)=>{var E;(E=i.current)==null||E.off(k,_)},[]),y=v.useCallback((k,_,E)=>{i.current&&i.current.connected?i.current.emit(k,_,E):console.warn(`WS: Cannot emit event '${k}', socket not connected.`)},[]),C=v.useMemo(()=>({connectionReady:d,connected:l,connect:x,reconnect:b,disconnect:S,on:m,off:g,emit:y}),[l,d,x,b,S,m,g,y]);return f.jsx($C.Provider,{value:C,children:e})},cu=(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])},Lo=()=>{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},y6=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},ld=()=>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 qe=(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))(qe||{}),xe=(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.AgentMessageStreamStatus="agent:message:stream_status",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(xe||{});function x6(){const e=id(),t=v.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return cu("popstate",t),null}function w6(){const e=vr(),t=id(),n=v.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(qe.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return cu("popstate",n),v.useEffect(()=>{if(!e)return;const r=oL(),i=sL();r!==i&&(e.emit(qe.PageChange,{page:i}),t.setPage(i))},[e]),null}function b6(){return x6(),null}const kx=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function S6(){var H,se,X,ke;const e=Ee(),t=Z(q=>q.widget),n=Z(q=>q.setOpen),r=Z(q=>q.setAIAgent),i=Z(q=>q.setIsAIAgentMode),s=Z(q=>q.setIsHaveChat),o=Z(q=>q.isHaveChat),a=Z(q=>q.humanNeedRequested),l=Z(q=>q.setHumanNeedRequested),c=Z(q=>q.aiAgent),d=Z(q=>q.setShowActionButtons),u=Z(q=>q.defaultValues),[p,h]=v.useState(!1),[x,b]=v.useState(!1),[S,m]=v.useState(null),g=xs(),y=Lo(),C=ld(),[k,_]=v.useState(!0),[E,A]=v.useState(!1),V=id(),D=ag(),I=vr(),O=wm(),{data:$}=Nk(t==null?void 0:t.link_id),[P,N]=v.useState(null),L=v.useRef(!1),B=v.useRef(!1),j=v.useRef(!1),z=v.useRef(!1),[R,G]=v.useState(!1),U=ml(),J=v.useCallback(async()=>{var q,le,ue;if(!(!t||z.current)){z.current=!0,G(!0),m(null),Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),Z.getState().clearAIAgentState(),d(!1);try{let Se=null;try{Se=await Pk(t.link_id)}catch(he){console.error("Failed to resolve widget agent for new chat:",he),Se=null}O.setQueryData(Mk(t.link_id),Se);const Y=(((ue=(le=(q=t.appearance)==null?void 0:q.body)==null?void 0:le.inputs)==null?void 0:ue.length)||0)>0;if(Se){if(N(Se),j.current)return;j.current=!0;try{const he={username:(u==null?void 0:u.username)||"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`};u!=null&&u.secret_data&&(he.secret_data=u.secret_data);const[pe,M]=await D.mutateAsync({inputs:he,history:V.history,client_id:t.client_id,widget_id:t.link_id,device_id:Dr(t.link_id),is_agent_mode:!0});Gn(M)&&Yp(pe)?(Hn(lt.CustomerToken,pe.customer_token,t.link_id),Hn(lt.CustomerRefreshToken,pe.customer_refresh_token,t.link_id),Hn(lt.DeviceId,pe.device_id,t.link_id),V.clearHistory(),s(!0),r(Se),i(!0),g.push("chat")):(xo(pe),(pe==null?void 0:pe.statusCode)===403&&m((pe==null?void 0:pe.message)||"Sohbet başlatılamadı."))}catch(he){console.error("Error creating chat for AI agent:",he)}finally{j.current=!1}return}if(!Y){if(j.current)return;j.current=!0;try{const he={};u!=null&&u.secret_data&&(he.secret_data=u.secret_data),u!=null&&u.username&&(he.username=u.username);const[pe,M]=await D.mutateAsync({inputs:he,history:V.history,client_id:t.client_id,widget_id:t.link_id,device_id:Dr(t.link_id)});Gn(M)&&Yp(pe)?(Hn(lt.CustomerToken,pe.customer_token,t.link_id),Hn(lt.CustomerRefreshToken,pe.customer_refresh_token,t.link_id),Hn(lt.DeviceId,pe.device_id,t.link_id),V.clearHistory(),s(!0),g.push("chat")):(xo(pe),(pe==null?void 0:pe.statusCode)===403&&m((pe==null?void 0:pe.message)||"Sohbet başlatılamadı."))}catch(he){console.error("Error creating chat:",he)}finally{j.current=!1}return}N(null),_(!1)}finally{z.current=!1,G(!1)}}},[t,O,D,V,u==null?void 0:u.secret_data,u==null?void 0:u.username,s,r,i,g,d]),ie=v.useCallback(q=>{A(q)},[]);if(!t)return null;const ge=()=>{n(!1)};v.useEffect(()=>{L.current=!1},[t==null?void 0:t.link_id]),v.useEffect(()=>{var le,ue,Se;if(!t)return;const q=Zn(t.link_id);if(q.isAgentMode&&q.agent&&(U!=null&&U.accessToken)&&!L.current){if(L.current=!0,r(q.agent),i(!0),q.sessionId&&Z.getState().setAIAgentSessionId(q.sessionId),q.humanNeedRequested){if(Z.getState().setHumanNeedRequested(!0),!((((Se=(ue=(le=t.appearance)==null?void 0:le.body)==null?void 0:ue.inputs)==null?void 0:Se.length)||0)>0)){g.push("chat");return}return}N(q.agent),g.push("chat")}},[t,U==null?void 0:U.accessToken,U==null?void 0:U.refreshToken,g,r,i]),v.useEffect(()=>{if(!t)return;const q=Zn(t.link_id);q.isAgentMode&&q.agent&&(U!=null&&U.accessToken)||$!==void 0&&N($)},[t,$,U==null?void 0:U.accessToken]),v.useEffect(()=>{if(p||!t||!U||!U.accessToken){B.current=!1;return}if(B.current||a)return;if(o){g.push("chat");return}const q=Zn(t.link_id);q.isAgentMode&&q.agent&&!q.humanNeedRequested||(B.current=!0,N4(t.client_id,Zi(Xi(U),t.link_id)).then(([le,ue])=>{if(Gn(ue))a||g.push("chat");else if(ue===403){const Se=Zn(t.link_id);if(Se.isAgentMode&&Se.agent){if(Se.humanNeedRequested){r(Se.agent),i(!1),Se.sessionId&&Z.getState().setAIAgentSessionId(Se.sessionId),Z.getState().setHumanNeedRequested(!0);return}r(Se.agent),i(!0),Se.sessionId&&Z.getState().setAIAgentSessionId(Se.sessionId),g.push("chat")}else ba(t.link_id||""),h(!0)}else ue===404?(ba(t.link_id||""),h(!0)):ue===401?(_k(t.link_id||""),h(!0)):g.push("chat")}).catch(()=>g.push("chat")))},[p,g,r,i,t,U==null?void 0:U.accessToken,U==null?void 0:U.refreshToken,o,a]);const te=kx(((se=(H=t.appearance)==null?void 0:H.head)==null?void 0:se.elements)||[],"text"),be=kx(((ke=(X=t.appearance)==null?void 0:X.head)==null?void 0:ke.elements)||[],"title"),je=()=>{if(a&&t){let q=c;if(!q){const le=Zn(t.link_id);le.agent&&(q=le.agent,r(le.agent),N(le.agent))}if(q){i(!0),Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),g.push("chat");return}}_(!0)},oe=()=>{P&&(r(P),i(!0),Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),g.push("chat"))},ae=v.useCallback(q=>{if(!I||x)return;b(!0);const le=()=>{I.emit(qe.AgentRequestHuman,{},ue=>{b(!1),ue!=null&&ue.success&&(Z.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),Z.getState().clearAIAgentState(),g.push("chat"))})};q&&Object.keys(q).length>0?I.emit(qe.ChatUpdateInputs,{inputs:q},ue=>{ue!=null&&ue.success?le():b(!1)}):le()},[I,x,i,l,g]);return v.useEffect(()=>{var q,le,ue;if(a){if(!c&&t){const Se=Zn(t.link_id);Se.agent&&(r(Se.agent),N(Se.agent))}(c||Zn((t==null?void 0:t.link_id)||"").agent)&&((((ue=(le=(q=t==null?void 0:t.appearance)==null?void 0:q.body)==null?void 0:le.inputs)==null?void 0:ue.length)||0)>0?_(!1):ae())}},[a,c,t,ae,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(w.HeaderBackground),color:e.getColor(w.HeaderText),borderColor:e.getColor(w.HeaderBorder),...y?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!k&&(E||a&&(c||t&&Zn(t.link_id).agent))&&f.jsx("button",{type:"button",onClick:je,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(ee.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:k?"Geçmiş sohbetler":be||"Müşteri Hizmetleri"}),!k&&te&&f.jsx("div",{className:"text-xs opacity-90 truncate",children:te})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[f.jsx(kL,{}),C&&f.jsx("button",{type:"button",onClick:ge,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:f.jsx(ee.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(w.Background)},children:k?f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:f.jsx(bL,{onHasHistory:ie,emptyStateText:S||void 0})}):f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx(mL,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!P&&!a,onAIAgentStart:oe,onOk:()=>{a&&c||(Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),g.push("chat"))},onOperatorConnect:a&&(c||Zn(t.link_id).agent)?ae:void 0,isConnectingToOperator:x})})}),k&&f.jsxs("div",{className:"flex-shrink-0",style:{backgroundColor:e.getColor(w.Background)},children:[f.jsx("div",{className:"px-5 py-2",children:f.jsxs(An,{onClick:J,disabled:R,size:"lg",className:"w-full flex items-center justify-center gap-2",children:[f.jsx(ee.Plus,{className:"size-4"}),f.jsx("span",{children:R?"Hazırlanıyor…":"Yeni Sohbet Başlat"})]})}),f.jsx(Co,{variant:"block"})]})]})}function k6(){return f.jsxs(f.Fragment,{children:[f.jsx(S6,{}),f.jsx(b6,{})]})}const C6=[{path:"/",component:k6,name:"registration"}];function ot({className:e="",style:t}){const n=Ee();return f.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(w.MessageAdminBackground),opacity:.6,...t}})}function _6(){const e=Ee();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(ot,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(ot,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(ot,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(ot,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(ot,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function T6(){const e=Ee();return f.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(w.FooterBackground),borderRadius:e.getRadius()},children:[f.jsx("div",{className:"grow",children:f.jsx(ot,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.InputBackground)}})}),f.jsx(ot,{className:"h-12 w-12 rounded-full"})]})}function E6(){const e=Ee();return f.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(w.HeaderBackground),borderBottom:`1px solid ${e.getColor(w.HeaderBorder)}`},children:[f.jsx(ot,{className:"h-5 w-36"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ot,{className:"h-5 w-5 rounded"}),f.jsx(ot,{className:"h-5 w-5 rounded"})]})]})}function A6(){const e=Ee();return f.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(w.GreeterBackground)},children:f.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[f.jsxs("div",{children:[f.jsx(ot,{className:"h-4 w-20 mb-1"}),f.jsx(ot,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(ot,{className:"h-4 w-24 mb-1"}),f.jsx(ot,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(ot,{className:"h-4 w-16 mb-1"}),f.jsx(ot,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.InputBackground)}})]}),f.jsx(ot,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.GreeterButtonBackground),opacity:.5}})]})})}function j6(){const e=Ee();return f.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(w.GreeterTopBackground)},children:[f.jsx(ot,{className:"h-7 w-40"}),f.jsx(ot,{className:"h-4 w-56"})]})}function zC(){const e=Ee();return f.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(w.Background)},children:[f.jsx(E6,{}),f.jsx(_6,{}),f.jsx(T6,{}),f.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(w.FooterBorder)}`,backgroundColor:e.getColor(w.FooterBackground)},children:[f.jsx(ot,{className:"h-3 w-20"}),f.jsx(ot,{className:"h-3.5 w-3.5 rounded"})]})]})}function dh(){const e=Ee(),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(w.GreeterBackground)},children:[f.jsx(j6,{}),f.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:f.jsx(A6,{})})]})}const R6=/^admin_([a-f0-9]{24})_(.+)$/i;function Gr(e){return e.profile_id?`id:${e.profile_id}`:`name:${e.name.trim().toLowerCase()}`}function Cx(e){const t=e.trim().match(R6);return t?{profile_id:t[1],name:t[2]}:null}function M6(e,t){const n=e?[...e]:[],r=Gr(t),i=n.findIndex(s=>Gr(s)===r);if(i>=0){const s=n[i];return n[i]={...s,...t,name:t.name||s.name,avatar:t.avatar??s.avatar,profile_id:t.profile_id??s.profile_id},n}return[...n,t]}function fh(e,t){return e!=null&&e.length?e.filter(n=>!(t.profile_id&&n.profile_id===t.profile_id||!t.profile_id&&t.name&&n.name===t.name)):[]}function P6(e,t){const n=t.profile_id!=null&&t.profile_id!==""?fh(e,{profile_id:t.profile_id}):fh(e,{name:t.name});return[t,...n]}function oa(e){const t=e[0];return t?{agent_name:t.name,agent_avatar:t.avatar}:{agent_name:void 0,agent_avatar:void 0}}function N6(e){const t=new Map,n=[];for(const r of e)if(r.sender_type===ve.Activity){if(r.activity_type===rn.AdminJoin){let i;const s=typeof r.content=="string"?Cx(r.content):null;if(s)i={profile_id:s.profile_id,name:s.name};else if(r.sender_name)i={name:r.sender_name};else continue;const o=Gr(i);t.has(o)||n.push(o);const a=t.get(o);t.set(o,{...a,...i,name:i.name,avatar:i.avatar??(a==null?void 0:a.avatar),profile_id:i.profile_id??(a==null?void 0:a.profile_id)})}else if(r.activity_type===rn.AdminLeave){const i=typeof r.content=="string"?Cx(r.content):null;if(i){const s=Gr({profile_id:i.profile_id,name:i.name});t.delete(s);const o=n.indexOf(s);o>=0&&n.splice(o,1)}else if(r.sender_name){const s=Gr({name:r.sender_name});t.delete(s);const o=n.indexOf(s);o>=0&&n.splice(o,1)}}else if(r.activity_type===rn.ChatTransferred){if(r.sender_id){const i=Gr({profile_id:r.sender_id,name:""});t.delete(i);const s=n.indexOf(i);s>=0&&n.splice(s,1)}else if(r.sender_name){const i=Gr({name:r.sender_name});t.delete(i);const s=n.indexOf(i);s>=0&&n.splice(s,1)}}}return n.map(r=>t.get(r)).filter(r=>r!=null)}function Pg(e,t){return e!=null&&e.trim()?[{name:e.trim(),avatar:t}]:[]}function _x(e){const t=e.participants&&e.participants.length>0?e.participants:Pg(e.agent_name,e.agent_avatar),n=oa(t);return{...e,participants:t,agent_name:n.agent_name,agent_avatar:n.agent_avatar}}function O6(e){var s,o;const t=e.who_joined_details;if(t!=null&&t.length)return t.map(a=>({profile_id:a.profile_id,name:a.name,avatar:a.avatar}));const n=e.participant_logs;if(n!=null&&n.length)return n.map(a=>({profile_id:a.user_id,name:a.name}));const r=(s=e.archive_summary)==null?void 0:s.admin_name,i=(o=e.archive_summary)==null?void 0:o.agent_avatar;return r?[{name:r,avatar:i}]:[]}const D6="/notify.mp3",Ng="lc:notification_sound_muted",VC=()=>{try{return sessionStorage.getItem(Ng)==="1"}catch{return!1}},UC=e=>{try{sessionStorage.setItem(Ng,e?"1":"0")}catch{}},I6=async e=>{try{if(sessionStorage.getItem(Ng)==="1")return}catch{}await new Audio(e||D6).play()},hf=[Be.Light,Be.Dark,Be.System];function L6(e){switch(e){case Be.Light:return ee.Sun;case Be.Dark:return ee.Moon;case Be.System:return ee.Monitor;default:return ee.Monitor}}function F6({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>VC()),a=v.useRef(null),l=v.useRef(null),c=Ee(),d=Oo(),u=vr(),{setShowActionButtons:p}=Z(),{mode:h,setMode:x}=c,b=()=>{u==null||u.emit(qe.ChatClose,{}),p(!1),e()},S=()=>{const y=hf.indexOf(h),C=hf[(y+1)%hf.length];x(C)},m=()=>{const y=!s;UC(y),o(y)};v.useEffect(()=>{if(!r)return;const y=C=>{var k,_;(k=l.current)!=null&&k.contains(C.target)||(_=a.current)!=null&&_.contains(C.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[r]);const g=r&&f.jsxs(Oe.div,{ref:l,onMouseDown:y=>y.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(w.Background),borderColor:c.getColor(w.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(w.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(w.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(ee.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(w.InputText)},onClick:m,children:[s?f.jsx(ee.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(ee.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(w.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(w.InputText)},onClick:S,children:[(()=>{const y=L6(h);return f.jsx(y,{className:"size-4 flex-shrink-0"})})(),h===Be.Light?"Açık tema":h===Be.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Nr,{children:t&&f.jsx(Oe.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(w.ModalOverlayColor)},children:f.jsxs(Oe.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(w.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(w.ChatCloseConfirmText)},children:d(re.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(w.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(w.GreeterBackground),color:c.getColor(w.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(w.ErrorBackground),color:c.getColor(w.ErrorText),borderRadius:c.getRadius()},onClick:b,children:d(re.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(y=>!y),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(w.HeaderText)},title:d(re.ChatSettings),"aria-expanded":r,children:f.jsx(ee.Menu,{className:"size-5"})}),f.jsx(Nr,{children:g})]})]})}function B6(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 ph({text:e}){const n=Ee().getColor(w.LinkColor),i=(s=>{const o=B6(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,x=>{const b=x.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(b)?b:`https://${b}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${b}</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 Tx="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function HC({files:e,className:t,onDelete:n,hideName:r}){const i=Lo(),{getColor:s}=Ee(),[o,a]=v.useState(new Map),[l,c]=v.useState(null);v.useEffect(()=>{const m=new Map;for(let g=0;g<e.length;g++){const y=e[g];if(y instanceof File){const C=URL.createObjectURL(y);m.set(g,C)}}return a(m),()=>{for(const g of m.values())URL.revokeObjectURL(g)}},[e]);const d=m=>{var y;return((y=(m instanceof File?m.name:m).split(".").pop())==null?void 0:y.toLowerCase())||""},u=m=>m instanceof File?m.name:m.split("/").pop()||m,p=m=>{const[g,y]=m.split(".");return g.length>10?`${g.slice(0,10)}...${y}`:m},h=m=>{const g=["jpg","jpeg","png","gif","bmp","webp","svg"],y=d(m);return g.includes(y)},x=(m,g)=>{if(m instanceof File){const y=o.get(g);y&&window.open(y,"_blank")}else window.open(m,"_blank")},b=(m,g)=>{m.stopPropagation(),n==null||n(g)},S=(m,g)=>m instanceof File?o.get(g)||"":m;return f.jsx("div",{className:Ne("flex gap-2 w-full overflow-x-auto",t),children:e.map((m,g)=>{const y=u(m),C=d(m),k=h(m),_=S(m,g);return f.jsxs("div",{onClick:()=>x(m,g),onMouseEnter:()=>c(g),onMouseLeave:()=>c(null),className:"min-w-20 max-w-20 cursor-pointer group/item border rounded-lg p-1.5 transition-all duration-200 relative",style:{backgroundColor:s(w.Background),borderColor:s(l===g?w.InputBorder:w.Border),boxShadow:l===g?`0 4px 6px -1px ${s(w.ShadowColor)}`:void 0},children:[n&&f.jsx("button",{onClick:E=>b(E,g),className:Ne("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"})})}),k?f.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:f.jsx("img",{src:_,alt:y,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 rounded transition-colors duration-200",style:{backgroundColor:s(l===g?w.CloseButtonHover:w.InputBackground)},children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 rounded flex items-center justify-center",style:{backgroundColor:`color-mix(in srgb, ${s(w.ButtonBackground)} 20%, transparent)`},children:f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",style:{color:s(w.ButtonBackground)},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:Ne("text-[10px] font-medium uppercase",{[Tx]:r}),style:{color:s(w.FooterText)},children:C||"file"})]})}),f.jsx("div",{className:Ne("max-w-16 text-[10px] font-medium truncate text-ellipsis overflow-hidden",{[Tx]:r}),style:{color:s(w.InputText)},title:y,children:p(y)})]},g)})})}const Og="livechat:send:";function Ex(e){const t=(e==null?void 0:e.trim())??"";if(!t)return{text:"",suggestedQuestions:[]};let n=null;try{n=JSON.parse(t)}catch{const l=t.indexOf("{"),c=t.lastIndexOf("}");if(l!==-1&&c>l)try{n=JSON.parse(t.slice(l,c+1))}catch{n=null}}if(!n||typeof n!="object"||Array.isArray(n))return{text:e,suggestedQuestions:[]};const r=n,i=r.generation;let s;typeof i=="string"&&i.trim()?s=i.trim():i!=null&&(typeof i=="number"||typeof i=="boolean")?s=String(i):s=e;const o=r.suggested_questions,a=[];if(Array.isArray(o))for(const l of o){if(typeof l=="string"){const c=l.trim();c&&a.push(c)}if(a.length>=10)break}return{text:s,suggestedQuestions:a}}function $6(e){return`${Og}${encodeURIComponent(e)}`}function aa(e){return e.startsWith(Og)}function z6(e){if(!aa(e))return null;try{return decodeURIComponent(e.slice(Og.length))}catch{return null}}function V6(e){const t=e.id&&String(e.id).trim()||"";if(t)return`id:${t}`;const n=e._id;if(n!=null&&String(n).trim())return`id:${String(n)}`;const r=typeof e.created_at=="string"?e.created_at:e.created_at instanceof Date?e.created_at.toISOString():"",i=(e.content||"").slice(0,40);return`fall:${r}:${i}`}function Ax(e){if(e.sender_type!==ve.Agent)return{content:e.content,buttons:e.buttons};if(e.buttons&&e.buttons.length>0)return{content:e.content,buttons:e.buttons};if(Array.isArray(e.buttons)&&e.buttons.length===0){const{text:r}=Ex(e.content);return{content:r,buttons:void 0}}const{text:t,suggestedQuestions:n}=Ex(e.content);return n.length===0?{content:t,buttons:void 0}:{content:t,buttons:n.map(r=>({label:r,url:$6(r)}))}}const U6={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},H6={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function WC({buttons:e,className:t="",onLivechatSend:n,suggestGroupSpent:r=!1}){const i=Ee();if(!e||e.length===0)return null;const s=e.some(l=>aa(l.url)),o=(l,c)=>{if(aa(l)){if(r)return;const d=z6(l);d&&n&&n(d),c.currentTarget.blur();return}l.startsWith("http://")||l.startsWith("https://")?window.open(l,"_blank","noopener,noreferrer"):l.startsWith("tel:")||l.startsWith("mailto:")?window.location.href=l:console.log("Custom action:",l)},a=l=>aa(l)?null:l.startsWith("http://")||l.startsWith("https://")?f.jsx(ee.ExternalLink,{className:"size-4"}):l.startsWith("tel:")?f.jsx(ee.Phone,{className:"size-4"}):l.startsWith("mailto:")?f.jsx(ee.Mail,{className:"size-4"}):null;return f.jsx(Oe.div,{className:Ne(t,"mt-2",r&&s&&"opacity-50"),initial:"hidden",animate:"visible",variants:U6,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:f.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${i.getColor(w.Background)}f0`},children:f.jsx("div",{className:Ne("flex flex-wrap",s?"gap-1.5":"gap-2"),children:e.map((l,c)=>{const d=aa(l.url),u=d&&r;return f.jsxs(Oe.button,{type:"button",disabled:u,"aria-disabled":u||void 0,variants:H6,transition:{duration:.25,ease:"easeOut"},whileHover:u?void 0:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:u?void 0:{scale:.98,transition:{duration:.1}},onClick:p=>o(l.url,p),className:Ne("group inline-flex items-center font-medium transition-all duration-200 relative overflow-hidden",u?"cursor-not-allowed":"cursor-pointer","outline-none focus:outline-none focus-visible:outline-none","[-webkit-tap-highlight-color:transparent]",d?"gap-1.5 px-2.5 py-1.5 text-xs rounded-md max-w-[100%] text-left":"gap-2 px-4 py-2.5 text-sm"),style:{backgroundColor:i.getColor(w.GreeterBackground),color:i.getColor(w.GreeterText),borderRadius:i.getRadius(),border:`1px solid ${i.getColor(w.DividerColor)}`,boxShadow:`0 1px 3px ${i.getColor(w.ShadowColor)}30`},onMouseEnter:p=>{u||(p.currentTarget.style.backgroundColor=i.getColor(w.ButtonBackground),p.currentTarget.style.color=i.getColor(w.ButtonText),p.currentTarget.style.borderColor=i.getColor(w.ButtonBackground),p.currentTarget.style.boxShadow=`0 4px 12px ${i.getColor(w.ShadowColor)}40`)},onMouseLeave:p=>{p.currentTarget.style.backgroundColor=i.getColor(w.GreeterBackground),p.currentTarget.style.color=i.getColor(w.GreeterText),p.currentTarget.style.borderColor=i.getColor(w.DividerColor),p.currentTarget.style.boxShadow=`0 1px 3px ${i.getColor(w.ShadowColor)}30`},children:[f.jsxs("span",{className:Ne("flex items-center min-w-0",d?"gap-1.5":"gap-2"),children:[a(l.url),f.jsx("span",{className:Ne(d?"font-normal leading-snug":"font-medium"),children:l.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%, ${i.getColor(w.ButtonText)}10 50%, transparent 70%)`,borderRadius:i.getRadius()}})]},`${l.label}-${c}`)})})})})}const hh=700,W6=700;function q6({msgId:e,skipStagger:t,isCustomerSide:n,hasButtons:r,buttons:i,suggestGroupSpent:s,suggestKey:o,onLivechatSendSuggested:a,setSpentSuggestMsgIds:l}){const[c,d]=v.useState(t&&r);return v.useEffect(()=>{if(t){d(r);return}let u;return d(!1),r&&(u=setTimeout(()=>d(!0),hh)),()=>{u!==void 0&&clearTimeout(u)}},[e,t,r]),r?f.jsx("div",{className:Ne("w-full",{"flex justify-end":n,"flex justify-start":!n}),children:f.jsx("div",{className:"max-w-[80%]",children:c&&f.jsx(WC,{buttons:i,suggestGroupSpent:s,onLivechatSend:u=>{l(p=>{const h=new Set(p);return h.add(o),h}),a==null||a(u,!0)}})})}):null}function G6({msgId:e,text:t,delayMs:n,getBubbleRadius:r}){const i=Ee(),[s,o]=v.useState(n<=0);return v.useEffect(()=>{if(n<=0){o(!0);return}o(!1);const a=setTimeout(()=>o(!0),n);return()=>clearTimeout(a)},[e,n]),s?f.jsx("div",{className:"flex w-full min-w-0 justify-start mt-2",children:f.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap !text-sm",style:{backgroundColor:i.getColor(w.MessageAdminBackground),color:i.getColor(w.MessageAdminText),borderRadius:r(ve.Agent)},children:f.jsx(ph,{text:t})})}):null}const jx=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"",Rx=["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 qC({messages:e,isTyping:t,chat:n,streamingContent:r,streamingStatusText:i,onLivechatSendSuggested:s}){var V,D,I,O;const o=v.useRef(null),a=v.useRef(null),[l,c]=v.useState(!0),d=v.useRef(!0),{widget:u,showActionButtons:p}=Z(),h=Ee(),x=v.useRef(!0),b=v.useRef(new Set),[S,m]=v.useState(0),[g,y]=v.useState(()=>new Set),C=v.useRef(null);v.useEffect(()=>{C.current===null&&e.length!==0&&(C.current=new Set(e.map($=>String($.id??"")).filter(Boolean)))},[e]),v.useEffect(()=>{e.length>0&&x.current&&requestAnimationFrame(()=>{x.current=!1})},[e]),v.useEffect(()=>{e.length===0&&(b.current.clear(),y(new Set),C.current=null)},[e.length]),v.useEffect(()=>{if(!t||r===void 0||r||i)return;const $=setInterval(()=>{m(P=>(P+1)%Rx.length)},2500);return()=>clearInterval($)},[t,r,i]);const k=()=>{const $=a.current;$&&($.scrollTop=$.scrollHeight)},_=()=>{if(a.current){const{scrollTop:$,scrollHeight:P,clientHeight:N}=a.current,L=P-$<=N+10;d.current=L,c(L)}};v.useEffect(()=>{(d.current||t)&&k()},[e,t,r,i]);const E=($,P)=>{if(x.current)return{initial:!1,animate:{}};const N=$.id||"";return b.current.has(N)?P===ve.Customer?{initial:!1,animate:{opacity:1,x:0}}:{initial:!1,animate:{}}:(b.current.add(N),P===ve.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:{initial:!1,animate:{}})},A=$=>$===ve.Customer?"18px 18px 4px 18px":$===ve.User||$===ve.Agent?"18px 18px 18px 4px":h.getRadius();return f.jsxs("section",{onScroll:_,ref:a,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden scrollbar",children:[((D=(V=u==null?void 0:u.appearance)==null?void 0:V.design)==null?void 0:D.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:h.getColor(w.MessageAdminBackground),color:h.getColor(w.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(O=(I=u==null?void 0:u.appearance)==null?void 0:I.design)==null?void 0:O.greeting_message})}),f.jsx(Nr,{children:Array.isArray(e)&&(()=>{const $=e.filter(R=>{var G;return R!=null&&(!!R.content||(((G=R.files)==null?void 0:G.length)??0)>0)&&R.content!==`
|
|
97
|
-
`}),
|
|
96
|
+
*/var wt=typeof Symbol=="function"&&Symbol.for,kg=wt?Symbol.for("react.element"):60103,Cg=wt?Symbol.for("react.portal"):60106,qu=wt?Symbol.for("react.fragment"):60107,Gu=wt?Symbol.for("react.strict_mode"):60108,Yu=wt?Symbol.for("react.profiler"):60114,Qu=wt?Symbol.for("react.provider"):60109,Ku=wt?Symbol.for("react.context"):60110,_g=wt?Symbol.for("react.async_mode"):60111,Xu=wt?Symbol.for("react.concurrent_mode"):60111,Zu=wt?Symbol.for("react.forward_ref"):60112,Ju=wt?Symbol.for("react.suspense"):60113,$I=wt?Symbol.for("react.suspense_list"):60120,ed=wt?Symbol.for("react.memo"):60115,td=wt?Symbol.for("react.lazy"):60116,zI=wt?Symbol.for("react.block"):60121,VI=wt?Symbol.for("react.fundamental"):60117,UI=wt?Symbol.for("react.responder"):60118,HI=wt?Symbol.for("react.scope"):60119;function mn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case kg:switch(e=e.type,e){case _g:case Xu:case qu:case Yu:case Gu:case Ju:return e;default:switch(e=e&&e.$$typeof,e){case Ku:case Zu:case td:case ed:case Qu:return e;default:return t}}case Cg:return t}}}function yC(e){return mn(e)===Xu}Le.AsyncMode=_g;Le.ConcurrentMode=Xu;Le.ContextConsumer=Ku;Le.ContextProvider=Qu;Le.Element=kg;Le.ForwardRef=Zu;Le.Fragment=qu;Le.Lazy=td;Le.Memo=ed;Le.Portal=Cg;Le.Profiler=Yu;Le.StrictMode=Gu;Le.Suspense=Ju;Le.isAsyncMode=function(e){return yC(e)||mn(e)===_g};Le.isConcurrentMode=yC;Le.isContextConsumer=function(e){return mn(e)===Ku};Le.isContextProvider=function(e){return mn(e)===Qu};Le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===kg};Le.isForwardRef=function(e){return mn(e)===Zu};Le.isFragment=function(e){return mn(e)===qu};Le.isLazy=function(e){return mn(e)===td};Le.isMemo=function(e){return mn(e)===ed};Le.isPortal=function(e){return mn(e)===Cg};Le.isProfiler=function(e){return mn(e)===Yu};Le.isStrictMode=function(e){return mn(e)===Gu};Le.isSuspense=function(e){return mn(e)===Ju};Le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===qu||e===Xu||e===Yu||e===Gu||e===Ju||e===$I||typeof e=="object"&&e!==null&&(e.$$typeof===td||e.$$typeof===ed||e.$$typeof===Qu||e.$$typeof===Ku||e.$$typeof===Zu||e.$$typeof===VI||e.$$typeof===UI||e.$$typeof===HI||e.$$typeof===zI)};Le.typeOf=mn;vC.exports=Le;var WI=vC.exports,xC=WI,qI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},GI={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},wC={};wC[xC.ForwardRef]=qI;wC[xC.Memo]=GI;function gt(){return gt=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},gt.apply(this,arguments)}function bC(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 nd=v.createContext(void 0);nd.displayName="FormikContext";nd.Provider;nd.Consumer;function YI(){var e=v.useContext(nd);return e}var In=function(t){return typeof t=="function"},rd=function(t){return t!==null&&typeof t=="object"},QI=function(t){return String(Math.floor(Number(t)))===t},sf=function(t){return Object.prototype.toString.call(t)==="[object String]"},of=function(t){return rd(t)&&In(t.then)};function tn(e,t,n,r){r===void 0&&(r=0);for(var i=gC(t);e&&r<i.length;)e=e[i[r++]];return r!==i.length&&!e||e===void 0?n:e}function es(e,t,n){for(var r=dx(e),i=r,s=0,o=gC(t);s<o.length-1;s++){var a=o[s],l=tn(e,o.slice(0,s+1));if(l&&(rd(l)||Array.isArray(l)))i=i[a]=dx(l);else{var c=o[s+1];i=i[a]=QI(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 SC(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];rd(a)?n.get(a)||(n.set(a,!0),r[o]=Array.isArray(a)?[]:{},SC(a,t,n,r[o])):r[o]=t}return r}function KI(e,t){switch(t.type){case"SET_VALUES":return gt({},e,{values:t.payload});case"SET_TOUCHED":return gt({},e,{touched:t.payload});case"SET_ERRORS":return Pi(e.errors,t.payload)?e:gt({},e,{errors:t.payload});case"SET_STATUS":return gt({},e,{status:t.payload});case"SET_ISSUBMITTING":return gt({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return gt({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return gt({},e,{values:es(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return gt({},e,{touched:es(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return gt({},e,{errors:es(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return gt({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return gt({},e,{touched:SC(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return gt({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return gt({},e,{isSubmitting:!1});default:return e}}var Ai={},Ql={};function XI(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=bC(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),p=gt({validateOnChange:n,validateOnBlur:i,validateOnMount:o,onSubmit:d},u),h=v.useRef(p.initialValues),x=v.useRef(p.initialErrors||Ai),b=v.useRef(p.initialTouched||Ql),S=v.useRef(p.initialStatus),m=v.useRef(!1),g=v.useRef({});v.useEffect(function(){return m.current=!0,function(){m.current=!1}},[]);var y=v.useState(0),k=y[1],C=v.useRef({values:Yl(p.initialValues),errors:Yl(p.initialErrors)||Ai,touched:Yl(p.initialTouched)||Ql,status:Yl(p.initialStatus),isSubmitting:!1,isValidating:!1,submitCount:0}),_=C.current,E=v.useCallback(function(M){var K=C.current;C.current=KI(K,M),K!==C.current&&k(function(F){return F+1})},[]),A=v.useCallback(function(M,K){return new Promise(function(F,W){var ce=p.validate(M,K);ce==null?F(Ai):of(ce)?ce.then(function(me){F(me||Ai)},function(me){W(me)}):F(ce)})},[p.validate]),$=v.useCallback(function(M,K){var F=p.validationSchema,W=In(F)?F(K):F,ce=K&&W.validateAt?W.validateAt(K,M):JI(M,W);return new Promise(function(me,_e){ce.then(function(){me(Ai)},function(et){et.name==="ValidationError"?me(ZI(et)):_e(et)})})},[p.validationSchema]),I=v.useCallback(function(M,K){return new Promise(function(F){return F(g.current[M].validate(K))})},[]),D=v.useCallback(function(M){var K=Object.keys(g.current).filter(function(W){return In(g.current[W].validate)}),F=K.length>0?K.map(function(W){return I(W,tn(M,W))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(F).then(function(W){return W.reduce(function(ce,me,_e){return me==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||me&&(ce=es(ce,K[_e],me)),ce},{})})},[I]),P=v.useCallback(function(M){return Promise.all([D(M),p.validationSchema?$(M):{},p.validate?A(M):{}]).then(function(K){var F=K[0],W=K[1],ce=K[2],me=Zp.all([F,W,ce],{arrayMerge:eL});return me})},[p.validate,p.validationSchema,D,A,$]),z=wn(function(M){return M===void 0&&(M=_.values),E({type:"SET_ISVALIDATING",payload:!0}),P(M).then(function(K){return m.current&&(E({type:"SET_ISVALIDATING",payload:!1}),E({type:"SET_ERRORS",payload:K})),K})});v.useEffect(function(){o&&m.current===!0&&Pi(h.current,p.initialValues)&&z(h.current)},[o,z]);var N=v.useCallback(function(M){var K=M&&M.values?M.values:h.current,F=M&&M.errors?M.errors:x.current?x.current:p.initialErrors||{},W=M&&M.touched?M.touched:b.current?b.current:p.initialTouched||{},ce=M&&M.status?M.status:S.current?S.current:p.initialStatus;h.current=K,x.current=F,b.current=W,S.current=ce;var me=function(){E({type:"RESET_FORM",payload:{isSubmitting:!!M&&!!M.isSubmitting,errors:F,touched:W,status:ce,values:K,isValidating:!!M&&!!M.isValidating,submitCount:M&&M.submitCount&&typeof M.submitCount=="number"?M.submitCount:0}})};if(p.onReset){var _e=p.onReset(_.values,X);of(_e)?_e.then(me):me()}else me()},[p.initialErrors,p.initialStatus,p.initialTouched,p.onReset]);v.useEffect(function(){m.current===!0&&!Pi(h.current,p.initialValues)&&c&&(h.current=p.initialValues,N(),o&&z(h.current))},[c,p.initialValues,N,o,z]),v.useEffect(function(){c&&m.current===!0&&!Pi(x.current,p.initialErrors)&&(x.current=p.initialErrors||Ai,E({type:"SET_ERRORS",payload:p.initialErrors||Ai}))},[c,p.initialErrors]),v.useEffect(function(){c&&m.current===!0&&!Pi(b.current,p.initialTouched)&&(b.current=p.initialTouched||Ql,E({type:"SET_TOUCHED",payload:p.initialTouched||Ql}))},[c,p.initialTouched]),v.useEffect(function(){c&&m.current===!0&&!Pi(S.current,p.initialStatus)&&(S.current=p.initialStatus,E({type:"SET_STATUS",payload:p.initialStatus}))},[c,p.initialStatus,p.initialTouched]);var O=wn(function(M){if(g.current[M]&&In(g.current[M].validate)){var K=tn(_.values,M),F=g.current[M].validate(K);return of(F)?(E({type:"SET_ISVALIDATING",payload:!0}),F.then(function(W){return W}).then(function(W){E({type:"SET_FIELD_ERROR",payload:{field:M,value:W}}),E({type:"SET_ISVALIDATING",payload:!1})})):(E({type:"SET_FIELD_ERROR",payload:{field:M,value:F}}),Promise.resolve(F))}else if(p.validationSchema)return E({type:"SET_ISVALIDATING",payload:!0}),$(_.values,M).then(function(W){return W}).then(function(W){E({type:"SET_FIELD_ERROR",payload:{field:M,value:tn(W,M)}}),E({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),L=v.useCallback(function(M,K){var F=K.validate;g.current[M]={validate:F}},[]),B=v.useCallback(function(M){delete g.current[M]},[]),j=wn(function(M,K){E({type:"SET_TOUCHED",payload:M});var F=K===void 0?i:K;return F?z(_.values):Promise.resolve()}),V=v.useCallback(function(M){E({type:"SET_ERRORS",payload:M})},[]),R=wn(function(M,K){var F=In(M)?M(_.values):M;E({type:"SET_VALUES",payload:F});var W=K===void 0?n:K;return W?z(F):Promise.resolve()}),G=v.useCallback(function(M,K){E({type:"SET_FIELD_ERROR",payload:{field:M,value:K}})},[]),U=wn(function(M,K,F){E({type:"SET_FIELD_VALUE",payload:{field:M,value:K}});var W=F===void 0?n:F;return W?z(es(_.values,M,K)):Promise.resolve()}),J=v.useCallback(function(M,K){var F=K,W=M,ce;if(!sf(M)){M.persist&&M.persist();var me=M.target?M.target:M.currentTarget,_e=me.type,et=me.name,it=me.id,Tt=me.value,Ot=me.checked,yr=me.outerHTML,gn=me.options,Fe=me.multiple;F=K||et||it,W=/number|range/.test(_e)?(ce=parseFloat(Tt),isNaN(ce)?"":ce):/checkbox/.test(_e)?nL(tn(_.values,F),Ot,Tt):gn&&Fe?tL(gn):Tt}F&&U(F,W)},[U,_.values]),ie=wn(function(M){if(sf(M))return function(K){return J(K,M)};J(M)}),ge=wn(function(M,K,F){K===void 0&&(K=!0),E({type:"SET_FIELD_TOUCHED",payload:{field:M,value:K}});var W=F===void 0?i:F;return W?z(_.values):Promise.resolve()}),te=v.useCallback(function(M,K){M.persist&&M.persist();var F=M.target,W=F.name,ce=F.id,me=F.outerHTML,_e=K||W||ce;ge(_e,!0)},[ge]),be=wn(function(M){if(sf(M))return function(K){return te(K,M)};te(M)}),je=v.useCallback(function(M){In(M)?E({type:"SET_FORMIK_STATE",payload:M}):E({type:"SET_FORMIK_STATE",payload:function(){return M}})},[]),oe=v.useCallback(function(M){E({type:"SET_STATUS",payload:M})},[]),ae=v.useCallback(function(M){E({type:"SET_ISSUBMITTING",payload:M})},[]),H=wn(function(){return E({type:"SUBMIT_ATTEMPT"}),z().then(function(M){var K=M instanceof Error,F=!K&&Object.keys(M).length===0;if(F){var W;try{if(W=ke(),W===void 0)return}catch(ce){throw ce}return Promise.resolve(W).then(function(ce){return m.current&&E({type:"SUBMIT_SUCCESS"}),ce}).catch(function(ce){if(m.current)throw E({type:"SUBMIT_FAILURE"}),ce})}else if(m.current&&(E({type:"SUBMIT_FAILURE"}),K))throw M})}),se=wn(function(M){M&&M.preventDefault&&In(M.preventDefault)&&M.preventDefault(),M&&M.stopPropagation&&In(M.stopPropagation)&&M.stopPropagation(),H().catch(function(K){console.warn("Warning: An unhandled error was caught from submitForm()",K)})}),X={resetForm:N,validateForm:z,validateField:O,setErrors:V,setFieldError:G,setFieldTouched:ge,setFieldValue:U,setStatus:oe,setSubmitting:ae,setTouched:j,setValues:R,setFormikState:je,submitForm:H},ke=wn(function(){return d(_.values,X)}),q=wn(function(M){M&&M.preventDefault&&In(M.preventDefault)&&M.preventDefault(),M&&M.stopPropagation&&In(M.stopPropagation)&&M.stopPropagation(),N()}),le=v.useCallback(function(M){return{value:tn(_.values,M),error:tn(_.errors,M),touched:!!tn(_.touched,M),initialValue:tn(h.current,M),initialTouched:!!tn(b.current,M),initialError:tn(x.current,M)}},[_.errors,_.touched,_.values]),ue=v.useCallback(function(M){return{setValue:function(F,W){return U(M,F,W)},setTouched:function(F,W){return ge(M,F,W)},setError:function(F){return G(M,F)}}},[U,ge,G]),Se=v.useCallback(function(M){var K=rd(M),F=K?M.name:M,W=tn(_.values,F),ce={name:F,value:W,onChange:ie,onBlur:be};if(K){var me=M.type,_e=M.value,et=M.as,it=M.multiple;me==="checkbox"?_e===void 0?ce.checked=!!W:(ce.checked=!!(Array.isArray(W)&&~W.indexOf(_e)),ce.value=_e):me==="radio"?(ce.checked=W===_e,ce.value=_e):et==="select"&&it&&(ce.value=ce.value||[],ce.multiple=!0)}return ce},[be,ie,_.values]),Y=v.useMemo(function(){return!Pi(h.current,_.values)},[h.current,_.values]),he=v.useMemo(function(){return typeof a<"u"?Y?_.errors&&Object.keys(_.errors).length===0:a!==!1&&In(a)?a(p):a:_.errors&&Object.keys(_.errors).length===0},[a,Y,_.errors,p]),pe=gt({},_,{initialValues:h.current,initialErrors:x.current,initialTouched:b.current,initialStatus:S.current,handleBlur:be,handleChange:ie,handleReset:q,handleSubmit:se,resetForm:N,setErrors:V,setFormikState:je,setFieldTouched:ge,setFieldValue:U,setFieldError:G,setStatus:oe,setSubmitting:ae,setTouched:j,setValues:R,submitForm:H,validateForm:z,validateField:O,isValid:he,dirty:Y,unregisterField:B,registerField:L,getFieldProps:Se,getFieldMeta:le,getFieldHelpers:ue,validateOnBlur:i,validateOnChange:n,validateOnMount:o});return pe}function ZI(e){var t={};if(e.inner){if(e.inner.length===0)return es(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;tn(t,o.path)||(t=es(t,o.path,o.message))}}return t}function JI(e,t,n,r){n===void 0&&(n=!1);var i=ih(e);return t[n?"validateSync":"validate"](i,{abortEarly:!1,context:i})}function ih(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||zy(i)?ih(i):i!==""?i:void 0}):zy(e[r])?t[r]=ih(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function eL(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 tL(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function nL(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 rL=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?v.useLayoutEffect:v.useEffect;function wn(e){var t=v.useRef(e);return rL(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 iL=v.forwardRef(function(e,t){var n=e.action,r=bC(e,["action"]),i=n??"#",s=YI(),o=s.handleReset,a=s.handleSubmit;return v.createElement("form",gt({onSubmit:a,ref:t,onReset:o,action:i},r))});iL.displayName="Form";const kC=({init:e,schema:t,action:n,validateOnBlur:r=!1})=>XI({initialValues:e,validationSchema:t,validateOnBlur:r,enableReinitialize:!0,validateOnChange:!1,validateOnMount:!1,onSubmit:i=>{n(i)}});function Tg({id:e,text:t,className:n,required:r}){const i=Ee();return t?f.jsxs("label",{htmlFor:e,className:Ne("mb-1 block text-sm font-medium",n),style:{color:i.getColor(w.InputText)},children:[t,r&&f.jsx("span",{className:"ml-1",style:{color:i.getColor(w.ErrorText)},children:"*"})]}):null}const af={sm:"px-3 py-1 text-xs",md:"px-4 py-2 text-sm",lg:"px-5 py-3 text-15"};function sL({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,...x}){const b=Ee(),S=b.getRadius(),m=l?b.getColor(w.ErrorBorder):b.getColor(w.InputBorder),g=b.getColor(w.LinkColor);return f.jsxs("div",{className:Ne({"mb-2":!o},d),style:{"--focus-ring":g},children:[f.jsx(Tg,{id:e,text:t,required:a}),f.jsxs("div",{className:"flex items-center",children:[r&&f.jsx("span",{className:Ne("inline-block border border-solid border-r-0 rounded-l-md",af[i]),style:{borderColor:l?b.getColor(w.ErrorBorder):b.getColor(w.InputBorder),backgroundColor:b.getColor(w.InputBackground),borderRadius:S},children:r}),f.jsx("input",{id:e,autoFocus:h,className:Ne("border border-solid block w-full outline-none transition-[border-color,box-shadow] duration-200 focus:ring-2 focus:ring-offset-0 rounded-lg",af[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?b.getColor(w.ErrorText):b.getColor(w.InputText),backgroundColor:b.getColor(w.InputBackground),borderColor:m,borderRadius:S,"--tw-ring-color":g},...x}),n&&f.jsx("span",{className:Ne("inline-block border border-solid border-l-0 rounded-r-md",af[i]),style:{borderColor:l?b.getColor(w.ErrorBorder):b.getColor(w.InputBorder),backgroundColor:b.getColor(w.InputBackground),borderRadius:S},children:n})]}),!!l&&f.jsx("p",{className:"mt-1 text-xs",style:{color:b.getColor(w.ErrorText)},children:l})]})}const hx=(e,t)=>{const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${e}=${t};expires=${n.toUTCString()};path=/`},CC=v.createContext({}),oL=()=>`${window.location.pathname}_$$_${document.title}`,aL=()=>{const e=localStorage.getItem("page");return!e||e===""?"/":e},lL=()=>{const e=localStorage.getItem("p-history");if(!e||e==="")return[];try{return JSON.parse(e)}catch{return[]}};function cL({children:e}){const[t,n]=v.useState("/"),[r,i]=v.useState(lL());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(CC.Provider,{value:{page:t,setPage:o,history:r,clearHistory:s},children:e})}function id(){return v.useContext(CC)}function uL({label:e,id:t,value:n="",className:r,placeholder:i,children:s,required:o,error:a,...l}){const c=Ee();return f.jsxs("div",{className:r,children:[e&&f.jsx(Tg,{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(w.InputBackground),color:c.getColor(w.InputText),borderColor:a?c.getColor(w.ErrorBorder):c.getColor(w.InputBorder),borderRadius:c.getRadius(),"--tw-ring-color":c.getColor(w.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(w.ErrorText)},children:a})]})}const mx={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:""}},dL={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"},fL={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 pL({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 x=Ee(),b=x.getColor(w.InputText),S=x.getColor(w.LinkColor),m=x.getColor(w.InputBorder),g=x.getColor(w.InputBackground),y=x.getColor(w.ErrorText);return f.jsxs("div",{children:[f.jsxs("div",{className:`flex items-center justify-between gap-2 ${u?"flex-row-reverse":""} ${mx[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 ${dL[c]} ${mx[d].input}`,style:{borderColor:i?S:m,backgroundColor:i?S:g},required:n,checked:i,value:r,onChange:k=>s==null?void 0:s(k.target.checked),onBlur:k=>o==null?void 0:o(k.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(ee.Check,{className:fL[c]})})]}),f.jsx("label",{className:"disable-highlight flex grow cursor-pointer select-none items-center text-sm",style:{color:b},htmlFor:l,children:e})]}),(a||p)&&f.jsx("small",{className:"text-xs",style:{color:y},children:p||a})]})}function hL({id:e,value:t,name:n,onChange:r,children:i,disabled:s,className:o}){const a=Ee(),l=a.getColor(w.InputText),c=a.getColor(w.LinkColor);return f.jsxs("label",{htmlFor:e,className:Ne("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(w.InputBorder),backgroundColor:t?c:a.getColor(w.InputBackground),boxShadow:t?`inset 0 0 0 3px ${a.getColor(w.Background)}`:void 0},disabled:s}),f.jsx("span",{className:"text-sm font-medium",style:{color:l},children:i})]})}function mL({id:e,label:t,children:n,required:r,className:i,error:s}){const o=Ee(),a=o.getColor(w.InputText),l=o.getColor(w.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 gx=Object.assign(hL,{Group:mL});function sd({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:x=!1,...b}){const S=Ee();return f.jsxs("div",{className:Ne({"mb-2":!s},i),children:[t&&f.jsx(Tg,{id:e,text:t,required:l}),f.jsx("textarea",{className:Ne("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":!x,"border-none bg-transparent":x}),id:e,rows:o,"aria-invalid":d,...b,ref:u,autoFocus:p,style:{...h,fontSize:"14px",color:c?S.getColor(w.ErrorText):S.getColor(w.InputText),...!x&&{backgroundColor:S.getColor(w.InputBackground),borderColor:c?S.getColor(w.ErrorBorder):S.getColor(w.InputBorder),borderRadius:S.getRadius(),"--tw-ring-color":S.getColor(w.LinkColor)}}}),!!c&&f.jsx("p",{className:"mt-1 text-xs",style:{color:S.getColor(w.ErrorText)},children:c})]})}function Co({variant:e="block",className:t=""}){const n=Ee(),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(w.FooterText)}:{color:n.getColor(w.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 gL({onOk:e,clientId:t,widgetId:n,appearance:r,aiAgentMode:i=!1,onAIAgentStart:s,onOperatorConnect:o,isConnectingToOperator:a=!1}){var _,E,A,$,I,D;const l=Ee(),{defaultValues:c,widget:d,setIsHaveChat:u}=Z(),[p,h]=v.useState(!1),x=v.useRef(null);v.useEffect(()=>{const P=setTimeout(()=>{var N;const z=(N=x.current)==null?void 0:N.querySelector('input:not([type="hidden"]), select, textarea');z==null||z.focus()},150);return()=>clearTimeout(P)},[]);const b=id(),S=ag(),m=!!c&&"username"in c,g=(E=(_=r==null?void 0:r.body)==null?void 0:_.inputs)==null?void 0:E.reduce((P,z)=>{let N=z.remember?Xs(z.name):c==null?void 0:c[z.name];return z.options&&N&&!z.options.includes(N)&&(N=void 0),z.name==="username"&&m&&(N=c.username),P[z.name]=N||"",P},{}),y=pg(($=(A=r==null?void 0:r.body)==null?void 0:A.inputs)==null?void 0:$.reduce((P,z)=>(P[z.name]=z.required?au().required(`${z.label} alanı zorunludur`):au(),P),{})),k=kC({init:{...g},schema:y,validateOnBlur:!1,action:async P=>{var z,N;if(!(p||a)){h(!0);try{m&&(P.username=c.username),c!=null&&c.secret_data&&(P.secret_data=c.secret_data);for(const B in P)typeof P[B]=="string"&&(P[B]=P[B].trim());if(o){for(const B of((z=r==null?void 0:r.body)==null?void 0:z.inputs)||[])B.remember&&hx(B.name,P[B.name]);o(P);return}const[O,L]=await S.mutateAsync({inputs:P,history:b.history,client_id:t,widget_id:n,device_id:Dr((d==null?void 0:d.link_id)||""),is_agent_mode:i});if(Gn(L)){Yp(O)&&(Hn(lt.CustomerToken,O.customer_token,(d==null?void 0:d.link_id)||""),Hn(lt.CustomerRefreshToken,O.customer_refresh_token,(d==null?void 0:d.link_id)||""),Hn(lt.DeviceId,O.device_id,(d==null?void 0:d.link_id)||"")),b.clearHistory();for(const B of((N=r==null?void 0:r.body)==null?void 0:N.inputs)||[])B.remember&&hx(B.name,P[B.name]);u(!0),i?s==null||s():e==null||e();return}xo(O,{form:k})}catch(O){console.error("Chat creation error:",O)}finally{h(!1)}}}}),C=l.getColor(w.GreeterBackground);return f.jsxs("section",{className:"h-full overflow-y-auto px-5",style:{backgroundColor:C},children:[f.jsxs("form",{ref:x,autoComplete:"off",className:"grid grid-cols-1 gap-4",onSubmit:k.handleSubmit,children:[(D=(I=r==null?void 0:r.body)==null?void 0:I.inputs)==null?void 0:D.map((P,z)=>{var O,L;const N=z===0;if(["text","email","phone"].includes(P.type))return f.jsx(sL,{id:P.name,name:P.name,type:P.type,label:P.label,value:k.values[P.name],onChange:k.handleChange,onBlur:k.handleBlur,disabled:P.name==="username"&&m,readOnly:P.name==="username"&&m,autoComplete:"off",placeholder:P.placeholder,error:k.errors[P.name],ariaInvalid:k.errors.name?!0:void 0,required:P.required,noMargin:!0,autoFocus:N},P.name);if(P.type==="select")return f.jsx(uL,{id:P.name,name:P.name,value:k.values[P.name],onChange:k.handleChange,label:P.label,error:k.errors[P.name],required:P.required,placeholder:P.placeholder,autoFocus:N,children:(O=P.options)==null?void 0:O.map(B=>f.jsx("option",{value:B,children:B},B))},P.name);if(P.type==="checkbox")return f.jsx(pL,{id:P.name,name:P.name,value:k.values[P.name],checked:k.values[P.name]==="true",onChange:k.handleChange,required:P.required,error:k.errors[P.name],children:P.label},P.name);if(P.type==="radio")return f.jsx(gx.Group,{id:P.name,label:P.label,required:P.required,error:k.errors[P.name],children:(L=P.options)==null?void 0:L.map(B=>f.jsx(gx,{onChange:j=>{j?k.setFieldValue(P.name,B):k.setFieldValue(P.name,"")},id:B,name:P.name,value:B===k.values[P.name],children:B},B))},P.name);if(P.type==="textarea")return f.jsx(sd,{id:P.name,name:P.name,value:k.values[P.name],onChange:k.handleChange,onBlur:k.handleBlur,placeholder:P.placeholder,error:k.errors[P.name],required:P.required,label:P.label,noMargin:!0,autoFocus:N},P.name)}),f.jsx(An,{textKey:w.GreeterButtonText,bgKey:w.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(Co,{variant:"block",className:"py-2"})]})}var an=(e=>(e.Open="open",e.Closed="closed",e.Pending="pending",e.Deleted="deleted",e.Created="created",e.Agent="agent",e))(an||{}),rn=(e=>(e.AdminJoin="admin_join",e.AdminLeave="admin_leave",e.ChatCreated="chat_created",e.AdminToggleUpload="admin_toggle_upload",e.ChatTransferred="chat_transferred",e))(rn||{}),ve=(e=>(e.Customer="customer",e.User="user",e.Agent="agent",e.System="system",e.Activity="activity",e))(ve||{});const xs=e=>{const t=yA(),n=(r,i)=>{var o;const s=((o=x8.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 vL={exports:{}},lf={exports:{}},vx;function _C(){return vx||(vx=1,function(e,t){(function(n,r){e.exports=r()})(bh,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",x="date",b="Invalid Date",S=/^(\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(N){var O=["th","st","nd","rd"],L=N%100;return"["+N+(O[(L-20)%10]||O[L]||O[0])+"]"}},y=function(N,O,L){var B=String(N);return!B||B.length>=O?N:""+Array(O+1-B.length).join(L)+N},k={s:y,z:function(N){var O=-N.utcOffset(),L=Math.abs(O),B=Math.floor(L/60),j=L%60;return(O<=0?"+":"-")+y(B,2,"0")+":"+y(j,2,"0")},m:function N(O,L){if(O.date()<L.date())return-N(L,O);var B=12*(L.year()-O.year())+(L.month()-O.month()),j=O.clone().add(B,u),V=L-j<0,R=O.clone().add(B+(V?-1:1),u);return+(-(B+(L-j)/(V?j-R:R-j))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:u,y:h,w:d,d:c,D:x,h:l,m:a,s:o,ms:s,Q:p}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},C="en",_={};_[C]=g;var E="$isDayjsObject",A=function(N){return N instanceof P||!(!N||!N[E])},$=function N(O,L,B){var j;if(!O)return C;if(typeof O=="string"){var V=O.toLowerCase();_[V]&&(j=V),L&&(_[V]=L,j=V);var R=O.split("-");if(!j&&R.length>1)return N(R[0])}else{var G=O.name;_[G]=O,j=G}return!B&&j&&(C=j),j||!B&&C},I=function(N,O){if(A(N))return N.clone();var L=typeof O=="object"?O:{};return L.date=N,L.args=arguments,new P(L)},D=k;D.l=$,D.i=A,D.w=function(N,O){return I(N,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var P=function(){function N(L){this.$L=$(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[E]=!0}var O=N.prototype;return O.parse=function(L){this.$d=function(B){var j=B.date,V=B.utc;if(j===null)return new Date(NaN);if(D.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var R=j.match(S);if(R){var G=R[2]-1||0,U=(R[7]||"0").substring(0,3);return V?new Date(Date.UTC(R[1],G,R[3]||1,R[4]||0,R[5]||0,R[6]||0,U)):new Date(R[1],G,R[3]||1,R[4]||0,R[5]||0,R[6]||0,U)}}return new Date(j)}(L),this.init()},O.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},O.$utils=function(){return D},O.isValid=function(){return this.$d.toString()!==b},O.isSame=function(L,B){var j=I(L);return this.startOf(B)<=j&&j<=this.endOf(B)},O.isAfter=function(L,B){return I(L)<this.startOf(B)},O.isBefore=function(L,B){return this.endOf(B)<I(L)},O.$g=function(L,B,j){return D.u(L)?this[B]:this.set(j,L)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(L,B){var j=this,V=!!D.u(B)||B,R=D.p(L),G=function(oe,ae){var H=D.w(j.$u?Date.UTC(j.$y,ae,oe):new Date(j.$y,ae,oe),j);return V?H:H.endOf(c)},U=function(oe,ae){return D.w(j.toDate()[oe].apply(j.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(ae)),j)},J=this.$W,ie=this.$M,ge=this.$D,te="set"+(this.$u?"UTC":"");switch(R){case h:return V?G(1,0):G(31,11);case u:return V?G(1,ie):G(0,ie+1);case d:var be=this.$locale().weekStart||0,je=(J<be?J+7:J)-be;return G(V?ge-je:ge+(6-je),ie);case c:case x:return U(te+"Hours",0);case l:return U(te+"Minutes",1);case a:return U(te+"Seconds",2);case o:return U(te+"Milliseconds",3);default:return this.clone()}},O.endOf=function(L){return this.startOf(L,!1)},O.$set=function(L,B){var j,V=D.p(L),R="set"+(this.$u?"UTC":""),G=(j={},j[c]=R+"Date",j[x]=R+"Date",j[u]=R+"Month",j[h]=R+"FullYear",j[l]=R+"Hours",j[a]=R+"Minutes",j[o]=R+"Seconds",j[s]=R+"Milliseconds",j)[V],U=V===c?this.$D+(B-this.$W):B;if(V===u||V===h){var J=this.clone().set(x,1);J.$d[G](U),J.init(),this.$d=J.set(x,Math.min(this.$D,J.daysInMonth())).$d}else G&&this.$d[G](U);return this.init(),this},O.set=function(L,B){return this.clone().$set(L,B)},O.get=function(L){return this[D.p(L)]()},O.add=function(L,B){var j,V=this;L=Number(L);var R=D.p(B),G=function(ie){var ge=I(V);return D.w(ge.date(ge.date()+Math.round(ie*L)),V)};if(R===u)return this.set(u,this.$M+L);if(R===h)return this.set(h,this.$y+L);if(R===c)return G(1);if(R===d)return G(7);var U=(j={},j[a]=r,j[l]=i,j[o]=n,j)[R]||1,J=this.$d.getTime()+L*U;return D.w(J,this)},O.subtract=function(L,B){return this.add(-1*L,B)},O.format=function(L){var B=this,j=this.$locale();if(!this.isValid())return j.invalidDate||b;var V=L||"YYYY-MM-DDTHH:mm:ssZ",R=D.z(this),G=this.$H,U=this.$m,J=this.$M,ie=j.weekdays,ge=j.months,te=j.meridiem,be=function(ae,H,se,X){return ae&&(ae[H]||ae(B,V))||se[H].slice(0,X)},je=function(ae){return D.s(G%12||12,ae,"0")},oe=te||function(ae,H,se){var X=ae<12?"AM":"PM";return se?X.toLowerCase():X};return V.replace(m,function(ae,H){return H||function(se){switch(se){case"YY":return String(B.$y).slice(-2);case"YYYY":return D.s(B.$y,4,"0");case"M":return J+1;case"MM":return D.s(J+1,2,"0");case"MMM":return be(j.monthsShort,J,ge,3);case"MMMM":return be(ge,J);case"D":return B.$D;case"DD":return D.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return be(j.weekdaysMin,B.$W,ie,2);case"ddd":return be(j.weekdaysShort,B.$W,ie,3);case"dddd":return ie[B.$W];case"H":return String(G);case"HH":return D.s(G,2,"0");case"h":return je(1);case"hh":return je(2);case"a":return oe(G,U,!0);case"A":return oe(G,U,!1);case"m":return String(U);case"mm":return D.s(U,2,"0");case"s":return String(B.$s);case"ss":return D.s(B.$s,2,"0");case"SSS":return D.s(B.$ms,3,"0");case"Z":return R}return null}(ae)||R.replace(":","")})},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(L,B,j){var V,R=this,G=D.p(B),U=I(L),J=(U.utcOffset()-this.utcOffset())*r,ie=this-U,ge=function(){return D.m(R,U)};switch(G){case h:V=ge()/12;break;case u:V=ge();break;case p:V=ge()/3;break;case d:V=(ie-J)/6048e5;break;case c:V=(ie-J)/864e5;break;case l:V=ie/i;break;case a:V=ie/r;break;case o:V=ie/n;break;default:V=ie}return j?V:D.a(V)},O.daysInMonth=function(){return this.endOf(u).$D},O.$locale=function(){return _[this.$L]},O.locale=function(L,B){if(!L)return this.$L;var j=this.clone(),V=$(L,B,!0);return V&&(j.$L=V),j},O.clone=function(){return D.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},N}(),z=P.prototype;return I.prototype=z,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",u],["$y",h],["$D",x]].forEach(function(N){z[N[1]]=function(O){return this.$g(O,N[0],N[1])}}),I.extend=function(N,O){return N.$i||(N(O,P,I),N.$i=!0),I},I.locale=$,I.isDayjs=A,I.unix=function(N){return I(1e3*N)},I.en=_[C],I.Ls=_,I.p={},I})}(lf)),lf.exports}(function(e,t){(function(n,r){e.exports=r(_C())})(bh,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})})(vL);var TC={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(bh,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 x,b,S,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"}],y=g.length,k=0;k<y;k+=1){var C=g[k];C.d&&(x=p?i(c).diff(u,C.d,!0):u.diff(c,C.d,!0));var _=(n.rounding||Math.round)(Math.abs(x));if(S=x>0,_<=C.r||!C.r){_<=1&&k>0&&(C=g[k-1]);var E=m[C.l];h&&(_=h(""+_)),b=typeof E=="string"?E.replace("%d",_):E(_,d,C.l,S);break}}if(d)return b;var A=S?m.future:m.past;return typeof A=="function"?A(b):A.replace("%s",b)},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)}}})})(TC);var yL=TC.exports;const xL=Ir(yL);var wL=_C();const cf=Ir(wL),bL=(e="tr")=>(cf.extend(xL),cf.locale(e),cf);function SL({onHasHistory:e,emptyStateText:t}){const n=Z(y=>y.widget),r=Z(y=>y.setHistoryChat),i=Z(y=>y.setHistoryMessages),s=Ee(),o=xs(),[a,l]=v.useState(null),c=bL(),d=v.useRef(!1),u=n!=null&&n.link_id?Dr(n.link_id):null,{data:p,isLoading:h}=$4((n==null?void 0:n.link_id)||"",u||"");if(v.useEffect(()=>{if(!h&&p){const[y,k]=p,C=Gn(k)&&Array.isArray(y)&&y.length>0;if(C&&!d.current){const _=y[0];if(_.status===an.Open||_.status===an.Pending){console.log("ChatHistoryList: Auto-joining active chat",_._id),d.current=!0,r(_),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[x,b]=p;if(!Gn(b)||!Array.isArray(x))return b===429?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:"Geçmiş şu an yüklenemedi"}),f.jsx("div",{className:"mt-2 text-xs opacity-60",children:"Yeni bir sohbet başlatabilir veya daha sonra tekrar deneyebilirsiniz."})]})}):null;const S=y=>c(y).fromNow(),m=y=>{const k=y.map(_=>typeof _=="string"?_.trim():"").filter(Boolean);if(k.length===0)return"Atanmamış";if(k.length===1)return k[0];if(k.length===2)return`${k[0]} ve ${k[1]}`;if(k.length===3)return`${k[0]}, ${k[1]} ve ${k[2]}`;const C=k.length-2;return`${k[0]}, ${k[1]} ve ${C} kişi daha`},g=y=>{var k;if(y.who_joined_details&&Array.isArray(y.who_joined_details)&&y.who_joined_details.length>0){const C=y.who_joined_details.map(_=>_.name||"");return m(C)}if(y.participant_logs&&Array.isArray(y.participant_logs)&&y.participant_logs.length>0){const C=y.participant_logs.map(_=>_.name||"");return m(C)}return(k=y.archive_summary)!=null&&k.admin_name?y.archive_summary.admin_name:"Atanmamış"};return x.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:x.map(y=>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(w.InputText),backgroundColor:a===y._id?s.getColor(w.MessageAdminBackground):"transparent",cursor:"pointer"},onMouseEnter:()=>l(y._id),onMouseLeave:()=>l(null),onClick:()=>{r(y),i(null),o.push("chat")},children:[f.jsx("span",{className:"font-medium text-sm truncate flex-1 min-w-0",children:g(y)}),f.jsx("span",{className:"text-xs flex-shrink-0 tabular-nums",style:{color:s.getColor(w.FooterText)},children:S(y.created_at)})]},y._id))})})}const uf=[Be.Light,Be.Dark,Be.System];function kL(e){switch(e){case Be.Light:return ee.Sun;case Be.Dark:return ee.Moon;case Be.System:return ee.Monitor;default:return ee.Monitor}}function CL(){const e=Ee(),{mode:t,setMode:n}=e,r=()=>{const s=uf.indexOf(t),o=uf[(s+1)%uf.length];n(o)},i=kL(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(w.HeaderText)},title:t===Be.Light?"Açık tema":t===Be.Dark?"Koyu tema":"Sistem",children:f.jsx(i,{className:"size-5"})})}const mr=Object.create(null);mr.open="0";mr.close="1";mr.ping="2";mr.pong="3";mr.message="4";mr.upgrade="5";mr.noop="6";const wc=Object.create(null);Object.keys(mr).forEach(e=>{wc[mr[e]]=e});const sh={type:"error",data:"parser error"},EC=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",AC=typeof ArrayBuffer=="function",jC=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Eg=({type:e,data:t},n,r)=>EC&&t instanceof Blob?n?r(t):yx(t,r):AC&&(t instanceof ArrayBuffer||jC(t))?n?r(t):yx(new Blob([t]),r):r(mr[e]+(t||"")),yx=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function xx(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let df;function _L(e,t){if(EC&&e.data instanceof Blob)return e.data.arrayBuffer().then(xx).then(t);if(AC&&(e.data instanceof ArrayBuffer||jC(e.data)))return t(xx(e.data));Eg(e,!1,n=>{df||(df=new TextEncoder),t(df.encode(n))})}const wx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<wx.length;e++)sa[wx.charCodeAt(e)]=e;const TL=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=sa[e.charCodeAt(r)],o=sa[e.charCodeAt(r+1)],a=sa[e.charCodeAt(r+2)],l=sa[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},EL=typeof ArrayBuffer=="function",Ag=(e,t)=>{if(typeof e!="string")return{type:"message",data:RC(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:AL(e.substring(1),t)}:wc[n]?e.length>1?{type:wc[n],data:e.substring(1)}:{type:wc[n]}:sh},AL=(e,t)=>{if(EL){const n=TL(e);return RC(n,t)}else return{base64:!0,data:e}},RC=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},MC="",jL=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,o)=>{Eg(s,!1,a=>{r[o]=a,++i===n&&t(r.join(MC))})})},RL=(e,t)=>{const n=e.split(MC),r=[];for(let i=0;i<n.length;i++){const s=Ag(n[i],t);if(r.push(s),s.type==="error")break}return r};function ML(){return new TransformStream({transform(e,t){_L(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 ff;function Kl(e){return e.reduce((t,n)=>t+n.length,0)}function Xl(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 PL(e,t){ff||(ff=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(Kl(n)<1)break;const l=Xl(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(Kl(n)<2)break;const l=Xl(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(Kl(n)<8)break;const l=Xl(n,8),c=new DataView(l.buffer,l.byteOffset,l.length),d=c.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(sh);break}i=d*Math.pow(2,32)+c.getUint32(4),r=3}else{if(Kl(n)<i)break;const l=Xl(n,i);a.enqueue(Ag(s?l:ff.decode(l),t)),r=0}if(i===0||i>e){a.enqueue(sh);break}}}})}const PC=4;function dt(e){if(e)return NL(e)}function NL(e){for(var t in dt.prototype)e[t]=dt.prototype[t];return e}dt.prototype.on=dt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};dt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};dt.prototype.off=dt.prototype.removeListener=dt.prototype.removeAllListeners=dt.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};dt.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};dt.prototype.emitReserved=dt.prototype.emit;dt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};dt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const od=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Tn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),OL="arraybuffer";function NC(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const DL=Tn.setTimeout,IL=Tn.clearTimeout;function ad(e,t){t.useNativeTimers?(e.setTimeoutFn=DL.bind(Tn),e.clearTimeoutFn=IL.bind(Tn)):(e.setTimeoutFn=Tn.setTimeout.bind(Tn),e.clearTimeoutFn=Tn.clearTimeout.bind(Tn))}const LL=1.33;function FL(e){return typeof e=="string"?BL(e):Math.ceil((e.byteLength||e.size)*LL)}function BL(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 OC(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function $L(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function zL(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 VL extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class jg extends dt{constructor(t){super(),this.writable=!1,ad(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 VL(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=Ag(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=$L(t);return n.length?"?"+n:""}}class UL extends jg{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)};RL(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,jL(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]=OC()),!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 HL=DC;function WL(){}class qL extends UL{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 fr extends dt{constructor(t,n,r){super(),this.createRequest=t,ad(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=NC(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=fr.requestsCount++,fr.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=WL,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete fr.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()}}fr.requestsCount=0;fr.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",bx);else if(typeof addEventListener=="function"){const e="onpagehide"in Tn?"pagehide":"unload";addEventListener(e,bx,!1)}}function bx(){for(let e in fr.requests)fr.requests.hasOwnProperty(e)&&fr.requests[e].abort()}const GL=function(){const e=IC({xdomain:!1});return e&&e.responseType!==null}();class YL extends qL{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=GL&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new fr(IC,this.uri(),t)}}function IC(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||HL))return new XMLHttpRequest}catch{}if(!t)try{return new Tn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const LC=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class QL extends jg{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=LC?{}:NC(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;Eg(r,this.supportsBinary,s=>{try{this.doWrite(r,s)}catch{}i&&od(()=>{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]=OC()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const pf=Tn.WebSocket||Tn.MozWebSocket;class KL extends QL{createSocket(t,n,r){return LC?new pf(t,n,r):n?new pf(t,n):new pf(t)}doWrite(t,n){this.ws.send(n)}}class XL extends jg{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=PL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=ML();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&&od(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const ZL={websocket:KL,webtransport:XL,polling:YL},JL=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,e6=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function oh(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=JL.exec(e||""),s={},o=14;for(;o--;)s[e6[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=t6(s,s.path),s.queryKey=n6(s,s.query),s}function t6(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 n6(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const ah=typeof addEventListener=="function"&&typeof removeEventListener=="function",bc=[];ah&&addEventListener("offline",()=>{bc.forEach(e=>e())},!1);class mi extends dt{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=oh(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=oh(n.host).host);ad(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=zL(this.opts.query)),ah&&(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"})},bc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=PC,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&&mi.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",mi.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+=FL(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,od(()=>{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(mi.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(),ah&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=bc.indexOf(this._offlineEventListener);r!==-1&&bc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}mi.protocol=PC;class r6 extends mi{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;mi.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;mi.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 i6=class extends r6{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=>ZL[i]).filter(i=>!!i)),super(t,r)}};function s6(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=oh(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 o6=typeof ArrayBuffer=="function",a6=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,FC=Object.prototype.toString,l6=typeof Blob=="function"||typeof Blob<"u"&&FC.call(Blob)==="[object BlobConstructor]",c6=typeof File=="function"||typeof File<"u"&&FC.call(File)==="[object FileConstructor]";function Rg(e){return o6&&(e instanceof ArrayBuffer||a6(e))||l6&&e instanceof Blob||c6&&e instanceof File}function Sc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Sc(e[n]))return!0;return!1}if(Rg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Sc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Sc(e[n]))return!0;return!1}function u6(e){const t=[],n=e.data,r=e;return r.data=lh(n,t),r.attachments=t.length,{packet:r,buffers:t}}function lh(e,t){if(!e)return e;if(Rg(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]=lh(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]=lh(e[r],t));return n}return e}function d6(e,t){return e.data=ch(e.data,t),delete e.attachments,e}function ch(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]=ch(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ch(e[n],t));return e}const f6=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],p6=5;var Me;(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"})(Me||(Me={}));class h6{constructor(t){this.replacer=t}encode(t){return(t.type===Me.EVENT||t.type===Me.ACK)&&Sc(t)?this.encodeAsBinary({type:t.type===Me.EVENT?Me.BINARY_EVENT:Me.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Me.BINARY_EVENT||t.type===Me.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=u6(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function Sx(e){return Object.prototype.toString.call(e)==="[object Object]"}class Mg extends dt{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===Me.BINARY_EVENT;r||n.type===Me.BINARY_ACK?(n.type=r?Me.EVENT:Me.ACK,this.reconstructor=new m6(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Rg(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(Me[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Me.BINARY_EVENT||r.type===Me.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(Mg.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 Me.CONNECT:return Sx(n);case Me.DISCONNECT:return n===void 0;case Me.CONNECT_ERROR:return typeof n=="string"||Sx(n);case Me.EVENT:case Me.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&f6.indexOf(n[0])===-1);case Me.ACK:case Me.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class m6{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=d6(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const g6=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Mg,Encoder:h6,get PacketType(){return Me},protocol:p6},Symbol.toStringTag,{value:"Module"}));function zn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const v6=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class BC extends dt{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=[zn(t,"open",this.onopen.bind(this)),zn(t,"packet",this.onpacket.bind(this)),zn(t,"error",this.onerror.bind(this)),zn(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(v6.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:Me.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:Me.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 Me.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 Me.EVENT:case Me.BINARY_EVENT:this.onevent(t);break;case Me.ACK:case Me.BINARY_ACK:this.onack(t);break;case Me.DISCONNECT:this.ondisconnect();break;case Me.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:Me.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:Me.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 Io(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}Io.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};Io.prototype.reset=function(){this.attempts=0};Io.prototype.setMin=function(e){this.ms=e};Io.prototype.setMax=function(e){this.max=e};Io.prototype.setJitter=function(e){this.jitter=e};class uh extends dt{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,ad(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 Io({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||g6;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 i6(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=zn(n,"open",function(){r.onopen(),t&&t()}),s=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=zn(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(zn(t,"ping",this.onping.bind(this)),zn(t,"data",this.ondata.bind(this)),zn(t,"error",this.onerror.bind(this)),zn(t,"close",this.onclose.bind(this)),zn(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){od(()=>{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 BC(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 Ko={};function kc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=s6(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=Ko[i]&&s in Ko[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new uh(r,t):(Ko[i]||(Ko[i]=new uh(r,t)),l=Ko[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(kc,{Manager:uh,Socket:BC,io:kc,connect:kc});const $C=v.createContext(null),vr=()=>{const e=v.useContext($C);if(!e)throw new Error("useWebsocket must be used within a WebSocketProvider");return e},y6=({children:e})=>{const{widget:t,isHaveChat:n,isAIAgentMode:r}=Z(),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(C=>{var _;console.log("WS: cleanupSocket called",{reason:C,hasSocket:!!i.current,isConnected:(_=i.current)==null?void 0:_.connected,currentLinkId:a.current}),i.current&&(console.log("WS: Cleaning up existing socket.",C||""),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((C,_,E)=>{if(a.current===C&&(o.current||i.current&&i.current.connected)){console.log("WS: Connect called but already connecting or connected for same linkId.");return}if(!_&&!E){console.log("WS: Connect skipped - no active chat or AI agent mode");return}const A=ia(lt.CustomerToken,C)||Xs("customer_token"),$=ia(lt.CustomerRefreshToken,C)||Xs("customer_refresh_token");if(!A||!$){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{Z.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:C,tokenPrefix:`${A==null?void 0:A.substring(0,20)}...`,refreshTokenPrefix:`${$==null?void 0:$.substring(0,20)}...`,deviceId:ia(lt.DeviceId,C)}),o.current=!0,a.current=C;const I=kc(iE,{transports:["websocket"],forceNew:!0,timeout:1e4,auth:{customer_token:A,device_id:ia(lt.DeviceId,C)||Xs("device_id"),customer_refresh_token:$}});i.current=I,I.on("error",D=>{console.error("WS: Websocket error",D),o.current=!1}),I.on("connect_error",D=>{console.error("WS: Connect error",D),o.current=!1,c(!1),u(!1),i.current===I&&(i.current=null,a.current=null);const P=(D==null?void 0:D.message)||String(D);if(P.toLowerCase().includes("unauthorized")||P.includes("401")){console.log("WS: Unauthorized error, clearing tokens only"),C&&_k(C),localStorage.removeItem("lc:widget:isHaveChat");try{Z.getState().setIsHaveChat(!1)}catch{}}}),I.on("disconnect",D=>{var z;console.log("WS: Disconnected",D),c(!1),u(!1),o.current=!1,s.current=!1,i.current===I&&(i.current=null,a.current=null);const P=Z.getState();D==="io server disconnect"&&((z=P.widget)!=null&&z.link_id)&&(P.isHaveChat||P.isAIAgentMode)&&(console.log("WS: Server disconnect, attempting reconnect..."),setTimeout(()=>{h(P.widget.link_id,P.isHaveChat,P.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 C=t==null?void 0:t.link_id;return C&&(n||r)?(console.log("WS: Auto-connecting due to linkId and isHaveChat/isAIAgentMode",{isHaveChat:n,isAIAgentMode:r}),h(C,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 C=()=>{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",C),window.addEventListener("pagehide",_),()=>{window.removeEventListener("beforeunload",C),window.removeEventListener("pagehide",_)}},[]);const x=v.useCallback(()=>{const C=t==null?void 0:t.link_id;C?h(C,n,r):console.warn("WS: Manual connect failed, no link_id available.")},[t==null?void 0:t.link_id,n,r,h]),b=v.useCallback(()=>{console.log("WS: Reconnecting..."),p("manual reconnect");const C=t==null?void 0:t.link_id;C&&setTimeout(()=>{h(C,n,r)},100)},[t==null?void 0:t.link_id,n,r,h,p]),S=v.useCallback(()=>{console.log("WS: Manual disconnect"),p("manual disconnect")},[p]),m=v.useCallback((C,_)=>{var E;(E=i.current)==null||E.on(C,_)},[]),g=v.useCallback((C,_)=>{var E;(E=i.current)==null||E.off(C,_)},[]),y=v.useCallback((C,_,E)=>{i.current&&i.current.connected?i.current.emit(C,_,E):console.warn(`WS: Cannot emit event '${C}', socket not connected.`)},[]),k=v.useMemo(()=>({connectionReady:d,connected:l,connect:x,reconnect:b,disconnect:S,on:m,off:g,emit:y}),[l,d,x,b,S,m,g,y]);return f.jsx($C.Provider,{value:k,children:e})},cu=(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])},Lo=()=>{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},zC=()=>{let e=!1;return typeof window<"u"&&(e=new URLSearchParams(window.location.search).get("fullscreen")==="true"),e},ld=()=>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 qe=(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))(qe||{}),xe=(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.AgentMessageStreamStatus="agent:message:stream_status",e.AgentMessageFinalMetadata="agent:message:final_metadata",e.AgentSpamWarning="agent:spam:warning",e.AgentSpamBanned="agent:spam:banned",e))(xe||{});function x6(){const e=id(),t=v.useCallback(()=>{const n=window.location.pathname;n!==e.page&&e.setPage(n)},[e.page]);return cu("popstate",t),null}function w6(){const e=vr(),t=id(),n=v.useCallback(()=>{const r=window.location.pathname;if(r!==t.page){if(e){e.emit(qe.PageChange,{page:r});return}t.setPage(r)}},[e,t.page]);return cu("popstate",n),v.useEffect(()=>{if(!e)return;const r=aL(),i=oL();r!==i&&(e.emit(qe.PageChange,{page:i}),t.setPage(i))},[e]),null}function b6(){return x6(),null}const kx=(e,t)=>{var n;return(n=e.find(r=>r.type===t))==null?void 0:n.content};function S6(){var H,se,X,ke;const e=Ee(),t=Z(q=>q.widget),n=Z(q=>q.setOpen),r=Z(q=>q.setAIAgent),i=Z(q=>q.setIsAIAgentMode),s=Z(q=>q.setIsHaveChat),o=Z(q=>q.isHaveChat),a=Z(q=>q.humanNeedRequested),l=Z(q=>q.setHumanNeedRequested),c=Z(q=>q.aiAgent),d=Z(q=>q.setShowActionButtons),u=Z(q=>q.defaultValues),[p,h]=v.useState(!1),[x,b]=v.useState(!1),[S,m]=v.useState(null),g=xs(),y=Lo(),k=ld(),[C,_]=v.useState(!0),[E,A]=v.useState(!1),$=id(),I=ag(),D=vr(),P=wm(),{data:z}=Nk(t==null?void 0:t.link_id),[N,O]=v.useState(null),L=v.useRef(!1),B=v.useRef(!1),j=v.useRef(!1),V=v.useRef(!1),[R,G]=v.useState(!1),U=ml(),J=v.useCallback(async()=>{var q,le,ue;if(!(!t||V.current)){V.current=!0,G(!0),m(null),Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),Z.getState().clearAIAgentState(),d(!1);try{let Se=null;try{Se=await Pk(t.link_id)}catch(he){console.error("Failed to resolve widget agent for new chat:",he),Se=null}P.setQueryData(Mk(t.link_id),Se);const Y=(((ue=(le=(q=t.appearance)==null?void 0:q.body)==null?void 0:le.inputs)==null?void 0:ue.length)||0)>0;if(Se){if(O(Se),j.current)return;j.current=!0;try{const he={username:(u==null?void 0:u.username)||"Ziyaretçi",email:`visitor_${Date.now()}@temp.local`};u!=null&&u.secret_data&&(he.secret_data=u.secret_data);const[pe,M]=await I.mutateAsync({inputs:he,history:$.history,client_id:t.client_id,widget_id:t.link_id,device_id:Dr(t.link_id),is_agent_mode:!0});Gn(M)&&Yp(pe)?(Hn(lt.CustomerToken,pe.customer_token,t.link_id),Hn(lt.CustomerRefreshToken,pe.customer_refresh_token,t.link_id),Hn(lt.DeviceId,pe.device_id,t.link_id),$.clearHistory(),s(!0),r(Se),i(!0),g.push("chat")):(xo(pe),(pe==null?void 0:pe.statusCode)===403&&m((pe==null?void 0:pe.message)||"Sohbet başlatılamadı."))}catch(he){console.error("Error creating chat for AI agent:",he)}finally{j.current=!1}return}if(!Y){if(j.current)return;j.current=!0;try{const he={};u!=null&&u.secret_data&&(he.secret_data=u.secret_data),u!=null&&u.username&&(he.username=u.username);const[pe,M]=await I.mutateAsync({inputs:he,history:$.history,client_id:t.client_id,widget_id:t.link_id,device_id:Dr(t.link_id)});Gn(M)&&Yp(pe)?(Hn(lt.CustomerToken,pe.customer_token,t.link_id),Hn(lt.CustomerRefreshToken,pe.customer_refresh_token,t.link_id),Hn(lt.DeviceId,pe.device_id,t.link_id),$.clearHistory(),s(!0),g.push("chat")):(xo(pe),(pe==null?void 0:pe.statusCode)===403&&m((pe==null?void 0:pe.message)||"Sohbet başlatılamadı."))}catch(he){console.error("Error creating chat:",he)}finally{j.current=!1}return}O(null),_(!1)}finally{V.current=!1,G(!1)}}},[t,P,I,$,u==null?void 0:u.secret_data,u==null?void 0:u.username,s,r,i,g,d]),ie=v.useCallback(q=>{A(q)},[]);if(!t)return null;const ge=()=>{n(!1)};v.useEffect(()=>{L.current=!1},[t==null?void 0:t.link_id]),v.useEffect(()=>{var le,ue,Se;if(!t)return;const q=Zn(t.link_id);if(q.isAgentMode&&q.agent&&(U!=null&&U.accessToken)&&!L.current){if(L.current=!0,r(q.agent),i(!0),q.sessionId&&Z.getState().setAIAgentSessionId(q.sessionId),q.humanNeedRequested){if(Z.getState().setHumanNeedRequested(!0),!((((Se=(ue=(le=t.appearance)==null?void 0:le.body)==null?void 0:ue.inputs)==null?void 0:Se.length)||0)>0)){g.push("chat");return}return}O(q.agent),g.push("chat")}},[t,U==null?void 0:U.accessToken,U==null?void 0:U.refreshToken,g,r,i]),v.useEffect(()=>{if(!t)return;const q=Zn(t.link_id);q.isAgentMode&&q.agent&&(U!=null&&U.accessToken)||z!==void 0&&O(z)},[t,z,U==null?void 0:U.accessToken]),v.useEffect(()=>{if(p||!t||!U||!U.accessToken){B.current=!1;return}if(B.current||a)return;if(o){g.push("chat");return}const q=Zn(t.link_id);q.isAgentMode&&q.agent&&!q.humanNeedRequested||(B.current=!0,O4(t.client_id,Zi(Xi(U),t.link_id)).then(([le,ue])=>{if(Gn(ue))a||g.push("chat");else if(ue===403){const Se=Zn(t.link_id);if(Se.isAgentMode&&Se.agent){if(Se.humanNeedRequested){r(Se.agent),i(!1),Se.sessionId&&Z.getState().setAIAgentSessionId(Se.sessionId),Z.getState().setHumanNeedRequested(!0);return}r(Se.agent),i(!0),Se.sessionId&&Z.getState().setAIAgentSessionId(Se.sessionId),g.push("chat")}else ba(t.link_id||""),h(!0)}else ue===404?(ba(t.link_id||""),h(!0)):ue===401?(_k(t.link_id||""),h(!0)):g.push("chat")}).catch(()=>g.push("chat")))},[p,g,r,i,t,U==null?void 0:U.accessToken,U==null?void 0:U.refreshToken,o,a]);const te=kx(((se=(H=t.appearance)==null?void 0:H.head)==null?void 0:se.elements)||[],"text"),be=kx(((ke=(X=t.appearance)==null?void 0:X.head)==null?void 0:ke.elements)||[],"title"),je=()=>{if(a&&t){let q=c;if(!q){const le=Zn(t.link_id);le.agent&&(q=le.agent,r(le.agent),O(le.agent))}if(q){i(!0),Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),g.push("chat");return}}_(!0)},oe=()=>{N&&(r(N),i(!0),Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),g.push("chat"))},ae=v.useCallback(q=>{if(!D||x)return;b(!0);const le=()=>{D.emit(qe.AgentRequestHuman,{},ue=>{b(!1),ue!=null&&ue.success&&(Z.getState().setIsHaveChat(!0),d(!1),i(!1),l(!1),Z.getState().clearAIAgentState(),g.push("chat"))})};q&&Object.keys(q).length>0?D.emit(qe.ChatUpdateInputs,{inputs:q},ue=>{ue!=null&&ue.success?le():b(!1)}):le()},[D,x,i,l,g]);return v.useEffect(()=>{var q,le,ue;if(a){if(!c&&t){const Se=Zn(t.link_id);Se.agent&&(r(Se.agent),O(Se.agent))}(c||Zn((t==null?void 0:t.link_id)||"").agent)&&((((ue=(le=(q=t==null?void 0:t.appearance)==null?void 0:q.body)==null?void 0:le.inputs)==null?void 0:ue.length)||0)>0?_(!1):ae())}},[a,c,t,ae,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(w.HeaderBackground),color:e.getColor(w.HeaderText),borderColor:e.getColor(w.HeaderBorder),...y?{}:{borderTopLeftRadius:e.getRadius(),borderTopRightRadius:e.getRadius()}},children:[f.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[!C&&(E||a&&(c||t&&Zn(t.link_id).agent))&&f.jsx("button",{type:"button",onClick:je,className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(ee.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":be||"Müşteri Hizmetleri"}),!C&&te&&f.jsx("div",{className:"text-xs opacity-90 truncate",children:te})]})]}),f.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[f.jsx(CL,{}),k&&f.jsx("button",{type:"button",onClick:ge,className:"p-1.5 rounded-md hover:opacity-80 transition-opacity",children:f.jsx(ee.X,{className:"w-5 h-5"})})]})]}),f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",style:{backgroundColor:e.getColor(w.Background)},children:C?f.jsx("div",{className:"flex-1 overflow-hidden flex flex-col min-h-0",children:f.jsx(SL,{onHasHistory:ie,emptyStateText:S||void 0})}):f.jsx("div",{className:"flex-1 overflow-y-auto",children:f.jsx(gL,{clientId:t.client_id,widgetId:t.link_id,appearance:t.appearance,aiAgentMode:!!N&&!a,onAIAgentStart:oe,onOk:()=>{a&&c||(Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),g.push("chat"))},onOperatorConnect:a&&(c||Zn(t.link_id).agent)?ae:void 0,isConnectingToOperator:x})})}),C&&f.jsxs("div",{className:"flex-shrink-0",style:{backgroundColor:e.getColor(w.Background)},children:[f.jsx("div",{className:"px-5 py-2",children:f.jsxs(An,{onClick:J,disabled:R,size:"lg",className:"w-full flex items-center justify-center gap-2",children:[f.jsx(ee.Plus,{className:"size-4"}),f.jsx("span",{children:R?"Hazırlanıyor…":"Yeni Sohbet Başlat"})]})}),f.jsx(Co,{variant:"block"})]})]})}function k6(){return f.jsxs(f.Fragment,{children:[f.jsx(S6,{}),f.jsx(b6,{})]})}const C6=[{path:"/",component:k6,name:"registration"}];function ot({className:e="",style:t}){const n=Ee();return f.jsx("div",{className:`animate-pulse rounded ${e}`,style:{backgroundColor:n.getColor(w.MessageAdminBackground),opacity:.6,...t}})}function _6(){const e=Ee();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(ot,{className:"h-12 w-3/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(ot,{className:"h-10 w-2/5",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(ot,{className:"h-16 w-4/5",style:{borderRadius:e.getRadius()}})}),f.jsx("div",{className:"flex w-full items-center justify-end",children:f.jsx(ot,{className:"h-8 w-1/3",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.MessageVisitorBackground),opacity:.4}})}),f.jsx("div",{className:"flex w-full items-center justify-start",children:f.jsx(ot,{className:"h-10 w-1/2",style:{borderRadius:e.getRadius()}})})]})}function T6(){const e=Ee();return f.jsxs("div",{className:"p-3 flex items-center gap-3",style:{backgroundColor:e.getColor(w.FooterBackground),borderRadius:e.getRadius()},children:[f.jsx("div",{className:"grow",children:f.jsx(ot,{className:"h-12 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.InputBackground)}})}),f.jsx(ot,{className:"h-12 w-12 rounded-full"})]})}function E6(){const e=Ee();return f.jsxs("header",{className:"p-4 flex justify-between items-center z-10",style:{backgroundColor:e.getColor(w.HeaderBackground),borderBottom:`1px solid ${e.getColor(w.HeaderBorder)}`},children:[f.jsx(ot,{className:"h-5 w-36"}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(ot,{className:"h-5 w-5 rounded"}),f.jsx(ot,{className:"h-5 w-5 rounded"})]})]})}function A6(){const e=Ee();return f.jsx("section",{className:"h-full overflow-y-auto px-4 py-3",style:{backgroundColor:e.getColor(w.GreeterBackground)},children:f.jsxs("div",{className:"grid grid-cols-1 gap-2",children:[f.jsxs("div",{children:[f.jsx(ot,{className:"h-4 w-20 mb-1"}),f.jsx(ot,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(ot,{className:"h-4 w-24 mb-1"}),f.jsx(ot,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.InputBackground)}})]}),f.jsxs("div",{children:[f.jsx(ot,{className:"h-4 w-16 mb-1"}),f.jsx(ot,{className:"h-11 w-full",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.InputBackground)}})]}),f.jsx(ot,{className:"h-11 w-full mt-2",style:{borderRadius:e.getRadius(),backgroundColor:e.getColor(w.GreeterButtonBackground),opacity:.5}})]})})}function j6(){const e=Ee();return f.jsxs("div",{className:"relative flex flex-col gap-3 items-center justify-center h-44",style:{backgroundColor:e.getColor(w.GreeterTopBackground)},children:[f.jsx(ot,{className:"h-7 w-40"}),f.jsx(ot,{className:"h-4 w-56"})]})}function VC(){const e=Ee();return f.jsxs("div",{className:"h-full w-full flex flex-col overflow-hidden",style:{backgroundColor:e.getColor(w.Background)},children:[f.jsx(E6,{}),f.jsx(_6,{}),f.jsx(T6,{}),f.jsxs("div",{className:"py-1.5 px-3 flex items-center justify-center gap-1",style:{borderTop:`1px solid ${e.getColor(w.FooterBorder)}`,backgroundColor:e.getColor(w.FooterBackground)},children:[f.jsx(ot,{className:"h-3 w-20"}),f.jsx(ot,{className:"h-3.5 w-3.5 rounded"})]})]})}function dh(){const e=Ee(),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(w.GreeterBackground)},children:[f.jsx(j6,{}),f.jsx("div",{style:{height:t?"calc(var(--app-height,100dvh) - 11rem)":"calc(100% - 11rem)"},children:f.jsx(A6,{})})]})}const R6=/^admin_([a-f0-9]{24})_(.+)$/i;function Gr(e){return e.profile_id?`id:${e.profile_id}`:`name:${e.name.trim().toLowerCase()}`}function Cx(e){const t=e.trim().match(R6);return t?{profile_id:t[1],name:t[2]}:null}function M6(e,t){const n=e?[...e]:[],r=Gr(t),i=n.findIndex(s=>Gr(s)===r);if(i>=0){const s=n[i];return n[i]={...s,...t,name:t.name||s.name,avatar:t.avatar??s.avatar,profile_id:t.profile_id??s.profile_id},n}return[...n,t]}function fh(e,t){return e!=null&&e.length?e.filter(n=>!(t.profile_id&&n.profile_id===t.profile_id||!t.profile_id&&t.name&&n.name===t.name)):[]}function P6(e,t){const n=t.profile_id!=null&&t.profile_id!==""?fh(e,{profile_id:t.profile_id}):fh(e,{name:t.name});return[t,...n]}function oa(e){const t=e[0];return t?{agent_name:t.name,agent_avatar:t.avatar}:{agent_name:void 0,agent_avatar:void 0}}function N6(e){const t=new Map,n=[];for(const r of e)if(r.sender_type===ve.Activity){if(r.activity_type===rn.AdminJoin){let i;const s=typeof r.content=="string"?Cx(r.content):null;if(s)i={profile_id:s.profile_id,name:s.name};else if(r.sender_name)i={name:r.sender_name};else continue;const o=Gr(i);t.has(o)||n.push(o);const a=t.get(o);t.set(o,{...a,...i,name:i.name,avatar:i.avatar??(a==null?void 0:a.avatar),profile_id:i.profile_id??(a==null?void 0:a.profile_id)})}else if(r.activity_type===rn.AdminLeave){const i=typeof r.content=="string"?Cx(r.content):null;if(i){const s=Gr({profile_id:i.profile_id,name:i.name});t.delete(s);const o=n.indexOf(s);o>=0&&n.splice(o,1)}else if(r.sender_name){const s=Gr({name:r.sender_name});t.delete(s);const o=n.indexOf(s);o>=0&&n.splice(o,1)}}else if(r.activity_type===rn.ChatTransferred){if(r.sender_id){const i=Gr({profile_id:r.sender_id,name:""});t.delete(i);const s=n.indexOf(i);s>=0&&n.splice(s,1)}else if(r.sender_name){const i=Gr({name:r.sender_name});t.delete(i);const s=n.indexOf(i);s>=0&&n.splice(s,1)}}}return n.map(r=>t.get(r)).filter(r=>r!=null)}function Pg(e,t){return e!=null&&e.trim()?[{name:e.trim(),avatar:t}]:[]}function _x(e){const t=e.participants&&e.participants.length>0?e.participants:Pg(e.agent_name,e.agent_avatar),n=oa(t);return{...e,participants:t,agent_name:n.agent_name,agent_avatar:n.agent_avatar}}function O6(e){var s,o;const t=e.who_joined_details;if(t!=null&&t.length)return t.map(a=>({profile_id:a.profile_id,name:a.name,avatar:a.avatar}));const n=e.participant_logs;if(n!=null&&n.length)return n.map(a=>({profile_id:a.user_id,name:a.name}));const r=(s=e.archive_summary)==null?void 0:s.admin_name,i=(o=e.archive_summary)==null?void 0:o.agent_avatar;return r?[{name:r,avatar:i}]:[]}const D6="/notify.mp3",Ng="lc:notification_sound_muted",UC=()=>{try{return sessionStorage.getItem(Ng)==="1"}catch{return!1}},HC=e=>{try{sessionStorage.setItem(Ng,e?"1":"0")}catch{}},I6=async e=>{try{if(sessionStorage.getItem(Ng)==="1")return}catch{}await new Audio(e||D6).play()},hf=[Be.Light,Be.Dark,Be.System];function L6(e){switch(e){case Be.Light:return ee.Sun;case Be.Dark:return ee.Moon;case Be.System:return ee.Monitor;default:return ee.Monitor}}function F6({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>UC()),a=v.useRef(null),l=v.useRef(null),c=Ee(),d=Oo(),u=vr(),{setShowActionButtons:p}=Z(),{mode:h,setMode:x}=c,b=()=>{u==null||u.emit(qe.ChatClose,{}),p(!1),e()},S=()=>{const y=hf.indexOf(h),k=hf[(y+1)%hf.length];x(k)},m=()=>{const y=!s;HC(y),o(y)};v.useEffect(()=>{if(!r)return;const y=k=>{var C,_;(C=l.current)!=null&&C.contains(k.target)||(_=a.current)!=null&&_.contains(k.target)||i(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[r]);const g=r&&f.jsxs(Oe.div,{ref:l,onMouseDown:y=>y.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(w.Background),borderColor:c.getColor(w.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(w.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(w.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(ee.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(w.InputText)},onClick:m,children:[s?f.jsx(ee.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(ee.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(w.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(w.InputText)},onClick:S,children:[(()=>{const y=L6(h);return f.jsx(y,{className:"size-4 flex-shrink-0"})})(),h===Be.Light?"Açık tema":h===Be.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Nr,{children:t&&f.jsx(Oe.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(w.ModalOverlayColor)},children:f.jsxs(Oe.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(w.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(w.ChatCloseConfirmText)},children:d(re.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(w.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(w.GreeterBackground),color:c.getColor(w.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(w.ErrorBackground),color:c.getColor(w.ErrorText),borderRadius:c.getRadius()},onClick:b,children:d(re.CloseAction)})]})]})})}),f.jsxs("div",{className:"relative flex-shrink-0",children:[f.jsx("button",{ref:a,type:"button",onClick:()=>i(y=>!y),className:"flex items-center justify-center p-1.5 rounded-md hover:opacity-80 transition-opacity",style:{backgroundColor:"transparent",color:c.getColor(w.HeaderText)},title:d(re.ChatSettings),"aria-expanded":r,children:f.jsx(ee.Menu,{className:"size-5"})}),f.jsx(Nr,{children:g})]})]})}function B6(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 ph({text:e}){const n=Ee().getColor(w.LinkColor),i=(s=>{const o=B6(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,x=>{const b=x.replace(/[">]+$/,"");return`<a href="${/^https?:\/\//i.test(b)?b:`https://${b}`}" target="_blank" rel="noopener noreferrer" style="color: ${n}; text-decoration: underline;">${b}</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 Tx="opacity-0 group-hover/item:opacity-100 transition-opacity duration-200";function WC({files:e,className:t,onDelete:n,hideName:r}){const i=Lo(),{getColor:s}=Ee(),[o,a]=v.useState(new Map),[l,c]=v.useState(null);v.useEffect(()=>{const m=new Map;for(let g=0;g<e.length;g++){const y=e[g];if(y instanceof File){const k=URL.createObjectURL(y);m.set(g,k)}}return a(m),()=>{for(const g of m.values())URL.revokeObjectURL(g)}},[e]);const d=m=>{var y;return((y=(m instanceof File?m.name:m).split(".").pop())==null?void 0:y.toLowerCase())||""},u=m=>m instanceof File?m.name:m.split("/").pop()||m,p=m=>{const[g,y]=m.split(".");return g.length>10?`${g.slice(0,10)}...${y}`:m},h=m=>{const g=["jpg","jpeg","png","gif","bmp","webp","svg"],y=d(m);return g.includes(y)},x=(m,g)=>{if(m instanceof File){const y=o.get(g);y&&window.open(y,"_blank")}else window.open(m,"_blank")},b=(m,g)=>{m.stopPropagation(),n==null||n(g)},S=(m,g)=>m instanceof File?o.get(g)||"":m;return f.jsx("div",{className:Ne("flex gap-2 w-full overflow-x-auto",t),children:e.map((m,g)=>{const y=u(m),k=d(m),C=h(m),_=S(m,g);return f.jsxs("div",{onClick:()=>x(m,g),onMouseEnter:()=>c(g),onMouseLeave:()=>c(null),className:"min-w-20 max-w-20 cursor-pointer group/item border rounded-lg p-1.5 transition-all duration-200 relative",style:{backgroundColor:s(w.Background),borderColor:s(l===g?w.InputBorder:w.Border),boxShadow:l===g?`0 4px 6px -1px ${s(w.ShadowColor)}`:void 0},children:[n&&f.jsx("button",{onClick:E=>b(E,g),className:Ne("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"})})}),C?f.jsx("div",{className:"aspect-square w-fit mb-0.5 overflow-hidden rounded",children:f.jsx("img",{src:_,alt:y,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 rounded transition-colors duration-200",style:{backgroundColor:s(l===g?w.CloseButtonHover:w.InputBackground)},children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"w-6 h-6 mx-auto mb-0.5 rounded flex items-center justify-center",style:{backgroundColor:`color-mix(in srgb, ${s(w.ButtonBackground)} 20%, transparent)`},children:f.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",style:{color:s(w.ButtonBackground)},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:Ne("text-[10px] font-medium uppercase",{[Tx]:r}),style:{color:s(w.FooterText)},children:k||"file"})]})}),f.jsx("div",{className:Ne("max-w-16 text-[10px] font-medium truncate text-ellipsis overflow-hidden",{[Tx]:r}),style:{color:s(w.InputText)},title:y,children:p(y)})]},g)})})}const Og="livechat:send:";function Ex(e){const t=(e==null?void 0:e.trim())??"";if(!t)return{text:"",suggestedQuestions:[]};let n=null;try{n=JSON.parse(t)}catch{const l=t.indexOf("{"),c=t.lastIndexOf("}");if(l!==-1&&c>l)try{n=JSON.parse(t.slice(l,c+1))}catch{n=null}}if(!n||typeof n!="object"||Array.isArray(n))return{text:e,suggestedQuestions:[]};const r=n,i=r.generation;let s;typeof i=="string"&&i.trim()?s=i.trim():i!=null&&(typeof i=="number"||typeof i=="boolean")?s=String(i):s=e;const o=r.suggested_questions,a=[];if(Array.isArray(o))for(const l of o){if(typeof l=="string"){const c=l.trim();c&&a.push(c)}if(a.length>=10)break}return{text:s,suggestedQuestions:a}}function $6(e){return`${Og}${encodeURIComponent(e)}`}function aa(e){return e.startsWith(Og)}function z6(e){if(!aa(e))return null;try{return decodeURIComponent(e.slice(Og.length))}catch{return null}}function V6(e){const t=e.id&&String(e.id).trim()||"";if(t)return`id:${t}`;const n=e._id;if(n!=null&&String(n).trim())return`id:${String(n)}`;const r=typeof e.created_at=="string"?e.created_at:e.created_at instanceof Date?e.created_at.toISOString():"",i=(e.content||"").slice(0,40);return`fall:${r}:${i}`}function Ax(e){if(e.sender_type!==ve.Agent)return{content:e.content,buttons:e.buttons};if(e.buttons&&e.buttons.length>0)return{content:e.content,buttons:e.buttons};if(Array.isArray(e.buttons)&&e.buttons.length===0){const{text:r}=Ex(e.content);return{content:r,buttons:void 0}}const{text:t,suggestedQuestions:n}=Ex(e.content);return n.length===0?{content:t,buttons:void 0}:{content:t,buttons:n.map(r=>({label:r,url:$6(r)}))}}const U6={hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},H6={hidden:{opacity:0,y:8,scale:.95},visible:{opacity:1,y:0,scale:1}};function qC({buttons:e,className:t="",onLivechatSend:n,suggestGroupSpent:r=!1}){const i=Ee();if(!e||e.length===0)return null;const s=e.some(l=>aa(l.url)),o=(l,c)=>{if(aa(l)){if(r)return;const d=z6(l);d&&n&&n(d),c.currentTarget.blur();return}l.startsWith("http://")||l.startsWith("https://")?window.open(l,"_blank","noopener,noreferrer"):l.startsWith("tel:")||l.startsWith("mailto:")?window.location.href=l:console.log("Custom action:",l)},a=l=>aa(l)?null:l.startsWith("http://")||l.startsWith("https://")?f.jsx(ee.ExternalLink,{className:"size-4"}):l.startsWith("tel:")?f.jsx(ee.Phone,{className:"size-4"}):l.startsWith("mailto:")?f.jsx(ee.Mail,{className:"size-4"}):null;return f.jsx(Oe.div,{className:Ne(t,"mt-2",r&&s&&"opacity-50"),initial:"hidden",animate:"visible",variants:U6,transition:{duration:.3,ease:"easeOut",staggerChildren:.08},children:f.jsx("div",{className:"rounded-lg ",style:{backgroundColor:`${i.getColor(w.Background)}f0`},children:f.jsx("div",{className:Ne("flex flex-wrap",s?"gap-1.5":"gap-2"),children:e.map((l,c)=>{const d=aa(l.url),u=d&&r;return f.jsxs(Oe.button,{type:"button",disabled:u,"aria-disabled":u||void 0,variants:H6,transition:{duration:.25,ease:"easeOut"},whileHover:u?void 0:{scale:1.02,y:-1,transition:{duration:.15}},whileTap:u?void 0:{scale:.98,transition:{duration:.1}},onClick:p=>o(l.url,p),className:Ne("group inline-flex items-center font-medium transition-all duration-200 relative overflow-hidden",u?"cursor-not-allowed":"cursor-pointer","outline-none focus:outline-none focus-visible:outline-none","[-webkit-tap-highlight-color:transparent]",d?"gap-1.5 px-2.5 py-1.5 text-xs rounded-md max-w-[100%] text-left":"gap-2 px-4 py-2.5 text-sm"),style:{backgroundColor:i.getColor(w.GreeterBackground),color:i.getColor(w.GreeterText),borderRadius:i.getRadius(),border:`1px solid ${i.getColor(w.DividerColor)}`,boxShadow:`0 1px 3px ${i.getColor(w.ShadowColor)}30`},onMouseEnter:p=>{u||(p.currentTarget.style.backgroundColor=i.getColor(w.ButtonBackground),p.currentTarget.style.color=i.getColor(w.ButtonText),p.currentTarget.style.borderColor=i.getColor(w.ButtonBackground),p.currentTarget.style.boxShadow=`0 4px 12px ${i.getColor(w.ShadowColor)}40`)},onMouseLeave:p=>{p.currentTarget.style.backgroundColor=i.getColor(w.GreeterBackground),p.currentTarget.style.color=i.getColor(w.GreeterText),p.currentTarget.style.borderColor=i.getColor(w.DividerColor),p.currentTarget.style.boxShadow=`0 1px 3px ${i.getColor(w.ShadowColor)}30`},children:[f.jsxs("span",{className:Ne("flex items-center min-w-0",d?"gap-1.5":"gap-2"),children:[a(l.url),f.jsx("span",{className:Ne(d?"font-normal leading-snug":"font-medium"),children:l.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%, ${i.getColor(w.ButtonText)}10 50%, transparent 70%)`,borderRadius:i.getRadius()}})]},`${l.label}-${c}`)})})})})}const hh=700,W6=700;function q6({msgId:e,skipStagger:t,isCustomerSide:n,hasButtons:r,buttons:i,suggestGroupSpent:s,suggestKey:o,onLivechatSendSuggested:a,setSpentSuggestMsgIds:l}){const[c,d]=v.useState(t&&r);return v.useEffect(()=>{if(t){d(r);return}let u;return d(!1),r&&(u=setTimeout(()=>d(!0),hh)),()=>{u!==void 0&&clearTimeout(u)}},[e,t,r]),r?f.jsx("div",{className:Ne("w-full",{"flex justify-end":n,"flex justify-start":!n}),children:f.jsx("div",{className:"max-w-[80%]",children:c&&f.jsx(qC,{buttons:i,suggestGroupSpent:s,onLivechatSend:u=>{l(p=>{const h=new Set(p);return h.add(o),h}),a==null||a(u,!0)}})})}):null}function G6({msgId:e,text:t,delayMs:n,getBubbleRadius:r}){const i=Ee(),[s,o]=v.useState(n<=0);return v.useEffect(()=>{if(n<=0){o(!0);return}o(!1);const a=setTimeout(()=>o(!0),n);return()=>clearTimeout(a)},[e,n]),s?f.jsx("div",{className:"flex w-full min-w-0 justify-start mt-2",children:f.jsx("div",{className:"max-w-[80%] border-0 px-3 py-2 whitespace-pre-wrap !text-sm",style:{backgroundColor:i.getColor(w.MessageAdminBackground),color:i.getColor(w.MessageAdminText),borderRadius:r(ve.Agent)},children:f.jsx(ph,{text:t})})}):null}const jx=e=>e?(typeof e=="string"&&(e=new Date(e)),e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})):"",Rx=["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 GC({messages:e,isTyping:t,chat:n,streamingContent:r,streamingStatusText:i,onLivechatSendSuggested:s}){var $,I,D,P;const o=v.useRef(null),a=v.useRef(null),[l,c]=v.useState(!0),d=v.useRef(!0),{widget:u,showActionButtons:p}=Z(),h=Ee(),x=v.useRef(!0),b=v.useRef(new Set),[S,m]=v.useState(0),[g,y]=v.useState(()=>new Set),k=v.useRef(null);v.useEffect(()=>{k.current===null&&e.length!==0&&(k.current=new Set(e.map(z=>String(z.id??"")).filter(Boolean)))},[e]),v.useEffect(()=>{e.length>0&&x.current&&requestAnimationFrame(()=>{x.current=!1})},[e]),v.useEffect(()=>{e.length===0&&(b.current.clear(),y(new Set),k.current=null)},[e.length]),v.useEffect(()=>{if(!t||r===void 0||r||i)return;const z=setInterval(()=>{m(N=>(N+1)%Rx.length)},2500);return()=>clearInterval(z)},[t,r,i]);const C=()=>{const z=a.current;z&&(z.scrollTop=z.scrollHeight)},_=()=>{if(a.current){const{scrollTop:z,scrollHeight:N,clientHeight:O}=a.current,L=N-z<=O+10;d.current=L,c(L)}};v.useEffect(()=>{(d.current||t)&&C()},[e,t,r,i]);const E=(z,N)=>{if(x.current)return{initial:!1,animate:{}};const O=z.id||"";return b.current.has(O)?N===ve.Customer?{initial:!1,animate:{opacity:1,x:0}}:{initial:!1,animate:{}}:(b.current.add(O),N===ve.Customer?{initial:{opacity:0,x:30},animate:{opacity:1,x:0}}:{initial:!1,animate:{}})},A=z=>z===ve.Customer?"18px 18px 4px 18px":z===ve.User||z===ve.Agent?"18px 18px 18px 4px":h.getRadius();return f.jsxs("section",{onScroll:_,ref:a,className:"flex flex-col gap-3 w-full grow pt-4 px-4 overflow-y-auto overflow-x-hidden scrollbar",children:[((I=($=u==null?void 0:u.appearance)==null?void 0:$.design)==null?void 0:I.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:h.getColor(w.MessageAdminBackground),color:h.getColor(w.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:(P=(D=u==null?void 0:u.appearance)==null?void 0:D.design)==null?void 0:P.greeting_message})}),f.jsx(Nr,{children:Array.isArray(e)&&(()=>{const z=e.filter(R=>{var G;return R!=null&&(!!R.content||(((G=R.files)==null?void 0:G.length)??0)>0)&&R.content!==`
|
|
97
|
+
`}),N=z.length-1,O=N>=0?z[N]:null,L=(O==null?void 0:O.sender_type)===ve.Customer,B=(O==null?void 0:O.sender_type)===ve.Agent?Ax(O):null,j=(O==null?void 0:O.sender_type)===ve.Agent&&!!(B!=null&&B.buttons&&B.buttons.length>0),V=!L&&j;return z.map((R,G)=>{var H,se,X;const U=Ax(R),J=V6(R),ie=z.slice(G+1).some(ke=>ke.sender_type===ve.Customer),ge=g.has(J)||ie,te=((H=k.current)==null?void 0:H.has(String(R.id)))??!1,be=(se=R.post_followup)==null?void 0:se.trim(),je=R.sender_type===ve.Agent&&G===N&&(O==null?void 0:O.sender_type)===ve.Agent,oe=R.sender_type===ve.Agent&&be?te?0:je?U.buttons&&U.buttons.length>0?hh+W6:hh:0:0,ae=E(R,R.sender_type);return f.jsxs(Oe.div,{initial:ae.initial,animate:ae.animate,transition:{duration:.25,ease:"easeOut"},className:Ne("flex flex-col w-full min-w-0 justify-center break-words",{"items-end":R.sender_type===ve.Customer||R.activity_type===rn.ChatCreated,"items-start":R.sender_type===ve.User||R.sender_type===ve.Agent,"items-center":R.sender_type===ve.System||R.sender_type===ve.Activity}),children:[R.sender_type===ve.System&&f.jsx("div",{className:"max-w-full whitespace-pre-wrap break-words overflow-hidden px-3 py-1.5 text-sm",style:{backgroundColor:h.getColor(w.MessageAdminBackground),color:h.getColor(w.MessageAdminText),borderRadius:h.getRadius()},children:R.content}),([ve.Customer,ve.User,ve.Agent].includes(R.sender_type)||R.activity_type===rn.ChatCreated)&&f.jsxs("div",{className:Ne("max-w-[80%] border-0 px-3 py-2",{"whitespace-pre-wrap !text-sm":R.sender_type===ve.Customer||R.activity_type===rn.ChatCreated||R.sender_type===ve.Agent&&!((X=U.content)!=null&&X.includes('id="chaty"'))}),style:{backgroundColor:R.sender_type===ve.User||R.sender_type===ve.Agent?h.getColor(w.MessageAdminBackground):h.getColor(w.MessageVisitorBackground),color:R.sender_type===ve.User||R.sender_type===ve.Agent?h.getColor(w.MessageAdminText):h.getColor(w.MessageVisitorText),borderRadius:A(R.sender_type)},children:[R.files&&R.files.length>0&&f.jsx(WC,{files:R.files,className:"mb-1",hideName:!0}),R.sender_type===ve.User||R.sender_type===ve.Agent?f.jsx(ph,{text:U.content}):R.content,R.created_at&&f.jsx("div",{className:"text-[0.5rem] text-right opacity-70 mt-1",style:{color:R.sender_type===ve.User||R.sender_type===ve.Agent?h.getColor(w.MessageAdminText):h.getColor(w.MessageVisitorText)},children:jx(R.created_at)})]}),R.sender_type===ve.Agent&&U.buttons&&U.buttons.length>0&&V&&G===N&&f.jsx(q6,{msgId:String(R.id),skipStagger:te,isCustomerSide:!1,hasButtons:!0,buttons:U.buttons,suggestGroupSpent:ge,suggestKey:J,onLivechatSendSuggested:s,setSpentSuggestMsgIds:y}),R.sender_type===ve.Agent&&be&&f.jsx(G6,{msgId:String(R.id),text:be,delayMs:oe,getBubbleRadius:A}),([ve.Customer,ve.User].includes(R.sender_type)||R.activity_type===rn.ChatCreated)&&U.buttons&&U.buttons.length>0&&f.jsx("div",{className:Ne("w-full",{"flex justify-end":R.sender_type===ve.Customer||R.activity_type===rn.ChatCreated,"flex justify-start":R.sender_type===ve.User}),children:f.jsx("div",{className:"max-w-[80%]",children:f.jsx(qC,{buttons:U.buttons,suggestGroupSpent:ge,onLivechatSend:ke=>{y(q=>{const le=new Set(q);return le.add(J),le}),s==null||s(ke,!0)}})})}),R.sender_type===ve.Activity&&R.activity_type!==rn.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:h.getColor(w.MessageAdminBackground),color:h.getColor(w.MessageAdminText)},children:R.activity_type===rn.AdminLeave?`${R.content.split("_")[2]} odadan ayrıldı`:R.activity_type===rn.AdminJoin?`${R.content.split("_")[2]} odaya katıldı`:R.activity_type===rn.AdminToggleUpload?R.content.includes("is_customer_uploadable:true")?"Dosya gönderim izni açıldı":"Dosya gönderim izni kapatıldı":R.content}),ve.System===R.sender_type&&f.jsx("div",{className:"text-xs",style:{color:h.getColor(w.MessageAdminText)},children:R.created_at&&jx(R.created_at)})]},R.id||G)})})()}),t&&f.jsx(Oe.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:h.getColor(w.MessageAdminBackground),color:h.getColor(w.MessageAdminText),borderRadius:"18px 18px 18px 4px"},children:r?f.jsx(ph,{text:r}):f.jsxs("div",{className:"flex items-center gap-2 py-1",children:[f.jsx(ee.Sparkles,{className:"size-4 flex-shrink-0 sparkle-pulse",style:{color:h.getColor(w.MessageAdminText)}}),f.jsx(Nr,{mode:"wait",children:f.jsx(Oe.span,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},exit:{opacity:0,y:-8},transition:{duration:.2},className:"!text-sm",style:{color:h.getColor(w.MessageAdminText)},children:i||Rx[S]},i?`srv:${i}`:S)})]})}):f.jsx("div",{className:"flex items-center rounded-full px-4 py-2",style:{backgroundColor:h.getColor(w.MessageAdminBackground)},children:f.jsxs("div",{className:"flex space-x-1",children:[f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:h.getColor(w.MessageAdminText),animationDelay:"0ms"}}),f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:h.getColor(w.MessageAdminText),animationDelay:"150ms"}}),f.jsx("div",{className:"size-1.5 rounded-full dot-wave",style:{backgroundColor:h.getColor(w.MessageAdminText),animationDelay:"300ms"}})]})})}),!l&&f.jsx("div",{className:"absolute right-4 z-10 transition-all duration-200",style:{bottom:p?"8rem":"7rem"},children:f.jsx(An,{type:"button",variant:"primary",kind:"solid",rounded:!0,className:"size-10 flex items-center justify-center p-0! shadow-md",onClick:()=>{var z,N;(N=a.current)==null||N.scrollTo({top:(z=a.current)==null?void 0:z.scrollHeight,behavior:"smooth"})},children:f.jsx(ee.ArrowDown,{className:"size-4"})})}),f.jsx("div",{ref:o})]})}/**
|
|
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 Y6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Q6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Mx=e=>{const t=Q6(e);return t.charAt(0).toUpperCase()+t.slice(1)},
|
|
102
|
+
*/const Y6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Q6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Mx=e=>{const t=Q6(e);return t.charAt(0).toUpperCase()+t.slice(1)},YC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),K6=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.
|
|
@@ -109,23 +109,23 @@ attempted value: ${o}
|
|
|
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 Z6=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,...X6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:
|
|
112
|
+
*/const Z6=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,...X6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:YC("lucide",i),...!s&&!K6(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 QC=(e,t)=>{const n=v.forwardRef(({className:r,...i},s)=>v.createElement(Z6,{ref:s,iconNode:t,className:YC(`lucide-${Y6(Mx(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Mx(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 J6=[["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"}]],eF=
|
|
122
|
+
*/const J6=[["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"}]],eF=QC("cloud-upload",J6);/**
|
|
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 tF=[["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"}]],nF=YC("paperclip",tF);var QC={exports:{}},rF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",iF=rF,sF=iF;function KC(){}function XC(){}XC.resetWarningCache=KC;var oF=function(){function e(r,i,s,o,a,l){if(l!==sF){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:XC,resetWarningCache:KC};return n.PropTypes=n,n};QC.exports=oF();var aF=QC.exports;const $e=Ir(aF);function ws(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 lF=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 _o(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=lF.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 uF=[".DS_Store","Thumbs.db"];function dF(e){return ws(this,void 0,void 0,function*(){return uu(e)&&fF(e.dataTransfer)?gF(e.dataTransfer,e.type):pF(e)?hF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?mF(e):[]})}function fF(e){return uu(e)}function pF(e){return uu(e)&&uu(e.target)}function uu(e){return typeof e=="object"&&e!==null}function hF(e){return mh(e.target.files).map(t=>_o(t))}function mF(e){return ws(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>_o(n))})}function gF(e,t){return ws(this,void 0,void 0,function*(){if(e.items){const n=mh(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(vF));return Nx(ZC(r))}return Nx(mh(e.files).map(n=>_o(n)))})}function Nx(e){return e.filter(t=>uF.indexOf(t.name)===-1)}function mh(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 vF(e){if(typeof e.webkitGetAsEntry!="function")return Ox(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?JC(t):Ox(e,t)}function ZC(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?ZC(n):[n]],[])}function Ox(e,t){return ws(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,_o(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return _o(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function yF(e){return ws(this,void 0,void 0,function*(){return e.isDirectory?JC(e):xF(e)})}function JC(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>ws(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(yF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function xF(e){return ws(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=_o(r,e.fullPath);t(i)},r=>{n(r)})})})}var mf=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 Dx(e){return SF(e)||bF(e)||t2(e)||wF()}function wF(){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 bF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SF(e){if(Array.isArray(e))return gh(e)}function Ix(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 Lx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ix(Object(n),!0).forEach(function(r){
|
|
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 YF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QF(e){if(Array.isArray(e))return vh(e)}function gf(e,t){return ZF(e)||XF(e,t)||
|
|
131
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o2(e,t){if(e){if(typeof e=="string")return vh(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 vh(e,t)}}function vh(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 XF(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 ZF(e){if(Array.isArray(e))return e}function zx(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 Qe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zx(Object(n),!0).forEach(function(r){yh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fu(e,t){if(e==null)return{};var n=JF(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 JF(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 yl=v.forwardRef(function(e,t){var n=e.children,r=fu(e,VF),i=e8(r),s=i.open,o=fu(i,UF);return v.useImperativeHandle(t,function(){return{open:s}},[s]),ne.createElement(v.Fragment,null,n(Qe(Qe({},o),{},{open:s})))});yl.displayName="Dropzone";var a2={disabled:!1,getFilesFromEvent:dF,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};yl.defaultProps=a2;yl.propTypes={children:$e.func,accept:$e.objectOf($e.arrayOf($e.string)),multiple:$e.bool,preventDropOnDocument:$e.bool,noClick:$e.bool,noKeyboard:$e.bool,noDrag:$e.bool,noDragEventsBubbling:$e.bool,minSize:$e.number,maxSize:$e.number,maxFiles:$e.number,disabled:$e.bool,getFilesFromEvent:$e.func,onFileDialogCancel:$e.func,onFileDialogOpen:$e.func,useFsAccessApi:$e.bool,autoFocus:$e.bool,onDragEnter:$e.func,onDragLeave:$e.func,onDragOver:$e.func,onDrop:$e.func,onDropAccepted:$e.func,onDropRejected:$e.func,onError:$e.func,validator:$e.func};var xh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function e8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Qe(Qe({},a2),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,x=t.onDropRejected,b=t.onFileDialogCancel,S=t.onFileDialogOpen,m=t.useFsAccessApi,g=t.autoFocus,y=t.preventDropOnDocument,C=t.noClick,k=t.noKeyboard,_=t.noDrag,E=t.noDragEventsBubbling,A=t.onError,V=t.validator,D=v.useMemo(function(){return BF(n)},[n]),I=v.useMemo(function(){return FF(n)},[n]),O=v.useMemo(function(){return typeof S=="function"?S:Vx},[S]),$=v.useMemo(function(){return typeof b=="function"?b:Vx},[b]),P=v.useRef(null),N=v.useRef(null),L=v.useReducer(t8,xh),B=gf(L,2),j=B[0],z=B[1],R=j.isFocused,G=j.isFileDialogActive,U=v.useRef(typeof window<"u"&&window.isSecureContext&&m&&LF()),J=function(){!U.current&&G&&setTimeout(function(){if(N.current){var W=N.current.files;W.length||(z({type:"closeDialog"}),$())}},300)};v.useEffect(function(){return window.addEventListener("focus",J,!1),function(){window.removeEventListener("focus",J,!1)}},[N,G,$,U]);var ie=v.useRef([]),ge=function(W){P.current&&P.current.contains(W.target)||(W.preventDefault(),ie.current=[])};v.useEffect(function(){return y&&(document.addEventListener("dragover",$x,!1),document.addEventListener("drop",ge,!1)),function(){y&&(document.removeEventListener("dragover",$x),document.removeEventListener("drop",ge))}},[P,y]),v.useEffect(function(){return!r&&g&&P.current&&P.current.focus(),function(){}},[P,g,r]);var te=v.useCallback(function(F){A?A(F):console.error(F)},[A]),be=v.useCallback(function(F){F.preventDefault(),F.persist(),he(F),ie.current=[].concat(qF(ie.current),[F.target]),Zl(F)&&Promise.resolve(i(F)).then(function(W){if(!(du(F)&&!E)){var ce=W.length,me=ce>0&&NF({files:W,accept:D,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:V}),_e=ce>0&&!me;z({isDragAccept:me,isDragReject:_e,isDragActive:!0,type:"setDraggedFiles"}),c&&c(F)}}).catch(function(W){return te(W)})},[i,c,te,E,D,o,s,a,l,V]),je=v.useCallback(function(F){F.preventDefault(),F.persist(),he(F);var W=Zl(F);if(W&&F.dataTransfer)try{F.dataTransfer.dropEffect="copy"}catch{}return W&&u&&u(F),!1},[u,E]),oe=v.useCallback(function(F){F.preventDefault(),F.persist(),he(F);var W=ie.current.filter(function(me){return P.current&&P.current.contains(me)}),ce=W.indexOf(F.target);ce!==-1&&W.splice(ce,1),ie.current=W,!(W.length>0)&&(z({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Zl(F)&&d&&d(F))},[P,d,E]),ae=v.useCallback(function(F,W){var ce=[],me=[];F.forEach(function(_e){var et=n2(_e,D),it=gf(et,2),Tt=it[0],Ot=it[1],yr=r2(_e,o,s),gn=gf(yr,2),Fe=gn[0],Dt=gn[1],bs=V?V(_e):null;if(Tt&&Fe&&!bs)ce.push(_e);else{var Ht=[Ot,Dt];bs&&(Ht=Ht.concat(bs)),me.push({file:_e,errors:Ht.filter(function(vn){return vn})})}}),(!a&&ce.length>1||a&&l>=1&&ce.length>l)&&(ce.forEach(function(_e){me.push({file:_e,errors:[PF]})}),ce.splice(0)),z({acceptedFiles:ce,fileRejections:me,isDragReject:me.length>0,type:"setFiles"}),p&&p(ce,me,W),me.length>0&&x&&x(me,W),ce.length>0&&h&&h(ce,W)},[z,a,D,o,s,l,p,h,x,V]),H=v.useCallback(function(F){F.preventDefault(),F.persist(),he(F),ie.current=[],Zl(F)&&Promise.resolve(i(F)).then(function(W){du(F)&&!E||ae(W,F)}).catch(function(W){return te(W)}),z({type:"reset"})},[i,ae,te,E]),se=v.useCallback(function(){if(U.current){z({type:"openDialog"}),O();var F={multiple:a,types:I};window.showOpenFilePicker(F).then(function(W){return i(W)}).then(function(W){ae(W,null),z({type:"closeDialog"})}).catch(function(W){$F(W)?($(W),z({type:"closeDialog"})):zF(W)?(U.current=!1,N.current?(N.current.value=null,N.current.click()):te(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."))):te(W)});return}N.current&&(z({type:"openDialog"}),O(),N.current.value=null,N.current.click())},[z,O,$,m,ae,te,I,a]),X=v.useCallback(function(F){!P.current||!P.current.isEqualNode(F.target)||(F.key===" "||F.key==="Enter"||F.keyCode===32||F.keyCode===13)&&(F.preventDefault(),se())},[P,se]),ke=v.useCallback(function(){z({type:"focus"})},[]),q=v.useCallback(function(){z({type:"blur"})},[]),le=v.useCallback(function(){C||(IF()?setTimeout(se,0):se())},[C,se]),ue=function(W){return r?null:W},Se=function(W){return k?null:ue(W)},Y=function(W){return _?null:ue(W)},he=function(W){E&&W.stopPropagation()},pe=v.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=F.refKey,ce=W===void 0?"ref":W,me=F.role,_e=F.onKeyDown,et=F.onFocus,it=F.onBlur,Tt=F.onClick,Ot=F.onDragEnter,yr=F.onDragOver,gn=F.onDragLeave,Fe=F.onDrop,Dt=fu(F,HF);return Qe(Qe(yh({onKeyDown:Se(Xn(_e,X)),onFocus:Se(Xn(et,ke)),onBlur:Se(Xn(it,q)),onClick:ue(Xn(Tt,le)),onDragEnter:Y(Xn(Ot,be)),onDragOver:Y(Xn(yr,je)),onDragLeave:Y(Xn(gn,oe)),onDrop:Y(Xn(Fe,H)),role:typeof me=="string"&&me!==""?me:"presentation"},ce,P),!r&&!k?{tabIndex:0}:{}),Dt)}},[P,X,ke,q,le,be,je,oe,H,k,_,r]),M=v.useCallback(function(F){F.stopPropagation()},[]),K=v.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=F.refKey,ce=W===void 0?"ref":W,me=F.onChange,_e=F.onClick,et=fu(F,WF),it=yh({accept:D,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:ue(Xn(me,H)),onClick:ue(Xn(_e,M)),tabIndex:-1},ce,N);return Qe(Qe({},it),et)}},[N,n,a,H,r]);return Qe(Qe({},j),{},{isFocused:R&&!r,getRootProps:pe,getInputProps:K,rootRef:P,inputRef:N,open:ue(se)})}function t8(e,t){switch(t.type){case"focus":return Qe(Qe({},e),{},{isFocused:!0});case"blur":return Qe(Qe({},e),{},{isFocused:!1});case"openDialog":return Qe(Qe({},xh),{},{isFileDialogActive:!0});case"closeDialog":return Qe(Qe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Qe(Qe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Qe(Qe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Qe({},xh);default:return e}}function Vx(){}const l2=5*1024*1024,To={"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"]},Ux=Object.values(To).flat();function n8(e){var r;if(e.size>l2)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(To).includes(e.type)||Ux.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Ux.join(", ")}`}}function pu(e){for(const t of e){const n=n8(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function c2({onDrop:e}){const t=n=>{const r=pu(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(yl,{onDrop:t,accept:Object.keys(To).reduce((n,r)=>(n[r]=To[r],n),{}),maxSize:l2,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(eF,{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"})]})]})})})}c2.Button=({onDrop:e})=>{const t=Ee(),n=r=>{const i=pu(r);if(!i.isValid){on({description:i.error,variant:"error"});return}e(r)};return f.jsx(yl,{onDrop:n,accept:Object.keys(To).reduce((r,i)=>(r[i]=To[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(nF,{style:{color:t.getColor(w.IconColor)},className:"size-5"})]})})};function u2(e){const t=Number.parseFloat(globalThis.getComputedStyle(document.documentElement).fontSize)||16,n=t*3,r=t*6;return e.style.height="auto",`${Math.min(Math.max(e.scrollHeight,n),r)}px`}const Hx=[{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 d2({onSelect:e,isOpen:t,onClose:n}){const r=Ee(),[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(Nr,{children:t&&f.jsxs(Oe.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(w.Background),border:`1px solid ${r.getColor(w.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(w.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(w.DividerColor)}`},children:Hx.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(w.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:Hx[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(w.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${c}`))})]})})}const Wx=2;function r8({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=vr(),u=I4(t),p=Ee(),h=Oo(),{setIsInputFocused:x,showActionButtons:b,setShowActionButtons:S}=Z(),[m,g]=v.useState(""),[y,C]=v.useState("3rem"),[k,_]=v.useState(!1),[E,A]=v.useState([]),[V,D]=v.useState(0),[I,O]=v.useState(!1),[$,P]=v.useState(0),[N,L]=v.useState(null),[B,j]=v.useState(!1),z=()=>{if(!a||!l||l.status!==an.Closed||!l.closed_at)return!1;const oe=new Date(l.closed_at);return(new Date().getTime()-oe.getTime())/(1e3*60*60)>2},R=a&&(l==null?void 0:l.status)===an.Closed&&z();v.useEffect(()=>{if(r.length>0){const oe=r[r.length-1];oe.id!==N&&(L(oe.id),oe.sender_type===ve.User&&(D(0),O(!1)))}},[r,N]),v.useEffect(()=>{let oe;return I&&$>0&&(oe=window.setTimeout(()=>{P(ae=>ae<=1?(O(!1),D(0),0):ae-1)},1e3)),()=>clearTimeout(oe)},[I,$]),v.useEffect(()=>{const oe=c.current;if(oe){const ae=()=>x(!0),H=()=>x(!1);return oe.addEventListener("focus",ae),oe.addEventListener("blur",H),()=>{oe.removeEventListener("focus",ae),oe.removeEventListener("blur",H)}}},[x]),v.useEffect(()=>{const oe=()=>{S(!0)},ae=()=>{S(!1)};return d==null||d.on(xe.ChatUserShowButton,oe),d==null||d.on(xe.MessageUserCreate,ae),()=>{d==null||d.off(xe.ChatUserShowButton,oe),d==null||d.off(xe.MessageUserCreate,ae)}},[d,S]),v.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&S(!1)},[r,S]),cu("lc:rate-limit",oe=>{const ae=oe.detail&&oe.detail.seconds||3;O(!0),P(ae),D(0)}),cu("paste",oe=>{const ae=oe.clipboardData.items,H=[];for(const se of ae){const X=se.getAsFile();X&&H.push(X)}if(H.length>0&&!n){on({description:h(re.FileUploadDisabled),variant:"error"});return}if(H.length>0){const se=pu(H);if(!se.isValid){on({description:se.error,variant:"error"});return}A([...E,...H])}});const G=async()=>{const oe=m.trim(),ae=!!n&&E.length>0,H=oe.length>0&&oe.length<Wx;if(!oe&&!ae||H)return;if(V>5&&!I){O(!0),P(3);return}if(I||k)return;const se=m,X=[...E];g(""),A([]),c.current&&(c.current.style.height="3rem",C("3rem")),_(!0);let ke;if(n&&X.length>0){const[q,le]=await u.mutateAsync(X);if(!Gn(le)){mj(q,le),_(!1),g(se),A(X);return}L4(q)&&(ke=q.file_urls)}if(o){o(se,ke),_(!1);return}d==null||d.emit(qe.MessageCreate,{content:se,files:ke},q=>{e(q),_(!1),D(le=>le+1),S(!1)})},J=(m.trim().length>=Wx||E.length>0)&&!k&&!I,ie=oe=>{d==null||d.emit(qe.MessageTyping,{content:oe})},ge=()=>{d==null||d.emit(qe.ChatClose,{}),S(!1),i==null||i()},te=()=>{d==null||d.emit(qe.ChatClose,{}),S(!1),s==null||s()},be=v.useCallback(oe=>{const ae=c.current;if(ae){const H=ae.selectionStart,se=ae.selectionEnd,X=m.substring(0,H)+oe+m.substring(se);X.length<=2e3&&(g(X),ie(X),setTimeout(()=>{ae.selectionStart=ae.selectionEnd=H+oe.length,ae.focus()},0))}else{const H=m+oe;H.length<=2e3&&(g(H),ie(H))}},[m]),je=a&&(l==null?void 0:l.status)===an.Closed;return R?null:f.jsxs(f.Fragment,{children:[je&&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(w.InputBackground),borderColor:p.getColor(w.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(ee.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:p.getColor(w.FooterText)}}),f.jsx("span",{className:"text-sm",style:{color:p.getColor(w.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),f.jsxs(An,{size:"lg",onClick:()=>{s==null||s()},className:"rounded-lg gap-2 transition-all",children:[f.jsx(ee.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]}),f.jsx(Co,{variant:"block"})]}),I&&f.jsxs(Oe.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(w.ErrorBackground),borderColor:p.getColor(w.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(ee.XCircle,{className:"size-4 mr-2",style:{color:p.getColor(w.ErrorText)}}),f.jsx("span",{className:"text-sm font-medium",style:{color:p.getColor(w.ErrorText)},children:h(re.RateLimitMessage).replace("{seconds}",$.toString())})]}),b&&f.jsxs(Oe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex gap-2",children:[f.jsxs(An,{className:"flex-1 flex items-center justify-center gap-2",size:"md",variant:"primary",kind:"outline",onClick:ge,style:{borderColor:p.getColor(w.ButtonBackground),color:p.getColor(w.ButtonBackground),backgroundColor:"transparent"},children:[f.jsx(ee.Star,{className:"size-4"}),f.jsx("span",{children:"Değerlendir"})]}),f.jsxs(An,{size:"md",className:"flex-1 flex items-center justify-center gap-2",onClick:te,children:[f.jsx(ee.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet"})]})]}),(!a||a&&(l==null?void 0:l.status)!==an.Closed&&(l==null?void 0:l.status)!==an.Deleted)&&f.jsxs("form",{className:"flex flex-col relative",onSubmit:oe=>{oe.preventDefault(),G()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:p.getColor(w.DividerColor)}}),n&&E&&E.length>0&&f.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:f.jsx(HC,{files:E,onDelete:oe=>{A(E.filter((ae,H)=>H!==oe))}})}),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(sd,{id:"message",inputRef:c,className:"grow",noMargin:!0,borderless:!0,rows:1,autoComplete:"off",disabled:I,style:{height:y,maxHeight:"6rem",opacity:I?.5:1,cursor:I?"not-allowed":"text",boxShadow:"none"},placeholder:I?h(re.RateLimitMessage).replace("{seconds}",$.toString()):h(re.MessagePlaceholder),value:m,maxLength:2e3,onChange:oe=>{if(I)return;const ae=oe.target.value,H=oe.currentTarget;if(ae.length<=2e3&&(g(ae),ie(ae)),ae.length===0){H.style.height="3rem",C("3rem");return}const se=u2(H);H.style.height=se,C(se)},onKeyDown:oe=>{if(I){oe.preventDefault();return}oe.key==="Enter"&&!oe.shiftKey&&(oe.preventDefault(),G())}}),m.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:m.length>=2e3?p.getColor(w.ErrorText):p.getColor(w.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(Oe.div,{whileTap:{scale:.9},children:f.jsx(An,{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:!J,style:{opacity:1,color:J?p.getColor(w.ButtonBackground):p.getColor(w.FooterText)},children:k?f.jsx(ee.Spin,{className:"size-4 animate-spin"}):I?f.jsx("span",{className:"text-[10px] font-bold",children:$}):f.jsx(ee.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(d2,{isOpen:B,onClose:()=>j(!1),onSelect:be}),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:()=>j(!B),className:"p-1.5 rounded-md transition-colors",style:{color:p.getColor(w.IconColor)},children:f.jsx(ee.Emoji,{className:"size-5"})}),n&&f.jsx(c2.Button,{onDrop:oe=>{if(oe.length){const ae=pu(oe);if(!ae.isValid){on({description:ae.error,variant:"error"});return}A([...E,...oe])}}})]}),f.jsx(Co,{variant:"inline"})]})]})]})}const qx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function Gx({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=v.useMemo(()=>{const o=e.charCodeAt(0)||0,a=qx[o%qx.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return f.jsxs(Oe.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:Ne("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})]})]})}const Yx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]],Us=32;function i8({participant:e,className:t}){const n=v.useMemo(()=>{const r=e.name.charCodeAt(0)||0,i=Yx[r%Yx.length];return`linear-gradient(135deg, ${i[0]}, ${i[1]})`},[e.name]);return f.jsx("span",{title:e.name,className:Ne("block rounded-full border border-white/25 shadow-sm overflow-hidden",t),children:e.avatar?f.jsx("img",{className:"rounded-full object-cover",style:{width:Us,height:Us},src:e.avatar,alt:"",title:e.name}):f.jsx("div",{className:"flex items-center justify-center font-semibold text-white text-xs",style:{width:Us,height:Us,background:n},children:e.name.charAt(0).toUpperCase()})})}const vf=3;function Qx({participants:e,textColor:t,className:n}){const r=v.useMemo(()=>e.map(l=>l.name).join(", "),[e]);if(e.length===0)return null;const i=e.length>vf,s=i?e.slice(0,vf-1):e,o=i?e.length-(vf-1):0,a=e[0];return f.jsxs("div",{className:Ne("group/participant relative inline-flex max-w-full",n),children:[f.jsxs(Oe.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center min-w-0 cursor-default",children:[f.jsx("div",{className:"flex items-center flex-shrink-0",children:f.jsxs("div",{className:"flex flex-row items-center -space-x-2",children:[s.map((l,c)=>f.jsx("div",{className:"relative",style:{zIndex:s.length-c},title:l.name,children:f.jsx(i8,{participant:l})},`${Gr(l)}-${c}`)),i?f.jsxs("div",{title:r,className:"relative flex items-center justify-center rounded-full border border-white/25 bg-black/25 text-xs font-semibold shadow-sm",style:{width:Us,height:Us,zIndex:0},children:["+",o]}):null]})}),f.jsx("div",{className:"flex flex-col min-w-0",children:f.jsx("span",{className:"line-clamp-1 font-medium text-neutral-500",style:t?{color:t}:void 0,title:a.name,children:a.name})})]}),f.jsx("div",{role:"tooltip",className:"pointer-events-none absolute left-0 top-full z-[100] mt-1 max-w-[min(280px,calc(100vw-2rem))] rounded-md px-2 py-1.5 text-xs font-normal leading-snug shadow-lg opacity-0 transition-opacity duration-150 group-hover/participant:opacity-100 bg-neutral-900 text-white border border-white/10",children:r})]})}function f2({className:e,sizePx:t=36,"aria-hidden":n=!0}){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1389 1350",width:t,height:t,className:Ne("shrink-0",e),"aria-hidden":n,focusable:"false",children:f.jsx("g",{transform:"translate(0,1350) scale(0.1,-0.1)",fill:"currentColor",stroke:"none",children:f.jsx("path",{d:"M6395 13484 c-630 -49 -1143 -142 -1678 -303 -589 -178 -1181 -458 -1687 -798 -786 -527 -1550 -1309 -2022 -2068 -697 -1122 -1053 -2468 -998 -3774 29 -689 123 -1222 336 -1905 204 -650 363 -1007 660 -1479 258 -410 531 -746 928 -1143 434 -433 838 -759 1271 -1025 906 -558 1911 -872 3100 -971 223 -18 798 -15 1030 6 1408 126 2688 653 3748 1541 440 368 859 810 1162 1223 33 45 63 81 68 82 4 0 296 -145 649 -321 354 -177 653 -322 666 -322 32 0 62 31 62 63 0 38 -1715 2749 -1750 2767 -33 17 -3703 19 -3747 2 -15 -5 -31 -16 -35 -22 -14 -22 -8 -74 10 -89 9 -9 329 -172 710 -362 380 -190 692 -350 692 -354 0 -18 -321 -322 -440 -417 -542 -433 -1157 -699 -1839 -795 -610 -87 -1281 -13 -1841 202 -58 22 -129 49 -159 59 -29 11 -99 43 -154 70 -87 44 -106 50 -140 45 -22 -4 -177 -65 -346 -137 -168 -72 -508 -216 -756 -319 -247 -104 -475 -200 -505 -214 -66 -31 -94 -32 -120 -6 -24 24 -26 67 -4 118 9 20 108 305 220 632 112 327 231 672 264 766 33 93 60 175 60 181 0 5 -22 39 -49 75 -28 36 -88 123 -134 194 -313 477 -507 1007 -584 1591 -26 198 -26 740 0 933 112 830 463 1561 1032 2148 613 633 1363 1009 2251 1129 189 25 735 25 924 0 812 -110 1495 -428 2097 -976 312 -284 621 -692 804 -1063 53 -107 67 -113 178 -73 185 67 2538 1039 2575 1063 39 26 41 31 40 75 0 39 -18 82 -98 245 -301 607 -678 1135 -1181 1650 -1165 1196 -2582 1886 -4225 2058 -147 15 -909 28 -1045 18z"})})})}function p2({color:e,borderColor:t,backgroundColor:n,sizePx:r=28}){return f.jsx("div",{className:"flex size-[46px] shrink-0 items-center justify-center overflow-hidden rounded-[14px] border border-solid",style:{borderColor:t,backgroundColor:n,color:e},"aria-hidden":!0,children:f.jsx(f2,{sizePx:r})})}function s8({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:x,isHaveChat:b,isInputFocused:S}=Z(),m=Z($=>$.historyChat),g=Ee(),y=Lo(),C=ld(),k=vr(),_=xs(),E=v.useRef(new Set),A=v.useRef(!1),V=()=>{h(!1)},D=v.useCallback(()=>{if(!k||!x||!b||!Array.isArray(r))return;const $=r.filter(P=>P.sender_type===ve.User&&!E.current.has(P.id)).map(P=>P.id);$.length!==0&&k.emit(qe.MessageRead,{message_ids:$},P=>{if(P&&P.success===!0)for(const N of $)E.current.add(N)})},[k,r,x,b]);v.useEffect(()=>{x&&(A.current=!0),x&&b&&(S||A.current)&&(D(),A.current=!1)},[x,b,S,D]);const I=()=>{var P,N,L,B;return((B=(L=(N=(P=p==null?void 0:p.appearance)==null?void 0:P.head)==null?void 0:N.elements)==null?void 0:L.find(j=>j.type==="title"))==null?void 0:B.content)||"Müşteri Hizmetleri"},O=()=>{var L,B,j,z,R,G,U,J;if(c&&m)return"Geçmiş sohbet";const $=((B=(L=e==null?void 0:e.participants)==null?void 0:L[0])==null?void 0:B.name)||(e==null?void 0:e.agent_name);if($)return $;const P=(z=(j=p==null?void 0:p.appearance)==null?void 0:j.design)==null?void 0:z.greeting_header;return P||((J=(U=(G=(R=p==null?void 0:p.appearance)==null?void 0:R.head)==null?void 0:G.elements)==null?void 0:U.find(ie=>ie.type==="text"))==null?void 0:J.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(w.HeaderBackground),color:g.getColor(w.HeaderText),borderColor:g.getColor(w.HeaderBorder),...y?{}:{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:()=>{Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),Z.getState().setShowHistoryOnRegistration(!0),_.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(ee.ArrowLeft,{className:"w-5 h-5"})}),(()=>{if(c&&m){const $=O6(m);if($.length>1)return f.jsx(Qx,{participants:$,textColor:g.getColor(w.HeaderText)});if($.length===1)return f.jsx(Gx,{name:$[0].name,avatar:$[0].avatar,textColor:g.getColor(w.HeaderText)})}if(!c&&e){const $=e.participants&&e.participants.length>0?e.participants:Pg(e.agent_name,e.agent_avatar);if($.length>1)return f.jsx(Qx,{participants:$,textColor:g.getColor(w.HeaderText)});if($.length===1)return f.jsx(Gx,{name:$[0].name,avatar:$[0].avatar,textColor:g.getColor(w.HeaderText)})}return f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[f.jsx(p2,{color:g.getColor(w.HeaderText),borderColor:g.getColor(w.HeaderBorder),backgroundColor:g.getColor(w.MessageAdminBackground)}),f.jsx("div",{className:"min-w-0 flex-1",children:c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"truncate font-medium",children:I()}),f.jsx("div",{className:"truncate text-sm opacity-90",children:O()})]}):f.jsx("div",{className:"truncate font-medium",children:O()})})]})})()]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!c||c&&(e==null?void 0:e.status)!==an.Closed)&&f.jsx(F6,{onChatClose:s}),C&&f.jsx("button",{type:"button",onClick:V,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(ee.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(qC,{messages:r,isTyping:t||n.length>0,chat:e,onLivechatSendSuggested:l?$=>l($):void 0}),f.jsx(Nr,{children:d&&f.jsxs(Oe.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(w.ErrorBackground),borderColor:g.getColor(w.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:g.getRadius()},children:[f.jsx(ee.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:g.getColor(w.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:g.getColor(w.ErrorText)},children:d}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:g.getColor(w.ErrorText)},children:f.jsx(ee.X,{className:"size-4"})})]})}),f.jsx(r8,{client_id:(p==null?void 0:p.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:$=>{i($)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c,historyChat:c?Z.getState().historyChat:void 0})]})}function o8({rating:e,onChange:t}){const n=Ee();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(Oe.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(w.StarInactiveColor),fill:n.getColor(w.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(w.StarActiveColor),fill:n.getColor(w.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(w.StarActiveColor),fill:n.getColor(w.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 a8({onOk:e}){const t=Ee(),n=Oo(),r=ld(),[i,s]=v.useState(0),[o,a]=v.useState(!1),[l,c]=v.useState(10),d=D4(),[u,p]=v.useState(!1);v.useEffect(()=>{if(o){const S=setInterval(()=>{c(m=>m<=1?(clearInterval(S),e(!0),0):m-1)},1e3);return()=>clearInterval(S)}},[o]);const h=pg({comment:au()}),x=kC({init:{comment:""},schema:h,action:async S=>{const[m,g]=await d.mutateAsync({rating:i,comment:S.comment});if(Gn(g)){a(!0);return}xo(m,{form:x})}}),b=()=>{e(!0)};return f.jsxs(Oe.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(w.HeaderBorder),color:t.getColor(w.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(w.HeaderText)},children:f.jsx(ee.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(w.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(w.HeaderText)},children:n(re.RatingThankYouTitle)}),f.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(w.FooterText)},children:n(re.RatingThankYouDescription)}),f.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(w.FooterText)},children:n(re.RatingCountdown).replace("{seconds}",l.toString())}),f.jsx(An,{onClick:b,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(w.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(w.RatingRateConversationText)},children:n(re.RatingRateConversation)}),f.jsx(o8,{rating:i,onChange:S=>{s(S),S>=1&&p(!1)}}),i>0&&f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(w.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(w.ErrorText)},children:n(re.RatingMinimumError)}):null]}),f.jsxs("form",{onSubmit:x.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(w.InputText)},children:n(re.RatingComment)}),f.jsx(sd,{id:"comment",onChange:x.handleChange,onBlur:x.handleBlur,value:x.values.comment,placeholder:n(re.RatingCommentPlaceholder),className:"rounded-lg",error:x.errors.comment})]}),f.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[f.jsx(An,{type:"submit",size:"lg",onClick:S=>{i<1&&(S.preventDefault(),S.stopPropagation(),p(!0))},className:"w-full",children:n(re.RatingSubmit)}),f.jsx(An,{onClick:b,size:"lg",variant:"secondary",kind:"subtle",className:"w-full",bgKey:w.GreeterBackground,textKey:w.GreeterText,children:n(re.RatingNewConversation)})]})]})]})}),f.jsx(Co,{variant:"block"})]})}function l8({onSendMessage:e,disabled:t,loading:n=!1}){const r=v.useRef(null),i=Ee(),s=Oo(),{setIsInputFocused:o}=Z(),[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 S;(S=r.current)==null||S.focus()},100),h.current=n},[n,t]),v.useEffect(()=>{t&&p(!1)},[t]);const x=()=>{if(!a.trim()||t)return;const S=a;l(""),r.current&&(r.current.style.height="3rem",d("3rem")),e(S)},b=v.useCallback(S=>{if(t)return;const m=r.current;if(m){const g=m.selectionStart,y=m.selectionEnd,C=a.substring(0,g)+S+a.substring(y);C.length<=2e3&&(l(C),setTimeout(()=>{m.selectionStart=m.selectionEnd=g+S.length,m.focus()},0))}else{const g=a+S;g.length<=2e3&&l(g)}},[a,t]);return f.jsxs("form",{className:"flex flex-col relative",onSubmit:S=>{S.preventDefault(),x()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:i.getColor(w.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(sd,{id:"ai-message",inputRef:r,className:"grow",noMargin:!0,borderless:!0,rows:1,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:S=>{if(t)return;const m=S.target.value,g=S.currentTarget;if(m.length<=2e3&&l(m),m.length===0){g.style.height="3rem",d("3rem");return}const y=u2(g);g.style.height=y,d(y)},onKeyDown:S=>{if(t){S.preventDefault();return}S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),x())}}),a.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:a.length>=2e3?i.getColor(w.ErrorText):i.getColor(w.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(Oe.div,{whileTap:{scale:.9},children:f.jsx(An,{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(w.ButtonBackground):i.getColor(w.FooterText)},children:n?f.jsx(ee.Spin,{className:"size-4 animate-spin"}):f.jsx(ee.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(d2,{isOpen:u,onClose:()=>p(!1),onSelect:b}),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(w.IconColor)},children:f.jsx(ee.Emoji,{className:"size-5"})})}),f.jsx(Co,{variant:"inline"})]})]})}const yf=[Be.Light,Be.Dark,Be.System];function c8(e){switch(e){case Be.Light:return ee.Sun;case Be.Dark:return ee.Moon;case Be.System:return ee.Monitor;default:return ee.Monitor}}function u8({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>VC()),a=v.useRef(null),l=v.useRef(null),c=Ee(),d=Oo(),{mode:u,setMode:p}=c,h=()=>e(),x=()=>{const m=yf.indexOf(u),g=yf[(m+1)%yf.length];p(g)},b=()=>{const m=!s;UC(m),o(m)};v.useEffect(()=>{if(!r)return;const m=g=>{var y,C;(y=l.current)!=null&&y.contains(g.target)||(C=a.current)!=null&&C.contains(g.target)||i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[r]);const S=r&&f.jsxs(Oe.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(w.Background),borderColor:c.getColor(w.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(w.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(w.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(ee.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(w.InputText)},onClick:b,children:[s?f.jsx(ee.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(ee.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(w.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(w.InputText)},onClick:x,children:[(()=>{const m=c8(u);return f.jsx(m,{className:"size-4 flex-shrink-0"})})(),u===Be.Light?"Açık tema":u===Be.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Nr,{children:t&&f.jsx(Oe.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(w.ModalOverlayColor)},children:f.jsxs(Oe.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(w.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(w.ChatCloseConfirmText)},children:d(re.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(w.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(w.GreeterBackground),color:c.getColor(w.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(w.ErrorBackground),color:c.getColor(w.ErrorText),borderRadius:c.getRadius()},onClick:h,children:d(re.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(w.HeaderText)},title:d(re.ChatSettings),"aria-expanded":r,children:f.jsx(ee.Menu,{className:"size-5"})}),f.jsx(Nr,{children:S})]})]})}async function d8(e,t,n,r){let i=Math.max(0,Math.min(t,e.length));n(e.slice(0,i));const s=e.length-i;if(s<=0)return;const l=Math.min(14e3,Math.max(900,s*18)),c=16,d=Math.max(1,Math.ceil(s*c/l));await new Promise((u,p)=>{const h=window.setInterval(()=>{if(r.aborted){window.clearInterval(h),p(new DOMException("aborted","AbortError"));return}i=Math.min(e.length,i+d),n(e.slice(0,i)),i>=e.length&&(window.clearInterval(h),u())},c)})}function f8({onOperatorConnected:e,onChatClose:t}){var H,se,X,ke;const{widget:n,setOpen:r,aiAgent:i,aiAgentMessages:s,addAIAgentMessage:o,setAIAgentMessages:a,aiAgentSessionId:l,setAIAgentSessionId:c,humanNeedRequested:d,setHumanNeedRequested:u,setIsAIAgentMode:p,setAIAgentRequestInFlight:h}=Z(),x=Ee(),b=Lo(),S=ld(),m=vr(),g=xs(),[y,C]=v.useState(!1),[k,_]=v.useState(!1),[E,A]=v.useState(!1),[V,D]=v.useState(!1),[I,O]=v.useState(""),[$,P]=v.useState(null),[N,L]=v.useState(!1),[B,j]=v.useState(0),[z,R]=v.useState(null),G=v.useRef(""),U=v.useRef(null),J=()=>{r(!1)},ie=()=>{u(!1),t()},ge=(((X=(se=(H=n==null?void 0:n.appearance)==null?void 0:H.body)==null?void 0:se.inputs)==null?void 0:X.length)||0)>0,te=v.useRef(!1),be=v.useRef(!1);v.useEffect(()=>{if(!i||te.current)return;if(s.length>0){te.current=!0;return}if(!m||!m.connected){const ue=setInterval(()=>{m&&m.connected&&(clearInterval(ue),q())},100),Se=setTimeout(()=>{clearInterval(ue),te.current||le()},3e3);return()=>{clearInterval(ue),clearTimeout(Se)}}q();function q(){te.current||!m||(te.current=!0,m.emit(qe.MessageList,{},ue=>{Array.isArray(ue)&&ue.length>0?a(ue):le()}))}function le(){if(!i)return;const ue={id:gc(),content:`Merhaba! Ben ${i.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:ve.User};o(ue)}},[m,i,s.length,a,o]),v.useEffect(()=>{if(y)if(I||$)_(!0);else{const q=setTimeout(()=>_(!0),1e3);return()=>clearTimeout(q)}else _(!1)},[y,I,$]),v.useEffect(()=>{if(B>0){const q=requestAnimationFrame(()=>j(0));return()=>cancelAnimationFrame(q)}},[B]),v.useEffect(()=>{if(!m)return;const q=({token:Y})=>{P(null),O(he=>{const pe=he+Y;return G.current=pe,pe})},le=Y=>{Y.message?P(Y.message):Y.status&&P(Y.status)},ue=Y=>{Y.repeat_count===3&&R(Y.message)},Se=()=>{t()};return m.on(xe.AgentMessageChunk,q),m.on(xe.AgentMessageStreamStatus,le),m.on(xe.AgentSpamWarning,ue),m.on(xe.AgentSpamBanned,Se),()=>{m.off(xe.AgentMessageChunk,q),m.off(xe.AgentMessageStreamStatus,le),m.off(xe.AgentSpamWarning,ue),m.off(xe.AgentSpamBanned,Se)}},[m,t]),v.useEffect(()=>{if(!m)return;const q=le=>{const ue=String(le._id??"");if(!ue)return;const Se=typeof le.content=="string"?le.content.trim():"";P(Y=>Y&&Se&&Y.trim()===Se?null:Y),a(Y=>{if(Y.some(pe=>pe.id===ue))return Y;const he={id:ue,content:le.content,created_at:le.created_at?new Date(le.created_at):new Date,files:le.files??[],sender_type:le.sender_type,answers:le.answers,reply_id:le.reply_id,buttons:le.buttons,post_followup:le.post_followup};return[...Y,he]})};return m.on(xe.MessageAgentCreate,q),()=>{m.off(xe.MessageAgentCreate,q)}},[m,a]);const je=v.useCallback((q,le)=>{var he;if(!n||!i||!m||d||E||be.current)return;(he=U.current)==null||he.abort(),be.current=!0,h(!0);const ue=`temp-${Date.now()}`,Se={id:ue,content:q,created_at:new Date,files:[],sender_type:ve.Customer};o(Se),O(""),G.current="",P(null),L(!0),C(!0),A(!0);const Y=l||Dr(n.link_id);m.emit(qe.AgentMessageCreate,{question:q,agent_id:i.id,session_id:Y,...le===!0?{skip_to_generation:!0}:{}},pe=>{var yr,gn;if(!pe||typeof pe=="object"&&"isError"in pe&&pe.isError===!0){be.current=!1,h(!1),(yr=U.current)==null||yr.abort(),L(!1),O(""),G.current="",P(null),C(!1),A(!1);const Fe=pe,Dt=Fe&&typeof Fe.error=="string"?Fe.error:null,Ht=(Fe&&"errorCode"in Fe&&typeof Fe.errorCode=="string"&&Fe.errorCode.trim()?Fe.errorCode.trim():null)??"ERR_WS_UNKNOWN",vn=Ht==="ERR_WS_TIMEOUT"||Dt==="Event handler timeout",xl=Ht==="ERR_CHAT_NOT_AGENT_MODE",Ss=Ht==="ERR_CHAT_CLOSED",Fo=Ht==="ERR_CHAT_NOT_FOUND",Ce=Dt&&Dt.trim().length>0?Dt.trim():null,ct={id:gc(),content:xl?"Sohbet artık yapay zeka asistanı modunda değil (örneğin canlı desteğe aktarıldı). Canlı destek görünümüne geçiriliyorsunuz.":vn?`Yanıt çok uzun sürdü; sohbet güncellenmiş olabilir. Sayfayı yenileyin veya tekrar deneyin. Hata kodu: ${Ht}`:Ss||Fo?Ce??(Ss?"Bu sohbet sona ermiş. Gerekirse yeni bir sohbet başlatın.":"Sohbet bulunamadı. Sayfayı yenileyip tekrar deneyin."):Ce??`Üzgünüm, bir hata oluştu. Hata kodu: ${Ht}. Bu kodu destek personeli ile paylaşabilirsiniz.`,created_at:new Date,files:[],sender_type:ve.System};if(a(mt=>mt.filter(It=>It.id!==ue).concat([ct])),xl){Z.getState().setIsHaveChat(!0),e(),Z.getState().clearAIAgentState();return}if(Ss||Fo){Z.getState().clearAIAgentState(),u(!0);return}u(!0);return}const K=pe;K.session_id&&c(K.session_id);const F=K.generation??"",W=K.agent_message,me=(typeof W.post_followup=="string"&&W.post_followup.trim()||void 0)??(typeof K.post_message=="string"&&K.post_message.trim()||void 0),_e={...W,id:String(W._id??W.id??gc()),created_at:W.created_at?new Date(W.created_at):new Date,post_followup:me},et=G.current;let it=0;F.startsWith(et)&&(it=et.length),(gn=U.current)==null||gn.abort();const Tt=new AbortController;U.current=Tt;const Ot=()=>{U.current===Tt&&(U.current=null),be.current=!1,h(!1),L(!1),O(""),G.current="",P(null),C(!1),A(!1),a(Fe=>Fe.some(Dt=>Dt.id===_e.id)?Fe:[...Fe,_e]),K.human_need&&u(!0)};if(it>=F.length){Ot();return}(async()=>{try{await d8(F,it,Fe=>{G.current=Fe,O(Fe)},Tt.signal),Ot()}catch{Tt.signal.aborted&&(be.current=!1,h(!1),L(!1),O(""),G.current="",P(null),U.current===Tt&&(U.current=null),a(Fe=>Fe.some(Dt=>Dt.id===_e.id)?Fe:[...Fe,_e]),K.human_need&&u(!0))}})()})},[n,i,d,E,m,l,o,a,c,u,e,h]),oe=v.useCallback(q=>{if(!m||V)return;D(!0);const le=()=>{m.emit(qe.AgentRequestHuman,{},ue=>{D(!1),ue!=null&&ue.success?(Z.getState().setIsHaveChat(!0),p(!1),u(!1),Z.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};q&&Object.keys(q).length>0?m.emit(qe.ChatUpdateInputs,{inputs:q},ue=>{ue!=null&&ue.success?le():(console.error("Failed to update chat inputs"),D(!1))}):le()},[m,V,p,u,e]),ae=()=>{ge?g.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:x.getColor(w.HeaderBackground),color:x.getColor(w.HeaderText),borderColor:x.getColor(w.HeaderBorder),...b?{}:{borderTopLeftRadius:x.getRadius(),borderTopRightRadius:x.getRadius()}},children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(ke=i.avatar)!=null&&ke.trim()?f.jsx("div",{className:"flex size-[46px] shrink-0 items-center justify-center overflow-hidden rounded-[14px] border border-solid",style:{borderColor:x.getColor(w.HeaderBorder),backgroundColor:x.getColor(w.MessageAdminBackground)},children:f.jsx("img",{src:i.avatar.trim(),alt:"",className:"size-full object-cover"})}):f.jsx(p2,{color:x.getColor(w.HeaderText),borderColor:x.getColor(w.HeaderBorder),backgroundColor:x.getColor(w.MessageAdminBackground)}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-medium",style:{color:x.getColor(w.HeaderText)},children:i.name}),f.jsx("div",{className:"line-clamp-1 text-xs opacity-75",style:{color:x.getColor(w.HeaderText)},children:"AI Asistan"})]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(u8,{onChatClose:ie}),S&&f.jsx("button",{type:"button",onClick:J,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(ee.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(qC,{messages:s,isTyping:k||y&&(!!I||!!$),streamingContent:N?I:void 0,streamingStatusText:N?$:void 0,onLivechatSendSuggested:je,skipAnimationForLastN:B}),f.jsx(Nr,{children:z&&f.jsxs(Oe.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:x.getColor(w.ErrorBackground),borderColor:x.getColor(w.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:x.getRadius()},children:[f.jsx(ee.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:x.getColor(w.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:x.getColor(w.ErrorText)},children:z}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>R(null),style:{color:x.getColor(w.ErrorText)},children:f.jsx(ee.X,{className:"size-4"})})]})}),d?f.jsx(Oe.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:x.getColor(w.Background)},children:f.jsx(Oe.div,{className:"relative w-full max-w-lg mx-auto overflow-hidden",style:{borderRadius:x.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:f.jsx(An,{onClick:ae,disabled:V,size:"lg",className:"w-full flex items-center justify-center gap-2",children:V?f.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):f.jsxs(f.Fragment,{children:[f.jsx(ee.User,{className:"w-5 h-5"}),f.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})}):f.jsx(l8,{onSendMessage:je,disabled:E,loading:E})]})]}):null}function p8({children:e}){const{widget:t}=Z();return t?f.jsx("section",{className:"h-full w-full relative",children:e}):null}function h8({children:e}){const t=vr(),n=xs(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=Z(),[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(xe.Connect,u),t.on(xe.Disconnect,p),t.connected?(a(!1),d.current=!0):t.connect(),()=>{t.off(xe.Connect,u),t.off(xe.Disconnect,p)}},[t,r,i,s,n]),i&&s||r?e:!t||l?(t||n.push("registration"),f.jsx(dh,{})):d.current&&!t.connected?f.jsx(dh,{}):o||!t.connected?f.jsx(zC,{}):e}function Kx(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 m8(){const e=H=>{if(!H||typeof H!="object")return!1;const se=String((H==null?void 0:H.error)||(H==null?void 0:H.message)||"").toLowerCase(),X=Number((H==null?void 0:H.status)||(H==null?void 0:H.statusCode)||0);return(H==null?void 0:H.retryAfter)!==void 0||X===429||/too\s+many|rate\s*limit|çok\s+fazla/.test(se)},t=H=>{const se=Number((H==null?void 0:H.retryAfter)??(H==null?void 0:H.seconds));return Number.isFinite(se)&&se>0?se:3},{widget:n,setOpen:r,setIsHaveChat:i,historyChat:s,setHistoryChat:o,historyMessages:a,setHistoryMessages:l,aiAgent:c,isAIAgentMode:d,clearAIAgentState:u}=Z(),p=Ee(),h=vr(),{connected:x,connectionReady:b}=h,S=ml(),m=xs(),g=Lo(),[y,C]=v.useState(null),[k,_]=v.useState([]),[E,A]=v.useState(!1),[V,D]=v.useState([]),[I,O]=v.useState(!1),$=ag(),P=v.useRef(!1),N=v.useRef(null),L=v.useRef(!1),[B,j]=v.useState(!1),[z,R]=v.useState(null);v.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:x,connectionReady:b,hasChat:!!y,chatViewEmitted:P.current})},[x,b,y]),v.useEffect(()=>{if(y||s||d){j(!1);return}const H=setTimeout(()=>{!y&&!s&&!d&&(console.warn("WS: Connection timeout reached in ChatDetailView"),j(!0))},1e4);return()=>clearTimeout(H)},[y,s,d]),v.useEffect(()=>{if(!s||!n)return;if(C({status:s.status,is_customer_uploadable:!1}),a){_(a);return}const H=Dr(n.link_id);$4(s._id,n.link_id,H).then(([se,X])=>{if(Gn(X)&&Array.isArray(se)){const ke=se.map(q=>({id:q._id,content:q.content,created_at:q.created_at,files:q.files,sender_type:q.sender_type,activity_type:q.activity_type,answers:q.answers,reply_id:q.reply_id,buttons:q.buttons}));_(ke),l(ke)}}).catch(se=>{console.error("Failed to load history messages",se)})},[s,n,a,l]),v.useLayoutEffect(()=>{if(!n||d||s)return;const H=Zn(n.link_id);H.isAgentMode&&H.agent&&(console.log("ChatDetailView: Recovering AI Agent state from localStorage"),Z.getState().setAIAgent(H.agent),Z.getState().setIsAIAgentMode(!0),H.sessionId&&Z.getState().setAIAgentSessionId(H.sessionId),H.humanNeedRequested&&Z.getState().setHumanNeedRequested(!0))},[n,d,s]);const G=async(H,se)=>{var Se;if(!n)return;if(!s){const Y=`temp-${Date.now()}`,he={id:Y,content:H,created_at:new Date,files:se||[],sender_type:ve.Customer,answers:[],reply_id:void 0,buttons:[]};_(pe=>[...pe,he]),h==null||h.emit(qe.MessageCreate,{content:H,files:se},pe=>{const M=Array.isArray(pe)?pe[0]:pe;if(M&&M.isError){_(F=>F.filter(W=>W.id!==Y));const K=e(M);K||xo(M),K&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(M)}}));return}_(K=>K.map(F=>F.id===Y?M:F))});return}const X={},ke=n.appearance;if((Se=ke==null?void 0:ke.body)!=null&&Se.inputs){for(const Y of ke.body.inputs)if(Y.required||Y.remember){const he=Xs(Y.name);he&&(X[Y.name]=he)}}const q=Z.getState().defaultValues;if(q){q.username&&(X.username=q.username),q.secret_data&&(X.secret_data=q.secret_data);for(const Y in q)X[Y]||(X[Y]=q[Y])}const[le,ue]=await $.mutateAsync({inputs:X,history:[],client_id:n.client_id,widget_id:n.link_id,device_id:Dr(n.link_id)});if(Gn(ue)){o(null),i(!0),le&&typeof le=="object"&&"customer_token"in le&&(Hn(lt.CustomerToken,le.customer_token,n.link_id),Hn(lt.CustomerRefreshToken,le.customer_refresh_token,n.link_id));let Y=0;const he=20,pe=`temp-${Date.now()}`,M={id:pe,content:H,created_at:new Date,files:se||[],sender_type:ve.Customer,answers:[],reply_id:void 0,buttons:[]};_(F=>[...F,M]);const K=setInterval(()=>{Y+=1,h!=null&&h.connected?(h.emit(qe.MessageCreate,{content:H,files:se},F=>{const W=Array.isArray(F)?F[0]:F;if(W&&W.isError){_(me=>me.filter(_e=>_e.id!==pe));const ce=e(W);ce||xo(W),ce&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(W)}}));return}_(ce=>ce.map(me=>me.id===pe?W:me))}),clearInterval(K)):Y>=he&&clearInterval(K)},200)}},U=H=>{!H&&!g&&r(!1),O(!0),ba((n==null?void 0:n.link_id)||""),i(!1),C(null),_([]),D([]),o(null),Z.getState().setHistoryMessages(null),Z.getState().setShowHistoryOnRegistration(!1),u(),vc(n.client_id,Zi(Xi(S),n.link_id)).then(()=>{h==null||h.disconnect(),m.push("registration")})},J=()=>{Z.getState().setMinimizedAssigneeName(null),y?(localStorage.setItem("showActionButtons","false"),C({...y,status:an.Closed})):U(!1)};v.useEffect(()=>{if(!h)return;const{isAIAgentMode:H,aiAgent:se}=Z.getState();if(!(H&&se)){if(s){P.current=!1,L.current=!1;return}if(!x||!b){x||(L.current=!1,P.current=!1,N.current=null);return}L.current=!0,!(!n||P.current)&&(P.current=!0,console.log("ChatView: Emitting chat:view request"),h.emit(qe.ChatView,{},X=>{if(console.log("ChatView: Received response",{chatReceived:X!==null,chatStatus:X==null?void 0:X.status,hasAgentName:!!(X!=null&&X.agent_name),hasError:X&&"error"in X}),Z.getState().historyChat){P.current=!1;return}if(X===null||X&&"error"in X||!(X!=null&&X.status)){console.log("ChatView returned invalid chat (null, error, or missing status), cleaning up and redirecting to registration",{chat:X}),r(!1),i(!1),vc(n.client_id,Zi(Xi(S),n.link_id)),_([]),D([]),o(null),Z.getState().setHistoryMessages(null),u(),ba((n==null?void 0:n.link_id)||""),h.disconnect(),m.push("registration"),P.current=!1;return}console.log("ChatView: Setting chat state",{status:X.status}),C(_x(X)),i(!0)}))}},[s,h,n,x,b,S,m,r,i,o,d,c,u]);const ie=()=>{J()},ge=()=>{U(!0)},[te,be]=v.useState(!1),je=v.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),P.current=!1,N.current=null,L.current=!1;const H=Z.getState().aiAgentMessages;H.length>0&&_(H),be(!0)},[]);v.useEffect(()=>{if(te){if(!h||!x||!b){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:x,connectionReady:b});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),P.current){be(!1);return}P.current=!0,h.emit(qe.ChatView,{},H=>{console.log("handleOperatorConnected: ChatView result",H),H&&!("error"in H)&&H.status?(C(_x(H)),i(!0),h.emit(qe.MessageList,{},X=>{console.log("handleOperatorConnected: MessageList result",X),Array.isArray(X)&&_(ke=>Kx(ke,X))})):(console.log("handleOperatorConnected: Invalid chat result, clearing state",H),i(!1)),be(!1)})}},[te,h,x,b,i]);const oe=()=>{u(),g||r(!1),O(!0),ba((n==null?void 0:n.link_id)||""),i(!1),C(null),_([]),D([]),o(null),Z.getState().setHistoryMessages(null),Z.getState().setShowHistoryOnRegistration(!1),vc(n.client_id,Zi(Xi(S),n.link_id)).then(()=>{h==null||h.disconnect(),m.push("registration")})},ae=v.useCallback(H=>{if(d&&c&&!s){const{aiAgentMessages:se,addAIAgentMessage:X}=Z.getState();if(se.some(ke=>ke.id===H.id))return;X(H);return}y&&![an.Closed,an.Deleted].includes(y.status)&&_(se=>{const X=se.filter(q=>{var le;return!((le=q.id)!=null&&le.startsWith("temp-")&&q.content===H.content)});return X.some(q=>q.id===H.id)?X:[...X,H]})},[y,d,c,s]);return v.useEffect(()=>{if(!h)return;const H=Y=>{const he={content:Y.content,created_at:Y.created_at,files:Y.files,id:Y._id,sender_type:Y.sender_type,answers:Y.answers,reply_id:Y.reply_id,buttons:Y.buttons,post_followup:Y.post_followup};if(V.length>0){D(pe=>[...pe,he]);return}Y.is_shortcut?D([he]):ae(he),A(!1)},se=Y=>{const he={content:Y.content,created_at:Y.created_at,files:Y.files,id:Y._id,sender_id:Y.sender_id,sender_type:Y.sender_type,activity_type:Y.activity_type,sender_name:Y.sender_name,answers:Y.answers,reply_id:Y.reply_id,buttons:Y.buttons};ae(he)},X=Y=>{!Y||!Y.name?C(he=>he?{...he,agent_name:void 0,agent_avatar:void 0,participants:[]}:null):C(he=>{if(!he)return null;const pe=P6(he.participants,{profile_id:Y.id,name:Y.name,avatar:Y.avatar}),M=oa(pe);return{...he,participants:pe,...M}})},ke=()=>{A(!0)},q=()=>{J()},le=({is_customer_uploadable:Y})=>{C(he=>he?{...he,is_customer_uploadable:Y}:null)},ue=Y=>{C(he=>{if(!he)return null;const pe=fh(he.participants,{profile_id:Y.profile_id});if(!Y.hasOtherAdmins||pe.length===0)return{...he,participants:[],agent_name:void 0,agent_avatar:void 0};const M=oa(pe);return{...he,participants:pe,...M}})},Se=Y=>{C(he=>{if(!he)return null;const pe=M6(he.participants,{profile_id:Y.profile_id,name:Y.name,avatar:Y.avatar}),M=oa(pe);return{...he,participants:pe,...M}})};return h.on(xe.MessageAgentCreate,H),h.on(xe.MessageUserCreate,se),h.on(xe.MessageCustomerCreate,se),h.on(xe.ChatUserAssignee,X),h.on(xe.MessageAgentTyping,ke),h.on(xe.ChatUserClose,q),h.on(xe.ChatToggleUpload,le),h.on(xe.ChatUserLeave,ue),h.on(xe.ChatUserJoin,Se),()=>{h.off(xe.MessageAgentCreate,H),h.off(xe.MessageUserCreate,se),h.off(xe.MessageCustomerCreate,se),h.off(xe.ChatUserAssignee,X),h.off(xe.MessageAgentTyping,ke),h.off(xe.ChatUserClose,q),h.off(xe.ChatToggleUpload,le),h.off(xe.ChatUserLeave,ue),h.off(xe.ChatUserJoin,Se)}},[ae,V]),v.useEffect(()=>{if(!h)return;const H=X=>{X.repeat_count===3&&R(X.message)},se=()=>{h.emit(qe.ChatClose,{}),Z.getState().setShowActionButtons(!1),J()};return h.on(xe.AgentSpamWarning,H),h.on(xe.AgentSpamBanned,se),()=>{h.off(xe.AgentSpamWarning,H),h.off(xe.AgentSpamBanned,se)}},[h,J]),v.useEffect(()=>{if(!h||!y||s){N.current=null;return}const H=`${y.status}-${y.agent_name||"no-agent"}`;N.current!==H&&(N.current=H,h.emit(qe.MessageList,{},se=>{if(!Array.isArray(se)){console.warn("MessageList response is not an array:",se),N.current=null;return}_(X=>Kx(X,se)),C(X=>{if(!X)return null;const ke=N6(se),q=ke.length>0?ke:X.participants&&X.participants.length>0?X.participants:Pg(X.agent_name,X.agent_avatar),le=oa(q);return{...X,participants:q,...le}})}))},[h,y,s]),v.useEffect(()=>{const H=setTimeout(()=>{A(!1)},2e3);return()=>clearTimeout(H)},[E]),v.useEffect(()=>{if(!n||V.length===0)return;let H=0;n.writing_timeout&&(H=[...V[0].content].length/n.writing_timeout,H<0&&(H=0));const se=setTimeout(()=>{ae(V[0]),D(V.slice(1))},H*1e3);return()=>clearTimeout(se)},[V,n]),I?f.jsx(dh,{}):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(w.Background)},children:f.jsx(f8,{onOperatorConnected:je,onChatClose:oe})})]}):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(w.Background)},children:y?y.status===an.Closed&&!s?f.jsx(a8,{onOk:U}):f.jsx(s8,{chat:y,isTyping:E,messages:k,shortcutMessages:V,onNewMessage:ae,onChatClose:J,onEvaluateChat:ie,onNewChat:ge,onSendMessage:G,isHistoryMode:!!s,spamWarningMessage:z,onDismissSpamWarning:()=>R(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(w.InputBorder)},children:f.jsx(ee.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:()=>U(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:p.getColor(w.ButtonBackground),color:p.getColor(w.ButtonText),borderRadius:p.getRadius()},children:"Tekrar Dene"})]}):f.jsx(zC,{})})]})}function g8(){return w6(),null}function v8(){return f.jsxs(h8,{children:[f.jsx(p8,{children:f.jsx(m8,{})}),f.jsx(g8,{})]})}const y8=[{path:"/chat",component:v8,name:"chat"}],h2=[...y8],m2=[...C6],x8=[...h2,...m2],w8=["Göktuğ","Rüzgar","Altan","Hamza","Caner"],b8="lc:tooltip:operator";function S8(){const e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function g2(){const e=w8;return e[Math.floor(Math.random()*e.length)]}function k8(e){const t=S8(),n=`${b8}:${e}`;try{const i=localStorage.getItem(n);if(i){const s=JSON.parse(i);if(s&&s.day===t&&typeof s.name=="string"&&s.name.length>0)return s.name}}catch{}const r=g2();try{localStorage.setItem(n,JSON.stringify({name:r,day:t}))}catch{}return r}function C8(e){return e==="light"?{balloon:"#ffffff",greeting:"#111111",sub:"#666666",close:"#bbbbbb",closeHoverBg:"rgba(0, 0, 0, 0.06)",title:"#4a3ff5",shadow:"0 8px 32px rgba(0, 0, 0, 0.22), 0 1px 6px rgba(0, 0, 0, 0.1)"}:{balloon:"#1e1e2e",greeting:"#f4f4f5",sub:"#a1a1aa",close:"#71717a",closeHoverBg:"rgba(255, 255, 255, 0.08)",title:"#4a3ff5",shadow:"0 8px 32px rgba(0, 0, 0, 0.45), 0 1px 6px rgba(0, 0, 0, 0.3)"}}function wh({text:e,assigneeName:t}){var m,g,y,C;const{widget:n,isHaveChat:r,isTooltipVisible:i,setIsTooltipVisible:s,onTooltipClose:o}=Z(),{texts:a,resolvedMode:l}=Ee(),c=v.useMemo(()=>C8(l),[l]),d=v.useMemo(()=>n!=null&&n.link_id?k8(n.link_id):g2(),[n==null?void 0:n.link_id]),{data:u,isSuccess:p,isError:h}=Nk(n==null?void 0:n.link_id),x=()=>{s(!1),o&&o()},{greetingLine:b,showSub:S}=v.useMemo(()=>{var V,D,I,O;if(e)return{greetingLine:e,showSub:!1};const k=t==null?void 0:t.trim();if(k)return{greetingLine:a[re.TooltipBalloonGreeting].replace(/\{name\}/g,k),showSub:!0};const _=(r?(D=(V=n==null?void 0:n.appearance)==null?void 0:V.design)==null?void 0:D.tooltip_message_active:(O=(I=n==null?void 0:n.appearance)==null?void 0:I.design)==null?void 0:O.tooltip_message)||"";if(h&&_)return{greetingLine:_,showSub:!0};const E=a[re.TooltipBalloonGreeting];let A="Chaty";return p&&u?A="Chaty":p&&u===null&&(A=d),{greetingLine:E.replace(/\{name\}/g,A),showSub:!0}},[e,t,a,r,(g=(m=n==null?void 0:n.appearance)==null?void 0:m.design)==null?void 0:g.tooltip_message,(C=(y=n==null?void 0:n.appearance)==null?void 0:y.design)==null?void 0:C.tooltip_message_active,h,p,u,d]);return i?f.jsxs(Oe.div,{initial:{opacity:0,y:12,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.97},transition:{duration:.3,ease:"easeOut"},className:Ne("absolute bottom-full right-0 z-10 mb-3 w-[260px]","px-[18px] pb-[18px] pt-4"),style:{borderRadius:"18px 18px 4px 18px",backgroundColor:c.balloon,boxShadow:c.shadow},children:[f.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[f.jsx("button",{type:"button",onClick:x,className:"shrink-0 rounded p-0.5 text-[13px] leading-none transition-colors",style:{color:c.close},onMouseEnter:k=>{k.currentTarget.style.color=l==="light"?"#555555":"#d4d4d8",k.currentTarget.style.backgroundColor=c.closeHoverBg},onMouseLeave:k=>{k.currentTarget.style.color=c.close,k.currentTarget.style.backgroundColor="transparent"},"aria-label":a[re.CloseButtonAria],children:f.jsx(ee.X,{className:"size-3.5","aria-hidden":!0})}),f.jsx("span",{className:"text-right text-[10px] font-bold uppercase tracking-[0.13em]",style:{color:c.title},children:a[re.TooltipBalloonTitle]})]}),f.jsx(Oe.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.05,duration:.25},className:"mb-1 text-[15px] font-bold leading-snug",style:{color:c.greeting},children:b}),S&&f.jsx("p",{className:"text-[13px] leading-normal",style:{color:c.sub},children:a[re.TooltipBalloonSub]}),f.jsx("div",{className:"pointer-events-none absolute h-2.5 w-[18px]",style:{bottom:"-9px",right:"38px",backgroundColor:c.balloon,clipPath:"polygon(0 0, 100% 0, 100% 100%)"},"aria-hidden":!0})]},"widget-tooltip"):null}function _8({label:e,onActivate:t}){return f.jsx("button",{type:"button",className:"chatier-minimized-unread-bubble",onClick:t,"aria-live":"polite",children:e})}function T8(e){return e.sender_type===ve.Activity||e.sender_type===ve.System?!1:e.sender_type===ve.Agent||e.sender_type===ve.User}function Xx({fallback:e,fallbackOpen:t,onOpenWidget:n}){const[r]=v.useState(window.document.title),i=vr(),{isHaveChat:s,open:o,soundPath:a,isTooltipVisible:l}=Z(),c=Z(_=>_.minimizedAssigneeName),d=Z(_=>_.setMinimizedAssigneeName),[u,p]=v.useState(!0),[h,x]=v.useState(0),[b,S]=v.useState(null),m=Oo(),g=v.useRef(new Set),y=()=>{I6(a)},C=(_,E)=>{if(b&&clearInterval(b),_||!s||E===0||Number.isNaN(E)){window.document.title=r,S(null);return}const A=setInterval(()=>{if(_||!s||E===0||Number.isNaN(E)){window.document.title=r,clearInterval(A),S(null);return}const D=`${m(re.MinimizedUnreadMessage).replace(/\{count\}/g,String(E))} - ${r}`;window.document.title!==D?window.document.title=D:window.document.title=r},1e3);return S(A),()=>{clearInterval(A),S(null)}};if(v.useEffect(()=>C(o&&u,h),[h,o,u]),v.useEffect(()=>{const _=()=>{p(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",_,!1),()=>{document.removeEventListener("visibilitychange",_)}},[]),v.useEffect(()=>{o&&(x(0),g.current.clear())},[o]),v.useEffect(()=>{s||d(null)},[s,d]),v.useEffect(()=>{if(!i||!s)return;const _=D=>{o||T8(D)&&(g.current.has(D._id)||(g.current.add(D._id),x(I=>I+1),y()))},E=D=>{var O;const I=(O=D.name)==null?void 0:O.trim();I&&d(I),y()},A=D=>{var P;if(!D.was_assigned)return;const I=Z.getState().minimizedAssigneeName;if(!D.hasOtherAdmins){d(null);return}const O=(P=D.name)==null?void 0:P.trim(),$=I==null?void 0:I.trim();O&&$&&O===$&&d(null)},V=()=>{d(null)};return i.on(xe.MessageAgentCreate,_),i.on(xe.ChatUserAssignee,E),i.on(xe.ChatUserLeave,A),i.on(xe.ChatUserClose,V),()=>{i.off(xe.MessageAgentCreate,_),i.off(xe.ChatUserAssignee,E),i.off(xe.ChatUserLeave,A),i.off(xe.ChatUserClose,V)}},[i,s,o,d]),o)return null;const k=h>0?m(re.MinimizedUnreadMessage).replace(/\{count\}/g,String(h)):"";if(s&&h>0)return f.jsx(_8,{label:k,onActivate:n});if(s&&l){const _=c==null?void 0:c.trim();return f.jsx(wh,{..._?{assigneeName:_}:{}})}return!s&&t?e:null}function Jl({onClick:e,buttonBackground:t,buttonText:n,haloBackground:r,glow:i,glow2:s,haloIdle:o,showClose:a,className:l,"aria-label":c}){const d=r??`color-mix(in srgb, ${t} 30%, transparent)`;return f.jsxs("button",{type:"button",className:Ne("chatier-blob-wrap relative flex size-[68px] shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent p-0 outline-none transition-transform duration-200 hover:scale-[1.06] active:scale-[0.95] focus-visible:ring-2 focus-visible:ring-offset-2",l),style:{"--chatier-blob":t,"--chatier-glow":i??"rgba(74, 63, 245, 0.55)","--chatier-glow2":s??"rgba(74, 63, 245, 0.22)","--chatier-halo-idle":o??"none",color:n},onClick:e,"aria-label":c??(a?"Sohbeti küçült":"Sohbeti aç"),children:[f.jsx("div",{className:"chatier-blob-halo chatier-blob-morph-rev pointer-events-none absolute -inset-[10px] rounded-full transition-shadow duration-300",style:{backgroundColor:d},"aria-hidden":!0}),f.jsx("div",{className:"chatier-blob-bg chatier-blob-morph pointer-events-none absolute inset-0 transition-shadow duration-300",style:{backgroundColor:t},"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 flex size-full items-center justify-center",children:[f.jsx(Oe.div,{className:"absolute flex items-center justify-center",initial:!1,animate:{opacity:a?0:1,scale:a?.5:1,rotate:a?90:0},transition:{duration:.22,ease:"easeOut"},children:f.jsx(f2,{sizePx:36,className:"text-current"})}),f.jsx(Oe.div,{className:"absolute flex items-center justify-center",initial:!1,animate:{opacity:a?1:0,scale:a?1:.5,rotate:a?0:-90},transition:{duration:.22,ease:"easeOut"},children:f.jsx(ee.X,{className:"size-7 text-current","aria-hidden":!0})})]})]})}function E8(e){return e==="light"?{background:"#ffffff",halo:"rgba(255, 255, 255, 0.22)",foreground:"#4a3ff5",glow:"rgba(255, 255, 255, 0.5)",glow2:"rgba(255, 255, 255, 0.2)",haloIdle:"0 0 28px rgba(255, 255, 255, 0.38), 0 0 12px rgba(255, 255, 255, 0.2)"}:{background:"#4a3ff5",halo:"rgba(74, 63, 245, 0.3)",foreground:"#ffffff",glow:"rgba(74, 63, 245, 0.55)",glow2:"rgba(74, 63, 245, 0.22)",haloIdle:"0 0 24px rgba(74, 63, 245, 0.42), 0 0 10px rgba(74, 63, 245, 0.22)"}}function A8({children:e,border:t}){var z,R,G,U;const n=vr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c,humanNeedRequested:d}=Z(),[u]=v.useState(!0),p=xs(),h=ml(),x=_m(),b=Ee(),{resolvedMode:S}=b,m=v.useMemo(()=>E8(S),[S]),g=v.useMemo(()=>({buttonBackground:m.background,haloBackground:m.halo,buttonText:m.foreground,glow:m.glow,glow2:m.glow2,haloIdle:m.haloIdle}),[m]),y=Lo(),C=y6(),[k,_]=v.useState({x:0,y:0}),E=YM(),A=v.useRef(null),V=v.useRef(null),[D,I]=v.useState(!1),[O,$]=v.useState(()=>r?"visible":"hidden");v.useEffect(()=>((()=>{I("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{I(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{I(!0)})}),[]),v.useEffect(()=>{o&&x.pathname==="/"&&h&&h.accessToken&&!d&&p.push("chat")},[o,x.pathname,h,p,d]),v.useEffect(()=>{r&&$("visible")},[r]);const P=J=>{if(!A.current||!V.current)return J;const ie=A.current.getBoundingClientRect(),ge={width:window.innerWidth,height:window.innerHeight},te={top:20,right:20,bottom:40,left:20};let be=J.x,je=J.y;return ie.right+be-k.x>ge.width-te.right&&(be=ge.width-te.right-ie.width-(ie.left-k.x)),ie.left+be-k.x<te.left&&(be=te.left-(ie.left-k.x)),ie.bottom+je-k.y>ge.height-te.bottom&&(je=ge.height-te.bottom-ie.height-(ie.top-k.y)),ie.top+je-k.y<te.top&&(je=te.top-(ie.top-k.y)),{x:be,y:je}},N=()=>{if(i(!0),!n)return;n.emit(qe.WidgetOpen,{});const{isAIAgentMode:J,aiAgentRequestInFlight:ie,setAIAgentMessages:ge}=Z.getState();J&&ie&&n.emit(qe.MessageList,{},te=>{Array.isArray(te)&&te.length>0&&ge(te)}),l&&l()},L=()=>{i(!1),n&&(n.emit(qe.WidgetClose,{}),c&&c())},B=()=>{i(!1),s(!1),vc(a.client_id,Zi(Xi(h),a.link_id)),p.push("registration")};v.useEffect(()=>{if(y&&(o||C)&&N(),!(!n||!a))return n.on(xe.Banned,B),()=>{n.off(xe.Banned,B)}},[]);function j(J){D&&E.start(J)}return f.jsxs("section",{className:"relative w-full h-full",ref:V,"data-theme":S,children:[f.jsx(Oe.div,{initial:!1,animate:{opacity:r?1:0,scale:r?1:.7,y:r?0:12},transition:r?{duration:.32,ease:[.34,1.56,.64,1]}:{duration:.22,ease:[.4,0,.2,1]},onAnimationComplete:()=>{Z.getState().open||$("hidden")},className:Ne("fixed z-300 overflow-hidden",{"":t&&!y,"bottom-32 right-10 rounded-xl":!y,"!bottom-0 !right-0":y}),style:{width:y?"100%":((R=(z=a==null?void 0:a.appearance)==null?void 0:z.design)==null?void 0:R.width)||"21rem",height:y?"var(--app-height, 100dvh)":((U=(G=a==null?void 0:a.appearance)==null?void 0:G.design)==null?void 0:U.height)||"30rem",left:y?"0":"",right:y?"0px !important":"",maxHeight:y?"var(--app-height, 100dvh)":"",boxShadow:y?"":`0 10px 25px -5px ${b.getColor(w.ShadowColor)}, 0 8px 10px -6px ${b.getColor(w.ShadowColor)}`,backgroundColor:b.getColor(w.Background),visibility:r?"visible":O,transformOrigin:y?"bottom center":"bottom right",pointerEvents:r?"auto":"none"},"aria-hidden":!r,children:e}),!D&&f.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[f.jsx(Xx,{fallback:f.jsx(wh,{}),fallbackOpen:u,onOpenWidget:N}),!r&&f.jsx(Jl,{...g,onClick:N,showClose:!1},"desktop-open-blob"),r&&!y&&f.jsx(Jl,{...g,onClick:L,showClose:!0},"desktop-close-blob")]}),D&&f.jsxs(Oe.div,{ref:A,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:k.x,y:k.y},drag:D,dragControls:E,dragMomentum:!1,dragElastic:0,onDragEnd:(J,ie)=>{const ge={x:k.x+ie.offset.x,y:k.y+ie.offset.y},te=P(ge);_(te)},children:[f.jsx(Xx,{fallback:f.jsx(wh,{}),fallbackOpen:u,onOpenWidget:N}),!r&&f.jsx("div",{className:"cursor-move",onPointerDown:j,children:f.jsx(Jl,{...g,onClick:N,showClose:!1})},"chat-button"),r&&!y&&f.jsx(Jl,{...g,onClick:L,showClose:!0},"touch-close-blob")]})]})}function j8(e){const{widget:t}=Z();return f.jsx(r4,{widget:t,children:f.jsx(A8,{...e})})}function R8(){const{isHaveChat:e,isAIAgentMode:t}=Z();return f.jsx(OA,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:f.jsx(j8,{border:!0,children:f.jsxs(IA,{children:[h2.map((n,r)=>f.jsx(_p,{path:n.path,element:f.jsx(n.component,{})},r)),m2.map((n,r)=>f.jsx(_p,{path:n.path,element:f.jsx(n.component,{})},r))]})})})}const M8="#4a3ff5";function P8(){const[e,t]=v.useState(()=>typeof window<"u"?Ay():"light");return v.useEffect(()=>{const n=()=>t(Ay()),r=window.matchMedia("(prefers-color-scheme: dark)");return r.addEventListener("change",n),window.addEventListener("storage",n),()=>{r.removeEventListener("change",n),window.removeEventListener("storage",n)}},[]),e}function N8(){const t=P8()==="dark",n=t?M8:"#ffffff",r=t?"rgba(74,63,245,0.55)":"rgba(255,255,255,0.4)",i=t?"rgba(74,63,245,0.4)":"rgba(255,255,255,0.3)";return f.jsxs("output",{className:"pointer-events-none fixed bottom-[40px] right-[20px] z-400 block","aria-live":"polite","aria-busy":"true",children:[f.jsx("span",{className:"sr-only",children:"Yükleniyor"}),f.jsxs("div",{className:"relative flex size-[68px] items-center justify-center",children:[f.jsx("div",{className:"chatier-loader-halo absolute size-14 rounded-full",style:{backgroundColor:i},"aria-hidden":!0}),f.jsx("div",{className:"chatier-loader-square size-8",style:{backgroundColor:n,boxShadow:`0 0 16px ${r}`},"aria-hidden":!0})]})]})}const O8=2e3,D8=v.forwardRef((e,t)=>{const n=localStorage.getItem("lc:device:id"),{data:r,isLoading:i,error:s}=BE(e.link_id,n||void 0),{widget:o,setWidget:a,setSoundPath:l,setDefaultValues:c,setOpen:d,setOnTooltipClose:u,setIsTooltipVisible:p,setOnOpen:h,setOnClose:x,onOpen:b,onClose:S}=Z(),m=v.useRef(null),[g,y]=v.useState(!0);return v.useEffect(()=>{if(i){m.current=Date.now(),y(!1);return}const k=m.current;if(k===null){y(!0);return}const _=Date.now()-k,E=Math.max(0,O8-_);if(E===0){m.current=null,y(!0);return}const A=window.setTimeout(()=>{m.current=null,y(!0)},E);return()=>window.clearTimeout(A)},[i]),v.useImperativeHandle(t,()=>({open:()=>{d(!0),b&&b()},close:()=>{d(!1),S&&S()}})),v.useEffect(()=>{r&&zE(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&&x(e.onClose)},[r,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),i||!g?f.jsx(N8,{}):s||!r||!o?null:f.jsx(lL,{children:f.jsx(v6,{children:f.jsx(R8,{})})})}),I8=new SE;let Zx=null;function L8(e){if(!e.container)return;const t=ne.createRef();return Zx=Sb(e.container),Zx.render(f.jsxs(EE,{client:I8,children:[f.jsx(D8,{...e,ref:t}),f.jsx(uj,{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=Dr(e.link_id);F4({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=L8});export default F8();
|
|
127
|
+
*/const tF=[["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"}]],nF=QC("paperclip",tF);var KC={exports:{}},rF="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",iF=rF,sF=iF;function XC(){}function ZC(){}ZC.resetWarningCache=XC;var oF=function(){function e(r,i,s,o,a,l){if(l!==sF){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:ZC,resetWarningCache:XC};return n.PropTypes=n,n};KC.exports=oF();var aF=KC.exports;const $e=Ir(aF);function ws(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 lF=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 _o(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=lF.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 uF=[".DS_Store","Thumbs.db"];function dF(e){return ws(this,void 0,void 0,function*(){return uu(e)&&fF(e.dataTransfer)?gF(e.dataTransfer,e.type):pF(e)?hF(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?mF(e):[]})}function fF(e){return uu(e)}function pF(e){return uu(e)&&uu(e.target)}function uu(e){return typeof e=="object"&&e!==null}function hF(e){return mh(e.target.files).map(t=>_o(t))}function mF(e){return ws(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>_o(n))})}function gF(e,t){return ws(this,void 0,void 0,function*(){if(e.items){const n=mh(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(vF));return Nx(JC(r))}return Nx(mh(e.files).map(n=>_o(n)))})}function Nx(e){return e.filter(t=>uF.indexOf(t.name)===-1)}function mh(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 vF(e){if(typeof e.webkitGetAsEntry!="function")return Ox(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?e2(t):Ox(e,t)}function JC(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?JC(n):[n]],[])}function Ox(e,t){return ws(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,_o(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return _o(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function yF(e){return ws(this,void 0,void 0,function*(){return e.isDirectory?e2(e):xF(e)})}function e2(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>ws(this,void 0,void 0,function*(){if(o.length){const a=Promise.all(o.map(yF));i.push(a),s()}else try{const a=yield Promise.all(i);n(a)}catch(a){r(a)}}),o=>{r(o)})}s()})}function xF(e){return ws(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=_o(r,e.fullPath);t(i)},r=>{n(r)})})})}var mf=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 Dx(e){return SF(e)||bF(e)||n2(e)||wF()}function wF(){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 bF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SF(e){if(Array.isArray(e))return gh(e)}function Ix(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 Lx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ix(Object(n),!0).forEach(function(r){t2(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ix(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tl(e,t){return _F(e)||CF(e,t)||n2(e,t)||kF()}function kF(){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 n2(e,t){if(e){if(typeof e=="string")return gh(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 gh(e,t)}}function gh(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 CF(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 _F(e){if(Array.isArray(e))return e}var TF=typeof mf=="function"?mf:mf.default,EF="file-invalid-type",AF="file-too-large",jF="file-too-small",RF="too-many-files",MF=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:EF,message:"File type must be ".concat(r)}},Fx=function(t){return{code:AF,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Bx=function(t){return{code:jF,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},PF={code:RF,message:"Too many files"};function r2(e,t){var n=e.type==="application/x-moz-file"||TF(e,t);return[n,n?null:MF(t)]}function i2(e,t,n){if(Ni(e.size))if(Ni(t)&&Ni(n)){if(e.size>n)return[!1,Fx(n)];if(e.size<t)return[!1,Bx(t)]}else{if(Ni(t)&&e.size<t)return[!1,Bx(t)];if(Ni(n)&&e.size>n)return[!1,Fx(n)]}return[!0,null]}function Ni(e){return e!=null}function NF(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=r2(l,n),d=tl(c,1),u=d[0],p=i2(l,r,i),h=tl(p,1),x=h[0],b=a?a(l):null;return u&&x&&!b})}function du(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Zl(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 $x(e){e.preventDefault()}function OF(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function DF(e){return e.indexOf("Edge/")!==-1}function IF(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return OF(e)||DF(e)}function Xn(){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!du(r)&&a&&a.apply(void 0,[r].concat(s)),du(r)})}}function LF(){return"showOpenFilePicker"in window}function FF(e){if(Ni(e)){var t=Object.entries(e).filter(function(n){var r=tl(n,2),i=r[0],s=r[1],o=!0;return s2(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(o2))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=tl(r,2),s=i[0],o=i[1];return Lx(Lx({},n),{},t2({},s,o))},{});return[{description:"Files",accept:t}]}return e}function BF(e){if(Ni(e))return Object.entries(e).reduce(function(t,n){var r=tl(n,2),i=r[0],s=r[1];return[].concat(Dx(t),[i],Dx(s))},[]).filter(function(t){return s2(t)||o2(t)}).join(",")}function $F(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function zF(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function s2(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function o2(e){return/^.*\.[\w]+$/.test(e)}var VF=["children"],UF=["open"],HF=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],WF=["refKey","onChange","onClick"];function qF(e){return QF(e)||YF(e)||a2(e)||GF()}function GF(){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 YF(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function QF(e){if(Array.isArray(e))return vh(e)}function gf(e,t){return ZF(e)||XF(e,t)||a2(e,t)||KF()}function KF(){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 a2(e,t){if(e){if(typeof e=="string")return vh(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 vh(e,t)}}function vh(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 XF(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 ZF(e){if(Array.isArray(e))return e}function zx(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 Qe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zx(Object(n),!0).forEach(function(r){yh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fu(e,t){if(e==null)return{};var n=JF(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 JF(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 yl=v.forwardRef(function(e,t){var n=e.children,r=fu(e,VF),i=e8(r),s=i.open,o=fu(i,UF);return v.useImperativeHandle(t,function(){return{open:s}},[s]),ne.createElement(v.Fragment,null,n(Qe(Qe({},o),{},{open:s})))});yl.displayName="Dropzone";var l2={disabled:!1,getFilesFromEvent:dF,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};yl.defaultProps=l2;yl.propTypes={children:$e.func,accept:$e.objectOf($e.arrayOf($e.string)),multiple:$e.bool,preventDropOnDocument:$e.bool,noClick:$e.bool,noKeyboard:$e.bool,noDrag:$e.bool,noDragEventsBubbling:$e.bool,minSize:$e.number,maxSize:$e.number,maxFiles:$e.number,disabled:$e.bool,getFilesFromEvent:$e.func,onFileDialogCancel:$e.func,onFileDialogOpen:$e.func,useFsAccessApi:$e.bool,autoFocus:$e.bool,onDragEnter:$e.func,onDragLeave:$e.func,onDragOver:$e.func,onDrop:$e.func,onDropAccepted:$e.func,onDropRejected:$e.func,onError:$e.func,validator:$e.func};var xh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function e8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Qe(Qe({},l2),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,x=t.onDropRejected,b=t.onFileDialogCancel,S=t.onFileDialogOpen,m=t.useFsAccessApi,g=t.autoFocus,y=t.preventDropOnDocument,k=t.noClick,C=t.noKeyboard,_=t.noDrag,E=t.noDragEventsBubbling,A=t.onError,$=t.validator,I=v.useMemo(function(){return BF(n)},[n]),D=v.useMemo(function(){return FF(n)},[n]),P=v.useMemo(function(){return typeof S=="function"?S:Vx},[S]),z=v.useMemo(function(){return typeof b=="function"?b:Vx},[b]),N=v.useRef(null),O=v.useRef(null),L=v.useReducer(t8,xh),B=gf(L,2),j=B[0],V=B[1],R=j.isFocused,G=j.isFileDialogActive,U=v.useRef(typeof window<"u"&&window.isSecureContext&&m&&LF()),J=function(){!U.current&&G&&setTimeout(function(){if(O.current){var W=O.current.files;W.length||(V({type:"closeDialog"}),z())}},300)};v.useEffect(function(){return window.addEventListener("focus",J,!1),function(){window.removeEventListener("focus",J,!1)}},[O,G,z,U]);var ie=v.useRef([]),ge=function(W){N.current&&N.current.contains(W.target)||(W.preventDefault(),ie.current=[])};v.useEffect(function(){return y&&(document.addEventListener("dragover",$x,!1),document.addEventListener("drop",ge,!1)),function(){y&&(document.removeEventListener("dragover",$x),document.removeEventListener("drop",ge))}},[N,y]),v.useEffect(function(){return!r&&g&&N.current&&N.current.focus(),function(){}},[N,g,r]);var te=v.useCallback(function(F){A?A(F):console.error(F)},[A]),be=v.useCallback(function(F){F.preventDefault(),F.persist(),he(F),ie.current=[].concat(qF(ie.current),[F.target]),Zl(F)&&Promise.resolve(i(F)).then(function(W){if(!(du(F)&&!E)){var ce=W.length,me=ce>0&&NF({files:W,accept:I,minSize:o,maxSize:s,multiple:a,maxFiles:l,validator:$}),_e=ce>0&&!me;V({isDragAccept:me,isDragReject:_e,isDragActive:!0,type:"setDraggedFiles"}),c&&c(F)}}).catch(function(W){return te(W)})},[i,c,te,E,I,o,s,a,l,$]),je=v.useCallback(function(F){F.preventDefault(),F.persist(),he(F);var W=Zl(F);if(W&&F.dataTransfer)try{F.dataTransfer.dropEffect="copy"}catch{}return W&&u&&u(F),!1},[u,E]),oe=v.useCallback(function(F){F.preventDefault(),F.persist(),he(F);var W=ie.current.filter(function(me){return N.current&&N.current.contains(me)}),ce=W.indexOf(F.target);ce!==-1&&W.splice(ce,1),ie.current=W,!(W.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Zl(F)&&d&&d(F))},[N,d,E]),ae=v.useCallback(function(F,W){var ce=[],me=[];F.forEach(function(_e){var et=r2(_e,I),it=gf(et,2),Tt=it[0],Ot=it[1],yr=i2(_e,o,s),gn=gf(yr,2),Fe=gn[0],Dt=gn[1],bs=$?$(_e):null;if(Tt&&Fe&&!bs)ce.push(_e);else{var Ht=[Ot,Dt];bs&&(Ht=Ht.concat(bs)),me.push({file:_e,errors:Ht.filter(function(vn){return vn})})}}),(!a&&ce.length>1||a&&l>=1&&ce.length>l)&&(ce.forEach(function(_e){me.push({file:_e,errors:[PF]})}),ce.splice(0)),V({acceptedFiles:ce,fileRejections:me,isDragReject:me.length>0,type:"setFiles"}),p&&p(ce,me,W),me.length>0&&x&&x(me,W),ce.length>0&&h&&h(ce,W)},[V,a,I,o,s,l,p,h,x,$]),H=v.useCallback(function(F){F.preventDefault(),F.persist(),he(F),ie.current=[],Zl(F)&&Promise.resolve(i(F)).then(function(W){du(F)&&!E||ae(W,F)}).catch(function(W){return te(W)}),V({type:"reset"})},[i,ae,te,E]),se=v.useCallback(function(){if(U.current){V({type:"openDialog"}),P();var F={multiple:a,types:D};window.showOpenFilePicker(F).then(function(W){return i(W)}).then(function(W){ae(W,null),V({type:"closeDialog"})}).catch(function(W){$F(W)?(z(W),V({type:"closeDialog"})):zF(W)?(U.current=!1,O.current?(O.current.value=null,O.current.click()):te(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."))):te(W)});return}O.current&&(V({type:"openDialog"}),P(),O.current.value=null,O.current.click())},[V,P,z,m,ae,te,D,a]),X=v.useCallback(function(F){!N.current||!N.current.isEqualNode(F.target)||(F.key===" "||F.key==="Enter"||F.keyCode===32||F.keyCode===13)&&(F.preventDefault(),se())},[N,se]),ke=v.useCallback(function(){V({type:"focus"})},[]),q=v.useCallback(function(){V({type:"blur"})},[]),le=v.useCallback(function(){k||(IF()?setTimeout(se,0):se())},[k,se]),ue=function(W){return r?null:W},Se=function(W){return C?null:ue(W)},Y=function(W){return _?null:ue(W)},he=function(W){E&&W.stopPropagation()},pe=v.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=F.refKey,ce=W===void 0?"ref":W,me=F.role,_e=F.onKeyDown,et=F.onFocus,it=F.onBlur,Tt=F.onClick,Ot=F.onDragEnter,yr=F.onDragOver,gn=F.onDragLeave,Fe=F.onDrop,Dt=fu(F,HF);return Qe(Qe(yh({onKeyDown:Se(Xn(_e,X)),onFocus:Se(Xn(et,ke)),onBlur:Se(Xn(it,q)),onClick:ue(Xn(Tt,le)),onDragEnter:Y(Xn(Ot,be)),onDragOver:Y(Xn(yr,je)),onDragLeave:Y(Xn(gn,oe)),onDrop:Y(Xn(Fe,H)),role:typeof me=="string"&&me!==""?me:"presentation"},ce,N),!r&&!C?{tabIndex:0}:{}),Dt)}},[N,X,ke,q,le,be,je,oe,H,C,_,r]),M=v.useCallback(function(F){F.stopPropagation()},[]),K=v.useMemo(function(){return function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},W=F.refKey,ce=W===void 0?"ref":W,me=F.onChange,_e=F.onClick,et=fu(F,WF),it=yh({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:ue(Xn(me,H)),onClick:ue(Xn(_e,M)),tabIndex:-1},ce,O);return Qe(Qe({},it),et)}},[O,n,a,H,r]);return Qe(Qe({},j),{},{isFocused:R&&!r,getRootProps:pe,getInputProps:K,rootRef:N,inputRef:O,open:ue(se)})}function t8(e,t){switch(t.type){case"focus":return Qe(Qe({},e),{},{isFocused:!0});case"blur":return Qe(Qe({},e),{},{isFocused:!1});case"openDialog":return Qe(Qe({},xh),{},{isFileDialogActive:!0});case"closeDialog":return Qe(Qe({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Qe(Qe({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Qe(Qe({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Qe({},xh);default:return e}}function Vx(){}const c2=5*1024*1024,To={"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"]},Ux=Object.values(To).flat();function n8(e){var r;if(e.size>c2)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(To).includes(e.type)||Ux.includes(t)?{isValid:!0,error:""}:{isValid:!1,error:`Desteklenmeyen dosya tipi. Kabul edilen tipler: ${Ux.join(", ")}`}}function pu(e){for(const t of e){const n=n8(t);if(!n.isValid)return n}return{isValid:!0,error:""}}function u2({onDrop:e}){const t=n=>{const r=pu(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(yl,{onDrop:t,accept:Object.keys(To).reduce((n,r)=>(n[r]=To[r],n),{}),maxSize:c2,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(eF,{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"})]})]})})})}u2.Button=({onDrop:e})=>{const t=Ee(),n=r=>{const i=pu(r);if(!i.isValid){on({description:i.error,variant:"error"});return}e(r)};return f.jsx(yl,{onDrop:n,accept:Object.keys(To).reduce((r,i)=>(r[i]=To[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(nF,{style:{color:t.getColor(w.IconColor)},className:"size-5"})]})})};function d2(e){const t=Number.parseFloat(globalThis.getComputedStyle(document.documentElement).fontSize)||16,n=t*3,r=t*6;return e.style.height="auto",`${Math.min(Math.max(e.scrollHeight,n),r)}px`}const Hx=[{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 f2({onSelect:e,isOpen:t,onClose:n}){const r=Ee(),[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(Nr,{children:t&&f.jsxs(Oe.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(w.Background),border:`1px solid ${r.getColor(w.Border)}`,borderRadius:r.getRadius(),boxShadow:`0 4px 20px ${r.getColor(w.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(w.DividerColor)}`},children:Hx.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(w.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:Hx[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(w.InputBackground)},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:l},`${l}-${c}`))})]})})}const Wx=2;function r8({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=vr(),u=L4(t),p=Ee(),h=Oo(),{setIsInputFocused:x,showActionButtons:b,setShowActionButtons:S}=Z(),[m,g]=v.useState(""),[y,k]=v.useState("3rem"),[C,_]=v.useState(!1),[E,A]=v.useState([]),[$,I]=v.useState(0),[D,P]=v.useState(!1),[z,N]=v.useState(0),[O,L]=v.useState(null),[B,j]=v.useState(!1),V=()=>{if(!a||!l||l.status!==an.Closed||!l.closed_at)return!1;const oe=new Date(l.closed_at);return(new Date().getTime()-oe.getTime())/(1e3*60*60)>2},R=a&&(l==null?void 0:l.status)===an.Closed&&V();v.useEffect(()=>{if(r.length>0){const oe=r[r.length-1];oe.id!==O&&(L(oe.id),oe.sender_type===ve.User&&(I(0),P(!1)))}},[r,O]),v.useEffect(()=>{let oe;return D&&z>0&&(oe=window.setTimeout(()=>{N(ae=>ae<=1?(P(!1),I(0),0):ae-1)},1e3)),()=>clearTimeout(oe)},[D,z]),v.useEffect(()=>{const oe=c.current;if(oe){const ae=()=>x(!0),H=()=>x(!1);return oe.addEventListener("focus",ae),oe.addEventListener("blur",H),()=>{oe.removeEventListener("focus",ae),oe.removeEventListener("blur",H)}}},[x]),v.useEffect(()=>{const oe=()=>{S(!0)},ae=()=>{S(!1)};return d==null||d.on(xe.ChatUserShowButton,oe),d==null||d.on(xe.MessageUserCreate,ae),()=>{d==null||d.off(xe.ChatUserShowButton,oe),d==null||d.off(xe.MessageUserCreate,ae)}},[d,S]),v.useEffect(()=>{r.length>0&&r[r.length-1].activity_type==="admin_join"&&S(!1)},[r,S]),cu("lc:rate-limit",oe=>{const ae=oe.detail&&oe.detail.seconds||3;P(!0),N(ae),I(0)}),cu("paste",oe=>{const ae=oe.clipboardData.items,H=[];for(const se of ae){const X=se.getAsFile();X&&H.push(X)}if(H.length>0&&!n){on({description:h(re.FileUploadDisabled),variant:"error"});return}if(H.length>0){const se=pu(H);if(!se.isValid){on({description:se.error,variant:"error"});return}A([...E,...H])}});const G=async()=>{const oe=m.trim(),ae=!!n&&E.length>0,H=oe.length>0&&oe.length<Wx;if(!oe&&!ae||H)return;if($>5&&!D){P(!0),N(3);return}if(D||C)return;const se=m,X=[...E];g(""),A([]),c.current&&(c.current.style.height="3rem",k("3rem")),_(!0);let ke;if(n&&X.length>0){const[q,le]=await u.mutateAsync(X);if(!Gn(le)){gj(q,le),_(!1),g(se),A(X);return}F4(q)&&(ke=q.file_urls)}if(o){o(se,ke),_(!1);return}d==null||d.emit(qe.MessageCreate,{content:se,files:ke},q=>{e(q),_(!1),I(le=>le+1),S(!1)})},J=(m.trim().length>=Wx||E.length>0)&&!C&&!D,ie=oe=>{d==null||d.emit(qe.MessageTyping,{content:oe})},ge=()=>{d==null||d.emit(qe.ChatClose,{}),S(!1),i==null||i()},te=()=>{d==null||d.emit(qe.ChatClose,{}),S(!1),s==null||s()},be=v.useCallback(oe=>{const ae=c.current;if(ae){const H=ae.selectionStart,se=ae.selectionEnd,X=m.substring(0,H)+oe+m.substring(se);X.length<=2e3&&(g(X),ie(X),setTimeout(()=>{ae.selectionStart=ae.selectionEnd=H+oe.length,ae.focus()},0))}else{const H=m+oe;H.length<=2e3&&(g(H),ie(H))}},[m]),je=a&&(l==null?void 0:l.status)===an.Closed;return R?null:f.jsxs(f.Fragment,{children:[je&&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(w.InputBackground),borderColor:p.getColor(w.InputBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(ee.Lock,{className:"w-5 h-5 flex-shrink-0",style:{color:p.getColor(w.FooterText)}}),f.jsx("span",{className:"text-sm",style:{color:p.getColor(w.FooterText)},children:"Bu sohbet kapatılmıştır."})]}),f.jsxs(An,{size:"lg",onClick:()=>{s==null||s()},className:"rounded-lg gap-2 transition-all",children:[f.jsx(ee.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet Başlat"})]}),f.jsx(Co,{variant:"block"})]}),D&&f.jsxs(Oe.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(w.ErrorBackground),borderColor:p.getColor(w.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:p.getRadius()},children:[f.jsx(ee.XCircle,{className:"size-4 mr-2",style:{color:p.getColor(w.ErrorText)}}),f.jsx("span",{className:"text-sm font-medium",style:{color:p.getColor(w.ErrorText)},children:h(re.RateLimitMessage).replace("{seconds}",z.toString())})]}),b&&f.jsxs(Oe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"mb-2 mx-3 flex gap-2",children:[f.jsxs(An,{className:"flex-1 flex items-center justify-center gap-2",size:"md",variant:"primary",kind:"outline",onClick:ge,style:{borderColor:p.getColor(w.ButtonBackground),color:p.getColor(w.ButtonBackground),backgroundColor:"transparent"},children:[f.jsx(ee.Star,{className:"size-4"}),f.jsx("span",{children:"Değerlendir"})]}),f.jsxs(An,{size:"md",className:"flex-1 flex items-center justify-center gap-2",onClick:te,children:[f.jsx(ee.Plus,{className:"size-4"}),f.jsx("span",{children:"Yeni Sohbet"})]})]}),(!a||a&&(l==null?void 0:l.status)!==an.Closed&&(l==null?void 0:l.status)!==an.Deleted)&&f.jsxs("form",{className:"flex flex-col relative",onSubmit:oe=>{oe.preventDefault(),G()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:p.getColor(w.DividerColor)}}),n&&E&&E.length>0&&f.jsx("div",{className:"px-3 pt-2 overflow-x-auto",children:f.jsx(WC,{files:E,onDelete:oe=>{A(E.filter((ae,H)=>H!==oe))}})}),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(sd,{id:"message",inputRef:c,className:"grow",noMargin:!0,borderless:!0,rows:1,autoComplete:"off",disabled:D,style:{height:y,maxHeight:"6rem",opacity:D?.5:1,cursor:D?"not-allowed":"text",boxShadow:"none"},placeholder:D?h(re.RateLimitMessage).replace("{seconds}",z.toString()):h(re.MessagePlaceholder),value:m,maxLength:2e3,onChange:oe=>{if(D)return;const ae=oe.target.value,H=oe.currentTarget;if(ae.length<=2e3&&(g(ae),ie(ae)),ae.length===0){H.style.height="3rem",k("3rem");return}const se=d2(H);H.style.height=se,k(se)},onKeyDown:oe=>{if(D){oe.preventDefault();return}oe.key==="Enter"&&!oe.shiftKey&&(oe.preventDefault(),G())}}),m.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:m.length>=2e3?p.getColor(w.ErrorText):p.getColor(w.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(Oe.div,{whileTap:{scale:.9},children:f.jsx(An,{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:!J,style:{opacity:1,color:J?p.getColor(w.ButtonBackground):p.getColor(w.FooterText)},children:C?f.jsx(ee.Spin,{className:"size-4 animate-spin"}):D?f.jsx("span",{className:"text-[10px] font-bold",children:z}):f.jsx(ee.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(f2,{isOpen:B,onClose:()=>j(!1),onSelect:be}),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:()=>j(!B),className:"p-1.5 rounded-md transition-colors",style:{color:p.getColor(w.IconColor)},children:f.jsx(ee.Emoji,{className:"size-5"})}),n&&f.jsx(u2.Button,{onDrop:oe=>{if(oe.length){const ae=pu(oe);if(!ae.isValid){on({description:ae.error,variant:"error"});return}A([...E,...oe])}}})]}),f.jsx(Co,{variant:"inline"})]})]})]})}const qx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]];function Gx({name:e,avatar:t,className:n="text-neutral-500",textColor:r,subtitle:i}){const s=v.useMemo(()=>{const o=e.charCodeAt(0)||0,a=qx[o%qx.length];return`linear-gradient(135deg, ${a[0]}, ${a[1]})`},[e]);return f.jsxs(Oe.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:Ne("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})]})]})}const Yx=[["#6366f1","#8b5cf6"],["#3b82f6","#06b6d4"],["#10b981","#34d399"],["#f59e0b","#f97316"],["#ef4444","#f472b6"],["#8b5cf6","#ec4899"],["#14b8a6","#22d3ee"],["#f43f5e","#fb923c"]],Us=32;function i8({participant:e,className:t}){const n=v.useMemo(()=>{const r=e.name.charCodeAt(0)||0,i=Yx[r%Yx.length];return`linear-gradient(135deg, ${i[0]}, ${i[1]})`},[e.name]);return f.jsx("span",{title:e.name,className:Ne("block rounded-full border border-white/25 shadow-sm overflow-hidden",t),children:e.avatar?f.jsx("img",{className:"rounded-full object-cover",style:{width:Us,height:Us},src:e.avatar,alt:"",title:e.name}):f.jsx("div",{className:"flex items-center justify-center font-semibold text-white text-xs",style:{width:Us,height:Us,background:n},children:e.name.charAt(0).toUpperCase()})})}const vf=3;function Qx({participants:e,textColor:t,className:n}){const r=v.useMemo(()=>e.map(l=>l.name).join(", "),[e]);if(e.length===0)return null;const i=e.length>vf,s=i?e.slice(0,vf-1):e,o=i?e.length-(vf-1):0,a=e[0];return f.jsxs("div",{className:Ne("group/participant relative inline-flex max-w-full",n),children:[f.jsxs(Oe.div,{initial:{opacity:.8},animate:{opacity:1},className:"flex gap-2 items-center min-w-0 cursor-default",children:[f.jsx("div",{className:"flex items-center flex-shrink-0",children:f.jsxs("div",{className:"flex flex-row items-center -space-x-2",children:[s.map((l,c)=>f.jsx("div",{className:"relative",style:{zIndex:s.length-c},title:l.name,children:f.jsx(i8,{participant:l})},`${Gr(l)}-${c}`)),i?f.jsxs("div",{title:r,className:"relative flex items-center justify-center rounded-full border border-white/25 bg-black/25 text-xs font-semibold shadow-sm",style:{width:Us,height:Us,zIndex:0},children:["+",o]}):null]})}),f.jsx("div",{className:"flex flex-col min-w-0",children:f.jsx("span",{className:"line-clamp-1 font-medium text-neutral-500",style:t?{color:t}:void 0,title:a.name,children:a.name})})]}),f.jsx("div",{role:"tooltip",className:"pointer-events-none absolute left-0 top-full z-[100] mt-1 max-w-[min(280px,calc(100vw-2rem))] rounded-md px-2 py-1.5 text-xs font-normal leading-snug shadow-lg opacity-0 transition-opacity duration-150 group-hover/participant:opacity-100 bg-neutral-900 text-white border border-white/10",children:r})]})}function p2({className:e,sizePx:t=36,"aria-hidden":n=!0}){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1389 1350",width:t,height:t,className:Ne("shrink-0",e),"aria-hidden":n,focusable:"false",children:f.jsx("g",{transform:"translate(0,1350) scale(0.1,-0.1)",fill:"currentColor",stroke:"none",children:f.jsx("path",{d:"M6395 13484 c-630 -49 -1143 -142 -1678 -303 -589 -178 -1181 -458 -1687 -798 -786 -527 -1550 -1309 -2022 -2068 -697 -1122 -1053 -2468 -998 -3774 29 -689 123 -1222 336 -1905 204 -650 363 -1007 660 -1479 258 -410 531 -746 928 -1143 434 -433 838 -759 1271 -1025 906 -558 1911 -872 3100 -971 223 -18 798 -15 1030 6 1408 126 2688 653 3748 1541 440 368 859 810 1162 1223 33 45 63 81 68 82 4 0 296 -145 649 -321 354 -177 653 -322 666 -322 32 0 62 31 62 63 0 38 -1715 2749 -1750 2767 -33 17 -3703 19 -3747 2 -15 -5 -31 -16 -35 -22 -14 -22 -8 -74 10 -89 9 -9 329 -172 710 -362 380 -190 692 -350 692 -354 0 -18 -321 -322 -440 -417 -542 -433 -1157 -699 -1839 -795 -610 -87 -1281 -13 -1841 202 -58 22 -129 49 -159 59 -29 11 -99 43 -154 70 -87 44 -106 50 -140 45 -22 -4 -177 -65 -346 -137 -168 -72 -508 -216 -756 -319 -247 -104 -475 -200 -505 -214 -66 -31 -94 -32 -120 -6 -24 24 -26 67 -4 118 9 20 108 305 220 632 112 327 231 672 264 766 33 93 60 175 60 181 0 5 -22 39 -49 75 -28 36 -88 123 -134 194 -313 477 -507 1007 -584 1591 -26 198 -26 740 0 933 112 830 463 1561 1032 2148 613 633 1363 1009 2251 1129 189 25 735 25 924 0 812 -110 1495 -428 2097 -976 312 -284 621 -692 804 -1063 53 -107 67 -113 178 -73 185 67 2538 1039 2575 1063 39 26 41 31 40 75 0 39 -18 82 -98 245 -301 607 -678 1135 -1181 1650 -1165 1196 -2582 1886 -4225 2058 -147 15 -909 28 -1045 18z"})})})}function h2({color:e,borderColor:t,backgroundColor:n,sizePx:r=28}){return f.jsx("div",{className:"flex size-[46px] shrink-0 items-center justify-center overflow-hidden rounded-[14px] border border-solid",style:{borderColor:t,backgroundColor:n,color:e},"aria-hidden":!0,children:f.jsx(p2,{sizePx:r})})}function s8({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:x,isHaveChat:b,isInputFocused:S}=Z(),m=Z(z=>z.historyChat),g=Ee(),y=Lo(),k=ld(),C=vr(),_=xs(),E=v.useRef(new Set),A=v.useRef(!1),$=()=>{h(!1)},I=v.useCallback(()=>{if(!C||!x||!b||!Array.isArray(r))return;const z=r.filter(N=>N.sender_type===ve.User&&!E.current.has(N.id)).map(N=>N.id);z.length!==0&&C.emit(qe.MessageRead,{message_ids:z},N=>{if(N&&N.success===!0)for(const O of z)E.current.add(O)})},[C,r,x,b]);v.useEffect(()=>{x&&(A.current=!0),x&&b&&(S||A.current)&&(I(),A.current=!1)},[x,b,S,I]);const D=()=>{var N,O,L,B;return((B=(L=(O=(N=p==null?void 0:p.appearance)==null?void 0:N.head)==null?void 0:O.elements)==null?void 0:L.find(j=>j.type==="title"))==null?void 0:B.content)||"Müşteri Hizmetleri"},P=()=>{var L,B,j,V,R,G,U,J;if(c&&m)return"Geçmiş sohbet";const z=((B=(L=e==null?void 0:e.participants)==null?void 0:L[0])==null?void 0:B.name)||(e==null?void 0:e.agent_name);if(z)return z;const N=(V=(j=p==null?void 0:p.appearance)==null?void 0:j.design)==null?void 0:V.greeting_header;return N||((J=(U=(G=(R=p==null?void 0:p.appearance)==null?void 0:R.head)==null?void 0:G.elements)==null?void 0:U.find(ie=>ie.type==="text"))==null?void 0:J.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(w.HeaderBackground),color:g.getColor(w.HeaderText),borderColor:g.getColor(w.HeaderBorder),...y?{}:{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:()=>{Z.getState().setHistoryChat(null),Z.getState().setHistoryMessages(null),Z.getState().setShowHistoryOnRegistration(!0),_.push("registration")},className:"flex-shrink-0 p-1 hover:opacity-80 transition-opacity",children:f.jsx(ee.ArrowLeft,{className:"w-5 h-5"})}),(()=>{if(c&&m){const z=O6(m);if(z.length>1)return f.jsx(Qx,{participants:z,textColor:g.getColor(w.HeaderText)});if(z.length===1)return f.jsx(Gx,{name:z[0].name,avatar:z[0].avatar,textColor:g.getColor(w.HeaderText)})}if(!c&&e){const z=e.participants&&e.participants.length>0?e.participants:Pg(e.agent_name,e.agent_avatar);if(z.length>1)return f.jsx(Qx,{participants:z,textColor:g.getColor(w.HeaderText)});if(z.length===1)return f.jsx(Gx,{name:z[0].name,avatar:z[0].avatar,textColor:g.getColor(w.HeaderText)})}return f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[f.jsx(h2,{color:g.getColor(w.HeaderText),borderColor:g.getColor(w.HeaderBorder),backgroundColor:g.getColor(w.MessageAdminBackground)}),f.jsx("div",{className:"min-w-0 flex-1",children:c?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"truncate font-medium",children:D()}),f.jsx("div",{className:"truncate text-sm opacity-90",children:P()})]}):f.jsx("div",{className:"truncate font-medium",children:P()})})]})})()]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(!c||c&&(e==null?void 0:e.status)!==an.Closed)&&f.jsx(F6,{onChatClose:s}),k&&f.jsx("button",{type:"button",onClick:$,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(ee.X,{className:"w-5 h-5 cursor-pointer"})})]})]}),f.jsx(GC,{messages:r,isTyping:t||n.length>0,chat:e,onLivechatSendSuggested:l?z=>l(z):void 0}),f.jsx(Nr,{children:d&&f.jsxs(Oe.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(w.ErrorBackground),borderColor:g.getColor(w.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:g.getRadius()},children:[f.jsx(ee.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:g.getColor(w.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:g.getColor(w.ErrorText)},children:d}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:u,style:{color:g.getColor(w.ErrorText)},children:f.jsx(ee.X,{className:"size-4"})})]})}),f.jsx(r8,{client_id:(p==null?void 0:p.client_id)||"",is_uploadable:e.is_customer_uploadable,messages:r,onNewMessage:z=>{i(z)},onEvaluateChat:o,onNewChat:a,onSendMessage:l,isHistoryMode:c,historyChat:c?Z.getState().historyChat:void 0})]})}function o8({rating:e,onChange:t}){const n=Ee();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(Oe.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(w.StarInactiveColor),fill:n.getColor(w.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(w.StarActiveColor),fill:n.getColor(w.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(w.StarActiveColor),fill:n.getColor(w.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 a8({onOk:e}){const t=Ee(),n=Oo(),r=ld(),[i,s]=v.useState(0),[o,a]=v.useState(!1),[l,c]=v.useState(10),d=I4(),[u,p]=v.useState(!1);v.useEffect(()=>{if(o){const S=setInterval(()=>{c(m=>m<=1?(clearInterval(S),e(!0),0):m-1)},1e3);return()=>clearInterval(S)}},[o]);const h=pg({comment:au()}),x=kC({init:{comment:""},schema:h,action:async S=>{const[m,g]=await d.mutateAsync({rating:i,comment:S.comment});if(Gn(g)){a(!0);return}xo(m,{form:x})}}),b=()=>{e(!0)};return f.jsxs(Oe.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(w.HeaderBorder),color:t.getColor(w.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(w.HeaderText)},children:f.jsx(ee.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(w.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(w.HeaderText)},children:n(re.RatingThankYouTitle)}),f.jsx("p",{className:"mb-6 text-sm",style:{color:t.getColor(w.FooterText)},children:n(re.RatingThankYouDescription)}),f.jsx("p",{className:"mb-3 text-xs",style:{color:t.getColor(w.FooterText)},children:n(re.RatingCountdown).replace("{seconds}",l.toString())}),f.jsx(An,{onClick:b,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(w.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(w.RatingRateConversationText)},children:n(re.RatingRateConversation)}),f.jsx(o8,{rating:i,onChange:S=>{s(S),S>=1&&p(!1)}}),i>0&&f.jsx("p",{className:"text-center text-xs mt-1",style:{color:t.getColor(w.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(w.ErrorText)},children:n(re.RatingMinimumError)}):null]}),f.jsxs("form",{onSubmit:x.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(w.InputText)},children:n(re.RatingComment)}),f.jsx(sd,{id:"comment",onChange:x.handleChange,onBlur:x.handleBlur,value:x.values.comment,placeholder:n(re.RatingCommentPlaceholder),className:"rounded-lg",error:x.errors.comment})]}),f.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[f.jsx(An,{type:"submit",size:"lg",onClick:S=>{i<1&&(S.preventDefault(),S.stopPropagation(),p(!0))},className:"w-full",children:n(re.RatingSubmit)}),f.jsx(An,{onClick:b,size:"lg",variant:"secondary",kind:"subtle",className:"w-full",bgKey:w.GreeterBackground,textKey:w.GreeterText,children:n(re.RatingNewConversation)})]})]})]})}),f.jsx(Co,{variant:"block"})]})}function l8({onSendMessage:e,disabled:t,loading:n=!1}){const r=v.useRef(null),i=Ee(),s=Oo(),{setIsInputFocused:o}=Z(),[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 S;(S=r.current)==null||S.focus()},100),h.current=n},[n,t]),v.useEffect(()=>{t&&p(!1)},[t]);const x=()=>{if(!a.trim()||t)return;const S=a;l(""),r.current&&(r.current.style.height="3rem",d("3rem")),e(S)},b=v.useCallback(S=>{if(t)return;const m=r.current;if(m){const g=m.selectionStart,y=m.selectionEnd,k=a.substring(0,g)+S+a.substring(y);k.length<=2e3&&(l(k),setTimeout(()=>{m.selectionStart=m.selectionEnd=g+S.length,m.focus()},0))}else{const g=a+S;g.length<=2e3&&l(g)}},[a,t]);return f.jsxs("form",{className:"flex flex-col relative",onSubmit:S=>{S.preventDefault(),x()},children:[f.jsx("div",{className:"mx-4 border-t",style:{borderColor:i.getColor(w.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(sd,{id:"ai-message",inputRef:r,className:"grow",noMargin:!0,borderless:!0,rows:1,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:S=>{if(t)return;const m=S.target.value,g=S.currentTarget;if(m.length<=2e3&&l(m),m.length===0){g.style.height="3rem",d("3rem");return}const y=d2(g);g.style.height=y,d(y)},onKeyDown:S=>{if(t){S.preventDefault();return}S.key==="Enter"&&!S.shiftKey&&(S.preventDefault(),x())}}),a.length>=500&&f.jsx("div",{className:"absolute bottom-2 right-3 text-xs pointer-events-none",style:{color:a.length>=2e3?i.getColor(w.ErrorText):i.getColor(w.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(Oe.div,{whileTap:{scale:.9},children:f.jsx(An,{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(w.ButtonBackground):i.getColor(w.FooterText)},children:n?f.jsx(ee.Spin,{className:"size-4 animate-spin"}):f.jsx(ee.PaperAirplane,{className:"size-5"})})})})]}),f.jsx(f2,{isOpen:u,onClose:()=>p(!1),onSelect:b}),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(w.IconColor)},children:f.jsx(ee.Emoji,{className:"size-5"})})}),f.jsx(Co,{variant:"inline"})]})]})}const yf=[Be.Light,Be.Dark,Be.System];function c8(e){switch(e){case Be.Light:return ee.Sun;case Be.Dark:return ee.Moon;case Be.System:return ee.Monitor;default:return ee.Monitor}}function u8({onChatClose:e}){const[t,n]=v.useState(!1),[r,i]=v.useState(!1),[s,o]=v.useState(()=>UC()),a=v.useRef(null),l=v.useRef(null),c=Ee(),d=Oo(),{mode:u,setMode:p}=c,h=()=>e(),x=()=>{const m=yf.indexOf(u),g=yf[(m+1)%yf.length];p(g)},b=()=>{const m=!s;HC(m),o(m)};v.useEffect(()=>{if(!r)return;const m=g=>{var y,k;(y=l.current)!=null&&y.contains(g.target)||(k=a.current)!=null&&k.contains(g.target)||i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[r]);const S=r&&f.jsxs(Oe.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(w.Background),borderColor:c.getColor(w.Border),borderRadius:c.getRadius(),boxShadow:`0 4px 12px ${c.getColor(w.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(w.ErrorText)},onClick:()=>{i(!1),n(!0)},children:[f.jsx(ee.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(w.InputText)},onClick:b,children:[s?f.jsx(ee.VolumeX,{className:"size-4 flex-shrink-0"}):f.jsx(ee.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(w.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(w.InputText)},onClick:x,children:[(()=>{const m=c8(u);return f.jsx(m,{className:"size-4 flex-shrink-0"})})(),u===Be.Light?"Açık tema":u===Be.Dark?"Koyu tema":"Sistem"]})]});return f.jsxs(f.Fragment,{children:[f.jsx(Nr,{children:t&&f.jsx(Oe.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(w.ModalOverlayColor)},children:f.jsxs(Oe.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(w.Background),borderRadius:c.getRadius()},children:[f.jsx("div",{className:"text-base font-semibold mb-2",style:{color:c.getColor(w.ChatCloseConfirmText)},children:d(re.ChatCloseConfirm)}),f.jsx("div",{className:"text-sm mb-4",style:{color:c.getColor(w.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(w.GreeterBackground),color:c.getColor(w.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(w.ErrorBackground),color:c.getColor(w.ErrorText),borderRadius:c.getRadius()},onClick:h,children:d(re.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(w.HeaderText)},title:d(re.ChatSettings),"aria-expanded":r,children:f.jsx(ee.Menu,{className:"size-5"})}),f.jsx(Nr,{children:S})]})]})}async function d8(e,t,n,r){let i=Math.max(0,Math.min(t,e.length));n(e.slice(0,i));const s=e.length-i;if(s<=0)return;const l=Math.min(14e3,Math.max(900,s*18)),c=16,d=Math.max(1,Math.ceil(s*c/l));await new Promise((u,p)=>{const h=window.setInterval(()=>{if(r.aborted){window.clearInterval(h),p(new DOMException("aborted","AbortError"));return}i=Math.min(e.length,i+d),n(e.slice(0,i)),i>=e.length&&(window.clearInterval(h),u())},c)})}function f8({onOperatorConnected:e,onChatClose:t}){var H,se,X,ke;const{widget:n,setOpen:r,aiAgent:i,aiAgentMessages:s,addAIAgentMessage:o,setAIAgentMessages:a,aiAgentSessionId:l,setAIAgentSessionId:c,humanNeedRequested:d,setHumanNeedRequested:u,setIsAIAgentMode:p,setAIAgentRequestInFlight:h}=Z(),x=Ee(),b=Lo(),S=ld(),m=vr(),g=xs(),[y,k]=v.useState(!1),[C,_]=v.useState(!1),[E,A]=v.useState(!1),[$,I]=v.useState(!1),[D,P]=v.useState(""),[z,N]=v.useState(null),[O,L]=v.useState(!1),[B,j]=v.useState(0),[V,R]=v.useState(null),G=v.useRef(""),U=v.useRef(null),J=()=>{r(!1)},ie=()=>{u(!1),t()},ge=(((X=(se=(H=n==null?void 0:n.appearance)==null?void 0:H.body)==null?void 0:se.inputs)==null?void 0:X.length)||0)>0,te=v.useRef(!1),be=v.useRef(!1);v.useEffect(()=>{if(!i||te.current)return;if(s.length>0){te.current=!0;return}if(!m||!m.connected){const ue=setInterval(()=>{m&&m.connected&&(clearInterval(ue),q())},100),Se=setTimeout(()=>{clearInterval(ue),te.current||le()},3e3);return()=>{clearInterval(ue),clearTimeout(Se)}}q();function q(){te.current||!m||(te.current=!0,m.emit(qe.MessageList,{},ue=>{Array.isArray(ue)&&ue.length>0?a(ue):le()}))}function le(){if(!i)return;const ue={id:gc(),content:`Merhaba! Ben ${i.name}. Size nasıl yardımcı olabilirim?`,created_at:new Date,files:[],sender_type:ve.User};o(ue)}},[m,i,s.length,a,o]),v.useEffect(()=>{if(y)if(D||z)_(!0);else{const q=setTimeout(()=>_(!0),1e3);return()=>clearTimeout(q)}else _(!1)},[y,D,z]),v.useEffect(()=>{if(B>0){const q=requestAnimationFrame(()=>j(0));return()=>cancelAnimationFrame(q)}},[B]),v.useEffect(()=>{if(!m)return;const q=({token:Y})=>{N(null),P(he=>{const pe=he+Y;return G.current=pe,pe})},le=Y=>{Y.message?N(Y.message):Y.status&&N(Y.status)},ue=Y=>{Y.repeat_count===3&&R(Y.message)},Se=()=>{t()};return m.on(xe.AgentMessageChunk,q),m.on(xe.AgentMessageStreamStatus,le),m.on(xe.AgentSpamWarning,ue),m.on(xe.AgentSpamBanned,Se),()=>{m.off(xe.AgentMessageChunk,q),m.off(xe.AgentMessageStreamStatus,le),m.off(xe.AgentSpamWarning,ue),m.off(xe.AgentSpamBanned,Se)}},[m,t]),v.useEffect(()=>{if(!m)return;const q=le=>{const ue=String(le._id??"");if(!ue)return;const Se=typeof le.content=="string"?le.content.trim():"";N(Y=>Y&&Se&&Y.trim()===Se?null:Y),a(Y=>{if(Y.some(pe=>pe.id===ue))return Y;const he={id:ue,content:le.content,created_at:le.created_at?new Date(le.created_at):new Date,files:le.files??[],sender_type:le.sender_type,answers:le.answers,reply_id:le.reply_id,buttons:le.buttons,post_followup:le.post_followup};return[...Y,he]})};return m.on(xe.MessageAgentCreate,q),()=>{m.off(xe.MessageAgentCreate,q)}},[m,a]);const je=v.useCallback((q,le)=>{var he;if(!n||!i||!m||d||E||be.current)return;(he=U.current)==null||he.abort(),be.current=!0,h(!0);const ue=`temp-${Date.now()}`,Se={id:ue,content:q,created_at:new Date,files:[],sender_type:ve.Customer};o(Se),P(""),G.current="",N(null),L(!0),k(!0),A(!0);const Y=l||Dr(n.link_id);m.emit(qe.AgentMessageCreate,{question:q,agent_id:i.id,session_id:Y,...le===!0?{skip_to_generation:!0}:{}},pe=>{var yr,gn;if(!pe||typeof pe=="object"&&"isError"in pe&&pe.isError===!0){be.current=!1,h(!1),(yr=U.current)==null||yr.abort(),L(!1),P(""),G.current="",N(null),k(!1),A(!1);const Fe=pe,Dt=Fe&&typeof Fe.error=="string"?Fe.error:null,Ht=(Fe&&"errorCode"in Fe&&typeof Fe.errorCode=="string"&&Fe.errorCode.trim()?Fe.errorCode.trim():null)??"ERR_WS_UNKNOWN",vn=Ht==="ERR_WS_TIMEOUT"||Dt==="Event handler timeout",xl=Ht==="ERR_CHAT_NOT_AGENT_MODE",Ss=Ht==="ERR_CHAT_CLOSED",Fo=Ht==="ERR_CHAT_NOT_FOUND",Ce=Dt&&Dt.trim().length>0?Dt.trim():null,ct={id:gc(),content:xl?"Sohbet artık yapay zeka asistanı modunda değil (örneğin canlı desteğe aktarıldı). Canlı destek görünümüne geçiriliyorsunuz.":vn?`Yanıt çok uzun sürdü; sohbet güncellenmiş olabilir. Sayfayı yenileyin veya tekrar deneyin. Hata kodu: ${Ht}`:Ss||Fo?Ce??(Ss?"Bu sohbet sona ermiş. Gerekirse yeni bir sohbet başlatın.":"Sohbet bulunamadı. Sayfayı yenileyip tekrar deneyin."):Ce??`Üzgünüm, bir hata oluştu. Hata kodu: ${Ht}. Bu kodu destek personeli ile paylaşabilirsiniz.`,created_at:new Date,files:[],sender_type:ve.System};if(a(mt=>mt.filter(It=>It.id!==ue).concat([ct])),xl){Z.getState().setIsHaveChat(!0),e(),Z.getState().clearAIAgentState();return}if(Ss||Fo){Z.getState().clearAIAgentState(),u(!0);return}u(!0);return}const K=pe;K.session_id&&c(K.session_id);const F=K.generation??"",W=K.agent_message,me=(typeof W.post_followup=="string"&&W.post_followup.trim()||void 0)??(typeof K.post_message=="string"&&K.post_message.trim()||void 0),_e={...W,id:String(W._id??W.id??gc()),created_at:W.created_at?new Date(W.created_at):new Date,post_followup:me},et=G.current;let it=0;F.startsWith(et)&&(it=et.length),(gn=U.current)==null||gn.abort();const Tt=new AbortController;U.current=Tt;const Ot=()=>{U.current===Tt&&(U.current=null),be.current=!1,h(!1),L(!1),P(""),G.current="",N(null),k(!1),A(!1),a(Fe=>Fe.some(Dt=>Dt.id===_e.id)?Fe:[...Fe,_e]),K.human_need&&u(!0)};if(it>=F.length){Ot();return}(async()=>{try{await d8(F,it,Fe=>{G.current=Fe,P(Fe)},Tt.signal),Ot()}catch{Tt.signal.aborted&&(be.current=!1,h(!1),L(!1),P(""),G.current="",N(null),U.current===Tt&&(U.current=null),a(Fe=>Fe.some(Dt=>Dt.id===_e.id)?Fe:[...Fe,_e]),K.human_need&&u(!0))}})()})},[n,i,d,E,m,l,o,a,c,u,e,h]),oe=v.useCallback(q=>{if(!m||$)return;I(!0);const le=()=>{m.emit(qe.AgentRequestHuman,{},ue=>{I(!1),ue!=null&&ue.success?(Z.getState().setIsHaveChat(!0),p(!1),u(!1),Z.getState().clearAIAgentState(),e()):console.error("Failed to request human operator")})};q&&Object.keys(q).length>0?m.emit(qe.ChatUpdateInputs,{inputs:q},ue=>{ue!=null&&ue.success?le():(console.error("Failed to update chat inputs"),I(!1))}):le()},[m,$,p,u,e]),ae=()=>{ge?g.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:x.getColor(w.HeaderBackground),color:x.getColor(w.HeaderText),borderColor:x.getColor(w.HeaderBorder),...b?{}:{borderTopLeftRadius:x.getRadius(),borderTopRightRadius:x.getRadius()}},children:[f.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(ke=i.avatar)!=null&&ke.trim()?f.jsx("div",{className:"flex size-[46px] shrink-0 items-center justify-center overflow-hidden rounded-[14px] border border-solid",style:{borderColor:x.getColor(w.HeaderBorder),backgroundColor:x.getColor(w.MessageAdminBackground)},children:f.jsx("img",{src:i.avatar.trim(),alt:"",className:"size-full object-cover"})}):f.jsx(h2,{color:x.getColor(w.HeaderText),borderColor:x.getColor(w.HeaderBorder),backgroundColor:x.getColor(w.MessageAdminBackground)}),f.jsxs("div",{className:"min-w-0 flex-1",children:[f.jsx("div",{className:"truncate font-medium",style:{color:x.getColor(w.HeaderText)},children:i.name}),f.jsx("div",{className:"line-clamp-1 text-xs opacity-75",style:{color:x.getColor(w.HeaderText)},children:"AI Asistan"})]})]}),f.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[f.jsx(u8,{onChatClose:ie}),S&&f.jsx("button",{type:"button",onClick:J,className:"p-1 hover:opacity-80 transition-opacity",children:f.jsx(ee.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(GC,{messages:s,isTyping:C||y&&(!!D||!!z),streamingContent:O?D:void 0,streamingStatusText:O?z:void 0,onLivechatSendSuggested:je,skipAnimationForLastN:B}),f.jsx(Nr,{children:V&&f.jsxs(Oe.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:x.getColor(w.ErrorBackground),borderColor:x.getColor(w.ErrorBorder),borderWidth:"1px",borderStyle:"solid",borderRadius:x.getRadius()},children:[f.jsx(ee.XCircle,{className:"size-4 flex-shrink-0 mt-0.5",style:{color:x.getColor(w.ErrorText)}}),f.jsx("span",{className:"text-sm",style:{color:x.getColor(w.ErrorText)},children:V}),f.jsx("button",{type:"button",className:"ml-auto flex-shrink-0",onClick:()=>R(null),style:{color:x.getColor(w.ErrorText)},children:f.jsx(ee.X,{className:"size-4"})})]})}),d?f.jsx(Oe.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:x.getColor(w.Background)},children:f.jsx(Oe.div,{className:"relative w-full max-w-lg mx-auto overflow-hidden",style:{borderRadius:x.getRadius()},animate:{filter:["brightness(1)","brightness(1.1)","brightness(1)"]},transition:{duration:2.5,repeat:Number.POSITIVE_INFINITY,ease:"easeInOut"},children:f.jsx(An,{onClick:ae,disabled:$,size:"lg",className:"w-full flex items-center justify-center gap-2",children:$?f.jsx("span",{className:"animate-pulse",children:"Bağlanıyor..."}):f.jsxs(f.Fragment,{children:[f.jsx(ee.User,{className:"w-5 h-5"}),f.jsx("span",{children:"Canlı Desteğe Bağlan"})]})})})}):f.jsx(l8,{onSendMessage:je,disabled:E,loading:E})]})]}):null}function p8({children:e}){const{widget:t}=Z();return t?f.jsx("section",{className:"h-full w-full relative",children:e}):null}function h8({children:e}){const t=vr(),n=xs(),{historyChat:r,isAIAgentMode:i,aiAgent:s}=Z(),[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(xe.Connect,u),t.on(xe.Disconnect,p),t.connected?(a(!1),d.current=!0):t.connect(),()=>{t.off(xe.Connect,u),t.off(xe.Disconnect,p)}},[t,r,i,s,n]),i&&s||r?e:!t||l?(t||n.push("registration"),f.jsx(dh,{})):d.current&&!t.connected?f.jsx(dh,{}):o||!t.connected?f.jsx(VC,{}):e}function Kx(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 m8(){const e=H=>{if(!H||typeof H!="object")return!1;const se=String((H==null?void 0:H.error)||(H==null?void 0:H.message)||"").toLowerCase(),X=Number((H==null?void 0:H.status)||(H==null?void 0:H.statusCode)||0);return(H==null?void 0:H.retryAfter)!==void 0||X===429||/too\s+many|rate\s*limit|çok\s+fazla/.test(se)},t=H=>{const se=Number((H==null?void 0:H.retryAfter)??(H==null?void 0:H.seconds));return Number.isFinite(se)&&se>0?se:3},{widget:n,setOpen:r,setIsHaveChat:i,historyChat:s,setHistoryChat:o,historyMessages:a,setHistoryMessages:l,aiAgent:c,isAIAgentMode:d,clearAIAgentState:u}=Z(),p=Ee(),h=vr(),{connected:x,connectionReady:b}=h,S=ml(),m=xs(),g=Lo(),[y,k]=v.useState(null),[C,_]=v.useState([]),[E,A]=v.useState(!1),[$,I]=v.useState([]),[D,P]=v.useState(!1),z=ag(),N=v.useRef(!1),O=v.useRef(null),L=v.useRef(!1),[B,j]=v.useState(!1),[V,R]=v.useState(null);v.useEffect(()=>{console.log("WS: ChatDetailView socket state:",{connected:x,connectionReady:b,hasChat:!!y,chatViewEmitted:N.current})},[x,b,y]),v.useEffect(()=>{if(y||s||d){j(!1);return}const H=setTimeout(()=>{!y&&!s&&!d&&(console.warn("WS: Connection timeout reached in ChatDetailView"),j(!0))},1e4);return()=>clearTimeout(H)},[y,s,d]),v.useEffect(()=>{if(!s||!n)return;if(k({status:s.status,is_customer_uploadable:!1}),a){_(a);return}const H=Dr(n.link_id);z4(s._id,n.link_id,H).then(([se,X])=>{if(Gn(X)&&Array.isArray(se)){const ke=se.map(q=>({id:q._id,content:q.content,created_at:q.created_at,files:q.files,sender_type:q.sender_type,activity_type:q.activity_type,answers:q.answers,reply_id:q.reply_id,buttons:q.buttons}));_(ke),l(ke)}}).catch(se=>{console.error("Failed to load history messages",se)})},[s,n,a,l]),v.useLayoutEffect(()=>{if(!n||d||s)return;const H=Zn(n.link_id);H.isAgentMode&&H.agent&&(console.log("ChatDetailView: Recovering AI Agent state from localStorage"),Z.getState().setAIAgent(H.agent),Z.getState().setIsAIAgentMode(!0),H.sessionId&&Z.getState().setAIAgentSessionId(H.sessionId),H.humanNeedRequested&&Z.getState().setHumanNeedRequested(!0))},[n,d,s]);const G=async(H,se)=>{var Se;if(!n)return;if(!s){const Y=`temp-${Date.now()}`,he={id:Y,content:H,created_at:new Date,files:se||[],sender_type:ve.Customer,answers:[],reply_id:void 0,buttons:[]};_(pe=>[...pe,he]),h==null||h.emit(qe.MessageCreate,{content:H,files:se},pe=>{const M=Array.isArray(pe)?pe[0]:pe;if(M&&M.isError){_(F=>F.filter(W=>W.id!==Y));const K=e(M);K||xo(M),K&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(M)}}));return}_(K=>K.map(F=>F.id===Y?M:F))});return}const X={},ke=n.appearance;if((Se=ke==null?void 0:ke.body)!=null&&Se.inputs){for(const Y of ke.body.inputs)if(Y.required||Y.remember){const he=Xs(Y.name);he&&(X[Y.name]=he)}}const q=Z.getState().defaultValues;if(q){q.username&&(X.username=q.username),q.secret_data&&(X.secret_data=q.secret_data);for(const Y in q)X[Y]||(X[Y]=q[Y])}const[le,ue]=await z.mutateAsync({inputs:X,history:[],client_id:n.client_id,widget_id:n.link_id,device_id:Dr(n.link_id)});if(Gn(ue)){o(null),i(!0),le&&typeof le=="object"&&"customer_token"in le&&(Hn(lt.CustomerToken,le.customer_token,n.link_id),Hn(lt.CustomerRefreshToken,le.customer_refresh_token,n.link_id));let Y=0;const he=20,pe=`temp-${Date.now()}`,M={id:pe,content:H,created_at:new Date,files:se||[],sender_type:ve.Customer,answers:[],reply_id:void 0,buttons:[]};_(F=>[...F,M]);const K=setInterval(()=>{Y+=1,h!=null&&h.connected?(h.emit(qe.MessageCreate,{content:H,files:se},F=>{const W=Array.isArray(F)?F[0]:F;if(W&&W.isError){_(me=>me.filter(_e=>_e.id!==pe));const ce=e(W);ce||xo(W),ce&&typeof window<"u"&&window.dispatchEvent(new CustomEvent("lc:rate-limit",{detail:{seconds:t(W)}}));return}_(ce=>ce.map(me=>me.id===pe?W:me))}),clearInterval(K)):Y>=he&&clearInterval(K)},200)}},U=H=>{!H&&!g&&r(!1),P(!0),ba((n==null?void 0:n.link_id)||""),i(!1),k(null),_([]),I([]),o(null),Z.getState().setHistoryMessages(null),Z.getState().setShowHistoryOnRegistration(!1),u(),vc(n.client_id,Zi(Xi(S),n.link_id)).then(()=>{h==null||h.disconnect(),m.push("registration")})},J=()=>{Z.getState().setMinimizedAssigneeName(null),y?(localStorage.setItem("showActionButtons","false"),k({...y,status:an.Closed})):U(!1)};v.useEffect(()=>{if(!h)return;const{isAIAgentMode:H,aiAgent:se}=Z.getState();if(!(H&&se)){if(s){N.current=!1,L.current=!1;return}if(!x||!b){x||(L.current=!1,N.current=!1,O.current=null);return}L.current=!0,!(!n||N.current)&&(N.current=!0,console.log("ChatView: Emitting chat:view request"),h.emit(qe.ChatView,{},X=>{if(console.log("ChatView: Received response",{chatReceived:X!==null,chatStatus:X==null?void 0:X.status,hasAgentName:!!(X!=null&&X.agent_name),hasError:X&&"error"in X}),Z.getState().historyChat){N.current=!1;return}if(X===null||X&&"error"in X||!(X!=null&&X.status)){console.log("ChatView returned invalid chat (null, error, or missing status), cleaning up and redirecting to registration",{chat:X}),r(!1),i(!1),vc(n.client_id,Zi(Xi(S),n.link_id)),_([]),I([]),o(null),Z.getState().setHistoryMessages(null),u(),ba((n==null?void 0:n.link_id)||""),h.disconnect(),m.push("registration"),N.current=!1;return}console.log("ChatView: Setting chat state",{status:X.status}),k(_x(X)),i(!0)}))}},[s,h,n,x,b,S,m,r,i,o,d,c,u]);const ie=()=>{J()},ge=()=>{U(!0)},[te,be]=v.useState(!1),je=v.useCallback(()=>{console.log("handleOperatorConnected: Starting operator connection flow"),N.current=!1,O.current=null,L.current=!1;const H=Z.getState().aiAgentMessages;H.length>0&&_(H),be(!0)},[]);v.useEffect(()=>{if(te){if(!h||!x||!b){console.log("handleOperatorConnected: Waiting for socket connection...",{connected:x,connectionReady:b});return}if(console.log("handleOperatorConnected: Socket ready, fetching chat view"),N.current){be(!1);return}N.current=!0,h.emit(qe.ChatView,{},H=>{console.log("handleOperatorConnected: ChatView result",H),H&&!("error"in H)&&H.status?(k(_x(H)),i(!0),h.emit(qe.MessageList,{},X=>{console.log("handleOperatorConnected: MessageList result",X),Array.isArray(X)&&_(ke=>Kx(ke,X))})):(console.log("handleOperatorConnected: Invalid chat result, clearing state",H),i(!1)),be(!1)})}},[te,h,x,b,i]);const oe=()=>{u(),g||r(!1),P(!0),ba((n==null?void 0:n.link_id)||""),i(!1),k(null),_([]),I([]),o(null),Z.getState().setHistoryMessages(null),Z.getState().setShowHistoryOnRegistration(!1),vc(n.client_id,Zi(Xi(S),n.link_id)).then(()=>{h==null||h.disconnect(),m.push("registration")})},ae=v.useCallback(H=>{if(d&&c&&!s){const{aiAgentMessages:se,addAIAgentMessage:X}=Z.getState();if(se.some(ke=>ke.id===H.id))return;X(H);return}y&&![an.Closed,an.Deleted].includes(y.status)&&_(se=>{const X=se.filter(q=>{var le;return!((le=q.id)!=null&&le.startsWith("temp-")&&q.content===H.content)});return X.some(q=>q.id===H.id)?X:[...X,H]})},[y,d,c,s]);return v.useEffect(()=>{if(!h)return;const H=Y=>{const he={content:Y.content,created_at:Y.created_at,files:Y.files,id:Y._id,sender_type:Y.sender_type,answers:Y.answers,reply_id:Y.reply_id,buttons:Y.buttons,post_followup:Y.post_followup};if($.length>0){I(pe=>[...pe,he]);return}Y.is_shortcut?I([he]):ae(he),A(!1)},se=Y=>{const he={content:Y.content,created_at:Y.created_at,files:Y.files,id:Y._id,sender_id:Y.sender_id,sender_type:Y.sender_type,activity_type:Y.activity_type,sender_name:Y.sender_name,answers:Y.answers,reply_id:Y.reply_id,buttons:Y.buttons};ae(he)},X=Y=>{!Y||!Y.name?k(he=>he?{...he,agent_name:void 0,agent_avatar:void 0,participants:[]}:null):k(he=>{if(!he)return null;const pe=P6(he.participants,{profile_id:Y.id,name:Y.name,avatar:Y.avatar}),M=oa(pe);return{...he,participants:pe,...M}})},ke=()=>{A(!0)},q=()=>{J()},le=({is_customer_uploadable:Y})=>{k(he=>he?{...he,is_customer_uploadable:Y}:null)},ue=Y=>{k(he=>{if(!he)return null;const pe=fh(he.participants,{profile_id:Y.profile_id});if(!Y.hasOtherAdmins||pe.length===0)return{...he,participants:[],agent_name:void 0,agent_avatar:void 0};const M=oa(pe);return{...he,participants:pe,...M}})},Se=Y=>{k(he=>{if(!he)return null;const pe=M6(he.participants,{profile_id:Y.profile_id,name:Y.name,avatar:Y.avatar}),M=oa(pe);return{...he,participants:pe,...M}})};return h.on(xe.MessageAgentCreate,H),h.on(xe.MessageUserCreate,se),h.on(xe.MessageCustomerCreate,se),h.on(xe.ChatUserAssignee,X),h.on(xe.MessageAgentTyping,ke),h.on(xe.ChatUserClose,q),h.on(xe.ChatToggleUpload,le),h.on(xe.ChatUserLeave,ue),h.on(xe.ChatUserJoin,Se),()=>{h.off(xe.MessageAgentCreate,H),h.off(xe.MessageUserCreate,se),h.off(xe.MessageCustomerCreate,se),h.off(xe.ChatUserAssignee,X),h.off(xe.MessageAgentTyping,ke),h.off(xe.ChatUserClose,q),h.off(xe.ChatToggleUpload,le),h.off(xe.ChatUserLeave,ue),h.off(xe.ChatUserJoin,Se)}},[ae,$]),v.useEffect(()=>{if(!h)return;const H=X=>{X.repeat_count===3&&R(X.message)},se=()=>{h.emit(qe.ChatClose,{}),Z.getState().setShowActionButtons(!1),J()};return h.on(xe.AgentSpamWarning,H),h.on(xe.AgentSpamBanned,se),()=>{h.off(xe.AgentSpamWarning,H),h.off(xe.AgentSpamBanned,se)}},[h,J]),v.useEffect(()=>{if(!h||!y||s){O.current=null;return}const H=`${y.status}-${y.agent_name||"no-agent"}`;O.current!==H&&(O.current=H,h.emit(qe.MessageList,{},se=>{if(!Array.isArray(se)){console.warn("MessageList response is not an array:",se),O.current=null;return}_(X=>Kx(X,se)),k(X=>{if(!X)return null;const ke=N6(se),q=ke.length>0?ke:X.participants&&X.participants.length>0?X.participants:Pg(X.agent_name,X.agent_avatar),le=oa(q);return{...X,participants:q,...le}})}))},[h,y,s]),v.useEffect(()=>{const H=setTimeout(()=>{A(!1)},2e3);return()=>clearTimeout(H)},[E]),v.useEffect(()=>{if(!n||$.length===0)return;let H=0;n.writing_timeout&&(H=[...$[0].content].length/n.writing_timeout,H<0&&(H=0));const se=setTimeout(()=>{ae($[0]),I($.slice(1))},H*1e3);return()=>clearTimeout(se)},[$,n]),D?f.jsx(dh,{}):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(w.Background)},children:f.jsx(f8,{onOperatorConnected:je,onChatClose:oe})})]}):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(w.Background)},children:y?y.status===an.Closed&&!s?f.jsx(a8,{onOk:U}):f.jsx(s8,{chat:y,isTyping:E,messages:C,shortcutMessages:$,onNewMessage:ae,onChatClose:J,onEvaluateChat:ie,onNewChat:ge,onSendMessage:G,isHistoryMode:!!s,spamWarningMessage:V,onDismissSpamWarning:()=>R(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(w.InputBorder)},children:f.jsx(ee.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:()=>U(!0),className:"px-6 py-2 rounded-lg font-medium transition-all",style:{backgroundColor:p.getColor(w.ButtonBackground),color:p.getColor(w.ButtonText),borderRadius:p.getRadius()},children:"Tekrar Dene"})]}):f.jsx(VC,{})})]})}function g8(){return w6(),null}function v8(){return f.jsxs(h8,{children:[f.jsx(p8,{children:f.jsx(m8,{})}),f.jsx(g8,{})]})}const y8=[{path:"/chat",component:v8,name:"chat"}],m2=[...y8],g2=[...C6],x8=[...m2,...g2],w8=["Göktuğ","Rüzgar","Altan","Hamza","Caner"],b8="lc:tooltip:operator";function S8(){const e=new Date,t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function v2(){const e=w8;return e[Math.floor(Math.random()*e.length)]}function k8(e){const t=S8(),n=`${b8}:${e}`;try{const i=localStorage.getItem(n);if(i){const s=JSON.parse(i);if(s&&s.day===t&&typeof s.name=="string"&&s.name.length>0)return s.name}}catch{}const r=v2();try{localStorage.setItem(n,JSON.stringify({name:r,day:t}))}catch{}return r}function C8(e){return e==="light"?{balloon:"#ffffff",greeting:"#111111",sub:"#666666",close:"#bbbbbb",closeHoverBg:"rgba(0, 0, 0, 0.06)",title:"#4a3ff5",shadow:"0 8px 32px rgba(0, 0, 0, 0.22), 0 1px 6px rgba(0, 0, 0, 0.1)"}:{balloon:"#1e1e2e",greeting:"#f4f4f5",sub:"#a1a1aa",close:"#71717a",closeHoverBg:"rgba(255, 255, 255, 0.08)",title:"#4a3ff5",shadow:"0 8px 32px rgba(0, 0, 0, 0.45), 0 1px 6px rgba(0, 0, 0, 0.3)"}}function wh({text:e,assigneeName:t}){var m,g,y,k;const{widget:n,isHaveChat:r,isTooltipVisible:i,setIsTooltipVisible:s,onTooltipClose:o}=Z(),{texts:a,resolvedMode:l}=Ee(),c=v.useMemo(()=>C8(l),[l]),d=v.useMemo(()=>n!=null&&n.link_id?k8(n.link_id):v2(),[n==null?void 0:n.link_id]),{data:u,isSuccess:p,isError:h}=Nk(n==null?void 0:n.link_id),x=()=>{s(!1),o&&o()},{greetingLine:b,showSub:S}=v.useMemo(()=>{var $,I,D,P;if(e)return{greetingLine:e,showSub:!1};const C=t==null?void 0:t.trim();if(C)return{greetingLine:a[re.TooltipBalloonGreeting].replace(/\{name\}/g,C),showSub:!0};const _=(r?(I=($=n==null?void 0:n.appearance)==null?void 0:$.design)==null?void 0:I.tooltip_message_active:(P=(D=n==null?void 0:n.appearance)==null?void 0:D.design)==null?void 0:P.tooltip_message)||"";if(h&&_)return{greetingLine:_,showSub:!0};const E=a[re.TooltipBalloonGreeting];let A="Chaty";return p&&u?A="Chaty":p&&u===null&&(A=d),{greetingLine:E.replace(/\{name\}/g,A),showSub:!0}},[e,t,a,r,(g=(m=n==null?void 0:n.appearance)==null?void 0:m.design)==null?void 0:g.tooltip_message,(k=(y=n==null?void 0:n.appearance)==null?void 0:y.design)==null?void 0:k.tooltip_message_active,h,p,u,d]);return i?f.jsxs(Oe.div,{initial:{opacity:0,y:12,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:12,scale:.97},transition:{duration:.3,ease:"easeOut"},className:Ne("absolute bottom-full right-0 z-10 mb-3 w-[260px]","px-[18px] pb-[18px] pt-4"),style:{borderRadius:"18px 18px 4px 18px",backgroundColor:c.balloon,boxShadow:c.shadow},children:[f.jsxs("div",{className:"mb-3 flex items-start justify-between gap-2",children:[f.jsx("button",{type:"button",onClick:x,className:"shrink-0 rounded p-0.5 text-[13px] leading-none transition-colors",style:{color:c.close},onMouseEnter:C=>{C.currentTarget.style.color=l==="light"?"#555555":"#d4d4d8",C.currentTarget.style.backgroundColor=c.closeHoverBg},onMouseLeave:C=>{C.currentTarget.style.color=c.close,C.currentTarget.style.backgroundColor="transparent"},"aria-label":a[re.CloseButtonAria],children:f.jsx(ee.X,{className:"size-3.5","aria-hidden":!0})}),f.jsx("span",{className:"text-right text-[10px] font-bold uppercase tracking-[0.13em]",style:{color:c.title},children:a[re.TooltipBalloonTitle]})]}),f.jsx(Oe.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.05,duration:.25},className:"mb-1 text-[15px] font-bold leading-snug",style:{color:c.greeting},children:b}),S&&f.jsx("p",{className:"text-[13px] leading-normal",style:{color:c.sub},children:a[re.TooltipBalloonSub]}),f.jsx("div",{className:"pointer-events-none absolute h-2.5 w-[18px]",style:{bottom:"-9px",right:"38px",backgroundColor:c.balloon,clipPath:"polygon(0 0, 100% 0, 100% 100%)"},"aria-hidden":!0})]},"widget-tooltip"):null}function _8({label:e,onActivate:t}){return f.jsx("button",{type:"button",className:"chatier-minimized-unread-bubble",onClick:t,"aria-live":"polite",children:e})}function T8(e){return e.sender_type===ve.Activity||e.sender_type===ve.System?!1:e.sender_type===ve.Agent||e.sender_type===ve.User}function Xx({fallback:e,fallbackOpen:t,onOpenWidget:n}){const[r]=v.useState(window.document.title),i=vr(),{isHaveChat:s,open:o,soundPath:a,isTooltipVisible:l}=Z(),c=Z(_=>_.minimizedAssigneeName),d=Z(_=>_.setMinimizedAssigneeName),[u,p]=v.useState(!0),[h,x]=v.useState(0),[b,S]=v.useState(null),m=Oo(),g=v.useRef(new Set),y=()=>{I6(a)},k=(_,E)=>{if(b&&clearInterval(b),_||!s||E===0||Number.isNaN(E)){window.document.title=r,S(null);return}const A=setInterval(()=>{if(_||!s||E===0||Number.isNaN(E)){window.document.title=r,clearInterval(A),S(null);return}const I=`${m(re.MinimizedUnreadMessage).replace(/\{count\}/g,String(E))} - ${r}`;window.document.title!==I?window.document.title=I:window.document.title=r},1e3);return S(A),()=>{clearInterval(A),S(null)}};if(v.useEffect(()=>k(o&&u,h),[h,o,u]),v.useEffect(()=>{const _=()=>{p(document.visibilityState==="visible")};return document.addEventListener("visibilitychange",_,!1),()=>{document.removeEventListener("visibilitychange",_)}},[]),v.useEffect(()=>{o&&(x(0),g.current.clear())},[o]),v.useEffect(()=>{s||d(null)},[s,d]),v.useEffect(()=>{if(!i||!s)return;const _=I=>{o||T8(I)&&(g.current.has(I._id)||(g.current.add(I._id),x(D=>D+1),y()))},E=I=>{var P;const D=(P=I.name)==null?void 0:P.trim();D&&d(D),y()},A=I=>{var N;if(!I.was_assigned)return;const D=Z.getState().minimizedAssigneeName;if(!I.hasOtherAdmins){d(null);return}const P=(N=I.name)==null?void 0:N.trim(),z=D==null?void 0:D.trim();P&&z&&P===z&&d(null)},$=()=>{d(null)};return i.on(xe.MessageAgentCreate,_),i.on(xe.ChatUserAssignee,E),i.on(xe.ChatUserLeave,A),i.on(xe.ChatUserClose,$),()=>{i.off(xe.MessageAgentCreate,_),i.off(xe.ChatUserAssignee,E),i.off(xe.ChatUserLeave,A),i.off(xe.ChatUserClose,$)}},[i,s,o,d]),o)return null;const C=h>0?m(re.MinimizedUnreadMessage).replace(/\{count\}/g,String(h)):"";if(s&&h>0)return f.jsx(_8,{label:C,onActivate:n});if(s&&l){const _=c==null?void 0:c.trim();return f.jsx(wh,{..._?{assigneeName:_}:{}})}return!s&&t?e:null}function Jl({onClick:e,buttonBackground:t,buttonText:n,haloBackground:r,glow:i,glow2:s,haloIdle:o,showClose:a,className:l,"aria-label":c}){const d=r??`color-mix(in srgb, ${t} 30%, transparent)`;return f.jsxs("button",{type:"button",className:Ne("chatier-blob-wrap relative flex size-[68px] shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent p-0 outline-none transition-transform duration-200 hover:scale-[1.06] active:scale-[0.95] focus-visible:ring-2 focus-visible:ring-offset-2",l),style:{"--chatier-blob":t,"--chatier-glow":i??"rgba(74, 63, 245, 0.55)","--chatier-glow2":s??"rgba(74, 63, 245, 0.22)","--chatier-halo-idle":o??"none",color:n},onClick:e,"aria-label":c??(a?"Sohbeti küçült":"Sohbeti aç"),children:[f.jsx("div",{className:"chatier-blob-halo chatier-blob-morph-rev pointer-events-none absolute -inset-[10px] rounded-full transition-shadow duration-300",style:{backgroundColor:d},"aria-hidden":!0}),f.jsx("div",{className:"chatier-blob-bg chatier-blob-morph pointer-events-none absolute inset-0 transition-shadow duration-300",style:{backgroundColor:t},"aria-hidden":!0}),f.jsxs("div",{className:"relative z-10 flex size-full items-center justify-center",children:[f.jsx(Oe.div,{className:"absolute flex items-center justify-center",initial:!1,animate:{opacity:a?0:1,scale:a?.5:1,rotate:a?90:0},transition:{duration:.22,ease:"easeOut"},children:f.jsx(p2,{sizePx:36,className:"text-current"})}),f.jsx(Oe.div,{className:"absolute flex items-center justify-center",initial:!1,animate:{opacity:a?1:0,scale:a?1:.5,rotate:a?0:-90},transition:{duration:.22,ease:"easeOut"},children:f.jsx(ee.X,{className:"size-7 text-current","aria-hidden":!0})})]})]})}function E8(e){return e==="light"?{background:"#ffffff",halo:"rgba(255, 255, 255, 0.22)",foreground:"#4a3ff5",glow:"rgba(255, 255, 255, 0.5)",glow2:"rgba(255, 255, 255, 0.2)",haloIdle:"0 0 28px rgba(255, 255, 255, 0.38), 0 0 12px rgba(255, 255, 255, 0.2)"}:{background:"#4a3ff5",halo:"rgba(74, 63, 245, 0.3)",foreground:"#ffffff",glow:"rgba(74, 63, 245, 0.55)",glow2:"rgba(74, 63, 245, 0.22)",haloIdle:"0 0 24px rgba(74, 63, 245, 0.42), 0 0 10px rgba(74, 63, 245, 0.22)"}}function A8({children:e,border:t}){var V,R,G,U;const n=vr(),{open:r,setOpen:i,setIsHaveChat:s,isHaveChat:o,widget:a,onOpen:l,onClose:c,humanNeedRequested:d}=Z(),[u]=v.useState(!0),p=xs(),h=ml(),x=_m(),b=Ee(),{resolvedMode:S}=b,m=v.useMemo(()=>E8(S),[S]),g=v.useMemo(()=>({buttonBackground:m.background,haloBackground:m.halo,buttonText:m.foreground,glow:m.glow,glow2:m.glow2,haloIdle:m.haloIdle}),[m]),y=Lo(),k=zC(),[C,_]=v.useState({x:0,y:0}),E=QM(),A=v.useRef(null),$=v.useRef(null),[I,D]=v.useState(!1),[P,z]=v.useState(()=>r?"visible":"hidden");v.useEffect(()=>((()=>{D("ontouchstart"in window||navigator.maxTouchPoints>0)})(),window.addEventListener("touchstart",()=>{D(!0)},{once:!0}),()=>{window.removeEventListener("touchstart",()=>{D(!0)})}),[]),v.useEffect(()=>{o&&x.pathname==="/"&&h&&h.accessToken&&!d&&p.push("chat")},[o,x.pathname,h,p,d]),v.useEffect(()=>{r&&z("visible")},[r]);const N=J=>{if(!A.current||!$.current)return J;const ie=A.current.getBoundingClientRect(),ge={width:window.innerWidth,height:window.innerHeight},te={top:20,right:20,bottom:40,left:20};let be=J.x,je=J.y;return ie.right+be-C.x>ge.width-te.right&&(be=ge.width-te.right-ie.width-(ie.left-C.x)),ie.left+be-C.x<te.left&&(be=te.left-(ie.left-C.x)),ie.bottom+je-C.y>ge.height-te.bottom&&(je=ge.height-te.bottom-ie.height-(ie.top-C.y)),ie.top+je-C.y<te.top&&(je=te.top-(ie.top-C.y)),{x:be,y:je}},O=()=>{if(i(!0),!n)return;n.emit(qe.WidgetOpen,{});const{isAIAgentMode:J,aiAgentRequestInFlight:ie,setAIAgentMessages:ge}=Z.getState();J&&ie&&n.emit(qe.MessageList,{},te=>{Array.isArray(te)&&te.length>0&&ge(te)}),l&&l()},L=()=>{i(!1),n&&(n.emit(qe.WidgetClose,{}),c&&c())},B=()=>{i(!1),s(!1),vc(a.client_id,Zi(Xi(h),a.link_id)),p.push("registration")};v.useEffect(()=>{if(y&&(o||k)&&O(),!(!n||!a))return n.on(xe.Banned,B),()=>{n.off(xe.Banned,B)}},[]);function j(J){I&&E.start(J)}return f.jsxs("section",{className:"relative w-full h-full",ref:$,"data-theme":S,children:[f.jsx(Oe.div,{initial:!1,animate:{opacity:r?1:0,scale:r?1:.7,y:r?0:12},transition:r?{duration:.32,ease:[.34,1.56,.64,1]}:{duration:.22,ease:[.4,0,.2,1]},onAnimationComplete:()=>{Z.getState().open||z("hidden")},className:Ne("fixed z-300 overflow-hidden",{"":t&&!y,"bottom-32 right-10 rounded-xl":!y,"!bottom-0 !right-0":y}),style:{width:y?"100%":((R=(V=a==null?void 0:a.appearance)==null?void 0:V.design)==null?void 0:R.width)||"21rem",height:y?"var(--app-height, 100dvh)":((U=(G=a==null?void 0:a.appearance)==null?void 0:G.design)==null?void 0:U.height)||"30rem",left:y?"0":"",right:y?"0px !important":"",maxHeight:y?"var(--app-height, 100dvh)":"",boxShadow:y?"":`0 10px 25px -5px ${b.getColor(w.ShadowColor)}, 0 8px 10px -6px ${b.getColor(w.ShadowColor)}`,backgroundColor:b.getColor(w.Background),visibility:r?"visible":P,transformOrigin:y?"bottom center":"bottom right",pointerEvents:r?"auto":"none"},"aria-hidden":!r,children:e}),!I&&f.jsxs("div",{className:"fixed bottom-[40px] right-[20px] z-400",children:[f.jsx(Xx,{fallback:f.jsx(wh,{}),fallbackOpen:u,onOpenWidget:O}),!r&&f.jsx(Jl,{...g,onClick:O,showClose:!1},"desktop-open-blob"),r&&!y&&f.jsx(Jl,{...g,onClick:L,showClose:!0},"desktop-close-blob")]}),I&&f.jsxs(Oe.div,{ref:A,className:"fixed z-400 bottom-24 right-5",initial:{bottom:"96px",right:"20px"},animate:{x:C.x,y:C.y},drag:I,dragControls:E,dragMomentum:!1,dragElastic:0,onDragEnd:(J,ie)=>{const ge={x:C.x+ie.offset.x,y:C.y+ie.offset.y},te=N(ge);_(te)},children:[f.jsx(Xx,{fallback:f.jsx(wh,{}),fallbackOpen:u,onOpenWidget:O}),!r&&f.jsx("div",{className:"cursor-move",onPointerDown:j,children:f.jsx(Jl,{...g,onClick:O,showClose:!1})},"chat-button"),r&&!y&&f.jsx(Jl,{...g,onClick:L,showClose:!0},"touch-close-blob")]})]})}function j8(e){const{widget:t}=Z();return f.jsx(i4,{widget:t,children:f.jsx(A8,{...e})})}function R8(){const{isHaveChat:e,isAIAgentMode:t}=Z();return f.jsx(DA,{initialEntries:[e||t?"/chat":"/"],future:{v7_startTransition:!0},children:f.jsx(j8,{border:!0,children:f.jsxs(LA,{children:[m2.map((n,r)=>f.jsx(_p,{path:n.path,element:f.jsx(n.component,{})},r)),g2.map((n,r)=>f.jsx(_p,{path:n.path,element:f.jsx(n.component,{})},r))]})})})}const M8="#4a3ff5";function P8(){const[e,t]=v.useState(()=>typeof window<"u"?Ay():"light");return v.useEffect(()=>{const n=()=>t(Ay()),r=window.matchMedia("(prefers-color-scheme: dark)");return r.addEventListener("change",n),window.addEventListener("storage",n),()=>{r.removeEventListener("change",n),window.removeEventListener("storage",n)}},[]),e}function N8(){const t=P8()==="dark",n=t?M8:"#ffffff",r=t?"rgba(74,63,245,0.55)":"rgba(255,255,255,0.4)",i=t?"rgba(74,63,245,0.4)":"rgba(255,255,255,0.3)";return f.jsxs("output",{className:"pointer-events-none fixed bottom-[40px] right-[20px] z-400 block","aria-live":"polite","aria-busy":"true",children:[f.jsx("span",{className:"sr-only",children:"Yükleniyor"}),f.jsxs("div",{className:"relative flex size-[68px] items-center justify-center",children:[f.jsx("div",{className:"chatier-loader-halo absolute size-14 rounded-full",style:{backgroundColor:i},"aria-hidden":!0}),f.jsx("div",{className:"chatier-loader-square size-8",style:{backgroundColor:n,boxShadow:`0 0 16px ${r}`},"aria-hidden":!0})]})]})}const O8=2e3,D8=v.forwardRef((e,t)=>{var A;const n=typeof document<"u"&&((A=document.documentElement)==null?void 0:A.dataset.chatierStandaloneApp)==="true",r=zC(),i=n||r,s=localStorage.getItem("lc:device:id"),{data:o,isLoading:a,error:l}=$E(e.link_id,s||void 0),{widget:c,setWidget:d,setSoundPath:u,setDefaultValues:p,setOpen:h,setOnTooltipClose:x,setIsTooltipVisible:b,setOnOpen:S,setOnClose:m,onOpen:g,onClose:y}=Z(),k=v.useRef(null),[C,_]=v.useState(!0);return v.useEffect(()=>{if(i){if(a){k.current=null,_(!0);return}k.current=null,_(!0);return}if(a){k.current=Date.now(),_(!1);return}const $=k.current;if($===null){_(!0);return}const I=Date.now()-$,D=Math.max(0,O8-I);if(D===0){k.current=null,_(!0);return}const P=window.setTimeout(()=>{k.current=null,_(!0)},D);return()=>window.clearTimeout(P)},[a,i]),v.useImperativeHandle(t,()=>({open:()=>{h(!0),g&&g()},close:()=>{h(!1),y&&y()}})),v.useEffect(()=>{o&&VE(o)&&d(o),e.soundPath&&u(e.soundPath),e.defaultValues&&p(e.defaultValues),e.onTooltipClose&&x(e.onTooltipClose),e.showTooltip===!1&&b(!1),e.onOpen&&S(e.onOpen),e.onClose&&m(e.onClose)},[o,e.soundPath,e.defaultValues,e.onTooltipClose,e.showTooltip,e.onOpen,e.onClose]),!i&&(a||!C)?f.jsx(N8,{}):l||!o||!c?null:f.jsx(cL,{children:f.jsx(y6,{children:f.jsx(R8,{})})})}),I8=new kE;let Zx=null;function L8(e){if(!e.container)return;const t=ne.createRef();return Zx=Sb(e.container),Zx.render(f.jsxs(AE,{client:I8,children:[f.jsx(D8,{...e,ref:t}),f.jsx(dj,{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=Dr(e.link_id);B4({widget_id:e.link_id,device_id:r,decrypted_data:n})}}}window.widget=L8});export default F8();
|