From 3cff250ba03b4869333566128d45cc9c68b9b956 Mon Sep 17 00:00:00 2001 From: legop3 Date: Sun, 7 Jun 2026 16:39:50 -0400 Subject: [PATCH] better bettter replayses --- server/package.json | 1 + server/public/assets/index-BysYkDl7.js | 126 ++++++ server/public/assets/index-DaajoH22.css | 1 - server/public/assets/index-Dr65gZI2.css | 1 + server/public/assets/index-DyBCFpEY.js | 126 ------ server/public/index.html | 4 +- .../services/discordBotService/channelIO.js | 7 +- .../discordBotService/commands/replay.js | 198 +++++---- .../src/services/discordBotService/index.js | 2 + .../integrations/busEvents.js | 129 +++--- .../discordBotService/replayWorkflow.js | 385 ++++++++++++++++++ .../services/replayEngineV2/socketHooks.js | 13 +- webui/src/App.jsx | 6 +- .../ReplaySourcesPanel/ReplayReadyPopup.jsx | 71 ++++ .../components/ReplaySourcesPanel/index.jsx | 52 ++- webui/src/context/SessionContext.jsx | 76 ++++ 16 files changed, 888 insertions(+), 310 deletions(-) create mode 100644 server/public/assets/index-BysYkDl7.js delete mode 100644 server/public/assets/index-DaajoH22.css create mode 100644 server/public/assets/index-Dr65gZI2.css delete mode 100644 server/public/assets/index-DyBCFpEY.js create mode 100644 server/src/services/discordBotService/replayWorkflow.js create mode 100644 webui/src/components/ReplaySourcesPanel/ReplayReadyPopup.jsx diff --git a/server/package.json b/server/package.json index fb36c9de..ef908fe4 100644 --- a/server/package.json +++ b/server/package.json @@ -11,6 +11,7 @@ "bcrypt": "^6.0.0", "discord.js": "^14.25.1", "express": "^4.19.2", + "fuse.js": "^7.4.2", "home-assistant-js-websocket": "^3.1.2", "js-yaml": "^4.1.1", "morgan": "^1.10.0", diff --git a/server/public/assets/index-BysYkDl7.js b/server/public/assets/index-BysYkDl7.js new file mode 100644 index 00000000..9c219990 --- /dev/null +++ b/server/public/assets/index-BysYkDl7.js @@ -0,0 +1,126 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OrbitControls-BJ-UXxdt.js","assets/three.module--MGUDD-H.js"])))=>i.map(i=>d[i]); +(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))o(h);new MutationObserver(h=>{for(const f of h)if(f.type==="childList")for(const v of f.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&o(v)}).observe(document,{childList:!0,subtree:!0});function l(h){const f={};return h.integrity&&(f.integrity=h.integrity),h.referrerPolicy&&(f.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?f.credentials="include":h.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function o(h){if(h.ep)return;h.ep=!0;const f=l(h);fetch(h.href,f)}})();function hd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ne={exports:{}},i8={};var qr;function dd(){if(qr)return i8;qr=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function l(o,h,f){var v=null;if(f!==void 0&&(v=""+f),h.key!==void 0&&(v=""+h.key),"key"in h){f={};for(var p in h)p!=="key"&&(f[p]=h[p])}else f=h;return h=f.ref,{$$typeof:t,type:o,key:v,ref:h!==void 0?h:null,props:f}}return i8.Fragment=n,i8.jsx=l,i8.jsxs=l,i8}var Dr;function fd(){return Dr||(Dr=1,ne.exports=dd()),ne.exports}var r=fd(),le={exports:{}},N1={};var Or;function md(){if(Or)return N1;Or=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),v=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),y=Symbol.iterator;function C(N){return N===null||typeof N!="object"?null:(N=y&&N[y]||N["@@iterator"],typeof N=="function"?N:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function H(N,q,X){this.props=N,this.context=q,this.refs=w,this.updater=X||A}H.prototype.isReactComponent={},H.prototype.setState=function(N,q){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,q,"setState")},H.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function j(){}j.prototype=H.prototype;function L(N,q,X){this.props=N,this.context=q,this.refs=w,this.updater=X||A}var B=L.prototype=new j;B.constructor=L,S(B,H.prototype),B.isPureReactComponent=!0;var T=Array.isArray;function E(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function O(N,q,X){var l1=X.ref;return{$$typeof:t,type:N,key:q,ref:l1!==void 0?l1:null,props:X}}function $(N,q){return O(N.type,q,N.props)}function I(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function Q(N){var q={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(X){return q[X]})}var o1=/\/+/g;function h1(N,q){return typeof N=="object"&&N!==null&&N.key!=null?Q(""+N.key):q.toString(36)}function t1(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(E,E):(N.status="pending",N.then(function(q){N.status==="pending"&&(N.status="fulfilled",N.value=q)},function(q){N.status==="pending"&&(N.status="rejected",N.reason=q)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function F(N,q,X,l1,g1){var y1=typeof N;(y1==="undefined"||y1==="boolean")&&(N=null);var z1=!1;if(N===null)z1=!0;else switch(y1){case"bigint":case"string":case"number":z1=!0;break;case"object":switch(N.$$typeof){case t:case n:z1=!0;break;case g:return z1=N._init,F(z1(N._payload),q,X,l1,g1)}}if(z1)return g1=g1(N),z1=l1===""?"."+h1(N,0):l1,T(g1)?(X="",z1!=null&&(X=z1.replace(o1,"$&/")+"/"),F(g1,q,X,"",function(e1){return e1})):g1!=null&&(I(g1)&&(g1=$(g1,X+(g1.key==null||N&&N.key===g1.key?"":(""+g1.key).replace(o1,"$&/")+"/")+z1)),q.push(g1)),1;z1=0;var F1=l1===""?".":l1+":";if(T(N))for(var f1=0;f1>>1,i1=F[W];if(0>>1;Wh(X,Z))l1h(g1,X)?(F[W]=g1,F[l1]=Z,W=l1):(F[W]=X,F[q]=Z,W=q);else if(l1h(g1,Z))F[W]=g1,F[l1]=Z,W=l1;else break t}}return _}function h(F,_){var Z=F.sortIndex-_.sortIndex;return Z!==0?Z:F.id-_.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;t.unstable_now=function(){return f.now()}}else{var v=Date,p=v.now();t.unstable_now=function(){return v.now()-p}}var z=[],x=[],g=1,M=null,y=3,C=!1,A=!1,S=!1,w=!1,H=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function B(F){for(var _=l(x);_!==null;){if(_.callback===null)o(x);else if(_.startTime<=F)o(x),_.sortIndex=_.expirationTime,n(z,_);else break;_=l(x)}}function T(F){if(S=!1,B(F),!A)if(l(z)!==null)A=!0,E||(E=!0,Q());else{var _=l(x);_!==null&&t1(T,_.startTime-F)}}var E=!1,R=-1,k=5,O=-1;function $(){return w?!0:!(t.unstable_now()-OF&&$());){var W=M.callback;if(typeof W=="function"){M.callback=null,y=M.priorityLevel;var i1=W(M.expirationTime<=F);if(F=t.unstable_now(),typeof i1=="function"){M.callback=i1,B(F),_=!0;break e}M===l(z)&&o(z),B(F)}else o(z);M=l(z)}if(M!==null)_=!0;else{var N=l(x);N!==null&&t1(T,N.startTime-F),_=!1}}break t}finally{M=null,y=Z,C=!1}_=void 0}}finally{_?Q():E=!1}}}var Q;if(typeof L=="function")Q=function(){L(I)};else if(typeof MessageChannel<"u"){var o1=new MessageChannel,h1=o1.port2;o1.port1.onmessage=I,Q=function(){h1.postMessage(null)}}else Q=function(){H(I,0)};function t1(F,_){R=H(function(){F(t.unstable_now())},_)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_forceFrameRate=function(F){0>F||125W?(F.sortIndex=Z,n(x,F),l(z)===null&&F===l(x)&&(S?(j(R),R=-1):S=!0,t1(T,Z-W))):(F.sortIndex=i1,n(z,F),A||C||(A=!0,E||(E=!0,Q()))),F},t.unstable_shouldYield=$,t.unstable_wrapCallback=function(F){var _=y;return function(){var Z=y;y=_;try{return F.apply(this,arguments)}finally{y=Z}}}})(se)),se}var Zr;function pd(){return Zr||(Zr=1,ie.exports=vd()),ie.exports}var oe={exports:{}},O2={};var $r;function gd(){if($r)return O2;$r=1;var t=lc();function n(z){var x="https://react.dev/errors/"+z;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),oe.exports=gd(),oe.exports}var Ir;function zd(){if(Ir)return s8;Ir=1;var t=pd(),n=lc(),l=xd();function o(e){var c="https://react.dev/errors/"+e;if(1i1||(e.current=W[i1],W[i1]=null,i1--)}function X(e,c){i1++,W[i1]=e.current,e.current=c}var l1=N(null),g1=N(null),y1=N(null),z1=N(null);function F1(e,c){switch(X(y1,c),X(g1,e),X(l1,null),c.nodeType){case 9:case 11:e=(e=c.documentElement)&&(e=e.namespaceURI)?ir(e):0;break;default:if(e=c.tagName,c=c.namespaceURI)c=ir(c),e=sr(c,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(l1),X(l1,e)}function f1(){q(l1),q(g1),q(y1)}function e1(e){e.memoizedState!==null&&X(z1,e);var c=l1.current,a=sr(c,e.type);c!==a&&(X(g1,e),X(l1,a))}function x1(e){g1.current===e&&(q(l1),q(g1)),z1.current===e&&(q(z1),a8._currentValue=Z)}var p1,B1;function E1(e){if(p1===void 0)try{throw Error()}catch(a){var c=a.stack.trim().match(/\n( *(at )?)/);p1=c&&c[1]||"",B1=-1)":-1u||D[s]!==Y[u]){var c1=` +`+D[s].replace(" at new "," at ");return e.displayName&&c1.includes("")&&(c1=c1.replace("",e.displayName)),c1}while(1<=s&&0<=u);break}}}finally{b1=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?E1(a):""}function K1(e,c){switch(e.tag){case 26:case 27:case 5:return E1(e.type);case 16:return E1("Lazy");case 13:return e.child!==c&&c!==null?E1("Suspense Fallback"):E1("Suspense");case 19:return E1("SuspenseList");case 0:case 15:return S1(e.type,!1);case 11:return S1(e.type.render,!1);case 1:return S1(e.type,!0);case 31:return E1("Activity");default:return""}}function L2(e){try{var c="",a=null;do c+=K1(e,a),a=e,e=e.return;while(e);return c}catch(s){return` +Error generating stack: `+s.message+` +`+s.stack}}var s1=Object.prototype.hasOwnProperty,r1=t.unstable_scheduleCallback,m1=t.unstable_cancelCallback,w1=t.unstable_shouldYield,D1=t.unstable_requestPaint,A1=t.unstable_now,r2=t.unstable_getCurrentPriorityLevel,e2=t.unstable_ImmediatePriority,I1=t.unstable_UserBlockingPriority,A2=t.unstable_NormalPriority,d1=t.unstable_LowPriority,v1=t.unstable_IdlePriority,X1=t.log,p0=t.unstable_setDisableYieldValue,q3=null,D2=null;function j4(e){if(typeof X1=="function"&&p0(e),D2&&typeof D2.setStrictMode=="function")try{D2.setStrictMode(q3,e)}catch{}}var C1=Math.clz32?Math.clz32:G1,i2=Math.log,s2=Math.LN2;function G1(e){return e>>>=0,e===0?32:31-(i2(e)/s2|0)|0}var J1=256,G2=262144,F4=4194304;function o4(e){var c=e&42;if(c!==0)return c;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function v2(e,c,a){var s=e.pendingLanes;if(s===0)return 0;var u=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var V=s&134217727;return V!==0?(s=V&~d,s!==0?u=o4(s):(b&=V,b!==0?u=o4(b):a||(a=V&~e,a!==0&&(u=o4(a))))):(V=s&~d,V!==0?u=o4(V):b!==0?u=o4(b):a||(a=s&~e,a!==0&&(u=o4(a)))),u===0?0:c!==0&&c!==u&&(c&d)===0&&(d=u&-u,a=c&-c,d>=a||d===32&&(a&4194048)!==0)?c:u}function C4(e,c){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&c)===0}function Jo(e,c){switch(e){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32: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 c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _c(){var e=F4;return F4<<=1,(F4&62914560)===0&&(F4=4194304),e}function I7(e){for(var c=[],a=0;31>a;a++)c.push(e);return c}function g0(e,c){e.pendingLanes|=c,c!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Wo(e,c,a,s,u,d){var b=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var V=e.entanglements,D=e.expirationTimes,Y=e.hiddenUpdates;for(a=b&~a;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var lu=/[\n"\\]/g;function h4(e){return e.replace(lu,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function J7(e,c,a,s,u,d,b,V){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),c!=null?b==="number"?(c===0&&e.value===""||e.value!=c)&&(e.value=""+u4(c)):e.value!==""+u4(c)&&(e.value=""+u4(c)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),c!=null?W7(e,b,u4(c)):a!=null?W7(e,b,u4(a)):s!=null&&e.removeAttribute("value"),u==null&&d!=null&&(e.defaultChecked=!!d),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),V!=null&&typeof V!="function"&&typeof V!="symbol"&&typeof V!="boolean"?e.name=""+u4(V):e.removeAttribute("name")}function ta(e,c,a,s,u,d,b,V){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),c!=null||a!=null){if(!(d!=="submit"&&d!=="reset"||c!=null)){X7(e);return}a=a!=null?""+u4(a):"",c=c!=null?""+u4(c):a,V||c===e.value||(e.value=c),e.defaultValue=c}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=V?e.checked:!!s,e.defaultChecked=!!s,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),X7(e)}function W7(e,c,a){c==="number"&&R8(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function p6(e,c,a,s){if(e=e.options,c){c={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nt=!1;if(U4)try{var b0={};Object.defineProperty(b0,"passive",{get:function(){nt=!0}}),window.addEventListener("test",b0,b0),window.removeEventListener("test",b0,b0)}catch{nt=!1}var d3=null,lt=null,T8=null;function ia(){if(T8)return T8;var e,c=lt,a=c.length,s,u="value"in d3?d3.value:d3.textContent,d=u.length;for(e=0;e=w0),fa=" ",ma=!1;function va(e,c){switch(e){case"keyup":return Nu.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pa(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var M6=!1;function Ru(e,c){switch(e){case"compositionend":return pa(c);case"keypress":return c.which!==32?null:(ma=!0,fa);case"textInput":return e=c.data,e===fa&&ma?null:e;default:return null}}function Eu(e,c){if(M6)return e==="compositionend"||!ut&&va(e,c)?(e=ia(),T8=lt=d3=null,M6=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:a,offset:c-e};e=s}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=wa(a)}}function Sa(e,c){return e&&c?e===c?!0:e&&e.nodeType===3?!1:c&&c.nodeType===3?Sa(e,c.parentNode):"contains"in e?e.contains(c):e.compareDocumentPosition?!!(e.compareDocumentPosition(c)&16):!1:!1}function Va(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var c=R8(e.document);c instanceof e.HTMLIFrameElement;){try{var a=typeof c.contentWindow.location.href=="string"}catch{a=!1}if(a)e=c.contentWindow;else break;c=R8(e.document)}return c}function ft(e){var c=e&&e.nodeName&&e.nodeName.toLowerCase();return c&&(c==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||c==="textarea"||e.contentEditable==="true")}var $u=U4&&"documentMode"in document&&11>=document.documentMode,b6=null,mt=null,L0=null,vt=!1;function La(e,c,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;vt||b6==null||b6!==R8(s)||(s=b6,"selectionStart"in s&&ft(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),L0&&V0(L0,s)||(L0=s,s=B5(mt,"onSelect"),0>=b,u-=b,N4=1<<32-C1(c)+u|a<T1?(Z1=H1,H1=null):Z1=H1.sibling;var Y1=K(G,H1,P[T1],a1);if(Y1===null){H1===null&&(H1=Z1);break}e&&H1&&Y1.alternate===null&&c(G,H1),U=d(Y1,U,T1),P1===null?V1=Y1:P1.sibling=Y1,P1=Y1,H1=Z1}if(T1===P.length)return a(G,H1),$1&&$4(G,T1),V1;if(H1===null){for(;T1T1?(Z1=H1,H1=null):Z1=H1.sibling;var k3=K(G,H1,Y1.value,a1);if(k3===null){H1===null&&(H1=Z1);break}e&&H1&&k3.alternate===null&&c(G,H1),U=d(k3,U,T1),P1===null?V1=k3:P1.sibling=k3,P1=k3,H1=Z1}if(Y1.done)return a(G,H1),$1&&$4(G,T1),V1;if(H1===null){for(;!Y1.done;T1++,Y1=P.next())Y1=n1(G,Y1.value,a1),Y1!==null&&(U=d(Y1,U,T1),P1===null?V1=Y1:P1.sibling=Y1,P1=Y1);return $1&&$4(G,T1),V1}for(H1=s(H1);!Y1.done;T1++,Y1=P.next())Y1=J(H1,G,T1,Y1.value,a1),Y1!==null&&(e&&Y1.alternate!==null&&H1.delete(Y1.key===null?T1:Y1.key),U=d(Y1,U,T1),P1===null?V1=Y1:P1.sibling=Y1,P1=Y1);return e&&H1.forEach(function(ud){return c(G,ud)}),$1&&$4(G,T1),V1}function n2(G,U,P,a1){if(typeof P=="object"&&P!==null&&P.type===S&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case C:t:{for(var V1=P.key;U!==null;){if(U.key===V1){if(V1=P.type,V1===S){if(U.tag===7){a(G,U.sibling),a1=u(U,P.props.children),a1.return=G,G=a1;break t}}else if(U.elementType===V1||typeof V1=="object"&&V1!==null&&V1.$$typeof===k&&Q3(V1)===U.type){a(G,U.sibling),a1=u(U,P.props),k0(a1,P),a1.return=G,G=a1;break t}a(G,U);break}else c(G,U);U=U.sibling}P.type===S?(a1=$3(P.props.children,G.mode,a1,P.key),a1.return=G,G=a1):(a1=P8(P.type,P.key,P.props,null,G.mode,a1),k0(a1,P),a1.return=G,G=a1)}return b(G);case A:t:{for(V1=P.key;U!==null;){if(U.key===V1)if(U.tag===4&&U.stateNode.containerInfo===P.containerInfo&&U.stateNode.implementation===P.implementation){a(G,U.sibling),a1=u(U,P.children||[]),a1.return=G,G=a1;break t}else{a(G,U);break}else c(G,U);U=U.sibling}a1=yt(P,G.mode,a1),a1.return=G,G=a1}return b(G);case k:return P=Q3(P),n2(G,U,P,a1)}if(t1(P))return M1(G,U,P,a1);if(Q(P)){if(V1=Q(P),typeof V1!="function")throw Error(o(150));return P=V1.call(P),L1(G,U,P,a1)}if(typeof P.then=="function")return n2(G,U,t5(P),a1);if(P.$$typeof===L)return n2(G,U,K8(G,P),a1);e5(G,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,U!==null&&U.tag===6?(a(G,U.sibling),a1=u(U,P),a1.return=G,G=a1):(a(G,U),a1=bt(P,G.mode,a1),a1.return=G,G=a1),b(G)):a(G,U)}return function(G,U,P,a1){try{N0=0;var V1=n2(G,U,P,a1);return F6=null,V1}catch(H1){if(H1===j6||H1===J8)throw H1;var P1=e4(29,H1,null,G.mode);return P1.lanes=a1,P1.return=G,P1}finally{}}}var X3=Xa(!0),Ja=Xa(!1),g3=!1;function kt(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rt(e,c){e=e.updateQueue,c.updateQueue===e&&(c.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function x3(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function z3(e,c,a){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Q1&2)!==0){var u=s.pending;return u===null?c.next=c:(c.next=u.next,u.next=c),s.pending=c,c=I8(e),Ra(e,null,a),c}return G8(e,s,c,a),I8(e)}function R0(e,c,a){if(c=c.updateQueue,c!==null&&(c=c.shared,(a&4194048)!==0)){var s=c.lanes;s&=e.pendingLanes,a|=s,c.lanes=a,Zc(e,a)}}function Et(e,c){var a=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var u=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?u=d=b:d=d.next=b,a=a.next}while(a!==null);d===null?u=d=c:d=d.next=c}else u=d=c;a={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=c:e.next=c,a.lastBaseUpdate=c}var Tt=!1;function E0(){if(Tt){var e=B6;if(e!==null)throw e}}function T0(e,c,a,s){Tt=!1;var u=e.updateQueue;g3=!1;var d=u.firstBaseUpdate,b=u.lastBaseUpdate,V=u.shared.pending;if(V!==null){u.shared.pending=null;var D=V,Y=D.next;D.next=null,b===null?d=Y:b.next=Y,b=D;var c1=e.alternate;c1!==null&&(c1=c1.updateQueue,V=c1.lastBaseUpdate,V!==b&&(V===null?c1.firstBaseUpdate=Y:V.next=Y,c1.lastBaseUpdate=D))}if(d!==null){var n1=u.baseState;b=0,c1=Y=D=null,V=d;do{var K=V.lane&-536870913,J=K!==V.lane;if(J?(U1&K)===K:(s&K)===K){K!==0&&K===A6&&(Tt=!0),c1!==null&&(c1=c1.next={lane:0,tag:V.tag,payload:V.payload,callback:null,next:null});t:{var M1=e,L1=V;K=c;var n2=a;switch(L1.tag){case 1:if(M1=L1.payload,typeof M1=="function"){n1=M1.call(n2,n1,K);break t}n1=M1;break t;case 3:M1.flags=M1.flags&-65537|128;case 0:if(M1=L1.payload,K=typeof M1=="function"?M1.call(n2,n1,K):M1,K==null)break t;n1=M({},n1,K);break t;case 2:g3=!0}}K=V.callback,K!==null&&(e.flags|=64,J&&(e.flags|=8192),J=u.callbacks,J===null?u.callbacks=[K]:J.push(K))}else J={lane:K,tag:V.tag,payload:V.payload,callback:V.callback,next:null},c1===null?(Y=c1=J,D=n1):c1=c1.next=J,b|=K;if(V=V.next,V===null){if(V=u.shared.pending,V===null)break;J=V,V=J.next,J.next=null,u.lastBaseUpdate=J,u.shared.pending=null}}while(!0);c1===null&&(D=n1),u.baseState=D,u.firstBaseUpdate=Y,u.lastBaseUpdate=c1,d===null&&(u.shared.lanes=0),w3|=b,e.lanes=b,e.memoizedState=n1}}function Wa(e,c){if(typeof e!="function")throw Error(o(191,e));e.call(c)}function tn(e,c){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;ed?d:8;var b=F.T,V={};F.T=V,c9(e,!1,c,a);try{var D=u(),Y=F.S;if(Y!==null&&Y(V,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var c1=Wu(D,s);O0(e,c,c1,r4(e))}else O0(e,c,s,r4(e))}catch(n1){O0(e,c,{then:function(){},status:"rejected",reason:n1},r4())}finally{_.p=d,b!==null&&V.types!==null&&(b.types=V.types),F.T=b}}function lh(){}function t9(e,c,a,s){if(e.tag!==5)throw Error(o(476));var u=Nn(e).queue;Fn(e,u,c,Z,a===null?lh:function(){return kn(e),a(s)})}function Nn(e){var c=e.memoizedState;if(c!==null)return c;c={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Y4,lastRenderedState:Z},next:null};var a={};return c.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Y4,lastRenderedState:a},next:null},e.memoizedState=c,e=e.alternate,e!==null&&(e.memoizedState=c),c}function kn(e){var c=Nn(e);c.next===null&&(c=e.alternate.memoizedState),O0(e,c.next.queue,{},r4())}function e9(){return E2(a8)}function Rn(){return z2().memoizedState}function En(){return z2().memoizedState}function rh(e){for(var c=e.return;c!==null;){switch(c.tag){case 24:case 3:var a=r4();e=x3(a);var s=z3(c,e,a);s!==null&&(J2(s,c,a),R0(s,c,a)),c={cache:Bt()},e.payload=c;return}c=c.return}}function ih(e,c,a){var s=r4();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},h5(e)?qn(c,a):(a=zt(e,c,a,s),a!==null&&(J2(a,e,s),Dn(a,c,s)))}function Tn(e,c,a){var s=r4();O0(e,c,a,s)}function O0(e,c,a,s){var u={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(h5(e))qn(c,u);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=c.lastRenderedReducer,d!==null))try{var b=c.lastRenderedState,V=d(b,a);if(u.hasEagerState=!0,u.eagerState=V,t4(V,b))return G8(e,c,u,0),l2===null&&$8(),!1}catch{}finally{}if(a=zt(e,c,u,s),a!==null)return J2(a,e,s),Dn(a,c,s),!0}return!1}function c9(e,c,a,s){if(s={lane:2,revertLane:k9(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},h5(e)){if(c)throw Error(o(479))}else c=zt(e,a,s,2),c!==null&&J2(c,e,2)}function h5(e){var c=e.alternate;return e===k1||c!==null&&c===k1}function qn(e,c){k6=n5=!0;var a=e.pending;a===null?c.next=c:(c.next=a.next,a.next=c),e.pending=c}function Dn(e,c,a){if((a&4194048)!==0){var s=c.lanes;s&=e.pendingLanes,a|=s,c.lanes=a,Zc(e,a)}}var _0={readContext:E2,use:i5,useCallback:p2,useContext:p2,useEffect:p2,useImperativeHandle:p2,useLayoutEffect:p2,useInsertionEffect:p2,useMemo:p2,useReducer:p2,useRef:p2,useState:p2,useDebugValue:p2,useDeferredValue:p2,useTransition:p2,useSyncExternalStore:p2,useId:p2,useHostTransitionStatus:p2,useFormState:p2,useActionState:p2,useOptimistic:p2,useMemoCache:p2,useCacheRefresh:p2};_0.useEffectEvent=p2;var On={readContext:E2,use:i5,useCallback:function(e,c){return Z2().memoizedState=[e,c===void 0?null:c],e},useContext:E2,useEffect:Cn,useImperativeHandle:function(e,c,a){a=a!=null?a.concat([e]):null,o5(4194308,4,Vn.bind(null,c,e),a)},useLayoutEffect:function(e,c){return o5(4194308,4,e,c)},useInsertionEffect:function(e,c){o5(4,2,e,c)},useMemo:function(e,c){var a=Z2();c=c===void 0?null:c;var s=e();if(J3){j4(!0);try{e()}finally{j4(!1)}}return a.memoizedState=[s,c],s},useReducer:function(e,c,a){var s=Z2();if(a!==void 0){var u=a(c);if(J3){j4(!0);try{a(c)}finally{j4(!1)}}}else u=c;return s.memoizedState=s.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},s.queue=e,e=e.dispatch=ih.bind(null,k1,e),[s.memoizedState,e]},useRef:function(e){var c=Z2();return e={current:e},c.memoizedState=e},useState:function(e){e=Qt(e);var c=e.queue,a=Tn.bind(null,k1,c);return c.dispatch=a,[e.memoizedState,a]},useDebugValue:Jt,useDeferredValue:function(e,c){var a=Z2();return Wt(a,e,c)},useTransition:function(){var e=Qt(!1);return e=Fn.bind(null,k1,e.queue,!0,!1),Z2().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,c,a){var s=k1,u=Z2();if($1){if(a===void 0)throw Error(o(407));a=a()}else{if(a=c(),l2===null)throw Error(o(349));(U1&127)!==0||rn(s,c,a)}u.memoizedState=a;var d={value:a,getSnapshot:c};return u.queue=d,Cn(on.bind(null,s,d,e),[e]),s.flags|=2048,E6(9,{destroy:void 0},sn.bind(null,s,d,a,c),null),a},useId:function(){var e=Z2(),c=l2.identifierPrefix;if($1){var a=k4,s=N4;a=(s&~(1<<32-C1(s)-1)).toString(32)+a,c="_"+c+"R_"+a,a=l5++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?b.createElement(u,{is:s.is}):b.createElement(u)}}d[k2]=c,d[I2]=s;t:for(b=c.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===c)break t;for(;b.sibling===null;){if(b.return===null||b.return===c)break t;b=b.return}b.sibling.return=b.return,b=b.sibling}c.stateNode=d;t:switch(q2(d,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break t;case"img":s=!0;break t;default:s=!1}s&&K4(c)}}return u2(c),p9(c,c.type,e===null?null:e.memoizedProps,c.pendingProps,a),null;case 6:if(e&&c.stateNode!=null)e.memoizedProps!==s&&K4(c);else{if(typeof s!="string"&&c.stateNode===null)throw Error(o(166));if(e=y1.current,V6(c)){if(e=c.stateNode,a=c.memoizedProps,s=null,u=R2,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}e[k2]=c,e=!!(e.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||lr(e.nodeValue,a)),e||v3(c,!0)}else e=j5(e).createTextNode(s),e[k2]=c,c.stateNode=e}return u2(c),null;case 31:if(a=c.memoizedState,e===null||e.memoizedState!==null){if(s=V6(c),a!==null){if(e===null){if(!s)throw Error(o(318));if(e=c.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[k2]=c}else G3(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;u2(c),e=!1}else a=St(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return c.flags&256?(a4(c),c):(a4(c),null);if((c.flags&128)!==0)throw Error(o(558))}return u2(c),null;case 13:if(s=c.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=V6(c),s!==null&&s.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=c.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[k2]=c}else G3(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;u2(c),u=!1}else u=St(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return c.flags&256?(a4(c),c):(a4(c),null)}return a4(c),(c.flags&128)!==0?(c.lanes=a,c):(a=s!==null,e=e!==null&&e.memoizedState!==null,a&&(s=c.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==u&&(s.flags|=2048)),a!==e&&a&&(c.child.flags|=8192),p5(c,c.updateQueue),u2(c),null);case 4:return f1(),e===null&&q9(c.stateNode.containerInfo),u2(c),null;case 10:return I4(c.type),u2(c),null;case 19:if(q(x2),s=c.memoizedState,s===null)return u2(c),null;if(u=(c.flags&128)!==0,d=s.rendering,d===null)if(u)Z0(s,!1);else{if(g2!==0||e!==null&&(e.flags&128)!==0)for(e=c.child;e!==null;){if(d=a5(e),d!==null){for(c.flags|=128,Z0(s,!1),e=d.updateQueue,c.updateQueue=e,p5(c,e),c.subtreeFlags=0,e=a,a=c.child;a!==null;)Ea(a,e),a=a.sibling;return X(x2,x2.current&1|2),$1&&$4(c,s.treeForkCount),c.child}e=e.sibling}s.tail!==null&&A1()>b5&&(c.flags|=128,u=!0,Z0(s,!1),c.lanes=4194304)}else{if(!u)if(e=a5(d),e!==null){if(c.flags|=128,u=!0,e=e.updateQueue,c.updateQueue=e,p5(c,e),Z0(s,!0),s.tail===null&&s.tailMode==="hidden"&&!d.alternate&&!$1)return u2(c),null}else 2*A1()-s.renderingStartTime>b5&&a!==536870912&&(c.flags|=128,u=!0,Z0(s,!1),c.lanes=4194304);s.isBackwards?(d.sibling=c.child,c.child=d):(e=s.last,e!==null?e.sibling=d:c.child=d,s.last=d)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=A1(),e.sibling=null,a=x2.current,X(x2,u?a&1|2:a&1),$1&&$4(c,s.treeForkCount),e):(u2(c),null);case 22:case 23:return a4(c),Dt(),s=c.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(c.flags|=8192):s&&(c.flags|=8192),s?(a&536870912)!==0&&(c.flags&128)===0&&(u2(c),c.subtreeFlags&6&&(c.flags|=8192)):u2(c),a=c.updateQueue,a!==null&&p5(c,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),s=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(s=c.memoizedState.cachePool.pool),s!==a&&(c.flags|=2048),e!==null&&q(Y3),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),c.memoizedState.cache!==a&&(c.flags|=2048),I4(b2),u2(c),null;case 25:return null;case 30:return null}throw Error(o(156,c.tag))}function dh(e,c){switch(wt(c),c.tag){case 1:return e=c.flags,e&65536?(c.flags=e&-65537|128,c):null;case 3:return I4(b2),f1(),e=c.flags,(e&65536)!==0&&(e&128)===0?(c.flags=e&-65537|128,c):null;case 26:case 27:case 5:return x1(c),null;case 31:if(c.memoizedState!==null){if(a4(c),c.alternate===null)throw Error(o(340));G3()}return e=c.flags,e&65536?(c.flags=e&-65537|128,c):null;case 13:if(a4(c),e=c.memoizedState,e!==null&&e.dehydrated!==null){if(c.alternate===null)throw Error(o(340));G3()}return e=c.flags,e&65536?(c.flags=e&-65537|128,c):null;case 19:return q(x2),null;case 4:return f1(),null;case 10:return I4(c.type),null;case 22:case 23:return a4(c),Dt(),e!==null&&q(Y3),e=c.flags,e&65536?(c.flags=e&-65537|128,c):null;case 24:return I4(b2),null;case 25:return null;default:return null}}function ul(e,c){switch(wt(c),c.tag){case 3:I4(b2),f1();break;case 26:case 27:case 5:x1(c);break;case 4:f1();break;case 31:c.memoizedState!==null&&a4(c);break;case 13:a4(c);break;case 19:q(x2);break;case 10:I4(c.type);break;case 22:case 23:a4(c),Dt(),e!==null&&q(Y3);break;case 24:I4(b2)}}function $0(e,c){try{var a=c.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var u=s.next;a=u;do{if((a.tag&e)===e){s=void 0;var d=a.create,b=a.inst;s=d(),b.destroy=s}a=a.next}while(a!==u)}}catch(V){t2(c,c.return,V)}}function y3(e,c,a){try{var s=c.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var d=u.next;s=d;do{if((s.tag&e)===e){var b=s.inst,V=b.destroy;if(V!==void 0){b.destroy=void 0,u=c;var D=a,Y=V;try{Y()}catch(c1){t2(u,D,c1)}}}s=s.next}while(s!==d)}}catch(c1){t2(c,c.return,c1)}}function hl(e){var c=e.updateQueue;if(c!==null){var a=e.stateNode;try{tn(c,a)}catch(s){t2(e,e.return,s)}}}function dl(e,c,a){a.props=W3(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(s){t2(e,c,s)}}function G0(e,c){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof a=="function"?e.refCleanup=a(s):a.current=s}}catch(u){t2(e,c,u)}}function R4(e,c){var a=e.ref,s=e.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(u){t2(e,c,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){t2(e,c,u)}else a.current=null}function fl(e){var c=e.type,a=e.memoizedProps,s=e.stateNode;try{t:switch(c){case"button":case"input":case"select":case"textarea":a.autoFocus&&s.focus();break t;case"img":a.src?s.src=a.src:a.srcSet&&(s.srcset=a.srcSet)}}catch(u){t2(e,e.return,u)}}function g9(e,c,a){try{var s=e.stateNode;kh(s,e.type,a,c),s[I2]=c}catch(u){t2(e,e.return,u)}}function ml(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&A3(e.type)||e.tag===4}function x9(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||ml(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&A3(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function z9(e,c,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,c?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,c):(c=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.appendChild(e),a=a._reactRootContainer,a!=null||c.onclick!==null||(c.onclick=_4));else if(s!==4&&(s===27&&A3(e.type)&&(a=e.stateNode,c=null),e=e.child,e!==null))for(z9(e,c,a),e=e.sibling;e!==null;)z9(e,c,a),e=e.sibling}function g5(e,c,a){var s=e.tag;if(s===5||s===6)e=e.stateNode,c?a.insertBefore(e,c):a.appendChild(e);else if(s!==4&&(s===27&&A3(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(g5(e,c,a),e=e.sibling;e!==null;)g5(e,c,a),e=e.sibling}function vl(e){var c=e.stateNode,a=e.memoizedProps;try{for(var s=e.type,u=c.attributes;u.length;)c.removeAttributeNode(u[0]);q2(c,s,a),c[k2]=e,c[I2]=a}catch(d){t2(e,e.return,d)}}var X4=!1,w2=!1,M9=!1,pl=typeof WeakSet=="function"?WeakSet:Set,j2=null;function fh(e,c){if(e=e.containerInfo,_9=q5,e=Va(e),ft(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else t:{a=(a=e.ownerDocument)&&a.defaultView||window;var s=a.getSelection&&a.getSelection();if(s&&s.rangeCount!==0){a=s.anchorNode;var u=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{a.nodeType,d.nodeType}catch{a=null;break t}var b=0,V=-1,D=-1,Y=0,c1=0,n1=e,K=null;e:for(;;){for(var J;n1!==a||u!==0&&n1.nodeType!==3||(V=b+u),n1!==d||s!==0&&n1.nodeType!==3||(D=b+s),n1.nodeType===3&&(b+=n1.nodeValue.length),(J=n1.firstChild)!==null;)K=n1,n1=J;for(;;){if(n1===e)break e;if(K===a&&++Y===u&&(V=b),K===d&&++c1===s&&(D=b),(J=n1.nextSibling)!==null)break;n1=K,K=n1.parentNode}n1=J}a=V===-1||D===-1?null:{start:V,end:D}}else a=null}a=a||{start:0,end:0}}else a=null;for(U9={focusedElem:e,selectionRange:a},q5=!1,j2=c;j2!==null;)if(c=j2,e=c.child,(c.subtreeFlags&1028)!==0&&e!==null)e.return=c,j2=e;else for(;j2!==null;){switch(c=j2,d=c.alternate,e=c.flags,c.tag){case 0:if((e&4)!==0&&(e=c.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a title"))),q2(d,s,a),d[k2]=e,B2(d),s=d;break t;case"link":var b=yr("link","href",u).get(s+(a.href||""));if(b){for(var V=0;Vn2&&(b=n2,n2=L1,L1=b);var G=Ha(V,L1),U=Ha(V,n2);if(G&&U&&(J.rangeCount!==1||J.anchorNode!==G.node||J.anchorOffset!==G.offset||J.focusNode!==U.node||J.focusOffset!==U.offset)){var P=n1.createRange();P.setStart(G.node,G.offset),J.removeAllRanges(),L1>n2?(J.addRange(P),J.extend(U.node,U.offset)):(P.setEnd(U.node,U.offset),J.addRange(P))}}}}for(n1=[],J=V;J=J.parentNode;)J.nodeType===1&&n1.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof V.focus=="function"&&V.focus(),V=0;Va?32:a,F.T=null,a=V9,V9=null;var d=S3,b=c3;if(V2=0,_6=S3=null,c3=0,(Q1&6)!==0)throw Error(o(331));var V=Q1;if(Q1|=4,Vl(d.current),wl(d,d.current,b,a),Q1=V,X0(0,!1),D2&&typeof D2.onPostCommitFiberRoot=="function")try{D2.onPostCommitFiberRoot(q3,d)}catch{}return!0}finally{_.p=u,F.T=s,Gl(e,c)}}function Pl(e,c,a){c=f4(a,c),c=r9(e.stateNode,c,2),e=z3(e,c,2),e!==null&&(g0(e,2),E4(e))}function t2(e,c,a){if(e.tag===3)Pl(e,e,a);else for(;c!==null;){if(c.tag===3){Pl(c,e,a);break}else if(c.tag===1){var s=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(H3===null||!H3.has(s))){e=f4(a,e),a=Yn(2),s=z3(c,a,2),s!==null&&(Qn(a,s,c,e),g0(s,2),E4(s));break}}c=c.return}}function j9(e,c,a){var s=e.pingCache;if(s===null){s=e.pingCache=new ph;var u=new Set;s.set(c,u)}else u=s.get(c),u===void 0&&(u=new Set,s.set(c,u));u.has(a)||(C9=!0,u.add(a),e=bh.bind(null,e,c,a),c.then(e,e))}function bh(e,c,a){var s=e.pingCache;s!==null&&s.delete(c),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,l2===e&&(U1&a)===a&&(g2===4||g2===3&&(U1&62914560)===U1&&300>A1()-M5?(Q1&2)===0&&U6(e,0):w9|=a,O6===U1&&(O6=0)),E4(e)}function Yl(e,c){c===0&&(c=_c()),e=Z3(e,c),e!==null&&(g0(e,c),E4(e))}function yh(e){var c=e.memoizedState,a=0;c!==null&&(a=c.retryLane),Yl(e,a)}function Ch(e,c){var a=0;switch(e.tag){case 31:case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(o(314))}s!==null&&s.delete(c),Yl(e,a)}function wh(e,c){return r1(e,c)}var V5=null,$6=null,F9=!1,L5=!1,N9=!1,L3=0;function E4(e){e!==$6&&e.next===null&&($6===null?V5=$6=e:$6=$6.next=e),L5=!0,F9||(F9=!0,Sh())}function X0(e,c){if(!N9&&L5){N9=!0;do for(var a=!1,s=V5;s!==null;){if(e!==0){var u=s.pendingLanes;if(u===0)var d=0;else{var b=s.suspendedLanes,V=s.pingedLanes;d=(1<<31-C1(42|e)+1)-1,d&=u&~(b&~V),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,Jl(s,d))}else d=U1,d=v2(s,s===l2?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||C4(s,d)||(a=!0,Jl(s,d));s=s.next}while(a);N9=!1}}function Hh(){Ql()}function Ql(){L5=F9=!1;var e=0;L3!==0&&Eh()&&(e=L3);for(var c=A1(),a=null,s=V5;s!==null;){var u=s.next,d=Kl(s,c);d===0?(s.next=null,a===null?V5=u:a.next=u,u===null&&($6=a)):(a=s,(e!==0||(d&3)!==0)&&(L5=!0)),s=u}V2!==0&&V2!==5||X0(e),L3!==0&&(L3=0)}function Kl(e,c){for(var a=e.suspendedLanes,s=e.pingedLanes,u=e.expirationTimes,d=e.pendingLanes&-62914561;0V)break;var c1=D.transferSize,n1=D.initiatorType;c1&&rr(n1)&&(D=D.responseEnd,b+=c1*(D"u"?null:document;function xr(e,c,a){var s=G6;if(s&&typeof c=="string"&&c){var u=h4(c);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),gr.has(u)||(gr.add(u),e={rel:e,crossOrigin:a,href:c},s.querySelector(u)===null&&(c=s.createElement("link"),q2(c,"link",e),B2(c),s.head.appendChild(c)))}}function Gh(e){a3.D(e),xr("dns-prefetch",e,null)}function Ih(e,c){a3.C(e,c),xr("preconnect",e,c)}function Ph(e,c,a){a3.L(e,c,a);var s=G6;if(s&&e&&c){var u='link[rel="preload"][as="'+h4(c)+'"]';c==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+h4(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+h4(a.imageSizes)+'"]')):u+='[href="'+h4(e)+'"]';var d=u;switch(c){case"style":d=I6(e);break;case"script":d=P6(e)}z4.has(d)||(e=M({rel:"preload",href:c==="image"&&a&&a.imageSrcSet?void 0:e,as:c},a),z4.set(d,e),s.querySelector(u)!==null||c==="style"&&s.querySelector(e8(d))||c==="script"&&s.querySelector(c8(d))||(c=s.createElement("link"),q2(c,"link",e),B2(c),s.head.appendChild(c)))}}function Yh(e,c){a3.m(e,c);var a=G6;if(a&&e){var s=c&&typeof c.as=="string"?c.as:"script",u='link[rel="modulepreload"][as="'+h4(s)+'"][href="'+h4(e)+'"]',d=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=P6(e)}if(!z4.has(d)&&(e=M({rel:"modulepreload",href:e},c),z4.set(d,e),a.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(c8(d)))return}s=a.createElement("link"),q2(s,"link",e),B2(s),a.head.appendChild(s)}}}function Qh(e,c,a){a3.S(e,c,a);var s=G6;if(s&&e){var u=m6(s).hoistableStyles,d=I6(e);c=c||"default";var b=u.get(d);if(!b){var V={loading:0,preload:null};if(b=s.querySelector(e8(d)))V.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":c},a),(a=z4.get(d))&&Q9(e,a);var D=b=s.createElement("link");B2(D),q2(D,"link",e),D._p=new Promise(function(Y,c1){D.onload=Y,D.onerror=c1}),D.addEventListener("load",function(){V.loading|=1}),D.addEventListener("error",function(){V.loading|=2}),V.loading|=4,N5(b,c,s)}b={type:"stylesheet",instance:b,count:1,state:V},u.set(d,b)}}}function Kh(e,c){a3.X(e,c);var a=G6;if(a&&e){var s=m6(a).hoistableScripts,u=P6(e),d=s.get(u);d||(d=a.querySelector(c8(u)),d||(e=M({src:e,async:!0},c),(c=z4.get(u))&&K9(e,c),d=a.createElement("script"),B2(d),q2(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(u,d))}}function Xh(e,c){a3.M(e,c);var a=G6;if(a&&e){var s=m6(a).hoistableScripts,u=P6(e),d=s.get(u);d||(d=a.querySelector(c8(u)),d||(e=M({src:e,async:!0,type:"module"},c),(c=z4.get(u))&&K9(e,c),d=a.createElement("script"),B2(d),q2(d,"link",e),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(u,d))}}function zr(e,c,a,s){var u=(u=y1.current)?F5(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(c=I6(a.href),a=m6(u).hoistableStyles,s=a.get(c),s||(s={type:"style",instance:null,count:0,state:null},a.set(c,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=I6(a.href);var d=m6(u).hoistableStyles,b=d.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=u.querySelector(e8(e)))&&!d._p&&(b.instance=d,b.state.loading=5),z4.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},z4.set(e,a),d||Jh(u,e,a,b.state))),c&&s===null)throw Error(o(528,""));return b}if(c&&s!==null)throw Error(o(529,""));return null;case"script":return c=a.async,a=a.src,typeof a=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=P6(a),a=m6(u).hoistableScripts,s=a.get(c),s||(s={type:"script",instance:null,count:0,state:null},a.set(c,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function I6(e){return'href="'+h4(e)+'"'}function e8(e){return'link[rel="stylesheet"]['+e+"]"}function Mr(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function Jh(e,c,a,s){e.querySelector('link[rel="preload"][as="style"]['+c+"]")?s.loading=1:(c=e.createElement("link"),s.preload=c,c.addEventListener("load",function(){return s.loading|=1}),c.addEventListener("error",function(){return s.loading|=2}),q2(c,"link",a),B2(c),e.head.appendChild(c))}function P6(e){return'[src="'+h4(e)+'"]'}function c8(e){return"script[async]"+e}function br(e,c,a){if(c.count++,c.instance===null)switch(c.type){case"style":var s=e.querySelector('style[data-href~="'+h4(a.href)+'"]');if(s)return c.instance=s,B2(s),s;var u=M({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),B2(s),q2(s,"style",u),N5(s,a.precedence,e),c.instance=s;case"stylesheet":u=I6(a.href);var d=e.querySelector(e8(u));if(d)return c.state.loading|=4,c.instance=d,B2(d),d;s=Mr(a),(u=z4.get(u))&&Q9(s,u),d=(e.ownerDocument||e).createElement("link"),B2(d);var b=d;return b._p=new Promise(function(V,D){b.onload=V,b.onerror=D}),q2(d,"link",s),c.state.loading|=4,N5(d,a.precedence,e),c.instance=d;case"script":return d=P6(a.src),(u=e.querySelector(c8(d)))?(c.instance=u,B2(u),u):(s=a,(u=z4.get(d))&&(s=M({},a),K9(s,u)),e=e.ownerDocument||e,u=e.createElement("script"),B2(u),q2(u,"link",s),e.head.appendChild(u),c.instance=u);case"void":return null;default:throw Error(o(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(s=c.instance,c.state.loading|=4,N5(s,a.precedence,e));return c.instance}function N5(e,c,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,d=u,b=0;b title"):null)}function Wh(e,c,a){if(a===1||c.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return e=c.disabled,typeof c.precedence=="string"&&e==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function wr(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function td(e,c,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=I6(s.href),d=c.querySelector(e8(u));if(d){c=d._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(e.count++,e=R5.bind(e),c.then(e,e)),a.state.loading|=4,a.instance=d,B2(d);return}d=c.ownerDocument||c,s=Mr(s),(u=z4.get(u))&&Q9(s,u),d=d.createElement("link"),B2(d);var b=d;b._p=new Promise(function(V,D){b.onload=V,b.onerror=D}),q2(d,"link",s),a.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,c),(c=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=R5.bind(e),c.addEventListener("load",a),c.addEventListener("error",a))}}var X9=0;function ed(e,c){return e.stylesheets&&e.count===0&&T5(e,e.stylesheets),0X9?50:800)+c);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function R5(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)T5(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var E5=null;function T5(e,c){e.stylesheets=null,e.unsuspend!==null&&(e.count++,E5=new Map,c.forEach(cd,e),E5=null,R5.call(e))}function cd(e,c){if(!(c.state.loading&4)){var a=E5.get(e);if(a)var s=a.get(null);else{a=new Map,E5.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),re.exports=zd(),re.exports}var bd=Md();var Yr="popstate";function yd(t={}){function n(o,h){let{pathname:f,search:v,hash:p}=o.location;return De("",{pathname:f,search:v,hash:p},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function l(o,h){return typeof h=="string"?h:M8(h)}return wd(n,l,null,t)}function f2(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function A4(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Cd(){return Math.random().toString(36).substring(2,10)}function Qr(t,n){return{usr:t.state,key:t.key,idx:n}}function De(t,n,l=null,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof n=="string"?h0(n):n,state:l,key:n&&n.key||o||Cd()}}function M8({pathname:t="/",search:n="",hash:l=""}){return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),l&&l!=="#"&&(t+=l.charAt(0)==="#"?l:"#"+l),t}function h0(t){let n={};if(t){let l=t.indexOf("#");l>=0&&(n.hash=t.substring(l),t=t.substring(0,l));let o=t.indexOf("?");o>=0&&(n.search=t.substring(o),t=t.substring(0,o)),t&&(n.pathname=t)}return n}function wd(t,n,l,o={}){let{window:h=document.defaultView,v5Compat:f=!1}=o,v=h.history,p="POP",z=null,x=g();x==null&&(x=0,v.replaceState({...v.state,idx:x},""));function g(){return(v.state||{idx:null}).idx}function M(){p="POP";let w=g(),H=w==null?null:w-x;x=w,z&&z({action:p,location:S.location,delta:H})}function y(w,H){p="PUSH";let j=De(S.location,w,H);x=g()+1;let L=Qr(j,x),B=S.createHref(j);try{v.pushState(L,"",B)}catch(T){if(T instanceof DOMException&&T.name==="DataCloneError")throw T;h.location.assign(B)}f&&z&&z({action:p,location:S.location,delta:1})}function C(w,H){p="REPLACE";let j=De(S.location,w,H);x=g();let L=Qr(j,x),B=S.createHref(j);v.replaceState(L,"",B),f&&z&&z({action:p,location:S.location,delta:0})}function A(w){return Hd(w)}let S={get action(){return p},get location(){return t(h,v)},listen(w){if(z)throw new Error("A history only accepts one active listener");return h.addEventListener(Yr,M),z=w,()=>{h.removeEventListener(Yr,M),z=null}},createHref(w){return n(h,w)},createURL:A,encodeLocation(w){let H=A(w);return{pathname:H.pathname,search:H.search,hash:H.hash}},push:y,replace:C,go(w){return v.go(w)}};return S}function Hd(t,n=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),f2(l,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:M8(t);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=l+o),new URL(o,l)}function os(t,n,l="/"){return Sd(t,n,l,!1)}function Sd(t,n,l,o){let h=typeof n=="string"?h0(n):n,f=o3(h.pathname||"/",l);if(f==null)return null;let v=us(t);Vd(v);let p=null;for(let z=0;p==null&&z{let g={relativePath:x===void 0?v.path||"":x,caseSensitive:v.caseSensitive===!0,childrenIndex:p,route:v};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(o)&&z)return;f2(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let M=s3([o,g.relativePath]),y=l.concat(g);v.children&&v.children.length>0&&(f2(v.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${M}".`),us(v.children,n,y,M,z)),!(v.path==null&&!v.index)&&n.push({path:M,score:kd(M,v.index),routesMeta:y})};return t.forEach((v,p)=>{if(v.path===""||!v.path?.includes("?"))f(v,p);else for(let z of hs(v.path))f(v,p,!0,z)}),n}function hs(t){let n=t.split("/");if(n.length===0)return[];let[l,...o]=n,h=l.endsWith("?"),f=l.replace(/\?$/,"");if(o.length===0)return h?[f,""]:[f];let v=hs(o.join("/")),p=[];return p.push(...v.map(z=>z===""?f:[f,z].join("/"))),h&&p.push(...v),p.map(z=>t.startsWith("/")&&z===""?"/":z)}function Vd(t){t.sort((n,l)=>n.score!==l.score?l.score-n.score:Rd(n.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var Ld=/^:[\w-]+$/,Ad=3,Bd=2,jd=1,Fd=10,Nd=-2,Kr=t=>t==="*";function kd(t,n){let l=t.split("/"),o=l.length;return l.some(Kr)&&(o+=Nd),n&&(o+=Bd),l.filter(h=>!Kr(h)).reduce((h,f)=>h+(Ld.test(f)?Ad:f===""?jd:Fd),o)}function Rd(t,n){return t.length===n.length&&t.slice(0,-1).every((o,h)=>o===n[h])?t[t.length-1]-n[n.length-1]:0}function Ed(t,n,l=!1){let{routesMeta:o}=t,h={},f="/",v=[];for(let p=0;p{if(g==="*"){let A=p[y]||"";v=f.slice(0,f.length-A.length).replace(/(.)\/+$/,"$1")}const C=p[y];return M&&!C?x[g]=void 0:x[g]=(C||"").replace(/%2F/g,"/"),x},{}),pathname:f,pathnameBase:v,pattern:t}}function Td(t,n=!1,l=!0){A4(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],h="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(v,p,z)=>(o.push({paramName:p,isOptional:z!=null}),z?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),h+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?h+="\\/*$":t!==""&&t!=="/"&&(h+="(?:(?=\\/|$))"),[new RegExp(h,n?void 0:"i"),o]}function qd(t){try{return t.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return A4(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),t}}function o3(t,n){if(n==="/")return t;if(!t.toLowerCase().startsWith(n.toLowerCase()))return null;let l=n.endsWith("/")?n.length-1:n.length,o=t.charAt(l);return o&&o!=="/"?null:t.slice(l)||"/"}var Dd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Od=t=>Dd.test(t);function _d(t,n="/"){let{pathname:l,search:o="",hash:h=""}=typeof t=="string"?h0(t):t,f;if(l)if(Od(l))f=l;else{if(l.includes("//")){let v=l;l=l.replace(/\/\/+/g,"/"),A4(!1,`Pathnames cannot have embedded double slashes - normalizing ${v} -> ${l}`)}l.startsWith("/")?f=Xr(l.substring(1),"/"):f=Xr(l,n)}else f=n;return{pathname:f,search:$d(o),hash:Gd(h)}}function Xr(t,n){let l=n.replace(/\/+$/,"").split("/");return t.split("/").forEach(h=>{h===".."?l.length>1&&l.pop():h!=="."&&l.push(h)}),l.length>1?l.join("/"):"/"}function ue(t,n,l,o){return`Cannot include a '${t}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Ud(t){return t.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function ds(t){let n=Ud(t);return n.map((l,o)=>o===n.length-1?l.pathname:l.pathnameBase)}function fs(t,n,l,o=!1){let h;typeof t=="string"?h=h0(t):(h={...t},f2(!h.pathname||!h.pathname.includes("?"),ue("?","pathname","search",h)),f2(!h.pathname||!h.pathname.includes("#"),ue("#","pathname","hash",h)),f2(!h.search||!h.search.includes("#"),ue("#","search","hash",h)));let f=t===""||h.pathname==="",v=f?"/":h.pathname,p;if(v==null)p=l;else{let M=n.length-1;if(!o&&v.startsWith("..")){let y=v.split("/");for(;y[0]==="..";)y.shift(),M-=1;h.pathname=y.join("/")}p=M>=0?n[M]:"/"}let z=_d(h,p),x=v&&v!=="/"&&v.endsWith("/"),g=(f||v===".")&&l.endsWith("/");return!z.pathname.endsWith("/")&&(x||g)&&(z.pathname+="/"),z}var s3=t=>t.join("/").replace(/\/\/+/g,"/"),Zd=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),$d=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Gd=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Id(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ms=["POST","PUT","PATCH","DELETE"];new Set(ms);var Pd=["GET",...ms];new Set(Pd);var d0=m.createContext(null);d0.displayName="DataRouter";var R7=m.createContext(null);R7.displayName="DataRouterState";m.createContext(!1);var vs=m.createContext({isTransitioning:!1});vs.displayName="ViewTransition";var Yd=m.createContext(new Map);Yd.displayName="Fetchers";var Qd=m.createContext(null);Qd.displayName="Await";var D4=m.createContext(null);D4.displayName="Navigation";var V8=m.createContext(null);V8.displayName="Location";var u3=m.createContext({outlet:null,matches:[],isDataRoute:!1});u3.displayName="Route";var rc=m.createContext(null);rc.displayName="RouteError";function Kd(t,{relative:n}={}){f2(L8(),"useHref() may be used only in the context of a component.");let{basename:l,navigator:o}=m.useContext(D4),{hash:h,pathname:f,search:v}=A8(t,{relative:n}),p=f;return l!=="/"&&(p=f==="/"?l:s3([l,f])),o.createHref({pathname:p,search:v,hash:h})}function L8(){return m.useContext(V8)!=null}function u6(){return f2(L8(),"useLocation() may be used only in the context of a component."),m.useContext(V8).location}var ps="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function gs(t){m.useContext(D4).static||m.useLayoutEffect(t)}function Xd(){let{isDataRoute:t}=m.useContext(u3);return t?hf():Jd()}function Jd(){f2(L8(),"useNavigate() may be used only in the context of a component.");let t=m.useContext(d0),{basename:n,navigator:l}=m.useContext(D4),{matches:o}=m.useContext(u3),{pathname:h}=u6(),f=JSON.stringify(ds(o)),v=m.useRef(!1);return gs(()=>{v.current=!0}),m.useCallback((z,x={})=>{if(A4(v.current,ps),!v.current)return;if(typeof z=="number"){l.go(z);return}let g=fs(z,JSON.parse(f),h,x.relative==="path");t==null&&n!=="/"&&(g.pathname=g.pathname==="/"?n:s3([n,g.pathname])),(x.replace?l.replace:l.push)(g,x.state,x)},[n,l,f,h,t])}m.createContext(null);function A8(t,{relative:n}={}){let{matches:l}=m.useContext(u3),{pathname:o}=u6(),h=JSON.stringify(ds(l));return m.useMemo(()=>fs(t,JSON.parse(h),o,n==="path"),[t,h,o,n])}function Wd(t,n){return xs(t,n)}function xs(t,n,l,o,h){f2(L8(),"useRoutes() may be used only in the context of a component.");let{navigator:f}=m.useContext(D4),{matches:v}=m.useContext(u3),p=v[v.length-1],z=p?p.params:{},x=p?p.pathname:"/",g=p?p.pathnameBase:"/",M=p&&p.route;{let j=M&&M.path||"";zs(x,!M||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${x}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let y=u6(),C;if(n){let j=typeof n=="string"?h0(n):n;f2(g==="/"||j.pathname?.startsWith(g),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${j.pathname}" was given in the \`location\` prop.`),C=j}else C=y;let A=C.pathname||"/",S=A;if(g!=="/"){let j=g.replace(/^\//,"").split("/");S="/"+A.replace(/^\//,"").split("/").slice(j.length).join("/")}let w=os(t,{pathname:S});A4(M||w!=null,`No routes matched location "${C.pathname}${C.search}${C.hash}" `),A4(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${C.pathname}${C.search}${C.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let H=nf(w&&w.map(j=>Object.assign({},j,{params:Object.assign({},z,j.params),pathname:s3([g,f.encodeLocation?f.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?g:s3([g,f.encodeLocation?f.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),v,l,o,h);return n&&H?m.createElement(V8.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...C},navigationType:"POP"}},H):H}function tf(){let t=uf(),n=Id(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),l=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",h={padding:"0.5rem",backgroundColor:o},f={padding:"2px 4px",backgroundColor:o},v=null;return console.error("Error handled by React Router default ErrorBoundary:",t),v=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:f},"ErrorBoundary")," or"," ",m.createElement("code",{style:f},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},n),l?m.createElement("pre",{style:h},l):null,v)}var ef=m.createElement(tf,null),cf=class extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){this.props.onError?this.props.onError(t,n):console.error("React Router caught the following error during render",t)}render(){return this.state.error!==void 0?m.createElement(u3.Provider,{value:this.props.routeContext},m.createElement(rc.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function af({routeContext:t,match:n,children:l}){let o=m.useContext(d0);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(u3.Provider,{value:t},l)}function nf(t,n=[],l=null,o=null,h=null){if(t==null){if(!l)return null;if(l.errors)t=l.matches;else if(n.length===0&&!l.initialized&&l.matches.length>0)t=l.matches;else return null}let f=t,v=l?.errors;if(v!=null){let g=f.findIndex(M=>M.route.id&&v?.[M.route.id]!==void 0);f2(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(v).join(",")}`),f=f.slice(0,Math.min(f.length,g+1))}let p=!1,z=-1;if(l)for(let g=0;g=0?f=f.slice(0,z+1):f=[f[0]];break}}}let x=l&&o?(g,M)=>{o(g,{location:l.location,params:l.matches?.[0]?.params??{},errorInfo:M})}:void 0;return f.reduceRight((g,M,y)=>{let C,A=!1,S=null,w=null;l&&(C=v&&M.route.id?v[M.route.id]:void 0,S=M.route.errorElement||ef,p&&(z<0&&y===0?(zs("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,w=null):z===y&&(A=!0,w=M.route.hydrateFallbackElement||null)));let H=n.concat(f.slice(0,y+1)),j=()=>{let L;return C?L=S:A?L=w:M.route.Component?L=m.createElement(M.route.Component,null):M.route.element?L=M.route.element:L=g,m.createElement(af,{match:M,routeContext:{outlet:g,matches:H,isDataRoute:l!=null},children:L})};return l&&(M.route.ErrorBoundary||M.route.errorElement||y===0)?m.createElement(cf,{location:l.location,revalidation:l.revalidation,component:S,error:C,children:j(),routeContext:{outlet:null,matches:H,isDataRoute:!0},onError:x}):j()},null)}function ic(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function lf(t){let n=m.useContext(d0);return f2(n,ic(t)),n}function rf(t){let n=m.useContext(R7);return f2(n,ic(t)),n}function sf(t){let n=m.useContext(u3);return f2(n,ic(t)),n}function sc(t){let n=sf(t),l=n.matches[n.matches.length-1];return f2(l.route.id,`${t} can only be used on routes that contain a unique "id"`),l.route.id}function of(){return sc("useRouteId")}function uf(){let t=m.useContext(rc),n=rf("useRouteError"),l=sc("useRouteError");return t!==void 0?t:n.errors?.[l]}function hf(){let{router:t}=lf("useNavigate"),n=sc("useNavigate"),l=m.useRef(!1);return gs(()=>{l.current=!0}),m.useCallback(async(h,f={})=>{A4(l.current,ps),l.current&&(typeof h=="number"?t.navigate(h):await t.navigate(h,{fromRouteId:n,...f}))},[t,n])}var Jr={};function zs(t,n,l){!n&&!Jr[t]&&(Jr[t]=!0,A4(!1,l))}m.memo(df);function df({routes:t,future:n,state:l,unstable_onError:o}){return xs(t,void 0,l,o,n)}function r7(t){f2(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function ff({basename:t="/",children:n=null,location:l,navigationType:o="POP",navigator:h,static:f=!1}){f2(!L8(),"You cannot render a inside another . You should never have more than one in your app.");let v=t.replace(/^\/*/,"/"),p=m.useMemo(()=>({basename:v,navigator:h,static:f,future:{}}),[v,h,f]);typeof l=="string"&&(l=h0(l));let{pathname:z="/",search:x="",hash:g="",state:M=null,key:y="default"}=l,C=m.useMemo(()=>{let A=o3(z,v);return A==null?null:{location:{pathname:A,search:x,hash:g,state:M,key:y},navigationType:o}},[v,z,x,g,M,y,o]);return A4(C!=null,` is not able to match the URL "${z}${x}${g}" because it does not start with the basename, so the won't render anything.`),C==null?null:m.createElement(D4.Provider,{value:p},m.createElement(V8.Provider,{children:n,value:C}))}function mf({children:t,location:n}){return Wd(Oe(t),n)}function Oe(t,n=[]){let l=[];return m.Children.forEach(t,(o,h)=>{if(!m.isValidElement(o))return;let f=[...n,h];if(o.type===m.Fragment){l.push.apply(l,Oe(o.props.children,f));return}f2(o.type===r7,`[${typeof o.type=="string"?o.type:o.type.name}] is not a component. All component children of must be a or `),f2(!o.props.index||!o.props.children,"An index route cannot have child routes.");let v={id:o.props.id||f.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(v.children=Oe(o.props.children,f)),l.push(v)}),l}var i7="get",s7="application/x-www-form-urlencoded";function E7(t){return t!=null&&typeof t.tagName=="string"}function vf(t){return E7(t)&&t.tagName.toLowerCase()==="button"}function pf(t){return E7(t)&&t.tagName.toLowerCase()==="form"}function gf(t){return E7(t)&&t.tagName.toLowerCase()==="input"}function xf(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function zf(t,n){return t.button===0&&(!n||n==="_self")&&!xf(t)}var G5=null;function Mf(){if(G5===null)try{new FormData(document.createElement("form"),0),G5=!1}catch{G5=!0}return G5}var bf=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function he(t){return t!=null&&!bf.has(t)?(A4(!1,`"${t}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${s7}"`),null):t}function yf(t,n){let l,o,h,f,v;if(pf(t)){let p=t.getAttribute("action");o=p?o3(p,n):null,l=t.getAttribute("method")||i7,h=he(t.getAttribute("enctype"))||s7,f=new FormData(t)}else if(vf(t)||gf(t)&&(t.type==="submit"||t.type==="image")){let p=t.form;if(p==null)throw new Error('Cannot submit a + + ); + + return ( +
+
{ + // The backdrop closes the popup, but clicks inside the card must leave video controls usable. + event.stopPropagation(); + }} + role="presentation" + > + +
+
+
+
+
+ ); +} diff --git a/webui/src/components/ReplaySourcesPanel/index.jsx b/webui/src/components/ReplaySourcesPanel/index.jsx index 9f387618..6a8e5d08 100644 --- a/webui/src/components/ReplaySourcesPanel/index.jsx +++ b/webui/src/components/ReplaySourcesPanel/index.jsx @@ -26,8 +26,6 @@ export default function ReplaySourcesPanel({ panelId = 'replay-sources', fillHei const replaySources = useSessionSelector((state) => state.session?.replaySources ?? []); const mode = useSessionSelector((state) => state.session?.mode || null); const assignmentRoverId = useSessionSelector((state) => state.session?.assignment?.roverId ?? null); - const users = useSessionSelector((state) => state.session?.users ?? []); - const selfSocketId = useSessionSelector((state) => state.session?.socketId || null); const roster = useSessionSelector((state) => state.session?.roster ?? []); const replayState = useSessionSelector((state) => state.session?.replay || null); const { triggerReplay } = useSessionActions(); @@ -41,6 +39,10 @@ export default function ReplaySourcesPanel({ panelId = 'replay-sources', fillHei const [titleDirty, setTitleDirty] = useState(false); const [includeSidebar, setIncludeSidebar] = useState(true); const [remainingMs, setRemainingMs] = useState(0); + const [activeJobId, setActiveJobId] = useState(null); + const activeReplayJob = useSessionSelector((state) => ( + activeJobId ? state.replayJobs?.[activeJobId] || null : null + )); const defaults = useMemo(() => { const roverId = assignmentRoverId; @@ -51,17 +53,13 @@ export default function ReplaySourcesPanel({ panelId = 'replay-sources', fillHei }, [assignmentRoverId]); const defaultTitle = useMemo(() => { - const self = Array.isArray(users) - ? users.find((entry) => entry?.socketId === selfSocketId) - : null; - const nickname = (self?.nickname || 'Someone').trim() || 'Someone'; const roverId = assignmentRoverId || null; const roverName = roverId && Array.isArray(roster) ? roster.find((entry) => String(entry?.id) === String(roverId))?.name || roverId - : 'a rover'; - return `${nickname} driving ${roverName}`; - }, [users, selfSocketId, assignmentRoverId, roster]); + : ''; + return roverName ? `Replay: ${roverName}` : 'Replay'; + }, [assignmentRoverId, roster]); useEffect(() => { setSelected(defaults); @@ -119,6 +117,24 @@ export default function ReplaySourcesPanel({ panelId = 'replay-sources', fillHei }, [replayState?.lastTriggeredAt, replayState?.cooldownMs, replayState?.remainingMs]); const replayDisabled = busy || mode === 'lockdown' || remainingMs > 0 || !selected.length; + const activeJobStatusText = useMemo(() => { + if (!activeReplayJob?.status) return null; + const titleText = activeReplayJob.title ? `: ${activeReplayJob.title}` : ''; + switch (activeReplayJob.status) { + case 'accepted': + return `Replay accepted${titleText}`; + case 'building': + return `Replay building${titleText}`; + case 'uploading': + return `Replay uploading${titleText}`; + case 'ready': + return `Replay ready${titleText}`; + case 'failed': + return activeReplayJob.message || `Replay failed${titleText}`; + default: + return activeReplayJob.message || `Replay ${activeReplayJob.status}${titleText}`; + } + }, [activeReplayJob]); const toggleKey = (key) => { setSelected((prev) => { @@ -132,14 +148,22 @@ export default function ReplaySourcesPanel({ panelId = 'replay-sources', fillHei setBusy(true); setError(null); setSuccess(null); + setActiveJobId(null); try { const payload = selected.map((key) => { const [type, id] = key.split(':'); return { type, id }; }); const resolvedTitle = String(title || '').trim() || defaultTitle; - await triggerReplay({ sources: payload, title: resolvedTitle, includeSidebar }); - setSuccess('Replay sent. Check the Discord replay channel.'); + const resp = await triggerReplay({ sources: payload, title: resolvedTitle, includeSidebar }); + if (resp?.jobId) { + // The socket acknowledgement is only the start of the async job. + // Later replay:status events update this same job id as Discord builds and uploads the video. + setActiveJobId(resp.jobId); + setSuccess('Replay accepted.'); + } else { + setSuccess('Replay accepted.'); + } } catch (err) { setError(err.message); } finally { @@ -195,7 +219,11 @@ export default function ReplaySourcesPanel({ panelId = 'replay-sources', fillHei {remainingMs > 0 ? `Replay (${Math.ceil(remainingMs / 1000)}s)` : busy ? 'Replay…' : 'Replay'} {error ?
{error}
: null} - {success ?
{success}
: null} + {activeJobStatusText ? ( +
+ {activeJobStatusText} +
+ ) : success ?
{success}
: null} ); diff --git a/webui/src/context/SessionContext.jsx b/webui/src/context/SessionContext.jsx index 367301ff..e261a96c 100644 --- a/webui/src/context/SessionContext.jsx +++ b/webui/src/context/SessionContext.jsx @@ -15,6 +15,8 @@ const INITIAL_STATE = { overseerControlState: null, overseerMemory: null, alerts: [], + replayJobs: {}, + latestReplay: null, }; const SessionContext = createContext(null); @@ -129,6 +131,72 @@ export function SessionProvider({ children }) { ], })); } + function handleReplayStatus(payload = {}) { + if (!payload?.jobId) return; + setState((prev) => { + const previous = prev.replayJobs?.[payload.jobId] || {}; + const nextJob = { + ...previous, + ...payload, + updatedAt: Date.now(), + }; + return { + ...prev, + // Keep status by job id because the replay panel receives the job id synchronously + // from the trigger acknowledgement, then later socket events update that same record. + replayJobs: { + ...(prev.replayJobs || {}), + [payload.jobId]: nextJob, + }, + }; + }); + } + function handleReplayReady(payload = {}) { + if (!payload?.jobId || !payload?.url) return; + setState((prev) => { + const previous = prev.replayJobs?.[payload.jobId] || {}; + const nextJob = { + ...previous, + ...payload, + status: 'ready', + media: payload, + updatedAt: Date.now(), + }; + return { + ...prev, + replayJobs: { + ...(prev.replayJobs || {}), + [payload.jobId]: nextJob, + }, + // Only the current replay popup is retained. Discord is the media host, so + // this state is intentionally short-lived and does not become a replay library. + latestReplay: { + ...payload, + receivedAt: Date.now(), + }, + }; + }); + } + function handleReplayFailed(payload = {}) { + if (payload?.jobId) handleReplayStatus({ ...payload, status: 'failed' }); + const message = typeof payload?.message === 'string' && payload.message.trim() + ? payload.message.trim() + : 'Replay failed after being accepted.'; + setState((prev) => ({ + ...prev, + alerts: [ + ...prev.alerts.slice(-49), + { + id: payload?.jobId ? `replay-failed-${payload.jobId}` : `replay-failed-${Date.now()}`, + title: 'Replay failed', + message, + color: '#f59e0b', + receivedAt: Date.now(), + lifetimeMs: 6000, + }, + ], + })); + } function handleOverseerState(payload = null) { const state = payload && typeof payload === 'object' ? payload : null; setState((prev) => ({ ...prev, overseerControlState: state })); @@ -148,6 +216,9 @@ export function SessionProvider({ children }) { socket.on('overseer:state', handleOverseerState); socket.on('overseer:memory', handleOverseerMemory); socket.on('alert:new', handleAlertNew); + socket.on('replay:status', handleReplayStatus); + socket.on('replay:ready', handleReplayReady); + socket.on('replay:failed', handleReplayFailed); return () => { socket.off('session:sync', handleSession); socket.off('log:init', handleLogInit); @@ -158,6 +229,9 @@ export function SessionProvider({ children }) { socket.off('overseer:state', handleOverseerState); socket.off('overseer:memory', handleOverseerMemory); socket.off('alert:new', handleAlertNew); + socket.off('replay:status', handleReplayStatus); + socket.off('replay:ready', handleReplayReady); + socket.off('replay:failed', handleReplayFailed); }; }, [setState, socket]); @@ -231,6 +305,8 @@ export function SessionProvider({ children }) { { ...alert, receivedAt: Date.now(), id: alert.id || Math.random().toString(36).slice(2) }, ], })), + clearLatestReplay: () => + setState((prev) => (prev.latestReplay ? { ...prev, latestReplay: null } : prev)), }), [emitWithAck, setState], );