(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function mf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Va={exports:{}},Mo={},Wa={exports:{}},D={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var gr=Symbol.for("react.element"),yf=Symbol.for("react.portal"),gf=Symbol.for("react.fragment"),vf=Symbol.for("react.strict_mode"),kf=Symbol.for("react.profiler"),Sf=Symbol.for("react.provider"),wf=Symbol.for("react.context"),Cf=Symbol.for("react.forward_ref"),_f=Symbol.for("react.suspense"),Ef=Symbol.for("react.memo"),Nf=Symbol.for("react.lazy"),Cs=Symbol.iterator;function Pf(e){return e===null||typeof e!="object"?null:(e=Cs&&e[Cs]||e["@@iterator"],typeof e=="function"?e:null)}var Ha={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Qa=Object.assign,Ga={};function Nn(e,t,n){this.props=e,this.context=t,this.refs=Ga,this.updater=n||Ha}Nn.prototype.isReactComponent={};Nn.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")};Nn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ka(){}Ka.prototype=Nn.prototype;function _l(e,t,n){this.props=e,this.context=t,this.refs=Ga,this.updater=n||Ha}var El=_l.prototype=new Ka;El.constructor=_l;Qa(El,Nn.prototype);El.isPureReactComponent=!0;var _s=Array.isArray,Ya=Object.prototype.hasOwnProperty,Nl={current:null},ba={key:!0,ref:!0,__self:!0,__source:!0};function qa(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Ya.call(t,r)&&!ba.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,X=L[W];if(0>>1;Wo(T,I))Mo(re,T)?(L[W]=re,L[M]=I,W=M):(L[W]=T,L[Qe]=I,W=Qe);else if(Mo(re,I))L[W]=re,L[M]=I,W=M;else break e}}return j}function o(L,j){var I=L.sortIndex-j.sortIndex;return I!==0?I:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var s=[],u=[],m=1,c=null,f=3,v=!1,y=!1,g=!1,N=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(L){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=L)r(u),j.sortIndex=j.expirationTime,t(s,j);else break;j=n(u)}}function k(L){if(g=!1,h(L),!y)if(n(s)!==null)y=!0,On(C);else{var j=n(u);j!==null&&Mn(k,j.startTime-L)}}function C(L,j){y=!1,g&&(g=!1,p(_),_=-1),v=!0;var I=f;try{for(h(j),c=n(s);c!==null&&(!(c.expirationTime>j)||L&&!ue());){var W=c.callback;if(typeof W=="function"){c.callback=null,f=c.priorityLevel;var X=W(c.expirationTime<=j);j=e.unstable_now(),typeof X=="function"?c.callback=X:c===n(s)&&r(s),h(j)}else r(s);c=n(s)}if(c!==null)var xt=!0;else{var Qe=n(u);Qe!==null&&Mn(k,Qe.startTime-j),xt=!1}return xt}finally{c=null,f=I,v=!1}}var P=!1,E=null,_=-1,F=5,A=-1;function ue(){return!(e.unstable_now()-AL||125W?(L.sortIndex=I,t(u,L),n(s)===null&&L===n(u)&&(g?(p(_),_=-1):g=!0,Mn(k,I-W))):(L.sortIndex=X,t(s,L),y||v||(y=!0,On(C))),L},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function(L){var j=f;return function(){var I=f;f=j;try{return L.apply(this,arguments)}finally{f=I}}}})(tu);eu.exports=tu;var Ff=eu.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $f=z,Te=Ff;function w(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ni=Object.prototype.hasOwnProperty,Uf=/^[: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]*$/,Ns={},Ps={};function Rf(e){return Ni.call(Ps,e)?!0:Ni.call(Ns,e)?!1:Uf.test(e)?Ps[e]=!0:(Ns[e]=!0,!1)}function Vf(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 Wf(e,t,n,r){if(t===null||typeof t>"u"||Vf(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 ge(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ae[e]=new ge(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ae[t]=new ge(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ae[e]=new ge(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ae[e]=new ge(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){ae[e]=new ge(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ae[e]=new ge(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ae[e]=new ge(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ae[e]=new ge(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ae[e]=new ge(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tl=/[\-:]([a-z])/g;function Ll(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(Tl,Ll);ae[t]=new ge(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(Tl,Ll);ae[t]=new ge(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(Tl,Ll);ae[t]=new ge(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ae[e]=new ge(e,1,!1,e.toLowerCase(),null,!1,!1)});ae.xlinkHref=new ge("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ae[e]=new ge(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ol(e,t,n,r){var o=ae.hasOwnProperty(t)?ae[t]:null;(o!==null?o.type!==0:r||!(2a||o[l]!==i[a]){var s=` `+o[l].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{Xo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Un(e):""}function Hf(e){switch(e.tag){case 5:return Un(e.type);case 16:return Un("Lazy");case 13:return Un("Suspense");case 19:return Un("SuspenseList");case 0:case 2:case 15:return e=Jo(e.type,!1),e;case 11:return e=Jo(e.type.render,!1),e;case 1:return e=Jo(e.type,!0),e;default:return""}}function Oi(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 en:return"Fragment";case Zt:return"Portal";case Pi:return"Profiler";case Ml:return"StrictMode";case Ti:return"Suspense";case Li:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ou:return(e.displayName||"Context")+".Consumer";case ru:return(e._context.displayName||"Context")+".Provider";case Al:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case jl:return t=e.displayName||null,t!==null?t:Oi(e.type)||"Memo";case yt:t=e._payload,e=e._init;try{return Oi(e(t))}catch{}}return null}function Qf(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 Oi(t);case 8:return t===Ml?"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 At(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gf(e){var t=lu(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nr(e){e._valueTracker||(e._valueTracker=Gf(e))}function su(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=lu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function io(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 Mi(e,t){var n=t.checked;return b({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ls(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=At(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 au(e,t){t=t.checked,t!=null&&Ol(e,"checked",t,!1)}function Ai(e,t){au(e,t);var n=At(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")?ji(e,t.type,n):t.hasOwnProperty("defaultValue")&&ji(e,t.type,At(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Os(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 ji(e,t,n){(t!=="number"||io(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Rn=Array.isArray;function dn(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Pr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function tr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Qn={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},Kf=["Webkit","ms","Moz","O"];Object.keys(Qn).forEach(function(e){Kf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Qn[t]=Qn[e]})});function du(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Qn.hasOwnProperty(e)&&Qn[e]?(""+t).trim():t+"px"}function pu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=du(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Yf=b({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 Di(e,t){if(t){if(Yf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(w(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(w(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(w(61))}if(t.style!=null&&typeof t.style!="object")throw Error(w(62))}}function xi(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 Bi=null;function zl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fi=null,pn=null,hn=null;function js(e){if(e=Sr(e)){if(typeof Fi!="function")throw Error(w(280));var t=e.stateNode;t&&(t=Do(t),Fi(e.stateNode,e.type,t))}}function hu(e){pn?hn?hn.push(e):hn=[e]:pn=e}function mu(){if(pn){var e=pn,t=hn;if(hn=pn=null,js(e),t)for(e=0;e>>=0,e===0?32:31-(id(e)/ld|0)|0}var Tr=64,Lr=4194304;function Vn(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 uo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~o;a!==0?r=Vn(a):(i&=l,i!==0&&(r=Vn(i)))}else l=n&~o,l!==0?r=Vn(l):i!==0&&(r=Vn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function vr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ve(t),e[t]=n}function cd(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=Kn),Rs=" ",Vs=!1;function Du(e,t){switch(e){case"keyup":return Fd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tn=!1;function Ud(e,t){switch(e){case"compositionend":return xu(t);case"keypress":return t.which!==32?null:(Vs=!0,Rs);case"textInput":return e=t.data,e===Rs&&Vs?null:e;default:return null}}function Rd(e,t){if(tn)return e==="compositionend"||!Rl&&Du(e,t)?(e=zu(),Gr=Fl=St=null,tn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Gs(n)}}function Uu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ru(){for(var e=window,t=io();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=io(e.document)}return t}function Vl(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 qd(e){var t=Ru(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Uu(n.ownerDocument.documentElement,n)){if(r!==null&&Vl(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 o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Ks(n,i);var l=Ks(n,r);o&&l&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,nn=null,Hi=null,bn=null,Qi=!1;function Ys(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qi||nn==null||nn!==io(r)||(r=nn,"selectionStart"in r&&Vl(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}),bn&&sr(bn,r)||(bn=r,r=po(Hi,"onSelect"),0ln||(e.current=Xi[ln],Xi[ln]=null,ln--)}function V(e,t){ln++,Xi[ln]=e.current,e.current=t}var jt={},pe=It(jt),Se=It(!1),Ht=jt;function kn(e,t){var n=e.type.contextTypes;if(!n)return jt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function we(e){return e=e.childContextTypes,e!=null}function mo(){Q(Se),Q(pe)}function ta(e,t,n){if(pe.current!==jt)throw Error(w(168));V(pe,t),V(Se,n)}function qu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(w(108,Qf(e)||"Unknown",o));return b({},n,r)}function yo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jt,Ht=pe.current,V(pe,e),V(Se,Se.current),!0}function na(e,t,n){var r=e.stateNode;if(!r)throw Error(w(169));n?(e=qu(e,t,Ht),r.__reactInternalMemoizedMergedChildContext=e,Q(Se),Q(pe),V(pe,e)):Q(Se),V(Se,n)}var tt=null,xo=!1,di=!1;function Xu(e){tt===null?tt=[e]:tt.push(e)}function ap(e){xo=!0,Xu(e)}function Dt(){if(!di&&tt!==null){di=!0;var e=0,t=U;try{var n=tt;for(U=1;e>=l,o-=l,nt=1<<32-Ve(t)+o|n<_?(F=E,E=null):F=E.sibling;var A=f(p,E,h[_],k);if(A===null){E===null&&(E=F);break}e&&E&&A.alternate===null&&t(p,E),d=i(A,d,_),P===null?C=A:P.sibling=A,P=A,E=F}if(_===h.length)return n(p,E),G&&Bt(p,_),C;if(E===null){for(;__?(F=E,E=null):F=E.sibling;var ue=f(p,E,A.value,k);if(ue===null){E===null&&(E=F);break}e&&E&&ue.alternate===null&&t(p,E),d=i(ue,d,_),P===null?C=ue:P.sibling=ue,P=ue,E=F}if(A.done)return n(p,E),G&&Bt(p,_),C;if(E===null){for(;!A.done;_++,A=h.next())A=c(p,A.value,k),A!==null&&(d=i(A,d,_),P===null?C=A:P.sibling=A,P=A);return G&&Bt(p,_),C}for(E=r(p,E);!A.done;_++,A=h.next())A=v(E,p,_,A.value,k),A!==null&&(e&&A.alternate!==null&&E.delete(A.key===null?_:A.key),d=i(A,d,_),P===null?C=A:P.sibling=A,P=A);return e&&E.forEach(function(ct){return t(p,ct)}),G&&Bt(p,_),C}function N(p,d,h,k){if(typeof h=="object"&&h!==null&&h.type===en&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Er:e:{for(var C=h.key,P=d;P!==null;){if(P.key===C){if(C=h.type,C===en){if(P.tag===7){n(p,P.sibling),d=o(P,h.props.children),d.return=p,p=d;break e}}else if(P.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===yt&&ia(C)===P.type){n(p,P.sibling),d=o(P,h.props),d.ref=xn(p,P,h),d.return=p,p=d;break e}n(p,P);break}else t(p,P);P=P.sibling}h.type===en?(d=Wt(h.props.children,p.mode,k,h.key),d.return=p,p=d):(k=eo(h.type,h.key,h.props,null,p.mode,k),k.ref=xn(p,d,h),k.return=p,p=k)}return l(p);case Zt:e:{for(P=h.key;d!==null;){if(d.key===P)if(d.tag===4&&d.stateNode.containerInfo===h.containerInfo&&d.stateNode.implementation===h.implementation){n(p,d.sibling),d=o(d,h.children||[]),d.return=p,p=d;break e}else{n(p,d);break}else t(p,d);d=d.sibling}d=Si(h,p.mode,k),d.return=p,p=d}return l(p);case yt:return P=h._init,N(p,d,P(h._payload),k)}if(Rn(h))return y(p,d,h,k);if(An(h))return g(p,d,h,k);Dr(p,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,d!==null&&d.tag===6?(n(p,d.sibling),d=o(d,h),d.return=p,p=d):(n(p,d),d=ki(h,p.mode,k),d.return=p,p=d),l(p)):n(p,d)}return N}var wn=tc(!0),nc=tc(!1),ko=It(null),So=null,un=null,Gl=null;function Kl(){Gl=un=So=null}function Yl(e){var t=ko.current;Q(ko),e._currentValue=t}function el(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 yn(e,t){So=e,Gl=un=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ke=!0),e.firstContext=null)}function De(e){var t=e._currentValue;if(Gl!==e)if(e={context:e,memoizedValue:t,next:null},un===null){if(So===null)throw Error(w(308));un=e,So.dependencies={lanes:0,firstContext:e}}else un=un.next=e;return t}var Ut=null;function bl(e){Ut===null?Ut=[e]:Ut.push(e)}function rc(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,bl(t)):(n.next=o.next,o.next=n),t.interleaved=n,st(e,r)}function st(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 gt=!1;function ql(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oc(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 ot(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,B&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,st(e,n)}return o=r.interleaved,o===null?(t.next=t,bl(r)):(t.next=o.next,o.next=t),r.interleaved=t,st(e,n)}function Yr(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,Dl(e,n)}}function la(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 wo(e,t,n,r){var o=e.updateQueue;gt=!1;var i=o.firstBaseUpdate,l=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var s=a,u=s.next;s.next=null,l===null?i=u:l.next=u,l=s;var m=e.alternate;m!==null&&(m=m.updateQueue,a=m.lastBaseUpdate,a!==l&&(a===null?m.firstBaseUpdate=u:a.next=u,m.lastBaseUpdate=s))}if(i!==null){var c=o.baseState;l=0,m=u=s=null,a=i;do{var f=a.lane,v=a.eventTime;if((r&f)===f){m!==null&&(m=m.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,g=a;switch(f=t,v=n,g.tag){case 1:if(y=g.payload,typeof y=="function"){c=y.call(v,c,f);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,f=typeof y=="function"?y.call(v,c,f):y,f==null)break e;c=b({},c,f);break e;case 2:gt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else v={eventTime:v,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},m===null?(u=m=v,s=c):m=m.next=v,l|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(m===null&&(s=c),o.baseState=s,o.firstBaseUpdate=u,o.lastBaseUpdate=m,t=o.shared.interleaved,t!==null){o=t;do l|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Kt|=l,e.lanes=l,e.memoizedState=c}}function sa(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=hi.transition;hi.transition={};try{e(!1),t()}finally{U=n,hi.transition=r}}function wc(){return xe().memoizedState}function dp(e,t,n){var r=Lt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cc(e))_c(t,n);else if(n=rc(e,t,n,r),n!==null){var o=me();We(n,e,r,o),Ec(n,t,r)}}function pp(e,t,n){var r=Lt(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cc(e))_c(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(o.hasEagerState=!0,o.eagerState=a,He(a,l)){var s=t.interleaved;s===null?(o.next=o,bl(t)):(o.next=s.next,s.next=o),t.interleaved=o;return}}catch{}finally{}n=rc(e,t,o,r),n!==null&&(o=me(),We(n,e,r,o),Ec(n,t,r))}}function Cc(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function _c(e,t){qn=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ec(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Dl(e,n)}}var Eo={readContext:De,useCallback:ce,useContext:ce,useEffect:ce,useImperativeHandle:ce,useInsertionEffect:ce,useLayoutEffect:ce,useMemo:ce,useReducer:ce,useRef:ce,useState:ce,useDebugValue:ce,useDeferredValue:ce,useTransition:ce,useMutableSource:ce,useSyncExternalStore:ce,useId:ce,unstable_isNewReconciler:!1},hp={readContext:De,useCallback:function(e,t){return Ye().memoizedState=[e,t===void 0?null:t],e},useContext:De,useEffect:ua,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,qr(4194308,4,yc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return qr(4194308,4,e,t)},useInsertionEffect:function(e,t){return qr(4,2,e,t)},useMemo:function(e,t){var n=Ye();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ye();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=dp.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=Ye();return e={current:e},t.memoizedState=e},useState:aa,useDebugValue:os,useDeferredValue:function(e){return Ye().memoizedState=e},useTransition:function(){var e=aa(!1),t=e[0];return e=fp.bind(null,e[1]),Ye().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Y,o=Ye();if(G){if(n===void 0)throw Error(w(407));n=n()}else{if(n=t(),ie===null)throw Error(w(349));Gt&30||ac(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,ua(cc.bind(null,r,i,e),[e]),r.flags|=2048,mr(9,uc.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ye(),t=ie.identifierPrefix;if(G){var n=rt,r=nt;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=pr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[be]=t,e[cr]=r,Ic(e,t,!1,!1),t.stateNode=e;e:{switch(l=xi(n,r),n){case"dialog":H("cancel",e),H("close",e),o=r;break;case"iframe":case"object":case"embed":H("load",e),o=r;break;case"video":case"audio":for(o=0;oEn&&(t.flags|=128,r=!0,Bn(i,!1),t.lanes=4194304)}else{if(!r)if(e=Co(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!G)return fe(t),null}else 2*J()-i.renderingStartTime>En&&n!==1073741824&&(t.flags|=128,r=!0,Bn(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=J(),t.sibling=null,n=K.current,V(K,r?n&1|2:n&1),t):(fe(t),null);case 22:case 23:return cs(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ee&1073741824&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),null;case 24:return null;case 25:return null}throw Error(w(156,t.tag))}function Cp(e,t){switch(Hl(t),t.tag){case 1:return we(t.type)&&mo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(),Q(Se),Q(pe),Zl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jl(t),null;case 13:if(Q(K),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(w(340));Sn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Q(K),null;case 4:return Cn(),null;case 10:return Yl(t.type._context),null;case 22:case 23:return cs(),null;case 24:return null;default:return null}}var Br=!1,de=!1,_p=typeof WeakSet=="function"?WeakSet:Set,O=null;function cn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){q(e,t,r)}else n.current=null}function ul(e,t,n){try{n()}catch(r){q(e,t,r)}}var Sa=!1;function Ep(e,t){if(Gi=co,e=Ru(),Vl(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 o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,a=-1,s=-1,u=0,m=0,c=e,f=null;t:for(;;){for(var v;c!==n||o!==0&&c.nodeType!==3||(a=l+o),c!==i||r!==0&&c.nodeType!==3||(s=l+r),c.nodeType===3&&(l+=c.nodeValue.length),(v=c.firstChild)!==null;)f=c,c=v;for(;;){if(c===e)break t;if(f===n&&++u===o&&(a=l),f===i&&++m===r&&(s=l),(v=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=v}n=a===-1||s===-1?null:{start:a,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ki={focusedElem:e,selectionRange:n},co=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,N=y.memoizedState,p=t.stateNode,d=p.getSnapshotBeforeUpdate(t.elementType===t.type?g:Fe(t.type,g),N);p.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(w(163))}}catch(k){q(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return y=Sa,Sa=!1,y}function Xn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&ul(t,n,i)}o=o.next}while(o!==r)}}function $o(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 cl(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 Bc(e){var t=e.alternate;t!==null&&(e.alternate=null,Bc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[be],delete t[cr],delete t[qi],delete t[lp],delete t[sp])),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 Fc(e){return e.tag===5||e.tag===3||e.tag===4}function wa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fc(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 fl(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=ho));else if(r!==4&&(e=e.child,e!==null))for(fl(e,t,n),e=e.sibling;e!==null;)fl(e,t,n),e=e.sibling}function dl(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(dl(e,t,n),e=e.sibling;e!==null;)dl(e,t,n),e=e.sibling}var le=null,$e=!1;function ht(e,t,n){for(n=n.child;n!==null;)$c(e,t,n),n=n.sibling}function $c(e,t,n){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(Ao,n)}catch{}switch(n.tag){case 5:de||cn(n,t);case 6:var r=le,o=$e;le=null,ht(e,t,n),le=r,$e=o,le!==null&&($e?(e=le,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):le.removeChild(n.stateNode));break;case 18:le!==null&&($e?(e=le,n=n.stateNode,e.nodeType===8?fi(e.parentNode,n):e.nodeType===1&&fi(e,n),ir(e)):fi(le,n.stateNode));break;case 4:r=le,o=$e,le=n.stateNode.containerInfo,$e=!0,ht(e,t,n),le=r,$e=o;break;case 0:case 11:case 14:case 15:if(!de&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&ul(n,t,l),o=o.next}while(o!==r)}ht(e,t,n);break;case 1:if(!de&&(cn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){q(n,t,a)}ht(e,t,n);break;case 21:ht(e,t,n);break;case 22:n.mode&1?(de=(r=de)||n.memoizedState!==null,ht(e,t,n),de=r):ht(e,t,n);break;default:ht(e,t,n)}}function Ca(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _p),t.forEach(function(r){var o=zp.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Be(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=l),r&=~i}if(r=o,r=J()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Pp(r/1960))-r,10e?16:e,wt===null)var r=!1;else{if(e=wt,wt=null,To=0,B&6)throw Error(w(331));var o=B;for(B|=4,O=e.current;O!==null;){var i=O,l=i.child;if(O.flags&16){var a=i.deletions;if(a!==null){for(var s=0;sJ()-as?Vt(e,0):ss|=n),Ce(e,t)}function Kc(e,t){t===0&&(e.mode&1?(t=Lr,Lr<<=1,!(Lr&130023424)&&(Lr=4194304)):t=1);var n=me();e=st(e,t),e!==null&&(vr(e,t,n),Ce(e,n))}function jp(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Kc(e,n)}function zp(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(w(314))}r!==null&&r.delete(t),Kc(e,n)}var Yc;Yc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Se.current)ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ke=!1,Sp(e,t,n);ke=!!(e.flags&131072)}else ke=!1,G&&t.flags&1048576&&Ju(t,vo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Xr(e,t),e=t.pendingProps;var o=kn(t,pe.current);yn(t,n),o=ts(null,t,r,e,o,n);var i=ns();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,we(r)?(i=!0,yo(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ql(t),o.updater=Fo,t.stateNode=o,o._reactInternals=t,nl(t,r,e,n),t=il(null,t,r,!0,i,n)):(t.tag=0,G&&i&&Wl(t),he(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Xr(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Dp(r),e=Fe(r,e),o){case 0:t=ol(null,t,r,e,n);break e;case 1:t=ga(null,t,r,e,n);break e;case 11:t=ma(null,t,r,e,n);break e;case 14:t=ya(null,t,r,Fe(r.type,e),n);break e}throw Error(w(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Fe(r,o),ol(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Fe(r,o),ga(e,t,r,o,n);case 3:e:{if(Ac(t),e===null)throw Error(w(387));r=t.pendingProps,i=t.memoizedState,o=i.element,oc(e,t),wo(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=_n(Error(w(423)),t),t=va(e,t,r,n,o);break e}else if(r!==o){o=_n(Error(w(424)),t),t=va(e,t,r,n,o);break e}else for(Ne=Nt(t.stateNode.containerInfo.firstChild),Pe=t,G=!0,Re=null,n=nc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Sn(),r===o){t=at(e,t,n);break e}he(e,t,r,n)}t=t.child}return t;case 5:return ic(t),e===null&&Zi(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,l=o.children,Yi(r,o)?l=null:i!==null&&Yi(r,i)&&(t.flags|=32),Mc(e,t),he(e,t,l,n),t.child;case 6:return e===null&&Zi(t),null;case 13:return jc(e,t,n);case 4:return Xl(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wn(t,null,r,n):he(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Fe(r,o),ma(e,t,r,o,n);case 7:return he(e,t,t.pendingProps,n),t.child;case 8:return he(e,t,t.pendingProps.children,n),t.child;case 12:return he(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,l=o.value,V(ko,r._currentValue),r._currentValue=l,i!==null)if(He(i.value,l)){if(i.children===o.children&&!Se.current){t=at(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var s=a.firstContext;s!==null;){if(s.context===r){if(i.tag===1){s=ot(-1,n&-n),s.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var m=u.pending;m===null?s.next=s:(s.next=m.next,m.next=s),u.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),el(i.return,n,t),a.lanes|=n;break}s=s.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(w(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),el(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}he(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,yn(t,n),o=De(o),r=r(o),t.flags|=1,he(e,t,r,n),t.child;case 14:return r=t.type,o=Fe(r,t.pendingProps),o=Fe(r.type,o),ya(e,t,r,o,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Fe(r,o),Xr(e,t),t.tag=1,we(r)?(e=!0,yo(t)):e=!1,yn(t,n),Nc(t,r,o),nl(t,r,o,n),il(null,t,r,!0,e,n);case 19:return zc(e,t,n);case 22:return Oc(e,t,n)}throw Error(w(156,t.tag))};function bc(e,t){return Cu(e,t)}function Ip(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 ze(e,t,n,r){return new Ip(e,t,n,r)}function ds(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dp(e){if(typeof e=="function")return ds(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Al)return 11;if(e===jl)return 14}return 2}function Ot(e,t){var n=e.alternate;return n===null?(n=ze(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 eo(e,t,n,r,o,i){var l=2;if(r=e,typeof e=="function")ds(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case en:return Wt(n.children,o,i,t);case Ml:l=8,o|=8;break;case Pi:return e=ze(12,n,t,o|2),e.elementType=Pi,e.lanes=i,e;case Ti:return e=ze(13,n,t,o),e.elementType=Ti,e.lanes=i,e;case Li:return e=ze(19,n,t,o),e.elementType=Li,e.lanes=i,e;case iu:return Ro(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ru:l=10;break e;case ou:l=9;break e;case Al:l=11;break e;case jl:l=14;break e;case yt:l=16,r=null;break e}throw Error(w(130,e==null?e:typeof e,""))}return t=ze(l,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Wt(e,t,n,r){return e=ze(7,e,r,t),e.lanes=n,e}function Ro(e,t,n,r){return e=ze(22,e,r,t),e.elementType=iu,e.lanes=n,e.stateNode={isHidden:!1},e}function ki(e,t,n){return e=ze(6,e,null,t),e.lanes=n,e}function Si(e,t,n){return t=ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xp(e,t,n,r,o){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=ei(0),this.expirationTimes=ei(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ei(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ps(e,t,n,r,o,i,l,a,s){return e=new xp(e,t,n,a,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ze(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ql(i),e}function Bp(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zc)}catch(e){console.error(e)}}Zc(),Za.exports=Le;var Vp=Za.exports,Ma=Vp;Ei.createRoot=Ma.createRoot,Ei.hydrateRoot=Ma.hydrateRoot;const Ze=Object.create(null);Ze.open="0";Ze.close="1";Ze.ping="2";Ze.pong="3";Ze.message="4";Ze.upgrade="5";Ze.noop="6";const to=Object.create(null);Object.keys(Ze).forEach(e=>{to[Ze[e]]=e});const gl={type:"error",data:"parser error"},ef=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",tf=typeof ArrayBuffer=="function",nf=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,gs=({type:e,data:t},n,r)=>ef&&t instanceof Blob?n?r(t):Aa(t,r):tf&&(t instanceof ArrayBuffer||nf(t))?n?r(t):Aa(new Blob([t]),r):r(Ze[e]+(t||"")),Aa=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function ja(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let wi;function Wp(e,t){if(ef&&e.data instanceof Blob)return e.data.arrayBuffer().then(ja).then(t);if(tf&&(e.data instanceof ArrayBuffer||nf(e.data)))return t(ja(e.data));gs(e,!1,n=>{wi||(wi=new TextEncoder),t(wi.encode(n))})}const za="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e{let t=e.length*.75,n=e.length,r,o=0,i,l,a,s;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),m=new Uint8Array(u);for(r=0;r>4,m[o++]=(l&15)<<4|a>>2,m[o++]=(a&3)<<6|s&63;return u},Qp=typeof ArrayBuffer=="function",vs=(e,t)=>{if(typeof e!="string")return{type:"message",data:rf(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:Gp(e.substring(1),t)}:to[n]?e.length>1?{type:to[n],data:e.substring(1)}:{type:to[n]}:gl},Gp=(e,t)=>{if(Qp){const n=Hp(e);return rf(n,t)}else return{base64:!0,data:e}},rf=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},of="",Kp=(e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach((i,l)=>{gs(i,!1,a=>{r[l]=a,++o===n&&t(r.join(of))})})},Yp=(e,t)=>{const n=e.split(of),r=[];for(let o=0;o{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const i=new DataView(o.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{o=new Uint8Array(9);const i=new DataView(o.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Ci;function Ur(e){return e.reduce((t,n)=>t+n.length,0)}function Rr(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;oMath.pow(2,21)-1){a.enqueue(gl);break}o=m*Math.pow(2,32)+u.getUint32(4),r=3}else{if(Ur(n)e){a.enqueue(gl);break}}}})}const lf=4;function ee(e){if(e)return Xp(e)}function Xp(e){for(var t in ee.prototype)e[t]=ee.prototype[t];return e}ee.prototype.on=ee.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};ee.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};ee.prototype.off=ee.prototype.removeListener=ee.prototype.removeAllListeners=ee.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,o=0;oPromise.resolve().then(t):(t,n)=>n(t,0),je=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Jp="arraybuffer";function sf(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const Zp=je.setTimeout,eh=je.clearTimeout;function Ko(e,t){t.useNativeTimers?(e.setTimeoutFn=Zp.bind(je),e.clearTimeoutFn=eh.bind(je)):(e.setTimeoutFn=je.setTimeout.bind(je),e.clearTimeoutFn=je.clearTimeout.bind(je))}const th=1.33;function nh(e){return typeof e=="string"?rh(e):Math.ceil((e.byteLength||e.size)*th)}function rh(e){let t=0,n=0;for(let r=0,o=e.length;r=57344?n+=3:(r++,n+=4);return n}function af(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function oh(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function ih(e){let t={},n=e.split("&");for(let r=0,o=n.length;r{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)};Yp(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,Kp(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]=af()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let uf=!1;try{uf=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ah=uf;function uh(){}class ch extends sh{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",(o,i)=>{this.onError("xhr post error",o,i)})}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 Je extends ee{constructor(t,n,r){super(),this.createRequest=t,Ko(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=sf(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 o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}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 o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.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(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Je.requestsCount++,Je.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=uh,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Je.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()}}Je.requestsCount=0;Je.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ia);else if(typeof addEventListener=="function"){const e="onpagehide"in je?"pagehide":"unload";addEventListener(e,Ia,!1)}}function Ia(){for(let e in Je.requests)Je.requests.hasOwnProperty(e)&&Je.requests[e].abort()}const fh=function(){const e=cf({xdomain:!1});return e&&e.responseType!==null}();class dh extends ch{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=fh&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new Je(cf,this.uri(),t)}}function cf(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||ah))return new XMLHttpRequest}catch{}if(!t)try{return new je[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ff=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ph extends ks{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=ff?{}:sf(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(o){return this.emitReserved("error",o)}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{try{this.doWrite(r,i)}catch{}o&&Go(()=>{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]=af()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const _i=je.WebSocket||je.MozWebSocket;class hh extends ph{createSocket(t,n,r){return ff?new _i(t,n,r):n?new _i(t,n):new _i(t)}doWrite(t,n){this.ws.send(n)}}class mh extends ks{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=qp(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),o=bp();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const i=()=>{r.read().then(({done:a,value:s})=>{a||(this.onPacket(s),i())}).catch(a=>{})};i();const l={type:"open"};this.query.sid&&(l.data=`{"sid":"${this.query.sid}"}`),this._writer.write(l).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n{o&&Go(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const yh={websocket:hh,webtransport:mh,polling:dh},gh=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vh=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function vl(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 o=gh.exec(e||""),i={},l=14;for(;l--;)i[vh[l]]=o[l]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=kh(i,i.path),i.queryKey=Sh(i,i.query),i}function kh(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 Sh(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,i){o&&(n[o]=i)}),n}const kl=typeof addEventListener=="function"&&typeof removeEventListener=="function",no=[];kl&&addEventListener("offline",()=>{no.forEach(e=>e())},!1);class Mt extends ee{constructor(t,n){if(super(),this.binaryType=Jp,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=vl(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=vl(n.host).host);Ko(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 o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=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=ih(this.opts.query)),kl&&(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"})},no.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=lf,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&&Mt.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",Mt.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;r0&&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,Go(()=>{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,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),o&&this.once("flush",o),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(Mt.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(),kl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=no.indexOf(this._offlineEventListener);r!==-1&&no.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Mt.protocol=lf;class wh extends Mt{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",c=>{if(!r)if(c.type==="pong"&&c.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Mt.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(m(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function i(){r||(r=!0,m(),n.close(),n=null)}const l=c=>{const f=new Error("probe error: "+c);f.transport=n.name,i(),this.emitReserved("upgradeError",f)};function a(){l("transport closed")}function s(){l("socket closed")}function u(c){n&&c.name!==n.name&&i()}const m=()=>{n.removeListener("open",o),n.removeListener("error",l),n.removeListener("close",a),this.off("close",s),this.off("upgrading",u)};n.once("open",o),n.once("error",l),n.once("close",a),this.once("close",s),this.once("upgrading",u),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;ryh[o]).filter(o=>!!o)),super(t,r)}};function _h(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=vl(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 i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const Eh=typeof ArrayBuffer=="function",Nh=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,df=Object.prototype.toString,Ph=typeof Blob=="function"||typeof Blob<"u"&&df.call(Blob)==="[object BlobConstructor]",Th=typeof File=="function"||typeof File<"u"&&df.call(File)==="[object FileConstructor]";function Ss(e){return Eh&&(e instanceof ArrayBuffer||Nh(e))||Ph&&e instanceof Blob||Th&&e instanceof File}function ro(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num{delete this.acks[t];for(let a=0;a{this.io.clearTimeoutFn(i),n.apply(this,a)};l.withError=!0,this.acks[t]=l}emitWithAck(t,...n){return new Promise((r,o)=>{const i=(l,a)=>l?o(l):r(a);i.withError=!0,n.push(i),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((o,...i)=>(this._queue[0],o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...i)),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:x.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 x.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 x.EVENT:case x.BINARY_EVENT:this.onevent(t);break;case x.ACK:case x.BINARY_ACK:this.onack(t);break;case x.DISCONNECT:this.ondisconnect();break;case x.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(...o){r||(r=!0,n.packet({type:x.ACK,id:t,data:o}))}}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._drainQueue(!0),this.emitReserved("connect")}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:x.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;r0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ln.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};Ln.prototype.reset=function(){this.attempts=0};Ln.prototype.setMin=function(e){this.ms=e};Ln.prototype.setMax=function(e){this.max=e};Ln.prototype.setJitter=function(e){this.jitter=e};class Cl extends ee{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,Ko(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 Ln({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||zh;this.encoder=new o.Encoder,this.decoder=new o.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 Ch(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Ue(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},l=Ue(n,"error",i);if(this._timeout!==!1){const a=this._timeout,s=this.setTimeoutFn(()=>{o(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}return this.subs.push(o),this.subs.push(l),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ue(t,"ping",this.onping.bind(this)),Ue(t,"data",this.ondata.bind(this)),Ue(t,"error",this.onerror.bind(this)),Ue(t,"close",this.onclose.bind(this)),Ue(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){Go(()=>{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 pf(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;rt()),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(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):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 $n={};function oo(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=_h(e,t.path||"/socket.io"),r=n.source,o=n.id,i=n.path,l=$n[o]&&i in $n[o].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||l;let s;return a?s=new Cl(r,t):($n[o]||($n[o]=new Cl(r,t)),s=$n[o]),n.query&&!t.query&&(t.query=n.queryKey),s.socket(n.path,t)}Object.assign(oo,{Manager:Cl,Socket:pf,io:oo,connect:oo});const Dh=window.location.hostname==="localhost"?"http://localhost:3001":`http://${window.location.hostname}:3001`,R=oo(Dh,{autoConnect:!1,reconnection:!0,reconnectionAttempts:10,reconnectionDelay:1e3}),xa=[{color:"radiance",name:"Dawn's Wrath",symbol:"โ˜€",desc:"Healing, protection, order"},{color:"tide",name:"Depths of Knowledge",symbol:"๐ŸŒŠ",desc:"Card draw, control, counters"},{color:"shadow",name:"Veil of Shadows",symbol:"๐Ÿ’€",desc:"Removal, sacrifice, drain"},{color:"flame",name:"Infernal Fury",symbol:"๐Ÿ”ฅ",desc:"Direct damage, speed, aggression"},{color:"growth",name:"Primal Might",symbol:"๐ŸŒฟ",desc:"Big creatures, ramp, buffs"}];function xh({playerId:e,playerName:t,rooms:n,currentRoom:r,screen:o,onBackToLobby:i}){const[l,a]=z.useState("");z.useEffect(()=>{R.emit("getRooms")},[]);const s=()=>{R.emit("createRoom",{roomName:l||`${t}'s Game`}),a("")},u=f=>{R.emit("joinRoom",{roomId:f})},m=f=>{R.emit("selectDeck",{deckColor:f})},c=()=>{R.emit("startGame")};if(o==="room"&&r){const f=r.players.find(g=>g.id===e),v=r.hostId===e,y=r.players.length>=2&&r.players.every(g=>g.ready);return S.jsx("div",{className:"lobby",children:S.jsxs("div",{className:"room-view",children:[S.jsxs("div",{className:"room-header",children:[S.jsx("button",{className:"btn btn-back",onClick:i,children:"โ† Leave"}),S.jsx("h2",{children:r.name})]}),S.jsxs("div",{className:"room-players",children:[S.jsx("h3",{children:"Players"}),r.players.map(g=>{var N;return S.jsxs("div",{className:`room-player ${g.ready?"ready":""}`,children:[S.jsxs("span",{className:"player-name",children:[g.name," ",g.id===r.hostId?"(Host)":""]}),S.jsx("span",{className:"player-status",children:g.ready?`โœ” ${typeof g.deck=="string"?(N=xa.find(p=>p.color===g.deck))==null?void 0:N.name:"Custom Deck"}`:"Choosing deck..."})]},g.id)}),r.players.length<2&&S.jsx("div",{className:"room-player waiting",children:"Waiting for opponent..."})]}),S.jsxs("div",{className:"deck-selection",children:[S.jsx("h3",{children:"Choose Your Deck"}),S.jsx("div",{className:"deck-grid",children:xa.map(g=>S.jsxs("button",{className:`deck-card ${(f==null?void 0:f.deck)===g.color?"selected":""} color-${g.color}`,onClick:()=>m(g.color),children:[S.jsx("span",{className:"deck-symbol",children:g.symbol}),S.jsx("span",{className:"deck-name",children:g.name}),S.jsx("span",{className:"deck-desc",children:g.desc})]},g.color))})]}),v&&S.jsx("button",{className:"btn btn-primary btn-start",onClick:c,disabled:!y,children:y?"Start Game":"Waiting for all players to be ready..."})]})})}return S.jsxs("div",{className:"lobby",children:[S.jsxs("div",{className:"lobby-header",children:[S.jsx("h1",{className:"game-title-small",children:"Arcane Duels"}),S.jsxs("span",{className:"player-badge",children:["Playing as: ",t]})]}),S.jsxs("div",{className:"lobby-content",children:[S.jsxs("div",{className:"create-room",children:[S.jsx("h3",{children:"Create a Game"}),S.jsxs("div",{className:"create-room-form",children:[S.jsx("input",{type:"text",value:l,onChange:f=>a(f.target.value),placeholder:"Room name (optional)",className:"room-input"}),S.jsx("button",{className:"btn btn-primary",onClick:s,children:"Create Room"})]})]}),S.jsxs("div",{className:"room-list",children:[S.jsxs("h3",{children:["Available Games ",n.length>0&&`(${n.length})`]}),n.length===0?S.jsx("div",{className:"no-rooms",children:"No games available. Create one!"}):n.map(f=>S.jsxs("div",{className:"room-item",children:[S.jsxs("div",{className:"room-info",children:[S.jsx("span",{className:"room-name",children:f.name}),S.jsxs("span",{className:"room-meta",children:["Host: ",f.host," ยท ",f.playerCount,"/",f.maxPlayers," players"]})]}),S.jsx("button",{className:"btn btn-join",onClick:()=>u(f.id),disabled:f.status!=="waiting"||f.playerCount>=f.maxPlayers,children:f.status!=="waiting"?"In Progress":f.playerCount>=f.maxPlayers?"Full":"Join"})]},f.id))]})]})]})}function Bh(e){let t=5381;for(let n=0;n>>0;return t}function Fh(e){let t=e|0;return()=>{t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function $h(e){const t=Fh(Bh(e||"card"));return t(),t(),t(),{f:()=>t(),r:(n,r)=>n+t()*(r-n),i:(n,r)=>Math.floor(n+t()*(r-n)),pick:n=>n[Math.floor(t()*n.length)]}}const Ba={radiance:{bg:["#7a6420","#b89530","#d4a843","#f0d060","#fff8e7"],fills:["#f0d060","#e8c040","#d4a843","#ffeebb","#c49840"],glow:"#fffce8",deep:"#5a4010"},tide:{bg:["#0d1825","#1a3355","#2266aa","#4499dd"],fills:["#3388cc","#55aaee","#4499dd","#77ccff","#2266aa"],glow:"#cceeff",deep:"#08101a"},shadow:{bg:["#05020a","#0f0a18","#1a1520","#2a1530"],fills:["#5a3070","#8a6098","#44224d","#6b4880","#3a1845"],glow:"#c8a0d8",deep:"#030108"},flame:{bg:["#180600","#331000","#662200","#993300"],fills:["#ee5533","#ff8844","#cc3311","#ffbb33","#ff6622"],glow:"#ffeecc",deep:"#100300"},growth:{bg:["#081a05","#153010","#224411","#336622"],fills:["#55aa44","#88cc66","#44884a","#66bb55","#339933"],glow:"#d4eec8",deep:"#040d02"},colorless:{bg:["#303030","#505050","#707070","#909090"],fills:["#aaaaaa","#bbbbbb","#999999","#cccccc","#888888"],glow:"#e8e8ee",deep:"#202020"}};function Uh(e,t,n,r,o){const i=t.r(r*.3,r*.7),l=t.r(o*.15,o*.45),a=e.createRadialGradient(i,l,0,i,l,Math.max(r,o)*1.1);a.addColorStop(0,"#fff8e7"),a.addColorStop(.25,"#f5e6b8"),a.addColorStop(.5,"#d4a843"),a.addColorStop(.8,"#b89530"),a.addColorStop(1,"#7a6420"),e.fillStyle=a,e.fillRect(0,0,r,o);const s=t.i(7,14);for(let v=0;v{const a=l.current;if(!a)return;const s=window.devicePixelRatio||1;a.width=o*s,a.height=i*s;const u=a.getContext("2d");u.scale(s,s);const m=$h(t),c=Ba[n]||Ba.colorless;(Fa[n]||Fa.colorless)(u,m,c,o,i);const v=qh[r];v&&v(u,m,c,o,i),Xh(u,o,i),Jh(u,m,o,i)},[t,n,r,o,i]),S.jsx("canvas",{ref:l,style:{width:`${o}px`,height:`${i}px`,display:"block"}})}),Ua={radiance:{bg:"#fff8e7",border:"#d4a843",accent:"#f0d060"},tide:{bg:"#e7f0ff",border:"#4477bb",accent:"#6699dd"},shadow:{bg:"#2a2a2a",border:"#666",accent:"#8a7090",text:"#ddd"},flame:{bg:"#fff0e7",border:"#cc4422",accent:"#ee6644"},growth:{bg:"#eaf5e7",border:"#448833",accent:"#66aa55"},colorless:{bg:"#f0f0f0",border:"#999",accent:"#bbb"}},e0={swift:"Swift",vigilant:"Vigilant",soaring:"Soaring",guardian:"Guardian",fortified:"Fortified",draining:"Draining",overwhelming:"Overwhelming",venomous:"Venomous",reaching:"Reaching"};function t0(e){if(!e)return"";const t=[];e.colorless&&t.push(String(e.colorless));const n={radiance:"โ˜€",tide:"๐ŸŒŠ",shadow:"๐Ÿ’€",flame:"๐Ÿ”ฅ",growth:"๐ŸŒฟ"};for(const[r,o]of Object.entries(n))for(let i=0;i<(e[r]||0);i++)t.push(o);return t.join(" ")}function Vr({card:e,instance:t,onClick:n,selected:r,selectable:o,small:i,faceDown:l,zone:a}){if(l)return S.jsx("div",{className:"card card-facedown",onClick:n,children:S.jsx("div",{className:"card-back",children:"Arcane Duels"})});const s=(t==null?void 0:t.cardData)||e;if(!s)return null;const u=Ua[s.color]||Ua.colorless,m=s.type==="creature",c=s.type==="land",f=t==null?void 0:t.tapped,v=s.keywords||[],y=t?t.effectivePower:s.power,g=t?t.effectiveToughness-(t.damage||0):s.toughness,N=["card",`card-${s.type}`,`color-${s.color}`,f?"tapped":"",r?"selected":"",o?"selectable":"",i?"card-small":"",a?`zone-${a}`:"",t!=null&&t.summoningSickness?"summoning-sick":""].filter(Boolean).join(" "),p={"--card-bg":u.bg,"--card-border":u.border,"--card-accent":u.accent,color:u.text||"#222"};return S.jsxs("div",{className:N,style:p,onClick:n,children:[S.jsxs("div",{className:"card-header",children:[S.jsx("span",{className:"card-name",children:s.name}),!c&&S.jsx("span",{className:"card-cost",children:t0(s.cost)})]}),S.jsx("div",{className:"card-art",children:S.jsx(Zh,{cardName:s.name,color:s.color,type:s.type,width:i?100:130,height:i?45:70})}),S.jsxs("div",{className:"card-type-line",children:[s.type.charAt(0).toUpperCase()+s.type.slice(1),s.subtype?` โ€” ${s.subtype}`:""]}),S.jsxs("div",{className:"card-text",children:[v.length>0&&S.jsx("div",{className:"card-keywords",children:v.map(d=>e0[d]||d).join(", ")}),s.flavor&&!i&&S.jsx("div",{className:"card-flavor",children:s.flavor})]}),m&&S.jsx("div",{className:"card-pt",children:S.jsxs("span",{className:(t==null?void 0:t.damage)>0?"damaged":"",children:[y,"/",g]})})]})}const n0={untap:"Untap",upkeep:"Upkeep",draw:"Draw",main1:"Main 1",combat_begin:"Combat",combat_attackers:"Attackers",combat_blockers:"Blockers",combat_damage:"Damage",combat_end:"End Combat",main2:"Main 2",end_step:"End",cleanup:"Cleanup"},Ra={radiance:"โ˜€",tide:"๐ŸŒŠ",shadow:"๐Ÿ’€",flame:"๐Ÿ”ฅ",growth:"๐ŸŒฟ",colorless:"โšช"};function r0({gameState:e,playerId:t,onLeave:n}){var Qe;const[r,o]=z.useState(null),[i,l]=z.useState([]),[a,s]=z.useState({}),[u,m]=z.useState(null),[c,f]=z.useState(null),[v,y]=z.useState(0),[g,N]=z.useState(null),[p,d]=z.useState(!1),h=e.activePlayerId===t,k=e.currentPhase,C=e.players[t],P=Object.keys(e.players).find(T=>T!==t),E=e.players[P];z.useEffect(()=>{const T=M=>{M.type==="chooseManaColor"&&N(M.options)};return R.on("needsResponse",T),()=>R.off("needsResponse",T)},[]),z.useEffect(()=>{l([]),s({})},[k]);const _=z.useCallback(T=>{R.emit("gameAction",{action:T})},[]),F=z.useCallback(T=>{_({type:"tapLand",instanceId:T})},[_]),A=z.useCallback((T,M=!1)=>{_({type:"tapAbility",instanceId:T,sacrifice:M})},[_]),ue=z.useCallback(T=>{var $,dt,_e;const M=C.hand[T];if(!M)return;if(M.type==="land"){_({type:"playLand",handIndex:T}),o(null);return}const re=($=M.abilities)==null?void 0:$.some(pt=>["destroyCreature","destroyCreatureIf","bounceCreature","pumpCreature","dealDamage","drainLife","tapCreature","giveKeyword","preventDamage"].includes(pt.effect));if((dt=M.abilities)==null?void 0:dt.some(pt=>pt.isX)){f({handIndex:T,needsTarget:re,cardData:M}),m(null);return}if(re){f({handIndex:T,needsTarget:!0,cardData:M,xAmount:0}),m("creature");return}if((_e=M.abilities)==null?void 0:_e.some(pt=>pt.target==="any"&&["dealDamage","drainLife"].includes(pt.effect))){f({handIndex:T,needsTarget:!0,cardData:M,xAmount:0,canTargetPlayer:!0}),m("any");return}_({type:"castSpell",handIndex:T}),o(null)},[C,_]),ct=z.useCallback(T=>{c&&(_({type:"castSpell",handIndex:c.handIndex,targetInstanceId:T,xAmount:c.xAmount||v}),f(null),m(null),o(null),y(0))},[c,v,_]),ft=z.useCallback(T=>{c&&(_({type:"castSpell",handIndex:c.handIndex,targetPlayerId:T,xAmount:c.xAmount||v}),f(null),m(null),o(null),y(0))},[c,v,_]),Cr=z.useCallback(()=>{_({type:"declareAttackers",attackerIds:i}),l([])},[i,_]),Yo=z.useCallback(()=>{_({type:"declareBlockers",blockerAssignments:a}),s({})},[a,_]),On=z.useCallback(()=>{_({type:"passPriority"})},[_]),Mn=z.useCallback(()=>{window.confirm("Are you sure you want to concede?")&&_({type:"concede"})},[_]),L=z.useCallback(T=>{_({type:"chooseManaColor",color:T}),N(null)},[_]),j=z.useCallback(T=>{l(M=>M.includes(T)?M.filter(re=>re!==T):[...M,T])},[]),I=z.useCallback((T,M)=>{s(re=>{const Ge={...re};return Ge[T]===M?delete Ge[T]:Ge[T]=M,Ge})},[]),W=z.useCallback((T,M)=>{var Xt,$,dt;if(u&&c){ct(T.instanceId);return}if(M)return;if(k==="combat_attackers"&&h&&T.cardData.type==="creature"){j(T.instanceId);return}if((T.cardData.type==="land"||(Xt=T.cardData.abilities)!=null&&Xt.some(_e=>_e.trigger==="tap"&&_e.effect==="addMana"))&&!T.tapped){F(T.instanceId);return}const re=($=T.cardData.abilities)==null?void 0:$.some(_e=>_e.trigger==="tap"&&_e.effect!=="addMana"),Ge=(dt=T.cardData.abilities)==null?void 0:dt.some(_e=>_e.trigger==="tap_sacrifice");re&&!T.tapped?A(T.instanceId,!1):Ge&&A(T.instanceId,!0)},[u,c,k,h,ct,j,F,A]),X=T=>S.jsx("div",{className:"mana-pool",children:Object.entries(T).map(([M,re])=>re>0?S.jsxs("span",{className:`mana mana-${M}`,children:[Ra[M],re]},M):null)}),xt=(T,M)=>{const re=T.battlefield.filter($=>$.cardData.type==="land"),Ge=T.battlefield.filter($=>$.cardData.type==="creature"),Xt=T.battlefield.filter($=>$.cardData.type!=="land"&&$.cardData.type!=="creature");return S.jsxs("div",{className:`battlefield ${M?"opponent":"mine"}`,children:[Xt.length>0&&S.jsx("div",{className:"bf-row bf-others",children:Xt.map($=>S.jsx(Vr,{instance:$,small:!0,onClick:()=>W($,M),selected:i.includes($.instanceId),selectable:u!==null},$.instanceId))}),S.jsx("div",{className:"bf-row bf-creatures",children:Ge.length===0?S.jsx("div",{className:"bf-empty",children:"No creatures"}):Ge.map($=>{const dt=e.attackers.includes($.instanceId),_e=Object.values(a).includes($.instanceId)||Object.values(e.blockers).flat().includes($.instanceId);return S.jsxs("div",{className:`bf-creature-slot ${dt?"attacking":""} ${_e?"blocking":""}`,children:[S.jsx(Vr,{instance:$,small:!0,onClick:()=>{if(k==="combat_blockers"&&!h&&!M&&e.attackers.length>0){const pt=e.attackers[0];I($.instanceId,pt)}else W($,M)},selected:i.includes($.instanceId)||Object.keys(a).includes($.instanceId),selectable:k==="combat_attackers"&&h&&!M||k==="combat_blockers"&&!h&&!M||u!==null}),dt&&S.jsx("div",{className:"combat-badge attack-badge",children:"ATK"}),_e&&S.jsx("div",{className:"combat-badge block-badge",children:"BLK"})]},$.instanceId)})}),S.jsx("div",{className:"bf-row bf-lands",children:re.map($=>S.jsx(Vr,{instance:$,small:!0,onClick:()=>W($,M)},$.instanceId))})]})};return e.gameOver?S.jsx("div",{className:"game-over-overlay",children:S.jsxs("div",{className:"game-over-modal",children:[S.jsx("h1",{children:e.winner===t?"Victory!":"Defeat"}),S.jsx("p",{children:e.winner===t?"You have won the duel!":"You have been defeated."}),S.jsx("button",{className:"btn btn-primary",onClick:n,children:"Back to Lobby"})]})}):S.jsxs("div",{className:"game-board",children:[S.jsxs("div",{className:"game-top-bar",children:[S.jsx("button",{className:"btn btn-small btn-back",onClick:Mn,children:"Concede"}),S.jsx("div",{className:"phase-tracker",children:Object.entries(n0).map(([T,M])=>S.jsx("span",{className:`phase-pip ${k===T?"active":""} ${h?"my-turn":""}`,children:M},T))}),S.jsxs("div",{className:"turn-info",children:["Turn ",e.turnNumber," ยท ",h?"Your turn":"Opponent's turn"]}),S.jsx("button",{className:"btn btn-small",onClick:()=>d(!p),children:"Log"})]}),S.jsxs("div",{className:"opponent-area",children:[S.jsxs("div",{className:"player-info opponent-info",children:[S.jsxs("span",{className:"life-total",children:["โค"," ",E.life]}),S.jsxs("span",{className:"hand-count",children:["๐Ÿƒ"," ",E.handCount]}),S.jsxs("span",{className:"library-count",children:["Deck: ",E.libraryCount]}),X(E.manaPool),u==="any"&&S.jsx("button",{className:"btn btn-target",onClick:()=>ft(P),children:"Target Opponent"})]}),xt(E,!0)]}),S.jsxs("div",{className:"combat-zone",children:[k==="combat_attackers"&&h&&S.jsxs("div",{className:"combat-controls",children:[S.jsx("span",{children:"Select attackers, then:"}),S.jsx("button",{className:"btn btn-primary",onClick:Cr,children:i.length>0?`Attack with ${i.length} creature(s)`:"Skip Attack"})]}),k==="combat_blockers"&&!h&&S.jsxs("div",{className:"combat-controls",children:[S.jsx("span",{children:"Select blockers, then:"}),S.jsx("button",{className:"btn btn-primary",onClick:Yo,children:Object.keys(a).length>0?`Block with ${Object.keys(a).length} creature(s)`:"No Blocks"})]})]}),S.jsxs("div",{className:"my-area",children:[xt(C,!1),S.jsxs("div",{className:"player-info my-info",children:[S.jsxs("span",{className:"life-total",children:["โค"," ",C.life]}),S.jsxs("span",{className:"library-count",children:["Deck: ",C.libraryCount]}),X(C.manaPool),u==="any"&&S.jsx("button",{className:"btn btn-target",onClick:()=>ft(t),children:"Target Self"})]})]}),S.jsxs("div",{className:"hand-area",children:[S.jsx("div",{className:"hand",children:C.hand.map((T,M)=>S.jsx("div",{className:"hand-slot",children:S.jsx(Vr,{card:T,onClick:()=>{r===M?ue(M):o(M)},selected:r===M,selectable:h||T.type==="instant"})},`${T.cardId}-${M}`))}),S.jsx("div",{className:"hand-actions",children:(h||k==="combat_blockers")&&S.jsx("button",{className:"btn btn-pass",onClick:On,children:k==="main1"?"Go to Combat":k==="main2"?"End Turn":k==="combat_blockers"&&!h?"No Blocks":"Pass"})})]}),c&&((Qe=c.cardData.abilities)==null?void 0:Qe.some(T=>T.isX))&&!u&&S.jsx("div",{className:"modal-overlay",children:S.jsxs("div",{className:"modal",children:[S.jsxs("h3",{children:["Choose X value for ",c.cardData.name]}),S.jsxs("div",{className:"x-picker",children:[S.jsx("button",{onClick:()=>y(Math.max(0,v-1)),children:"-"}),S.jsx("span",{className:"x-value",children:v}),S.jsx("button",{onClick:()=>y(v+1),children:"+"})]}),S.jsxs("div",{className:"modal-actions",children:[S.jsx("button",{className:"btn btn-primary",onClick:()=>{c.needsTarget?(f({...c,xAmount:v}),m("any")):(_({type:"castSpell",handIndex:c.handIndex,xAmount:v,targetPlayerId:c.canTargetPlayer?P:void 0}),f(null),o(null),y(0))},children:c.needsTarget?"Choose Target":"Cast"}),S.jsx("button",{className:"btn",onClick:()=>{f(null),y(0)},children:"Cancel"})]})]})}),g&&S.jsx("div",{className:"modal-overlay",children:S.jsxs("div",{className:"modal",children:[S.jsx("h3",{children:"Choose mana color"}),S.jsx("div",{className:"mana-choice-grid",children:g.map(T=>S.jsxs("button",{className:`btn mana-choice-btn color-${T}`,onClick:()=>L(T),children:[Ra[T]," ",T.charAt(0).toUpperCase()+T.slice(1)]},T))})]})}),u&&S.jsxs("div",{className:"target-banner",children:["Choose a target (click a creature",u==="any"?" or player":"",")",S.jsx("button",{className:"btn btn-small",onClick:()=>{m(null),f(null)},children:"Cancel"})]}),p&&S.jsxs("div",{className:"game-log-panel",children:[S.jsxs("div",{className:"log-header",children:[S.jsx("h3",{children:"Game Log"}),S.jsx("button",{className:"btn btn-small",onClick:()=>d(!1),children:"Close"})]}),S.jsx("div",{className:"log-entries",children:e.log.slice().reverse().map((T,M)=>S.jsxs("div",{className:"log-entry",children:[S.jsxs("span",{className:"log-turn",children:["T",T.turn]}),S.jsx("span",{className:"log-msg",children:T.message})]},M))})]})]})}const mt={NAME:"name",LOBBY:"lobby",ROOM:"room",GAME:"game"};function o0(){const[e,t]=z.useState(mt.NAME),[n,r]=z.useState(""),[o,i]=z.useState(null),[l,a]=z.useState([]),[s,u]=z.useState(null),[m,c]=z.useState(null),[f,v]=z.useState(null),[y,g]=z.useState(null),[N,p]=z.useState(!1);z.useEffect(()=>(R.connect(),R.on("connect",()=>{p(!0),i(R.id)}),R.on("disconnect",()=>p(!1)),R.on("nameSet",k=>{i(k.id),t(mt.LOBBY)}),R.on("roomsUpdated",k=>a(k)),R.on("roomCreated",k=>{u(k),t(mt.ROOM)}),R.on("roomJoined",k=>{u(k),t(mt.ROOM)}),R.on("roomUpdated",k=>u(k)),R.on("gameStarted",k=>{v(k.gameId),c(k.state),t(mt.GAME)}),R.on("gameStateUpdated",k=>c(k)),R.on("error",k=>{g(k.message),setTimeout(()=>g(null),3e3)}),R.on("actionError",k=>{g(k.message),setTimeout(()=>g(null),3e3)}),R.on("playerDisconnected",k=>{g(`${k.playerName} disconnected`),setTimeout(()=>g(null),3e3)}),R.on("needsResponse",()=>{}),()=>{R.removeAllListeners(),R.disconnect()}),[]);const d=z.useCallback(k=>{k.preventDefault(),n.trim()&&R.emit("setName",n.trim())},[n]),h=z.useCallback(()=>{R.emit("leaveRoom"),u(null),c(null),v(null),t(mt.LOBBY),R.emit("getRooms")},[]);return e===mt.NAME?S.jsxs("div",{className:"app",children:[S.jsxs("div",{className:"title-screen",children:[S.jsx("h1",{className:"game-title",children:"Arcane Duels"}),S.jsx("p",{className:"game-subtitle",children:"A game of strategy, mana, and might"}),S.jsxs("form",{onSubmit:d,className:"name-form",children:[S.jsx("input",{type:"text",value:n,onChange:k=>r(k.target.value),placeholder:"Enter your name...",className:"name-input",maxLength:20,autoFocus:!0}),S.jsx("button",{type:"submit",className:"btn btn-primary",disabled:!N,children:N?"Enter the Arena":"Connecting..."})]})]}),y&&S.jsx("div",{className:"error-toast",children:y})]}):e===mt.GAME&&m?S.jsxs("div",{className:"app",children:[S.jsx(r0,{gameState:m,playerId:o,onLeave:h}),y&&S.jsx("div",{className:"error-toast",children:y})]}):S.jsxs("div",{className:"app",children:[S.jsx(xh,{playerId:o,playerName:n,rooms:l,currentRoom:s,screen:e,onBackToLobby:h}),y&&S.jsx("div",{className:"error-toast",children:y})]})}Ei.createRoot(document.getElementById("root")).render(S.jsx(Af.StrictMode,{children:S.jsx(o0,{})}));