@rqmii_immersive/agent-react-sdk 5.1.1 → 5.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/embed.js CHANGED
@@ -38,7 +38,7 @@
38
38
  `+z[ee].replace(" at new "," at ");return l.displayName&&Le.includes("<anonymous>")&&(Le=Le.replace("<anonymous>",l.displayName)),Le}while(1<=ee&&0<=Te);break}}}finally{bt=!1,Error.prepareStackTrace=y}return(l=l?l.displayName||l.name:"")?ze(l):""}function Ct(l){switch(l.tag){case 5:return ze(l.type);case 16:return ze("Lazy");case 13:return ze("Suspense");case 19:return ze("SuspenseList");case 0:case 2:case 15:return l=Rt(l.type,!1),l;case 11:return l=Rt(l.type.render,!1),l;case 1:return l=Rt(l.type,!0),l;default:return""}}function He(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case _:return"Fragment";case q:return"Portal";case Z:return"Profiler";case G:return"StrictMode";case Se:return"Suspense";case Ne:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case oe:return(l.displayName||"Context")+".Consumer";case ie:return(l._context.displayName||"Context")+".Provider";case ve:var d=l.render;return l=l.displayName,l||(l=d.displayName||d.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Me:return d=l.displayName||null,d!==null?d:He(l.type)||"Memo";case Ae:d=l._payload,l=l._init;try{return He(l(d))}catch{}}return null}function gt(l){var d=l.type;switch(l.tag){case 24:return"Cache";case 9:return(d.displayName||"Context")+".Consumer";case 10:return(d._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=d.render,l=l.displayName||l.name||"",d.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return d;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return He(d);case 8:return d===G?"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 d=="function")return d.displayName||d.name||null;if(typeof d=="string")return d}return null}function tt(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Lt(l){var d=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function Vt(l){var d=Lt(l)?"checked":"value",y=Object.getOwnPropertyDescriptor(l.constructor.prototype,d),T=""+l[d];if(!l.hasOwnProperty(d)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var z=y.get,H=y.set;return Object.defineProperty(l,d,{configurable:!0,get:function(){return z.call(this)},set:function(ee){T=""+ee,H.call(this,ee)}}),Object.defineProperty(l,d,{enumerable:y.enumerable}),{getValue:function(){return T},setValue:function(ee){T=""+ee},stopTracking:function(){l._valueTracker=null,delete l[d]}}}}function hn(l){l._valueTracker||(l._valueTracker=Vt(l))}function Vn(l){if(!l)return!1;var d=l._valueTracker;if(!d)return!0;var y=d.getValue(),T="";return l&&(T=Lt(l)?l.checked?"true":"false":l.value),l=T,l!==y?(d.setValue(l),!0):!1}function fn(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function dt(l,d){var y=d.checked;return Ce({},d,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:y??l._wrapperState.initialChecked})}function it(l,d){var y=d.defaultValue==null?"":d.defaultValue,T=d.checked!=null?d.checked:d.defaultChecked;y=tt(d.value!=null?d.value:y),l._wrapperState={initialChecked:T,initialValue:y,controlled:d.type==="checkbox"||d.type==="radio"?d.checked!=null:d.value!=null}}function ht(l,d){d=d.checked,d!=null&&W(l,"checked",d,!1)}function Pt(l,d){ht(l,d);var y=tt(d.value),T=d.type;if(y!=null)T==="number"?(y===0&&l.value===""||l.value!=y)&&(l.value=""+y):l.value!==""+y&&(l.value=""+y);else if(T==="submit"||T==="reset"){l.removeAttribute("value");return}d.hasOwnProperty("value")?Sn(l,d.type,y):d.hasOwnProperty("defaultValue")&&Sn(l,d.type,tt(d.defaultValue)),d.checked==null&&d.defaultChecked!=null&&(l.defaultChecked=!!d.defaultChecked)}function Gt(l,d,y){if(d.hasOwnProperty("value")||d.hasOwnProperty("defaultValue")){var T=d.type;if(!(T!=="submit"&&T!=="reset"||d.value!==void 0&&d.value!==null))return;d=""+l._wrapperState.initialValue,y||d===l.value||(l.value=d),l.defaultValue=d}y=l.name,y!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,y!==""&&(l.name=y)}function Sn(l,d,y){(d!=="number"||fn(l.ownerDocument)!==l)&&(y==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+y&&(l.defaultValue=""+y))}var $t=Array.isArray;function yn(l,d,y,T){if(l=l.options,d){d={};for(var z=0;z<y.length;z++)d["$"+y[z]]=!0;for(y=0;y<l.length;y++)z=d.hasOwnProperty("$"+l[y].value),l[y].selected!==z&&(l[y].selected=z),z&&T&&(l[y].defaultSelected=!0)}else{for(y=""+tt(y),d=null,z=0;z<l.length;z++){if(l[z].value===y){l[z].selected=!0,T&&(l[z].defaultSelected=!0);return}d!==null||l[z].disabled||(d=l[z])}d!==null&&(d.selected=!0)}}function yt(l,d){if(d.dangerouslySetInnerHTML!=null)throw Error(t(91));return Ce({},d,{value:void 0,defaultValue:void 0,children:""+l._wrapperState.initialValue})}function be(l,d){var y=d.value;if(y==null){if(y=d.children,d=d.defaultValue,y!=null){if(d!=null)throw Error(t(92));if($t(y)){if(1<y.length)throw Error(t(93));y=y[0]}d=y}d==null&&(d=""),y=d}l._wrapperState={initialValue:tt(y)}}function Kn(l,d){var y=tt(d.value),T=tt(d.defaultValue);y!=null&&(y=""+y,y!==l.value&&(l.value=y),d.defaultValue==null&&l.defaultValue!==y&&(l.defaultValue=y)),T!=null&&(l.defaultValue=""+T)}function qn(l){var d=l.textContent;d===l._wrapperState.initialValue&&d!==""&&d!==null&&(l.value=d)}function de(l){switch(l){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function J(l,d){return l==null||l==="http://www.w3.org/1999/xhtml"?de(d):l==="http://www.w3.org/2000/svg"&&d==="foreignObject"?"http://www.w3.org/1999/xhtml":l}var Be,Ye=(function(l){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(d,y,T,z){MSApp.execUnsafeLocalFunction(function(){return l(d,y,T,z)})}:l})(function(l,d){if(l.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in l)l.innerHTML=d;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+d.valueOf().toString()+"</svg>",d=Be.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;d.firstChild;)l.appendChild(d.firstChild)}});function at(l,d){if(d){var y=l.firstChild;if(y&&y===l.lastChild&&y.nodeType===3){y.nodeValue=d;return}}l.textContent=d}var It={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},Bt=["Webkit","ms","Moz","O"];Object.keys(It).forEach(function(l){Bt.forEach(function(d){d=d+l.charAt(0).toUpperCase()+l.substring(1),It[d]=It[l]})});function lt(l,d,y){return d==null||typeof d=="boolean"||d===""?"":y||typeof d!="number"||d===0||It.hasOwnProperty(l)&&It[l]?(""+d).trim():d+"px"}function At(l,d){l=l.style;for(var y in d)if(d.hasOwnProperty(y)){var T=y.indexOf("--")===0,z=lt(y,d[y],T);y==="float"&&(y="cssFloat"),T?l.setProperty(y,z):l[y]=z}}var Jt=Ce({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 Mn(l,d){if(d){if(Jt[l]&&(d.children!=null||d.dangerouslySetInnerHTML!=null))throw Error(t(137,l));if(d.dangerouslySetInnerHTML!=null){if(d.children!=null)throw Error(t(60));if(typeof d.dangerouslySetInnerHTML!="object"||!("__html"in d.dangerouslySetInnerHTML))throw Error(t(61))}if(d.style!=null&&typeof d.style!="object")throw Error(t(62))}}function Dt(l,d){if(l.indexOf("-")===-1)return typeof d.is=="string";switch(l){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 Wt=null;function An(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var zn=null,On=null,Oe=null;function qt(l){if(l=zl(l)){if(typeof zn!="function")throw Error(t(280));var d=l.stateNode;d&&(d=Zc(d),zn(l.stateNode,l.type,d))}}function ft(l){On?Oe?Oe.push(l):Oe=[l]:On=l}function Yt(){if(On){var l=On,d=Oe;if(Oe=On=null,qt(l),d)for(l=0;l<d.length;l++)qt(d[l])}}function Zt(l,d){return l(d)}function xt(){}var pn=!1;function un(l,d,y){if(pn)return l(d,y);pn=!0;try{return Zt(l,d,y)}finally{pn=!1,(On!==null||Oe!==null)&&(xt(),Yt())}}function gi(l,d){var y=l.stateNode;if(y===null)return null;var T=Zc(y);if(T===null)return null;y=T[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(T=!T.disabled)||(l=l.type,T=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!T;break e;default:l=!1}if(l)return null;if(y&&typeof y!="function")throw Error(t(231,d,typeof y));return y}var ai=!1;if(f)try{var ir={};Object.defineProperty(ir,"passive",{get:function(){ai=!0}}),window.addEventListener("test",ir,ir),window.removeEventListener("test",ir,ir)}catch{ai=!1}function ks(l,d,y,T,z,H,ee,Te,Le){var je=Array.prototype.slice.call(arguments,3);try{d.apply(y,je)}catch(Et){this.onError(Et)}}var pa=!1,Da=null,oa=!1,En=null,Rs={onError:function(l){pa=!0,Da=l}};function Wi(l,d,y,T,z,H,ee,Te,Le){pa=!1,Da=null,ks.apply(Rs,arguments)}function ma(l,d,y,T,z,H,ee,Te,Le){if(Wi.apply(this,arguments),pa){if(pa){var je=Da;pa=!1,Da=null}else throw Error(t(198));oa||(oa=!0,En=je)}}function tn(l){var d=l,y=l;if(l.alternate)for(;d.return;)d=d.return;else{l=d;do d=l,(d.flags&4098)!==0&&(y=d.return),l=d.return;while(l)}return d.tag===3?y:null}function Kr(l){if(l.tag===13){var d=l.memoizedState;if(d===null&&(l=l.alternate,l!==null&&(d=l.memoizedState)),d!==null)return d.dehydrated}return null}function Ys(l){if(tn(l)!==l)throw Error(t(188))}function Yo(l){var d=l.alternate;if(!d){if(d=tn(l),d===null)throw Error(t(188));return d!==l?null:l}for(var y=l,T=d;;){var z=y.return;if(z===null)break;var H=z.alternate;if(H===null){if(T=z.return,T!==null){y=T;continue}break}if(z.child===H.child){for(H=z.child;H;){if(H===y)return Ys(z),l;if(H===T)return Ys(z),d;H=H.sibling}throw Error(t(188))}if(y.return!==T.return)y=z,T=H;else{for(var ee=!1,Te=z.child;Te;){if(Te===y){ee=!0,y=z,T=H;break}if(Te===T){ee=!0,T=z,y=H;break}Te=Te.sibling}if(!ee){for(Te=H.child;Te;){if(Te===y){ee=!0,y=H,T=z;break}if(Te===T){ee=!0,T=H,y=z;break}Te=Te.sibling}if(!ee)throw Error(t(189))}}if(y.alternate!==T)throw Error(t(190))}if(y.tag!==3)throw Error(t(188));return y.stateNode.current===y?l:d}function La(l){return l=Yo(l),l!==null?Na(l):null}function Na(l){if(l.tag===5||l.tag===6)return l;for(l=l.child;l!==null;){var d=Na(l);if(d!==null)return d;l=l.sibling}return null}var la=e.unstable_scheduleCallback,Fr=e.unstable_cancelCallback,kl=e.unstable_shouldYield,uu=e.unstable_requestPaint,Qi=e.unstable_now,ls=e.unstable_getCurrentPriorityLevel,rr=e.unstable_ImmediatePriority,re=e.unstable_UserBlockingPriority,Ve=e.unstable_NormalPriority,nt=e.unstable_LowPriority,qe=e.unstable_IdlePriority,Ke=null,Mt=null;function vt(l){if(Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(Ke,l,void 0,(l.current.flags&128)===128)}catch{}}var Ut=Math.clz32?Math.clz32:Jn,xn=Math.log,Rn=Math.LN2;function Jn(l){return l>>>=0,l===0?32:31-(xn(l)/Rn|0)|0}var Xn=64,ln=4194304;function fi(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function ii(l,d){var y=l.pendingLanes;if(y===0)return 0;var T=0,z=l.suspendedLanes,H=l.pingedLanes,ee=y&268435455;if(ee!==0){var Te=ee&~z;Te!==0?T=fi(Te):(H&=ee,H!==0&&(T=fi(H)))}else ee=y&~z,ee!==0?T=fi(ee):H!==0&&(T=fi(H));if(T===0)return 0;if(d!==0&&d!==T&&(d&z)===0&&(z=T&-T,H=d&-d,z>=H||z===16&&(H&4194240)!==0))return d;if((T&4)!==0&&(T|=y&16),d=l.entangledLanes,d!==0)for(l=l.entanglements,d&=T;0<d;)y=31-Ut(d),z=1<<y,T|=l[y],d&=~z;return T}function Qt(l,d){switch(l){case 1:case 2:case 4:return d+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return d+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function oi(l,d){for(var y=l.suspendedLanes,T=l.pingedLanes,z=l.expirationTimes,H=l.pendingLanes;0<H;){var ee=31-Ut(H),Te=1<<ee,Le=z[ee];Le===-1?((Te&y)===0||(Te&T)!==0)&&(z[ee]=Qt(Te,d)):Le<=d&&(l.expiredLanes|=Te),H&=~Te}}function qi(l){return l=l.pendingLanes&-1073741825,l!==0?l:l&1073741824?1073741824:0}function Kt(){var l=Xn;return Xn<<=1,(Xn&4194240)===0&&(Xn=64),l}function $e(l){for(var d=[],y=0;31>y;y++)d.push(l);return d}function Gn(l,d,y){l.pendingLanes|=d,d!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,d=31-Ut(d),l[d]=y}function br(l,d){var y=l.pendingLanes&~d;l.pendingLanes=d,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=d,l.mutableReadLanes&=d,l.entangledLanes&=d,d=l.entanglements;var T=l.eventTimes;for(l=l.expirationTimes;0<y;){var z=31-Ut(y),H=1<<z;d[z]=0,T[z]=-1,l[z]=-1,y&=~H}}function Or(l,d){var y=l.entangledLanes|=d;for(l=l.entanglements;y;){var T=31-Ut(y),z=1<<T;z&d|l[T]&d&&(l[T]|=d),y&=~z}}var Qn=0;function mn(l){return l&=-l,1<l?4<l?(l&268435455)!==0?16:536870912:4:1}var mi,Ri,Br,Si,us,cs=!1,ds=[],Ps=null,ga=null,va=null,wo=new Map,So=new Map,za=[],Qd="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Qo(l,d){switch(l){case"focusin":case"focusout":Ps=null;break;case"dragenter":case"dragleave":ga=null;break;case"mouseover":case"mouseout":va=null;break;case"pointerover":case"pointerout":wo.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":So.delete(d.pointerId)}}function Jo(l,d,y,T,z,H){return l===null||l.nativeEvent!==H?(l={blockedOn:d,domEventName:y,eventSystemFlags:T,nativeEvent:H,targetContainers:[z]},d!==null&&(d=zl(d),d!==null&&Ri(d)),l):(l.eventSystemFlags|=T,d=l.targetContainers,z!==null&&d.indexOf(z)===-1&&d.push(z),l)}function Lc(l,d,y,T,z){switch(d){case"focusin":return Ps=Jo(Ps,l,d,y,T,z),!0;case"dragenter":return ga=Jo(ga,l,d,y,T,z),!0;case"mouseover":return va=Jo(va,l,d,y,T,z),!0;case"pointerover":var H=z.pointerId;return wo.set(H,Jo(wo.get(H)||null,l,d,y,T,z)),!0;case"gotpointercapture":return H=z.pointerId,So.set(H,Jo(So.get(H)||null,l,d,y,T,z)),!0}return!1}function Nc(l){var d=Ga(l.target);if(d!==null){var y=tn(d);if(y!==null){if(d=y.tag,d===13){if(d=Kr(y),d!==null){l.blockedOn=d,us(l.priority,function(){Br(y)});return}}else if(d===3&&y.stateNode.current.memoizedState.isDehydrated){l.blockedOn=y.tag===3?y.stateNode.containerInfo:null;return}}}l.blockedOn=null}function Zo(l){if(l.blockedOn!==null)return!1;for(var d=l.targetContainers;0<d.length;){var y=Q(l.domEventName,l.eventSystemFlags,d[0],l.nativeEvent);if(y===null){y=l.nativeEvent;var T=new y.constructor(y.type,y);Wt=T,y.target.dispatchEvent(T),Wt=null}else return d=zl(y),d!==null&&Ri(d),l.blockedOn=y,!1;d.shift()}return!0}function to(l,d,y){Zo(l)&&y.delete(d)}function Vu(){cs=!1,Ps!==null&&Zo(Ps)&&(Ps=null),ga!==null&&Zo(ga)&&(ga=null),va!==null&&Zo(va)&&(va=null),wo.forEach(to),So.forEach(to)}function ya(l,d){l.blockedOn===d&&(l.blockedOn=null,cs||(cs=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Vu)))}function Fa(l){function d(z){return ya(z,l)}if(0<ds.length){ya(ds[0],l);for(var y=1;y<ds.length;y++){var T=ds[y];T.blockedOn===l&&(T.blockedOn=null)}}for(Ps!==null&&ya(Ps,l),ga!==null&&ya(ga,l),va!==null&&ya(va,l),wo.forEach(d),So.forEach(d),y=0;y<za.length;y++)T=za[y],T.blockedOn===l&&(T.blockedOn=null);for(;0<za.length&&(y=za[0],y.blockedOn===null);)Nc(y),y.blockedOn===null&&za.shift()}var no=B.ReactCurrentBatchConfig,Eo=!0;function Jd(l,d,y,T){var z=Qn,H=no.transition;no.transition=null;try{Qn=1,Gu(l,d,y,T)}finally{Qn=z,no.transition=H}}function zc(l,d,y,T){var z=Qn,H=no.transition;no.transition=null;try{Qn=4,Gu(l,d,y,T)}finally{Qn=z,no.transition=H}}function Gu(l,d,y,T){if(Eo){var z=Q(l,d,y,T);if(z===null)_u(l,d,T,Hu,y),Qo(l,T);else if(Lc(z,l,d,y,T))T.stopPropagation();else if(Qo(l,T),d&4&&-1<Qd.indexOf(l)){for(;z!==null;){var H=zl(z);if(H!==null&&mi(H),H=Q(l,d,y,T),H===null&&_u(l,d,T,Hu,y),H===z)break;z=H}z!==null&&T.stopPropagation()}else _u(l,d,T,null,y)}}var Hu=null;function Q(l,d,y,T){if(Hu=null,l=An(T),l=Ga(l),l!==null)if(d=tn(l),d===null)l=null;else if(y=d.tag,y===13){if(l=Kr(d),l!==null)return l;l=null}else if(y===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;l=null}else d!==l&&(l=null);return Hu=l,null}function se(l){switch(l){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ls()){case rr:return 1;case re:return 4;case Ve:case nt:return 16;case qe:return 536870912;default:return 16}default:return 16}}var ye=null,De=null,Pe=null;function Je(){if(Pe)return Pe;var l,d=De,y=d.length,T,z="value"in ye?ye.value:ye.textContent,H=z.length;for(l=0;l<y&&d[l]===z[l];l++);var ee=y-l;for(T=1;T<=ee&&d[y-T]===z[H-T];T++);return Pe=z.slice(l,1<T?1-T:void 0)}function Ge(l){var d=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&d===13&&(l=13)):l=d,l===10&&(l=13),32<=l||l===13?l:0}function Fe(){return!0}function Xe(){return!1}function pt(l){function d(y,T,z,H,ee){this._reactName=y,this._targetInst=z,this.type=T,this.nativeEvent=H,this.target=ee,this.currentTarget=null;for(var Te in l)l.hasOwnProperty(Te)&&(y=l[Te],this[Te]=y?y(H):H[Te]);return this.isDefaultPrevented=(H.defaultPrevented!=null?H.defaultPrevented:H.returnValue===!1)?Fe:Xe,this.isPropagationStopped=Xe,this}return Ce(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var y=this.nativeEvent;y&&(y.preventDefault?y.preventDefault():typeof y.returnValue!="unknown"&&(y.returnValue=!1),this.isDefaultPrevented=Fe)},stopPropagation:function(){var y=this.nativeEvent;y&&(y.stopPropagation?y.stopPropagation():typeof y.cancelBubble!="unknown"&&(y.cancelBubble=!0),this.isPropagationStopped=Fe)},persist:function(){},isPersistent:Fe}),d}var kt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mt=pt(kt),st=Ce({},kt,{view:0,detail:0}),Cn=pt(st),We,Ft,Ii,Hn=Ce({},st,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ba,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Ii&&(Ii&&l.type==="mousemove"?(We=l.screenX-Ii.screenX,Ft=l.screenY-Ii.screenY):Ft=We=0,Ii=l),We)},movementY:function(l){return"movementY"in l?l.movementY:Ft}}),bn=pt(Hn),_n=Ce({},Hn,{dataTransfer:0}),rn=pt(_n),Ur=Ce({},st,{relatedTarget:0}),Lr=pt(Ur),Qs=Ce({},kt,{animationName:0,elapsedTime:0,pseudoElement:0}),To=pt(Qs),Wu=Ce({},kt,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),qu=pt(Wu),sr=Ce({},kt,{data:0}),Aa=pt(sr),Zd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},xa={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kd(l){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(l):(l=xa[l])?!!d[l]:!1}function ba(){return Kd}var cu=Ce({},st,{key:function(l){if(l.key){var d=Zd[l.key]||l.key;if(d!=="Unidentified")return d}return l.type==="keypress"?(l=Ge(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?Dn[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ba,charCode:function(l){return l.type==="keypress"?Ge(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Ge(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),ar=pt(cu),Is=Ce({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ko=pt(Is),du=Ce({},st,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ba}),_d=pt(du),ju=Ce({},kt,{propertyName:0,elapsedTime:0,pseudoElement:0}),wr=pt(ju),io=Ce({},Hn,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Rl=pt(io),Sr=[9,13,27,32],Xi=f&&"CompositionEvent"in window,hs=null;f&&"documentMode"in document&&(hs=document.documentMode);var $d=f&&"TextEvent"in window&&!hs,Xu=f&&(!Xi||hs&&8<hs&&11>=hs),Fc=" ",eh=!1;function of(l,d){switch(l){case"keyup":return Sr.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lf(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Ds=!1;function _o(l,d){switch(l){case"compositionend":return lf(d);case"keypress":return d.which!==32?null:(eh=!0,Fc);case"textInput":return l=d.data,l===Fc&&eh?null:l;default:return null}}function Oc(l,d){if(Ds)return l==="compositionend"||!Xi&&of(l,d)?(l=Je(),Pe=De=ye=null,Ds=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return Xu&&d.locale!=="ko"?null:d.data;default:return null}}var Yp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Oa(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d==="input"?!!Yp[l.type]:d==="textarea"}function Ba(l,d,y,T){ft(T),d=ec(d,"onChange"),0<d.length&&(y=new mt("onChange","change",null,y,T),l.push({event:y,listeners:d}))}var Pl=null,Yu=null;function uf(l){Ku(l,0)}function Bc(l){var d=fu(l);if(Vn(d))return l}function Qp(l,d){if(l==="change")return d}var th=!1;if(f){var Uc;if(f){var nh="oninput"in document;if(!nh){var Vc=document.createElement("div");Vc.setAttribute("oninput","return;"),nh=typeof Vc.oninput=="function"}Uc=nh}else Uc=!1;th=Uc&&(!document.documentMode||9<document.documentMode)}function Js(){Pl&&(Pl.detachEvent("onpropertychange",Ji),Yu=Pl=null)}function Ji(l){if(l.propertyName==="value"&&Bc(Yu)){var d=[];Ba(d,Yu,l,An(l)),un(uf,d)}}function Pg(l,d,y){l==="focusin"?(Js(),Pl=d,Yu=y,Pl.attachEvent("onpropertychange",Ji)):l==="focusout"&&Js()}function Ig(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return Bc(Yu)}function Jp(l,d){if(l==="click")return Bc(d)}function Gc(l,d){if(l==="input"||l==="change")return Bc(d)}function Il(l,d){return l===d&&(l!==0||1/l===1/d)||l!==l&&d!==d}var Ua=typeof Object.is=="function"?Object.is:Il;function Qu(l,d){if(Ua(l,d))return!0;if(typeof l!="object"||l===null||typeof d!="object"||d===null)return!1;var y=Object.keys(l),T=Object.keys(d);if(y.length!==T.length)return!1;for(T=0;T<y.length;T++){var z=y[T];if(!p.call(d,z)||!Ua(l[z],d[z]))return!1}return!0}function Ju(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function ro(l,d){var y=Ju(l);l=0;for(var T;y;){if(y.nodeType===3){if(T=l+y.textContent.length,l<=d&&T>=d)return{node:y,offset:d-l};l=T}e:{for(;y;){if(y.nextSibling){y=y.nextSibling;break e}y=y.parentNode}y=void 0}y=Ju(y)}}function ih(l,d){return l&&d?l===d?!0:l&&l.nodeType===3?!1:d&&d.nodeType===3?ih(l,d.parentNode):"contains"in l?l.contains(d):l.compareDocumentPosition?!!(l.compareDocumentPosition(d)&16):!1:!1}function Hc(){for(var l=window,d=fn();d instanceof l.HTMLIFrameElement;){try{var y=typeof d.contentWindow.location.href=="string"}catch{y=!1}if(y)l=d.contentWindow;else break;d=fn(l.document)}return d}function rh(l){var d=l&&l.nodeName&&l.nodeName.toLowerCase();return d&&(d==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||d==="textarea"||l.contentEditable==="true")}function cf(l){var d=Hc(),y=l.focusedElem,T=l.selectionRange;if(d!==y&&y&&y.ownerDocument&&ih(y.ownerDocument.documentElement,y)){if(T!==null&&rh(y)){if(d=T.start,l=T.end,l===void 0&&(l=d),"selectionStart"in y)y.selectionStart=d,y.selectionEnd=Math.min(l,y.value.length);else if(l=(d=y.ownerDocument||document)&&d.defaultView||window,l.getSelection){l=l.getSelection();var z=y.textContent.length,H=Math.min(T.start,z);T=T.end===void 0?H:Math.min(T.end,z),!l.extend&&H>T&&(z=T,T=H,H=z),z=ro(y,H);var ee=ro(y,T);z&&ee&&(l.rangeCount!==1||l.anchorNode!==z.node||l.anchorOffset!==z.offset||l.focusNode!==ee.node||l.focusOffset!==ee.offset)&&(d=d.createRange(),d.setStart(z.node,z.offset),l.removeAllRanges(),H>T?(l.addRange(d),l.extend(ee.node,ee.offset)):(d.setEnd(ee.node,ee.offset),l.addRange(d)))}}for(d=[],l=y;l=l.parentNode;)l.nodeType===1&&d.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<d.length;y++)l=d[y],l.element.scrollLeft=l.left,l.element.scrollTop=l.top}}var sh=f&&"documentMode"in document&&11>=document.documentMode,Dl=null,ah=null,Ll=null,df=!1;function hf(l,d,y){var T=y.window===y?y.document:y.nodeType===9?y:y.ownerDocument;df||Dl==null||Dl!==fn(T)||(T=Dl,"selectionStart"in T&&rh(T)?T={start:T.selectionStart,end:T.selectionEnd}:(T=(T.ownerDocument&&T.ownerDocument.defaultView||window).getSelection(),T={anchorNode:T.anchorNode,anchorOffset:T.anchorOffset,focusNode:T.focusNode,focusOffset:T.focusOffset}),Ll&&Qu(Ll,T)||(Ll=T,T=ec(ah,"onSelect"),0<T.length&&(d=new mt("onSelect","select",null,d,y),l.push({event:d,listeners:T}),d.target=Dl)))}function Wc(l,d){var y={};return y[l.toLowerCase()]=d.toLowerCase(),y["Webkit"+l]="webkit"+d,y["Moz"+l]="moz"+d,y}var Vr={animationend:Wc("Animation","AnimationEnd"),animationiteration:Wc("Animation","AnimationIteration"),animationstart:Wc("Animation","AnimationStart"),transitionend:Wc("Transition","TransitionEnd")},qc={},ff={};f&&(ff=document.createElement("div").style,"AnimationEvent"in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),"TransitionEvent"in window||delete Vr.transitionend.transition);function Zu(l){if(qc[l])return qc[l];if(!Vr[l])return l;var d=Vr[l],y;for(y in d)if(d.hasOwnProperty(y)&&y in ff)return qc[l]=d[y];return l}var Zp=Zu("animationend"),jc=Zu("animationiteration"),fs=Zu("animationstart"),pf=Zu("transitionend"),Zs=new Map,mf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ls(l,d){Zs.set(l,d),o(d,[l])}for(var $o=0;$o<mf.length;$o++){var Mo=mf[$o],gf=Mo.toLowerCase(),Mi=Mo[0].toUpperCase()+Mo.slice(1);Ls(gf,"on"+Mi)}Ls(Zp,"onAnimationEnd"),Ls(jc,"onAnimationIteration"),Ls(fs,"onAnimationStart"),Ls("dblclick","onDoubleClick"),Ls("focusin","onFocus"),Ls("focusout","onBlur"),Ls(pf,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ks="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Kp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ks));function hu(l,d,y){var T=l.type||"unknown-event";l.currentTarget=y,ma(T,d,void 0,l),l.currentTarget=null}function Ku(l,d){d=(d&4)!==0;for(var y=0;y<l.length;y++){var T=l[y],z=T.event;T=T.listeners;e:{var H=void 0;if(d)for(var ee=T.length-1;0<=ee;ee--){var Te=T[ee],Le=Te.instance,je=Te.currentTarget;if(Te=Te.listener,Le!==H&&z.isPropagationStopped())break e;hu(z,Te,je),H=Le}else for(ee=0;ee<T.length;ee++){if(Te=T[ee],Le=Te.instance,je=Te.currentTarget,Te=Te.listener,Le!==H&&z.isPropagationStopped())break e;hu(z,Te,je),H=Le}}}if(oa)throw l=En,oa=!1,En=null,l}function Di(l,d){var y=d[bf];y===void 0&&(y=d[bf]=new Set);var T=l+"__bubble";y.has(T)||(vf(d,l,2,!1),y.add(T))}function oh(l,d,y){var T=0;d&&(T|=4),vf(y,l,T,d)}var Xc="_reactListening"+Math.random().toString(36).slice(2);function el(l){if(!l[Xc]){l[Xc]=!0,n.forEach(function(y){y!=="selectionchange"&&(Kp.has(y)||oh(y,!1,l),oh(y,!0,l))});var d=l.nodeType===9?l:l.ownerDocument;d===null||d[Xc]||(d[Xc]=!0,oh("selectionchange",!1,d))}}function vf(l,d,y,T){switch(se(d)){case 1:var z=Jd;break;case 4:z=zc;break;default:z=Gu}y=z.bind(null,d,y,l),z=void 0,!ai||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(z=!0),T?z!==void 0?l.addEventListener(d,y,{capture:!0,passive:z}):l.addEventListener(d,y,!0):z!==void 0?l.addEventListener(d,y,{passive:z}):l.addEventListener(d,y,!1)}function _u(l,d,y,T,z){var H=T;if((d&1)===0&&(d&2)===0&&T!==null)e:for(;;){if(T===null)return;var ee=T.tag;if(ee===3||ee===4){var Te=T.stateNode.containerInfo;if(Te===z||Te.nodeType===8&&Te.parentNode===z)break;if(ee===4)for(ee=T.return;ee!==null;){var Le=ee.tag;if((Le===3||Le===4)&&(Le=ee.stateNode.containerInfo,Le===z||Le.nodeType===8&&Le.parentNode===z))return;ee=ee.return}for(;Te!==null;){if(ee=Ga(Te),ee===null)return;if(Le=ee.tag,Le===5||Le===6){T=H=ee;continue e}Te=Te.parentNode}}T=T.return}un(function(){var je=H,Et=An(y),Nt=[];e:{var wt=Zs.get(l);if(wt!==void 0){var sn=mt,vn=l;switch(l){case"keypress":if(Ge(y)===0)break e;case"keydown":case"keyup":sn=ar;break;case"focusin":vn="focus",sn=Lr;break;case"focusout":vn="blur",sn=Lr;break;case"beforeblur":case"afterblur":sn=Lr;break;case"click":if(y.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":sn=bn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":sn=rn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":sn=_d;break;case Zp:case jc:case fs:sn=To;break;case pf:sn=wr;break;case"scroll":sn=Cn;break;case"wheel":sn=Rl;break;case"copy":case"cut":case"paste":sn=qu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":sn=Ko}var Tn=(d&4)!==0,Oi=!Tn&&l==="scroll",Ze=Tn?wt!==null?wt+"Capture":null:wt;Tn=[];for(var a=je,u;a!==null;){u=a;var g=u.stateNode;if(u.tag===5&&g!==null&&(u=g,Ze!==null&&(g=gi(a,Ze),g!=null&&Tn.push($u(a,g,u)))),Oi)break;a=a.return}0<Tn.length&&(wt=new sn(wt,vn,null,y,Et),Nt.push({event:wt,listeners:Tn}))}}if((d&7)===0){e:{if(wt=l==="mouseover"||l==="pointerover",sn=l==="mouseout"||l==="pointerout",wt&&y!==Wt&&(vn=y.relatedTarget||y.fromElement)&&(Ga(vn)||vn[ko]))break e;if((sn||wt)&&(wt=Et.window===Et?Et:(wt=Et.ownerDocument)?wt.defaultView||wt.parentWindow:window,sn?(vn=y.relatedTarget||y.toElement,sn=je,vn=vn?Ga(vn):null,vn!==null&&(Oi=tn(vn),vn!==Oi||vn.tag!==5&&vn.tag!==6)&&(vn=null)):(sn=null,vn=je),sn!==vn)){if(Tn=bn,g="onMouseLeave",Ze="onMouseEnter",a="mouse",(l==="pointerout"||l==="pointerover")&&(Tn=Ko,g="onPointerLeave",Ze="onPointerEnter",a="pointer"),Oi=sn==null?wt:fu(sn),u=vn==null?wt:fu(vn),wt=new Tn(g,a+"leave",sn,y,Et),wt.target=Oi,wt.relatedTarget=u,g=null,Ga(Et)===je&&(Tn=new Tn(Ze,a+"enter",vn,y,Et),Tn.target=u,Tn.relatedTarget=Oi,g=Tn),Oi=g,sn&&vn)t:{for(Tn=sn,Ze=vn,a=0,u=Tn;u;u=Nl(u))a++;for(u=0,g=Ze;g;g=Nl(g))u++;for(;0<a-u;)Tn=Nl(Tn),a--;for(;0<u-a;)Ze=Nl(Ze),u--;for(;a--;){if(Tn===Ze||Ze!==null&&Tn===Ze.alternate)break t;Tn=Nl(Tn),Ze=Nl(Ze)}Tn=null}else Tn=null;sn!==null&&lh(Nt,wt,sn,Tn,!1),vn!==null&&Oi!==null&&lh(Nt,Oi,vn,Tn,!0)}}e:{if(wt=je?fu(je):window,sn=wt.nodeName&&wt.nodeName.toLowerCase(),sn==="select"||sn==="input"&&wt.type==="file")var w=Qp;else if(Oa(wt))if(th)w=Gc;else{w=Ig;var D=Pg}else(sn=wt.nodeName)&&sn.toLowerCase()==="input"&&(wt.type==="checkbox"||wt.type==="radio")&&(w=Jp);if(w&&(w=w(l,je))){Ba(Nt,w,y,Et);break e}D&&D(l,wt,je),l==="focusout"&&(D=wt._wrapperState)&&D.controlled&&wt.type==="number"&&Sn(wt,"number",wt.value)}switch(D=je?fu(je):window,l){case"focusin":(Oa(D)||D.contentEditable==="true")&&(Dl=D,ah=je,Ll=null);break;case"focusout":Ll=ah=Dl=null;break;case"mousedown":df=!0;break;case"contextmenu":case"mouseup":case"dragend":df=!1,hf(Nt,y,Et);break;case"selectionchange":if(sh)break;case"keydown":case"keyup":hf(Nt,y,Et)}var F;if(Xi)e:{switch(l){case"compositionstart":var $="onCompositionStart";break e;case"compositionend":$="onCompositionEnd";break e;case"compositionupdate":$="onCompositionUpdate";break e}$=void 0}else Ds?of(l,y)&&($="onCompositionEnd"):l==="keydown"&&y.keyCode===229&&($="onCompositionStart");$&&(Xu&&y.locale!=="ko"&&(Ds||$!=="onCompositionStart"?$==="onCompositionEnd"&&Ds&&(F=Je()):(ye=Et,De="value"in ye?ye.value:ye.textContent,Ds=!0)),D=ec(je,$),0<D.length&&($=new Aa($,l,null,y,Et),Nt.push({event:$,listeners:D}),F?$.data=F:(F=lf(y),F!==null&&($.data=F)))),(F=$d?_o(l,y):Oc(l,y))&&(je=ec(je,"onBeforeInput"),0<je.length&&(Et=new Aa("onBeforeInput","beforeinput",null,y,Et),Nt.push({event:Et,listeners:je}),Et.data=F))}Ku(Nt,d)})}function $u(l,d,y){return{instance:l,listener:d,currentTarget:y}}function ec(l,d){for(var y=d+"Capture",T=[];l!==null;){var z=l,H=z.stateNode;z.tag===5&&H!==null&&(z=H,H=gi(l,y),H!=null&&T.unshift($u(l,H,z)),H=gi(l,d),H!=null&&T.push($u(l,H,z))),l=l.return}return T}function Nl(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5);return l||null}function lh(l,d,y,T,z){for(var H=d._reactName,ee=[];y!==null&&y!==T;){var Te=y,Le=Te.alternate,je=Te.stateNode;if(Le!==null&&Le===T)break;Te.tag===5&&je!==null&&(Te=je,z?(Le=gi(y,H),Le!=null&&ee.unshift($u(y,Le,Te))):z||(Le=gi(y,H),Le!=null&&ee.push($u(y,Le,Te)))),y=y.return}ee.length!==0&&l.push({event:d,listeners:ee})}var Yc=/\r\n?/g,yf=/\u0000|\uFFFD/g;function Ns(l){return(typeof l=="string"?l:""+l).replace(Yc,`
39
39
  `).replace(yf,"")}function Qc(l,d,y){if(d=Ns(d),Ns(l)!==d&&y)throw Error(t(425))}function ps(){}var uh=null,ch=null;function Af(l,d){return l==="textarea"||l==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var Co=typeof setTimeout=="function"?setTimeout:void 0,_p=typeof clearTimeout=="function"?clearTimeout:void 0,dh=typeof Promise=="function"?Promise:void 0,tc=typeof queueMicrotask=="function"?queueMicrotask:typeof dh<"u"?function(l){return dh.resolve(null).then(l).catch($p)}:Co;function $p(l){setTimeout(function(){throw l})}function hh(l,d){var y=d,T=0;do{var z=y.nextSibling;if(l.removeChild(y),z&&z.nodeType===8)if(y=z.data,y==="/$"){if(T===0){l.removeChild(z),Fa(d);return}T--}else y!=="$"&&y!=="$?"&&y!=="$!"||T++;y=z}while(y);Fa(d)}function tl(l){for(;l!=null;l=l.nextSibling){var d=l.nodeType;if(d===1||d===3)break;if(d===8){if(d=l.data,d==="$"||d==="$!"||d==="$?")break;if(d==="/$")return null}}return l}function xf(l){l=l.previousSibling;for(var d=0;l;){if(l.nodeType===8){var y=l.data;if(y==="$"||y==="$!"||y==="$?"){if(d===0)return l;d--}else y==="/$"&&d++}l=l.previousSibling}return null}var nl=Math.random().toString(36).slice(2),Va="__reactFiber$"+nl,Jc="__reactProps$"+nl,ko="__reactContainer$"+nl,bf="__reactEvents$"+nl,wf="__reactListeners$"+nl,Sf="__reactHandles$"+nl;function Ga(l){var d=l[Va];if(d)return d;for(var y=l.parentNode;y;){if(d=y[ko]||y[Va]){if(y=d.alternate,d.child!==null||y!==null&&y.child!==null)for(l=xf(l);l!==null;){if(y=l[Va])return y;l=xf(l)}return d}l=y,y=l.parentNode}return null}function zl(l){return l=l[Va]||l[ko],!l||l.tag!==5&&l.tag!==6&&l.tag!==13&&l.tag!==3?null:l}function fu(l){if(l.tag===5||l.tag===6)return l.stateNode;throw Error(t(33))}function Zc(l){return l[Jc]||null}var fh=[],pu=-1;function Ro(l){return{current:l}}function Zi(l){0>pu||(l.current=fh[pu],fh[pu]=null,pu--)}function zi(l,d){pu++,fh[pu]=l.current,l.current=d}var il={},zs=Ro(il),ei=Ro(!1),rl=il;function _s(l,d){var y=l.type.contextTypes;if(!y)return il;var T=l.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===d)return T.__reactInternalMemoizedMaskedChildContext;var z={},H;for(H in y)z[H]=d[H];return T&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=d,l.__reactInternalMemoizedMaskedChildContext=z),z}function $s(l){return l=l.childContextTypes,l!=null}function ph(){Zi(ei),Zi(zs)}function em(l,d,y){if(zs.current!==il)throw Error(t(168));zi(zs,d),zi(ei,y)}function tm(l,d,y){var T=l.stateNode;if(d=d.childContextTypes,typeof T.getChildContext!="function")return y;T=T.getChildContext();for(var z in T)if(!(z in d))throw Error(t(108,gt(l)||"Unknown",z));return Ce({},y,T)}function mh(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||il,rl=zs.current,zi(zs,l),zi(ei,ei.current),!0}function gh(l,d,y){var T=l.stateNode;if(!T)throw Error(t(169));y?(l=tm(l,d,rl),T.__reactInternalMemoizedMergedChildContext=l,Zi(ei),Zi(zs),zi(zs,l)):Zi(ei),zi(ei,y)}var ms=null,Kc=!1,nc=!1;function Fl(l){ms===null?ms=[l]:ms.push(l)}function nm(l){Kc=!0,Fl(l)}function sl(){if(!nc&&ms!==null){nc=!0;var l=0,d=Qn;try{var y=ms;for(Qn=1;l<y.length;l++){var T=y[l];do T=T(!0);while(T!==null)}ms=null,Kc=!1}catch(z){throw ms!==null&&(ms=ms.slice(l+1)),la(rr,sl),z}finally{Qn=d,nc=!1}}return null}var Ol=[],ic=0,_c=null,$c=0,wa=[],Ha=0,Sa=null,Fs=1,Yn="";function Bl(l,d){Ol[ic++]=$c,Ol[ic++]=_c,_c=l,$c=d}function Gr(l,d,y){wa[Ha++]=Fs,wa[Ha++]=Yn,wa[Ha++]=Sa,Sa=l;var T=Fs;l=Yn;var z=32-Ut(T)-1;T&=~(1<<z),y+=1;var H=32-Ut(d)+z;if(30<H){var ee=z-z%5;H=(T&(1<<ee)-1).toString(32),T>>=ee,z-=ee,Fs=1<<32-Ut(d)+z|y<<z|T,Yn=H+l}else Fs=1<<H|y<<z|T,Yn=l}function Er(l){l.return!==null&&(Bl(l,1),Gr(l,1,0))}function Ef(l){for(;l===_c;)_c=Ol[--ic],Ol[ic]=null,$c=Ol[--ic],Ol[ic]=null;for(;l===Sa;)Sa=wa[--Ha],wa[Ha]=null,Yn=wa[--Ha],wa[Ha]=null,Fs=wa[--Ha],wa[Ha]=null}var gs=null,_r=null,ji=!1,ea=null;function ed(l,d){var y=Pi(5,null,null,0);y.elementType="DELETED",y.stateNode=d,y.return=l,d=l.deletions,d===null?(l.deletions=[y],l.flags|=16):d.push(y)}function vh(l,d){switch(l.tag){case 5:var y=l.type;return d=d.nodeType!==1||y.toLowerCase()!==d.nodeName.toLowerCase()?null:d,d!==null?(l.stateNode=d,gs=l,_r=tl(d.firstChild),!0):!1;case 6:return d=l.pendingProps===""||d.nodeType!==3?null:d,d!==null?(l.stateNode=d,gs=l,_r=null,!0):!1;case 13:return d=d.nodeType!==8?null:d,d!==null?(y=Sa!==null?{id:Fs,overflow:Yn}:null,l.memoizedState={dehydrated:d,treeContext:y,retryLane:1073741824},y=Pi(18,null,null,0),y.stateNode=d,y.return=l,l.child=y,gs=l,_r=null,!0):!1;default:return!1}}function Po(l){return(l.mode&1)!==0&&(l.flags&128)===0}function td(l){if(ji){var d=_r;if(d){var y=d;if(!vh(l,d)){if(Po(l))throw Error(t(418));d=tl(y.nextSibling);var T=gs;d&&vh(l,d)?ed(T,y):(l.flags=l.flags&-4097|2,ji=!1,gs=l)}}else{if(Po(l))throw Error(t(418));l.flags=l.flags&-4097|2,ji=!1,gs=l}}}function nd(l){for(l=l.return;l!==null&&l.tag!==5&&l.tag!==3&&l.tag!==13;)l=l.return;gs=l}function mu(l){if(l!==gs)return!1;if(!ji)return nd(l),ji=!0,!1;var d;if((d=l.tag!==3)&&!(d=l.tag!==5)&&(d=l.type,d=d!=="head"&&d!=="body"&&!Af(l.type,l.memoizedProps)),d&&(d=_r)){if(Po(l))throw yh(),Error(t(418));for(;d;)ed(l,d),d=tl(d.nextSibling)}if(nd(l),l.tag===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(t(317));e:{for(l=l.nextSibling,d=0;l;){if(l.nodeType===8){var y=l.data;if(y==="/$"){if(d===0){_r=tl(l.nextSibling);break e}d--}else y!=="$"&&y!=="$!"&&y!=="$?"||d++}l=l.nextSibling}_r=null}}else _r=gs?tl(l.stateNode.nextSibling):null;return!0}function yh(){for(var l=_r;l;)l=tl(l.nextSibling)}function ua(){_r=gs=null,ji=!1}function id(l){ea===null?ea=[l]:ea.push(l)}var Tf=B.ReactCurrentBatchConfig;function gu(l,d,y){if(l=y.ref,l!==null&&typeof l!="function"&&typeof l!="object"){if(y._owner){if(y=y._owner,y){if(y.tag!==1)throw Error(t(309));var T=y.stateNode}if(!T)throw Error(t(147,l));var z=T,H=""+l;return d!==null&&d.ref!==null&&typeof d.ref=="function"&&d.ref._stringRef===H?d.ref:(d=function(ee){var Te=z.refs;ee===null?delete Te[H]:Te[H]=ee},d._stringRef=H,d)}if(typeof l!="string")throw Error(t(284));if(!y._owner)throw Error(t(290,l))}return l}function Ah(l,d){throw l=Object.prototype.toString.call(d),Error(t(31,l==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":l))}function rd(l){var d=l._init;return d(l._payload)}function jn(l){function d(Ze,a){if(l){var u=Ze.deletions;u===null?(Ze.deletions=[a],Ze.flags|=16):u.push(a)}}function y(Ze,a){if(!l)return null;for(;a!==null;)d(Ze,a),a=a.sibling;return null}function T(Ze,a){for(Ze=new Map;a!==null;)a.key!==null?Ze.set(a.key,a):Ze.set(a.index,a),a=a.sibling;return Ze}function z(Ze,a){return Ze=er(Ze,a),Ze.index=0,Ze.sibling=null,Ze}function H(Ze,a,u){return Ze.index=u,l?(u=Ze.alternate,u!==null?(u=u.index,u<a?(Ze.flags|=2,a):u):(Ze.flags|=2,a)):(Ze.flags|=1048576,a)}function ee(Ze){return l&&Ze.alternate===null&&(Ze.flags|=2),Ze}function Te(Ze,a,u,g){return a===null||a.tag!==6?(a=_l(u,Ze.mode,g),a.return=Ze,a):(a=z(a,u),a.return=Ze,a)}function Le(Ze,a,u,g){var w=u.type;return w===_?Et(Ze,a,u.props.children,g,u.key):a!==null&&(a.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ae&&rd(w)===a.type)?(g=z(a,u.props),g.ref=gu(Ze,a,u),g.return=Ze,g):(g=gr(u.type,u.key,u.props,null,Ze.mode,g),g.ref=gu(Ze,a,u),g.return=Ze,g)}function je(Ze,a,u,g){return a===null||a.tag!==4||a.stateNode.containerInfo!==u.containerInfo||a.stateNode.implementation!==u.implementation?(a=op(u,Ze.mode,g),a.return=Ze,a):(a=z(a,u.children||[]),a.return=Ze,a)}function Et(Ze,a,u,g,w){return a===null||a.tag!==7?(a=Xr(u,Ze.mode,g,w),a.return=Ze,a):(a=z(a,u),a.return=Ze,a)}function Nt(Ze,a,u){if(typeof a=="string"&&a!==""||typeof a=="number")return a=_l(""+a,Ze.mode,u),a.return=Ze,a;if(typeof a=="object"&&a!==null){switch(a.$$typeof){case j:return u=gr(a.type,a.key,a.props,null,Ze.mode,u),u.ref=gu(Ze,null,a),u.return=Ze,u;case q:return a=op(a,Ze.mode,u),a.return=Ze,a;case Ae:var g=a._init;return Nt(Ze,g(a._payload),u)}if($t(a)||ke(a))return a=Xr(a,Ze.mode,u,null),a.return=Ze,a;Ah(Ze,a)}return null}function wt(Ze,a,u,g){var w=a!==null?a.key:null;if(typeof u=="string"&&u!==""||typeof u=="number")return w!==null?null:Te(Ze,a,""+u,g);if(typeof u=="object"&&u!==null){switch(u.$$typeof){case j:return u.key===w?Le(Ze,a,u,g):null;case q:return u.key===w?je(Ze,a,u,g):null;case Ae:return w=u._init,wt(Ze,a,w(u._payload),g)}if($t(u)||ke(u))return w!==null?null:Et(Ze,a,u,g,null);Ah(Ze,u)}return null}function sn(Ze,a,u,g,w){if(typeof g=="string"&&g!==""||typeof g=="number")return Ze=Ze.get(u)||null,Te(a,Ze,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case j:return Ze=Ze.get(g.key===null?u:g.key)||null,Le(a,Ze,g,w);case q:return Ze=Ze.get(g.key===null?u:g.key)||null,je(a,Ze,g,w);case Ae:var D=g._init;return sn(Ze,a,u,D(g._payload),w)}if($t(g)||ke(g))return Ze=Ze.get(u)||null,Et(a,Ze,g,w,null);Ah(a,g)}return null}function vn(Ze,a,u,g){for(var w=null,D=null,F=a,$=a=0,Re=null;F!==null&&$<u.length;$++){F.index>$?(Re=F,F=null):Re=F.sibling;var _e=wt(Ze,F,u[$],g);if(_e===null){F===null&&(F=Re);break}l&&F&&_e.alternate===null&&d(Ze,F),a=H(_e,a,$),D===null?w=_e:D.sibling=_e,D=_e,F=Re}if($===u.length)return y(Ze,F),ji&&Bl(Ze,$),w;if(F===null){for(;$<u.length;$++)F=Nt(Ze,u[$],g),F!==null&&(a=H(F,a,$),D===null?w=F:D.sibling=F,D=F);return ji&&Bl(Ze,$),w}for(F=T(Ze,F);$<u.length;$++)Re=sn(F,Ze,$,u[$],g),Re!==null&&(l&&Re.alternate!==null&&F.delete(Re.key===null?$:Re.key),a=H(Re,a,$),D===null?w=Re:D.sibling=Re,D=Re);return l&&F.forEach(function(Tt){return d(Ze,Tt)}),ji&&Bl(Ze,$),w}function Tn(Ze,a,u,g){var w=ke(u);if(typeof w!="function")throw Error(t(150));if(u=w.call(u),u==null)throw Error(t(151));for(var D=w=null,F=a,$=a=0,Re=null,_e=u.next();F!==null&&!_e.done;$++,_e=u.next()){F.index>$?(Re=F,F=null):Re=F.sibling;var Tt=wt(Ze,F,_e.value,g);if(Tt===null){F===null&&(F=Re);break}l&&F&&Tt.alternate===null&&d(Ze,F),a=H(Tt,a,$),D===null?w=Tt:D.sibling=Tt,D=Tt,F=Re}if(_e.done)return y(Ze,F),ji&&Bl(Ze,$),w;if(F===null){for(;!_e.done;$++,_e=u.next())_e=Nt(Ze,_e.value,g),_e!==null&&(a=H(_e,a,$),D===null?w=_e:D.sibling=_e,D=_e);return ji&&Bl(Ze,$),w}for(F=T(Ze,F);!_e.done;$++,_e=u.next())_e=sn(F,Ze,$,_e.value,g),_e!==null&&(l&&_e.alternate!==null&&F.delete(_e.key===null?$:_e.key),a=H(_e,a,$),D===null?w=_e:D.sibling=_e,D=_e);return l&&F.forEach(function(_t){return d(Ze,_t)}),ji&&Bl(Ze,$),w}function Oi(Ze,a,u,g){if(typeof u=="object"&&u!==null&&u.type===_&&u.key===null&&(u=u.props.children),typeof u=="object"&&u!==null){switch(u.$$typeof){case j:e:{for(var w=u.key,D=a;D!==null;){if(D.key===w){if(w=u.type,w===_){if(D.tag===7){y(Ze,D.sibling),a=z(D,u.props.children),a.return=Ze,Ze=a;break e}}else if(D.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Ae&&rd(w)===D.type){y(Ze,D.sibling),a=z(D,u.props),a.ref=gu(Ze,D,u),a.return=Ze,Ze=a;break e}y(Ze,D);break}else d(Ze,D);D=D.sibling}u.type===_?(a=Xr(u.props.children,Ze.mode,g,u.key),a.return=Ze,Ze=a):(g=gr(u.type,u.key,u.props,null,Ze.mode,g),g.ref=gu(Ze,a,u),g.return=Ze,Ze=g)}return ee(Ze);case q:e:{for(D=u.key;a!==null;){if(a.key===D)if(a.tag===4&&a.stateNode.containerInfo===u.containerInfo&&a.stateNode.implementation===u.implementation){y(Ze,a.sibling),a=z(a,u.children||[]),a.return=Ze,Ze=a;break e}else{y(Ze,a);break}else d(Ze,a);a=a.sibling}a=op(u,Ze.mode,g),a.return=Ze,Ze=a}return ee(Ze);case Ae:return D=u._init,Oi(Ze,a,D(u._payload),g)}if($t(u))return vn(Ze,a,u,g);if(ke(u))return Tn(Ze,a,u,g);Ah(Ze,u)}return typeof u=="string"&&u!==""||typeof u=="number"?(u=""+u,a!==null&&a.tag===6?(y(Ze,a.sibling),a=z(a,u),a.return=Ze,Ze=a):(y(Ze,a),a=_l(u,Ze.mode,g),a.return=Ze,Ze=a),ee(Ze)):y(Ze,a)}return Oi}var rc=jn(!0),Mf=jn(!1),Ul=Ro(null),Vl=null,vu=null,Cf=null;function kf(){Cf=vu=Vl=null}function Rf(l){var d=Ul.current;Zi(Ul),l._currentValue=d}function im(l,d,y){for(;l!==null;){var T=l.alternate;if((l.childLanes&d)!==d?(l.childLanes|=d,T!==null&&(T.childLanes|=d)):T!==null&&(T.childLanes&d)!==d&&(T.childLanes|=d),l===y)break;l=l.return}}function Gl(l,d){Vl=l,Cf=vu=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&d)!==0&&(na=!0),l.firstContext=null)}function Ea(l){var d=l._currentValue;if(Cf!==l)if(l={context:l,memoizedValue:d,next:null},vu===null){if(Vl===null)throw Error(t(308));vu=l,Vl.dependencies={lanes:0,firstContext:l}}else vu=vu.next=l;return d}var al=null;function xh(l){al===null?al=[l]:al.push(l)}function bh(l,d,y,T){var z=d.interleaved;return z===null?(y.next=y,xh(d)):(y.next=z.next,z.next=y),d.interleaved=y,ol(l,T)}function ol(l,d){l.lanes|=d;var y=l.alternate;for(y!==null&&(y.lanes|=d),y=l,l=l.return;l!==null;)l.childLanes|=d,y=l.alternate,y!==null&&(y.childLanes|=d),y=l,l=l.return;return y.tag===3?y.stateNode:null}var Os=!1;function Wa(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $r(l,d){l=l.updateQueue,d.updateQueue===l&&(d.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function es(l,d){return{eventTime:l,lane:d,tag:0,payload:null,callback:null,next:null}}function ur(l,d,y){var T=l.updateQueue;if(T===null)return null;if(T=T.shared,(ri&2)!==0){var z=T.pending;return z===null?d.next=d:(d.next=z.next,z.next=d),T.pending=d,ol(l,y)}return z=T.interleaved,z===null?(d.next=d,xh(T)):(d.next=z.next,z.next=d),T.interleaved=d,ol(l,y)}function sd(l,d,y){if(d=d.updateQueue,d!==null&&(d=d.shared,(y&4194240)!==0)){var T=d.lanes;T&=l.pendingLanes,y|=T,d.lanes=y,Or(l,y)}}function Dg(l,d){var y=l.updateQueue,T=l.alternate;if(T!==null&&(T=T.updateQueue,y===T)){var z=null,H=null;if(y=y.firstBaseUpdate,y!==null){do{var ee={eventTime:y.eventTime,lane:y.lane,tag:y.tag,payload:y.payload,callback:y.callback,next:null};H===null?z=H=ee:H=H.next=ee,y=y.next}while(y!==null);H===null?z=H=d:H=H.next=d}else z=H=d;y={baseState:T.baseState,firstBaseUpdate:z,lastBaseUpdate:H,shared:T.shared,effects:T.effects},l.updateQueue=y;return}l=y.lastBaseUpdate,l===null?y.firstBaseUpdate=d:l.next=d,y.lastBaseUpdate=d}function Tr(l,d,y,T){var z=l.updateQueue;Os=!1;var H=z.firstBaseUpdate,ee=z.lastBaseUpdate,Te=z.shared.pending;if(Te!==null){z.shared.pending=null;var Le=Te,je=Le.next;Le.next=null,ee===null?H=je:ee.next=je,ee=Le;var Et=l.alternate;Et!==null&&(Et=Et.updateQueue,Te=Et.lastBaseUpdate,Te!==ee&&(Te===null?Et.firstBaseUpdate=je:Te.next=je,Et.lastBaseUpdate=Le))}if(H!==null){var Nt=z.baseState;ee=0,Et=je=Le=null,Te=H;do{var wt=Te.lane,sn=Te.eventTime;if((T&wt)===wt){Et!==null&&(Et=Et.next={eventTime:sn,lane:0,tag:Te.tag,payload:Te.payload,callback:Te.callback,next:null});e:{var vn=l,Tn=Te;switch(wt=d,sn=y,Tn.tag){case 1:if(vn=Tn.payload,typeof vn=="function"){Nt=vn.call(sn,Nt,wt);break e}Nt=vn;break e;case 3:vn.flags=vn.flags&-65537|128;case 0:if(vn=Tn.payload,wt=typeof vn=="function"?vn.call(sn,Nt,wt):vn,wt==null)break e;Nt=Ce({},Nt,wt);break e;case 2:Os=!0}}Te.callback!==null&&Te.lane!==0&&(l.flags|=64,wt=z.effects,wt===null?z.effects=[Te]:wt.push(Te))}else sn={eventTime:sn,lane:wt,tag:Te.tag,payload:Te.payload,callback:Te.callback,next:null},Et===null?(je=Et=sn,Le=Nt):Et=Et.next=sn,ee|=wt;if(Te=Te.next,Te===null){if(Te=z.shared.pending,Te===null)break;wt=Te,Te=wt.next,wt.next=null,z.lastBaseUpdate=wt,z.shared.pending=null}}while(!0);if(Et===null&&(Le=Nt),z.baseState=Le,z.firstBaseUpdate=je,z.lastBaseUpdate=Et,d=z.shared.interleaved,d!==null){z=d;do ee|=z.lane,z=z.next;while(z!==d)}else H===null&&(z.shared.lanes=0);Ui|=ee,l.lanes=ee,l.memoizedState=Nt}}function ll(l,d,y){if(l=d.effects,d.effects=null,l!==null)for(d=0;d<l.length;d++){var T=l[d],z=T.callback;if(z!==null){if(T.callback=null,T=y,typeof z!="function")throw Error(t(191,z));z.call(T)}}}var ad={},Io=Ro(ad),od=Ro(ad),sc=Ro(ad);function yu(l){if(l===ad)throw Error(t(174));return l}function ld(l,d){switch(zi(sc,d),zi(od,l),zi(Io,ad),l=d.nodeType,l){case 9:case 11:d=(d=d.documentElement)?d.namespaceURI:J(null,"");break;default:l=l===8?d.parentNode:d,d=l.namespaceURI||null,l=l.tagName,d=J(d,l)}Zi(Io),zi(Io,d)}function Hl(){Zi(Io),Zi(od),Zi(sc)}function rm(l){yu(sc.current);var d=yu(Io.current),y=J(d,l.type);d!==y&&(zi(od,l),zi(Io,y))}function wh(l){od.current===l&&(Zi(Io),Zi(od))}var yr=Ro(0);function ul(l){for(var d=l;d!==null;){if(d.tag===13){var y=d.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||y.data==="$?"||y.data==="$!"))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var cl=[];function Pf(){for(var l=0;l<cl.length;l++)cl[l]._workInProgressVersionPrimary=null;cl.length=0}var If=B.ReactCurrentDispatcher,Df=B.ReactCurrentBatchConfig,so=0,cr=null,Hr=null,ts=null,Au=!1,xu=!1,Wl=0,sm=0;function Bs(){throw Error(t(321))}function Lf(l,d){if(d===null)return!1;for(var y=0;y<d.length&&y<l.length;y++)if(!Ua(l[y],d[y]))return!1;return!0}function Nf(l,d,y,T,z,H){if(so=H,cr=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,If.current=l===null||l.memoizedState===null?Bg:Ug,l=y(T,z),xu){H=0;do{if(xu=!1,Wl=0,25<=H)throw Error(t(301));H+=1,ts=Hr=null,d.updateQueue=null,If.current=oy,l=y(T,z)}while(xu)}if(If.current=Th,d=Hr!==null&&Hr.next!==null,so=0,ts=Hr=cr=null,Au=!1,d)throw Error(t(300));return l}function zf(){var l=Wl!==0;return Wl=0,l}function ao(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ts===null?cr.memoizedState=ts=l:ts=ts.next=l,ts}function qa(){if(Hr===null){var l=cr.alternate;l=l!==null?l.memoizedState:null}else l=Hr.next;var d=ts===null?cr.memoizedState:ts.next;if(d!==null)ts=d,Hr=l;else{if(l===null)throw Error(t(310));Hr=l,l={memoizedState:Hr.memoizedState,baseState:Hr.baseState,baseQueue:Hr.baseQueue,queue:Hr.queue,next:null},ts===null?cr.memoizedState=ts=l:ts=ts.next=l}return ts}function ud(l,d){return typeof d=="function"?d(l):d}function Ff(l){var d=qa(),y=d.queue;if(y===null)throw Error(t(311));y.lastRenderedReducer=l;var T=Hr,z=T.baseQueue,H=y.pending;if(H!==null){if(z!==null){var ee=z.next;z.next=H.next,H.next=ee}T.baseQueue=z=H,y.pending=null}if(z!==null){H=z.next,T=T.baseState;var Te=ee=null,Le=null,je=H;do{var Et=je.lane;if((so&Et)===Et)Le!==null&&(Le=Le.next={lane:0,action:je.action,hasEagerState:je.hasEagerState,eagerState:je.eagerState,next:null}),T=je.hasEagerState?je.eagerState:l(T,je.action);else{var Nt={lane:Et,action:je.action,hasEagerState:je.hasEagerState,eagerState:je.eagerState,next:null};Le===null?(Te=Le=Nt,ee=T):Le=Le.next=Nt,cr.lanes|=Et,Ui|=Et}je=je.next}while(je!==null&&je!==H);Le===null?ee=T:Le.next=Te,Ua(T,d.memoizedState)||(na=!0),d.memoizedState=T,d.baseState=ee,d.baseQueue=Le,y.lastRenderedState=T}if(l=y.interleaved,l!==null){z=l;do H=z.lane,cr.lanes|=H,Ui|=H,z=z.next;while(z!==l)}else z===null&&(y.lanes=0);return[d.memoizedState,y.dispatch]}function am(l){var d=qa(),y=d.queue;if(y===null)throw Error(t(311));y.lastRenderedReducer=l;var T=y.dispatch,z=y.pending,H=d.memoizedState;if(z!==null){y.pending=null;var ee=z=z.next;do H=l(H,ee.action),ee=ee.next;while(ee!==z);Ua(H,d.memoizedState)||(na=!0),d.memoizedState=H,d.baseQueue===null&&(d.baseState=H),y.lastRenderedState=H}return[H,T]}function Of(){}function Bf(l,d){var y=cr,T=qa(),z=d(),H=!Ua(T.memoizedState,z);if(H&&(T.memoizedState=z,na=!0),T=T.queue,Sh(um.bind(null,y,T,l),[l]),T.getSnapshot!==d||H||ts!==null&&ts.memoizedState.tag&1){if(y.flags|=2048,cd(9,lm.bind(null,y,T,z,d),void 0,null),kr===null)throw Error(t(349));(so&30)!==0||om(y,d,z)}return z}function om(l,d,y){l.flags|=16384,l={getSnapshot:d,value:y},d=cr.updateQueue,d===null?(d={lastEffect:null,stores:null},cr.updateQueue=d,d.stores=[l]):(y=d.stores,y===null?d.stores=[l]:y.push(l))}function lm(l,d,y,T){d.value=y,d.getSnapshot=T,Lg(d)&&cm(l)}function um(l,d,y){return y(function(){Lg(d)&&cm(l)})}function Lg(l){var d=l.getSnapshot;l=l.value;try{var y=d();return!Ua(l,y)}catch{return!0}}function cm(l){var d=ol(l,1);d!==null&&bs(d,l,1,-1)}function Uf(l){var d=ao();return typeof l=="function"&&(l=l()),d.memoizedState=d.baseState=l,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ud,lastRenderedState:l},d.queue=l,l=l.dispatch=Fg.bind(null,cr,l),[d.memoizedState,l]}function cd(l,d,y,T){return l={tag:l,create:d,destroy:y,deps:T,next:null},d=cr.updateQueue,d===null?(d={lastEffect:null,stores:null},cr.updateQueue=d,d.lastEffect=l.next=l):(y=d.lastEffect,y===null?d.lastEffect=l.next=l:(T=y.next,y.next=l,l.next=T,d.lastEffect=l)),l}function dm(){return qa().memoizedState}function dd(l,d,y,T){var z=ao();cr.flags|=l,z.memoizedState=cd(1|d,y,void 0,T===void 0?null:T)}function hd(l,d,y,T){var z=qa();T=T===void 0?null:T;var H=void 0;if(Hr!==null){var ee=Hr.memoizedState;if(H=ee.destroy,T!==null&&Lf(T,ee.deps)){z.memoizedState=cd(d,y,H,T);return}}cr.flags|=l,z.memoizedState=cd(1|d,y,H,T)}function Vf(l,d){return dd(8390656,8,l,d)}function Sh(l,d){return hd(2048,8,l,d)}function Eh(l,d){return hd(4,2,l,d)}function hm(l,d){return hd(4,4,l,d)}function fm(l,d){if(typeof d=="function")return l=l(),d(l),function(){d(null)};if(d!=null)return l=l(),d.current=l,function(){d.current=null}}function Ng(l,d,y){return y=y!=null?y.concat([l]):null,hd(4,4,fm.bind(null,d,l),y)}function Gf(){}function Hf(l,d){var y=qa();d=d===void 0?null:d;var T=y.memoizedState;return T!==null&&d!==null&&Lf(d,T[1])?T[0]:(y.memoizedState=[l,d],l)}function pm(l,d){var y=qa();d=d===void 0?null:d;var T=y.memoizedState;return T!==null&&d!==null&&Lf(d,T[1])?T[0]:(l=l(),y.memoizedState=[l,d],l)}function mm(l,d,y){return(so&21)===0?(l.baseState&&(l.baseState=!1,na=!0),l.memoizedState=y):(Ua(y,d)||(y=Kt(),cr.lanes|=y,Ui|=y,l.baseState=!0),d)}function ay(l,d){var y=Qn;Qn=y!==0&&4>y?y:4,l(!0);var T=Df.transition;Df.transition={};try{l(!1),d()}finally{Qn=y,Df.transition=T}}function gm(){return qa().memoizedState}function zg(l,d,y){var T=Ya(l);if(y={lane:T,action:y,hasEagerState:!1,eagerState:null,next:null},vm(l))Og(d,y);else if(y=bh(l,d,y,T),y!==null){var z=zr();bs(y,l,T,z),ym(y,d,T)}}function Fg(l,d,y){var T=Ya(l),z={lane:T,action:y,hasEagerState:!1,eagerState:null,next:null};if(vm(l))Og(d,z);else{var H=l.alternate;if(l.lanes===0&&(H===null||H.lanes===0)&&(H=d.lastRenderedReducer,H!==null))try{var ee=d.lastRenderedState,Te=H(ee,y);if(z.hasEagerState=!0,z.eagerState=Te,Ua(Te,ee)){var Le=d.interleaved;Le===null?(z.next=z,xh(d)):(z.next=Le.next,Le.next=z),d.interleaved=z;return}}catch{}finally{}y=bh(l,d,z,T),y!==null&&(z=zr(),bs(y,l,T,z),ym(y,d,T))}}function vm(l){var d=l.alternate;return l===cr||d!==null&&d===cr}function Og(l,d){xu=Au=!0;var y=l.pending;y===null?d.next=d:(d.next=y.next,y.next=d),l.pending=d}function ym(l,d,y){if((y&4194240)!==0){var T=d.lanes;T&=l.pendingLanes,y|=T,d.lanes=y,Or(l,y)}}var Th={readContext:Ea,useCallback:Bs,useContext:Bs,useEffect:Bs,useImperativeHandle:Bs,useInsertionEffect:Bs,useLayoutEffect:Bs,useMemo:Bs,useReducer:Bs,useRef:Bs,useState:Bs,useDebugValue:Bs,useDeferredValue:Bs,useTransition:Bs,useMutableSource:Bs,useSyncExternalStore:Bs,useId:Bs,unstable_isNewReconciler:!1},Bg={readContext:Ea,useCallback:function(l,d){return ao().memoizedState=[l,d===void 0?null:d],l},useContext:Ea,useEffect:Vf,useImperativeHandle:function(l,d,y){return y=y!=null?y.concat([l]):null,dd(4194308,4,fm.bind(null,d,l),y)},useLayoutEffect:function(l,d){return dd(4194308,4,l,d)},useInsertionEffect:function(l,d){return dd(4,2,l,d)},useMemo:function(l,d){var y=ao();return d=d===void 0?null:d,l=l(),y.memoizedState=[l,d],l},useReducer:function(l,d,y){var T=ao();return d=y!==void 0?y(d):d,T.memoizedState=T.baseState=d,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:d},T.queue=l,l=l.dispatch=zg.bind(null,cr,l),[T.memoizedState,l]},useRef:function(l){var d=ao();return l={current:l},d.memoizedState=l},useState:Uf,useDebugValue:Gf,useDeferredValue:function(l){return ao().memoizedState=l},useTransition:function(){var l=Uf(!1),d=l[0];return l=ay.bind(null,l[1]),ao().memoizedState=l,[d,l]},useMutableSource:function(){},useSyncExternalStore:function(l,d,y){var T=cr,z=ao();if(ji){if(y===void 0)throw Error(t(407));y=y()}else{if(y=d(),kr===null)throw Error(t(349));(so&30)!==0||om(T,d,y)}z.memoizedState=y;var H={value:y,getSnapshot:d};return z.queue=H,Vf(um.bind(null,T,H,l),[l]),T.flags|=2048,cd(9,lm.bind(null,T,H,y,d),void 0,null),y},useId:function(){var l=ao(),d=kr.identifierPrefix;if(ji){var y=Yn,T=Fs;y=(T&~(1<<32-Ut(T)-1)).toString(32)+y,d=":"+d+"R"+y,y=Wl++,0<y&&(d+="H"+y.toString(32)),d+=":"}else y=sm++,d=":"+d+"r"+y.toString(32)+":";return l.memoizedState=d},unstable_isNewReconciler:!1},Ug={readContext:Ea,useCallback:Hf,useContext:Ea,useEffect:Sh,useImperativeHandle:Ng,useInsertionEffect:Eh,useLayoutEffect:hm,useMemo:pm,useReducer:Ff,useRef:dm,useState:function(){return Ff(ud)},useDebugValue:Gf,useDeferredValue:function(l){var d=qa();return mm(d,Hr.memoizedState,l)},useTransition:function(){var l=Ff(ud)[0],d=qa().memoizedState;return[l,d]},useMutableSource:Of,useSyncExternalStore:Bf,useId:gm,unstable_isNewReconciler:!1},oy={readContext:Ea,useCallback:Hf,useContext:Ea,useEffect:Sh,useImperativeHandle:Ng,useInsertionEffect:Eh,useLayoutEffect:hm,useMemo:pm,useReducer:am,useRef:dm,useState:function(){return am(ud)},useDebugValue:Gf,useDeferredValue:function(l){var d=qa();return Hr===null?d.memoizedState=l:mm(d,Hr.memoizedState,l)},useTransition:function(){var l=am(ud)[0],d=qa().memoizedState;return[l,d]},useMutableSource:Of,useSyncExternalStore:Bf,useId:gm,unstable_isNewReconciler:!1};function Wr(l,d){if(l&&l.defaultProps){d=Ce({},d),l=l.defaultProps;for(var y in l)d[y]===void 0&&(d[y]=l[y]);return d}return d}function Do(l,d,y,T){d=l.memoizedState,y=y(T,d),y=y==null?d:Ce({},d,y),l.memoizedState=y,l.lanes===0&&(l.updateQueue.baseState=y)}var dl={isMounted:function(l){return(l=l._reactInternals)?tn(l)===l:!1},enqueueSetState:function(l,d,y){l=l._reactInternals;var T=zr(),z=Ya(l),H=es(T,z);H.payload=d,y!=null&&(H.callback=y),d=ur(l,H,z),d!==null&&(bs(d,l,z,T),sd(d,l,z))},enqueueReplaceState:function(l,d,y){l=l._reactInternals;var T=zr(),z=Ya(l),H=es(T,z);H.tag=1,H.payload=d,y!=null&&(H.callback=y),d=ur(l,H,z),d!==null&&(bs(d,l,z,T),sd(d,l,z))},enqueueForceUpdate:function(l,d){l=l._reactInternals;var y=zr(),T=Ya(l),z=es(y,T);z.tag=2,d!=null&&(z.callback=d),d=ur(l,z,T),d!==null&&(bs(d,l,T,y),sd(d,l,T))}};function bu(l,d,y,T,z,H,ee){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(T,H,ee):d.prototype&&d.prototype.isPureReactComponent?!Qu(y,T)||!Qu(z,H):!0}function Am(l,d,y){var T=!1,z=il,H=d.contextType;return typeof H=="object"&&H!==null?H=Ea(H):(z=$s(d)?rl:zs.current,T=d.contextTypes,H=(T=T!=null)?_s(l,z):il),d=new d(y,H),l.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=dl,l.stateNode=d,d._reactInternals=l,T&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=z,l.__reactInternalMemoizedMaskedChildContext=H),d}function xm(l,d,y,T){l=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(y,T),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(y,T),d.state!==l&&dl.enqueueReplaceState(d,d.state,null)}function Wf(l,d,y,T){var z=l.stateNode;z.props=y,z.state=l.memoizedState,z.refs={},Wa(l);var H=d.contextType;typeof H=="object"&&H!==null?z.context=Ea(H):(H=$s(d)?rl:zs.current,z.context=_s(l,H)),z.state=l.memoizedState,H=d.getDerivedStateFromProps,typeof H=="function"&&(Do(l,d,H,y),z.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof z.getSnapshotBeforeUpdate=="function"||typeof z.UNSAFE_componentWillMount!="function"&&typeof z.componentWillMount!="function"||(d=z.state,typeof z.componentWillMount=="function"&&z.componentWillMount(),typeof z.UNSAFE_componentWillMount=="function"&&z.UNSAFE_componentWillMount(),d!==z.state&&dl.enqueueReplaceState(z,z.state,null),Tr(l,y,z,T),z.state=l.memoizedState),typeof z.componentDidMount=="function"&&(l.flags|=4194308)}function ac(l,d){try{var y="",T=d;do y+=Ct(T),T=T.return;while(T);var z=y}catch(H){z=`
40
40
  Error generating stack: `+H.message+`
41
- `+H.stack}return{value:l,source:d,stack:z,digest:null}}function qf(l,d,y){return{value:l,source:null,stack:y??null,digest:d??null}}function jf(l,d){try{console.error(d.value)}catch(y){setTimeout(function(){throw y})}}var Vg=typeof WeakMap=="function"?WeakMap:Map;function bm(l,d,y){y=es(-1,y),y.tag=3,y.payload={element:null};var T=d.value;return y.callback=function(){pc||(pc=!0,Xl=T),jf(l,d)},y}function wm(l,d,y){y=es(-1,y),y.tag=3;var T=l.type.getDerivedStateFromError;if(typeof T=="function"){var z=d.value;y.payload=function(){return T(z)},y.callback=function(){jf(l,d)}}var H=l.stateNode;return H!==null&&typeof H.componentDidCatch=="function"&&(y.callback=function(){jf(l,d),typeof T!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var ee=d.stack;this.componentDidCatch(d.value,{componentStack:ee!==null?ee:""})}),y}function Xf(l,d,y){var T=l.pingCache;if(T===null){T=l.pingCache=new Vg;var z=new Set;T.set(d,z)}else z=T.get(d),z===void 0&&(z=new Set,T.set(d,z));z.has(y)||(z.add(y),l=rp.bind(null,l,d,y),d.then(l,l))}function Gg(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function ta(l,d,y,T,z){return(l.mode&1)===0?(l===d?l.flags|=65536:(l.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(d=es(-1,1),d.tag=2,ur(y,d,1))),y.lanes|=1),l):(l.flags|=65536,l.lanes=z,l)}var oo=B.ReactCurrentOwner,na=!1;function ns(l,d,y,T){d.child=l===null?Mf(d,null,y,T):rc(d,l.child,y,T)}function Yf(l,d,y,T,z){y=y.render;var H=d.ref;return Gl(d,z),T=Nf(l,d,y,T,H,z),y=zf(),l!==null&&!na?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~z,Cr(l,d,z)):(ji&&y&&Er(d),d.flags|=1,ns(l,d,T,z),d.child)}function oc(l,d,y,T,z){if(l===null){var H=y.type;return typeof H=="function"&&!Md(H)&&H.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(d.tag=15,d.type=H,Qf(l,d,H,T,z)):(l=gr(y.type,null,T,d,d.mode,z),l.ref=d.ref,l.return=d,d.child=l)}if(H=l.child,(l.lanes&z)===0){var ee=H.memoizedProps;if(y=y.compare,y=y!==null?y:Qu,y(ee,T)&&l.ref===d.ref)return Cr(l,d,z)}return d.flags|=1,l=er(H,T),l.ref=d.ref,l.return=d,d.child=l}function Qf(l,d,y,T,z){if(l!==null){var H=l.memoizedProps;if(Qu(H,T)&&l.ref===d.ref)if(na=!1,d.pendingProps=T=H,(l.lanes&z)!==0)(l.flags&131072)!==0&&(na=!0);else return d.lanes=l.lanes,Cr(l,d,z)}return Mh(l,d,y,T,z)}function Sm(l,d,y){var T=d.pendingProps,z=T.children,H=l!==null?l.memoizedState:null;if(T.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},zi(hc,Rr),Rr|=y;else{if((y&1073741824)===0)return l=H!==null?H.baseLanes|y:y,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,zi(hc,Rr),Rr|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},T=H!==null?H.baseLanes:y,zi(hc,Rr),Rr|=T}else H!==null?(T=H.baseLanes|y,d.memoizedState=null):T=y,zi(hc,Rr),Rr|=T;return ns(l,d,z,y),d.child}function Jf(l,d){var y=d.ref;(l===null&&y!==null||l!==null&&l.ref!==y)&&(d.flags|=512,d.flags|=2097152)}function Mh(l,d,y,T,z){var H=$s(y)?rl:zs.current;return H=_s(d,H),Gl(d,z),y=Nf(l,d,y,T,H,z),T=zf(),l!==null&&!na?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~z,Cr(l,d,z)):(ji&&T&&Er(d),d.flags|=1,ns(l,d,y,z),d.child)}function Em(l,d,y,T,z){if($s(y)){var H=!0;mh(d)}else H=!1;if(Gl(d,z),d.stateNode===null)hl(l,d),Am(d,y,T),Wf(d,y,T,z),T=!0;else if(l===null){var ee=d.stateNode,Te=d.memoizedProps;ee.props=Te;var Le=ee.context,je=y.contextType;typeof je=="object"&&je!==null?je=Ea(je):(je=$s(y)?rl:zs.current,je=_s(d,je));var Et=y.getDerivedStateFromProps,Nt=typeof Et=="function"||typeof ee.getSnapshotBeforeUpdate=="function";Nt||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(Te!==T||Le!==je)&&xm(d,ee,T,je),Os=!1;var wt=d.memoizedState;ee.state=wt,Tr(d,T,ee,z),Le=d.memoizedState,Te!==T||wt!==Le||ei.current||Os?(typeof Et=="function"&&(Do(d,y,Et,T),Le=d.memoizedState),(Te=Os||bu(d,y,Te,T,wt,Le,je))?(Nt||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount()),typeof ee.componentDidMount=="function"&&(d.flags|=4194308)):(typeof ee.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=T,d.memoizedState=Le),ee.props=T,ee.state=Le,ee.context=je,T=Te):(typeof ee.componentDidMount=="function"&&(d.flags|=4194308),T=!1)}else{ee=d.stateNode,$r(l,d),Te=d.memoizedProps,je=d.type===d.elementType?Te:Wr(d.type,Te),ee.props=je,Nt=d.pendingProps,wt=ee.context,Le=y.contextType,typeof Le=="object"&&Le!==null?Le=Ea(Le):(Le=$s(y)?rl:zs.current,Le=_s(d,Le));var sn=y.getDerivedStateFromProps;(Et=typeof sn=="function"||typeof ee.getSnapshotBeforeUpdate=="function")||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(Te!==Nt||wt!==Le)&&xm(d,ee,T,Le),Os=!1,wt=d.memoizedState,ee.state=wt,Tr(d,T,ee,z);var vn=d.memoizedState;Te!==Nt||wt!==vn||ei.current||Os?(typeof sn=="function"&&(Do(d,y,sn,T),vn=d.memoizedState),(je=Os||bu(d,y,je,T,wt,vn,Le)||!1)?(Et||typeof ee.UNSAFE_componentWillUpdate!="function"&&typeof ee.componentWillUpdate!="function"||(typeof ee.componentWillUpdate=="function"&&ee.componentWillUpdate(T,vn,Le),typeof ee.UNSAFE_componentWillUpdate=="function"&&ee.UNSAFE_componentWillUpdate(T,vn,Le)),typeof ee.componentDidUpdate=="function"&&(d.flags|=4),typeof ee.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof ee.componentDidUpdate!="function"||Te===l.memoizedProps&&wt===l.memoizedState||(d.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||Te===l.memoizedProps&&wt===l.memoizedState||(d.flags|=1024),d.memoizedProps=T,d.memoizedState=vn),ee.props=T,ee.state=vn,ee.context=Le,T=je):(typeof ee.componentDidUpdate!="function"||Te===l.memoizedProps&&wt===l.memoizedState||(d.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||Te===l.memoizedProps&&wt===l.memoizedState||(d.flags|=1024),T=!1)}return Zf(l,d,y,T,H,z)}function Zf(l,d,y,T,z,H){Jf(l,d);var ee=(d.flags&128)!==0;if(!T&&!ee)return z&&gh(d,y,!1),Cr(l,d,H);T=d.stateNode,oo.current=d;var Te=ee&&typeof y.getDerivedStateFromError!="function"?null:T.render();return d.flags|=1,l!==null&&ee?(d.child=rc(d,l.child,null,H),d.child=rc(d,null,Te,H)):ns(l,d,Te,H),d.memoizedState=T.state,z&&gh(d,y,!0),d.child}function Kf(l){var d=l.stateNode;d.pendingContext?em(l,d.pendingContext,d.pendingContext!==d.context):d.context&&em(l,d.context,!1),ld(l,d.containerInfo)}function _f(l,d,y,T,z){return ua(),id(z),d.flags|=256,ns(l,d,y,T),d.child}var $f={dehydrated:null,treeContext:null,retryLane:0};function Mr(l){return{baseLanes:l,cachePool:null,transitions:null}}function ep(l,d,y){var T=d.pendingProps,z=yr.current,H=!1,ee=(d.flags&128)!==0,Te;if((Te=ee)||(Te=l!==null&&l.memoizedState===null?!1:(z&2)!==0),Te?(H=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(z|=1),zi(yr,z&1),l===null)return td(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((d.mode&1)===0?d.lanes=1:l.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(ee=T.children,l=T.fallback,H?(T=d.mode,H=d.child,ee={mode:"hidden",children:ee},(T&1)===0&&H!==null?(H.childLanes=0,H.pendingProps=ee):H=ca(ee,T,0,null),l=Xr(l,T,y,null),H.return=d,l.return=d,H.sibling=l,d.child=H,d.child.memoizedState=Mr(y),d.memoizedState=$f,l):fd(d,ee));if(z=l.memoizedState,z!==null&&(Te=z.dehydrated,Te!==null))return Tm(l,d,ee,T,Te,z,y);if(H){H=T.fallback,ee=d.mode,z=l.child,Te=z.sibling;var Le={mode:"hidden",children:T.children};return(ee&1)===0&&d.child!==z?(T=d.child,T.childLanes=0,T.pendingProps=Le,d.deletions=null):(T=er(z,Le),T.subtreeFlags=z.subtreeFlags&14680064),Te!==null?H=er(Te,H):(H=Xr(H,ee,y,null),H.flags|=2),H.return=d,T.return=d,T.sibling=H,d.child=T,T=H,H=d.child,ee=l.child.memoizedState,ee=ee===null?Mr(y):{baseLanes:ee.baseLanes|y,cachePool:null,transitions:ee.transitions},H.memoizedState=ee,H.childLanes=l.childLanes&~y,d.memoizedState=$f,T}return H=l.child,l=H.sibling,T=er(H,{mode:"visible",children:T.children}),(d.mode&1)===0&&(T.lanes=y),T.return=d,T.sibling=null,l!==null&&(y=d.deletions,y===null?(d.deletions=[l],d.flags|=16):y.push(l)),d.child=T,d.memoizedState=null,T}function fd(l,d){return d=ca({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function pd(l,d,y,T){return T!==null&&id(T),rc(d,l.child,null,y),l=fd(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function Tm(l,d,y,T,z,H,ee){if(y)return d.flags&256?(d.flags&=-257,T=qf(Error(t(422))),pd(l,d,ee,T)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(H=T.fallback,z=d.mode,T=ca({mode:"visible",children:T.children},z,0,null),H=Xr(H,z,ee,null),H.flags|=2,T.return=d,H.return=d,T.sibling=H,d.child=T,(d.mode&1)!==0&&rc(d,l.child,null,ee),d.child.memoizedState=Mr(ee),d.memoizedState=$f,H);if((d.mode&1)===0)return pd(l,d,ee,null);if(z.data==="$!"){if(T=z.nextSibling&&z.nextSibling.dataset,T)var Te=T.dgst;return T=Te,H=Error(t(419)),T=qf(H,T,void 0),pd(l,d,ee,T)}if(Te=(ee&l.childLanes)!==0,na||Te){if(T=kr,T!==null){switch(ee&-ee){case 4:z=2;break;case 16:z=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:z=32;break;case 536870912:z=268435456;break;default:z=0}z=(z&(T.suspendedLanes|ee))!==0?0:z,z!==0&&z!==H.retryLane&&(H.retryLane=z,ol(l,z),bs(T,l,z,-1))}return Fi(),T=qf(Error(t(421))),pd(l,d,ee,T)}return z.data==="$?"?(d.flags|=128,d.child=l.child,d=sp.bind(null,l),z._reactRetry=d,null):(l=H.treeContext,_r=tl(z.nextSibling),gs=d,ji=!0,ea=null,l!==null&&(wa[Ha++]=Fs,wa[Ha++]=Yn,wa[Ha++]=Sa,Fs=l.id,Yn=l.overflow,Sa=d),d=fd(d,T.children),d.flags|=4096,d)}function wu(l,d,y){l.lanes|=d;var T=l.alternate;T!==null&&(T.lanes|=d),im(l.return,d,y)}function md(l,d,y,T,z){var H=l.memoizedState;H===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:T,tail:y,tailMode:z}:(H.isBackwards=d,H.rendering=null,H.renderingStartTime=0,H.last=T,H.tail=y,H.tailMode=z)}function ql(l,d,y){var T=d.pendingProps,z=T.revealOrder,H=T.tail;if(ns(l,d,T.children,y),T=yr.current,(T&2)!==0)T=T&1|2,d.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&wu(l,y,d);else if(l.tag===19)wu(l,y,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}T&=1}if(zi(yr,T),(d.mode&1)===0)d.memoizedState=null;else switch(z){case"forwards":for(y=d.child,z=null;y!==null;)l=y.alternate,l!==null&&ul(l)===null&&(z=y),y=y.sibling;y=z,y===null?(z=d.child,d.child=null):(z=y.sibling,y.sibling=null),md(d,!1,z,y,H);break;case"backwards":for(y=null,z=d.child,d.child=null;z!==null;){if(l=z.alternate,l!==null&&ul(l)===null){d.child=z;break}l=z.sibling,z.sibling=y,y=z,z=l}md(d,!0,y,null,H);break;case"together":md(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function hl(l,d){(d.mode&1)===0&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function Cr(l,d,y){if(l!==null&&(d.dependencies=l.dependencies),Ui|=d.lanes,(y&d.childLanes)===0)return null;if(l!==null&&d.child!==l.child)throw Error(t(153));if(d.child!==null){for(l=d.child,y=er(l,l.pendingProps),d.child=y,y.return=d;l.sibling!==null;)l=l.sibling,y=y.sibling=er(l,l.pendingProps),y.return=d;y.sibling=null}return d.child}function ly(l,d,y){switch(d.tag){case 3:Kf(d),ua();break;case 5:rm(d);break;case 1:$s(d.type)&&mh(d);break;case 4:ld(d,d.stateNode.containerInfo);break;case 10:var T=d.type._context,z=d.memoizedProps.value;zi(Ul,T._currentValue),T._currentValue=z;break;case 13:if(T=d.memoizedState,T!==null)return T.dehydrated!==null?(zi(yr,yr.current&1),d.flags|=128,null):(y&d.child.childLanes)!==0?ep(l,d,y):(zi(yr,yr.current&1),l=Cr(l,d,y),l!==null?l.sibling:null);zi(yr,yr.current&1);break;case 19:if(T=(y&d.childLanes)!==0,(l.flags&128)!==0){if(T)return ql(l,d,y);d.flags|=128}if(z=d.memoizedState,z!==null&&(z.rendering=null,z.tail=null,z.lastEffect=null),zi(yr,yr.current),T)break;return null;case 22:case 23:return d.lanes=0,Sm(l,d,y)}return Cr(l,d,y)}var tp,lc,gd,vd;tp=function(l,d){for(var y=d.child;y!==null;){if(y.tag===5||y.tag===6)l.appendChild(y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===d)break;for(;y.sibling===null;){if(y.return===null||y.return===d)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},lc=function(){},gd=function(l,d,y,T){var z=l.memoizedProps;if(z!==T){l=d.stateNode,yu(Io.current);var H=null;switch(y){case"input":z=dt(l,z),T=dt(l,T),H=[];break;case"select":z=Ce({},z,{value:void 0}),T=Ce({},T,{value:void 0}),H=[];break;case"textarea":z=yt(l,z),T=yt(l,T),H=[];break;default:typeof z.onClick!="function"&&typeof T.onClick=="function"&&(l.onclick=ps)}Mn(y,T);var ee;y=null;for(je in z)if(!T.hasOwnProperty(je)&&z.hasOwnProperty(je)&&z[je]!=null)if(je==="style"){var Te=z[je];for(ee in Te)Te.hasOwnProperty(ee)&&(y||(y={}),y[ee]="")}else je!=="dangerouslySetInnerHTML"&&je!=="children"&&je!=="suppressContentEditableWarning"&&je!=="suppressHydrationWarning"&&je!=="autoFocus"&&(r.hasOwnProperty(je)?H||(H=[]):(H=H||[]).push(je,null));for(je in T){var Le=T[je];if(Te=z?.[je],T.hasOwnProperty(je)&&Le!==Te&&(Le!=null||Te!=null))if(je==="style")if(Te){for(ee in Te)!Te.hasOwnProperty(ee)||Le&&Le.hasOwnProperty(ee)||(y||(y={}),y[ee]="");for(ee in Le)Le.hasOwnProperty(ee)&&Te[ee]!==Le[ee]&&(y||(y={}),y[ee]=Le[ee])}else y||(H||(H=[]),H.push(je,y)),y=Le;else je==="dangerouslySetInnerHTML"?(Le=Le?Le.__html:void 0,Te=Te?Te.__html:void 0,Le!=null&&Te!==Le&&(H=H||[]).push(je,Le)):je==="children"?typeof Le!="string"&&typeof Le!="number"||(H=H||[]).push(je,""+Le):je!=="suppressContentEditableWarning"&&je!=="suppressHydrationWarning"&&(r.hasOwnProperty(je)?(Le!=null&&je==="onScroll"&&Di("scroll",l),H||Te===Le||(H=[])):(H=H||[]).push(je,Le))}y&&(H=H||[]).push("style",y);var je=H;(d.updateQueue=je)&&(d.flags|=4)}},vd=function(l,d,y,T){y!==T&&(d.flags|=4)};function Su(l,d){if(!ji)switch(l.tailMode){case"hidden":d=l.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?l.tail=null:y.sibling=null;break;case"collapsed":y=l.tail;for(var T=null;y!==null;)y.alternate!==null&&(T=y),y=y.sibling;T===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:T.sibling=null}}function is(l){var d=l.alternate!==null&&l.alternate.child===l.child,y=0,T=0;if(d)for(var z=l.child;z!==null;)y|=z.lanes|z.childLanes,T|=z.subtreeFlags&14680064,T|=z.flags&14680064,z.return=l,z=z.sibling;else for(z=l.child;z!==null;)y|=z.lanes|z.childLanes,T|=z.subtreeFlags,T|=z.flags,z.return=l,z=z.sibling;return l.subtreeFlags|=T,l.childLanes=y,d}function Hg(l,d,y){var T=d.pendingProps;switch(Ef(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return is(d),null;case 1:return $s(d.type)&&ph(),is(d),null;case 3:return T=d.stateNode,Hl(),Zi(ei),Zi(zs),Pf(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(l===null||l.child===null)&&(mu(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,ea!==null&&(Ed(ea),ea=null))),lc(l,d),is(d),null;case 5:wh(d);var z=yu(sc.current);if(y=d.type,l!==null&&d.stateNode!=null)gd(l,d,y,T,z),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!T){if(d.stateNode===null)throw Error(t(166));return is(d),null}if(l=yu(Io.current),mu(d)){T=d.stateNode,y=d.type;var H=d.memoizedProps;switch(T[Va]=d,T[Jc]=H,l=(d.mode&1)!==0,y){case"dialog":Di("cancel",T),Di("close",T);break;case"iframe":case"object":case"embed":Di("load",T);break;case"video":case"audio":for(z=0;z<Ks.length;z++)Di(Ks[z],T);break;case"source":Di("error",T);break;case"img":case"image":case"link":Di("error",T),Di("load",T);break;case"details":Di("toggle",T);break;case"input":it(T,H),Di("invalid",T);break;case"select":T._wrapperState={wasMultiple:!!H.multiple},Di("invalid",T);break;case"textarea":be(T,H),Di("invalid",T)}Mn(y,H),z=null;for(var ee in H)if(H.hasOwnProperty(ee)){var Te=H[ee];ee==="children"?typeof Te=="string"?T.textContent!==Te&&(H.suppressHydrationWarning!==!0&&Qc(T.textContent,Te,l),z=["children",Te]):typeof Te=="number"&&T.textContent!==""+Te&&(H.suppressHydrationWarning!==!0&&Qc(T.textContent,Te,l),z=["children",""+Te]):r.hasOwnProperty(ee)&&Te!=null&&ee==="onScroll"&&Di("scroll",T)}switch(y){case"input":hn(T),Gt(T,H,!0);break;case"textarea":hn(T),qn(T);break;case"select":case"option":break;default:typeof H.onClick=="function"&&(T.onclick=ps)}T=z,d.updateQueue=T,T!==null&&(d.flags|=4)}else{ee=z.nodeType===9?z:z.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=de(y)),l==="http://www.w3.org/1999/xhtml"?y==="script"?(l=ee.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof T.is=="string"?l=ee.createElement(y,{is:T.is}):(l=ee.createElement(y),y==="select"&&(ee=l,T.multiple?ee.multiple=!0:T.size&&(ee.size=T.size))):l=ee.createElementNS(l,y),l[Va]=d,l[Jc]=T,tp(l,d,!1,!1),d.stateNode=l;e:{switch(ee=Dt(y,T),y){case"dialog":Di("cancel",l),Di("close",l),z=T;break;case"iframe":case"object":case"embed":Di("load",l),z=T;break;case"video":case"audio":for(z=0;z<Ks.length;z++)Di(Ks[z],l);z=T;break;case"source":Di("error",l),z=T;break;case"img":case"image":case"link":Di("error",l),Di("load",l),z=T;break;case"details":Di("toggle",l),z=T;break;case"input":it(l,T),z=dt(l,T),Di("invalid",l);break;case"option":z=T;break;case"select":l._wrapperState={wasMultiple:!!T.multiple},z=Ce({},T,{value:void 0}),Di("invalid",l);break;case"textarea":be(l,T),z=yt(l,T),Di("invalid",l);break;default:z=T}Mn(y,z),Te=z;for(H in Te)if(Te.hasOwnProperty(H)){var Le=Te[H];H==="style"?At(l,Le):H==="dangerouslySetInnerHTML"?(Le=Le?Le.__html:void 0,Le!=null&&Ye(l,Le)):H==="children"?typeof Le=="string"?(y!=="textarea"||Le!=="")&&at(l,Le):typeof Le=="number"&&at(l,""+Le):H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&H!=="autoFocus"&&(r.hasOwnProperty(H)?Le!=null&&H==="onScroll"&&Di("scroll",l):Le!=null&&W(l,H,Le,ee))}switch(y){case"input":hn(l),Gt(l,T,!1);break;case"textarea":hn(l),qn(l);break;case"option":T.value!=null&&l.setAttribute("value",""+tt(T.value));break;case"select":l.multiple=!!T.multiple,H=T.value,H!=null?yn(l,!!T.multiple,H,!1):T.defaultValue!=null&&yn(l,!!T.multiple,T.defaultValue,!0);break;default:typeof z.onClick=="function"&&(l.onclick=ps)}switch(y){case"button":case"input":case"select":case"textarea":T=!!T.autoFocus;break e;case"img":T=!0;break e;default:T=!1}}T&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return is(d),null;case 6:if(l&&d.stateNode!=null)vd(l,d,l.memoizedProps,T);else{if(typeof T!="string"&&d.stateNode===null)throw Error(t(166));if(y=yu(sc.current),yu(Io.current),mu(d)){if(T=d.stateNode,y=d.memoizedProps,T[Va]=d,(H=T.nodeValue!==y)&&(l=gs,l!==null))switch(l.tag){case 3:Qc(T.nodeValue,y,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Qc(T.nodeValue,y,(l.mode&1)!==0)}H&&(d.flags|=4)}else T=(y.nodeType===9?y:y.ownerDocument).createTextNode(T),T[Va]=d,d.stateNode=T}return is(d),null;case 13:if(Zi(yr),T=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(ji&&_r!==null&&(d.mode&1)!==0&&(d.flags&128)===0)yh(),ua(),d.flags|=98560,H=!1;else if(H=mu(d),T!==null&&T.dehydrated!==null){if(l===null){if(!H)throw Error(t(318));if(H=d.memoizedState,H=H!==null?H.dehydrated:null,!H)throw Error(t(317));H[Va]=d}else ua(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;is(d),H=!1}else ea!==null&&(Ed(ea),ea=null),H=!0;if(!H)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=y,d):(T=T!==null,T!==(l!==null&&l.memoizedState!==null)&&T&&(d.child.flags|=8192,(d.mode&1)!==0&&(l===null||(yr.current&1)!==0?ss===0&&(ss=3):Fi())),d.updateQueue!==null&&(d.flags|=4),is(d),null);case 4:return Hl(),lc(l,d),l===null&&el(d.stateNode.containerInfo),is(d),null;case 10:return Rf(d.type._context),is(d),null;case 17:return $s(d.type)&&ph(),is(d),null;case 19:if(Zi(yr),H=d.memoizedState,H===null)return is(d),null;if(T=(d.flags&128)!==0,ee=H.rendering,ee===null)if(T)Su(H,!1);else{if(ss!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(ee=ul(l),ee!==null){for(d.flags|=128,Su(H,!1),T=ee.updateQueue,T!==null&&(d.updateQueue=T,d.flags|=4),d.subtreeFlags=0,T=y,y=d.child;y!==null;)H=y,l=T,H.flags&=14680066,ee=H.alternate,ee===null?(H.childLanes=0,H.lanes=l,H.child=null,H.subtreeFlags=0,H.memoizedProps=null,H.memoizedState=null,H.updateQueue=null,H.dependencies=null,H.stateNode=null):(H.childLanes=ee.childLanes,H.lanes=ee.lanes,H.child=ee.child,H.subtreeFlags=0,H.deletions=null,H.memoizedProps=ee.memoizedProps,H.memoizedState=ee.memoizedState,H.updateQueue=ee.updateQueue,H.type=ee.type,l=ee.dependencies,H.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),y=y.sibling;return zi(yr,yr.current&1|2),d.child}l=l.sibling}H.tail!==null&&Qi()>ja&&(d.flags|=128,T=!0,Su(H,!1),d.lanes=4194304)}else{if(!T)if(l=ul(ee),l!==null){if(d.flags|=128,T=!0,y=l.updateQueue,y!==null&&(d.updateQueue=y,d.flags|=4),Su(H,!0),H.tail===null&&H.tailMode==="hidden"&&!ee.alternate&&!ji)return is(d),null}else 2*Qi()-H.renderingStartTime>ja&&y!==1073741824&&(d.flags|=128,T=!0,Su(H,!1),d.lanes=4194304);H.isBackwards?(ee.sibling=d.child,d.child=ee):(y=H.last,y!==null?y.sibling=ee:d.child=ee,H.last=ee)}return H.tail!==null?(d=H.tail,H.rendering=d,H.tail=d.sibling,H.renderingStartTime=Qi(),d.sibling=null,y=yr.current,zi(yr,T?y&1|2:y&1),d):(is(d),null);case 22:case 23:return ka(),T=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==T&&(d.flags|=8192),T&&(d.mode&1)!==0?(Rr&1073741824)!==0&&(is(d),d.subtreeFlags&6&&(d.flags|=8192)):is(d),null;case 24:return null;case 25:return null}throw Error(t(156,d.tag))}function Wg(l,d){switch(Ef(d),d.tag){case 1:return $s(d.type)&&ph(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Hl(),Zi(ei),Zi(zs),Pf(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return wh(d),null;case 13:if(Zi(yr),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(t(340));ua()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Zi(yr),null;case 4:return Hl(),null;case 10:return Rf(d.type._context),null;case 22:case 23:return ka(),null;case 24:return null;default:return null}}var Us=!1,vs=!1,qg=typeof WeakSet=="function"?WeakSet:Set,gn=null;function uc(l,d){var y=l.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(T){mr(l,d,T)}else y.current=null}function np(l,d,y){try{y()}catch(T){mr(l,d,T)}}var Mm=!1;function yd(l,d){if(uh=Eo,l=Hc(),rh(l)){if("selectionStart"in l)var y={start:l.selectionStart,end:l.selectionEnd};else e:{y=(y=l.ownerDocument)&&y.defaultView||window;var T=y.getSelection&&y.getSelection();if(T&&T.rangeCount!==0){y=T.anchorNode;var z=T.anchorOffset,H=T.focusNode;T=T.focusOffset;try{y.nodeType,H.nodeType}catch{y=null;break e}var ee=0,Te=-1,Le=-1,je=0,Et=0,Nt=l,wt=null;t:for(;;){for(var sn;Nt!==y||z!==0&&Nt.nodeType!==3||(Te=ee+z),Nt!==H||T!==0&&Nt.nodeType!==3||(Le=ee+T),Nt.nodeType===3&&(ee+=Nt.nodeValue.length),(sn=Nt.firstChild)!==null;)wt=Nt,Nt=sn;for(;;){if(Nt===l)break t;if(wt===y&&++je===z&&(Te=ee),wt===H&&++Et===T&&(Le=ee),(sn=Nt.nextSibling)!==null)break;Nt=wt,wt=Nt.parentNode}Nt=sn}y=Te===-1||Le===-1?null:{start:Te,end:Le}}else y=null}y=y||{start:0,end:0}}else y=null;for(ch={focusedElem:l,selectionRange:y},Eo=!1,gn=d;gn!==null;)if(d=gn,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,gn=l;else for(;gn!==null;){d=gn;try{var vn=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(vn!==null){var Tn=vn.memoizedProps,Oi=vn.memoizedState,Ze=d.stateNode,a=Ze.getSnapshotBeforeUpdate(d.elementType===d.type?Tn:Wr(d.type,Tn),Oi);Ze.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var u=d.stateNode.containerInfo;u.nodeType===1?u.textContent="":u.nodeType===9&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(g){mr(d,d.return,g)}if(l=d.sibling,l!==null){l.return=d.return,gn=l;break}gn=d.return}return vn=Mm,Mm=!1,vn}function ys(l,d,y){var T=d.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var z=T=T.next;do{if((z.tag&l)===l){var H=z.destroy;z.destroy=void 0,H!==void 0&&np(d,y,H)}z=z.next}while(z!==T)}}function ia(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var y=d=d.next;do{if((y.tag&l)===l){var T=y.create;y.destroy=T()}y=y.next}while(y!==d)}}function Ch(l){var d=l.ref;if(d!==null){var y=l.stateNode;switch(l.tag){case 5:l=y;break;default:l=y}typeof d=="function"?d(l):d.current=l}}function Cm(l){var d=l.alternate;d!==null&&(l.alternate=null,Cm(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[Va],delete d[Jc],delete d[bf],delete d[wf],delete d[Sf])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function kh(l){return l.tag===5||l.tag===3||l.tag===4}function ip(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||kh(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ad(l,d,y){var T=l.tag;if(T===5||T===6)l=l.stateNode,d?y.nodeType===8?y.parentNode.insertBefore(l,d):y.insertBefore(l,d):(y.nodeType===8?(d=y.parentNode,d.insertBefore(l,y)):(d=y,d.appendChild(l)),y=y._reactRootContainer,y!=null||d.onclick!==null||(d.onclick=ps));else if(T!==4&&(l=l.child,l!==null))for(Ad(l,d,y),l=l.sibling;l!==null;)Ad(l,d,y),l=l.sibling}function Rh(l,d,y){var T=l.tag;if(T===5||T===6)l=l.stateNode,d?y.insertBefore(l,d):y.appendChild(l);else if(T!==4&&(l=l.child,l!==null))for(Rh(l,d,y),l=l.sibling;l!==null;)Rh(l,d,y),l=l.sibling}var Ar=null,Vs=!1;function lo(l,d,y){for(y=y.child;y!==null;)xd(l,d,y),y=y.sibling}function xd(l,d,y){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Ke,y)}catch{}switch(y.tag){case 5:vs||uc(y,d);case 6:var T=Ar,z=Vs;Ar=null,lo(l,d,y),Ar=T,Vs=z,Ar!==null&&(Vs?(l=Ar,y=y.stateNode,l.nodeType===8?l.parentNode.removeChild(y):l.removeChild(y)):Ar.removeChild(y.stateNode));break;case 18:Ar!==null&&(Vs?(l=Ar,y=y.stateNode,l.nodeType===8?hh(l.parentNode,y):l.nodeType===1&&hh(l,y),Fa(l)):hh(Ar,y.stateNode));break;case 4:T=Ar,z=Vs,Ar=y.stateNode.containerInfo,Vs=!0,lo(l,d,y),Ar=T,Vs=z;break;case 0:case 11:case 14:case 15:if(!vs&&(T=y.updateQueue,T!==null&&(T=T.lastEffect,T!==null))){z=T=T.next;do{var H=z,ee=H.destroy;H=H.tag,ee!==void 0&&((H&2)!==0||(H&4)!==0)&&np(y,d,ee),z=z.next}while(z!==T)}lo(l,d,y);break;case 1:if(!vs&&(uc(y,d),T=y.stateNode,typeof T.componentWillUnmount=="function"))try{T.props=y.memoizedProps,T.state=y.memoizedState,T.componentWillUnmount()}catch(Te){mr(y,d,Te)}lo(l,d,y);break;case 21:lo(l,d,y);break;case 22:y.mode&1?(vs=(T=vs)||y.memoizedState!==null,lo(l,d,y),vs=T):lo(l,d,y);break;default:lo(l,d,y)}}function Gs(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var y=l.stateNode;y===null&&(y=l.stateNode=new qg),d.forEach(function(T){var z=ap.bind(null,l,T);y.has(T)||(y.add(T),T.then(z,z))})}}function dr(l,d){var y=d.deletions;if(y!==null)for(var T=0;T<y.length;T++){var z=y[T];try{var H=l,ee=d,Te=ee;e:for(;Te!==null;){switch(Te.tag){case 5:Ar=Te.stateNode,Vs=!1;break e;case 3:Ar=Te.stateNode.containerInfo,Vs=!0;break e;case 4:Ar=Te.stateNode.containerInfo,Vs=!0;break e}Te=Te.return}if(Ar===null)throw Error(t(160));xd(H,ee,z),Ar=null,Vs=!1;var Le=z.alternate;Le!==null&&(Le.return=null),z.return=null}catch(je){mr(z,d,je)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)Lo(d,l),d=d.sibling}function Lo(l,d){var y=l.alternate,T=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(dr(d,l),Nr(l),T&4){try{ys(3,l,l.return),ia(3,l)}catch(Tn){mr(l,l.return,Tn)}try{ys(5,l,l.return)}catch(Tn){mr(l,l.return,Tn)}}break;case 1:dr(d,l),Nr(l),T&512&&y!==null&&uc(y,y.return);break;case 5:if(dr(d,l),Nr(l),T&512&&y!==null&&uc(y,y.return),l.flags&32){var z=l.stateNode;try{at(z,"")}catch(Tn){mr(l,l.return,Tn)}}if(T&4&&(z=l.stateNode,z!=null)){var H=l.memoizedProps,ee=y!==null?y.memoizedProps:H,Te=l.type,Le=l.updateQueue;if(l.updateQueue=null,Le!==null)try{Te==="input"&&H.type==="radio"&&H.name!=null&&ht(z,H),Dt(Te,ee);var je=Dt(Te,H);for(ee=0;ee<Le.length;ee+=2){var Et=Le[ee],Nt=Le[ee+1];Et==="style"?At(z,Nt):Et==="dangerouslySetInnerHTML"?Ye(z,Nt):Et==="children"?at(z,Nt):W(z,Et,Nt,je)}switch(Te){case"input":Pt(z,H);break;case"textarea":Kn(z,H);break;case"select":var wt=z._wrapperState.wasMultiple;z._wrapperState.wasMultiple=!!H.multiple;var sn=H.value;sn!=null?yn(z,!!H.multiple,sn,!1):wt!==!!H.multiple&&(H.defaultValue!=null?yn(z,!!H.multiple,H.defaultValue,!0):yn(z,!!H.multiple,H.multiple?[]:"",!1))}z[Jc]=H}catch(Tn){mr(l,l.return,Tn)}}break;case 6:if(dr(d,l),Nr(l),T&4){if(l.stateNode===null)throw Error(t(162));z=l.stateNode,H=l.memoizedProps;try{z.nodeValue=H}catch(Tn){mr(l,l.return,Tn)}}break;case 3:if(dr(d,l),Nr(l),T&4&&y!==null&&y.memoizedState.isDehydrated)try{Fa(d.containerInfo)}catch(Tn){mr(l,l.return,Tn)}break;case 4:dr(d,l),Nr(l);break;case 13:dr(d,l),Nr(l),z=l.child,z.flags&8192&&(H=z.memoizedState!==null,z.stateNode.isHidden=H,!H||z.alternate!==null&&z.alternate.memoizedState!==null||(wd=Qi())),T&4&&Gs(l);break;case 22:if(Et=y!==null&&y.memoizedState!==null,l.mode&1?(vs=(je=vs)||Et,dr(d,l),vs=je):dr(d,l),Nr(l),T&8192){if(je=l.memoizedState!==null,(l.stateNode.isHidden=je)&&!Et&&(l.mode&1)!==0)for(gn=l,Et=l.child;Et!==null;){for(Nt=gn=Et;gn!==null;){switch(wt=gn,sn=wt.child,wt.tag){case 0:case 11:case 14:case 15:ys(4,wt,wt.return);break;case 1:uc(wt,wt.return);var vn=wt.stateNode;if(typeof vn.componentWillUnmount=="function"){T=wt,y=wt.return;try{d=T,vn.props=d.memoizedProps,vn.state=d.memoizedState,vn.componentWillUnmount()}catch(Tn){mr(T,y,Tn)}}break;case 5:uc(wt,wt.return);break;case 22:if(wt.memoizedState!==null){No(Nt);continue}}sn!==null?(sn.return=wt,gn=sn):No(Nt)}Et=Et.sibling}e:for(Et=null,Nt=l;;){if(Nt.tag===5){if(Et===null){Et=Nt;try{z=Nt.stateNode,je?(H=z.style,typeof H.setProperty=="function"?H.setProperty("display","none","important"):H.display="none"):(Te=Nt.stateNode,Le=Nt.memoizedProps.style,ee=Le!=null&&Le.hasOwnProperty("display")?Le.display:null,Te.style.display=lt("display",ee))}catch(Tn){mr(l,l.return,Tn)}}}else if(Nt.tag===6){if(Et===null)try{Nt.stateNode.nodeValue=je?"":Nt.memoizedProps}catch(Tn){mr(l,l.return,Tn)}}else if((Nt.tag!==22&&Nt.tag!==23||Nt.memoizedState===null||Nt===l)&&Nt.child!==null){Nt.child.return=Nt,Nt=Nt.child;continue}if(Nt===l)break e;for(;Nt.sibling===null;){if(Nt.return===null||Nt.return===l)break e;Et===Nt&&(Et=null),Nt=Nt.return}Et===Nt&&(Et=null),Nt.sibling.return=Nt.return,Nt=Nt.sibling}}break;case 19:dr(d,l),Nr(l),T&4&&Gs(l);break;case 21:break;default:dr(d,l),Nr(l)}}function Nr(l){var d=l.flags;if(d&2){try{e:{for(var y=l.return;y!==null;){if(kh(y)){var T=y;break e}y=y.return}throw Error(t(160))}switch(T.tag){case 5:var z=T.stateNode;T.flags&32&&(at(z,""),T.flags&=-33);var H=ip(l);Rh(l,H,z);break;case 3:case 4:var ee=T.stateNode.containerInfo,Te=ip(l);Ad(l,Te,ee);break;default:throw Error(t(161))}}catch(Le){mr(l,l.return,Le)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function uo(l,d,y){gn=l,rs(l)}function rs(l,d,y){for(var T=(l.mode&1)!==0;gn!==null;){var z=gn,H=z.child;if(z.tag===22&&T){var ee=z.memoizedState!==null||Us;if(!ee){var Te=z.alternate,Le=Te!==null&&Te.memoizedState!==null||vs;Te=Us;var je=vs;if(Us=ee,(vs=Le)&&!je)for(gn=z;gn!==null;)ee=gn,Le=ee.child,ee.tag===22&&ee.memoizedState!==null?dc(z):Le!==null?(Le.return=ee,gn=Le):dc(z);for(;H!==null;)gn=H,rs(H),H=H.sibling;gn=z,Us=Te,vs=je}cc(l)}else(z.subtreeFlags&8772)!==0&&H!==null?(H.return=z,gn=H):cc(l)}}function cc(l){for(;gn!==null;){var d=gn;if((d.flags&8772)!==0){var y=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:vs||ia(5,d);break;case 1:var T=d.stateNode;if(d.flags&4&&!vs)if(y===null)T.componentDidMount();else{var z=d.elementType===d.type?y.memoizedProps:Wr(d.type,y.memoizedProps);T.componentDidUpdate(z,y.memoizedState,T.__reactInternalSnapshotBeforeUpdate)}var H=d.updateQueue;H!==null&&ll(d,H,T);break;case 3:var ee=d.updateQueue;if(ee!==null){if(y=null,d.child!==null)switch(d.child.tag){case 5:y=d.child.stateNode;break;case 1:y=d.child.stateNode}ll(d,ee,y)}break;case 5:var Te=d.stateNode;if(y===null&&d.flags&4){y=Te;var Le=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":Le.autoFocus&&y.focus();break;case"img":Le.src&&(y.src=Le.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var je=d.alternate;if(je!==null){var Et=je.memoizedState;if(Et!==null){var Nt=Et.dehydrated;Nt!==null&&Fa(Nt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}vs||d.flags&512&&Ch(d)}catch(wt){mr(d,d.return,wt)}}if(d===l){gn=null;break}if(y=d.sibling,y!==null){y.return=d.return,gn=y;break}gn=d.return}}function No(l){for(;gn!==null;){var d=gn;if(d===l){gn=null;break}var y=d.sibling;if(y!==null){y.return=d.return,gn=y;break}gn=d.return}}function dc(l){for(;gn!==null;){var d=gn;try{switch(d.tag){case 0:case 11:case 15:var y=d.return;try{ia(4,d)}catch(Le){mr(d,y,Le)}break;case 1:var T=d.stateNode;if(typeof T.componentDidMount=="function"){var z=d.return;try{T.componentDidMount()}catch(Le){mr(d,z,Le)}}var H=d.return;try{Ch(d)}catch(Le){mr(d,H,Le)}break;case 5:var ee=d.return;try{Ch(d)}catch(Le){mr(d,ee,Le)}}}catch(Le){mr(d,d.return,Le)}if(d===l){gn=null;break}var Te=d.sibling;if(Te!==null){Te.return=d.return,gn=Te;break}gn=d.return}}var As=Math.ceil,Ki=B.ReactCurrentDispatcher,vi=B.ReactCurrentOwner,qr=B.ReactCurrentBatchConfig,ri=0,kr=null,hr=null,fr=0,Rr=0,hc=Ro(0),ss=0,bd=null,Ui=0,Eu=0,jl=0,fc=null,xs=null,wd=0,ja=1/0,Xa=null,pc=!1,Xl=null,Ta=null,Sd=!1,Ma=null,fl=0,Tu=0,mc=null,Yl=-1,zo=0;function zr(){return(ri&6)!==0?Qi():Yl!==-1?Yl:Yl=Qi()}function Ya(l){return(l.mode&1)===0?1:(ri&2)!==0&&fr!==0?fr&-fr:Tf.transition!==null?(zo===0&&(zo=Kt()),zo):(l=Qn,l!==0||(l=window.event,l=l===void 0?16:se(l.type)),l)}function bs(l,d,y,T){if(50<Tu)throw Tu=0,mc=null,Error(t(185));Gn(l,y,T),((ri&2)===0||l!==kr)&&(l===kr&&((ri&2)===0&&(Eu|=y),ss===4&&Fo(l,fr)),ra(l,T),y===1&&ri===0&&(d.mode&1)===0&&(ja=Qi()+500,Kc&&sl()))}function ra(l,d){var y=l.callbackNode;oi(l,d);var T=ii(l,l===kr?fr:0);if(T===0)y!==null&&Fr(y),l.callbackNode=null,l.callbackPriority=0;else if(d=T&-T,l.callbackPriority!==d){if(y!=null&&Fr(y),d===1)l.tag===0?nm(Mu.bind(null,l)):Fl(Mu.bind(null,l)),tc(function(){(ri&6)===0&&sl()}),y=null;else{switch(mn(T)){case 1:y=rr;break;case 4:y=re;break;case 16:y=Ve;break;case 536870912:y=qe;break;default:y=Ve}y=Ih(y,Ca.bind(null,l))}l.callbackPriority=d,l.callbackNode=y}}function Ca(l,d){if(Yl=-1,zo=0,(ri&6)!==0)throw Error(t(327));var y=l.callbackNode;if(vc()&&l.callbackNode!==y)return null;var T=ii(l,l===kr?fr:0);if(T===0)return null;if((T&30)!==0||(T&l.expiredLanes)!==0||d)d=pr(l,T);else{d=T;var z=ri;ri|=2;var H=ui();(kr!==l||fr!==d)&&(Xa=null,ja=Qi()+500,Yi(l,d));do try{Td();break}catch(Te){Oo(l,Te)}while(!0);kf(),Ki.current=H,ri=z,hr!==null?d=0:(kr=null,fr=0,d=ss)}if(d!==0){if(d===2&&(z=qi(l),z!==0&&(T=z,d=Ql(l,z))),d===1)throw y=bd,Yi(l,0),Fo(l,T),ra(l,Qi()),y;if(d===6)Fo(l,T);else{if(z=l.current.alternate,(T&30)===0&&!pl(z)&&(d=pr(l,T),d===2&&(H=qi(l),H!==0&&(T=H,d=Ql(l,H))),d===1))throw y=bd,Yi(l,0),Fo(l,T),ra(l,Qi()),y;switch(l.finishedWork=z,l.finishedLanes=T,d){case 0:case 1:throw Error(t(345));case 2:co(l,xs,Xa);break;case 3:if(Fo(l,T),(T&130023424)===T&&(d=wd+500-Qi(),10<d)){if(ii(l,0)!==0)break;if(z=l.suspendedLanes,(z&T)!==T){zr(),l.pingedLanes|=l.suspendedLanes&z;break}l.timeoutHandle=Co(co.bind(null,l,xs,Xa),d);break}co(l,xs,Xa);break;case 4:if(Fo(l,T),(T&4194240)===T)break;for(d=l.eventTimes,z=-1;0<T;){var ee=31-Ut(T);H=1<<ee,ee=d[ee],ee>z&&(z=ee),T&=~H}if(T=z,T=Qi()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*As(T/1960))-T,10<T){l.timeoutHandle=Co(co.bind(null,l,xs,Xa),T);break}co(l,xs,Xa);break;case 5:co(l,xs,Xa);break;default:throw Error(t(329))}}}return ra(l,Qi()),l.callbackNode===y?Ca.bind(null,l):null}function Ql(l,d){var y=fc;return l.current.memoizedState.isDehydrated&&(Yi(l,d).flags|=256),l=pr(l,d),l!==2&&(d=xs,xs=y,d!==null&&Ed(d)),l}function Ed(l){xs===null?xs=l:xs.push.apply(xs,l)}function pl(l){for(var d=l;;){if(d.flags&16384){var y=d.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var T=0;T<y.length;T++){var z=y[T],H=z.getSnapshot;z=z.value;try{if(!Ua(H(),z))return!1}catch{return!1}}}if(y=d.child,d.subtreeFlags&16384&&y!==null)y.return=d,d=y;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Fo(l,d){for(d&=~jl,d&=~Eu,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var y=31-Ut(d),T=1<<y;l[y]=-1,d&=~T}}function Mu(l){if((ri&6)!==0)throw Error(t(327));vc();var d=ii(l,0);if((d&1)===0)return ra(l,Qi()),null;var y=pr(l,d);if(l.tag!==0&&y===2){var T=qi(l);T!==0&&(d=T,y=Ql(l,T))}if(y===1)throw y=bd,Yi(l,0),Fo(l,d),ra(l,Qi()),y;if(y===6)throw Error(t(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,co(l,xs,Xa),ra(l,Qi()),null}function gc(l,d){var y=ri;ri|=1;try{return l(d)}finally{ri=y,ri===0&&(ja=Qi()+500,Kc&&sl())}}function jr(l){Ma!==null&&Ma.tag===0&&(ri&6)===0&&vc();var d=ri;ri|=1;var y=qr.transition,T=Qn;try{if(qr.transition=null,Qn=1,l)return l()}finally{Qn=T,qr.transition=y,ri=d,(ri&6)===0&&sl()}}function ka(){Rr=hc.current,Zi(hc)}function Yi(l,d){l.finishedWork=null,l.finishedLanes=0;var y=l.timeoutHandle;if(y!==-1&&(l.timeoutHandle=-1,_p(y)),hr!==null)for(y=hr.return;y!==null;){var T=y;switch(Ef(T),T.tag){case 1:T=T.type.childContextTypes,T!=null&&ph();break;case 3:Hl(),Zi(ei),Zi(zs),Pf();break;case 5:wh(T);break;case 4:Hl();break;case 13:Zi(yr);break;case 19:Zi(yr);break;case 10:Rf(T.type._context);break;case 22:case 23:ka()}y=y.return}if(kr=l,hr=l=er(l.current,null),fr=Rr=d,ss=0,bd=null,jl=Eu=Ui=0,xs=fc=null,al!==null){for(d=0;d<al.length;d++)if(y=al[d],T=y.interleaved,T!==null){y.interleaved=null;var z=T.next,H=y.pending;if(H!==null){var ee=H.next;H.next=z,T.next=ee}y.pending=T}al=null}return l}function Oo(l,d){do{var y=hr;try{if(kf(),If.current=Th,Au){for(var T=cr.memoizedState;T!==null;){var z=T.queue;z!==null&&(z.pending=null),T=T.next}Au=!1}if(so=0,ts=Hr=cr=null,xu=!1,Wl=0,vi.current=null,y===null||y.return===null){ss=1,bd=d,hr=null;break}e:{var H=l,ee=y.return,Te=y,Le=d;if(d=fr,Te.flags|=32768,Le!==null&&typeof Le=="object"&&typeof Le.then=="function"){var je=Le,Et=Te,Nt=Et.tag;if((Et.mode&1)===0&&(Nt===0||Nt===11||Nt===15)){var wt=Et.alternate;wt?(Et.updateQueue=wt.updateQueue,Et.memoizedState=wt.memoizedState,Et.lanes=wt.lanes):(Et.updateQueue=null,Et.memoizedState=null)}var sn=Gg(ee);if(sn!==null){sn.flags&=-257,ta(sn,ee,Te,H,d),sn.mode&1&&Xf(H,je,d),d=sn,Le=je;var vn=d.updateQueue;if(vn===null){var Tn=new Set;Tn.add(Le),d.updateQueue=Tn}else vn.add(Le);break e}else{if((d&1)===0){Xf(H,je,d),Fi();break e}Le=Error(t(426))}}else if(ji&&Te.mode&1){var Oi=Gg(ee);if(Oi!==null){(Oi.flags&65536)===0&&(Oi.flags|=256),ta(Oi,ee,Te,H,d),id(ac(Le,Te));break e}}H=Le=ac(Le,Te),ss!==4&&(ss=2),fc===null?fc=[H]:fc.push(H),H=ee;do{switch(H.tag){case 3:H.flags|=65536,d&=-d,H.lanes|=d;var Ze=bm(H,Le,d);Dg(H,Ze);break e;case 1:Te=Le;var a=H.type,u=H.stateNode;if((H.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Ta===null||!Ta.has(u)))){H.flags|=65536,d&=-d,H.lanes|=d;var g=wm(H,Te,d);Dg(H,g);break e}}H=H.return}while(H!==null)}Zl(y)}catch(w){d=w,hr===y&&y!==null&&(hr=y=y.return);continue}break}while(!0)}function ui(){var l=Ki.current;return Ki.current=Th,l===null?Th:l}function Fi(){(ss===0||ss===3||ss===2)&&(ss=4),kr===null||(Ui&268435455)===0&&(Eu&268435455)===0||Fo(kr,fr)}function pr(l,d){var y=ri;ri|=2;var T=ui();(kr!==l||fr!==d)&&(Xa=null,Yi(l,d));do try{Ph();break}catch(z){Oo(l,z)}while(!0);if(kf(),ri=y,Ki.current=T,hr!==null)throw Error(t(261));return kr=null,fr=0,ss}function Ph(){for(;hr!==null;)Jl(hr)}function Td(){for(;hr!==null&&!kl();)Jl(hr)}function Jl(l){var d=Pr(l.alternate,l,Rr);l.memoizedProps=l.pendingProps,d===null?Zl(l):hr=d,vi.current=null}function Zl(l){var d=l;do{var y=d.alternate;if(l=d.return,(d.flags&32768)===0){if(y=Hg(y,d,Rr),y!==null){hr=y;return}}else{if(y=Wg(y,d),y!==null){y.flags&=32767,hr=y;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{ss=6,hr=null;return}}if(d=d.sibling,d!==null){hr=d;return}hr=d=l}while(d!==null);ss===0&&(ss=5)}function co(l,d,y){var T=Qn,z=qr.transition;try{qr.transition=null,Qn=1,Cu(l,d,y,T)}finally{qr.transition=z,Qn=T}return null}function Cu(l,d,y,T){do vc();while(Ma!==null);if((ri&6)!==0)throw Error(t(327));y=l.finishedWork;var z=l.finishedLanes;if(y===null)return null;if(l.finishedWork=null,l.finishedLanes=0,y===l.current)throw Error(t(177));l.callbackNode=null,l.callbackPriority=0;var H=y.lanes|y.childLanes;if(br(l,H),l===kr&&(hr=kr=null,fr=0),(y.subtreeFlags&2064)===0&&(y.flags&2064)===0||Sd||(Sd=!0,Ih(Ve,function(){return vc(),null})),H=(y.flags&15990)!==0,(y.subtreeFlags&15990)!==0||H){H=qr.transition,qr.transition=null;var ee=Qn;Qn=1;var Te=ri;ri|=4,vi.current=null,yd(l,y),Lo(y,l),cf(ch),Eo=!!uh,ch=uh=null,l.current=y,uo(y),uu(),ri=Te,Qn=ee,qr.transition=H}else l.current=y;if(Sd&&(Sd=!1,Ma=l,fl=z),H=l.pendingLanes,H===0&&(Ta=null),vt(y.stateNode),ra(l,Qi()),d!==null)for(T=l.onRecoverableError,y=0;y<d.length;y++)z=d[y],T(z.value,{componentStack:z.stack,digest:z.digest});if(pc)throw pc=!1,l=Xl,Xl=null,l;return(fl&1)!==0&&l.tag!==0&&vc(),H=l.pendingLanes,(H&1)!==0?l===mc?Tu++:(Tu=0,mc=l):Tu=0,sl(),null}function vc(){if(Ma!==null){var l=mn(fl),d=qr.transition,y=Qn;try{if(qr.transition=null,Qn=16>l?16:l,Ma===null)var T=!1;else{if(l=Ma,Ma=null,fl=0,(ri&6)!==0)throw Error(t(331));var z=ri;for(ri|=4,gn=l.current;gn!==null;){var H=gn,ee=H.child;if((gn.flags&16)!==0){var Te=H.deletions;if(Te!==null){for(var Le=0;Le<Te.length;Le++){var je=Te[Le];for(gn=je;gn!==null;){var Et=gn;switch(Et.tag){case 0:case 11:case 15:ys(8,Et,H)}var Nt=Et.child;if(Nt!==null)Nt.return=Et,gn=Nt;else for(;gn!==null;){Et=gn;var wt=Et.sibling,sn=Et.return;if(Cm(Et),Et===je){gn=null;break}if(wt!==null){wt.return=sn,gn=wt;break}gn=sn}}}var vn=H.alternate;if(vn!==null){var Tn=vn.child;if(Tn!==null){vn.child=null;do{var Oi=Tn.sibling;Tn.sibling=null,Tn=Oi}while(Tn!==null)}}gn=H}}if((H.subtreeFlags&2064)!==0&&ee!==null)ee.return=H,gn=ee;else e:for(;gn!==null;){if(H=gn,(H.flags&2048)!==0)switch(H.tag){case 0:case 11:case 15:ys(9,H,H.return)}var Ze=H.sibling;if(Ze!==null){Ze.return=H.return,gn=Ze;break e}gn=H.return}}var a=l.current;for(gn=a;gn!==null;){ee=gn;var u=ee.child;if((ee.subtreeFlags&2064)!==0&&u!==null)u.return=ee,gn=u;else e:for(ee=a;gn!==null;){if(Te=gn,(Te.flags&2048)!==0)try{switch(Te.tag){case 0:case 11:case 15:ia(9,Te)}}catch(w){mr(Te,Te.return,w)}if(Te===ee){gn=null;break e}var g=Te.sibling;if(g!==null){g.return=Te.return,gn=g;break e}gn=Te.return}}if(ri=z,sl(),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(Ke,l)}catch{}T=!0}return T}finally{Qn=y,qr.transition=d}}return!1}function yc(l,d,y){d=ac(y,d),d=bm(l,d,1),l=ur(l,d,1),d=zr(),l!==null&&(Gn(l,1,d),ra(l,d))}function mr(l,d,y){if(l.tag===3)yc(l,l,y);else for(;d!==null;){if(d.tag===3){yc(d,l,y);break}else if(d.tag===1){var T=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof T.componentDidCatch=="function"&&(Ta===null||!Ta.has(T))){l=ac(y,l),l=wm(d,l,1),d=ur(d,l,1),l=zr(),d!==null&&(Gn(d,1,l),ra(d,l));break}}d=d.return}}function rp(l,d,y){var T=l.pingCache;T!==null&&T.delete(d),d=zr(),l.pingedLanes|=l.suspendedLanes&y,kr===l&&(fr&y)===y&&(ss===4||ss===3&&(fr&130023424)===fr&&500>Qi()-wd?Yi(l,0):jl|=y),ra(l,d)}function km(l,d){d===0&&((l.mode&1)===0?d=1:(d=ln,ln<<=1,(ln&130023424)===0&&(ln=4194304)));var y=zr();l=ol(l,d),l!==null&&(Gn(l,d,y),ra(l,y))}function sp(l){var d=l.memoizedState,y=0;d!==null&&(y=d.retryLane),km(l,y)}function ap(l,d){var y=0;switch(l.tag){case 13:var T=l.stateNode,z=l.memoizedState;z!==null&&(y=z.retryLane);break;case 19:T=l.stateNode;break;default:throw Error(t(314))}T!==null&&T.delete(d),km(l,y)}var Pr;Pr=function(l,d,y){if(l!==null)if(l.memoizedProps!==d.pendingProps||ei.current)na=!0;else{if((l.lanes&y)===0&&(d.flags&128)===0)return na=!1,ly(l,d,y);na=(l.flags&131072)!==0}else na=!1,ji&&(d.flags&1048576)!==0&&Gr(d,$c,d.index);switch(d.lanes=0,d.tag){case 2:var T=d.type;hl(l,d),l=d.pendingProps;var z=_s(d,zs.current);Gl(d,y),z=Nf(null,d,T,l,z,y);var H=zf();return d.flags|=1,typeof z=="object"&&z!==null&&typeof z.render=="function"&&z.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,$s(T)?(H=!0,mh(d)):H=!1,d.memoizedState=z.state!==null&&z.state!==void 0?z.state:null,Wa(d),z.updater=dl,d.stateNode=z,z._reactInternals=d,Wf(d,T,l,y),d=Zf(null,d,T,!0,H,y)):(d.tag=0,ji&&H&&Er(d),ns(null,d,z,y),d=d.child),d;case 16:T=d.elementType;e:{switch(hl(l,d),l=d.pendingProps,z=T._init,T=z(T._payload),d.type=T,z=d.tag=Rm(T),l=Wr(T,l),z){case 0:d=Mh(null,d,T,l,y);break e;case 1:d=Em(null,d,T,l,y);break e;case 11:d=Yf(null,d,T,l,y);break e;case 14:d=oc(null,d,T,Wr(T.type,l),y);break e}throw Error(t(306,T,""))}return d;case 0:return T=d.type,z=d.pendingProps,z=d.elementType===T?z:Wr(T,z),Mh(l,d,T,z,y);case 1:return T=d.type,z=d.pendingProps,z=d.elementType===T?z:Wr(T,z),Em(l,d,T,z,y);case 3:e:{if(Kf(d),l===null)throw Error(t(387));T=d.pendingProps,H=d.memoizedState,z=H.element,$r(l,d),Tr(d,T,null,y);var ee=d.memoizedState;if(T=ee.element,H.isDehydrated)if(H={element:T,isDehydrated:!1,cache:ee.cache,pendingSuspenseBoundaries:ee.pendingSuspenseBoundaries,transitions:ee.transitions},d.updateQueue.baseState=H,d.memoizedState=H,d.flags&256){z=ac(Error(t(423)),d),d=_f(l,d,T,y,z);break e}else if(T!==z){z=ac(Error(t(424)),d),d=_f(l,d,T,y,z);break e}else for(_r=tl(d.stateNode.containerInfo.firstChild),gs=d,ji=!0,ea=null,y=Mf(d,null,T,y),d.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ua(),T===z){d=Cr(l,d,y);break e}ns(l,d,T,y)}d=d.child}return d;case 5:return rm(d),l===null&&td(d),T=d.type,z=d.pendingProps,H=l!==null?l.memoizedProps:null,ee=z.children,Af(T,z)?ee=null:H!==null&&Af(T,H)&&(d.flags|=32),Jf(l,d),ns(l,d,ee,y),d.child;case 6:return l===null&&td(d),null;case 13:return ep(l,d,y);case 4:return ld(d,d.stateNode.containerInfo),T=d.pendingProps,l===null?d.child=rc(d,null,T,y):ns(l,d,T,y),d.child;case 11:return T=d.type,z=d.pendingProps,z=d.elementType===T?z:Wr(T,z),Yf(l,d,T,z,y);case 7:return ns(l,d,d.pendingProps,y),d.child;case 8:return ns(l,d,d.pendingProps.children,y),d.child;case 12:return ns(l,d,d.pendingProps.children,y),d.child;case 10:e:{if(T=d.type._context,z=d.pendingProps,H=d.memoizedProps,ee=z.value,zi(Ul,T._currentValue),T._currentValue=ee,H!==null)if(Ua(H.value,ee)){if(H.children===z.children&&!ei.current){d=Cr(l,d,y);break e}}else for(H=d.child,H!==null&&(H.return=d);H!==null;){var Te=H.dependencies;if(Te!==null){ee=H.child;for(var Le=Te.firstContext;Le!==null;){if(Le.context===T){if(H.tag===1){Le=es(-1,y&-y),Le.tag=2;var je=H.updateQueue;if(je!==null){je=je.shared;var Et=je.pending;Et===null?Le.next=Le:(Le.next=Et.next,Et.next=Le),je.pending=Le}}H.lanes|=y,Le=H.alternate,Le!==null&&(Le.lanes|=y),im(H.return,y,d),Te.lanes|=y;break}Le=Le.next}}else if(H.tag===10)ee=H.type===d.type?null:H.child;else if(H.tag===18){if(ee=H.return,ee===null)throw Error(t(341));ee.lanes|=y,Te=ee.alternate,Te!==null&&(Te.lanes|=y),im(ee,y,d),ee=H.sibling}else ee=H.child;if(ee!==null)ee.return=H;else for(ee=H;ee!==null;){if(ee===d){ee=null;break}if(H=ee.sibling,H!==null){H.return=ee.return,ee=H;break}ee=ee.return}H=ee}ns(l,d,z.children,y),d=d.child}return d;case 9:return z=d.type,T=d.pendingProps.children,Gl(d,y),z=Ea(z),T=T(z),d.flags|=1,ns(l,d,T,y),d.child;case 14:return T=d.type,z=Wr(T,d.pendingProps),z=Wr(T.type,z),oc(l,d,T,z,y);case 15:return Qf(l,d,d.type,d.pendingProps,y);case 17:return T=d.type,z=d.pendingProps,z=d.elementType===T?z:Wr(T,z),hl(l,d),d.tag=1,$s(T)?(l=!0,mh(d)):l=!1,Gl(d,y),Am(d,T,z),Wf(d,T,z,y),Zf(null,d,T,!0,l,y);case 19:return ql(l,d,y);case 22:return Sm(l,d,y)}throw Error(t(156,d.tag))};function Ih(l,d){return la(l,d)}function Kl(l,d,y,T){this.tag=l,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pi(l,d,y,T){return new Kl(l,d,y,T)}function Md(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Rm(l){if(typeof l=="function")return Md(l)?1:0;if(l!=null){if(l=l.$$typeof,l===ve)return 11;if(l===Me)return 14}return 2}function er(l,d){var y=l.alternate;return y===null?(y=Pi(l.tag,d,l.key,l.mode),y.elementType=l.elementType,y.type=l.type,y.stateNode=l.stateNode,y.alternate=l,l.alternate=y):(y.pendingProps=d,y.type=l.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=l.flags&14680064,y.childLanes=l.childLanes,y.lanes=l.lanes,y.child=l.child,y.memoizedProps=l.memoizedProps,y.memoizedState=l.memoizedState,y.updateQueue=l.updateQueue,d=l.dependencies,y.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},y.sibling=l.sibling,y.index=l.index,y.ref=l.ref,y}function gr(l,d,y,T,z,H){var ee=2;if(T=l,typeof l=="function")Md(l)&&(ee=1);else if(typeof l=="string")ee=5;else e:switch(l){case _:return Xr(y.children,z,H,d);case G:ee=8,z|=8;break;case Z:return l=Pi(12,y,d,z|2),l.elementType=Z,l.lanes=H,l;case Se:return l=Pi(13,y,d,z),l.elementType=Se,l.lanes=H,l;case Ne:return l=Pi(19,y,d,z),l.elementType=Ne,l.lanes=H,l;case me:return ca(y,z,H,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case ie:ee=10;break e;case oe:ee=9;break e;case ve:ee=11;break e;case Me:ee=14;break e;case Ae:ee=16,T=null;break e}throw Error(t(130,l==null?l:typeof l,""))}return d=Pi(ee,y,d,z),d.elementType=l,d.type=T,d.lanes=H,d}function Xr(l,d,y,T){return l=Pi(7,l,T,d),l.lanes=y,l}function ca(l,d,y,T){return l=Pi(22,l,T,d),l.elementType=me,l.lanes=y,l.stateNode={isHidden:!1},l}function _l(l,d,y){return l=Pi(6,l,null,d),l.lanes=y,l}function op(l,d,y){return d=Pi(4,l.children!==null?l.children:[],l.key,d),d.lanes=y,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function lp(l,d,y,T,z){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$e(0),this.expirationTimes=$e(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$e(0),this.identifierPrefix=T,this.onRecoverableError=z,this.mutableSourceEagerHydrationData=null}function Ac(l,d,y,T,z,H,ee,Te,Le){return l=new lp(l,d,y,Te,Le),d===1?(d=1,H===!0&&(d|=8)):d=0,H=Pi(3,null,null,d),l.current=H,H.stateNode=l,H.memoizedState={element:T,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wa(H),l}function up(l,d,y){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:T==null?null:""+T,children:l,containerInfo:d,implementation:y}}function Cd(l){if(!l)return il;l=l._reactInternals;e:{if(tn(l)!==l||l.tag!==1)throw Error(t(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if($s(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(t(171))}if(l.tag===1){var y=l.type;if($s(y))return tm(l,y,d)}return d}function Dh(l,d,y,T,z,H,ee,Te,Le){return l=Ac(y,T,!0,l,z,H,ee,Te,Le),l.context=Cd(null),y=l.current,T=zr(),z=Ya(y),H=es(T,z),H.callback=d??null,ur(y,H,z),l.current.lanes=z,Gn(l,z,T),ra(l,T),l}function $l(l,d,y,T){var z=d.current,H=zr(),ee=Ya(z);return y=Cd(y),d.context===null?d.context=y:d.pendingContext=y,d=es(H,ee),d.payload={element:l},T=T===void 0?null:T,T!==null&&(d.callback=T),l=ur(z,d,ee),l!==null&&(bs(l,z,ee,H),sd(l,z,ee)),ee}function Lh(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function yi(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var y=l.retryLane;l.retryLane=y!==0&&y<d?y:d}}function Vi(l,d){yi(l,d),(l=l.alternate)&&yi(l,d)}function bi(){return null}var Ei=typeof reportError=="function"?reportError:function(l){console.error(l)};function Li(l){this._internalRoot=l}as.prototype.render=Li.prototype.render=function(l){var d=this._internalRoot;if(d===null)throw Error(t(409));$l(l,d,null,null)},as.prototype.unmount=Li.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var d=l.containerInfo;jr(function(){$l(null,l,null,null)}),d[ko]=null}};function as(l){this._internalRoot=l}as.prototype.unstable_scheduleHydration=function(l){if(l){var d=Si();l={blockedOn:null,target:l,priority:d};for(var y=0;y<za.length&&d!==0&&d<za[y].priority;y++);za.splice(y,0,l),y===0&&Nc(l)}};function Bo(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function ml(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function cp(){}function gl(l,d,y,T,z){if(z){if(typeof T=="function"){var H=T;T=function(){var je=Lh(ee);H.call(je)}}var ee=Dh(d,T,l,0,null,!1,!1,"",cp);return l._reactRootContainer=ee,l[ko]=ee.current,el(l.nodeType===8?l.parentNode:l),jr(),ee}for(;z=l.lastChild;)l.removeChild(z);if(typeof T=="function"){var Te=T;T=function(){var je=Lh(Le);Te.call(je)}}var Le=Ac(l,0,!1,null,null,!1,!1,"",cp);return l._reactRootContainer=Le,l[ko]=Le.current,el(l.nodeType===8?l.parentNode:l),jr(function(){$l(d,Le,y,T)}),Le}function _i(l,d,y,T,z){var H=y._reactRootContainer;if(H){var ee=H;if(typeof z=="function"){var Te=z;z=function(){var Le=Lh(ee);Te.call(Le)}}$l(d,ee,l,z)}else ee=gl(y,d,l,z,T);return Lh(ee)}mi=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var y=fi(d.pendingLanes);y!==0&&(Or(d,y|1),ra(d,Qi()),(ri&6)===0&&(ja=Qi()+500,sl()))}break;case 13:jr(function(){var T=ol(l,1);if(T!==null){var z=zr();bs(T,l,1,z)}}),Vi(l,1)}},Ri=function(l){if(l.tag===13){var d=ol(l,134217728);if(d!==null){var y=zr();bs(d,l,134217728,y)}Vi(l,134217728)}},Br=function(l){if(l.tag===13){var d=Ya(l),y=ol(l,d);if(y!==null){var T=zr();bs(y,l,d,T)}Vi(l,d)}},Si=function(){return Qn},us=function(l,d){var y=Qn;try{return Qn=l,d()}finally{Qn=y}},zn=function(l,d,y){switch(d){case"input":if(Pt(l,y),d=y.name,y.type==="radio"&&d!=null){for(y=l;y.parentNode;)y=y.parentNode;for(y=y.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<y.length;d++){var T=y[d];if(T!==l&&T.form===l.form){var z=Zc(T);if(!z)throw Error(t(90));Vn(T),Pt(T,z)}}}break;case"textarea":Kn(l,y);break;case"select":d=y.value,d!=null&&yn(l,!!y.multiple,d,!1)}},Zt=gc,xt=jr;var vl={usingClientEntryPoint:!1,Events:[zl,fu,Zc,ft,Yt,gc]},ws={findFiberByHostInstance:Ga,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dp={bundleType:ws.bundleType,version:ws.version,rendererPackageName:ws.rendererPackageName,rendererConfig:ws.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:B.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=La(l),l===null?null:l.stateNode},findFiberByHostInstance:ws.findFiberByHostInstance||bi,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ss=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ss.isDisabled&&Ss.supportsFiber)try{Ke=Ss.inject(dp),Mt=Ss}catch{}}return Uo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vl,Uo.createPortal=function(l,d){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Bo(d))throw Error(t(200));return up(l,d,null,y)},Uo.createRoot=function(l,d){if(!Bo(l))throw Error(t(299));var y=!1,T="",z=Ei;return d!=null&&(d.unstable_strictMode===!0&&(y=!0),d.identifierPrefix!==void 0&&(T=d.identifierPrefix),d.onRecoverableError!==void 0&&(z=d.onRecoverableError)),d=Ac(l,1,!1,null,null,y,!1,T,z),l[ko]=d.current,el(l.nodeType===8?l.parentNode:l),new Li(d)},Uo.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(t(188)):(l=Object.keys(l).join(","),Error(t(268,l)));return l=La(d),l=l===null?null:l.stateNode,l},Uo.flushSync=function(l){return jr(l)},Uo.hydrate=function(l,d,y){if(!ml(d))throw Error(t(200));return _i(null,l,d,!0,y)},Uo.hydrateRoot=function(l,d,y){if(!Bo(l))throw Error(t(405));var T=y!=null&&y.hydratedSources||null,z=!1,H="",ee=Ei;if(y!=null&&(y.unstable_strictMode===!0&&(z=!0),y.identifierPrefix!==void 0&&(H=y.identifierPrefix),y.onRecoverableError!==void 0&&(ee=y.onRecoverableError)),d=Dh(d,null,l,1,y??null,z,!1,H,ee),l[ko]=d.current,el(l),T)for(l=0;l<T.length;l++)y=T[l],z=y._getVersion,z=z(y._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[y,z]:d.mutableSourceEagerHydrationData.push(y,z);return new as(d)},Uo.render=function(l,d,y){if(!ml(d))throw Error(t(200));return _i(null,l,d,!1,y)},Uo.unmountComponentAtNode=function(l){if(!ml(l))throw Error(t(40));return l._reactRootContainer?(jr(function(){_i(null,null,l,!1,function(){l._reactRootContainer=null,l[ko]=null})}),!0):!1},Uo.unstable_batchedUpdates=gc,Uo.unstable_renderSubtreeIntoContainer=function(l,d,y,T){if(!ml(y))throw Error(t(200));if(l==null||l._reactInternals===void 0)throw Error(t(38));return _i(l,d,y,!1,T)},Uo.version="18.3.1-next-f1338f8080-20240426",Uo}var BS;function SR(){if(BS)return cx.exports;BS=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),cx.exports=wR(),cx.exports}var US;function ER(){if(US)return cy;US=1;var i=SR();return cy.createRoot=i.createRoot,cy.hydrateRoot=i.hydrateRoot,cy}var TR=ER(),pe=Pm();const or=ox(pe),eu={TEXT:"text",VOICE:"voice",TEXT_AND_VOICE:"text_and_voice",CLOUD_AVATAR:"cloud_avatar",DESKTOP_AVATAR:"desktop_avatar"},xc={DISCONNECT:"disconnect",SESSION_READY:"session_ready",SESSION_JOINED:"session_joined",SESSION_TERMINATED:"session_terminated",USER_MESSAGE:"user_message",AUDIO_CHUNK:"audio_chunk",AUDIO_END:"audio_end",INTERRUPT:"interrupt",CHANGE_SESSION_LANGUAGE:"change_session_language",LANGUAGE_CHANGED:"language_changed",CLIENT_READY:"client_ready",CLIENT_TOOL_REQUEST:"client_tool_request",CLIENT_TOOL_RESULT:"client_tool_result",CLEAR_SESSION_HISTORY:"clear_session_history",TRANSCRIPT:"transcript",PARTIAL_TRANSCRIPT:"partial_transcript",AGENT_RESPONSE_CHUNK:"agent_response_chunk",AGENT_RESPONSE:"agent_response",AGENT_AUDIO_CHUNK:"agent_audio_chunk",AGENT_AUDIO_COMPLETE:"agent_audio_complete",AVATAR_SPEAKING:"avatar_speaking",AVATAR_SPEAKING_DONE:"avatar_speaking_done",INTERRUPTED:"interrupted",ERROR:"error",AUTH_ERROR:"auth_error",SESSION_EXPIRED:"session_expired",CREDITS_EXHAUSTED:"credits_exhausted",SESSION_STATE_CHANGED:"session:state_changed",AUDIO_PLAYBACK_COMPLETE:"audio:playback_complete",MESSAGE_RATE_LIMITED:"message_rate_limited",SHOW_LEAD_CAPTURE_FORM:"show_lead_capture_form"},Qr={IDLE:"idle",INITIALIZING:"initializing",CONNECTING:"connecting",CONNECTED:"connected",FAILED:"failed",ENDED:"ended"},xl={IDLE:"idle",CONNECTING:"connecting",LOADING:"loading",CONNECTED:"connected",DISCONNECTED:"disconnected",ERROR:"error"},Im={IDLE:"idle",AGENT_THINKING:"agent_thinking",AGENT_SPEAKING:"agent_speaking",TOOL_EXECUTING:"tool_executing",TERMINATING:"terminating",TERMINATED:"terminated"},MR={encoding:"16bitInt",channels:1,sampleRate:16e3},fx={connectionState:Qr.IDLE,isConnected:!1,isSessionReady:!1,error:null,isAudioPlaying:!1,isAvatarSpeaking:!1,sessionState:Im.IDLE,cloudStream:{state:xl.IDLE,error:null},transcript:null,partialTranscript:null,session:{sessionId:null,role:null,agentType:null,streamingUrl:null,uniqueId:null},messages:[],creditExhausted:!1,creditError:null,agentConfig:null};function VS(i,e){switch(e.type){case"SET_CONNECTION_STATE":return{...i,connectionState:e.payload,isConnected:e.payload===Qr.CONNECTED};case"SET_ERROR":return{...i,error:e.payload};case"SET_CLOUD_STREAM_STATE":return{...i,cloudStream:e.payload};case"SET_SESSION_STATE":return{...i,sessionState:e.payload};case"UPDATE_SESSION":return{...i,session:{...i.session,...e.payload}};case"ADD_MESSAGE":return{...i,messages:[...i.messages,e.payload]};case"SET_AUDIO_PLAYING":return{...i,isAudioPlaying:e.payload};case"SET_AVATAR_SPEAKING":return{...i,isAvatarSpeaking:e.payload};case"SET_CREDIT_EXHAUSTED":return{...i,creditExhausted:e.payload.exhausted,creditError:e.payload.error};case"SET_TRANSCRIPT":return{...i,transcript:e.payload};case"SET_PARTIAL_TRANSCRIPT":return{...i,partialTranscript:e.payload};case"SET_MESSAGES":return{...i,messages:e.payload};case"SET_SESSION_READY":return{...i,isSessionReady:e.payload};case"SET_AGENT_CONFIG":return{...i,agentConfig:e.payload};case"HARD_RESET":return fx;case"REPLACE_STATE":return e.payload;default:return i}}function CR(i){return{isSessionTerminated:i===Im.TERMINATED,isSessionTerminating:i===Im.TERMINATING,isAgentThinking:i===Im.AGENT_THINKING,isAgentSpeaking:i===Im.AGENT_SPEAKING,isToolExecuting:i===Im.TOOL_EXECUTING}}function kR(){const i=new Map;return{addChunk(e,t){const n=e||`request-${Date.now()}`,o=`${i.get(n)||""}${t||""}`;return i.set(n,o),{id:n,text:o}},consume(e,t=""){const n=e||`request-${Date.now()}`,r=i.get(n)||t||"";return i.delete(n),{id:n,text:r}},clear(){i.clear()}}}function RR(){try{const i=Intl.DateTimeFormat().resolvedOptions().timeZone;return typeof i=="string"&&i.trim()?i.trim():void 0}catch{return}}async function Xg(i){if(!i?.ok){let e=`HTTP ${i.status}`;try{const r=await i.json();e=r?.detail||r?.message||e}catch{}const t=new Error(e);throw t.status=i.status,t}return i.json()}function PR({restUrl:i,log:e,withCredentials:t}){function n(){if(!i)throw new Error("Missing restUrl in RqmiiAgentProvider")}async function r({apiKey:v,publicChatId:A,agentId:S,userId:b,language:M="en",timezone:k,config:L}={}){n();const P={...v?{api_key:v}:{},...A?{public_chat_id:A}:{},...S?{agent_id:S}:{},...b?{user_id:b}:{},language:M,...k?{timezone:k}:{},...L?{config:L}:{}};e("initializeSession — POST /sessions/init",P);const I=await fetch(`${i}/sessions/init`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P),...t?{credentials:"include"}:{}}),U=await Xg(I);if(!U?.session_id||!U?.session_token)throw new Error("Invalid initialize session response");return U}async function o({uniqueId:v}){n(),e("joinDesktopSession — POST /sessions/join",{uniqueId:v});const A=await fetch(`${i}/sessions/join`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({unique_id:v}),...t?{credentials:"include"}:{}}),S=await Xg(A);if(!S?.session_id||!S?.session_token)throw new Error("Invalid join session response");return S}async function c(v){n(),e("fetchAgentConfig — GET /agent/{publicChatId}",{publicChatId:v});const A=await fetch(`${i}/agent/${encodeURIComponent(v)}`,{method:"GET",headers:{"Content-Type":"application/json"},...t?{credentials:"include"}:{}});return Xg(A)}async function f({sessionId:v,rating:A,feedback:S,endedBy:b}){if(n(),!v)throw new Error("sessionId is required");const M={...typeof A=="number"?{rating:A}:{},...S?{feedback:S}:{},...b?{ended_by:b}:{}};e("submitFeedback — PATCH /conversations/{sessionId}/feedback",{sessionId:v,payload:M});const k=await fetch(`${i}/conversations/${encodeURIComponent(v)}/feedback`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(M),...t?{credentials:"include"}:{}});return Xg(k)}async function p({agentId:v,sessionId:A,collectedData:S}){if(n(),!v)throw new Error("agentId is required");if(!A)throw new Error("sessionId is required");e("submitLead — POST /public/agent/{agentId}/lead-capture/leads",{agentId:v,sessionId:A});const b=await fetch(`${i}/public/agent/${encodeURIComponent(v)}/lead-capture/leads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:A,collected_data:S}),...t?{credentials:"include"}:{}});return Xg(b)}return{initializeSession:r,joinDesktopSession:o,fetchAgentConfig:c,submitFeedback:f,submitLead:p}}const bc=Object.create(null);bc.open="0",bc.close="1",bc.ping="2",bc.pong="3",bc.message="4",bc.upgrade="5",bc.noop="6";const dy=Object.create(null);Object.keys(bc).forEach(i=>{dy[bc[i]]=i});const px={type:"error",data:"parser error"},GS=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",HS=typeof ArrayBuffer=="function",WS=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer,mx=({type:i,data:e},t,n)=>GS&&e instanceof Blob?t?n(e):qS(e,n):HS&&(e instanceof ArrayBuffer||WS(e))?t?n(e):qS(new Blob([e]),n):n(bc[i]+(e||"")),qS=(i,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(i)};function jS(i){return i instanceof Uint8Array?i:i instanceof ArrayBuffer?new Uint8Array(i):new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let gx;function IR(i,e){if(GS&&i.data instanceof Blob)return i.data.arrayBuffer().then(jS).then(e);if(HS&&(i.data instanceof ArrayBuffer||WS(i.data)))return e(jS(i.data));mx(i,!1,t=>{gx||(gx=new TextEncoder),e(gx.encode(t))})}const XS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yg=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i<XS.length;i++)Yg[XS.charCodeAt(i)]=i;const DR=i=>{let e=i.length*.75,t=i.length,n,r=0,o,c,f,p;i[i.length-1]==="="&&(e--,i[i.length-2]==="="&&e--);const v=new ArrayBuffer(e),A=new Uint8Array(v);for(n=0;n<t;n+=4)o=Yg[i.charCodeAt(n)],c=Yg[i.charCodeAt(n+1)],f=Yg[i.charCodeAt(n+2)],p=Yg[i.charCodeAt(n+3)],A[r++]=o<<2|c>>4,A[r++]=(c&15)<<4|f>>2,A[r++]=(f&3)<<6|p&63;return v},LR=typeof ArrayBuffer=="function",vx=(i,e)=>{if(typeof i!="string")return{type:"message",data:YS(i,e)};const t=i.charAt(0);return t==="b"?{type:"message",data:NR(i.substring(1),e)}:dy[t]?i.length>1?{type:dy[t],data:i.substring(1)}:{type:dy[t]}:px},NR=(i,e)=>{if(LR){const t=DR(i);return YS(t,e)}else return{base64:!0,data:i}},YS=(i,e)=>{switch(e){case"blob":return i instanceof Blob?i:new Blob([i]);case"arraybuffer":default:return i instanceof ArrayBuffer?i:i.buffer}},QS="",zR=(i,e)=>{const t=i.length,n=new Array(t);let r=0;i.forEach((o,c)=>{mx(o,!1,f=>{n[c]=f,++r===t&&e(n.join(QS))})})},FR=(i,e)=>{const t=i.split(QS),n=[];for(let r=0;r<t.length;r++){const o=vx(t[r],e);if(n.push(o),o.type==="error")break}return n};function OR(){return new TransformStream({transform(i,e){IR(i,t=>{const n=t.length;let r;if(n<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,n);else if(n<65536){r=new Uint8Array(3);const o=new DataView(r.buffer);o.setUint8(0,126),o.setUint16(1,n)}else{r=new Uint8Array(9);const o=new DataView(r.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}let yx;function hy(i){return i.reduce((e,t)=>e+t.length,0)}function fy(i,e){if(i[0].length===e)return i.shift();const t=new Uint8Array(e);let n=0;for(let r=0;r<e;r++)t[r]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function BR(i,e){yx||(yx=new TextDecoder);const t=[];let n=0,r=-1,o=!1;return new TransformStream({transform(c,f){for(t.push(c);;){if(n===0){if(hy(t)<1)break;const p=fy(t,1);o=(p[0]&128)===128,r=p[0]&127,r<126?n=3:r===126?n=1:n=2}else if(n===1){if(hy(t)<2)break;const p=fy(t,2);r=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),n=3}else if(n===2){if(hy(t)<8)break;const p=fy(t,8),v=new DataView(p.buffer,p.byteOffset,p.length),A=v.getUint32(0);if(A>Math.pow(2,21)-1){f.enqueue(px);break}r=A*Math.pow(2,32)+v.getUint32(4),n=3}else{if(hy(t)<r)break;const p=fy(t,r);f.enqueue(vx(o?p:yx.decode(p),e)),n=0}if(r===0||r>i){f.enqueue(px);break}}}})}const JS=4;function qs(i){if(i)return UR(i)}function UR(i){for(var e in qs.prototype)i[e]=qs.prototype[e];return i}qs.prototype.on=qs.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this},qs.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this},qs.prototype.off=qs.prototype.removeListener=qs.prototype.removeAllListeners=qs.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var n,r=0;r<t.length;r++)if(n=t[r],n===e||n.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+i],this},qs.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,r=t.length;n<r;++n)t[n].apply(this,e)}return this},qs.prototype.emitReserved=qs.prototype.emit,qs.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]},qs.prototype.hasListeners=function(i){return!!this.listeners(i).length};const py=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),tu=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),VR="arraybuffer";function X4(){}function ZS(i,...e){return e.reduce((t,n)=>(i.hasOwnProperty(n)&&(t[n]=i[n]),t),{})}const GR=tu.setTimeout,HR=tu.clearTimeout;function my(i,e){e.useNativeTimers?(i.setTimeoutFn=GR.bind(tu),i.clearTimeoutFn=HR.bind(tu)):(i.setTimeoutFn=tu.setTimeout.bind(tu),i.clearTimeoutFn=tu.clearTimeout.bind(tu))}const WR=1.33;function qR(i){return typeof i=="string"?jR(i):Math.ceil((i.byteLength||i.size)*WR)}function jR(i){let e=0,t=0;for(let n=0,r=i.length;n<r;n++)e=i.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function KS(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function XR(i){let e="";for(let t in i)i.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(i[t]));return e}function YR(i){let e={},t=i.split("&");for(let n=0,r=t.length;n<r;n++){let o=t[n].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class QR extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class Ax extends qs{constructor(e){super(),this.writable=!1,my(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new QR(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=vx(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=XR(e);return t.length?"?"+t:""}}class JR extends Ax{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};FR(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,zR(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=KS()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let _S=!1;try{_S=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ZR=_S;function KR(){}class _R extends JR{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(r,o)=>{this.onError("xhr post error",r,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}let Dm=class sx extends qs{constructor(e,t,n){super(),this.createRequest=e,my(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=ZS(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this._opts.extraHeaders[r])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var r;n.readyState===3&&((r=this._opts.cookieJar)===null||r===void 0||r.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(r){this.setTimeoutFn(()=>{this._onError(r)},0);return}typeof document<"u"&&(this._index=sx.requestsCount++,sx.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=KR,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete sx.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};if(Dm.requestsCount=0,Dm.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",$S);else if(typeof addEventListener=="function"){const i="onpagehide"in tu?"pagehide":"unload";addEventListener(i,$S,!1)}}function $S(){for(let i in Dm.requests)Dm.requests.hasOwnProperty(i)&&Dm.requests[i].abort()}const $R=(function(){const i=e1({xdomain:!1});return i&&i.responseType!==null})();class e3 extends _R{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=$R&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Dm(e1,this.uri(),e)}}function e1(i){const e=i.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||ZR))return new XMLHttpRequest}catch{}if(!e)try{return new tu[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const t1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class t3 extends Ax{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=t1?{}:ZS(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;mx(n,this.supportsBinary,o=>{try{this.doWrite(n,o)}catch{}r&&py(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=KS()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const xx=tu.WebSocket||tu.MozWebSocket;class n3 extends t3{createSocket(e,t,n){return t1?new xx(e,t,n):t?new xx(e,t):new xx(e)}doWrite(e,t){this.ws.send(t)}}class i3 extends Ax{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=BR(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=OR();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const o=()=>{n.read().then(({done:f,value:p})=>{f||(this.onPacket(p),o())}).catch(f=>{})};o();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&py(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const r3={websocket:n3,webtransport:i3,polling:e3},s3=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,a3=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function bx(i){if(i.length>8e3)throw"URI too long";const e=i,t=i.indexOf("["),n=i.indexOf("]");t!=-1&&n!=-1&&(i=i.substring(0,t)+i.substring(t,n).replace(/:/g,";")+i.substring(n,i.length));let r=s3.exec(i||""),o={},c=14;for(;c--;)o[a3[c]]=r[c]||"";return t!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=o3(o,o.path),o.queryKey=l3(o,o.query),o}function o3(i,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function l3(i,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,r,o){r&&(t[r]=o)}),t}const wx=typeof addEventListener=="function"&&typeof removeEventListener=="function",gy=[];wx&&addEventListener("offline",()=>{gy.forEach(i=>i())},!1);class Fh extends qs{constructor(e,t){if(super(),this.binaryType=VR,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=bx(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=bx(t.host).host);my(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const r=n.prototype.name;this.transports.push(r),this._transportsByName[r]=n}),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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=YR(this.opts.query)),wx&&(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"})},gy.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=JS,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Fh.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",Fh.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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 e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(t+=qR(r)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,py(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if(typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(Fh.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){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(),wx&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=gy.indexOf(this._offlineEventListener);n!==-1&&gy.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}Fh.protocol=JS;class u3 extends Fh{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;Fh.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",S=>{if(!n)if(S.type==="pong"&&S.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Fh.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(A(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=t.name,this.emitReserved("upgradeError",b)}}))};function o(){n||(n=!0,A(),t.close(),t=null)}const c=S=>{const b=new Error("probe error: "+S);b.transport=t.name,o(),this.emitReserved("upgradeError",b)};function f(){c("transport closed")}function p(){c("socket closed")}function v(S){t&&S.name!==t.name&&o()}const A=()=>{t.removeListener("open",r),t.removeListener("error",c),t.removeListener("close",f),this.off("close",p),this.off("upgrading",v)};t.once("open",r),t.once("error",c),t.once("close",f),this.once("close",p),this.once("upgrading",v),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let c3=class extends u3{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(r=>r3[r]).filter(r=>!!r)),super(e,n)}};function d3(i,e="",t){let n=i;t=t||typeof location<"u"&&location,i==null&&(i=t.protocol+"//"+t.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=t.protocol+i:i=t.host+i),/^(https?|wss?):\/\//.test(i)||(typeof t<"u"?i=t.protocol+"//"+i:i="https://"+i),n=bx(i)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(t&&t.port===n.port?"":":"+n.port),n}const h3=typeof ArrayBuffer=="function",f3=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,n1=Object.prototype.toString,p3=typeof Blob=="function"||typeof Blob<"u"&&n1.call(Blob)==="[object BlobConstructor]",m3=typeof File=="function"||typeof File<"u"&&n1.call(File)==="[object FileConstructor]";function Sx(i){return h3&&(i instanceof ArrayBuffer||f3(i))||p3&&i instanceof Blob||m3&&i instanceof File}function vy(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(vy(i[t]))return!0;return!1}if(Sx(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return vy(i.toJSON(),!0);for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&vy(i[t]))return!0;return!1}function g3(i){const e=[],t=i.data,n=i;return n.data=Ex(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Ex(i,e){if(!i)return i;if(Sx(i)){const t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){const t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=Ex(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){const t={};for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=Ex(i[n],e));return t}return i}function v3(i,e){return i.data=Tx(i.data,e),delete i.attachments,i}function Tx(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=Tx(i[t],e);else if(typeof i=="object")for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=Tx(i[t],e));return i}const y3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ni;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(Ni||(Ni={}));class A3{constructor(e){this.replacer=e}encode(e){return(e.type===Ni.EVENT||e.type===Ni.ACK)&&vy(e)?this.encodeAsBinary({type:e.type===Ni.EVENT?Ni.BINARY_EVENT:Ni.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===Ni.BINARY_EVENT||e.type===Ni.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=g3(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}class Mx extends qs{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===Ni.BINARY_EVENT;n||t.type===Ni.BINARY_ACK?(t.type=n?Ni.EVENT:Ni.ACK,this.reconstructor=new x3(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(Sx(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(Ni[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===Ni.BINARY_EVENT||n.type===Ni.BINARY_ACK){const o=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const c=e.substring(o,t);if(c!=Number(c)||e.charAt(t)!=="-")throw new Error("Illegal attachments");const f=Number(c);if(!b3(f)||f<0)throw new Error("Illegal attachments");if(f>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=f}if(e.charAt(t+1)==="/"){const o=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(o,t)}else n.nsp="/";const r=e.charAt(t+1);if(r!==""&&Number(r)==r){const o=t+1;for(;++t;){const c=e.charAt(t);if(c==null||Number(c)!=c){--t;break}if(t===e.length)break}n.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(Mx.isPayloadValid(n.type,o))n.data=o;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Ni.CONNECT:return i1(t);case Ni.DISCONNECT:return t===void 0;case Ni.CONNECT_ERROR:return typeof t=="string"||i1(t);case Ni.EVENT:case Ni.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&y3.indexOf(t[0])===-1);case Ni.ACK:case Ni.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class x3{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=v3(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const b3=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function i1(i){return Object.prototype.toString.call(i)==="[object Object]"}const w3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Mx,Encoder:A3,get PacketType(){return Ni}},Symbol.toStringTag,{value:"Module"}));function ku(i,e,t){return i.on(e,t),function(){i.off(e,t)}}const S3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class r1 extends qs{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[ku(e,"open",this.onopen.bind(this)),ku(e,"packet",this.onpacket.bind(this)),ku(e,"error",this.onerror.bind(this)),ku(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,o;if(S3.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const c={type:Ni.EVENT,data:t};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const A=this.ids++,S=t.pop();this._registerAckCallback(A,S),c.id=A}const f=(r=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||r===void 0?void 0:r.writable,p=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!f||(p?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(e,t){var n;const r=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(r===void 0){this.acks[e]=t;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===e&&this.sendBuffer.splice(f,1);t.call(this,new Error("operation has timed out"))},r),c=(...f)=>{this.io.clearTimeoutFn(o),t.apply(this,f)};c.withError=!0,this.acks[e]=c}emitWithAck(e,...t){return new Promise((n,r)=>{const o=(c,f)=>c?r(c):n(f);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...o)=>(this._queue[0],r!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(r)):(this._queue.shift(),t&&t(null,...o)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Ni.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Ni.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 Ni.EVENT:case Ni.BINARY_EVENT:this.onevent(e);break;case Ni.ACK:case Ni.BINARY_ACK:this.onack(e);break;case Ni.DISCONNECT:this.ondisconnect();break;case Ni.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:Ni.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ni.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Lm(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}Lm.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*i);i=(Math.floor(e*10)&1)==0?i-t:i+t}return Math.min(i,this.max)|0},Lm.prototype.reset=function(){this.attempts=0},Lm.prototype.setMin=function(i){this.ms=i},Lm.prototype.setMax=function(i){this.max=i},Lm.prototype.setJitter=function(i){this.jitter=i};class Cx extends qs{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,my(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Lm({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||w3;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new c3(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=ku(t,"open",function(){n.onopen(),e&&e()}),o=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),e?e(f):this.maybeReconnectOnOpen()},c=ku(t,"error",o);if(this._timeout!==!1){const f=this._timeout,p=this.setTimeoutFn(()=>{r(),o(new Error("timeout")),t.close()},f);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(r),this.subs.push(c),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ku(e,"ping",this.onping.bind(this)),ku(e,"data",this.ondata.bind(this)),ku(e,"error",this.onerror.bind(this)),ku(e,"close",this.onclose.bind(this)),ku(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){py(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new r1(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Qg={};function yy(i,e){typeof i=="object"&&(e=i,i=void 0),e=e||{};const t=d3(i,e.path||"/socket.io"),n=t.source,r=t.id,o=t.path,c=Qg[r]&&o in Qg[r].nsps,f=e.forceNew||e["force new connection"]||e.multiplex===!1||c;let p;return f?p=new Cx(n,e):(Qg[r]||(Qg[r]=new Cx(n,e)),p=Qg[r]),t.query&&!e.query&&(e.query=t.queryKey),p.socket(t.path,e)}Object.assign(yy,{Manager:Cx,Socket:r1,io:yy,connect:yy});function E3({wsUrl:i,log:e}){let t=null;function n({authPayload:c,queryToken:f}){const p=yy(i,{transports:["polling"],timeout:2e4,reconnection:!1,auth:c,query:f?{token:f}:void 0});return t=p,p}function r(){if(t){try{t.removeAllListeners(),t.connected?t.disconnect():t.close()}catch{}t=null}}function o(){return t}return{connectSocketRaw:n,cleanupSocket:r,getSocket:o}}const T3=i=>{if(window.audioCtx=i,i.state!=="suspended")return;const e=document.body,t=["touchstart","touchend","mousedown","keydown"];t.forEach(o=>e.addEventListener(o,n,!1));function n(){i.resume().then(r)}function r(){t.forEach(o=>e.removeEventListener(o,n))}};function da(i){this.init(i)}da.prototype.init=function(i){var e={encoding:"16bitInt",channels:1,sampleRate:16e3};this.option=Object.assign({},e,i),this.flush=this.flush.bind(this),this.maxValue=this.getMaxValue(),this.typedArray=this.getTypedArray(),this.playingBufferNode=null,this.scheduledBufferNode=null,this.createContext(),this.resetState()},da.prototype.getMaxValue=function(){var i={"8bitInt":128,"16bitInt":32768,"32bitInt":2147483648,"32bitFloat":1};return i[this.option.encoding]?i[this.option.encoding]:i["16bitInt"]},da.prototype.getTypedArray=function(){var i={"8bitInt":Int8Array,"16bitInt":Int16Array,"32bitInt":Int32Array,"32bitFloat":Float32Array};return i[this.option.encoding]?i[this.option.encoding]:i["16bitInt"]},da.prototype.createContext=function(){this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.audioCtx.resume(),this.audioCtx.onstatechange=()=>console.log("audioCtx.state",this.audioCtx.state),T3(this.audioCtx),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioCtx.destination),this.startTime=this.audioCtx.currentTime},da.prototype.resetState=function(){this.playingStartTime=-1,this.lastGotTimestamp=0,this.samples=new Float32Array,this.timeout=void 0,this.flag_request_stop=!1,this.startTime=0},da.prototype.isTypedArray=function(i){return i.byteLength&&i.buffer&&i.buffer.constructor==ArrayBuffer},da.prototype.feed=function(i){if(this.isTypedArray(i)){i=this.getFormatedValue(i);var e=new Float32Array(this.samples.length+i.length);e.set(this.samples,0),e.set(i,this.samples.length),this.samples=e,this.timeout||this.flush()}},da.prototype.getFormatedValue=function(e){var e=new this.typedArray(e.buffer),t=new Float32Array(e.length),n;for(n=0;n<e.length;n++)t[n]=e[n]/this.maxValue;return t},da.prototype.volume=function(i){this.gainNode.gain.value=i},da.prototype.destroy=function(){this.interval&&clearInterval(this.interval),this.samples=null,this.audioCtx.close(),this.audioCtx=null},da.prototype.getTimestamp=function(i){if(this.playingStartTime>=0){if(!i)return this.audioCtx.currentTime-this.playingStartTime;const e=this.lastGotTimestamp;return this.lastGotTimestamp+=i/1e3,e}return 0},da.prototype.setRequestStop=function(){this.flag_request_stop=!0},da.prototype.setOnEnd=function(i){this.onEnd=i},da.prototype.interrupt=function(i){this.scheduledBufferNode&&this.scheduledBufferNode.stop(0),this.playingBufferNode&&this.playingBufferNode.stop(0),this.ensuredClearTimeout(),this.resetState(),this.flag_request_stop=!1},da.prototype.ensuredSetTimeout=(function(){let i;return function(e,t){i=performance.now();const n=r=>{r-i>=t?(this.timeout=void 0,e()):this.timeout=requestAnimationFrame(n)};this.timeout=requestAnimationFrame(n)}})(),da.prototype.ensuredClearTimeout=function(){this.timeout&&(cancelAnimationFrame(this.timeout),this.timeout=void 0)},da.prototype.flush=function(){if(this.samples.length){var i=this.audioCtx.createBufferSource(),e=this.samples.length/this.option.channels,t=this.audioCtx.createBuffer(this.option.channels,e,this.option.sampleRate),n,r,o,c,f;for(r=0;r<this.option.channels;r++)for(n=t.getChannelData(r),o=r,f=50,c=0;c<e;c++)n[c]=this.samples[o],c<50&&(n[c]=n[c]*c/50),c>=e-51&&(n[c]=n[c]*f--/50),o+=this.option.channels;if(this.startTime<this.audioCtx.currentTime&&(this.startTime=this.audioCtx.currentTime),this.samples=new Float32Array,i.buffer=t,i.connect(this.gainNode),i.start(this.startTime),this.playingBufferNode=this.scheduledBufferNode,this.scheduledBufferNode=i,this.playingStartTime<0&&(this.playingStartTime=this.startTime),this.startTime+=t.duration,this.flag_request_stop)this.flag_request_stop=!1,i.onended=()=>{this.resetState(),this.onEnd&&this.onEnd()};else{const p=(this.startTime-this.audioCtx.currentTime)*1e3;this.ensuredSetTimeout(this.flush,p-50)}}};function M3(i,e){const t=new da(i),n=t.destroy.bind(t);let r=!1;return t.destroy=()=>{if(!r){r=!0;try{n()}catch{}}},t.setOnEnd(()=>{r||e()}),t._isDestroyed=()=>r,t}function C3({enableAudio:i,pcmOptions:e,log:t,onPlaybackComplete:n}){let r=null,o=null;function c(){if(!i||r)return r;const P={...MR,...e||{}};return r=M3(P,()=>{n()}),r}function f(){if(r){try{r.interrupt?.(),r.destroy?.()}catch{}r=null}}function p(P){const I=c();if(I)try{I.feed(P)}catch(U){t("feedAudio: player.feed() failed",U),n()}}function v(){if(!r){n();return}try{r.setRequestStop(),r.playingBufferNode||r.scheduledBufferNode||n()}catch(P){t("requestStop: setRequestStop() failed",P),n()}}function A(){f()}function S(){if(r)try{const P=r.audioCtx;P?.state==="running"&&P.suspend()}catch(P){t("pauseAudioPlayback: audioCtx.suspend() failed",P)}}async function b(){const P=c();if(P)try{const I=P.audioCtx;I?.state==="suspended"&&await I.resume()}catch(I){t("resumeAudioPlayback: audioCtx.resume() failed",I)}}function M(P){o=P||null}function k(){return o}function L(){return r?r._isDestroyed?.()??!0:!0}return{ensurePcmPlayer:c,destroyPcmPlayer:f,feedAudio:p,requestStop:v,interruptPlayback:A,pauseAudioPlayback:S,resumeAudioPlayback:b,attachAudioElement:M,getAudioElement:k,isDestroyed:L}}function k3(i){const{wsUrl:e,restUrl:t,enableAudio:n,pcmOptions:r,debug:o,withCredentials:c,onPlaybackComplete:f}=i,p=pe.useCallback((...b)=>{o&&console.log("[RqmiiSDK]",...b)},[o]),v=pe.useRef(null),A=pe.useRef(null),S=pe.useRef(null);return v.current||(v.current=E3({wsUrl:e,log:p})),A.current||(A.current=C3({enableAudio:n,pcmOptions:r,log:p,onPlaybackComplete:f})),S.current||(S.current=PR({restUrl:t,log:p,withCredentials:c})),pe.useEffect(()=>()=>{v.current?.cleanupSocket(),A.current?.destroyPcmPlayer()},[]),{socketMgrRef:v,audioMgrRef:A,sessionMgrRef:S,log:p}}function kx(i){return String(i||"").toLowerCase().replaceAll("-","_")}function R3(i){if(!i)return null;if(i instanceof Uint8Array)return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(typeof i=="object"&&i!==null){const e=i;if(e.buffer instanceof ArrayBuffer){const t=i,n=Number.isInteger(t.byteOffset)?t.byteOffset:0,r=Number.isInteger(t.byteLength)?t.byteLength:t.buffer.byteLength-n;return new Uint8Array(t.buffer,n,r)}if(e.type==="Buffer"&&Array.isArray(e.data))return new Uint8Array(e.data)}try{return new Uint8Array(i)}catch{return null}}function P3(i){const{socket:e,dispatch:t,stateRef:n,sessionIdRef:r,sessionAgentTypeRef:o,interruptedRef:c,manualDisconnectRef:f,chunkAccumulatorRef:p,clientToolsRef:v,audioMgrRef:A,enableAudio:S,cbRefs:b,eventsEmitter:M}=i,k=xc,L=A.current;e.on(k.DISCONNECT,P=>{if(t({type:"SET_CONNECTION_STATE",payload:Qr.IDLE}),t({type:"SET_SESSION_READY",payload:!1}),b.current.onDisconnect?.(P),P==="io server disconnect"||P==="io client disconnect"||f.current){t({type:"SET_CONNECTION_STATE",payload:Qr.ENDED});return}t({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),t({type:"SET_ERROR",payload:"Connection lost"})}),e.on(k.SESSION_READY,P=>{t({type:"SET_SESSION_READY",payload:!0}),t({type:"SET_ERROR",payload:null}),P?.agentType&&t({type:"UPDATE_SESSION",payload:{agentType:kx(P.agentType)}})}),e.on(k.SESSION_JOINED,()=>{t({type:"SET_SESSION_READY",payload:!0}),t({type:"SET_ERROR",payload:null})}),e.on(k.SESSION_TERMINATED,()=>{L.interruptPlayback(),t({type:"SET_AUDIO_PLAYING",payload:!1}),t({type:"SET_CONNECTION_STATE",payload:Qr.ENDED}),t({type:"SET_SESSION_READY",payload:!1}),b.current.onSessionTerminated?.(),e.disconnect()}),e.on(k.TRANSCRIPT,P=>{const I=P||null;t({type:"SET_TRANSCRIPT",payload:I}),I?.is_final&&I?.text?.trim()&&(t({type:"ADD_MESSAGE",payload:{id:`transcript-${Date.now()}`,role:"user",text:I.text.trim(),timestamp:new Date().toISOString()}}),t({type:"SET_PARTIAL_TRANSCRIPT",payload:null})),M.emit("transcript",I??void 0),M.emit("partial_transcript",void 0)}),e.on(k.PARTIAL_TRANSCRIPT,P=>{const I=typeof P=="string"?P:P?.text;if(typeof I=="string"&&I.length===0)return;const U=P||null;t({type:"SET_PARTIAL_TRANSCRIPT",payload:U}),M.emit("partial_transcript",U??void 0)}),e.on(k.AGENT_RESPONSE_CHUNK,P=>{const{id:I,text:U}=p.current.addChunk(P?.requestId,P?.text);t({type:"SET_MESSAGES",payload:[...n.current.messages.filter(W=>W.id!==I),{id:I,role:"assistant",text:U,streaming:!0,timestamp:new Date().toISOString()}]})}),e.on(k.AGENT_RESPONSE,P=>{const{id:I,text:U}=p.current.consume(P?.requestId,P?.text);t({type:"SET_MESSAGES",payload:[...n.current.messages.filter(W=>W.id!==I),{id:I,role:"assistant",text:U,streaming:!1,timestamp:new Date().toISOString()}]})}),e.on(k.AVATAR_SPEAKING,()=>{t({type:"SET_AVATAR_SPEAKING",payload:!0})}),e.on(k.AVATAR_SPEAKING_DONE,()=>{t({type:"SET_AVATAR_SPEAKING",payload:!1})}),e.on(k.AGENT_AUDIO_CHUNK,P=>{if(!S||c.current)return;const I=kx(o.current);if(I==="cloud_avatar"||I==="desktop_avatar"||I==="text")return;const U=R3(P?.audio);U&&(L.feedAudio(U),t({type:"SET_AUDIO_PLAYING",payload:!0}))}),e.on(k.AGENT_AUDIO_COMPLETE,()=>{if(!S)return;const P=kx(o.current);P==="cloud_avatar"||P==="desktop_avatar"||P==="text"||L.requestStop()}),e.on(k.INTERRUPTED,()=>{const P=!L.isDestroyed();c.current=!1,L.interruptPlayback(),t({type:"SET_AUDIO_PLAYING",payload:!1}),P&&e.connected&&e.emit(k.AUDIO_PLAYBACK_COMPLETE,{session_id:r.current})}),e.on(k.AUTH_ERROR,P=>{t({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),t({type:"SET_ERROR",payload:P?.message||"Authentication error"})}),e.on(k.ERROR,P=>{const I=P?.code;if(!(I==="TTS_ERROR"||I==="STT_ERROR"||I==="LLM_ERROR")){if(I==="INSUFFICIENT_CREDITS"){t({type:"SET_CREDIT_EXHAUSTED",payload:{exhausted:!0,error:P?.message||"Insufficient credits to process this request."}}),b.current.onError?.(P);return}t({type:"SET_ERROR",payload:P?.message||P?.detail||"Server error"}),b.current.onError?.(P)}}),e.on(k.SESSION_EXPIRED,P=>{t({type:"SET_CONNECTION_STATE",payload:Qr.ENDED}),t({type:"SET_SESSION_READY",payload:!1}),b.current.onSessionExpired?.(P)}),e.on(k.CREDITS_EXHAUSTED,()=>{t({type:"SET_CREDIT_EXHAUSTED",payload:{exhausted:!0,error:"This project has run out of credits."}}),t({type:"SET_CONNECTION_STATE",payload:Qr.ENDED}),t({type:"SET_SESSION_READY",payload:!1}),f.current=!0;try{e.disconnect()}catch{}}),e.on(k.SESSION_STATE_CHANGED,P=>{P?.state&&t({type:"SET_SESSION_STATE",payload:P.state})}),e.on(k.LANGUAGE_CHANGED,P=>{const I=P?.language;I&&M.emit("language_changed",{language:I})}),e.on(k.SHOW_LEAD_CAPTURE_FORM,P=>{const I=Array.isArray(P?.fields)?P.fields:[],U=P?.agentId;!U||I.length===0||t({type:"ADD_MESSAGE",payload:{id:`lead-form-${Date.now()}`,role:"lead_form",text:"",form:{agentId:U,title:P?.title,fields:I},timestamp:new Date().toISOString()}})}),e.on(k.MESSAGE_RATE_LIMITED,P=>{M.emit("message_rate_limited",P)}),e.on(k.CLIENT_TOOL_REQUEST,P=>{const I=P?.executionId,U=P?.toolName,W=P?.parameters??{},B=P?.waitForResponse!==!1;if(!U)return;const j=v.current[U];if(!j)return;const q={minimize:()=>M.emit("minimize_chat"),maximize:()=>M.emit("maximize_chat")};B&&I?j(W,q).then(_=>{e.emit(k.CLIENT_TOOL_RESULT,{executionId:I,result:_})}).catch(_=>{e.emit(k.CLIENT_TOOL_RESULT,{executionId:I,result:{error:_ instanceof Error?_.message:String(_)}})}):j(W,q).catch(()=>{})})}class I3{listeners=new Map;on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}once(e,t){const n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){this.listeners.get(e)?.delete(t)}emit(e,t){const n=this.listeners.get(e);if(n)for(const r of n)try{r(t)}catch{}}removeAllListeners(){this.listeners.clear()}}function s1(){if(typeof window>"u")return;const i=window;i.__rqmii_orig_console||(i.__rqmii_orig_console={error:console.error,warn:console.warn,log:console.log,debug:console.debug});const e=i.__rqmii_orig_console,t=n=>{if(n.length===0)return!1;const r=String(n[0]);return r.includes("reading 'S'")||r.includes("reading 'state'")||r.includes("MicVAD has null stream")||r.includes("VAD |")||r.includes("audioCtx.state")||r.includes("using default audio context")};console.error=(...n)=>{t(n)||e.error.apply(console,n)},console.warn=(...n)=>{t(n)||e.warn.apply(console,n)},console.log=(...n)=>{t(n)||e.log.apply(console,n)},console.debug=(...n)=>{t(n)||e.debug.apply(console,n)}}const a1=pe.createContext(null);function D3({children:i,wsUrl:e="wss://ws.rqmii.com",restUrl:t="https://api.rqmii.com",enableAudio:n=!0,pcmOptions:r,debug:o=!1,heartbeatIntervalSeconds:c=15,withCredentials:f=!1,onSessionExpired:p,onSessionTerminated:v,onError:A,onDisconnect:S}){const[b,M]=pe.useReducer(VS,fx),k=pe.useRef(b),L=pe.useCallback(yt=>{k.current=VS(k.current,yt),M(yt)},[]),P=pe.useRef(!1),I=pe.useRef(kR()),U=pe.useRef(null),W=pe.useRef(fx.session.agentType),B=pe.useRef(!1),j=pe.useRef(new I3),q=pe.useRef({}),_=pe.useRef({onSessionExpired:p,onSessionTerminated:v,onError:A,onDisconnect:S});pe.useEffect(()=>{s1(),_.current={onSessionExpired:p,onSessionTerminated:v,onError:A,onDisconnect:S}},[p,v,A,S]),pe.useEffect(()=>{W.current=b.session.agentType},[b.session.agentType]),pe.useEffect(()=>{U.current=b.session.sessionId},[b.session.sessionId]);const G=pe.useCallback(()=>{L({type:"SET_AUDIO_PLAYING",payload:!1});const yt=Z.current?.getSocket();yt?.connected&&yt.emit(xc.AUDIO_PLAYBACK_COMPLETE,{session_id:U.current})},[]),{socketMgrRef:Z,audioMgrRef:ie,sessionMgrRef:oe}=k3({wsUrl:e,restUrl:t,enableAudio:n,pcmOptions:r,debug:o,withCredentials:f,onPlaybackComplete:G}),ve=pe.useCallback(yt=>{P3({socket:yt,dispatch:L,stateRef:k,sessionIdRef:U,sessionAgentTypeRef:W,interruptedRef:B,manualDisconnectRef:P,chunkAccumulatorRef:I,clientToolsRef:q,audioMgrRef:{current:ie.current},enableAudio:n,cbRefs:_,eventsEmitter:j.current})},[n]),Se=pe.useCallback(({authPayload:yt,queryToken:be})=>new Promise((Kn,qn)=>{Z.current?.cleanupSocket();const de=Z.current.connectSocketRaw({authPayload:yt,queryToken:be});ve(de),de.once("connect",()=>{L({type:"SET_CONNECTION_STATE",payload:Qr.CONNECTED}),L({type:"SET_ERROR",payload:null}),Kn(de)}),de.once("connect_error",J=>{L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:J?.message||"Connection error"}),qn(J)})}),[ve]),Ne=pe.useCallback(({keepManualDisconnect:yt=!1}={})=>{P.current=!0,B.current=!1,I.current.clear(),ie.current.destroyPcmPlayer(),Z.current.cleanupSocket(),yt||(P.current=!1),L({type:"HARD_RESET"})},[]),Me=pe.useCallback(async({apiKey:yt,publicChatId:be,agentId:Kn,userId:qn,language:de="en",clientTools:J,config:Be}={})=>{if(!yt&&!be&&!Kn)throw new Error("Provide one of apiKey, publicChatId, or agentId");Ne(),q.current=J??{},L({type:"SET_CONNECTION_STATE",payload:Qr.INITIALIZING}),L({type:"SET_ERROR",payload:null});const Ye=RR();let at;try{at=await oe.current.initializeSession({apiKey:yt,publicChatId:be,agentId:Kn,userId:qn,language:de,timezone:Ye,config:Be})}catch(Bt){const lt=Bt;throw lt.status===401||lt.status===403?(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:lt.message||"Authentication failed"})):lt.status===402?(L({type:"SET_CREDIT_EXHAUSTED",payload:{exhausted:!0,error:lt.message||"Insufficient credits"}}),L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED})):lt.status===429?(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:lt.message||"Too many requests. Please try again later."})):(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:lt.message||"Failed to initialize session"})),Bt}const It=at;L({type:"UPDATE_SESSION",payload:{sessionId:It.session_id,agentType:It.streaming_url?eu.CLOUD_AVATAR:b.session.agentType,streamingUrl:It.streaming_url||null,uniqueId:It.unique_id||null}}),L({type:"SET_CONNECTION_STATE",payload:Qr.CONNECTING}),L({type:"SET_CLOUD_STREAM_STATE",payload:{state:It.streaming_url?xl.CONNECTING:xl.IDLE,error:null}}),P.current=!0;try{await Se({authPayload:{token:It.session_token},queryToken:It.session_token}),P.current=!1}catch(Bt){throw P.current=!1,Bt}return at},[Se,Ne,e,b.session.agentType]),Ae=pe.useCallback(async({uniqueId:yt})=>{if(!yt)throw new Error("uniqueId is required");Ne(),L({type:"SET_CONNECTION_STATE",payload:Qr.INITIALIZING}),L({type:"SET_ERROR",payload:null});let be;try{be=await oe.current.joinDesktopSession({uniqueId:yt})}catch(qn){const de=qn;throw(de.status===401||de.status===403)&&(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:de.message||"Authentication failed"})),de.status===402&&(L({type:"SET_CREDIT_EXHAUSTED",payload:{exhausted:!0,error:de.message||"Insufficient credits"}}),L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED})),de.status===429&&(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:de.message||"Too many requests. Please try again later."})),qn}const Kn=be;L({type:"UPDATE_SESSION",payload:{sessionId:Kn.session_id,uniqueId:yt,role:"user",agentType:eu.DESKTOP_AVATAR}}),L({type:"SET_CONNECTION_STATE",payload:Qr.CONNECTING}),L({type:"SET_CLOUD_STREAM_STATE",payload:{state:xl.IDLE,error:null}}),P.current=!0;try{await Se({authPayload:{token:Kn.session_token},queryToken:Kn.session_token}),P.current=!1}catch(qn){throw P.current=!1,qn}return be},[Se,Ne,e]),me=pe.useCallback(()=>Ne({keepManualDisconnect:!0}),[Ne]),fe=pe.useCallback(async()=>{const yt=Z.current?.getSocket();return yt&&b.isConnected&&(yt.emit("end_session"),await new Promise(be=>setTimeout(be,150))),me(),{success:!0}},[me,b.isConnected]),ke=pe.useCallback(()=>{const yt=Z.current?.getSocket();yt?.connected?yt.emit("end_session"):(L({type:"SET_CONNECTION_STATE",payload:Qr.ENDED}),L({type:"SET_SESSION_READY",payload:!1}))},[]),Ce=pe.useCallback((yt,be={})=>{const Kn=Z.current?.getSocket();return!Kn||!b.isConnected?!1:(Kn.emit(yt,be),!0)},[b.isConnected]),ce=pe.useCallback(yt=>!yt||!String(yt).trim()?!1:(L({type:"ADD_MESSAGE",payload:{id:`user-${Date.now()}`,role:"user",text:String(yt),timestamp:new Date().toISOString()}}),Ce(xc.USER_MESSAGE,{message:String(yt)})),[Ce]),ze=pe.useCallback((yt,be)=>{!be||!String(be).trim()||L({type:"ADD_MESSAGE",payload:{id:`${yt}-${Date.now()}`,role:yt,text:String(be),timestamp:new Date().toISOString()}})},[]),bt=pe.useCallback(yt=>!yt||!String(yt).trim()?!1:Ce(xc.USER_MESSAGE,{message:String(yt)}),[Ce]),Rt=pe.useCallback(yt=>Ce(xc.AUDIO_CHUNK,{audio:yt}),[Ce]),Ct=pe.useCallback(()=>Ce(xc.AUDIO_END,{}),[Ce]),He=pe.useCallback(()=>(B.current=!0,ie.current.interruptPlayback(),L({type:"SET_AUDIO_PLAYING",payload:!1}),Ce(xc.INTERRUPT,{})),[Ce]),gt=pe.useCallback(()=>Ce(xc.CLEAR_SESSION_HISTORY,{}),[Ce]),tt=pe.useCallback(yt=>yt?Ce(xc.CHANGE_SESSION_LANGUAGE,{language:yt}):!1,[Ce]),Lt=pe.useCallback((yt={})=>Ce(xc.CLIENT_READY,yt),[Ce]),Vt=pe.useCallback(()=>{I.current.clear(),L({type:"SET_MESSAGES",payload:[]})},[]),hn=pe.useCallback(yt=>{L({type:"SET_MESSAGES",payload:yt})},[]),Vn=pe.useCallback(()=>ie.current.resumeAudioPlayback(),[]),fn=pe.useCallback(()=>ie.current.pauseAudioPlayback(),[]),dt=pe.useCallback(yt=>ie.current.attachAudioElement(yt),[]),it=pe.useCallback((yt,be=null)=>{L({type:"SET_CLOUD_STREAM_STATE",payload:{state:yt,error:be?String(be):null}})},[]),ht=pe.useCallback(async yt=>{try{const be=await oe.current.fetchAgentConfig(yt);return L({type:"SET_AGENT_CONFIG",payload:be}),be}catch(be){throw L({type:"SET_AGENT_CONFIG",payload:null}),be}},[t]),Pt=pe.useCallback(yt=>{Object.keys(q.current).length===0?q.current=yt:Object.assign(q.current,yt)},[]),Gt=pe.useCallback(yt=>{const be=yt.sessionId||U.current;return be?oe.current.submitFeedback({sessionId:be,rating:yt.rating,feedback:yt.feedback,endedBy:yt.endedBy}):Promise.reject(new Error("No session id available for feedback"))},[]),Sn=pe.useCallback(yt=>{const be=yt.sessionId||U.current;return be?oe.current.submitLead({agentId:yt.agentId,sessionId:be,collectedData:yt.collectedData}):Promise.reject(new Error("No session id available for lead capture"))},[]),$t=pe.useMemo(()=>CR(b.sessionState),[b.sessionState]),yn=pe.useMemo(()=>({...b,...$t,initializeSession:Me,joinDesktopSession:Ae,disconnect:me,terminateSession:fe,endSession:ke,emit:Ce,sendTextMessage:ce,addLocalMessage:ze,emitUserMessage:bt,sendAudioChunk:Rt,endAudioStream:Ct,interrupt:He,clearSessionHistory:gt,changeSessionLanguage:tt,signalClientReady:Lt,clearMessages:Vt,setMessages:hn,resumeAudioPlayback:Vn,pauseAudioPlayback:fn,attachAudioElement:dt,fetchAgentConfig:ht,submitFeedback:Gt,submitLead:Sn,setCloudStreamState:it,registerClientTools:Pt,events:j.current,audioElement:ie.current?.getAudioElement()??null,socket:Z.current?.getSocket()??null}),[b,$t,Me,Ae,me,fe,ke,Ce,ce,ze,bt,Rt,Ct,He,gt,tt,Lt,Vt,hn,Vn,fn,dt,it,Pt,Gt,Sn]);return ge.jsx(a1.Provider,{value:yn,children:i})}function hp(){const i=pe.useContext(a1);if(!i)throw new Error("useRqmiiAgentContext must be used inside <RqmiiAgentProvider>");return i}function fp(){const i=hp();return{connectionState:i.connectionState,isConnected:i.isConnected,isSessionReady:i.isSessionReady,error:i.error,session:i.session,creditExhausted:i.creditExhausted,creditError:i.creditError,sessionState:i.sessionState,isSessionTerminated:i.isSessionTerminated,isSessionTerminating:i.isSessionTerminating,isAgentThinking:i.isAgentThinking,isAgentSpeaking:i.isAgentSpeaking,isToolExecuting:i.isToolExecuting,agentConfig:i.agentConfig,initializeSession:i.initializeSession,joinDesktopSession:i.joinDesktopSession,disconnect:i.disconnect,terminateSession:i.terminateSession,endSession:i.endSession,interrupt:i.interrupt,clearSessionHistory:i.clearSessionHistory,changeSessionLanguage:i.changeSessionLanguage,signalClientReady:i.signalClientReady,fetchAgentConfig:i.fetchAgentConfig,submitFeedback:i.submitFeedback,registerClientTools:i.registerClientTools,events:i.events}}function L3({connect:i=!0,session:e,onError:t,onInitialized:n,clientTools:r,children:o}){const{initializeSession:c,joinDesktopSession:f,disconnect:p,registerClientTools:v}=fp(),A=pe.useRef(!1),S=pe.useRef(!1),b=pe.useRef(c),M=pe.useRef(f),k=pe.useRef(p),L=pe.useRef(t),P=pe.useRef(n),I=pe.useRef(v),U=pe.useRef(r);return pe.useEffect(()=>{b.current=c}),pe.useEffect(()=>{M.current=f}),pe.useEffect(()=>{k.current=p}),pe.useEffect(()=>{L.current=t}),pe.useEffect(()=>{P.current=n}),pe.useEffect(()=>{I.current=v}),pe.useEffect(()=>{U.current=r}),pe.useEffect(()=>{if(!i||A.current)return;A.current=!0,S.current=!1;let W=!1;return(async()=>{try{const j=U.current;if(e?.mode==="join_desktop"){const _=await M.current({uniqueId:e.uniqueId});W||(j&&I.current(j),P.current?.(_));return}const q=await b.current({apiKey:e?.apiKey,publicChatId:e?.publicChatId,agentId:e?.agentId,language:e?.language||"en",config:e?.config,clientTools:j});W||P.current?.(q)}catch(j){W||(S.current=!0,L.current?.(j))}})(),()=>{W=!0,!S.current&&(k.current(),A.current=!1)}},[i,e]),ge.jsx(ge.Fragment,{children:o})}function N3({children:i,wsUrl:e,restUrl:t,session:n,connect:r=!0,enableAudio:o=!0,pcmOptions:c,debug:f=!1,withCredentials:p=!1,onError:v,onInitialized:A,clientTools:S}){return ge.jsx(D3,{wsUrl:e,restUrl:t,enableAudio:o,pcmOptions:c,debug:f,withCredentials:p,children:ge.jsx(L3,{connect:r,session:n,onError:v,onInitialized:A,clientTools:S,children:i})})}var Rx={exports:{}},o1;function z3(){return o1||(o1=1,(function(i){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
41
+ `+H.stack}return{value:l,source:d,stack:z,digest:null}}function qf(l,d,y){return{value:l,source:null,stack:y??null,digest:d??null}}function jf(l,d){try{console.error(d.value)}catch(y){setTimeout(function(){throw y})}}var Vg=typeof WeakMap=="function"?WeakMap:Map;function bm(l,d,y){y=es(-1,y),y.tag=3,y.payload={element:null};var T=d.value;return y.callback=function(){pc||(pc=!0,Xl=T),jf(l,d)},y}function wm(l,d,y){y=es(-1,y),y.tag=3;var T=l.type.getDerivedStateFromError;if(typeof T=="function"){var z=d.value;y.payload=function(){return T(z)},y.callback=function(){jf(l,d)}}var H=l.stateNode;return H!==null&&typeof H.componentDidCatch=="function"&&(y.callback=function(){jf(l,d),typeof T!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var ee=d.stack;this.componentDidCatch(d.value,{componentStack:ee!==null?ee:""})}),y}function Xf(l,d,y){var T=l.pingCache;if(T===null){T=l.pingCache=new Vg;var z=new Set;T.set(d,z)}else z=T.get(d),z===void 0&&(z=new Set,T.set(d,z));z.has(y)||(z.add(y),l=rp.bind(null,l,d,y),d.then(l,l))}function Gg(l){do{var d;if((d=l.tag===13)&&(d=l.memoizedState,d=d!==null?d.dehydrated!==null:!0),d)return l;l=l.return}while(l!==null);return null}function ta(l,d,y,T,z){return(l.mode&1)===0?(l===d?l.flags|=65536:(l.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(d=es(-1,1),d.tag=2,ur(y,d,1))),y.lanes|=1),l):(l.flags|=65536,l.lanes=z,l)}var oo=B.ReactCurrentOwner,na=!1;function ns(l,d,y,T){d.child=l===null?Mf(d,null,y,T):rc(d,l.child,y,T)}function Yf(l,d,y,T,z){y=y.render;var H=d.ref;return Gl(d,z),T=Nf(l,d,y,T,H,z),y=zf(),l!==null&&!na?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~z,Cr(l,d,z)):(ji&&y&&Er(d),d.flags|=1,ns(l,d,T,z),d.child)}function oc(l,d,y,T,z){if(l===null){var H=y.type;return typeof H=="function"&&!Md(H)&&H.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(d.tag=15,d.type=H,Qf(l,d,H,T,z)):(l=gr(y.type,null,T,d,d.mode,z),l.ref=d.ref,l.return=d,d.child=l)}if(H=l.child,(l.lanes&z)===0){var ee=H.memoizedProps;if(y=y.compare,y=y!==null?y:Qu,y(ee,T)&&l.ref===d.ref)return Cr(l,d,z)}return d.flags|=1,l=er(H,T),l.ref=d.ref,l.return=d,d.child=l}function Qf(l,d,y,T,z){if(l!==null){var H=l.memoizedProps;if(Qu(H,T)&&l.ref===d.ref)if(na=!1,d.pendingProps=T=H,(l.lanes&z)!==0)(l.flags&131072)!==0&&(na=!0);else return d.lanes=l.lanes,Cr(l,d,z)}return Mh(l,d,y,T,z)}function Sm(l,d,y){var T=d.pendingProps,z=T.children,H=l!==null?l.memoizedState:null;if(T.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null,transitions:null},zi(hc,Rr),Rr|=y;else{if((y&1073741824)===0)return l=H!==null?H.baseLanes|y:y,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:l,cachePool:null,transitions:null},d.updateQueue=null,zi(hc,Rr),Rr|=l,null;d.memoizedState={baseLanes:0,cachePool:null,transitions:null},T=H!==null?H.baseLanes:y,zi(hc,Rr),Rr|=T}else H!==null?(T=H.baseLanes|y,d.memoizedState=null):T=y,zi(hc,Rr),Rr|=T;return ns(l,d,z,y),d.child}function Jf(l,d){var y=d.ref;(l===null&&y!==null||l!==null&&l.ref!==y)&&(d.flags|=512,d.flags|=2097152)}function Mh(l,d,y,T,z){var H=$s(y)?rl:zs.current;return H=_s(d,H),Gl(d,z),y=Nf(l,d,y,T,H,z),T=zf(),l!==null&&!na?(d.updateQueue=l.updateQueue,d.flags&=-2053,l.lanes&=~z,Cr(l,d,z)):(ji&&T&&Er(d),d.flags|=1,ns(l,d,y,z),d.child)}function Em(l,d,y,T,z){if($s(y)){var H=!0;mh(d)}else H=!1;if(Gl(d,z),d.stateNode===null)hl(l,d),Am(d,y,T),Wf(d,y,T,z),T=!0;else if(l===null){var ee=d.stateNode,Te=d.memoizedProps;ee.props=Te;var Le=ee.context,je=y.contextType;typeof je=="object"&&je!==null?je=Ea(je):(je=$s(y)?rl:zs.current,je=_s(d,je));var Et=y.getDerivedStateFromProps,Nt=typeof Et=="function"||typeof ee.getSnapshotBeforeUpdate=="function";Nt||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(Te!==T||Le!==je)&&xm(d,ee,T,je),Os=!1;var wt=d.memoizedState;ee.state=wt,Tr(d,T,ee,z),Le=d.memoizedState,Te!==T||wt!==Le||ei.current||Os?(typeof Et=="function"&&(Do(d,y,Et,T),Le=d.memoizedState),(Te=Os||bu(d,y,Te,T,wt,Le,je))?(Nt||typeof ee.UNSAFE_componentWillMount!="function"&&typeof ee.componentWillMount!="function"||(typeof ee.componentWillMount=="function"&&ee.componentWillMount(),typeof ee.UNSAFE_componentWillMount=="function"&&ee.UNSAFE_componentWillMount()),typeof ee.componentDidMount=="function"&&(d.flags|=4194308)):(typeof ee.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=T,d.memoizedState=Le),ee.props=T,ee.state=Le,ee.context=je,T=Te):(typeof ee.componentDidMount=="function"&&(d.flags|=4194308),T=!1)}else{ee=d.stateNode,$r(l,d),Te=d.memoizedProps,je=d.type===d.elementType?Te:Wr(d.type,Te),ee.props=je,Nt=d.pendingProps,wt=ee.context,Le=y.contextType,typeof Le=="object"&&Le!==null?Le=Ea(Le):(Le=$s(y)?rl:zs.current,Le=_s(d,Le));var sn=y.getDerivedStateFromProps;(Et=typeof sn=="function"||typeof ee.getSnapshotBeforeUpdate=="function")||typeof ee.UNSAFE_componentWillReceiveProps!="function"&&typeof ee.componentWillReceiveProps!="function"||(Te!==Nt||wt!==Le)&&xm(d,ee,T,Le),Os=!1,wt=d.memoizedState,ee.state=wt,Tr(d,T,ee,z);var vn=d.memoizedState;Te!==Nt||wt!==vn||ei.current||Os?(typeof sn=="function"&&(Do(d,y,sn,T),vn=d.memoizedState),(je=Os||bu(d,y,je,T,wt,vn,Le)||!1)?(Et||typeof ee.UNSAFE_componentWillUpdate!="function"&&typeof ee.componentWillUpdate!="function"||(typeof ee.componentWillUpdate=="function"&&ee.componentWillUpdate(T,vn,Le),typeof ee.UNSAFE_componentWillUpdate=="function"&&ee.UNSAFE_componentWillUpdate(T,vn,Le)),typeof ee.componentDidUpdate=="function"&&(d.flags|=4),typeof ee.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof ee.componentDidUpdate!="function"||Te===l.memoizedProps&&wt===l.memoizedState||(d.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||Te===l.memoizedProps&&wt===l.memoizedState||(d.flags|=1024),d.memoizedProps=T,d.memoizedState=vn),ee.props=T,ee.state=vn,ee.context=Le,T=je):(typeof ee.componentDidUpdate!="function"||Te===l.memoizedProps&&wt===l.memoizedState||(d.flags|=4),typeof ee.getSnapshotBeforeUpdate!="function"||Te===l.memoizedProps&&wt===l.memoizedState||(d.flags|=1024),T=!1)}return Zf(l,d,y,T,H,z)}function Zf(l,d,y,T,z,H){Jf(l,d);var ee=(d.flags&128)!==0;if(!T&&!ee)return z&&gh(d,y,!1),Cr(l,d,H);T=d.stateNode,oo.current=d;var Te=ee&&typeof y.getDerivedStateFromError!="function"?null:T.render();return d.flags|=1,l!==null&&ee?(d.child=rc(d,l.child,null,H),d.child=rc(d,null,Te,H)):ns(l,d,Te,H),d.memoizedState=T.state,z&&gh(d,y,!0),d.child}function Kf(l){var d=l.stateNode;d.pendingContext?em(l,d.pendingContext,d.pendingContext!==d.context):d.context&&em(l,d.context,!1),ld(l,d.containerInfo)}function _f(l,d,y,T,z){return ua(),id(z),d.flags|=256,ns(l,d,y,T),d.child}var $f={dehydrated:null,treeContext:null,retryLane:0};function Mr(l){return{baseLanes:l,cachePool:null,transitions:null}}function ep(l,d,y){var T=d.pendingProps,z=yr.current,H=!1,ee=(d.flags&128)!==0,Te;if((Te=ee)||(Te=l!==null&&l.memoizedState===null?!1:(z&2)!==0),Te?(H=!0,d.flags&=-129):(l===null||l.memoizedState!==null)&&(z|=1),zi(yr,z&1),l===null)return td(d),l=d.memoizedState,l!==null&&(l=l.dehydrated,l!==null)?((d.mode&1)===0?d.lanes=1:l.data==="$!"?d.lanes=8:d.lanes=1073741824,null):(ee=T.children,l=T.fallback,H?(T=d.mode,H=d.child,ee={mode:"hidden",children:ee},(T&1)===0&&H!==null?(H.childLanes=0,H.pendingProps=ee):H=ca(ee,T,0,null),l=Xr(l,T,y,null),H.return=d,l.return=d,H.sibling=l,d.child=H,d.child.memoizedState=Mr(y),d.memoizedState=$f,l):fd(d,ee));if(z=l.memoizedState,z!==null&&(Te=z.dehydrated,Te!==null))return Tm(l,d,ee,T,Te,z,y);if(H){H=T.fallback,ee=d.mode,z=l.child,Te=z.sibling;var Le={mode:"hidden",children:T.children};return(ee&1)===0&&d.child!==z?(T=d.child,T.childLanes=0,T.pendingProps=Le,d.deletions=null):(T=er(z,Le),T.subtreeFlags=z.subtreeFlags&14680064),Te!==null?H=er(Te,H):(H=Xr(H,ee,y,null),H.flags|=2),H.return=d,T.return=d,T.sibling=H,d.child=T,T=H,H=d.child,ee=l.child.memoizedState,ee=ee===null?Mr(y):{baseLanes:ee.baseLanes|y,cachePool:null,transitions:ee.transitions},H.memoizedState=ee,H.childLanes=l.childLanes&~y,d.memoizedState=$f,T}return H=l.child,l=H.sibling,T=er(H,{mode:"visible",children:T.children}),(d.mode&1)===0&&(T.lanes=y),T.return=d,T.sibling=null,l!==null&&(y=d.deletions,y===null?(d.deletions=[l],d.flags|=16):y.push(l)),d.child=T,d.memoizedState=null,T}function fd(l,d){return d=ca({mode:"visible",children:d},l.mode,0,null),d.return=l,l.child=d}function pd(l,d,y,T){return T!==null&&id(T),rc(d,l.child,null,y),l=fd(d,d.pendingProps.children),l.flags|=2,d.memoizedState=null,l}function Tm(l,d,y,T,z,H,ee){if(y)return d.flags&256?(d.flags&=-257,T=qf(Error(t(422))),pd(l,d,ee,T)):d.memoizedState!==null?(d.child=l.child,d.flags|=128,null):(H=T.fallback,z=d.mode,T=ca({mode:"visible",children:T.children},z,0,null),H=Xr(H,z,ee,null),H.flags|=2,T.return=d,H.return=d,T.sibling=H,d.child=T,(d.mode&1)!==0&&rc(d,l.child,null,ee),d.child.memoizedState=Mr(ee),d.memoizedState=$f,H);if((d.mode&1)===0)return pd(l,d,ee,null);if(z.data==="$!"){if(T=z.nextSibling&&z.nextSibling.dataset,T)var Te=T.dgst;return T=Te,H=Error(t(419)),T=qf(H,T,void 0),pd(l,d,ee,T)}if(Te=(ee&l.childLanes)!==0,na||Te){if(T=kr,T!==null){switch(ee&-ee){case 4:z=2;break;case 16:z=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:z=32;break;case 536870912:z=268435456;break;default:z=0}z=(z&(T.suspendedLanes|ee))!==0?0:z,z!==0&&z!==H.retryLane&&(H.retryLane=z,ol(l,z),bs(T,l,z,-1))}return Fi(),T=qf(Error(t(421))),pd(l,d,ee,T)}return z.data==="$?"?(d.flags|=128,d.child=l.child,d=sp.bind(null,l),z._reactRetry=d,null):(l=H.treeContext,_r=tl(z.nextSibling),gs=d,ji=!0,ea=null,l!==null&&(wa[Ha++]=Fs,wa[Ha++]=Yn,wa[Ha++]=Sa,Fs=l.id,Yn=l.overflow,Sa=d),d=fd(d,T.children),d.flags|=4096,d)}function wu(l,d,y){l.lanes|=d;var T=l.alternate;T!==null&&(T.lanes|=d),im(l.return,d,y)}function md(l,d,y,T,z){var H=l.memoizedState;H===null?l.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:T,tail:y,tailMode:z}:(H.isBackwards=d,H.rendering=null,H.renderingStartTime=0,H.last=T,H.tail=y,H.tailMode=z)}function ql(l,d,y){var T=d.pendingProps,z=T.revealOrder,H=T.tail;if(ns(l,d,T.children,y),T=yr.current,(T&2)!==0)T=T&1|2,d.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=d.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&wu(l,y,d);else if(l.tag===19)wu(l,y,d);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===d)break e;for(;l.sibling===null;){if(l.return===null||l.return===d)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}T&=1}if(zi(yr,T),(d.mode&1)===0)d.memoizedState=null;else switch(z){case"forwards":for(y=d.child,z=null;y!==null;)l=y.alternate,l!==null&&ul(l)===null&&(z=y),y=y.sibling;y=z,y===null?(z=d.child,d.child=null):(z=y.sibling,y.sibling=null),md(d,!1,z,y,H);break;case"backwards":for(y=null,z=d.child,d.child=null;z!==null;){if(l=z.alternate,l!==null&&ul(l)===null){d.child=z;break}l=z.sibling,z.sibling=y,y=z,z=l}md(d,!0,y,null,H);break;case"together":md(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function hl(l,d){(d.mode&1)===0&&l!==null&&(l.alternate=null,d.alternate=null,d.flags|=2)}function Cr(l,d,y){if(l!==null&&(d.dependencies=l.dependencies),Ui|=d.lanes,(y&d.childLanes)===0)return null;if(l!==null&&d.child!==l.child)throw Error(t(153));if(d.child!==null){for(l=d.child,y=er(l,l.pendingProps),d.child=y,y.return=d;l.sibling!==null;)l=l.sibling,y=y.sibling=er(l,l.pendingProps),y.return=d;y.sibling=null}return d.child}function ly(l,d,y){switch(d.tag){case 3:Kf(d),ua();break;case 5:rm(d);break;case 1:$s(d.type)&&mh(d);break;case 4:ld(d,d.stateNode.containerInfo);break;case 10:var T=d.type._context,z=d.memoizedProps.value;zi(Ul,T._currentValue),T._currentValue=z;break;case 13:if(T=d.memoizedState,T!==null)return T.dehydrated!==null?(zi(yr,yr.current&1),d.flags|=128,null):(y&d.child.childLanes)!==0?ep(l,d,y):(zi(yr,yr.current&1),l=Cr(l,d,y),l!==null?l.sibling:null);zi(yr,yr.current&1);break;case 19:if(T=(y&d.childLanes)!==0,(l.flags&128)!==0){if(T)return ql(l,d,y);d.flags|=128}if(z=d.memoizedState,z!==null&&(z.rendering=null,z.tail=null,z.lastEffect=null),zi(yr,yr.current),T)break;return null;case 22:case 23:return d.lanes=0,Sm(l,d,y)}return Cr(l,d,y)}var tp,lc,gd,vd;tp=function(l,d){for(var y=d.child;y!==null;){if(y.tag===5||y.tag===6)l.appendChild(y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===d)break;for(;y.sibling===null;){if(y.return===null||y.return===d)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},lc=function(){},gd=function(l,d,y,T){var z=l.memoizedProps;if(z!==T){l=d.stateNode,yu(Io.current);var H=null;switch(y){case"input":z=dt(l,z),T=dt(l,T),H=[];break;case"select":z=Ce({},z,{value:void 0}),T=Ce({},T,{value:void 0}),H=[];break;case"textarea":z=yt(l,z),T=yt(l,T),H=[];break;default:typeof z.onClick!="function"&&typeof T.onClick=="function"&&(l.onclick=ps)}Mn(y,T);var ee;y=null;for(je in z)if(!T.hasOwnProperty(je)&&z.hasOwnProperty(je)&&z[je]!=null)if(je==="style"){var Te=z[je];for(ee in Te)Te.hasOwnProperty(ee)&&(y||(y={}),y[ee]="")}else je!=="dangerouslySetInnerHTML"&&je!=="children"&&je!=="suppressContentEditableWarning"&&je!=="suppressHydrationWarning"&&je!=="autoFocus"&&(r.hasOwnProperty(je)?H||(H=[]):(H=H||[]).push(je,null));for(je in T){var Le=T[je];if(Te=z?.[je],T.hasOwnProperty(je)&&Le!==Te&&(Le!=null||Te!=null))if(je==="style")if(Te){for(ee in Te)!Te.hasOwnProperty(ee)||Le&&Le.hasOwnProperty(ee)||(y||(y={}),y[ee]="");for(ee in Le)Le.hasOwnProperty(ee)&&Te[ee]!==Le[ee]&&(y||(y={}),y[ee]=Le[ee])}else y||(H||(H=[]),H.push(je,y)),y=Le;else je==="dangerouslySetInnerHTML"?(Le=Le?Le.__html:void 0,Te=Te?Te.__html:void 0,Le!=null&&Te!==Le&&(H=H||[]).push(je,Le)):je==="children"?typeof Le!="string"&&typeof Le!="number"||(H=H||[]).push(je,""+Le):je!=="suppressContentEditableWarning"&&je!=="suppressHydrationWarning"&&(r.hasOwnProperty(je)?(Le!=null&&je==="onScroll"&&Di("scroll",l),H||Te===Le||(H=[])):(H=H||[]).push(je,Le))}y&&(H=H||[]).push("style",y);var je=H;(d.updateQueue=je)&&(d.flags|=4)}},vd=function(l,d,y,T){y!==T&&(d.flags|=4)};function Su(l,d){if(!ji)switch(l.tailMode){case"hidden":d=l.tail;for(var y=null;d!==null;)d.alternate!==null&&(y=d),d=d.sibling;y===null?l.tail=null:y.sibling=null;break;case"collapsed":y=l.tail;for(var T=null;y!==null;)y.alternate!==null&&(T=y),y=y.sibling;T===null?d||l.tail===null?l.tail=null:l.tail.sibling=null:T.sibling=null}}function is(l){var d=l.alternate!==null&&l.alternate.child===l.child,y=0,T=0;if(d)for(var z=l.child;z!==null;)y|=z.lanes|z.childLanes,T|=z.subtreeFlags&14680064,T|=z.flags&14680064,z.return=l,z=z.sibling;else for(z=l.child;z!==null;)y|=z.lanes|z.childLanes,T|=z.subtreeFlags,T|=z.flags,z.return=l,z=z.sibling;return l.subtreeFlags|=T,l.childLanes=y,d}function Hg(l,d,y){var T=d.pendingProps;switch(Ef(d),d.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return is(d),null;case 1:return $s(d.type)&&ph(),is(d),null;case 3:return T=d.stateNode,Hl(),Zi(ei),Zi(zs),Pf(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(l===null||l.child===null)&&(mu(d)?d.flags|=4:l===null||l.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,ea!==null&&(Ed(ea),ea=null))),lc(l,d),is(d),null;case 5:wh(d);var z=yu(sc.current);if(y=d.type,l!==null&&d.stateNode!=null)gd(l,d,y,T,z),l.ref!==d.ref&&(d.flags|=512,d.flags|=2097152);else{if(!T){if(d.stateNode===null)throw Error(t(166));return is(d),null}if(l=yu(Io.current),mu(d)){T=d.stateNode,y=d.type;var H=d.memoizedProps;switch(T[Va]=d,T[Jc]=H,l=(d.mode&1)!==0,y){case"dialog":Di("cancel",T),Di("close",T);break;case"iframe":case"object":case"embed":Di("load",T);break;case"video":case"audio":for(z=0;z<Ks.length;z++)Di(Ks[z],T);break;case"source":Di("error",T);break;case"img":case"image":case"link":Di("error",T),Di("load",T);break;case"details":Di("toggle",T);break;case"input":it(T,H),Di("invalid",T);break;case"select":T._wrapperState={wasMultiple:!!H.multiple},Di("invalid",T);break;case"textarea":be(T,H),Di("invalid",T)}Mn(y,H),z=null;for(var ee in H)if(H.hasOwnProperty(ee)){var Te=H[ee];ee==="children"?typeof Te=="string"?T.textContent!==Te&&(H.suppressHydrationWarning!==!0&&Qc(T.textContent,Te,l),z=["children",Te]):typeof Te=="number"&&T.textContent!==""+Te&&(H.suppressHydrationWarning!==!0&&Qc(T.textContent,Te,l),z=["children",""+Te]):r.hasOwnProperty(ee)&&Te!=null&&ee==="onScroll"&&Di("scroll",T)}switch(y){case"input":hn(T),Gt(T,H,!0);break;case"textarea":hn(T),qn(T);break;case"select":case"option":break;default:typeof H.onClick=="function"&&(T.onclick=ps)}T=z,d.updateQueue=T,T!==null&&(d.flags|=4)}else{ee=z.nodeType===9?z:z.ownerDocument,l==="http://www.w3.org/1999/xhtml"&&(l=de(y)),l==="http://www.w3.org/1999/xhtml"?y==="script"?(l=ee.createElement("div"),l.innerHTML="<script><\/script>",l=l.removeChild(l.firstChild)):typeof T.is=="string"?l=ee.createElement(y,{is:T.is}):(l=ee.createElement(y),y==="select"&&(ee=l,T.multiple?ee.multiple=!0:T.size&&(ee.size=T.size))):l=ee.createElementNS(l,y),l[Va]=d,l[Jc]=T,tp(l,d,!1,!1),d.stateNode=l;e:{switch(ee=Dt(y,T),y){case"dialog":Di("cancel",l),Di("close",l),z=T;break;case"iframe":case"object":case"embed":Di("load",l),z=T;break;case"video":case"audio":for(z=0;z<Ks.length;z++)Di(Ks[z],l);z=T;break;case"source":Di("error",l),z=T;break;case"img":case"image":case"link":Di("error",l),Di("load",l),z=T;break;case"details":Di("toggle",l),z=T;break;case"input":it(l,T),z=dt(l,T),Di("invalid",l);break;case"option":z=T;break;case"select":l._wrapperState={wasMultiple:!!T.multiple},z=Ce({},T,{value:void 0}),Di("invalid",l);break;case"textarea":be(l,T),z=yt(l,T),Di("invalid",l);break;default:z=T}Mn(y,z),Te=z;for(H in Te)if(Te.hasOwnProperty(H)){var Le=Te[H];H==="style"?At(l,Le):H==="dangerouslySetInnerHTML"?(Le=Le?Le.__html:void 0,Le!=null&&Ye(l,Le)):H==="children"?typeof Le=="string"?(y!=="textarea"||Le!=="")&&at(l,Le):typeof Le=="number"&&at(l,""+Le):H!=="suppressContentEditableWarning"&&H!=="suppressHydrationWarning"&&H!=="autoFocus"&&(r.hasOwnProperty(H)?Le!=null&&H==="onScroll"&&Di("scroll",l):Le!=null&&W(l,H,Le,ee))}switch(y){case"input":hn(l),Gt(l,T,!1);break;case"textarea":hn(l),qn(l);break;case"option":T.value!=null&&l.setAttribute("value",""+tt(T.value));break;case"select":l.multiple=!!T.multiple,H=T.value,H!=null?yn(l,!!T.multiple,H,!1):T.defaultValue!=null&&yn(l,!!T.multiple,T.defaultValue,!0);break;default:typeof z.onClick=="function"&&(l.onclick=ps)}switch(y){case"button":case"input":case"select":case"textarea":T=!!T.autoFocus;break e;case"img":T=!0;break e;default:T=!1}}T&&(d.flags|=4)}d.ref!==null&&(d.flags|=512,d.flags|=2097152)}return is(d),null;case 6:if(l&&d.stateNode!=null)vd(l,d,l.memoizedProps,T);else{if(typeof T!="string"&&d.stateNode===null)throw Error(t(166));if(y=yu(sc.current),yu(Io.current),mu(d)){if(T=d.stateNode,y=d.memoizedProps,T[Va]=d,(H=T.nodeValue!==y)&&(l=gs,l!==null))switch(l.tag){case 3:Qc(T.nodeValue,y,(l.mode&1)!==0);break;case 5:l.memoizedProps.suppressHydrationWarning!==!0&&Qc(T.nodeValue,y,(l.mode&1)!==0)}H&&(d.flags|=4)}else T=(y.nodeType===9?y:y.ownerDocument).createTextNode(T),T[Va]=d,d.stateNode=T}return is(d),null;case 13:if(Zi(yr),T=d.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(ji&&_r!==null&&(d.mode&1)!==0&&(d.flags&128)===0)yh(),ua(),d.flags|=98560,H=!1;else if(H=mu(d),T!==null&&T.dehydrated!==null){if(l===null){if(!H)throw Error(t(318));if(H=d.memoizedState,H=H!==null?H.dehydrated:null,!H)throw Error(t(317));H[Va]=d}else ua(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;is(d),H=!1}else ea!==null&&(Ed(ea),ea=null),H=!0;if(!H)return d.flags&65536?d:null}return(d.flags&128)!==0?(d.lanes=y,d):(T=T!==null,T!==(l!==null&&l.memoizedState!==null)&&T&&(d.child.flags|=8192,(d.mode&1)!==0&&(l===null||(yr.current&1)!==0?ss===0&&(ss=3):Fi())),d.updateQueue!==null&&(d.flags|=4),is(d),null);case 4:return Hl(),lc(l,d),l===null&&el(d.stateNode.containerInfo),is(d),null;case 10:return Rf(d.type._context),is(d),null;case 17:return $s(d.type)&&ph(),is(d),null;case 19:if(Zi(yr),H=d.memoizedState,H===null)return is(d),null;if(T=(d.flags&128)!==0,ee=H.rendering,ee===null)if(T)Su(H,!1);else{if(ss!==0||l!==null&&(l.flags&128)!==0)for(l=d.child;l!==null;){if(ee=ul(l),ee!==null){for(d.flags|=128,Su(H,!1),T=ee.updateQueue,T!==null&&(d.updateQueue=T,d.flags|=4),d.subtreeFlags=0,T=y,y=d.child;y!==null;)H=y,l=T,H.flags&=14680066,ee=H.alternate,ee===null?(H.childLanes=0,H.lanes=l,H.child=null,H.subtreeFlags=0,H.memoizedProps=null,H.memoizedState=null,H.updateQueue=null,H.dependencies=null,H.stateNode=null):(H.childLanes=ee.childLanes,H.lanes=ee.lanes,H.child=ee.child,H.subtreeFlags=0,H.deletions=null,H.memoizedProps=ee.memoizedProps,H.memoizedState=ee.memoizedState,H.updateQueue=ee.updateQueue,H.type=ee.type,l=ee.dependencies,H.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),y=y.sibling;return zi(yr,yr.current&1|2),d.child}l=l.sibling}H.tail!==null&&Qi()>ja&&(d.flags|=128,T=!0,Su(H,!1),d.lanes=4194304)}else{if(!T)if(l=ul(ee),l!==null){if(d.flags|=128,T=!0,y=l.updateQueue,y!==null&&(d.updateQueue=y,d.flags|=4),Su(H,!0),H.tail===null&&H.tailMode==="hidden"&&!ee.alternate&&!ji)return is(d),null}else 2*Qi()-H.renderingStartTime>ja&&y!==1073741824&&(d.flags|=128,T=!0,Su(H,!1),d.lanes=4194304);H.isBackwards?(ee.sibling=d.child,d.child=ee):(y=H.last,y!==null?y.sibling=ee:d.child=ee,H.last=ee)}return H.tail!==null?(d=H.tail,H.rendering=d,H.tail=d.sibling,H.renderingStartTime=Qi(),d.sibling=null,y=yr.current,zi(yr,T?y&1|2:y&1),d):(is(d),null);case 22:case 23:return ka(),T=d.memoizedState!==null,l!==null&&l.memoizedState!==null!==T&&(d.flags|=8192),T&&(d.mode&1)!==0?(Rr&1073741824)!==0&&(is(d),d.subtreeFlags&6&&(d.flags|=8192)):is(d),null;case 24:return null;case 25:return null}throw Error(t(156,d.tag))}function Wg(l,d){switch(Ef(d),d.tag){case 1:return $s(d.type)&&ph(),l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 3:return Hl(),Zi(ei),Zi(zs),Pf(),l=d.flags,(l&65536)!==0&&(l&128)===0?(d.flags=l&-65537|128,d):null;case 5:return wh(d),null;case 13:if(Zi(yr),l=d.memoizedState,l!==null&&l.dehydrated!==null){if(d.alternate===null)throw Error(t(340));ua()}return l=d.flags,l&65536?(d.flags=l&-65537|128,d):null;case 19:return Zi(yr),null;case 4:return Hl(),null;case 10:return Rf(d.type._context),null;case 22:case 23:return ka(),null;case 24:return null;default:return null}}var Us=!1,vs=!1,qg=typeof WeakSet=="function"?WeakSet:Set,gn=null;function uc(l,d){var y=l.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(T){mr(l,d,T)}else y.current=null}function np(l,d,y){try{y()}catch(T){mr(l,d,T)}}var Mm=!1;function yd(l,d){if(uh=Eo,l=Hc(),rh(l)){if("selectionStart"in l)var y={start:l.selectionStart,end:l.selectionEnd};else e:{y=(y=l.ownerDocument)&&y.defaultView||window;var T=y.getSelection&&y.getSelection();if(T&&T.rangeCount!==0){y=T.anchorNode;var z=T.anchorOffset,H=T.focusNode;T=T.focusOffset;try{y.nodeType,H.nodeType}catch{y=null;break e}var ee=0,Te=-1,Le=-1,je=0,Et=0,Nt=l,wt=null;t:for(;;){for(var sn;Nt!==y||z!==0&&Nt.nodeType!==3||(Te=ee+z),Nt!==H||T!==0&&Nt.nodeType!==3||(Le=ee+T),Nt.nodeType===3&&(ee+=Nt.nodeValue.length),(sn=Nt.firstChild)!==null;)wt=Nt,Nt=sn;for(;;){if(Nt===l)break t;if(wt===y&&++je===z&&(Te=ee),wt===H&&++Et===T&&(Le=ee),(sn=Nt.nextSibling)!==null)break;Nt=wt,wt=Nt.parentNode}Nt=sn}y=Te===-1||Le===-1?null:{start:Te,end:Le}}else y=null}y=y||{start:0,end:0}}else y=null;for(ch={focusedElem:l,selectionRange:y},Eo=!1,gn=d;gn!==null;)if(d=gn,l=d.child,(d.subtreeFlags&1028)!==0&&l!==null)l.return=d,gn=l;else for(;gn!==null;){d=gn;try{var vn=d.alternate;if((d.flags&1024)!==0)switch(d.tag){case 0:case 11:case 15:break;case 1:if(vn!==null){var Tn=vn.memoizedProps,Oi=vn.memoizedState,Ze=d.stateNode,a=Ze.getSnapshotBeforeUpdate(d.elementType===d.type?Tn:Wr(d.type,Tn),Oi);Ze.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var u=d.stateNode.containerInfo;u.nodeType===1?u.textContent="":u.nodeType===9&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(g){mr(d,d.return,g)}if(l=d.sibling,l!==null){l.return=d.return,gn=l;break}gn=d.return}return vn=Mm,Mm=!1,vn}function ys(l,d,y){var T=d.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var z=T=T.next;do{if((z.tag&l)===l){var H=z.destroy;z.destroy=void 0,H!==void 0&&np(d,y,H)}z=z.next}while(z!==T)}}function ia(l,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var y=d=d.next;do{if((y.tag&l)===l){var T=y.create;y.destroy=T()}y=y.next}while(y!==d)}}function Ch(l){var d=l.ref;if(d!==null){var y=l.stateNode;switch(l.tag){case 5:l=y;break;default:l=y}typeof d=="function"?d(l):d.current=l}}function Cm(l){var d=l.alternate;d!==null&&(l.alternate=null,Cm(d)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(d=l.stateNode,d!==null&&(delete d[Va],delete d[Jc],delete d[bf],delete d[wf],delete d[Sf])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function kh(l){return l.tag===5||l.tag===3||l.tag===4}function ip(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||kh(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ad(l,d,y){var T=l.tag;if(T===5||T===6)l=l.stateNode,d?y.nodeType===8?y.parentNode.insertBefore(l,d):y.insertBefore(l,d):(y.nodeType===8?(d=y.parentNode,d.insertBefore(l,y)):(d=y,d.appendChild(l)),y=y._reactRootContainer,y!=null||d.onclick!==null||(d.onclick=ps));else if(T!==4&&(l=l.child,l!==null))for(Ad(l,d,y),l=l.sibling;l!==null;)Ad(l,d,y),l=l.sibling}function Rh(l,d,y){var T=l.tag;if(T===5||T===6)l=l.stateNode,d?y.insertBefore(l,d):y.appendChild(l);else if(T!==4&&(l=l.child,l!==null))for(Rh(l,d,y),l=l.sibling;l!==null;)Rh(l,d,y),l=l.sibling}var Ar=null,Vs=!1;function lo(l,d,y){for(y=y.child;y!==null;)xd(l,d,y),y=y.sibling}function xd(l,d,y){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(Ke,y)}catch{}switch(y.tag){case 5:vs||uc(y,d);case 6:var T=Ar,z=Vs;Ar=null,lo(l,d,y),Ar=T,Vs=z,Ar!==null&&(Vs?(l=Ar,y=y.stateNode,l.nodeType===8?l.parentNode.removeChild(y):l.removeChild(y)):Ar.removeChild(y.stateNode));break;case 18:Ar!==null&&(Vs?(l=Ar,y=y.stateNode,l.nodeType===8?hh(l.parentNode,y):l.nodeType===1&&hh(l,y),Fa(l)):hh(Ar,y.stateNode));break;case 4:T=Ar,z=Vs,Ar=y.stateNode.containerInfo,Vs=!0,lo(l,d,y),Ar=T,Vs=z;break;case 0:case 11:case 14:case 15:if(!vs&&(T=y.updateQueue,T!==null&&(T=T.lastEffect,T!==null))){z=T=T.next;do{var H=z,ee=H.destroy;H=H.tag,ee!==void 0&&((H&2)!==0||(H&4)!==0)&&np(y,d,ee),z=z.next}while(z!==T)}lo(l,d,y);break;case 1:if(!vs&&(uc(y,d),T=y.stateNode,typeof T.componentWillUnmount=="function"))try{T.props=y.memoizedProps,T.state=y.memoizedState,T.componentWillUnmount()}catch(Te){mr(y,d,Te)}lo(l,d,y);break;case 21:lo(l,d,y);break;case 22:y.mode&1?(vs=(T=vs)||y.memoizedState!==null,lo(l,d,y),vs=T):lo(l,d,y);break;default:lo(l,d,y)}}function Gs(l){var d=l.updateQueue;if(d!==null){l.updateQueue=null;var y=l.stateNode;y===null&&(y=l.stateNode=new qg),d.forEach(function(T){var z=ap.bind(null,l,T);y.has(T)||(y.add(T),T.then(z,z))})}}function dr(l,d){var y=d.deletions;if(y!==null)for(var T=0;T<y.length;T++){var z=y[T];try{var H=l,ee=d,Te=ee;e:for(;Te!==null;){switch(Te.tag){case 5:Ar=Te.stateNode,Vs=!1;break e;case 3:Ar=Te.stateNode.containerInfo,Vs=!0;break e;case 4:Ar=Te.stateNode.containerInfo,Vs=!0;break e}Te=Te.return}if(Ar===null)throw Error(t(160));xd(H,ee,z),Ar=null,Vs=!1;var Le=z.alternate;Le!==null&&(Le.return=null),z.return=null}catch(je){mr(z,d,je)}}if(d.subtreeFlags&12854)for(d=d.child;d!==null;)Lo(d,l),d=d.sibling}function Lo(l,d){var y=l.alternate,T=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:if(dr(d,l),Nr(l),T&4){try{ys(3,l,l.return),ia(3,l)}catch(Tn){mr(l,l.return,Tn)}try{ys(5,l,l.return)}catch(Tn){mr(l,l.return,Tn)}}break;case 1:dr(d,l),Nr(l),T&512&&y!==null&&uc(y,y.return);break;case 5:if(dr(d,l),Nr(l),T&512&&y!==null&&uc(y,y.return),l.flags&32){var z=l.stateNode;try{at(z,"")}catch(Tn){mr(l,l.return,Tn)}}if(T&4&&(z=l.stateNode,z!=null)){var H=l.memoizedProps,ee=y!==null?y.memoizedProps:H,Te=l.type,Le=l.updateQueue;if(l.updateQueue=null,Le!==null)try{Te==="input"&&H.type==="radio"&&H.name!=null&&ht(z,H),Dt(Te,ee);var je=Dt(Te,H);for(ee=0;ee<Le.length;ee+=2){var Et=Le[ee],Nt=Le[ee+1];Et==="style"?At(z,Nt):Et==="dangerouslySetInnerHTML"?Ye(z,Nt):Et==="children"?at(z,Nt):W(z,Et,Nt,je)}switch(Te){case"input":Pt(z,H);break;case"textarea":Kn(z,H);break;case"select":var wt=z._wrapperState.wasMultiple;z._wrapperState.wasMultiple=!!H.multiple;var sn=H.value;sn!=null?yn(z,!!H.multiple,sn,!1):wt!==!!H.multiple&&(H.defaultValue!=null?yn(z,!!H.multiple,H.defaultValue,!0):yn(z,!!H.multiple,H.multiple?[]:"",!1))}z[Jc]=H}catch(Tn){mr(l,l.return,Tn)}}break;case 6:if(dr(d,l),Nr(l),T&4){if(l.stateNode===null)throw Error(t(162));z=l.stateNode,H=l.memoizedProps;try{z.nodeValue=H}catch(Tn){mr(l,l.return,Tn)}}break;case 3:if(dr(d,l),Nr(l),T&4&&y!==null&&y.memoizedState.isDehydrated)try{Fa(d.containerInfo)}catch(Tn){mr(l,l.return,Tn)}break;case 4:dr(d,l),Nr(l);break;case 13:dr(d,l),Nr(l),z=l.child,z.flags&8192&&(H=z.memoizedState!==null,z.stateNode.isHidden=H,!H||z.alternate!==null&&z.alternate.memoizedState!==null||(wd=Qi())),T&4&&Gs(l);break;case 22:if(Et=y!==null&&y.memoizedState!==null,l.mode&1?(vs=(je=vs)||Et,dr(d,l),vs=je):dr(d,l),Nr(l),T&8192){if(je=l.memoizedState!==null,(l.stateNode.isHidden=je)&&!Et&&(l.mode&1)!==0)for(gn=l,Et=l.child;Et!==null;){for(Nt=gn=Et;gn!==null;){switch(wt=gn,sn=wt.child,wt.tag){case 0:case 11:case 14:case 15:ys(4,wt,wt.return);break;case 1:uc(wt,wt.return);var vn=wt.stateNode;if(typeof vn.componentWillUnmount=="function"){T=wt,y=wt.return;try{d=T,vn.props=d.memoizedProps,vn.state=d.memoizedState,vn.componentWillUnmount()}catch(Tn){mr(T,y,Tn)}}break;case 5:uc(wt,wt.return);break;case 22:if(wt.memoizedState!==null){No(Nt);continue}}sn!==null?(sn.return=wt,gn=sn):No(Nt)}Et=Et.sibling}e:for(Et=null,Nt=l;;){if(Nt.tag===5){if(Et===null){Et=Nt;try{z=Nt.stateNode,je?(H=z.style,typeof H.setProperty=="function"?H.setProperty("display","none","important"):H.display="none"):(Te=Nt.stateNode,Le=Nt.memoizedProps.style,ee=Le!=null&&Le.hasOwnProperty("display")?Le.display:null,Te.style.display=lt("display",ee))}catch(Tn){mr(l,l.return,Tn)}}}else if(Nt.tag===6){if(Et===null)try{Nt.stateNode.nodeValue=je?"":Nt.memoizedProps}catch(Tn){mr(l,l.return,Tn)}}else if((Nt.tag!==22&&Nt.tag!==23||Nt.memoizedState===null||Nt===l)&&Nt.child!==null){Nt.child.return=Nt,Nt=Nt.child;continue}if(Nt===l)break e;for(;Nt.sibling===null;){if(Nt.return===null||Nt.return===l)break e;Et===Nt&&(Et=null),Nt=Nt.return}Et===Nt&&(Et=null),Nt.sibling.return=Nt.return,Nt=Nt.sibling}}break;case 19:dr(d,l),Nr(l),T&4&&Gs(l);break;case 21:break;default:dr(d,l),Nr(l)}}function Nr(l){var d=l.flags;if(d&2){try{e:{for(var y=l.return;y!==null;){if(kh(y)){var T=y;break e}y=y.return}throw Error(t(160))}switch(T.tag){case 5:var z=T.stateNode;T.flags&32&&(at(z,""),T.flags&=-33);var H=ip(l);Rh(l,H,z);break;case 3:case 4:var ee=T.stateNode.containerInfo,Te=ip(l);Ad(l,Te,ee);break;default:throw Error(t(161))}}catch(Le){mr(l,l.return,Le)}l.flags&=-3}d&4096&&(l.flags&=-4097)}function uo(l,d,y){gn=l,rs(l)}function rs(l,d,y){for(var T=(l.mode&1)!==0;gn!==null;){var z=gn,H=z.child;if(z.tag===22&&T){var ee=z.memoizedState!==null||Us;if(!ee){var Te=z.alternate,Le=Te!==null&&Te.memoizedState!==null||vs;Te=Us;var je=vs;if(Us=ee,(vs=Le)&&!je)for(gn=z;gn!==null;)ee=gn,Le=ee.child,ee.tag===22&&ee.memoizedState!==null?dc(z):Le!==null?(Le.return=ee,gn=Le):dc(z);for(;H!==null;)gn=H,rs(H),H=H.sibling;gn=z,Us=Te,vs=je}cc(l)}else(z.subtreeFlags&8772)!==0&&H!==null?(H.return=z,gn=H):cc(l)}}function cc(l){for(;gn!==null;){var d=gn;if((d.flags&8772)!==0){var y=d.alternate;try{if((d.flags&8772)!==0)switch(d.tag){case 0:case 11:case 15:vs||ia(5,d);break;case 1:var T=d.stateNode;if(d.flags&4&&!vs)if(y===null)T.componentDidMount();else{var z=d.elementType===d.type?y.memoizedProps:Wr(d.type,y.memoizedProps);T.componentDidUpdate(z,y.memoizedState,T.__reactInternalSnapshotBeforeUpdate)}var H=d.updateQueue;H!==null&&ll(d,H,T);break;case 3:var ee=d.updateQueue;if(ee!==null){if(y=null,d.child!==null)switch(d.child.tag){case 5:y=d.child.stateNode;break;case 1:y=d.child.stateNode}ll(d,ee,y)}break;case 5:var Te=d.stateNode;if(y===null&&d.flags&4){y=Te;var Le=d.memoizedProps;switch(d.type){case"button":case"input":case"select":case"textarea":Le.autoFocus&&y.focus();break;case"img":Le.src&&(y.src=Le.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(d.memoizedState===null){var je=d.alternate;if(je!==null){var Et=je.memoizedState;if(Et!==null){var Nt=Et.dehydrated;Nt!==null&&Fa(Nt)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}vs||d.flags&512&&Ch(d)}catch(wt){mr(d,d.return,wt)}}if(d===l){gn=null;break}if(y=d.sibling,y!==null){y.return=d.return,gn=y;break}gn=d.return}}function No(l){for(;gn!==null;){var d=gn;if(d===l){gn=null;break}var y=d.sibling;if(y!==null){y.return=d.return,gn=y;break}gn=d.return}}function dc(l){for(;gn!==null;){var d=gn;try{switch(d.tag){case 0:case 11:case 15:var y=d.return;try{ia(4,d)}catch(Le){mr(d,y,Le)}break;case 1:var T=d.stateNode;if(typeof T.componentDidMount=="function"){var z=d.return;try{T.componentDidMount()}catch(Le){mr(d,z,Le)}}var H=d.return;try{Ch(d)}catch(Le){mr(d,H,Le)}break;case 5:var ee=d.return;try{Ch(d)}catch(Le){mr(d,ee,Le)}}}catch(Le){mr(d,d.return,Le)}if(d===l){gn=null;break}var Te=d.sibling;if(Te!==null){Te.return=d.return,gn=Te;break}gn=d.return}}var As=Math.ceil,Ki=B.ReactCurrentDispatcher,vi=B.ReactCurrentOwner,qr=B.ReactCurrentBatchConfig,ri=0,kr=null,hr=null,fr=0,Rr=0,hc=Ro(0),ss=0,bd=null,Ui=0,Eu=0,jl=0,fc=null,xs=null,wd=0,ja=1/0,Xa=null,pc=!1,Xl=null,Ta=null,Sd=!1,Ma=null,fl=0,Tu=0,mc=null,Yl=-1,zo=0;function zr(){return(ri&6)!==0?Qi():Yl!==-1?Yl:Yl=Qi()}function Ya(l){return(l.mode&1)===0?1:(ri&2)!==0&&fr!==0?fr&-fr:Tf.transition!==null?(zo===0&&(zo=Kt()),zo):(l=Qn,l!==0||(l=window.event,l=l===void 0?16:se(l.type)),l)}function bs(l,d,y,T){if(50<Tu)throw Tu=0,mc=null,Error(t(185));Gn(l,y,T),((ri&2)===0||l!==kr)&&(l===kr&&((ri&2)===0&&(Eu|=y),ss===4&&Fo(l,fr)),ra(l,T),y===1&&ri===0&&(d.mode&1)===0&&(ja=Qi()+500,Kc&&sl()))}function ra(l,d){var y=l.callbackNode;oi(l,d);var T=ii(l,l===kr?fr:0);if(T===0)y!==null&&Fr(y),l.callbackNode=null,l.callbackPriority=0;else if(d=T&-T,l.callbackPriority!==d){if(y!=null&&Fr(y),d===1)l.tag===0?nm(Mu.bind(null,l)):Fl(Mu.bind(null,l)),tc(function(){(ri&6)===0&&sl()}),y=null;else{switch(mn(T)){case 1:y=rr;break;case 4:y=re;break;case 16:y=Ve;break;case 536870912:y=qe;break;default:y=Ve}y=Ih(y,Ca.bind(null,l))}l.callbackPriority=d,l.callbackNode=y}}function Ca(l,d){if(Yl=-1,zo=0,(ri&6)!==0)throw Error(t(327));var y=l.callbackNode;if(vc()&&l.callbackNode!==y)return null;var T=ii(l,l===kr?fr:0);if(T===0)return null;if((T&30)!==0||(T&l.expiredLanes)!==0||d)d=pr(l,T);else{d=T;var z=ri;ri|=2;var H=ui();(kr!==l||fr!==d)&&(Xa=null,ja=Qi()+500,Yi(l,d));do try{Td();break}catch(Te){Oo(l,Te)}while(!0);kf(),Ki.current=H,ri=z,hr!==null?d=0:(kr=null,fr=0,d=ss)}if(d!==0){if(d===2&&(z=qi(l),z!==0&&(T=z,d=Ql(l,z))),d===1)throw y=bd,Yi(l,0),Fo(l,T),ra(l,Qi()),y;if(d===6)Fo(l,T);else{if(z=l.current.alternate,(T&30)===0&&!pl(z)&&(d=pr(l,T),d===2&&(H=qi(l),H!==0&&(T=H,d=Ql(l,H))),d===1))throw y=bd,Yi(l,0),Fo(l,T),ra(l,Qi()),y;switch(l.finishedWork=z,l.finishedLanes=T,d){case 0:case 1:throw Error(t(345));case 2:co(l,xs,Xa);break;case 3:if(Fo(l,T),(T&130023424)===T&&(d=wd+500-Qi(),10<d)){if(ii(l,0)!==0)break;if(z=l.suspendedLanes,(z&T)!==T){zr(),l.pingedLanes|=l.suspendedLanes&z;break}l.timeoutHandle=Co(co.bind(null,l,xs,Xa),d);break}co(l,xs,Xa);break;case 4:if(Fo(l,T),(T&4194240)===T)break;for(d=l.eventTimes,z=-1;0<T;){var ee=31-Ut(T);H=1<<ee,ee=d[ee],ee>z&&(z=ee),T&=~H}if(T=z,T=Qi()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*As(T/1960))-T,10<T){l.timeoutHandle=Co(co.bind(null,l,xs,Xa),T);break}co(l,xs,Xa);break;case 5:co(l,xs,Xa);break;default:throw Error(t(329))}}}return ra(l,Qi()),l.callbackNode===y?Ca.bind(null,l):null}function Ql(l,d){var y=fc;return l.current.memoizedState.isDehydrated&&(Yi(l,d).flags|=256),l=pr(l,d),l!==2&&(d=xs,xs=y,d!==null&&Ed(d)),l}function Ed(l){xs===null?xs=l:xs.push.apply(xs,l)}function pl(l){for(var d=l;;){if(d.flags&16384){var y=d.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var T=0;T<y.length;T++){var z=y[T],H=z.getSnapshot;z=z.value;try{if(!Ua(H(),z))return!1}catch{return!1}}}if(y=d.child,d.subtreeFlags&16384&&y!==null)y.return=d,d=y;else{if(d===l)break;for(;d.sibling===null;){if(d.return===null||d.return===l)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Fo(l,d){for(d&=~jl,d&=~Eu,l.suspendedLanes|=d,l.pingedLanes&=~d,l=l.expirationTimes;0<d;){var y=31-Ut(d),T=1<<y;l[y]=-1,d&=~T}}function Mu(l){if((ri&6)!==0)throw Error(t(327));vc();var d=ii(l,0);if((d&1)===0)return ra(l,Qi()),null;var y=pr(l,d);if(l.tag!==0&&y===2){var T=qi(l);T!==0&&(d=T,y=Ql(l,T))}if(y===1)throw y=bd,Yi(l,0),Fo(l,d),ra(l,Qi()),y;if(y===6)throw Error(t(345));return l.finishedWork=l.current.alternate,l.finishedLanes=d,co(l,xs,Xa),ra(l,Qi()),null}function gc(l,d){var y=ri;ri|=1;try{return l(d)}finally{ri=y,ri===0&&(ja=Qi()+500,Kc&&sl())}}function jr(l){Ma!==null&&Ma.tag===0&&(ri&6)===0&&vc();var d=ri;ri|=1;var y=qr.transition,T=Qn;try{if(qr.transition=null,Qn=1,l)return l()}finally{Qn=T,qr.transition=y,ri=d,(ri&6)===0&&sl()}}function ka(){Rr=hc.current,Zi(hc)}function Yi(l,d){l.finishedWork=null,l.finishedLanes=0;var y=l.timeoutHandle;if(y!==-1&&(l.timeoutHandle=-1,_p(y)),hr!==null)for(y=hr.return;y!==null;){var T=y;switch(Ef(T),T.tag){case 1:T=T.type.childContextTypes,T!=null&&ph();break;case 3:Hl(),Zi(ei),Zi(zs),Pf();break;case 5:wh(T);break;case 4:Hl();break;case 13:Zi(yr);break;case 19:Zi(yr);break;case 10:Rf(T.type._context);break;case 22:case 23:ka()}y=y.return}if(kr=l,hr=l=er(l.current,null),fr=Rr=d,ss=0,bd=null,jl=Eu=Ui=0,xs=fc=null,al!==null){for(d=0;d<al.length;d++)if(y=al[d],T=y.interleaved,T!==null){y.interleaved=null;var z=T.next,H=y.pending;if(H!==null){var ee=H.next;H.next=z,T.next=ee}y.pending=T}al=null}return l}function Oo(l,d){do{var y=hr;try{if(kf(),If.current=Th,Au){for(var T=cr.memoizedState;T!==null;){var z=T.queue;z!==null&&(z.pending=null),T=T.next}Au=!1}if(so=0,ts=Hr=cr=null,xu=!1,Wl=0,vi.current=null,y===null||y.return===null){ss=1,bd=d,hr=null;break}e:{var H=l,ee=y.return,Te=y,Le=d;if(d=fr,Te.flags|=32768,Le!==null&&typeof Le=="object"&&typeof Le.then=="function"){var je=Le,Et=Te,Nt=Et.tag;if((Et.mode&1)===0&&(Nt===0||Nt===11||Nt===15)){var wt=Et.alternate;wt?(Et.updateQueue=wt.updateQueue,Et.memoizedState=wt.memoizedState,Et.lanes=wt.lanes):(Et.updateQueue=null,Et.memoizedState=null)}var sn=Gg(ee);if(sn!==null){sn.flags&=-257,ta(sn,ee,Te,H,d),sn.mode&1&&Xf(H,je,d),d=sn,Le=je;var vn=d.updateQueue;if(vn===null){var Tn=new Set;Tn.add(Le),d.updateQueue=Tn}else vn.add(Le);break e}else{if((d&1)===0){Xf(H,je,d),Fi();break e}Le=Error(t(426))}}else if(ji&&Te.mode&1){var Oi=Gg(ee);if(Oi!==null){(Oi.flags&65536)===0&&(Oi.flags|=256),ta(Oi,ee,Te,H,d),id(ac(Le,Te));break e}}H=Le=ac(Le,Te),ss!==4&&(ss=2),fc===null?fc=[H]:fc.push(H),H=ee;do{switch(H.tag){case 3:H.flags|=65536,d&=-d,H.lanes|=d;var Ze=bm(H,Le,d);Dg(H,Ze);break e;case 1:Te=Le;var a=H.type,u=H.stateNode;if((H.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Ta===null||!Ta.has(u)))){H.flags|=65536,d&=-d,H.lanes|=d;var g=wm(H,Te,d);Dg(H,g);break e}}H=H.return}while(H!==null)}Zl(y)}catch(w){d=w,hr===y&&y!==null&&(hr=y=y.return);continue}break}while(!0)}function ui(){var l=Ki.current;return Ki.current=Th,l===null?Th:l}function Fi(){(ss===0||ss===3||ss===2)&&(ss=4),kr===null||(Ui&268435455)===0&&(Eu&268435455)===0||Fo(kr,fr)}function pr(l,d){var y=ri;ri|=2;var T=ui();(kr!==l||fr!==d)&&(Xa=null,Yi(l,d));do try{Ph();break}catch(z){Oo(l,z)}while(!0);if(kf(),ri=y,Ki.current=T,hr!==null)throw Error(t(261));return kr=null,fr=0,ss}function Ph(){for(;hr!==null;)Jl(hr)}function Td(){for(;hr!==null&&!kl();)Jl(hr)}function Jl(l){var d=Pr(l.alternate,l,Rr);l.memoizedProps=l.pendingProps,d===null?Zl(l):hr=d,vi.current=null}function Zl(l){var d=l;do{var y=d.alternate;if(l=d.return,(d.flags&32768)===0){if(y=Hg(y,d,Rr),y!==null){hr=y;return}}else{if(y=Wg(y,d),y!==null){y.flags&=32767,hr=y;return}if(l!==null)l.flags|=32768,l.subtreeFlags=0,l.deletions=null;else{ss=6,hr=null;return}}if(d=d.sibling,d!==null){hr=d;return}hr=d=l}while(d!==null);ss===0&&(ss=5)}function co(l,d,y){var T=Qn,z=qr.transition;try{qr.transition=null,Qn=1,Cu(l,d,y,T)}finally{qr.transition=z,Qn=T}return null}function Cu(l,d,y,T){do vc();while(Ma!==null);if((ri&6)!==0)throw Error(t(327));y=l.finishedWork;var z=l.finishedLanes;if(y===null)return null;if(l.finishedWork=null,l.finishedLanes=0,y===l.current)throw Error(t(177));l.callbackNode=null,l.callbackPriority=0;var H=y.lanes|y.childLanes;if(br(l,H),l===kr&&(hr=kr=null,fr=0),(y.subtreeFlags&2064)===0&&(y.flags&2064)===0||Sd||(Sd=!0,Ih(Ve,function(){return vc(),null})),H=(y.flags&15990)!==0,(y.subtreeFlags&15990)!==0||H){H=qr.transition,qr.transition=null;var ee=Qn;Qn=1;var Te=ri;ri|=4,vi.current=null,yd(l,y),Lo(y,l),cf(ch),Eo=!!uh,ch=uh=null,l.current=y,uo(y),uu(),ri=Te,Qn=ee,qr.transition=H}else l.current=y;if(Sd&&(Sd=!1,Ma=l,fl=z),H=l.pendingLanes,H===0&&(Ta=null),vt(y.stateNode),ra(l,Qi()),d!==null)for(T=l.onRecoverableError,y=0;y<d.length;y++)z=d[y],T(z.value,{componentStack:z.stack,digest:z.digest});if(pc)throw pc=!1,l=Xl,Xl=null,l;return(fl&1)!==0&&l.tag!==0&&vc(),H=l.pendingLanes,(H&1)!==0?l===mc?Tu++:(Tu=0,mc=l):Tu=0,sl(),null}function vc(){if(Ma!==null){var l=mn(fl),d=qr.transition,y=Qn;try{if(qr.transition=null,Qn=16>l?16:l,Ma===null)var T=!1;else{if(l=Ma,Ma=null,fl=0,(ri&6)!==0)throw Error(t(331));var z=ri;for(ri|=4,gn=l.current;gn!==null;){var H=gn,ee=H.child;if((gn.flags&16)!==0){var Te=H.deletions;if(Te!==null){for(var Le=0;Le<Te.length;Le++){var je=Te[Le];for(gn=je;gn!==null;){var Et=gn;switch(Et.tag){case 0:case 11:case 15:ys(8,Et,H)}var Nt=Et.child;if(Nt!==null)Nt.return=Et,gn=Nt;else for(;gn!==null;){Et=gn;var wt=Et.sibling,sn=Et.return;if(Cm(Et),Et===je){gn=null;break}if(wt!==null){wt.return=sn,gn=wt;break}gn=sn}}}var vn=H.alternate;if(vn!==null){var Tn=vn.child;if(Tn!==null){vn.child=null;do{var Oi=Tn.sibling;Tn.sibling=null,Tn=Oi}while(Tn!==null)}}gn=H}}if((H.subtreeFlags&2064)!==0&&ee!==null)ee.return=H,gn=ee;else e:for(;gn!==null;){if(H=gn,(H.flags&2048)!==0)switch(H.tag){case 0:case 11:case 15:ys(9,H,H.return)}var Ze=H.sibling;if(Ze!==null){Ze.return=H.return,gn=Ze;break e}gn=H.return}}var a=l.current;for(gn=a;gn!==null;){ee=gn;var u=ee.child;if((ee.subtreeFlags&2064)!==0&&u!==null)u.return=ee,gn=u;else e:for(ee=a;gn!==null;){if(Te=gn,(Te.flags&2048)!==0)try{switch(Te.tag){case 0:case 11:case 15:ia(9,Te)}}catch(w){mr(Te,Te.return,w)}if(Te===ee){gn=null;break e}var g=Te.sibling;if(g!==null){g.return=Te.return,gn=g;break e}gn=Te.return}}if(ri=z,sl(),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(Ke,l)}catch{}T=!0}return T}finally{Qn=y,qr.transition=d}}return!1}function yc(l,d,y){d=ac(y,d),d=bm(l,d,1),l=ur(l,d,1),d=zr(),l!==null&&(Gn(l,1,d),ra(l,d))}function mr(l,d,y){if(l.tag===3)yc(l,l,y);else for(;d!==null;){if(d.tag===3){yc(d,l,y);break}else if(d.tag===1){var T=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof T.componentDidCatch=="function"&&(Ta===null||!Ta.has(T))){l=ac(y,l),l=wm(d,l,1),d=ur(d,l,1),l=zr(),d!==null&&(Gn(d,1,l),ra(d,l));break}}d=d.return}}function rp(l,d,y){var T=l.pingCache;T!==null&&T.delete(d),d=zr(),l.pingedLanes|=l.suspendedLanes&y,kr===l&&(fr&y)===y&&(ss===4||ss===3&&(fr&130023424)===fr&&500>Qi()-wd?Yi(l,0):jl|=y),ra(l,d)}function km(l,d){d===0&&((l.mode&1)===0?d=1:(d=ln,ln<<=1,(ln&130023424)===0&&(ln=4194304)));var y=zr();l=ol(l,d),l!==null&&(Gn(l,d,y),ra(l,y))}function sp(l){var d=l.memoizedState,y=0;d!==null&&(y=d.retryLane),km(l,y)}function ap(l,d){var y=0;switch(l.tag){case 13:var T=l.stateNode,z=l.memoizedState;z!==null&&(y=z.retryLane);break;case 19:T=l.stateNode;break;default:throw Error(t(314))}T!==null&&T.delete(d),km(l,y)}var Pr;Pr=function(l,d,y){if(l!==null)if(l.memoizedProps!==d.pendingProps||ei.current)na=!0;else{if((l.lanes&y)===0&&(d.flags&128)===0)return na=!1,ly(l,d,y);na=(l.flags&131072)!==0}else na=!1,ji&&(d.flags&1048576)!==0&&Gr(d,$c,d.index);switch(d.lanes=0,d.tag){case 2:var T=d.type;hl(l,d),l=d.pendingProps;var z=_s(d,zs.current);Gl(d,y),z=Nf(null,d,T,l,z,y);var H=zf();return d.flags|=1,typeof z=="object"&&z!==null&&typeof z.render=="function"&&z.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,$s(T)?(H=!0,mh(d)):H=!1,d.memoizedState=z.state!==null&&z.state!==void 0?z.state:null,Wa(d),z.updater=dl,d.stateNode=z,z._reactInternals=d,Wf(d,T,l,y),d=Zf(null,d,T,!0,H,y)):(d.tag=0,ji&&H&&Er(d),ns(null,d,z,y),d=d.child),d;case 16:T=d.elementType;e:{switch(hl(l,d),l=d.pendingProps,z=T._init,T=z(T._payload),d.type=T,z=d.tag=Rm(T),l=Wr(T,l),z){case 0:d=Mh(null,d,T,l,y);break e;case 1:d=Em(null,d,T,l,y);break e;case 11:d=Yf(null,d,T,l,y);break e;case 14:d=oc(null,d,T,Wr(T.type,l),y);break e}throw Error(t(306,T,""))}return d;case 0:return T=d.type,z=d.pendingProps,z=d.elementType===T?z:Wr(T,z),Mh(l,d,T,z,y);case 1:return T=d.type,z=d.pendingProps,z=d.elementType===T?z:Wr(T,z),Em(l,d,T,z,y);case 3:e:{if(Kf(d),l===null)throw Error(t(387));T=d.pendingProps,H=d.memoizedState,z=H.element,$r(l,d),Tr(d,T,null,y);var ee=d.memoizedState;if(T=ee.element,H.isDehydrated)if(H={element:T,isDehydrated:!1,cache:ee.cache,pendingSuspenseBoundaries:ee.pendingSuspenseBoundaries,transitions:ee.transitions},d.updateQueue.baseState=H,d.memoizedState=H,d.flags&256){z=ac(Error(t(423)),d),d=_f(l,d,T,y,z);break e}else if(T!==z){z=ac(Error(t(424)),d),d=_f(l,d,T,y,z);break e}else for(_r=tl(d.stateNode.containerInfo.firstChild),gs=d,ji=!0,ea=null,y=Mf(d,null,T,y),d.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ua(),T===z){d=Cr(l,d,y);break e}ns(l,d,T,y)}d=d.child}return d;case 5:return rm(d),l===null&&td(d),T=d.type,z=d.pendingProps,H=l!==null?l.memoizedProps:null,ee=z.children,Af(T,z)?ee=null:H!==null&&Af(T,H)&&(d.flags|=32),Jf(l,d),ns(l,d,ee,y),d.child;case 6:return l===null&&td(d),null;case 13:return ep(l,d,y);case 4:return ld(d,d.stateNode.containerInfo),T=d.pendingProps,l===null?d.child=rc(d,null,T,y):ns(l,d,T,y),d.child;case 11:return T=d.type,z=d.pendingProps,z=d.elementType===T?z:Wr(T,z),Yf(l,d,T,z,y);case 7:return ns(l,d,d.pendingProps,y),d.child;case 8:return ns(l,d,d.pendingProps.children,y),d.child;case 12:return ns(l,d,d.pendingProps.children,y),d.child;case 10:e:{if(T=d.type._context,z=d.pendingProps,H=d.memoizedProps,ee=z.value,zi(Ul,T._currentValue),T._currentValue=ee,H!==null)if(Ua(H.value,ee)){if(H.children===z.children&&!ei.current){d=Cr(l,d,y);break e}}else for(H=d.child,H!==null&&(H.return=d);H!==null;){var Te=H.dependencies;if(Te!==null){ee=H.child;for(var Le=Te.firstContext;Le!==null;){if(Le.context===T){if(H.tag===1){Le=es(-1,y&-y),Le.tag=2;var je=H.updateQueue;if(je!==null){je=je.shared;var Et=je.pending;Et===null?Le.next=Le:(Le.next=Et.next,Et.next=Le),je.pending=Le}}H.lanes|=y,Le=H.alternate,Le!==null&&(Le.lanes|=y),im(H.return,y,d),Te.lanes|=y;break}Le=Le.next}}else if(H.tag===10)ee=H.type===d.type?null:H.child;else if(H.tag===18){if(ee=H.return,ee===null)throw Error(t(341));ee.lanes|=y,Te=ee.alternate,Te!==null&&(Te.lanes|=y),im(ee,y,d),ee=H.sibling}else ee=H.child;if(ee!==null)ee.return=H;else for(ee=H;ee!==null;){if(ee===d){ee=null;break}if(H=ee.sibling,H!==null){H.return=ee.return,ee=H;break}ee=ee.return}H=ee}ns(l,d,z.children,y),d=d.child}return d;case 9:return z=d.type,T=d.pendingProps.children,Gl(d,y),z=Ea(z),T=T(z),d.flags|=1,ns(l,d,T,y),d.child;case 14:return T=d.type,z=Wr(T,d.pendingProps),z=Wr(T.type,z),oc(l,d,T,z,y);case 15:return Qf(l,d,d.type,d.pendingProps,y);case 17:return T=d.type,z=d.pendingProps,z=d.elementType===T?z:Wr(T,z),hl(l,d),d.tag=1,$s(T)?(l=!0,mh(d)):l=!1,Gl(d,y),Am(d,T,z),Wf(d,T,z,y),Zf(null,d,T,!0,l,y);case 19:return ql(l,d,y);case 22:return Sm(l,d,y)}throw Error(t(156,d.tag))};function Ih(l,d){return la(l,d)}function Kl(l,d,y,T){this.tag=l,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pi(l,d,y,T){return new Kl(l,d,y,T)}function Md(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Rm(l){if(typeof l=="function")return Md(l)?1:0;if(l!=null){if(l=l.$$typeof,l===ve)return 11;if(l===Me)return 14}return 2}function er(l,d){var y=l.alternate;return y===null?(y=Pi(l.tag,d,l.key,l.mode),y.elementType=l.elementType,y.type=l.type,y.stateNode=l.stateNode,y.alternate=l,l.alternate=y):(y.pendingProps=d,y.type=l.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=l.flags&14680064,y.childLanes=l.childLanes,y.lanes=l.lanes,y.child=l.child,y.memoizedProps=l.memoizedProps,y.memoizedState=l.memoizedState,y.updateQueue=l.updateQueue,d=l.dependencies,y.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},y.sibling=l.sibling,y.index=l.index,y.ref=l.ref,y}function gr(l,d,y,T,z,H){var ee=2;if(T=l,typeof l=="function")Md(l)&&(ee=1);else if(typeof l=="string")ee=5;else e:switch(l){case _:return Xr(y.children,z,H,d);case G:ee=8,z|=8;break;case Z:return l=Pi(12,y,d,z|2),l.elementType=Z,l.lanes=H,l;case Se:return l=Pi(13,y,d,z),l.elementType=Se,l.lanes=H,l;case Ne:return l=Pi(19,y,d,z),l.elementType=Ne,l.lanes=H,l;case me:return ca(y,z,H,d);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case ie:ee=10;break e;case oe:ee=9;break e;case ve:ee=11;break e;case Me:ee=14;break e;case Ae:ee=16,T=null;break e}throw Error(t(130,l==null?l:typeof l,""))}return d=Pi(ee,y,d,z),d.elementType=l,d.type=T,d.lanes=H,d}function Xr(l,d,y,T){return l=Pi(7,l,T,d),l.lanes=y,l}function ca(l,d,y,T){return l=Pi(22,l,T,d),l.elementType=me,l.lanes=y,l.stateNode={isHidden:!1},l}function _l(l,d,y){return l=Pi(6,l,null,d),l.lanes=y,l}function op(l,d,y){return d=Pi(4,l.children!==null?l.children:[],l.key,d),d.lanes=y,d.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},d}function lp(l,d,y,T,z){this.tag=d,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$e(0),this.expirationTimes=$e(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$e(0),this.identifierPrefix=T,this.onRecoverableError=z,this.mutableSourceEagerHydrationData=null}function Ac(l,d,y,T,z,H,ee,Te,Le){return l=new lp(l,d,y,Te,Le),d===1?(d=1,H===!0&&(d|=8)):d=0,H=Pi(3,null,null,d),l.current=H,H.stateNode=l,H.memoizedState={element:T,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wa(H),l}function up(l,d,y){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:q,key:T==null?null:""+T,children:l,containerInfo:d,implementation:y}}function Cd(l){if(!l)return il;l=l._reactInternals;e:{if(tn(l)!==l||l.tag!==1)throw Error(t(170));var d=l;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if($s(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(t(171))}if(l.tag===1){var y=l.type;if($s(y))return tm(l,y,d)}return d}function Dh(l,d,y,T,z,H,ee,Te,Le){return l=Ac(y,T,!0,l,z,H,ee,Te,Le),l.context=Cd(null),y=l.current,T=zr(),z=Ya(y),H=es(T,z),H.callback=d??null,ur(y,H,z),l.current.lanes=z,Gn(l,z,T),ra(l,T),l}function $l(l,d,y,T){var z=d.current,H=zr(),ee=Ya(z);return y=Cd(y),d.context===null?d.context=y:d.pendingContext=y,d=es(H,ee),d.payload={element:l},T=T===void 0?null:T,T!==null&&(d.callback=T),l=ur(z,d,ee),l!==null&&(bs(l,z,ee,H),sd(l,z,ee)),ee}function Lh(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 5:return l.child.stateNode;default:return l.child.stateNode}}function yi(l,d){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var y=l.retryLane;l.retryLane=y!==0&&y<d?y:d}}function Vi(l,d){yi(l,d),(l=l.alternate)&&yi(l,d)}function bi(){return null}var Ei=typeof reportError=="function"?reportError:function(l){console.error(l)};function Li(l){this._internalRoot=l}as.prototype.render=Li.prototype.render=function(l){var d=this._internalRoot;if(d===null)throw Error(t(409));$l(l,d,null,null)},as.prototype.unmount=Li.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var d=l.containerInfo;jr(function(){$l(null,l,null,null)}),d[ko]=null}};function as(l){this._internalRoot=l}as.prototype.unstable_scheduleHydration=function(l){if(l){var d=Si();l={blockedOn:null,target:l,priority:d};for(var y=0;y<za.length&&d!==0&&d<za[y].priority;y++);za.splice(y,0,l),y===0&&Nc(l)}};function Bo(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function ml(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11&&(l.nodeType!==8||l.nodeValue!==" react-mount-point-unstable "))}function cp(){}function gl(l,d,y,T,z){if(z){if(typeof T=="function"){var H=T;T=function(){var je=Lh(ee);H.call(je)}}var ee=Dh(d,T,l,0,null,!1,!1,"",cp);return l._reactRootContainer=ee,l[ko]=ee.current,el(l.nodeType===8?l.parentNode:l),jr(),ee}for(;z=l.lastChild;)l.removeChild(z);if(typeof T=="function"){var Te=T;T=function(){var je=Lh(Le);Te.call(je)}}var Le=Ac(l,0,!1,null,null,!1,!1,"",cp);return l._reactRootContainer=Le,l[ko]=Le.current,el(l.nodeType===8?l.parentNode:l),jr(function(){$l(d,Le,y,T)}),Le}function _i(l,d,y,T,z){var H=y._reactRootContainer;if(H){var ee=H;if(typeof z=="function"){var Te=z;z=function(){var Le=Lh(ee);Te.call(Le)}}$l(d,ee,l,z)}else ee=gl(y,d,l,z,T);return Lh(ee)}mi=function(l){switch(l.tag){case 3:var d=l.stateNode;if(d.current.memoizedState.isDehydrated){var y=fi(d.pendingLanes);y!==0&&(Or(d,y|1),ra(d,Qi()),(ri&6)===0&&(ja=Qi()+500,sl()))}break;case 13:jr(function(){var T=ol(l,1);if(T!==null){var z=zr();bs(T,l,1,z)}}),Vi(l,1)}},Ri=function(l){if(l.tag===13){var d=ol(l,134217728);if(d!==null){var y=zr();bs(d,l,134217728,y)}Vi(l,134217728)}},Br=function(l){if(l.tag===13){var d=Ya(l),y=ol(l,d);if(y!==null){var T=zr();bs(y,l,d,T)}Vi(l,d)}},Si=function(){return Qn},us=function(l,d){var y=Qn;try{return Qn=l,d()}finally{Qn=y}},zn=function(l,d,y){switch(d){case"input":if(Pt(l,y),d=y.name,y.type==="radio"&&d!=null){for(y=l;y.parentNode;)y=y.parentNode;for(y=y.querySelectorAll("input[name="+JSON.stringify(""+d)+'][type="radio"]'),d=0;d<y.length;d++){var T=y[d];if(T!==l&&T.form===l.form){var z=Zc(T);if(!z)throw Error(t(90));Vn(T),Pt(T,z)}}}break;case"textarea":Kn(l,y);break;case"select":d=y.value,d!=null&&yn(l,!!y.multiple,d,!1)}},Zt=gc,xt=jr;var vl={usingClientEntryPoint:!1,Events:[zl,fu,Zc,ft,Yt,gc]},ws={findFiberByHostInstance:Ga,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dp={bundleType:ws.bundleType,version:ws.version,rendererPackageName:ws.rendererPackageName,rendererConfig:ws.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:B.ReactCurrentDispatcher,findHostInstanceByFiber:function(l){return l=La(l),l===null?null:l.stateNode},findFiberByHostInstance:ws.findFiberByHostInstance||bi,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ss=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ss.isDisabled&&Ss.supportsFiber)try{Ke=Ss.inject(dp),Mt=Ss}catch{}}return Uo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vl,Uo.createPortal=function(l,d){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Bo(d))throw Error(t(200));return up(l,d,null,y)},Uo.createRoot=function(l,d){if(!Bo(l))throw Error(t(299));var y=!1,T="",z=Ei;return d!=null&&(d.unstable_strictMode===!0&&(y=!0),d.identifierPrefix!==void 0&&(T=d.identifierPrefix),d.onRecoverableError!==void 0&&(z=d.onRecoverableError)),d=Ac(l,1,!1,null,null,y,!1,T,z),l[ko]=d.current,el(l.nodeType===8?l.parentNode:l),new Li(d)},Uo.findDOMNode=function(l){if(l==null)return null;if(l.nodeType===1)return l;var d=l._reactInternals;if(d===void 0)throw typeof l.render=="function"?Error(t(188)):(l=Object.keys(l).join(","),Error(t(268,l)));return l=La(d),l=l===null?null:l.stateNode,l},Uo.flushSync=function(l){return jr(l)},Uo.hydrate=function(l,d,y){if(!ml(d))throw Error(t(200));return _i(null,l,d,!0,y)},Uo.hydrateRoot=function(l,d,y){if(!Bo(l))throw Error(t(405));var T=y!=null&&y.hydratedSources||null,z=!1,H="",ee=Ei;if(y!=null&&(y.unstable_strictMode===!0&&(z=!0),y.identifierPrefix!==void 0&&(H=y.identifierPrefix),y.onRecoverableError!==void 0&&(ee=y.onRecoverableError)),d=Dh(d,null,l,1,y??null,z,!1,H,ee),l[ko]=d.current,el(l),T)for(l=0;l<T.length;l++)y=T[l],z=y._getVersion,z=z(y._source),d.mutableSourceEagerHydrationData==null?d.mutableSourceEagerHydrationData=[y,z]:d.mutableSourceEagerHydrationData.push(y,z);return new as(d)},Uo.render=function(l,d,y){if(!ml(d))throw Error(t(200));return _i(null,l,d,!1,y)},Uo.unmountComponentAtNode=function(l){if(!ml(l))throw Error(t(40));return l._reactRootContainer?(jr(function(){_i(null,null,l,!1,function(){l._reactRootContainer=null,l[ko]=null})}),!0):!1},Uo.unstable_batchedUpdates=gc,Uo.unstable_renderSubtreeIntoContainer=function(l,d,y,T){if(!ml(y))throw Error(t(200));if(l==null||l._reactInternals===void 0)throw Error(t(38));return _i(l,d,y,!1,T)},Uo.version="18.3.1-next-f1338f8080-20240426",Uo}var BS;function SR(){if(BS)return cx.exports;BS=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),cx.exports=wR(),cx.exports}var US;function ER(){if(US)return cy;US=1;var i=SR();return cy.createRoot=i.createRoot,cy.hydrateRoot=i.hydrateRoot,cy}var TR=ER(),pe=Pm();const or=ox(pe),eu={TEXT:"text",VOICE:"voice",TEXT_AND_VOICE:"text_and_voice",CLOUD_AVATAR:"cloud_avatar",DESKTOP_AVATAR:"desktop_avatar"},xc={DISCONNECT:"disconnect",SESSION_READY:"session_ready",SESSION_JOINED:"session_joined",SESSION_TERMINATED:"session_terminated",USER_MESSAGE:"user_message",AUDIO_CHUNK:"audio_chunk",AUDIO_END:"audio_end",INTERRUPT:"interrupt",CHANGE_SESSION_LANGUAGE:"change_session_language",LANGUAGE_CHANGED:"language_changed",CLIENT_READY:"client_ready",CLIENT_TOOL_REQUEST:"client_tool_request",CLIENT_TOOL_RESULT:"client_tool_result",CLEAR_SESSION_HISTORY:"clear_session_history",TRANSCRIPT:"transcript",PARTIAL_TRANSCRIPT:"partial_transcript",AGENT_RESPONSE_CHUNK:"agent_response_chunk",AGENT_RESPONSE:"agent_response",AGENT_AUDIO_CHUNK:"agent_audio_chunk",AGENT_AUDIO_COMPLETE:"agent_audio_complete",AVATAR_SPEAKING:"avatar_speaking",AVATAR_SPEAKING_DONE:"avatar_speaking_done",INTERRUPTED:"interrupted",ERROR:"error",AUTH_ERROR:"auth_error",SESSION_EXPIRED:"session_expired",CREDITS_EXHAUSTED:"credits_exhausted",SESSION_STATE_CHANGED:"session:state_changed",AUDIO_PLAYBACK_COMPLETE:"audio:playback_complete",MESSAGE_RATE_LIMITED:"message_rate_limited",SHOW_LEAD_CAPTURE_FORM:"show_lead_capture_form"},Qr={IDLE:"idle",INITIALIZING:"initializing",CONNECTING:"connecting",CONNECTED:"connected",FAILED:"failed",ENDED:"ended"},xl={IDLE:"idle",CONNECTING:"connecting",LOADING:"loading",CONNECTED:"connected",DISCONNECTED:"disconnected",ERROR:"error"},Im={IDLE:"idle",AGENT_THINKING:"agent_thinking",AGENT_SPEAKING:"agent_speaking",TOOL_EXECUTING:"tool_executing",TERMINATING:"terminating",TERMINATED:"terminated"},MR={encoding:"16bitInt",channels:1,sampleRate:16e3},fx={connectionState:Qr.IDLE,isConnected:!1,isSessionReady:!1,error:null,isAudioPlaying:!1,isAvatarSpeaking:!1,sessionState:Im.IDLE,cloudStream:{state:xl.IDLE,error:null},transcript:null,partialTranscript:null,session:{sessionId:null,role:null,agentType:null,streamingUrl:null,uniqueId:null},messages:[],creditExhausted:!1,creditError:null,agentConfig:null};function VS(i,e){switch(e.type){case"SET_CONNECTION_STATE":return{...i,connectionState:e.payload,isConnected:e.payload===Qr.CONNECTED};case"SET_ERROR":return{...i,error:e.payload};case"SET_CLOUD_STREAM_STATE":return{...i,cloudStream:e.payload};case"SET_SESSION_STATE":return{...i,sessionState:e.payload};case"UPDATE_SESSION":return{...i,session:{...i.session,...e.payload}};case"ADD_MESSAGE":return{...i,messages:[...i.messages,e.payload]};case"SET_AUDIO_PLAYING":return{...i,isAudioPlaying:e.payload};case"SET_AVATAR_SPEAKING":return{...i,isAvatarSpeaking:e.payload};case"SET_CREDIT_EXHAUSTED":return{...i,creditExhausted:e.payload.exhausted,creditError:e.payload.error};case"SET_TRANSCRIPT":return{...i,transcript:e.payload};case"SET_PARTIAL_TRANSCRIPT":return{...i,partialTranscript:e.payload};case"SET_MESSAGES":return{...i,messages:e.payload};case"SET_SESSION_READY":return{...i,isSessionReady:e.payload};case"SET_AGENT_CONFIG":return{...i,agentConfig:e.payload};case"HARD_RESET":return fx;case"REPLACE_STATE":return e.payload;default:return i}}function CR(i){return{isSessionTerminated:i===Im.TERMINATED,isSessionTerminating:i===Im.TERMINATING,isAgentThinking:i===Im.AGENT_THINKING,isAgentSpeaking:i===Im.AGENT_SPEAKING,isToolExecuting:i===Im.TOOL_EXECUTING}}function kR(){const i=new Map;return{addChunk(e,t){const n=e||`request-${Date.now()}`,o=`${i.get(n)||""}${t||""}`;return i.set(n,o),{id:n,text:o}},consume(e,t=""){const n=e||`request-${Date.now()}`,r=i.get(n)||t||"";return i.delete(n),{id:n,text:r}},clear(){i.clear()}}}function RR(){try{const i=Intl.DateTimeFormat().resolvedOptions().timeZone;return typeof i=="string"&&i.trim()?i.trim():void 0}catch{return}}async function Xg(i){if(!i?.ok){let e=`HTTP ${i.status}`;try{const r=await i.json();e=r?.detail||r?.message||e}catch{}const t=new Error(e);throw t.status=i.status,t}return i.json()}function PR({restUrl:i,log:e,withCredentials:t}){function n(){if(!i)throw new Error("Missing restUrl in RqmiiAgentProvider")}async function r({apiKey:v,publicChatId:A,agentId:S,userId:b,language:M="en",timezone:k,config:L}={}){n();const P={...v?{api_key:v}:{},...A?{public_chat_id:A}:{},...S?{agent_id:S}:{},...b?{user_id:b}:{},language:M,...k?{timezone:k}:{},...L?{config:L}:{}};e("initializeSession — POST /sessions/init",P);const I=await fetch(`${i}/sessions/init`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P),...t?{credentials:"include"}:{}}),U=await Xg(I);if(!U?.session_id||!U?.session_token)throw new Error("Invalid initialize session response");return U}async function o({uniqueId:v}){n(),e("joinDesktopSession — POST /sessions/join",{uniqueId:v});const A=await fetch(`${i}/sessions/join`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({unique_id:v}),...t?{credentials:"include"}:{}}),S=await Xg(A);if(!S?.session_id||!S?.session_token)throw new Error("Invalid join session response");return S}async function c(v){n(),e("fetchAgentConfig — GET /agent/{publicChatId}",{publicChatId:v});const A=await fetch(`${i}/agent/${encodeURIComponent(v)}`,{method:"GET",headers:{"Content-Type":"application/json"},...t?{credentials:"include"}:{}});return Xg(A)}async function f({sessionId:v,rating:A,feedback:S,endedBy:b}){if(n(),!v)throw new Error("sessionId is required");const M={...typeof A=="number"?{rating:A}:{},...S?{feedback:S}:{},...b?{ended_by:b}:{}};e("submitFeedback — PATCH /conversations/{sessionId}/feedback",{sessionId:v,payload:M});const k=await fetch(`${i}/conversations/${encodeURIComponent(v)}/feedback`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(M),...t?{credentials:"include"}:{}});return Xg(k)}async function p({agentId:v,sessionId:A,collectedData:S}){if(n(),!v)throw new Error("agentId is required");if(!A)throw new Error("sessionId is required");e("submitLead — POST /public/agent/{agentId}/lead-capture/leads",{agentId:v,sessionId:A});const b=await fetch(`${i}/public/agent/${encodeURIComponent(v)}/lead-capture/leads`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:A,collected_data:S}),...t?{credentials:"include"}:{}});return Xg(b)}return{initializeSession:r,joinDesktopSession:o,fetchAgentConfig:c,submitFeedback:f,submitLead:p}}const bc=Object.create(null);bc.open="0",bc.close="1",bc.ping="2",bc.pong="3",bc.message="4",bc.upgrade="5",bc.noop="6";const dy=Object.create(null);Object.keys(bc).forEach(i=>{dy[bc[i]]=i});const px={type:"error",data:"parser error"},GS=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",HS=typeof ArrayBuffer=="function",WS=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i&&i.buffer instanceof ArrayBuffer,mx=({type:i,data:e},t,n)=>GS&&e instanceof Blob?t?n(e):qS(e,n):HS&&(e instanceof ArrayBuffer||WS(e))?t?n(e):qS(new Blob([e]),n):n(bc[i]+(e||"")),qS=(i,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(i)};function jS(i){return i instanceof Uint8Array?i:i instanceof ArrayBuffer?new Uint8Array(i):new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let gx;function IR(i,e){if(GS&&i.data instanceof Blob)return i.data.arrayBuffer().then(jS).then(e);if(HS&&(i.data instanceof ArrayBuffer||WS(i.data)))return e(jS(i.data));mx(i,!1,t=>{gx||(gx=new TextEncoder),e(gx.encode(t))})}const XS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yg=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let i=0;i<XS.length;i++)Yg[XS.charCodeAt(i)]=i;const DR=i=>{let e=i.length*.75,t=i.length,n,r=0,o,c,f,p;i[i.length-1]==="="&&(e--,i[i.length-2]==="="&&e--);const v=new ArrayBuffer(e),A=new Uint8Array(v);for(n=0;n<t;n+=4)o=Yg[i.charCodeAt(n)],c=Yg[i.charCodeAt(n+1)],f=Yg[i.charCodeAt(n+2)],p=Yg[i.charCodeAt(n+3)],A[r++]=o<<2|c>>4,A[r++]=(c&15)<<4|f>>2,A[r++]=(f&3)<<6|p&63;return v},LR=typeof ArrayBuffer=="function",vx=(i,e)=>{if(typeof i!="string")return{type:"message",data:YS(i,e)};const t=i.charAt(0);return t==="b"?{type:"message",data:NR(i.substring(1),e)}:dy[t]?i.length>1?{type:dy[t],data:i.substring(1)}:{type:dy[t]}:px},NR=(i,e)=>{if(LR){const t=DR(i);return YS(t,e)}else return{base64:!0,data:i}},YS=(i,e)=>{switch(e){case"blob":return i instanceof Blob?i:new Blob([i]);case"arraybuffer":default:return i instanceof ArrayBuffer?i:i.buffer}},QS="",zR=(i,e)=>{const t=i.length,n=new Array(t);let r=0;i.forEach((o,c)=>{mx(o,!1,f=>{n[c]=f,++r===t&&e(n.join(QS))})})},FR=(i,e)=>{const t=i.split(QS),n=[];for(let r=0;r<t.length;r++){const o=vx(t[r],e);if(n.push(o),o.type==="error")break}return n};function OR(){return new TransformStream({transform(i,e){IR(i,t=>{const n=t.length;let r;if(n<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,n);else if(n<65536){r=new Uint8Array(3);const o=new DataView(r.buffer);o.setUint8(0,126),o.setUint16(1,n)}else{r=new Uint8Array(9);const o=new DataView(r.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(n))}i.data&&typeof i.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}let yx;function hy(i){return i.reduce((e,t)=>e+t.length,0)}function fy(i,e){if(i[0].length===e)return i.shift();const t=new Uint8Array(e);let n=0;for(let r=0;r<e;r++)t[r]=i[0][n++],n===i[0].length&&(i.shift(),n=0);return i.length&&n<i[0].length&&(i[0]=i[0].slice(n)),t}function BR(i,e){yx||(yx=new TextDecoder);const t=[];let n=0,r=-1,o=!1;return new TransformStream({transform(c,f){for(t.push(c);;){if(n===0){if(hy(t)<1)break;const p=fy(t,1);o=(p[0]&128)===128,r=p[0]&127,r<126?n=3:r===126?n=1:n=2}else if(n===1){if(hy(t)<2)break;const p=fy(t,2);r=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),n=3}else if(n===2){if(hy(t)<8)break;const p=fy(t,8),v=new DataView(p.buffer,p.byteOffset,p.length),A=v.getUint32(0);if(A>Math.pow(2,21)-1){f.enqueue(px);break}r=A*Math.pow(2,32)+v.getUint32(4),n=3}else{if(hy(t)<r)break;const p=fy(t,r);f.enqueue(vx(o?p:yx.decode(p),e)),n=0}if(r===0||r>i){f.enqueue(px);break}}}})}const JS=4;function qs(i){if(i)return UR(i)}function UR(i){for(var e in qs.prototype)i[e]=qs.prototype[e];return i}qs.prototype.on=qs.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this},qs.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return t.fn=e,this.on(i,t),this},qs.prototype.off=qs.prototype.removeListener=qs.prototype.removeAllListeners=qs.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var n,r=0;r<t.length;r++)if(n=t[r],n===e||n.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+i],this},qs.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,r=t.length;n<r;++n)t[n].apply(this,e)}return this},qs.prototype.emitReserved=qs.prototype.emit,qs.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]},qs.prototype.hasListeners=function(i){return!!this.listeners(i).length};const py=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),tu=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),VR="arraybuffer";function X4(){}function ZS(i,...e){return e.reduce((t,n)=>(i.hasOwnProperty(n)&&(t[n]=i[n]),t),{})}const GR=tu.setTimeout,HR=tu.clearTimeout;function my(i,e){e.useNativeTimers?(i.setTimeoutFn=GR.bind(tu),i.clearTimeoutFn=HR.bind(tu)):(i.setTimeoutFn=tu.setTimeout.bind(tu),i.clearTimeoutFn=tu.clearTimeout.bind(tu))}const WR=1.33;function qR(i){return typeof i=="string"?jR(i):Math.ceil((i.byteLength||i.size)*WR)}function jR(i){let e=0,t=0;for(let n=0,r=i.length;n<r;n++)e=i.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function KS(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function XR(i){let e="";for(let t in i)i.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(i[t]));return e}function YR(i){let e={},t=i.split("&");for(let n=0,r=t.length;n<r;n++){let o=t[n].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}class QR extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class Ax extends qs{constructor(e){super(),this.writable=!1,my(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new QR(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=vx(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=XR(e);return t.length?"?"+t:""}}class JR extends Ax{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};FR(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,zR(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=KS()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let _S=!1;try{_S=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ZR=_S;function KR(){}class _R extends JR{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(r,o)=>{this.onError("xhr post error",r,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}let Dm=class sx extends qs{constructor(e,t,n){super(),this.createRequest=e,my(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=ZS(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this._opts.extraHeaders[r])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var r;n.readyState===3&&((r=this._opts.cookieJar)===null||r===void 0||r.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(r){this.setTimeoutFn(()=>{this._onError(r)},0);return}typeof document<"u"&&(this._index=sx.requestsCount++,sx.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=KR,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete sx.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};if(Dm.requestsCount=0,Dm.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",$S);else if(typeof addEventListener=="function"){const i="onpagehide"in tu?"pagehide":"unload";addEventListener(i,$S,!1)}}function $S(){for(let i in Dm.requests)Dm.requests.hasOwnProperty(i)&&Dm.requests[i].abort()}const $R=(function(){const i=e1({xdomain:!1});return i&&i.responseType!==null})();class e3 extends _R{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=$R&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Dm(e1,this.uri(),e)}}function e1(i){const e=i.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||ZR))return new XMLHttpRequest}catch{}if(!e)try{return new tu[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const t1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class t3 extends Ax{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=t1?{}:ZS(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;mx(n,this.supportsBinary,o=>{try{this.doWrite(n,o)}catch{}r&&py(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=KS()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const xx=tu.WebSocket||tu.MozWebSocket;class n3 extends t3{createSocket(e,t,n){return t1?new xx(e,t,n):t?new xx(e,t):new xx(e)}doWrite(e,t){this.ws.send(t)}}class i3 extends Ax{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=BR(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=OR();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const o=()=>{n.read().then(({done:f,value:p})=>{f||(this.onPacket(p),o())}).catch(f=>{})};o();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&py(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const r3={websocket:n3,webtransport:i3,polling:e3},s3=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,a3=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function bx(i){if(i.length>8e3)throw"URI too long";const e=i,t=i.indexOf("["),n=i.indexOf("]");t!=-1&&n!=-1&&(i=i.substring(0,t)+i.substring(t,n).replace(/:/g,";")+i.substring(n,i.length));let r=s3.exec(i||""),o={},c=14;for(;c--;)o[a3[c]]=r[c]||"";return t!=-1&&n!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=o3(o,o.path),o.queryKey=l3(o,o.query),o}function o3(i,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function l3(i,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,r,o){r&&(t[r]=o)}),t}const wx=typeof addEventListener=="function"&&typeof removeEventListener=="function",gy=[];wx&&addEventListener("offline",()=>{gy.forEach(i=>i())},!1);class Fh extends qs{constructor(e,t){if(super(),this.binaryType=VR,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=bx(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=bx(t.host).host);my(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const r=n.prototype.name;this.transports.push(r),this._transportsByName[r]=n}),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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=YR(this.opts.query)),wx&&(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"})},gy.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=JS,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Fh.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",Fh.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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 e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(t+=qR(r)),n>0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,py(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if(typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(Fh.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){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(),wx&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=gy.indexOf(this._offlineEventListener);n!==-1&&gy.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}Fh.protocol=JS;class u3 extends Fh{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;Fh.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",S=>{if(!n)if(S.type==="pong"&&S.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Fh.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(A(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const b=new Error("probe error");b.transport=t.name,this.emitReserved("upgradeError",b)}}))};function o(){n||(n=!0,A(),t.close(),t=null)}const c=S=>{const b=new Error("probe error: "+S);b.transport=t.name,o(),this.emitReserved("upgradeError",b)};function f(){c("transport closed")}function p(){c("socket closed")}function v(S){t&&S.name!==t.name&&o()}const A=()=>{t.removeListener("open",r),t.removeListener("error",c),t.removeListener("close",f),this.off("close",p),this.off("upgrading",v)};t.once("open",r),t.once("error",c),t.once("close",f),this.once("close",p),this.once("upgrading",v),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let c3=class extends u3{constructor(e,t={}){const n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(r=>r3[r]).filter(r=>!!r)),super(e,n)}};function d3(i,e="",t){let n=i;t=t||typeof location<"u"&&location,i==null&&(i=t.protocol+"//"+t.host),typeof i=="string"&&(i.charAt(0)==="/"&&(i.charAt(1)==="/"?i=t.protocol+i:i=t.host+i),/^(https?|wss?):\/\//.test(i)||(typeof t<"u"?i=t.protocol+"//"+i:i="https://"+i),n=bx(i)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const o=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+o+":"+n.port+e,n.href=n.protocol+"://"+o+(t&&t.port===n.port?"":":"+n.port),n}const h3=typeof ArrayBuffer=="function",f3=i=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(i):i.buffer instanceof ArrayBuffer,n1=Object.prototype.toString,p3=typeof Blob=="function"||typeof Blob<"u"&&n1.call(Blob)==="[object BlobConstructor]",m3=typeof File=="function"||typeof File<"u"&&n1.call(File)==="[object FileConstructor]";function Sx(i){return h3&&(i instanceof ArrayBuffer||f3(i))||p3&&i instanceof Blob||m3&&i instanceof File}function vy(i,e){if(!i||typeof i!="object")return!1;if(Array.isArray(i)){for(let t=0,n=i.length;t<n;t++)if(vy(i[t]))return!0;return!1}if(Sx(i))return!0;if(i.toJSON&&typeof i.toJSON=="function"&&arguments.length===1)return vy(i.toJSON(),!0);for(const t in i)if(Object.prototype.hasOwnProperty.call(i,t)&&vy(i[t]))return!0;return!1}function g3(i){const e=[],t=i.data,n=i;return n.data=Ex(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Ex(i,e){if(!i)return i;if(Sx(i)){const t={_placeholder:!0,num:e.length};return e.push(i),t}else if(Array.isArray(i)){const t=new Array(i.length);for(let n=0;n<i.length;n++)t[n]=Ex(i[n],e);return t}else if(typeof i=="object"&&!(i instanceof Date)){const t={};for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=Ex(i[n],e));return t}return i}function v3(i,e){return i.data=Tx(i.data,e),delete i.attachments,i}function Tx(i,e){if(!i)return i;if(i&&i._placeholder===!0){if(typeof i.num=="number"&&i.num>=0&&i.num<e.length)return e[i.num];throw new Error("illegal attachments")}else if(Array.isArray(i))for(let t=0;t<i.length;t++)i[t]=Tx(i[t],e);else if(typeof i=="object")for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[t]=Tx(i[t],e));return i}const y3=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Ni;(function(i){i[i.CONNECT=0]="CONNECT",i[i.DISCONNECT=1]="DISCONNECT",i[i.EVENT=2]="EVENT",i[i.ACK=3]="ACK",i[i.CONNECT_ERROR=4]="CONNECT_ERROR",i[i.BINARY_EVENT=5]="BINARY_EVENT",i[i.BINARY_ACK=6]="BINARY_ACK"})(Ni||(Ni={}));class A3{constructor(e){this.replacer=e}encode(e){return(e.type===Ni.EVENT||e.type===Ni.ACK)&&vy(e)?this.encodeAsBinary({type:e.type===Ni.EVENT?Ni.BINARY_EVENT:Ni.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===Ni.BINARY_EVENT||e.type===Ni.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=g3(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}}class Mx extends qs{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===Ni.BINARY_EVENT;n||t.type===Ni.BINARY_ACK?(t.type=n?Ni.EVENT:Ni.ACK,this.reconstructor=new x3(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(Sx(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(Ni[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===Ni.BINARY_EVENT||n.type===Ni.BINARY_ACK){const o=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const c=e.substring(o,t);if(c!=Number(c)||e.charAt(t)!=="-")throw new Error("Illegal attachments");const f=Number(c);if(!b3(f)||f<0)throw new Error("Illegal attachments");if(f>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=f}if(e.charAt(t+1)==="/"){const o=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(o,t)}else n.nsp="/";const r=e.charAt(t+1);if(r!==""&&Number(r)==r){const o=t+1;for(;++t;){const c=e.charAt(t);if(c==null||Number(c)!=c){--t;break}if(t===e.length)break}n.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){const o=this.tryParse(e.substr(t));if(Mx.isPayloadValid(n.type,o))n.data=o;else throw new Error("invalid payload")}return n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case Ni.CONNECT:return i1(t);case Ni.DISCONNECT:return t===void 0;case Ni.CONNECT_ERROR:return typeof t=="string"||i1(t);case Ni.EVENT:case Ni.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&y3.indexOf(t[0])===-1);case Ni.ACK:case Ni.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class x3{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=v3(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const b3=Number.isInteger||function(i){return typeof i=="number"&&isFinite(i)&&Math.floor(i)===i};function i1(i){return Object.prototype.toString.call(i)==="[object Object]"}const w3=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Mx,Encoder:A3,get PacketType(){return Ni}},Symbol.toStringTag,{value:"Module"}));function ku(i,e,t){return i.on(e,t),function(){i.off(e,t)}}const S3=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class r1 extends qs{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[ku(e,"open",this.onopen.bind(this)),ku(e,"packet",this.onpacket.bind(this)),ku(e,"error",this.onerror.bind(this)),ku(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,o;if(S3.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const c={type:Ni.EVENT,data:t};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const A=this.ids++,S=t.pop();this._registerAckCallback(A,S),c.id=A}const f=(r=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||r===void 0?void 0:r.writable,p=this.connected&&!(!((o=this.io.engine)===null||o===void 0)&&o._hasPingExpired());return this.flags.volatile&&!f||(p?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(e,t){var n;const r=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(r===void 0){this.acks[e]=t;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===e&&this.sendBuffer.splice(f,1);t.call(this,new Error("operation has timed out"))},r),c=(...f)=>{this.io.clearTimeoutFn(o),t.apply(this,f)};c.withError=!0,this.acks[e]=c}emitWithAck(e,...t){return new Promise((n,r)=>{const o=(c,f)=>c?r(c):n(f);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...o)=>(this._queue[0],r!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(r)):(this._queue.shift(),t&&t(null,...o)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Ni.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Ni.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 Ni.EVENT:case Ni.BINARY_EVENT:this.onevent(e);break;case Ni.ACK:case Ni.BINARY_ACK:this.onack(e);break;case Ni.DISCONNECT:this.ondisconnect();break;case Ni.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:Ni.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Ni.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Lm(i){i=i||{},this.ms=i.min||100,this.max=i.max||1e4,this.factor=i.factor||2,this.jitter=i.jitter>0&&i.jitter<=1?i.jitter:0,this.attempts=0}Lm.prototype.duration=function(){var i=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*i);i=(Math.floor(e*10)&1)==0?i-t:i+t}return Math.min(i,this.max)|0},Lm.prototype.reset=function(){this.attempts=0},Lm.prototype.setMin=function(i){this.ms=i},Lm.prototype.setMax=function(i){this.max=i},Lm.prototype.setJitter=function(i){this.jitter=i};class Cx extends qs{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,my(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Lm({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||w3;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new c3(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=ku(t,"open",function(){n.onopen(),e&&e()}),o=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),e?e(f):this.maybeReconnectOnOpen()},c=ku(t,"error",o);if(this._timeout!==!1){const f=this._timeout,p=this.setTimeoutFn(()=>{r(),o(new Error("timeout")),t.close()},f);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(r),this.subs.push(c),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(ku(e,"ping",this.onping.bind(this)),ku(e,"data",this.ondata.bind(this)),ku(e,"error",this.onerror.bind(this)),ku(e,"close",this.onclose.bind(this)),ku(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){py(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new r1(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Qg={};function yy(i,e){typeof i=="object"&&(e=i,i=void 0),e=e||{};const t=d3(i,e.path||"/socket.io"),n=t.source,r=t.id,o=t.path,c=Qg[r]&&o in Qg[r].nsps,f=e.forceNew||e["force new connection"]||e.multiplex===!1||c;let p;return f?p=new Cx(n,e):(Qg[r]||(Qg[r]=new Cx(n,e)),p=Qg[r]),t.query&&!e.query&&(e.query=t.queryKey),p.socket(t.path,e)}Object.assign(yy,{Manager:Cx,Socket:r1,io:yy,connect:yy});function E3({wsUrl:i,log:e}){let t=null;function n({authPayload:c,queryToken:f}){const p=yy(i,{transports:["polling"],timeout:2e4,reconnection:!1,auth:c,query:f?{token:f}:void 0});return t=p,p}function r(){if(t){try{t.removeAllListeners(),t.connected?t.disconnect():t.close()}catch{}t=null}}function o(){return t}return{connectSocketRaw:n,cleanupSocket:r,getSocket:o}}const T3=i=>{if(window.audioCtx=i,i.state!=="suspended")return;const e=document.body,t=["touchstart","touchend","mousedown","keydown"];t.forEach(o=>e.addEventListener(o,n,!1));function n(){i.resume().then(r)}function r(){t.forEach(o=>e.removeEventListener(o,n))}};function da(i){this.init(i)}da.prototype.init=function(i){var e={encoding:"16bitInt",channels:1,sampleRate:16e3};this.option=Object.assign({},e,i),this.flush=this.flush.bind(this),this.maxValue=this.getMaxValue(),this.typedArray=this.getTypedArray(),this.playingBufferNode=null,this.scheduledBufferNode=null,this.createContext(),this.resetState()},da.prototype.getMaxValue=function(){var i={"8bitInt":128,"16bitInt":32768,"32bitInt":2147483648,"32bitFloat":1};return i[this.option.encoding]?i[this.option.encoding]:i["16bitInt"]},da.prototype.getTypedArray=function(){var i={"8bitInt":Int8Array,"16bitInt":Int16Array,"32bitInt":Int32Array,"32bitFloat":Float32Array};return i[this.option.encoding]?i[this.option.encoding]:i["16bitInt"]},da.prototype.createContext=function(){this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.audioCtx.resume(),this.audioCtx.onstatechange=()=>console.log("audioCtx.state",this.audioCtx.state),T3(this.audioCtx),this.gainNode=this.audioCtx.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioCtx.destination),this.startTime=this.audioCtx.currentTime},da.prototype.resetState=function(){this.playingStartTime=-1,this.lastGotTimestamp=0,this.samples=new Float32Array,this.timeout=void 0,this.flag_request_stop=!1,this.startTime=0},da.prototype.isTypedArray=function(i){return i.byteLength&&i.buffer&&i.buffer.constructor==ArrayBuffer},da.prototype.feed=function(i){if(this.isTypedArray(i)){i=this.getFormatedValue(i);var e=new Float32Array(this.samples.length+i.length);e.set(this.samples,0),e.set(i,this.samples.length),this.samples=e,this.timeout||this.flush()}},da.prototype.getFormatedValue=function(e){var e=new this.typedArray(e.buffer),t=new Float32Array(e.length),n;for(n=0;n<e.length;n++)t[n]=e[n]/this.maxValue;return t},da.prototype.volume=function(i){this.gainNode.gain.value=i},da.prototype.destroy=function(){this.interval&&clearInterval(this.interval),this.samples=null,this.audioCtx.close(),this.audioCtx=null},da.prototype.getTimestamp=function(i){if(this.playingStartTime>=0){if(!i)return this.audioCtx.currentTime-this.playingStartTime;const e=this.lastGotTimestamp;return this.lastGotTimestamp+=i/1e3,e}return 0},da.prototype.setRequestStop=function(){this.flag_request_stop=!0},da.prototype.setOnEnd=function(i){this.onEnd=i},da.prototype.interrupt=function(i){this.scheduledBufferNode&&this.scheduledBufferNode.stop(0),this.playingBufferNode&&this.playingBufferNode.stop(0),this.ensuredClearTimeout(),this.resetState(),this.flag_request_stop=!1},da.prototype.ensuredSetTimeout=(function(){let i;return function(e,t){i=performance.now();const n=r=>{r-i>=t?(this.timeout=void 0,e()):this.timeout=requestAnimationFrame(n)};this.timeout=requestAnimationFrame(n)}})(),da.prototype.ensuredClearTimeout=function(){this.timeout&&(cancelAnimationFrame(this.timeout),this.timeout=void 0)},da.prototype.flush=function(){if(this.samples.length){var i=this.audioCtx.createBufferSource(),e=this.samples.length/this.option.channels,t=this.audioCtx.createBuffer(this.option.channels,e,this.option.sampleRate),n,r,o,c,f;for(r=0;r<this.option.channels;r++)for(n=t.getChannelData(r),o=r,f=50,c=0;c<e;c++)n[c]=this.samples[o],c<50&&(n[c]=n[c]*c/50),c>=e-51&&(n[c]=n[c]*f--/50),o+=this.option.channels;if(this.startTime<this.audioCtx.currentTime&&(this.startTime=this.audioCtx.currentTime),this.samples=new Float32Array,i.buffer=t,i.connect(this.gainNode),i.start(this.startTime),this.playingBufferNode=this.scheduledBufferNode,this.scheduledBufferNode=i,this.playingStartTime<0&&(this.playingStartTime=this.startTime),this.startTime+=t.duration,this.flag_request_stop)this.flag_request_stop=!1,i.onended=()=>{this.resetState(),this.onEnd&&this.onEnd()};else{const p=(this.startTime-this.audioCtx.currentTime)*1e3;this.ensuredSetTimeout(this.flush,p-50)}}};function M3(i,e){const t=new da(i),n=t.destroy.bind(t);let r=!1;return t.destroy=()=>{if(!r){r=!0;try{n()}catch{}}},t.setOnEnd(()=>{r||e()}),t._isDestroyed=()=>r,t}function C3({enableAudio:i,pcmOptions:e,log:t,onPlaybackComplete:n}){let r=null,o=null;function c(){if(!i||r)return r;const P={...MR,...e||{}};return r=M3(P,()=>{n()}),r}function f(){if(r){try{r.interrupt?.(),r.destroy?.()}catch{}r=null}}function p(P){const I=c();if(I)try{I.feed(P)}catch(U){t("feedAudio: player.feed() failed",U),n()}}function v(){if(!r){n();return}try{r.setRequestStop(),r.playingBufferNode||r.scheduledBufferNode||n()}catch(P){t("requestStop: setRequestStop() failed",P),n()}}function A(){f()}function S(){if(r)try{const P=r.audioCtx;P?.state==="running"&&P.suspend()}catch(P){t("pauseAudioPlayback: audioCtx.suspend() failed",P)}}async function b(){const P=c();if(P)try{const I=P.audioCtx;I?.state==="suspended"&&await I.resume()}catch(I){t("resumeAudioPlayback: audioCtx.resume() failed",I)}}function M(P){o=P||null}function k(){return o}function L(){return r?r._isDestroyed?.()??!0:!0}return{ensurePcmPlayer:c,destroyPcmPlayer:f,feedAudio:p,requestStop:v,interruptPlayback:A,pauseAudioPlayback:S,resumeAudioPlayback:b,attachAudioElement:M,getAudioElement:k,isDestroyed:L}}function k3(i){const{wsUrl:e,restUrl:t,enableAudio:n,pcmOptions:r,debug:o,withCredentials:c,onPlaybackComplete:f}=i,p=pe.useCallback((...b)=>{o&&console.log("[RqmiiSDK]",...b)},[o]),v=pe.useRef(null),A=pe.useRef(null),S=pe.useRef(null);return v.current||(v.current=E3({wsUrl:e,log:p})),A.current||(A.current=C3({enableAudio:n,pcmOptions:r,log:p,onPlaybackComplete:f})),S.current||(S.current=PR({restUrl:t,log:p,withCredentials:c})),pe.useEffect(()=>()=>{v.current?.cleanupSocket(),A.current?.destroyPcmPlayer()},[]),{socketMgrRef:v,audioMgrRef:A,sessionMgrRef:S,log:p}}function kx(i){return String(i||"").toLowerCase().replaceAll("-","_")}function R3(i){if(!i)return null;if(i instanceof Uint8Array)return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(typeof i=="object"&&i!==null){const e=i;if(e.buffer instanceof ArrayBuffer){const t=i,n=Number.isInteger(t.byteOffset)?t.byteOffset:0,r=Number.isInteger(t.byteLength)?t.byteLength:t.buffer.byteLength-n;return new Uint8Array(t.buffer,n,r)}if(e.type==="Buffer"&&Array.isArray(e.data))return new Uint8Array(e.data)}try{return new Uint8Array(i)}catch{return null}}function P3(i){const{socket:e,dispatch:t,stateRef:n,sessionIdRef:r,sessionAgentTypeRef:o,interruptedRef:c,manualDisconnectRef:f,chunkAccumulatorRef:p,clientToolsRef:v,audioMgrRef:A,enableAudio:S,cbRefs:b,eventsEmitter:M}=i,k=xc,L=A.current;e.on(k.DISCONNECT,P=>{if(t({type:"SET_CONNECTION_STATE",payload:Qr.IDLE}),t({type:"SET_SESSION_READY",payload:!1}),b.current.onDisconnect?.(P),P==="io server disconnect"||P==="io client disconnect"||f.current){t({type:"SET_CONNECTION_STATE",payload:Qr.ENDED});return}t({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),t({type:"SET_ERROR",payload:"Connection lost"})}),e.on(k.SESSION_READY,P=>{t({type:"SET_SESSION_READY",payload:!0}),t({type:"SET_ERROR",payload:null}),P?.agentType&&t({type:"UPDATE_SESSION",payload:{agentType:kx(P.agentType)}})}),e.on(k.SESSION_JOINED,()=>{t({type:"SET_SESSION_READY",payload:!0}),t({type:"SET_ERROR",payload:null})}),e.on(k.SESSION_TERMINATED,()=>{L.interruptPlayback(),t({type:"SET_AUDIO_PLAYING",payload:!1}),t({type:"SET_CONNECTION_STATE",payload:Qr.ENDED}),t({type:"SET_SESSION_READY",payload:!1}),b.current.onSessionTerminated?.(),e.disconnect()}),e.on(k.TRANSCRIPT,P=>{const I=P||null;t({type:"SET_TRANSCRIPT",payload:I}),I?.is_final&&I?.text?.trim()&&(t({type:"ADD_MESSAGE",payload:{id:`transcript-${Date.now()}`,role:"user",text:I.text.trim(),timestamp:new Date().toISOString()}}),t({type:"SET_PARTIAL_TRANSCRIPT",payload:null})),M.emit("transcript",I??void 0),M.emit("partial_transcript",void 0)}),e.on(k.PARTIAL_TRANSCRIPT,P=>{const I=typeof P=="string"?P:P?.text;if(typeof I=="string"&&I.length===0)return;const U=P||null;t({type:"SET_PARTIAL_TRANSCRIPT",payload:U}),M.emit("partial_transcript",U??void 0)}),e.on(k.AGENT_RESPONSE_CHUNK,P=>{const{id:I,text:U}=p.current.addChunk(P?.requestId,P?.text);t({type:"SET_MESSAGES",payload:[...n.current.messages.filter(W=>W.id!==I),{id:I,role:"assistant",text:U,streaming:!0,timestamp:new Date().toISOString()}]})}),e.on(k.AGENT_RESPONSE,P=>{const{id:I,text:U}=p.current.consume(P?.requestId,P?.text);t({type:"SET_MESSAGES",payload:[...n.current.messages.filter(W=>W.id!==I),{id:I,role:"assistant",text:U,streaming:!1,timestamp:new Date().toISOString()}]})}),e.on(k.AVATAR_SPEAKING,()=>{t({type:"SET_AVATAR_SPEAKING",payload:!0})}),e.on(k.AVATAR_SPEAKING_DONE,()=>{t({type:"SET_AVATAR_SPEAKING",payload:!1})}),e.on(k.AGENT_AUDIO_CHUNK,P=>{if(!S||c.current)return;const I=kx(o.current);if(I==="cloud_avatar"||I==="desktop_avatar"||I==="text")return;const U=R3(P?.audio);U&&(L.feedAudio(U),t({type:"SET_AUDIO_PLAYING",payload:!0}))}),e.on(k.AGENT_AUDIO_COMPLETE,()=>{if(!S)return;const P=kx(o.current);P==="cloud_avatar"||P==="desktop_avatar"||P==="text"||L.requestStop()}),e.on(k.INTERRUPTED,()=>{const P=!L.isDestroyed();c.current=!1,L.interruptPlayback(),t({type:"SET_AUDIO_PLAYING",payload:!1}),P&&e.connected&&e.emit(k.AUDIO_PLAYBACK_COMPLETE,{session_id:r.current})}),e.on(k.AUTH_ERROR,P=>{t({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),t({type:"SET_ERROR",payload:P?.message||"Authentication error"})}),e.on(k.ERROR,P=>{const I=P?.code;if(!(I==="TTS_ERROR"||I==="STT_ERROR"||I==="LLM_ERROR")){if(I==="INSUFFICIENT_CREDITS"){t({type:"SET_CREDIT_EXHAUSTED",payload:{exhausted:!0,error:P?.message||"Insufficient credits to process this request."}}),b.current.onError?.(P);return}t({type:"SET_ERROR",payload:P?.message||P?.detail||"Server error"}),b.current.onError?.(P)}}),e.on(k.SESSION_EXPIRED,P=>{t({type:"SET_CONNECTION_STATE",payload:Qr.ENDED}),t({type:"SET_SESSION_READY",payload:!1}),b.current.onSessionExpired?.(P)}),e.on(k.CREDITS_EXHAUSTED,()=>{t({type:"SET_CREDIT_EXHAUSTED",payload:{exhausted:!0,error:"This project has run out of credits."}}),t({type:"SET_CONNECTION_STATE",payload:Qr.ENDED}),t({type:"SET_SESSION_READY",payload:!1}),f.current=!0;try{e.disconnect()}catch{}}),e.on(k.SESSION_STATE_CHANGED,P=>{P?.state&&t({type:"SET_SESSION_STATE",payload:P.state})}),e.on(k.LANGUAGE_CHANGED,P=>{const I=P?.language;I&&M.emit("language_changed",{language:I})}),e.on(k.SHOW_LEAD_CAPTURE_FORM,P=>{const I=Array.isArray(P?.fields)?P.fields:[],U=P?.agentId;!U||I.length===0||t({type:"ADD_MESSAGE",payload:{id:`lead-form-${Date.now()}`,role:"lead_form",text:"",form:{agentId:U,title:P?.title,fields:I},timestamp:new Date().toISOString()}})}),e.on(k.MESSAGE_RATE_LIMITED,P=>{M.emit("message_rate_limited",P)}),e.on(k.CLIENT_TOOL_REQUEST,P=>{const I=P?.executionId,U=P?.toolName,W=P?.parameters??{},B=P?.waitForResponse!==!1;if(!U)return;const j=v.current[U];if(!j)return;const q={minimize:()=>M.emit("minimize_chat"),maximize:()=>M.emit("maximize_chat")};B&&I?j(W,q).then(_=>{e.emit(k.CLIENT_TOOL_RESULT,{executionId:I,result:_})}).catch(_=>{e.emit(k.CLIENT_TOOL_RESULT,{executionId:I,result:{error:_ instanceof Error?_.message:String(_)}})}):j(W,q).catch(()=>{})})}class I3{listeners=new Map;on(e,t){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(t),()=>this.off(e,t)}once(e,t){const n=((...r)=>{this.off(e,n),t(...r)});return this.on(e,n)}off(e,t){this.listeners.get(e)?.delete(t)}emit(e,t){const n=this.listeners.get(e);if(n)for(const r of n)try{r(t)}catch{}}removeAllListeners(){this.listeners.clear()}}function s1(){if(typeof window>"u")return;const i=window;i.__rqmii_orig_console||(i.__rqmii_orig_console={error:console.error,warn:console.warn,log:console.log,debug:console.debug});const e=i.__rqmii_orig_console,t=o=>{if(o.length===0)return!1;const c=String(o[0]);return c.includes("reading 'S'")||c.includes("reading 'state'")||c.includes("MicVAD has null stream")||c.includes("VAD |")||c.includes("audioCtx.state")||c.includes("using default audio context")};console.error=(...o)=>{t(o)||e.error.apply(console,o)},console.warn=(...o)=>{t(o)||e.warn.apply(console,o)},console.log=(...o)=>{t(o)||e.log.apply(console,o)},console.debug=(...o)=>{t(o)||e.debug.apply(console,o)};const n=i.onerror;i.onerror=function(o,c,f,p,v){const A=String(o);return A.includes("reading 'state'")||A.includes("reading 'S'")||A.includes("MicVAD has null stream")?!0:n?n(o,c,f,p,v):!1};const r=i.onunhandledrejection;i.onunhandledrejection=function(o){const c=String(o.reason&&o.reason.message?o.reason.message:o.reason);return c.includes("reading 'state'")||c.includes("reading 'S'")||c.includes("MicVAD has null stream")?(o.preventDefault(),!0):r?r.call(i,o):!1}}const a1=pe.createContext(null);function D3({children:i,wsUrl:e="wss://ws.rqmii.com",restUrl:t="https://api.rqmii.com",enableAudio:n=!0,pcmOptions:r,debug:o=!1,heartbeatIntervalSeconds:c=15,withCredentials:f=!1,onSessionExpired:p,onSessionTerminated:v,onError:A,onDisconnect:S}){const[b,M]=pe.useReducer(VS,fx),k=pe.useRef(b),L=pe.useCallback(yt=>{k.current=VS(k.current,yt),M(yt)},[]),P=pe.useRef(!1),I=pe.useRef(kR()),U=pe.useRef(null),W=pe.useRef(fx.session.agentType),B=pe.useRef(!1),j=pe.useRef(new I3),q=pe.useRef({}),_=pe.useRef({onSessionExpired:p,onSessionTerminated:v,onError:A,onDisconnect:S});pe.useEffect(()=>{s1(),_.current={onSessionExpired:p,onSessionTerminated:v,onError:A,onDisconnect:S}},[p,v,A,S]),pe.useEffect(()=>{W.current=b.session.agentType},[b.session.agentType]),pe.useEffect(()=>{U.current=b.session.sessionId},[b.session.sessionId]);const G=pe.useCallback(()=>{L({type:"SET_AUDIO_PLAYING",payload:!1});const yt=Z.current?.getSocket();yt?.connected&&yt.emit(xc.AUDIO_PLAYBACK_COMPLETE,{session_id:U.current})},[]),{socketMgrRef:Z,audioMgrRef:ie,sessionMgrRef:oe}=k3({wsUrl:e,restUrl:t,enableAudio:n,pcmOptions:r,debug:o,withCredentials:f,onPlaybackComplete:G}),ve=pe.useCallback(yt=>{P3({socket:yt,dispatch:L,stateRef:k,sessionIdRef:U,sessionAgentTypeRef:W,interruptedRef:B,manualDisconnectRef:P,chunkAccumulatorRef:I,clientToolsRef:q,audioMgrRef:{current:ie.current},enableAudio:n,cbRefs:_,eventsEmitter:j.current})},[n]),Se=pe.useCallback(({authPayload:yt,queryToken:be})=>new Promise((Kn,qn)=>{Z.current?.cleanupSocket();const de=Z.current.connectSocketRaw({authPayload:yt,queryToken:be});ve(de),de.once("connect",()=>{L({type:"SET_CONNECTION_STATE",payload:Qr.CONNECTED}),L({type:"SET_ERROR",payload:null}),Kn(de)}),de.once("connect_error",J=>{L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:J?.message||"Connection error"}),qn(J)})}),[ve]),Ne=pe.useCallback(({keepManualDisconnect:yt=!1}={})=>{P.current=!0,B.current=!1,I.current.clear(),ie.current.destroyPcmPlayer(),Z.current.cleanupSocket(),yt||(P.current=!1),L({type:"HARD_RESET"})},[]),Me=pe.useCallback(async({apiKey:yt,publicChatId:be,agentId:Kn,userId:qn,language:de="en",clientTools:J,config:Be}={})=>{if(!yt&&!be&&!Kn)throw new Error("Provide one of apiKey, publicChatId, or agentId");Ne(),q.current=J??{},L({type:"SET_CONNECTION_STATE",payload:Qr.INITIALIZING}),L({type:"SET_ERROR",payload:null});const Ye=RR();let at;try{at=await oe.current.initializeSession({apiKey:yt,publicChatId:be,agentId:Kn,userId:qn,language:de,timezone:Ye,config:Be})}catch(Bt){const lt=Bt;throw lt.status===401||lt.status===403?(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:lt.message||"Authentication failed"})):lt.status===402?(L({type:"SET_CREDIT_EXHAUSTED",payload:{exhausted:!0,error:lt.message||"Insufficient credits"}}),L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED})):lt.status===429?(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:lt.message||"Too many requests. Please try again later."})):(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:lt.message||"Failed to initialize session"})),Bt}const It=at;L({type:"UPDATE_SESSION",payload:{sessionId:It.session_id,agentType:It.streaming_url?eu.CLOUD_AVATAR:b.session.agentType,streamingUrl:It.streaming_url||null,uniqueId:It.unique_id||null}}),L({type:"SET_CONNECTION_STATE",payload:Qr.CONNECTING}),L({type:"SET_CLOUD_STREAM_STATE",payload:{state:It.streaming_url?xl.CONNECTING:xl.IDLE,error:null}}),P.current=!0;try{await Se({authPayload:{token:It.session_token},queryToken:It.session_token}),P.current=!1}catch(Bt){throw P.current=!1,Bt}return at},[Se,Ne,e,b.session.agentType]),Ae=pe.useCallback(async({uniqueId:yt})=>{if(!yt)throw new Error("uniqueId is required");Ne(),L({type:"SET_CONNECTION_STATE",payload:Qr.INITIALIZING}),L({type:"SET_ERROR",payload:null});let be;try{be=await oe.current.joinDesktopSession({uniqueId:yt})}catch(qn){const de=qn;throw(de.status===401||de.status===403)&&(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:de.message||"Authentication failed"})),de.status===402&&(L({type:"SET_CREDIT_EXHAUSTED",payload:{exhausted:!0,error:de.message||"Insufficient credits"}}),L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED})),de.status===429&&(L({type:"SET_CONNECTION_STATE",payload:Qr.FAILED}),L({type:"SET_ERROR",payload:de.message||"Too many requests. Please try again later."})),qn}const Kn=be;L({type:"UPDATE_SESSION",payload:{sessionId:Kn.session_id,uniqueId:yt,role:"user",agentType:eu.DESKTOP_AVATAR}}),L({type:"SET_CONNECTION_STATE",payload:Qr.CONNECTING}),L({type:"SET_CLOUD_STREAM_STATE",payload:{state:xl.IDLE,error:null}}),P.current=!0;try{await Se({authPayload:{token:Kn.session_token},queryToken:Kn.session_token}),P.current=!1}catch(qn){throw P.current=!1,qn}return be},[Se,Ne,e]),me=pe.useCallback(()=>Ne({keepManualDisconnect:!0}),[Ne]),fe=pe.useCallback(async()=>{const yt=Z.current?.getSocket();return yt&&b.isConnected&&(yt.emit("end_session"),await new Promise(be=>setTimeout(be,150))),me(),{success:!0}},[me,b.isConnected]),ke=pe.useCallback(()=>{const yt=Z.current?.getSocket();yt?.connected?yt.emit("end_session"):(L({type:"SET_CONNECTION_STATE",payload:Qr.ENDED}),L({type:"SET_SESSION_READY",payload:!1}))},[]),Ce=pe.useCallback((yt,be={})=>{const Kn=Z.current?.getSocket();return!Kn||!b.isConnected?!1:(Kn.emit(yt,be),!0)},[b.isConnected]),ce=pe.useCallback(yt=>!yt||!String(yt).trim()?!1:(L({type:"ADD_MESSAGE",payload:{id:`user-${Date.now()}`,role:"user",text:String(yt),timestamp:new Date().toISOString()}}),Ce(xc.USER_MESSAGE,{message:String(yt)})),[Ce]),ze=pe.useCallback((yt,be)=>{!be||!String(be).trim()||L({type:"ADD_MESSAGE",payload:{id:`${yt}-${Date.now()}`,role:yt,text:String(be),timestamp:new Date().toISOString()}})},[]),bt=pe.useCallback(yt=>!yt||!String(yt).trim()?!1:Ce(xc.USER_MESSAGE,{message:String(yt)}),[Ce]),Rt=pe.useCallback(yt=>Ce(xc.AUDIO_CHUNK,{audio:yt}),[Ce]),Ct=pe.useCallback(()=>Ce(xc.AUDIO_END,{}),[Ce]),He=pe.useCallback(()=>(B.current=!0,ie.current.interruptPlayback(),L({type:"SET_AUDIO_PLAYING",payload:!1}),Ce(xc.INTERRUPT,{})),[Ce]),gt=pe.useCallback(()=>Ce(xc.CLEAR_SESSION_HISTORY,{}),[Ce]),tt=pe.useCallback(yt=>yt?Ce(xc.CHANGE_SESSION_LANGUAGE,{language:yt}):!1,[Ce]),Lt=pe.useCallback((yt={})=>Ce(xc.CLIENT_READY,yt),[Ce]),Vt=pe.useCallback(()=>{I.current.clear(),L({type:"SET_MESSAGES",payload:[]})},[]),hn=pe.useCallback(yt=>{L({type:"SET_MESSAGES",payload:yt})},[]),Vn=pe.useCallback(()=>ie.current.resumeAudioPlayback(),[]),fn=pe.useCallback(()=>ie.current.pauseAudioPlayback(),[]),dt=pe.useCallback(yt=>ie.current.attachAudioElement(yt),[]),it=pe.useCallback((yt,be=null)=>{L({type:"SET_CLOUD_STREAM_STATE",payload:{state:yt,error:be?String(be):null}})},[]),ht=pe.useCallback(async yt=>{try{const be=await oe.current.fetchAgentConfig(yt);return L({type:"SET_AGENT_CONFIG",payload:be}),be}catch(be){throw L({type:"SET_AGENT_CONFIG",payload:null}),be}},[t]),Pt=pe.useCallback(yt=>{Object.keys(q.current).length===0?q.current=yt:Object.assign(q.current,yt)},[]),Gt=pe.useCallback(yt=>{const be=yt.sessionId||U.current;return be?oe.current.submitFeedback({sessionId:be,rating:yt.rating,feedback:yt.feedback,endedBy:yt.endedBy}):Promise.reject(new Error("No session id available for feedback"))},[]),Sn=pe.useCallback(yt=>{const be=yt.sessionId||U.current;return be?oe.current.submitLead({agentId:yt.agentId,sessionId:be,collectedData:yt.collectedData}):Promise.reject(new Error("No session id available for lead capture"))},[]),$t=pe.useMemo(()=>CR(b.sessionState),[b.sessionState]),yn=pe.useMemo(()=>({...b,...$t,initializeSession:Me,joinDesktopSession:Ae,disconnect:me,terminateSession:fe,endSession:ke,emit:Ce,sendTextMessage:ce,addLocalMessage:ze,emitUserMessage:bt,sendAudioChunk:Rt,endAudioStream:Ct,interrupt:He,clearSessionHistory:gt,changeSessionLanguage:tt,signalClientReady:Lt,clearMessages:Vt,setMessages:hn,resumeAudioPlayback:Vn,pauseAudioPlayback:fn,attachAudioElement:dt,fetchAgentConfig:ht,submitFeedback:Gt,submitLead:Sn,setCloudStreamState:it,registerClientTools:Pt,events:j.current,audioElement:ie.current?.getAudioElement()??null,socket:Z.current?.getSocket()??null}),[b,$t,Me,Ae,me,fe,ke,Ce,ce,ze,bt,Rt,Ct,He,gt,tt,Lt,Vt,hn,Vn,fn,dt,it,Pt,Gt,Sn]);return ge.jsx(a1.Provider,{value:yn,children:i})}function hp(){const i=pe.useContext(a1);if(!i)throw new Error("useRqmiiAgentContext must be used inside <RqmiiAgentProvider>");return i}function fp(){const i=hp();return{connectionState:i.connectionState,isConnected:i.isConnected,isSessionReady:i.isSessionReady,error:i.error,session:i.session,creditExhausted:i.creditExhausted,creditError:i.creditError,sessionState:i.sessionState,isSessionTerminated:i.isSessionTerminated,isSessionTerminating:i.isSessionTerminating,isAgentThinking:i.isAgentThinking,isAgentSpeaking:i.isAgentSpeaking,isToolExecuting:i.isToolExecuting,agentConfig:i.agentConfig,initializeSession:i.initializeSession,joinDesktopSession:i.joinDesktopSession,disconnect:i.disconnect,terminateSession:i.terminateSession,endSession:i.endSession,interrupt:i.interrupt,clearSessionHistory:i.clearSessionHistory,changeSessionLanguage:i.changeSessionLanguage,signalClientReady:i.signalClientReady,fetchAgentConfig:i.fetchAgentConfig,submitFeedback:i.submitFeedback,registerClientTools:i.registerClientTools,events:i.events}}function L3({connect:i=!0,session:e,onError:t,onInitialized:n,clientTools:r,children:o}){const{initializeSession:c,joinDesktopSession:f,disconnect:p,registerClientTools:v}=fp(),A=pe.useRef(!1),S=pe.useRef(!1),b=pe.useRef(c),M=pe.useRef(f),k=pe.useRef(p),L=pe.useRef(t),P=pe.useRef(n),I=pe.useRef(v),U=pe.useRef(r);return pe.useEffect(()=>{b.current=c}),pe.useEffect(()=>{M.current=f}),pe.useEffect(()=>{k.current=p}),pe.useEffect(()=>{L.current=t}),pe.useEffect(()=>{P.current=n}),pe.useEffect(()=>{I.current=v}),pe.useEffect(()=>{U.current=r}),pe.useEffect(()=>{if(!i||A.current)return;A.current=!0,S.current=!1;let W=!1;return(async()=>{try{const j=U.current;if(e?.mode==="join_desktop"){const _=await M.current({uniqueId:e.uniqueId});W||(j&&I.current(j),P.current?.(_));return}const q=await b.current({apiKey:e?.apiKey,publicChatId:e?.publicChatId,agentId:e?.agentId,language:e?.language||"en",config:e?.config,clientTools:j});W||P.current?.(q)}catch(j){W||(S.current=!0,L.current?.(j))}})(),()=>{W=!0,!S.current&&(k.current(),A.current=!1)}},[i,e]),ge.jsx(ge.Fragment,{children:o})}function N3({children:i,wsUrl:e,restUrl:t,session:n,connect:r=!0,enableAudio:o=!0,pcmOptions:c,debug:f=!1,withCredentials:p=!1,onError:v,onInitialized:A,clientTools:S}){return ge.jsx(D3,{wsUrl:e,restUrl:t,enableAudio:o,pcmOptions:c,debug:f,withCredentials:p,children:ge.jsx(L3,{connect:r,session:n,onError:v,onInitialized:A,clientTools:S,children:i})})}var Rx={exports:{}},o1;function z3(){return o1||(o1=1,(function(i){const e={};e.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
42
42
  `).map(n=>n.trim())},e.splitSections=function(t){return t.split(`
43
43
  m=`).map((r,o)=>(o>0?"m="+r:r).trim()+`\r
44
44
  `)},e.getDescription=function(t){const n=e.splitSections(t);return n&&n[0]},e.getMediaSections=function(t){const n=e.splitSections(t);return n.shift(),n},e.matchPrefix=function(t,n){return e.splitLines(t).filter(r=>r.indexOf(n)===0)},e.parseCandidate=function(t){let n;t.indexOf("a=candidate:")===0?n=t.substring(12).split(" "):n=t.substring(10).split(" ");const r={foundation:n[0],component:{1:"rtp",2:"rtcp"}[n[1]]||n[1],protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]};for(let o=8;o<n.length;o+=2)switch(n[o]){case"raddr":r.relatedAddress=n[o+1];break;case"rport":r.relatedPort=parseInt(n[o+1],10);break;case"tcptype":r.tcpType=n[o+1];break;case"ufrag":r.ufrag=n[o+1],r.usernameFragment=n[o+1];break;default:r[n[o]]===void 0&&(r[n[o]]=n[o+1]);break}return r},e.writeCandidate=function(t){const n=[];n.push(t.foundation);const r=t.component;r==="rtp"?n.push(1):r==="rtcp"?n.push(2):n.push(r),n.push(t.protocol.toUpperCase()),n.push(t.priority),n.push(t.address||t.ip),n.push(t.port);const o=t.type;return n.push("typ"),n.push(o),o!=="host"&&t.relatedAddress&&t.relatedPort!==void 0&&(n.push("raddr"),n.push(t.relatedAddress),n.push("rport"),n.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(n.push("ufrag"),n.push(t.usernameFragment||t.ufrag)),"candidate:"+n.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){let n=t.substring(9).split(" ");const r={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),r.name=n[0],r.clockRate=parseInt(n[1],10),r.channels=n.length===3?parseInt(n[2],10):1,r.numChannels=r.channels,r},e.writeRtpMap=function(t){let n=t.payloadType;t.preferredPayloadType!==void 0&&(n=t.preferredPayloadType);const r=t.channels||t.numChannels||1;return"a=rtpmap:"+n+" "+t.name+"/"+t.clockRate+(r!==1?"/"+r:"")+`\r