@openparachute/hub 0.7.4-rc.2 → 0.7.4-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -11
- package/src/__tests__/admin-auth.test.ts +128 -0
- package/src/__tests__/admin-clients.test.ts +103 -1
- package/src/__tests__/admin-lock.test.ts +7 -1
- package/src/__tests__/admin-vaults.test.ts +216 -10
- package/src/__tests__/api-account-2fa.test.ts +453 -0
- package/src/__tests__/api-hub-upgrade.test.ts +59 -3
- package/src/__tests__/api-mint-token.test.ts +75 -0
- package/src/__tests__/api-modules.test.ts +143 -0
- package/src/__tests__/api-settings-root-redirect.test.ts +302 -0
- package/src/__tests__/auth.test.ts +336 -0
- package/src/__tests__/clients.test.ts +326 -8
- package/src/__tests__/cloudflare-connector-service.test.ts +3 -1
- package/src/__tests__/cors.test.ts +138 -1
- package/src/__tests__/doctor.test.ts +755 -0
- package/src/__tests__/hub-command.test.ts +69 -2
- package/src/__tests__/hub-server.test.ts +127 -5
- package/src/__tests__/hub-settings.test.ts +188 -0
- package/src/__tests__/init.test.ts +153 -0
- package/src/__tests__/jwt-sign.test.ts +27 -0
- package/src/__tests__/managed-unit.test.ts +62 -0
- package/src/__tests__/oauth-handlers.test.ts +626 -0
- package/src/__tests__/oauth-ui.test.ts +107 -1
- package/src/__tests__/scope-explanations.test.ts +19 -0
- package/src/__tests__/setup-gate.test.ts +111 -3
- package/src/__tests__/setup-wizard.test.ts +124 -7
- package/src/__tests__/supervisor.test.ts +25 -0
- package/src/__tests__/vault-names.test.ts +32 -3
- package/src/__tests__/vault-remove.test.ts +40 -19
- package/src/__tests__/well-known.test.ts +37 -2
- package/src/admin-agent-grants.ts +16 -1
- package/src/admin-auth.ts +13 -4
- package/src/admin-clients.ts +66 -5
- package/src/admin-grants.ts +11 -2
- package/src/admin-vaults.ts +77 -27
- package/src/api-account-2fa.ts +395 -0
- package/src/api-admin-lock.ts +7 -0
- package/src/api-hub-upgrade.ts +52 -4
- package/src/api-hub.ts +10 -1
- package/src/api-invites.ts +18 -3
- package/src/api-me.ts +11 -2
- package/src/api-mint-token.ts +16 -1
- package/src/api-modules.ts +119 -1
- package/src/api-revoke-token.ts +14 -1
- package/src/api-settings-hub-origin.ts +14 -1
- package/src/api-settings-root-redirect.ts +201 -0
- package/src/api-tokens.ts +14 -1
- package/src/api-users.ts +15 -6
- package/src/api-vault-caps.ts +11 -2
- package/src/cli.ts +56 -5
- package/src/clients.ts +178 -0
- package/src/commands/auth.ts +263 -1
- package/src/commands/doctor.ts +1250 -0
- package/src/commands/hub.ts +102 -1
- package/src/commands/init.ts +108 -0
- package/src/commands/vault-remove.ts +16 -24
- package/src/cors.ts +7 -3
- package/src/help.ts +65 -1
- package/src/hub-db.ts +14 -0
- package/src/hub-server.ts +173 -25
- package/src/hub-settings.ts +163 -1
- package/src/jwt-sign.ts +25 -6
- package/src/managed-unit.ts +30 -1
- package/src/oauth-handlers.ts +110 -7
- package/src/oauth-ui.ts +174 -0
- package/src/rate-limit.ts +28 -0
- package/src/scope-explanations.ts +2 -1
- package/src/setup-wizard.ts +40 -21
- package/src/supervisor.ts +46 -2
- package/src/vault-names.ts +15 -4
- package/src/well-known.ts +10 -1
- package/web/ui/dist/assets/{index--728BX3j.css → index-BcC4U5gM.css} +1 -1
- package/web/ui/dist/assets/index-CVqK1cV5.js +61 -0
- package/web/ui/dist/index.html +2 -2
- package/web/ui/dist/assets/index-DZzX_Enf.js +0 -61
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&o(g)}).observe(document,{childList:!0,subtree:!0});function c(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(f){if(f.ep)return;f.ep=!0;const h=c(f);fetch(f.href,h)}})();var Xr={exports:{}},Yl={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Th;function iv(){if(Th)return Yl;Th=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function c(o,f,h){var g=null;if(h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),"key"in f){h={};for(var y in f)y!=="key"&&(h[y]=f[y])}else h=f;return f=h.ref,{$$typeof:l,type:o,key:g,ref:f!==void 0?f:null,props:h}}return Yl.Fragment=r,Yl.jsx=c,Yl.jsxs=c,Yl}var _h;function sv(){return _h||(_h=1,Xr.exports=iv()),Xr.exports}var i=sv(),Qr={exports:{}},ce={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ah;function uv(){if(Ah)return ce;Ah=1;var l=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),_=Symbol.iterator;function k(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,L={};function z(N,G,I){this.props=N,this.context=G,this.refs=L,this.updater=I||C}z.prototype.isReactComponent={},z.prototype.setState=function(N,G){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,G,"setState")},z.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function Z(){}Z.prototype=z.prototype;function X(N,G,I){this.props=N,this.context=G,this.refs=L,this.updater=I||C}var P=X.prototype=new Z;P.constructor=X,O(P,z.prototype),P.isPureReactComponent=!0;var K=Array.isArray;function J(){}var E={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function Q(N,G,I){var ae=I.ref;return{$$typeof:l,type:N,key:G,ref:ae!==void 0?ae:null,props:I}}function te(N,G){return Q(N.type,G,N.props)}function le(N){return typeof N=="object"&&N!==null&&N.$$typeof===l}function ie(N){var G={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(I){return G[I]})}var W=/\/+/g;function ge(N,G){return typeof N=="object"&&N!==null&&N.key!=null?ie(""+N.key):G.toString(36)}function be(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(J,J):(N.status="pending",N.then(function(G){N.status==="pending"&&(N.status="fulfilled",N.value=G)},function(G){N.status==="pending"&&(N.status="rejected",N.reason=G)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function H(N,G,I,ae,oe){var he=typeof N;(he==="undefined"||he==="boolean")&&(N=null);var Ne=!1;if(N===null)Ne=!0;else switch(he){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(N.$$typeof){case l:case r:Ne=!0;break;case x:return Ne=N._init,H(Ne(N._payload),G,I,ae,oe)}}if(Ne)return oe=oe(N),Ne=ae===""?"."+ge(N,0):ae,K(oe)?(I="",Ne!=null&&(I=Ne.replace(W,"$&/")+"/"),H(oe,G,I,"",function(Jn){return Jn})):oe!=null&&(le(oe)&&(oe=te(oe,I+(oe.key==null||N&&N.key===oe.key?"":(""+oe.key).replace(W,"$&/")+"/")+Ne)),G.push(oe)),1;Ne=0;var it=ae===""?".":ae+":";if(K(N))for(var Ye=0;Ye<N.length;Ye++)ae=N[Ye],he=it+ge(ae,Ye),Ne+=H(ae,G,I,he,oe);else if(Ye=k(N),typeof Ye=="function")for(N=Ye.call(N),Ye=0;!(ae=N.next()).done;)ae=ae.value,he=it+ge(ae,Ye++),Ne+=H(ae,G,I,he,oe);else if(he==="object"){if(typeof N.then=="function")return H(be(N),G,I,ae,oe);throw G=String(N),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function F(N,G,I){if(N==null)return N;var ae=[],oe=0;return H(N,ae,"","",function(he){return G.call(I,he,oe++)}),ae}function re(N){if(N._status===-1){var G=N._result;G=G(),G.then(function(I){(N._status===0||N._status===-1)&&(N._status=1,N._result=I)},function(I){(N._status===0||N._status===-1)&&(N._status=2,N._result=I)}),N._status===-1&&(N._status=0,N._result=G)}if(N._status===1)return N._result.default;throw N._result}var Te=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},ze={map:F,forEach:function(N,G,I){F(N,function(){G.apply(this,arguments)},I)},count:function(N){var G=0;return F(N,function(){G++}),G},toArray:function(N){return F(N,function(G){return G})||[]},only:function(N){if(!le(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return ce.Activity=j,ce.Children=ze,ce.Component=z,ce.Fragment=c,ce.Profiler=f,ce.PureComponent=X,ce.StrictMode=o,ce.Suspense=m,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,ce.__COMPILER_RUNTIME={__proto__:null,c:function(N){return E.H.useMemoCache(N)}},ce.cache=function(N){return function(){return N.apply(null,arguments)}},ce.cacheSignal=function(){return null},ce.cloneElement=function(N,G,I){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ae=O({},N.props),oe=N.key;if(G!=null)for(he in G.key!==void 0&&(oe=""+G.key),G)!D.call(G,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&G.ref===void 0||(ae[he]=G[he]);var he=arguments.length-2;if(he===1)ae.children=I;else if(1<he){for(var Ne=Array(he),it=0;it<he;it++)Ne[it]=arguments[it+2];ae.children=Ne}return Q(N.type,oe,ae)},ce.createContext=function(N){return N={$$typeof:g,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:h,_context:N},N},ce.createElement=function(N,G,I){var ae,oe={},he=null;if(G!=null)for(ae in G.key!==void 0&&(he=""+G.key),G)D.call(G,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(oe[ae]=G[ae]);var Ne=arguments.length-2;if(Ne===1)oe.children=I;else if(1<Ne){for(var it=Array(Ne),Ye=0;Ye<Ne;Ye++)it[Ye]=arguments[Ye+2];oe.children=it}if(N&&N.defaultProps)for(ae in Ne=N.defaultProps,Ne)oe[ae]===void 0&&(oe[ae]=Ne[ae]);return Q(N,he,oe)},ce.createRef=function(){return{current:null}},ce.forwardRef=function(N){return{$$typeof:y,render:N}},ce.isValidElement=le,ce.lazy=function(N){return{$$typeof:x,_payload:{_status:-1,_result:N},_init:re}},ce.memo=function(N,G){return{$$typeof:v,type:N,compare:G===void 0?null:G}},ce.startTransition=function(N){var G=E.T,I={};E.T=I;try{var ae=N(),oe=E.S;oe!==null&&oe(I,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(J,Te)}catch(he){Te(he)}finally{G!==null&&I.types!==null&&(G.types=I.types),E.T=G}},ce.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},ce.use=function(N){return E.H.use(N)},ce.useActionState=function(N,G,I){return E.H.useActionState(N,G,I)},ce.useCallback=function(N,G){return E.H.useCallback(N,G)},ce.useContext=function(N){return E.H.useContext(N)},ce.useDebugValue=function(){},ce.useDeferredValue=function(N,G){return E.H.useDeferredValue(N,G)},ce.useEffect=function(N,G){return E.H.useEffect(N,G)},ce.useEffectEvent=function(N){return E.H.useEffectEvent(N)},ce.useId=function(){return E.H.useId()},ce.useImperativeHandle=function(N,G,I){return E.H.useImperativeHandle(N,G,I)},ce.useInsertionEffect=function(N,G){return E.H.useInsertionEffect(N,G)},ce.useLayoutEffect=function(N,G){return E.H.useLayoutEffect(N,G)},ce.useMemo=function(N,G){return E.H.useMemo(N,G)},ce.useOptimistic=function(N,G){return E.H.useOptimistic(N,G)},ce.useReducer=function(N,G,I){return E.H.useReducer(N,G,I)},ce.useRef=function(N){return E.H.useRef(N)},ce.useState=function(N){return E.H.useState(N)},ce.useSyncExternalStore=function(N,G,I){return E.H.useSyncExternalStore(N,G,I)},ce.useTransition=function(){return E.H.useTransition()},ce.version="19.2.5",ce}var Rh;function dc(){return Rh||(Rh=1,Qr.exports=uv()),Qr.exports}var b=dc(),$r={exports:{}},Gl={},Jr={exports:{}},Kr={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Mh;function rv(){return Mh||(Mh=1,(function(l){function r(H,F){var re=H.length;H.push(F);e:for(;0<re;){var Te=re-1>>>1,ze=H[Te];if(0<f(ze,F))H[Te]=F,H[re]=ze,re=Te;else break e}}function c(H){return H.length===0?null:H[0]}function o(H){if(H.length===0)return null;var F=H[0],re=H.pop();if(re!==F){H[0]=re;e:for(var Te=0,ze=H.length,N=ze>>>1;Te<N;){var G=2*(Te+1)-1,I=H[G],ae=G+1,oe=H[ae];if(0>f(I,re))ae<ze&&0>f(oe,I)?(H[Te]=oe,H[ae]=re,Te=ae):(H[Te]=I,H[G]=re,Te=G);else if(ae<ze&&0>f(oe,re))H[Te]=oe,H[ae]=re,Te=ae;else break e}}return F}function f(H,F){var re=H.sortIndex-F.sortIndex;return re!==0?re:H.id-F.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;l.unstable_now=function(){return h.now()}}else{var g=Date,y=g.now();l.unstable_now=function(){return g.now()-y}}var m=[],v=[],x=1,j=null,_=3,k=!1,C=!1,O=!1,L=!1,z=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function P(H){for(var F=c(v);F!==null;){if(F.callback===null)o(v);else if(F.startTime<=H)o(v),F.sortIndex=F.expirationTime,r(m,F);else break;F=c(v)}}function K(H){if(O=!1,P(H),!C)if(c(m)!==null)C=!0,J||(J=!0,ie());else{var F=c(v);F!==null&&be(K,F.startTime-H)}}var J=!1,E=-1,D=5,Q=-1;function te(){return L?!0:!(l.unstable_now()-Q<D)}function le(){if(L=!1,J){var H=l.unstable_now();Q=H;var F=!0;try{e:{C=!1,O&&(O=!1,Z(E),E=-1),k=!0;var re=_;try{t:{for(P(H),j=c(m);j!==null&&!(j.expirationTime>H&&te());){var Te=j.callback;if(typeof Te=="function"){j.callback=null,_=j.priorityLevel;var ze=Te(j.expirationTime<=H);if(H=l.unstable_now(),typeof ze=="function"){j.callback=ze,P(H),F=!0;break t}j===c(m)&&o(m),P(H)}else o(m);j=c(m)}if(j!==null)F=!0;else{var N=c(v);N!==null&&be(K,N.startTime-H),F=!1}}break e}finally{j=null,_=re,k=!1}F=void 0}}finally{F?ie():J=!1}}}var ie;if(typeof X=="function")ie=function(){X(le)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ge=W.port2;W.port1.onmessage=le,ie=function(){ge.postMessage(null)}}else ie=function(){z(le,0)};function be(H,F){E=z(function(){H(l.unstable_now())},F)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(H){H.callback=null},l.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<H?Math.floor(1e3/H):5},l.unstable_getCurrentPriorityLevel=function(){return _},l.unstable_next=function(H){switch(_){case 1:case 2:case 3:var F=3;break;default:F=_}var re=_;_=F;try{return H()}finally{_=re}},l.unstable_requestPaint=function(){L=!0},l.unstable_runWithPriority=function(H,F){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var re=_;_=H;try{return F()}finally{_=re}},l.unstable_scheduleCallback=function(H,F,re){var Te=l.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?Te+re:Te):re=Te,H){case 1:var ze=-1;break;case 2:ze=250;break;case 5:ze=1073741823;break;case 4:ze=1e4;break;default:ze=5e3}return ze=re+ze,H={id:x++,callback:F,priorityLevel:H,startTime:re,expirationTime:ze,sortIndex:-1},re>Te?(H.sortIndex=re,r(v,H),c(m)===null&&H===c(v)&&(O?(Z(E),E=-1):O=!0,be(K,re-Te))):(H.sortIndex=ze,r(m,H),C||k||(C=!0,J||(J=!0,ie()))),H},l.unstable_shouldYield=te,l.unstable_wrapCallback=function(H){var F=_;return function(){var re=_;_=F;try{return H.apply(this,arguments)}finally{_=re}}}})(Kr)),Kr}var zh;function cv(){return zh||(zh=1,Jr.exports=rv()),Jr.exports}var Fr={exports:{}},at={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Oh;function ov(){if(Oh)return at;Oh=1;var l=dc();function r(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)v+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(){}var o={d:{f:c,r:function(){throw Error(r(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},f=Symbol.for("react.portal");function h(m,v,x){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:j==null?null:""+j,children:m,containerInfo:v,implementation:x}}var g=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(m,v){if(m==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return at.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,at.createPortal=function(m,v){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(r(299));return h(m,v,null,x)},at.flushSync=function(m){var v=g.T,x=o.p;try{if(g.T=null,o.p=2,m)return m()}finally{g.T=v,o.p=x,o.d.f()}},at.preconnect=function(m,v){typeof m=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(m,v))},at.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},at.preinit=function(m,v){if(typeof m=="string"&&v&&typeof v.as=="string"){var x=v.as,j=y(x,v.crossOrigin),_=typeof v.integrity=="string"?v.integrity:void 0,k=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?o.d.S(m,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:j,integrity:_,fetchPriority:k}):x==="script"&&o.d.X(m,{crossOrigin:j,integrity:_,fetchPriority:k,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},at.preinitModule=function(m,v){if(typeof m=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var x=y(v.as,v.crossOrigin);o.d.M(m,{crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&o.d.M(m)},at.preload=function(m,v){if(typeof m=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var x=v.as,j=y(x,v.crossOrigin);o.d.L(m,x,{crossOrigin:j,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},at.preloadModule=function(m,v){if(typeof m=="string")if(v){var x=y(v.as,v.crossOrigin);o.d.m(m,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else o.d.m(m)},at.requestFormReset=function(m){o.d.r(m)},at.unstable_batchedUpdates=function(m,v){return m(v)},at.useFormState=function(m,v,x){return g.H.useFormState(m,v,x)},at.useFormStatus=function(){return g.H.useHostTransitionStatus()},at.version="19.2.5",at}var Uh;function dv(){if(Uh)return Fr.exports;Uh=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),Fr.exports=ov(),Fr.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Dh;function fv(){if(Dh)return Gl;Dh=1;var l=cv(),r=dc(),c=dv();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function g(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(h(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,n=t;;){var s=a.return;if(s===null)break;var u=s.alternate;if(u===null){if(n=s.return,n!==null){a=n;continue}break}if(s.child===u.child){for(u=s.child;u;){if(u===a)return m(s),e;if(u===n)return m(s),t;u=u.sibling}throw Error(o(188))}if(a.return!==n.return)a=s,n=u;else{for(var d=!1,p=s.child;p;){if(p===a){d=!0,a=s,n=u;break}if(p===n){d=!0,n=s,a=u;break}p=p.sibling}if(!d){for(p=u.child;p;){if(p===a){d=!0,a=u,n=s;break}if(p===n){d=!0,n=u,a=s;break}p=p.sibling}if(!d)throw Error(o(189))}}if(a.alternate!==n)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,_=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),X=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),le=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=le&&e[le]||e["@@iterator"],typeof e=="function"?e:null)}var W=Symbol.for("react.client.reference");function ge(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===W?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case z:return"Profiler";case L:return"StrictMode";case K:return"Suspense";case J:return"SuspenseList";case Q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case X:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case P:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case E:return t=e.displayName||null,t!==null?t:ge(e.type)||"Memo";case D:t=e._payload,e=e._init;try{return ge(e(t))}catch{}}return null}var be=Array.isArray,H=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},Te=[],ze=-1;function N(e){return{current:e}}function G(e){0>ze||(e.current=Te[ze],Te[ze]=null,ze--)}function I(e,t){ze++,Te[ze]=e.current,e.current=t}var ae=N(null),oe=N(null),he=N(null),Ne=N(null);function it(e,t){switch(I(he,t),I(oe,e),I(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Wf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Wf(t),e=If(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(ae),I(ae,e)}function Ye(){G(ae),G(oe),G(he)}function Jn(e){e.memoizedState!==null&&I(Ne,e);var t=ae.current,a=If(t,e.type);t!==a&&(I(oe,e),I(ae,a))}function Kl(e){oe.current===e&&(G(ae),G(oe)),Ne.current===e&&(G(Ne),Hl._currentValue=re)}var ks,Nc;function La(e){if(ks===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ks=t&&t[1]||"",Nc=-1<a.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+ks+e+Nc}var Ts=!1;function _s(e,t){if(!e||Ts)return"";Ts=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(U){var M=U}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(U){M=U}e.call(Y.prototype)}}else{try{throw Error()}catch(U){M=U}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(U){if(U&&M&&typeof U.stack=="string")return[U.stack,M.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=n.DetermineComponentFrameRoot(),d=u[0],p=u[1];if(d&&p){var S=d.split(`
|
|
44
|
+
`),R=p.split(`
|
|
45
|
+
`);for(s=n=0;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;for(;s<R.length&&!R[s].includes("DetermineComponentFrameRoot");)s++;if(n===S.length||s===R.length)for(n=S.length-1,s=R.length-1;1<=n&&0<=s&&S[n]!==R[s];)s--;for(;1<=n&&0<=s;n--,s--)if(S[n]!==R[s]){if(n!==1||s!==1)do if(n--,s--,0>s||S[n]!==R[s]){var B=`
|
|
46
|
+
`+S[n].replace(" at new "," at ");return e.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",e.displayName)),B}while(1<=n&&0<=s);break}}}finally{Ts=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?La(a):""}function Dm(e,t){switch(e.tag){case 26:case 27:case 5:return La(e.type);case 16:return La("Lazy");case 13:return e.child!==t&&t!==null?La("Suspense Fallback"):La("Suspense");case 19:return La("SuspenseList");case 0:case 15:return _s(e.type,!1);case 11:return _s(e.type.render,!1);case 1:return _s(e.type,!0);case 31:return La("Activity");default:return""}}function Ec(e){try{var t="",a=null;do t+=Dm(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var As=Object.prototype.hasOwnProperty,Rs=l.unstable_scheduleCallback,Ms=l.unstable_cancelCallback,Hm=l.unstable_shouldYield,Bm=l.unstable_requestPaint,mt=l.unstable_now,Lm=l.unstable_getCurrentPriorityLevel,kc=l.unstable_ImmediatePriority,Tc=l.unstable_UserBlockingPriority,Fl=l.unstable_NormalPriority,qm=l.unstable_LowPriority,_c=l.unstable_IdlePriority,Ym=l.log,Gm=l.unstable_setDisableYieldValue,Kn=null,pt=null;function ha(e){if(typeof Ym=="function"&&Gm(e),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Kn,e)}catch{}}var gt=Math.clz32?Math.clz32:Xm,Vm=Math.log,Zm=Math.LN2;function Xm(e){return e>>>=0,e===0?32:31-(Vm(e)/Zm|0)|0}var Wl=256,Il=262144,Pl=4194304;function qa(e){var t=e&42;if(t!==0)return t;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 ei(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var s=0,u=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var p=n&134217727;return p!==0?(n=p&~u,n!==0?s=qa(n):(d&=p,d!==0?s=qa(d):a||(a=p&~e,a!==0&&(s=qa(a))))):(p=n&~u,p!==0?s=qa(p):d!==0?s=qa(d):a||(a=n&~e,a!==0&&(s=qa(a)))),s===0?0:t!==0&&t!==s&&(t&u)===0&&(u=s&-s,a=t&-t,u>=a||u===32&&(a&4194048)!==0)?t:s}function Fn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qm(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ac(){var e=Pl;return Pl<<=1,(Pl&62914560)===0&&(Pl=4194304),e}function zs(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Wn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $m(e,t,a,n,s,u){var d=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 p=e.entanglements,S=e.expirationTimes,R=e.hiddenUpdates;for(a=d&~a;0<a;){var B=31-gt(a),Y=1<<B;p[B]=0,S[B]=-1;var M=R[B];if(M!==null)for(R[B]=null,B=0;B<M.length;B++){var U=M[B];U!==null&&(U.lane&=-536870913)}a&=~Y}n!==0&&Rc(e,n,0),u!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=u&~(d&~t))}function Rc(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-gt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Mc(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-gt(a),s=1<<n;s&t|e[n]&t&&(e[n]|=t),a&=~s}}function zc(e,t){var a=t&-t;return a=(a&42)!==0?1:Os(a),(a&(e.suspendedLanes|t))!==0?0:a}function Os(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Us(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Oc(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:jh(e.type))}function Uc(e,t){var a=F.p;try{return F.p=e,t()}finally{F.p=a}}var ma=Math.random().toString(36).slice(2),We="__reactFiber$"+ma,ut="__reactProps$"+ma,sn="__reactContainer$"+ma,Ds="__reactEvents$"+ma,Jm="__reactListeners$"+ma,Km="__reactHandles$"+ma,Dc="__reactResources$"+ma,In="__reactMarker$"+ma;function Hs(e){delete e[We],delete e[ut],delete e[Ds],delete e[Jm],delete e[Km]}function un(e){var t=e[We];if(t)return t;for(var a=e.parentNode;a;){if(t=a[sn]||a[We]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=ih(e);e!==null;){if(a=e[We])return a;e=ih(e)}return t}e=a,a=e.parentNode}return null}function rn(e){if(e=e[We]||e[sn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function cn(e){var t=e[Dc];return t||(t=e[Dc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ke(e){e[In]=!0}var Hc=new Set,Bc={};function Ya(e,t){on(e,t),on(e+"Capture",t)}function on(e,t){for(Bc[e]=t,e=0;e<t.length;e++)Hc.add(t[e])}var Fm=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Lc={},qc={};function Wm(e){return As.call(qc,e)?!0:As.call(Lc,e)?!1:Fm.test(e)?qc[e]=!0:(Lc[e]=!0,!1)}function ti(e,t,a){if(Wm(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function ai(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function $t(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Im(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){a=""+d,u.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bs(e){if(!e._valueTracker){var t=Yc(e)?"checked":"value";e._valueTracker=Im(e,t,""+e[t])}}function Gc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Yc(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function ni(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Pm=/[\n"\\]/g;function Tt(e){return e.replace(Pm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ls(e,t,a,n,s,u,d,p){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+kt(t)):e.value!==""+kt(t)&&(e.value=""+kt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?qs(e,d,kt(t)):a!=null?qs(e,d,kt(a)):n!=null&&e.removeAttribute("value"),s==null&&u!=null&&(e.defaultChecked=!!u),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+kt(p):e.removeAttribute("name")}function Vc(e,t,a,n,s,u,d,p){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||a!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Bs(e);return}a=a!=null?""+kt(a):"",t=t!=null?""+kt(t):a,p||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=p?e.checked:!!n,e.defaultChecked=!!n,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Bs(e)}function qs(e,t,a){t==="number"&&ni(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function dn(e,t,a,n){if(e=e.options,t){t={};for(var s=0;s<a.length;s++)t["$"+a[s]]=!0;for(a=0;a<e.length;a++)s=t.hasOwnProperty("$"+e[a].value),e[a].selected!==s&&(e[a].selected=s),s&&n&&(e[a].defaultSelected=!0)}else{for(a=""+kt(a),t=null,s=0;s<e.length;s++){if(e[s].value===a){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Zc(e,t,a){if(t!=null&&(t=""+kt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+kt(a):""}function Xc(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(o(92));if(be(n)){if(1<n.length)throw Error(o(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=kt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Bs(e)}function fn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var ep=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Qc(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||ep.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function $c(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var s in t)n=t[s],t.hasOwnProperty(s)&&a[s]!==n&&Qc(e,s,n)}else for(var u in t)t.hasOwnProperty(u)&&Qc(e,u,t[u])}function Ys(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),ap=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function li(e){return ap.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jt(){}var Gs=null;function Vs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hn=null,mn=null;function Jc(e){var t=rn(e);if(t&&(e=t.stateNode)){var a=e[ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ls(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Tt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var s=n[ut]||null;if(!s)throw Error(o(90));Ls(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Gc(n)}break e;case"textarea":Zc(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&dn(e,!!a.multiple,t,!1)}}}var Zs=!1;function Kc(e,t,a){if(Zs)return e(t,a);Zs=!0;try{var n=e(t);return n}finally{if(Zs=!1,(hn!==null||mn!==null)&&(Xi(),hn&&(t=hn,e=mn,mn=hn=null,Jc(t),e)))for(t=0;t<e.length;t++)Jc(e[t])}}function el(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ut]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var Kt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xs=!1;if(Kt)try{var tl={};Object.defineProperty(tl,"passive",{get:function(){Xs=!0}}),window.addEventListener("test",tl,tl),window.removeEventListener("test",tl,tl)}catch{Xs=!1}var pa=null,Qs=null,ii=null;function Fc(){if(ii)return ii;var e,t=Qs,a=t.length,n,s="value"in pa?pa.value:pa.textContent,u=s.length;for(e=0;e<a&&t[e]===s[e];e++);var d=a-e;for(n=1;n<=d&&t[a-n]===s[u-n];n++);return ii=s.slice(e,1<n?1-n:void 0)}function si(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ui(){return!0}function Wc(){return!1}function rt(e){function t(a,n,s,u,d){this._reactName=a,this._targetInst=s,this.type=n,this.nativeEvent=u,this.target=d,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(a=e[p],this[p]=a?a(u):u[p]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?ui:Wc,this.isPropagationStopped=Wc,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=ui)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ui)},persist:function(){},isPersistent:ui}),t}var Ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ri=rt(Ga),al=j({},Ga,{view:0,detail:0}),np=rt(al),$s,Js,nl,ci=j({},al,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fs,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==nl&&(nl&&e.type==="mousemove"?($s=e.screenX-nl.screenX,Js=e.screenY-nl.screenY):Js=$s=0,nl=e),$s)},movementY:function(e){return"movementY"in e?e.movementY:Js}}),Ic=rt(ci),lp=j({},ci,{dataTransfer:0}),ip=rt(lp),sp=j({},al,{relatedTarget:0}),Ks=rt(sp),up=j({},Ga,{animationName:0,elapsedTime:0,pseudoElement:0}),rp=rt(up),cp=j({},Ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),op=rt(cp),dp=j({},Ga,{data:0}),Pc=rt(dp),fp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hp={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},mp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function pp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=mp[e])?!!t[e]:!1}function Fs(){return pp}var gp=j({},al,{key:function(e){if(e.key){var t=fp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=si(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fs,charCode:function(e){return e.type==="keypress"?si(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?si(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vp=rt(gp),yp=j({},ci,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),eo=rt(yp),bp=j({},al,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fs}),xp=rt(bp),jp=j({},Ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sp=rt(jp),wp=j({},ci,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Cp=rt(wp),Np=j({},Ga,{newState:0,oldState:0}),Ep=rt(Np),kp=[9,13,27,32],Ws=Kt&&"CompositionEvent"in window,ll=null;Kt&&"documentMode"in document&&(ll=document.documentMode);var Tp=Kt&&"TextEvent"in window&&!ll,to=Kt&&(!Ws||ll&&8<ll&&11>=ll),ao=" ",no=!1;function lo(e,t){switch(e){case"keyup":return kp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function io(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pn=!1;function _p(e,t){switch(e){case"compositionend":return io(t);case"keypress":return t.which!==32?null:(no=!0,ao);case"textInput":return e=t.data,e===ao&&no?null:e;default:return null}}function Ap(e,t){if(pn)return e==="compositionend"||!Ws&&lo(e,t)?(e=Fc(),ii=Qs=pa=null,pn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return to&&t.locale!=="ko"?null:t.data;default:return null}}var Rp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function so(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Rp[e.type]:t==="textarea"}function uo(e,t,a,n){hn?mn?mn.push(n):mn=[n]:hn=n,t=Ii(t,"onChange"),0<t.length&&(a=new ri("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var il=null,sl=null;function Mp(e){Xf(e,0)}function oi(e){var t=Pn(e);if(Gc(t))return e}function ro(e,t){if(e==="change")return t}var co=!1;if(Kt){var Is;if(Kt){var Ps="oninput"in document;if(!Ps){var oo=document.createElement("div");oo.setAttribute("oninput","return;"),Ps=typeof oo.oninput=="function"}Is=Ps}else Is=!1;co=Is&&(!document.documentMode||9<document.documentMode)}function fo(){il&&(il.detachEvent("onpropertychange",ho),sl=il=null)}function ho(e){if(e.propertyName==="value"&&oi(sl)){var t=[];uo(t,sl,e,Vs(e)),Kc(Mp,t)}}function zp(e,t,a){e==="focusin"?(fo(),il=t,sl=a,il.attachEvent("onpropertychange",ho)):e==="focusout"&&fo()}function Op(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oi(sl)}function Up(e,t){if(e==="click")return oi(t)}function Dp(e,t){if(e==="input"||e==="change")return oi(t)}function Hp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vt=typeof Object.is=="function"?Object.is:Hp;function ul(e,t){if(vt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var s=a[n];if(!As.call(t,s)||!vt(e[s],t[s]))return!1}return!0}function mo(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function po(e,t){var a=mo(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=mo(a)}}function go(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?go(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ni(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ni(e.document)}return t}function eu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Bp=Kt&&"documentMode"in document&&11>=document.documentMode,gn=null,tu=null,rl=null,au=!1;function yo(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;au||gn==null||gn!==ni(n)||(n=gn,"selectionStart"in n&&eu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),rl&&ul(rl,n)||(rl=n,n=Ii(tu,"onSelect"),0<n.length&&(t=new ri("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=gn)))}function Va(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var vn={animationend:Va("Animation","AnimationEnd"),animationiteration:Va("Animation","AnimationIteration"),animationstart:Va("Animation","AnimationStart"),transitionrun:Va("Transition","TransitionRun"),transitionstart:Va("Transition","TransitionStart"),transitioncancel:Va("Transition","TransitionCancel"),transitionend:Va("Transition","TransitionEnd")},nu={},bo={};Kt&&(bo=document.createElement("div").style,"AnimationEvent"in window||(delete vn.animationend.animation,delete vn.animationiteration.animation,delete vn.animationstart.animation),"TransitionEvent"in window||delete vn.transitionend.transition);function Za(e){if(nu[e])return nu[e];if(!vn[e])return e;var t=vn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in bo)return nu[e]=t[a];return e}var xo=Za("animationend"),jo=Za("animationiteration"),So=Za("animationstart"),Lp=Za("transitionrun"),qp=Za("transitionstart"),Yp=Za("transitioncancel"),wo=Za("transitionend"),Co=new Map,lu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lu.push("scrollEnd");function Bt(e,t){Co.set(e,t),Ya(t,[e])}var di=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},_t=[],yn=0,iu=0;function fi(){for(var e=yn,t=iu=yn=0;t<e;){var a=_t[t];_t[t++]=null;var n=_t[t];_t[t++]=null;var s=_t[t];_t[t++]=null;var u=_t[t];if(_t[t++]=null,n!==null&&s!==null){var d=n.pending;d===null?s.next=s:(s.next=d.next,d.next=s),n.pending=s}u!==0&&No(a,s,u)}}function hi(e,t,a,n){_t[yn++]=e,_t[yn++]=t,_t[yn++]=a,_t[yn++]=n,iu|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function su(e,t,a,n){return hi(e,t,a,n),mi(e)}function Xa(e,t){return hi(e,null,null,t),mi(e)}function No(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var s=!1,u=e.return;u!==null;)u.childLanes|=a,n=u.alternate,n!==null&&(n.childLanes|=a),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(s=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,s&&t!==null&&(s=31-gt(a),e=u.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=a|536870912),u):null}function mi(e){if(50<Al)throw Al=0,pr=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bn={};function Gp(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yt(e,t,a,n){return new Gp(e,t,a,n)}function uu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ft(e,t){var a=e.alternate;return a===null?(a=yt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Eo(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,a,n,s,u){var d=0;if(n=e,typeof e=="function")uu(e)&&(d=1);else if(typeof e=="string")d=$g(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Q:return e=yt(31,a,t,s),e.elementType=Q,e.lanes=u,e;case O:return Qa(a.children,s,u,t);case L:d=8,s|=24;break;case z:return e=yt(12,a,t,s|2),e.elementType=z,e.lanes=u,e;case K:return e=yt(13,a,t,s),e.elementType=K,e.lanes=u,e;case J:return e=yt(19,a,t,s),e.elementType=J,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:d=10;break e;case Z:d=9;break e;case P:d=11;break e;case E:d=14;break e;case D:d=16,n=null;break e}d=29,a=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=yt(d,a,t,s),t.elementType=e,t.type=n,t.lanes=u,t}function Qa(e,t,a,n){return e=yt(7,e,n,t),e.lanes=a,e}function ru(e,t,a){return e=yt(6,e,null,t),e.lanes=a,e}function ko(e){var t=yt(18,null,null,0);return t.stateNode=e,t}function cu(e,t,a){return t=yt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var To=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var a=To.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ec(t)},To.set(e,t),t)}return{value:e,source:t,stack:Ec(t)}}var xn=[],jn=0,gi=null,cl=0,Rt=[],Mt=0,ga=null,Vt=1,Zt="";function Wt(e,t){xn[jn++]=cl,xn[jn++]=gi,gi=e,cl=t}function _o(e,t,a){Rt[Mt++]=Vt,Rt[Mt++]=Zt,Rt[Mt++]=ga,ga=e;var n=Vt;e=Zt;var s=32-gt(n)-1;n&=~(1<<s),a+=1;var u=32-gt(t)+s;if(30<u){var d=s-s%5;u=(n&(1<<d)-1).toString(32),n>>=d,s-=d,Vt=1<<32-gt(t)+s|a<<s|n,Zt=u+e}else Vt=1<<u|a<<s|n,Zt=e}function ou(e){e.return!==null&&(Wt(e,1),_o(e,1,0))}function du(e){for(;e===gi;)gi=xn[--jn],xn[jn]=null,cl=xn[--jn],xn[jn]=null;for(;e===ga;)ga=Rt[--Mt],Rt[Mt]=null,Zt=Rt[--Mt],Rt[Mt]=null,Vt=Rt[--Mt],Rt[Mt]=null}function Ao(e,t){Rt[Mt++]=Vt,Rt[Mt++]=Zt,Rt[Mt++]=ga,Vt=t.id,Zt=t.overflow,ga=e}var Ie=null,Ue=null,xe=!1,va=null,zt=!1,fu=Error(o(519));function ya(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ol(At(t,e)),fu}function Ro(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[We]=e,t[ut]=n,a){case"dialog":pe("cancel",t),pe("close",t);break;case"iframe":case"object":case"embed":pe("load",t);break;case"video":case"audio":for(a=0;a<Ml.length;a++)pe(Ml[a],t);break;case"source":pe("error",t);break;case"img":case"image":case"link":pe("error",t),pe("load",t);break;case"details":pe("toggle",t);break;case"input":pe("invalid",t),Vc(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":pe("invalid",t);break;case"textarea":pe("invalid",t),Xc(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Kf(t.textContent,a)?(n.popover!=null&&(pe("beforetoggle",t),pe("toggle",t)),n.onScroll!=null&&pe("scroll",t),n.onScrollEnd!=null&&pe("scrollend",t),n.onClick!=null&&(t.onclick=Jt),t=!0):t=!1,t||ya(e,!0)}function Mo(e){for(Ie=e.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:zt=!1;return;case 27:case 3:zt=!0;return;default:Ie=Ie.return}}function Sn(e){if(e!==Ie)return!1;if(!xe)return Mo(e),xe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Ar(e.type,e.memoizedProps)),a=!a),a&&Ue&&ya(e),Mo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ue=lh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ue=lh(e)}else t===27?(t=Ue,Ma(e.type)?(e=Ur,Ur=null,Ue=e):Ue=t):Ue=Ie?Ut(e.stateNode.nextSibling):null;return!0}function $a(){Ue=Ie=null,xe=!1}function hu(){var e=va;return e!==null&&(ft===null?ft=e:ft.push.apply(ft,e),va=null),e}function ol(e){va===null?va=[e]:va.push(e)}var mu=N(null),Ja=null,It=null;function ba(e,t,a){I(mu,t._currentValue),t._currentValue=a}function Pt(e){e._currentValue=mu.current,G(mu)}function pu(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function gu(e,t,a,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var u=s.dependencies;if(u!==null){var d=s.child;u=u.firstContext;e:for(;u!==null;){var p=u;u=s;for(var S=0;S<t.length;S++)if(p.context===t[S]){u.lanes|=a,p=u.alternate,p!==null&&(p.lanes|=a),pu(u.return,a,e),n||(d=null);break e}u=p.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(o(341));d.lanes|=a,u=d.alternate,u!==null&&(u.lanes|=a),pu(d,a,e),d=null}else d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function wn(e,t,a,n){e=null;for(var s=t,u=!1;s!==null;){if(!u){if((s.flags&524288)!==0)u=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var d=s.alternate;if(d===null)throw Error(o(387));if(d=d.memoizedProps,d!==null){var p=s.type;vt(s.pendingProps.value,d.value)||(e!==null?e.push(p):e=[p])}}else if(s===Ne.current){if(d=s.alternate,d===null)throw Error(o(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Hl):e=[Hl])}s=s.return}e!==null&&gu(t,e,a,n),t.flags|=262144}function vi(e){for(e=e.firstContext;e!==null;){if(!vt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ka(e){Ja=e,It=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pe(e){return zo(Ja,e)}function yi(e,t){return Ja===null&&Ka(e),zo(e,t)}function zo(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},It===null){if(e===null)throw Error(o(308));It=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else It=It.next=t;return a}var Vp=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Zp=l.unstable_scheduleCallback,Xp=l.unstable_NormalPriority,Ze={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vu(){return{controller:new Vp,data:new Map,refCount:0}}function dl(e){e.refCount--,e.refCount===0&&Zp(Xp,function(){e.controller.abort()})}var fl=null,yu=0,Cn=0,Nn=null;function Qp(e,t){if(fl===null){var a=fl=[];yu=0,Cn=jr(),Nn={status:"pending",value:void 0,then:function(n){a.push(n)}}}return yu++,t.then(Oo,Oo),t}function Oo(){if(--yu===0&&fl!==null){Nn!==null&&(Nn.status="fulfilled");var e=fl;fl=null,Cn=0,Nn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $p(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var s=0;s<a.length;s++)(0,a[s])(t)},function(s){for(n.status="rejected",n.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),n}var Uo=H.S;H.S=function(e,t){bf=mt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qp(e,t),Uo!==null&&Uo(e,t)};var Fa=N(null);function bu(){var e=Fa.current;return e!==null?e:Oe.pooledCache}function bi(e,t){t===null?I(Fa,Fa.current):I(Fa,t.pool)}function Do(){var e=bu();return e===null?null:{parent:Ze._currentValue,pool:e}}var En=Error(o(460)),xu=Error(o(474)),xi=Error(o(542)),ji={then:function(){}};function Ho(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Bo(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Jt,Jt),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qo(e),e;default:if(typeof t.status=="string")t.then(Jt,Jt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=n}},function(n){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qo(e),e}throw Ia=t,En}}function Wa(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ia=a,En):a}}var Ia=null;function Lo(){if(Ia===null)throw Error(o(459));var e=Ia;return Ia=null,e}function qo(e){if(e===En||e===xi)throw Error(o(483))}var kn=null,hl=0;function Si(e){var t=hl;return hl+=1,kn===null&&(kn=[]),Bo(kn,e,t)}function ml(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function wi(e,t){throw t.$$typeof===_?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yo(e){function t(T,w){if(e){var A=T.deletions;A===null?(T.deletions=[w],T.flags|=16):A.push(w)}}function a(T,w){if(!e)return null;for(;w!==null;)t(T,w),w=w.sibling;return null}function n(T){for(var w=new Map;T!==null;)T.key!==null?w.set(T.key,T):w.set(T.index,T),T=T.sibling;return w}function s(T,w){return T=Ft(T,w),T.index=0,T.sibling=null,T}function u(T,w,A){return T.index=A,e?(A=T.alternate,A!==null?(A=A.index,A<w?(T.flags|=67108866,w):A):(T.flags|=67108866,w)):(T.flags|=1048576,w)}function d(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function p(T,w,A,q){return w===null||w.tag!==6?(w=ru(A,T.mode,q),w.return=T,w):(w=s(w,A),w.return=T,w)}function S(T,w,A,q){var se=A.type;return se===O?B(T,w,A.props.children,q,A.key):w!==null&&(w.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===D&&Wa(se)===w.type)?(w=s(w,A.props),ml(w,A),w.return=T,w):(w=pi(A.type,A.key,A.props,null,T.mode,q),ml(w,A),w.return=T,w)}function R(T,w,A,q){return w===null||w.tag!==4||w.stateNode.containerInfo!==A.containerInfo||w.stateNode.implementation!==A.implementation?(w=cu(A,T.mode,q),w.return=T,w):(w=s(w,A.children||[]),w.return=T,w)}function B(T,w,A,q,se){return w===null||w.tag!==7?(w=Qa(A,T.mode,q,se),w.return=T,w):(w=s(w,A),w.return=T,w)}function Y(T,w,A){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=ru(""+w,T.mode,A),w.return=T,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case k:return A=pi(w.type,w.key,w.props,null,T.mode,A),ml(A,w),A.return=T,A;case C:return w=cu(w,T.mode,A),w.return=T,w;case D:return w=Wa(w),Y(T,w,A)}if(be(w)||ie(w))return w=Qa(w,T.mode,A,null),w.return=T,w;if(typeof w.then=="function")return Y(T,Si(w),A);if(w.$$typeof===X)return Y(T,yi(T,w),A);wi(T,w)}return null}function M(T,w,A,q){var se=w!==null?w.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return se!==null?null:p(T,w,""+A,q);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case k:return A.key===se?S(T,w,A,q):null;case C:return A.key===se?R(T,w,A,q):null;case D:return A=Wa(A),M(T,w,A,q)}if(be(A)||ie(A))return se!==null?null:B(T,w,A,q,null);if(typeof A.then=="function")return M(T,w,Si(A),q);if(A.$$typeof===X)return M(T,w,yi(T,A),q);wi(T,A)}return null}function U(T,w,A,q,se){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return T=T.get(A)||null,p(w,T,""+q,se);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case k:return T=T.get(q.key===null?A:q.key)||null,S(w,T,q,se);case C:return T=T.get(q.key===null?A:q.key)||null,R(w,T,q,se);case D:return q=Wa(q),U(T,w,A,q,se)}if(be(q)||ie(q))return T=T.get(A)||null,B(w,T,q,se,null);if(typeof q.then=="function")return U(T,w,A,Si(q),se);if(q.$$typeof===X)return U(T,w,A,yi(w,q),se);wi(w,q)}return null}function ee(T,w,A,q){for(var se=null,Se=null,ne=w,fe=w=0,ye=null;ne!==null&&fe<A.length;fe++){ne.index>fe?(ye=ne,ne=null):ye=ne.sibling;var we=M(T,ne,A[fe],q);if(we===null){ne===null&&(ne=ye);break}e&&ne&&we.alternate===null&&t(T,ne),w=u(we,w,fe),Se===null?se=we:Se.sibling=we,Se=we,ne=ye}if(fe===A.length)return a(T,ne),xe&&Wt(T,fe),se;if(ne===null){for(;fe<A.length;fe++)ne=Y(T,A[fe],q),ne!==null&&(w=u(ne,w,fe),Se===null?se=ne:Se.sibling=ne,Se=ne);return xe&&Wt(T,fe),se}for(ne=n(ne);fe<A.length;fe++)ye=U(ne,T,fe,A[fe],q),ye!==null&&(e&&ye.alternate!==null&&ne.delete(ye.key===null?fe:ye.key),w=u(ye,w,fe),Se===null?se=ye:Se.sibling=ye,Se=ye);return e&&ne.forEach(function(Ha){return t(T,Ha)}),xe&&Wt(T,fe),se}function ue(T,w,A,q){if(A==null)throw Error(o(151));for(var se=null,Se=null,ne=w,fe=w=0,ye=null,we=A.next();ne!==null&&!we.done;fe++,we=A.next()){ne.index>fe?(ye=ne,ne=null):ye=ne.sibling;var Ha=M(T,ne,we.value,q);if(Ha===null){ne===null&&(ne=ye);break}e&&ne&&Ha.alternate===null&&t(T,ne),w=u(Ha,w,fe),Se===null?se=Ha:Se.sibling=Ha,Se=Ha,ne=ye}if(we.done)return a(T,ne),xe&&Wt(T,fe),se;if(ne===null){for(;!we.done;fe++,we=A.next())we=Y(T,we.value,q),we!==null&&(w=u(we,w,fe),Se===null?se=we:Se.sibling=we,Se=we);return xe&&Wt(T,fe),se}for(ne=n(ne);!we.done;fe++,we=A.next())we=U(ne,T,fe,we.value,q),we!==null&&(e&&we.alternate!==null&&ne.delete(we.key===null?fe:we.key),w=u(we,w,fe),Se===null?se=we:Se.sibling=we,Se=we);return e&&ne.forEach(function(lv){return t(T,lv)}),xe&&Wt(T,fe),se}function Re(T,w,A,q){if(typeof A=="object"&&A!==null&&A.type===O&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case k:e:{for(var se=A.key;w!==null;){if(w.key===se){if(se=A.type,se===O){if(w.tag===7){a(T,w.sibling),q=s(w,A.props.children),q.return=T,T=q;break e}}else if(w.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===D&&Wa(se)===w.type){a(T,w.sibling),q=s(w,A.props),ml(q,A),q.return=T,T=q;break e}a(T,w);break}else t(T,w);w=w.sibling}A.type===O?(q=Qa(A.props.children,T.mode,q,A.key),q.return=T,T=q):(q=pi(A.type,A.key,A.props,null,T.mode,q),ml(q,A),q.return=T,T=q)}return d(T);case C:e:{for(se=A.key;w!==null;){if(w.key===se)if(w.tag===4&&w.stateNode.containerInfo===A.containerInfo&&w.stateNode.implementation===A.implementation){a(T,w.sibling),q=s(w,A.children||[]),q.return=T,T=q;break e}else{a(T,w);break}else t(T,w);w=w.sibling}q=cu(A,T.mode,q),q.return=T,T=q}return d(T);case D:return A=Wa(A),Re(T,w,A,q)}if(be(A))return ee(T,w,A,q);if(ie(A)){if(se=ie(A),typeof se!="function")throw Error(o(150));return A=se.call(A),ue(T,w,A,q)}if(typeof A.then=="function")return Re(T,w,Si(A),q);if(A.$$typeof===X)return Re(T,w,yi(T,A),q);wi(T,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,w!==null&&w.tag===6?(a(T,w.sibling),q=s(w,A),q.return=T,T=q):(a(T,w),q=ru(A,T.mode,q),q.return=T,T=q),d(T)):a(T,w)}return function(T,w,A,q){try{hl=0;var se=Re(T,w,A,q);return kn=null,se}catch(ne){if(ne===En||ne===xi)throw ne;var Se=yt(29,ne,null,T.mode);return Se.lanes=q,Se.return=T,Se}finally{}}}var Pa=Yo(!0),Go=Yo(!1),xa=!1;function ju(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Su(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ja(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Ce&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=mi(e),No(e,null,a),t}return hi(e,n,t,a),mi(e)}function pl(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Mc(e,a)}}function wu(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var s=null,u=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};u===null?s=u=d:u=u.next=d,a=a.next}while(a!==null);u===null?s=u=t:u=u.next=t}else s=u=t;a={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:u,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Cu=!1;function gl(){if(Cu){var e=Nn;if(e!==null)throw e}}function vl(e,t,a,n){Cu=!1;var s=e.updateQueue;xa=!1;var u=s.firstBaseUpdate,d=s.lastBaseUpdate,p=s.shared.pending;if(p!==null){s.shared.pending=null;var S=p,R=S.next;S.next=null,d===null?u=R:d.next=R,d=S;var B=e.alternate;B!==null&&(B=B.updateQueue,p=B.lastBaseUpdate,p!==d&&(p===null?B.firstBaseUpdate=R:p.next=R,B.lastBaseUpdate=S))}if(u!==null){var Y=s.baseState;d=0,B=R=S=null,p=u;do{var M=p.lane&-536870913,U=M!==p.lane;if(U?(ve&M)===M:(n&M)===M){M!==0&&M===Cn&&(Cu=!0),B!==null&&(B=B.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var ee=e,ue=p;M=t;var Re=a;switch(ue.tag){case 1:if(ee=ue.payload,typeof ee=="function"){Y=ee.call(Re,Y,M);break e}Y=ee;break e;case 3:ee.flags=ee.flags&-65537|128;case 0:if(ee=ue.payload,M=typeof ee=="function"?ee.call(Re,Y,M):ee,M==null)break e;Y=j({},Y,M);break e;case 2:xa=!0}}M=p.callback,M!==null&&(e.flags|=64,U&&(e.flags|=8192),U=s.callbacks,U===null?s.callbacks=[M]:U.push(M))}else U={lane:M,tag:p.tag,payload:p.payload,callback:p.callback,next:null},B===null?(R=B=U,S=Y):B=B.next=U,d|=M;if(p=p.next,p===null){if(p=s.shared.pending,p===null)break;U=p,p=U.next,U.next=null,s.lastBaseUpdate=U,s.shared.pending=null}}while(!0);B===null&&(S=Y),s.baseState=S,s.firstBaseUpdate=R,s.lastBaseUpdate=B,u===null&&(s.shared.lanes=0),ka|=d,e.lanes=d,e.memoizedState=Y}}function Vo(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Zo(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Vo(a[e],t)}var Tn=N(null),Ci=N(0);function Xo(e,t){e=ra,I(Ci,e),I(Tn,t),ra=e|t.baseLanes}function Nu(){I(Ci,ra),I(Tn,Tn.current)}function Eu(){ra=Ci.current,G(Tn),G(Ci)}var bt=N(null),Ot=null;function wa(e){var t=e.alternate;I(Ge,Ge.current&1),I(bt,e),Ot===null&&(t===null||Tn.current!==null||t.memoizedState!==null)&&(Ot=e)}function ku(e){I(Ge,Ge.current),I(bt,e),Ot===null&&(Ot=e)}function Qo(e){e.tag===22?(I(Ge,Ge.current),I(bt,e),Ot===null&&(Ot=e)):Ca()}function Ca(){I(Ge,Ge.current),I(bt,bt.current)}function xt(e){G(bt),Ot===e&&(Ot=null),G(Ge)}var Ge=N(0);function Ni(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||zr(a)||Or(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ea=0,de=null,_e=null,Xe=null,Ei=!1,_n=!1,en=!1,ki=0,yl=0,An=null,Jp=0;function Le(){throw Error(o(321))}function Tu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!vt(e[a],t[a]))return!1;return!0}function _u(e,t,a,n,s,u){return ea=u,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,H.H=e===null||e.memoizedState===null?_d:Zu,en=!1,u=a(n,s),en=!1,_n&&(u=Jo(t,a,n,s)),$o(e),u}function $o(e){H.H=jl;var t=_e!==null&&_e.next!==null;if(ea=0,Xe=_e=de=null,Ei=!1,yl=0,An=null,t)throw Error(o(300));e===null||Qe||(e=e.dependencies,e!==null&&vi(e)&&(Qe=!0))}function Jo(e,t,a,n){de=e;var s=0;do{if(_n&&(An=null),yl=0,_n=!1,25<=s)throw Error(o(301));if(s+=1,Xe=_e=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}H.H=Ad,u=t(a,n)}while(_n);return u}function Kp(){var e=H.H,t=e.useState()[0];return t=typeof t.then=="function"?bl(t):t,e=e.useState()[0],(_e!==null?_e.memoizedState:null)!==e&&(de.flags|=1024),t}function Au(){var e=ki!==0;return ki=0,e}function Ru(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Mu(e){if(Ei){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ei=!1}ea=0,Xe=_e=de=null,_n=!1,yl=ki=0,An=null}function st(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?de.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ve(){if(_e===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=_e.next;var t=Xe===null?de.memoizedState:Xe.next;if(t!==null)Xe=t,_e=e;else{if(e===null)throw de.alternate===null?Error(o(467)):Error(o(310));_e=e,e={memoizedState:_e.memoizedState,baseState:_e.baseState,baseQueue:_e.baseQueue,queue:_e.queue,next:null},Xe===null?de.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Ti(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bl(e){var t=yl;return yl+=1,An===null&&(An=[]),e=Bo(An,e,t),t=de,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,H.H=t===null||t.memoizedState===null?_d:Zu),e}function _i(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return bl(e);if(e.$$typeof===X)return Pe(e)}throw Error(o(438,String(e)))}function zu(e){var t=null,a=de.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=de.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ti(),de.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=te;return t.index++,a}function ta(e,t){return typeof t=="function"?t(e):t}function Ai(e){var t=Ve();return Ou(t,_e,e)}function Ou(e,t,a){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=a;var s=e.baseQueue,u=n.pending;if(u!==null){if(s!==null){var d=s.next;s.next=u.next,u.next=d}t.baseQueue=s=u,n.pending=null}if(u=e.baseState,s===null)e.memoizedState=u;else{t=s.next;var p=d=null,S=null,R=t,B=!1;do{var Y=R.lane&-536870913;if(Y!==R.lane?(ve&Y)===Y:(ea&Y)===Y){var M=R.revertLane;if(M===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),Y===Cn&&(B=!0);else if((ea&M)===M){R=R.next,M===Cn&&(B=!0);continue}else Y={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},S===null?(p=S=Y,d=u):S=S.next=Y,de.lanes|=M,ka|=M;Y=R.action,en&&a(u,Y),u=R.hasEagerState?R.eagerState:a(u,Y)}else M={lane:Y,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},S===null?(p=S=M,d=u):S=S.next=M,de.lanes|=Y,ka|=Y;R=R.next}while(R!==null&&R!==t);if(S===null?d=u:S.next=p,!vt(u,e.memoizedState)&&(Qe=!0,B&&(a=Nn,a!==null)))throw a;e.memoizedState=u,e.baseState=d,e.baseQueue=S,n.lastRenderedState=u}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Uu(e){var t=Ve(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var n=a.dispatch,s=a.pending,u=t.memoizedState;if(s!==null){a.pending=null;var d=s=s.next;do u=e(u,d.action),d=d.next;while(d!==s);vt(u,t.memoizedState)||(Qe=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),a.lastRenderedState=u}return[u,n]}function Ko(e,t,a){var n=de,s=Ve(),u=xe;if(u){if(a===void 0)throw Error(o(407));a=a()}else a=t();var d=!vt((_e||s).memoizedState,a);if(d&&(s.memoizedState=a,Qe=!0),s=s.queue,Bu(Io.bind(null,n,s,e),[e]),s.getSnapshot!==t||d||Xe!==null&&Xe.memoizedState.tag&1){if(n.flags|=2048,Rn(9,{destroy:void 0},Wo.bind(null,n,s,a,t),null),Oe===null)throw Error(o(349));u||(ea&127)!==0||Fo(n,t,a)}return a}function Fo(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=de.updateQueue,t===null?(t=Ti(),de.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Wo(e,t,a,n){t.value=a,t.getSnapshot=n,Po(t)&&ed(e)}function Io(e,t,a){return a(function(){Po(t)&&ed(e)})}function Po(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!vt(e,a)}catch{return!0}}function ed(e){var t=Xa(e,2);t!==null&&ht(t,e,2)}function Du(e){var t=st();if(typeof e=="function"){var a=e;if(e=a(),en){ha(!0);try{a()}finally{ha(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:e},t}function td(e,t,a,n){return e.baseState=a,Ou(e,_e,typeof n=="function"?n:ta)}function Fp(e,t,a,n,s){if(zi(e))throw Error(o(485));if(e=t.action,e!==null){var u={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){u.listeners.push(d)}};H.T!==null?a(!0):u.isTransition=!1,n(u),a=t.pending,a===null?(u.next=t.pending=u,ad(t,u)):(u.next=a.next,t.pending=a.next=u)}}function ad(e,t){var a=t.action,n=t.payload,s=e.state;if(t.isTransition){var u=H.T,d={};H.T=d;try{var p=a(s,n),S=H.S;S!==null&&S(d,p),nd(e,t,p)}catch(R){Hu(e,t,R)}finally{u!==null&&d.types!==null&&(u.types=d.types),H.T=u}}else try{u=a(s,n),nd(e,t,u)}catch(R){Hu(e,t,R)}}function nd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){ld(e,t,n)},function(n){return Hu(e,t,n)}):ld(e,t,a)}function ld(e,t,a){t.status="fulfilled",t.value=a,id(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,ad(e,a)))}function Hu(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,id(t),t=t.next;while(t!==n)}e.action=null}function id(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function sd(e,t){return t}function ud(e,t){if(xe){var a=Oe.formState;if(a!==null){e:{var n=de;if(xe){if(Ue){t:{for(var s=Ue,u=zt;s.nodeType!==8;){if(!u){s=null;break t}if(s=Ut(s.nextSibling),s===null){s=null;break t}}u=s.data,s=u==="F!"||u==="F"?s:null}if(s){Ue=Ut(s.nextSibling),n=s.data==="F!";break e}}ya(n)}n=!1}n&&(t=a[0])}}return a=st(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sd,lastRenderedState:t},a.queue=n,a=Ed.bind(null,de,n),n.dispatch=a,n=Du(!1),u=Vu.bind(null,de,!1,n.queue),n=st(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,a=Fp.bind(null,de,s,u,a),s.dispatch=a,n.memoizedState=e,[t,a,!1]}function rd(e){var t=Ve();return cd(t,_e,e)}function cd(e,t,a){if(t=Ou(e,t,sd)[0],e=Ai(ta)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=bl(t)}catch(d){throw d===En?xi:d}else n=t;t=Ve();var s=t.queue,u=s.dispatch;return a!==t.memoizedState&&(de.flags|=2048,Rn(9,{destroy:void 0},Wp.bind(null,s,a),null)),[n,u,e]}function Wp(e,t){e.action=t}function od(e){var t=Ve(),a=_e;if(a!==null)return cd(t,a,e);Ve(),t=t.memoizedState,a=Ve();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Rn(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=de.updateQueue,t===null&&(t=Ti(),de.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function dd(){return Ve().memoizedState}function Ri(e,t,a,n){var s=st();de.flags|=e,s.memoizedState=Rn(1|t,{destroy:void 0},a,n===void 0?null:n)}function Mi(e,t,a,n){var s=Ve();n=n===void 0?null:n;var u=s.memoizedState.inst;_e!==null&&n!==null&&Tu(n,_e.memoizedState.deps)?s.memoizedState=Rn(t,u,a,n):(de.flags|=e,s.memoizedState=Rn(1|t,u,a,n))}function fd(e,t){Ri(8390656,8,e,t)}function Bu(e,t){Mi(2048,8,e,t)}function Ip(e){de.flags|=4;var t=de.updateQueue;if(t===null)t=Ti(),de.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function hd(e){var t=Ve().memoizedState;return Ip({ref:t,nextImpl:e}),function(){if((Ce&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function md(e,t){return Mi(4,2,e,t)}function pd(e,t){return Mi(4,4,e,t)}function gd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vd(e,t,a){a=a!=null?a.concat([e]):null,Mi(4,4,gd.bind(null,t,e),a)}function Lu(){}function yd(e,t){var a=Ve();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Tu(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function bd(e,t){var a=Ve();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Tu(t,n[1]))return n[0];if(n=e(),en){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[n,t],n}function qu(e,t,a){return a===void 0||(ea&1073741824)!==0&&(ve&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=jf(),de.lanes|=e,ka|=e,a)}function xd(e,t,a,n){return vt(a,t)?a:Tn.current!==null?(e=qu(e,a,n),vt(e,t)||(Qe=!0),e):(ea&42)===0||(ea&1073741824)!==0&&(ve&261930)===0?(Qe=!0,e.memoizedState=a):(e=jf(),de.lanes|=e,ka|=e,t)}function jd(e,t,a,n,s){var u=F.p;F.p=u!==0&&8>u?u:8;var d=H.T,p={};H.T=p,Vu(e,!1,t,a);try{var S=s(),R=H.S;if(R!==null&&R(p,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var B=$p(S,n);xl(e,t,B,wt(e))}else xl(e,t,n,wt(e))}catch(Y){xl(e,t,{then:function(){},status:"rejected",reason:Y},wt())}finally{F.p=u,d!==null&&p.types!==null&&(d.types=p.types),H.T=d}}function Pp(){}function Yu(e,t,a,n){if(e.tag!==5)throw Error(o(476));var s=Sd(e).queue;jd(e,s,t,re,a===null?Pp:function(){return wd(e),a(n)})}function Sd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:re},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wd(e){var t=Sd(e);t.next===null&&(t=e.alternate.memoizedState),xl(e,t.next.queue,{},wt())}function Gu(){return Pe(Hl)}function Cd(){return Ve().memoizedState}function Nd(){return Ve().memoizedState}function eg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=wt();e=ja(a);var n=Sa(t,e,a);n!==null&&(ht(n,t,a),pl(n,t,a)),t={cache:vu()},e.payload=t;return}t=t.return}}function tg(e,t,a){var n=wt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},zi(e)?kd(t,a):(a=su(e,t,a,n),a!==null&&(ht(a,e,n),Td(a,t,n)))}function Ed(e,t,a){var n=wt();xl(e,t,a,n)}function xl(e,t,a,n){var s={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(zi(e))kd(t,s);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var d=t.lastRenderedState,p=u(d,a);if(s.hasEagerState=!0,s.eagerState=p,vt(p,d))return hi(e,t,s,0),Oe===null&&fi(),!1}catch{}finally{}if(a=su(e,t,s,n),a!==null)return ht(a,e,n),Td(a,t,n),!0}return!1}function Vu(e,t,a,n){if(n={lane:2,revertLane:jr(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zi(e)){if(t)throw Error(o(479))}else t=su(e,a,n,2),t!==null&&ht(t,e,2)}function zi(e){var t=e.alternate;return e===de||t!==null&&t===de}function kd(e,t){_n=Ei=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Td(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Mc(e,a)}}var jl={readContext:Pe,use:_i,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};jl.useEffectEvent=Le;var _d={readContext:Pe,use:_i,useCallback:function(e,t){return st().memoizedState=[e,t===void 0?null:t],e},useContext:Pe,useEffect:fd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ri(4194308,4,gd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ri(4194308,4,e,t)},useInsertionEffect:function(e,t){Ri(4,2,e,t)},useMemo:function(e,t){var a=st();t=t===void 0?null:t;var n=e();if(en){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=st();if(a!==void 0){var s=a(t);if(en){ha(!0);try{a(t)}finally{ha(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=tg.bind(null,de,e),[n.memoizedState,e]},useRef:function(e){var t=st();return e={current:e},t.memoizedState=e},useState:function(e){e=Du(e);var t=e.queue,a=Ed.bind(null,de,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Lu,useDeferredValue:function(e,t){var a=st();return qu(a,e,t)},useTransition:function(){var e=Du(!1);return e=jd.bind(null,de,e.queue,!0,!1),st().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=de,s=st();if(xe){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),Oe===null)throw Error(o(349));(ve&127)!==0||Fo(n,t,a)}s.memoizedState=a;var u={value:a,getSnapshot:t};return s.queue=u,fd(Io.bind(null,n,u,e),[e]),n.flags|=2048,Rn(9,{destroy:void 0},Wo.bind(null,n,u,a,t),null),a},useId:function(){var e=st(),t=Oe.identifierPrefix;if(xe){var a=Zt,n=Vt;a=(n&~(1<<32-gt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ki++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Jp++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Gu,useFormState:ud,useActionState:ud,useOptimistic:function(e){var t=st();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Vu.bind(null,de,!0,a),a.dispatch=t,[e,t]},useMemoCache:zu,useCacheRefresh:function(){return st().memoizedState=eg.bind(null,de)},useEffectEvent:function(e){var t=st(),a={impl:e};return t.memoizedState=a,function(){if((Ce&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},Zu={readContext:Pe,use:_i,useCallback:yd,useContext:Pe,useEffect:Bu,useImperativeHandle:vd,useInsertionEffect:md,useLayoutEffect:pd,useMemo:bd,useReducer:Ai,useRef:dd,useState:function(){return Ai(ta)},useDebugValue:Lu,useDeferredValue:function(e,t){var a=Ve();return xd(a,_e.memoizedState,e,t)},useTransition:function(){var e=Ai(ta)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:bl(e),t]},useSyncExternalStore:Ko,useId:Cd,useHostTransitionStatus:Gu,useFormState:rd,useActionState:rd,useOptimistic:function(e,t){var a=Ve();return td(a,_e,e,t)},useMemoCache:zu,useCacheRefresh:Nd};Zu.useEffectEvent=hd;var Ad={readContext:Pe,use:_i,useCallback:yd,useContext:Pe,useEffect:Bu,useImperativeHandle:vd,useInsertionEffect:md,useLayoutEffect:pd,useMemo:bd,useReducer:Uu,useRef:dd,useState:function(){return Uu(ta)},useDebugValue:Lu,useDeferredValue:function(e,t){var a=Ve();return _e===null?qu(a,e,t):xd(a,_e.memoizedState,e,t)},useTransition:function(){var e=Uu(ta)[0],t=Ve().memoizedState;return[typeof e=="boolean"?e:bl(e),t]},useSyncExternalStore:Ko,useId:Cd,useHostTransitionStatus:Gu,useFormState:od,useActionState:od,useOptimistic:function(e,t){var a=Ve();return _e!==null?td(a,_e,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:zu,useCacheRefresh:Nd};Ad.useEffectEvent=hd;function Xu(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Qu={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=wt(),s=ja(n);s.payload=t,a!=null&&(s.callback=a),t=Sa(e,s,n),t!==null&&(ht(t,e,n),pl(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=wt(),s=ja(n);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=Sa(e,s,n),t!==null&&(ht(t,e,n),pl(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=wt(),n=ja(a);n.tag=2,t!=null&&(n.callback=t),t=Sa(e,n,a),t!==null&&(ht(t,e,a),pl(t,e,a))}};function Rd(e,t,a,n,s,u,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,u,d):t.prototype&&t.prototype.isPureReactComponent?!ul(a,n)||!ul(s,u):!0}function Md(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Qu.enqueueReplaceState(t,t.state,null)}function tn(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}function zd(e){di(e)}function Od(e){console.error(e)}function Ud(e){di(e)}function Oi(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Dd(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function $u(e,t,a){return a=ja(a),a.tag=3,a.payload={element:null},a.callback=function(){Oi(e,t)},a}function Hd(e){return e=ja(e),e.tag=3,e}function Bd(e,t,a,n){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var u=n.value;e.payload=function(){return s(u)},e.callback=function(){Dd(t,a,n)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Dd(t,a,n),typeof s!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var p=n.stack;this.componentDidCatch(n.value,{componentStack:p!==null?p:""})})}function ag(e,t,a,n,s){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&wn(t,a,s,!0),a=bt.current,a!==null){switch(a.tag){case 31:case 13:return Ot===null?Qi():a.alternate===null&&qe===0&&(qe=3),a.flags&=-257,a.flags|=65536,a.lanes=s,n===ji?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),yr(e,n,s)),!1;case 22:return a.flags|=65536,n===ji?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),yr(e,n,s)),!1}throw Error(o(435,a.tag))}return yr(e,n,s),Qi(),!1}if(xe)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==fu&&(e=Error(o(422),{cause:n}),ol(At(e,a)))):(n!==fu&&(t=Error(o(423),{cause:n}),ol(At(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=At(n,a),s=$u(e.stateNode,n,s),wu(e,s),qe!==4&&(qe=2)),!1;var u=Error(o(520),{cause:n});if(u=At(u,a),_l===null?_l=[u]:_l.push(u),qe!==4&&(qe=2),t===null)return!0;n=At(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=$u(a.stateNode,n,e),wu(a,e),!1;case 1:if(t=a.type,u=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Ta===null||!Ta.has(u))))return a.flags|=65536,s&=-s,a.lanes|=s,s=Hd(s),Bd(s,e,a,n),wu(a,s),!1}a=a.return}while(a!==null);return!1}var Ju=Error(o(461)),Qe=!1;function et(e,t,a,n){t.child=e===null?Go(t,null,a,n):Pa(t,e.child,a,n)}function Ld(e,t,a,n,s){a=a.render;var u=t.ref;if("ref"in n){var d={};for(var p in n)p!=="ref"&&(d[p]=n[p])}else d=n;return Ka(t),n=_u(e,t,a,d,u,s),p=Au(),e!==null&&!Qe?(Ru(e,t,s),aa(e,t,s)):(xe&&p&&ou(t),t.flags|=1,et(e,t,n,s),t.child)}function qd(e,t,a,n,s){if(e===null){var u=a.type;return typeof u=="function"&&!uu(u)&&u.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=u,Yd(e,t,u,n,s)):(e=pi(a.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!ar(e,s)){var d=u.memoizedProps;if(a=a.compare,a=a!==null?a:ul,a(d,n)&&e.ref===t.ref)return aa(e,t,s)}return t.flags|=1,e=Ft(u,n),e.ref=t.ref,e.return=t,t.child=e}function Yd(e,t,a,n,s){if(e!==null){var u=e.memoizedProps;if(ul(u,n)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=n=u,ar(e,s))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,aa(e,t,s)}return Ku(e,t,a,n,s)}function Gd(e,t,a,n){var s=n.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|a:a,e!==null){for(n=t.child=e.child,s=0;n!==null;)s=s|n.lanes|n.childLanes,n=n.sibling;n=s&~u}else n=0,t.child=null;return Vd(e,t,u,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bi(t,u!==null?u.cachePool:null),u!==null?Xo(t,u):Nu(),Qo(t);else return n=t.lanes=536870912,Vd(e,t,u!==null?u.baseLanes|a:a,a,n)}else u!==null?(bi(t,u.cachePool),Xo(t,u),Ca(),t.memoizedState=null):(e!==null&&bi(t,null),Nu(),Ca());return et(e,t,s,a),t.child}function Sl(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vd(e,t,a,n,s){var u=bu();return u=u===null?null:{parent:Ze._currentValue,pool:u},t.memoizedState={baseLanes:a,cachePool:u},e!==null&&bi(t,null),Nu(),Qo(t),e!==null&&wn(e,t,n,!0),t.childLanes=s,null}function Ui(e,t){return t=Hi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zd(e,t,a){return Pa(t,e.child,null,a),e=Ui(t,t.pendingProps),e.flags|=2,xt(t),t.memoizedState=null,e}function ng(e,t,a){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(xe){if(n.mode==="hidden")return e=Ui(t,n),t.lanes=536870912,Sl(null,e);if(ku(t),(e=Ue)?(e=nh(e,zt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ga!==null?{id:Vt,overflow:Zt}:null,retryLane:536870912,hydrationErrors:null},a=ko(e),a.return=t,t.child=a,Ie=t,Ue=null)):e=null,e===null)throw ya(t);return t.lanes=536870912,null}return Ui(t,n)}var u=e.memoizedState;if(u!==null){var d=u.dehydrated;if(ku(t),s)if(t.flags&256)t.flags&=-257,t=Zd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Qe||wn(e,t,a,!1),s=(a&e.childLanes)!==0,Qe||s){if(n=Oe,n!==null&&(d=zc(n,a),d!==0&&d!==u.retryLane))throw u.retryLane=d,Xa(e,d),ht(n,e,d),Ju;Qi(),t=Zd(e,t,a)}else e=u.treeContext,Ue=Ut(d.nextSibling),Ie=t,xe=!0,va=null,zt=!1,e!==null&&Ao(t,e),t=Ui(t,n),t.flags|=4096;return t}return e=Ft(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Di(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ku(e,t,a,n,s){return Ka(t),a=_u(e,t,a,n,void 0,s),n=Au(),e!==null&&!Qe?(Ru(e,t,s),aa(e,t,s)):(xe&&n&&ou(t),t.flags|=1,et(e,t,a,s),t.child)}function Xd(e,t,a,n,s,u){return Ka(t),t.updateQueue=null,a=Jo(t,n,a,s),$o(e),n=Au(),e!==null&&!Qe?(Ru(e,t,u),aa(e,t,u)):(xe&&n&&ou(t),t.flags|=1,et(e,t,a,u),t.child)}function Qd(e,t,a,n,s){if(Ka(t),t.stateNode===null){var u=bn,d=a.contextType;typeof d=="object"&&d!==null&&(u=Pe(d)),u=new a(n,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Qu,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=n,u.state=t.memoizedState,u.refs={},ju(t),d=a.contextType,u.context=typeof d=="object"&&d!==null?Pe(d):bn,u.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(Xu(t,a,d,n),u.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(d=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),d!==u.state&&Qu.enqueueReplaceState(u,u.state,null),vl(t,n,u,s),gl(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){u=t.stateNode;var p=t.memoizedProps,S=tn(a,p);u.props=S;var R=u.context,B=a.contextType;d=bn,typeof B=="object"&&B!==null&&(d=Pe(B));var Y=a.getDerivedStateFromProps;B=typeof Y=="function"||typeof u.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,B||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(p||R!==d)&&Md(t,u,n,d),xa=!1;var M=t.memoizedState;u.state=M,vl(t,n,u,s),gl(),R=t.memoizedState,p||M!==R||xa?(typeof Y=="function"&&(Xu(t,a,Y,n),R=t.memoizedState),(S=xa||Rd(t,a,S,n,M,R,d))?(B||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=R),u.props=n,u.state=R,u.context=d,n=S):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{u=t.stateNode,Su(e,t),d=t.memoizedProps,B=tn(a,d),u.props=B,Y=t.pendingProps,M=u.context,R=a.contextType,S=bn,typeof R=="object"&&R!==null&&(S=Pe(R)),p=a.getDerivedStateFromProps,(R=typeof p=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(d!==Y||M!==S)&&Md(t,u,n,S),xa=!1,M=t.memoizedState,u.state=M,vl(t,n,u,s),gl();var U=t.memoizedState;d!==Y||M!==U||xa||e!==null&&e.dependencies!==null&&vi(e.dependencies)?(typeof p=="function"&&(Xu(t,a,p,n),U=t.memoizedState),(B=xa||Rd(t,a,B,n,M,U,S)||e!==null&&e.dependencies!==null&&vi(e.dependencies))?(R||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,U,S),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,U,S)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=U),u.props=n,u.state=U,u.context=S,n=B):(typeof u.componentDidUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),n=!1)}return u=n,Di(e,t),n=(t.flags&128)!==0,u||n?(u=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&n?(t.child=Pa(t,e.child,null,s),t.child=Pa(t,null,a,s)):et(e,t,a,s),t.memoizedState=u.state,e=t.child):e=aa(e,t,s),e}function $d(e,t,a,n){return $a(),t.flags|=256,et(e,t,a,n),t.child}var Fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wu(e){return{baseLanes:e,cachePool:Do()}}function Iu(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=St),e}function Jd(e,t,a){var n=t.pendingProps,s=!1,u=(t.flags&128)!==0,d;if((d=u)||(d=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(xe){if(s?wa(t):Ca(),(e=Ue)?(e=nh(e,zt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ga!==null?{id:Vt,overflow:Zt}:null,retryLane:536870912,hydrationErrors:null},a=ko(e),a.return=t,t.child=a,Ie=t,Ue=null)):e=null,e===null)throw ya(t);return Or(e)?t.lanes=32:t.lanes=536870912,null}var p=n.children;return n=n.fallback,s?(Ca(),s=t.mode,p=Hi({mode:"hidden",children:p},s),n=Qa(n,s,a,null),p.return=t,n.return=t,p.sibling=n,t.child=p,n=t.child,n.memoizedState=Wu(a),n.childLanes=Iu(e,d,a),t.memoizedState=Fu,Sl(null,n)):(wa(t),Pu(t,p))}var S=e.memoizedState;if(S!==null&&(p=S.dehydrated,p!==null)){if(u)t.flags&256?(wa(t),t.flags&=-257,t=er(e,t,a)):t.memoizedState!==null?(Ca(),t.child=e.child,t.flags|=128,t=null):(Ca(),p=n.fallback,s=t.mode,n=Hi({mode:"visible",children:n.children},s),p=Qa(p,s,a,null),p.flags|=2,n.return=t,p.return=t,n.sibling=p,t.child=n,Pa(t,e.child,null,a),n=t.child,n.memoizedState=Wu(a),n.childLanes=Iu(e,d,a),t.memoizedState=Fu,t=Sl(null,n));else if(wa(t),Or(p)){if(d=p.nextSibling&&p.nextSibling.dataset,d)var R=d.dgst;d=R,n=Error(o(419)),n.stack="",n.digest=d,ol({value:n,source:null,stack:null}),t=er(e,t,a)}else if(Qe||wn(e,t,a,!1),d=(a&e.childLanes)!==0,Qe||d){if(d=Oe,d!==null&&(n=zc(d,a),n!==0&&n!==S.retryLane))throw S.retryLane=n,Xa(e,n),ht(d,e,n),Ju;zr(p)||Qi(),t=er(e,t,a)}else zr(p)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,Ue=Ut(p.nextSibling),Ie=t,xe=!0,va=null,zt=!1,e!==null&&Ao(t,e),t=Pu(t,n.children),t.flags|=4096);return t}return s?(Ca(),p=n.fallback,s=t.mode,S=e.child,R=S.sibling,n=Ft(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,R!==null?p=Ft(R,p):(p=Qa(p,s,a,null),p.flags|=2),p.return=t,n.return=t,n.sibling=p,t.child=n,Sl(null,n),n=t.child,p=e.child.memoizedState,p===null?p=Wu(a):(s=p.cachePool,s!==null?(S=Ze._currentValue,s=s.parent!==S?{parent:S,pool:S}:s):s=Do(),p={baseLanes:p.baseLanes|a,cachePool:s}),n.memoizedState=p,n.childLanes=Iu(e,d,a),t.memoizedState=Fu,Sl(e.child,n)):(wa(t),a=e.child,e=a.sibling,a=Ft(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function Pu(e,t){return t=Hi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Hi(e,t){return e=yt(22,e,null,t),e.lanes=0,e}function er(e,t,a){return Pa(t,e.child,null,a),e=Pu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Kd(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),pu(e.return,t,a)}function tr(e,t,a,n,s,u){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:s,treeForkCount:u}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=n,d.tail=a,d.tailMode=s,d.treeForkCount=u)}function Fd(e,t,a){var n=t.pendingProps,s=n.revealOrder,u=n.tail;n=n.children;var d=Ge.current,p=(d&2)!==0;if(p?(d=d&1|2,t.flags|=128):d&=1,I(Ge,d),et(e,t,n,a),n=xe?cl:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Kd(e,a,t);else if(e.tag===19)Kd(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"forwards":for(a=t.child,s=null;a!==null;)e=a.alternate,e!==null&&Ni(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),tr(t,!1,s,a,u,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ni(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}tr(t,!0,a,null,u,n);break;case"together":tr(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function aa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ka|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(wn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=Ft(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ft(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function ar(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vi(e)))}function lg(e,t,a){switch(t.tag){case 3:it(t,t.stateNode.containerInfo),ba(t,Ze,e.memoizedState.cache),$a();break;case 27:case 5:Jn(t);break;case 4:it(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ku(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(wa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Jd(e,t,a):(wa(t),e=aa(e,t,a),e!==null?e.sibling:null);wa(t);break;case 19:var s=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(wn(e,t,a,!1),n=(a&t.childLanes)!==0),s){if(n)return Fd(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),I(Ge,Ge.current),n)break;return null;case 22:return t.lanes=0,Gd(e,t,a,t.pendingProps);case 24:ba(t,Ze,e.memoizedState.cache)}return aa(e,t,a)}function Wd(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!ar(e,a)&&(t.flags&128)===0)return Qe=!1,lg(e,t,a);Qe=(e.flags&131072)!==0}else Qe=!1,xe&&(t.flags&1048576)!==0&&_o(t,cl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Wa(t.elementType),t.type=e,typeof e=="function")uu(e)?(n=tn(e,n),t.tag=1,t=Qd(null,t,e,n,a)):(t.tag=0,t=Ku(null,t,e,n,a));else{if(e!=null){var s=e.$$typeof;if(s===P){t.tag=11,t=Ld(null,t,e,n,a);break e}else if(s===E){t.tag=14,t=qd(null,t,e,n,a);break e}}throw t=ge(e)||e,Error(o(306,t,""))}}return t;case 0:return Ku(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,s=tn(n,t.pendingProps),Qd(e,t,n,s,a);case 3:e:{if(it(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var u=t.memoizedState;s=u.element,Su(e,t),vl(t,n,null,a);var d=t.memoizedState;if(n=d.cache,ba(t,Ze,n),n!==u.cache&&gu(t,[Ze],a,!0),gl(),n=d.element,u.isDehydrated)if(u={element:n,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=$d(e,t,n,a);break e}else if(n!==s){s=At(Error(o(424)),t),ol(s),t=$d(e,t,n,a);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ue=Ut(e.firstChild),Ie=t,xe=!0,va=null,zt=!0,a=Go(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if($a(),n===s){t=aa(e,t,a);break e}et(e,t,n,a)}t=t.child}return t;case 26:return Di(e,t),e===null?(a=ch(t.type,null,t.pendingProps,null))?t.memoizedState=a:xe||(a=t.type,e=t.pendingProps,n=Pi(he.current).createElement(a),n[We]=t,n[ut]=e,tt(n,a,e),Ke(n),t.stateNode=n):t.memoizedState=ch(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Jn(t),e===null&&xe&&(n=t.stateNode=sh(t.type,t.pendingProps,he.current),Ie=t,zt=!0,s=Ue,Ma(t.type)?(Ur=s,Ue=Ut(n.firstChild)):Ue=s),et(e,t,t.pendingProps.children,a),Di(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&xe&&((s=n=Ue)&&(n=Og(n,t.type,t.pendingProps,zt),n!==null?(t.stateNode=n,Ie=t,Ue=Ut(n.firstChild),zt=!1,s=!0):s=!1),s||ya(t)),Jn(t),s=t.type,u=t.pendingProps,d=e!==null?e.memoizedProps:null,n=u.children,Ar(s,u)?n=null:d!==null&&Ar(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=_u(e,t,Kp,null,null,a),Hl._currentValue=s),Di(e,t),et(e,t,n,a),t.child;case 6:return e===null&&xe&&((e=a=Ue)&&(a=Ug(a,t.pendingProps,zt),a!==null?(t.stateNode=a,Ie=t,Ue=null,e=!0):e=!1),e||ya(t)),null;case 13:return Jd(e,t,a);case 4:return it(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Pa(t,null,n,a):et(e,t,n,a),t.child;case 11:return Ld(e,t,t.type,t.pendingProps,a);case 7:return et(e,t,t.pendingProps,a),t.child;case 8:return et(e,t,t.pendingProps.children,a),t.child;case 12:return et(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,ba(t,t.type,n.value),et(e,t,n.children,a),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,Ka(t),s=Pe(s),n=n(s),t.flags|=1,et(e,t,n,a),t.child;case 14:return qd(e,t,t.type,t.pendingProps,a);case 15:return Yd(e,t,t.type,t.pendingProps,a);case 19:return Fd(e,t,a);case 31:return ng(e,t,a);case 22:return Gd(e,t,a,t.pendingProps);case 24:return Ka(t),n=Pe(Ze),e===null?(s=bu(),s===null&&(s=Oe,u=vu(),s.pooledCache=u,u.refCount++,u!==null&&(s.pooledCacheLanes|=a),s=u),t.memoizedState={parent:n,cache:s},ju(t),ba(t,Ze,s)):((e.lanes&a)!==0&&(Su(e,t),vl(t,null,null,a),gl()),s=e.memoizedState,u=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),ba(t,Ze,n)):(n=u.cache,ba(t,Ze,n),n!==s.cache&&gu(t,[Ze],a,!0))),et(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function na(e){e.flags|=4}function nr(e,t,a,n,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Nf())e.flags|=8192;else throw Ia=ji,xu}else e.flags&=-16777217}function Id(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!mh(t))if(Nf())e.flags|=8192;else throw Ia=ji,xu}function Bi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ac():536870912,e.lanes|=t,Un|=t)}function wl(e,t){if(!xe)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function De(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,n|=s.subtreeFlags&65011712,n|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function ig(e,t,a){var n=t.pendingProps;switch(du(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return De(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Pt(Ze),Ye(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Sn(t)?na(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,hu())),De(t),null;case 26:var s=t.type,u=t.memoizedState;return e===null?(na(t),u!==null?(De(t),Id(t,u)):(De(t),nr(t,s,null,n,a))):u?u!==e.memoizedState?(na(t),De(t),Id(t,u)):(De(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&na(t),De(t),nr(t,s,e,n,a)),null;case 27:if(Kl(t),a=he.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&na(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return De(t),null}e=ae.current,Sn(t)?Ro(t):(e=sh(s,n,a),t.stateNode=e,na(t))}return De(t),null;case 5:if(Kl(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&na(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return De(t),null}if(u=ae.current,Sn(t))Ro(t);else{var d=Pi(he.current);switch(u){case 1:u=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:u=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":u=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":u=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":u=d.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?u.multiple=!0:n.size&&(u.size=n.size);break;default:u=typeof n.is=="string"?d.createElement(s,{is:n.is}):d.createElement(s)}}u[We]=t,u[ut]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)u.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=u;e:switch(tt(u,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&na(t)}}return De(t),nr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&na(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=he.current,Sn(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,s=Ie,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[We]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Kf(e.nodeValue,a)),e||ya(t,!0)}else e=Pi(e).createTextNode(n),e[We]=t,t.stateNode=e}return De(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Sn(t),a!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[We]=t}else $a(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),e=!1}else a=hu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(xt(t),t):(xt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return De(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Sn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(o(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));s[We]=t}else $a(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),s=!1}else s=hu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(xt(t),t):(xt(t),null)}return xt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==s&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Bi(t,t.updateQueue),De(t),null);case 4:return Ye(),e===null&&Nr(t.stateNode.containerInfo),De(t),null;case 10:return Pt(t.type),De(t),null;case 19:if(G(Ge),n=t.memoizedState,n===null)return De(t),null;if(s=(t.flags&128)!==0,u=n.rendering,u===null)if(s)wl(n,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Ni(e),u!==null){for(t.flags|=128,wl(n,!1),e=u.updateQueue,t.updateQueue=e,Bi(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Eo(a,e),a=a.sibling;return I(Ge,Ge.current&1|2),xe&&Wt(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&mt()>Vi&&(t.flags|=128,s=!0,wl(n,!1),t.lanes=4194304)}else{if(!s)if(e=Ni(u),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Bi(t,e),wl(n,!0),n.tail===null&&n.tailMode==="hidden"&&!u.alternate&&!xe)return De(t),null}else 2*mt()-n.renderingStartTime>Vi&&a!==536870912&&(t.flags|=128,s=!0,wl(n,!1),t.lanes=4194304);n.isBackwards?(u.sibling=t.child,t.child=u):(e=n.last,e!==null?e.sibling=u:t.child=u,n.last=u)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=mt(),e.sibling=null,a=Ge.current,I(Ge,s?a&1|2:a&1),xe&&Wt(t,n.treeForkCount),e):(De(t),null);case 22:case 23:return xt(t),Eu(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),a=t.updateQueue,a!==null&&Bi(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&G(Fa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Pt(Ze),De(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function sg(e,t){switch(du(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pt(Ze),Ye(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Kl(t),null;case 31:if(t.memoizedState!==null){if(xt(t),t.alternate===null)throw Error(o(340));$a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));$a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(Ge),null;case 4:return Ye(),null;case 10:return Pt(t.type),null;case 22:case 23:return xt(t),Eu(),e!==null&&G(Fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Pt(Ze),null;case 25:return null;default:return null}}function Pd(e,t){switch(du(t),t.tag){case 3:Pt(Ze),Ye();break;case 26:case 27:case 5:Kl(t);break;case 4:Ye();break;case 31:t.memoizedState!==null&&xt(t);break;case 13:xt(t);break;case 19:G(Ge);break;case 10:Pt(t.type);break;case 22:case 23:xt(t),Eu(),e!==null&&G(Fa);break;case 24:Pt(Ze)}}function Cl(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var s=n.next;a=s;do{if((a.tag&e)===e){n=void 0;var u=a.create,d=a.inst;n=u(),d.destroy=n}a=a.next}while(a!==s)}}catch(p){ke(t,t.return,p)}}function Na(e,t,a){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var u=s.next;n=u;do{if((n.tag&e)===e){var d=n.inst,p=d.destroy;if(p!==void 0){d.destroy=void 0,s=t;var S=a,R=p;try{R()}catch(B){ke(s,S,B)}}}n=n.next}while(n!==u)}}catch(B){ke(t,t.return,B)}}function ef(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Zo(t,a)}catch(n){ke(e,e.return,n)}}}function tf(e,t,a){a.props=tn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){ke(e,t,n)}}function Nl(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(s){ke(e,t,s)}}function Xt(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(s){ke(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){ke(e,t,s)}else a.current=null}function af(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(s){ke(e,e.return,s)}}function lr(e,t,a){try{var n=e.stateNode;Tg(n,e.type,a,t),n[ut]=t}catch(s){ke(e,e.return,s)}}function nf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ma(e.type)||e.tag===4}function ir(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nf(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&&Ma(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function sr(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Jt));else if(n!==4&&(n===27&&Ma(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(sr(e,t,a),e=e.sibling;e!==null;)sr(e,t,a),e=e.sibling}function Li(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Ma(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Li(e,t,a),e=e.sibling;e!==null;)Li(e,t,a),e=e.sibling}function lf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);tt(t,n,a),t[We]=e,t[ut]=a}catch(u){ke(e,e.return,u)}}var la=!1,$e=!1,ur=!1,sf=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function ug(e,t){if(e=e.containerInfo,Tr=ss,e=vo(e),eu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var s=n.anchorOffset,u=n.focusNode;n=n.focusOffset;try{a.nodeType,u.nodeType}catch{a=null;break e}var d=0,p=-1,S=-1,R=0,B=0,Y=e,M=null;t:for(;;){for(var U;Y!==a||s!==0&&Y.nodeType!==3||(p=d+s),Y!==u||n!==0&&Y.nodeType!==3||(S=d+n),Y.nodeType===3&&(d+=Y.nodeValue.length),(U=Y.firstChild)!==null;)M=Y,Y=U;for(;;){if(Y===e)break t;if(M===a&&++R===s&&(p=d),M===u&&++B===n&&(S=d),(U=Y.nextSibling)!==null)break;Y=M,M=Y.parentNode}Y=U}a=p===-1||S===-1?null:{start:p,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;for(_r={focusedElem:e,selectionRange:a},ss=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){switch(t=Fe,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)s=e[a],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,a=t,s=u.memoizedProps,u=u.memoizedState,n=a.stateNode;try{var ee=tn(a.type,s);e=n.getSnapshotBeforeUpdate(ee,u),n.__reactInternalSnapshotBeforeUpdate=e}catch(ue){ke(a,a.return,ue)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Mr(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Mr(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Fe=e;break}Fe=t.return}}function uf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:sa(e,a),n&4&&Cl(5,a);break;case 1:if(sa(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){ke(a,a.return,d)}else{var s=tn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){ke(a,a.return,d)}}n&64&&ef(a),n&512&&Nl(a,a.return);break;case 3:if(sa(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Zo(e,t)}catch(d){ke(a,a.return,d)}}break;case 27:t===null&&n&4&&lf(a);case 26:case 5:sa(e,a),t===null&&n&4&&af(a),n&512&&Nl(a,a.return);break;case 12:sa(e,a);break;case 31:sa(e,a),n&4&&of(e,a);break;case 13:sa(e,a),n&4&&df(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=gg.bind(null,a),Dg(e,a))));break;case 22:if(n=a.memoizedState!==null||la,!n){t=t!==null&&t.memoizedState!==null||$e,s=la;var u=$e;la=n,($e=t)&&!u?ua(e,a,(a.subtreeFlags&8772)!==0):sa(e,a),la=s,$e=u}break;case 30:break;default:sa(e,a)}}function rf(e){var t=e.alternate;t!==null&&(e.alternate=null,rf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Hs(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var He=null,ct=!1;function ia(e,t,a){for(a=a.child;a!==null;)cf(e,t,a),a=a.sibling}function cf(e,t,a){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Kn,a)}catch{}switch(a.tag){case 26:$e||Xt(a,t),ia(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:$e||Xt(a,t);var n=He,s=ct;Ma(a.type)&&(He=a.stateNode,ct=!1),ia(e,t,a),Ol(a.stateNode),He=n,ct=s;break;case 5:$e||Xt(a,t);case 6:if(n=He,s=ct,He=null,ia(e,t,a),He=n,ct=s,He!==null)if(ct)try{(He.nodeType===9?He.body:He.nodeName==="HTML"?He.ownerDocument.body:He).removeChild(a.stateNode)}catch(u){ke(a,t,u)}else try{He.removeChild(a.stateNode)}catch(u){ke(a,t,u)}break;case 18:He!==null&&(ct?(e=He,th(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Vn(e)):th(He,a.stateNode));break;case 4:n=He,s=ct,He=a.stateNode.containerInfo,ct=!0,ia(e,t,a),He=n,ct=s;break;case 0:case 11:case 14:case 15:Na(2,a,t),$e||Na(4,a,t),ia(e,t,a);break;case 1:$e||(Xt(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&tf(a,t,n)),ia(e,t,a);break;case 21:ia(e,t,a);break;case 22:$e=(n=$e)||a.memoizedState!==null,ia(e,t,a),$e=n;break;default:ia(e,t,a)}}function of(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vn(e)}catch(a){ke(t,t.return,a)}}}function df(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vn(e)}catch(a){ke(t,t.return,a)}}function rg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sf),t;default:throw Error(o(435,e.tag))}}function qi(e,t){var a=rg(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var s=vg.bind(null,e,n);n.then(s,s)}})}function ot(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var s=a[n],u=e,d=t,p=d;e:for(;p!==null;){switch(p.tag){case 27:if(Ma(p.type)){He=p.stateNode,ct=!1;break e}break;case 5:He=p.stateNode,ct=!1;break e;case 3:case 4:He=p.stateNode.containerInfo,ct=!0;break e}p=p.return}if(He===null)throw Error(o(160));cf(u,d,s),He=null,ct=!1,u=s.alternate,u!==null&&(u.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ff(t,e),t=t.sibling}var Lt=null;function ff(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ot(t,e),dt(e),n&4&&(Na(3,e,e.return),Cl(3,e),Na(5,e,e.return));break;case 1:ot(t,e),dt(e),n&512&&($e||a===null||Xt(a,a.return)),n&64&&la&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var s=Lt;if(ot(t,e),dt(e),n&512&&($e||a===null||Xt(a,a.return)),n&4){var u=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,s=s.ownerDocument||s;t:switch(n){case"title":u=s.getElementsByTagName("title")[0],(!u||u[In]||u[We]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=s.createElement(n),s.head.insertBefore(u,s.querySelector("head > title"))),tt(u,n,a),u[We]=e,Ke(u),n=u;break e;case"link":var d=fh("link","href",s).get(n+(a.href||""));if(d){for(var p=0;p<d.length;p++)if(u=d[p],u.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&u.getAttribute("rel")===(a.rel==null?null:a.rel)&&u.getAttribute("title")===(a.title==null?null:a.title)&&u.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(p,1);break t}}u=s.createElement(n),tt(u,n,a),s.head.appendChild(u);break;case"meta":if(d=fh("meta","content",s).get(n+(a.content||""))){for(p=0;p<d.length;p++)if(u=d[p],u.getAttribute("content")===(a.content==null?null:""+a.content)&&u.getAttribute("name")===(a.name==null?null:a.name)&&u.getAttribute("property")===(a.property==null?null:a.property)&&u.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&u.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(p,1);break t}}u=s.createElement(n),tt(u,n,a),s.head.appendChild(u);break;default:throw Error(o(468,n))}u[We]=e,Ke(u),n=u}e.stateNode=n}else hh(s,e.type,e.stateNode);else e.stateNode=dh(s,n,e.memoizedProps);else u!==n?(u===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):u.count--,n===null?hh(s,e.type,e.stateNode):dh(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&lr(e,e.memoizedProps,a.memoizedProps)}break;case 27:ot(t,e),dt(e),n&512&&($e||a===null||Xt(a,a.return)),a!==null&&n&4&&lr(e,e.memoizedProps,a.memoizedProps);break;case 5:if(ot(t,e),dt(e),n&512&&($e||a===null||Xt(a,a.return)),e.flags&32){s=e.stateNode;try{fn(s,"")}catch(ee){ke(e,e.return,ee)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,lr(e,s,a!==null?a.memoizedProps:s)),n&1024&&(ur=!0);break;case 6:if(ot(t,e),dt(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(ee){ke(e,e.return,ee)}}break;case 3:if(as=null,s=Lt,Lt=es(t.containerInfo),ot(t,e),Lt=s,dt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Vn(t.containerInfo)}catch(ee){ke(e,e.return,ee)}ur&&(ur=!1,hf(e));break;case 4:n=Lt,Lt=es(e.stateNode.containerInfo),ot(t,e),dt(e),Lt=n;break;case 12:ot(t,e),dt(e);break;case 31:ot(t,e),dt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,qi(e,n)));break;case 13:ot(t,e),dt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Gi=mt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,qi(e,n)));break;case 22:s=e.memoizedState!==null;var S=a!==null&&a.memoizedState!==null,R=la,B=$e;if(la=R||s,$e=B||S,ot(t,e),$e=B,la=R,dt(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||S||la||$e||an(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){S=a=t;try{if(u=S.stateNode,s)d=u.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{p=S.stateNode;var Y=S.memoizedProps.style,M=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;p.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(ee){ke(S,S.return,ee)}}}else if(t.tag===6){if(a===null){S=t;try{S.stateNode.nodeValue=s?"":S.memoizedProps}catch(ee){ke(S,S.return,ee)}}}else if(t.tag===18){if(a===null){S=t;try{var U=S.stateNode;s?ah(U,!0):ah(S.stateNode,!1)}catch(ee){ke(S,S.return,ee)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,qi(e,a))));break;case 19:ot(t,e),dt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,qi(e,n)));break;case 30:break;case 21:break;default:ot(t,e),dt(e)}}function dt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(nf(n)){a=n;break}n=n.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var s=a.stateNode,u=ir(e);Li(e,u,s);break;case 5:var d=a.stateNode;a.flags&32&&(fn(d,""),a.flags&=-33);var p=ir(e);Li(e,p,d);break;case 3:case 4:var S=a.stateNode.containerInfo,R=ir(e);sr(e,R,S);break;default:throw Error(o(161))}}catch(B){ke(e,e.return,B)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function sa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uf(e,t.alternate,t),t=t.sibling}function an(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Na(4,t,t.return),an(t);break;case 1:Xt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&tf(t,t.return,a),an(t);break;case 27:Ol(t.stateNode);case 26:case 5:Xt(t,t.return),an(t);break;case 22:t.memoizedState===null&&an(t);break;case 30:an(t);break;default:an(t)}e=e.sibling}}function ua(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,s=e,u=t,d=u.flags;switch(u.tag){case 0:case 11:case 15:ua(s,u,a),Cl(4,u);break;case 1:if(ua(s,u,a),n=u,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(R){ke(n,n.return,R)}if(n=u,s=n.updateQueue,s!==null){var p=n.stateNode;try{var S=s.shared.hiddenCallbacks;if(S!==null)for(s.shared.hiddenCallbacks=null,s=0;s<S.length;s++)Vo(S[s],p)}catch(R){ke(n,n.return,R)}}a&&d&64&&ef(u),Nl(u,u.return);break;case 27:lf(u);case 26:case 5:ua(s,u,a),a&&n===null&&d&4&&af(u),Nl(u,u.return);break;case 12:ua(s,u,a);break;case 31:ua(s,u,a),a&&d&4&&of(s,u);break;case 13:ua(s,u,a),a&&d&4&&df(s,u);break;case 22:u.memoizedState===null&&ua(s,u,a),Nl(u,u.return);break;case 30:break;default:ua(s,u,a)}t=t.sibling}}function rr(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&dl(a))}function cr(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e))}function qt(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)mf(e,t,a,n),t=t.sibling}function mf(e,t,a,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:qt(e,t,a,n),s&2048&&Cl(9,t);break;case 1:qt(e,t,a,n);break;case 3:qt(e,t,a,n),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&dl(e)));break;case 12:if(s&2048){qt(e,t,a,n),e=t.stateNode;try{var u=t.memoizedProps,d=u.id,p=u.onPostCommit;typeof p=="function"&&p(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){ke(t,t.return,S)}}else qt(e,t,a,n);break;case 31:qt(e,t,a,n);break;case 13:qt(e,t,a,n);break;case 23:break;case 22:u=t.stateNode,d=t.alternate,t.memoizedState!==null?u._visibility&2?qt(e,t,a,n):El(e,t):u._visibility&2?qt(e,t,a,n):(u._visibility|=2,Mn(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&rr(d,t);break;case 24:qt(e,t,a,n),s&2048&&cr(t.alternate,t);break;default:qt(e,t,a,n)}}function Mn(e,t,a,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,d=t,p=a,S=n,R=d.flags;switch(d.tag){case 0:case 11:case 15:Mn(u,d,p,S,s),Cl(8,d);break;case 23:break;case 22:var B=d.stateNode;d.memoizedState!==null?B._visibility&2?Mn(u,d,p,S,s):El(u,d):(B._visibility|=2,Mn(u,d,p,S,s)),s&&R&2048&&rr(d.alternate,d);break;case 24:Mn(u,d,p,S,s),s&&R&2048&&cr(d.alternate,d);break;default:Mn(u,d,p,S,s)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,s=n.flags;switch(n.tag){case 22:El(a,n),s&2048&&rr(n.alternate,n);break;case 24:El(a,n),s&2048&&cr(n.alternate,n);break;default:El(a,n)}t=t.sibling}}var kl=8192;function zn(e,t,a){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)pf(e,t,a),e=e.sibling}function pf(e,t,a){switch(e.tag){case 26:zn(e,t,a),e.flags&kl&&e.memoizedState!==null&&Jg(a,Lt,e.memoizedState,e.memoizedProps);break;case 5:zn(e,t,a);break;case 3:case 4:var n=Lt;Lt=es(e.stateNode.containerInfo),zn(e,t,a),Lt=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=kl,kl=16777216,zn(e,t,a),kl=n):zn(e,t,a));break;default:zn(e,t,a)}}function gf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Tl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Fe=n,yf(n,e)}gf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)vf(e),e=e.sibling}function vf(e){switch(e.tag){case 0:case 11:case 15:Tl(e),e.flags&2048&&Na(9,e,e.return);break;case 3:Tl(e);break;case 12:Tl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yi(e)):Tl(e);break;default:Tl(e)}}function Yi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Fe=n,yf(n,e)}gf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Na(8,t,t.return),Yi(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Yi(t));break;default:Yi(t)}e=e.sibling}}function yf(e,t){for(;Fe!==null;){var a=Fe;switch(a.tag){case 0:case 11:case 15:Na(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:dl(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Fe=n;else e:for(a=e;Fe!==null;){n=Fe;var s=n.sibling,u=n.return;if(rf(n),n===a){Fe=null;break e}if(s!==null){s.return=u,Fe=s;break e}Fe=u}}}var cg={getCacheForType:function(e){var t=Pe(Ze),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Pe(Ze).controller.signal}},og=typeof WeakMap=="function"?WeakMap:Map,Ce=0,Oe=null,me=null,ve=0,Ee=0,jt=null,Ea=!1,On=!1,or=!1,ra=0,qe=0,ka=0,nn=0,dr=0,St=0,Un=0,_l=null,ft=null,fr=!1,Gi=0,bf=0,Vi=1/0,Zi=null,Ta=null,Je=0,_a=null,Dn=null,ca=0,hr=0,mr=null,xf=null,Al=0,pr=null;function wt(){return(Ce&2)!==0&&ve!==0?ve&-ve:H.T!==null?jr():Oc()}function jf(){if(St===0)if((ve&536870912)===0||xe){var e=Il;Il<<=1,(Il&3932160)===0&&(Il=262144),St=e}else St=536870912;return e=bt.current,e!==null&&(e.flags|=32),St}function ht(e,t,a){(e===Oe&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)&&(Hn(e,0),Aa(e,ve,St,!1)),Wn(e,a),((Ce&2)===0||e!==Oe)&&(e===Oe&&((Ce&2)===0&&(nn|=a),qe===4&&Aa(e,ve,St,!1)),Qt(e))}function Sf(e,t,a){if((Ce&6)!==0)throw Error(o(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Fn(e,t),s=n?hg(e,t):vr(e,t,!0),u=n;do{if(s===0){On&&!n&&Aa(e,t,0,!1);break}else{if(a=e.current.alternate,u&&!dg(a)){s=vr(e,t,!1),u=!1;continue}if(s===2){if(u=t,e.errorRecoveryDisabledLanes&u)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var p=e;s=_l;var S=p.current.memoizedState.isDehydrated;if(S&&(Hn(p,d).flags|=256),d=vr(p,d,!1),d!==2){if(or&&!S){p.errorRecoveryDisabledLanes|=u,nn|=u,s=4;break e}u=ft,ft=s,u!==null&&(ft===null?ft=u:ft.push.apply(ft,u))}s=d}if(u=!1,s!==2)continue}}if(s===1){Hn(e,0),Aa(e,t,0,!0);break}e:{switch(n=e,u=s,u){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Aa(n,t,St,!Ea);break e;case 2:ft=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(s=Gi+300-mt(),10<s)){if(Aa(n,t,St,!Ea),ei(n,0,!0)!==0)break e;ca=t,n.timeoutHandle=Pf(wf.bind(null,n,a,ft,Zi,fr,t,St,nn,Un,Ea,u,"Throttled",-0,0),s);break e}wf(n,a,ft,Zi,fr,t,St,nn,Un,Ea,u,null,-0,0)}}break}while(!0);Qt(e)}function wf(e,t,a,n,s,u,d,p,S,R,B,Y,M,U){if(e.timeoutHandle=-1,Y=t.subtreeFlags,Y&8192||(Y&16785408)===16785408){Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jt},pf(t,u,Y);var ee=(u&62914560)===u?Gi-mt():(u&4194048)===u?bf-mt():0;if(ee=Kg(Y,ee),ee!==null){ca=u,e.cancelPendingCommit=ee(Rf.bind(null,e,t,u,a,n,s,d,p,S,B,Y,null,M,U)),Aa(e,u,d,!R);return}}Rf(e,t,u,a,n,s,d,p,S)}function dg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var s=a[n],u=s.getSnapshot;s=s.value;try{if(!vt(u(),s))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Aa(e,t,a,n){t&=~dr,t&=~nn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var u=31-gt(s),d=1<<u;n[u]=-1,s&=~d}a!==0&&Rc(e,a,t)}function Xi(){return(Ce&6)===0?(Rl(0),!1):!0}function gr(){if(me!==null){if(Ee===0)var e=me.return;else e=me,It=Ja=null,Mu(e),kn=null,hl=0,e=me;for(;e!==null;)Pd(e.alternate,e),e=e.return;me=null}}function Hn(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Rg(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),ca=0,gr(),Oe=e,me=a=Ft(e.current,null),ve=t,Ee=0,jt=null,Ea=!1,On=Fn(e,t),or=!1,Un=St=dr=nn=ka=qe=0,ft=_l=null,fr=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-gt(n),u=1<<s;t|=e[s],n&=~u}return ra=t,fi(),a}function Cf(e,t){de=null,H.H=jl,t===En||t===xi?(t=Lo(),Ee=3):t===xu?(t=Lo(),Ee=4):Ee=t===Ju?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,jt=t,me===null&&(qe=1,Oi(e,At(t,e.current)))}function Nf(){var e=bt.current;return e===null?!0:(ve&4194048)===ve?Ot===null:(ve&62914560)===ve||(ve&536870912)!==0?e===Ot:!1}function Ef(){var e=H.H;return H.H=jl,e===null?jl:e}function kf(){var e=H.A;return H.A=cg,e}function Qi(){qe=4,Ea||(ve&4194048)!==ve&&bt.current!==null||(On=!0),(ka&134217727)===0&&(nn&134217727)===0||Oe===null||Aa(Oe,ve,St,!1)}function vr(e,t,a){var n=Ce;Ce|=2;var s=Ef(),u=kf();(Oe!==e||ve!==t)&&(Zi=null,Hn(e,t)),t=!1;var d=qe;e:do try{if(Ee!==0&&me!==null){var p=me,S=jt;switch(Ee){case 8:gr(),d=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var R=Ee;if(Ee=0,jt=null,Bn(e,p,S,R),a&&On){d=0;break e}break;default:R=Ee,Ee=0,jt=null,Bn(e,p,S,R)}}fg(),d=qe;break}catch(B){Cf(e,B)}while(!0);return t&&e.shellSuspendCounter++,It=Ja=null,Ce=n,H.H=s,H.A=u,me===null&&(Oe=null,ve=0,fi()),d}function fg(){for(;me!==null;)Tf(me)}function hg(e,t){var a=Ce;Ce|=2;var n=Ef(),s=kf();Oe!==e||ve!==t?(Zi=null,Vi=mt()+500,Hn(e,t)):On=Fn(e,t);e:do try{if(Ee!==0&&me!==null){t=me;var u=jt;t:switch(Ee){case 1:Ee=0,jt=null,Bn(e,t,u,1);break;case 2:case 9:if(Ho(u)){Ee=0,jt=null,_f(t);break}t=function(){Ee!==2&&Ee!==9||Oe!==e||(Ee=7),Qt(e)},u.then(t,t);break e;case 3:Ee=7;break e;case 4:Ee=5;break e;case 7:Ho(u)?(Ee=0,jt=null,_f(t)):(Ee=0,jt=null,Bn(e,t,u,7));break;case 5:var d=null;switch(me.tag){case 26:d=me.memoizedState;case 5:case 27:var p=me;if(d?mh(d):p.stateNode.complete){Ee=0,jt=null;var S=p.sibling;if(S!==null)me=S;else{var R=p.return;R!==null?(me=R,$i(R)):me=null}break t}}Ee=0,jt=null,Bn(e,t,u,5);break;case 6:Ee=0,jt=null,Bn(e,t,u,6);break;case 8:gr(),qe=6;break e;default:throw Error(o(462))}}mg();break}catch(B){Cf(e,B)}while(!0);return It=Ja=null,H.H=n,H.A=s,Ce=a,me!==null?0:(Oe=null,ve=0,fi(),qe)}function mg(){for(;me!==null&&!Hm();)Tf(me)}function Tf(e){var t=Wd(e.alternate,e,ra);e.memoizedProps=e.pendingProps,t===null?$i(e):me=t}function _f(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Xd(a,t,t.pendingProps,t.type,void 0,ve);break;case 11:t=Xd(a,t,t.pendingProps,t.type.render,t.ref,ve);break;case 5:Mu(t);default:Pd(a,t),t=me=Eo(t,ra),t=Wd(a,t,ra)}e.memoizedProps=e.pendingProps,t===null?$i(e):me=t}function Bn(e,t,a,n){It=Ja=null,Mu(t),kn=null,hl=0;var s=t.return;try{if(ag(e,s,t,a,ve)){qe=1,Oi(e,At(a,e.current)),me=null;return}}catch(u){if(s!==null)throw me=s,u;qe=1,Oi(e,At(a,e.current)),me=null;return}t.flags&32768?(xe||n===1?e=!0:On||(ve&536870912)!==0?e=!1:(Ea=e=!0,(n===2||n===9||n===3||n===6)&&(n=bt.current,n!==null&&n.tag===13&&(n.flags|=16384))),Af(t,e)):$i(t)}function $i(e){var t=e;do{if((t.flags&32768)!==0){Af(t,Ea);return}e=t.return;var a=ig(t.alternate,t,ra);if(a!==null){me=a;return}if(t=t.sibling,t!==null){me=t;return}me=t=e}while(t!==null);qe===0&&(qe=5)}function Af(e,t){do{var a=sg(e.alternate,e);if(a!==null){a.flags&=32767,me=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){me=e;return}me=e=a}while(e!==null);qe=6,me=null}function Rf(e,t,a,n,s,u,d,p,S){e.cancelPendingCommit=null;do Ji();while(Je!==0);if((Ce&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(u=t.lanes|t.childLanes,u|=iu,$m(e,a,u,d,p,S),e===Oe&&(me=Oe=null,ve=0),Dn=t,_a=e,ca=a,hr=u,mr=s,xf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,yg(Fl,function(){return Df(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=H.T,H.T=null,s=F.p,F.p=2,d=Ce,Ce|=4;try{ug(e,t,a)}finally{Ce=d,F.p=s,H.T=n}}Je=1,Mf(),zf(),Of()}}function Mf(){if(Je===1){Je=0;var e=_a,t=Dn,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=H.T,H.T=null;var n=F.p;F.p=2;var s=Ce;Ce|=4;try{ff(t,e);var u=_r,d=vo(e.containerInfo),p=u.focusedElem,S=u.selectionRange;if(d!==p&&p&&p.ownerDocument&&go(p.ownerDocument.documentElement,p)){if(S!==null&&eu(p)){var R=S.start,B=S.end;if(B===void 0&&(B=R),"selectionStart"in p)p.selectionStart=R,p.selectionEnd=Math.min(B,p.value.length);else{var Y=p.ownerDocument||document,M=Y&&Y.defaultView||window;if(M.getSelection){var U=M.getSelection(),ee=p.textContent.length,ue=Math.min(S.start,ee),Re=S.end===void 0?ue:Math.min(S.end,ee);!U.extend&&ue>Re&&(d=Re,Re=ue,ue=d);var T=po(p,ue),w=po(p,Re);if(T&&w&&(U.rangeCount!==1||U.anchorNode!==T.node||U.anchorOffset!==T.offset||U.focusNode!==w.node||U.focusOffset!==w.offset)){var A=Y.createRange();A.setStart(T.node,T.offset),U.removeAllRanges(),ue>Re?(U.addRange(A),U.extend(w.node,w.offset)):(A.setEnd(w.node,w.offset),U.addRange(A))}}}}for(Y=[],U=p;U=U.parentNode;)U.nodeType===1&&Y.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<Y.length;p++){var q=Y[p];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}ss=!!Tr,_r=Tr=null}finally{Ce=s,F.p=n,H.T=a}}e.current=t,Je=2}}function zf(){if(Je===2){Je=0;var e=_a,t=Dn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=H.T,H.T=null;var n=F.p;F.p=2;var s=Ce;Ce|=4;try{uf(e,t.alternate,t)}finally{Ce=s,F.p=n,H.T=a}}Je=3}}function Of(){if(Je===4||Je===3){Je=0,Bm();var e=_a,t=Dn,a=ca,n=xf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Dn=_a=null,Uf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Ta=null),Us(a),t=t.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Kn,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=H.T,s=F.p,F.p=2,H.T=null;try{for(var u=e.onRecoverableError,d=0;d<n.length;d++){var p=n[d];u(p.value,{componentStack:p.stack})}}finally{H.T=t,F.p=s}}(ca&3)!==0&&Ji(),Qt(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===pr?Al++:(Al=0,pr=e):Al=0,Rl(0)}}function Uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,dl(t)))}function Ji(){return Mf(),zf(),Of(),Df()}function Df(){if(Je!==5)return!1;var e=_a,t=hr;hr=0;var a=Us(ca),n=H.T,s=F.p;try{F.p=32>a?32:a,H.T=null,a=mr,mr=null;var u=_a,d=ca;if(Je=0,Dn=_a=null,ca=0,(Ce&6)!==0)throw Error(o(331));var p=Ce;if(Ce|=4,vf(u.current),mf(u,u.current,d,a),Ce=p,Rl(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Kn,u)}catch{}return!0}finally{F.p=s,H.T=n,Uf(e,t)}}function Hf(e,t,a){t=At(a,t),t=$u(e.stateNode,t,2),e=Sa(e,t,2),e!==null&&(Wn(e,2),Qt(e))}function ke(e,t,a){if(e.tag===3)Hf(e,e,a);else for(;t!==null;){if(t.tag===3){Hf(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ta===null||!Ta.has(n))){e=At(a,e),a=Hd(2),n=Sa(t,a,2),n!==null&&(Bd(a,n,t,e),Wn(n,2),Qt(n));break}}t=t.return}}function yr(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new og;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(a)||(or=!0,s.add(a),e=pg.bind(null,e,t,a),t.then(e,e))}function pg(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Oe===e&&(ve&a)===a&&(qe===4||qe===3&&(ve&62914560)===ve&&300>mt()-Gi?(Ce&2)===0&&Hn(e,0):dr|=a,Un===ve&&(Un=0)),Qt(e)}function Bf(e,t){t===0&&(t=Ac()),e=Xa(e,t),e!==null&&(Wn(e,t),Qt(e))}function gg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Bf(e,a)}function vg(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Bf(e,a)}function yg(e,t){return Rs(e,t)}var Ki=null,Ln=null,br=!1,Fi=!1,xr=!1,Ra=0;function Qt(e){e!==Ln&&e.next===null&&(Ln===null?Ki=Ln=e:Ln=Ln.next=e),Fi=!0,br||(br=!0,xg())}function Rl(e,t){if(!xr&&Fi){xr=!0;do for(var a=!1,n=Ki;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var u=0;else{var d=n.suspendedLanes,p=n.pingedLanes;u=(1<<31-gt(42|e)+1)-1,u&=s&~(d&~p),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(a=!0,Gf(n,u))}else u=ve,u=ei(n,n===Oe?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(u&3)===0||Fn(n,u)||(a=!0,Gf(n,u));n=n.next}while(a);xr=!1}}function bg(){Lf()}function Lf(){Fi=br=!1;var e=0;Ra!==0&&Ag()&&(e=Ra);for(var t=mt(),a=null,n=Ki;n!==null;){var s=n.next,u=qf(n,t);u===0?(n.next=null,a===null?Ki=s:a.next=s,s===null&&(Ln=a)):(a=n,(e!==0||(u&3)!==0)&&(Fi=!0)),n=s}Je!==0&&Je!==5||Rl(e),Ra!==0&&(Ra=0)}function qf(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var d=31-gt(u),p=1<<d,S=s[d];S===-1?((p&a)===0||(p&n)!==0)&&(s[d]=Qm(p,t)):S<=t&&(e.expiredLanes|=p),u&=~p}if(t=Oe,a=ve,a=ei(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Ee===2||Ee===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ms(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Fn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Ms(n),Us(a)){case 2:case 8:a=Tc;break;case 32:a=Fl;break;case 268435456:a=_c;break;default:a=Fl}return n=Yf.bind(null,e),a=Rs(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Ms(n),e.callbackPriority=2,e.callbackNode=null,2}function Yf(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ji()&&e.callbackNode!==a)return null;var n=ve;return n=ei(e,e===Oe?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Sf(e,n,t),qf(e,mt()),e.callbackNode!=null&&e.callbackNode===a?Yf.bind(null,e):null)}function Gf(e,t){if(Ji())return null;Sf(e,t,!0)}function xg(){Mg(function(){(Ce&6)!==0?Rs(kc,bg):Lf()})}function jr(){if(Ra===0){var e=Cn;e===0&&(e=Wl,Wl<<=1,(Wl&261888)===0&&(Wl=256)),Ra=e}return Ra}function Vf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:li(""+e)}function Zf(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function jg(e,t,a,n,s){if(t==="submit"&&a&&a.stateNode===s){var u=Vf((s[ut]||null).action),d=n.submitter;d&&(t=(t=d[ut]||null)?Vf(t.formAction):d.getAttribute("formAction"),t!==null&&(u=t,d=null));var p=new ri("action","action",null,n,s);e.push({event:p,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Ra!==0){var S=d?Zf(s,d):new FormData(s);Yu(a,{pending:!0,data:S,method:s.method,action:u},null,S)}}else typeof u=="function"&&(p.preventDefault(),S=d?Zf(s,d):new FormData(s),Yu(a,{pending:!0,data:S,method:s.method,action:u},u,S))},currentTarget:s}]})}}for(var Sr=0;Sr<lu.length;Sr++){var wr=lu[Sr],Sg=wr.toLowerCase(),wg=wr[0].toUpperCase()+wr.slice(1);Bt(Sg,"on"+wg)}Bt(xo,"onAnimationEnd"),Bt(jo,"onAnimationIteration"),Bt(So,"onAnimationStart"),Bt("dblclick","onDoubleClick"),Bt("focusin","onFocus"),Bt("focusout","onBlur"),Bt(Lp,"onTransitionRun"),Bt(qp,"onTransitionStart"),Bt(Yp,"onTransitionCancel"),Bt(wo,"onTransitionEnd"),on("onMouseEnter",["mouseout","mouseover"]),on("onMouseLeave",["mouseout","mouseover"]),on("onPointerEnter",["pointerout","pointerover"]),on("onPointerLeave",["pointerout","pointerover"]),Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ml="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Cg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ml));function Xf(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],s=n.event;n=n.listeners;e:{var u=void 0;if(t)for(var d=n.length-1;0<=d;d--){var p=n[d],S=p.instance,R=p.currentTarget;if(p=p.listener,S!==u&&s.isPropagationStopped())break e;u=p,s.currentTarget=R;try{u(s)}catch(B){di(B)}s.currentTarget=null,u=S}else for(d=0;d<n.length;d++){if(p=n[d],S=p.instance,R=p.currentTarget,p=p.listener,S!==u&&s.isPropagationStopped())break e;u=p,s.currentTarget=R;try{u(s)}catch(B){di(B)}s.currentTarget=null,u=S}}}}function pe(e,t){var a=t[Ds];a===void 0&&(a=t[Ds]=new Set);var n=e+"__bubble";a.has(n)||(Qf(t,e,2,!1),a.add(n))}function Cr(e,t,a){var n=0;t&&(n|=4),Qf(a,e,n,t)}var Wi="_reactListening"+Math.random().toString(36).slice(2);function Nr(e){if(!e[Wi]){e[Wi]=!0,Hc.forEach(function(a){a!=="selectionchange"&&(Cg.has(a)||Cr(a,!1,e),Cr(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wi]||(t[Wi]=!0,Cr("selectionchange",!1,t))}}function Qf(e,t,a,n){switch(jh(t)){case 2:var s=Ig;break;case 8:s=Pg;break;default:s=qr}a=s.bind(null,t,a,e),s=void 0,!Xs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,a,{capture:!0,passive:s}):e.addEventListener(t,a,!0):s!==void 0?e.addEventListener(t,a,{passive:s}):e.addEventListener(t,a,!1)}function Er(e,t,a,n,s){var u=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var d=n.tag;if(d===3||d===4){var p=n.stateNode.containerInfo;if(p===s)break;if(d===4)for(d=n.return;d!==null;){var S=d.tag;if((S===3||S===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;p!==null;){if(d=un(p),d===null)return;if(S=d.tag,S===5||S===6||S===26||S===27){n=u=d;continue e}p=p.parentNode}}n=n.return}Kc(function(){var R=u,B=Vs(a),Y=[];e:{var M=Co.get(e);if(M!==void 0){var U=ri,ee=e;switch(e){case"keypress":if(si(a)===0)break e;case"keydown":case"keyup":U=vp;break;case"focusin":ee="focus",U=Ks;break;case"focusout":ee="blur",U=Ks;break;case"beforeblur":case"afterblur":U=Ks;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=Ic;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=ip;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=xp;break;case xo:case jo:case So:U=rp;break;case wo:U=Sp;break;case"scroll":case"scrollend":U=np;break;case"wheel":U=Cp;break;case"copy":case"cut":case"paste":U=op;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=eo;break;case"toggle":case"beforetoggle":U=Ep}var ue=(t&4)!==0,Re=!ue&&(e==="scroll"||e==="scrollend"),T=ue?M!==null?M+"Capture":null:M;ue=[];for(var w=R,A;w!==null;){var q=w;if(A=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||A===null||T===null||(q=el(w,T),q!=null&&ue.push(zl(w,q,A))),Re)break;w=w.return}0<ue.length&&(M=new U(M,ee,null,a,B),Y.push({event:M,listeners:ue}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",M&&a!==Gs&&(ee=a.relatedTarget||a.fromElement)&&(un(ee)||ee[sn]))break e;if((U||M)&&(M=B.window===B?B:(M=B.ownerDocument)?M.defaultView||M.parentWindow:window,U?(ee=a.relatedTarget||a.toElement,U=R,ee=ee?un(ee):null,ee!==null&&(Re=h(ee),ue=ee.tag,ee!==Re||ue!==5&&ue!==27&&ue!==6)&&(ee=null)):(U=null,ee=R),U!==ee)){if(ue=Ic,q="onMouseLeave",T="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(ue=eo,q="onPointerLeave",T="onPointerEnter",w="pointer"),Re=U==null?M:Pn(U),A=ee==null?M:Pn(ee),M=new ue(q,w+"leave",U,a,B),M.target=Re,M.relatedTarget=A,q=null,un(B)===R&&(ue=new ue(T,w+"enter",ee,a,B),ue.target=A,ue.relatedTarget=Re,q=ue),Re=q,U&&ee)t:{for(ue=Ng,T=U,w=ee,A=0,q=T;q;q=ue(q))A++;q=0;for(var se=w;se;se=ue(se))q++;for(;0<A-q;)T=ue(T),A--;for(;0<q-A;)w=ue(w),q--;for(;A--;){if(T===w||w!==null&&T===w.alternate){ue=T;break t}T=ue(T),w=ue(w)}ue=null}else ue=null;U!==null&&$f(Y,M,U,ue,!1),ee!==null&&Re!==null&&$f(Y,Re,ee,ue,!0)}}e:{if(M=R?Pn(R):window,U=M.nodeName&&M.nodeName.toLowerCase(),U==="select"||U==="input"&&M.type==="file")var Se=ro;else if(so(M))if(co)Se=Dp;else{Se=Op;var ne=zp}else U=M.nodeName,!U||U.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?R&&Ys(R.elementType)&&(Se=ro):Se=Up;if(Se&&(Se=Se(e,R))){uo(Y,Se,a,B);break e}ne&&ne(e,M,R),e==="focusout"&&R&&M.type==="number"&&R.memoizedProps.value!=null&&qs(M,"number",M.value)}switch(ne=R?Pn(R):window,e){case"focusin":(so(ne)||ne.contentEditable==="true")&&(gn=ne,tu=R,rl=null);break;case"focusout":rl=tu=gn=null;break;case"mousedown":au=!0;break;case"contextmenu":case"mouseup":case"dragend":au=!1,yo(Y,a,B);break;case"selectionchange":if(Bp)break;case"keydown":case"keyup":yo(Y,a,B)}var fe;if(Ws)e:{switch(e){case"compositionstart":var ye="onCompositionStart";break e;case"compositionend":ye="onCompositionEnd";break e;case"compositionupdate":ye="onCompositionUpdate";break e}ye=void 0}else pn?lo(e,a)&&(ye="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ye="onCompositionStart");ye&&(to&&a.locale!=="ko"&&(pn||ye!=="onCompositionStart"?ye==="onCompositionEnd"&&pn&&(fe=Fc()):(pa=B,Qs="value"in pa?pa.value:pa.textContent,pn=!0)),ne=Ii(R,ye),0<ne.length&&(ye=new Pc(ye,e,null,a,B),Y.push({event:ye,listeners:ne}),fe?ye.data=fe:(fe=io(a),fe!==null&&(ye.data=fe)))),(fe=Tp?_p(e,a):Ap(e,a))&&(ye=Ii(R,"onBeforeInput"),0<ye.length&&(ne=new Pc("onBeforeInput","beforeinput",null,a,B),Y.push({event:ne,listeners:ye}),ne.data=fe)),jg(Y,e,R,a,B)}Xf(Y,t)})}function zl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ii(e,t){for(var a=t+"Capture",n=[];e!==null;){var s=e,u=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||u===null||(s=el(e,a),s!=null&&n.unshift(zl(e,s,u)),s=el(e,t),s!=null&&n.push(zl(e,s,u))),e.tag===3)return n;e=e.return}return[]}function Ng(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $f(e,t,a,n,s){for(var u=t._reactName,d=[];a!==null&&a!==n;){var p=a,S=p.alternate,R=p.stateNode;if(p=p.tag,S!==null&&S===n)break;p!==5&&p!==26&&p!==27||R===null||(S=R,s?(R=el(a,u),R!=null&&d.unshift(zl(a,R,S))):s||(R=el(a,u),R!=null&&d.push(zl(a,R,S)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var Eg=/\r\n?/g,kg=/\u0000|\uFFFD/g;function Jf(e){return(typeof e=="string"?e:""+e).replace(Eg,`
|
|
49
|
+
`).replace(kg,"")}function Kf(e,t){return t=Jf(t),Jf(e)===t}function Ae(e,t,a,n,s,u){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||fn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&fn(e,""+n);break;case"className":ai(e,"class",n);break;case"tabIndex":ai(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ai(e,a,n);break;case"style":$c(e,n,u);break;case"data":if(t!=="object"){ai(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=li(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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"&&(a==="formAction"?(t!=="input"&&Ae(e,t,"name",s.name,s,null),Ae(e,t,"formEncType",s.formEncType,s,null),Ae(e,t,"formMethod",s.formMethod,s,null),Ae(e,t,"formTarget",s.formTarget,s,null)):(Ae(e,t,"encType",s.encType,s,null),Ae(e,t,"method",s.method,s,null),Ae(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=li(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Jt);break;case"onScroll":n!=null&&pe("scroll",e);break;case"onScrollEnd":n!=null&&pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=li(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":pe("beforetoggle",e),pe("toggle",e),ti(e,"popover",n);break;case"xlinkActuate":$t(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":$t(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":$t(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":$t(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":$t(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":$t(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":$t(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":$t(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":$t(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":ti(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=tp.get(a)||a,ti(e,a,n))}}function kr(e,t,a,n,s,u){switch(a){case"style":$c(e,n,u);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof n=="string"?fn(e,n):(typeof n=="number"||typeof n=="bigint")&&fn(e,""+n);break;case"onScroll":n!=null&&pe("scroll",e);break;case"onScrollEnd":n!=null&&pe("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Jt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),t=a.slice(2,s?a.length-7:void 0),u=e[ut]||null,u=u!=null?u[a]:null,typeof u=="function"&&e.removeEventListener(t,u,s),typeof n=="function")){typeof u!="function"&&u!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,s);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):ti(e,a,n)}}}function tt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":pe("error",e),pe("load",e);var n=!1,s=!1,u;for(u in a)if(a.hasOwnProperty(u)){var d=a[u];if(d!=null)switch(u){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ae(e,t,u,d,a,null)}}s&&Ae(e,t,"srcSet",a.srcSet,a,null),n&&Ae(e,t,"src",a.src,a,null);return;case"input":pe("invalid",e);var p=u=d=s=null,S=null,R=null;for(n in a)if(a.hasOwnProperty(n)){var B=a[n];if(B!=null)switch(n){case"name":s=B;break;case"type":d=B;break;case"checked":S=B;break;case"defaultChecked":R=B;break;case"value":u=B;break;case"defaultValue":p=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(o(137,t));break;default:Ae(e,t,n,B,a,null)}}Vc(e,u,p,S,R,d,s,!1);return;case"select":pe("invalid",e),n=d=u=null;for(s in a)if(a.hasOwnProperty(s)&&(p=a[s],p!=null))switch(s){case"value":u=p;break;case"defaultValue":d=p;break;case"multiple":n=p;default:Ae(e,t,s,p,a,null)}t=u,a=d,e.multiple=!!n,t!=null?dn(e,!!n,t,!1):a!=null&&dn(e,!!n,a,!0);return;case"textarea":pe("invalid",e),u=s=n=null;for(d in a)if(a.hasOwnProperty(d)&&(p=a[d],p!=null))switch(d){case"value":n=p;break;case"defaultValue":s=p;break;case"children":u=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:Ae(e,t,d,p,a,null)}Xc(e,n,s,u);return;case"option":for(S in a)if(a.hasOwnProperty(S)&&(n=a[S],n!=null))switch(S){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ae(e,t,S,n,a,null)}return;case"dialog":pe("beforetoggle",e),pe("toggle",e),pe("cancel",e),pe("close",e);break;case"iframe":case"object":pe("load",e);break;case"video":case"audio":for(n=0;n<Ml.length;n++)pe(Ml[n],e);break;case"image":pe("error",e),pe("load",e);break;case"details":pe("toggle",e);break;case"embed":case"source":case"link":pe("error",e),pe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(R in a)if(a.hasOwnProperty(R)&&(n=a[R],n!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ae(e,t,R,n,a,null)}return;default:if(Ys(t)){for(B in a)a.hasOwnProperty(B)&&(n=a[B],n!==void 0&&kr(e,t,B,n,a,void 0));return}}for(p in a)a.hasOwnProperty(p)&&(n=a[p],n!=null&&Ae(e,t,p,n,a,null))}function Tg(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,u=null,d=null,p=null,S=null,R=null,B=null;for(U in a){var Y=a[U];if(a.hasOwnProperty(U)&&Y!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":S=Y;default:n.hasOwnProperty(U)||Ae(e,t,U,null,n,Y)}}for(var M in n){var U=n[M];if(Y=a[M],n.hasOwnProperty(M)&&(U!=null||Y!=null))switch(M){case"type":u=U;break;case"name":s=U;break;case"checked":R=U;break;case"defaultChecked":B=U;break;case"value":d=U;break;case"defaultValue":p=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(o(137,t));break;default:U!==Y&&Ae(e,t,M,U,n,Y)}}Ls(e,d,p,S,R,B,u,s);return;case"select":U=d=p=M=null;for(u in a)if(S=a[u],a.hasOwnProperty(u)&&S!=null)switch(u){case"value":break;case"multiple":U=S;default:n.hasOwnProperty(u)||Ae(e,t,u,null,n,S)}for(s in n)if(u=n[s],S=a[s],n.hasOwnProperty(s)&&(u!=null||S!=null))switch(s){case"value":M=u;break;case"defaultValue":p=u;break;case"multiple":d=u;default:u!==S&&Ae(e,t,s,u,n,S)}t=p,a=d,n=U,M!=null?dn(e,!!a,M,!1):!!n!=!!a&&(t!=null?dn(e,!!a,t,!0):dn(e,!!a,a?[]:"",!1));return;case"textarea":U=M=null;for(p in a)if(s=a[p],a.hasOwnProperty(p)&&s!=null&&!n.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:Ae(e,t,p,null,n,s)}for(d in n)if(s=n[d],u=a[d],n.hasOwnProperty(d)&&(s!=null||u!=null))switch(d){case"value":M=s;break;case"defaultValue":U=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(o(91));break;default:s!==u&&Ae(e,t,d,s,n,u)}Zc(e,M,U);return;case"option":for(var ee in a)if(M=a[ee],a.hasOwnProperty(ee)&&M!=null&&!n.hasOwnProperty(ee))switch(ee){case"selected":e.selected=!1;break;default:Ae(e,t,ee,null,n,M)}for(S in n)if(M=n[S],U=a[S],n.hasOwnProperty(S)&&M!==U&&(M!=null||U!=null))switch(S){case"selected":e.selected=M&&typeof M!="function"&&typeof M!="symbol";break;default:Ae(e,t,S,M,n,U)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in a)M=a[ue],a.hasOwnProperty(ue)&&M!=null&&!n.hasOwnProperty(ue)&&Ae(e,t,ue,null,n,M);for(R in n)if(M=n[R],U=a[R],n.hasOwnProperty(R)&&M!==U&&(M!=null||U!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,t));break;default:Ae(e,t,R,M,n,U)}return;default:if(Ys(t)){for(var Re in a)M=a[Re],a.hasOwnProperty(Re)&&M!==void 0&&!n.hasOwnProperty(Re)&&kr(e,t,Re,void 0,n,M);for(B in n)M=n[B],U=a[B],!n.hasOwnProperty(B)||M===U||M===void 0&&U===void 0||kr(e,t,B,M,n,U);return}}for(var T in a)M=a[T],a.hasOwnProperty(T)&&M!=null&&!n.hasOwnProperty(T)&&Ae(e,t,T,null,n,M);for(Y in n)M=n[Y],U=a[Y],!n.hasOwnProperty(Y)||M===U||M==null&&U==null||Ae(e,t,Y,M,n,U)}function Ff(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _g(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var s=a[n],u=s.transferSize,d=s.initiatorType,p=s.duration;if(u&&p&&Ff(d)){for(d=0,p=s.responseEnd,n+=1;n<a.length;n++){var S=a[n],R=S.startTime;if(R>p)break;var B=S.transferSize,Y=S.initiatorType;B&&Ff(Y)&&(S=S.responseEnd,d+=B*(S<p?1:(p-R)/(S-R)))}if(--n,t+=8*(u+d)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Tr=null,_r=null;function Pi(e){return e.nodeType===9?e:e.ownerDocument}function Wf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function If(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Ar(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Rr=null;function Ag(){var e=window.event;return e&&e.type==="popstate"?e===Rr?!1:(Rr=e,!0):(Rr=null,!1)}var Pf=typeof setTimeout=="function"?setTimeout:void 0,Rg=typeof clearTimeout=="function"?clearTimeout:void 0,eh=typeof Promise=="function"?Promise:void 0,Mg=typeof queueMicrotask=="function"?queueMicrotask:typeof eh<"u"?function(e){return eh.resolve(null).then(e).catch(zg)}:Pf;function zg(e){setTimeout(function(){throw e})}function Ma(e){return e==="head"}function th(e,t){var a=t,n=0;do{var s=a.nextSibling;if(e.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(s),Vn(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Ol(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ol(a);for(var u=a.firstChild;u;){var d=u.nextSibling,p=u.nodeName;u[In]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&u.rel.toLowerCase()==="stylesheet"||a.removeChild(u),u=d}}else a==="body"&&Ol(e.ownerDocument.body);a=s}while(a);Vn(t)}function ah(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Mr(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Mr(a),Hs(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Og(e,t,a,n){for(;e.nodeType===1;){var s=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[In])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Ut(e.nextSibling),e===null)break}return null}function Ug(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Ut(e.nextSibling),e===null))return null;return e}function nh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ut(e.nextSibling),e===null))return null;return e}function zr(e){return e.data==="$?"||e.data==="$~"}function Or(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Dg(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Ut(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Ur=null;function lh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Ut(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function ih(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function sh(e,t,a){switch(t=Pi(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ol(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Hs(e)}var Dt=new Map,uh=new Set;function es(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var oa=F.d;F.d={f:Hg,r:Bg,D:Lg,C:qg,L:Yg,m:Gg,X:Zg,S:Vg,M:Xg};function Hg(){var e=oa.f(),t=Xi();return e||t}function Bg(e){var t=rn(e);t!==null&&t.tag===5&&t.type==="form"?wd(t):oa.r(e)}var qn=typeof document>"u"?null:document;function rh(e,t,a){var n=qn;if(n&&typeof t=="string"&&t){var s=Tt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),uh.has(s)||(uh.add(s),e={rel:e,crossOrigin:a,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),tt(t,"link",e),Ke(t),n.head.appendChild(t)))}}function Lg(e){oa.D(e),rh("dns-prefetch",e,null)}function qg(e,t){oa.C(e,t),rh("preconnect",e,t)}function Yg(e,t,a){oa.L(e,t,a);var n=qn;if(n&&e&&t){var s='link[rel="preload"][as="'+Tt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+Tt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+Tt(a.imageSizes)+'"]')):s+='[href="'+Tt(e)+'"]';var u=s;switch(t){case"style":u=Yn(e);break;case"script":u=Gn(e)}Dt.has(u)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Dt.set(u,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(Ul(u))||t==="script"&&n.querySelector(Dl(u))||(t=n.createElement("link"),tt(t,"link",e),Ke(t),n.head.appendChild(t)))}}function Gg(e,t){oa.m(e,t);var a=qn;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Tt(n)+'"][href="'+Tt(e)+'"]',u=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Gn(e)}if(!Dt.has(u)&&(e=j({rel:"modulepreload",href:e},t),Dt.set(u,e),a.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Dl(u)))return}n=a.createElement("link"),tt(n,"link",e),Ke(n),a.head.appendChild(n)}}}function Vg(e,t,a){oa.S(e,t,a);var n=qn;if(n&&e){var s=cn(n).hoistableStyles,u=Yn(e);t=t||"default";var d=s.get(u);if(!d){var p={loading:0,preload:null};if(d=n.querySelector(Ul(u)))p.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Dt.get(u))&&Dr(e,a);var S=d=n.createElement("link");Ke(S),tt(S,"link",e),S._p=new Promise(function(R,B){S.onload=R,S.onerror=B}),S.addEventListener("load",function(){p.loading|=1}),S.addEventListener("error",function(){p.loading|=2}),p.loading|=4,ts(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:p},s.set(u,d)}}}function Zg(e,t){oa.X(e,t);var a=qn;if(a&&e){var n=cn(a).hoistableScripts,s=Gn(e),u=n.get(s);u||(u=a.querySelector(Dl(s)),u||(e=j({src:e,async:!0},t),(t=Dt.get(s))&&Hr(e,t),u=a.createElement("script"),Ke(u),tt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(s,u))}}function Xg(e,t){oa.M(e,t);var a=qn;if(a&&e){var n=cn(a).hoistableScripts,s=Gn(e),u=n.get(s);u||(u=a.querySelector(Dl(s)),u||(e=j({src:e,async:!0,type:"module"},t),(t=Dt.get(s))&&Hr(e,t),u=a.createElement("script"),Ke(u),tt(u,"link",e),a.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},n.set(s,u))}}function ch(e,t,a,n){var s=(s=he.current)?es(s):null;if(!s)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Yn(a.href),a=cn(s).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Yn(a.href);var u=cn(s).hoistableStyles,d=u.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=s.querySelector(Ul(e)))&&!u._p&&(d.instance=u,d.state.loading=5),Dt.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},Dt.set(e,a),u||Qg(s,e,a,d.state))),t&&n===null)throw Error(o(528,""));return d}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Gn(a),a=cn(s).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Yn(e){return'href="'+Tt(e)+'"'}function Ul(e){return'link[rel="stylesheet"]['+e+"]"}function oh(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function Qg(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),tt(t,"link",a),Ke(t),e.head.appendChild(t))}function Gn(e){return'[src="'+Tt(e)+'"]'}function Dl(e){return"script[async]"+e}function dh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Tt(a.href)+'"]');if(n)return t.instance=n,Ke(n),n;var s=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Ke(n),tt(n,"style",s),ts(n,a.precedence,e),t.instance=n;case"stylesheet":s=Yn(a.href);var u=e.querySelector(Ul(s));if(u)return t.state.loading|=4,t.instance=u,Ke(u),u;n=oh(a),(s=Dt.get(s))&&Dr(n,s),u=(e.ownerDocument||e).createElement("link"),Ke(u);var d=u;return d._p=new Promise(function(p,S){d.onload=p,d.onerror=S}),tt(u,"link",n),t.state.loading|=4,ts(u,a.precedence,e),t.instance=u;case"script":return u=Gn(a.src),(s=e.querySelector(Dl(u)))?(t.instance=s,Ke(s),s):(n=a,(s=Dt.get(u))&&(n=j({},a),Hr(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),Ke(s),tt(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,ts(n,a.precedence,e));return t.instance}function ts(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,u=s,d=0;d<n.length;d++){var p=n[d];if(p.dataset.precedence===t)u=p;else if(u!==s)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Dr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var as=null;function fh(e,t,a){if(as===null){var n=new Map,s=as=new Map;s.set(a,n)}else s=as,n=s.get(a),n||(n=new Map,s.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),s=0;s<a.length;s++){var u=a[s];if(!(u[In]||u[We]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var d=u.getAttribute(t)||"";d=e+d;var p=n.get(d);p?p.push(u):n.set(d,[u])}}return n}function hh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function $g(e,t,a){if(a===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 mh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jg(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=Yn(n.href),u=t.querySelector(Ul(s));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ns.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=u,Ke(u);return}u=t.ownerDocument||t,n=oh(n),(s=Dt.get(s))&&Dr(n,s),u=u.createElement("link"),Ke(u);var d=u;d._p=new Promise(function(p,S){d.onload=p,d.onerror=S}),tt(u,"link",n),a.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ns.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Br=0;function Kg(e,t){return e.stylesheets&&e.count===0&&is(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&is(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Br===0&&(Br=62500*_g());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&is(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Br?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function ns(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)is(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ls=null;function is(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ls=new Map,t.forEach(Fg,e),ls=null,ns.call(e))}function Fg(e,t){if(!(t.state.loading&4)){var a=ls.get(e);if(a)var n=a.get(null);else{a=new Map,ls.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<s.length;u++){var d=s[u];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),n=d)}n&&a.set(null,n)}s=t.instance,d=s.getAttribute("data-precedence"),u=a.get(d)||n,u===n&&a.set(null,s),a.set(d,s),this.count++,n=ns.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),u?u.parentNode.insertBefore(s,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Hl={$$typeof:X,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function Wg(e,t,a,n,s,u,d,p,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=zs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zs(0),this.hiddenUpdates=zs(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=u,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function ph(e,t,a,n,s,u,d,p,S,R,B,Y){return e=new Wg(e,t,a,d,S,R,B,Y,p),t=1,u===!0&&(t|=24),u=yt(3,null,null,t),e.current=u,u.stateNode=e,t=vu(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:n,isDehydrated:a,cache:t},ju(u),e}function gh(e){return e?(e=bn,e):bn}function vh(e,t,a,n,s,u){s=gh(s),n.context===null?n.context=s:n.pendingContext=s,n=ja(t),n.payload={element:a},u=u===void 0?null:u,u!==null&&(n.callback=u),a=Sa(e,n,t),a!==null&&(ht(a,e,t),pl(a,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Lr(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Xa(e,67108864);t!==null&&ht(t,e,67108864),Lr(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=wt();t=Os(t);var a=Xa(e,t);a!==null&&ht(a,e,t),Lr(e,t)}}var ss=!0;function Ig(e,t,a,n){var s=H.T;H.T=null;var u=F.p;try{F.p=2,qr(e,t,a,n)}finally{F.p=u,H.T=s}}function Pg(e,t,a,n){var s=H.T;H.T=null;var u=F.p;try{F.p=8,qr(e,t,a,n)}finally{F.p=u,H.T=s}}function qr(e,t,a,n){if(ss){var s=Yr(n);if(s===null)Er(e,t,n,us,a),Sh(e,n);else if(tv(s,e,t,a,n))n.stopPropagation();else if(Sh(e,n),t&4&&-1<ev.indexOf(e)){for(;s!==null;){var u=rn(s);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var d=qa(u.pendingLanes);if(d!==0){var p=u;for(p.pendingLanes|=2,p.entangledLanes|=2;d;){var S=1<<31-gt(d);p.entanglements[1]|=S,d&=~S}Qt(u),(Ce&6)===0&&(Vi=mt()+500,Rl(0))}}break;case 31:case 13:p=Xa(u,2),p!==null&&ht(p,u,2),Xi(),Lr(u,2)}if(u=Yr(n),u===null&&Er(e,t,n,us,a),u===s)break;s=u}s!==null&&n.stopPropagation()}else Er(e,t,n,null,a)}}function Yr(e){return e=Vs(e),Gr(e)}var us=null;function Gr(e){if(us=null,e=un(e),e!==null){var t=h(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=g(t),e!==null)return e;e=null}else if(a===31){if(e=y(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return us=e,null}function jh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Lm()){case kc:return 2;case Tc:return 8;case Fl:case qm:return 32;case _c:return 268435456;default:return 32}default:return 32}}var Vr=!1,za=null,Oa=null,Ua=null,Bl=new Map,Ll=new Map,Da=[],ev="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Sh(e,t){switch(e){case"focusin":case"focusout":za=null;break;case"dragenter":case"dragleave":Oa=null;break;case"mouseover":case"mouseout":Ua=null;break;case"pointerover":case"pointerout":Bl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ll.delete(t.pointerId)}}function ql(e,t,a,n,s,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:u,targetContainers:[s]},t!==null&&(t=rn(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function tv(e,t,a,n,s){switch(t){case"focusin":return za=ql(za,e,t,a,n,s),!0;case"dragenter":return Oa=ql(Oa,e,t,a,n,s),!0;case"mouseover":return Ua=ql(Ua,e,t,a,n,s),!0;case"pointerover":var u=s.pointerId;return Bl.set(u,ql(Bl.get(u)||null,e,t,a,n,s)),!0;case"gotpointercapture":return u=s.pointerId,Ll.set(u,ql(Ll.get(u)||null,e,t,a,n,s)),!0}return!1}function wh(e){var t=un(e.target);if(t!==null){var a=h(t);if(a!==null){if(t=a.tag,t===13){if(t=g(a),t!==null){e.blockedOn=t,Uc(e.priority,function(){xh(a)});return}}else if(t===31){if(t=y(a),t!==null){e.blockedOn=t,Uc(e.priority,function(){xh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Yr(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Gs=n,a.target.dispatchEvent(n),Gs=null}else return t=rn(a),t!==null&&bh(t),e.blockedOn=a,!1;t.shift()}return!0}function Ch(e,t,a){rs(e)&&a.delete(t)}function av(){Vr=!1,za!==null&&rs(za)&&(za=null),Oa!==null&&rs(Oa)&&(Oa=null),Ua!==null&&rs(Ua)&&(Ua=null),Bl.forEach(Ch),Ll.forEach(Ch)}function cs(e,t){e.blockedOn===t&&(e.blockedOn=null,Vr||(Vr=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,av)))}var os=null;function Nh(e){os!==e&&(os=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){os===e&&(os=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],s=e[t+2];if(typeof n!="function"){if(Gr(n||a)===null)continue;break}var u=rn(a);u!==null&&(e.splice(t,3),t-=3,Yu(u,{pending:!0,data:s,method:a.method,action:n},n,s))}}))}function Vn(e){function t(S){return cs(S,e)}za!==null&&cs(za,e),Oa!==null&&cs(Oa,e),Ua!==null&&cs(Ua,e),Bl.forEach(t),Ll.forEach(t);for(var a=0;a<Da.length;a++){var n=Da[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Da.length&&(a=Da[0],a.blockedOn===null);)wh(a),a.blockedOn===null&&Da.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var s=a[n],u=a[n+1],d=s[ut]||null;if(typeof u=="function")d||Nh(a);else if(d){var p=null;if(u&&u.hasAttribute("formAction")){if(s=u,d=u[ut]||null)p=d.formAction;else if(Gr(s)!==null)continue}else p=d.action;typeof p=="function"?a[n+1]=p:(a.splice(n,3),n-=3),Nh(a)}}}function Eh(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Zr(e){this._internalRoot=e}ds.prototype.render=Zr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,n=wt();vh(a,n,e,t,null,null)},ds.prototype.unmount=Zr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Xi(),t[sn]=null}};function ds(e){this._internalRoot=e}ds.prototype.unstable_scheduleHydration=function(e){if(e){var t=Oc();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Da.length&&t!==0&&t<Da[a].priority;a++);Da.splice(a,0,e),a===0&&wh(e)}};var kh=r.version;if(kh!=="19.2.5")throw Error(o(527,kh,"19.2.5"));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var nv={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fs.isDisabled&&fs.supportsFiber)try{Kn=fs.inject(nv),pt=fs}catch{}}return Gl.createRoot=function(e,t){if(!f(e))throw Error(o(299));var a=!1,n="",s=zd,u=Od,d=Ud;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=ph(e,1,!1,null,null,a,n,null,s,u,d,Eh),e[sn]=t.current,Nr(e),new Zr(t)},Gl.hydrateRoot=function(e,t,a){if(!f(e))throw Error(o(299));var n=!1,s="",u=zd,d=Od,p=Ud,S=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(u=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(p=a.onRecoverableError),a.formState!==void 0&&(S=a.formState)),t=ph(e,1,!0,t,a??null,n,s,S,u,d,p,Eh),t.context=gh(null),a=t.current,n=wt(),n=Os(n),s=ja(n),s.callback=null,Sa(a,s,n),a=n,t.current.lanes=a,Wn(t,a),Qt(t),e[sn]=t.current,Nr(e),new ds(t)},Gl.version="19.2.5",Gl}var Hh;function hv(){if(Hh)return $r.exports;Hh=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(r){console.error(r)}}return l(),$r.exports=fv(),$r.exports}var mv=hv();/**
|
|
50
|
+
* react-router v7.14.2
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var Bh="popstate";function Lh(l){return typeof l=="object"&&l!=null&&"pathname"in l&&"search"in l&&"hash"in l&&"state"in l&&"key"in l}function pv(l={}){function r(o,f){var v;let h=(v=f.state)==null?void 0:v.masked,{pathname:g,search:y,hash:m}=h||o.location;return uc("",{pathname:g,search:y,hash:m},f.state&&f.state.usr||null,f.state&&f.state.key||"default",h?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function c(o,f){return typeof f=="string"?f:Ql(f)}return vv(r,c,null,l)}function Be(l,r){if(l===!1||l===null||typeof l>"u")throw new Error(r)}function Ht(l,r){if(!l){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function gv(){return Math.random().toString(36).substring(2,10)}function qh(l,r){return{usr:l.state,key:l.key,idx:r,masked:l.unstable_mask?{pathname:l.pathname,search:l.search,hash:l.hash}:void 0}}function uc(l,r,c=null,o,f){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof r=="string"?Zn(r):r,state:c,key:r&&r.key||o||gv(),unstable_mask:f}}function Ql({pathname:l="/",search:r="",hash:c=""}){return r&&r!=="?"&&(l+=r.charAt(0)==="?"?r:"?"+r),c&&c!=="#"&&(l+=c.charAt(0)==="#"?c:"#"+c),l}function Zn(l){let r={};if(l){let c=l.indexOf("#");c>=0&&(r.hash=l.substring(c),l=l.substring(0,c));let o=l.indexOf("?");o>=0&&(r.search=l.substring(o),l=l.substring(0,o)),l&&(r.pathname=l)}return r}function vv(l,r,c,o={}){let{window:f=document.defaultView,v5Compat:h=!1}=o,g=f.history,y="POP",m=null,v=x();v==null&&(v=0,g.replaceState({...g.state,idx:v},""));function x(){return(g.state||{idx:null}).idx}function j(){y="POP";let L=x(),z=L==null?null:L-v;v=L,m&&m({action:y,location:O.location,delta:z})}function _(L,z){y="PUSH";let Z=Lh(L)?L:uc(O.location,L,z);v=x()+1;let X=qh(Z,v),P=O.createHref(Z.unstable_mask||Z);try{g.pushState(X,"",P)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;f.location.assign(P)}h&&m&&m({action:y,location:O.location,delta:1})}function k(L,z){y="REPLACE";let Z=Lh(L)?L:uc(O.location,L,z);v=x();let X=qh(Z,v),P=O.createHref(Z.unstable_mask||Z);g.replaceState(X,"",P),h&&m&&m({action:y,location:O.location,delta:0})}function C(L){return yv(L)}let O={get action(){return y},get location(){return l(f,g)},listen(L){if(m)throw new Error("A history only accepts one active listener");return f.addEventListener(Bh,j),m=L,()=>{f.removeEventListener(Bh,j),m=null}},createHref(L){return r(f,L)},createURL:C,encodeLocation(L){let z=C(L);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:_,replace:k,go(L){return g.go(L)}};return O}function yv(l,r=!1){let c="http://localhost";typeof window<"u"&&(c=window.location.origin!=="null"?window.location.origin:window.location.href),Be(c,"No window.location.(origin|href) available to create URL");let o=typeof l=="string"?l:Ql(l);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=c+o),new URL(o,c)}function tm(l,r,c="/"){return bv(l,r,c,!1)}function bv(l,r,c,o){let f=typeof r=="string"?Zn(r):r,h=fa(f.pathname||"/",c);if(h==null)return null;let g=am(l);xv(g);let y=null;for(let m=0;y==null&&m<g.length;++m){let v=Rv(h);y=_v(g[m],v,o)}return y}function am(l,r=[],c=[],o="",f=!1){let h=(g,y,m=f,v)=>{let x={relativePath:v===void 0?g.path||"":v,caseSensitive:g.caseSensitive===!0,childrenIndex:y,route:g};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(o)&&m)return;Be(x.relativePath.startsWith(o),`Absolute route path "${x.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(o.length)}let j=Yt([o,x.relativePath]),_=c.concat(x);g.children&&g.children.length>0&&(Be(g.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),am(g.children,r,_,j,m)),!(g.path==null&&!g.index)&&r.push({path:j,score:kv(j,g.index),routesMeta:_})};return l.forEach((g,y)=>{var m;if(g.path===""||!((m=g.path)!=null&&m.includes("?")))h(g,y);else for(let v of nm(g.path))h(g,y,!0,v)}),r}function nm(l){let r=l.split("/");if(r.length===0)return[];let[c,...o]=r,f=c.endsWith("?"),h=c.replace(/\?$/,"");if(o.length===0)return f?[h,""]:[h];let g=nm(o.join("/")),y=[];return y.push(...g.map(m=>m===""?h:[h,m].join("/"))),f&&y.push(...g),y.map(m=>l.startsWith("/")&&m===""?"/":m)}function xv(l){l.sort((r,c)=>r.score!==c.score?c.score-r.score:Tv(r.routesMeta.map(o=>o.childrenIndex),c.routesMeta.map(o=>o.childrenIndex)))}var jv=/^:[\w-]+$/,Sv=3,wv=2,Cv=1,Nv=10,Ev=-2,Yh=l=>l==="*";function kv(l,r){let c=l.split("/"),o=c.length;return c.some(Yh)&&(o+=Ev),r&&(o+=wv),c.filter(f=>!Yh(f)).reduce((f,h)=>f+(jv.test(h)?Sv:h===""?Cv:Nv),o)}function Tv(l,r){return l.length===r.length&&l.slice(0,-1).every((o,f)=>o===r[f])?l[l.length-1]-r[r.length-1]:0}function _v(l,r,c=!1){let{routesMeta:o}=l,f={},h="/",g=[];for(let y=0;y<o.length;++y){let m=o[y],v=y===o.length-1,x=h==="/"?r:r.slice(h.length)||"/",j=vs({path:m.relativePath,caseSensitive:m.caseSensitive,end:v},x),_=m.route;if(!j&&v&&c&&!o[o.length-1].route.index&&(j=vs({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},x)),!j)return null;Object.assign(f,j.params),g.push({params:f,pathname:Yt([h,j.pathname]),pathnameBase:Uv(Yt([h,j.pathnameBase])),route:_}),j.pathnameBase!=="/"&&(h=Yt([h,j.pathnameBase]))}return g}function vs(l,r){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[c,o]=Av(l.path,l.caseSensitive,l.end),f=r.match(c);if(!f)return null;let h=f[0],g=h.replace(/(.)\/+$/,"$1"),y=f.slice(1);return{params:o.reduce((v,{paramName:x,isOptional:j},_)=>{if(x==="*"){let C=y[_]||"";g=h.slice(0,h.length-C.length).replace(/(.)\/+$/,"$1")}const k=y[_];return j&&!k?v[x]=void 0:v[x]=(k||"").replace(/%2F/g,"/"),v},{}),pathname:h,pathnameBase:g,pattern:l}}function Av(l,r=!1,c=!0){Ht(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let o=[],f="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(g,y,m,v,x)=>{if(o.push({paramName:y,isOptional:m!=null}),m){let j=x.charAt(v+g.length);return j&&j!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(o.push({paramName:"*"}),f+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):c?f+="\\/*$":l!==""&&l!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,r?void 0:"i"),o]}function Rv(l){try{return l.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Ht(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),l}}function fa(l,r){if(r==="/")return l;if(!l.toLowerCase().startsWith(r.toLowerCase()))return null;let c=r.endsWith("/")?r.length-1:r.length,o=l.charAt(c);return o&&o!=="/"?null:l.slice(c)||"/"}var Mv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function zv(l,r="/"){let{pathname:c,search:o="",hash:f=""}=typeof l=="string"?Zn(l):l,h;return c?(c=lm(c),c.startsWith("/")?h=Gh(c.substring(1),"/"):h=Gh(c,r)):h=r,{pathname:h,search:Dv(o),hash:Hv(f)}}function Gh(l,r){let c=ys(r).split("/");return l.split("/").forEach(f=>{f===".."?c.length>1&&c.pop():f!=="."&&c.push(f)}),c.length>1?c.join("/"):"/"}function Wr(l,r,c,o){return`Cannot include a '${l}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${c}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ov(l){return l.filter((r,c)=>c===0||r.route.path&&r.route.path.length>0)}function fc(l){let r=Ov(l);return r.map((c,o)=>o===r.length-1?c.pathname:c.pathnameBase)}function js(l,r,c,o=!1){let f;typeof l=="string"?f=Zn(l):(f={...l},Be(!f.pathname||!f.pathname.includes("?"),Wr("?","pathname","search",f)),Be(!f.pathname||!f.pathname.includes("#"),Wr("#","pathname","hash",f)),Be(!f.search||!f.search.includes("#"),Wr("#","search","hash",f)));let h=l===""||f.pathname==="",g=h?"/":f.pathname,y;if(g==null)y=c;else{let j=r.length-1;if(!o&&g.startsWith("..")){let _=g.split("/");for(;_[0]==="..";)_.shift(),j-=1;f.pathname=_.join("/")}y=j>=0?r[j]:"/"}let m=zv(f,y),v=g&&g!=="/"&&g.endsWith("/"),x=(h||g===".")&&c.endsWith("/");return!m.pathname.endsWith("/")&&(v||x)&&(m.pathname+="/"),m}var lm=l=>l.replace(/\/\/+/g,"/"),Yt=l=>lm(l.join("/")),ys=l=>l.replace(/\/+$/,""),Uv=l=>ys(l).replace(/^\/*/,"/"),Dv=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,Hv=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,Bv=class{constructor(l,r,c,o=!1){this.status=l,this.statusText=r||"",this.internal=o,c instanceof Error?(this.data=c.toString(),this.error=c):this.data=c}};function Lv(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function qv(l){let r=l.map(c=>c.route.path).filter(Boolean);return Yt(r)||"/"}var im=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sm(l,r){let c=l;if(typeof c!="string"||!Mv.test(c))return{absoluteURL:void 0,isExternal:!1,to:c};let o=c,f=!1;if(im)try{let h=new URL(window.location.href),g=c.startsWith("//")?new URL(h.protocol+c):new URL(c),y=fa(g.pathname,r);g.origin===h.origin&&y!=null?c=y+g.search+g.hash:f=!0}catch{Ht(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:f,to:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var um=["POST","PUT","PATCH","DELETE"];new Set(um);var Yv=["GET",...um];new Set(Yv);var Xn=b.createContext(null);Xn.displayName="DataRouter";var Ss=b.createContext(null);Ss.displayName="DataRouterState";var rm=b.createContext(!1);function Gv(){return b.useContext(rm)}var cm=b.createContext({isTransitioning:!1});cm.displayName="ViewTransition";var Vv=b.createContext(new Map);Vv.displayName="Fetchers";var Zv=b.createContext(null);Zv.displayName="Await";var Ct=b.createContext(null);Ct.displayName="Navigation";var $l=b.createContext(null);$l.displayName="Location";var Gt=b.createContext({outlet:null,matches:[],isDataRoute:!1});Gt.displayName="Route";var hc=b.createContext(null);hc.displayName="RouteError";var om="REACT_ROUTER_ERROR",Xv="REDIRECT",Qv="ROUTE_ERROR_RESPONSE";function $v(l){if(l.startsWith(`${om}:${Xv}:{`))try{let r=JSON.parse(l.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function Jv(l){if(l.startsWith(`${om}:${Qv}:{`))try{let r=JSON.parse(l.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Bv(r.status,r.statusText,r.data)}catch{}}function Kv(l,{relative:r}={}){Be(Qn(),"useHref() may be used only in the context of a <Router> component.");let{basename:c,navigator:o}=b.useContext(Ct),{hash:f,pathname:h,search:g}=Jl(l,{relative:r}),y=h;return c!=="/"&&(y=h==="/"?c:Yt([c,h])),o.createHref({pathname:y,search:g,hash:f})}function Qn(){return b.useContext($l)!=null}function Nt(){return Be(Qn(),"useLocation() may be used only in the context of a <Router> component."),b.useContext($l).location}var dm="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fm(l){b.useContext(Ct).static||b.useLayoutEffect(l)}function mc(){let{isDataRoute:l}=b.useContext(Gt);return l?cy():Fv()}function Fv(){Be(Qn(),"useNavigate() may be used only in the context of a <Router> component.");let l=b.useContext(Xn),{basename:r,navigator:c}=b.useContext(Ct),{matches:o}=b.useContext(Gt),{pathname:f}=Nt(),h=JSON.stringify(fc(o)),g=b.useRef(!1);return fm(()=>{g.current=!0}),b.useCallback((m,v={})=>{if(Ht(g.current,dm),!g.current)return;if(typeof m=="number"){c.go(m);return}let x=js(m,JSON.parse(h),f,v.relative==="path");l==null&&r!=="/"&&(x.pathname=x.pathname==="/"?r:Yt([r,x.pathname])),(v.replace?c.replace:c.push)(x,v.state,v)},[r,c,h,f,l])}b.createContext(null);function Wv(){let{matches:l}=b.useContext(Gt),r=l[l.length-1];return(r==null?void 0:r.params)??{}}function Jl(l,{relative:r}={}){let{matches:c}=b.useContext(Gt),{pathname:o}=Nt(),f=JSON.stringify(fc(c));return b.useMemo(()=>js(l,JSON.parse(f),o,r==="path"),[l,f,o,r])}function Iv(l,r){return hm(l,r)}function hm(l,r,c){var L;Be(Qn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=b.useContext(Ct),{matches:f}=b.useContext(Gt),h=f[f.length-1],g=h?h.params:{},y=h?h.pathname:"/",m=h?h.pathnameBase:"/",v=h&&h.route;{let z=v&&v.path||"";pm(y,!v||z.endsWith("*")||z.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${y}" (under <Route path="${z}">) 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.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${z}"> to <Route path="${z==="/"?"*":`${z}/*`}">.`)}let x=Nt(),j;if(r){let z=typeof r=="string"?Zn(r):r;Be(m==="/"||((L=z.pathname)==null?void 0:L.startsWith(m)),`When overriding the location using \`<Routes location>\` 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 "${m}" but pathname "${z.pathname}" was given in the \`location\` prop.`),j=z}else j=x;let _=j.pathname||"/",k=_;if(m!=="/"){let z=m.replace(/^\//,"").split("/");k="/"+_.replace(/^\//,"").split("/").slice(z.length).join("/")}let C=tm(l,{pathname:k});Ht(v||C!=null,`No routes matched location "${j.pathname}${j.search}${j.hash}" `),Ht(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${j.pathname}${j.search}${j.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let O=ny(C&&C.map(z=>Object.assign({},z,{params:Object.assign({},g,z.params),pathname:Yt([m,o.encodeLocation?o.encodeLocation(z.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathname]),pathnameBase:z.pathnameBase==="/"?m:Yt([m,o.encodeLocation?o.encodeLocation(z.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:z.pathnameBase])})),f,c);return r&&O?b.createElement($l.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...j},navigationType:"POP"}},O):O}function Pv(){let l=ry(),r=Lv(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),c=l instanceof Error?l.stack:null,o="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:o},h={padding:"2px 4px",backgroundColor:o},g=null;return console.error("Error handled by React Router default ErrorBoundary:",l),g=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:h},"ErrorBoundary")," or"," ",b.createElement("code",{style:h},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},r),c?b.createElement("pre",{style:f},c):null,g)}var ey=b.createElement(Pv,null),mm=class extends b.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,r){return r.location!==l.location||r.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:r.error,location:r.location,revalidation:l.revalidation||r.revalidation}}componentDidCatch(l,r){this.props.onError?this.props.onError(l,r):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const c=Jv(l.digest);c&&(l=c)}let r=l!==void 0?b.createElement(Gt.Provider,{value:this.props.routeContext},b.createElement(hc.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?b.createElement(ty,{error:l},r):r}};mm.contextType=rm;var Ir=new WeakMap;function ty({children:l,error:r}){let{basename:c}=b.useContext(Ct);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=$v(r.digest);if(o){let f=Ir.get(r);if(f)throw f;let h=sm(o.location,c);if(im&&!Ir.get(r))if(h.isExternal||o.reloadDocument)window.location.href=h.absoluteURL||h.to;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(h.to,{replace:o.replace}));throw Ir.set(r,g),g}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h.absoluteURL||h.to}`})}}return l}function ay({routeContext:l,match:r,children:c}){let o=b.useContext(Xn);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement(Gt.Provider,{value:l},c)}function ny(l,r=[],c){let o=c==null?void 0:c.state;if(l==null){if(!o)return null;if(o.errors)l=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)l=o.matches;else return null}let f=l,h=o==null?void 0:o.errors;if(h!=null){let x=f.findIndex(j=>j.route.id&&(h==null?void 0:h[j.route.id])!==void 0);Be(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),f=f.slice(0,Math.min(f.length,x+1))}let g=!1,y=-1;if(c&&o){g=o.renderFallback;for(let x=0;x<f.length;x++){let j=f[x];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(y=x),j.route.id){let{loaderData:_,errors:k}=o,C=j.route.loader&&!_.hasOwnProperty(j.route.id)&&(!k||k[j.route.id]===void 0);if(j.route.lazy||C){c.isStatic&&(g=!0),y>=0?f=f.slice(0,y+1):f=[f[0]];break}}}}let m=c==null?void 0:c.onError,v=o&&m?(x,j)=>{var _,k;m(x,{location:o.location,params:((k=(_=o.matches)==null?void 0:_[0])==null?void 0:k.params)??{},unstable_pattern:qv(o.matches),errorInfo:j})}:void 0;return f.reduceRight((x,j,_)=>{let k,C=!1,O=null,L=null;o&&(k=h&&j.route.id?h[j.route.id]:void 0,O=j.route.errorElement||ey,g&&(y<0&&_===0?(pm("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,L=null):y===_&&(C=!0,L=j.route.hydrateFallbackElement||null)));let z=r.concat(f.slice(0,_+1)),Z=()=>{let X;return k?X=O:C?X=L:j.route.Component?X=b.createElement(j.route.Component,null):j.route.element?X=j.route.element:X=x,b.createElement(ay,{match:j,routeContext:{outlet:x,matches:z,isDataRoute:o!=null},children:X})};return o&&(j.route.ErrorBoundary||j.route.errorElement||_===0)?b.createElement(mm,{location:o.location,revalidation:o.revalidation,component:O,error:k,children:Z(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:v}):Z()},null)}function pc(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ly(l){let r=b.useContext(Xn);return Be(r,pc(l)),r}function iy(l){let r=b.useContext(Ss);return Be(r,pc(l)),r}function sy(l){let r=b.useContext(Gt);return Be(r,pc(l)),r}function gc(l){let r=sy(l),c=r.matches[r.matches.length-1];return Be(c.route.id,`${l} can only be used on routes that contain a unique "id"`),c.route.id}function uy(){return gc("useRouteId")}function ry(){var o;let l=b.useContext(hc),r=iy("useRouteError"),c=gc("useRouteError");return l!==void 0?l:(o=r.errors)==null?void 0:o[c]}function cy(){let{router:l}=ly("useNavigate"),r=gc("useNavigate"),c=b.useRef(!1);return fm(()=>{c.current=!0}),b.useCallback(async(f,h={})=>{Ht(c.current,dm),c.current&&(typeof f=="number"?await l.navigate(f):await l.navigate(f,{fromRouteId:r,...h}))},[l,r])}var Vh={};function pm(l,r,c){!r&&!Vh[l]&&(Vh[l]=!0,Ht(!1,c))}b.memo(oy);function oy({routes:l,future:r,state:c,isStatic:o,onError:f}){return hm(l,void 0,{state:c,isStatic:o,onError:f})}function Pr({to:l,replace:r,state:c,relative:o}){Be(Qn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:f}=b.useContext(Ct);Ht(!f,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:h}=b.useContext(Gt),{pathname:g}=Nt(),y=mc(),m=js(l,fc(h),g,o==="path"),v=JSON.stringify(m);return b.useEffect(()=>{y(JSON.parse(v),{replace:r,state:c,relative:o})},[y,v,o,r,c]),null}function nt(l){Be(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function dy({basename:l="/",children:r=null,location:c,navigationType:o="POP",navigator:f,static:h=!1,unstable_useTransitions:g}){Be(!Qn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let y=l.replace(/^\/*/,"/"),m=b.useMemo(()=>({basename:y,navigator:f,static:h,unstable_useTransitions:g,future:{}}),[y,f,h,g]);typeof c=="string"&&(c=Zn(c));let{pathname:v="/",search:x="",hash:j="",state:_=null,key:k="default",unstable_mask:C}=c,O=b.useMemo(()=>{let L=fa(v,y);return L==null?null:{location:{pathname:L,search:x,hash:j,state:_,key:k,unstable_mask:C},navigationType:o}},[y,v,x,j,_,k,o,C]);return Ht(O!=null,`<Router basename="${y}"> is not able to match the URL "${v}${x}${j}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:b.createElement(Ct.Provider,{value:m},b.createElement($l.Provider,{children:r,value:O}))}function fy({children:l,location:r}){return Iv(rc(l),r)}function rc(l,r=[]){let c=[];return b.Children.forEach(l,(o,f)=>{if(!b.isValidElement(o))return;let h=[...r,f];if(o.type===b.Fragment){c.push.apply(c,rc(o.props.children,h));return}Be(o.type===nt,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Be(!o.props.index||!o.props.children,"An index route cannot have child routes.");let g={id:o.props.id||h.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&&(g.children=rc(o.props.children,h)),c.push(g)}),c}var ps="get",gs="application/x-www-form-urlencoded";function ws(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function hy(l){return ws(l)&&l.tagName.toLowerCase()==="button"}function my(l){return ws(l)&&l.tagName.toLowerCase()==="form"}function py(l){return ws(l)&&l.tagName.toLowerCase()==="input"}function gy(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function vy(l,r){return l.button===0&&(!r||r==="_self")&&!gy(l)}function cc(l=""){return new URLSearchParams(typeof l=="string"||Array.isArray(l)||l instanceof URLSearchParams?l:Object.keys(l).reduce((r,c)=>{let o=l[c];return r.concat(Array.isArray(o)?o.map(f=>[c,f]):[[c,o]])},[]))}function yy(l,r){let c=cc(l);return r&&r.forEach((o,f)=>{c.has(f)||r.getAll(f).forEach(h=>{c.append(f,h)})}),c}var hs=null;function by(){if(hs===null)try{new FormData(document.createElement("form"),0),hs=!1}catch{hs=!0}return hs}var xy=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ec(l){return l!=null&&!xy.has(l)?(Ht(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${gs}"`),null):l}function jy(l,r){let c,o,f,h,g;if(my(l)){let y=l.getAttribute("action");o=y?fa(y,r):null,c=l.getAttribute("method")||ps,f=ec(l.getAttribute("enctype"))||gs,h=new FormData(l)}else if(hy(l)||py(l)&&(l.type==="submit"||l.type==="image")){let y=l.form;if(y==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=l.getAttribute("formaction")||y.getAttribute("action");if(o=m?fa(m,r):null,c=l.getAttribute("formmethod")||y.getAttribute("method")||ps,f=ec(l.getAttribute("formenctype"))||ec(y.getAttribute("enctype"))||gs,h=new FormData(y,l),!by()){let{name:v,type:x,value:j}=l;if(x==="image"){let _=v?`${v}.`:"";h.append(`${_}x`,"0"),h.append(`${_}y`,"0")}else v&&h.append(v,j)}}else{if(ws(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');c=ps,o=null,f=gs,g=l}return h&&f==="text/plain"&&(g=h,h=void 0),{action:o,method:c.toLowerCase(),encType:f,formData:h,body:g}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vc(l,r){if(l===!1||l===null||typeof l>"u")throw new Error(r)}function gm(l,r,c,o){let f=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return c?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${o}`:f.pathname=`${f.pathname}.${o}`:f.pathname==="/"?f.pathname=`_root.${o}`:r&&fa(f.pathname,r)==="/"?f.pathname=`${ys(r)}/_root.${o}`:f.pathname=`${ys(f.pathname)}.${o}`,f}async function Sy(l,r){if(l.id in r)return r[l.id];try{let c=await import(l.module);return r[l.id]=c,c}catch(c){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(c),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function wy(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function Cy(l,r,c){let o=await Promise.all(l.map(async f=>{let h=r.routes[f.route.id];if(h){let g=await Sy(h,c);return g.links?g.links():[]}return[]}));return Ty(o.flat(1).filter(wy).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function Zh(l,r,c,o,f,h){let g=(m,v)=>c[v]?m.route.id!==c[v].route.id:!0,y=(m,v)=>{var x;return c[v].pathname!==m.pathname||((x=c[v].route.path)==null?void 0:x.endsWith("*"))&&c[v].params["*"]!==m.params["*"]};return h==="assets"?r.filter((m,v)=>g(m,v)||y(m,v)):h==="data"?r.filter((m,v)=>{var j;let x=o.routes[m.route.id];if(!x||!x.hasLoader)return!1;if(g(m,v)||y(m,v))return!0;if(m.route.shouldRevalidate){let _=m.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((j=c[0])==null?void 0:j.params)||{},nextUrl:new URL(l,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function Ny(l,r,{includeHydrateFallback:c}={}){return Ey(l.map(o=>{let f=r.routes[o.route.id];if(!f)return[];let h=[f.module];return f.clientActionModule&&(h=h.concat(f.clientActionModule)),f.clientLoaderModule&&(h=h.concat(f.clientLoaderModule)),c&&f.hydrateFallbackModule&&(h=h.concat(f.hydrateFallbackModule)),f.imports&&(h=h.concat(f.imports)),h}).flat(1))}function Ey(l){return[...new Set(l)]}function ky(l){let r={},c=Object.keys(l).sort();for(let o of c)r[o]=l[o];return r}function Ty(l,r){let c=new Set;return new Set(r),l.reduce((o,f)=>{let h=JSON.stringify(ky(f));return c.has(h)||(c.add(h),o.push({key:h,link:f})),o},[])}function yc(){let l=b.useContext(Xn);return vc(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function _y(){let l=b.useContext(Ss);return vc(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var bc=b.createContext(void 0);bc.displayName="FrameworkContext";function xc(){let l=b.useContext(bc);return vc(l,"You must render this element inside a <HydratedRouter> element"),l}function Ay(l,r){let c=b.useContext(bc),[o,f]=b.useState(!1),[h,g]=b.useState(!1),{onFocus:y,onBlur:m,onMouseEnter:v,onMouseLeave:x,onTouchStart:j}=r,_=b.useRef(null);b.useEffect(()=>{if(l==="render"&&g(!0),l==="viewport"){let O=z=>{z.forEach(Z=>{g(Z.isIntersecting)})},L=new IntersectionObserver(O,{threshold:.5});return _.current&&L.observe(_.current),()=>{L.disconnect()}}},[l]),b.useEffect(()=>{if(o){let O=setTimeout(()=>{g(!0)},100);return()=>{clearTimeout(O)}}},[o]);let k=()=>{f(!0)},C=()=>{f(!1),g(!1)};return c?l!=="intent"?[h,_,{}]:[h,_,{onFocus:Vl(y,k),onBlur:Vl(m,C),onMouseEnter:Vl(v,k),onMouseLeave:Vl(x,C),onTouchStart:Vl(j,k)}]:[!1,_,{}]}function Vl(l,r){return c=>{l&&l(c),c.defaultPrevented||r(c)}}function Ry({page:l,...r}){let c=Gv(),{router:o}=yc(),f=b.useMemo(()=>tm(o.routes,l,o.basename),[o.routes,l,o.basename]);return f?c?b.createElement(zy,{page:l,matches:f,...r}):b.createElement(Oy,{page:l,matches:f,...r}):null}function My(l){let{manifest:r,routeModules:c}=xc(),[o,f]=b.useState([]);return b.useEffect(()=>{let h=!1;return Cy(l,r,c).then(g=>{h||f(g)}),()=>{h=!0}},[l,r,c]),o}function zy({page:l,matches:r,...c}){let o=Nt(),{future:f}=xc(),{basename:h}=yc(),g=b.useMemo(()=>{if(l===o.pathname+o.search+o.hash)return[];let y=gm(l,h,f.unstable_trailingSlashAwareDataRequests,"rsc"),m=!1,v=[];for(let x of r)typeof x.route.shouldRevalidate=="function"?m=!0:v.push(x.route.id);return m&&v.length>0&&y.searchParams.set("_routes",v.join(",")),[y.pathname+y.search]},[h,f.unstable_trailingSlashAwareDataRequests,l,o,r]);return b.createElement(b.Fragment,null,g.map(y=>b.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...c})))}function Oy({page:l,matches:r,...c}){let o=Nt(),{future:f,manifest:h,routeModules:g}=xc(),{basename:y}=yc(),{loaderData:m,matches:v}=_y(),x=b.useMemo(()=>Zh(l,r,v,h,o,"data"),[l,r,v,h,o]),j=b.useMemo(()=>Zh(l,r,v,h,o,"assets"),[l,r,v,h,o]),_=b.useMemo(()=>{if(l===o.pathname+o.search+o.hash)return[];let O=new Set,L=!1;if(r.forEach(Z=>{var P;let X=h.routes[Z.route.id];!X||!X.hasLoader||(!x.some(K=>K.route.id===Z.route.id)&&Z.route.id in m&&((P=g[Z.route.id])!=null&&P.shouldRevalidate)||X.hasClientLoader?L=!0:O.add(Z.route.id))}),O.size===0)return[];let z=gm(l,y,f.unstable_trailingSlashAwareDataRequests,"data");return L&&O.size>0&&z.searchParams.set("_routes",r.filter(Z=>O.has(Z.route.id)).map(Z=>Z.route.id).join(",")),[z.pathname+z.search]},[y,f.unstable_trailingSlashAwareDataRequests,m,o,h,x,r,l,g]),k=b.useMemo(()=>Ny(j,h),[j,h]),C=My(j);return b.createElement(b.Fragment,null,_.map(O=>b.createElement("link",{key:O,rel:"prefetch",as:"fetch",href:O,...c})),k.map(O=>b.createElement("link",{key:O,rel:"modulepreload",href:O,...c})),C.map(({key:O,link:L})=>b.createElement("link",{key:O,nonce:c.nonce,...L,crossOrigin:L.crossOrigin??c.crossOrigin})))}function Uy(...l){return r=>{l.forEach(c=>{typeof c=="function"?c(r):c!=null&&(c.current=r)})}}var Dy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Dy&&(window.__reactRouterVersion="7.14.2")}catch{}function Hy({basename:l,children:r,unstable_useTransitions:c,window:o}){let f=b.useRef();f.current==null&&(f.current=pv({window:o,v5Compat:!0}));let h=f.current,[g,y]=b.useState({action:h.action,location:h.location}),m=b.useCallback(v=>{c===!1?y(v):b.startTransition(()=>y(v))},[c]);return b.useLayoutEffect(()=>h.listen(m),[h,m]),b.createElement(dy,{basename:l,children:r,location:g.location,navigationType:g.action,navigator:h,unstable_useTransitions:c})}var vm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lt=b.forwardRef(function({onClick:r,discover:c="render",prefetch:o="none",relative:f,reloadDocument:h,replace:g,unstable_mask:y,state:m,target:v,to:x,preventScrollReset:j,viewTransition:_,unstable_defaultShouldRevalidate:k,...C},O){let{basename:L,navigator:z,unstable_useTransitions:Z}=b.useContext(Ct),X=typeof x=="string"&&vm.test(x),P=sm(x,L);x=P.to;let K=Kv(x,{relative:f}),J=Nt(),E=null;if(y){let be=js(y,[],J.unstable_mask?J.unstable_mask.pathname:"/",!0);L!=="/"&&(be.pathname=be.pathname==="/"?L:Yt([L,be.pathname])),E=z.createHref(be)}let[D,Q,te]=Ay(o,C),le=Yy(x,{replace:g,unstable_mask:y,state:m,target:v,preventScrollReset:j,relative:f,viewTransition:_,unstable_defaultShouldRevalidate:k,unstable_useTransitions:Z});function ie(be){r&&r(be),be.defaultPrevented||le(be)}let W=!(P.isExternal||h),ge=b.createElement("a",{...C,...te,href:(W?E:void 0)||P.absoluteURL||K,onClick:W?ie:r,ref:Uy(O,Q),target:v,"data-discover":!X&&c==="render"?"true":void 0});return D&&!X?b.createElement(b.Fragment,null,ge,b.createElement(Ry,{page:K})):ge});lt.displayName="Link";var By=b.forwardRef(function({"aria-current":r="page",caseSensitive:c=!1,className:o="",end:f=!1,style:h,to:g,viewTransition:y,children:m,...v},x){let j=Jl(g,{relative:v.relative}),_=Nt(),k=b.useContext(Ss),{navigator:C,basename:O}=b.useContext(Ct),L=k!=null&&Qy(j)&&y===!0,z=C.encodeLocation?C.encodeLocation(j).pathname:j.pathname,Z=_.pathname,X=k&&k.navigation&&k.navigation.location?k.navigation.location.pathname:null;c||(Z=Z.toLowerCase(),X=X?X.toLowerCase():null,z=z.toLowerCase()),X&&O&&(X=fa(X,O)||X);const P=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let K=Z===z||!f&&Z.startsWith(z)&&Z.charAt(P)==="/",J=X!=null&&(X===z||!f&&X.startsWith(z)&&X.charAt(z.length)==="/"),E={isActive:K,isPending:J,isTransitioning:L},D=K?r:void 0,Q;typeof o=="function"?Q=o(E):Q=[o,K?"active":null,J?"pending":null,L?"transitioning":null].filter(Boolean).join(" ");let te=typeof h=="function"?h(E):h;return b.createElement(lt,{...v,"aria-current":D,className:Q,ref:x,style:te,to:g,viewTransition:y},typeof m=="function"?m(E):m)});By.displayName="NavLink";var Ly=b.forwardRef(({discover:l="render",fetcherKey:r,navigate:c,reloadDocument:o,replace:f,state:h,method:g=ps,action:y,onSubmit:m,relative:v,preventScrollReset:x,viewTransition:j,unstable_defaultShouldRevalidate:_,...k},C)=>{let{unstable_useTransitions:O}=b.useContext(Ct),L=Zy(),z=Xy(y,{relative:v}),Z=g.toLowerCase()==="get"?"get":"post",X=typeof y=="string"&&vm.test(y),P=K=>{if(m&&m(K),K.defaultPrevented)return;K.preventDefault();let J=K.nativeEvent.submitter,E=(J==null?void 0:J.getAttribute("formmethod"))||g,D=()=>L(J||K.currentTarget,{fetcherKey:r,method:E,navigate:c,replace:f,state:h,relative:v,preventScrollReset:x,viewTransition:j,unstable_defaultShouldRevalidate:_});O&&c!==!1?b.startTransition(()=>D()):D()};return b.createElement("form",{ref:C,method:Z,action:z,onSubmit:o?m:P,...k,"data-discover":!X&&l==="render"?"true":void 0})});Ly.displayName="Form";function qy(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ym(l){let r=b.useContext(Xn);return Be(r,qy(l)),r}function Yy(l,{target:r,replace:c,unstable_mask:o,state:f,preventScrollReset:h,relative:g,viewTransition:y,unstable_defaultShouldRevalidate:m,unstable_useTransitions:v}={}){let x=mc(),j=Nt(),_=Jl(l,{relative:g});return b.useCallback(k=>{if(vy(k,r)){k.preventDefault();let C=c!==void 0?c:Ql(j)===Ql(_),O=()=>x(l,{replace:C,unstable_mask:o,state:f,preventScrollReset:h,relative:g,viewTransition:y,unstable_defaultShouldRevalidate:m});v?b.startTransition(()=>O()):O()}},[j,x,_,c,o,f,r,l,h,g,y,m,v])}function bm(l){Ht(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let r=b.useRef(cc(l)),c=b.useRef(!1),o=Nt(),f=b.useMemo(()=>yy(o.search,c.current?null:r.current),[o.search]),h=mc(),g=b.useCallback((y,m)=>{const v=cc(typeof y=="function"?y(new URLSearchParams(f)):y);c.current=!0,h("?"+v,m)},[h,f]);return[f,g]}var Gy=0,Vy=()=>`__${String(++Gy)}__`;function Zy(){let{router:l}=ym("useSubmit"),{basename:r}=b.useContext(Ct),c=uy(),o=l.fetch,f=l.navigate;return b.useCallback(async(h,g={})=>{let{action:y,method:m,encType:v,formData:x,body:j}=jy(h,r);if(g.navigate===!1){let _=g.fetcherKey||Vy();await o(_,c,g.action||y,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:x,body:j,formMethod:g.method||m,formEncType:g.encType||v,flushSync:g.flushSync})}else await f(g.action||y,{unstable_defaultShouldRevalidate:g.unstable_defaultShouldRevalidate,preventScrollReset:g.preventScrollReset,formData:x,body:j,formMethod:g.method||m,formEncType:g.encType||v,replace:g.replace,state:g.state,fromRouteId:c,flushSync:g.flushSync,viewTransition:g.viewTransition})},[o,f,r,c])}function Xy(l,{relative:r}={}){let{basename:c}=b.useContext(Ct),o=b.useContext(Gt);Be(o,"useFormAction must be used inside a RouteContext");let[f]=o.matches.slice(-1),h={...Jl(l||".",{relative:r})},g=Nt();if(l==null){h.search=g.search;let y=new URLSearchParams(h.search),m=y.getAll("index");if(m.some(x=>x==="")){y.delete("index"),m.filter(j=>j).forEach(j=>y.append("index",j));let x=y.toString();h.search=x?`?${x}`:""}}return(!l||l===".")&&f.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),c!=="/"&&(h.pathname=h.pathname==="/"?c:Yt([c,h.pathname])),Ql(h)}function Qy(l,{relative:r}={}){let c=b.useContext(cm);Be(c!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=ym("useViewTransitionState"),f=Jl(l,{relative:r});if(!c.isTransitioning)return!1;let h=fa(c.currentLocation.pathname,o)||c.currentLocation.pathname,g=fa(c.nextLocation.pathname,o)||c.nextLocation.pathname;return vs(f.pathname,g)!=null||vs(f.pathname,h)!=null}const $y='<path d="M23.1599 14.9453C22.7429 14.9429 22.3775 15.2985 22.375 15.7204C22.3726 16.1374 22.7282 16.5028 23.1501 16.5053C23.567 16.5077 23.9325 16.1521 23.935 15.7302C23.9374 15.3108 23.5793 14.9478 23.1599 14.9453Z" fill="currentColor"/><path d="M15.758 22.3758C15.3435 22.3562 14.9657 22.702 14.9461 23.1214C14.9265 23.5359 15.2723 23.9137 15.6917 23.9333C16.1063 23.9529 16.484 23.6071 16.5036 23.1877C16.5232 22.7731 16.1774 22.3954 15.758 22.3758Z" fill="currentColor"/><path d="M23.1208 9.08552C23.5721 9.10024 23.9375 8.76176 23.9473 8.31291C23.9571 7.86161 23.6137 7.50351 23.1649 7.49615C22.7308 7.49124 22.3825 7.81746 22.3604 8.24668C22.3383 8.70044 22.6744 9.06835 23.1208 9.08307V9.08552Z" fill="currentColor"/><path d="M8.32678 22.3598C7.87547 22.3451 7.51002 22.6836 7.50021 23.1324C7.49039 23.5837 7.83378 23.9418 8.28263 23.9492C8.73393 23.9541 9.08712 23.6058 9.08712 23.1545C9.08712 22.7032 8.75601 22.3746 8.32678 22.3598Z" fill="currentColor"/><path d="M23.1502 12.8994C23.6113 12.9019 24.0135 12.4947 24.0013 12.0361C23.9914 11.5897 23.6039 11.2095 23.16 11.207C22.6989 11.2046 22.2966 11.6117 22.3089 12.0704C22.3187 12.5143 22.7062 12.897 23.1502 12.8994Z" fill="currentColor"/><path d="M12.9002 23.1849C12.9198 22.7459 12.5568 22.3436 12.1079 22.3068C11.6542 22.2725 11.2299 22.6551 11.2078 23.1162C11.1882 23.5553 11.5512 23.9575 12 23.9943C12.4538 24.0287 12.8781 23.646 12.9002 23.1849Z" fill="currentColor"/><path d="M19.4899 20.3568C19.9829 20.3544 20.368 19.9595 20.3582 19.464C20.3508 18.9882 19.9755 18.6129 19.4997 18.6056C19.0067 18.5982 18.6118 18.9833 18.6094 19.4763C18.6094 19.9693 18.9969 20.3593 19.4899 20.3544V20.3568Z" fill="currentColor"/><path d="M0.946568 14.8555C0.483002 14.8555 0.0881117 15.243 0.0783008 15.7066C0.0684898 16.1873 0.470738 16.5994 0.951474 16.5969C1.41504 16.5969 1.80993 16.2094 1.81974 15.7458C1.82955 15.2651 1.4273 14.853 0.946568 14.8555Z" fill="currentColor"/><path d="M15.6895 1.82027C16.1678 1.83989 16.5872 1.445 16.597 0.964263C16.6044 0.500696 16.2267 0.0984479 15.7631 0.0788261C15.2848 0.0592042 14.8654 0.454094 14.8556 0.93483C14.8482 1.3984 15.2259 1.80065 15.6895 1.82027Z" fill="currentColor"/><path d="M0.928315 9.18321C1.44829 9.19302 1.84073 8.81285 1.84073 8.29532C1.84073 7.79742 1.47037 7.41479 0.974917 7.40253C0.454937 7.39272 0.0625 7.77289 0.0625 8.29042C0.0625 8.79078 0.432863 9.17095 0.928315 9.18321Z" fill="currentColor"/><path d="M8.33104 0.0630625C7.81106 0.0458934 7.41126 0.423614 7.40636 0.938689C7.399 1.43905 7.76691 1.82658 8.25991 1.84129C8.76272 1.85601 9.15761 1.50036 9.18459 1.00982C9.21157 0.489838 8.84121 0.0777789 8.33349 0.0630625H8.33104Z" fill="currentColor"/><path d="M19.483 3.67042C18.9728 3.67042 18.5362 4.1021 18.5313 4.61227C18.524 5.11999 18.9532 5.56148 19.4634 5.57374C19.9858 5.58846 20.4445 5.1347 20.4371 4.60982C20.4298 4.09965 19.9932 3.66797 19.483 3.66797V3.67042Z" fill="currentColor"/><path d="M0.976227 11.102C0.456247 11.0849 -0.00486668 11.5411 3.87869e-05 12.0611C0.00494425 12.5663 0.441531 13.0029 0.946794 13.0029C1.45206 13.0029 1.8911 12.5737 1.90091 12.066C1.91072 11.5631 1.48394 11.1192 0.976227 11.102Z" fill="currentColor"/><path d="M12.0584 4.16361e-05C11.5531 -0.00486383 11.1116 0.424365 11.1018 0.93208C11.0895 1.45206 11.5457 1.91072 12.0657 1.90091C12.571 1.8911 13.0051 1.45206 13.0002 0.946797C12.9978 0.441534 12.5636 0.0049471 12.0584 4.16361e-05Z" fill="currentColor"/><path d="M4.65891 18.5322C4.13894 18.5077 3.67046 18.9516 3.66801 19.479C3.6631 19.9867 4.09233 20.4257 4.6025 20.438C5.11022 20.4478 5.55416 20.0259 5.57133 19.5133C5.59095 19.0081 5.16908 18.5567 4.65891 18.5322Z" fill="currentColor"/><path d="M4.58641 5.65236C5.13337 5.67443 5.62637 5.21332 5.64845 4.65654C5.67052 4.10959 5.20941 3.61659 4.65264 3.59451C4.10568 3.57244 3.61268 4.03355 3.5906 4.59032C3.56853 5.13728 4.02964 5.63028 4.58641 5.65236Z" fill="currentColor"/><path d="M19.5008 16.8099C20.1017 16.8 20.5726 16.3169 20.5677 15.7159C20.5628 15.115 20.087 14.6392 19.4836 14.6367C18.8803 14.6343 18.402 15.1077 18.3946 15.7086C18.3873 16.3267 18.8803 16.8197 19.5008 16.8074V16.8099Z" fill="currentColor"/><path d="M15.7209 20.5694C16.3218 20.5694 16.8025 20.0985 16.8099 19.4976C16.8172 18.8967 16.3488 18.411 15.7478 18.3988C15.1298 18.384 14.6318 18.8746 14.6368 19.4927C14.6417 20.0936 15.1199 20.5694 15.7209 20.5719V20.5694Z" fill="currentColor"/><path d="M9.42652 19.4702C9.41916 18.8644 8.9188 18.364 8.31298 18.3518C7.69243 18.3395 7.1651 18.8546 7.16019 19.4751C7.15529 20.0981 7.67281 20.6157 8.29581 20.6157C8.9188 20.6157 9.43388 20.0908 9.42652 19.4702Z" fill="currentColor"/><path d="M19.4553 7.16016C18.8495 7.17487 18.354 7.68259 18.3516 8.28841C18.3491 8.91141 18.8666 9.42893 19.4896 9.42403C20.1126 9.41912 20.6253 8.89669 20.6154 8.27615C20.6056 7.65316 20.0734 7.14544 19.4553 7.16261V7.16016Z" fill="currentColor"/><path d="M15.7219 5.79748C16.3817 5.79748 16.9115 5.26034 16.8993 4.60055C16.887 3.95793 16.3695 3.44531 15.7244 3.44531C15.0793 3.44531 14.5348 3.98246 14.5471 4.64225C14.5593 5.28732 15.0793 5.79748 15.7219 5.79748Z" fill="currentColor"/><path d="M4.63052 16.9006C5.27559 16.8957 5.78821 16.3806 5.79557 15.738C5.80292 15.0782 5.27068 14.5435 4.6109 14.5509C3.94866 14.5582 3.42623 15.0978 3.44585 15.7576C3.46302 16.4002 3.9879 16.9055 4.63052 16.9006Z" fill="currentColor"/><path d="M12.0637 20.6756C12.7088 20.6683 13.2533 20.1115 13.246 19.4714C13.2386 18.8263 12.6818 18.2818 12.0417 18.2891C11.3966 18.2965 10.8521 18.8533 10.8594 19.4934C10.8668 20.1385 11.4211 20.683 12.0637 20.6756Z" fill="currentColor"/><path d="M19.4762 10.8594C18.8312 10.8618 18.2842 11.4137 18.2891 12.0563C18.2915 12.7014 18.8434 13.2483 19.486 13.2434C20.1311 13.241 20.6781 12.6891 20.6732 12.0465C20.6682 11.4039 20.1188 10.8569 19.4762 10.8594Z" fill="currentColor"/><path d="M8.31147 5.84627C8.98106 5.83645 9.52067 5.28459 9.51576 4.61499C9.51085 3.9454 8.9639 3.40089 8.29675 3.39844C7.62716 3.39844 7.07774 3.93804 7.07038 4.60764C7.06303 5.2944 7.6247 5.85362 8.31147 5.84627Z" fill="currentColor"/><path d="M4.64934 7.0706C3.96257 7.05588 3.39599 7.6102 3.39845 8.29942C3.39845 8.96902 3.94541 9.51597 4.615 9.51843C5.2846 9.52088 5.83646 8.98128 5.84382 8.31168C5.85118 7.64209 5.31648 7.08532 4.64689 7.0706H4.64934Z" fill="currentColor"/><path d="M12.0484 5.91679C12.7376 5.92169 13.3312 5.34285 13.3508 4.64873C13.3704 3.94479 12.7671 3.32916 12.0607 3.32425C11.3715 3.31934 10.7779 3.89819 10.7583 4.59231C10.7387 5.29625 11.3396 5.91434 12.0484 5.91679Z" fill="currentColor"/><path d="M4.58021 13.3473C5.28169 13.3743 5.90469 12.7783 5.91695 12.0695C5.92921 11.3827 5.35528 10.7818 4.66115 10.7548C3.95967 10.7278 3.33668 11.3238 3.32441 12.0327C3.31215 12.7194 3.88609 13.3203 4.58021 13.3473Z" fill="currentColor"/><path d="M15.7193 14.3359C14.9687 14.3359 14.3335 14.9761 14.3359 15.7266C14.3359 16.4772 14.9761 17.1124 15.7266 17.11C16.4772 17.11 17.1124 16.4698 17.11 15.7193C17.1075 14.9687 16.4698 14.3335 15.7193 14.3359Z" fill="currentColor"/><path d="M15.7407 9.73609C16.5428 9.72628 17.1756 9.0763 17.1658 8.27671C17.156 7.47712 16.506 6.84186 15.7064 6.85167C14.9068 6.86149 14.2716 7.51146 14.2814 8.31105C14.2912 9.11064 14.9411 9.7459 15.7407 9.73609Z" fill="currentColor"/><path d="M8.2987 14.2813C7.50156 14.2764 6.8565 14.9165 6.85159 15.7161C6.84669 16.5133 7.48685 17.1583 8.28644 17.1632C9.08358 17.1681 9.72865 16.528 9.73355 15.7284C9.73601 14.9313 9.09584 14.2862 8.2987 14.2813Z" fill="currentColor"/><path d="M8.2854 9.79467C9.12669 9.79712 9.78647 9.15696 9.79874 8.32057C9.811 7.45967 9.15857 6.79007 8.30257 6.78516C7.46128 6.78271 6.8015 7.42533 6.78923 8.25926C6.77697 9.12017 7.4294 9.78976 8.2854 9.79467Z" fill="currentColor"/><path d="M15.7268 10.5156C14.8757 10.5156 14.1644 11.2343 14.184 12.0829C14.2036 12.9242 14.9075 13.6061 15.7415 13.5914C16.5803 13.5766 17.2671 12.8801 17.2622 12.0461C17.2573 11.2097 16.5631 10.5181 15.7268 10.5156Z" fill="currentColor"/><path d="M12.0588 14.1836C11.2077 14.1787 10.4964 14.8998 10.516 15.7485C10.5356 16.5897 11.2371 17.2716 12.0686 17.2593C12.9074 17.2471 13.5942 16.553 13.5917 15.7166C13.5893 14.8802 12.8976 14.1885 12.0612 14.1836H12.0588Z" fill="currentColor"/><path d="M12.0397 6.66802C11.1568 6.67538 10.4356 7.39894 10.4258 8.28192C10.4185 9.17717 11.1666 9.92525 12.0618 9.91789C12.9448 9.91054 13.6659 9.18698 13.6757 8.304C13.6831 7.40875 12.935 6.66066 12.0397 6.66802Z" fill="currentColor"/><path d="M8.29197 13.6757C9.1725 13.6757 9.90096 12.9619 9.91813 12.074C9.9353 11.1812 9.19212 10.4282 8.29442 10.4258C7.41389 10.4258 6.68543 11.1395 6.66826 12.0274C6.65109 12.9202 7.39427 13.6732 8.29197 13.6757Z" fill="currentColor"/><path d="M12.0638 10.2891C11.068 10.2842 10.2905 11.0568 10.293 12.0526C10.293 13.0288 11.0533 13.8014 12.0222 13.8137C13.0204 13.8259 13.8077 13.0631 13.8151 12.0722C13.8225 11.074 13.0548 10.294 12.0638 10.2891Z" fill="currentColor"/>';function xm({size:l=20,idSuffix:r,className:c}){const o=`pc-brand-mark-clip-${r}`;return i.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:c,dangerouslySetInnerHTML:{__html:`<g clip-path="url(#${o})">${$y}</g><defs><clipPath id="${o}"><rect width="24" height="24" fill="white"/></clipPath></defs>`}})}const jc="Parachute";let ln=null,Zl=null;const Jy=3e4;function Ky(){return"/admin/host-admin-token"}function Fy(){const l=`${window.location.pathname}${window.location.search}`;return`/login?next=${encodeURIComponent(l)}`}function Et(){return window.location.replace(Fy()),new Promise(()=>{})}function Wy(){return window.location.replace("/account/"),new Promise(()=>{})}async function Me(){const l=Date.now();return ln&&ln.expiresAt-l>Jy?ln.token:Zl||(Zl=Iy().finally(()=>{Zl=null}),Zl)}async function Iy(){const l=await fetch(Ky(),{method:"GET",headers:{accept:"application/json"},credentials:"same-origin"});if(l.status===401)return ln=null,Et();if(l.status===403)return ln=null,Wy();if(!l.ok)throw new Error(`/admin/host-admin-token failed: ${l.status} ${await l.text()}`);const r=await l.json();if(!r.token||!r.expires_at)throw new Error("/admin/host-admin-token returned malformed body");return ln={token:r.token,expiresAt:new Date(r.expires_at).getTime()},r.token}function je(){ln=null}class V extends Error{constructor(r,c){super(c),this.status=r,this.name="HttpError"}}async function Sc(){const l=await fetch("/.well-known/parachute.json",{headers:{accept:"application/json"}});if(!l.ok)throw new V(l.status,`well-known fetch failed: ${l.status}`);const r=await l.json(),c=r.vaults??[],o=r.services??[];return{moduleInstalled:o.some(h=>h.name==="parachute-vault"||h.name.startsWith("parachute-vault-")),vaults:c.map(h=>{const g={name:h.name,url:h.url,version:h.version,path:Py(h.name,h.url,o)};return h.managementUrl&&(g.managementUrl=h.managementUrl),g})}}function Py(l,r,c){const o=c.find(f=>f.name===`parachute-vault-${l}`||f.path===`/vault/${l}`);if(o)return o.path;try{return new URL(r).pathname}catch{return`/vault/${l}`}}async function jm(l){const r=await fetch(`/admin/vault-admin-token/${encodeURIComponent(l)}`,{method:"GET",headers:{accept:"application/json"},credentials:"same-origin"});if(r.status===401)return Et();if(!r.ok)throw new V(r.status,await $(r));const c=await r.json();if(!c.token||!c.expires_at)throw new V(500,"/admin/vault-admin-token returned malformed body");return{token:c.token,expiresAt:c.expires_at,scopes:c.scopes??[]}}async function e1(l){var g,y;const r=await jm(l),c=await fetch(`/vault/${encodeURIComponent(l)}/.parachute/usage`,{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${r.token}`}});if(!c.ok)throw new V(c.status,await $(c));const o=await c.json(),f=(g=o.counts)==null?void 0:g.notes,h=(y=o.bytes)==null?void 0:y.total;if(typeof f!="number"||typeof h!="number")throw new V(500,"/.parachute/usage returned malformed body");return{notes:f,totalBytes:h}}function Sm(l){if(!Number.isFinite(l)||l<0)return"0 B";if(l<1024)return`${Math.round(l)} B`;const r=l/1024;if(r<1024)return`${Math.round(r)} KB`;const c=r/1024;return c<1024?`${c.toFixed(1)} MB`:`${(c/1024).toFixed(1)} GB`}async function t1(l={}){const r=await Me(),c=l.vault?`?vault=${encodeURIComponent(l.vault)}`:"",o=await fetch(`/api/grants${c}`,{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${r}`}});if(o.status===401||o.status===403)throw je(),new V(o.status,await $(o));if(!o.ok)throw new V(o.status,await $(o));return(await o.json()).grants??[]}async function a1(l){const r=await Me(),c=await fetch(`/api/grants/${encodeURIComponent(l)}`,{method:"DELETE",headers:{authorization:`Bearer ${r}`}});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c))}async function wc(){const l=await fetch("/api/me",{method:"GET",headers:{accept:"application/json"},credentials:"same-origin"});if(!l.ok)throw new V(l.status,await $(l));return await l.json()}async function n1(l){const r=new URLSearchParams({__csrf:l}),c=await fetch("/logout",{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded",accept:"text/html, application/json"},credentials:"same-origin",body:r,redirect:"manual"});if(!(c.status===0||c.ok||c.status===302))throw new V(c.status,await $(c))}let Xh=!1;function l1(l,r){if(/^https?:\/\//i.test(r))return r;const c=l.replace(/\/+$/,"");return r==="/admin"||r==="/admin/"?(Xh||(Xh=!0,console.warn(`resolveManagementUrl: vault declares the legacy per-instance managementUrl ${JSON.stringify(r)}; joining under the vault URL for one release. New semantics: relative ("admin/") = per-instance join, leading-"/" = origin-absolute.`)),`${c}${r}`):r.startsWith("/")?new URL(r,`${c}/`).toString():`${c}/${r}`}async function Qh(l={}){const r=new URLSearchParams;l.revoked&&r.set("revoked",l.revoked),l.subject&&r.set("subject",l.subject),l.createdVia&&r.set("created_via",l.createdVia),l.cursor&&r.set("cursor",l.cursor);const c=r.toString(),o=c?`/api/auth/tokens?${c}`:"/api/auth/tokens",f=await Me(),h=await fetch(o,{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${f}`}});if(h.status===401||h.status===403)throw je(),new V(h.status,await $(h));if(!h.ok)throw new V(h.status,await $(h));return await h.json()}async function wm(l){const r=await Me(),c=await fetch("/api/auth/mint-token",{method:"POST",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${r}`},body:JSON.stringify(l)});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return await c.json()}async function i1(l){const r=await Me(),c=await fetch("/api/auth/revoke-token",{method:"POST",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({jti:l})});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return await c.json()}async function s1(l){const r=await Me(),c=await fetch(`/api/oauth/clients/${encodeURIComponent(l)}`,{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${r}`}});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return await c.json()}async function u1(l,r){const o={method:"POST",headers:{accept:"application/json",authorization:`Bearer ${await Me()}`}};r!==void 0&&(o.headers={...o.headers,"content-type":"application/json"},o.body=JSON.stringify({return_to:r}));const f=await fetch(`/api/oauth/clients/${encodeURIComponent(l)}/approve`,o);if(f.status===401||f.status===403)throw je(),new V(f.status,await $(f));if(!f.ok)throw new V(f.status,await $(f));return await f.json()}async function Cs(){const l=await Me(),r=await fetch("/api/modules",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return await r.json()}async function Ns(l,r){const c=await Me();return await fetch(`/api/modules/${encodeURIComponent(l)}/${r}`,{method:"POST",headers:{accept:"application/json",authorization:`Bearer ${c}`}})}async function r1(l){const r=await Ns(l,"install");if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return(await r.json()).operation_id}async function c1(l){const r=await Ns(l,"upgrade");if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return(await r.json()).operation_id}async function o1(l){const r=await Ns(l,"restart");if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return await r.json()}async function d1(l){const r=await Ns(l,"uninstall");if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return await r.json()}async function f1(l){const r=await Me(),c=await fetch("/api/modules/channel",{method:"PUT",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({channel:l})});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return(await c.json()).channel}async function Cm(){const l=await Me(),r=await fetch("/api/settings/hub-origin",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return await r.json()}async function $h(l){const r=await Me(),c=await fetch("/api/settings/hub-origin",{method:"PUT",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${r}`},body:JSON.stringify({hub_origin:l})});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return(await c.json()).hub_origin}async function h1(l){const r=await Me(),c=await fetch(`/api/modules/operations/${encodeURIComponent(l)}`,{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${r}`}});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return await c.json()}async function m1(){const l=await Me(),r=await fetch("/api/users",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return(await r.json()).users??[]}async function p1(l){const r=await Me(),c=await fetch("/api/users",{method:"POST",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${r}`},body:JSON.stringify(l)});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return(await c.json()).user}async function g1(l){const r=await Me(),c=await fetch(`/api/users/${encodeURIComponent(l)}`,{method:"DELETE",headers:{authorization:`Bearer ${r}`}});if(c.status===401||c.status===403)throw c.status===401&&je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));const o=await c.json().catch(()=>({}));return{revocationLagSeconds:typeof o.revocation_lag_seconds=="number"?o.revocation_lag_seconds:60}}async function v1(l,r){const c=await Me(),o=await fetch(`/api/users/${encodeURIComponent(l)}/reset-password`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${c}`},body:JSON.stringify({new_password:r})});if(o.status===401||o.status===403)throw o.status===401&&je(),new V(o.status,await $(o));if(!o.ok)throw new V(o.status,await $(o));const f=await o.json().catch(()=>({}));return{revocationLagSeconds:typeof f.revocation_lag_seconds=="number"?f.revocation_lag_seconds:60}}async function y1(l,r){const c=await Me(),o=await fetch(`/api/users/${encodeURIComponent(l)}/vaults`,{method:"PATCH",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${c}`},body:JSON.stringify({assigned_vaults:r})});if(o.status===401||o.status===403)throw o.status===401&&je(),new V(o.status,await $(o));if(!o.ok)throw new V(o.status,await $(o))}async function Nm(){const l=await Me(),r=await fetch("/api/users/vaults",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return(await r.json()).vaults??[]}async function b1(){const l=await Me(),r=await fetch("/api/vault-caps",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return(await r.json()).vault_caps??[]}async function x1(l,r){const c=await Me(),o=await fetch(`/api/vault-caps/${encodeURIComponent(l)}`,{method:"PUT",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${c}`},body:JSON.stringify({cap_bytes:r})});if(o.status===401||o.status===403)throw je(),new V(o.status,await $(o));if(!o.ok)throw new V(o.status,await $(o));return(await o.json()).vault_cap}async function j1(){const l=await Me(),r=await fetch("/api/invites",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return(await r.json()).invites??[]}async function S1(l){const r=await Me(),c=await fetch("/api/invites",{method:"POST",headers:{"content-type":"application/json",accept:"application/json",authorization:`Bearer ${r}`},body:JSON.stringify(l)});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return await c.json()}async function w1(l){const r=await Me(),c=await fetch(`/api/invites/${encodeURIComponent(l)}`,{method:"DELETE",headers:{accept:"application/json",authorization:`Bearer ${r}`}});if(c.status===401)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c))}async function oc(){const l=await Me(),r=await fetch("/api/hub",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return await r.json()}async function C1(l){const r=await Me(),c=await fetch("/api/hub/upgrade",{method:"POST",headers:{accept:"application/json",authorization:`Bearer ${r}`}});if(c.status===401||c.status===403)throw je(),new V(c.status,await $(c));if(!c.ok)throw new V(c.status,await $(c));return await c.json()}async function N1(){const l=await Me(),r=await fetch("/api/hub/upgrade/status",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===404)return null;if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));return await r.json()}async function Cc(){const l=await fetch("/api/admin-lock",{method:"GET",headers:{accept:"application/json"},credentials:"same-origin"});if(l.status===401)return Et();if(!l.ok)throw new V(l.status,await $(l));return await l.json()}async function $n(l,r,c={}){return await fetch(`/api/admin-lock${l}`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",body:JSON.stringify({__csrf:r,...c})})}async function E1(l,r){const c=await $n("/unlock",l,{pin:r});if(!c.ok)throw new V(c.status,await $(c));return await c.json().catch(()=>({})),Cc()}async function k1(l){const r=await $n("/lock",l);if(!r.ok)throw new V(r.status,await $(r))}async function T1(l){const r=await $n("/heartbeat",l);if(!r.ok)throw new V(r.status,await $(r));return await r.json()}async function _1(l,r,c){const o={pin:r};c!==void 0&&(o.idle_seconds=c);const f=await $n("/set",l,o);if(!f.ok)throw new V(f.status,await $(f))}async function A1(l,r,c,o){const f={new_pin:r};c&&(f.current_pin=c),o!==void 0&&(f.idle_seconds=o);const h=await $n("/change",l,f);if(!h.ok)throw new V(h.status,await $(h))}async function R1(l,r){const c={};r&&(c.current_pin=r);const o=await $n("/remove",l,c);if(!o.ok)throw new V(o.status,await $(o))}async function $(l){try{const r=await l.text(),c=JSON.parse(r);if(c.error_description)return c.error_description;if(c.error)return c.error;if(r)return r}catch{}return`${l.status} ${l.statusText}`}async function M1(){const l=await fetch("/api/connections/catalog",{method:"GET",headers:{accept:"application/json"},credentials:"same-origin"});if(l.status===401)return Et();if(!l.ok)throw new V(l.status,await $(l));const r=await l.json(),c=Array.isArray(r.events)?r.events:[],o=Array.isArray(r.actions)?r.actions:[],f=Array.isArray(r.templates)?r.templates:[];return{events:c,actions:o,templates:f}}async function z1(){const l=await fetch("/admin/connections",{method:"GET",headers:{accept:"application/json"},credentials:"same-origin"});if(l.status===401)return Et();if(!l.ok)throw new V(l.status,await $(l));const r=await l.json();return Array.isArray(r.connections)?r.connections:[]}async function O1(l){const r=await fetch("/admin/connections",{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",body:JSON.stringify(l)});if(r.status===401)return Et();if(!r.ok)throw new V(r.status,await $(r));const c=await r.json();if(!c.connection||typeof c.connection.id!="string")throw new V(500,"/admin/connections returned a malformed connection body");return{connection:c.connection,...c.connect?{connect:c.connect}:{}}}async function U1(l){const r=await fetch(`/admin/connections/${encodeURIComponent(l)}/approve`,{method:"POST",headers:{accept:"application/json"},credentials:"same-origin"});if(r.status===401){await Et();return}if(!r.ok)throw new V(r.status,await $(r))}async function D1(l){const r=await fetch(`/admin/connections/${encodeURIComponent(l)}`,{method:"DELETE",headers:{accept:"application/json"},credentials:"same-origin"});if(r.status===401){await Et();return}if(r.status===207){let c="connection teardown partially failed";try{const o=await r.json();Array.isArray(o.errors)&&o.errors.length>0&&(c=o.errors.map(f=>`${f.step??"step"}: ${f.detail??"failed"}`).join("; "))}catch{}throw new V(207,c)}if(!r.ok)throw new V(r.status,await $(r))}async function H1(){const l=await Me(),r=await fetch("/admin/grants",{method:"GET",headers:{accept:"application/json",authorization:`Bearer ${l}`}});if(r.status===401||r.status===403)throw je(),new V(r.status,await $(r));if(!r.ok)throw new V(r.status,await $(r));const c=await r.json();return Array.isArray(c.grants)?c.grants:[]}async function tc(l,r){const c=await fetch(`/admin/grants/${encodeURIComponent(l)}/approve`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",body:JSON.stringify(r!==void 0?{token:r}:{})});if(c.status===401)return Et();if(!c.ok)throw new V(c.status,await $(c));return await c.json()}async function B1(l){const r=await fetch(`/admin/grants/${encodeURIComponent(l)}/revoke`,{method:"POST",headers:{accept:"application/json"},credentials:"same-origin"});if(r.status===401){await Et();return}if(!r.ok)throw new V(r.status,await $(r))}async function Es(l,r,c={}){return await fetch(`/api/account${l}`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",body:JSON.stringify({__csrf:r,...c})})}async function L1(l){const r=await Es("/2fa/start",l);if(r.status===401)return Et();if(!r.ok)throw new V(r.status,await $(r));return await r.json()}async function q1(l,r,c){const o=await Es("/2fa/confirm",l,{secret:r,code:c});if(o.status===401)return Et();if(!o.ok)throw new V(o.status,await $(o));return await o.json()}async function Y1(l,r){const c=await Es("/2fa/disable",l,{password:r});if(c.status===401){await Et();return}if(!c.ok)throw new V(c.status,await $(c))}async function G1(l,r,c){const o=await Es("/password",l,{current_password:r,new_password:c});if(o.status===401)throw new V(o.status,await $(o));if(!o.ok)throw new V(o.status,await $(o))}const V1=3e4;function Jh(l){const r=Math.max(0,l),c=Math.floor(r/1e3);if(c<60)return`${c}s`;const o=Math.floor(c/60);if(o<60)return`${o}m`;const f=Math.floor(o/60);return f<24?`${f}h ${o%60}m`:`${Math.floor(f/24)}d ${f%24}h`}function ac(l){const r=new Date(l);if(Number.isNaN(r.getTime()))return l;const c=o=>String(o).padStart(2,"0");return`${r.getUTCFullYear()}-${c(r.getUTCMonth()+1)}-${c(r.getUTCDate())} ${c(r.getUTCHours())}:${c(r.getUTCMinutes())}:${c(r.getUTCSeconds())} UTC`}function Z1(l){var r;if(l.source==="container")return"container";if(l.source==="npm")return"npm";if(l.source==="bun-linked"){const c=(r=l.bun_linked_path)==null?void 0:r.split("/").filter(Boolean).pop();return c&&l.git_head?`bun-linked → ${c} @ ${l.git_head}`:c?`bun-linked → ${c}`:"bun-linked"}return"unknown"}function X1(){const[l,r]=b.useState(null),[c,o]=b.useState(!1),[f,h]=b.useState(!1),[g,y]=b.useState(null),m=b.useCallback(async()=>{h(!0);try{const v=await oc();r(v),y(new Date)}catch{}finally{h(!1)}},[]);return b.useEffect(()=>{m()},[m]),b.useEffect(()=>{const v=()=>{m()};window.addEventListener("focus",v);const x=window.setInterval(()=>{m()},V1);return()=>{window.removeEventListener("focus",v),window.clearInterval(x)}},[m]),l?i.jsxs("footer",{className:"hub-version-badge","data-testid":"hub-version-badge",children:[i.jsxs("button",{type:"button",className:"hub-version-badge-summary",onClick:()=>o(v=>!v),"aria-expanded":c,"data-testid":"hub-version-badge-summary",children:["Hub ",i.jsx("strong",{children:l.version})," · running"," ",i.jsx("span",{"data-testid":"hub-version-badge-uptime",children:Jh(l.uptime_ms)})," ·"," ",i.jsx("span",{className:"hub-version-badge-source","data-testid":"hub-version-badge-source",children:l.source})]}),c?i.jsxs("div",{className:"hub-version-badge-panel","data-testid":"hub-version-badge-panel",children:[i.jsxs("dl",{children:[i.jsx("dt",{children:"Hub"}),i.jsx("dd",{children:i.jsxs("code",{children:["@openparachute/hub ",l.version]})}),i.jsx("dt",{children:"Source"}),i.jsx("dd",{children:Z1(l)}),i.jsx("dt",{children:"Started"}),i.jsxs("dd",{children:[ac(l.started_at)," (",Jh(l.uptime_ms)," ago)"]}),l.container_build_time?i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Built"}),i.jsx("dd",{children:ac(l.container_build_time)})]}):null,l.render_commit?i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Commit"}),i.jsxs("dd",{children:[i.jsx("code",{children:l.render_commit.slice(0,8)}),l.render_branch?i.jsxs(i.Fragment,{children:[" on ",i.jsx("code",{children:l.render_branch})]}):null]})]}):null,g?i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"Last checked"}),i.jsx("dd",{children:ac(g.toISOString())})]}):null]}),i.jsx("button",{type:"button",className:"hub-version-badge-refresh secondary",onClick:()=>void m(),disabled:f,"data-testid":"hub-version-badge-refresh",children:f?"Refreshing…":"Refresh"})]}):null]}):null}function Q1({csrf:l,onUnlocked:r}){const[c,o]=b.useState(""),[f,h]=b.useState(!1),[g,y]=b.useState(null),m=b.useRef(null);b.useEffect(()=>{var x;(x=m.current)==null||x.focus()},[]);async function v(x){var j;if(x.preventDefault(),!f){h(!0),y(null);try{await E1(l,c),o(""),r()}catch(_){const k=_ instanceof V?_.status===429?"Too many attempts — wait a moment and try again.":"Incorrect PIN.":_ instanceof Error?_.message:"Unlock failed.";y(k),o(""),(j=m.current)==null||j.focus()}finally{h(!1)}}}return i.jsx("main",{className:"lock-screen","data-testid":"admin-lock-screen","aria-label":"Admin console locked",children:i.jsxs("div",{className:"lock-card",children:[i.jsx(xm,{size:32,idSuffix:"lock",className:"lock-brand-mark"}),i.jsxs("h1",{className:"lock-title",children:[jc," is locked"]}),i.jsx("p",{className:"muted lock-sub",children:"Enter your PIN to unlock the admin console."}),i.jsxs("form",{onSubmit:x=>void v(x),className:"lock-form",children:[i.jsx("label",{htmlFor:"admin-lock-pin",className:"visually-hidden",children:"PIN"}),i.jsx("input",{id:"admin-lock-pin",ref:m,type:"password",inputMode:"numeric",autoComplete:"off",pattern:"[0-9]*",maxLength:12,placeholder:"••••",value:c,disabled:f,onChange:x=>o(x.target.value.replace(/[^0-9]/g,"")),className:"lock-pin-input","data-testid":"admin-lock-pin-input","aria-invalid":g?"true":void 0}),i.jsx("button",{type:"submit",disabled:f||c.length<4,"data-testid":"admin-lock-unlock",children:f?"Unlocking…":"Unlock"})]}),g&&i.jsx("div",{className:"error lock-error",role:"alert","data-testid":"admin-lock-error",children:g})]})})}const $1=3e4;function J1(l,r){const[c,o]=b.useState(!0),[f,h]=b.useState(!1),[g,y]=b.useState(!1),m=b.useRef(null),v=b.useRef(0),x=b.useRef(900),j=b.useRef(l),_=b.useRef(!1);j.current=l,_.current=f;const k=b.useCallback(()=>{m.current&&(clearTimeout(m.current),m.current=null)},[]),C=b.useCallback(()=>{k();const z=Number.isFinite(x.current)?x.current:900;m.current=setTimeout(()=>h(!0),Math.max(1,z)*1e3)},[k]),O=b.useCallback(z=>{y(z.configured),h(z.locked),Number.isFinite(z.idle_seconds)&&(x.current=z.idle_seconds),z.configured&&!z.locked?C():k()},[C,k]),L=b.useCallback(()=>{r&&Cc().then(O).catch(()=>{}).finally(()=>o(!1))},[r,O]);return b.useEffect(()=>{if(!r){o(!1);return}L()},[r,L]),b.useEffect(()=>{if(!r||!g)return;function z(){if(_.current)return;C();const P=Date.now();if(P-v.current<$1)return;v.current=P;const K=j.current;K&&T1(K).then(J=>{J.locked?h(!0):Number.isFinite(J.idle_seconds)&&(x.current=J.idle_seconds)}).catch(()=>{})}const Z=["pointerdown","keydown","scroll","mousemove"];for(const P of Z)window.addEventListener(P,z,{passive:!0});function X(){L()}return window.addEventListener("focus",X),()=>{for(const P of Z)window.removeEventListener(P,z);window.removeEventListener("focus",X)}},[r,g,C,L]),b.useEffect(()=>()=>k(),[k]),{loading:c,locked:f,configured:g,refresh:L}}function K1(){const[l,r]=b.useState({kind:"loading"}),c=b.useCallback(async()=>{try{const o=await wc();if(!o.hasSession){r({kind:"signed-out"});return}r({kind:"ok",csrf:o.csrf,twoFactorEnabled:o.two_factor_enabled})}catch{r({kind:"signed-out"})}},[]);return b.useEffect(()=>{c()},[c]),l.kind==="loading"?i.jsx("div",{className:"empty",children:"Loading account…"}):l.kind==="signed-out"?i.jsxs("div",{className:"empty",children:["You're not signed in."," ",i.jsx("a",{href:`/login?next=${encodeURIComponent(window.location.pathname)}`,children:"Sign in"})," to manage your account."]}):i.jsxs("section",{className:"settings","data-testid":"account-page",children:[i.jsx("h1",{children:"My account"}),i.jsx("p",{className:"muted",children:"Manage your own sign-in credentials. Changes here apply to your account only."}),i.jsx(F1,{csrf:l.csrf}),i.jsx(W1,{csrf:l.csrf,enabled:l.twoFactorEnabled,onChanged:()=>void c()})]})}function F1({csrf:l}){const[r,c]=b.useState(""),[o,f]=b.useState(""),[h,g]=b.useState(""),[y,m]=b.useState(!1),[v,x]=b.useState(null),[j,_]=b.useState(null);async function k(C){if(C.preventDefault(),!y){if(x(null),_(null),!r||!o||!h){x("All three fields are required.");return}if(o.length<12){x("New password must be at least 12 characters (a passphrase is fine).");return}if(o!==h){x("New password and confirmation do not match.");return}m(!0);try{await G1(l,r,o),c(""),f(""),g(""),_("Password changed. Tokens minted under your old password were revoked.")}catch(O){x(O instanceof Error?O.message:String(O))}finally{m(!1)}}}return i.jsxs("section",{className:"settings-block","aria-labelledby":"account-password-heading","data-testid":"account-password",children:[i.jsx("h2",{id:"account-password-heading",children:"Password"}),i.jsx("p",{className:"muted",children:"Change the password you use to sign in to this hub."}),i.jsxs("form",{onSubmit:C=>void k(C),className:"settings-form",children:[i.jsxs("label",{children:["Current password",i.jsx("input",{type:"password",autoComplete:"current-password",value:r,disabled:y,onChange:C=>c(C.target.value),"data-testid":"account-current-password"})]}),i.jsxs("label",{children:["New password (12+ characters)",i.jsx("input",{type:"password",autoComplete:"new-password",value:o,disabled:y,onChange:C=>f(C.target.value),"data-testid":"account-new-password"})]}),i.jsxs("label",{children:["Confirm new password",i.jsx("input",{type:"password",autoComplete:"new-password",value:h,disabled:y,onChange:C=>g(C.target.value),"data-testid":"account-confirm-password"})]}),i.jsx("div",{className:"actions",children:i.jsx("button",{type:"submit",disabled:y,"data-testid":"account-change-password",children:y?"Saving…":"Change password"})})]}),v&&i.jsx("div",{className:"error","data-testid":"account-password-error",children:v}),j&&i.jsx("p",{className:"muted","data-testid":"account-password-notice",children:j})]})}function W1({csrf:l,enabled:r,onChanged:c}){const[o,f]=b.useState({kind:"idle"}),[h,g]=b.useState(!1),[y,m]=b.useState(null),[v,x]=b.useState(""),[j,_]=b.useState("");async function k(){if(!h){m(null),g(!0);try{const z=await L1(l);f({kind:"enrolling",start:z}),x("")}catch(z){m(z instanceof Error?z.message:String(z))}finally{g(!1)}}}async function C(z){if(z.preventDefault(),!(h||o.kind!=="enrolling")){if(m(null),!/^\d{6}$/.test(v.trim())){m("Enter the 6-digit code from your authenticator app.");return}g(!0);try{const Z=await q1(l,o.start.secret,v.trim());f({kind:"backup-codes",codes:Z.backup_codes}),x(""),c()}catch(Z){m(Z instanceof Error?Z.message:String(Z))}finally{g(!1)}}}function O(){f({kind:"idle"}),x(""),m(null)}async function L(z){if(z.preventDefault(),!h){if(m(null),!j){m("Enter your current password to turn off two-factor.");return}g(!0);try{await Y1(l,j),_(""),f({kind:"idle"}),c()}catch(Z){m(Z instanceof Error?Z.message:String(Z))}finally{g(!1)}}}return i.jsxs("section",{className:"settings-block","aria-labelledby":"account-2fa-heading","data-testid":"account-2fa",children:[i.jsx("h2",{id:"account-2fa-heading",children:"Two-factor authentication"}),i.jsx("p",{className:"muted",children:"Add a time-based one-time code (TOTP) from an authenticator app as a second step at sign-in."}),i.jsxs("p",{children:["Status:"," ",i.jsx("span",{className:`lock-status-pill ${r?"lock-status-on":"lock-status-off"}`,"data-testid":"account-2fa-status",children:r?"Enabled":"Off"})]}),o.kind==="backup-codes"?i.jsxs("div",{"data-testid":"account-2fa-backup-codes",children:[i.jsxs("p",{children:[i.jsx("strong",{children:"Save these backup codes now."})," Each can be used once if you lose your authenticator. They won't be shown again."]}),i.jsx("ul",{className:"backup-codes",children:o.codes.map(z=>i.jsx("li",{children:i.jsx("code",{children:z})},z))}),i.jsx("div",{className:"actions",children:i.jsx("button",{type:"button",onClick:()=>f({kind:"idle"}),"data-testid":"account-2fa-codes-done",children:"I've saved my codes"})})]}):r?i.jsxs("form",{onSubmit:z=>void L(z),className:"settings-form",children:[i.jsx("p",{className:"muted",children:"Turning off two-factor requires your current password."}),i.jsxs("label",{children:["Current password",i.jsx("input",{type:"password",autoComplete:"current-password",value:j,disabled:h,onChange:z=>_(z.target.value),"data-testid":"account-2fa-disable-password"})]}),i.jsx("div",{className:"actions",children:i.jsx("button",{type:"submit",className:"destructive",disabled:h,"data-testid":"account-2fa-disable",children:h?"Turning off…":"Turn off two-factor"})})]}):o.kind==="enrolling"?i.jsxs("form",{onSubmit:z=>void C(z),className:"settings-form",children:[i.jsx("p",{children:"Scan this QR code with your authenticator app, then enter the 6-digit code it shows to confirm."}),i.jsx("img",{src:o.start.qr_data_url,alt:"Two-factor QR code",width:180,height:180,"data-testid":"account-2fa-qr"}),i.jsxs("p",{className:"muted",children:["Can't scan? Enter this key manually:"," ",i.jsx("code",{"data-testid":"account-2fa-secret",children:o.start.secret})]}),i.jsxs("label",{children:["6-digit code",i.jsx("input",{type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:6,value:v,disabled:h,onChange:z=>x(z.target.value.replace(/[^0-9]/g,"")),"data-testid":"account-2fa-code"})]}),i.jsxs("div",{className:"actions",children:[i.jsx("button",{type:"submit",disabled:h,"data-testid":"account-2fa-confirm",children:h?"Verifying…":"Verify and enable"}),i.jsx("button",{type:"button",className:"destructive",disabled:h,onClick:O,"data-testid":"account-2fa-cancel",children:"Cancel"})]})]}):i.jsx("div",{className:"actions",children:i.jsx("button",{type:"button",disabled:h,onClick:()=>void k(),"data-testid":"account-2fa-enroll",children:h?"Starting…":"Set up two-factor"})}),y&&i.jsx("div",{className:"error","data-testid":"account-2fa-error",children:y})]})}function I1(){const{clientId:l}=Wv(),r=l??"",[c]=bm(),o=P1(c.get("return_to")),[f,h]=b.useState({kind:"loading"}),[g,y]=b.useState({kind:"idle"}),[m,v]=b.useState(0);b.useEffect(()=>{if(!r){h({kind:"error",message:"missing client id in URL"});return}let j=!1;return h({kind:"loading"}),s1(r).then(_=>{j||(h({kind:"ok",client:_}),_.status==="approved"&&(y({kind:"approved",alreadyApproved:!0}),o&&window.location.assign(o)))}).catch(_=>{if(j)return;if(_ instanceof V&&_.status===404){h({kind:"not_found"});return}const k=_ instanceof Error?_.message:String(_);h({kind:"error",message:k})}),()=>{j=!0}},[r,m,o]);async function x(){y({kind:"approving"});try{const j=await u1(r,o||void 0);if(j.redirect_to&&Em(j.redirect_to)){window.location.assign(j.redirect_to);return}y({kind:"approved",alreadyApproved:j.already_approved})}catch(j){const _=j instanceof V?`approve failed (${j.status}): ${j.message}`:j instanceof Error?j.message:String(j);y({kind:"error",message:_})}}return i.jsxs("div",{children:[i.jsx("div",{className:"list-header",children:i.jsx("h2",{children:"Approve app"})}),e0({loadState:f,action:g,onApprove:x,onRetry:()=>v(j=>j+1)})]})}function Em(l){return!(!l||!l.startsWith("/")||l.startsWith("//"))}function P1(l){return l===null?null:Em(l)?l:null}function e0({loadState:l,action:r,onApprove:c,onRetry:o}){if(l.kind==="loading")return i.jsx("p",{className:"muted","data-loading":"true",children:"Loading…"});if(l.kind==="not_found")return i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"Unknown client."}),i.jsxs("p",{className:"muted",children:["This client_id isn't registered with this hub. The deep link may be stale, or the requesting app may have been registered against a different hub."," ",i.jsx(lt,{to:"/permissions",children:"Back to permissions"}),"."]})]});if(l.kind==="error")return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"error-banner",children:["Couldn't load the client: ",i.jsx("code",{children:l.message})]}),i.jsx("button",{type:"button",onClick:o,className:"secondary",children:"Retry"})]});const{client:f}=l,h=f.client_name??f.client_id;if(r.kind==="approved")return i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:r.alreadyApproved?"Already approved.":"Approved."}),i.jsxs("p",{className:"muted",children:[i.jsx("code",{children:h})," ",r.alreadyApproved?"was already on this hub's approved list.":"can now run an OAuth flow with this hub."," ","Return to the app that sent you here and retry the action — the request will go through now."]}),i.jsx("p",{className:"muted",style:{marginTop:"1rem"},children:i.jsx(lt,{to:"/permissions",children:"View permissions"})})]});const g=r.kind==="approving",y=r.kind==="error"?r.message:null;return i.jsxs("div",{children:[i.jsx("p",{className:"muted",children:"An app is asking this hub to issue OAuth tokens. Review the details below and approve only if you recognize the app."}),i.jsx("div",{className:"vault-row",style:{marginTop:"1rem"},children:i.jsxs("div",{className:"body",children:[i.jsx("div",{className:"name",children:i.jsx("code",{children:h})}),i.jsxs("div",{className:"dim",children:[i.jsx("span",{className:"muted",children:"client_id: "}),i.jsx("code",{children:f.client_id})]}),i.jsxs("div",{className:"dim",style:{marginTop:"0.25rem"},children:[i.jsx("span",{className:"muted",children:"redirect_uris: "}),f.redirect_uris.map((m,v)=>i.jsxs("span",{children:[i.jsx("code",{children:m}),v<f.redirect_uris.length-1?" ":null]},m))]}),f.scopes.length>0?i.jsxs("div",{className:"dim",style:{marginTop:"0.25rem"},children:[i.jsx("span",{className:"muted",children:"requested scopes: "}),f.scopes.map((m,v)=>i.jsxs("span",{children:[i.jsx("code",{children:t0(m)}),v<f.scopes.length-1?" ":null]},m)),f.scopes.some(km)?i.jsxs("p",{className:"muted",style:{marginTop:"0.4rem",fontStyle:"italic",fontSize:"0.85rem"},children:[i.jsx("code",{children:"*"})," — a specific vault is selected during sign-in via the consent picker (or the user's assigned vault for multi-user setups)."]}):null]}):null,i.jsxs("div",{className:"dim",style:{marginTop:"0.25rem"},children:[i.jsx("span",{className:"muted",children:"registered: "}),i.jsx("code",{title:f.registered_at,children:f.registered_at})]}),y?i.jsx("div",{className:"error-banner",style:{marginTop:"0.5rem"},children:i.jsx("code",{children:y})}):null]})}),i.jsxs("div",{style:{marginTop:"1rem",display:"flex",gap:"0.5rem"},children:[i.jsx("button",{type:"button",onClick:()=>{c()},disabled:g,children:g?"Approving…":`Approve ${h}`}),i.jsx(lt,{to:"/permissions",className:"secondary",style:{alignSelf:"center"},children:"Cancel"})]})]})}function t0(l){return km(l)?`vault:*:${l.split(":")[1]}`:l}function km(l){const r=l.split(":");if(r.length!==2||r[0]!=="vault")return!1;const c=r[1];return c==="read"||c==="write"}function a0(l){const r={};for(const c of l.parameters){const o=/^sink\.params\.(.+)$/.exec(c.target);o!=null&&o[1]&&(r[o[1]]=c.example??`my-${c.key}`)}return r}function nc(l,r){return l instanceof V?`${r} failed (${l.status}): ${l.message}`:l instanceof Error?l.message:String(l)}function Kh({value:l,label:r="Copy"}){const[c,o]=b.useState(!1);return i.jsx("button",{type:"button",className:"secondary",onClick:()=>{typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(l).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},children:c?"Copied ✓":r})}function n0(){const[l,r]=b.useState({kind:"loading"}),[c,o]=b.useState(0),[f,h]=b.useState({kind:"idle"}),[g,y]=b.useState({kind:"idle"}),[m,v]=b.useState({kind:"idle"}),[x,j]=b.useState(""),[_,k]=b.useState(""),[C,O]=b.useState(""),[L,z]=b.useState(""),[Z,X]=b.useState(""),[P,K]=b.useState(""),[J,E]=b.useState("");b.useEffect(()=>{let ie=!1;return r({kind:"loading"}),Promise.all([z1(),M1(),Sc()]).then(([W,ge,be])=>{ie||(r({kind:"ok",data:{connections:W,catalog:ge,vaults:be.vaults}}),O(H=>{var F;return H||((F=be.vaults[0])==null?void 0:F.name)||""}))}).catch(W=>{ie||r({kind:"error",message:W instanceof Error?W.message:String(W)})}),()=>{ie=!0}},[c]);function D(ie){j(ie.source.module),k(ie.source.event),X(ie.sink.module),K(ie.sink.action),z(ie.source.filter?JSON.stringify(ie.source.filter,null,2):"");const W=a0(ie);E(Object.keys(W).length>0?JSON.stringify(W,null,2):""),h({kind:"idle"})}async function Q(ie){if(ie.preventDefault(),!x||!_||!Z||!P){h({kind:"error",message:"Pick a source event and a sink action."});return}let W,ge;try{W=L.trim()?JSON.parse(L):void 0}catch{h({kind:"error",message:"Filter is not valid JSON."});return}try{ge=J.trim()?JSON.parse(J):void 0}catch{h({kind:"error",message:"Action params are not valid JSON."});return}if(x==="vault"&&!C){h({kind:"error",message:"Pick a vault for the source event."});return}h({kind:"submitting"});try{const be=await O1({source:{module:x,...x==="vault"?{vault:C}:{},event:_,...W?{filter:W}:{}},sink:{module:Z,action:P,...ge?{params:ge}:{}}});h({kind:"created",...be.connect?{connect:be.connect}:{}}),o(H=>H+1)}catch(be){h({kind:"error",message:nc(be,"Create")})}}async function te(ie){y({kind:"removing",id:ie});try{await D1(ie),y({kind:"idle"}),o(W=>W+1)}catch(W){y({kind:"error",id:ie,message:nc(W,"Remove")})}}async function le(ie){if(m.kind!=="approving"){v({kind:"approving",id:ie});try{await U1(ie),v({kind:"idle"}),o(W=>W+1)}catch(W){v({kind:"error",id:ie,message:nc(W,"Approve")})}}}return i.jsxs("div",{"data-route-content":"true",children:[i.jsx("div",{className:"list-header",children:i.jsx("h1",{children:"Connections"})}),i.jsxs("p",{className:"muted",children:["A connection wires ",i.jsx("em",{children:"when [event] in a module → do [action] in another module"}),". The hub mints the tokens and registers the trigger. Modules declare presets for the common cases — pick one below to pre-fill the builder."]}),l0(l,g,y,te,m,le,()=>o(ie=>ie+1)),l.kind==="ok"&&i.jsx(c0,{catalog:l.data.catalog,vaults:l.data.vaults,sourceModule:x,setSourceModule:j,sourceEvent:_,setSourceEvent:k,vault:C,setVault:O,filterText:L,setFilterText:z,sinkModule:Z,setSinkModule:X,sinkAction:P,setSinkAction:K,paramsText:J,setParamsText:E,createSt:f,setCreateSt:h,onSubmit:Q,onApplyTemplate:D})]})}function l0(l,r,c,o,f,h,g){if(l.kind==="loading")return i.jsx("p",{className:"muted",children:"Loading connections…"});if(l.kind==="error")return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"error-banner",children:["Couldn't load connections: ",i.jsx("code",{children:l.message})]}),i.jsx("button",{type:"button",onClick:g,className:"secondary",children:"Retry"})]});const{connections:y}=l.data;return y.length===0?i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No connections yet."}),i.jsx("p",{className:"muted",children:"Build one below, or start from a module's preset."})]}):i.jsx(u0,{connections:y,removeSt:r,setRemoveSt:c,onConfirmRemove:o,approveSt:f,onApprove:h})}function Tm(l){return l.requested_by&&l.requested_by.length>0?l.requested_by:"custom"}function i0(l){return l==="custom"?"Custom (built here)":`Added from ${l}`}function s0(l){const r=new Map;for(const c of l){const o=Tm(c),f=r.get(o);f?f.push(c):r.set(o,[c])}return Array.from(r.entries()).sort(([c],[o])=>c===o?0:c==="custom"?1:o==="custom"?-1:c.localeCompare(o))}function u0({connections:l,removeSt:r,setRemoveSt:c,onConfirmRemove:o,approveSt:f,onApprove:h}){const g=s0(l);return i.jsx(i.Fragment,{children:g.map(([y,m])=>i.jsxs("div",{className:"channel-list",style:{marginTop:"1rem"},"data-provenance-group":y,children:[i.jsx("h3",{style:{marginBottom:"0.25rem"},children:i0(y)}),i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{className:"channel-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",children:"Connection"}),i.jsx("th",{scope:"col",children:"When"}),i.jsx("th",{scope:"col",children:"Do"}),i.jsx("th",{scope:"col",children:"Source"}),i.jsx("th",{scope:"col",children:"Actions"})]})}),i.jsx("tbody",{children:m.map(v=>r0(v,r,c,o,f,h))})]})})]},y))})}function r0(l,r,c,o,f,h){const g=r.kind==="confirming"&&r.id===l.id,y=r.kind==="removing"&&r.id===l.id,m=r.kind==="error"&&r.id===l.id?r.message:null,v=l.status==="pending",x=f.kind==="approving"&&f.id===l.id,j=f.kind==="error"&&f.id===l.id?f.message:null,_=`${l.source.module}.${l.source.event}${l.source.vault?` (${l.source.vault})`:""}`,k=`${l.sink.module}.${l.sink.action}`,C=Tm(l);return i.jsxs("tr",{"data-connection-id":l.id,"data-requested-by":C,children:[i.jsxs("td",{children:[i.jsx("code",{children:l.id}),v&&i.jsxs(i.Fragment,{children:[" ",i.jsx("span",{className:"tag","data-testid":"pending-badge",title:`A module claimed a credential it already holds${l.provisioned.scope?` (${l.provisioned.scope})`:""} — approving lets it renew before expiry. Nothing new is granted.`,children:"pending approval"})]})]}),i.jsx("td",{children:i.jsx("code",{children:_})}),i.jsx("td",{children:i.jsx("code",{children:k})}),i.jsx("td",{children:C==="custom"?i.jsx("span",{className:"muted",children:"custom"}):i.jsx("span",{className:"tag","data-testid":"provenance-badge",children:C})}),i.jsxs("td",{children:[v&&i.jsx("button",{type:"button",disabled:x,onClick:()=>void h(l.id),"aria-label":`Approve ${l.id}`,"data-testid":"approve-connection",style:{marginRight:"0.5rem"},children:x?"Approving…":"Approve"}),g?i.jsxs("dialog",{open:!0,className:"error-banner",style:{marginTop:"0.25rem",background:"var(--bg-warn, #fffbe6)"},"aria-label":`Confirm remove ${l.id}`,children:[i.jsxs("p",{children:["Remove connection ",i.jsx("code",{children:l.id}),"? This tears down the provisioned trigger (and channel config, if any)."]}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[i.jsx("button",{type:"button",className:"destructive",onClick:()=>{o(l.id)},disabled:y,children:y?"Removing…":"Remove"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>c({kind:"idle"}),disabled:y,children:"Cancel"})]})]}):i.jsx("button",{type:"button",className:"secondary",disabled:y,onClick:()=>c({kind:"confirming",id:l.id}),"aria-label":`Remove ${l.id}`,children:y?"Removing…":"Remove"}),m&&i.jsx("div",{className:"error-banner",style:{marginTop:"0.25rem"},children:i.jsx("code",{children:m})}),j&&i.jsx("div",{className:"error-banner",style:{marginTop:"0.25rem"},children:i.jsx("code",{children:j})})]})]},l.id)}function c0(l){const{catalog:r,createSt:c}=l,o=c.kind==="submitting",f=m=>r.events.filter(v=>v.module===m),h=m=>r.actions.filter(v=>v.module===m),g=Array.from(new Set(r.events.map(m=>m.module))),y=Array.from(new Set(r.actions.map(m=>m.module)));return i.jsxs("section",{style:{marginTop:"1.5rem"},children:[i.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",flexWrap:"wrap"},children:[i.jsx("h3",{style:{marginRight:"auto"},children:"Build a connection"}),r.templates.map(m=>i.jsxs("button",{type:"button",className:"secondary",onClick:()=>l.onApplyTemplate(m),"data-testid":`preset-${m.module}-${m.key}`,...m.description?{title:m.description}:{},children:["Preset: ",m.title]},`${m.module}/${m.key}`))]}),i.jsxs("form",{onSubmit:m=>void l.onSubmit(m),"aria-label":"Build a connection",children:[i.jsxs("fieldset",{style:{border:"1px solid var(--border, #ddd)",padding:"0.75rem"},children:[i.jsx("legend",{children:"When (source event)"}),i.jsxs("p",{children:[i.jsx("label",{htmlFor:"conn-source-module",children:"Module"}),i.jsx("br",{}),i.jsxs("select",{id:"conn-source-module",value:l.sourceModule,disabled:o,onChange:m=>{l.setSourceModule(m.target.value),l.setSourceEvent("")},children:[i.jsx("option",{value:"",children:"— pick a module —"}),g.map(m=>i.jsx("option",{value:m,children:m},m))]})]}),l.sourceModule&&i.jsxs("p",{children:[i.jsx("label",{htmlFor:"conn-source-event",children:"Event"}),i.jsx("br",{}),i.jsxs("select",{id:"conn-source-event",value:l.sourceEvent,disabled:o,onChange:m=>l.setSourceEvent(m.target.value),children:[i.jsx("option",{value:"",children:"— pick an event —"}),f(l.sourceModule).map(m=>i.jsxs("option",{value:m.key,children:[m.title," (",m.key,")"]},m.key))]})]}),l.sourceModule==="vault"&&i.jsxs("p",{children:[i.jsx("label",{htmlFor:"conn-vault",children:"Vault"}),i.jsx("br",{}),i.jsx("select",{id:"conn-vault",value:l.vault,disabled:o,onChange:m=>l.setVault(m.target.value),children:l.vaults.map(m=>i.jsx("option",{value:m.name,children:m.name},m.name))})]}),i.jsxs("p",{children:[i.jsxs("label",{htmlFor:"conn-filter",children:["Filter ",i.jsx("span",{className:"muted",children:"(JSON — tags / has_metadata / missing_metadata)"})]}),i.jsx("br",{}),i.jsx("textarea",{id:"conn-filter",value:l.filterText,disabled:o,rows:4,style:{width:"100%",fontFamily:"monospace"},onChange:m=>l.setFilterText(m.target.value),placeholder:'{ "tags": ["#agent-message/inbound"] }'})]})]}),i.jsxs("fieldset",{style:{border:"1px solid var(--border, #ddd)",padding:"0.75rem",marginTop:"0.75rem"},children:[i.jsx("legend",{children:"Do (sink action)"}),i.jsxs("p",{children:[i.jsx("label",{htmlFor:"conn-sink-module",children:"Module"}),i.jsx("br",{}),i.jsxs("select",{id:"conn-sink-module",value:l.sinkModule,disabled:o,onChange:m=>{l.setSinkModule(m.target.value),l.setSinkAction("")},children:[i.jsx("option",{value:"",children:"— pick a module —"}),y.map(m=>i.jsx("option",{value:m,children:m},m))]})]}),l.sinkModule&&i.jsxs("p",{children:[i.jsx("label",{htmlFor:"conn-sink-action",children:"Action"}),i.jsx("br",{}),i.jsxs("select",{id:"conn-sink-action",value:l.sinkAction,disabled:o,onChange:m=>l.setSinkAction(m.target.value),children:[i.jsx("option",{value:"",children:"— pick an action —"}),h(l.sinkModule).map(m=>i.jsxs("option",{value:m.key,children:[m.title," (",m.key,")"]},m.key))]})]}),i.jsxs("p",{children:[i.jsxs("label",{htmlFor:"conn-params",children:["Action params ",i.jsxs("span",{className:"muted",children:["(JSON — e.g. ",'{ "channel": "eng" }',")"]})]}),i.jsx("br",{}),i.jsx("textarea",{id:"conn-params",value:l.paramsText,disabled:o,rows:3,style:{width:"100%",fontFamily:"monospace"},onChange:m=>l.setParamsText(m.target.value),placeholder:'{ "channel": "eng" }'})]})]}),c.kind==="error"&&i.jsx("div",{className:"error-banner",style:{marginTop:"0.5rem"},children:i.jsx("code",{children:c.message})}),i.jsx("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.75rem"},children:i.jsx("button",{type:"submit",disabled:o,children:o?"Creating…":"Create connection"})})]}),c.kind==="created"&&c.connect&&i.jsx(o0,{connect:c.connect,onDismiss:()=>l.setCreateSt({kind:"idle"})}),c.kind==="created"&&!c.connect&&i.jsx("div",{className:"success-banner",style:{marginTop:"1rem"},"data-testid":"connection-created",children:"Connection created."})]})}function o0({connect:l,onDismiss:r}){return i.jsxs("div",{className:"mcp-connect-card",style:{marginTop:"1rem"},"data-testid":"connection-connect-panel",children:[i.jsx("h3",{children:"Connect a session"}),i.jsx("p",{className:"muted",children:"Run these where your Claude Code session will live; authorize in the browser when prompted."}),i.jsxs("div",{className:"mcp-field",children:[i.jsx("span",{className:"mcp-field-label",children:"1 · Register the channel (MCP)"}),i.jsxs("div",{className:"token-box",children:[i.jsx("code",{"data-testid":"connection-mcp-add",children:l.mcpAdd}),i.jsx(Kh,{value:l.mcpAdd})]})]}),i.jsxs("div",{className:"mcp-field",children:[i.jsx("span",{className:"mcp-field-label",children:"2 · Launch a session on the channel"}),i.jsxs("div",{className:"token-box",children:[i.jsx("code",{"data-testid":"connection-launch",children:l.launch}),i.jsx(Kh,{value:l.launch})]}),i.jsxs("p",{className:"muted",style:{marginTop:"0.4rem"},children:["⚠ This launches Claude Code with unrestricted tool access (",i.jsx("code",{children:"--dangerously-skip-permissions"}),") — run it only on a machine you trust for that session."]})]}),i.jsx("div",{style:{marginTop:"0.75rem"},children:i.jsx("button",{type:"button",className:"secondary",onClick:r,children:"Dismiss"})})]})}function Xl(l,r){return l instanceof V||l instanceof Error?l.message:`${r} failed`}function d0(){const[l,r]=b.useState({kind:"loading"}),[c,o]=b.useState({kind:"idle"}),[f,h]=b.useState(0);b.useEffect(()=>{let x=!1;return r({kind:"loading"}),H1().then(j=>{x||r({kind:"ok",grants:j})}).catch(j=>{x||r({kind:"error",message:Xl(j,"Load")})}),()=>{x=!0}},[f]);async function g(x){o({kind:"working",id:x});try{await tc(x),o({kind:"idle"}),h(j=>j+1)}catch(j){o({kind:"error",id:x,message:Xl(j,"Approve")})}}async function y(x,j){if(j.trim().length===0){o({kind:"error",id:x,message:"Paste the API token before approving."});return}o({kind:"working",id:x});try{await tc(x,j),o({kind:"idle"}),h(_=>_+1)}catch(_){o({kind:"error",id:x,message:Xl(_,"Approve")})}}async function m(x){o({kind:"working",id:x});try{const j=await tc(x);if(j.authorizeUrl){window.location.assign(j.authorizeUrl);return}o({kind:"idle"}),h(_=>_+1)}catch(j){o({kind:"error",id:x,message:Xl(j,"Connect")})}}async function v(x){o({kind:"working",id:x});try{await B1(x),o({kind:"idle"}),h(j=>j+1)}catch(j){o({kind:"error",id:x,message:Xl(j,"Revoke")})}}return i.jsxs("div",{"data-route-content":"true",children:[i.jsx("div",{className:"list-header",children:i.jsx("h1",{children:"Grants"})}),i.jsxs("p",{className:"muted",children:["Agents declare connections they want beyond their own vault — other vaults (tag-scoped) and external service credentials. Each one waits here for your approval. A vault note can only"," ",i.jsx("em",{children:"request"}),"; nothing is granted until you approve it below."]}),f0(l,c,o,{onApproveVault:g,onApproveService:y,onConnectMcp:m,onRevoke:v,onRetry:()=>h(x=>x+1)})]})}function f0(l,r,c,o){if(l.kind==="loading")return i.jsx("p",{className:"muted",children:"Loading grants…"});if(l.kind==="error")return i.jsxs("div",{children:[i.jsx("div",{className:"error-banner",children:l.message}),i.jsx("button",{type:"button",onClick:o.onRetry,className:"secondary",children:"Retry"})]});if(l.grants.length===0)return i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No grant requests yet."}),i.jsx("p",{className:"muted",children:"When an agent declares a connection it wants, it shows up here for approval."})]});const f=new Map;for(const g of l.grants){const y=f.get(g.agent)??[];y.push(g),f.set(g.agent,y)}const h=[...f.keys()].sort();return i.jsx("div",{className:"grants-groups",children:h.map(g=>i.jsxs("section",{"aria-label":`Grants for ${g}`,style:{marginBottom:"1.5rem"},children:[i.jsx("h3",{style:{marginBottom:"0.25rem"},children:g}),i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{className:"channel-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Connection"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:(f.get(g)??[]).map(y=>i.jsx(m0,{grant:y,rowSt:r,setRowSt:c,actions:o},y.id))})]})})]},g))})}function h0(l){if(l.kind==="vault"){const r=l.access??"read",c=l.tags&&l.tags.length>0?` (${l.tags.join(", ")})`:"";return`vault: ${l.target} · ${r}${c}`}if(l.kind==="service"){const r=l.inject&&l.inject.length>0?` · inject: ${l.inject.join("+")}`:"";return`service: ${l.target}${r}`}return`mcp: ${l.target}`}function m0({grant:l,rowSt:r,setRowSt:c,actions:o}){const f=r.kind==="working"&&r.id===l.id,h=r.kind==="error"&&r.id===l.id?r.message:null,g=l.connection,y=g.kind==="mcp",m=g.kind==="service",v=l.status!=="approved",x=r.kind==="pasting"&&r.id===l.id?r.token:null;return i.jsxs("tr",{"data-grant-id":l.id,children:[i.jsxs("td",{children:[i.jsx("code",{children:h0(g)}),y&&i.jsx("span",{className:"muted",children:" — remote MCP (OAuth)"})]}),i.jsxs("td",{children:[i.jsx("span",{className:`status status-${l.status}`,children:l.status}),l.reason&&i.jsxs("span",{className:"muted",children:[" — ",l.reason]})]}),i.jsxs("td",{children:[v&&g.kind==="vault"&&i.jsx("button",{type:"button",className:"primary",disabled:f,onClick:()=>o.onApproveVault(l.id),children:f?"Approving…":l.status==="revoked"?"Re-approve":"Approve"}),v&&y&&x===null&&i.jsxs("span",{style:{display:"inline-flex",gap:"0.5rem",alignItems:"center"},children:[i.jsx("button",{type:"button",className:"primary",disabled:f,onClick:()=>o.onConnectMcp(l.id),children:f?"Connecting…":l.status==="needs_consent"?"Reconnect":"Connect"}),i.jsx("button",{type:"button",className:"secondary",disabled:f,onClick:()=>c({kind:"pasting",id:l.id,token:""}),children:"Paste a token instead"})]}),v&&m&&x===null&&i.jsx("button",{type:"button",className:"primary",disabled:f,onClick:()=>c({kind:"pasting",id:l.id,token:""}),children:l.status==="revoked"?"Re-approve…":"Approve…"}),v&&(m||y)&&x!==null&&i.jsxs("span",{style:{display:"inline-flex",gap:"0.5rem",alignItems:"center"},children:[i.jsx("input",{type:"password","aria-label":`API token for ${g.target}`,placeholder:`${g.target} API token`,value:x,onChange:j=>c({kind:"pasting",id:l.id,token:j.target.value})}),i.jsx("button",{type:"button",className:"primary",disabled:f,onClick:()=>o.onApproveService(l.id,x),children:f?"Approving…":"Save & approve"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>c({kind:"idle"}),children:"Cancel"})]}),l.status==="approved"&&i.jsx("button",{type:"button",className:"secondary",disabled:f,onClick:()=>o.onRevoke(l.id),children:f?"Revoking…":"Revoke"}),h&&i.jsxs("span",{className:"error-inline",children:[" ",h]})]})]})}const p0=[{to:"/connections",label:"Connections",desc:"Wire a module event to another module's action."},{to:"/modules",label:"Modules",desc:"Install, upgrade, and manage modules."},{to:"/users",label:"Users",desc:"Manage operators and invite members."},{to:"/tokens",label:"Tokens",desc:"Mint and revoke access tokens."},{to:"/permissions",label:"Permissions",desc:"OAuth consent grants per app."},{to:"/settings",label:"Settings",desc:"Canonical URL, install channel, more."}];function g0(){const[l,r]=b.useState({kind:"loading"}),[c,o]=b.useState(null);b.useEffect(()=>{let g=!1;return Cs().then(y=>{g||r({kind:"ok",modules:y.modules.filter(m=>m.installed)})}).catch(y=>{if(g)return;const m=y instanceof Error?y.message:String(y);r({kind:"error",message:m})}),Sc().then(y=>{g||o(y.vaults.length)}).catch(()=>{g||o(null)}),()=>{g=!0}},[]);const f=l.kind==="ok"?l.modules:[],h=f.flatMap(g=>g.uis.map(y=>({key:`${g.short}:${y.name}`,label:y.display_name,tagline:y.tagline,href:y.path,ownerLabel:g.display_name})));return i.jsxs("div",{"data-route-content":"true",className:"admin-home",children:[i.jsx("div",{className:"list-header",children:i.jsx("h1",{children:"Hub"})}),i.jsxs("p",{className:"muted",children:["Everything on this hub, in one place. Hub-native sections open here in the admin shell; module surfaces (marked ",i.jsx("span",{className:"ext-mark",children:"↗"}),") open the module's own UI."]}),i.jsxs("section",{className:"home-group","data-testid":"home-administer",children:[i.jsxs("div",{className:"home-group-head",children:[i.jsx("h2",{children:"Administer"}),i.jsx("span",{className:"home-group-tag home-group-tag-hub",children:"hub"})]}),i.jsx("p",{className:"muted home-group-sub",children:"Cross-cutting host admin. Opens here in the shell — the nav stays with you."}),i.jsx("div",{className:"home-grid",children:p0.map(g=>i.jsxs(lt,{to:g.to,className:"home-card home-card-hub","data-section":g.to,children:[i.jsx("span",{className:"home-card-title",children:g.label}),i.jsx("span",{className:"home-card-desc",children:g.desc})]},g.to))})]}),i.jsxs("section",{className:"home-group","data-testid":"home-modules",children:[i.jsxs("div",{className:"home-group-head",children:[i.jsx("h2",{children:"Modules"}),i.jsx("span",{className:"home-group-tag home-group-tag-module",children:"modules"})]}),i.jsxs("p",{className:"muted home-group-sub",children:["Installed modules. Each opens its own admin surface outside the hub shell. Manage install / upgrade / restart from ",i.jsx(lt,{to:"/modules",children:"Modules"}),"."]}),l.kind==="loading"?i.jsx("p",{className:"muted","data-loading":"true",children:"Loading modules…"}):l.kind==="error"?i.jsxs("p",{className:"muted","data-testid":"home-modules-error",children:["Couldn't load modules (",l.message,"). Open ",i.jsx(lt,{to:"/modules",children:"Modules"})," ","directly."]}):f.length===0?i.jsxs("p",{className:"muted","data-testid":"home-modules-empty",children:["No modules installed yet. ",i.jsx(lt,{to:"/modules",children:"Install one →"})]}):i.jsx("div",{className:"home-grid",children:f.map(g=>g.short==="vault"&&c===0?i.jsx(y0,{module:g},g.short):i.jsx(v0,{module:g},g.short))})]}),h.length>0?i.jsxs("section",{className:"home-group","data-testid":"home-surfaces",children:[i.jsxs("div",{className:"home-group-head",children:[i.jsx("h2",{children:"Your surfaces"}),i.jsx("span",{className:"home-group-tag home-group-tag-module",children:"module-owned"})]}),i.jsx("p",{className:"muted home-group-sub",children:"The user-facing apps these modules host. Opens the app — outside the hub shell."}),i.jsx("div",{className:"home-grid",children:h.map(g=>i.jsxs("a",{href:g.href,className:"home-card home-card-surface","data-testid":`home-surface-${g.key}`,children:[i.jsxs("span",{className:"home-card-title",children:[g.label," ",i.jsx("span",{className:"ext-mark",children:"↗"})]}),g.tagline?i.jsx("span",{className:"home-card-desc",children:g.tagline}):null,i.jsxs("span",{className:"home-card-owner",children:["opens ",g.ownerLabel,"'s surface"]})]},g.key))})]}):null]})}function v0({module:l}){const r=l.config_ui_url??l.management_url;return r?i.jsxs("a",{href:r,className:"home-card home-card-module","data-testid":`home-module-${l.short}`,children:[i.jsxs("span",{className:"home-card-title",children:[l.display_name," ",i.jsx("span",{className:"ext-mark",children:"↗"})]}),l.tagline?i.jsx("span",{className:"home-card-desc",children:l.tagline}):null,i.jsxs("span",{className:"home-card-owner",children:["opens ",l.display_name,"'s own admin"]})]}):i.jsxs("div",{className:"home-card home-card-module home-card-disabled","data-testid":`home-module-${l.short}`,"aria-disabled":"true",children:[i.jsx("span",{className:"home-card-title",children:l.display_name}),l.tagline?i.jsx("span",{className:"home-card-desc",children:l.tagline}):null,i.jsx("span",{className:"home-card-owner home-card-owner-empty",children:"no admin UI yet"})]})}function y0({module:l}){return i.jsxs("a",{href:"/admin/setup?step=vault",className:"home-card home-card-hub","data-testid":`home-module-${l.short}`,children:[i.jsx("span",{className:"home-card-title",children:l.display_name}),i.jsx("span",{className:"home-card-desc",children:"No vaults yet — create your first vault to start storing notes, tokens, and secrets."}),i.jsx("span",{className:"home-card-owner",children:"create your first vault — opens the setup wizard"})]})}const b0=2e3,x0=12e4;function j0(){const[l,r]=b.useState(null),[c,o]=b.useState({kind:"idle"}),f=b.useRef(null),h=b.useRef(0),g=b.useCallback(async()=>{try{r(await oc())}catch{}},[]);b.useEffect(()=>{g()},[g]),b.useEffect(()=>()=>{f.current&&clearInterval(f.current)},[]);const y=b.useCallback(()=>{f.current&&(clearInterval(f.current),f.current=null)},[]),m=b.useCallback((x,j)=>{h.current=Date.now()+x0,y(),f.current=setInterval(()=>{(async()=>{let _=null,k=null;try{_=await oc()}catch{}try{k=await N1()}catch{}if(_){const C=_.version!==x,O=j!==null&&_.version===j;if(C||O){y(),r(_),o({kind:"succeeded",newVersion:_.version});return}}if((k==null?void 0:k.phase)==="failed"){y(),o({kind:"error",message:k.error??"the hub upgrade failed — check the platform log"});return}if(Date.now()>=h.current){y();const C=(k==null?void 0:k.log.at(-1))??null;o({kind:"timeout",lastLog:C})}})()},b0)},[y]);async function v(){if(!l)return;const x=l.version;o({kind:"starting"});try{const j=await C1();if(j.mode==="redeploy-required"){o({kind:"redeploy-required",targetVersion:j.target_version});return}o({kind:"upgrading",previousVersion:x,targetVersion:j.target_version}),m(x,j.target_version)}catch(j){o({kind:"error",message:j instanceof Error?j.message:String(j)})}}return l?i.jsxs("section",{className:"hub-upgrade-card install-card","data-testid":"hub-upgrade-card",children:[i.jsxs("div",{className:"install-card-body",children:[i.jsxs("h3",{children:["Hub ",i.jsx("span",{className:"muted",children:"(@openparachute/hub)"})]}),i.jsxs("p",{className:"install-card-meta muted",children:["Installed ",i.jsxs("code",{"data-testid":"hub-current-version",children:["v",l.version]})," · source"," ",i.jsx("code",{children:l.source})]}),i.jsx(w0,{state:c})]}),i.jsx("div",{className:"install-card-actions",children:i.jsx(S0,{state:c,onUpgrade:()=>void v()})})]}):null}function S0({state:l,onUpgrade:r}){if(l.kind==="redeploy-required")return i.jsx("span",{className:"muted","data-testid":"hub-redeploy-hint",children:"Redeploy from your platform dashboard"});const c=l.kind==="starting"||l.kind==="upgrading";return i.jsx("button",{type:"button",onClick:r,disabled:c,"data-testid":"hub-upgrade-button",children:c?"Upgrading…":"Upgrade hub"})}function w0({state:l}){switch(l.kind){case"idle":return null;case"starting":return i.jsx("p",{className:"muted","data-testid":"hub-upgrade-state-starting",children:"Starting the hub upgrade…"});case"upgrading":return i.jsxs("p",{className:"muted","data-testid":"hub-upgrade-state-upgrading",children:["Upgrading",l.targetVersion?` to v${l.targetVersion}`:"","… the hub will restart; this page reconnects automatically."]});case"succeeded":return i.jsxs("p",{className:"muted","data-testid":"hub-upgrade-state-success",children:["Upgraded — the hub is now running ",i.jsxs("code",{children:["v",l.newVersion]}),"."]});case"timeout":return i.jsxs("p",{className:"warn-banner","data-testid":"hub-upgrade-state-timeout",children:["The hub may still be coming up — refresh shortly.",l.lastLog?i.jsxs(i.Fragment,{children:[" ",i.jsxs("span",{className:"dim",children:["Last status: ",l.lastLog]})]}):null]});case"redeploy-required":return i.jsxs("p",{className:"warn-banner","data-testid":"hub-upgrade-state-redeploy",children:["This hub is baked into its container image, so an in-place upgrade wouldn't survive a restart."," ",l.targetVersion?i.jsxs(i.Fragment,{children:["Redeploy from your platform dashboard to move to ",i.jsxs("code",{children:["v",l.targetVersion]}),"."]}):i.jsx(i.Fragment,{children:"Redeploy from your platform dashboard to pick up the latest hub."})]});case"error":return i.jsxs("p",{className:"error-banner","data-testid":"hub-upgrade-state-error",children:["Upgrade failed: ",l.message]})}}function C0(){if(typeof navigator>"u")return"other";const l=(navigator.platform||"").toLowerCase();return l.includes("mac")?"darwin":l.includes("linux")?"linux":"other"}function N0(l,r){const c=[];if(l.darwin&&c.push({label:"macOS",command:l.darwin,preferred:r==="darwin"}),l.linux&&c.push({label:"Linux",command:l.linux,preferred:r==="linux"}),l.generic){const o=c.some(f=>f.preferred);c.push({label:"Any platform",command:l.generic,preferred:!o})}return c.sort((o,f)=>Number(f.preferred)-Number(o.preferred))}function E0({command:l}){const[r,c]=b.useState(!1);async function o(){try{await navigator.clipboard.writeText(l),c(!0),setTimeout(()=>c(!1),1500)}catch{}}return i.jsxs("div",{className:"depcard-cmd",children:[i.jsx("pre",{className:"depcard-cmd-text",children:l}),i.jsx("button",{type:"button",className:"btn btn-secondary depcard-copy",onClick:()=>void o(),"aria-label":"Copy install command",children:r?"Copied":"Copy"})]})}function k0({wire:l}){const r=C0(),c=N0(l.install,r);return i.jsxs("div",{className:"depcard","data-testid":"missing-dependency-card",children:[i.jsxs("h3",{className:"depcard-heading",children:[l.binary," isn't installed"]}),l.why?i.jsxs("p",{className:"depcard-why muted",children:["It's needed to ",l.why,"."]}):null,c.length>0?i.jsxs("div",{className:"depcard-installs",children:[i.jsx("p",{className:"depcard-installs-label",children:"Install it:"}),c.map(o=>i.jsxs("div",{className:o.preferred?"depcard-install preferred":"depcard-install",children:[i.jsx("span",{className:"depcard-os",children:o.label}),i.jsx(E0,{command:o.command})]},o.label))]}):null,l.docs_url?i.jsx("p",{className:"depcard-docs",children:i.jsx("a",{href:l.docs_url,target:"_blank",rel:"noreferrer noopener",children:"Documentation"})}):null,l.sysadmin_hint?i.jsx("p",{className:"depcard-hint muted",children:l.sysadmin_hint}):null]})}function T0(l){const{error:r,errorDetail:c}=l;return(c==null?void 0:c.error_type)==="missing_dependency"?i.jsx(k0,{wire:c}):c!=null&&c.error_description?i.jsx("span",{className:"depcard-fallback",children:c.error_description}):r?i.jsx("span",{className:"depcard-fallback",children:r}):null}function _0(l){switch(l){case"running":return"active";case"starting":case"restarting":return"pending";case"crashed":return"failing";case"stopped":case null:case void 0:return"inactive";default:return"inactive"}}function A0(l){if(l==null)return"active";switch(l){case"active":case"pending":case"inactive":case"failing":return l;case"pending-oauth":return"pending";case"disabled":return"inactive";default:return"active"}}const R0=1e3;function M0(){const[l,r]=b.useState({kind:"loading"}),[c,o]=b.useState([]),[f,h]=b.useState({}),[g,y]=b.useState({}),m=b.useCallback(async()=>{try{const E=await Cs();r({kind:"ok",catalog:E})}catch(E){const D=E instanceof Error?E.message:String(E);r({kind:"error",message:D})}},[]);b.useEffect(()=>{m()},[m]);const v=b.useRef(null);b.useEffect(()=>{if(c.length===0){v.current&&(clearInterval(v.current),v.current=null);return}if(!v.current)return v.current=setInterval(()=>{Promise.all(c.map(async E=>{var D;try{const Q=await h1(E.operationId);o(te=>te.map(le=>le.operationId===Q.id?{...le,log:Q.log,status:Q.status,error:Q.error,errorDetail:Q.error_detail}:le)),(Q.status==="succeeded"||Q.status==="failed")&&(Q.status==="failed"&&((D=Q.error_detail)==null?void 0:D.error_type)==="missing_dependency"?m():setTimeout(()=>{o(le=>le.filter(ie=>ie.operationId!==Q.id)),m()},1500))}catch(Q){const te=Q instanceof Error?Q.message:String(Q);o(le=>le.map(ie=>ie.operationId===E.operationId?{...ie,status:"failed",error:te}:ie))}}))},R0),()=>{v.current&&(clearInterval(v.current),v.current=null)}},[c,m]);async function x(E){y(D=>{const Q={...D};return delete Q[E],Q});try{const D=await r1(E);o(Q=>[...Q,{kind:"install",operationId:D,short:E,log:[],status:"pending"}])}catch(D){y(Q=>({...Q,[E]:D instanceof Error?D.message:String(D)}))}}async function j(E){y(D=>{const Q={...D};return delete Q[E],Q});try{const D=await c1(E);o(Q=>[...Q,{kind:"upgrade",operationId:D,short:E,log:[],status:"pending"}])}catch(D){y(Q=>({...Q,[E]:D instanceof Error?D.message:String(D)}))}}async function _(E){if(!f[E]){h(D=>({...D,[E]:!0})),y(D=>{const Q={...D};return delete Q[E],Q});try{await o1(E),await m()}catch(D){y(Q=>({...Q,[E]:D instanceof Error?D.message:String(D)}))}finally{h(D=>({...D,[E]:!1}))}}}async function k(E){if(!f[E]&&window.confirm(`Uninstall ${E}? The container will stop the service, remove the package, and drop its services.json entry. The persistent disk's data dir is left intact.`)){h(D=>({...D,[E]:!0})),y(D=>{const Q={...D};return delete Q[E],Q});try{await d1(E),await m()}catch(D){y(Q=>({...Q,[E]:D instanceof Error?D.message:String(D)}))}finally{h(D=>({...D,[E]:!1}))}}}if(l.kind==="loading")return i.jsx("div",{className:"empty",children:"Loading modules…"});if(l.kind==="error")return l.message.includes("setup_required")?i.jsxs("div",{className:"empty",children:["Hub not yet configured. ",i.jsx("a",{href:"/admin/setup",children:"Finish first-boot setup"})," first."]}):i.jsxs("div",{className:"empty",children:["Failed to load modules: ",l.message,"."," ",i.jsx("button",{type:"button",onClick:()=>void m(),children:"Retry"})]});const C=l.catalog,{modules:O,supervisor_available:L,module_install_channel:z}=C,Z=O.filter(E=>E.installed),X=O.filter(E=>!E.installed&&E.available_to_install),P=new Set(c.filter(E=>E.kind==="install").map(E=>E.short)),K=X.filter(E=>!P.has(E.short));async function J(E){if(E!==z){r({kind:"ok",catalog:{...C,module_install_channel:E}});try{const D=await f1(E);r(Q=>Q.kind==="ok"?{kind:"ok",catalog:{...Q.catalog,module_install_channel:D}}:Q)}catch(D){const Q=D instanceof Error?D.message:String(D);r({kind:"error",message:`Failed to update channel — ${Q}`})}}}return i.jsxs("section",{className:"modules",children:[i.jsx("h1",{children:"Modules"}),i.jsx("p",{className:"muted",children:"Install, upgrade, and manage Parachute modules. Available modules are pinned for the v0.6 release; the marketplace is on the roadmap."}),i.jsx(j0,{}),i.jsx(H0,{channel:z,disabled:!L,onChange:E=>void J(E)}),!L&&i.jsxs("div",{className:"banner banner-info",children:["This hub is running outside container mode (no supervisor wired). Module install / restart / upgrade is available only under ",i.jsx("code",{children:"parachute serve"}),". On-box installs use"," ",i.jsx("code",{children:"parachute install vault"})," etc. from a shell instead."]}),c.length>0&&i.jsxs("div",{className:"banner","data-testid":"pending-ops-banner",children:[i.jsx("strong",{children:"In progress:"}),i.jsx("ul",{children:c.map(E=>i.jsxs("li",{children:[i.jsx("code",{children:E.short})," · ",E.kind," · status: ",E.status,E.status==="failed"&&(E.errorDetail||E.error)?i.jsx("div",{className:"depcard-wrap",children:T0({error:E.error,errorDetail:E.errorDetail})}):null,E.log.length>0&&i.jsxs("details",{children:[i.jsxs("summary",{children:[E.log.length," log line(s)"]}),i.jsx("pre",{children:E.log.join(`
|
|
61
|
+
`)})]})]},E.operationId))})]}),i.jsxs("section",{className:"modules-installed","data-testid":"installed-section",children:[i.jsx("h2",{children:"Installed modules"}),Z.length===0?i.jsxs("p",{className:"muted","data-testid":"installed-empty",children:["No modules installed yet. Pick one from ",i.jsx("strong",{children:"Install a module"})," below to get started."]}):Fh(Z,E=>i.jsx("ul",{className:"module-list",children:E.map(D=>i.jsx(z0,{module:D,supervisorAvailable:L,syncBusy:!!f[D.short],errorMessage:g[D.short],onUpgrade:()=>void j(D.short),onRestart:()=>void _(D.short),onUninstall:()=>void k(D.short)},D.short))}),"installed")]}),i.jsxs("section",{className:"modules-installable","data-testid":"installable-section",children:[i.jsx("h2",{children:"Install a module"}),K.length===0?i.jsx("p",{className:"muted","data-testid":"installable-empty",children:P.size>0?"Install in progress — see In progress above.":"All available modules are installed."}):Fh(K,E=>i.jsx("ul",{className:"install-list",children:E.map(D=>i.jsx(O0,{module:D,supervisorAvailable:L,installing:P.has(D.short),errorMessage:g[D.short],onInstall:()=>void x(D.short)},D.short))}),"installable")]})]})}function Fh(l,r,c){const o=l.filter(g=>g.focus==="core"),f=l.filter(g=>g.focus==="experimental"),h=l.filter(g=>g.focus==="deprecated");return i.jsxs(i.Fragment,{children:[o.length>0&&i.jsx("div",{"data-testid":`${c}-core-group`,children:r(o)}),f.length>0&&i.jsxs("div",{className:"modules-experimental","data-testid":`${c}-experimental-group`,children:[i.jsxs("h3",{className:"muted experimental-heading",children:["Experimental"," ",i.jsx("span",{className:"muted",children:"— exploration modules; not part of the core surface"})]}),r(f)]}),h.length>0&&i.jsxs("div",{className:"modules-deprecated","data-testid":`${c}-deprecated-group`,children:[i.jsxs("h3",{className:"muted deprecated-heading",children:["Deprecated"," ",i.jsx("span",{className:"muted",children:"— retained for existing installs; not offered for new setups"})]}),r(h)]})]})}function z0({module:l,supervisorAvailable:r,syncBusy:c,errorMessage:o,onUpgrade:f,onRestart:h,onUninstall:g}){const y=r&&!c,m=l.upgrade_available,v=l.management_url,x=l.config_ui_url;return i.jsxs("li",{className:"module-row","data-short":l.short,children:[i.jsxs("header",{children:[i.jsxs("h2",{children:[l.display_name," ",i.jsxs("span",{className:"muted",children:["(",l.short,")"]})]}),(()=>{const j=U0(l);return i.jsx("span",{className:`status status-${j.cssState}`,"data-state":j.cssState,"data-testid":`module-status-${l.short}`,children:j.label})})()]}),l.tagline?i.jsx("p",{className:"tagline",children:l.tagline}):null,i.jsxs("dl",{className:"meta",children:[i.jsx("dt",{children:"Package"}),i.jsx("dd",{children:i.jsx("code",{children:l.package})}),i.jsx("dt",{children:"Installed"}),i.jsxs("dd",{children:["v",l.installed_version??"unknown",m&&i.jsxs("span",{className:"badge",children:["v",l.latest_version," available"]})]}),l.pid&&i.jsxs(i.Fragment,{children:[i.jsx("dt",{children:"PID"}),i.jsx("dd",{children:l.pid})]})]}),l.uis.length>0&&i.jsx(D0,{uis:l.uis}),i.jsxs("div",{className:"actions",children:[v?i.jsx("a",{className:"btn",href:v,"data-testid":`open-${l.short}`,children:"Open"}):i.jsx("button",{type:"button",className:"btn",disabled:!0,title:x?"No separate Open surface — use Configure for this module's admin UI.":"This module hasn't shipped an admin UI yet.","data-testid":`open-${l.short}`,children:"Open"}),x?i.jsx("a",{className:"btn",href:x,"data-testid":`configure-${l.short}`,children:"Configure"}):null,i.jsx("button",{type:"button",disabled:!y,onClick:h,children:"Restart"}),i.jsx("button",{type:"button",disabled:!y||!m,onClick:f,children:m?`Upgrade to v${l.latest_version}`:"Up to date"}),i.jsx("button",{type:"button",className:"destructive",disabled:!y,onClick:g,children:"Uninstall"})]}),o&&i.jsx("div",{className:"error",children:o})]})}function O0({module:l,supervisorAvailable:r,installing:c,errorMessage:o,onInstall:f}){const h=r&&!c;return i.jsxs("li",{className:"install-card","data-short":l.short,children:[i.jsxs("div",{className:"install-card-body",children:[i.jsxs("h3",{children:[l.display_name," ",i.jsxs("span",{className:"muted",children:["(",l.short,")"]})]}),l.tagline?i.jsx("p",{className:"tagline",children:l.tagline}):null,i.jsxs("p",{className:"muted install-card-meta",children:[i.jsx("code",{children:l.package}),l.latest_version?i.jsxs(i.Fragment,{children:[" · ","latest ",i.jsxs("code",{children:["v",l.latest_version]})]}):null]})]}),i.jsx("div",{className:"install-card-actions",children:i.jsx("button",{type:"button",disabled:!h,onClick:f,children:c?"Installing…":"Install"})}),o&&i.jsx("div",{className:"error",children:o})]})}function U0(l){if(!l.installed)return{cssState:"absent",label:"not installed"};if(!l.supervisor_status)return{cssState:"absent",label:"not supervised"};const r=_0(l.supervisor_status);return{cssState:r,label:r}}function D0({uis:l}){return i.jsxs("details",{className:"module-uis","data-testid":"module-uis",open:!0,children:[i.jsxs("summary",{children:["Hosted UIs ",i.jsxs("span",{className:"muted",children:["(",l.length,")"]})]}),i.jsx("ul",{className:"ui-sub-units",children:l.map(r=>{const c=A0(r.status);return i.jsxs("li",{className:"ui-sub-unit","data-name":r.name,children:[r.icon_url&&i.jsx("img",{src:r.icon_url,alt:"",className:"ui-icon",width:20,height:20,loading:"lazy"}),i.jsxs("div",{className:"ui-sub-unit-body",children:[i.jsxs("a",{href:r.path,className:"ui-sub-unit-link",children:[i.jsx("strong",{children:r.display_name}),i.jsxs("span",{className:"muted",children:[" · ",r.path]})]}),r.tagline?i.jsx("p",{className:"tagline",children:r.tagline}):null]}),i.jsx("span",{className:`status status-${c}`,"data-state":c,"data-testid":`ui-status-${r.name}`,children:c})]},r.name)})})]})}function H0({channel:l,disabled:r,onChange:c}){return i.jsxs("fieldset",{className:"channel-toggle","data-testid":"channel-toggle",children:[i.jsx("legend",{children:"Install channel"}),i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"module-install-channel",value:"latest",checked:l==="latest",disabled:r,onChange:()=>c("latest")}),"Stable (",i.jsx("code",{children:"latest"}),")"]}),i.jsxs("label",{children:[i.jsx("input",{type:"radio",name:"module-install-channel",value:"rc",checked:l==="rc",disabled:r,onChange:()=>c("rc")}),"Release candidates (",i.jsx("code",{children:"rc"}),")"]}),i.jsxs("p",{className:"muted",children:["All future module installs and upgrades use this channel. Existing installed modules are unaffected — use ",i.jsx("strong",{children:"Upgrade"})," to pull a newer version."]}),i.jsxs("p",{className:"muted",children:["More hub settings (canonical URL, etc.) at ",i.jsx(lt,{to:"/settings",children:"Settings"}),"."]})]})}function B0(){const[l,r]=b.useState({kind:"loading"}),[c,o]=b.useState(""),[f,h]=b.useState(""),[g,y]=b.useState(0),[m,v]=b.useState({kind:"idle"});b.useEffect(()=>{let k=!1;return r({kind:"loading"}),t1(f?{vault:f}:{}).then(O=>{k||r({kind:"ok",grants:O})}).catch(O=>{if(k)return;const L=O instanceof Error?O.message:String(O);r({kind:"error",message:L})}),()=>{k=!0}},[g,f]);function x(k){k.preventDefault(),h(c.trim())}function j(){o(""),h("")}async function _(k){v({kind:"revoking",clientId:k.client_id});try{await a1(k.client_id),v({kind:"idle"}),y(C=>C+1)}catch(C){const O=C instanceof V?`revoke failed (${C.status}): ${C.message}`:C instanceof Error?C.message:String(C);v({kind:"error",clientId:k.client_id,message:O})}}return i.jsxs("div",{"data-route-content":"true",children:[i.jsx("div",{className:"list-header",children:i.jsx("h1",{children:"Permissions"})}),i.jsxs("p",{className:"muted",children:["Apps you've granted OAuth scopes to. Revoking a grant forces the consent screen on the next authorize flow — it does ",i.jsx("em",{children:"not"})," invalidate tokens already issued."]}),i.jsxs("form",{onSubmit:x,style:{marginTop:"1rem",marginBottom:"1rem"},children:[i.jsx("label",{htmlFor:"vault-filter",className:"muted",style:{marginRight:"0.5rem"},children:"Filter by vault:"}),i.jsx("input",{id:"vault-filter",type:"text",value:c,onChange:k=>o(k.target.value),placeholder:"e.g. work",style:{marginRight:"0.5rem"}}),i.jsx("button",{type:"submit",children:"Apply"}),f?i.jsx("button",{type:"button",onClick:j,className:"secondary",style:{marginLeft:"0.5rem"},children:"Clear"}):null]}),L0({state:l,revoke:m,setRevoke:v,onConfirm:_,onRetry:()=>y(k=>k+1)})]})}function L0({state:l,revoke:r,setRevoke:c,onConfirm:o,onRetry:f}){return l.kind==="loading"?i.jsx("p",{className:"muted","data-loading":"true",children:"Loading…"}):l.kind==="error"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"error-banner",children:["Couldn't load grants: ",i.jsx("code",{children:l.message})]}),i.jsx("button",{type:"button",onClick:f,className:"secondary",children:"Retry"})]}):l.grants.length===0?i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No grants."}),i.jsx("p",{className:"muted",children:"When an app asks for OAuth scopes and you approve them, the grant lands here. Revoking it forces the consent screen on the next authorize flow."})]}):i.jsx("div",{style:{marginTop:"1rem"},children:l.grants.map(h=>{const g=r.kind==="revoking"&&r.clientId===h.client_id,y=r.kind==="error"&&r.clientId===h.client_id?r:null,m=r.kind==="confirming"&&r.grant.client_id===h.client_id;return i.jsxs("div",{className:"vault-row",children:[i.jsxs("div",{className:"body",children:[i.jsx("div",{className:"name",children:i.jsx("code",{children:h.client_name??h.client_id})}),i.jsxs("div",{className:"dim",children:[i.jsx("span",{className:"muted",children:"granted "}),i.jsx("code",{title:h.granted_at,children:q0(h.granted_at)})]}),i.jsxs("div",{className:"dim",style:{marginTop:"0.25rem"},children:[i.jsx("span",{className:"muted",children:"scopes: "}),h.scopes.map((v,x)=>i.jsxs("span",{children:[i.jsx("code",{children:v}),x<h.scopes.length-1?" ":null]},v))]}),y?i.jsx("div",{className:"error-banner",style:{marginTop:"0.5rem"},children:i.jsx("code",{children:y.message})}):null,m?i.jsxs("dialog",{open:!0,className:"error-banner",style:{marginTop:"0.5rem",background:"var(--bg-warn, #fffbe6)"},"aria-label":`Confirm revoke ${h.client_name??h.client_id}`,children:[i.jsxs("p",{children:["Revoke ",i.jsx("code",{children:h.client_name??h.client_id}),"? Next OAuth flow for this app will prompt you to consent again."]}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[i.jsx("button",{type:"button",onClick:()=>{o(h)},disabled:g,children:g?"Revoking…":"Revoke"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>c({kind:"idle"}),disabled:g,children:"Cancel"})]})]}):null]}),m?null:i.jsx("button",{type:"button",className:"secondary",onClick:()=>c({kind:"confirming",grant:h}),"aria-label":`Revoke ${h.client_name??h.client_id}`,children:"Revoke"})]},h.client_id)})})}function q0(l){const r=new Date(l);return Number.isNaN(r.getTime())?l:r.toLocaleString()}function Y0(){const[l,r]=b.useState({kind:"loading"}),[c,o]=b.useState(""),[f,h]=b.useState(!1),[g,y]=b.useState(null),m=b.useCallback(async()=>{try{const C=await Cm();r({kind:"ok",setting:C}),o(C.hub_origin??""),y(null)}catch(C){const O=C instanceof Error?C.message:String(C);r({kind:"error",message:O})}},[]);b.useEffect(()=>{m()},[m]);async function v(C){if(C.preventDefault(),f||l.kind!=="ok")return;const O=c.trim(),L=O.length===0?null:O;h(!0),y(null);try{await $h(L),await m()}catch(z){const Z=z instanceof Error?z.message:String(z);y(Z)}finally{h(!1)}}async function x(){if(!f&&l.kind==="ok"){h(!0),y(null);try{await $h(null),await m()}catch(C){const O=C instanceof Error?C.message:String(C);y(O)}finally{h(!1)}}}if(l.kind==="loading")return i.jsx("div",{className:"empty",children:"Loading settings…"});if(l.kind==="error")return i.jsxs("div",{className:"empty",children:["Failed to load settings: ",l.message,"."," ",i.jsx("button",{type:"button",onClick:()=>void m(),children:"Retry"})]});const{setting:j}=l,_=j.hub_origin!==null,k=c.trim()!==(j.hub_origin??"");return i.jsxs("section",{className:"settings",children:[i.jsx("h1",{children:"Hub settings"}),i.jsx("p",{className:"muted",children:"Hub-wide operator controls. Settings here apply to every module + every minted token."}),i.jsxs("section",{className:"settings-block","aria-labelledby":"canonical-hub-url-heading",children:[i.jsx("h2",{id:"canonical-hub-url-heading",children:"Canonical hub URL"}),i.jsxs("dl",{className:"meta","data-testid":"hub-origin-current",children:[i.jsx("dt",{children:"Current value"}),i.jsxs("dd",{children:[i.jsx("code",{children:j.resolved_issuer})," ",i.jsx(V0,{source:j.source,hasStored:_})]})]}),i.jsxs("form",{onSubmit:C=>void v(C),className:"settings-form","data-testid":"hub-origin-form",children:[i.jsxs("label",{htmlFor:"hub-origin-input",children:[i.jsx("span",{children:"Canonical URL"}),i.jsx("input",{id:"hub-origin-input",type:"url",inputMode:"url",placeholder:"https://hub.example.com",value:c,disabled:f,onChange:C=>o(C.target.value),autoComplete:"off",spellCheck:!1})]}),i.jsxs("p",{className:"muted",children:["Set this when you've attached a custom domain. Tokens are minted against this URL — changing it invalidates any tokens already in circulation (the ",i.jsx("code",{children:"iss"})," claim won't match the new issuer on verification). Leave blank to use the request origin (default for Render-assigned URLs)."]}),i.jsxs("div",{className:"actions",children:[i.jsx("button",{type:"submit",disabled:f||!k,children:f?"Saving…":"Save"}),i.jsx("button",{type:"button",className:"destructive",disabled:f||!_,onClick:()=>void x(),children:"Reset to default"})]}),g&&i.jsx("div",{className:"error","data-testid":"hub-origin-save-error",children:g})]})]}),i.jsx(G0,{})]})}function G0(){const[l,r]=b.useState(null),[c,o]=b.useState(null),[f,h]=b.useState(null),[g,y]=b.useState(""),[m,v]=b.useState(""),[x,j]=b.useState(""),[_,k]=b.useState("15"),[C,O]=b.useState(!1),[L,z]=b.useState(null),[Z,X]=b.useState(null),P=b.useCallback(async()=>{try{const[te,le]=await Promise.all([Cc(),wc()]);r(te),o(le.hasSession?le.csrf:null),k(String(Math.round(te.idle_seconds/60))),h(null)}catch(te){h(te instanceof Error?te.message:String(te))}},[]);b.useEffect(()=>{P()},[P]);function K(){const te=Number.parseInt(_,10);if(Number.isFinite(te))return Math.max(1,te)*60}async function J(te){if(te.preventDefault(),!(C||!c)){if(z(null),X(null),!/^[0-9]{4,12}$/.test(g)){z("PIN must be 4–12 digits.");return}if(g!==m){z("PINs don't match.");return}O(!0);try{await _1(c,g,K()),y(""),v(""),X("Screen lock enabled."),await P()}catch(le){z(le instanceof Error?le.message:String(le))}finally{O(!1)}}}async function E(te){if(te.preventDefault(),!(C||!c)){if(z(null),X(null),!/^[0-9]{4,12}$/.test(g)){z("New PIN must be 4–12 digits.");return}if(g!==m){z("PINs don't match.");return}O(!0);try{await A1(c,g,x||void 0,K()),y(""),v(""),j(""),X("PIN updated."),await P()}catch(le){z(le instanceof Error?le.message:String(le))}finally{O(!1)}}}async function D(){if(!(C||!c)){z(null),X(null),O(!0);try{await R1(c,x||void 0),j(""),X("Screen lock disabled."),await P()}catch(te){z(te instanceof Error?te.message:String(te))}finally{O(!1)}}}const Q=(l==null?void 0:l.configured)??!1;return i.jsxs("section",{className:"settings-block","aria-labelledby":"admin-lock-heading","data-testid":"admin-lock-settings",children:[i.jsx("h2",{id:"admin-lock-heading",children:"Admin screen lock"}),i.jsxs("p",{className:"muted",children:["An optional PIN that locks the whole admin console after a period of inactivity — a phone-style lock for a remotely-exposed hub. Off by default; the OAuth flow for your connected apps is never affected. ",i.jsx("strong",{children:"Note:"})," this guards the exposed web portal only — anyone with shell access to the box bypasses it (that's an OS / disk-encryption concern)."]}),f?i.jsxs("div",{className:"error","data-testid":"admin-lock-load-error",children:["Failed to load lock status: ",f,"."," ",i.jsx("button",{type:"button",onClick:()=>void P(),children:"Retry"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{children:["Status:"," ",i.jsx("span",{className:`lock-status-pill ${Q?"lock-status-on":"lock-status-off"}`,"data-testid":"admin-lock-status-pill",children:Q?"Enabled":"Off"})]}),Q?i.jsxs("form",{onSubmit:te=>void E(te),className:"lock-settings-form",children:[i.jsxs("label",{children:["Current PIN",i.jsx("input",{type:"password",inputMode:"numeric",autoComplete:"off",value:x,disabled:C,onChange:te=>j(te.target.value.replace(/[^0-9]/g,"")),"data-testid":"admin-lock-current-pin"})]}),i.jsxs("label",{children:["New PIN (4–12 digits)",i.jsx("input",{type:"password",inputMode:"numeric",autoComplete:"off",value:g,disabled:C,onChange:te=>y(te.target.value.replace(/[^0-9]/g,"")),"data-testid":"admin-lock-new-pin"})]}),i.jsxs("label",{children:["Confirm new PIN",i.jsx("input",{type:"password",inputMode:"numeric",autoComplete:"off",value:m,disabled:C,onChange:te=>v(te.target.value.replace(/[^0-9]/g,"")),"data-testid":"admin-lock-new-pin2"})]}),i.jsxs("label",{children:["Lock after (minutes idle)",i.jsx("input",{type:"number",min:1,max:1440,value:_,disabled:C,onChange:te=>k(te.target.value),"data-testid":"admin-lock-idle"})]}),i.jsxs("div",{className:"actions",children:[i.jsx("button",{type:"submit",disabled:C,"data-testid":"admin-lock-change",children:C?"Saving…":"Update PIN"}),i.jsx("button",{type:"button",className:"destructive",disabled:C,onClick:()=>void D(),"data-testid":"admin-lock-remove",children:"Remove lock"})]})]}):i.jsxs("form",{onSubmit:te=>void J(te),className:"lock-settings-form",children:[i.jsxs("label",{children:["PIN (4–12 digits)",i.jsx("input",{type:"password",inputMode:"numeric",autoComplete:"off",value:g,disabled:C,onChange:te=>y(te.target.value.replace(/[^0-9]/g,"")),"data-testid":"admin-lock-set-pin"})]}),i.jsxs("label",{children:["Confirm PIN",i.jsx("input",{type:"password",inputMode:"numeric",autoComplete:"off",value:m,disabled:C,onChange:te=>v(te.target.value.replace(/[^0-9]/g,"")),"data-testid":"admin-lock-set-pin2"})]}),i.jsxs("label",{children:["Lock after (minutes idle)",i.jsx("input",{type:"number",min:1,max:1440,value:_,disabled:C,onChange:te=>k(te.target.value),"data-testid":"admin-lock-idle"})]}),i.jsx("div",{className:"actions",children:i.jsx("button",{type:"submit",disabled:C,"data-testid":"admin-lock-enable",children:C?"Saving…":"Enable screen lock"})})]}),L&&i.jsx("div",{className:"error","data-testid":"admin-lock-form-error",children:L}),Z&&i.jsx("p",{className:"muted","data-testid":"admin-lock-notice",children:Z})]})]})}function V0({source:l,hasStored:r}){return l==="settings"?i.jsx("span",{className:"badge badge-info","data-testid":"hub-origin-source",children:"from settings"}):l==="env"?i.jsxs("span",{className:"badge badge-info","data-testid":"hub-origin-source",children:["from env var ",i.jsx("code",{children:"PARACHUTE_HUB_ORIGIN"})]}):l==="expose"?i.jsxs("span",{className:"badge badge-info","data-testid":"hub-origin-source",children:["from your ",i.jsx("code",{children:"parachute expose"})," config"]}):i.jsx("span",{className:"badge badge-info","data-testid":"hub-origin-source",children:"from request origin"})}const lc={scope:"",audience:"",expiresIn:"",subject:"",permissions:""};function Z0(){const[l,r]=bm(),c=$0(l.get("status")),o=J0(l.get("source")),[f,h]=b.useState({kind:"loading"}),[g,y]=b.useState(0),[m,v]=b.useState({kind:"idle"}),[x,j]=b.useState(lc),[_,k]=b.useState({kind:"idle"}),[C,O]=b.useState(!1),[L,z]=b.useState(!1);function Z(E,D){r(Q=>{const te=new URLSearchParams(Q);return D==="all"?te.delete(E):te.set(E,D),te},{replace:!0})}b.useEffect(()=>{let E=!1;return h({kind:"loading"}),Qh(Wh(c,o)).then(D=>{E||h({kind:"ok",tokens:D.tokens,nextCursor:D.next_cursor})}).catch(D=>{if(E)return;const Q=D instanceof Error?D.message:String(D);h({kind:"error",message:Q})}),()=>{E=!0}},[g,c,o]);async function X(){if(f.kind!=="ok"||!f.nextCursor||L)return;const E={...Wh(c,o),cursor:f.nextCursor};z(!0);try{const D=await Qh(E);h({kind:"ok",tokens:[...f.tokens,...D.tokens],nextCursor:D.next_cursor})}catch(D){const Q=D instanceof Error?D.message:String(D);h({kind:"error",message:Q})}finally{z(!1)}}async function P(E){E.preventDefault();const D=x.scope.trim();if(D.length===0){v({kind:"error",message:"scope is required"});return}let Q;if(x.permissions.trim().length>0)try{const le=JSON.parse(x.permissions);if(le===null||typeof le!="object"||Array.isArray(le)){v({kind:"error",message:'permissions must be a JSON object (e.g. {"vault":{"default":...}})'});return}Q=le}catch(le){const ie=le instanceof Error?le.message:String(le);v({kind:"error",message:`permissions is not valid JSON — ${ie}`});return}let te;if(x.expiresIn.trim().length>0){const le=Number(x.expiresIn);if(!Number.isInteger(le)||le<=0){v({kind:"error",message:"expires_in must be a positive integer (seconds)"});return}te=le}v({kind:"submitting"});try{const le=await wm({scope:D,...x.audience.trim()?{audience:x.audience.trim()}:{},...te!==void 0?{expires_in:te}:{},...x.subject.trim()?{subject:x.subject.trim()}:{},...Q?{permissions:Q}:{}});v({kind:"minted",token:le}),j(lc),O(!1),y(ie=>ie+1)}catch(le){const ie=le instanceof V?`mint failed (${le.status}): ${le.message}`:le instanceof Error?le.message:String(le);v({kind:"error",message:ie})}}async function K(E){k({kind:"revoking",jti:E});try{await i1(E),k({kind:"idle"}),y(D=>D+1)}catch(D){const Q=D instanceof V?`revoke failed (${D.status}): ${D.message}`:D instanceof Error?D.message:String(D);k({kind:"error",jti:E,message:Q})}}function J(E){typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(E)}return i.jsxs("div",{children:[i.jsxs("div",{className:"list-header",children:[i.jsx("h1",{children:"Tokens"}),i.jsx("button",{type:"button",onClick:()=>O(E=>!E),children:C?"Hide form":"Mint new token"})]}),i.jsxs("p",{className:"muted",children:["The hub's token registry. Every CLI / OAuth / operator-mint writes a row here. Revoking flips ",i.jsx("code",{children:"revoked_at"}),"; resource servers on"," ",i.jsx("code",{children:"@openparachute/scope-guard@^0.2.0"})," reject within ~60s of the next poll."]}),m.kind==="minted"?i.jsxs("div",{className:"mint-banner",children:[i.jsx("h3",{children:"Minted"}),i.jsxs("p",{children:["Your new access token (jti: ",i.jsx("code",{children:m.token.jti}),"):"]}),i.jsx("div",{className:"token-box",children:i.jsx("code",{children:m.token.token})}),i.jsx("p",{className:"warn",children:"This is the only time the JWT is shown. Copy it now — there is no DB-side recovery."}),i.jsxs("div",{className:"actions",children:[i.jsx("button",{type:"button",onClick:()=>J(m.token.token),children:"Copy"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>v({kind:"idle"}),children:"Dismiss"})]})]}):null,C?i.jsx("div",{className:"section",children:i.jsxs("form",{onSubmit:P,children:[i.jsxs("div",{className:"row",children:[i.jsx("label",{htmlFor:"mint-scope",children:"Scope (space-separated)"}),i.jsx("input",{id:"mint-scope",type:"text",value:x.scope,onChange:E=>j({...x,scope:E.target.value}),placeholder:"e.g. scribe:transcribe vault:default:read",required:!0}),i.jsxs("div",{className:"field-hint",children:["Space-separated ",i.jsx("code",{children:"resource:verb"})," or ",i.jsx("code",{children:"resource:name:verb"})," ","tuples. The hub rejects non-requestable scopes (admin, host:*) per the privilege-diffusion guard."]})]}),i.jsxs("div",{className:"row",children:[i.jsx("label",{htmlFor:"mint-audience",children:"Audience (optional)"}),i.jsx("input",{id:"mint-audience",type:"text",value:x.audience,onChange:E=>j({...x,audience:E.target.value}),placeholder:"inferred from scope when blank"}),i.jsxs("div",{className:"field-hint",children:["Inferred from scope if omitted. ",i.jsx("code",{children:"vault:<name>:<verb>"})," →"," ",i.jsx("code",{children:"vault.<name>"}),"; otherwise the first colon-prefixed scope's namespace; fallback ",i.jsx("code",{children:"hub"}),"."]})]}),i.jsxs("div",{className:"row",children:[i.jsx("label",{htmlFor:"mint-expires-in",children:"Expires in (seconds, optional)"}),i.jsx("input",{id:"mint-expires-in",type:"text",inputMode:"numeric",value:x.expiresIn,onChange:E=>j({...x,expiresIn:E.target.value}),placeholder:"default 90d (7776000)"})]}),i.jsxs("div",{className:"row",children:[i.jsx("label",{htmlFor:"mint-subject",children:"Subject (optional)"}),i.jsx("input",{id:"mint-subject",type:"text",value:x.subject,onChange:E=>j({...x,subject:E.target.value}),placeholder:"defaults to operator's sub"})]}),i.jsxs("div",{className:"row",children:[i.jsx("label",{htmlFor:"mint-permissions",children:"Permissions (JSON object, optional)"}),i.jsx("textarea",{id:"mint-permissions",value:x.permissions,onChange:E=>j({...x,permissions:E.target.value}),placeholder:'e.g. {"vault":{"default":{"write_tags":["health"]}}}',rows:3,style:{width:"100%",fontFamily:"monospace",fontSize:"0.9rem"}})]}),m.kind==="error"?i.jsx("div",{className:"field-error",children:i.jsx("code",{children:m.message})}):null,i.jsxs("div",{className:"actions",children:[i.jsx("button",{type:"submit",disabled:m.kind==="submitting",children:m.kind==="submitting"?"Minting…":"Mint"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>{O(!1),j(lc),v({kind:"idle"})},children:"Cancel"})]})]})}):null,i.jsxs("div",{style:{marginTop:"1rem",marginBottom:"0.5rem",display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[i.jsx("span",{className:"muted",style:{marginRight:"0.5rem",minWidth:"4rem"},children:"Status:"}),[{value:"all",label:"Show all"},{value:"live",label:"Live only"},{value:"revoked",label:"Revoked only"}].map(E=>i.jsx("button",{type:"button",onClick:()=>Z("status",E.value),className:c===E.value?void 0:"secondary","aria-pressed":c===E.value,children:E.label},E.value))]}),i.jsxs("div",{style:{marginBottom:"1rem",display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[i.jsx("span",{className:"muted",style:{marginRight:"0.5rem",minWidth:"4rem"},children:"Source:"}),[{value:"all",label:"All sources"},{value:"oauth_refresh",label:"OAuth"},{value:"operator_mint",label:"Operator"},{value:"cli_mint",label:"CLI mint"}].map(E=>i.jsx("button",{type:"button",onClick:()=>Z("source",E.value),className:o===E.value?void 0:"secondary","aria-pressed":o===E.value,children:E.label},E.value))]}),X0({list:f,revoke:_,setRevoke:k,onConfirm:K,onLoadMore:X,onRetry:()=>y(E=>E+1),loadingMore:L,filtersActive:c!=="all"||o!=="all"})]})}function X0({list:l,revoke:r,setRevoke:c,onConfirm:o,onLoadMore:f,onRetry:h,loadingMore:g,filtersActive:y}){return l.kind==="loading"?i.jsx("p",{className:"muted","data-loading":"true",children:"Loading…"}):l.kind==="error"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"error-banner",children:["Couldn't load tokens: ",i.jsx("code",{children:l.message})]}),i.jsx("button",{type:"button",onClick:h,className:"secondary",children:"Retry"})]}):l.tokens.length===0?y?i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No tokens match the current filter."}),i.jsx("p",{className:"muted",children:'Try widening the Status or Source pills above. The default "Show all / All sources" view shows every registry row.'})]}):i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No tokens."}),i.jsxs("p",{className:"muted",children:["Every CLI mint, OAuth grant, and operator-token rotation lands here. Mint one with the form above, or via ",i.jsx("code",{children:"parachute auth mint-token"}),"."]})]}):i.jsxs("div",{"data-route-content":"true",children:[l.tokens.map(m=>{const v=Q0(m),x=r.kind==="revoking"&&r.jti===m.jti,j=r.kind==="confirming"&&r.jti===m.jti,_=r.kind==="error"&&r.jti===m.jti?r:null,k=m.user_id??m.subject??"(unknown)";return i.jsxs("div",{className:"vault-row",children:[i.jsxs("div",{className:"body",children:[i.jsxs("div",{className:"name",children:[i.jsx("code",{title:m.jti,children:ms(m.jti)}),i.jsx("span",{className:`tag${v==="live"?"":" muted"}`,children:v}),i.jsx("span",{className:`tag source-${F0(m.created_via)}`,title:`created_via: ${m.created_via}`,children:K0(m.created_via)})]}),i.jsxs("div",{className:"dim",style:{marginTop:"0.25rem"},children:[i.jsx("span",{className:"muted",children:"identity: "}),i.jsx("code",{children:k}),m.client_id?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"muted",children:" · client: "}),i.jsx("code",{children:m.client_id})]}):null]}),i.jsxs("div",{className:"dim",style:{marginTop:"0.25rem"},children:[i.jsx("span",{className:"muted",children:"scope: "}),m.scopes.map((C,O)=>i.jsxs("span",{children:[i.jsx("code",{children:C}),O<m.scopes.length-1?" ":null]},C))]}),i.jsxs("div",{className:"dim",style:{marginTop:"0.25rem",fontSize:"0.82rem"},children:[i.jsx("span",{className:"muted",children:"created "}),i.jsx("code",{title:m.created_at,children:ic(m.created_at)}),i.jsx("span",{className:"muted",children:" · expires "}),i.jsx("code",{title:m.expires_at,children:ic(m.expires_at)}),m.revoked_at?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"muted",children:" · revoked "}),i.jsx("code",{title:m.revoked_at,children:ic(m.revoked_at)})]}):null]}),m.permissions?i.jsxs("details",{style:{marginTop:"0.35rem"},children:[i.jsx("summary",{className:"muted",style:{cursor:"pointer",fontSize:"0.85rem"},children:"permissions"}),i.jsx("pre",{style:{fontSize:"0.82rem",marginTop:"0.25rem"},children:JSON.stringify(m.permissions,null,2)})]}):null,_?i.jsx("div",{className:"error-banner",style:{marginTop:"0.5rem"},children:i.jsx("code",{children:_.message})}):null,j?i.jsxs("dialog",{open:!0,className:"error-banner",style:{marginTop:"0.5rem",background:"var(--bg-warn, #fffbe6)"},"aria-label":`Confirm revoke ${ms(m.jti)}`,children:[i.jsxs("p",{children:["Revoke ",i.jsx("code",{children:ms(m.jti)}),"? Resource servers reject within ~60s of the next revocation-list poll. This cannot be undone."]}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[i.jsx("button",{type:"button",onClick:()=>{o(m.jti)},disabled:x,children:x?"Revoking…":"Revoke"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>c({kind:"idle"}),disabled:x,children:"Cancel"})]})]}):null]}),!j&&v==="live"?i.jsx("button",{type:"button",className:"secondary",onClick:()=>c({kind:"confirming",jti:m.jti}),"aria-label":`Revoke ${ms(m.jti)}`,children:"Revoke"}):null]},m.jti)}),l.nextCursor?i.jsx("div",{style:{marginTop:"1rem"},children:i.jsx("button",{type:"button",className:"secondary",disabled:g,onClick:()=>{f()},children:g?"Loading…":"Load more"})}):null]})}function Q0(l){if(l.revoked_at)return"revoked";const r=new Date(l.expires_at).getTime();return!Number.isNaN(r)&&r<Date.now()?"expired":"live"}function $0(l){return l==="live"||l==="revoked"||l==="all"?l:"all"}function J0(l){return l==="oauth_refresh"||l==="operator_mint"||l==="cli_mint"||l==="all"?l:"all"}function Wh(l,r){const c={};return l==="live"?c.revoked="false":l==="revoked"?c.revoked="true":c.revoked="all",r!=="all"&&(c.createdVia=r),c}function K0(l){switch(l){case"oauth_refresh":return"OAuth";case"operator_mint":return"Operator";case"cli_mint":return"CLI";default:return l}}function F0(l){switch(l){case"oauth_refresh":return"oauth";case"operator_mint":return"operator";case"cli_mint":return"cli";default:return"unknown"}}function ms(l){return l.length<=14?l:`${l.slice(0,8)}…${l.slice(-4)}`}function ic(l){const r=new Date(l);return Number.isNaN(r.getTime())?l:r.toLocaleString()}const W0=1440*60;function I0(l){return l.provision_vault?"owner (new vault)":l.vault_name===null?"account only":l.role==="read"?"read-only (shared)":"read & write (shared)"}function Ih(l){const r=l.username!==null?`an account for "${l.username}"`:"an account (they pick the username)";if(l.provision_vault){const o=l.vault_name!==null?`their own new vault "${l.vault_name}"`:"their own new vault (they name it)";return`Creates ${r} + ${o}, as owner.`}if(l.vault_name===null)return`Creates ${r} with no vault access yet.`;const c=l.role==="read"?"read-only":"read & write";return`Creates ${r} with ${c} access to your existing vault "${l.vault_name}".`}function P0(l,r,c){const o=l.username!==null?` Your username will be "${l.username}".`:"",f=l.provision_vault?l.vault_name!==null?` You'll get your own new vault ("${l.vault_name}").`:" You'll get your own new vault.":l.vault_name!==null?` You'll get ${l.role==="read"?"read-only":"read & write"} access to the vault "${l.vault_name}".`:"",h=new Date(c).toLocaleDateString();return`You're invited to my Parachute. Open this link to set your password and claim your account.${o}${f} The link works once and expires ${h}: ${r}`}function eb({hubOrigin:l}){const[r,c]=b.useState({kind:"loading"}),[o,f]=b.useState(0),[h,g]=b.useState(""),[y,m]=b.useState("provision"),[v,x]=b.useState(""),[j,_]=b.useState(""),[k,C]=b.useState("read"),[O,L]=b.useState([]),[z,Z]=b.useState("7"),[X,P]=b.useState({kind:"idle"}),[K,J]=b.useState(null),[E,D]=b.useState(null),Q={username:h.trim()!==""?h.trim():null,vault_name:y==="share"?j!==""?j:null:v.trim()!==""?v.trim():null,role:y==="share"?k:"write",provision_vault:y==="provision"};b.useEffect(()=>{let W=!1;return c({kind:"loading"}),Promise.all([j1(),Nm()]).then(([ge,be])=>{W||(c({kind:"ok",invites:ge}),L(be))}).catch(ge=>{W||c({kind:"error",message:ge instanceof Error?ge.message:String(ge)})}),()=>{W=!0}},[o]);async function te(W){if(W.preventDefault(),X.kind==="submitting")return;if(y==="share"&&j===""){P({kind:"error",message:"Pick which existing vault to share before creating the invite."});return}P({kind:"submitting"}),J(null);const ge=Number.parseInt(z,10),be={...h.trim()!==""?{username:h.trim()}:{},...Number.isFinite(ge)&&ge>0?{expires_in:ge*W0}:{},...y==="share"?{vault_name:j,provision_vault:!1,role:k}:{...v.trim()!==""?{vault_name:v.trim()}:{},provision_vault:!0}};try{const H=await S1(be);P({kind:"created",result:H}),g(""),x(""),_(""),f(F=>F+1)}catch(H){P({kind:"error",message:H instanceof Error?H.message:String(H)})}}async function le(W){if(!E){D(W);try{await w1(W),f(ge=>ge+1)}catch(ge){c({kind:"error",message:ge instanceof Error?ge.message:String(ge)})}finally{D(null)}}}function ie(W,ge){var be;(be=navigator.clipboard)==null||be.writeText(W).then(()=>{J(ge),setTimeout(()=>J(null),2e3)})}return i.jsxs("section",{style:{marginTop:"2rem"},"data-testid":"invites-section",children:[i.jsx("div",{className:"list-header",children:i.jsx("h2",{children:"Invite links"})}),i.jsx("p",{className:"muted",children:"Generate a one-time, expiring link. The recipient opens it and picks their password — no admin-typed default password. Either provision them a new vault of their own, or share an existing vault read-only or read & write. Pre-naming the username makes the link a named deliverable (the recipient can't change it)."}),i.jsxs("form",{onSubmit:W=>void te(W),style:{marginBottom:"1rem"},children:[i.jsxs("div",{style:{display:"flex",gap:"0.75rem",flexWrap:"wrap",alignItems:"flex-end"},children:[i.jsxs("label",{className:"field",style:{flex:"1 1 10rem"},children:[i.jsx("span",{className:"field-label",children:"Username (optional)"}),i.jsx("input",{type:"text",value:h,onChange:W=>g(W.target.value),placeholder:"leave blank → they choose",pattern:"[a-z0-9_-]*",minLength:2,maxLength:32,autoComplete:"off",spellCheck:!1})]}),i.jsxs("label",{className:"field",style:{flex:"0 0 14rem"},children:[i.jsx("span",{className:"field-label",children:"Vault access"}),i.jsxs("select",{value:y,onChange:W=>m(W.target.value==="share"?"share":"provision"),children:[i.jsx("option",{value:"provision",children:"Create a new vault for them"}),i.jsx("option",{value:"share",children:"Share an existing vault"})]})]}),y==="provision"?i.jsxs("label",{className:"field",style:{flex:"1 1 12rem"},children:[i.jsx("span",{className:"field-label",children:"New vault name (optional)"}),i.jsx("input",{type:"text",value:v,onChange:W=>x(W.target.value),placeholder:"leave blank → they choose",pattern:"[a-z0-9_-]*",autoComplete:"off",spellCheck:!1})]}):i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"field",style:{flex:"1 1 10rem"},children:[i.jsx("span",{className:"field-label",children:"Vault"}),i.jsxs("select",{value:j,onChange:W=>_(W.target.value),required:!0,children:[i.jsx("option",{value:"",children:"Pick a vault…"}),O.map(W=>i.jsx("option",{value:W,children:W},W))]})]}),i.jsxs("label",{className:"field",style:{flex:"0 0 9rem"},children:[i.jsx("span",{className:"field-label",children:"Role"}),i.jsxs("select",{value:k,onChange:W=>C(W.target.value==="write"?"write":"read"),children:[i.jsx("option",{value:"read",children:"Read-only"}),i.jsx("option",{value:"write",children:"Read & write"})]})]})]}),i.jsxs("label",{className:"field",style:{flex:"0 0 8rem"},children:[i.jsx("span",{className:"field-label",children:"Expires (days)"}),i.jsx("input",{type:"number",min:1,max:90,value:z,onChange:W=>Z(W.target.value)})]}),i.jsx("button",{type:"submit",disabled:X.kind==="submitting",children:X.kind==="submitting"?"Creating…":"Create invite"})]}),i.jsx("p",{className:"muted",style:{marginTop:"0.5rem"},"data-testid":"invite-preview",children:y==="share"&&j===""?"Pick the existing vault to share to finish configuring this link.":Ih(Q)})]}),X.kind==="error"&&i.jsx("div",{className:"error-banner",style:{marginBottom:"1rem"},children:X.message}),X.kind==="created"&&i.jsxs("output",{className:"success-banner",style:{display:"block",marginBottom:"1rem"},children:[i.jsx("strong",{children:"Invite created."})," ",Ih(X.result.invite),i.jsx("br",{}),`Copy it now — the link is shown only once and can't be retrieved later (the hub stores only a hash). "Copy message" includes a ready-to-send note telling the recipient what the link does.`,i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem",alignItems:"center",flexWrap:"wrap"},children:[i.jsx("code",{style:{wordBreak:"break-all",flex:"1 1 16rem"},children:X.result.url}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>ie(X.result.url,"link"),children:K==="link"?"Copied!":"Copy link"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>ie(P0(X.result.invite,X.result.url,X.result.invite.expires_at),"message"),children:K==="message"?"Copied!":"Copy message"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>P({kind:"idle"}),children:"Dismiss"})]})]}),r.kind==="loading"&&i.jsx("p",{className:"muted",children:"Loading invites…"}),r.kind==="error"&&i.jsxs("div",{className:"error-banner",children:[r.message,i.jsx("div",{style:{marginTop:"0.5rem"},children:i.jsx("button",{type:"button",className:"secondary",onClick:()=>f(W=>W+1),children:"Retry"})})]}),r.kind==="ok"&&r.invites.length===0&&i.jsx("p",{className:"muted",children:"No invites yet."}),r.kind==="ok"&&r.invites.length>0&&i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{className:"user-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"For"}),i.jsx("th",{children:"Vault"}),i.jsx("th",{children:"Access"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Expires"}),i.jsx("th",{children:"Created"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:r.invites.map(W=>i.jsxs("tr",{children:[i.jsx("td",{children:W.username??i.jsx("span",{className:"muted",children:"they choose"})}),i.jsx("td",{children:W.vault_name??i.jsx("span",{className:"muted",children:"redeemer chooses"})}),i.jsx("td",{children:I0(W)}),i.jsx("td",{children:i.jsx("span",{className:`status status-${W.status}`,children:W.status})}),i.jsx("td",{className:"muted",children:new Date(W.expires_at).toLocaleDateString()}),i.jsx("td",{className:"muted",children:new Date(W.created_at).toLocaleDateString()}),i.jsx("td",{children:W.status==="pending"?i.jsx("button",{type:"button",className:"secondary",disabled:E===W.id,onClick:()=>void le(W.id),children:E===W.id?"Revoking…":"Revoke"}):null})]},W.id))})]})}),l?i.jsxs("p",{className:"muted",style:{marginTop:"0.5rem",fontSize:"0.85em"},children:["Redemption links are served from ",i.jsxs("code",{children:[l,"/account/setup/<token>"]}),"."]}):null]})}const Ba=12,tb=/^[a-z0-9_-]+$/,bs=2,xs=32,Ph={username:"",password:"",assignedVaults:[]};function _m({username:l,hubOrigin:r}){const c=`${r||""}/login`;return i.jsxs("div",{className:"muted",style:{marginTop:"0.5rem",fontSize:"0.9em"},children:["Send them to ",i.jsx("code",{children:c})," with username ",i.jsx("code",{children:l})," and this password — they'll be prompted to set a new one on first sign-in."]})}function ab(){const[l,r]=b.useState({kind:"loading"}),[c,o]=b.useState(0),[f,h]=b.useState(!1),[g,y]=b.useState(Ph),[m,v]=b.useState({kind:"idle"}),[x,j]=b.useState({kind:"idle"}),[_,k]=b.useState({kind:"idle"}),[C,O]=b.useState({kind:"idle"});b.useEffect(()=>{let K=!1;return r({kind:"loading"}),Promise.all([m1(),Nm(),Cm()]).then(([J,E,D])=>{if(K)return;const Q=D.resolved_issuer.replace(/\/+$/,"");r({kind:"ok",data:{users:J,vaults:E,hubOrigin:Q}})}).catch(J=>{if(K)return;const E=J instanceof Error?J.message:String(J);r({kind:"error",message:E})}),()=>{K=!0}},[c]);function L(K){return K.username.length<bs||K.username.length>xs?`Username must be ${bs}-${xs} characters.`:tb.test(K.username)?K.password.length<Ba?`Password must be at least ${Ba} characters.`:null:"Username may only contain lowercase letters, digits, hyphens, and underscores."}async function z(K){K.preventDefault();const J=L(g);if(J){v({kind:"error",message:J});return}v({kind:"submitting"});const E={username:g.username,password:g.password,assignedVaults:g.assignedVaults};try{const D=await p1(E);y(Ph),v({kind:"created",username:D.username}),o(Q=>Q+1)}catch(D){const Q=D instanceof V?`Create failed (${D.status}): ${D.message}`:D instanceof Error?D.message:String(D);v({kind:"error",message:Q})}}async function Z(K){j({kind:"deleting",userId:K.id});try{const{revocationLagSeconds:J}=await g1(K.id);j({kind:"done",username:K.username,revocationLagSeconds:J}),o(E=>E+1)}catch(J){const E=J instanceof V?`Delete failed (${J.status}): ${J.message}`:J instanceof Error?J.message:String(J);j({kind:"error",userId:K.id,message:E})}}async function X(K,J){O({kind:"submitting",userId:K.id,selected:J});try{await y1(K.id,J),O({kind:"done",userId:K.id,username:K.username}),o(E=>E+1)}catch(E){const D=E instanceof V?`Edit vaults failed (${E.status}): ${E.message}`:E instanceof Error?E.message:String(E);O({kind:"error",userId:K.id,selected:J,message:D})}}async function P(K,J){if(J.length<Ba){k({kind:"error",userId:K.id,password:J,message:`Password must be at least ${Ba} characters.`});return}k({kind:"submitting",userId:K.id,password:J});try{const{revocationLagSeconds:E}=await v1(K.id,J);k({kind:"done",userId:K.id,username:K.username,revocationLagSeconds:E}),o(D=>D+1)}catch(E){const D=E instanceof V?`Reset failed (${E.status}): ${E.message}`:E instanceof Error?E.message:String(E);k({kind:"error",userId:K.id,password:J,message:D})}}return i.jsxs("div",{"data-route-content":"true",children:[i.jsx("div",{className:"list-header",children:i.jsx("h1",{children:"Users"})}),i.jsxs("p",{className:"muted",children:["Hub user accounts. Each user can be a member of one or more vaults — the OAuth issuer narrows their tokens to ",i.jsx("code",{children:"vault:<assigned>:*"})," scopes for any vault in their list. Users with no assignments can't authorize any vault yet — assign at least one above. The first admin is unrestricted (admin posture). Admin-created users land with a default password and are prompted to change it on first sign-in",l.kind==="ok"?i.jsxs(i.Fragment,{children:[" ","at ",i.jsxs("code",{children:[l.data.hubOrigin,"/login"]})]}):null,"."]}),x.kind==="done"&&i.jsxs("output",{className:"success-banner",style:{display:"block",marginBottom:"0.75rem"},"data-testid":"delete-done-banner",children:["Deleted ",i.jsx("code",{children:x.username}),". Their tokens are revoked. Resource servers (vault, scribe, etc.) cache the revocation list for up to ",x.revocationLagSeconds," ","seconds — if you're deleting because of a suspected compromise, also restart the affected services (e.g. ",i.jsx("code",{children:"parachute restart vault"}),") to flush their cache immediately.",i.jsx("div",{style:{marginTop:"0.5rem"},children:i.jsx("button",{type:"button",className:"secondary",onClick:()=>j({kind:"idle"}),children:"Dismiss"})})]}),nb(l,x,j,Z,_,k,P,C,O,X,l.kind==="ok"?l.data.vaults:[],l.kind==="ok"?l.data.hubOrigin:"",()=>o(K=>K+1)),l.kind==="ok"&&i.jsx(ub,{show:f,setShow:h,form:g,setForm:y,vaults:l.data.vaults,hubOrigin:l.data.hubOrigin,createState:m,setCreateState:v,onSubmit:z}),l.kind==="ok"&&i.jsx(eb,{hubOrigin:l.data.hubOrigin}),l.kind==="ok"&&i.jsx(cb,{})]})}function nb(l,r,c,o,f,h,g,y,m,v,x,j,_){var O;if(l.kind==="loading")return i.jsx("p",{className:"muted",children:"Loading users…"});if(l.kind==="error")return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"error-banner",children:["Couldn't load users: ",i.jsx("code",{children:l.message})]}),i.jsx("button",{type:"button",onClick:_,className:"secondary",children:"Retry"})]});const{users:k}=l.data;if(k.length===0)return i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No users yet."}),i.jsx("p",{className:"muted",children:"Click Create User below to invite someone."})]});const C=(O=k[0])==null?void 0:O.id;return i.jsx(lb,{users:k,firstAdminId:C,deleteSt:r,setDeleteSt:c,onConfirmDelete:o,resetSt:f,setResetSt:h,onSubmitReset:g,editVaultsSt:y,setEditVaultsSt:m,onSubmitEditVaults:v,availableVaults:x,hubOrigin:j})}function lb({users:l,firstAdminId:r,deleteSt:c,setDeleteSt:o,onConfirmDelete:f,resetSt:h,setResetSt:g,onSubmitReset:y,editVaultsSt:m,setEditVaultsSt:v,onSubmitEditVaults:x,availableVaults:j,hubOrigin:_}){return i.jsx("div",{className:"user-list",style:{marginTop:"1rem"},children:i.jsx("div",{className:"table-scroll",children:i.jsxs("table",{className:"user-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",children:"Username"}),i.jsx("th",{scope:"col",children:"Email"}),i.jsx("th",{scope:"col",children:"Role"}),i.jsx("th",{scope:"col",children:"Assigned vaults"}),i.jsx("th",{scope:"col",children:"Password set"}),i.jsx("th",{scope:"col",children:"Created"}),i.jsx("th",{scope:"col",children:"Actions"})]})}),i.jsx("tbody",{children:l.map(k=>{const C=k.id===r,O=c.kind==="deleting"&&c.userId===k.id,L=c.kind==="confirming"&&c.user.id===k.id,z=c.kind==="error"&&c.userId===k.id?c:null,Z=(h.kind==="open"||h.kind==="submitting"||h.kind==="error")&&h.userId===k.id?h:null,X=h.kind==="done"&&h.userId===k.id?h:null,P=(m.kind==="open"||m.kind==="submitting"||m.kind==="error")&&m.userId===k.id?m:null,K=m.kind==="done"&&m.userId===k.id?m:null;return i.jsxs("tr",{"data-user-id":k.id,children:[i.jsxs("td",{children:[i.jsx("code",{children:k.username}),C&&i.jsx("span",{className:"badge",style:{marginLeft:"0.5rem"},children:"first admin"})]}),i.jsx("td",{children:k.email?k.email.includes("@")?i.jsx("a",{href:`mailto:${k.email}`,children:k.email}):i.jsx("span",{children:k.email}):i.jsx("span",{className:"muted",title:"No email on file (account predates signup-email capture)",children:"—"})}),i.jsx("td",{children:C?i.jsx("span",{className:"badge",children:"admin"}):i.jsx("span",{className:"muted",children:"member"})}),i.jsx("td",{children:k.assigned_vaults.length>0?i.jsx("span",{style:{display:"inline-flex",flexWrap:"wrap",gap:"0.25rem"},children:k.assigned_vaults.map(J=>i.jsx("code",{children:J},J))}):i.jsx("span",{className:"muted",title:C?"First admin is unrestricted (admin posture)":"No vaults assigned — user can't authorize any vault yet",children:"—"})}),i.jsx("td",{children:k.password_changed?i.jsx("span",{"aria-label":"changed",children:"✓"}):i.jsx("span",{className:"status status-pending",title:"User hasn't completed first-sign-in change-password yet",children:"pending first login"})}),i.jsx("td",{children:i.jsx("span",{title:k.created_at,children:Am(k.created_at)})}),i.jsxs("td",{children:[L?null:i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",alignItems:"center"},children:[C&&i.jsxs(i.Fragment,{children:[i.jsx("span",{id:`first-admin-tooltip-${k.id}`,className:"sr-only",children:"First admin can't be deleted (would self-lock the hub)"}),i.jsx("span",{id:`first-admin-reset-tooltip-${k.id}`,className:"sr-only",children:"First admin uses /account/change-password directly"}),i.jsx("span",{id:`first-admin-vaults-tooltip-${k.id}`,className:"sr-only",children:"First admin's vault membership is unrestricted by design"})]}),i.jsx("button",{type:"button",className:"secondary",disabled:C||P!==null||m.kind==="submitting"&&m.userId===k.id,title:C?"First admin's vault membership is unrestricted by design":void 0,"aria-describedby":C?`first-admin-vaults-tooltip-${k.id}`:void 0,onClick:()=>v({kind:"open",userId:k.id,selected:[...k.assigned_vaults]}),"aria-label":`Edit vaults for ${k.username}`,children:"Edit vaults"}),i.jsx("button",{type:"button",className:"secondary",disabled:C||Z!==null||h.kind==="submitting"&&h.userId===k.id,title:C?"First admin uses /account/change-password directly":void 0,"aria-describedby":C?`first-admin-reset-tooltip-${k.id}`:void 0,onClick:()=>g({kind:"open",userId:k.id,password:""}),"aria-label":`Reset password for ${k.username}`,children:"Reset password"}),i.jsx("button",{type:"button",className:"secondary",disabled:C||O,title:C?"First admin can't be deleted (would self-lock the hub)":void 0,"aria-describedby":C?`first-admin-tooltip-${k.id}`:void 0,onClick:()=>o({kind:"confirming",user:k}),"aria-label":`Delete ${k.username}`,children:O?"Deleting…":"Delete"})]}),L&&i.jsxs("dialog",{open:!0,className:"error-banner",style:{marginTop:"0.25rem",background:"var(--bg-warn, #fffbe6)"},"aria-label":`Confirm delete ${k.username}`,children:[i.jsxs("p",{children:["Delete ",i.jsx("code",{children:k.username}),"? This revokes their tokens, drops their sessions and grants, and removes the account. The audit trail is preserved — tokens stay with ",i.jsx("code",{children:"revoked_at"})," set, anonymised."]}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[i.jsx("button",{type:"button",className:"destructive",onClick:()=>{f(k)},disabled:O,children:O?"Deleting…":"Delete"}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>o({kind:"idle"}),disabled:O,children:"Cancel"})]})]}),z&&i.jsx("div",{className:"error-banner",style:{marginTop:"0.25rem"},children:i.jsx("code",{children:z.message})}),Z&&i.jsx(ib,{user:k,state:Z,onCancel:()=>g({kind:"idle"}),onPasswordChange:J=>g({kind:"open",userId:k.id,password:J}),onSubmit:J=>{y(k,J)}}),X&&i.jsxs("output",{className:"success-banner",style:{marginTop:"0.25rem",display:"block"},children:["Password reset for ",i.jsx("code",{children:X.username}),". Hand them the new password and tell them they'll be prompted to change it on first sign-in.",i.jsx(_m,{username:X.username,hubOrigin:_}),i.jsxs("div",{className:"muted",style:{marginTop:"0.5rem",fontSize:"0.85em"},children:["Their existing tokens are revoked. Resource servers (vault, scribe, etc.) cache the revocation list for up to ",X.revocationLagSeconds," ","seconds — if you're resetting because of a suspected compromise, also restart the affected services (e.g. ",i.jsx("code",{children:"parachute restart vault"}),") to flush their cache immediately."]}),i.jsx("div",{style:{marginTop:"0.5rem"},children:i.jsx("button",{type:"button",className:"secondary",onClick:()=>g({kind:"idle"}),children:"Dismiss"})})]}),P&&i.jsx(sb,{user:k,state:P,availableVaults:j,onCancel:()=>v({kind:"idle"}),onSelectedChange:J=>v({kind:"open",userId:k.id,selected:J}),onSubmit:J=>{x(k,J)}}),K&&i.jsxs("output",{className:"success-banner",style:{marginTop:"0.25rem",display:"block"},children:["Vault assignments updated for ",i.jsx("code",{children:K.username}),".",i.jsx("div",{style:{marginTop:"0.5rem"},children:i.jsx("button",{type:"button",className:"secondary",onClick:()=>v({kind:"idle"}),children:"Dismiss"})})]})]})]},k.id)})})]})})})}function ib({user:l,state:r,onCancel:c,onPasswordChange:o,onSubmit:f}){const h=r.kind==="submitting",g=r.kind==="error"?r.message:null,y=`reset-password-input-${l.id}`;return i.jsxs("form",{onSubmit:m=>{m.preventDefault(),f(r.password)},"aria-label":`Reset password for ${l.username}`,style:{marginTop:"0.5rem",padding:"0.5rem",background:"var(--bg-soft, #f5f5f5)",borderRadius:"4px"},children:[i.jsxs("p",{style:{margin:0},children:[i.jsxs("label",{htmlFor:y,children:["New temporary password for ",i.jsx("code",{children:l.username})," ",i.jsxs("span",{className:"muted",children:["(min ",Ba," chars)"]})]}),i.jsx("br",{}),i.jsx("input",{id:y,type:"password",required:!0,autoComplete:"new-password",minLength:Ba,value:r.password,disabled:h,onChange:m=>o(m.target.value)})]}),g&&i.jsx("div",{className:"error-banner",style:{marginTop:"0.25rem"},children:i.jsx("code",{children:g})}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[i.jsx("button",{type:"submit",disabled:h,children:h?"Setting…":"Set new password"}),i.jsx("button",{type:"button",className:"secondary",onClick:c,disabled:h,children:"Cancel"})]})]})}function sb({user:l,state:r,availableVaults:c,onCancel:o,onSelectedChange:f,onSubmit:h}){const g=r.kind==="submitting",y=r.kind==="error"?r.message:null,m=`edit-vaults-select-${l.id}`;function v(x){const j=Array.from(x.target.selectedOptions).map(_=>_.value);f(j)}return i.jsxs("form",{onSubmit:x=>{x.preventDefault(),h(r.selected)},"aria-label":`Edit vaults for ${l.username}`,style:{marginTop:"0.5rem",padding:"0.5rem",background:"var(--bg-soft, #f5f5f5)",borderRadius:"4px"},children:[i.jsx("p",{style:{margin:0},children:i.jsxs("label",{htmlFor:m,children:["Vault assignments for ",i.jsx("code",{children:l.username})," ",i.jsx("span",{className:"muted",children:"(empty = no narrowing; shift-click to multi-select)"})]})}),r.selected.length>0&&i.jsx("div",{"data-testid":`edit-vaults-chips-${l.id}`,style:{marginTop:"0.4rem",display:"flex",flexWrap:"wrap",gap:"0.25rem"},children:r.selected.map(x=>i.jsx("code",{style:{padding:"0.1rem 0.4rem",borderRadius:"4px"},children:x},x))}),i.jsx("select",{id:m,multiple:!0,value:r.selected,onChange:v,disabled:g,size:Math.min(Math.max(c.length,3),8),style:{marginTop:"0.4rem",minWidth:"12rem"},children:c.map(x=>i.jsx("option",{value:x,children:x},x))}),c.length===0&&i.jsx("p",{className:"muted",style:{marginTop:"0.25rem"},children:"No vaults registered on this hub yet."}),y&&i.jsx("div",{className:"error-banner",style:{marginTop:"0.25rem"},children:i.jsx("code",{children:y})}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[i.jsx("button",{type:"submit",disabled:g,children:g?"Saving…":"Save vault assignments"}),i.jsx("button",{type:"button",className:"secondary",onClick:o,disabled:g,children:"Cancel"})]})]})}function ub({show:l,setShow:r,form:c,setForm:o,vaults:f,hubOrigin:h,createState:g,setCreateState:y,onSubmit:m}){const v=g.kind==="submitting";return i.jsx("section",{style:{marginTop:"1.5rem"},children:l?i.jsxs("form",{onSubmit:x=>void m(x),"aria-label":"Create user",children:[i.jsx("h3",{children:"Create user"}),i.jsxs("p",{children:[i.jsxs("label",{htmlFor:"new-user-username",children:["Username"," ",i.jsxs("span",{className:"muted",children:["(",bs,"-",xs," chars, lowercase letters/digits/hyphens/ underscores)"]})]}),i.jsx("br",{}),i.jsx("input",{id:"new-user-username",type:"text",required:!0,autoComplete:"off",value:c.username,minLength:bs,maxLength:xs,pattern:"[a-z0-9_\\-]+",onChange:x=>o({...c,username:x.target.value})})]}),i.jsxs("p",{children:[i.jsxs("label",{htmlFor:"new-user-password",children:["Password ",i.jsxs("span",{className:"muted",children:["(min ",Ba," chars)"]})]}),i.jsx("br",{}),i.jsx("input",{id:"new-user-password",type:"password",required:!0,autoComplete:"new-password",value:c.password,minLength:Ba,onChange:x=>o({...c,password:x.target.value})})]}),i.jsxs("p",{children:[i.jsxs("label",{htmlFor:"new-user-vaults",children:["Assigned vaults"," ",i.jsx("span",{className:"muted",children:"(empty = no restriction; shift-click to select multiple)"})]}),i.jsx("br",{}),c.assignedVaults.length>0&&i.jsx("span",{"data-testid":"new-user-vault-chips",style:{display:"inline-flex",flexWrap:"wrap",gap:"0.25rem",marginBottom:"0.25rem"},children:c.assignedVaults.map(x=>i.jsx("code",{children:x},x))}),i.jsx("br",{}),i.jsx("select",{id:"new-user-vaults",multiple:!0,value:c.assignedVaults,onChange:x=>o({...c,assignedVaults:Array.from(x.target.selectedOptions).map(j=>j.value)}),size:Math.min(Math.max(f.length,3),8),style:{minWidth:"12rem"},children:f.map(x=>i.jsx("option",{value:x,children:x},x))}),f.length===0&&i.jsx("span",{className:"muted",style:{marginLeft:"0.5rem"},children:"No vaults registered on this hub yet."})]}),g.kind==="error"&&i.jsx("div",{className:"error-banner",children:i.jsx("code",{children:g.message})}),g.kind==="created"&&i.jsxs("output",{className:"success-banner",children:["User ",i.jsx("code",{children:g.username})," created. They'll be prompted to change their password on first sign-in.",i.jsx(_m,{username:g.username,hubOrigin:h})]}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[i.jsx("button",{type:"submit",disabled:v,children:v?"Creating…":"Create user"}),i.jsx("button",{type:"button",className:"secondary",disabled:v,onClick:()=>{r(!1),y({kind:"idle"})},children:"Close"})]})]}):i.jsx("button",{type:"button",onClick:()=>r(!0),children:"Create User"})})}function Am(l){const r=new Date(l);return Number.isNaN(r.getTime())?l:r.toLocaleString()}const Rm=1024*1024*1024;function rb(l){if(l===null)return"";const r=l/Rm;return Number.isInteger(r)?String(r):r.toFixed(2)}function cb(){const[l,r]=b.useState({kind:"loading"}),[c,o]=b.useState(0),[f,h]=b.useState({kind:"idle"});b.useEffect(()=>{let y=!1;return r({kind:"loading"}),b1().then(m=>{y||r({kind:"ok",caps:m})}).catch(m=>{if(y)return;const v=m instanceof Error?m.message:String(m);r({kind:"error",message:v})}),()=>{y=!0}},[c]);async function g(y,m){const v=Number(m);if(!Number.isFinite(v)||v<=0){h({kind:"error",vaultName:y,gibInput:m,message:"Cap must be a positive number of GB."});return}h({kind:"submitting",vaultName:y,gibInput:m});try{await x1(y,Math.round(v*Rm)),h({kind:"idle"}),o(x=>x+1)}catch(x){const j=x instanceof V?`Set cap failed (${x.status}): ${x.message}`:x instanceof Error?x.message:String(x);h({kind:"error",vaultName:y,gibInput:m,message:j})}}return i.jsxs("section",{style:{marginTop:"1.5rem"},"data-testid":"vault-caps-section",children:[i.jsx("h2",{children:"Vault caps"}),i.jsx("p",{className:"muted",children:"Per-vault storage ceilings for this hub. Public-signup vaults are stamped with a default cap (~1 GB); admin-provisioned vaults are uncapped until you set one. Edit a cap to raise or lower a vault's ceiling."}),l.kind==="loading"&&i.jsx("p",{className:"muted",children:"Loading vault caps…"}),l.kind==="error"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"error-banner",children:["Couldn't load vault caps: ",i.jsx("code",{children:l.message})]}),i.jsx("button",{type:"button",className:"secondary",onClick:()=>o(y=>y+1),children:"Retry"})]}),l.kind==="ok"&&l.caps.length===0&&i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No vaults on this hub yet."}),i.jsx("p",{className:"muted",children:"Caps appear here once a vault is registered."})]}),l.kind==="ok"&&l.caps.length>0&&i.jsx("div",{className:"table-scroll",style:{marginTop:"1rem"},children:i.jsxs("table",{className:"user-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{scope:"col",children:"Vault"}),i.jsx("th",{scope:"col",children:"Cap"}),i.jsx("th",{scope:"col",children:"Updated"}),i.jsx("th",{scope:"col",children:"Actions"})]})}),i.jsx("tbody",{children:l.caps.map(y=>{const m=(f.kind==="open"||f.kind==="submitting"||f.kind==="error")&&f.vaultName===y.vault_name?f:null;return i.jsxs("tr",{"data-vault-name":y.vault_name,children:[i.jsx("td",{children:i.jsx("code",{children:y.vault_name})}),i.jsx("td",{"data-testid":`vault-cap-${y.vault_name}`,children:y.cap_bytes!==null?Sm(y.cap_bytes):i.jsx("span",{className:"muted",title:"No cap set — this vault is uncapped",children:"uncapped"})}),i.jsx("td",{children:y.updated_at?i.jsx("span",{title:y.updated_at,children:Am(y.updated_at)}):i.jsx("span",{className:"muted",children:"—"})}),i.jsx("td",{children:m?i.jsx(ob,{vaultName:y.vault_name,state:m,onCancel:()=>h({kind:"idle"}),onChange:v=>h({kind:"open",vaultName:y.vault_name,gibInput:v}),onSubmit:v=>{g(y.vault_name,v)}}):i.jsx("button",{type:"button",className:"secondary",onClick:()=>h({kind:"open",vaultName:y.vault_name,gibInput:rb(y.cap_bytes)}),"aria-label":`Edit cap for ${y.vault_name}`,children:"Edit cap"})})]},y.vault_name)})})]})})]})}function ob({vaultName:l,state:r,onCancel:c,onChange:o,onSubmit:f}){const h=r.kind==="submitting",g=r.kind==="error"?r.message:null,y=`cap-input-${l}`;return i.jsxs("form",{onSubmit:m=>{m.preventDefault(),f(r.gibInput)},"aria-label":`Edit cap for ${l}`,style:{padding:"0.5rem",background:"var(--bg-soft, #f5f5f5)",borderRadius:"4px"},children:[i.jsxs("label",{htmlFor:y,children:["Cap for ",i.jsx("code",{children:l})," ",i.jsx("span",{className:"muted",children:"(GB)"})]}),i.jsx("br",{}),i.jsx("input",{id:y,type:"number",step:"0.01",value:r.gibInput,disabled:h,onChange:m=>o(m.target.value),style:{width:"8rem",marginTop:"0.25rem"}}),g&&i.jsx("div",{className:"error-banner",style:{marginTop:"0.25rem"},children:i.jsx("code",{children:g})}),i.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"},children:[i.jsx("button",{type:"submit",disabled:h,children:h?"Saving…":"Save cap"}),i.jsx("button",{type:"button",className:"secondary",onClick:c,disabled:h,children:"Cancel"})]})]})}const db="https://parachute.computer/install#connect-mcp-clients";function Mm(l){return`${l.replace(/\/+$/,"")}/mcp`}function zm(l,r){return`claude mcp add --transport http parachute-${l} ${Mm(r)}`}function fb(l,r,c){return`${zm(l,r)} --header "Authorization: Bearer ${c}"`}function sc({value:l,label:r="Copy"}){const[c,o]=b.useState(!1);return i.jsx("button",{type:"button",className:"secondary",onClick:()=>{typeof navigator>"u"||!navigator.clipboard||navigator.clipboard.writeText(l).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},children:c?"Copied ✓":r})}function hb({vaultName:l,vaultUrl:r,embedded:c=!1}){const o=Mm(r),f=zm(l,r),[h,g]=b.useState(!1),[y,m]=b.useState({kind:"idle"});async function v(){if(y.kind!=="submitting"){m({kind:"submitting"});try{const _=await wm({scope:`vault:${l}:read vault:${l}:write`});m({kind:"minted",token:_})}catch(_){const k=_ instanceof V?`mint failed (${_.status}): ${_.message}`:_ instanceof Error?_.message:String(_);m({kind:"error",message:k})}}}const x=y.kind==="minted"?fb(l,r,y.token.token):null,j=i.jsxs(i.Fragment,{children:[i.jsx("h3",{children:"Connect an MCP client (or connector)"}),i.jsxs("p",{className:"muted",children:["Connect an MCP client — Claude Code, Claude.ai, etc. (sometimes called a connector in ChatGPT and other web UIs) — to the ",i.jsx("code",{children:l})," vault. The client signs in to this hub and reads/writes vault data over MCP."]}),i.jsxs("div",{className:"mcp-field",children:[i.jsx("span",{className:"mcp-field-label",children:"Endpoint"}),i.jsxs("div",{className:"token-box",children:[i.jsx("code",{"data-testid":"mcp-endpoint",children:o}),i.jsx(sc,{value:o})]})]}),i.jsxs("div",{className:"mcp-field",children:[i.jsx("span",{className:"mcp-field-label",children:"Claude Code"}),i.jsxs("div",{className:"token-box",children:[i.jsx("code",{"data-testid":"mcp-add-command",children:f}),i.jsx(sc,{value:f})]}),i.jsx("p",{className:"dim",children:"No token needed — the command triggers browser OAuth on first use (you sign in to this hub and approve access). For other clients, point them at the endpoint above."})]}),i.jsxs("details",{className:"mcp-token-path",open:h,onToggle:_=>g(_.currentTarget.open),children:[i.jsx("summary",{children:"Use a token instead (headless / CI clients)"}),i.jsxs("p",{className:"dim",children:["For clients that can't do browser OAuth, mint a scope-narrow hub token (",i.jsxs("code",{children:["vault:",l,":read vault:",l,":write"]})," ","— not admin) and pass it as a header. Revealed once; copy it now."]}),y.kind==="minted"&&x?i.jsxs("div",{className:"mint-banner","data-testid":"mcp-header-banner",children:[i.jsx("h3",{children:"Token minted"}),i.jsxs("p",{className:"muted",children:["This is the only time the hub shows this token. Copy the command below — it embeds the live token in the ",i.jsx("code",{children:"Authorization"})," header."]}),i.jsxs("div",{className:"token-box",children:[i.jsx("code",{"data-testid":"mcp-header-command",children:x}),i.jsx(sc,{value:x})]}),i.jsxs("p",{className:"warn",children:["⚠ Manage and revoke this token at ",i.jsx("code",{children:"/admin/tokens"}),"."]})]}):i.jsx("div",{className:"actions",children:i.jsx("button",{type:"button",className:"secondary",onClick:()=>{v()},disabled:y.kind==="submitting",children:y.kind==="submitting"?"Minting…":"Mint a token"})}),y.kind==="error"?i.jsx("div",{className:"error-banner",style:{marginTop:"0.5rem"},children:i.jsx("code",{children:y.message})}):null]}),i.jsx("p",{className:"dim mcp-docs-link",children:i.jsx("a",{href:db,target:"_blank",rel:"noreferrer",children:"Full connect docs →"})})]});return c?i.jsx("div",{className:"mcp-connect-card mcp-connect-card-embedded",children:j}):i.jsx("div",{className:"mcp-connect-card",children:j})}const em="/vault/admin/";function mb(){const[l,r]=b.useState("detecting"),[c,o]=b.useState({kind:"loading"}),[f,h]=b.useState(0),[g,y]=b.useState({kind:"idle"}),[m,v]=b.useState(null),[x,j]=b.useState({});b.useEffect(()=>{let C=!1;return Cs().then(O=>{if(C)return;const L=O.modules.find(z=>z.short==="vault");if(L!=null&&L.installed&&L.config_ui_url===em){r("redirecting"),window.location.replace(em);return}r("legacy")}).catch(()=>{C||r("legacy")}),()=>{C=!0}},[]);async function _(C){if(C.managementUrl){y({kind:"minting",name:C.name});try{const O=await jm(C.name),L=l1(C.url,C.managementUrl),z=L.includes("#")?"&":"#";window.location.assign(`${L}${z}token=${O.token}`)}catch(O){const L=O instanceof V?`mint failed (${O.status}): ${O.message}`:O instanceof Error?O.message:String(O);y({kind:"error",name:C.name,message:L})}}}if(b.useEffect(()=>{if(l!=="legacy")return;let C=!1;return Sc().then(O=>{C||o({kind:"ok",vaults:O.vaults,moduleInstalled:O.moduleInstalled})}).catch(O=>{if(C)return;const L=O instanceof Error?O.message:String(O);o({kind:"error",message:L})}),()=>{C=!0}},[f,l]),b.useEffect(()=>{if(c.kind!=="ok")return;const C=c.vaults.map(L=>L.name);if(C.length===0)return;let O=!1;j(L=>{const z={...L};for(const Z of C)z[Z]||(z[Z]={kind:"loading"});return z});for(const L of C)e1(L).then(z=>{O||j(Z=>({...Z,[L]:{kind:"ok",usage:z}}))}).catch(()=>{O||j(z=>({...z,[L]:{kind:"error"}}))});return()=>{O=!0}},[c]),l!=="legacy")return i.jsxs("div",{children:[i.jsx("div",{className:"list-header",children:i.jsx("h1",{children:"Vaults"})}),i.jsx("p",{className:"muted","data-testid":"vaults-detecting",children:l==="redirecting"?"Opening the vault admin…":"Loading…"})]});if(c.kind==="loading")return i.jsxs("div",{children:[i.jsx("div",{className:"list-header",children:i.jsx("h1",{children:"Vaults"})}),i.jsx("p",{className:"muted",children:"Loading…"})]});if(c.kind==="error")return i.jsxs("div",{children:[i.jsx("div",{className:"list-header",children:i.jsx("h1",{children:"Vaults"})}),i.jsxs("div",{className:"error-banner",children:["Couldn't load vaults: ",i.jsx("code",{children:c.message})]}),i.jsx("button",{type:"button",onClick:()=>h(C=>C+1),className:"secondary",children:"Retry"})]});const k=c.vaults.length===0&&!c.moduleInstalled;return i.jsxs("div",{"data-route-content":"true",children:[i.jsxs("div",{className:"list-header",children:[i.jsxs("h1",{children:["Vaults (",c.vaults.length,")"]}),k?i.jsx(lt,{to:"/modules",children:i.jsx("button",{type:"button",children:"Install vault module"})}):null]}),i.jsxs("p",{className:"muted",children:["Vaults registered with this hub at ",i.jsx("code",{children:"/.well-known/parachute.json"}),"."," ",i.jsx("strong",{children:"Manage"})," opens the vault's own admin app (outside the hub shell); use your browser's back button to return here."]}),c.vaults.length>0?i.jsxs("p",{className:"muted","data-testid":"vaults-legacy-create-hint",children:["To create another vault, upgrade the vault module from ",i.jsx(lt,{to:"/modules",children:"Modules"})," ","(its own admin app includes create), or run"," ",i.jsx("code",{children:"parachute vault create <name>"})," on the host."]}):null,c.vaults.length===0?k?i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No vault module installed."}),i.jsx("p",{className:"muted",children:"The vault backend isn't installed on this hub yet, so there's nothing to provision a vault against. Install it from the Modules page first, then come back here to create your first vault."}),i.jsx("p",{style:{marginTop:"0.75rem"},children:i.jsx(lt,{to:"/modules",children:"Install vault module →"})})]}):i.jsxs("div",{className:"empty empty-rich",children:[i.jsx("p",{className:"empty-headline",children:"No vaults yet."}),i.jsx("p",{className:"muted",children:"Create your first vault to start storing tokens, secrets, and notes scoped to this hub."}),i.jsx("p",{style:{marginTop:"0.75rem"},children:i.jsx("a",{href:"/admin/setup?step=vault",children:"Create a vault →"})})]}):i.jsx("div",{style:{marginTop:"1rem"},children:c.vaults.map(C=>{const O=g.kind==="minting"&&g.name===C.name,L=g.kind==="error"&&g.name===C.name?g:null,z=m===C.name,Z=x[C.name],X=(Z==null?void 0:Z.kind)==="ok"?`${Z.usage.notes} ${Z.usage.notes===1?"note":"notes"} · ${Sm(Z.usage.totalBytes)}`:(Z==null?void 0:Z.kind)==="loading"?"…":"—";return i.jsxs("div",{className:"vault-row-group",children:[i.jsxs("div",{className:"vault-row",children:[i.jsxs("div",{className:"body",children:[i.jsxs("div",{className:"name",children:[i.jsx("code",{children:C.name}),i.jsxs("span",{className:"tag muted",title:"Vault version",children:["v",C.version]})]}),i.jsx("div",{className:"dim url",children:i.jsx("code",{children:C.url})}),i.jsx("div",{className:"dim vault-usage","data-testid":`vault-usage-${C.name}`,children:X}),L?i.jsx("div",{className:"error-banner",style:{marginTop:"0.5rem"},children:i.jsx("code",{children:L.message})}):null]}),i.jsxs("div",{className:"vault-row-actions",children:[i.jsx("button",{type:"button",className:z?void 0:"secondary","aria-expanded":z,"aria-label":`Connect an MCP client to vault ${C.name}`,onClick:()=>v(P=>P===C.name?null:C.name),children:z?"Hide connect":"Connect"}),C.managementUrl?i.jsx("button",{type:"button",onClick:()=>{_(C)},disabled:O,"aria-label":`Manage vault ${C.name}`,children:O?"Opening…":"Manage"}):i.jsx("span",{className:"muted",title:"This vault has no admin SPA — manage with parachute-vault on the host.",children:"CLI only"})]})]}),z?i.jsx(hb,{vaultName:C.name,vaultUrl:C.url}):null]},C.name)})})]})}function Om(l){return l==="/permissions"||l.startsWith("/permissions/")?"permissions":l==="/tokens"||l.startsWith("/tokens/")?"tokens":l==="/modules"||l.startsWith("/modules/")?"modules":l==="/users"||l.startsWith("/users/")?"users":l==="/connections"||l.startsWith("/connections/")?"connections":l==="/vaults"||l.startsWith("/vaults/")?"vaults":l==="/settings"||l.startsWith("/settings/")?"settings":l==="/account"||l.startsWith("/account/")?"my account":l.startsWith("/approve-client/")?"approve app":"home"}function pb(l){return`${Om(l).split(" ").map(c=>c.length>0?c[0].toUpperCase()+c.slice(1):c).join(" ")} · ${jc}`}function gb(){const{pathname:l}=Nt(),r=Om(l),[c,o]=b.useState(null);b.useEffect(()=>{document.title=pb(l)},[l]);const[f,h]=b.useState(!1),[g,y]=b.useState([]),m=c!=null&&c.hasSession?c.csrf:null,v=J1(m,!!(c!=null&&c.hasSession));b.useEffect(()=>{let _=!1;return wc().then(k=>{_||o(k)}).catch(()=>{_||o({hasSession:!1})}),()=>{_=!0}},[]),b.useEffect(()=>{if(!c||!c.hasSession)return;let _=!1;return Cs().then(k=>{_||y(k.modules.filter(C=>C.installed))}).catch(()=>{_||y([])}),()=>{_=!0}},[c]),b.useEffect(()=>{v.locked&&je()},[v.locked]);async function x(){if(m){try{await k1(m)}catch{}je(),v.refresh()}}async function j(_){h(!0);try{await n1(_),window.location.href="/"}catch{h(!1)}}return v.locked&&m?i.jsx(Q1,{csrf:m,onUnlocked:v.refresh}):i.jsxs("div",{className:"page",children:[i.jsxs("nav",{className:"nav",children:[i.jsxs(lt,{to:"/",className:"brand",children:[i.jsx(xm,{size:18,idSuffix:"spa-nav",className:"brand-mark-icon"}),i.jsx("span",{className:"brand-wordmark",children:jc}),i.jsx("span",{className:"sub",children:r})]}),i.jsx(yb,{me:c,signingOut:f,onSignOut:j}),c!=null&&c.hasSession&&v.configured?i.jsx("button",{type:"button",className:"auth-spa-signout","data-testid":"admin-lock-now",title:"Lock the admin console now",onClick:()=>void x(),children:"Lock now"}):null,i.jsx(da,{to:"/",label:"Home",exact:!0}),i.jsx(da,{to:"/connections",label:"Connections"}),i.jsx(da,{to:"/grants",label:"Grants"}),i.jsx(da,{to:"/modules",label:"Modules"}),i.jsx(da,{to:"/users",label:"Users"}),i.jsx(da,{to:"/tokens",label:"Tokens"}),i.jsx(da,{to:"/permissions",label:"Permissions"}),i.jsx(da,{to:"/settings",label:"Settings"}),i.jsx(da,{to:"/account",label:"My account"}),i.jsx("span",{className:"nav-divider","aria-hidden":"true"}),i.jsx(vb,{services:g}),i.jsx("a",{href:"/hub.html",title:"Hub discovery page (top-level)",children:"Discovery"})]}),i.jsxs(fy,{children:[i.jsx(nt,{path:"/",element:i.jsx(g0,{})}),i.jsx(nt,{path:"/vaults",element:i.jsx(mb,{})}),i.jsx(nt,{path:"/vaults/new",element:i.jsx(Pr,{to:"/vaults",replace:!0})}),i.jsx(nt,{path:"/modules",element:i.jsx(M0,{})}),i.jsx(nt,{path:"/users",element:i.jsx(ab,{})}),i.jsx(nt,{path:"/connections",element:i.jsx(n0,{})}),i.jsx(nt,{path:"/grants",element:i.jsx(d0,{})}),i.jsx(nt,{path:"/channels",element:i.jsx(Pr,{to:"/connections",replace:!0})}),i.jsx(nt,{path:"/channels/*",element:i.jsx(Pr,{to:"/connections",replace:!0})}),i.jsx(nt,{path:"/permissions",element:i.jsx(B0,{})}),i.jsx(nt,{path:"/tokens",element:i.jsx(Z0,{})}),i.jsx(nt,{path:"/settings",element:i.jsx(Y0,{})}),i.jsx(nt,{path:"/account",element:i.jsx(K1,{})}),i.jsx(nt,{path:"/approve-client/:clientId",element:i.jsx(I1,{})}),i.jsx(nt,{path:"*",element:i.jsxs("div",{className:"empty",children:["404 — back to ",i.jsx(lt,{to:"/",children:"Home"}),"."]})})]}),c!=null&&c.hasSession?i.jsx(X1,{}):null]})}function da({to:l,label:r,alsoActiveAt:c,exact:o}){const{pathname:f}=Nt(),y=(o?f===l:f===l||f.startsWith(`${l}/`))||c!==void 0&&f===c;return i.jsx(lt,{to:l,className:y?"nav-link nav-link-active":"nav-link","aria-current":y?"page":void 0,children:r})}function vb({services:l}){return l.length===0?null:i.jsxs("details",{className:"nav-dropdown","data-testid":"installed-services-dropdown",children:[i.jsx("summary",{className:"nav-dropdown-summary",children:"Services"}),i.jsx("div",{className:"nav-dropdown-panel",role:"menu",children:l.map(r=>{const c=r.management_url;return c?i.jsx("a",{className:"nav-dropdown-item",href:c,role:"menuitem","data-testid":`nav-service-${r.short}`,children:r.display_name},r.short):i.jsx("span",{className:"nav-dropdown-item nav-dropdown-item-disabled",role:"menuitem","aria-disabled":"true",title:"This module hasn't shipped an admin UI yet.","data-testid":`nav-service-${r.short}`,children:r.display_name},r.short)})})]})}function yb({me:l,signingOut:r,onSignOut:c}){return l===null?null:l.hasSession?i.jsxs("span",{className:"auth-spa",children:[i.jsxs("span",{className:"muted",children:["Signed in as ",i.jsx("strong",{children:l.user.displayName})]})," ","·"," ",i.jsx("button",{type:"button",className:"auth-spa-signout",disabled:r,onClick:()=>{c(l.csrf)},children:r?"Signing out…":"Sign out"})]}):i.jsx("a",{href:`/login?next=${encodeURIComponent(window.location.pathname)}`,className:"auth-spa",children:"Sign in"})}const Um=document.getElementById("root");if(!Um)throw new Error("#root not found");function bb(){const l=window.location.pathname;return l==="/admin"||l.startsWith("/admin/")?"/admin":""}mv.createRoot(Um).render(i.jsx(b.StrictMode,{children:i.jsx(Hy,{basename:bb(),children:i.jsx(gb,{})})}));
|