From 2494f6e2766005029f165907c18d12ed72e423ff Mon Sep 17 00:00:00 2001 From: legop3 Date: Sat, 24 Jan 2026 23:40:22 -0500 Subject: [PATCH] lockdown fixes --- .../{index-Cge0aRRk.js => index-BJNBFmS4.js} | 4 ++-- server/public/index.html | 2 +- server/src/services/assignmentService.js | 12 +++++++--- server/src/services/authService.js | 4 ++++ server/src/services/discordBotService.js | 24 ++++++++++++++++++- server/src/services/homeAssistantService.js | 14 ++++++++--- server/src/services/lockdownGuard.js | 6 ----- server/src/services/modeManager.js | 5 +++- server/src/services/roverManager.js | 14 ++++++++--- webui/src/components/ModeGateOverlay.jsx | 3 ++- 10 files changed, 67 insertions(+), 21 deletions(-) rename server/public/assets/{index-Cge0aRRk.js => index-BJNBFmS4.js} (97%) diff --git a/server/public/assets/index-Cge0aRRk.js b/server/public/assets/index-BJNBFmS4.js similarity index 97% rename from server/public/assets/index-Cge0aRRk.js rename to server/public/assets/index-BJNBFmS4.js index 55cb1f0d..e31725c9 100644 --- a/server/public/assets/index-Cge0aRRk.js +++ b/server/public/assets/index-BJNBFmS4.js @@ -9,7 +9,7 @@ Error generating stack: `+s.message+` `).replace(mv,"")}function Bm(e,t){return t=Om(t),Om(e)===t}function Oe(e,t,n,s,c,u){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Ha(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Ha(e,""+s);break;case"className":Zs(e,"class",s);break;case"tabIndex":Zs(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Zs(e,n,s);break;case"style":Bf(e,s,u);break;case"data":if(t!=="object"){Zs(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Js(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&Oe(e,t,"name",c.name,c,null),Oe(e,t,"formEncType",c.formEncType,c,null),Oe(e,t,"formMethod",c.formMethod,c,null),Oe(e,t,"formTarget",c.formTarget,c,null)):(Oe(e,t,"encType",c.encType,c,null),Oe(e,t,"method",c.method,c,null),Oe(e,t,"target",c.target,c,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=Js(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=un);break;case"onScroll":s!=null&&xe("scroll",e);break;case"onScrollEnd":s!=null&&xe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(r(61));if(n=s.__html,n!=null){if(c.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=Js(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":xe("beforetoggle",e),xe("toggle",e),Ks(e,"popover",s);break;case"xlinkActuate":on(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":on(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":on(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":on(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":on(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":on(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":on(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":on(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":on(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ks(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2x)break;var Q=T.transferSize,J=T.initiatorType;Q&&zm(J)&&(T=T.responseEnd,h+=Q*(T"u"?null:document;function Fm(e,t,n){var s=ml;if(s&&typeof t=="string"&&t){var c=Dt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),Zm.has(c)||(Zm.add(c),e={rel:e,crossOrigin:n,href:t},s.querySelector(c)===null&&(t=s.createElement("link"),ot(t,"link",e),at(t),s.head.appendChild(t)))}}function Ev(e){En.D(e),Fm("dns-prefetch",e,null)}function qv(e,t){En.C(e,t),Fm("preconnect",e,t)}function Cv(e,t,n){En.L(e,t,n);var s=ml;if(s&&e&&t){var c='link[rel="preload"][as="'+Dt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+Dt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+Dt(n.imageSizes)+'"]')):c+='[href="'+Dt(e)+'"]';var u=c;switch(t){case"style":u=pl(e);break;case"script":u=gl(e)}Yt.has(u)||(e=S({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Yt.set(u,e),s.querySelector(c)!==null||t==="style"&&s.querySelector(gs(u))||t==="script"&&s.querySelector(ys(u))||(t=s.createElement("link"),ot(t,"link",e),at(t),s.head.appendChild(t)))}}function Tv(e,t){En.m(e,t);var n=ml;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Dt(s)+'"][href="'+Dt(e)+'"]',u=c;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=gl(e)}if(!Yt.has(u)&&(e=S({rel:"modulepreload",href:e},t),Yt.set(u,e),n.querySelector(c)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(ys(u)))return}s=n.createElement("link"),ot(s,"link",e),at(s),n.head.appendChild(s)}}}function Rv(e,t,n){En.S(e,t,n);var s=ml;if(s&&e){var c=za(s).hoistableStyles,u=pl(e);t=t||"default";var h=c.get(u);if(!h){var x={loading:0,preload:null};if(h=s.querySelector(gs(u)))x.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Yt.get(u))&&Ho(e,n);var T=h=s.createElement("link");at(T),ot(T,"link",e),T._p=new Promise(function(U,Q){T.onload=U,T.onerror=Q}),T.addEventListener("load",function(){x.loading|=1}),T.addEventListener("error",function(){x.loading|=2}),x.loading|=4,Ki(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:x},c.set(u,h)}}}function Mv(e,t){En.X(e,t);var n=ml;if(n&&e){var s=za(n).hoistableScripts,c=gl(e),u=s.get(c);u||(u=n.querySelector(ys(c)),u||(e=S({src:e,async:!0},t),(t=Yt.get(c))&&Vo(e,t),u=n.createElement("script"),at(u),ot(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(c,u))}}function kv(e,t){En.M(e,t);var n=ml;if(n&&e){var s=za(n).hoistableScripts,c=gl(e),u=s.get(c);u||(u=n.querySelector(ys(c)),u||(e=S({src:e,async:!0,type:"module"},t),(t=Yt.get(c))&&Vo(e,t),u=n.createElement("script"),at(u),ot(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},s.set(c,u))}}function Jm(e,t,n,s){var c=(c=ne.current)?$i(c):null;if(!c)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=pl(n.href),n=za(c).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=pl(n.href);var u=za(c).hoistableStyles,h=u.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,h),(u=c.querySelector(gs(e)))&&!u._p&&(h.instance=u,h.state.loading=5),Yt.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Yt.set(e,n),u||_v(c,e,n,h.state))),t&&s===null)throw Error(r(528,""));return h}if(t&&s!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=gl(n),n=za(c).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function pl(e){return'href="'+Dt(e)+'"'}function gs(e){return'link[rel="stylesheet"]['+e+"]"}function Im(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function _v(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),ot(t,"link",n),at(t),e.head.appendChild(t))}function gl(e){return'[src="'+Dt(e)+'"]'}function ys(e){return"script[async]"+e}function Wm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Dt(n.href)+'"]');if(s)return t.instance=s,at(s),s;var c=S({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),at(s),ot(s,"style",c),Ki(s,n.precedence,e),t.instance=s;case"stylesheet":c=pl(n.href);var u=e.querySelector(gs(c));if(u)return t.state.loading|=4,t.instance=u,at(u),u;s=Im(n),(c=Yt.get(c))&&Ho(s,c),u=(e.ownerDocument||e).createElement("link"),at(u);var h=u;return h._p=new Promise(function(x,T){h.onload=x,h.onerror=T}),ot(u,"link",s),t.state.loading|=4,Ki(u,n.precedence,e),t.instance=u;case"script":return u=gl(n.src),(c=e.querySelector(ys(u)))?(t.instance=c,at(c),c):(s=n,(c=Yt.get(u))&&(s=S({},n),Vo(s,c)),e=e.ownerDocument||e,c=e.createElement("script"),at(c),ot(c,"link",s),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Ki(s,n.precedence,e));return t.instance}function Ki(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=s.length?s[s.length-1]:null,u=c,h=0;h title"):null)}function Dv(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function tp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ov(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=pl(s.href),u=t.querySelector(gs(c));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,at(u);return}u=t.ownerDocument||t,s=Im(s),(c=Yt.get(c))&&Ho(s,c),u=u.createElement("link"),at(u);var h=u;h._p=new Promise(function(x,T){h.onload=x,h.onerror=T}),ot(u,"link",s),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Fi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Yo=0;function Bv(e,t){return e.stylesheets&&e.count===0&&Ii(e,e.stylesheets),0Yo?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(c)}}:null}function Fi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ii(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ji=null;function Ii(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ji=new Map,t.forEach(zv,e),Ji=null,Fi.call(e))}function zv(e,t){if(!(t.state.loading&4)){var n=Ji.get(e);if(n)var s=n.get(null);else{n=new Map,Ji.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Io.exports=ex(),Io.exports}var nx=tx();var wp="popstate";function ax(a={}){function l(r,f){let{pathname:d,search:y,hash:p}=r.location;return bu("",{pathname:d,search:y,hash:p},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function i(r,f){return typeof f=="string"?f:Ms(f)}return sx(l,i,null,a)}function Ge(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function It(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function lx(){return Math.random().toString(36).substring(2,10)}function Ep(a,l){return{usr:a.state,key:a.key,idx:l}}function bu(a,l,i=null,r){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?jl(l):l,state:i,key:l&&l.key||r||lx()}}function Ms({pathname:a="/",search:l="",hash:i=""}){return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),i&&i!=="#"&&(a+=i.charAt(0)==="#"?i:"#"+i),a}function jl(a){let l={};if(a){let i=a.indexOf("#");i>=0&&(l.hash=a.substring(i),a=a.substring(0,i));let r=a.indexOf("?");r>=0&&(l.search=a.substring(r),a=a.substring(0,r)),a&&(l.pathname=a)}return l}function sx(a,l,i,r={}){let{window:f=document.defaultView,v5Compat:d=!1}=r,y=f.history,p="POP",g=null,v=b();v==null&&(v=0,y.replaceState({...y.state,idx:v},""));function b(){return(y.state||{idx:null}).idx}function S(){p="POP";let A=b(),E=A==null?null:A-v;v=A,g&&g({action:p,location:q.location,delta:E})}function w(A,E){p="PUSH";let N=bu(q.location,A,E);v=b()+1;let _=Ep(N,v),X=q.createHref(N);try{y.pushState(_,"",X)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;f.location.assign(X)}d&&g&&g({action:p,location:q.location,delta:1})}function R(A,E){p="REPLACE";let N=bu(q.location,A,E);v=b();let _=Ep(N,v),X=q.createHref(N);y.replaceState(_,"",X),d&&g&&g({action:p,location:q.location,delta:0})}function j(A){return ix(A)}let q={get action(){return p},get location(){return a(f,y)},listen(A){if(g)throw new Error("A history only accepts one active listener");return f.addEventListener(wp,S),g=A,()=>{f.removeEventListener(wp,S),g=null}},createHref(A){return l(f,A)},createURL:j,encodeLocation(A){let E=j(A);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:w,replace:R,go(A){return y.go(A)}};return q}function ix(a,l=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),Ge(i,"No window.location.(origin|href) available to create URL");let r=typeof a=="string"?a:Ms(a);return r=r.replace(/ $/,"%20"),!l&&r.startsWith("//")&&(r=i+r),new URL(r,i)}function m0(a,l,i="/"){return rx(a,l,i,!1)}function rx(a,l,i,r){let f=typeof l=="string"?jl(l):l,d=Mn(f.pathname||"/",i);if(d==null)return null;let y=p0(a);cx(y);let p=null;for(let g=0;p==null&&g{let b={relativePath:v===void 0?y.path||"":v,caseSensitive:y.caseSensitive===!0,childrenIndex:p,route:y};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(r)&&g)return;Ge(b.relativePath.startsWith(r),`Absolute route path "${b.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(r.length)}let S=Tn([r,b.relativePath]),w=i.concat(b);y.children&&y.children.length>0&&(Ge(y.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${S}".`),p0(y.children,l,w,S,g)),!(y.path==null&&!y.index)&&l.push({path:S,score:px(S,y.index),routesMeta:w})};return a.forEach((y,p)=>{if(y.path===""||!y.path?.includes("?"))d(y,p);else for(let g of g0(y.path))d(y,p,!0,g)}),l}function g0(a){let l=a.split("/");if(l.length===0)return[];let[i,...r]=l,f=i.endsWith("?"),d=i.replace(/\?$/,"");if(r.length===0)return f?[d,""]:[d];let y=g0(r.join("/")),p=[];return p.push(...y.map(g=>g===""?d:[d,g].join("/"))),f&&p.push(...y),p.map(g=>a.startsWith("/")&&g===""?"/":g)}function cx(a){a.sort((l,i)=>l.score!==i.score?i.score-l.score:gx(l.routesMeta.map(r=>r.childrenIndex),i.routesMeta.map(r=>r.childrenIndex)))}var ox=/^:[\w-]+$/,ux=3,fx=2,dx=1,hx=10,mx=-2,qp=a=>a==="*";function px(a,l){let i=a.split("/"),r=i.length;return i.some(qp)&&(r+=mx),l&&(r+=fx),i.filter(f=>!qp(f)).reduce((f,d)=>f+(ox.test(d)?ux:d===""?dx:hx),r)}function gx(a,l){return a.length===l.length&&a.slice(0,-1).every((r,f)=>r===l[f])?a[a.length-1]-l[l.length-1]:0}function yx(a,l,i=!1){let{routesMeta:r}=a,f={},d="/",y=[];for(let p=0;p{if(b==="*"){let j=p[w]||"";y=d.slice(0,d.length-j.length).replace(/(.)\/+$/,"$1")}const R=p[w];return S&&!R?v[b]=void 0:v[b]=(R||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:y,pattern:a}}function vx(a,l=!1,i=!0){It(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let r=[],f="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(y,p,g)=>(r.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(r.push({paramName:"*"}),f+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?f+="\\/*$":a!==""&&a!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,l?void 0:"i"),r]}function xx(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return It(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),a}}function Mn(a,l){if(l==="/")return a;if(!a.toLowerCase().startsWith(l.toLowerCase()))return null;let i=l.endsWith("/")?l.length-1:l.length,r=a.charAt(i);return r&&r!=="/"?null:a.slice(i)||"/"}var bx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sx=a=>bx.test(a);function Ax(a,l="/"){let{pathname:i,search:r="",hash:f=""}=typeof a=="string"?jl(a):a,d;if(i)if(Sx(i))d=i;else{if(i.includes("//")){let y=i;i=i.replace(/\/\/+/g,"/"),It(!1,`Pathnames cannot have embedded double slashes - normalizing ${y} -> ${i}`)}i.startsWith("/")?d=Cp(i.substring(1),"/"):d=Cp(i,l)}else d=l;return{pathname:d,search:wx(r),hash:Ex(f)}}function Cp(a,l){let i=l.replace(/\/+$/,"").split("/");return a.split("/").forEach(f=>{f===".."?i.length>1&&i.pop():f!=="."&&i.push(f)}),i.length>1?i.join("/"):"/"}function tu(a,l,i,r){return`Cannot include a '${a}' character in a manually specified \`to.${l}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function jx(a){return a.filter((l,i)=>i===0||l.route.path&&l.route.path.length>0)}function y0(a){let l=jx(a);return l.map((i,r)=>r===l.length-1?i.pathname:i.pathnameBase)}function v0(a,l,i,r=!1){let f;typeof a=="string"?f=jl(a):(f={...a},Ge(!f.pathname||!f.pathname.includes("?"),tu("?","pathname","search",f)),Ge(!f.pathname||!f.pathname.includes("#"),tu("#","pathname","hash",f)),Ge(!f.search||!f.search.includes("#"),tu("#","search","hash",f)));let d=a===""||f.pathname==="",y=d?"/":f.pathname,p;if(y==null)p=i;else{let S=l.length-1;if(!r&&y.startsWith("..")){let w=y.split("/");for(;w[0]==="..";)w.shift(),S-=1;f.pathname=w.join("/")}p=S>=0?l[S]:"/"}let g=Ax(f,p),v=y&&y!=="/"&&y.endsWith("/"),b=(d||y===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(v||b)&&(g.pathname+="/"),g}var Tn=a=>a.join("/").replace(/\/\/+/g,"/"),Nx=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),wx=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Ex=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a;function qx(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var x0=["POST","PUT","PATCH","DELETE"];new Set(x0);var Cx=["GET",...x0];new Set(Cx);var Nl=m.createContext(null);Nl.displayName="DataRouter";var Er=m.createContext(null);Er.displayName="DataRouterState";m.createContext(!1);var b0=m.createContext({isTransitioning:!1});b0.displayName="ViewTransition";var Tx=m.createContext(new Map);Tx.displayName="Fetchers";var Rx=m.createContext(null);Rx.displayName="Await";var ln=m.createContext(null);ln.displayName="Navigation";var Bs=m.createContext(null);Bs.displayName="Location";var kn=m.createContext({outlet:null,matches:[],isDataRoute:!1});kn.displayName="Route";var Bu=m.createContext(null);Bu.displayName="RouteError";function Mx(a,{relative:l}={}){Ge(zs(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:r}=m.useContext(ln),{hash:f,pathname:d,search:y}=Ls(a,{relative:l}),p=d;return i!=="/"&&(p=d==="/"?i:Tn([i,d])),r.createHref({pathname:p,search:y,hash:f})}function zs(){return m.useContext(Bs)!=null}function Ra(){return Ge(zs(),"useLocation() may be used only in the context of a component."),m.useContext(Bs).location}var S0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function A0(a){m.useContext(ln).static||m.useLayoutEffect(a)}function kx(){let{isDataRoute:a}=m.useContext(kn);return a?Xx():_x()}function _x(){Ge(zs(),"useNavigate() may be used only in the context of a component.");let a=m.useContext(Nl),{basename:l,navigator:i}=m.useContext(ln),{matches:r}=m.useContext(kn),{pathname:f}=Ra(),d=JSON.stringify(y0(r)),y=m.useRef(!1);return A0(()=>{y.current=!0}),m.useCallback((g,v={})=>{if(It(y.current,S0),!y.current)return;if(typeof g=="number"){i.go(g);return}let b=v0(g,JSON.parse(d),f,v.relative==="path");a==null&&l!=="/"&&(b.pathname=b.pathname==="/"?l:Tn([l,b.pathname])),(v.replace?i.replace:i.push)(b,v.state,v)},[l,i,d,f,a])}m.createContext(null);function Ls(a,{relative:l}={}){let{matches:i}=m.useContext(kn),{pathname:r}=Ra(),f=JSON.stringify(y0(i));return m.useMemo(()=>v0(a,JSON.parse(f),r,l==="path"),[a,f,r,l])}function Dx(a,l){return j0(a,l)}function j0(a,l,i,r,f){Ge(zs(),"useRoutes() may be used only in the context of a component.");let{navigator:d}=m.useContext(ln),{matches:y}=m.useContext(kn),p=y[y.length-1],g=p?p.params:{},v=p?p.pathname:"/",b=p?p.pathnameBase:"/",S=p&&p.route;{let N=S&&S.path||"";N0(v,!S||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${v}" (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 w=Ra(),R;if(l){let N=typeof l=="string"?jl(l):l;Ge(b==="/"||N.pathname?.startsWith(b),`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 "${b}" but pathname "${N.pathname}" was given in the \`location\` prop.`),R=N}else R=w;let j=R.pathname||"/",q=j;if(b!=="/"){let N=b.replace(/^\//,"").split("/");q="/"+j.replace(/^\//,"").split("/").slice(N.length).join("/")}let A=m0(a,{pathname:q});It(S||A!=null,`No routes matched location "${R.pathname}${R.search}${R.hash}" `),It(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${R.pathname}${R.search}${R.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 E=Ux(A&&A.map(N=>Object.assign({},N,{params:Object.assign({},g,N.params),pathname:Tn([b,d.encodeLocation?d.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?b:Tn([b,d.encodeLocation?d.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),y,i,r,f);return l&&E?m.createElement(Bs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...R},navigationType:"POP"}},E):E}function Ox(){let a=Qx(),l=qx(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),i=a instanceof Error?a.stack:null,r="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:r},d={padding:"2px 4px",backgroundColor:r},y=null;return console.error("Error handled by React Router default ErrorBoundary:",a),y=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:d},"ErrorBoundary")," or"," ",m.createElement("code",{style:d},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},l),i?m.createElement("pre",{style:f},i):null,y)}var Bx=m.createElement(Ox,null),zx=class extends m.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){this.props.onError?this.props.onError(a,l):console.error("React Router caught the following error during render",a)}render(){return this.state.error!==void 0?m.createElement(kn.Provider,{value:this.props.routeContext},m.createElement(Bu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Lx({routeContext:a,match:l,children:i}){let r=m.useContext(Nl);return r&&r.static&&r.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=l.route.id),m.createElement(kn.Provider,{value:a},i)}function Ux(a,l=[],i=null,r=null,f=null){if(a==null){if(!i)return null;if(i.errors)a=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)a=i.matches;else return null}let d=a,y=i?.errors;if(y!=null){let b=d.findIndex(S=>S.route.id&&y?.[S.route.id]!==void 0);Ge(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(y).join(",")}`),d=d.slice(0,Math.min(d.length,b+1))}let p=!1,g=-1;if(i)for(let b=0;b=0?d=d.slice(0,g+1):d=[d[0]];break}}}let v=i&&r?(b,S)=>{r(b,{location:i.location,params:i.matches?.[0]?.params??{},errorInfo:S})}:void 0;return d.reduceRight((b,S,w)=>{let R,j=!1,q=null,A=null;i&&(R=y&&S.route.id?y[S.route.id]:void 0,q=S.route.errorElement||Bx,p&&(g<0&&w===0?(N0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),j=!0,A=null):g===w&&(j=!0,A=S.route.hydrateFallbackElement||null)));let E=l.concat(d.slice(0,w+1)),N=()=>{let _;return R?_=q:j?_=A:S.route.Component?_=m.createElement(S.route.Component,null):S.route.element?_=S.route.element:_=b,m.createElement(Lx,{match:S,routeContext:{outlet:b,matches:E,isDataRoute:i!=null},children:_})};return i&&(S.route.ErrorBoundary||S.route.errorElement||w===0)?m.createElement(zx,{location:i.location,revalidation:i.revalidation,component:q,error:R,children:N(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:v}):N()},null)}function zu(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hx(a){let l=m.useContext(Nl);return Ge(l,zu(a)),l}function Vx(a){let l=m.useContext(Er);return Ge(l,zu(a)),l}function Yx(a){let l=m.useContext(kn);return Ge(l,zu(a)),l}function Lu(a){let l=Yx(a),i=l.matches[l.matches.length-1];return Ge(i.route.id,`${a} can only be used on routes that contain a unique "id"`),i.route.id}function Gx(){return Lu("useRouteId")}function Qx(){let a=m.useContext(Bu),l=Vx("useRouteError"),i=Lu("useRouteError");return a!==void 0?a:l.errors?.[i]}function Xx(){let{router:a}=Hx("useNavigate"),l=Lu("useNavigate"),i=m.useRef(!1);return A0(()=>{i.current=!0}),m.useCallback(async(f,d={})=>{It(i.current,S0),i.current&&(typeof f=="number"?a.navigate(f):await a.navigate(f,{fromRouteId:l,...d}))},[a,l])}var Tp={};function N0(a,l,i){!l&&!Tp[a]&&(Tp[a]=!0,It(!1,i))}m.memo($x);function $x({routes:a,future:l,state:i,unstable_onError:r}){return j0(a,void 0,i,r,l)}function hr(a){Ge(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Kx({basename:a="/",children:l=null,location:i,navigationType:r="POP",navigator:f,static:d=!1}){Ge(!zs(),"You cannot render a inside another . You should never have more than one in your app.");let y=a.replace(/^\/*/,"/"),p=m.useMemo(()=>({basename:y,navigator:f,static:d,future:{}}),[y,f,d]);typeof i=="string"&&(i=jl(i));let{pathname:g="/",search:v="",hash:b="",state:S=null,key:w="default"}=i,R=m.useMemo(()=>{let j=Mn(g,y);return j==null?null:{location:{pathname:j,search:v,hash:b,state:S,key:w},navigationType:r}},[y,g,v,b,S,w,r]);return It(R!=null,` is not able to match the URL "${g}${v}${b}" because it does not start with the basename, so the won't render anything.`),R==null?null:m.createElement(ln.Provider,{value:p},m.createElement(Bs.Provider,{children:l,value:R}))}function Zx({children:a,location:l}){return Dx(Su(a),l)}function Su(a,l=[]){let i=[];return m.Children.forEach(a,(r,f)=>{if(!m.isValidElement(r))return;let d=[...l,f];if(r.type===m.Fragment){i.push.apply(i,Su(r.props.children,d));return}Ge(r.type===hr,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Ge(!r.props.index||!r.props.children,"An index route cannot have child routes.");let y={id:r.props.id||d.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(y.children=Su(r.props.children,d)),i.push(y)}),i}var mr="get",pr="application/x-www-form-urlencoded";function qr(a){return a!=null&&typeof a.tagName=="string"}function Fx(a){return qr(a)&&a.tagName.toLowerCase()==="button"}function Jx(a){return qr(a)&&a.tagName.toLowerCase()==="form"}function Ix(a){return qr(a)&&a.tagName.toLowerCase()==="input"}function Wx(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function Px(a,l){return a.button===0&&(!l||l==="_self")&&!Wx(a)}var sr=null;function eb(){if(sr===null)try{new FormData(document.createElement("form"),0),sr=!1}catch{sr=!0}return sr}var tb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nu(a){return a!=null&&!tb.has(a)?(It(!1,`"${a}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${pr}"`),null):a}function nb(a,l){let i,r,f,d,y;if(Jx(a)){let p=a.getAttribute("action");r=p?Mn(p,l):null,i=a.getAttribute("method")||mr,f=nu(a.getAttribute("enctype"))||pr,d=new FormData(a)}else if(Fx(a)||Ix(a)&&(a.type==="submit"||a.type==="image")){let p=a.form;if(p==null)throw new Error('Cannot submit a