specweave 1.0.591 → 1.0.593
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/.claude-plugin/marketplace.json +2 -2
- package/dist/dashboard/assets/index-DAfC5dt1.css +1 -0
- package/dist/dashboard/assets/{index-DH3l1QBV.js → index-DQb8E2_E.js} +8 -8
- package/dist/dashboard/index.html +2 -2
- package/package.json +2 -2
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/lib/integrations/ado/ado-spec-sync.js +0 -1
- package/plugins/specweave/lib/integrations/github/metadata-issue-lookup.js +3 -1
- package/plugins/specweave/lib/integrations/jira/jira-spec-sync.js +100 -90
- package/plugins/specweave/lib/integrations/jira/jira-status-sync.js +54 -2
- package/plugins/specweave/skills/team-lead/SKILL.md +67 -4
- package/plugins/specweave/skills/team-lead/agents/_protocol.md +44 -0
- package/plugins/specweave/skills/team-lead/agents/backend.md +2 -0
- package/plugins/specweave/skills/team-lead/agents/database.md +2 -0
- package/plugins/specweave/skills/team-lead/agents/testing.md +2 -0
- package/plugins/specweave/skills/team-lead/reference/dynamic-workflows.md +144 -0
- package/dist/dashboard/assets/index-vkwF92tD.css +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const x of d)if(x.type==="childList")for(const h of x.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function u(d){const x={};return d.integrity&&(x.integrity=d.integrity),d.referrerPolicy&&(x.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?x.credentials="include":d.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function c(d){if(d.ep)return;d.ep=!0;const x=u(d);fetch(d.href,x)}})();var Wc={exports:{}},Xn={};var R0;function og(){if(R0)return Xn;R0=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function u(c,d,x){var h=null;if(x!==void 0&&(h=""+x),d.key!==void 0&&(h=""+d.key),"key"in d){x={};for(var N in d)N!=="key"&&(x[N]=d[N])}else x=d;return d=x.ref,{$$typeof:r,type:c,key:h,ref:d!==void 0?d:null,props:x}}return Xn.Fragment=o,Xn.jsx=u,Xn.jsxs=u,Xn}var M0;function dg(){return M0||(M0=1,Wc.exports=og()),Wc.exports}var l=dg(),Fc={exports:{}},ue={};var _0;function fg(){if(_0)return ue;_0=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),h=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.iterator;function _(S){return S===null||typeof S!="object"?null:(S=w&&S[w]||S["@@iterator"],typeof S=="function"?S:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,b={};function C(S,q,Q){this.props=S,this.context=q,this.refs=b,this.updater=Q||z}C.prototype.isReactComponent={},C.prototype.setState=function(S,q){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,q,"setState")},C.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function T(){}T.prototype=C.prototype;function U(S,q,Q){this.props=S,this.context=q,this.refs=b,this.updater=Q||z}var J=U.prototype=new T;J.constructor=U,R(J,C.prototype),J.isPureReactComponent=!0;var V=Array.isArray;function ae(){}var Z={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function H(S,q,Q){var P=Q.ref;return{$$typeof:r,type:S,key:q,ref:P!==void 0?P:null,props:Q}}function W(S,q){return H(S.type,q,S.props)}function I(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function Ee(S){var q={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Q){return q[Q]})}var He=/\/+/g;function ze(S,q){return typeof S=="object"&&S!==null&&S.key!=null?Ee(""+S.key):q.toString(36)}function je(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(ae,ae):(S.status="pending",S.then(function(q){S.status==="pending"&&(S.status="fulfilled",S.value=q)},function(q){S.status==="pending"&&(S.status="rejected",S.reason=q)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,q,Q,P,ce){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var ee=!1;if(S===null)ee=!0;else switch(fe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(S.$$typeof){case r:case o:ee=!0;break;case v:return ee=S._init,k(ee(S._payload),q,Q,P,ce)}}if(ee)return ce=ce(S),ee=P===""?"."+ze(S,0):P,V(ce)?(Q="",ee!=null&&(Q=ee.replace(He,"$&/")+"/"),k(ce,q,Q,"",function(Fl){return Fl})):ce!=null&&(I(ce)&&(ce=W(ce,Q+(ce.key==null||S&&S.key===ce.key?"":(""+ce.key).replace(He,"$&/")+"/")+ee)),q.push(ce)),1;ee=0;var Ke=P===""?".":P+":";if(V(S))for(var qe=0;qe<S.length;qe++)P=S[qe],fe=Ke+ze(P,qe),ee+=k(P,q,Q,fe,ce);else if(qe=_(S),typeof qe=="function")for(S=qe.call(S),qe=0;!(P=S.next()).done;)P=P.value,fe=Ke+ze(P,qe++),ee+=k(P,q,Q,fe,ce);else if(fe==="object"){if(typeof S.then=="function")return k(je(S),q,Q,P,ce);throw q=String(S),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ee}function X(S,q,Q){if(S==null)return S;var P=[],ce=0;return k(S,P,"","",function(fe){return q.call(Q,fe,ce++)}),P}function se(S){if(S._status===-1){var q=S._result;q=q(),q.then(function(Q){(S._status===0||S._status===-1)&&(S._status=1,S._result=Q)},function(Q){(S._status===0||S._status===-1)&&(S._status=2,S._result=Q)}),S._status===-1&&(S._status=0,S._result=q)}if(S._status===1)return S._result.default;throw S._result}var ye=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},Ne={map:X,forEach:function(S,q,Q){X(S,function(){q.apply(this,arguments)},Q)},count:function(S){var q=0;return X(S,function(){q++}),q},toArray:function(S){return X(S,function(q){return q})||[]},only:function(S){if(!I(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ue.Activity=y,ue.Children=Ne,ue.Component=C,ue.Fragment=u,ue.Profiler=d,ue.PureComponent=U,ue.StrictMode=c,ue.Suspense=p,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,ue.__COMPILER_RUNTIME={__proto__:null,c:function(S){return Z.H.useMemoCache(S)}},ue.cache=function(S){return function(){return S.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(S,q,Q){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var P=R({},S.props),ce=S.key;if(q!=null)for(fe in q.key!==void 0&&(ce=""+q.key),q)!K.call(q,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&q.ref===void 0||(P[fe]=q[fe]);var fe=arguments.length-2;if(fe===1)P.children=Q;else if(1<fe){for(var ee=Array(fe),Ke=0;Ke<fe;Ke++)ee[Ke]=arguments[Ke+2];P.children=ee}return H(S.type,ce,P)},ue.createContext=function(S){return S={$$typeof:h,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:x,_context:S},S},ue.createElement=function(S,q,Q){var P,ce={},fe=null;if(q!=null)for(P in q.key!==void 0&&(fe=""+q.key),q)K.call(q,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(ce[P]=q[P]);var ee=arguments.length-2;if(ee===1)ce.children=Q;else if(1<ee){for(var Ke=Array(ee),qe=0;qe<ee;qe++)Ke[qe]=arguments[qe+2];ce.children=Ke}if(S&&S.defaultProps)for(P in ee=S.defaultProps,ee)ce[P]===void 0&&(ce[P]=ee[P]);return H(S,fe,ce)},ue.createRef=function(){return{current:null}},ue.forwardRef=function(S){return{$$typeof:N,render:S}},ue.isValidElement=I,ue.lazy=function(S){return{$$typeof:v,_payload:{_status:-1,_result:S},_init:se}},ue.memo=function(S,q){return{$$typeof:m,type:S,compare:q===void 0?null:q}},ue.startTransition=function(S){var q=Z.T,Q={};Z.T=Q;try{var P=S(),ce=Z.S;ce!==null&&ce(Q,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(ae,ye)}catch(fe){ye(fe)}finally{q!==null&&Q.types!==null&&(q.types=Q.types),Z.T=q}},ue.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},ue.use=function(S){return Z.H.use(S)},ue.useActionState=function(S,q,Q){return Z.H.useActionState(S,q,Q)},ue.useCallback=function(S,q){return Z.H.useCallback(S,q)},ue.useContext=function(S){return Z.H.useContext(S)},ue.useDebugValue=function(){},ue.useDeferredValue=function(S,q){return Z.H.useDeferredValue(S,q)},ue.useEffect=function(S,q){return Z.H.useEffect(S,q)},ue.useEffectEvent=function(S){return Z.H.useEffectEvent(S)},ue.useId=function(){return Z.H.useId()},ue.useImperativeHandle=function(S,q,Q){return Z.H.useImperativeHandle(S,q,Q)},ue.useInsertionEffect=function(S,q){return Z.H.useInsertionEffect(S,q)},ue.useLayoutEffect=function(S,q){return Z.H.useLayoutEffect(S,q)},ue.useMemo=function(S,q){return Z.H.useMemo(S,q)},ue.useOptimistic=function(S,q){return Z.H.useOptimistic(S,q)},ue.useReducer=function(S,q,Q){return Z.H.useReducer(S,q,Q)},ue.useRef=function(S){return Z.H.useRef(S)},ue.useState=function(S){return Z.H.useState(S)},ue.useSyncExternalStore=function(S,q,Q){return Z.H.useSyncExternalStore(S,q,Q)},ue.useTransition=function(){return Z.H.useTransition()},ue.version="19.2.7",ue}var z0;function xu(){return z0||(z0=1,Fc.exports=fg()),Fc.exports}var j=xu(),Pc={exports:{}},Qn={},Ic={exports:{}},eu={};var D0;function xg(){return D0||(D0=1,(function(r){function o(k,X){var se=k.length;k.push(X);e:for(;0<se;){var ye=se-1>>>1,Ne=k[ye];if(0<d(Ne,X))k[ye]=X,k[se]=Ne,se=ye;else break e}}function u(k){return k.length===0?null:k[0]}function c(k){if(k.length===0)return null;var X=k[0],se=k.pop();if(se!==X){k[0]=se;e:for(var ye=0,Ne=k.length,S=Ne>>>1;ye<S;){var q=2*(ye+1)-1,Q=k[q],P=q+1,ce=k[P];if(0>d(Q,se))P<Ne&&0>d(ce,Q)?(k[ye]=ce,k[P]=se,ye=P):(k[ye]=Q,k[q]=se,ye=q);else if(P<Ne&&0>d(ce,se))k[ye]=ce,k[P]=se,ye=P;else break e}}return X}function d(k,X){var se=k.sortIndex-X.sortIndex;return se!==0?se:k.id-X.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;r.unstable_now=function(){return x.now()}}else{var h=Date,N=h.now();r.unstable_now=function(){return h.now()-N}}var p=[],m=[],v=1,y=null,w=3,_=!1,z=!1,R=!1,b=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function J(k){for(var X=u(m);X!==null;){if(X.callback===null)c(m);else if(X.startTime<=k)c(m),X.sortIndex=X.expirationTime,o(p,X);else break;X=u(m)}}function V(k){if(R=!1,J(k),!z)if(u(p)!==null)z=!0,ae||(ae=!0,Ee());else{var X=u(m);X!==null&&je(V,X.startTime-k)}}var ae=!1,Z=-1,K=5,H=-1;function W(){return b?!0:!(r.unstable_now()-H<K)}function I(){if(b=!1,ae){var k=r.unstable_now();H=k;var X=!0;try{e:{z=!1,R&&(R=!1,T(Z),Z=-1),_=!0;var se=w;try{t:{for(J(k),y=u(p);y!==null&&!(y.expirationTime>k&&W());){var ye=y.callback;if(typeof ye=="function"){y.callback=null,w=y.priorityLevel;var Ne=ye(y.expirationTime<=k);if(k=r.unstable_now(),typeof Ne=="function"){y.callback=Ne,J(k),X=!0;break t}y===u(p)&&c(p),J(k)}else c(p);y=u(p)}if(y!==null)X=!0;else{var S=u(m);S!==null&&je(V,S.startTime-k),X=!1}}break e}finally{y=null,w=se,_=!1}X=void 0}}finally{X?Ee():ae=!1}}}var Ee;if(typeof U=="function")Ee=function(){U(I)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,ze=He.port2;He.port1.onmessage=I,Ee=function(){ze.postMessage(null)}}else Ee=function(){C(I,0)};function je(k,X){Z=C(function(){k(r.unstable_now())},X)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(k){k.callback=null},r.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<k?Math.floor(1e3/k):5},r.unstable_getCurrentPriorityLevel=function(){return w},r.unstable_next=function(k){switch(w){case 1:case 2:case 3:var X=3;break;default:X=w}var se=w;w=X;try{return k()}finally{w=se}},r.unstable_requestPaint=function(){b=!0},r.unstable_runWithPriority=function(k,X){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var se=w;w=k;try{return X()}finally{w=se}},r.unstable_scheduleCallback=function(k,X,se){var ye=r.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?ye+se:ye):se=ye,k){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=se+Ne,k={id:v++,callback:X,priorityLevel:k,startTime:se,expirationTime:Ne,sortIndex:-1},se>ye?(k.sortIndex=se,o(m,k),u(p)===null&&k===u(m)&&(R?(T(Z),Z=-1):R=!0,je(V,se-ye))):(k.sortIndex=Ne,o(p,k),z||_||(z=!0,ae||(ae=!0,Ee()))),k},r.unstable_shouldYield=W,r.unstable_wrapCallback=function(k){var X=w;return function(){var se=w;w=X;try{return k.apply(this,arguments)}finally{w=se}}}})(eu)),eu}var O0;function mg(){return O0||(O0=1,Ic.exports=xg()),Ic.exports}var tu={exports:{}},rt={};var U0;function hg(){if(U0)return rt;U0=1;var r=xu();function o(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var c={d:{f:u,r:function(){throw Error(o(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function x(p,m,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:y==null?null:""+y,children:p,containerInfo:m,implementation:v}}var h=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function N(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,rt.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(o(299));return x(p,m,null,v)},rt.flushSync=function(p){var m=h.T,v=c.p;try{if(h.T=null,c.p=2,p)return p()}finally{h.T=m,c.p=v,c.d.f()}},rt.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,c.d.C(p,m))},rt.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},rt.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,y=N(v,m.crossOrigin),w=typeof m.integrity=="string"?m.integrity:void 0,_=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?c.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:w,fetchPriority:_}):v==="script"&&c.d.X(p,{crossOrigin:y,integrity:w,fetchPriority:_,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},rt.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=N(m.as,m.crossOrigin);c.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&c.d.M(p)},rt.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,y=N(v,m.crossOrigin);c.d.L(p,v,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},rt.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=N(m.as,m.crossOrigin);c.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else c.d.m(p)},rt.requestFormReset=function(p){c.d.r(p)},rt.unstable_batchedUpdates=function(p,m){return p(m)},rt.useFormState=function(p,m,v){return h.H.useFormState(p,m,v)},rt.useFormStatus=function(){return h.H.useHostTransitionStatus()},rt.version="19.2.7",rt}var L0;function gg(){if(L0)return tu.exports;L0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),tu.exports=hg(),tu.exports}var H0;function pg(){if(H0)return Qn;H0=1;var r=mg(),o=xu(),u=gg();function c(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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function x(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 h(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 N(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 p(e){if(x(e)!==e)throw Error(c(188))}function m(e){var t=e.alternate;if(!t){if(t=x(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var s=a.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){a=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===a)return p(s),e;if(i===n)return p(s),t;i=i.sibling}throw Error(c(188))}if(a.return!==n.return)a=s,n=i;else{for(var f=!1,g=s.child;g;){if(g===a){f=!0,a=s,n=i;break}if(g===n){f=!0,n=s,a=i;break}g=g.sibling}if(!f){for(g=i.child;g;){if(g===a){f=!0,a=i,n=s;break}if(g===n){f=!0,n=i,a=s;break}g=g.sibling}if(!f)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,w=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),U=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function Ee(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var He=Symbol.for("react.client.reference");function ze(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===He?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case C:return"Profiler";case b:return"StrictMode";case V:return"Suspense";case ae:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case U:return e.displayName||"Context";case T:return(e._context.displayName||"Context")+".Consumer";case J:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:ze(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return ze(e(t))}catch{}}return null}var je=Array.isArray,k=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ye=[],Ne=-1;function S(e){return{current:e}}function q(e){0>Ne||(e.current=ye[Ne],ye[Ne]=null,Ne--)}function Q(e,t){Ne++,ye[Ne]=e.current,e.current=t}var P=S(null),ce=S(null),fe=S(null),ee=S(null);function Ke(e,t){switch(Q(fe,t),Q(ce,e),Q(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pf(t),e=If(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(P),Q(P,e)}function qe(){q(P),q(ce),q(fe)}function Fl(e){e.memoizedState!==null&&Q(ee,e);var t=P.current,a=If(t,e.type);t!==a&&(Q(ce,e),Q(P,a))}function ls(e){ce.current===e&&(q(P),q(ce)),ee.current===e&&(q(ee),qn._currentValue=se)}var zr,wu;function qa(e){if(zr===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);zr=t&&t[1]||"",wu=-1<a.stack.indexOf(`
|
|
1
|
+
(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const x of d)if(x.type==="childList")for(const h of x.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function u(d){const x={};return d.integrity&&(x.integrity=d.integrity),d.referrerPolicy&&(x.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?x.credentials="include":d.crossOrigin==="anonymous"?x.credentials="omit":x.credentials="same-origin",x}function c(d){if(d.ep)return;d.ep=!0;const x=u(d);fetch(d.href,x)}})();var Fc={exports:{}},Xn={};var M0;function xg(){if(M0)return Xn;M0=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function u(c,d,x){var h=null;if(x!==void 0&&(h=""+x),d.key!==void 0&&(h=""+d.key),"key"in d){x={};for(var N in d)N!=="key"&&(x[N]=d[N])}else x=d;return d=x.ref,{$$typeof:r,type:c,key:h,ref:d!==void 0?d:null,props:x}}return Xn.Fragment=o,Xn.jsx=u,Xn.jsxs=u,Xn}var _0;function mg(){return _0||(_0=1,Fc.exports=xg()),Fc.exports}var l=mg(),Pc={exports:{}},ue={};var z0;function hg(){if(z0)return ue;z0=1;var r=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),h=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),E=Symbol.iterator;function M(S){return S===null||typeof S!="object"?null:(S=E&&S[E]||S["@@iterator"],typeof S=="function"?S:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,b={};function w(S,q,Q){this.props=S,this.context=q,this.refs=b,this.updater=Q||z}w.prototype.isReactComponent={},w.prototype.setState=function(S,q){if(typeof S!="object"&&typeof S!="function"&&S!=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,S,q,"setState")},w.prototype.forceUpdate=function(S){this.updater.enqueueForceUpdate(this,S,"forceUpdate")};function T(){}T.prototype=w.prototype;function U(S,q,Q){this.props=S,this.context=q,this.refs=b,this.updater=Q||z}var J=U.prototype=new T;J.constructor=U,R(J,w.prototype),J.isPureReactComponent=!0;var V=Array.isArray;function ae(){}var Z={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function H(S,q,Q){var P=Q.ref;return{$$typeof:r,type:S,key:q,ref:P!==void 0?P:null,props:Q}}function W(S,q){return H(S.type,q,S.props)}function I(S){return typeof S=="object"&&S!==null&&S.$$typeof===r}function Ee(S){var q={"=":"=0",":":"=2"};return"$"+S.replace(/[=:]/g,function(Q){return q[Q]})}var He=/\/+/g;function ze(S,q){return typeof S=="object"&&S!==null&&S.key!=null?Ee(""+S.key):q.toString(36)}function je(S){switch(S.status){case"fulfilled":return S.value;case"rejected":throw S.reason;default:switch(typeof S.status=="string"?S.then(ae,ae):(S.status="pending",S.then(function(q){S.status==="pending"&&(S.status="fulfilled",S.value=q)},function(q){S.status==="pending"&&(S.status="rejected",S.reason=q)})),S.status){case"fulfilled":return S.value;case"rejected":throw S.reason}}throw S}function k(S,q,Q,P,ce){var fe=typeof S;(fe==="undefined"||fe==="boolean")&&(S=null);var ee=!1;if(S===null)ee=!0;else switch(fe){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(S.$$typeof){case r:case o:ee=!0;break;case v:return ee=S._init,k(ee(S._payload),q,Q,P,ce)}}if(ee)return ce=ce(S),ee=P===""?"."+ze(S,0):P,V(ce)?(Q="",ee!=null&&(Q=ee.replace(He,"$&/")+"/"),k(ce,q,Q,"",function(Fl){return Fl})):ce!=null&&(I(ce)&&(ce=W(ce,Q+(ce.key==null||S&&S.key===ce.key?"":(""+ce.key).replace(He,"$&/")+"/")+ee)),q.push(ce)),1;ee=0;var Ke=P===""?".":P+":";if(V(S))for(var qe=0;qe<S.length;qe++)P=S[qe],fe=Ke+ze(P,qe),ee+=k(P,q,Q,fe,ce);else if(qe=M(S),typeof qe=="function")for(S=qe.call(S),qe=0;!(P=S.next()).done;)P=P.value,fe=Ke+ze(P,qe++),ee+=k(P,q,Q,fe,ce);else if(fe==="object"){if(typeof S.then=="function")return k(je(S),q,Q,P,ce);throw q=String(S),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(S).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ee}function X(S,q,Q){if(S==null)return S;var P=[],ce=0;return k(S,P,"","",function(fe){return q.call(Q,fe,ce++)}),P}function se(S){if(S._status===-1){var q=S._result;q=q(),q.then(function(Q){(S._status===0||S._status===-1)&&(S._status=1,S._result=Q)},function(Q){(S._status===0||S._status===-1)&&(S._status=2,S._result=Q)}),S._status===-1&&(S._status=0,S._result=q)}if(S._status===1)return S._result.default;throw S._result}var ye=typeof reportError=="function"?reportError:function(S){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof S=="object"&&S!==null&&typeof S.message=="string"?String(S.message):String(S),error:S});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",S);return}console.error(S)},Ne={map:X,forEach:function(S,q,Q){X(S,function(){q.apply(this,arguments)},Q)},count:function(S){var q=0;return X(S,function(){q++}),q},toArray:function(S){return X(S,function(q){return q})||[]},only:function(S){if(!I(S))throw Error("React.Children.only expected to receive a single React element child.");return S}};return ue.Activity=y,ue.Children=Ne,ue.Component=w,ue.Fragment=u,ue.Profiler=d,ue.PureComponent=U,ue.StrictMode=c,ue.Suspense=p,ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,ue.__COMPILER_RUNTIME={__proto__:null,c:function(S){return Z.H.useMemoCache(S)}},ue.cache=function(S){return function(){return S.apply(null,arguments)}},ue.cacheSignal=function(){return null},ue.cloneElement=function(S,q,Q){if(S==null)throw Error("The argument must be a React element, but you passed "+S+".");var P=R({},S.props),ce=S.key;if(q!=null)for(fe in q.key!==void 0&&(ce=""+q.key),q)!K.call(q,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&q.ref===void 0||(P[fe]=q[fe]);var fe=arguments.length-2;if(fe===1)P.children=Q;else if(1<fe){for(var ee=Array(fe),Ke=0;Ke<fe;Ke++)ee[Ke]=arguments[Ke+2];P.children=ee}return H(S.type,ce,P)},ue.createContext=function(S){return S={$$typeof:h,_currentValue:S,_currentValue2:S,_threadCount:0,Provider:null,Consumer:null},S.Provider=S,S.Consumer={$$typeof:x,_context:S},S},ue.createElement=function(S,q,Q){var P,ce={},fe=null;if(q!=null)for(P in q.key!==void 0&&(fe=""+q.key),q)K.call(q,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(ce[P]=q[P]);var ee=arguments.length-2;if(ee===1)ce.children=Q;else if(1<ee){for(var Ke=Array(ee),qe=0;qe<ee;qe++)Ke[qe]=arguments[qe+2];ce.children=Ke}if(S&&S.defaultProps)for(P in ee=S.defaultProps,ee)ce[P]===void 0&&(ce[P]=ee[P]);return H(S,fe,ce)},ue.createRef=function(){return{current:null}},ue.forwardRef=function(S){return{$$typeof:N,render:S}},ue.isValidElement=I,ue.lazy=function(S){return{$$typeof:v,_payload:{_status:-1,_result:S},_init:se}},ue.memo=function(S,q){return{$$typeof:m,type:S,compare:q===void 0?null:q}},ue.startTransition=function(S){var q=Z.T,Q={};Z.T=Q;try{var P=S(),ce=Z.S;ce!==null&&ce(Q,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(ae,ye)}catch(fe){ye(fe)}finally{q!==null&&Q.types!==null&&(q.types=Q.types),Z.T=q}},ue.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},ue.use=function(S){return Z.H.use(S)},ue.useActionState=function(S,q,Q){return Z.H.useActionState(S,q,Q)},ue.useCallback=function(S,q){return Z.H.useCallback(S,q)},ue.useContext=function(S){return Z.H.useContext(S)},ue.useDebugValue=function(){},ue.useDeferredValue=function(S,q){return Z.H.useDeferredValue(S,q)},ue.useEffect=function(S,q){return Z.H.useEffect(S,q)},ue.useEffectEvent=function(S){return Z.H.useEffectEvent(S)},ue.useId=function(){return Z.H.useId()},ue.useImperativeHandle=function(S,q,Q){return Z.H.useImperativeHandle(S,q,Q)},ue.useInsertionEffect=function(S,q){return Z.H.useInsertionEffect(S,q)},ue.useLayoutEffect=function(S,q){return Z.H.useLayoutEffect(S,q)},ue.useMemo=function(S,q){return Z.H.useMemo(S,q)},ue.useOptimistic=function(S,q){return Z.H.useOptimistic(S,q)},ue.useReducer=function(S,q,Q){return Z.H.useReducer(S,q,Q)},ue.useRef=function(S){return Z.H.useRef(S)},ue.useState=function(S){return Z.H.useState(S)},ue.useSyncExternalStore=function(S,q,Q){return Z.H.useSyncExternalStore(S,q,Q)},ue.useTransition=function(){return Z.H.useTransition()},ue.version="19.2.7",ue}var D0;function mu(){return D0||(D0=1,Pc.exports=hg()),Pc.exports}var j=mu(),Ic={exports:{}},Qn={},eu={exports:{}},tu={};var O0;function gg(){return O0||(O0=1,(function(r){function o(k,X){var se=k.length;k.push(X);e:for(;0<se;){var ye=se-1>>>1,Ne=k[ye];if(0<d(Ne,X))k[ye]=X,k[se]=Ne,se=ye;else break e}}function u(k){return k.length===0?null:k[0]}function c(k){if(k.length===0)return null;var X=k[0],se=k.pop();if(se!==X){k[0]=se;e:for(var ye=0,Ne=k.length,S=Ne>>>1;ye<S;){var q=2*(ye+1)-1,Q=k[q],P=q+1,ce=k[P];if(0>d(Q,se))P<Ne&&0>d(ce,Q)?(k[ye]=ce,k[P]=se,ye=P):(k[ye]=Q,k[q]=se,ye=q);else if(P<Ne&&0>d(ce,se))k[ye]=ce,k[P]=se,ye=P;else break e}}return X}function d(k,X){var se=k.sortIndex-X.sortIndex;return se!==0?se:k.id-X.id}if(r.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var x=performance;r.unstable_now=function(){return x.now()}}else{var h=Date,N=h.now();r.unstable_now=function(){return h.now()-N}}var p=[],m=[],v=1,y=null,E=3,M=!1,z=!1,R=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function J(k){for(var X=u(m);X!==null;){if(X.callback===null)c(m);else if(X.startTime<=k)c(m),X.sortIndex=X.expirationTime,o(p,X);else break;X=u(m)}}function V(k){if(R=!1,J(k),!z)if(u(p)!==null)z=!0,ae||(ae=!0,Ee());else{var X=u(m);X!==null&&je(V,X.startTime-k)}}var ae=!1,Z=-1,K=5,H=-1;function W(){return b?!0:!(r.unstable_now()-H<K)}function I(){if(b=!1,ae){var k=r.unstable_now();H=k;var X=!0;try{e:{z=!1,R&&(R=!1,T(Z),Z=-1),M=!0;var se=E;try{t:{for(J(k),y=u(p);y!==null&&!(y.expirationTime>k&&W());){var ye=y.callback;if(typeof ye=="function"){y.callback=null,E=y.priorityLevel;var Ne=ye(y.expirationTime<=k);if(k=r.unstable_now(),typeof Ne=="function"){y.callback=Ne,J(k),X=!0;break t}y===u(p)&&c(p),J(k)}else c(p);y=u(p)}if(y!==null)X=!0;else{var S=u(m);S!==null&&je(V,S.startTime-k),X=!1}}break e}finally{y=null,E=se,M=!1}X=void 0}}finally{X?Ee():ae=!1}}}var Ee;if(typeof U=="function")Ee=function(){U(I)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,ze=He.port2;He.port1.onmessage=I,Ee=function(){ze.postMessage(null)}}else Ee=function(){w(I,0)};function je(k,X){Z=w(function(){k(r.unstable_now())},X)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(k){k.callback=null},r.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<k?Math.floor(1e3/k):5},r.unstable_getCurrentPriorityLevel=function(){return E},r.unstable_next=function(k){switch(E){case 1:case 2:case 3:var X=3;break;default:X=E}var se=E;E=X;try{return k()}finally{E=se}},r.unstable_requestPaint=function(){b=!0},r.unstable_runWithPriority=function(k,X){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var se=E;E=k;try{return X()}finally{E=se}},r.unstable_scheduleCallback=function(k,X,se){var ye=r.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?ye+se:ye):se=ye,k){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=se+Ne,k={id:v++,callback:X,priorityLevel:k,startTime:se,expirationTime:Ne,sortIndex:-1},se>ye?(k.sortIndex=se,o(m,k),u(p)===null&&k===u(m)&&(R?(T(Z),Z=-1):R=!0,je(V,se-ye))):(k.sortIndex=Ne,o(p,k),z||M||(z=!0,ae||(ae=!0,Ee()))),k},r.unstable_shouldYield=W,r.unstable_wrapCallback=function(k){var X=E;return function(){var se=E;E=X;try{return k.apply(this,arguments)}finally{E=se}}}})(tu)),tu}var U0;function pg(){return U0||(U0=1,eu.exports=gg()),eu.exports}var au={exports:{}},rt={};var L0;function yg(){if(L0)return rt;L0=1;var r=mu();function o(p){var m="https://react.dev/errors/"+p;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+p+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var c={d:{f:u,r:function(){throw Error(o(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function x(p,m,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:y==null?null:""+y,children:p,containerInfo:m,implementation:v}}var h=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function N(p,m){if(p==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,rt.createPortal=function(p,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(o(299));return x(p,m,null,v)},rt.flushSync=function(p){var m=h.T,v=c.p;try{if(h.T=null,c.p=2,p)return p()}finally{h.T=m,c.p=v,c.d.f()}},rt.preconnect=function(p,m){typeof p=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,c.d.C(p,m))},rt.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},rt.preinit=function(p,m){if(typeof p=="string"&&m&&typeof m.as=="string"){var v=m.as,y=N(v,m.crossOrigin),E=typeof m.integrity=="string"?m.integrity:void 0,M=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?c.d.S(p,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:E,fetchPriority:M}):v==="script"&&c.d.X(p,{crossOrigin:y,integrity:E,fetchPriority:M,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},rt.preinitModule=function(p,m){if(typeof p=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=N(m.as,m.crossOrigin);c.d.M(p,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&c.d.M(p)},rt.preload=function(p,m){if(typeof p=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,y=N(v,m.crossOrigin);c.d.L(p,v,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},rt.preloadModule=function(p,m){if(typeof p=="string")if(m){var v=N(m.as,m.crossOrigin);c.d.m(p,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else c.d.m(p)},rt.requestFormReset=function(p){c.d.r(p)},rt.unstable_batchedUpdates=function(p,m){return p(m)},rt.useFormState=function(p,m,v){return h.H.useFormState(p,m,v)},rt.useFormStatus=function(){return h.H.useHostTransitionStatus()},rt.version="19.2.7",rt}var H0;function vg(){if(H0)return au.exports;H0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),au.exports=yg(),au.exports}var B0;function bg(){if(B0)return Qn;B0=1;var r=pg(),o=mu(),u=vg();function c(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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function x(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 h(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 N(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 p(e){if(x(e)!==e)throw Error(c(188))}function m(e){var t=e.alternate;if(!t){if(t=x(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var s=a.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){a=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===a)return p(s),e;if(i===n)return p(s),t;i=i.sibling}throw Error(c(188))}if(a.return!==n.return)a=s,n=i;else{for(var f=!1,g=s.child;g;){if(g===a){f=!0,a=s,n=i;break}if(g===n){f=!0,n=s,a=i;break}g=g.sibling}if(!f){for(g=i.child;g;){if(g===a){f=!0,a=i,n=s;break}if(g===n){f=!0,n=i,a=s;break}g=g.sibling}if(!f)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,E=Symbol.for("react.element"),M=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),U=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function Ee(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var He=Symbol.for("react.client.reference");function ze(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===He?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case w:return"Profiler";case b:return"StrictMode";case V:return"Suspense";case ae:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case U:return e.displayName||"Context";case T:return(e._context.displayName||"Context")+".Consumer";case J:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:ze(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return ze(e(t))}catch{}}return null}var je=Array.isArray,k=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ye=[],Ne=-1;function S(e){return{current:e}}function q(e){0>Ne||(e.current=ye[Ne],ye[Ne]=null,Ne--)}function Q(e,t){Ne++,ye[Ne]=e.current,e.current=t}var P=S(null),ce=S(null),fe=S(null),ee=S(null);function Ke(e,t){switch(Q(fe,t),Q(ce,e),Q(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?If(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=If(t),e=e0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(P),Q(P,e)}function qe(){q(P),q(ce),q(fe)}function Fl(e){e.memoizedState!==null&&Q(ee,e);var t=P.current,a=e0(t,e.type);t!==a&&(Q(ce,e),Q(P,a))}function ls(e){ce.current===e&&(q(P),q(ce)),ee.current===e&&(q(ee),qn._currentValue=se)}var Dr,Tu;function qa(e){if(Dr===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Dr=t&&t[1]||"",Tu=-1<a.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
3
|
+
`+Dr+e+Tu}var Or=!1;function Ur(e,t){if(!e||Or)return"";Or=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(B){var L=B}Reflect.construct(e,[],G)}else{try{G.call()}catch(B){L=B}e.call(G.prototype)}}else{try{throw Error()}catch(B){L=B}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(B){if(B&&L&&typeof B.stack=="string")return[B.stack,L.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 i=n.DetermineComponentFrameRoot(),f=i[0],g=i[1];if(f&&g){var C=f.split(`
|
|
4
4
|
`),O=g.split(`
|
|
5
|
-
`);for(s=n=0;n<
|
|
6
|
-
`+
|
|
5
|
+
`);for(s=n=0;n<C.length&&!C[n].includes("DetermineComponentFrameRoot");)n++;for(;s<O.length&&!O[s].includes("DetermineComponentFrameRoot");)s++;if(n===C.length||s===O.length)for(n=C.length-1,s=O.length-1;1<=n&&0<=s&&C[n]!==O[s];)s--;for(;1<=n&&0<=s;n--,s--)if(C[n]!==O[s]){if(n!==1||s!==1)do if(n--,s--,0>s||C[n]!==O[s]){var $=`
|
|
6
|
+
`+C[n].replace(" at new "," at ");return e.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",e.displayName)),$}while(1<=n&&0<=s);break}}}finally{Or=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?qa(a):""}function Vx(e,t){switch(e.tag){case 26:case 27:case 5:return qa(e.type);case 16:return qa("Lazy");case 13:return e.child!==t&&t!==null?qa("Suspense Fallback"):qa("Suspense");case 19:return qa("SuspenseList");case 0:case 15:return Ur(e.type,!1);case 11:return Ur(e.type.render,!1);case 1:return Ur(e.type,!0);case 31:return qa("Activity");default:return""}}function Au(e){try{var t="",a=null;do t+=Vx(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
7
7
|
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}}var Ur=Object.prototype.hasOwnProperty,Lr=r.unstable_scheduleCallback,Hr=r.unstable_cancelCallback,Yx=r.unstable_shouldYield,Gx=r.unstable_requestPaint,ht=r.unstable_now,Vx=r.unstable_getCurrentPriorityLevel,Au=r.unstable_ImmediatePriority,Ru=r.unstable_UserBlockingPriority,ns=r.unstable_NormalPriority,Xx=r.unstable_LowPriority,Mu=r.unstable_IdlePriority,Qx=r.log,Zx=r.unstable_setDisableYieldValue,Pl=null,gt=null;function ha(e){if(typeof Qx=="function"&&Zx(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Pl,e)}catch{}}var pt=Math.clz32?Math.clz32:Wx,Kx=Math.log,Jx=Math.LN2;function Wx(e){return e>>>=0,e===0?32:31-(Kx(e)/Jx|0)|0}var ss=256,rs=262144,is=4194304;function Ya(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 cs(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var g=n&134217727;return g!==0?(n=g&~i,n!==0?s=Ya(n):(f&=g,f!==0?s=Ya(f):a||(a=g&~e,a!==0&&(s=Ya(a))))):(g=n&~i,g!==0?s=Ya(g):f!==0?s=Ya(f):a||(a=n&~e,a!==0&&(s=Ya(a)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:s}function Il(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Fx(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 _u(){var e=is;return is<<=1,(is&62914560)===0&&(is=4194304),e}function Br(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function en(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Px(e,t,a,n,s,i){var f=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 g=e.entanglements,E=e.expirationTimes,O=e.hiddenUpdates;for(a=f&~a;0<a;){var $=31-pt(a),G=1<<$;g[$]=0,E[$]=-1;var L=O[$];if(L!==null)for(O[$]=null,$=0;$<L.length;$++){var B=L[$];B!==null&&(B.lane&=-536870913)}a&=~G}n!==0&&zu(e,n,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(f&~t))}function zu(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-pt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Du(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-pt(a),s=1<<n;s&t|e[n]&t&&(e[n]|=t),a&=~s}}function Ou(e,t){var a=t&-t;return a=(a&42)!==0?1:kr(a),(a&(e.suspendedLanes|t))!==0?0:a}function kr(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 $r(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Uu(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:N0(e.type))}function Lu(e,t){var a=X.p;try{return X.p=e,t()}finally{X.p=a}}var ga=Math.random().toString(36).slice(2),et="__reactFiber$"+ga,ct="__reactProps$"+ga,il="__reactContainer$"+ga,qr="__reactEvents$"+ga,Ix="__reactListeners$"+ga,em="__reactHandles$"+ga,Hu="__reactResources$"+ga,tn="__reactMarker$"+ga;function Yr(e){delete e[et],delete e[ct],delete e[qr],delete e[Ix],delete e[em]}function cl(e){var t=e[et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[il]||a[et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=r0(e);e!==null;){if(a=e[et])return a;e=r0(e)}return t}e=a,a=e.parentNode}return null}function ul(e){if(e=e[et]||e[il]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function an(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ol(e){var t=e[Hu];return t||(t=e[Hu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Fe(e){e[tn]=!0}var Bu=new Set,ku={};function Ga(e,t){dl(e,t),dl(e+"Capture",t)}function dl(e,t){for(ku[e]=t,e=0;e<t.length;e++)Bu.add(t[e])}var tm=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]*$"),$u={},qu={};function am(e){return Ur.call(qu,e)?!0:Ur.call($u,e)?!1:tm.test(e)?qu[e]=!0:($u[e]=!0,!1)}function us(e,t,a){if(am(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 os(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 Jt(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 Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lm(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,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){a=""+f,i.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gr(e){if(!e._valueTracker){var t=Yu(e)?"checked":"value";e._valueTracker=lm(e,t,""+e[t])}}function Gu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Yu(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function ds(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 nm=/[\n"\\]/g;function wt(e){return e.replace(nm,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Vr(e,t,a,n,s,i,f,g){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Xr(e,f,Ct(t)):a!=null?Xr(e,f,Ct(a)):n!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+Ct(g):e.removeAttribute("name")}function Vu(e,t,a,n,s,i,f,g){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Gr(e);return}a=a!=null?""+Ct(a):"",t=t!=null?""+Ct(t):a,g||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=g?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Gr(e)}function Xr(e,t,a){t==="number"&&ds(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function fl(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=""+Ct(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 Xu(e,t,a){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ct(a):""}function Qu(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(je(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Ct(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Gr(e)}function xl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var sm=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 Zu(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||sm.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ku(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(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&&Zu(e,s,n)}else for(var i in t)t.hasOwnProperty(i)&&Zu(e,i,t[i])}function Qr(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 rm=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"]]),im=/^[\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 fs(e){return im.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wt(){}var Zr=null;function Kr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ml=null,hl=null;function Ju(e){var t=ul(e);if(t&&(e=t.stateNode)){var a=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(Vr(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="'+wt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var s=n[ct]||null;if(!s)throw Error(c(90));Vr(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&&Gu(n)}break e;case"textarea":Xu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&fl(e,!!a.multiple,t,!1)}}}var Jr=!1;function Wu(e,t,a){if(Jr)return e(t,a);Jr=!0;try{var n=e(t);return n}finally{if(Jr=!1,(ml!==null||hl!==null)&&(Is(),ml&&(t=ml,e=hl,hl=ml=null,Ju(t),e)))for(t=0;t<e.length;t++)Ju(e[t])}}function ln(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ct]||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(c(231,t,typeof a));return a}var Ft=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wr=!1;if(Ft)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){Wr=!0}}),window.addEventListener("test",nn,nn),window.removeEventListener("test",nn,nn)}catch{Wr=!1}var pa=null,Fr=null,xs=null;function Fu(){if(xs)return xs;var e,t=Fr,a=t.length,n,s="value"in pa?pa.value:pa.textContent,i=s.length;for(e=0;e<a&&t[e]===s[e];e++);var f=a-e;for(n=1;n<=f&&t[a-n]===s[i-n];n++);return xs=s.slice(e,1<n?1-n:void 0)}function ms(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 hs(){return!0}function Pu(){return!1}function ut(e){function t(a,n,s,i,f){this._reactName=a,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=f,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(a=e[g],this[g]=a?a(i):i[g]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?hs:Pu,this.isPropagationStopped=Pu,this}return y(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=hs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),t}var Va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gs=ut(Va),sn=y({},Va,{view:0,detail:0}),cm=ut(sn),Pr,Ir,rn,ps=y({},sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ti,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!==rn&&(rn&&e.type==="mousemove"?(Pr=e.screenX-rn.screenX,Ir=e.screenY-rn.screenY):Ir=Pr=0,rn=e),Pr)},movementY:function(e){return"movementY"in e?e.movementY:Ir}}),Iu=ut(ps),um=y({},ps,{dataTransfer:0}),om=ut(um),dm=y({},sn,{relatedTarget:0}),ei=ut(dm),fm=y({},Va,{animationName:0,elapsedTime:0,pseudoElement:0}),xm=ut(fm),mm=y({},Va,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hm=ut(mm),gm=y({},Va,{data:0}),eo=ut(gm),pm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ym={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"},vm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vm[e])?!!t[e]:!1}function ti(){return bm}var jm=y({},sn,{key:function(e){if(e.key){var t=pm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ym[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ti,charCode:function(e){return e.type==="keypress"?ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Nm=ut(jm),Sm=y({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),to=ut(Sm),Em=y({},sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ti}),Cm=ut(Em),wm=y({},Va,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tm=ut(wm),Am=y({},ps,{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}),Rm=ut(Am),Mm=y({},Va,{newState:0,oldState:0}),_m=ut(Mm),zm=[9,13,27,32],ai=Ft&&"CompositionEvent"in window,cn=null;Ft&&"documentMode"in document&&(cn=document.documentMode);var Dm=Ft&&"TextEvent"in window&&!cn,ao=Ft&&(!ai||cn&&8<cn&&11>=cn),lo=" ",no=!1;function so(e,t){switch(e){case"keyup":return zm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ro(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gl=!1;function Om(e,t){switch(e){case"compositionend":return ro(t);case"keypress":return t.which!==32?null:(no=!0,lo);case"textInput":return e=t.data,e===lo&&no?null:e;default:return null}}function Um(e,t){if(gl)return e==="compositionend"||!ai&&so(e,t)?(e=Fu(),xs=Fr=pa=null,gl=!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 ao&&t.locale!=="ko"?null:t.data;default:return null}}var Lm={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 io(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lm[e.type]:t==="textarea"}function co(e,t,a,n){ml?hl?hl.push(n):hl=[n]:ml=n,t=rr(t,"onChange"),0<t.length&&(a=new gs("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var un=null,on=null;function Hm(e){Qf(e,0)}function ys(e){var t=an(e);if(Gu(t))return e}function uo(e,t){if(e==="change")return t}var oo=!1;if(Ft){var li;if(Ft){var ni="oninput"in document;if(!ni){var fo=document.createElement("div");fo.setAttribute("oninput","return;"),ni=typeof fo.oninput=="function"}li=ni}else li=!1;oo=li&&(!document.documentMode||9<document.documentMode)}function xo(){un&&(un.detachEvent("onpropertychange",mo),on=un=null)}function mo(e){if(e.propertyName==="value"&&ys(on)){var t=[];co(t,on,e,Kr(e)),Wu(Hm,t)}}function Bm(e,t,a){e==="focusin"?(xo(),un=t,on=a,un.attachEvent("onpropertychange",mo)):e==="focusout"&&xo()}function km(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ys(on)}function $m(e,t){if(e==="click")return ys(t)}function qm(e,t){if(e==="input"||e==="change")return ys(t)}function Ym(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:Ym;function dn(e,t){if(yt(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(!Ur.call(t,s)||!yt(e[s],t[s]))return!1}return!0}function ho(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function go(e,t){var a=ho(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=ho(a)}}function po(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?po(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yo(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ds(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=ds(e.document)}return t}function si(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 Gm=Ft&&"documentMode"in document&&11>=document.documentMode,pl=null,ri=null,fn=null,ii=!1;function vo(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ii||pl==null||pl!==ds(n)||(n=pl,"selectionStart"in n&&si(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}),fn&&dn(fn,n)||(fn=n,n=rr(ri,"onSelect"),0<n.length&&(t=new gs("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=pl)))}function Xa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var yl={animationend:Xa("Animation","AnimationEnd"),animationiteration:Xa("Animation","AnimationIteration"),animationstart:Xa("Animation","AnimationStart"),transitionrun:Xa("Transition","TransitionRun"),transitionstart:Xa("Transition","TransitionStart"),transitioncancel:Xa("Transition","TransitionCancel"),transitionend:Xa("Transition","TransitionEnd")},ci={},bo={};Ft&&(bo=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function Qa(e){if(ci[e])return ci[e];if(!yl[e])return e;var t=yl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in bo)return ci[e]=t[a];return e}var jo=Qa("animationend"),No=Qa("animationiteration"),So=Qa("animationstart"),Vm=Qa("transitionrun"),Xm=Qa("transitionstart"),Qm=Qa("transitioncancel"),Eo=Qa("transitionend"),Co=new Map,ui="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(" ");ui.push("scrollEnd");function Ht(e,t){Co.set(e,t),Ga(t,[e])}var vs=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)},Tt=[],vl=0,oi=0;function bs(){for(var e=vl,t=oi=vl=0;t<e;){var a=Tt[t];Tt[t++]=null;var n=Tt[t];Tt[t++]=null;var s=Tt[t];Tt[t++]=null;var i=Tt[t];if(Tt[t++]=null,n!==null&&s!==null){var f=n.pending;f===null?s.next=s:(s.next=f.next,f.next=s),n.pending=s}i!==0&&wo(a,s,i)}}function js(e,t,a,n){Tt[vl++]=e,Tt[vl++]=t,Tt[vl++]=a,Tt[vl++]=n,oi|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function di(e,t,a,n){return js(e,t,a,n),Ns(e)}function Za(e,t){return js(e,null,null,t),Ns(e)}function wo(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var s=!1,i=e.return;i!==null;)i.childLanes|=a,n=i.alternate,n!==null&&(n.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-pt(a),e=i.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=a|536870912),i):null}function Ns(e){if(50<On)throw On=0,bc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bl={};function Zm(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 vt(e,t,a,n){return new Zm(e,t,a,n)}function fi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pt(e,t){var a=e.alternate;return a===null?(a=vt(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 To(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 Ss(e,t,a,n,s,i){var f=0;if(n=e,typeof e=="function")fi(e)&&(f=1);else if(typeof e=="string")f=Ph(e,a,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=vt(31,a,t,s),e.elementType=H,e.lanes=i,e;case R:return Ka(a.children,s,i,t);case b:f=8,s|=24;break;case C:return e=vt(12,a,t,s|2),e.elementType=C,e.lanes=i,e;case V:return e=vt(13,a,t,s),e.elementType=V,e.lanes=i,e;case ae:return e=vt(19,a,t,s),e.elementType=ae,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case U:f=10;break e;case T:f=9;break e;case J:f=11;break e;case Z:f=14;break e;case K:f=16,n=null;break e}f=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=vt(f,a,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Ka(e,t,a,n){return e=vt(7,e,n,t),e.lanes=a,e}function xi(e,t,a){return e=vt(6,e,null,t),e.lanes=a,e}function Ao(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function mi(e,t,a){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ro=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var a=Ro.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Tu(t)},Ro.set(e,t),t)}return{value:e,source:t,stack:Tu(t)}}var jl=[],Nl=0,Es=null,xn=0,Rt=[],Mt=0,ya=null,Vt=1,Xt="";function It(e,t){jl[Nl++]=xn,jl[Nl++]=Es,Es=e,xn=t}function Mo(e,t,a){Rt[Mt++]=Vt,Rt[Mt++]=Xt,Rt[Mt++]=ya,ya=e;var n=Vt;e=Xt;var s=32-pt(n)-1;n&=~(1<<s),a+=1;var i=32-pt(t)+s;if(30<i){var f=s-s%5;i=(n&(1<<f)-1).toString(32),n>>=f,s-=f,Vt=1<<32-pt(t)+s|a<<s|n,Xt=i+e}else Vt=1<<i|a<<s|n,Xt=e}function hi(e){e.return!==null&&(It(e,1),Mo(e,1,0))}function gi(e){for(;e===Es;)Es=jl[--Nl],jl[Nl]=null,xn=jl[--Nl],jl[Nl]=null;for(;e===ya;)ya=Rt[--Mt],Rt[Mt]=null,Xt=Rt[--Mt],Rt[Mt]=null,Vt=Rt[--Mt],Rt[Mt]=null}function _o(e,t){Rt[Mt++]=Vt,Rt[Mt++]=Xt,Rt[Mt++]=ya,Vt=t.id,Xt=t.overflow,ya=e}var tt=null,De=null,pe=!1,va=null,_t=!1,pi=Error(c(519));function ba(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mn(At(t,e)),pi}function zo(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[et]=e,t[ct]=n,a){case"dialog":me("cancel",t),me("close",t);break;case"iframe":case"object":case"embed":me("load",t);break;case"video":case"audio":for(a=0;a<Ln.length;a++)me(Ln[a],t);break;case"source":me("error",t);break;case"img":case"image":case"link":me("error",t),me("load",t);break;case"details":me("toggle",t);break;case"input":me("invalid",t),Vu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":me("invalid",t);break;case"textarea":me("invalid",t),Qu(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||Wf(t.textContent,a)?(n.popover!=null&&(me("beforetoggle",t),me("toggle",t)),n.onScroll!=null&&me("scroll",t),n.onScrollEnd!=null&&me("scrollend",t),n.onClick!=null&&(t.onclick=Wt),t=!0):t=!1,t||ba(e,!0)}function Do(e){for(tt=e.return;tt;)switch(tt.tag){case 5:case 31:case 13:_t=!1;return;case 27:case 3:_t=!0;return;default:tt=tt.return}}function Sl(e){if(e!==tt)return!1;if(!pe)return Do(e),pe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Uc(e.type,e.memoizedProps)),a=!a),a&&De&&ba(e),Do(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));De=s0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));De=s0(e)}else t===27?(t=De,Oa(e.type)?(e=$c,$c=null,De=e):De=t):De=tt?Dt(e.stateNode.nextSibling):null;return!0}function Ja(){De=tt=null,pe=!1}function yi(){var e=va;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),va=null),e}function mn(e){va===null?va=[e]:va.push(e)}var vi=S(null),Wa=null,ea=null;function ja(e,t,a){Q(vi,t._currentValue),t._currentValue=a}function ta(e){e._currentValue=vi.current,q(vi)}function bi(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 ji(e,t,a,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var f=s.child;i=i.firstContext;e:for(;i!==null;){var g=i;i=s;for(var E=0;E<t.length;E++)if(g.context===t[E]){i.lanes|=a,g=i.alternate,g!==null&&(g.lanes|=a),bi(i.return,a,e),n||(f=null);break e}i=g.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(c(341));f.lanes|=a,i=f.alternate,i!==null&&(i.lanes|=a),bi(f,a,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function El(e,t,a,n){e=null;for(var s=t,i=!1;s!==null;){if(!i){if((s.flags&524288)!==0)i=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(c(387));if(f=f.memoizedProps,f!==null){var g=s.type;yt(s.pendingProps.value,f.value)||(e!==null?e.push(g):e=[g])}}else if(s===ee.current){if(f=s.alternate,f===null)throw Error(c(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(qn):e=[qn])}s=s.return}e!==null&&ji(t,e,a,n),t.flags|=262144}function Cs(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fa(e){Wa=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return Oo(Wa,e)}function ws(e,t){return Wa===null&&Fa(e),Oo(e,t)}function Oo(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ea===null){if(e===null)throw Error(c(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return a}var Km=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()})}},Jm=r.unstable_scheduleCallback,Wm=r.unstable_NormalPriority,Ve={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ni(){return{controller:new Km,data:new Map,refCount:0}}function hn(e){e.refCount--,e.refCount===0&&Jm(Wm,function(){e.controller.abort()})}var gn=null,Si=0,Cl=0,wl=null;function Fm(e,t){if(gn===null){var a=gn=[];Si=0,Cl=wc(),wl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Si++,t.then(Uo,Uo),t}function Uo(){if(--Si===0&&gn!==null){wl!==null&&(wl.status="fulfilled");var e=gn;gn=null,Cl=0,wl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Pm(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 Lo=k.S;k.S=function(e,t){bf=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Fm(e,t),Lo!==null&&Lo(e,t)};var Pa=S(null);function Ei(){var e=Pa.current;return e!==null?e:_e.pooledCache}function Ts(e,t){t===null?Q(Pa,Pa.current):Q(Pa,t.pool)}function Ho(){var e=Ei();return e===null?null:{parent:Ve._currentValue,pool:e}}var Tl=Error(c(460)),Ci=Error(c(474)),As=Error(c(542)),Rs={then:function(){}};function Bo(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ko(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Wt,Wt),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(Wt,Wt);else{if(e=_e,e!==null&&100<e.shellSuspendCounter)throw Error(c(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 el=t,Tl}}function Ia(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(el=a,Tl):a}}var el=null;function $o(){if(el===null)throw Error(c(459));var e=el;return el=null,e}function qo(e){if(e===Tl||e===As)throw Error(c(483))}var Al=null,pn=0;function Ms(e){var t=pn;return pn+=1,Al===null&&(Al=[]),ko(Al,e,t)}function yn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function _s(e,t){throw t.$$typeof===w?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Yo(e){function t(M,A){if(e){var D=M.deletions;D===null?(M.deletions=[A],M.flags|=16):D.push(A)}}function a(M,A){if(!e)return null;for(;A!==null;)t(M,A),A=A.sibling;return null}function n(M){for(var A=new Map;M!==null;)M.key!==null?A.set(M.key,M):A.set(M.index,M),M=M.sibling;return A}function s(M,A){return M=Pt(M,A),M.index=0,M.sibling=null,M}function i(M,A,D){return M.index=D,e?(D=M.alternate,D!==null?(D=D.index,D<A?(M.flags|=67108866,A):D):(M.flags|=67108866,A)):(M.flags|=1048576,A)}function f(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function g(M,A,D,Y){return A===null||A.tag!==6?(A=xi(D,M.mode,Y),A.return=M,A):(A=s(A,D),A.return=M,A)}function E(M,A,D,Y){var le=D.type;return le===R?$(M,A,D.props.children,Y,D.key):A!==null&&(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&Ia(le)===A.type)?(A=s(A,D.props),yn(A,D),A.return=M,A):(A=Ss(D.type,D.key,D.props,null,M.mode,Y),yn(A,D),A.return=M,A)}function O(M,A,D,Y){return A===null||A.tag!==4||A.stateNode.containerInfo!==D.containerInfo||A.stateNode.implementation!==D.implementation?(A=mi(D,M.mode,Y),A.return=M,A):(A=s(A,D.children||[]),A.return=M,A)}function $(M,A,D,Y,le){return A===null||A.tag!==7?(A=Ka(D,M.mode,Y,le),A.return=M,A):(A=s(A,D),A.return=M,A)}function G(M,A,D){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=xi(""+A,M.mode,D),A.return=M,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case _:return D=Ss(A.type,A.key,A.props,null,M.mode,D),yn(D,A),D.return=M,D;case z:return A=mi(A,M.mode,D),A.return=M,A;case K:return A=Ia(A),G(M,A,D)}if(je(A)||Ee(A))return A=Ka(A,M.mode,D,null),A.return=M,A;if(typeof A.then=="function")return G(M,Ms(A),D);if(A.$$typeof===U)return G(M,ws(M,A),D);_s(M,A)}return null}function L(M,A,D,Y){var le=A!==null?A.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return le!==null?null:g(M,A,""+D,Y);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case _:return D.key===le?E(M,A,D,Y):null;case z:return D.key===le?O(M,A,D,Y):null;case K:return D=Ia(D),L(M,A,D,Y)}if(je(D)||Ee(D))return le!==null?null:$(M,A,D,Y,null);if(typeof D.then=="function")return L(M,A,Ms(D),Y);if(D.$$typeof===U)return L(M,A,ws(M,D),Y);_s(M,D)}return null}function B(M,A,D,Y,le){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return M=M.get(D)||null,g(A,M,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case _:return M=M.get(Y.key===null?D:Y.key)||null,E(A,M,Y,le);case z:return M=M.get(Y.key===null?D:Y.key)||null,O(A,M,Y,le);case K:return Y=Ia(Y),B(M,A,D,Y,le)}if(je(Y)||Ee(Y))return M=M.get(D)||null,$(A,M,Y,le,null);if(typeof Y.then=="function")return B(M,A,D,Ms(Y),le);if(Y.$$typeof===U)return B(M,A,D,ws(A,Y),le);_s(A,Y)}return null}function F(M,A,D,Y){for(var le=null,ve=null,te=A,de=A=0,ge=null;te!==null&&de<D.length;de++){te.index>de?(ge=te,te=null):ge=te.sibling;var be=L(M,te,D[de],Y);if(be===null){te===null&&(te=ge);break}e&&te&&be.alternate===null&&t(M,te),A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be,te=ge}if(de===D.length)return a(M,te),pe&&It(M,de),le;if(te===null){for(;de<D.length;de++)te=G(M,D[de],Y),te!==null&&(A=i(te,A,de),ve===null?le=te:ve.sibling=te,ve=te);return pe&&It(M,de),le}for(te=n(te);de<D.length;de++)ge=B(te,M,de,D[de],Y),ge!==null&&(e&&ge.alternate!==null&&te.delete(ge.key===null?de:ge.key),A=i(ge,A,de),ve===null?le=ge:ve.sibling=ge,ve=ge);return e&&te.forEach(function(ka){return t(M,ka)}),pe&&It(M,de),le}function re(M,A,D,Y){if(D==null)throw Error(c(151));for(var le=null,ve=null,te=A,de=A=0,ge=null,be=D.next();te!==null&&!be.done;de++,be=D.next()){te.index>de?(ge=te,te=null):ge=te.sibling;var ka=L(M,te,be.value,Y);if(ka===null){te===null&&(te=ge);break}e&&te&&ka.alternate===null&&t(M,te),A=i(ka,A,de),ve===null?le=ka:ve.sibling=ka,ve=ka,te=ge}if(be.done)return a(M,te),pe&&It(M,de),le;if(te===null){for(;!be.done;de++,be=D.next())be=G(M,be.value,Y),be!==null&&(A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be);return pe&&It(M,de),le}for(te=n(te);!be.done;de++,be=D.next())be=B(te,M,de,be.value,Y),be!==null&&(e&&be.alternate!==null&&te.delete(be.key===null?de:be.key),A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be);return e&&te.forEach(function(ug){return t(M,ug)}),pe&&It(M,de),le}function Me(M,A,D,Y){if(typeof D=="object"&&D!==null&&D.type===R&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case _:e:{for(var le=D.key;A!==null;){if(A.key===le){if(le=D.type,le===R){if(A.tag===7){a(M,A.sibling),Y=s(A,D.props.children),Y.return=M,M=Y;break e}}else if(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&Ia(le)===A.type){a(M,A.sibling),Y=s(A,D.props),yn(Y,D),Y.return=M,M=Y;break e}a(M,A);break}else t(M,A);A=A.sibling}D.type===R?(Y=Ka(D.props.children,M.mode,Y,D.key),Y.return=M,M=Y):(Y=Ss(D.type,D.key,D.props,null,M.mode,Y),yn(Y,D),Y.return=M,M=Y)}return f(M);case z:e:{for(le=D.key;A!==null;){if(A.key===le)if(A.tag===4&&A.stateNode.containerInfo===D.containerInfo&&A.stateNode.implementation===D.implementation){a(M,A.sibling),Y=s(A,D.children||[]),Y.return=M,M=Y;break e}else{a(M,A);break}else t(M,A);A=A.sibling}Y=mi(D,M.mode,Y),Y.return=M,M=Y}return f(M);case K:return D=Ia(D),Me(M,A,D,Y)}if(je(D))return F(M,A,D,Y);if(Ee(D)){if(le=Ee(D),typeof le!="function")throw Error(c(150));return D=le.call(D),re(M,A,D,Y)}if(typeof D.then=="function")return Me(M,A,Ms(D),Y);if(D.$$typeof===U)return Me(M,A,ws(M,D),Y);_s(M,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,A!==null&&A.tag===6?(a(M,A.sibling),Y=s(A,D),Y.return=M,M=Y):(a(M,A),Y=xi(D,M.mode,Y),Y.return=M,M=Y),f(M)):a(M,A)}return function(M,A,D,Y){try{pn=0;var le=Me(M,A,D,Y);return Al=null,le}catch(te){if(te===Tl||te===As)throw te;var ve=vt(29,te,null,M.mode);return ve.lanes=Y,ve.return=M,ve}}}var tl=Yo(!0),Go=Yo(!1),Na=!1;function wi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ti(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 Sa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ea(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Se&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=Ns(e),wo(e,null,a),t}return js(e,n,t,a),Ns(e)}function vn(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,Du(e,a)}}function Ai(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var s=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?s=i=f:i=i.next=f,a=a.next}while(a!==null);i===null?s=i=t:i=i.next=t}else s=i=t;a={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,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 Ri=!1;function bn(){if(Ri){var e=wl;if(e!==null)throw e}}function jn(e,t,a,n){Ri=!1;var s=e.updateQueue;Na=!1;var i=s.firstBaseUpdate,f=s.lastBaseUpdate,g=s.shared.pending;if(g!==null){s.shared.pending=null;var E=g,O=E.next;E.next=null,f===null?i=O:f.next=O,f=E;var $=e.alternate;$!==null&&($=$.updateQueue,g=$.lastBaseUpdate,g!==f&&(g===null?$.firstBaseUpdate=O:g.next=O,$.lastBaseUpdate=E))}if(i!==null){var G=s.baseState;f=0,$=O=E=null,g=i;do{var L=g.lane&-536870913,B=L!==g.lane;if(B?(he&L)===L:(n&L)===L){L!==0&&L===Cl&&(Ri=!0),$!==null&&($=$.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var F=e,re=g;L=t;var Me=a;switch(re.tag){case 1:if(F=re.payload,typeof F=="function"){G=F.call(Me,G,L);break e}G=F;break e;case 3:F.flags=F.flags&-65537|128;case 0:if(F=re.payload,L=typeof F=="function"?F.call(Me,G,L):F,L==null)break e;G=y({},G,L);break e;case 2:Na=!0}}L=g.callback,L!==null&&(e.flags|=64,B&&(e.flags|=8192),B=s.callbacks,B===null?s.callbacks=[L]:B.push(L))}else B={lane:L,tag:g.tag,payload:g.payload,callback:g.callback,next:null},$===null?(O=$=B,E=G):$=$.next=B,f|=L;if(g=g.next,g===null){if(g=s.shared.pending,g===null)break;B=g,g=B.next,B.next=null,s.lastBaseUpdate=B,s.shared.pending=null}}while(!0);$===null&&(E=G),s.baseState=E,s.firstBaseUpdate=O,s.lastBaseUpdate=$,i===null&&(s.shared.lanes=0),Ra|=f,e.lanes=f,e.memoizedState=G}}function Vo(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Xo(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Vo(a[e],t)}var Rl=S(null),zs=S(0);function Qo(e,t){e=oa,Q(zs,e),Q(Rl,t),oa=e|t.baseLanes}function Mi(){Q(zs,oa),Q(Rl,Rl.current)}function _i(){oa=zs.current,q(Rl),q(zs)}var bt=S(null),zt=null;function Ca(e){var t=e.alternate;Q(Ye,Ye.current&1),Q(bt,e),zt===null&&(t===null||Rl.current!==null||t.memoizedState!==null)&&(zt=e)}function zi(e){Q(Ye,Ye.current),Q(bt,e),zt===null&&(zt=e)}function Zo(e){e.tag===22?(Q(Ye,Ye.current),Q(bt,e),zt===null&&(zt=e)):wa()}function wa(){Q(Ye,Ye.current),Q(bt,bt.current)}function jt(e){q(bt),zt===e&&(zt=null),q(Ye)}var Ye=S(0);function Ds(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Bc(a)||kc(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 aa=0,oe=null,Ae=null,Xe=null,Os=!1,Ml=!1,al=!1,Us=0,Nn=0,_l=null,Im=0;function ke(){throw Error(c(321))}function Di(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!yt(e[a],t[a]))return!1;return!0}function Oi(e,t,a,n,s,i){return aa=i,oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Md:Ji,al=!1,i=a(n,s),al=!1,Ml&&(i=Jo(t,a,n,s)),Ko(e),i}function Ko(e){k.H=Cn;var t=Ae!==null&&Ae.next!==null;if(aa=0,Xe=Ae=oe=null,Os=!1,Nn=0,_l=null,t)throw Error(c(300));e===null||Qe||(e=e.dependencies,e!==null&&Cs(e)&&(Qe=!0))}function Jo(e,t,a,n){oe=e;var s=0;do{if(Ml&&(_l=null),Nn=0,Ml=!1,25<=s)throw Error(c(301));if(s+=1,Xe=Ae=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}k.H=_d,i=t(a,n)}while(Ml);return i}function eh(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Sn(t):t,e=e.useState()[0],(Ae!==null?Ae.memoizedState:null)!==e&&(oe.flags|=1024),t}function Ui(){var e=Us!==0;return Us=0,e}function Li(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Hi(e){if(Os){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Os=!1}aa=0,Xe=Ae=oe=null,Ml=!1,Nn=Us=0,_l=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?oe.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ge(){if(Ae===null){var e=oe.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=Xe===null?oe.memoizedState:Xe.next;if(t!==null)Xe=t,Ae=e;else{if(e===null)throw oe.alternate===null?Error(c(467)):Error(c(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Xe===null?oe.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sn(e){var t=Nn;return Nn+=1,_l===null&&(_l=[]),e=ko(_l,e,t),t=oe,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Md:Ji),e}function Hs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sn(e);if(e.$$typeof===U)return at(e)}throw Error(c(438,String(e)))}function Bi(e){var t=null,a=oe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=oe.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=Ls(),oe.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]=W;return t.index++,a}function la(e,t){return typeof t=="function"?t(e):t}function Bs(e){var t=Ge();return ki(t,Ae,e)}function ki(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var s=e.baseQueue,i=n.pending;if(i!==null){if(s!==null){var f=s.next;s.next=i.next,i.next=f}t.baseQueue=s=i,n.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var g=f=null,E=null,O=t,$=!1;do{var G=O.lane&-536870913;if(G!==O.lane?(he&G)===G:(aa&G)===G){var L=O.revertLane;if(L===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),G===Cl&&($=!0);else if((aa&L)===L){O=O.next,L===Cl&&($=!0);continue}else G={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},E===null?(g=E=G,f=i):E=E.next=G,oe.lanes|=L,Ra|=L;G=O.action,al&&a(i,G),i=O.hasEagerState?O.eagerState:a(i,G)}else L={lane:G,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},E===null?(g=E=L,f=i):E=E.next=L,oe.lanes|=G,Ra|=G;O=O.next}while(O!==null&&O!==t);if(E===null?f=i:E.next=g,!yt(i,e.memoizedState)&&(Qe=!0,$&&(a=wl,a!==null)))throw a;e.memoizedState=i,e.baseState=f,e.baseQueue=E,n.lastRenderedState=i}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function $i(e){var t=Ge(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,s=a.pending,i=t.memoizedState;if(s!==null){a.pending=null;var f=s=s.next;do i=e(i,f.action),f=f.next;while(f!==s);yt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,n]}function Wo(e,t,a){var n=oe,s=Ge(),i=pe;if(i){if(a===void 0)throw Error(c(407));a=a()}else a=t();var f=!yt((Ae||s).memoizedState,a);if(f&&(s.memoizedState=a,Qe=!0),s=s.queue,Gi(Io.bind(null,n,s,e),[e]),s.getSnapshot!==t||f||Xe!==null&&Xe.memoizedState.tag&1){if(n.flags|=2048,zl(9,{destroy:void 0},Po.bind(null,n,s,a,t),null),_e===null)throw Error(c(349));i||(aa&127)!==0||Fo(n,t,a)}return a}function Fo(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=oe.updateQueue,t===null?(t=Ls(),oe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Po(e,t,a,n){t.value=a,t.getSnapshot=n,ed(t)&&td(e)}function Io(e,t,a){return a(function(){ed(t)&&td(e)})}function ed(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!yt(e,a)}catch{return!0}}function td(e){var t=Za(e,2);t!==null&&mt(t,e,2)}function qi(e){var t=it();if(typeof e=="function"){var a=e;if(e=a(),al){ha(!0);try{a()}finally{ha(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},t}function ad(e,t,a,n){return e.baseState=a,ki(e,Ae,typeof n=="function"?n:la)}function th(e,t,a,n,s){if(qs(e))throw Error(c(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){i.listeners.push(f)}};k.T!==null?a(!0):i.isTransition=!1,n(i),a=t.pending,a===null?(i.next=t.pending=i,ld(t,i)):(i.next=a.next,t.pending=a.next=i)}}function ld(e,t){var a=t.action,n=t.payload,s=e.state;if(t.isTransition){var i=k.T,f={};k.T=f;try{var g=a(s,n),E=k.S;E!==null&&E(f,g),nd(e,t,g)}catch(O){Yi(e,t,O)}finally{i!==null&&f.types!==null&&(i.types=f.types),k.T=i}}else try{i=a(s,n),nd(e,t,i)}catch(O){Yi(e,t,O)}}function nd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){sd(e,t,n)},function(n){return Yi(e,t,n)}):sd(e,t,a)}function sd(e,t,a){t.status="fulfilled",t.value=a,rd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,ld(e,a)))}function Yi(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,rd(t),t=t.next;while(t!==n)}e.action=null}function rd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function id(e,t){return t}function cd(e,t){if(pe){var a=_e.formState;if(a!==null){e:{var n=oe;if(pe){if(De){t:{for(var s=De,i=_t;s.nodeType!==8;){if(!i){s=null;break t}if(s=Dt(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){De=Dt(s.nextSibling),n=s.data==="F!";break e}}ba(n)}n=!1}n&&(t=a[0])}}return a=it(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:id,lastRenderedState:t},a.queue=n,a=Td.bind(null,oe,n),n.dispatch=a,n=qi(!1),i=Ki.bind(null,oe,!1,n.queue),n=it(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,a=th.bind(null,oe,s,i,a),s.dispatch=a,n.memoizedState=e,[t,a,!1]}function ud(e){var t=Ge();return od(t,Ae,e)}function od(e,t,a){if(t=ki(e,t,id)[0],e=Bs(la)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Sn(t)}catch(f){throw f===Tl?As:f}else n=t;t=Ge();var s=t.queue,i=s.dispatch;return a!==t.memoizedState&&(oe.flags|=2048,zl(9,{destroy:void 0},ah.bind(null,s,a),null)),[n,i,e]}function ah(e,t){e.action=t}function dd(e){var t=Ge(),a=Ae;if(a!==null)return od(t,a,e);Ge(),t=t.memoizedState,a=Ge();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function zl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=oe.updateQueue,t===null&&(t=Ls(),oe.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 fd(){return Ge().memoizedState}function ks(e,t,a,n){var s=it();oe.flags|=e,s.memoizedState=zl(1|t,{destroy:void 0},a,n===void 0?null:n)}function $s(e,t,a,n){var s=Ge();n=n===void 0?null:n;var i=s.memoizedState.inst;Ae!==null&&n!==null&&Di(n,Ae.memoizedState.deps)?s.memoizedState=zl(t,i,a,n):(oe.flags|=e,s.memoizedState=zl(1|t,i,a,n))}function xd(e,t){ks(8390656,8,e,t)}function Gi(e,t){$s(2048,8,e,t)}function lh(e){oe.flags|=4;var t=oe.updateQueue;if(t===null)t=Ls(),oe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function md(e){var t=Ge().memoizedState;return lh({ref:t,nextImpl:e}),function(){if((Se&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function hd(e,t){return $s(4,2,e,t)}function gd(e,t){return $s(4,4,e,t)}function pd(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 yd(e,t,a){a=a!=null?a.concat([e]):null,$s(4,4,pd.bind(null,t,e),a)}function Vi(){}function vd(e,t){var a=Ge();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Di(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function bd(e,t){var a=Ge();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Di(t,n[1]))return n[0];if(n=e(),al){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[n,t],n}function Xi(e,t,a){return a===void 0||(aa&1073741824)!==0&&(he&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Nf(),oe.lanes|=e,Ra|=e,a)}function jd(e,t,a,n){return yt(a,t)?a:Rl.current!==null?(e=Xi(e,a,n),yt(e,t)||(Qe=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(he&261930)===0?(Qe=!0,e.memoizedState=a):(e=Nf(),oe.lanes|=e,Ra|=e,t)}function Nd(e,t,a,n,s){var i=X.p;X.p=i!==0&&8>i?i:8;var f=k.T,g={};k.T=g,Ki(e,!1,t,a);try{var E=s(),O=k.S;if(O!==null&&O(g,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var $=Pm(E,n);En(e,t,$,Et(e))}else En(e,t,n,Et(e))}catch(G){En(e,t,{then:function(){},status:"rejected",reason:G},Et())}finally{X.p=i,f!==null&&g.types!==null&&(f.types=g.types),k.T=f}}function nh(){}function Qi(e,t,a,n){if(e.tag!==5)throw Error(c(476));var s=Sd(e).queue;Nd(e,s,t,se,a===null?nh:function(){return Ed(e),a(n)})}function Sd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:se},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ed(e){var t=Sd(e);t.next===null&&(t=e.alternate.memoizedState),En(e,t.next.queue,{},Et())}function Zi(){return at(qn)}function Cd(){return Ge().memoizedState}function wd(){return Ge().memoizedState}function sh(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Et();e=Sa(a);var n=Ea(t,e,a);n!==null&&(mt(n,t,a),vn(n,t,a)),t={cache:Ni()},e.payload=t;return}t=t.return}}function rh(e,t,a){var n=Et();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},qs(e)?Ad(t,a):(a=di(e,t,a,n),a!==null&&(mt(a,e,n),Rd(a,t,n)))}function Td(e,t,a){var n=Et();En(e,t,a,n)}function En(e,t,a,n){var s={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(qs(e))Ad(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var f=t.lastRenderedState,g=i(f,a);if(s.hasEagerState=!0,s.eagerState=g,yt(g,f))return js(e,t,s,0),_e===null&&bs(),!1}catch{}if(a=di(e,t,s,n),a!==null)return mt(a,e,n),Rd(a,t,n),!0}return!1}function Ki(e,t,a,n){if(n={lane:2,revertLane:wc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qs(e)){if(t)throw Error(c(479))}else t=di(e,a,n,2),t!==null&&mt(t,e,2)}function qs(e){var t=e.alternate;return e===oe||t!==null&&t===oe}function Ad(e,t){Ml=Os=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Rd(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Du(e,a)}}var Cn={readContext:at,use:Hs,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useLayoutEffect:ke,useInsertionEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useSyncExternalStore:ke,useId:ke,useHostTransitionStatus:ke,useFormState:ke,useActionState:ke,useOptimistic:ke,useMemoCache:ke,useCacheRefresh:ke};Cn.useEffectEvent=ke;var Md={readContext:at,use:Hs,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:xd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ks(4194308,4,pd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){ks(4,2,e,t)},useMemo:function(e,t){var a=it();t=t===void 0?null:t;var n=e();if(al){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=it();if(a!==void 0){var s=a(t);if(al){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=rh.bind(null,oe,e),[n.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=qi(e);var t=e.queue,a=Td.bind(null,oe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Vi,useDeferredValue:function(e,t){var a=it();return Xi(a,e,t)},useTransition:function(){var e=qi(!1);return e=Nd.bind(null,oe,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=oe,s=it();if(pe){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),_e===null)throw Error(c(349));(he&127)!==0||Fo(n,t,a)}s.memoizedState=a;var i={value:a,getSnapshot:t};return s.queue=i,xd(Io.bind(null,n,i,e),[e]),n.flags|=2048,zl(9,{destroy:void 0},Po.bind(null,n,i,a,t),null),a},useId:function(){var e=it(),t=_e.identifierPrefix;if(pe){var a=Xt,n=Vt;a=(n&~(1<<32-pt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Us++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Im++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zi,useFormState:cd,useActionState:cd,useOptimistic:function(e){var t=it();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Ki.bind(null,oe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Bi,useCacheRefresh:function(){return it().memoizedState=sh.bind(null,oe)},useEffectEvent:function(e){var t=it(),a={impl:e};return t.memoizedState=a,function(){if((Se&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},Ji={readContext:at,use:Hs,useCallback:vd,useContext:at,useEffect:Gi,useImperativeHandle:yd,useInsertionEffect:hd,useLayoutEffect:gd,useMemo:bd,useReducer:Bs,useRef:fd,useState:function(){return Bs(la)},useDebugValue:Vi,useDeferredValue:function(e,t){var a=Ge();return jd(a,Ae.memoizedState,e,t)},useTransition:function(){var e=Bs(la)[0],t=Ge().memoizedState;return[typeof e=="boolean"?e:Sn(e),t]},useSyncExternalStore:Wo,useId:Cd,useHostTransitionStatus:Zi,useFormState:ud,useActionState:ud,useOptimistic:function(e,t){var a=Ge();return ad(a,Ae,e,t)},useMemoCache:Bi,useCacheRefresh:wd};Ji.useEffectEvent=md;var _d={readContext:at,use:Hs,useCallback:vd,useContext:at,useEffect:Gi,useImperativeHandle:yd,useInsertionEffect:hd,useLayoutEffect:gd,useMemo:bd,useReducer:$i,useRef:fd,useState:function(){return $i(la)},useDebugValue:Vi,useDeferredValue:function(e,t){var a=Ge();return Ae===null?Xi(a,e,t):jd(a,Ae.memoizedState,e,t)},useTransition:function(){var e=$i(la)[0],t=Ge().memoizedState;return[typeof e=="boolean"?e:Sn(e),t]},useSyncExternalStore:Wo,useId:Cd,useHostTransitionStatus:Zi,useFormState:dd,useActionState:dd,useOptimistic:function(e,t){var a=Ge();return Ae!==null?ad(a,Ae,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Bi,useCacheRefresh:wd};_d.useEffectEvent=md;function Wi(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Fi={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Et(),s=Sa(n);s.payload=t,a!=null&&(s.callback=a),t=Ea(e,s,n),t!==null&&(mt(t,e,n),vn(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Et(),s=Sa(n);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=Ea(e,s,n),t!==null&&(mt(t,e,n),vn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Et(),n=Sa(a);n.tag=2,t!=null&&(n.callback=t),t=Ea(e,n,a),t!==null&&(mt(t,e,a),vn(t,e,a))}};function zd(e,t,a,n,s,i,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,f):t.prototype&&t.prototype.isPureReactComponent?!dn(a,n)||!dn(s,i):!0}function Dd(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&&Fi.enqueueReplaceState(t,t.state,null)}function ll(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=y({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}function Od(e){vs(e)}function Ud(e){console.error(e)}function Ld(e){vs(e)}function Ys(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Hd(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 Pi(e,t,a){return a=Sa(a),a.tag=3,a.payload={element:null},a.callback=function(){Ys(e,t)},a}function Bd(e){return e=Sa(e),e.tag=3,e}function kd(e,t,a,n){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var i=n.value;e.payload=function(){return s(i)},e.callback=function(){Hd(t,a,n)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Hd(t,a,n),typeof s!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var g=n.stack;this.componentDidCatch(n.value,{componentStack:g!==null?g:""})})}function ih(e,t,a,n,s){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&El(t,a,s,!0),a=bt.current,a!==null){switch(a.tag){case 31:case 13:return zt===null?er():a.alternate===null&&$e===0&&($e=3),a.flags&=-257,a.flags|=65536,a.lanes=s,n===Rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Sc(e,n,s)),!1;case 22:return a.flags|=65536,n===Rs?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)),Sc(e,n,s)),!1}throw Error(c(435,a.tag))}return Sc(e,n,s),er(),!1}if(pe)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==pi&&(e=Error(c(422),{cause:n}),mn(At(e,a)))):(n!==pi&&(t=Error(c(423),{cause:n}),mn(At(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=At(n,a),s=Pi(e.stateNode,n,s),Ai(e,s),$e!==4&&($e=2)),!1;var i=Error(c(520),{cause:n});if(i=At(i,a),Dn===null?Dn=[i]:Dn.push(i),$e!==4&&($e=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=Pi(a.stateNode,n,e),Ai(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ma===null||!Ma.has(i))))return a.flags|=65536,s&=-s,a.lanes|=s,s=Bd(s),kd(s,e,a,n),Ai(a,s),!1}a=a.return}while(a!==null);return!1}var Ii=Error(c(461)),Qe=!1;function lt(e,t,a,n){t.child=e===null?Go(t,null,a,n):tl(t,e.child,a,n)}function $d(e,t,a,n,s){a=a.render;var i=t.ref;if("ref"in n){var f={};for(var g in n)g!=="ref"&&(f[g]=n[g])}else f=n;return Fa(t),n=Oi(e,t,a,f,i,s),g=Ui(),e!==null&&!Qe?(Li(e,t,s),na(e,t,s)):(pe&&g&&hi(t),t.flags|=1,lt(e,t,n,s),t.child)}function qd(e,t,a,n,s){if(e===null){var i=a.type;return typeof i=="function"&&!fi(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Yd(e,t,i,n,s)):(e=Ss(a.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!ic(e,s)){var f=i.memoizedProps;if(a=a.compare,a=a!==null?a:dn,a(f,n)&&e.ref===t.ref)return na(e,t,s)}return t.flags|=1,e=Pt(i,n),e.ref=t.ref,e.return=t,t.child=e}function Yd(e,t,a,n,s){if(e!==null){var i=e.memoizedProps;if(dn(i,n)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=n=i,ic(e,s))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,na(e,t,s)}return ec(e,t,a,n,s)}function Gd(e,t,a,n){var s=n.children,i=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(i=i!==null?i.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&~i}else n=0,t.child=null;return Vd(e,t,i,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ts(t,i!==null?i.cachePool:null),i!==null?Qo(t,i):Mi(),Zo(t);else return n=t.lanes=536870912,Vd(e,t,i!==null?i.baseLanes|a:a,a,n)}else i!==null?(Ts(t,i.cachePool),Qo(t,i),wa(),t.memoizedState=null):(e!==null&&Ts(t,null),Mi(),wa());return lt(e,t,s,a),t.child}function wn(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 i=Ei();return i=i===null?null:{parent:Ve._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Ts(t,null),Mi(),Zo(t),e!==null&&El(e,t,n,!0),t.childLanes=s,null}function Gs(e,t){return t=Xs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xd(e,t,a){return tl(t,e.child,null,a),e=Gs(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function ch(e,t,a){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(pe){if(n.mode==="hidden")return e=Gs(t,n),t.lanes=536870912,wn(null,e);if(zi(t),(e=De)?(e=n0(e,_t),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Vt,overflow:Xt}:null,retryLane:536870912,hydrationErrors:null},a=Ao(e),a.return=t,t.child=a,tt=t,De=null)):e=null,e===null)throw ba(t);return t.lanes=536870912,null}return Gs(t,n)}var i=e.memoizedState;if(i!==null){var f=i.dehydrated;if(zi(t),s)if(t.flags&256)t.flags&=-257,t=Xd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Qe||El(e,t,a,!1),s=(a&e.childLanes)!==0,Qe||s){if(n=_e,n!==null&&(f=Ou(n,a),f!==0&&f!==i.retryLane))throw i.retryLane=f,Za(e,f),mt(n,e,f),Ii;er(),t=Xd(e,t,a)}else e=i.treeContext,De=Dt(f.nextSibling),tt=t,pe=!0,va=null,_t=!1,e!==null&&_o(t,e),t=Gs(t,n),t.flags|=4096;return t}return e=Pt(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vs(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(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ec(e,t,a,n,s){return Fa(t),a=Oi(e,t,a,n,void 0,s),n=Ui(),e!==null&&!Qe?(Li(e,t,s),na(e,t,s)):(pe&&n&&hi(t),t.flags|=1,lt(e,t,a,s),t.child)}function Qd(e,t,a,n,s,i){return Fa(t),t.updateQueue=null,a=Jo(t,n,a,s),Ko(e),n=Ui(),e!==null&&!Qe?(Li(e,t,i),na(e,t,i)):(pe&&n&&hi(t),t.flags|=1,lt(e,t,a,i),t.child)}function Zd(e,t,a,n,s){if(Fa(t),t.stateNode===null){var i=bl,f=a.contextType;typeof f=="object"&&f!==null&&(i=at(f)),i=new a(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Fi,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},wi(t),f=a.contextType,i.context=typeof f=="object"&&f!==null?at(f):bl,i.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(Wi(t,a,f,n),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(f=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),f!==i.state&&Fi.enqueueReplaceState(i,i.state,null),jn(t,n,i,s),bn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var g=t.memoizedProps,E=ll(a,g);i.props=E;var O=i.context,$=a.contextType;f=bl,typeof $=="object"&&$!==null&&(f=at($));var G=a.getDerivedStateFromProps;$=typeof G=="function"||typeof i.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,$||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(g||O!==f)&&Dd(t,i,n,f),Na=!1;var L=t.memoizedState;i.state=L,jn(t,n,i,s),bn(),O=t.memoizedState,g||L!==O||Na?(typeof G=="function"&&(Wi(t,a,G,n),O=t.memoizedState),(E=Na||zd(t,a,E,n,L,O,f))?($||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=O),i.props=n,i.state=O,i.context=f,n=E):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Ti(e,t),f=t.memoizedProps,$=ll(a,f),i.props=$,G=t.pendingProps,L=i.context,O=a.contextType,E=bl,typeof O=="object"&&O!==null&&(E=at(O)),g=a.getDerivedStateFromProps,(O=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f!==G||L!==E)&&Dd(t,i,n,E),Na=!1,L=t.memoizedState,i.state=L,jn(t,n,i,s),bn();var B=t.memoizedState;f!==G||L!==B||Na||e!==null&&e.dependencies!==null&&Cs(e.dependencies)?(typeof g=="function"&&(Wi(t,a,g,n),B=t.memoizedState),($=Na||zd(t,a,$,n,L,B,E)||e!==null&&e.dependencies!==null&&Cs(e.dependencies))?(O||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,B,E),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,B,E)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=B),i.props=n,i.state=B,i.context=E,n=$):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,Vs(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=tl(t,e.child,null,s),t.child=tl(t,null,a,s)):lt(e,t,a,s),t.memoizedState=i.state,e=t.child):e=na(e,t,s),e}function Kd(e,t,a,n){return Ja(),t.flags|=256,lt(e,t,a,n),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:Ho()}}function lc(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,i=(t.flags&128)!==0,f;if((f=i)||(f=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(pe){if(s?Ca(t):wa(),(e=De)?(e=n0(e,_t),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Vt,overflow:Xt}:null,retryLane:536870912,hydrationErrors:null},a=Ao(e),a.return=t,t.child=a,tt=t,De=null)):e=null,e===null)throw ba(t);return kc(e)?t.lanes=32:t.lanes=536870912,null}var g=n.children;return n=n.fallback,s?(wa(),s=t.mode,g=Xs({mode:"hidden",children:g},s),n=Ka(n,s,a,null),g.return=t,n.return=t,g.sibling=n,t.child=g,n=t.child,n.memoizedState=ac(a),n.childLanes=lc(e,f,a),t.memoizedState=tc,wn(null,n)):(Ca(t),nc(t,g))}var E=e.memoizedState;if(E!==null&&(g=E.dehydrated,g!==null)){if(i)t.flags&256?(Ca(t),t.flags&=-257,t=sc(e,t,a)):t.memoizedState!==null?(wa(),t.child=e.child,t.flags|=128,t=null):(wa(),g=n.fallback,s=t.mode,n=Xs({mode:"visible",children:n.children},s),g=Ka(g,s,a,null),g.flags|=2,n.return=t,g.return=t,n.sibling=g,t.child=n,tl(t,e.child,null,a),n=t.child,n.memoizedState=ac(a),n.childLanes=lc(e,f,a),t.memoizedState=tc,t=wn(null,n));else if(Ca(t),kc(g)){if(f=g.nextSibling&&g.nextSibling.dataset,f)var O=f.dgst;f=O,n=Error(c(419)),n.stack="",n.digest=f,mn({value:n,source:null,stack:null}),t=sc(e,t,a)}else if(Qe||El(e,t,a,!1),f=(a&e.childLanes)!==0,Qe||f){if(f=_e,f!==null&&(n=Ou(f,a),n!==0&&n!==E.retryLane))throw E.retryLane=n,Za(e,n),mt(f,e,n),Ii;Bc(g)||er(),t=sc(e,t,a)}else Bc(g)?(t.flags|=192,t.child=e.child,t=null):(e=E.treeContext,De=Dt(g.nextSibling),tt=t,pe=!0,va=null,_t=!1,e!==null&&_o(t,e),t=nc(t,n.children),t.flags|=4096);return t}return s?(wa(),g=n.fallback,s=t.mode,E=e.child,O=E.sibling,n=Pt(E,{mode:"hidden",children:n.children}),n.subtreeFlags=E.subtreeFlags&65011712,O!==null?g=Pt(O,g):(g=Ka(g,s,a,null),g.flags|=2),g.return=t,n.return=t,n.sibling=g,t.child=n,wn(null,n),n=t.child,g=e.child.memoizedState,g===null?g=ac(a):(s=g.cachePool,s!==null?(E=Ve._currentValue,s=s.parent!==E?{parent:E,pool:E}:s):s=Ho(),g={baseLanes:g.baseLanes|a,cachePool:s}),n.memoizedState=g,n.childLanes=lc(e,f,a),t.memoizedState=tc,wn(e.child,n)):(Ca(t),a=e.child,e=a.sibling,a=Pt(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function nc(e,t){return t=Xs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Xs(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function sc(e,t,a){return tl(t,e.child,null,a),e=nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wd(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),bi(e.return,t,a)}function rc(e,t,a,n,s,i){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:s,treeForkCount:i}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=a,f.tailMode=s,f.treeForkCount=i)}function Fd(e,t,a){var n=t.pendingProps,s=n.revealOrder,i=n.tail;n=n.children;var f=Ye.current,g=(f&2)!==0;if(g?(f=f&1|2,t.flags|=128):f&=1,Q(Ye,f),lt(e,t,n,a),n=pe?xn:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Wd(e,a,t);else if(e.tag===19)Wd(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&&Ds(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),rc(t,!1,s,a,i,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&&Ds(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}rc(t,!0,a,null,i,n);break;case"together":rc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function na(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ra|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(El(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=Pt(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Pt(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function ic(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Cs(e)))}function uh(e,t,a){switch(t.tag){case 3:Ke(t,t.stateNode.containerInfo),ja(t,Ve,e.memoizedState.cache),Ja();break;case 27:case 5:Fl(t);break;case 4:Ke(t,t.stateNode.containerInfo);break;case 10:ja(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zi(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Ca(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Jd(e,t,a):(Ca(t),e=na(e,t,a),e!==null?e.sibling:null);Ca(t);break;case 19:var s=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(El(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),Q(Ye,Ye.current),n)break;return null;case 22:return t.lanes=0,Gd(e,t,a,t.pendingProps);case 24:ja(t,Ve,e.memoizedState.cache)}return na(e,t,a)}function Pd(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!ic(e,a)&&(t.flags&128)===0)return Qe=!1,uh(e,t,a);Qe=(e.flags&131072)!==0}else Qe=!1,pe&&(t.flags&1048576)!==0&&Mo(t,xn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e=="function")fi(e)?(n=ll(e,n),t.tag=1,t=Zd(null,t,e,n,a)):(t.tag=0,t=ec(null,t,e,n,a));else{if(e!=null){var s=e.$$typeof;if(s===J){t.tag=11,t=$d(null,t,e,n,a);break e}else if(s===Z){t.tag=14,t=qd(null,t,e,n,a);break e}}throw t=ze(e)||e,Error(c(306,t,""))}}return t;case 0:return ec(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,s=ll(n,t.pendingProps),Zd(e,t,n,s,a);case 3:e:{if(Ke(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var i=t.memoizedState;s=i.element,Ti(e,t),jn(t,n,null,a);var f=t.memoizedState;if(n=f.cache,ja(t,Ve,n),n!==i.cache&&ji(t,[Ve],a,!0),bn(),n=f.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Kd(e,t,n,a);break e}else if(n!==s){s=At(Error(c(424)),t),mn(s),t=Kd(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,De=Dt(e.firstChild),tt=t,pe=!0,va=null,_t=!0,a=Go(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ja(),n===s){t=na(e,t,a);break e}lt(e,t,n,a)}t=t.child}return t;case 26:return Vs(e,t),e===null?(a=o0(t.type,null,t.pendingProps,null))?t.memoizedState=a:pe||(a=t.type,e=t.pendingProps,n=ir(fe.current).createElement(a),n[et]=t,n[ct]=e,nt(n,a,e),Fe(n),t.stateNode=n):t.memoizedState=o0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Fl(t),e===null&&pe&&(n=t.stateNode=i0(t.type,t.pendingProps,fe.current),tt=t,_t=!0,s=De,Oa(t.type)?($c=s,De=Dt(n.firstChild)):De=s),lt(e,t,t.pendingProps.children,a),Vs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&pe&&((s=n=De)&&(n=kh(n,t.type,t.pendingProps,_t),n!==null?(t.stateNode=n,tt=t,De=Dt(n.firstChild),_t=!1,s=!0):s=!1),s||ba(t)),Fl(t),s=t.type,i=t.pendingProps,f=e!==null?e.memoizedProps:null,n=i.children,Uc(s,i)?n=null:f!==null&&Uc(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Oi(e,t,eh,null,null,a),qn._currentValue=s),Vs(e,t),lt(e,t,n,a),t.child;case 6:return e===null&&pe&&((e=a=De)&&(a=$h(a,t.pendingProps,_t),a!==null?(t.stateNode=a,tt=t,De=null,e=!0):e=!1),e||ba(t)),null;case 13:return Jd(e,t,a);case 4:return Ke(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=tl(t,null,n,a):lt(e,t,n,a),t.child;case 11:return $d(e,t,t.type,t.pendingProps,a);case 7:return lt(e,t,t.pendingProps,a),t.child;case 8:return lt(e,t,t.pendingProps.children,a),t.child;case 12:return lt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,ja(t,t.type,n.value),lt(e,t,n.children,a),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,Fa(t),s=at(s),n=n(s),t.flags|=1,lt(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 ch(e,t,a);case 22:return Gd(e,t,a,t.pendingProps);case 24:return Fa(t),n=at(Ve),e===null?(s=Ei(),s===null&&(s=_e,i=Ni(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=a),s=i),t.memoizedState={parent:n,cache:s},wi(t),ja(t,Ve,s)):((e.lanes&a)!==0&&(Ti(e,t),jn(t,null,null,a),bn()),s=e.memoizedState,i=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),ja(t,Ve,n)):(n=i.cache,ja(t,Ve,n),n!==s.cache&&ji(t,[Ve],a,!0))),lt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function sa(e){e.flags|=4}function cc(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(wf())e.flags|=8192;else throw el=Rs,Ci}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,!h0(t))if(wf())e.flags|=8192;else throw el=Rs,Ci}function Qs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?_u():536870912,e.lanes|=t,Ll|=t)}function Tn(e,t){if(!pe)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 Oe(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 oh(e,t,a){var n=t.pendingProps;switch(gi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return Oe(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ta(Ve),qe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Sl(t)?sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,yi())),Oe(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(sa(t),i!==null?(Oe(t),Id(t,i)):(Oe(t),cc(t,s,null,n,a))):i?i!==e.memoizedState?(sa(t),Oe(t),Id(t,i)):(Oe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&sa(t),Oe(t),cc(t,s,e,n,a)),null;case 27:if(ls(t),a=fe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Oe(t),null}e=P.current,Sl(t)?zo(t):(e=i0(s,n,a),t.stateNode=e,sa(t))}return Oe(t),null;case 5:if(ls(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Oe(t),null}if(i=P.current,Sl(t))zo(t);else{var f=ir(fe.current);switch(i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?f.createElement(s,{is:n.is}):f.createElement(s)}}i[et]=t,i[ct]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=i;e:switch(nt(i,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&&sa(t)}}return Oe(t),cc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=fe.current,Sl(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,s=tt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[et]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Wf(e.nodeValue,a)),e||ba(t,!0)}else e=ir(e).createTextNode(n),e[et]=t,t.stateNode=e}return Oe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Sl(t),a!==null){if(e===null){if(!n)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[et]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Oe(t),e=!1}else a=yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Oe(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Sl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(c(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(c(317));s[et]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Oe(t),s=!1}else s=yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(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),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Qs(t,t.updateQueue),Oe(t),null);case 4:return qe(),e===null&&Mc(t.stateNode.containerInfo),Oe(t),null;case 10:return ta(t.type),Oe(t),null;case 19:if(q(Ye),n=t.memoizedState,n===null)return Oe(t),null;if(s=(t.flags&128)!==0,i=n.rendering,i===null)if(s)Tn(n,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Ds(e),i!==null){for(t.flags|=128,Tn(n,!1),e=i.updateQueue,t.updateQueue=e,Qs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)To(a,e),a=a.sibling;return Q(Ye,Ye.current&1|2),pe&&It(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&ht()>Fs&&(t.flags|=128,s=!0,Tn(n,!1),t.lanes=4194304)}else{if(!s)if(e=Ds(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Qs(t,e),Tn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!pe)return Oe(t),null}else 2*ht()-n.renderingStartTime>Fs&&a!==536870912&&(t.flags|=128,s=!0,Tn(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ht(),e.sibling=null,a=Ye.current,Q(Ye,s?a&1|2:a&1),pe&&It(t,n.treeForkCount),e):(Oe(t),null);case 22:case 23:return jt(t),_i(),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&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),a=t.updateQueue,a!==null&&Qs(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&&q(Pa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ta(Ve),Oe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function dh(e,t){switch(gi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(Ve),qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ls(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(c(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ye),null;case 4:return qe(),null;case 10:return ta(t.type),null;case 22:case 23:return jt(t),_i(),e!==null&&q(Pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(Ve),null;case 25:return null;default:return null}}function ef(e,t){switch(gi(t),t.tag){case 3:ta(Ve),qe();break;case 26:case 27:case 5:ls(t);break;case 4:qe();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:q(Ye);break;case 10:ta(t.type);break;case 22:case 23:jt(t),_i(),e!==null&&q(Pa);break;case 24:ta(Ve)}}function An(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 i=a.create,f=a.inst;n=i(),f.destroy=n}a=a.next}while(a!==s)}}catch(g){we(t,t.return,g)}}function Ta(e,t,a){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){var f=n.inst,g=f.destroy;if(g!==void 0){f.destroy=void 0,s=t;var E=a,O=g;try{O()}catch($){we(s,E,$)}}}n=n.next}while(n!==i)}}catch($){we(t,t.return,$)}}function tf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Xo(t,a)}catch(n){we(e,e.return,n)}}}function af(e,t,a){a.props=ll(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){we(e,t,n)}}function Rn(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){we(e,t,s)}}function Qt(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(s){we(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){we(e,t,s)}else a.current=null}function lf(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){we(e,e.return,s)}}function uc(e,t,a){try{var n=e.stateNode;Dh(n,e.type,a,t),n[ct]=t}catch(s){we(e,e.return,s)}}function nf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function oc(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&&Oa(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 dc(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=Wt));else if(n!==4&&(n===27&&Oa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(dc(e,t,a),e=e.sibling;e!==null;)dc(e,t,a),e=e.sibling}function Zs(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&&Oa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Zs(e,t,a),e=e.sibling;e!==null;)Zs(e,t,a),e=e.sibling}function sf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);nt(t,n,a),t[et]=e,t[ct]=a}catch(i){we(e,e.return,i)}}var ra=!1,Ze=!1,fc=!1,rf=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function fh(e,t){if(e=e.containerInfo,Dc=mr,e=yo(e),si(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,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var f=0,g=-1,E=-1,O=0,$=0,G=e,L=null;t:for(;;){for(var B;G!==a||s!==0&&G.nodeType!==3||(g=f+s),G!==i||n!==0&&G.nodeType!==3||(E=f+n),G.nodeType===3&&(f+=G.nodeValue.length),(B=G.firstChild)!==null;)L=G,G=B;for(;;){if(G===e)break t;if(L===a&&++O===s&&(g=f),L===i&&++$===n&&(E=f),(B=G.nextSibling)!==null)break;G=L,L=G.parentNode}G=B}a=g===-1||E===-1?null:{start:g,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(Oc={focusedElem:e,selectionRange:a},mr=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){switch(t=Pe,i=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&&i!==null){e=void 0,a=t,s=i.memoizedProps,i=i.memoizedState,n=a.stateNode;try{var F=ll(a.type,s);e=n.getSnapshotBeforeUpdate(F,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(re){we(a,a.return,re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Hc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Hc(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Pe=e;break}Pe=t.return}}function cf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:ca(e,a),n&4&&An(5,a);break;case 1:if(ca(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){we(a,a.return,f)}else{var s=ll(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){we(a,a.return,f)}}n&64&&tf(a),n&512&&Rn(a,a.return);break;case 3:if(ca(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{Xo(e,t)}catch(f){we(a,a.return,f)}}break;case 27:t===null&&n&4&&sf(a);case 26:case 5:ca(e,a),t===null&&n&4&&lf(a),n&512&&Rn(a,a.return);break;case 12:ca(e,a);break;case 31:ca(e,a),n&4&&df(e,a);break;case 13:ca(e,a),n&4&&ff(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=jh.bind(null,a),qh(e,a))));break;case 22:if(n=a.memoizedState!==null||ra,!n){t=t!==null&&t.memoizedState!==null||Ze,s=ra;var i=Ze;ra=n,(Ze=t)&&!i?ua(e,a,(a.subtreeFlags&8772)!==0):ca(e,a),ra=s,Ze=i}break;case 30:break;default:ca(e,a)}}function uf(e){var t=e.alternate;t!==null&&(e.alternate=null,uf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Yr(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 Le=null,ot=!1;function ia(e,t,a){for(a=a.child;a!==null;)of(e,t,a),a=a.sibling}function of(e,t,a){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Pl,a)}catch{}switch(a.tag){case 26:Ze||Qt(a,t),ia(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ze||Qt(a,t);var n=Le,s=ot;Oa(a.type)&&(Le=a.stateNode,ot=!1),ia(e,t,a),Bn(a.stateNode),Le=n,ot=s;break;case 5:Ze||Qt(a,t);case 6:if(n=Le,s=ot,Le=null,ia(e,t,a),Le=n,ot=s,Le!==null)if(ot)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(a.stateNode)}catch(i){we(a,t,i)}else try{Le.removeChild(a.stateNode)}catch(i){we(a,t,i)}break;case 18:Le!==null&&(ot?(e=Le,a0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Vl(e)):a0(Le,a.stateNode));break;case 4:n=Le,s=ot,Le=a.stateNode.containerInfo,ot=!0,ia(e,t,a),Le=n,ot=s;break;case 0:case 11:case 14:case 15:Ta(2,a,t),Ze||Ta(4,a,t),ia(e,t,a);break;case 1:Ze||(Qt(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&af(a,t,n)),ia(e,t,a);break;case 21:ia(e,t,a);break;case 22:Ze=(n=Ze)||a.memoizedState!==null,ia(e,t,a),Ze=n;break;default:ia(e,t,a)}}function df(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vl(e)}catch(a){we(t,t.return,a)}}}function ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vl(e)}catch(a){we(t,t.return,a)}}function xh(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rf),t;default:throw Error(c(435,e.tag))}}function Ks(e,t){var a=xh(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var s=Nh.bind(null,e,n);n.then(s,s)}})}function dt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var s=a[n],i=e,f=t,g=f;e:for(;g!==null;){switch(g.tag){case 27:if(Oa(g.type)){Le=g.stateNode,ot=!1;break e}break;case 5:Le=g.stateNode,ot=!1;break e;case 3:case 4:Le=g.stateNode.containerInfo,ot=!0;break e}g=g.return}if(Le===null)throw Error(c(160));of(i,f,s),Le=null,ot=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xf(t,e),t=t.sibling}var Bt=null;function xf(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dt(t,e),ft(e),n&4&&(Ta(3,e,e.return),An(3,e),Ta(5,e,e.return));break;case 1:dt(t,e),ft(e),n&512&&(Ze||a===null||Qt(a,a.return)),n&64&&ra&&(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=Bt;if(dt(t,e),ft(e),n&512&&(Ze||a===null||Qt(a,a.return)),n&4){var i=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":i=s.getElementsByTagName("title")[0],(!i||i[tn]||i[et]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(n),s.head.insertBefore(i,s.querySelector("head > title"))),nt(i,n,a),i[et]=e,Fe(i),n=i;break e;case"link":var f=x0("link","href",s).get(n+(a.href||""));if(f){for(var g=0;g<f.length;g++)if(i=f[g],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(g,1);break t}}i=s.createElement(n),nt(i,n,a),s.head.appendChild(i);break;case"meta":if(f=x0("meta","content",s).get(n+(a.content||""))){for(g=0;g<f.length;g++)if(i=f[g],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(g,1);break t}}i=s.createElement(n),nt(i,n,a),s.head.appendChild(i);break;default:throw Error(c(468,n))}i[et]=e,Fe(i),n=i}e.stateNode=n}else m0(s,e.type,e.stateNode);else e.stateNode=f0(s,n,e.memoizedProps);else i!==n?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,n===null?m0(s,e.type,e.stateNode):f0(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&uc(e,e.memoizedProps,a.memoizedProps)}break;case 27:dt(t,e),ft(e),n&512&&(Ze||a===null||Qt(a,a.return)),a!==null&&n&4&&uc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(dt(t,e),ft(e),n&512&&(Ze||a===null||Qt(a,a.return)),e.flags&32){s=e.stateNode;try{xl(s,"")}catch(F){we(e,e.return,F)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,uc(e,s,a!==null?a.memoizedProps:s)),n&1024&&(fc=!0);break;case 6:if(dt(t,e),ft(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(F){we(e,e.return,F)}}break;case 3:if(or=null,s=Bt,Bt=cr(t.containerInfo),dt(t,e),Bt=s,ft(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Vl(t.containerInfo)}catch(F){we(e,e.return,F)}fc&&(fc=!1,mf(e));break;case 4:n=Bt,Bt=cr(e.stateNode.containerInfo),dt(t,e),ft(e),Bt=n;break;case 12:dt(t,e),ft(e);break;case 31:dt(t,e),ft(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ks(e,n)));break;case 13:dt(t,e),ft(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ws=ht()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ks(e,n)));break;case 22:s=e.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,O=ra,$=Ze;if(ra=O||s,Ze=$||E,dt(t,e),Ze=$,ra=O,ft(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||E||ra||Ze||nl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){E=a=t;try{if(i=E.stateNode,s)f=i.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{g=E.stateNode;var G=E.memoizedProps.style,L=G!=null&&G.hasOwnProperty("display")?G.display:null;g.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(F){we(E,E.return,F)}}}else if(t.tag===6){if(a===null){E=t;try{E.stateNode.nodeValue=s?"":E.memoizedProps}catch(F){we(E,E.return,F)}}}else if(t.tag===18){if(a===null){E=t;try{var B=E.stateNode;s?l0(B,!0):l0(E.stateNode,!1)}catch(F){we(E,E.return,F)}}}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,Ks(e,a))));break;case 19:dt(t,e),ft(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ks(e,n)));break;case 30:break;case 21:break;default:dt(t,e),ft(e)}}function ft(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(c(160));switch(a.tag){case 27:var s=a.stateNode,i=oc(e);Zs(e,i,s);break;case 5:var f=a.stateNode;a.flags&32&&(xl(f,""),a.flags&=-33);var g=oc(e);Zs(e,g,f);break;case 3:case 4:var E=a.stateNode.containerInfo,O=oc(e);dc(e,O,E);break;default:throw Error(c(161))}}catch($){we(e,e.return,$)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;mf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ca(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cf(e,t.alternate,t),t=t.sibling}function nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ta(4,t,t.return),nl(t);break;case 1:Qt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&af(t,t.return,a),nl(t);break;case 27:Bn(t.stateNode);case 26:case 5:Qt(t,t.return),nl(t);break;case 22:t.memoizedState===null&&nl(t);break;case 30:nl(t);break;default:nl(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,i=t,f=i.flags;switch(i.tag){case 0:case 11:case 15:ua(s,i,a),An(4,i);break;case 1:if(ua(s,i,a),n=i,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(O){we(n,n.return,O)}if(n=i,s=n.updateQueue,s!==null){var g=n.stateNode;try{var E=s.shared.hiddenCallbacks;if(E!==null)for(s.shared.hiddenCallbacks=null,s=0;s<E.length;s++)Vo(E[s],g)}catch(O){we(n,n.return,O)}}a&&f&64&&tf(i),Rn(i,i.return);break;case 27:sf(i);case 26:case 5:ua(s,i,a),a&&n===null&&f&4&&lf(i),Rn(i,i.return);break;case 12:ua(s,i,a);break;case 31:ua(s,i,a),a&&f&4&&df(s,i);break;case 13:ua(s,i,a),a&&f&4&&ff(s,i);break;case 22:i.memoizedState===null&&ua(s,i,a),Rn(i,i.return);break;case 30:break;default:ua(s,i,a)}t=t.sibling}}function xc(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&&hn(a))}function mc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hn(e))}function kt(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)hf(e,t,a,n),t=t.sibling}function hf(e,t,a,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:kt(e,t,a,n),s&2048&&An(9,t);break;case 1:kt(e,t,a,n);break;case 3:kt(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&&hn(e)));break;case 12:if(s&2048){kt(e,t,a,n),e=t.stateNode;try{var i=t.memoizedProps,f=i.id,g=i.onPostCommit;typeof g=="function"&&g(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(E){we(t,t.return,E)}}else kt(e,t,a,n);break;case 31:kt(e,t,a,n);break;case 13:kt(e,t,a,n);break;case 23:break;case 22:i=t.stateNode,f=t.alternate,t.memoizedState!==null?i._visibility&2?kt(e,t,a,n):Mn(e,t):i._visibility&2?kt(e,t,a,n):(i._visibility|=2,Dl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&xc(f,t);break;case 24:kt(e,t,a,n),s&2048&&mc(t.alternate,t);break;default:kt(e,t,a,n)}}function Dl(e,t,a,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,f=t,g=a,E=n,O=f.flags;switch(f.tag){case 0:case 11:case 15:Dl(i,f,g,E,s),An(8,f);break;case 23:break;case 22:var $=f.stateNode;f.memoizedState!==null?$._visibility&2?Dl(i,f,g,E,s):Mn(i,f):($._visibility|=2,Dl(i,f,g,E,s)),s&&O&2048&&xc(f.alternate,f);break;case 24:Dl(i,f,g,E,s),s&&O&2048&&mc(f.alternate,f);break;default:Dl(i,f,g,E,s)}t=t.sibling}}function Mn(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:Mn(a,n),s&2048&&xc(n.alternate,n);break;case 24:Mn(a,n),s&2048&&mc(n.alternate,n);break;default:Mn(a,n)}t=t.sibling}}var _n=8192;function Ol(e,t,a){if(e.subtreeFlags&_n)for(e=e.child;e!==null;)gf(e,t,a),e=e.sibling}function gf(e,t,a){switch(e.tag){case 26:Ol(e,t,a),e.flags&_n&&e.memoizedState!==null&&Ih(a,Bt,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,a);break;case 3:case 4:var n=Bt;Bt=cr(e.stateNode.containerInfo),Ol(e,t,a),Bt=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=_n,_n=16777216,Ol(e,t,a),_n=n):Ol(e,t,a));break;default:Ol(e,t,a)}}function pf(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 zn(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];Pe=n,vf(n,e)}pf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yf(e),e=e.sibling}function yf(e){switch(e.tag){case 0:case 11:case 15:zn(e),e.flags&2048&&Ta(9,e,e.return);break;case 3:zn(e);break;case 12:zn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Js(e)):zn(e);break;default:zn(e)}}function Js(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];Pe=n,vf(n,e)}pf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ta(8,t,t.return),Js(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Js(t));break;default:Js(t)}e=e.sibling}}function vf(e,t){for(;Pe!==null;){var a=Pe;switch(a.tag){case 0:case 11:case 15:Ta(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:hn(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Pe=n;else e:for(a=e;Pe!==null;){n=Pe;var s=n.sibling,i=n.return;if(uf(n),n===a){Pe=null;break e}if(s!==null){s.return=i,Pe=s;break e}Pe=i}}}var mh={getCacheForType:function(e){var t=at(Ve),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return at(Ve).controller.signal}},hh=typeof WeakMap=="function"?WeakMap:Map,Se=0,_e=null,xe=null,he=0,Ce=0,Nt=null,Aa=!1,Ul=!1,hc=!1,oa=0,$e=0,Ra=0,sl=0,gc=0,St=0,Ll=0,Dn=null,xt=null,pc=!1,Ws=0,bf=0,Fs=1/0,Ps=null,Ma=null,Je=0,_a=null,Hl=null,da=0,yc=0,vc=null,jf=null,On=0,bc=null;function Et(){return(Se&2)!==0&&he!==0?he&-he:k.T!==null?wc():Uu()}function Nf(){if(St===0)if((he&536870912)===0||pe){var e=rs;rs<<=1,(rs&3932160)===0&&(rs=262144),St=e}else St=536870912;return e=bt.current,e!==null&&(e.flags|=32),St}function mt(e,t,a){(e===_e&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(Bl(e,0),za(e,he,St,!1)),en(e,a),((Se&2)===0||e!==_e)&&(e===_e&&((Se&2)===0&&(sl|=a),$e===4&&za(e,he,St,!1)),Zt(e))}function Sf(e,t,a){if((Se&6)!==0)throw Error(c(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Il(e,t),s=n?yh(e,t):Nc(e,t,!0),i=n;do{if(s===0){Ul&&!n&&za(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!gh(a)){s=Nc(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var g=e;s=Dn;var E=g.current.memoizedState.isDehydrated;if(E&&(Bl(g,f).flags|=256),f=Nc(g,f,!1),f!==2){if(hc&&!E){g.errorRecoveryDisabledLanes|=i,sl|=i,s=4;break e}i=xt,xt=s,i!==null&&(xt===null?xt=i:xt.push.apply(xt,i))}s=f}if(i=!1,s!==2)continue}}if(s===1){Bl(e,0),za(e,t,0,!0);break}e:{switch(n=e,i=s,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:za(n,t,St,!Aa);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(s=Ws+300-ht(),10<s)){if(za(n,t,St,!Aa),cs(n,0,!0)!==0)break e;da=t,n.timeoutHandle=e0(Ef.bind(null,n,a,xt,Ps,pc,t,St,sl,Ll,Aa,i,"Throttled",-0,0),s);break e}Ef(n,a,xt,Ps,pc,t,St,sl,Ll,Aa,i,null,-0,0)}}break}while(!0);Zt(e)}function Ef(e,t,a,n,s,i,f,g,E,O,$,G,L,B){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wt},gf(t,i,G);var F=(i&62914560)===i?Ws-ht():(i&4194048)===i?bf-ht():0;if(F=eg(G,F),F!==null){da=i,e.cancelPendingCommit=F(zf.bind(null,e,t,i,a,n,s,f,g,E,$,G,null,L,B)),za(e,i,f,!O);return}}zf(e,t,i,a,n,s,f,g,E)}function gh(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],i=s.getSnapshot;s=s.value;try{if(!yt(i(),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 za(e,t,a,n){t&=~gc,t&=~sl,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var i=31-pt(s),f=1<<i;n[i]=-1,s&=~f}a!==0&&zu(e,a,t)}function Is(){return(Se&6)===0?(Un(0),!1):!0}function jc(){if(xe!==null){if(Ce===0)var e=xe.return;else e=xe,ea=Wa=null,Hi(e),Al=null,pn=0,e=xe;for(;e!==null;)ef(e.alternate,e),e=e.return;xe=null}}function Bl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Lh(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),da=0,jc(),_e=e,xe=a=Pt(e.current,null),he=t,Ce=0,Nt=null,Aa=!1,Ul=Il(e,t),hc=!1,Ll=St=gc=sl=Ra=$e=0,xt=Dn=null,pc=!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-pt(n),i=1<<s;t|=e[s],n&=~i}return oa=t,bs(),a}function Cf(e,t){oe=null,k.H=Cn,t===Tl||t===As?(t=$o(),Ce=3):t===Ci?(t=$o(),Ce=4):Ce=t===Ii?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nt=t,xe===null&&($e=1,Ys(e,At(t,e.current)))}function wf(){var e=bt.current;return e===null?!0:(he&4194048)===he?zt===null:(he&62914560)===he||(he&536870912)!==0?e===zt:!1}function Tf(){var e=k.H;return k.H=Cn,e===null?Cn:e}function Af(){var e=k.A;return k.A=mh,e}function er(){$e=4,Aa||(he&4194048)!==he&&bt.current!==null||(Ul=!0),(Ra&134217727)===0&&(sl&134217727)===0||_e===null||za(_e,he,St,!1)}function Nc(e,t,a){var n=Se;Se|=2;var s=Tf(),i=Af();(_e!==e||he!==t)&&(Ps=null,Bl(e,t)),t=!1;var f=$e;e:do try{if(Ce!==0&&xe!==null){var g=xe,E=Nt;switch(Ce){case 8:jc(),f=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var O=Ce;if(Ce=0,Nt=null,kl(e,g,E,O),a&&Ul){f=0;break e}break;default:O=Ce,Ce=0,Nt=null,kl(e,g,E,O)}}ph(),f=$e;break}catch($){Cf(e,$)}while(!0);return t&&e.shellSuspendCounter++,ea=Wa=null,Se=n,k.H=s,k.A=i,xe===null&&(_e=null,he=0,bs()),f}function ph(){for(;xe!==null;)Rf(xe)}function yh(e,t){var a=Se;Se|=2;var n=Tf(),s=Af();_e!==e||he!==t?(Ps=null,Fs=ht()+500,Bl(e,t)):Ul=Il(e,t);e:do try{if(Ce!==0&&xe!==null){t=xe;var i=Nt;t:switch(Ce){case 1:Ce=0,Nt=null,kl(e,t,i,1);break;case 2:case 9:if(Bo(i)){Ce=0,Nt=null,Mf(t);break}t=function(){Ce!==2&&Ce!==9||_e!==e||(Ce=7),Zt(e)},i.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:Bo(i)?(Ce=0,Nt=null,Mf(t)):(Ce=0,Nt=null,kl(e,t,i,7));break;case 5:var f=null;switch(xe.tag){case 26:f=xe.memoizedState;case 5:case 27:var g=xe;if(f?h0(f):g.stateNode.complete){Ce=0,Nt=null;var E=g.sibling;if(E!==null)xe=E;else{var O=g.return;O!==null?(xe=O,tr(O)):xe=null}break t}}Ce=0,Nt=null,kl(e,t,i,5);break;case 6:Ce=0,Nt=null,kl(e,t,i,6);break;case 8:jc(),$e=6;break e;default:throw Error(c(462))}}vh();break}catch($){Cf(e,$)}while(!0);return ea=Wa=null,k.H=n,k.A=s,Se=a,xe!==null?0:(_e=null,he=0,bs(),$e)}function vh(){for(;xe!==null&&!Yx();)Rf(xe)}function Rf(e){var t=Pd(e.alternate,e,oa);e.memoizedProps=e.pendingProps,t===null?tr(e):xe=t}function Mf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Qd(a,t,t.pendingProps,t.type,void 0,he);break;case 11:t=Qd(a,t,t.pendingProps,t.type.render,t.ref,he);break;case 5:Hi(t);default:ef(a,t),t=xe=To(t,oa),t=Pd(a,t,oa)}e.memoizedProps=e.pendingProps,t===null?tr(e):xe=t}function kl(e,t,a,n){ea=Wa=null,Hi(t),Al=null,pn=0;var s=t.return;try{if(ih(e,s,t,a,he)){$e=1,Ys(e,At(a,e.current)),xe=null;return}}catch(i){if(s!==null)throw xe=s,i;$e=1,Ys(e,At(a,e.current)),xe=null;return}t.flags&32768?(pe||n===1?e=!0:Ul||(he&536870912)!==0?e=!1:(Aa=e=!0,(n===2||n===9||n===3||n===6)&&(n=bt.current,n!==null&&n.tag===13&&(n.flags|=16384))),_f(t,e)):tr(t)}function tr(e){var t=e;do{if((t.flags&32768)!==0){_f(t,Aa);return}e=t.return;var a=oh(t.alternate,t,oa);if(a!==null){xe=a;return}if(t=t.sibling,t!==null){xe=t;return}xe=t=e}while(t!==null);$e===0&&($e=5)}function _f(e,t){do{var a=dh(e.alternate,e);if(a!==null){a.flags&=32767,xe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){xe=e;return}xe=e=a}while(e!==null);$e=6,xe=null}function zf(e,t,a,n,s,i,f,g,E){e.cancelPendingCommit=null;do ar();while(Je!==0);if((Se&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=oi,Px(e,a,i,f,g,E),e===_e&&(xe=_e=null,he=0),Hl=t,_a=e,da=a,yc=i,vc=s,jf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Sh(ns,function(){return Hf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=k.T,k.T=null,s=X.p,X.p=2,f=Se,Se|=4;try{fh(e,t,a)}finally{Se=f,X.p=s,k.T=n}}Je=1,Df(),Of(),Uf()}}function Df(){if(Je===1){Je=0;var e=_a,t=Hl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var n=X.p;X.p=2;var s=Se;Se|=4;try{xf(t,e);var i=Oc,f=yo(e.containerInfo),g=i.focusedElem,E=i.selectionRange;if(f!==g&&g&&g.ownerDocument&&po(g.ownerDocument.documentElement,g)){if(E!==null&&si(g)){var O=E.start,$=E.end;if($===void 0&&($=O),"selectionStart"in g)g.selectionStart=O,g.selectionEnd=Math.min($,g.value.length);else{var G=g.ownerDocument||document,L=G&&G.defaultView||window;if(L.getSelection){var B=L.getSelection(),F=g.textContent.length,re=Math.min(E.start,F),Me=E.end===void 0?re:Math.min(E.end,F);!B.extend&&re>Me&&(f=Me,Me=re,re=f);var M=go(g,re),A=go(g,Me);if(M&&A&&(B.rangeCount!==1||B.anchorNode!==M.node||B.anchorOffset!==M.offset||B.focusNode!==A.node||B.focusOffset!==A.offset)){var D=G.createRange();D.setStart(M.node,M.offset),B.removeAllRanges(),re>Me?(B.addRange(D),B.extend(A.node,A.offset)):(D.setEnd(A.node,A.offset),B.addRange(D))}}}}for(G=[],B=g;B=B.parentNode;)B.nodeType===1&&G.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<G.length;g++){var Y=G[g];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}mr=!!Dc,Oc=Dc=null}finally{Se=s,X.p=n,k.T=a}}e.current=t,Je=2}}function Of(){if(Je===2){Je=0;var e=_a,t=Hl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var n=X.p;X.p=2;var s=Se;Se|=4;try{cf(e,t.alternate,t)}finally{Se=s,X.p=n,k.T=a}}Je=3}}function Uf(){if(Je===4||Je===3){Je=0,Gx();var e=_a,t=Hl,a=da,n=jf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Hl=_a=null,Lf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Ma=null),$r(a),t=t.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=k.T,s=X.p,X.p=2,k.T=null;try{for(var i=e.onRecoverableError,f=0;f<n.length;f++){var g=n[f];i(g.value,{componentStack:g.stack})}}finally{k.T=t,X.p=s}}(da&3)!==0&&ar(),Zt(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===bc?On++:(On=0,bc=e):On=0,Un(0)}}function Lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,hn(t)))}function ar(){return Df(),Of(),Uf(),Hf()}function Hf(){if(Je!==5)return!1;var e=_a,t=yc;yc=0;var a=$r(da),n=k.T,s=X.p;try{X.p=32>a?32:a,k.T=null,a=vc,vc=null;var i=_a,f=da;if(Je=0,Hl=_a=null,da=0,(Se&6)!==0)throw Error(c(331));var g=Se;if(Se|=4,yf(i.current),hf(i,i.current,f,a),Se=g,Un(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Pl,i)}catch{}return!0}finally{X.p=s,k.T=n,Lf(e,t)}}function Bf(e,t,a){t=At(a,t),t=Pi(e.stateNode,t,2),e=Ea(e,t,2),e!==null&&(en(e,2),Zt(e))}function we(e,t,a){if(e.tag===3)Bf(e,e,a);else for(;t!==null;){if(t.tag===3){Bf(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ma===null||!Ma.has(n))){e=At(a,e),a=Bd(2),n=Ea(t,a,2),n!==null&&(kd(a,n,t,e),en(n,2),Zt(n));break}}t=t.return}}function Sc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new hh;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)||(hc=!0,s.add(a),e=bh.bind(null,e,t,a),t.then(e,e))}function bh(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,_e===e&&(he&a)===a&&($e===4||$e===3&&(he&62914560)===he&&300>ht()-Ws?(Se&2)===0&&Bl(e,0):gc|=a,Ll===he&&(Ll=0)),Zt(e)}function kf(e,t){t===0&&(t=_u()),e=Za(e,t),e!==null&&(en(e,t),Zt(e))}function jh(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),kf(e,a)}function Nh(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(c(314))}n!==null&&n.delete(t),kf(e,a)}function Sh(e,t){return Lr(e,t)}var lr=null,$l=null,Ec=!1,nr=!1,Cc=!1,Da=0;function Zt(e){e!==$l&&e.next===null&&($l===null?lr=$l=e:$l=$l.next=e),nr=!0,Ec||(Ec=!0,Ch())}function Un(e,t){if(!Cc&&nr){Cc=!0;do for(var a=!1,n=lr;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var i=0;else{var f=n.suspendedLanes,g=n.pingedLanes;i=(1<<31-pt(42|e)+1)-1,i&=s&~(f&~g),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Gf(n,i))}else i=he,i=cs(n,n===_e?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||Il(n,i)||(a=!0,Gf(n,i));n=n.next}while(a);Cc=!1}}function Eh(){$f()}function $f(){nr=Ec=!1;var e=0;Da!==0&&Uh()&&(e=Da);for(var t=ht(),a=null,n=lr;n!==null;){var s=n.next,i=qf(n,t);i===0?(n.next=null,a===null?lr=s:a.next=s,s===null&&($l=a)):(a=n,(e!==0||(i&3)!==0)&&(nr=!0)),n=s}Je!==0&&Je!==5||Un(e),Da!==0&&(Da=0)}function qf(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var f=31-pt(i),g=1<<f,E=s[f];E===-1?((g&a)===0||(g&n)!==0)&&(s[f]=Fx(g,t)):E<=t&&(e.expiredLanes|=g),i&=~g}if(t=_e,a=he,a=cs(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Hr(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Il(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Hr(n),$r(a)){case 2:case 8:a=Ru;break;case 32:a=ns;break;case 268435456:a=Mu;break;default:a=ns}return n=Yf.bind(null,e),a=Lr(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Hr(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(ar()&&e.callbackNode!==a)return null;var n=he;return n=cs(e,e===_e?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Sf(e,n,t),qf(e,ht()),e.callbackNode!=null&&e.callbackNode===a?Yf.bind(null,e):null)}function Gf(e,t){if(ar())return null;Sf(e,t,!0)}function Ch(){Hh(function(){(Se&6)!==0?Lr(Au,Eh):$f()})}function wc(){if(Da===0){var e=Cl;e===0&&(e=ss,ss<<=1,(ss&261888)===0&&(ss=256)),Da=e}return Da}function Vf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fs(""+e)}function Xf(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 wh(e,t,a,n,s){if(t==="submit"&&a&&a.stateNode===s){var i=Vf((s[ct]||null).action),f=n.submitter;f&&(t=(t=f[ct]||null)?Vf(t.formAction):f.getAttribute("formAction"),t!==null&&(i=t,f=null));var g=new gs("action","action",null,n,s);e.push({event:g,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Da!==0){var E=f?Xf(s,f):new FormData(s);Qi(a,{pending:!0,data:E,method:s.method,action:i},null,E)}}else typeof i=="function"&&(g.preventDefault(),E=f?Xf(s,f):new FormData(s),Qi(a,{pending:!0,data:E,method:s.method,action:i},i,E))},currentTarget:s}]})}}for(var Tc=0;Tc<ui.length;Tc++){var Ac=ui[Tc],Th=Ac.toLowerCase(),Ah=Ac[0].toUpperCase()+Ac.slice(1);Ht(Th,"on"+Ah)}Ht(jo,"onAnimationEnd"),Ht(No,"onAnimationIteration"),Ht(So,"onAnimationStart"),Ht("dblclick","onDoubleClick"),Ht("focusin","onFocus"),Ht("focusout","onBlur"),Ht(Vm,"onTransitionRun"),Ht(Xm,"onTransitionStart"),Ht(Qm,"onTransitionCancel"),Ht(Eo,"onTransitionEnd"),dl("onMouseEnter",["mouseout","mouseover"]),dl("onMouseLeave",["mouseout","mouseover"]),dl("onPointerEnter",["pointerout","pointerover"]),dl("onPointerLeave",["pointerout","pointerover"]),Ga("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ga("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ga("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ga("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ln="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(" "),Rh=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ln));function Qf(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 i=void 0;if(t)for(var f=n.length-1;0<=f;f--){var g=n[f],E=g.instance,O=g.currentTarget;if(g=g.listener,E!==i&&s.isPropagationStopped())break e;i=g,s.currentTarget=O;try{i(s)}catch($){vs($)}s.currentTarget=null,i=E}else for(f=0;f<n.length;f++){if(g=n[f],E=g.instance,O=g.currentTarget,g=g.listener,E!==i&&s.isPropagationStopped())break e;i=g,s.currentTarget=O;try{i(s)}catch($){vs($)}s.currentTarget=null,i=E}}}}function me(e,t){var a=t[qr];a===void 0&&(a=t[qr]=new Set);var n=e+"__bubble";a.has(n)||(Zf(t,e,2,!1),a.add(n))}function Rc(e,t,a){var n=0;t&&(n|=4),Zf(a,e,n,t)}var sr="_reactListening"+Math.random().toString(36).slice(2);function Mc(e){if(!e[sr]){e[sr]=!0,Bu.forEach(function(a){a!=="selectionchange"&&(Rh.has(a)||Rc(a,!1,e),Rc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sr]||(t[sr]=!0,Rc("selectionchange",!1,t))}}function Zf(e,t,a,n){switch(N0(t)){case 2:var s=lg;break;case 8:s=ng;break;default:s=Xc}a=s.bind(null,t,a,e),s=void 0,!Wr||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 _c(e,t,a,n,s){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var g=n.stateNode.containerInfo;if(g===s)break;if(f===4)for(f=n.return;f!==null;){var E=f.tag;if((E===3||E===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;g!==null;){if(f=cl(g),f===null)return;if(E=f.tag,E===5||E===6||E===26||E===27){n=i=f;continue e}g=g.parentNode}}n=n.return}Wu(function(){var O=i,$=Kr(a),G=[];e:{var L=Co.get(e);if(L!==void 0){var B=gs,F=e;switch(e){case"keypress":if(ms(a)===0)break e;case"keydown":case"keyup":B=Nm;break;case"focusin":F="focus",B=ei;break;case"focusout":F="blur",B=ei;break;case"beforeblur":case"afterblur":B=ei;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":B=Iu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=om;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=Cm;break;case jo:case No:case So:B=xm;break;case Eo:B=Tm;break;case"scroll":case"scrollend":B=cm;break;case"wheel":B=Rm;break;case"copy":case"cut":case"paste":B=hm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=to;break;case"toggle":case"beforetoggle":B=_m}var re=(t&4)!==0,Me=!re&&(e==="scroll"||e==="scrollend"),M=re?L!==null?L+"Capture":null:L;re=[];for(var A=O,D;A!==null;){var Y=A;if(D=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||D===null||M===null||(Y=ln(A,M),Y!=null&&re.push(Hn(A,Y,D))),Me)break;A=A.return}0<re.length&&(L=new B(L,F,null,a,$),G.push({event:L,listeners:re}))}}if((t&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",L&&a!==Zr&&(F=a.relatedTarget||a.fromElement)&&(cl(F)||F[il]))break e;if((B||L)&&(L=$.window===$?$:(L=$.ownerDocument)?L.defaultView||L.parentWindow:window,B?(F=a.relatedTarget||a.toElement,B=O,F=F?cl(F):null,F!==null&&(Me=x(F),re=F.tag,F!==Me||re!==5&&re!==27&&re!==6)&&(F=null)):(B=null,F=O),B!==F)){if(re=Iu,Y="onMouseLeave",M="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(re=to,Y="onPointerLeave",M="onPointerEnter",A="pointer"),Me=B==null?L:an(B),D=F==null?L:an(F),L=new re(Y,A+"leave",B,a,$),L.target=Me,L.relatedTarget=D,Y=null,cl($)===O&&(re=new re(M,A+"enter",F,a,$),re.target=D,re.relatedTarget=Me,Y=re),Me=Y,B&&F)t:{for(re=Mh,M=B,A=F,D=0,Y=M;Y;Y=re(Y))D++;Y=0;for(var le=A;le;le=re(le))Y++;for(;0<D-Y;)M=re(M),D--;for(;0<Y-D;)A=re(A),Y--;for(;D--;){if(M===A||A!==null&&M===A.alternate){re=M;break t}M=re(M),A=re(A)}re=null}else re=null;B!==null&&Kf(G,L,B,re,!1),F!==null&&Me!==null&&Kf(G,Me,F,re,!0)}}e:{if(L=O?an(O):window,B=L.nodeName&&L.nodeName.toLowerCase(),B==="select"||B==="input"&&L.type==="file")var ve=uo;else if(io(L))if(oo)ve=qm;else{ve=km;var te=Bm}else B=L.nodeName,!B||B.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?O&&Qr(O.elementType)&&(ve=uo):ve=$m;if(ve&&(ve=ve(e,O))){co(G,ve,a,$);break e}te&&te(e,L,O),e==="focusout"&&O&&L.type==="number"&&O.memoizedProps.value!=null&&Xr(L,"number",L.value)}switch(te=O?an(O):window,e){case"focusin":(io(te)||te.contentEditable==="true")&&(pl=te,ri=O,fn=null);break;case"focusout":fn=ri=pl=null;break;case"mousedown":ii=!0;break;case"contextmenu":case"mouseup":case"dragend":ii=!1,vo(G,a,$);break;case"selectionchange":if(Gm)break;case"keydown":case"keyup":vo(G,a,$)}var de;if(ai)e:{switch(e){case"compositionstart":var ge="onCompositionStart";break e;case"compositionend":ge="onCompositionEnd";break e;case"compositionupdate":ge="onCompositionUpdate";break e}ge=void 0}else gl?so(e,a)&&(ge="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ge="onCompositionStart");ge&&(ao&&a.locale!=="ko"&&(gl||ge!=="onCompositionStart"?ge==="onCompositionEnd"&&gl&&(de=Fu()):(pa=$,Fr="value"in pa?pa.value:pa.textContent,gl=!0)),te=rr(O,ge),0<te.length&&(ge=new eo(ge,e,null,a,$),G.push({event:ge,listeners:te}),de?ge.data=de:(de=ro(a),de!==null&&(ge.data=de)))),(de=Dm?Om(e,a):Um(e,a))&&(ge=rr(O,"onBeforeInput"),0<ge.length&&(te=new eo("onBeforeInput","beforeinput",null,a,$),G.push({event:te,listeners:ge}),te.data=de)),wh(G,e,O,a,$)}Qf(G,t)})}function Hn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function rr(e,t){for(var a=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=ln(e,a),s!=null&&n.unshift(Hn(e,s,i)),s=ln(e,t),s!=null&&n.push(Hn(e,s,i))),e.tag===3)return n;e=e.return}return[]}function Mh(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Kf(e,t,a,n,s){for(var i=t._reactName,f=[];a!==null&&a!==n;){var g=a,E=g.alternate,O=g.stateNode;if(g=g.tag,E!==null&&E===n)break;g!==5&&g!==26&&g!==27||O===null||(E=O,s?(O=ln(a,i),O!=null&&f.unshift(Hn(a,O,E))):s||(O=ln(a,i),O!=null&&f.push(Hn(a,O,E)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var _h=/\r\n?/g,zh=/\u0000|\uFFFD/g;function Jf(e){return(typeof e=="string"?e:""+e).replace(_h,`
|
|
9
|
-
`).replace(zh,"")}function Wf(e,t){return t=Jf(t),Jf(e)===t}function Re(e,t,a,n,s,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||xl(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&xl(e,""+n);break;case"className":os(e,"class",n);break;case"tabIndex":os(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":os(e,a,n);break;case"style":Ku(e,n,i);break;case"data":if(t!=="object"){os(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=fs(""+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 i=="function"&&(a==="formAction"?(t!=="input"&&Re(e,t,"name",s.name,s,null),Re(e,t,"formEncType",s.formEncType,s,null),Re(e,t,"formMethod",s.formMethod,s,null),Re(e,t,"formTarget",s.formTarget,s,null)):(Re(e,t,"encType",s.encType,s,null),Re(e,t,"method",s.method,s,null),Re(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=fs(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Wt);break;case"onScroll":n!=null&&me("scroll",e);break;case"onScrollEnd":n!=null&&me("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(c(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=fs(""+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":me("beforetoggle",e),me("toggle",e),us(e,"popover",n);break;case"xlinkActuate":Jt(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Jt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Jt(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Jt(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Jt(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Jt(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":us(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=rm.get(a)||a,us(e,a,n))}}function zc(e,t,a,n,s,i){switch(a){case"style":Ku(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?xl(e,n):(typeof n=="number"||typeof n=="bigint")&&xl(e,""+n);break;case"onScroll":n!=null&&me("scroll",e);break;case"onScrollEnd":n!=null&&me("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ku.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),t=a.slice(2,s?a.length-7:void 0),i=e[ct]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof n=="function")){typeof i!="function"&&i!==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,""):us(e,a,n)}}}function nt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":me("error",e),me("load",e);var n=!1,s=!1,i;for(i in a)if(a.hasOwnProperty(i)){var f=a[i];if(f!=null)switch(i){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Re(e,t,i,f,a,null)}}s&&Re(e,t,"srcSet",a.srcSet,a,null),n&&Re(e,t,"src",a.src,a,null);return;case"input":me("invalid",e);var g=i=f=s=null,E=null,O=null;for(n in a)if(a.hasOwnProperty(n)){var $=a[n];if($!=null)switch(n){case"name":s=$;break;case"type":f=$;break;case"checked":E=$;break;case"defaultChecked":O=$;break;case"value":i=$;break;case"defaultValue":g=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(c(137,t));break;default:Re(e,t,n,$,a,null)}}Vu(e,i,g,E,O,f,s,!1);return;case"select":me("invalid",e),n=f=i=null;for(s in a)if(a.hasOwnProperty(s)&&(g=a[s],g!=null))switch(s){case"value":i=g;break;case"defaultValue":f=g;break;case"multiple":n=g;default:Re(e,t,s,g,a,null)}t=i,a=f,e.multiple=!!n,t!=null?fl(e,!!n,t,!1):a!=null&&fl(e,!!n,a,!0);return;case"textarea":me("invalid",e),i=s=n=null;for(f in a)if(a.hasOwnProperty(f)&&(g=a[f],g!=null))switch(f){case"value":n=g;break;case"defaultValue":s=g;break;case"children":i=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:Re(e,t,f,g,a,null)}Qu(e,n,s,i);return;case"option":for(E in a)a.hasOwnProperty(E)&&(n=a[E],n!=null)&&(E==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Re(e,t,E,n,a,null));return;case"dialog":me("beforetoggle",e),me("toggle",e),me("cancel",e),me("close",e);break;case"iframe":case"object":me("load",e);break;case"video":case"audio":for(n=0;n<Ln.length;n++)me(Ln[n],e);break;case"image":me("error",e),me("load",e);break;case"details":me("toggle",e);break;case"embed":case"source":case"link":me("error",e),me("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(O in a)if(a.hasOwnProperty(O)&&(n=a[O],n!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Re(e,t,O,n,a,null)}return;default:if(Qr(t)){for($ in a)a.hasOwnProperty($)&&(n=a[$],n!==void 0&&zc(e,t,$,n,a,void 0));return}}for(g in a)a.hasOwnProperty(g)&&(n=a[g],n!=null&&Re(e,t,g,n,a,null))}function Dh(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,i=null,f=null,g=null,E=null,O=null,$=null;for(B in a){var G=a[B];if(a.hasOwnProperty(B)&&G!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":E=G;default:n.hasOwnProperty(B)||Re(e,t,B,null,n,G)}}for(var L in n){var B=n[L];if(G=a[L],n.hasOwnProperty(L)&&(B!=null||G!=null))switch(L){case"type":i=B;break;case"name":s=B;break;case"checked":O=B;break;case"defaultChecked":$=B;break;case"value":f=B;break;case"defaultValue":g=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(c(137,t));break;default:B!==G&&Re(e,t,L,B,n,G)}}Vr(e,f,g,E,O,$,i,s);return;case"select":B=f=g=L=null;for(i in a)if(E=a[i],a.hasOwnProperty(i)&&E!=null)switch(i){case"value":break;case"multiple":B=E;default:n.hasOwnProperty(i)||Re(e,t,i,null,n,E)}for(s in n)if(i=n[s],E=a[s],n.hasOwnProperty(s)&&(i!=null||E!=null))switch(s){case"value":L=i;break;case"defaultValue":g=i;break;case"multiple":f=i;default:i!==E&&Re(e,t,s,i,n,E)}t=g,a=f,n=B,L!=null?fl(e,!!a,L,!1):!!n!=!!a&&(t!=null?fl(e,!!a,t,!0):fl(e,!!a,a?[]:"",!1));return;case"textarea":B=L=null;for(g in a)if(s=a[g],a.hasOwnProperty(g)&&s!=null&&!n.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Re(e,t,g,null,n,s)}for(f in n)if(s=n[f],i=a[f],n.hasOwnProperty(f)&&(s!=null||i!=null))switch(f){case"value":L=s;break;case"defaultValue":B=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(c(91));break;default:s!==i&&Re(e,t,f,s,n,i)}Xu(e,L,B);return;case"option":for(var F in a)L=a[F],a.hasOwnProperty(F)&&L!=null&&!n.hasOwnProperty(F)&&(F==="selected"?e.selected=!1:Re(e,t,F,null,n,L));for(E in n)L=n[E],B=a[E],n.hasOwnProperty(E)&&L!==B&&(L!=null||B!=null)&&(E==="selected"?e.selected=L&&typeof L!="function"&&typeof L!="symbol":Re(e,t,E,L,n,B));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 re in a)L=a[re],a.hasOwnProperty(re)&&L!=null&&!n.hasOwnProperty(re)&&Re(e,t,re,null,n,L);for(O in n)if(L=n[O],B=a[O],n.hasOwnProperty(O)&&L!==B&&(L!=null||B!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(c(137,t));break;default:Re(e,t,O,L,n,B)}return;default:if(Qr(t)){for(var Me in a)L=a[Me],a.hasOwnProperty(Me)&&L!==void 0&&!n.hasOwnProperty(Me)&&zc(e,t,Me,void 0,n,L);for($ in n)L=n[$],B=a[$],!n.hasOwnProperty($)||L===B||L===void 0&&B===void 0||zc(e,t,$,L,n,B);return}}for(var M in a)L=a[M],a.hasOwnProperty(M)&&L!=null&&!n.hasOwnProperty(M)&&Re(e,t,M,null,n,L);for(G in n)L=n[G],B=a[G],!n.hasOwnProperty(G)||L===B||L==null&&B==null||Re(e,t,G,L,n,B)}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 Oh(){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],i=s.transferSize,f=s.initiatorType,g=s.duration;if(i&&g&&Ff(f)){for(f=0,g=s.responseEnd,n+=1;n<a.length;n++){var E=a[n],O=E.startTime;if(O>g)break;var $=E.transferSize,G=E.initiatorType;$&&Ff(G)&&(E=E.responseEnd,f+=$*(E<g?1:(g-O)/(E-O)))}if(--n,t+=8*(i+f)/(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 Dc=null,Oc=null;function ir(e){return e.nodeType===9?e:e.ownerDocument}function Pf(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 Uc(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 Lc=null;function Uh(){var e=window.event;return e&&e.type==="popstate"?e===Lc?!1:(Lc=e,!0):(Lc=null,!1)}var e0=typeof setTimeout=="function"?setTimeout:void 0,Lh=typeof clearTimeout=="function"?clearTimeout:void 0,t0=typeof Promise=="function"?Promise:void 0,Hh=typeof queueMicrotask=="function"?queueMicrotask:typeof t0<"u"?function(e){return t0.resolve(null).then(e).catch(Bh)}:e0;function Bh(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function a0(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),Vl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Bn(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Bn(a);for(var i=a.firstChild;i;){var f=i.nextSibling,g=i.nodeName;i[tn]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=f}}else a==="body"&&Bn(e.ownerDocument.body);a=s}while(a);Vl(t)}function l0(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 Hc(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":Hc(a),Yr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function kh(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[tn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==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(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Dt(e.nextSibling),e===null)break}return null}function $h(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Dt(e.nextSibling),e===null))return null;return e}function n0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dt(e.nextSibling),e===null))return null;return e}function Bc(e){return e.data==="$?"||e.data==="$~"}function kc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qh(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 Dt(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 $c=null;function s0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Dt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function r0(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 i0(e,t,a){switch(t=ir(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Bn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Yr(e)}var Ot=new Map,c0=new Set;function cr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fa=X.d;X.d={f:Yh,r:Gh,D:Vh,C:Xh,L:Qh,m:Zh,X:Jh,S:Kh,M:Wh};function Yh(){var e=fa.f(),t=Is();return e||t}function Gh(e){var t=ul(e);t!==null&&t.tag===5&&t.type==="form"?Ed(t):fa.r(e)}var ql=typeof document>"u"?null:document;function u0(e,t,a){var n=ql;if(n&&typeof t=="string"&&t){var s=wt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),c0.has(s)||(c0.add(s),e={rel:e,crossOrigin:a,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),nt(t,"link",e),Fe(t),n.head.appendChild(t)))}}function Vh(e){fa.D(e),u0("dns-prefetch",e,null)}function Xh(e,t){fa.C(e,t),u0("preconnect",e,t)}function Qh(e,t,a){fa.L(e,t,a);var n=ql;if(n&&e&&t){var s='link[rel="preload"][as="'+wt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+wt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+wt(a.imageSizes)+'"]')):s+='[href="'+wt(e)+'"]';var i=s;switch(t){case"style":i=Yl(e);break;case"script":i=Gl(e)}Ot.has(i)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ot.set(i,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(kn(i))||t==="script"&&n.querySelector($n(i))||(t=n.createElement("link"),nt(t,"link",e),Fe(t),n.head.appendChild(t)))}}function Zh(e,t){fa.m(e,t);var a=ql;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+wt(n)+'"][href="'+wt(e)+'"]',i=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Gl(e)}if(!Ot.has(i)&&(e=y({rel:"modulepreload",href:e},t),Ot.set(i,e),a.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($n(i)))return}n=a.createElement("link"),nt(n,"link",e),Fe(n),a.head.appendChild(n)}}}function Kh(e,t,a){fa.S(e,t,a);var n=ql;if(n&&e){var s=ol(n).hoistableStyles,i=Yl(e);t=t||"default";var f=s.get(i);if(!f){var g={loading:0,preload:null};if(f=n.querySelector(kn(i)))g.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ot.get(i))&&qc(e,a);var E=f=n.createElement("link");Fe(E),nt(E,"link",e),E._p=new Promise(function(O,$){E.onload=O,E.onerror=$}),E.addEventListener("load",function(){g.loading|=1}),E.addEventListener("error",function(){g.loading|=2}),g.loading|=4,ur(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:g},s.set(i,f)}}}function Jh(e,t){fa.X(e,t);var a=ql;if(a&&e){var n=ol(a).hoistableScripts,s=Gl(e),i=n.get(s);i||(i=a.querySelector($n(s)),i||(e=y({src:e,async:!0},t),(t=Ot.get(s))&&Yc(e,t),i=a.createElement("script"),Fe(i),nt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function Wh(e,t){fa.M(e,t);var a=ql;if(a&&e){var n=ol(a).hoistableScripts,s=Gl(e),i=n.get(s);i||(i=a.querySelector($n(s)),i||(e=y({src:e,async:!0,type:"module"},t),(t=Ot.get(s))&&Yc(e,t),i=a.createElement("script"),Fe(i),nt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function o0(e,t,a,n){var s=(s=fe.current)?cr(s):null;if(!s)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Yl(a.href),a=ol(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=Yl(a.href);var i=ol(s).hoistableStyles,f=i.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,f),(i=s.querySelector(kn(e)))&&!i._p&&(f.instance=i,f.state.loading=5),Ot.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},Ot.set(e,a),i||Fh(s,e,a,f.state))),t&&n===null)throw Error(c(528,""));return f}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Gl(a),a=ol(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(c(444,e))}}function Yl(e){return'href="'+wt(e)+'"'}function kn(e){return'link[rel="stylesheet"]['+e+"]"}function d0(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Fh(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}),nt(t,"link",a),Fe(t),e.head.appendChild(t))}function Gl(e){return'[src="'+wt(e)+'"]'}function $n(e){return"script[async]"+e}function f0(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+wt(a.href)+'"]');if(n)return t.instance=n,Fe(n),n;var s=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Fe(n),nt(n,"style",s),ur(n,a.precedence,e),t.instance=n;case"stylesheet":s=Yl(a.href);var i=e.querySelector(kn(s));if(i)return t.state.loading|=4,t.instance=i,Fe(i),i;n=d0(a),(s=Ot.get(s))&&qc(n,s),i=(e.ownerDocument||e).createElement("link"),Fe(i);var f=i;return f._p=new Promise(function(g,E){f.onload=g,f.onerror=E}),nt(i,"link",n),t.state.loading|=4,ur(i,a.precedence,e),t.instance=i;case"script":return i=Gl(a.src),(s=e.querySelector($n(i)))?(t.instance=s,Fe(s),s):(n=a,(s=Ot.get(i))&&(n=y({},a),Yc(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),Fe(s),nt(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,ur(n,a.precedence,e));return t.instance}function ur(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,i=s,f=0;f<n.length;f++){var g=n[f];if(g.dataset.precedence===t)i=g;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function qc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var or=null;function x0(e,t,a){if(or===null){var n=new Map,s=or=new Map;s.set(a,n)}else s=or,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 i=a[s];if(!(i[tn]||i[et]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var f=i.getAttribute(t)||"";f=e+f;var g=n.get(f);g?g.push(i):n.set(f,[i])}}return n}function m0(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Ph(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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 h0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ih(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=Yl(n.href),i=t.querySelector(kn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=dr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,Fe(i);return}i=t.ownerDocument||t,n=d0(n),(s=Ot.get(s))&&qc(n,s),i=i.createElement("link"),Fe(i);var f=i;f._p=new Promise(function(g,E){f.onload=g,f.onerror=E}),nt(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=dr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Gc=0;function eg(e,t){return e.stylesheets&&e.count===0&&xr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&xr(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Gc===0&&(Gc=62500*Oh());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&xr(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Gc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function dr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fr=null;function xr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fr=new Map,t.forEach(tg,e),fr=null,dr.call(e))}function tg(e,t){if(!(t.state.loading&4)){var a=fr.get(e);if(a)var n=a.get(null);else{a=new Map,fr.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var f=s[i];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),n=f)}n&&a.set(null,n)}s=t.instance,f=s.getAttribute("data-precedence"),i=a.get(f)||n,i===n&&a.set(null,s),a.set(f,s),this.count++,n=dr.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var qn={$$typeof:U,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function ag(e,t,a,n,s,i,f,g,E){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=Br(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Br(0),this.hiddenUpdates=Br(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.incompleteTransitions=new Map}function g0(e,t,a,n,s,i,f,g,E,O,$,G){return e=new ag(e,t,a,f,E,O,$,G,g),t=1,i===!0&&(t|=24),i=vt(3,null,null,t),e.current=i,i.stateNode=e,t=Ni(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:a,cache:t},wi(i),e}function p0(e){return e?(e=bl,e):bl}function y0(e,t,a,n,s,i){s=p0(s),n.context===null?n.context=s:n.pendingContext=s,n=Sa(t),n.payload={element:a},i=i===void 0?null:i,i!==null&&(n.callback=i),a=Ea(e,n,t),a!==null&&(mt(a,e,t),vn(a,e,t))}function v0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Vc(e,t){v0(e,t),(e=e.alternate)&&v0(e,t)}function b0(e){if(e.tag===13||e.tag===31){var t=Za(e,67108864);t!==null&&mt(t,e,67108864),Vc(e,67108864)}}function j0(e){if(e.tag===13||e.tag===31){var t=Et();t=kr(t);var a=Za(e,t);a!==null&&mt(a,e,t),Vc(e,t)}}var mr=!0;function lg(e,t,a,n){var s=k.T;k.T=null;var i=X.p;try{X.p=2,Xc(e,t,a,n)}finally{X.p=i,k.T=s}}function ng(e,t,a,n){var s=k.T;k.T=null;var i=X.p;try{X.p=8,Xc(e,t,a,n)}finally{X.p=i,k.T=s}}function Xc(e,t,a,n){if(mr){var s=Qc(n);if(s===null)_c(e,t,n,hr,a),S0(e,n);else if(rg(s,e,t,a,n))n.stopPropagation();else if(S0(e,n),t&4&&-1<sg.indexOf(e)){for(;s!==null;){var i=ul(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var f=Ya(i.pendingLanes);if(f!==0){var g=i;for(g.pendingLanes|=2,g.entangledLanes|=2;f;){var E=1<<31-pt(f);g.entanglements[1]|=E,f&=~E}Zt(i),(Se&6)===0&&(Fs=ht()+500,Un(0))}}break;case 31:case 13:g=Za(i,2),g!==null&&mt(g,i,2),Is(),Vc(i,2)}if(i=Qc(n),i===null&&_c(e,t,n,hr,a),i===s)break;s=i}s!==null&&n.stopPropagation()}else _c(e,t,n,null,a)}}function Qc(e){return e=Kr(e),Zc(e)}var hr=null;function Zc(e){if(hr=null,e=cl(e),e!==null){var t=x(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===31){if(e=N(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 hr=e,null}function N0(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(Vx()){case Au:return 2;case Ru:return 8;case ns:case Xx:return 32;case Mu:return 268435456;default:return 32}default:return 32}}var Kc=!1,Ua=null,La=null,Ha=null,Yn=new Map,Gn=new Map,Ba=[],sg="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 S0(e,t){switch(e){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":La=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":Yn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gn.delete(t.pointerId)}}function Vn(e,t,a,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=ul(t),t!==null&&b0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function rg(e,t,a,n,s){switch(t){case"focusin":return Ua=Vn(Ua,e,t,a,n,s),!0;case"dragenter":return La=Vn(La,e,t,a,n,s),!0;case"mouseover":return Ha=Vn(Ha,e,t,a,n,s),!0;case"pointerover":var i=s.pointerId;return Yn.set(i,Vn(Yn.get(i)||null,e,t,a,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Gn.set(i,Vn(Gn.get(i)||null,e,t,a,n,s)),!0}return!1}function E0(e){var t=cl(e.target);if(t!==null){var a=x(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Lu(e.priority,function(){j0(a)});return}}else if(t===31){if(t=N(a),t!==null){e.blockedOn=t,Lu(e.priority,function(){j0(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 gr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Qc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Zr=n,a.target.dispatchEvent(n),Zr=null}else return t=ul(a),t!==null&&b0(t),e.blockedOn=a,!1;t.shift()}return!0}function C0(e,t,a){gr(e)&&a.delete(t)}function ig(){Kc=!1,Ua!==null&&gr(Ua)&&(Ua=null),La!==null&&gr(La)&&(La=null),Ha!==null&&gr(Ha)&&(Ha=null),Yn.forEach(C0),Gn.forEach(C0)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Kc||(Kc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,ig)))}var yr=null;function w0(e){yr!==e&&(yr=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){yr===e&&(yr=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(Zc(n||a)===null)continue;break}var i=ul(a);i!==null&&(e.splice(t,3),t-=3,Qi(i,{pending:!0,data:s,method:a.method,action:n},n,s))}}))}function Vl(e){function t(E){return pr(E,e)}Ua!==null&&pr(Ua,e),La!==null&&pr(La,e),Ha!==null&&pr(Ha,e),Yn.forEach(t),Gn.forEach(t);for(var a=0;a<Ba.length;a++){var n=Ba[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Ba.length&&(a=Ba[0],a.blockedOn===null);)E0(a),a.blockedOn===null&&Ba.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var s=a[n],i=a[n+1],f=s[ct]||null;if(typeof i=="function")f||w0(a);else if(f){var g=null;if(i&&i.hasAttribute("formAction")){if(s=i,f=i[ct]||null)g=f.formAction;else if(Zc(s)!==null)continue}else g=f.action;typeof g=="function"?a[n+1]=g:(a.splice(n,3),n-=3),w0(a)}}}function T0(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.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 Jc(e){this._internalRoot=e}vr.prototype.render=Jc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=Et();y0(a,n,e,t,null,null)},vr.prototype.unmount=Jc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;y0(e.current,2,null,e,null,null),Is(),t[il]=null}};function vr(e){this._internalRoot=e}vr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Uu();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ba.length&&t!==0&&t<Ba[a].priority;a++);Ba.splice(a,0,e),a===0&&E0(e)}};var A0=o.version;if(A0!=="19.2.7")throw Error(c(527,A0,"19.2.7"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=m(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var cg={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var br=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!br.isDisabled&&br.supportsFiber)try{Pl=br.inject(cg),gt=br}catch{}}return Qn.createRoot=function(e,t){if(!d(e))throw Error(c(299));var a=!1,n="",s=Od,i=Ud,f=Ld;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&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=g0(e,1,!1,null,null,a,n,null,s,i,f,T0),e[il]=t.current,Mc(e),new Jc(t)},Qn.hydrateRoot=function(e,t,a){if(!d(e))throw Error(c(299));var n=!1,s="",i=Od,f=Ud,g=Ld,E=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(g=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=g0(e,1,!0,t,a??null,n,s,E,i,f,g,T0),t.context=p0(null),a=t.current,n=Et(),n=kr(n),s=Sa(n),s.callback=null,Ea(a,s,n),a=n,t.current.lanes=a,en(t,a),Zt(t),e[il]=t.current,Mc(e),new vr(t)},Qn.version="19.2.7",Qn}var B0;function yg(){if(B0)return Pc.exports;B0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),Pc.exports=pg(),Pc.exports}var vg=yg();var k0="popstate";function $0(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function bg(r={}){function o(c,d){let x=d.state?.masked,{pathname:h,search:N,hash:p}=x||c.location;return ou("",{pathname:h,search:N,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default",x?{pathname:c.location.pathname,search:c.location.search,hash:c.location.hash}:void 0)}function u(c,d){return typeof d=="string"?d:Pn(d)}return Ng(o,u,null,r)}function Be(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function qt(r,o){if(!r){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function jg(){return Math.random().toString(36).substring(2,10)}function q0(r,o){return{usr:r.state,key:r.key,idx:o,masked:r.mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function ou(r,o,u=null,c,d){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof o=="string"?Jl(o):o,state:u,key:o&&o.key||c||jg(),mask:d}}function Pn({pathname:r="/",search:o="",hash:u=""}){return o&&o!=="?"&&(r+=o.charAt(0)==="?"?o:"?"+o),u&&u!=="#"&&(r+=u.charAt(0)==="#"?u:"#"+u),r}function Jl(r){let o={};if(r){let u=r.indexOf("#");u>=0&&(o.hash=r.substring(u),r=r.substring(0,u));let c=r.indexOf("?");c>=0&&(o.search=r.substring(c),r=r.substring(0,c)),r&&(o.pathname=r)}return o}function Ng(r,o,u,c={}){let{window:d=document.defaultView,v5Compat:x=!1}=c,h=d.history,N="POP",p=null,m=v();m==null&&(m=0,h.replaceState({...h.state,idx:m},""));function v(){return(h.state||{idx:null}).idx}function y(){N="POP";let b=v(),C=b==null?null:b-m;m=b,p&&p({action:N,location:R.location,delta:C})}function w(b,C){N="PUSH";let T=$0(b)?b:ou(R.location,b,C);m=v()+1;let U=q0(T,m),J=R.createHref(T.mask||T);try{h.pushState(U,"",J)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(J)}x&&p&&p({action:N,location:R.location,delta:1})}function _(b,C){N="REPLACE";let T=$0(b)?b:ou(R.location,b,C);m=v();let U=q0(T,m),J=R.createHref(T.mask||T);h.replaceState(U,"",J),x&&p&&p({action:N,location:R.location,delta:0})}function z(b){return Sg(d,b)}let R={get action(){return N},get location(){return r(d,h)},listen(b){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(k0,y),p=b,()=>{d.removeEventListener(k0,y),p=null}},createHref(b){return o(d,b)},createURL:z,encodeLocation(b){let C=z(b);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:w,replace:_,go(b){return h.go(b)}};return R}function Sg(r,o,u=!1){let c="http://localhost";r&&(c=r.location.origin!=="null"?r.location.origin:r.location.href),Be(c,"No window.location.(origin|href) available to create URL");let d=typeof o=="string"?o:Pn(o);return d=d.replace(/ $/,"%20"),!u&&d.startsWith("//")&&(d=c+d),new URL(d,c)}function ux(r,o,u="/"){return Eg(r,o,u,!1)}function Eg(r,o,u,c,d){let x=typeof o=="string"?Jl(o):o,h=ma(x.pathname||"/",u);if(h==null)return null;let N=Cg(r),p=null,m=Hg(h);for(let v=0;p==null&&v<N.length;++v)p=Ug(N[v],m,c);return p}function Cg(r){let o=ox(r);return wg(o),o}function ox(r,o=[],u=[],c="",d=!1){let x=(h,N,p=d,m)=>{let v={relativePath:m===void 0?h.path||"":m,caseSensitive:h.caseSensitive===!0,childrenIndex:N,route:h};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(c)&&p)return;Be(v.relativePath.startsWith(c),`Absolute route path "${v.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(c.length)}let y=$t([c,v.relativePath]),w=u.concat(v);h.children&&h.children.length>0&&(Be(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),ox(h.children,o,w,y,p)),!(h.path==null&&!h.index)&&o.push({path:y,score:Dg(y,h.index),routesMeta:w})};return r.forEach((h,N)=>{if(h.path===""||!h.path?.includes("?"))x(h,N);else for(let p of dx(h.path))x(h,N,!0,p)}),o}function dx(r){let o=r.split("/");if(o.length===0)return[];let[u,...c]=o,d=u.endsWith("?"),x=u.replace(/\?$/,"");if(c.length===0)return d?[x,""]:[x];let h=dx(c.join("/")),N=[];return N.push(...h.map(p=>p===""?x:[x,p].join("/"))),d&&N.push(...h),N.map(p=>r.startsWith("/")&&p===""?"/":p)}function wg(r){r.sort((o,u)=>o.score!==u.score?u.score-o.score:Og(o.routesMeta.map(c=>c.childrenIndex),u.routesMeta.map(c=>c.childrenIndex)))}var Tg=/^:[\w-]+$/,Ag=3,Rg=2,Mg=1,_g=10,zg=-2,Y0=r=>r==="*";function Dg(r,o){let u=r.split("/"),c=u.length;return u.some(Y0)&&(c+=zg),o&&(c+=Rg),u.filter(d=>!Y0(d)).reduce((d,x)=>d+(Tg.test(x)?Ag:x===""?Mg:_g),c)}function Og(r,o){return r.length===o.length&&r.slice(0,-1).every((c,d)=>c===o[d])?r[r.length-1]-o[o.length-1]:0}function Ug(r,o,u=!1){let{routesMeta:c}=r,d={},x="/",h=[];for(let N=0;N<c.length;++N){let p=c[N],m=N===c.length-1,v=x==="/"?o:o.slice(x.length)||"/",y=Cr({path:p.relativePath,caseSensitive:p.caseSensitive,end:m},v),w=p.route;if(!y&&m&&u&&!c[c.length-1].route.index&&(y=Cr({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},v)),!y)return null;Object.assign(d,y.params),h.push({params:d,pathname:$t([x,y.pathname]),pathnameBase:qg($t([x,y.pathnameBase])),route:w}),y.pathnameBase!=="/"&&(x=$t([x,y.pathnameBase]))}return h}function Cr(r,o){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[u,c]=Lg(r.path,r.caseSensitive,r.end),d=o.match(u);if(!d)return null;let x=d[0],h=x.replace(/(.)\/+$/,"$1"),N=d.slice(1);return{params:c.reduce((m,{paramName:v,isOptional:y},w)=>{if(v==="*"){let z=N[w]||"";h=x.slice(0,x.length-z.length).replace(/(.)\/+$/,"$1")}const _=N[w];return y&&!_?m[v]=void 0:m[v]=(_||"").replace(/%2F/g,"/"),m},{}),pathname:x,pathnameBase:h,pattern:r}}function Lg(r,o=!1,u=!0){qt(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let c=[],d="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,N,p,m,v)=>{if(c.push({paramName:N,isOptional:p!=null}),p){let y=v.charAt(m+h.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(c.push({paramName:"*"}),d+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?d+="\\/*$":r!==""&&r!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),c]}function Hg(r){try{return r.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return qt(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),r}}function ma(r,o){if(o==="/")return r;if(!r.toLowerCase().startsWith(o.toLowerCase()))return null;let u=o.endsWith("/")?o.length-1:o.length,c=r.charAt(u);return c&&c!=="/"?null:r.slice(u)||"/"}var Bg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function kg(r,o="/"){let{pathname:u,search:c="",hash:d=""}=typeof r=="string"?Jl(r):r,x;return u?(u=xx(u),u.startsWith("/")?x=G0(u.substring(1),"/"):x=G0(u,o)):x=o,{pathname:x,search:Yg(c),hash:Gg(d)}}function G0(r,o){let u=wr(o).split("/");return r.split("/").forEach(d=>{d===".."?u.length>1&&u.pop():d!=="."&&u.push(d)}),u.length>1?u.join("/"):"/"}function au(r,o,u,c){return`Cannot include a '${r}' character in a manually specified \`to.${o}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${u}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function $g(r){return r.filter((o,u)=>u===0||o.route.path&&o.route.path.length>0)}function fx(r){let o=$g(r);return o.map((u,c)=>c===o.length-1?u.pathname:u.pathnameBase)}function mu(r,o,u,c=!1){let d;typeof r=="string"?d=Jl(r):(d={...r},Be(!d.pathname||!d.pathname.includes("?"),au("?","pathname","search",d)),Be(!d.pathname||!d.pathname.includes("#"),au("#","pathname","hash",d)),Be(!d.search||!d.search.includes("#"),au("#","search","hash",d)));let x=r===""||d.pathname==="",h=x?"/":d.pathname,N;if(h==null)N=u;else{let y=o.length-1;if(!c&&h.startsWith("..")){let w=h.split("/");for(;w[0]==="..";)w.shift(),y-=1;d.pathname=w.join("/")}N=y>=0?o[y]:"/"}let p=kg(d,N),m=h&&h!=="/"&&h.endsWith("/"),v=(x||h===".")&&u.endsWith("/");return!p.pathname.endsWith("/")&&(m||v)&&(p.pathname+="/"),p}var xx=r=>r.replace(/\/\/+/g,"/"),$t=r=>xx(r.join("/")),wr=r=>r.replace(/\/+$/,""),qg=r=>wr(r).replace(/^\/*/,"/"),Yg=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Gg=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,Vg=class{constructor(r,o,u,c=!1){this.status=r,this.statusText=o||"",this.internal=c,u instanceof Error?(this.data=u.toString(),this.error=u):this.data=u}};function Xg(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function Qg(r){let o=r.map(u=>u.route.path).filter(Boolean);return $t(o)||"/"}var mx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hx(r,o){let u=r;if(typeof u!="string"||!Bg.test(u))return{absoluteURL:void 0,isExternal:!1,to:u};let c=u,d=!1;if(mx)try{let x=new URL(window.location.href),h=u.startsWith("//")?new URL(x.protocol+u):new URL(u),N=ma(h.pathname,o);h.origin===x.origin&&N!=null?u=N+h.search+h.hash:d=!0}catch{qt(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var gx=["POST","PUT","PATCH","DELETE"];new Set(gx);var Zg=["GET",...gx];new Set(Zg);var Wl=j.createContext(null);Wl.displayName="DataRouter";var Tr=j.createContext(null);Tr.displayName="DataRouterState";var px=j.createContext(!1);function Kg(){return j.useContext(px)}var yx=j.createContext({isTransitioning:!1});yx.displayName="ViewTransition";var Jg=j.createContext(new Map);Jg.displayName="Fetchers";var Wg=j.createContext(null);Wg.displayName="Await";var Lt=j.createContext(null);Lt.displayName="Navigation";var In=j.createContext(null);In.displayName="Location";var Kt=j.createContext({outlet:null,matches:[],isDataRoute:!1});Kt.displayName="Route";var hu=j.createContext(null);hu.displayName="RouteError";var vx="REACT_ROUTER_ERROR",Fg="REDIRECT",Pg="ROUTE_ERROR_RESPONSE";function Ig(r){if(r.startsWith(`${vx}:${Fg}:{`))try{let o=JSON.parse(r.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function ep(r){if(r.startsWith(`${vx}:${Pg}:{`))try{let o=JSON.parse(r.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new Vg(o.status,o.statusText,o.data)}catch{}}function tp(r,{relative:o}={}){Be(es(),"useHref() may be used only in the context of a <Router> component.");let{basename:u,navigator:c}=j.useContext(Lt),{hash:d,pathname:x,search:h}=ts(r,{relative:o}),N=x;return u!=="/"&&(N=x==="/"?u:$t([u,x])),c.createHref({pathname:N,search:h,hash:d})}function es(){return j.useContext(In)!=null}function Yt(){return Be(es(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(In).location}var bx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jx(r){j.useContext(Lt).static||j.useLayoutEffect(r)}function gu(){let{isDataRoute:r}=j.useContext(Kt);return r?hp():ap()}function ap(){Be(es(),"useNavigate() may be used only in the context of a <Router> component.");let r=j.useContext(Wl),{basename:o,navigator:u}=j.useContext(Lt),{matches:c}=j.useContext(Kt),{pathname:d}=Yt(),x=JSON.stringify(fx(c)),h=j.useRef(!1);return jx(()=>{h.current=!0}),j.useCallback((p,m={})=>{if(qt(h.current,bx),!h.current)return;if(typeof p=="number"){u.go(p);return}let v=mu(p,JSON.parse(x),d,m.relative==="path");r==null&&o!=="/"&&(v.pathname=v.pathname==="/"?o:$t([o,v.pathname])),(m.replace?u.replace:u.push)(v,m.state,m)},[o,u,x,d,r])}j.createContext(null);function lp(){let{matches:r}=j.useContext(Kt);return r[r.length-1]?.params??{}}function ts(r,{relative:o}={}){let{matches:u}=j.useContext(Kt),{pathname:c}=Yt(),d=JSON.stringify(fx(u));return j.useMemo(()=>mu(r,JSON.parse(d),c,o==="path"),[r,d,c,o])}function np(r,o){return Nx(r,o)}function Nx(r,o,u){Be(es(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=j.useContext(Lt),{matches:d}=j.useContext(Kt),x=d[d.length-1],h=x?x.params:{},N=x?x.pathname:"/",p=x?x.pathnameBase:"/",m=x&&x.route;{let b=m&&m.path||"";Ex(N,!m||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${N}" (under <Route path="${b}">) 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.
|
|
8
|
+
`+n.stack}}var Lr=Object.prototype.hasOwnProperty,Hr=r.unstable_scheduleCallback,Br=r.unstable_cancelCallback,Xx=r.unstable_shouldYield,Qx=r.unstable_requestPaint,ht=r.unstable_now,Zx=r.unstable_getCurrentPriorityLevel,Ru=r.unstable_ImmediatePriority,Mu=r.unstable_UserBlockingPriority,ns=r.unstable_NormalPriority,Kx=r.unstable_LowPriority,_u=r.unstable_IdlePriority,Jx=r.log,Wx=r.unstable_setDisableYieldValue,Pl=null,gt=null;function ha(e){if(typeof Jx=="function"&&Wx(e),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Pl,e)}catch{}}var pt=Math.clz32?Math.clz32:Ix,Fx=Math.log,Px=Math.LN2;function Ix(e){return e>>>=0,e===0?32:31-(Fx(e)/Px|0)|0}var ss=256,rs=262144,is=4194304;function Ya(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 cs(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var s=0,i=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var g=n&134217727;return g!==0?(n=g&~i,n!==0?s=Ya(n):(f&=g,f!==0?s=Ya(f):a||(a=g&~e,a!==0&&(s=Ya(a))))):(g=n&~i,g!==0?s=Ya(g):f!==0?s=Ya(f):a||(a=n&~e,a!==0&&(s=Ya(a)))),s===0?0:t!==0&&t!==s&&(t&i)===0&&(i=s&-s,a=t&-t,i>=a||i===32&&(a&4194048)!==0)?t:s}function Il(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function em(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 zu(){var e=is;return is<<=1,(is&62914560)===0&&(is=4194304),e}function kr(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function en(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function tm(e,t,a,n,s,i){var f=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 g=e.entanglements,C=e.expirationTimes,O=e.hiddenUpdates;for(a=f&~a;0<a;){var $=31-pt(a),G=1<<$;g[$]=0,C[$]=-1;var L=O[$];if(L!==null)for(O[$]=null,$=0;$<L.length;$++){var B=L[$];B!==null&&(B.lane&=-536870913)}a&=~G}n!==0&&Du(e,n,0),i!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=i&~(f&~t))}function Du(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-pt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Ou(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-pt(a),s=1<<n;s&t|e[n]&t&&(e[n]|=t),a&=~s}}function Uu(e,t){var a=t&-t;return a=(a&42)!==0?1:$r(a),(a&(e.suspendedLanes|t))!==0?0:a}function $r(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 qr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Lu(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:S0(e.type))}function Hu(e,t){var a=X.p;try{return X.p=e,t()}finally{X.p=a}}var ga=Math.random().toString(36).slice(2),et="__reactFiber$"+ga,ct="__reactProps$"+ga,il="__reactContainer$"+ga,Yr="__reactEvents$"+ga,am="__reactListeners$"+ga,lm="__reactHandles$"+ga,Bu="__reactResources$"+ga,tn="__reactMarker$"+ga;function Gr(e){delete e[et],delete e[ct],delete e[Yr],delete e[am],delete e[lm]}function cl(e){var t=e[et];if(t)return t;for(var a=e.parentNode;a;){if(t=a[il]||a[et]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=i0(e);e!==null;){if(a=e[et])return a;e=i0(e)}return t}e=a,a=e.parentNode}return null}function ul(e){if(e=e[et]||e[il]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function an(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ol(e){var t=e[Bu];return t||(t=e[Bu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Fe(e){e[tn]=!0}var ku=new Set,$u={};function Ga(e,t){dl(e,t),dl(e+"Capture",t)}function dl(e,t){for($u[e]=t,e=0;e<t.length;e++)ku.add(t[e])}var nm=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]*$"),qu={},Yu={};function sm(e){return Lr.call(Yu,e)?!0:Lr.call(qu,e)?!1:nm.test(e)?Yu[e]=!0:(qu[e]=!0,!1)}function us(e,t,a){if(sm(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 os(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 Jt(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 Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rm(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,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(f){a=""+f,i.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vr(e){if(!e._valueTracker){var t=Gu(e)?"checked":"value";e._valueTracker=rm(e,t,""+e[t])}}function Vu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=Gu(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function ds(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 im=/[\n"\\]/g;function wt(e){return e.replace(im,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Xr(e,t,a,n,s,i,f,g){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Qr(e,f,Ct(t)):a!=null?Qr(e,f,Ct(a)):n!=null&&e.removeAttribute("value"),s==null&&i!=null&&(e.defaultChecked=!!i),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+Ct(g):e.removeAttribute("name")}function Xu(e,t,a,n,s,i,f,g){if(i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.type=i),t!=null||a!=null){if(!(i!=="submit"&&i!=="reset"||t!=null)){Vr(e);return}a=a!=null?""+Ct(a):"",t=t!=null?""+Ct(t):a,g||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=g?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Vr(e)}function Qr(e,t,a){t==="number"&&ds(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function fl(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=""+Ct(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 Qu(e,t,a){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Ct(a):""}function Zu(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(je(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Ct(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Vr(e)}function xl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var cm=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 Ku(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||cm.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Ju(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(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&&Ku(e,s,n)}else for(var i in t)t.hasOwnProperty(i)&&Ku(e,i,t[i])}function Zr(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 um=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"]]),om=/^[\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 fs(e){return om.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Wt(){}var Kr=null;function Jr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ml=null,hl=null;function Wu(e){var t=ul(e);if(t&&(e=t.stateNode)){var a=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(Xr(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="'+wt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var s=n[ct]||null;if(!s)throw Error(c(90));Xr(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&&Vu(n)}break e;case"textarea":Qu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&fl(e,!!a.multiple,t,!1)}}}var Wr=!1;function Fu(e,t,a){if(Wr)return e(t,a);Wr=!0;try{var n=e(t);return n}finally{if(Wr=!1,(ml!==null||hl!==null)&&(Is(),ml&&(t=ml,e=hl,hl=ml=null,Wu(t),e)))for(t=0;t<e.length;t++)Wu(e[t])}}function ln(e,t){var a=e.stateNode;if(a===null)return null;var n=a[ct]||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(c(231,t,typeof a));return a}var Ft=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fr=!1;if(Ft)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){Fr=!0}}),window.addEventListener("test",nn,nn),window.removeEventListener("test",nn,nn)}catch{Fr=!1}var pa=null,Pr=null,xs=null;function Pu(){if(xs)return xs;var e,t=Pr,a=t.length,n,s="value"in pa?pa.value:pa.textContent,i=s.length;for(e=0;e<a&&t[e]===s[e];e++);var f=a-e;for(n=1;n<=f&&t[a-n]===s[i-n];n++);return xs=s.slice(e,1<n?1-n:void 0)}function ms(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 hs(){return!0}function Iu(){return!1}function ut(e){function t(a,n,s,i,f){this._reactName=a,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=f,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(a=e[g],this[g]=a?a(i):i[g]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?hs:Iu,this.isPropagationStopped=Iu,this}return y(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=hs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),t}var Va={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gs=ut(Va),sn=y({},Va,{view:0,detail:0}),dm=ut(sn),Ir,ei,rn,ps=y({},sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ai,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!==rn&&(rn&&e.type==="mousemove"?(Ir=e.screenX-rn.screenX,ei=e.screenY-rn.screenY):ei=Ir=0,rn=e),Ir)},movementY:function(e){return"movementY"in e?e.movementY:ei}}),eo=ut(ps),fm=y({},ps,{dataTransfer:0}),xm=ut(fm),mm=y({},sn,{relatedTarget:0}),ti=ut(mm),hm=y({},Va,{animationName:0,elapsedTime:0,pseudoElement:0}),gm=ut(hm),pm=y({},Va,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ym=ut(pm),vm=y({},Va,{data:0}),to=ut(vm),bm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jm={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"},Nm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nm[e])?!!t[e]:!1}function ai(){return Sm}var Em=y({},sn,{key:function(e){if(e.key){var t=bm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ms(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ai,charCode:function(e){return e.type==="keypress"?ms(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ms(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Cm=ut(Em),wm=y({},ps,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ao=ut(wm),Tm=y({},sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ai}),Am=ut(Tm),Rm=y({},Va,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mm=ut(Rm),_m=y({},ps,{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}),zm=ut(_m),Dm=y({},Va,{newState:0,oldState:0}),Om=ut(Dm),Um=[9,13,27,32],li=Ft&&"CompositionEvent"in window,cn=null;Ft&&"documentMode"in document&&(cn=document.documentMode);var Lm=Ft&&"TextEvent"in window&&!cn,lo=Ft&&(!li||cn&&8<cn&&11>=cn),no=" ",so=!1;function ro(e,t){switch(e){case"keyup":return Um.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 gl=!1;function Hm(e,t){switch(e){case"compositionend":return io(t);case"keypress":return t.which!==32?null:(so=!0,no);case"textInput":return e=t.data,e===no&&so?null:e;default:return null}}function Bm(e,t){if(gl)return e==="compositionend"||!li&&ro(e,t)?(e=Pu(),xs=Pr=pa=null,gl=!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 lo&&t.locale!=="ko"?null:t.data;default:return null}}var km={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 co(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!km[e.type]:t==="textarea"}function uo(e,t,a,n){ml?hl?hl.push(n):hl=[n]:ml=n,t=rr(t,"onChange"),0<t.length&&(a=new gs("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var un=null,on=null;function $m(e){Zf(e,0)}function ys(e){var t=an(e);if(Vu(t))return e}function oo(e,t){if(e==="change")return t}var fo=!1;if(Ft){var ni;if(Ft){var si="oninput"in document;if(!si){var xo=document.createElement("div");xo.setAttribute("oninput","return;"),si=typeof xo.oninput=="function"}ni=si}else ni=!1;fo=ni&&(!document.documentMode||9<document.documentMode)}function mo(){un&&(un.detachEvent("onpropertychange",ho),on=un=null)}function ho(e){if(e.propertyName==="value"&&ys(on)){var t=[];uo(t,on,e,Jr(e)),Fu($m,t)}}function qm(e,t,a){e==="focusin"?(mo(),un=t,on=a,un.attachEvent("onpropertychange",ho)):e==="focusout"&&mo()}function Ym(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ys(on)}function Gm(e,t){if(e==="click")return ys(t)}function Vm(e,t){if(e==="input"||e==="change")return ys(t)}function Xm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:Xm;function dn(e,t){if(yt(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(!Lr.call(t,s)||!yt(e[s],t[s]))return!1}return!0}function go(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function po(e,t){var a=go(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=go(a)}}function yo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yo(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=ds(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=ds(e.document)}return t}function ri(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 Qm=Ft&&"documentMode"in document&&11>=document.documentMode,pl=null,ii=null,fn=null,ci=!1;function bo(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ci||pl==null||pl!==ds(n)||(n=pl,"selectionStart"in n&&ri(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}),fn&&dn(fn,n)||(fn=n,n=rr(ii,"onSelect"),0<n.length&&(t=new gs("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=pl)))}function Xa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var yl={animationend:Xa("Animation","AnimationEnd"),animationiteration:Xa("Animation","AnimationIteration"),animationstart:Xa("Animation","AnimationStart"),transitionrun:Xa("Transition","TransitionRun"),transitionstart:Xa("Transition","TransitionStart"),transitioncancel:Xa("Transition","TransitionCancel"),transitionend:Xa("Transition","TransitionEnd")},ui={},jo={};Ft&&(jo=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function Qa(e){if(ui[e])return ui[e];if(!yl[e])return e;var t=yl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in jo)return ui[e]=t[a];return e}var No=Qa("animationend"),So=Qa("animationiteration"),Eo=Qa("animationstart"),Zm=Qa("transitionrun"),Km=Qa("transitionstart"),Jm=Qa("transitioncancel"),Co=Qa("transitionend"),wo=new Map,oi="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(" ");oi.push("scrollEnd");function Ht(e,t){wo.set(e,t),Ga(t,[e])}var vs=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)},Tt=[],vl=0,di=0;function bs(){for(var e=vl,t=di=vl=0;t<e;){var a=Tt[t];Tt[t++]=null;var n=Tt[t];Tt[t++]=null;var s=Tt[t];Tt[t++]=null;var i=Tt[t];if(Tt[t++]=null,n!==null&&s!==null){var f=n.pending;f===null?s.next=s:(s.next=f.next,f.next=s),n.pending=s}i!==0&&To(a,s,i)}}function js(e,t,a,n){Tt[vl++]=e,Tt[vl++]=t,Tt[vl++]=a,Tt[vl++]=n,di|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function fi(e,t,a,n){return js(e,t,a,n),Ns(e)}function Za(e,t){return js(e,null,null,t),Ns(e)}function To(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var s=!1,i=e.return;i!==null;)i.childLanes|=a,n=i.alternate,n!==null&&(n.childLanes|=a),i.tag===22&&(e=i.stateNode,e===null||e._visibility&1||(s=!0)),e=i,i=i.return;return e.tag===3?(i=e.stateNode,s&&t!==null&&(s=31-pt(a),e=i.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=a|536870912),i):null}function Ns(e){if(50<On)throw On=0,jc=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bl={};function Wm(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 vt(e,t,a,n){return new Wm(e,t,a,n)}function xi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pt(e,t){var a=e.alternate;return a===null?(a=vt(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 Ao(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 Ss(e,t,a,n,s,i){var f=0;if(n=e,typeof e=="function")xi(e)&&(f=1);else if(typeof e=="string")f=tg(e,a,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case H:return e=vt(31,a,t,s),e.elementType=H,e.lanes=i,e;case R:return Ka(a.children,s,i,t);case b:f=8,s|=24;break;case w:return e=vt(12,a,t,s|2),e.elementType=w,e.lanes=i,e;case V:return e=vt(13,a,t,s),e.elementType=V,e.lanes=i,e;case ae:return e=vt(19,a,t,s),e.elementType=ae,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case U:f=10;break e;case T:f=9;break e;case J:f=11;break e;case Z:f=14;break e;case K:f=16,n=null;break e}f=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=vt(f,a,t,s),t.elementType=e,t.type=n,t.lanes=i,t}function Ka(e,t,a,n){return e=vt(7,e,n,t),e.lanes=a,e}function mi(e,t,a){return e=vt(6,e,null,t),e.lanes=a,e}function Ro(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function hi(e,t,a){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Mo=new WeakMap;function At(e,t){if(typeof e=="object"&&e!==null){var a=Mo.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Au(t)},Mo.set(e,t),t)}return{value:e,source:t,stack:Au(t)}}var jl=[],Nl=0,Es=null,xn=0,Rt=[],Mt=0,ya=null,Vt=1,Xt="";function It(e,t){jl[Nl++]=xn,jl[Nl++]=Es,Es=e,xn=t}function _o(e,t,a){Rt[Mt++]=Vt,Rt[Mt++]=Xt,Rt[Mt++]=ya,ya=e;var n=Vt;e=Xt;var s=32-pt(n)-1;n&=~(1<<s),a+=1;var i=32-pt(t)+s;if(30<i){var f=s-s%5;i=(n&(1<<f)-1).toString(32),n>>=f,s-=f,Vt=1<<32-pt(t)+s|a<<s|n,Xt=i+e}else Vt=1<<i|a<<s|n,Xt=e}function gi(e){e.return!==null&&(It(e,1),_o(e,1,0))}function pi(e){for(;e===Es;)Es=jl[--Nl],jl[Nl]=null,xn=jl[--Nl],jl[Nl]=null;for(;e===ya;)ya=Rt[--Mt],Rt[Mt]=null,Xt=Rt[--Mt],Rt[Mt]=null,Vt=Rt[--Mt],Rt[Mt]=null}function zo(e,t){Rt[Mt++]=Vt,Rt[Mt++]=Xt,Rt[Mt++]=ya,Vt=t.id,Xt=t.overflow,ya=e}var tt=null,De=null,pe=!1,va=null,_t=!1,yi=Error(c(519));function ba(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mn(At(t,e)),yi}function Do(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[et]=e,t[ct]=n,a){case"dialog":me("cancel",t),me("close",t);break;case"iframe":case"object":case"embed":me("load",t);break;case"video":case"audio":for(a=0;a<Ln.length;a++)me(Ln[a],t);break;case"source":me("error",t);break;case"img":case"image":case"link":me("error",t),me("load",t);break;case"details":me("toggle",t);break;case"input":me("invalid",t),Xu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":me("invalid",t);break;case"textarea":me("invalid",t),Zu(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||Ff(t.textContent,a)?(n.popover!=null&&(me("beforetoggle",t),me("toggle",t)),n.onScroll!=null&&me("scroll",t),n.onScrollEnd!=null&&me("scrollend",t),n.onClick!=null&&(t.onclick=Wt),t=!0):t=!1,t||ba(e,!0)}function Oo(e){for(tt=e.return;tt;)switch(tt.tag){case 5:case 31:case 13:_t=!1;return;case 27:case 3:_t=!0;return;default:tt=tt.return}}function Sl(e){if(e!==tt)return!1;if(!pe)return Oo(e),pe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Lc(e.type,e.memoizedProps)),a=!a),a&&De&&ba(e),Oo(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));De=r0(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));De=r0(e)}else t===27?(t=De,Oa(e.type)?(e=qc,qc=null,De=e):De=t):De=tt?Dt(e.stateNode.nextSibling):null;return!0}function Ja(){De=tt=null,pe=!1}function vi(){var e=va;return e!==null&&(xt===null?xt=e:xt.push.apply(xt,e),va=null),e}function mn(e){va===null?va=[e]:va.push(e)}var bi=S(null),Wa=null,ea=null;function ja(e,t,a){Q(bi,t._currentValue),t._currentValue=a}function ta(e){e._currentValue=bi.current,q(bi)}function ji(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 Ni(e,t,a,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var i=s.dependencies;if(i!==null){var f=s.child;i=i.firstContext;e:for(;i!==null;){var g=i;i=s;for(var C=0;C<t.length;C++)if(g.context===t[C]){i.lanes|=a,g=i.alternate,g!==null&&(g.lanes|=a),ji(i.return,a,e),n||(f=null);break e}i=g.next}}else if(s.tag===18){if(f=s.return,f===null)throw Error(c(341));f.lanes|=a,i=f.alternate,i!==null&&(i.lanes|=a),ji(f,a,e),f=null}else f=s.child;if(f!==null)f.return=s;else for(f=s;f!==null;){if(f===e){f=null;break}if(s=f.sibling,s!==null){s.return=f.return,f=s;break}f=f.return}s=f}}function El(e,t,a,n){e=null;for(var s=t,i=!1;s!==null;){if(!i){if((s.flags&524288)!==0)i=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var f=s.alternate;if(f===null)throw Error(c(387));if(f=f.memoizedProps,f!==null){var g=s.type;yt(s.pendingProps.value,f.value)||(e!==null?e.push(g):e=[g])}}else if(s===ee.current){if(f=s.alternate,f===null)throw Error(c(387));f.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(qn):e=[qn])}s=s.return}e!==null&&Ni(t,e,a,n),t.flags|=262144}function Cs(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fa(e){Wa=e,ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function at(e){return Uo(Wa,e)}function ws(e,t){return Wa===null&&Fa(e),Uo(e,t)}function Uo(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ea===null){if(e===null)throw Error(c(308));ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ea=ea.next=t;return a}var Fm=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()})}},Pm=r.unstable_scheduleCallback,Im=r.unstable_NormalPriority,Ve={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Si(){return{controller:new Fm,data:new Map,refCount:0}}function hn(e){e.refCount--,e.refCount===0&&Pm(Im,function(){e.controller.abort()})}var gn=null,Ei=0,Cl=0,wl=null;function eh(e,t){if(gn===null){var a=gn=[];Ei=0,Cl=Tc(),wl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Ei++,t.then(Lo,Lo),t}function Lo(){if(--Ei===0&&gn!==null){wl!==null&&(wl.status="fulfilled");var e=gn;gn=null,Cl=0,wl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function th(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 Ho=k.S;k.S=function(e,t){jf=ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&eh(e,t),Ho!==null&&Ho(e,t)};var Pa=S(null);function Ci(){var e=Pa.current;return e!==null?e:_e.pooledCache}function Ts(e,t){t===null?Q(Pa,Pa.current):Q(Pa,t.pool)}function Bo(){var e=Ci();return e===null?null:{parent:Ve._currentValue,pool:e}}var Tl=Error(c(460)),wi=Error(c(474)),As=Error(c(542)),Rs={then:function(){}};function ko(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $o(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Wt,Wt),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Yo(e),e;default:if(typeof t.status=="string")t.then(Wt,Wt);else{if(e=_e,e!==null&&100<e.shellSuspendCounter)throw Error(c(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,Yo(e),e}throw el=t,Tl}}function Ia(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(el=a,Tl):a}}var el=null;function qo(){if(el===null)throw Error(c(459));var e=el;return el=null,e}function Yo(e){if(e===Tl||e===As)throw Error(c(483))}var Al=null,pn=0;function Ms(e){var t=pn;return pn+=1,Al===null&&(Al=[]),$o(Al,e,t)}function yn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function _s(e,t){throw t.$$typeof===E?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Go(e){function t(_,A){if(e){var D=_.deletions;D===null?(_.deletions=[A],_.flags|=16):D.push(A)}}function a(_,A){if(!e)return null;for(;A!==null;)t(_,A),A=A.sibling;return null}function n(_){for(var A=new Map;_!==null;)_.key!==null?A.set(_.key,_):A.set(_.index,_),_=_.sibling;return A}function s(_,A){return _=Pt(_,A),_.index=0,_.sibling=null,_}function i(_,A,D){return _.index=D,e?(D=_.alternate,D!==null?(D=D.index,D<A?(_.flags|=67108866,A):D):(_.flags|=67108866,A)):(_.flags|=1048576,A)}function f(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function g(_,A,D,Y){return A===null||A.tag!==6?(A=mi(D,_.mode,Y),A.return=_,A):(A=s(A,D),A.return=_,A)}function C(_,A,D,Y){var le=D.type;return le===R?$(_,A,D.props.children,Y,D.key):A!==null&&(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&Ia(le)===A.type)?(A=s(A,D.props),yn(A,D),A.return=_,A):(A=Ss(D.type,D.key,D.props,null,_.mode,Y),yn(A,D),A.return=_,A)}function O(_,A,D,Y){return A===null||A.tag!==4||A.stateNode.containerInfo!==D.containerInfo||A.stateNode.implementation!==D.implementation?(A=hi(D,_.mode,Y),A.return=_,A):(A=s(A,D.children||[]),A.return=_,A)}function $(_,A,D,Y,le){return A===null||A.tag!==7?(A=Ka(D,_.mode,Y,le),A.return=_,A):(A=s(A,D),A.return=_,A)}function G(_,A,D){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=mi(""+A,_.mode,D),A.return=_,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case M:return D=Ss(A.type,A.key,A.props,null,_.mode,D),yn(D,A),D.return=_,D;case z:return A=hi(A,_.mode,D),A.return=_,A;case K:return A=Ia(A),G(_,A,D)}if(je(A)||Ee(A))return A=Ka(A,_.mode,D,null),A.return=_,A;if(typeof A.then=="function")return G(_,Ms(A),D);if(A.$$typeof===U)return G(_,ws(_,A),D);_s(_,A)}return null}function L(_,A,D,Y){var le=A!==null?A.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return le!==null?null:g(_,A,""+D,Y);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case M:return D.key===le?C(_,A,D,Y):null;case z:return D.key===le?O(_,A,D,Y):null;case K:return D=Ia(D),L(_,A,D,Y)}if(je(D)||Ee(D))return le!==null?null:$(_,A,D,Y,null);if(typeof D.then=="function")return L(_,A,Ms(D),Y);if(D.$$typeof===U)return L(_,A,ws(_,D),Y);_s(_,D)}return null}function B(_,A,D,Y,le){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return _=_.get(D)||null,g(A,_,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case M:return _=_.get(Y.key===null?D:Y.key)||null,C(A,_,Y,le);case z:return _=_.get(Y.key===null?D:Y.key)||null,O(A,_,Y,le);case K:return Y=Ia(Y),B(_,A,D,Y,le)}if(je(Y)||Ee(Y))return _=_.get(D)||null,$(A,_,Y,le,null);if(typeof Y.then=="function")return B(_,A,D,Ms(Y),le);if(Y.$$typeof===U)return B(_,A,D,ws(A,Y),le);_s(A,Y)}return null}function F(_,A,D,Y){for(var le=null,ve=null,te=A,de=A=0,ge=null;te!==null&&de<D.length;de++){te.index>de?(ge=te,te=null):ge=te.sibling;var be=L(_,te,D[de],Y);if(be===null){te===null&&(te=ge);break}e&&te&&be.alternate===null&&t(_,te),A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be,te=ge}if(de===D.length)return a(_,te),pe&&It(_,de),le;if(te===null){for(;de<D.length;de++)te=G(_,D[de],Y),te!==null&&(A=i(te,A,de),ve===null?le=te:ve.sibling=te,ve=te);return pe&&It(_,de),le}for(te=n(te);de<D.length;de++)ge=B(te,_,de,D[de],Y),ge!==null&&(e&&ge.alternate!==null&&te.delete(ge.key===null?de:ge.key),A=i(ge,A,de),ve===null?le=ge:ve.sibling=ge,ve=ge);return e&&te.forEach(function(ka){return t(_,ka)}),pe&&It(_,de),le}function re(_,A,D,Y){if(D==null)throw Error(c(151));for(var le=null,ve=null,te=A,de=A=0,ge=null,be=D.next();te!==null&&!be.done;de++,be=D.next()){te.index>de?(ge=te,te=null):ge=te.sibling;var ka=L(_,te,be.value,Y);if(ka===null){te===null&&(te=ge);break}e&&te&&ka.alternate===null&&t(_,te),A=i(ka,A,de),ve===null?le=ka:ve.sibling=ka,ve=ka,te=ge}if(be.done)return a(_,te),pe&&It(_,de),le;if(te===null){for(;!be.done;de++,be=D.next())be=G(_,be.value,Y),be!==null&&(A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be);return pe&&It(_,de),le}for(te=n(te);!be.done;de++,be=D.next())be=B(te,_,de,be.value,Y),be!==null&&(e&&be.alternate!==null&&te.delete(be.key===null?de:be.key),A=i(be,A,de),ve===null?le=be:ve.sibling=be,ve=be);return e&&te.forEach(function(fg){return t(_,fg)}),pe&&It(_,de),le}function Me(_,A,D,Y){if(typeof D=="object"&&D!==null&&D.type===R&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case M:e:{for(var le=D.key;A!==null;){if(A.key===le){if(le=D.type,le===R){if(A.tag===7){a(_,A.sibling),Y=s(A,D.props.children),Y.return=_,_=Y;break e}}else if(A.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&Ia(le)===A.type){a(_,A.sibling),Y=s(A,D.props),yn(Y,D),Y.return=_,_=Y;break e}a(_,A);break}else t(_,A);A=A.sibling}D.type===R?(Y=Ka(D.props.children,_.mode,Y,D.key),Y.return=_,_=Y):(Y=Ss(D.type,D.key,D.props,null,_.mode,Y),yn(Y,D),Y.return=_,_=Y)}return f(_);case z:e:{for(le=D.key;A!==null;){if(A.key===le)if(A.tag===4&&A.stateNode.containerInfo===D.containerInfo&&A.stateNode.implementation===D.implementation){a(_,A.sibling),Y=s(A,D.children||[]),Y.return=_,_=Y;break e}else{a(_,A);break}else t(_,A);A=A.sibling}Y=hi(D,_.mode,Y),Y.return=_,_=Y}return f(_);case K:return D=Ia(D),Me(_,A,D,Y)}if(je(D))return F(_,A,D,Y);if(Ee(D)){if(le=Ee(D),typeof le!="function")throw Error(c(150));return D=le.call(D),re(_,A,D,Y)}if(typeof D.then=="function")return Me(_,A,Ms(D),Y);if(D.$$typeof===U)return Me(_,A,ws(_,D),Y);_s(_,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,A!==null&&A.tag===6?(a(_,A.sibling),Y=s(A,D),Y.return=_,_=Y):(a(_,A),Y=mi(D,_.mode,Y),Y.return=_,_=Y),f(_)):a(_,A)}return function(_,A,D,Y){try{pn=0;var le=Me(_,A,D,Y);return Al=null,le}catch(te){if(te===Tl||te===As)throw te;var ve=vt(29,te,null,_.mode);return ve.lanes=Y,ve.return=_,ve}}}var tl=Go(!0),Vo=Go(!1),Na=!1;function Ti(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ai(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 Sa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ea(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Se&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=Ns(e),To(e,null,a),t}return js(e,n,t,a),Ns(e)}function vn(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,Ou(e,a)}}function Ri(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var s=null,i=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};i===null?s=i=f:i=i.next=f,a=a.next}while(a!==null);i===null?s=i=t:i=i.next=t}else s=i=t;a={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,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 Mi=!1;function bn(){if(Mi){var e=wl;if(e!==null)throw e}}function jn(e,t,a,n){Mi=!1;var s=e.updateQueue;Na=!1;var i=s.firstBaseUpdate,f=s.lastBaseUpdate,g=s.shared.pending;if(g!==null){s.shared.pending=null;var C=g,O=C.next;C.next=null,f===null?i=O:f.next=O,f=C;var $=e.alternate;$!==null&&($=$.updateQueue,g=$.lastBaseUpdate,g!==f&&(g===null?$.firstBaseUpdate=O:g.next=O,$.lastBaseUpdate=C))}if(i!==null){var G=s.baseState;f=0,$=O=C=null,g=i;do{var L=g.lane&-536870913,B=L!==g.lane;if(B?(he&L)===L:(n&L)===L){L!==0&&L===Cl&&(Mi=!0),$!==null&&($=$.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var F=e,re=g;L=t;var Me=a;switch(re.tag){case 1:if(F=re.payload,typeof F=="function"){G=F.call(Me,G,L);break e}G=F;break e;case 3:F.flags=F.flags&-65537|128;case 0:if(F=re.payload,L=typeof F=="function"?F.call(Me,G,L):F,L==null)break e;G=y({},G,L);break e;case 2:Na=!0}}L=g.callback,L!==null&&(e.flags|=64,B&&(e.flags|=8192),B=s.callbacks,B===null?s.callbacks=[L]:B.push(L))}else B={lane:L,tag:g.tag,payload:g.payload,callback:g.callback,next:null},$===null?(O=$=B,C=G):$=$.next=B,f|=L;if(g=g.next,g===null){if(g=s.shared.pending,g===null)break;B=g,g=B.next,B.next=null,s.lastBaseUpdate=B,s.shared.pending=null}}while(!0);$===null&&(C=G),s.baseState=C,s.firstBaseUpdate=O,s.lastBaseUpdate=$,i===null&&(s.shared.lanes=0),Ra|=f,e.lanes=f,e.memoizedState=G}}function Xo(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Qo(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Xo(a[e],t)}var Rl=S(null),zs=S(0);function Zo(e,t){e=oa,Q(zs,e),Q(Rl,t),oa=e|t.baseLanes}function _i(){Q(zs,oa),Q(Rl,Rl.current)}function zi(){oa=zs.current,q(Rl),q(zs)}var bt=S(null),zt=null;function Ca(e){var t=e.alternate;Q(Ye,Ye.current&1),Q(bt,e),zt===null&&(t===null||Rl.current!==null||t.memoizedState!==null)&&(zt=e)}function Di(e){Q(Ye,Ye.current),Q(bt,e),zt===null&&(zt=e)}function Ko(e){e.tag===22?(Q(Ye,Ye.current),Q(bt,e),zt===null&&(zt=e)):wa()}function wa(){Q(Ye,Ye.current),Q(bt,bt.current)}function jt(e){q(bt),zt===e&&(zt=null),q(Ye)}var Ye=S(0);function Ds(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||kc(a)||$c(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 aa=0,oe=null,Ae=null,Xe=null,Os=!1,Ml=!1,al=!1,Us=0,Nn=0,_l=null,ah=0;function ke(){throw Error(c(321))}function Oi(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!yt(e[a],t[a]))return!1;return!0}function Ui(e,t,a,n,s,i){return aa=i,oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?_d:Wi,al=!1,i=a(n,s),al=!1,Ml&&(i=Wo(t,a,n,s)),Jo(e),i}function Jo(e){k.H=Cn;var t=Ae!==null&&Ae.next!==null;if(aa=0,Xe=Ae=oe=null,Os=!1,Nn=0,_l=null,t)throw Error(c(300));e===null||Qe||(e=e.dependencies,e!==null&&Cs(e)&&(Qe=!0))}function Wo(e,t,a,n){oe=e;var s=0;do{if(Ml&&(_l=null),Nn=0,Ml=!1,25<=s)throw Error(c(301));if(s+=1,Xe=Ae=null,e.updateQueue!=null){var i=e.updateQueue;i.lastEffect=null,i.events=null,i.stores=null,i.memoCache!=null&&(i.memoCache.index=0)}k.H=zd,i=t(a,n)}while(Ml);return i}function lh(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?Sn(t):t,e=e.useState()[0],(Ae!==null?Ae.memoizedState:null)!==e&&(oe.flags|=1024),t}function Li(){var e=Us!==0;return Us=0,e}function Hi(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Bi(e){if(Os){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Os=!1}aa=0,Xe=Ae=oe=null,Ml=!1,Nn=Us=0,_l=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?oe.memoizedState=Xe=e:Xe=Xe.next=e,Xe}function Ge(){if(Ae===null){var e=oe.alternate;e=e!==null?e.memoizedState:null}else e=Ae.next;var t=Xe===null?oe.memoizedState:Xe.next;if(t!==null)Xe=t,Ae=e;else{if(e===null)throw oe.alternate===null?Error(c(467)):Error(c(310));Ae=e,e={memoizedState:Ae.memoizedState,baseState:Ae.baseState,baseQueue:Ae.baseQueue,queue:Ae.queue,next:null},Xe===null?oe.memoizedState=Xe=e:Xe=Xe.next=e}return Xe}function Ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Sn(e){var t=Nn;return Nn+=1,_l===null&&(_l=[]),e=$o(_l,e,t),t=oe,(Xe===null?t.memoizedState:Xe.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?_d:Wi),e}function Hs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Sn(e);if(e.$$typeof===U)return at(e)}throw Error(c(438,String(e)))}function ki(e){var t=null,a=oe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=oe.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=Ls(),oe.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]=W;return t.index++,a}function la(e,t){return typeof t=="function"?t(e):t}function Bs(e){var t=Ge();return $i(t,Ae,e)}function $i(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var s=e.baseQueue,i=n.pending;if(i!==null){if(s!==null){var f=s.next;s.next=i.next,i.next=f}t.baseQueue=s=i,n.pending=null}if(i=e.baseState,s===null)e.memoizedState=i;else{t=s.next;var g=f=null,C=null,O=t,$=!1;do{var G=O.lane&-536870913;if(G!==O.lane?(he&G)===G:(aa&G)===G){var L=O.revertLane;if(L===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),G===Cl&&($=!0);else if((aa&L)===L){O=O.next,L===Cl&&($=!0);continue}else G={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},C===null?(g=C=G,f=i):C=C.next=G,oe.lanes|=L,Ra|=L;G=O.action,al&&a(i,G),i=O.hasEagerState?O.eagerState:a(i,G)}else L={lane:G,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},C===null?(g=C=L,f=i):C=C.next=L,oe.lanes|=G,Ra|=G;O=O.next}while(O!==null&&O!==t);if(C===null?f=i:C.next=g,!yt(i,e.memoizedState)&&(Qe=!0,$&&(a=wl,a!==null)))throw a;e.memoizedState=i,e.baseState=f,e.baseQueue=C,n.lastRenderedState=i}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function qi(e){var t=Ge(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,s=a.pending,i=t.memoizedState;if(s!==null){a.pending=null;var f=s=s.next;do i=e(i,f.action),f=f.next;while(f!==s);yt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),a.lastRenderedState=i}return[i,n]}function Fo(e,t,a){var n=oe,s=Ge(),i=pe;if(i){if(a===void 0)throw Error(c(407));a=a()}else a=t();var f=!yt((Ae||s).memoizedState,a);if(f&&(s.memoizedState=a,Qe=!0),s=s.queue,Vi(ed.bind(null,n,s,e),[e]),s.getSnapshot!==t||f||Xe!==null&&Xe.memoizedState.tag&1){if(n.flags|=2048,zl(9,{destroy:void 0},Io.bind(null,n,s,a,t),null),_e===null)throw Error(c(349));i||(aa&127)!==0||Po(n,t,a)}return a}function Po(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=oe.updateQueue,t===null?(t=Ls(),oe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Io(e,t,a,n){t.value=a,t.getSnapshot=n,td(t)&&ad(e)}function ed(e,t,a){return a(function(){td(t)&&ad(e)})}function td(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!yt(e,a)}catch{return!0}}function ad(e){var t=Za(e,2);t!==null&&mt(t,e,2)}function Yi(e){var t=it();if(typeof e=="function"){var a=e;if(e=a(),al){ha(!0);try{a()}finally{ha(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},t}function ld(e,t,a,n){return e.baseState=a,$i(e,Ae,typeof n=="function"?n:la)}function nh(e,t,a,n,s){if(qs(e))throw Error(c(485));if(e=t.action,e!==null){var i={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){i.listeners.push(f)}};k.T!==null?a(!0):i.isTransition=!1,n(i),a=t.pending,a===null?(i.next=t.pending=i,nd(t,i)):(i.next=a.next,t.pending=a.next=i)}}function nd(e,t){var a=t.action,n=t.payload,s=e.state;if(t.isTransition){var i=k.T,f={};k.T=f;try{var g=a(s,n),C=k.S;C!==null&&C(f,g),sd(e,t,g)}catch(O){Gi(e,t,O)}finally{i!==null&&f.types!==null&&(i.types=f.types),k.T=i}}else try{i=a(s,n),sd(e,t,i)}catch(O){Gi(e,t,O)}}function sd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){rd(e,t,n)},function(n){return Gi(e,t,n)}):rd(e,t,a)}function rd(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,nd(e,a)))}function Gi(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 cd(e,t){return t}function ud(e,t){if(pe){var a=_e.formState;if(a!==null){e:{var n=oe;if(pe){if(De){t:{for(var s=De,i=_t;s.nodeType!==8;){if(!i){s=null;break t}if(s=Dt(s.nextSibling),s===null){s=null;break t}}i=s.data,s=i==="F!"||i==="F"?s:null}if(s){De=Dt(s.nextSibling),n=s.data==="F!";break e}}ba(n)}n=!1}n&&(t=a[0])}}return a=it(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cd,lastRenderedState:t},a.queue=n,a=Ad.bind(null,oe,n),n.dispatch=a,n=Yi(!1),i=Ji.bind(null,oe,!1,n.queue),n=it(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,a=nh.bind(null,oe,s,i,a),s.dispatch=a,n.memoizedState=e,[t,a,!1]}function od(e){var t=Ge();return dd(t,Ae,e)}function dd(e,t,a){if(t=$i(e,t,cd)[0],e=Bs(la)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Sn(t)}catch(f){throw f===Tl?As:f}else n=t;t=Ge();var s=t.queue,i=s.dispatch;return a!==t.memoizedState&&(oe.flags|=2048,zl(9,{destroy:void 0},sh.bind(null,s,a),null)),[n,i,e]}function sh(e,t){e.action=t}function fd(e){var t=Ge(),a=Ae;if(a!==null)return dd(t,a,e);Ge(),t=t.memoizedState,a=Ge();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function zl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=oe.updateQueue,t===null&&(t=Ls(),oe.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 xd(){return Ge().memoizedState}function ks(e,t,a,n){var s=it();oe.flags|=e,s.memoizedState=zl(1|t,{destroy:void 0},a,n===void 0?null:n)}function $s(e,t,a,n){var s=Ge();n=n===void 0?null:n;var i=s.memoizedState.inst;Ae!==null&&n!==null&&Oi(n,Ae.memoizedState.deps)?s.memoizedState=zl(t,i,a,n):(oe.flags|=e,s.memoizedState=zl(1|t,i,a,n))}function md(e,t){ks(8390656,8,e,t)}function Vi(e,t){$s(2048,8,e,t)}function rh(e){oe.flags|=4;var t=oe.updateQueue;if(t===null)t=Ls(),oe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function hd(e){var t=Ge().memoizedState;return rh({ref:t,nextImpl:e}),function(){if((Se&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function gd(e,t){return $s(4,2,e,t)}function pd(e,t){return $s(4,4,e,t)}function yd(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,$s(4,4,yd.bind(null,t,e),a)}function Xi(){}function bd(e,t){var a=Ge();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Oi(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function jd(e,t){var a=Ge();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Oi(t,n[1]))return n[0];if(n=e(),al){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[n,t],n}function Qi(e,t,a){return a===void 0||(aa&1073741824)!==0&&(he&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Sf(),oe.lanes|=e,Ra|=e,a)}function Nd(e,t,a,n){return yt(a,t)?a:Rl.current!==null?(e=Qi(e,a,n),yt(e,t)||(Qe=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(he&261930)===0?(Qe=!0,e.memoizedState=a):(e=Sf(),oe.lanes|=e,Ra|=e,t)}function Sd(e,t,a,n,s){var i=X.p;X.p=i!==0&&8>i?i:8;var f=k.T,g={};k.T=g,Ji(e,!1,t,a);try{var C=s(),O=k.S;if(O!==null&&O(g,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var $=th(C,n);En(e,t,$,Et(e))}else En(e,t,n,Et(e))}catch(G){En(e,t,{then:function(){},status:"rejected",reason:G},Et())}finally{X.p=i,f!==null&&g.types!==null&&(f.types=g.types),k.T=f}}function ih(){}function Zi(e,t,a,n){if(e.tag!==5)throw Error(c(476));var s=Ed(e).queue;Sd(e,s,t,se,a===null?ih:function(){return Cd(e),a(n)})}function Ed(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:se},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cd(e){var t=Ed(e);t.next===null&&(t=e.alternate.memoizedState),En(e,t.next.queue,{},Et())}function Ki(){return at(qn)}function wd(){return Ge().memoizedState}function Td(){return Ge().memoizedState}function ch(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Et();e=Sa(a);var n=Ea(t,e,a);n!==null&&(mt(n,t,a),vn(n,t,a)),t={cache:Si()},e.payload=t;return}t=t.return}}function uh(e,t,a){var n=Et();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},qs(e)?Rd(t,a):(a=fi(e,t,a,n),a!==null&&(mt(a,e,n),Md(a,t,n)))}function Ad(e,t,a){var n=Et();En(e,t,a,n)}function En(e,t,a,n){var s={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(qs(e))Rd(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var f=t.lastRenderedState,g=i(f,a);if(s.hasEagerState=!0,s.eagerState=g,yt(g,f))return js(e,t,s,0),_e===null&&bs(),!1}catch{}if(a=fi(e,t,s,n),a!==null)return mt(a,e,n),Md(a,t,n),!0}return!1}function Ji(e,t,a,n){if(n={lane:2,revertLane:Tc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qs(e)){if(t)throw Error(c(479))}else t=fi(e,a,n,2),t!==null&&mt(t,e,2)}function qs(e){var t=e.alternate;return e===oe||t!==null&&t===oe}function Rd(e,t){Ml=Os=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Md(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ou(e,a)}}var Cn={readContext:at,use:Hs,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useLayoutEffect:ke,useInsertionEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useSyncExternalStore:ke,useId:ke,useHostTransitionStatus:ke,useFormState:ke,useActionState:ke,useOptimistic:ke,useMemoCache:ke,useCacheRefresh:ke};Cn.useEffectEvent=ke;var _d={readContext:at,use:Hs,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:at,useEffect:md,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ks(4194308,4,yd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ks(4194308,4,e,t)},useInsertionEffect:function(e,t){ks(4,2,e,t)},useMemo:function(e,t){var a=it();t=t===void 0?null:t;var n=e();if(al){ha(!0);try{e()}finally{ha(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=it();if(a!==void 0){var s=a(t);if(al){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=uh.bind(null,oe,e),[n.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=Yi(e);var t=e.queue,a=Ad.bind(null,oe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Xi,useDeferredValue:function(e,t){var a=it();return Qi(a,e,t)},useTransition:function(){var e=Yi(!1);return e=Sd.bind(null,oe,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=oe,s=it();if(pe){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),_e===null)throw Error(c(349));(he&127)!==0||Po(n,t,a)}s.memoizedState=a;var i={value:a,getSnapshot:t};return s.queue=i,md(ed.bind(null,n,i,e),[e]),n.flags|=2048,zl(9,{destroy:void 0},Io.bind(null,n,i,a,t),null),a},useId:function(){var e=it(),t=_e.identifierPrefix;if(pe){var a=Xt,n=Vt;a=(n&~(1<<32-pt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Us++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=ah++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ki,useFormState:ud,useActionState:ud,useOptimistic:function(e){var t=it();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Ji.bind(null,oe,!0,a),a.dispatch=t,[e,t]},useMemoCache:ki,useCacheRefresh:function(){return it().memoizedState=ch.bind(null,oe)},useEffectEvent:function(e){var t=it(),a={impl:e};return t.memoizedState=a,function(){if((Se&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},Wi={readContext:at,use:Hs,useCallback:bd,useContext:at,useEffect:Vi,useImperativeHandle:vd,useInsertionEffect:gd,useLayoutEffect:pd,useMemo:jd,useReducer:Bs,useRef:xd,useState:function(){return Bs(la)},useDebugValue:Xi,useDeferredValue:function(e,t){var a=Ge();return Nd(a,Ae.memoizedState,e,t)},useTransition:function(){var e=Bs(la)[0],t=Ge().memoizedState;return[typeof e=="boolean"?e:Sn(e),t]},useSyncExternalStore:Fo,useId:wd,useHostTransitionStatus:Ki,useFormState:od,useActionState:od,useOptimistic:function(e,t){var a=Ge();return ld(a,Ae,e,t)},useMemoCache:ki,useCacheRefresh:Td};Wi.useEffectEvent=hd;var zd={readContext:at,use:Hs,useCallback:bd,useContext:at,useEffect:Vi,useImperativeHandle:vd,useInsertionEffect:gd,useLayoutEffect:pd,useMemo:jd,useReducer:qi,useRef:xd,useState:function(){return qi(la)},useDebugValue:Xi,useDeferredValue:function(e,t){var a=Ge();return Ae===null?Qi(a,e,t):Nd(a,Ae.memoizedState,e,t)},useTransition:function(){var e=qi(la)[0],t=Ge().memoizedState;return[typeof e=="boolean"?e:Sn(e),t]},useSyncExternalStore:Fo,useId:wd,useHostTransitionStatus:Ki,useFormState:fd,useActionState:fd,useOptimistic:function(e,t){var a=Ge();return Ae!==null?ld(a,Ae,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:ki,useCacheRefresh:Td};zd.useEffectEvent=hd;function Fi(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Pi={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Et(),s=Sa(n);s.payload=t,a!=null&&(s.callback=a),t=Ea(e,s,n),t!==null&&(mt(t,e,n),vn(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Et(),s=Sa(n);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=Ea(e,s,n),t!==null&&(mt(t,e,n),vn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Et(),n=Sa(a);n.tag=2,t!=null&&(n.callback=t),t=Ea(e,n,a),t!==null&&(mt(t,e,a),vn(t,e,a))}};function Dd(e,t,a,n,s,i,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,f):t.prototype&&t.prototype.isPureReactComponent?!dn(a,n)||!dn(s,i):!0}function Od(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&&Pi.enqueueReplaceState(t,t.state,null)}function ll(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=y({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}function Ud(e){vs(e)}function Ld(e){console.error(e)}function Hd(e){vs(e)}function Ys(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Bd(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 Ii(e,t,a){return a=Sa(a),a.tag=3,a.payload={element:null},a.callback=function(){Ys(e,t)},a}function kd(e){return e=Sa(e),e.tag=3,e}function $d(e,t,a,n){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var i=n.value;e.payload=function(){return s(i)},e.callback=function(){Bd(t,a,n)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Bd(t,a,n),typeof s!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var g=n.stack;this.componentDidCatch(n.value,{componentStack:g!==null?g:""})})}function oh(e,t,a,n,s){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&El(t,a,s,!0),a=bt.current,a!==null){switch(a.tag){case 31:case 13:return zt===null?er():a.alternate===null&&$e===0&&($e=3),a.flags&=-257,a.flags|=65536,a.lanes=s,n===Rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Ec(e,n,s)),!1;case 22:return a.flags|=65536,n===Rs?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)),Ec(e,n,s)),!1}throw Error(c(435,a.tag))}return Ec(e,n,s),er(),!1}if(pe)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==yi&&(e=Error(c(422),{cause:n}),mn(At(e,a)))):(n!==yi&&(t=Error(c(423),{cause:n}),mn(At(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=At(n,a),s=Ii(e.stateNode,n,s),Ri(e,s),$e!==4&&($e=2)),!1;var i=Error(c(520),{cause:n});if(i=At(i,a),Dn===null?Dn=[i]:Dn.push(i),$e!==4&&($e=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=Ii(a.stateNode,n,e),Ri(a,e),!1;case 1:if(t=a.type,i=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||i!==null&&typeof i.componentDidCatch=="function"&&(Ma===null||!Ma.has(i))))return a.flags|=65536,s&=-s,a.lanes|=s,s=kd(s),$d(s,e,a,n),Ri(a,s),!1}a=a.return}while(a!==null);return!1}var ec=Error(c(461)),Qe=!1;function lt(e,t,a,n){t.child=e===null?Vo(t,null,a,n):tl(t,e.child,a,n)}function qd(e,t,a,n,s){a=a.render;var i=t.ref;if("ref"in n){var f={};for(var g in n)g!=="ref"&&(f[g]=n[g])}else f=n;return Fa(t),n=Ui(e,t,a,f,i,s),g=Li(),e!==null&&!Qe?(Hi(e,t,s),na(e,t,s)):(pe&&g&&gi(t),t.flags|=1,lt(e,t,n,s),t.child)}function Yd(e,t,a,n,s){if(e===null){var i=a.type;return typeof i=="function"&&!xi(i)&&i.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=i,Gd(e,t,i,n,s)):(e=Ss(a.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!cc(e,s)){var f=i.memoizedProps;if(a=a.compare,a=a!==null?a:dn,a(f,n)&&e.ref===t.ref)return na(e,t,s)}return t.flags|=1,e=Pt(i,n),e.ref=t.ref,e.return=t,t.child=e}function Gd(e,t,a,n,s){if(e!==null){var i=e.memoizedProps;if(dn(i,n)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=n=i,cc(e,s))(e.flags&131072)!==0&&(Qe=!0);else return t.lanes=e.lanes,na(e,t,s)}return tc(e,t,a,n,s)}function Vd(e,t,a,n){var s=n.children,i=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(i=i!==null?i.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&~i}else n=0,t.child=null;return Xd(e,t,i,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ts(t,i!==null?i.cachePool:null),i!==null?Zo(t,i):_i(),Ko(t);else return n=t.lanes=536870912,Xd(e,t,i!==null?i.baseLanes|a:a,a,n)}else i!==null?(Ts(t,i.cachePool),Zo(t,i),wa(),t.memoizedState=null):(e!==null&&Ts(t,null),_i(),wa());return lt(e,t,s,a),t.child}function wn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xd(e,t,a,n,s){var i=Ci();return i=i===null?null:{parent:Ve._currentValue,pool:i},t.memoizedState={baseLanes:a,cachePool:i},e!==null&&Ts(t,null),_i(),Ko(t),e!==null&&El(e,t,n,!0),t.childLanes=s,null}function Gs(e,t){return t=Xs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Qd(e,t,a){return tl(t,e.child,null,a),e=Gs(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function dh(e,t,a){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(pe){if(n.mode==="hidden")return e=Gs(t,n),t.lanes=536870912,wn(null,e);if(Di(t),(e=De)?(e=s0(e,_t),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Vt,overflow:Xt}:null,retryLane:536870912,hydrationErrors:null},a=Ro(e),a.return=t,t.child=a,tt=t,De=null)):e=null,e===null)throw ba(t);return t.lanes=536870912,null}return Gs(t,n)}var i=e.memoizedState;if(i!==null){var f=i.dehydrated;if(Di(t),s)if(t.flags&256)t.flags&=-257,t=Qd(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Qe||El(e,t,a,!1),s=(a&e.childLanes)!==0,Qe||s){if(n=_e,n!==null&&(f=Uu(n,a),f!==0&&f!==i.retryLane))throw i.retryLane=f,Za(e,f),mt(n,e,f),ec;er(),t=Qd(e,t,a)}else e=i.treeContext,De=Dt(f.nextSibling),tt=t,pe=!0,va=null,_t=!1,e!==null&&zo(t,e),t=Gs(t,n),t.flags|=4096;return t}return e=Pt(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vs(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(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function tc(e,t,a,n,s){return Fa(t),a=Ui(e,t,a,n,void 0,s),n=Li(),e!==null&&!Qe?(Hi(e,t,s),na(e,t,s)):(pe&&n&&gi(t),t.flags|=1,lt(e,t,a,s),t.child)}function Zd(e,t,a,n,s,i){return Fa(t),t.updateQueue=null,a=Wo(t,n,a,s),Jo(e),n=Li(),e!==null&&!Qe?(Hi(e,t,i),na(e,t,i)):(pe&&n&&gi(t),t.flags|=1,lt(e,t,a,i),t.child)}function Kd(e,t,a,n,s){if(Fa(t),t.stateNode===null){var i=bl,f=a.contextType;typeof f=="object"&&f!==null&&(i=at(f)),i=new a(n,i),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Pi,t.stateNode=i,i._reactInternals=t,i=t.stateNode,i.props=n,i.state=t.memoizedState,i.refs={},Ti(t),f=a.contextType,i.context=typeof f=="object"&&f!==null?at(f):bl,i.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(Fi(t,a,f,n),i.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(f=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),f!==i.state&&Pi.enqueueReplaceState(i,i.state,null),jn(t,n,i,s),bn(),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){i=t.stateNode;var g=t.memoizedProps,C=ll(a,g);i.props=C;var O=i.context,$=a.contextType;f=bl,typeof $=="object"&&$!==null&&(f=at($));var G=a.getDerivedStateFromProps;$=typeof G=="function"||typeof i.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,$||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(g||O!==f)&&Od(t,i,n,f),Na=!1;var L=t.memoizedState;i.state=L,jn(t,n,i,s),bn(),O=t.memoizedState,g||L!==O||Na?(typeof G=="function"&&(Fi(t,a,G,n),O=t.memoizedState),(C=Na||Dd(t,a,C,n,L,O,f))?($||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=O),i.props=n,i.state=O,i.context=f,n=C):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,Ai(e,t),f=t.memoizedProps,$=ll(a,f),i.props=$,G=t.pendingProps,L=i.context,O=a.contextType,C=bl,typeof O=="object"&&O!==null&&(C=at(O)),g=a.getDerivedStateFromProps,(O=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(f!==G||L!==C)&&Od(t,i,n,C),Na=!1,L=t.memoizedState,i.state=L,jn(t,n,i,s),bn();var B=t.memoizedState;f!==G||L!==B||Na||e!==null&&e.dependencies!==null&&Cs(e.dependencies)?(typeof g=="function"&&(Fi(t,a,g,n),B=t.memoizedState),($=Na||Dd(t,a,$,n,L,B,C)||e!==null&&e.dependencies!==null&&Cs(e.dependencies))?(O||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,B,C),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,B,C)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=B),i.props=n,i.state=B,i.context=C,n=$):(typeof i.componentDidUpdate!="function"||f===e.memoizedProps&&L===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&L===e.memoizedState||(t.flags|=1024),n=!1)}return i=n,Vs(e,t),n=(t.flags&128)!==0,i||n?(i=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:i.render(),t.flags|=1,e!==null&&n?(t.child=tl(t,e.child,null,s),t.child=tl(t,null,a,s)):lt(e,t,a,s),t.memoizedState=i.state,e=t.child):e=na(e,t,s),e}function Jd(e,t,a,n){return Ja(),t.flags|=256,lt(e,t,a,n),t.child}var ac={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function lc(e){return{baseLanes:e,cachePool:Bo()}}function nc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=St),e}function Wd(e,t,a){var n=t.pendingProps,s=!1,i=(t.flags&128)!==0,f;if((f=i)||(f=e!==null&&e.memoizedState===null?!1:(Ye.current&2)!==0),f&&(s=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(pe){if(s?Ca(t):wa(),(e=De)?(e=s0(e,_t),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ya!==null?{id:Vt,overflow:Xt}:null,retryLane:536870912,hydrationErrors:null},a=Ro(e),a.return=t,t.child=a,tt=t,De=null)):e=null,e===null)throw ba(t);return $c(e)?t.lanes=32:t.lanes=536870912,null}var g=n.children;return n=n.fallback,s?(wa(),s=t.mode,g=Xs({mode:"hidden",children:g},s),n=Ka(n,s,a,null),g.return=t,n.return=t,g.sibling=n,t.child=g,n=t.child,n.memoizedState=lc(a),n.childLanes=nc(e,f,a),t.memoizedState=ac,wn(null,n)):(Ca(t),sc(t,g))}var C=e.memoizedState;if(C!==null&&(g=C.dehydrated,g!==null)){if(i)t.flags&256?(Ca(t),t.flags&=-257,t=rc(e,t,a)):t.memoizedState!==null?(wa(),t.child=e.child,t.flags|=128,t=null):(wa(),g=n.fallback,s=t.mode,n=Xs({mode:"visible",children:n.children},s),g=Ka(g,s,a,null),g.flags|=2,n.return=t,g.return=t,n.sibling=g,t.child=n,tl(t,e.child,null,a),n=t.child,n.memoizedState=lc(a),n.childLanes=nc(e,f,a),t.memoizedState=ac,t=wn(null,n));else if(Ca(t),$c(g)){if(f=g.nextSibling&&g.nextSibling.dataset,f)var O=f.dgst;f=O,n=Error(c(419)),n.stack="",n.digest=f,mn({value:n,source:null,stack:null}),t=rc(e,t,a)}else if(Qe||El(e,t,a,!1),f=(a&e.childLanes)!==0,Qe||f){if(f=_e,f!==null&&(n=Uu(f,a),n!==0&&n!==C.retryLane))throw C.retryLane=n,Za(e,n),mt(f,e,n),ec;kc(g)||er(),t=rc(e,t,a)}else kc(g)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,De=Dt(g.nextSibling),tt=t,pe=!0,va=null,_t=!1,e!==null&&zo(t,e),t=sc(t,n.children),t.flags|=4096);return t}return s?(wa(),g=n.fallback,s=t.mode,C=e.child,O=C.sibling,n=Pt(C,{mode:"hidden",children:n.children}),n.subtreeFlags=C.subtreeFlags&65011712,O!==null?g=Pt(O,g):(g=Ka(g,s,a,null),g.flags|=2),g.return=t,n.return=t,n.sibling=g,t.child=n,wn(null,n),n=t.child,g=e.child.memoizedState,g===null?g=lc(a):(s=g.cachePool,s!==null?(C=Ve._currentValue,s=s.parent!==C?{parent:C,pool:C}:s):s=Bo(),g={baseLanes:g.baseLanes|a,cachePool:s}),n.memoizedState=g,n.childLanes=nc(e,f,a),t.memoizedState=ac,wn(e.child,n)):(Ca(t),a=e.child,e=a.sibling,a=Pt(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function sc(e,t){return t=Xs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Xs(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function rc(e,t,a){return tl(t,e.child,null,a),e=sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Fd(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ji(e.return,t,a)}function ic(e,t,a,n,s,i){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:s,treeForkCount:i}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=a,f.tailMode=s,f.treeForkCount=i)}function Pd(e,t,a){var n=t.pendingProps,s=n.revealOrder,i=n.tail;n=n.children;var f=Ye.current,g=(f&2)!==0;if(g?(f=f&1|2,t.flags|=128):f&=1,Q(Ye,f),lt(e,t,n,a),n=pe?xn:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fd(e,a,t);else if(e.tag===19)Fd(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&&Ds(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),ic(t,!1,s,a,i,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&&Ds(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}ic(t,!0,a,null,i,n);break;case"together":ic(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function na(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ra|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(El(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=Pt(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Pt(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function cc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Cs(e)))}function fh(e,t,a){switch(t.tag){case 3:Ke(t,t.stateNode.containerInfo),ja(t,Ve,e.memoizedState.cache),Ja();break;case 27:case 5:Fl(t);break;case 4:Ke(t,t.stateNode.containerInfo);break;case 10:ja(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Di(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Ca(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Wd(e,t,a):(Ca(t),e=na(e,t,a),e!==null?e.sibling:null);Ca(t);break;case 19:var s=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(El(e,t,a,!1),n=(a&t.childLanes)!==0),s){if(n)return Pd(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Q(Ye,Ye.current),n)break;return null;case 22:return t.lanes=0,Vd(e,t,a,t.pendingProps);case 24:ja(t,Ve,e.memoizedState.cache)}return na(e,t,a)}function Id(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qe=!0;else{if(!cc(e,a)&&(t.flags&128)===0)return Qe=!1,fh(e,t,a);Qe=(e.flags&131072)!==0}else Qe=!1,pe&&(t.flags&1048576)!==0&&_o(t,xn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e=="function")xi(e)?(n=ll(e,n),t.tag=1,t=Kd(null,t,e,n,a)):(t.tag=0,t=tc(null,t,e,n,a));else{if(e!=null){var s=e.$$typeof;if(s===J){t.tag=11,t=qd(null,t,e,n,a);break e}else if(s===Z){t.tag=14,t=Yd(null,t,e,n,a);break e}}throw t=ze(e)||e,Error(c(306,t,""))}}return t;case 0:return tc(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,s=ll(n,t.pendingProps),Kd(e,t,n,s,a);case 3:e:{if(Ke(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var i=t.memoizedState;s=i.element,Ai(e,t),jn(t,n,null,a);var f=t.memoizedState;if(n=f.cache,ja(t,Ve,n),n!==i.cache&&Ni(t,[Ve],a,!0),bn(),n=f.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){t=Jd(e,t,n,a);break e}else if(n!==s){s=At(Error(c(424)),t),mn(s),t=Jd(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,De=Dt(e.firstChild),tt=t,pe=!0,va=null,_t=!0,a=Vo(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ja(),n===s){t=na(e,t,a);break e}lt(e,t,n,a)}t=t.child}return t;case 26:return Vs(e,t),e===null?(a=d0(t.type,null,t.pendingProps,null))?t.memoizedState=a:pe||(a=t.type,e=t.pendingProps,n=ir(fe.current).createElement(a),n[et]=t,n[ct]=e,nt(n,a,e),Fe(n),t.stateNode=n):t.memoizedState=d0(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Fl(t),e===null&&pe&&(n=t.stateNode=c0(t.type,t.pendingProps,fe.current),tt=t,_t=!0,s=De,Oa(t.type)?(qc=s,De=Dt(n.firstChild)):De=s),lt(e,t,t.pendingProps.children,a),Vs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&pe&&((s=n=De)&&(n=Yh(n,t.type,t.pendingProps,_t),n!==null?(t.stateNode=n,tt=t,De=Dt(n.firstChild),_t=!1,s=!0):s=!1),s||ba(t)),Fl(t),s=t.type,i=t.pendingProps,f=e!==null?e.memoizedProps:null,n=i.children,Lc(s,i)?n=null:f!==null&&Lc(s,f)&&(t.flags|=32),t.memoizedState!==null&&(s=Ui(e,t,lh,null,null,a),qn._currentValue=s),Vs(e,t),lt(e,t,n,a),t.child;case 6:return e===null&&pe&&((e=a=De)&&(a=Gh(a,t.pendingProps,_t),a!==null?(t.stateNode=a,tt=t,De=null,e=!0):e=!1),e||ba(t)),null;case 13:return Wd(e,t,a);case 4:return Ke(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=tl(t,null,n,a):lt(e,t,n,a),t.child;case 11:return qd(e,t,t.type,t.pendingProps,a);case 7:return lt(e,t,t.pendingProps,a),t.child;case 8:return lt(e,t,t.pendingProps.children,a),t.child;case 12:return lt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,ja(t,t.type,n.value),lt(e,t,n.children,a),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,Fa(t),s=at(s),n=n(s),t.flags|=1,lt(e,t,n,a),t.child;case 14:return Yd(e,t,t.type,t.pendingProps,a);case 15:return Gd(e,t,t.type,t.pendingProps,a);case 19:return Pd(e,t,a);case 31:return dh(e,t,a);case 22:return Vd(e,t,a,t.pendingProps);case 24:return Fa(t),n=at(Ve),e===null?(s=Ci(),s===null&&(s=_e,i=Si(),s.pooledCache=i,i.refCount++,i!==null&&(s.pooledCacheLanes|=a),s=i),t.memoizedState={parent:n,cache:s},Ti(t),ja(t,Ve,s)):((e.lanes&a)!==0&&(Ai(e,t),jn(t,null,null,a),bn()),s=e.memoizedState,i=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),ja(t,Ve,n)):(n=i.cache,ja(t,Ve,n),n!==s.cache&&Ni(t,[Ve],a,!0))),lt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function sa(e){e.flags|=4}function uc(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(Tf())e.flags|=8192;else throw el=Rs,wi}else e.flags&=-16777217}function ef(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!g0(t))if(Tf())e.flags|=8192;else throw el=Rs,wi}function Qs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zu():536870912,e.lanes|=t,Ll|=t)}function Tn(e,t){if(!pe)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 Oe(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 xh(e,t,a){var n=t.pendingProps;switch(pi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return Oe(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ta(Ve),qe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Sl(t)?sa(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,vi())),Oe(t),null;case 26:var s=t.type,i=t.memoizedState;return e===null?(sa(t),i!==null?(Oe(t),ef(t,i)):(Oe(t),uc(t,s,null,n,a))):i?i!==e.memoizedState?(sa(t),Oe(t),ef(t,i)):(Oe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&sa(t),Oe(t),uc(t,s,e,n,a)),null;case 27:if(ls(t),a=fe.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Oe(t),null}e=P.current,Sl(t)?Do(t):(e=c0(s,n,a),t.stateNode=e,sa(t))}return Oe(t),null;case 5:if(ls(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Oe(t),null}if(i=P.current,Sl(t))Do(t);else{var f=ir(fe.current);switch(i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?i.multiple=!0:n.size&&(i.size=n.size);break;default:i=typeof n.is=="string"?f.createElement(s,{is:n.is}):f.createElement(s)}}i[et]=t,i[ct]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=i;e:switch(nt(i,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&&sa(t)}}return Oe(t),uc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&sa(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=fe.current,Sl(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,s=tt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[et]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Ff(e.nodeValue,a)),e||ba(t,!0)}else e=ir(e).createTextNode(n),e[et]=t,t.stateNode=e}return Oe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Sl(t),a!==null){if(e===null){if(!n)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[et]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Oe(t),e=!1}else a=vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Oe(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=Sl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(c(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(c(317));s[et]=t}else Ja(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Oe(t),s=!1}else s=vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(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),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==s&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Qs(t,t.updateQueue),Oe(t),null);case 4:return qe(),e===null&&_c(t.stateNode.containerInfo),Oe(t),null;case 10:return ta(t.type),Oe(t),null;case 19:if(q(Ye),n=t.memoizedState,n===null)return Oe(t),null;if(s=(t.flags&128)!==0,i=n.rendering,i===null)if(s)Tn(n,!1);else{if($e!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Ds(e),i!==null){for(t.flags|=128,Tn(n,!1),e=i.updateQueue,t.updateQueue=e,Qs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Ao(a,e),a=a.sibling;return Q(Ye,Ye.current&1|2),pe&&It(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&ht()>Fs&&(t.flags|=128,s=!0,Tn(n,!1),t.lanes=4194304)}else{if(!s)if(e=Ds(i),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Qs(t,e),Tn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!i.alternate&&!pe)return Oe(t),null}else 2*ht()-n.renderingStartTime>Fs&&a!==536870912&&(t.flags|=128,s=!0,Tn(n,!1),t.lanes=4194304);n.isBackwards?(i.sibling=t.child,t.child=i):(e=n.last,e!==null?e.sibling=i:t.child=i,n.last=i)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=ht(),e.sibling=null,a=Ye.current,Q(Ye,s?a&1|2:a&1),pe&&It(t,n.treeForkCount),e):(Oe(t),null);case 22:case 23:return jt(t),zi(),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&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),a=t.updateQueue,a!==null&&Qs(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&&q(Pa),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ta(Ve),Oe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function mh(e,t){switch(pi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(Ve),qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ls(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(c(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ja()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(Ye),null;case 4:return qe(),null;case 10:return ta(t.type),null;case 22:case 23:return jt(t),zi(),e!==null&&q(Pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(Ve),null;case 25:return null;default:return null}}function tf(e,t){switch(pi(t),t.tag){case 3:ta(Ve),qe();break;case 26:case 27:case 5:ls(t);break;case 4:qe();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:q(Ye);break;case 10:ta(t.type);break;case 22:case 23:jt(t),zi(),e!==null&&q(Pa);break;case 24:ta(Ve)}}function An(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 i=a.create,f=a.inst;n=i(),f.destroy=n}a=a.next}while(a!==s)}}catch(g){we(t,t.return,g)}}function Ta(e,t,a){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){var f=n.inst,g=f.destroy;if(g!==void 0){f.destroy=void 0,s=t;var C=a,O=g;try{O()}catch($){we(s,C,$)}}}n=n.next}while(n!==i)}}catch($){we(t,t.return,$)}}function af(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Qo(t,a)}catch(n){we(e,e.return,n)}}}function lf(e,t,a){a.props=ll(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){we(e,t,n)}}function Rn(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){we(e,t,s)}}function Qt(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(s){we(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){we(e,t,s)}else a.current=null}function nf(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){we(e,e.return,s)}}function oc(e,t,a){try{var n=e.stateNode;Lh(n,e.type,a,t),n[ct]=t}catch(s){we(e,e.return,s)}}function sf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oa(e.type)||e.tag===4}function dc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sf(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&&Oa(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 fc(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=Wt));else if(n!==4&&(n===27&&Oa(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(fc(e,t,a),e=e.sibling;e!==null;)fc(e,t,a),e=e.sibling}function Zs(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&&Oa(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Zs(e,t,a),e=e.sibling;e!==null;)Zs(e,t,a),e=e.sibling}function rf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);nt(t,n,a),t[et]=e,t[ct]=a}catch(i){we(e,e.return,i)}}var ra=!1,Ze=!1,xc=!1,cf=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function hh(e,t){if(e=e.containerInfo,Oc=mr,e=vo(e),ri(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,i=n.focusNode;n=n.focusOffset;try{a.nodeType,i.nodeType}catch{a=null;break e}var f=0,g=-1,C=-1,O=0,$=0,G=e,L=null;t:for(;;){for(var B;G!==a||s!==0&&G.nodeType!==3||(g=f+s),G!==i||n!==0&&G.nodeType!==3||(C=f+n),G.nodeType===3&&(f+=G.nodeValue.length),(B=G.firstChild)!==null;)L=G,G=B;for(;;){if(G===e)break t;if(L===a&&++O===s&&(g=f),L===i&&++$===n&&(C=f),(B=G.nextSibling)!==null)break;G=L,L=G.parentNode}G=B}a=g===-1||C===-1?null:{start:g,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;for(Uc={focusedElem:e,selectionRange:a},mr=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){switch(t=Pe,i=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&&i!==null){e=void 0,a=t,s=i.memoizedProps,i=i.memoizedState,n=a.stateNode;try{var F=ll(a.type,s);e=n.getSnapshotBeforeUpdate(F,i),n.__reactInternalSnapshotBeforeUpdate=e}catch(re){we(a,a.return,re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Bc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bc(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Pe=e;break}Pe=t.return}}function uf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:ca(e,a),n&4&&An(5,a);break;case 1:if(ca(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){we(a,a.return,f)}else{var s=ll(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){we(a,a.return,f)}}n&64&&af(a),n&512&&Rn(a,a.return);break;case 3:if(ca(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{Qo(e,t)}catch(f){we(a,a.return,f)}}break;case 27:t===null&&n&4&&rf(a);case 26:case 5:ca(e,a),t===null&&n&4&&nf(a),n&512&&Rn(a,a.return);break;case 12:ca(e,a);break;case 31:ca(e,a),n&4&&ff(e,a);break;case 13:ca(e,a),n&4&&xf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Eh.bind(null,a),Vh(e,a))));break;case 22:if(n=a.memoizedState!==null||ra,!n){t=t!==null&&t.memoizedState!==null||Ze,s=ra;var i=Ze;ra=n,(Ze=t)&&!i?ua(e,a,(a.subtreeFlags&8772)!==0):ca(e,a),ra=s,Ze=i}break;case 30:break;default:ca(e,a)}}function of(e){var t=e.alternate;t!==null&&(e.alternate=null,of(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Gr(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 Le=null,ot=!1;function ia(e,t,a){for(a=a.child;a!==null;)df(e,t,a),a=a.sibling}function df(e,t,a){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Pl,a)}catch{}switch(a.tag){case 26:Ze||Qt(a,t),ia(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ze||Qt(a,t);var n=Le,s=ot;Oa(a.type)&&(Le=a.stateNode,ot=!1),ia(e,t,a),Bn(a.stateNode),Le=n,ot=s;break;case 5:Ze||Qt(a,t);case 6:if(n=Le,s=ot,Le=null,ia(e,t,a),Le=n,ot=s,Le!==null)if(ot)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(a.stateNode)}catch(i){we(a,t,i)}else try{Le.removeChild(a.stateNode)}catch(i){we(a,t,i)}break;case 18:Le!==null&&(ot?(e=Le,l0(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Vl(e)):l0(Le,a.stateNode));break;case 4:n=Le,s=ot,Le=a.stateNode.containerInfo,ot=!0,ia(e,t,a),Le=n,ot=s;break;case 0:case 11:case 14:case 15:Ta(2,a,t),Ze||Ta(4,a,t),ia(e,t,a);break;case 1:Ze||(Qt(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&lf(a,t,n)),ia(e,t,a);break;case 21:ia(e,t,a);break;case 22:Ze=(n=Ze)||a.memoizedState!==null,ia(e,t,a),Ze=n;break;default:ia(e,t,a)}}function ff(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vl(e)}catch(a){we(t,t.return,a)}}}function xf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vl(e)}catch(a){we(t,t.return,a)}}function gh(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cf),t;default:throw Error(c(435,e.tag))}}function Ks(e,t){var a=gh(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var s=Ch.bind(null,e,n);n.then(s,s)}})}function dt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var s=a[n],i=e,f=t,g=f;e:for(;g!==null;){switch(g.tag){case 27:if(Oa(g.type)){Le=g.stateNode,ot=!1;break e}break;case 5:Le=g.stateNode,ot=!1;break e;case 3:case 4:Le=g.stateNode.containerInfo,ot=!0;break e}g=g.return}if(Le===null)throw Error(c(160));df(i,f,s),Le=null,ot=!1,i=s.alternate,i!==null&&(i.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)mf(t,e),t=t.sibling}var Bt=null;function mf(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dt(t,e),ft(e),n&4&&(Ta(3,e,e.return),An(3,e),Ta(5,e,e.return));break;case 1:dt(t,e),ft(e),n&512&&(Ze||a===null||Qt(a,a.return)),n&64&&ra&&(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=Bt;if(dt(t,e),ft(e),n&512&&(Ze||a===null||Qt(a,a.return)),n&4){var i=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":i=s.getElementsByTagName("title")[0],(!i||i[tn]||i[et]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=s.createElement(n),s.head.insertBefore(i,s.querySelector("head > title"))),nt(i,n,a),i[et]=e,Fe(i),n=i;break e;case"link":var f=m0("link","href",s).get(n+(a.href||""));if(f){for(var g=0;g<f.length;g++)if(i=f[g],i.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&i.getAttribute("rel")===(a.rel==null?null:a.rel)&&i.getAttribute("title")===(a.title==null?null:a.title)&&i.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(g,1);break t}}i=s.createElement(n),nt(i,n,a),s.head.appendChild(i);break;case"meta":if(f=m0("meta","content",s).get(n+(a.content||""))){for(g=0;g<f.length;g++)if(i=f[g],i.getAttribute("content")===(a.content==null?null:""+a.content)&&i.getAttribute("name")===(a.name==null?null:a.name)&&i.getAttribute("property")===(a.property==null?null:a.property)&&i.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&i.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(g,1);break t}}i=s.createElement(n),nt(i,n,a),s.head.appendChild(i);break;default:throw Error(c(468,n))}i[et]=e,Fe(i),n=i}e.stateNode=n}else h0(s,e.type,e.stateNode);else e.stateNode=x0(s,n,e.memoizedProps);else i!==n?(i===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):i.count--,n===null?h0(s,e.type,e.stateNode):x0(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&oc(e,e.memoizedProps,a.memoizedProps)}break;case 27:dt(t,e),ft(e),n&512&&(Ze||a===null||Qt(a,a.return)),a!==null&&n&4&&oc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(dt(t,e),ft(e),n&512&&(Ze||a===null||Qt(a,a.return)),e.flags&32){s=e.stateNode;try{xl(s,"")}catch(F){we(e,e.return,F)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,oc(e,s,a!==null?a.memoizedProps:s)),n&1024&&(xc=!0);break;case 6:if(dt(t,e),ft(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(F){we(e,e.return,F)}}break;case 3:if(or=null,s=Bt,Bt=cr(t.containerInfo),dt(t,e),Bt=s,ft(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Vl(t.containerInfo)}catch(F){we(e,e.return,F)}xc&&(xc=!1,hf(e));break;case 4:n=Bt,Bt=cr(e.stateNode.containerInfo),dt(t,e),ft(e),Bt=n;break;case 12:dt(t,e),ft(e);break;case 31:dt(t,e),ft(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ks(e,n)));break;case 13:dt(t,e),ft(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ws=ht()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ks(e,n)));break;case 22:s=e.memoizedState!==null;var C=a!==null&&a.memoizedState!==null,O=ra,$=Ze;if(ra=O||s,Ze=$||C,dt(t,e),Ze=$,ra=O,ft(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||C||ra||Ze||nl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){C=a=t;try{if(i=C.stateNode,s)f=i.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{g=C.stateNode;var G=C.memoizedProps.style,L=G!=null&&G.hasOwnProperty("display")?G.display:null;g.style.display=L==null||typeof L=="boolean"?"":(""+L).trim()}}catch(F){we(C,C.return,F)}}}else if(t.tag===6){if(a===null){C=t;try{C.stateNode.nodeValue=s?"":C.memoizedProps}catch(F){we(C,C.return,F)}}}else if(t.tag===18){if(a===null){C=t;try{var B=C.stateNode;s?n0(B,!0):n0(C.stateNode,!1)}catch(F){we(C,C.return,F)}}}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,Ks(e,a))));break;case 19:dt(t,e),ft(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ks(e,n)));break;case 30:break;case 21:break;default:dt(t,e),ft(e)}}function ft(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(sf(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var s=a.stateNode,i=dc(e);Zs(e,i,s);break;case 5:var f=a.stateNode;a.flags&32&&(xl(f,""),a.flags&=-33);var g=dc(e);Zs(e,g,f);break;case 3:case 4:var C=a.stateNode.containerInfo,O=dc(e);fc(e,O,C);break;default:throw Error(c(161))}}catch($){we(e,e.return,$)}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 ca(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uf(e,t.alternate,t),t=t.sibling}function nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ta(4,t,t.return),nl(t);break;case 1:Qt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&lf(t,t.return,a),nl(t);break;case 27:Bn(t.stateNode);case 26:case 5:Qt(t,t.return),nl(t);break;case 22:t.memoizedState===null&&nl(t);break;case 30:nl(t);break;default:nl(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,i=t,f=i.flags;switch(i.tag){case 0:case 11:case 15:ua(s,i,a),An(4,i);break;case 1:if(ua(s,i,a),n=i,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(O){we(n,n.return,O)}if(n=i,s=n.updateQueue,s!==null){var g=n.stateNode;try{var C=s.shared.hiddenCallbacks;if(C!==null)for(s.shared.hiddenCallbacks=null,s=0;s<C.length;s++)Xo(C[s],g)}catch(O){we(n,n.return,O)}}a&&f&64&&af(i),Rn(i,i.return);break;case 27:rf(i);case 26:case 5:ua(s,i,a),a&&n===null&&f&4&&nf(i),Rn(i,i.return);break;case 12:ua(s,i,a);break;case 31:ua(s,i,a),a&&f&4&&ff(s,i);break;case 13:ua(s,i,a),a&&f&4&&xf(s,i);break;case 22:i.memoizedState===null&&ua(s,i,a),Rn(i,i.return);break;case 30:break;default:ua(s,i,a)}t=t.sibling}}function mc(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&&hn(a))}function hc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hn(e))}function kt(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)gf(e,t,a,n),t=t.sibling}function gf(e,t,a,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:kt(e,t,a,n),s&2048&&An(9,t);break;case 1:kt(e,t,a,n);break;case 3:kt(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&&hn(e)));break;case 12:if(s&2048){kt(e,t,a,n),e=t.stateNode;try{var i=t.memoizedProps,f=i.id,g=i.onPostCommit;typeof g=="function"&&g(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){we(t,t.return,C)}}else kt(e,t,a,n);break;case 31:kt(e,t,a,n);break;case 13:kt(e,t,a,n);break;case 23:break;case 22:i=t.stateNode,f=t.alternate,t.memoizedState!==null?i._visibility&2?kt(e,t,a,n):Mn(e,t):i._visibility&2?kt(e,t,a,n):(i._visibility|=2,Dl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&mc(f,t);break;case 24:kt(e,t,a,n),s&2048&&hc(t.alternate,t);break;default:kt(e,t,a,n)}}function Dl(e,t,a,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var i=e,f=t,g=a,C=n,O=f.flags;switch(f.tag){case 0:case 11:case 15:Dl(i,f,g,C,s),An(8,f);break;case 23:break;case 22:var $=f.stateNode;f.memoizedState!==null?$._visibility&2?Dl(i,f,g,C,s):Mn(i,f):($._visibility|=2,Dl(i,f,g,C,s)),s&&O&2048&&mc(f.alternate,f);break;case 24:Dl(i,f,g,C,s),s&&O&2048&&hc(f.alternate,f);break;default:Dl(i,f,g,C,s)}t=t.sibling}}function Mn(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:Mn(a,n),s&2048&&mc(n.alternate,n);break;case 24:Mn(a,n),s&2048&&hc(n.alternate,n);break;default:Mn(a,n)}t=t.sibling}}var _n=8192;function Ol(e,t,a){if(e.subtreeFlags&_n)for(e=e.child;e!==null;)pf(e,t,a),e=e.sibling}function pf(e,t,a){switch(e.tag){case 26:Ol(e,t,a),e.flags&_n&&e.memoizedState!==null&&ag(a,Bt,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,a);break;case 3:case 4:var n=Bt;Bt=cr(e.stateNode.containerInfo),Ol(e,t,a),Bt=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=_n,_n=16777216,Ol(e,t,a),_n=n):Ol(e,t,a));break;default:Ol(e,t,a)}}function yf(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 zn(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];Pe=n,bf(n,e)}yf(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:zn(e),e.flags&2048&&Ta(9,e,e.return);break;case 3:zn(e);break;case 12:zn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Js(e)):zn(e);break;default:zn(e)}}function Js(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];Pe=n,bf(n,e)}yf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ta(8,t,t.return),Js(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Js(t));break;default:Js(t)}e=e.sibling}}function bf(e,t){for(;Pe!==null;){var a=Pe;switch(a.tag){case 0:case 11:case 15:Ta(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:hn(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Pe=n;else e:for(a=e;Pe!==null;){n=Pe;var s=n.sibling,i=n.return;if(of(n),n===a){Pe=null;break e}if(s!==null){s.return=i,Pe=s;break e}Pe=i}}}var ph={getCacheForType:function(e){var t=at(Ve),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return at(Ve).controller.signal}},yh=typeof WeakMap=="function"?WeakMap:Map,Se=0,_e=null,xe=null,he=0,Ce=0,Nt=null,Aa=!1,Ul=!1,gc=!1,oa=0,$e=0,Ra=0,sl=0,pc=0,St=0,Ll=0,Dn=null,xt=null,yc=!1,Ws=0,jf=0,Fs=1/0,Ps=null,Ma=null,Je=0,_a=null,Hl=null,da=0,vc=0,bc=null,Nf=null,On=0,jc=null;function Et(){return(Se&2)!==0&&he!==0?he&-he:k.T!==null?Tc():Lu()}function Sf(){if(St===0)if((he&536870912)===0||pe){var e=rs;rs<<=1,(rs&3932160)===0&&(rs=262144),St=e}else St=536870912;return e=bt.current,e!==null&&(e.flags|=32),St}function mt(e,t,a){(e===_e&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(Bl(e,0),za(e,he,St,!1)),en(e,a),((Se&2)===0||e!==_e)&&(e===_e&&((Se&2)===0&&(sl|=a),$e===4&&za(e,he,St,!1)),Zt(e))}function Ef(e,t,a){if((Se&6)!==0)throw Error(c(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Il(e,t),s=n?jh(e,t):Sc(e,t,!0),i=n;do{if(s===0){Ul&&!n&&za(e,t,0,!1);break}else{if(a=e.current.alternate,i&&!vh(a)){s=Sc(e,t,!1),i=!1;continue}if(s===2){if(i=t,e.errorRecoveryDisabledLanes&i)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var g=e;s=Dn;var C=g.current.memoizedState.isDehydrated;if(C&&(Bl(g,f).flags|=256),f=Sc(g,f,!1),f!==2){if(gc&&!C){g.errorRecoveryDisabledLanes|=i,sl|=i,s=4;break e}i=xt,xt=s,i!==null&&(xt===null?xt=i:xt.push.apply(xt,i))}s=f}if(i=!1,s!==2)continue}}if(s===1){Bl(e,0),za(e,t,0,!0);break}e:{switch(n=e,i=s,i){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:za(n,t,St,!Aa);break e;case 2:xt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(s=Ws+300-ht(),10<s)){if(za(n,t,St,!Aa),cs(n,0,!0)!==0)break e;da=t,n.timeoutHandle=t0(Cf.bind(null,n,a,xt,Ps,yc,t,St,sl,Ll,Aa,i,"Throttled",-0,0),s);break e}Cf(n,a,xt,Ps,yc,t,St,sl,Ll,Aa,i,null,-0,0)}}break}while(!0);Zt(e)}function Cf(e,t,a,n,s,i,f,g,C,O,$,G,L,B){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wt},pf(t,i,G);var F=(i&62914560)===i?Ws-ht():(i&4194048)===i?jf-ht():0;if(F=lg(G,F),F!==null){da=i,e.cancelPendingCommit=F(Df.bind(null,e,t,i,a,n,s,f,g,C,$,G,null,L,B)),za(e,i,f,!O);return}}Df(e,t,i,a,n,s,f,g,C)}function vh(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],i=s.getSnapshot;s=s.value;try{if(!yt(i(),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 za(e,t,a,n){t&=~pc,t&=~sl,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var i=31-pt(s),f=1<<i;n[i]=-1,s&=~f}a!==0&&Du(e,a,t)}function Is(){return(Se&6)===0?(Un(0),!1):!0}function Nc(){if(xe!==null){if(Ce===0)var e=xe.return;else e=xe,ea=Wa=null,Bi(e),Al=null,pn=0,e=xe;for(;e!==null;)tf(e.alternate,e),e=e.return;xe=null}}function Bl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,kh(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),da=0,Nc(),_e=e,xe=a=Pt(e.current,null),he=t,Ce=0,Nt=null,Aa=!1,Ul=Il(e,t),gc=!1,Ll=St=pc=sl=Ra=$e=0,xt=Dn=null,yc=!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-pt(n),i=1<<s;t|=e[s],n&=~i}return oa=t,bs(),a}function wf(e,t){oe=null,k.H=Cn,t===Tl||t===As?(t=qo(),Ce=3):t===wi?(t=qo(),Ce=4):Ce=t===ec?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Nt=t,xe===null&&($e=1,Ys(e,At(t,e.current)))}function Tf(){var e=bt.current;return e===null?!0:(he&4194048)===he?zt===null:(he&62914560)===he||(he&536870912)!==0?e===zt:!1}function Af(){var e=k.H;return k.H=Cn,e===null?Cn:e}function Rf(){var e=k.A;return k.A=ph,e}function er(){$e=4,Aa||(he&4194048)!==he&&bt.current!==null||(Ul=!0),(Ra&134217727)===0&&(sl&134217727)===0||_e===null||za(_e,he,St,!1)}function Sc(e,t,a){var n=Se;Se|=2;var s=Af(),i=Rf();(_e!==e||he!==t)&&(Ps=null,Bl(e,t)),t=!1;var f=$e;e:do try{if(Ce!==0&&xe!==null){var g=xe,C=Nt;switch(Ce){case 8:Nc(),f=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var O=Ce;if(Ce=0,Nt=null,kl(e,g,C,O),a&&Ul){f=0;break e}break;default:O=Ce,Ce=0,Nt=null,kl(e,g,C,O)}}bh(),f=$e;break}catch($){wf(e,$)}while(!0);return t&&e.shellSuspendCounter++,ea=Wa=null,Se=n,k.H=s,k.A=i,xe===null&&(_e=null,he=0,bs()),f}function bh(){for(;xe!==null;)Mf(xe)}function jh(e,t){var a=Se;Se|=2;var n=Af(),s=Rf();_e!==e||he!==t?(Ps=null,Fs=ht()+500,Bl(e,t)):Ul=Il(e,t);e:do try{if(Ce!==0&&xe!==null){t=xe;var i=Nt;t:switch(Ce){case 1:Ce=0,Nt=null,kl(e,t,i,1);break;case 2:case 9:if(ko(i)){Ce=0,Nt=null,_f(t);break}t=function(){Ce!==2&&Ce!==9||_e!==e||(Ce=7),Zt(e)},i.then(t,t);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:ko(i)?(Ce=0,Nt=null,_f(t)):(Ce=0,Nt=null,kl(e,t,i,7));break;case 5:var f=null;switch(xe.tag){case 26:f=xe.memoizedState;case 5:case 27:var g=xe;if(f?g0(f):g.stateNode.complete){Ce=0,Nt=null;var C=g.sibling;if(C!==null)xe=C;else{var O=g.return;O!==null?(xe=O,tr(O)):xe=null}break t}}Ce=0,Nt=null,kl(e,t,i,5);break;case 6:Ce=0,Nt=null,kl(e,t,i,6);break;case 8:Nc(),$e=6;break e;default:throw Error(c(462))}}Nh();break}catch($){wf(e,$)}while(!0);return ea=Wa=null,k.H=n,k.A=s,Se=a,xe!==null?0:(_e=null,he=0,bs(),$e)}function Nh(){for(;xe!==null&&!Xx();)Mf(xe)}function Mf(e){var t=Id(e.alternate,e,oa);e.memoizedProps=e.pendingProps,t===null?tr(e):xe=t}function _f(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Zd(a,t,t.pendingProps,t.type,void 0,he);break;case 11:t=Zd(a,t,t.pendingProps,t.type.render,t.ref,he);break;case 5:Bi(t);default:tf(a,t),t=xe=Ao(t,oa),t=Id(a,t,oa)}e.memoizedProps=e.pendingProps,t===null?tr(e):xe=t}function kl(e,t,a,n){ea=Wa=null,Bi(t),Al=null,pn=0;var s=t.return;try{if(oh(e,s,t,a,he)){$e=1,Ys(e,At(a,e.current)),xe=null;return}}catch(i){if(s!==null)throw xe=s,i;$e=1,Ys(e,At(a,e.current)),xe=null;return}t.flags&32768?(pe||n===1?e=!0:Ul||(he&536870912)!==0?e=!1:(Aa=e=!0,(n===2||n===9||n===3||n===6)&&(n=bt.current,n!==null&&n.tag===13&&(n.flags|=16384))),zf(t,e)):tr(t)}function tr(e){var t=e;do{if((t.flags&32768)!==0){zf(t,Aa);return}e=t.return;var a=xh(t.alternate,t,oa);if(a!==null){xe=a;return}if(t=t.sibling,t!==null){xe=t;return}xe=t=e}while(t!==null);$e===0&&($e=5)}function zf(e,t){do{var a=mh(e.alternate,e);if(a!==null){a.flags&=32767,xe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){xe=e;return}xe=e=a}while(e!==null);$e=6,xe=null}function Df(e,t,a,n,s,i,f,g,C){e.cancelPendingCommit=null;do ar();while(Je!==0);if((Se&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(i=t.lanes|t.childLanes,i|=di,tm(e,a,i,f,g,C),e===_e&&(xe=_e=null,he=0),Hl=t,_a=e,da=a,vc=i,bc=s,Nf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,wh(ns,function(){return Bf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=k.T,k.T=null,s=X.p,X.p=2,f=Se,Se|=4;try{hh(e,t,a)}finally{Se=f,X.p=s,k.T=n}}Je=1,Of(),Uf(),Lf()}}function Of(){if(Je===1){Je=0;var e=_a,t=Hl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var n=X.p;X.p=2;var s=Se;Se|=4;try{mf(t,e);var i=Uc,f=vo(e.containerInfo),g=i.focusedElem,C=i.selectionRange;if(f!==g&&g&&g.ownerDocument&&yo(g.ownerDocument.documentElement,g)){if(C!==null&&ri(g)){var O=C.start,$=C.end;if($===void 0&&($=O),"selectionStart"in g)g.selectionStart=O,g.selectionEnd=Math.min($,g.value.length);else{var G=g.ownerDocument||document,L=G&&G.defaultView||window;if(L.getSelection){var B=L.getSelection(),F=g.textContent.length,re=Math.min(C.start,F),Me=C.end===void 0?re:Math.min(C.end,F);!B.extend&&re>Me&&(f=Me,Me=re,re=f);var _=po(g,re),A=po(g,Me);if(_&&A&&(B.rangeCount!==1||B.anchorNode!==_.node||B.anchorOffset!==_.offset||B.focusNode!==A.node||B.focusOffset!==A.offset)){var D=G.createRange();D.setStart(_.node,_.offset),B.removeAllRanges(),re>Me?(B.addRange(D),B.extend(A.node,A.offset)):(D.setEnd(A.node,A.offset),B.addRange(D))}}}}for(G=[],B=g;B=B.parentNode;)B.nodeType===1&&G.push({element:B,left:B.scrollLeft,top:B.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<G.length;g++){var Y=G[g];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}mr=!!Oc,Uc=Oc=null}finally{Se=s,X.p=n,k.T=a}}e.current=t,Je=2}}function Uf(){if(Je===2){Je=0;var e=_a,t=Hl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var n=X.p;X.p=2;var s=Se;Se|=4;try{uf(e,t.alternate,t)}finally{Se=s,X.p=n,k.T=a}}Je=3}}function Lf(){if(Je===4||Je===3){Je=0,Qx();var e=_a,t=Hl,a=da,n=Nf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Hl=_a=null,Hf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(Ma=null),qr(a),t=t.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=k.T,s=X.p,X.p=2,k.T=null;try{for(var i=e.onRecoverableError,f=0;f<n.length;f++){var g=n[f];i(g.value,{componentStack:g.stack})}}finally{k.T=t,X.p=s}}(da&3)!==0&&ar(),Zt(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===jc?On++:(On=0,jc=e):On=0,Un(0)}}function Hf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,hn(t)))}function ar(){return Of(),Uf(),Lf(),Bf()}function Bf(){if(Je!==5)return!1;var e=_a,t=vc;vc=0;var a=qr(da),n=k.T,s=X.p;try{X.p=32>a?32:a,k.T=null,a=bc,bc=null;var i=_a,f=da;if(Je=0,Hl=_a=null,da=0,(Se&6)!==0)throw Error(c(331));var g=Se;if(Se|=4,vf(i.current),gf(i,i.current,f,a),Se=g,Un(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Pl,i)}catch{}return!0}finally{X.p=s,k.T=n,Hf(e,t)}}function kf(e,t,a){t=At(a,t),t=Ii(e.stateNode,t,2),e=Ea(e,t,2),e!==null&&(en(e,2),Zt(e))}function we(e,t,a){if(e.tag===3)kf(e,e,a);else for(;t!==null;){if(t.tag===3){kf(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ma===null||!Ma.has(n))){e=At(a,e),a=kd(2),n=Ea(t,a,2),n!==null&&($d(a,n,t,e),en(n,2),Zt(n));break}}t=t.return}}function Ec(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new yh;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)||(gc=!0,s.add(a),e=Sh.bind(null,e,t,a),t.then(e,e))}function Sh(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,_e===e&&(he&a)===a&&($e===4||$e===3&&(he&62914560)===he&&300>ht()-Ws?(Se&2)===0&&Bl(e,0):pc|=a,Ll===he&&(Ll=0)),Zt(e)}function $f(e,t){t===0&&(t=zu()),e=Za(e,t),e!==null&&(en(e,t),Zt(e))}function Eh(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),$f(e,a)}function Ch(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(c(314))}n!==null&&n.delete(t),$f(e,a)}function wh(e,t){return Hr(e,t)}var lr=null,$l=null,Cc=!1,nr=!1,wc=!1,Da=0;function Zt(e){e!==$l&&e.next===null&&($l===null?lr=$l=e:$l=$l.next=e),nr=!0,Cc||(Cc=!0,Ah())}function Un(e,t){if(!wc&&nr){wc=!0;do for(var a=!1,n=lr;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var i=0;else{var f=n.suspendedLanes,g=n.pingedLanes;i=(1<<31-pt(42|e)+1)-1,i&=s&~(f&~g),i=i&201326741?i&201326741|1:i?i|2:0}i!==0&&(a=!0,Vf(n,i))}else i=he,i=cs(n,n===_e?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(i&3)===0||Il(n,i)||(a=!0,Vf(n,i));n=n.next}while(a);wc=!1}}function Th(){qf()}function qf(){nr=Cc=!1;var e=0;Da!==0&&Bh()&&(e=Da);for(var t=ht(),a=null,n=lr;n!==null;){var s=n.next,i=Yf(n,t);i===0?(n.next=null,a===null?lr=s:a.next=s,s===null&&($l=a)):(a=n,(e!==0||(i&3)!==0)&&(nr=!0)),n=s}Je!==0&&Je!==5||Un(e),Da!==0&&(Da=0)}function Yf(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes&-62914561;0<i;){var f=31-pt(i),g=1<<f,C=s[f];C===-1?((g&a)===0||(g&n)!==0)&&(s[f]=em(g,t)):C<=t&&(e.expiredLanes|=g),i&=~g}if(t=_e,a=he,a=cs(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Br(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Il(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Br(n),qr(a)){case 2:case 8:a=Mu;break;case 32:a=ns;break;case 268435456:a=_u;break;default:a=ns}return n=Gf.bind(null,e),a=Hr(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Br(n),e.callbackPriority=2,e.callbackNode=null,2}function Gf(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(ar()&&e.callbackNode!==a)return null;var n=he;return n=cs(e,e===_e?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Ef(e,n,t),Yf(e,ht()),e.callbackNode!=null&&e.callbackNode===a?Gf.bind(null,e):null)}function Vf(e,t){if(ar())return null;Ef(e,t,!0)}function Ah(){$h(function(){(Se&6)!==0?Hr(Ru,Th):qf()})}function Tc(){if(Da===0){var e=Cl;e===0&&(e=ss,ss<<=1,(ss&261888)===0&&(ss=256)),Da=e}return Da}function Xf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:fs(""+e)}function Qf(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 Rh(e,t,a,n,s){if(t==="submit"&&a&&a.stateNode===s){var i=Xf((s[ct]||null).action),f=n.submitter;f&&(t=(t=f[ct]||null)?Xf(t.formAction):f.getAttribute("formAction"),t!==null&&(i=t,f=null));var g=new gs("action","action",null,n,s);e.push({event:g,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Da!==0){var C=f?Qf(s,f):new FormData(s);Zi(a,{pending:!0,data:C,method:s.method,action:i},null,C)}}else typeof i=="function"&&(g.preventDefault(),C=f?Qf(s,f):new FormData(s),Zi(a,{pending:!0,data:C,method:s.method,action:i},i,C))},currentTarget:s}]})}}for(var Ac=0;Ac<oi.length;Ac++){var Rc=oi[Ac],Mh=Rc.toLowerCase(),_h=Rc[0].toUpperCase()+Rc.slice(1);Ht(Mh,"on"+_h)}Ht(No,"onAnimationEnd"),Ht(So,"onAnimationIteration"),Ht(Eo,"onAnimationStart"),Ht("dblclick","onDoubleClick"),Ht("focusin","onFocus"),Ht("focusout","onBlur"),Ht(Zm,"onTransitionRun"),Ht(Km,"onTransitionStart"),Ht(Jm,"onTransitionCancel"),Ht(Co,"onTransitionEnd"),dl("onMouseEnter",["mouseout","mouseover"]),dl("onMouseLeave",["mouseout","mouseover"]),dl("onPointerEnter",["pointerout","pointerover"]),dl("onPointerLeave",["pointerout","pointerover"]),Ga("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ga("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ga("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ga("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ga("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ln="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(" "),zh=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ln));function Zf(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 i=void 0;if(t)for(var f=n.length-1;0<=f;f--){var g=n[f],C=g.instance,O=g.currentTarget;if(g=g.listener,C!==i&&s.isPropagationStopped())break e;i=g,s.currentTarget=O;try{i(s)}catch($){vs($)}s.currentTarget=null,i=C}else for(f=0;f<n.length;f++){if(g=n[f],C=g.instance,O=g.currentTarget,g=g.listener,C!==i&&s.isPropagationStopped())break e;i=g,s.currentTarget=O;try{i(s)}catch($){vs($)}s.currentTarget=null,i=C}}}}function me(e,t){var a=t[Yr];a===void 0&&(a=t[Yr]=new Set);var n=e+"__bubble";a.has(n)||(Kf(t,e,2,!1),a.add(n))}function Mc(e,t,a){var n=0;t&&(n|=4),Kf(a,e,n,t)}var sr="_reactListening"+Math.random().toString(36).slice(2);function _c(e){if(!e[sr]){e[sr]=!0,ku.forEach(function(a){a!=="selectionchange"&&(zh.has(a)||Mc(a,!1,e),Mc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sr]||(t[sr]=!0,Mc("selectionchange",!1,t))}}function Kf(e,t,a,n){switch(S0(t)){case 2:var s=rg;break;case 8:s=ig;break;default:s=Qc}a=s.bind(null,t,a,e),s=void 0,!Fr||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 zc(e,t,a,n,s){var i=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var g=n.stateNode.containerInfo;if(g===s)break;if(f===4)for(f=n.return;f!==null;){var C=f.tag;if((C===3||C===4)&&f.stateNode.containerInfo===s)return;f=f.return}for(;g!==null;){if(f=cl(g),f===null)return;if(C=f.tag,C===5||C===6||C===26||C===27){n=i=f;continue e}g=g.parentNode}}n=n.return}Fu(function(){var O=i,$=Jr(a),G=[];e:{var L=wo.get(e);if(L!==void 0){var B=gs,F=e;switch(e){case"keypress":if(ms(a)===0)break e;case"keydown":case"keyup":B=Cm;break;case"focusin":F="focus",B=ti;break;case"focusout":F="blur",B=ti;break;case"beforeblur":case"afterblur":B=ti;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":B=eo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":B=xm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":B=Am;break;case No:case So:case Eo:B=gm;break;case Co:B=Mm;break;case"scroll":case"scrollend":B=dm;break;case"wheel":B=zm;break;case"copy":case"cut":case"paste":B=ym;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":B=ao;break;case"toggle":case"beforetoggle":B=Om}var re=(t&4)!==0,Me=!re&&(e==="scroll"||e==="scrollend"),_=re?L!==null?L+"Capture":null:L;re=[];for(var A=O,D;A!==null;){var Y=A;if(D=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||D===null||_===null||(Y=ln(A,_),Y!=null&&re.push(Hn(A,Y,D))),Me)break;A=A.return}0<re.length&&(L=new B(L,F,null,a,$),G.push({event:L,listeners:re}))}}if((t&7)===0){e:{if(L=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",L&&a!==Kr&&(F=a.relatedTarget||a.fromElement)&&(cl(F)||F[il]))break e;if((B||L)&&(L=$.window===$?$:(L=$.ownerDocument)?L.defaultView||L.parentWindow:window,B?(F=a.relatedTarget||a.toElement,B=O,F=F?cl(F):null,F!==null&&(Me=x(F),re=F.tag,F!==Me||re!==5&&re!==27&&re!==6)&&(F=null)):(B=null,F=O),B!==F)){if(re=eo,Y="onMouseLeave",_="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(re=ao,Y="onPointerLeave",_="onPointerEnter",A="pointer"),Me=B==null?L:an(B),D=F==null?L:an(F),L=new re(Y,A+"leave",B,a,$),L.target=Me,L.relatedTarget=D,Y=null,cl($)===O&&(re=new re(_,A+"enter",F,a,$),re.target=D,re.relatedTarget=Me,Y=re),Me=Y,B&&F)t:{for(re=Dh,_=B,A=F,D=0,Y=_;Y;Y=re(Y))D++;Y=0;for(var le=A;le;le=re(le))Y++;for(;0<D-Y;)_=re(_),D--;for(;0<Y-D;)A=re(A),Y--;for(;D--;){if(_===A||A!==null&&_===A.alternate){re=_;break t}_=re(_),A=re(A)}re=null}else re=null;B!==null&&Jf(G,L,B,re,!1),F!==null&&Me!==null&&Jf(G,Me,F,re,!0)}}e:{if(L=O?an(O):window,B=L.nodeName&&L.nodeName.toLowerCase(),B==="select"||B==="input"&&L.type==="file")var ve=oo;else if(co(L))if(fo)ve=Vm;else{ve=Ym;var te=qm}else B=L.nodeName,!B||B.toLowerCase()!=="input"||L.type!=="checkbox"&&L.type!=="radio"?O&&Zr(O.elementType)&&(ve=oo):ve=Gm;if(ve&&(ve=ve(e,O))){uo(G,ve,a,$);break e}te&&te(e,L,O),e==="focusout"&&O&&L.type==="number"&&O.memoizedProps.value!=null&&Qr(L,"number",L.value)}switch(te=O?an(O):window,e){case"focusin":(co(te)||te.contentEditable==="true")&&(pl=te,ii=O,fn=null);break;case"focusout":fn=ii=pl=null;break;case"mousedown":ci=!0;break;case"contextmenu":case"mouseup":case"dragend":ci=!1,bo(G,a,$);break;case"selectionchange":if(Qm)break;case"keydown":case"keyup":bo(G,a,$)}var de;if(li)e:{switch(e){case"compositionstart":var ge="onCompositionStart";break e;case"compositionend":ge="onCompositionEnd";break e;case"compositionupdate":ge="onCompositionUpdate";break e}ge=void 0}else gl?ro(e,a)&&(ge="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ge="onCompositionStart");ge&&(lo&&a.locale!=="ko"&&(gl||ge!=="onCompositionStart"?ge==="onCompositionEnd"&&gl&&(de=Pu()):(pa=$,Pr="value"in pa?pa.value:pa.textContent,gl=!0)),te=rr(O,ge),0<te.length&&(ge=new to(ge,e,null,a,$),G.push({event:ge,listeners:te}),de?ge.data=de:(de=io(a),de!==null&&(ge.data=de)))),(de=Lm?Hm(e,a):Bm(e,a))&&(ge=rr(O,"onBeforeInput"),0<ge.length&&(te=new to("onBeforeInput","beforeinput",null,a,$),G.push({event:te,listeners:ge}),te.data=de)),Rh(G,e,O,a,$)}Zf(G,t)})}function Hn(e,t,a){return{instance:e,listener:t,currentTarget:a}}function rr(e,t){for(var a=t+"Capture",n=[];e!==null;){var s=e,i=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||i===null||(s=ln(e,a),s!=null&&n.unshift(Hn(e,s,i)),s=ln(e,t),s!=null&&n.push(Hn(e,s,i))),e.tag===3)return n;e=e.return}return[]}function Dh(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jf(e,t,a,n,s){for(var i=t._reactName,f=[];a!==null&&a!==n;){var g=a,C=g.alternate,O=g.stateNode;if(g=g.tag,C!==null&&C===n)break;g!==5&&g!==26&&g!==27||O===null||(C=O,s?(O=ln(a,i),O!=null&&f.unshift(Hn(a,O,C))):s||(O=ln(a,i),O!=null&&f.push(Hn(a,O,C)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var Oh=/\r\n?/g,Uh=/\u0000|\uFFFD/g;function Wf(e){return(typeof e=="string"?e:""+e).replace(Oh,`
|
|
9
|
+
`).replace(Uh,"")}function Ff(e,t){return t=Wf(t),Wf(e)===t}function Re(e,t,a,n,s,i){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||xl(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&xl(e,""+n);break;case"className":os(e,"class",n);break;case"tabIndex":os(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":os(e,a,n);break;case"style":Ju(e,n,i);break;case"data":if(t!=="object"){os(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=fs(""+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 i=="function"&&(a==="formAction"?(t!=="input"&&Re(e,t,"name",s.name,s,null),Re(e,t,"formEncType",s.formEncType,s,null),Re(e,t,"formMethod",s.formMethod,s,null),Re(e,t,"formTarget",s.formTarget,s,null)):(Re(e,t,"encType",s.encType,s,null),Re(e,t,"method",s.method,s,null),Re(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=fs(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Wt);break;case"onScroll":n!=null&&me("scroll",e);break;case"onScrollEnd":n!=null&&me("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(c(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=fs(""+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":me("beforetoggle",e),me("toggle",e),us(e,"popover",n);break;case"xlinkActuate":Jt(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Jt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Jt(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Jt(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Jt(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Jt(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":us(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=um.get(a)||a,us(e,a,n))}}function Dc(e,t,a,n,s,i){switch(a){case"style":Ju(e,n,i);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?xl(e,n):(typeof n=="number"||typeof n=="bigint")&&xl(e,""+n);break;case"onScroll":n!=null&&me("scroll",e);break;case"onScrollEnd":n!=null&&me("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Wt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$u.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),t=a.slice(2,s?a.length-7:void 0),i=e[ct]||null,i=i!=null?i[a]:null,typeof i=="function"&&e.removeEventListener(t,i,s),typeof n=="function")){typeof i!="function"&&i!==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,""):us(e,a,n)}}}function nt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":me("error",e),me("load",e);var n=!1,s=!1,i;for(i in a)if(a.hasOwnProperty(i)){var f=a[i];if(f!=null)switch(i){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Re(e,t,i,f,a,null)}}s&&Re(e,t,"srcSet",a.srcSet,a,null),n&&Re(e,t,"src",a.src,a,null);return;case"input":me("invalid",e);var g=i=f=s=null,C=null,O=null;for(n in a)if(a.hasOwnProperty(n)){var $=a[n];if($!=null)switch(n){case"name":s=$;break;case"type":f=$;break;case"checked":C=$;break;case"defaultChecked":O=$;break;case"value":i=$;break;case"defaultValue":g=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(c(137,t));break;default:Re(e,t,n,$,a,null)}}Xu(e,i,g,C,O,f,s,!1);return;case"select":me("invalid",e),n=f=i=null;for(s in a)if(a.hasOwnProperty(s)&&(g=a[s],g!=null))switch(s){case"value":i=g;break;case"defaultValue":f=g;break;case"multiple":n=g;default:Re(e,t,s,g,a,null)}t=i,a=f,e.multiple=!!n,t!=null?fl(e,!!n,t,!1):a!=null&&fl(e,!!n,a,!0);return;case"textarea":me("invalid",e),i=s=n=null;for(f in a)if(a.hasOwnProperty(f)&&(g=a[f],g!=null))switch(f){case"value":n=g;break;case"defaultValue":s=g;break;case"children":i=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:Re(e,t,f,g,a,null)}Zu(e,n,s,i);return;case"option":for(C in a)a.hasOwnProperty(C)&&(n=a[C],n!=null)&&(C==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Re(e,t,C,n,a,null));return;case"dialog":me("beforetoggle",e),me("toggle",e),me("cancel",e),me("close",e);break;case"iframe":case"object":me("load",e);break;case"video":case"audio":for(n=0;n<Ln.length;n++)me(Ln[n],e);break;case"image":me("error",e),me("load",e);break;case"details":me("toggle",e);break;case"embed":case"source":case"link":me("error",e),me("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(O in a)if(a.hasOwnProperty(O)&&(n=a[O],n!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Re(e,t,O,n,a,null)}return;default:if(Zr(t)){for($ in a)a.hasOwnProperty($)&&(n=a[$],n!==void 0&&Dc(e,t,$,n,a,void 0));return}}for(g in a)a.hasOwnProperty(g)&&(n=a[g],n!=null&&Re(e,t,g,n,a,null))}function Lh(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,i=null,f=null,g=null,C=null,O=null,$=null;for(B in a){var G=a[B];if(a.hasOwnProperty(B)&&G!=null)switch(B){case"checked":break;case"value":break;case"defaultValue":C=G;default:n.hasOwnProperty(B)||Re(e,t,B,null,n,G)}}for(var L in n){var B=n[L];if(G=a[L],n.hasOwnProperty(L)&&(B!=null||G!=null))switch(L){case"type":i=B;break;case"name":s=B;break;case"checked":O=B;break;case"defaultChecked":$=B;break;case"value":f=B;break;case"defaultValue":g=B;break;case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(c(137,t));break;default:B!==G&&Re(e,t,L,B,n,G)}}Xr(e,f,g,C,O,$,i,s);return;case"select":B=f=g=L=null;for(i in a)if(C=a[i],a.hasOwnProperty(i)&&C!=null)switch(i){case"value":break;case"multiple":B=C;default:n.hasOwnProperty(i)||Re(e,t,i,null,n,C)}for(s in n)if(i=n[s],C=a[s],n.hasOwnProperty(s)&&(i!=null||C!=null))switch(s){case"value":L=i;break;case"defaultValue":g=i;break;case"multiple":f=i;default:i!==C&&Re(e,t,s,i,n,C)}t=g,a=f,n=B,L!=null?fl(e,!!a,L,!1):!!n!=!!a&&(t!=null?fl(e,!!a,t,!0):fl(e,!!a,a?[]:"",!1));return;case"textarea":B=L=null;for(g in a)if(s=a[g],a.hasOwnProperty(g)&&s!=null&&!n.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Re(e,t,g,null,n,s)}for(f in n)if(s=n[f],i=a[f],n.hasOwnProperty(f)&&(s!=null||i!=null))switch(f){case"value":L=s;break;case"defaultValue":B=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(c(91));break;default:s!==i&&Re(e,t,f,s,n,i)}Qu(e,L,B);return;case"option":for(var F in a)L=a[F],a.hasOwnProperty(F)&&L!=null&&!n.hasOwnProperty(F)&&(F==="selected"?e.selected=!1:Re(e,t,F,null,n,L));for(C in n)L=n[C],B=a[C],n.hasOwnProperty(C)&&L!==B&&(L!=null||B!=null)&&(C==="selected"?e.selected=L&&typeof L!="function"&&typeof L!="symbol":Re(e,t,C,L,n,B));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 re in a)L=a[re],a.hasOwnProperty(re)&&L!=null&&!n.hasOwnProperty(re)&&Re(e,t,re,null,n,L);for(O in n)if(L=n[O],B=a[O],n.hasOwnProperty(O)&&L!==B&&(L!=null||B!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(c(137,t));break;default:Re(e,t,O,L,n,B)}return;default:if(Zr(t)){for(var Me in a)L=a[Me],a.hasOwnProperty(Me)&&L!==void 0&&!n.hasOwnProperty(Me)&&Dc(e,t,Me,void 0,n,L);for($ in n)L=n[$],B=a[$],!n.hasOwnProperty($)||L===B||L===void 0&&B===void 0||Dc(e,t,$,L,n,B);return}}for(var _ in a)L=a[_],a.hasOwnProperty(_)&&L!=null&&!n.hasOwnProperty(_)&&Re(e,t,_,null,n,L);for(G in n)L=n[G],B=a[G],!n.hasOwnProperty(G)||L===B||L==null&&B==null||Re(e,t,G,L,n,B)}function Pf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Hh(){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],i=s.transferSize,f=s.initiatorType,g=s.duration;if(i&&g&&Pf(f)){for(f=0,g=s.responseEnd,n+=1;n<a.length;n++){var C=a[n],O=C.startTime;if(O>g)break;var $=C.transferSize,G=C.initiatorType;$&&Pf(G)&&(C=C.responseEnd,f+=$*(C<g?1:(g-O)/(C-O)))}if(--n,t+=8*(i+f)/(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 Oc=null,Uc=null;function ir(e){return e.nodeType===9?e:e.ownerDocument}function If(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 e0(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 Lc(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 Hc=null;function Bh(){var e=window.event;return e&&e.type==="popstate"?e===Hc?!1:(Hc=e,!0):(Hc=null,!1)}var t0=typeof setTimeout=="function"?setTimeout:void 0,kh=typeof clearTimeout=="function"?clearTimeout:void 0,a0=typeof Promise=="function"?Promise:void 0,$h=typeof queueMicrotask=="function"?queueMicrotask:typeof a0<"u"?function(e){return a0.resolve(null).then(e).catch(qh)}:t0;function qh(e){setTimeout(function(){throw e})}function Oa(e){return e==="head"}function l0(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),Vl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Bn(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Bn(a);for(var i=a.firstChild;i;){var f=i.nextSibling,g=i.nodeName;i[tn]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&i.rel.toLowerCase()==="stylesheet"||a.removeChild(i),i=f}}else a==="body"&&Bn(e.ownerDocument.body);a=s}while(a);Vl(t)}function n0(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 Bc(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":Bc(a),Gr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Yh(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[tn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(i=e.getAttribute("rel"),i==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(i!==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(i=e.getAttribute("src"),(i!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&i&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var i=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===i)return e}else return e;if(e=Dt(e.nextSibling),e===null)break}return null}function Gh(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Dt(e.nextSibling),e===null))return null;return e}function s0(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dt(e.nextSibling),e===null))return null;return e}function kc(e){return e.data==="$?"||e.data==="$~"}function $c(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Vh(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 Dt(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 qc=null;function r0(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Dt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function i0(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 c0(e,t,a){switch(t=ir(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Bn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Gr(e)}var Ot=new Map,u0=new Set;function cr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fa=X.d;X.d={f:Xh,r:Qh,D:Zh,C:Kh,L:Jh,m:Wh,X:Ph,S:Fh,M:Ih};function Xh(){var e=fa.f(),t=Is();return e||t}function Qh(e){var t=ul(e);t!==null&&t.tag===5&&t.type==="form"?Cd(t):fa.r(e)}var ql=typeof document>"u"?null:document;function o0(e,t,a){var n=ql;if(n&&typeof t=="string"&&t){var s=wt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),u0.has(s)||(u0.add(s),e={rel:e,crossOrigin:a,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),nt(t,"link",e),Fe(t),n.head.appendChild(t)))}}function Zh(e){fa.D(e),o0("dns-prefetch",e,null)}function Kh(e,t){fa.C(e,t),o0("preconnect",e,t)}function Jh(e,t,a){fa.L(e,t,a);var n=ql;if(n&&e&&t){var s='link[rel="preload"][as="'+wt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+wt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+wt(a.imageSizes)+'"]')):s+='[href="'+wt(e)+'"]';var i=s;switch(t){case"style":i=Yl(e);break;case"script":i=Gl(e)}Ot.has(i)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ot.set(i,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(kn(i))||t==="script"&&n.querySelector($n(i))||(t=n.createElement("link"),nt(t,"link",e),Fe(t),n.head.appendChild(t)))}}function Wh(e,t){fa.m(e,t);var a=ql;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+wt(n)+'"][href="'+wt(e)+'"]',i=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":i=Gl(e)}if(!Ot.has(i)&&(e=y({rel:"modulepreload",href:e},t),Ot.set(i,e),a.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($n(i)))return}n=a.createElement("link"),nt(n,"link",e),Fe(n),a.head.appendChild(n)}}}function Fh(e,t,a){fa.S(e,t,a);var n=ql;if(n&&e){var s=ol(n).hoistableStyles,i=Yl(e);t=t||"default";var f=s.get(i);if(!f){var g={loading:0,preload:null};if(f=n.querySelector(kn(i)))g.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ot.get(i))&&Yc(e,a);var C=f=n.createElement("link");Fe(C),nt(C,"link",e),C._p=new Promise(function(O,$){C.onload=O,C.onerror=$}),C.addEventListener("load",function(){g.loading|=1}),C.addEventListener("error",function(){g.loading|=2}),g.loading|=4,ur(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:g},s.set(i,f)}}}function Ph(e,t){fa.X(e,t);var a=ql;if(a&&e){var n=ol(a).hoistableScripts,s=Gl(e),i=n.get(s);i||(i=a.querySelector($n(s)),i||(e=y({src:e,async:!0},t),(t=Ot.get(s))&&Gc(e,t),i=a.createElement("script"),Fe(i),nt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function Ih(e,t){fa.M(e,t);var a=ql;if(a&&e){var n=ol(a).hoistableScripts,s=Gl(e),i=n.get(s);i||(i=a.querySelector($n(s)),i||(e=y({src:e,async:!0,type:"module"},t),(t=Ot.get(s))&&Gc(e,t),i=a.createElement("script"),Fe(i),nt(i,"link",e),a.head.appendChild(i)),i={type:"script",instance:i,count:1,state:null},n.set(s,i))}}function d0(e,t,a,n){var s=(s=fe.current)?cr(s):null;if(!s)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Yl(a.href),a=ol(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=Yl(a.href);var i=ol(s).hoistableStyles,f=i.get(e);if(f||(s=s.ownerDocument||s,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},i.set(e,f),(i=s.querySelector(kn(e)))&&!i._p&&(f.instance=i,f.state.loading=5),Ot.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},Ot.set(e,a),i||eg(s,e,a,f.state))),t&&n===null)throw Error(c(528,""));return f}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Gl(a),a=ol(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(c(444,e))}}function Yl(e){return'href="'+wt(e)+'"'}function kn(e){return'link[rel="stylesheet"]['+e+"]"}function f0(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function eg(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}),nt(t,"link",a),Fe(t),e.head.appendChild(t))}function Gl(e){return'[src="'+wt(e)+'"]'}function $n(e){return"script[async]"+e}function x0(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+wt(a.href)+'"]');if(n)return t.instance=n,Fe(n),n;var s=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Fe(n),nt(n,"style",s),ur(n,a.precedence,e),t.instance=n;case"stylesheet":s=Yl(a.href);var i=e.querySelector(kn(s));if(i)return t.state.loading|=4,t.instance=i,Fe(i),i;n=f0(a),(s=Ot.get(s))&&Yc(n,s),i=(e.ownerDocument||e).createElement("link"),Fe(i);var f=i;return f._p=new Promise(function(g,C){f.onload=g,f.onerror=C}),nt(i,"link",n),t.state.loading|=4,ur(i,a.precedence,e),t.instance=i;case"script":return i=Gl(a.src),(s=e.querySelector($n(i)))?(t.instance=s,Fe(s),s):(n=a,(s=Ot.get(i))&&(n=y({},a),Gc(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),Fe(s),nt(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,ur(n,a.precedence,e));return t.instance}function ur(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,i=s,f=0;f<n.length;f++){var g=n[f];if(g.dataset.precedence===t)i=g;else if(i!==s)break}i?i.parentNode.insertBefore(e,i.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var or=null;function m0(e,t,a){if(or===null){var n=new Map,s=or=new Map;s.set(a,n)}else s=or,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 i=a[s];if(!(i[tn]||i[et]||e==="link"&&i.getAttribute("rel")==="stylesheet")&&i.namespaceURI!=="http://www.w3.org/2000/svg"){var f=i.getAttribute(t)||"";f=e+f;var g=n.get(f);g?g.push(i):n.set(f,[i])}}return n}function h0(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function tg(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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 g0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function ag(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=Yl(n.href),i=t.querySelector(kn(s));if(i){t=i._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=dr.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=i,Fe(i);return}i=t.ownerDocument||t,n=f0(n),(s=Ot.get(s))&&Yc(n,s),i=i.createElement("link"),Fe(i);var f=i;f._p=new Promise(function(g,C){f.onload=g,f.onerror=C}),nt(i,"link",n),a.instance=i}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=dr.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Vc=0;function lg(e,t){return e.stylesheets&&e.count===0&&xr(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&xr(e,e.stylesheets),e.unsuspend){var i=e.unsuspend;e.unsuspend=null,i()}},6e4+t);0<e.imgBytes&&Vc===0&&(Vc=62500*Hh());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&xr(e,e.stylesheets),e.unsuspend)){var i=e.unsuspend;e.unsuspend=null,i()}},(e.imgBytes>Vc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function dr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fr=null;function xr(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fr=new Map,t.forEach(ng,e),fr=null,dr.call(e))}function ng(e,t){if(!(t.state.loading&4)){var a=fr.get(e);if(a)var n=a.get(null);else{a=new Map,fr.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),i=0;i<s.length;i++){var f=s[i];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),n=f)}n&&a.set(null,n)}s=t.instance,f=s.getAttribute("data-precedence"),i=a.get(f)||n,i===n&&a.set(null,s),a.set(f,s),this.count++,n=dr.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),i?i.parentNode.insertBefore(s,i.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var qn={$$typeof:U,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function sg(e,t,a,n,s,i,f,g,C){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=kr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kr(0),this.hiddenUpdates=kr(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=i,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function p0(e,t,a,n,s,i,f,g,C,O,$,G){return e=new sg(e,t,a,f,C,O,$,G,g),t=1,i===!0&&(t|=24),i=vt(3,null,null,t),e.current=i,i.stateNode=e,t=Si(),t.refCount++,e.pooledCache=t,t.refCount++,i.memoizedState={element:n,isDehydrated:a,cache:t},Ti(i),e}function y0(e){return e?(e=bl,e):bl}function v0(e,t,a,n,s,i){s=y0(s),n.context===null?n.context=s:n.pendingContext=s,n=Sa(t),n.payload={element:a},i=i===void 0?null:i,i!==null&&(n.callback=i),a=Ea(e,n,t),a!==null&&(mt(a,e,t),vn(a,e,t))}function b0(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Xc(e,t){b0(e,t),(e=e.alternate)&&b0(e,t)}function j0(e){if(e.tag===13||e.tag===31){var t=Za(e,67108864);t!==null&&mt(t,e,67108864),Xc(e,67108864)}}function N0(e){if(e.tag===13||e.tag===31){var t=Et();t=$r(t);var a=Za(e,t);a!==null&&mt(a,e,t),Xc(e,t)}}var mr=!0;function rg(e,t,a,n){var s=k.T;k.T=null;var i=X.p;try{X.p=2,Qc(e,t,a,n)}finally{X.p=i,k.T=s}}function ig(e,t,a,n){var s=k.T;k.T=null;var i=X.p;try{X.p=8,Qc(e,t,a,n)}finally{X.p=i,k.T=s}}function Qc(e,t,a,n){if(mr){var s=Zc(n);if(s===null)zc(e,t,n,hr,a),E0(e,n);else if(ug(s,e,t,a,n))n.stopPropagation();else if(E0(e,n),t&4&&-1<cg.indexOf(e)){for(;s!==null;){var i=ul(s);if(i!==null)switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var f=Ya(i.pendingLanes);if(f!==0){var g=i;for(g.pendingLanes|=2,g.entangledLanes|=2;f;){var C=1<<31-pt(f);g.entanglements[1]|=C,f&=~C}Zt(i),(Se&6)===0&&(Fs=ht()+500,Un(0))}}break;case 31:case 13:g=Za(i,2),g!==null&&mt(g,i,2),Is(),Xc(i,2)}if(i=Zc(n),i===null&&zc(e,t,n,hr,a),i===s)break;s=i}s!==null&&n.stopPropagation()}else zc(e,t,n,null,a)}}function Zc(e){return e=Jr(e),Kc(e)}var hr=null;function Kc(e){if(hr=null,e=cl(e),e!==null){var t=x(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(t),e!==null)return e;e=null}else if(a===31){if(e=N(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 hr=e,null}function S0(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(Zx()){case Ru:return 2;case Mu:return 8;case ns:case Kx:return 32;case _u:return 268435456;default:return 32}default:return 32}}var Jc=!1,Ua=null,La=null,Ha=null,Yn=new Map,Gn=new Map,Ba=[],cg="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 E0(e,t){switch(e){case"focusin":case"focusout":Ua=null;break;case"dragenter":case"dragleave":La=null;break;case"mouseover":case"mouseout":Ha=null;break;case"pointerover":case"pointerout":Yn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gn.delete(t.pointerId)}}function Vn(e,t,a,n,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},t!==null&&(t=ul(t),t!==null&&j0(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function ug(e,t,a,n,s){switch(t){case"focusin":return Ua=Vn(Ua,e,t,a,n,s),!0;case"dragenter":return La=Vn(La,e,t,a,n,s),!0;case"mouseover":return Ha=Vn(Ha,e,t,a,n,s),!0;case"pointerover":var i=s.pointerId;return Yn.set(i,Vn(Yn.get(i)||null,e,t,a,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Gn.set(i,Vn(Gn.get(i)||null,e,t,a,n,s)),!0}return!1}function C0(e){var t=cl(e.target);if(t!==null){var a=x(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Hu(e.priority,function(){N0(a)});return}}else if(t===31){if(t=N(a),t!==null){e.blockedOn=t,Hu(e.priority,function(){N0(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 gr(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Zc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);Kr=n,a.target.dispatchEvent(n),Kr=null}else return t=ul(a),t!==null&&j0(t),e.blockedOn=a,!1;t.shift()}return!0}function w0(e,t,a){gr(e)&&a.delete(t)}function og(){Jc=!1,Ua!==null&&gr(Ua)&&(Ua=null),La!==null&&gr(La)&&(La=null),Ha!==null&&gr(Ha)&&(Ha=null),Yn.forEach(w0),Gn.forEach(w0)}function pr(e,t){e.blockedOn===t&&(e.blockedOn=null,Jc||(Jc=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,og)))}var yr=null;function T0(e){yr!==e&&(yr=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){yr===e&&(yr=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(Kc(n||a)===null)continue;break}var i=ul(a);i!==null&&(e.splice(t,3),t-=3,Zi(i,{pending:!0,data:s,method:a.method,action:n},n,s))}}))}function Vl(e){function t(C){return pr(C,e)}Ua!==null&&pr(Ua,e),La!==null&&pr(La,e),Ha!==null&&pr(Ha,e),Yn.forEach(t),Gn.forEach(t);for(var a=0;a<Ba.length;a++){var n=Ba[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Ba.length&&(a=Ba[0],a.blockedOn===null);)C0(a),a.blockedOn===null&&Ba.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var s=a[n],i=a[n+1],f=s[ct]||null;if(typeof i=="function")f||T0(a);else if(f){var g=null;if(i&&i.hasAttribute("formAction")){if(s=i,f=i[ct]||null)g=f.formAction;else if(Kc(s)!==null)continue}else g=f.action;typeof g=="function"?a[n+1]=g:(a.splice(n,3),n-=3),T0(a)}}}function A0(){function e(i){i.canIntercept&&i.info==="react-transition"&&i.intercept({handler:function(){return new Promise(function(f){return s=f})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var i=navigation.currentEntry;i&&i.url!=null&&navigation.navigate(i.url,{state:i.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 Wc(e){this._internalRoot=e}vr.prototype.render=Wc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=Et();v0(a,n,e,t,null,null)},vr.prototype.unmount=Wc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;v0(e.current,2,null,e,null,null),Is(),t[il]=null}};function vr(e){this._internalRoot=e}vr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Lu();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Ba.length&&t!==0&&t<Ba[a].priority;a++);Ba.splice(a,0,e),a===0&&C0(e)}};var R0=o.version;if(R0!=="19.2.7")throw Error(c(527,R0,"19.2.7"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=m(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var dg={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var br=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!br.isDisabled&&br.supportsFiber)try{Pl=br.inject(dg),gt=br}catch{}}return Qn.createRoot=function(e,t){if(!d(e))throw Error(c(299));var a=!1,n="",s=Ud,i=Ld,f=Hd;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&&(i=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=p0(e,1,!1,null,null,a,n,null,s,i,f,A0),e[il]=t.current,_c(e),new Wc(t)},Qn.hydrateRoot=function(e,t,a){if(!d(e))throw Error(c(299));var n=!1,s="",i=Ud,f=Ld,g=Hd,C=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(i=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(g=a.onRecoverableError),a.formState!==void 0&&(C=a.formState)),t=p0(e,1,!0,t,a??null,n,s,C,i,f,g,A0),t.context=y0(null),a=t.current,n=Et(),n=$r(n),s=Sa(n),s.callback=null,Ea(a,s,n),a=n,t.current.lanes=a,en(t,a),Zt(t),e[il]=t.current,_c(e),new vr(t)},Qn.version="19.2.7",Qn}var k0;function jg(){if(k0)return Ic.exports;k0=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(o){console.error(o)}}return r(),Ic.exports=bg(),Ic.exports}var Ng=jg();var hu=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,ox=/^[\\/]{2}/;function Sg(r,o){return o+r.replace(/\\/g,"/")}var $0="popstate";function q0(r){return typeof r=="object"&&r!=null&&"pathname"in r&&"search"in r&&"hash"in r&&"state"in r&&"key"in r}function Eg(r={}){function o(c,d){let x=d.state?.masked,{pathname:h,search:N,hash:p}=x||c.location;return du("",{pathname:h,search:N,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default",x?{pathname:c.location.pathname,search:c.location.search,hash:c.location.hash}:void 0)}function u(c,d){return typeof d=="string"?d:Pn(d)}return wg(o,u,null,r)}function Be(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function qt(r,o){if(!r){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function Cg(){return Math.random().toString(36).substring(2,10)}function Y0(r,o){return{usr:r.state,key:r.key,idx:o,masked:r.mask?{pathname:r.pathname,search:r.search,hash:r.hash}:void 0}}function du(r,o,u=null,c,d){return{pathname:typeof r=="string"?r:r.pathname,search:"",hash:"",...typeof o=="string"?Jl(o):o,state:u,key:o&&o.key||c||Cg(),mask:d}}function Pn({pathname:r="/",search:o="",hash:u=""}){return o&&o!=="?"&&(r+=o.charAt(0)==="?"?o:"?"+o),u&&u!=="#"&&(r+=u.charAt(0)==="#"?u:"#"+u),r}function Jl(r){let o={};if(r){let u=r.indexOf("#");u>=0&&(o.hash=r.substring(u),r=r.substring(0,u));let c=r.indexOf("?");c>=0&&(o.search=r.substring(c),r=r.substring(0,c)),r&&(o.pathname=r)}return o}function wg(r,o,u,c={}){let{window:d=document.defaultView,v5Compat:x=!1}=c,h=d.history,N="POP",p=null,m=v();m==null&&(m=0,h.replaceState({...h.state,idx:m},""));function v(){return(h.state||{idx:null}).idx}function y(){N="POP";let b=v(),w=b==null?null:b-m;m=b,p&&p({action:N,location:R.location,delta:w})}function E(b,w){N="PUSH";let T=q0(b)?b:du(R.location,b,w);m=v()+1;let U=Y0(T,m),J=R.createHref(T.mask||T);try{h.pushState(U,"",J)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(J)}x&&p&&p({action:N,location:R.location,delta:1})}function M(b,w){N="REPLACE";let T=q0(b)?b:du(R.location,b,w);m=v();let U=Y0(T,m),J=R.createHref(T.mask||T);h.replaceState(U,"",J),x&&p&&p({action:N,location:R.location,delta:0})}function z(b){return Tg(d,b)}let R={get action(){return N},get location(){return r(d,h)},listen(b){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener($0,y),p=b,()=>{d.removeEventListener($0,y),p=null}},createHref(b){return o(d,b)},createURL:z,encodeLocation(b){let w=z(b);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:E,replace:M,go(b){return h.go(b)}};return R}function Tg(r,o,u=!1){let c="http://localhost";r&&(c=r.location.origin!=="null"?r.location.origin:r.location.href),Be(c,"No window.location.(origin|href) available to create URL");let d=typeof o=="string"?o:Pn(o);return d=d.replace(/ $/,"%20"),!u&&ox.test(d)&&(d=c+d),new URL(d,c)}function dx(r,o,u="/"){return Ag(r,o,u,!1)}function Ag(r,o,u,c,d){let x=typeof o=="string"?Jl(o):o,h=ma(x.pathname||"/",u);if(h==null)return null;let N=Rg(r),p=null,m=$g(h);for(let v=0;p==null&&v<N.length;++v)p=kg(N[v],m,c);return p}function Rg(r){let o=fx(r);return Mg(o),o}function fx(r,o=[],u=[],c="",d=!1){let x=(h,N,p=d,m)=>{let v={relativePath:m===void 0?h.path||"":m,caseSensitive:h.caseSensitive===!0,childrenIndex:N,route:h};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(c)&&p)return;Be(v.relativePath.startsWith(c),`Absolute route path "${v.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(c.length)}let y=$t([c,v.relativePath]),E=u.concat(v);h.children&&h.children.length>0&&(Be(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),fx(h.children,o,E,y,p)),!(h.path==null&&!h.index)&&o.push({path:y,score:Hg(y,h.index),routesMeta:E.map((M,z)=>{let[R,b]=hx(M.relativePath,M.caseSensitive,z===E.length-1);return{...M,matcher:R,compiledParams:b}})})};return r.forEach((h,N)=>{if(h.path===""||!h.path?.includes("?"))x(h,N);else for(let p of xx(h.path))x(h,N,!0,p)}),o}function xx(r){let o=r.split("/");if(o.length===0)return[];let[u,...c]=o,d=u.endsWith("?"),x=u.replace(/\?$/,"");if(c.length===0)return d?[x,""]:[x];let h=xx(c.join("/")),N=[];return N.push(...h.map(p=>p===""?x:[x,p].join("/"))),d&&N.push(...h),N.map(p=>r.startsWith("/")&&p===""?"/":p)}function Mg(r){r.sort((o,u)=>o.score!==u.score?u.score-o.score:Bg(o.routesMeta.map(c=>c.childrenIndex),u.routesMeta.map(c=>c.childrenIndex)))}var _g=/^:[\w-]+$/,zg=3,Dg=2,Og=1,Ug=10,Lg=-2,G0=r=>r==="*";function Hg(r,o){let u=r.split("/"),c=u.length;return u.some(G0)&&(c+=Lg),o&&(c+=Dg),u.filter(d=>!G0(d)).reduce((d,x)=>d+(_g.test(x)?zg:x===""?Og:Ug),c)}function Bg(r,o){return r.length===o.length&&r.slice(0,-1).every((c,d)=>c===o[d])?r[r.length-1]-o[o.length-1]:0}function kg(r,o,u=!1){let{routesMeta:c}=r,d={},x="/",h=[];for(let N=0;N<c.length;++N){let p=c[N],m=N===c.length-1,v=x==="/"?o:o.slice(x.length)||"/",y={path:p.relativePath,caseSensitive:p.caseSensitive,end:m},E=p.matcher&&p.compiledParams?mx(y,v,p.matcher,p.compiledParams):Cr(y,v),M=p.route;if(!E&&m&&u&&!c[c.length-1].route.index&&(E=Cr({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},v)),!E)return null;Object.assign(d,E.params),h.push({params:d,pathname:$t([x,E.pathname]),pathnameBase:Gg($t([x,E.pathnameBase])),route:M}),E.pathnameBase!=="/"&&(x=$t([x,E.pathnameBase]))}return h}function Cr(r,o){typeof r=="string"&&(r={path:r,caseSensitive:!1,end:!0});let[u,c]=hx(r.path,r.caseSensitive,r.end);return mx(r,o,u,c)}function mx(r,o,u,c){let d=o.match(u);if(!d)return null;let x=d[0],h=x.replace(/(.)\/+$/,"$1"),N=d.slice(1);return{params:c.reduce((m,{paramName:v,isOptional:y},E)=>{if(v==="*"){let z=N[E]||"";h=x.slice(0,x.length-z.length).replace(/(.)\/+$/,"$1")}const M=N[E];return y&&!M?m[v]=void 0:m[v]=(M||"").replace(/%2F/g,"/"),m},{}),pathname:x,pathnameBase:h,pattern:r}}function hx(r,o=!1,u=!0){qt(r==="*"||!r.endsWith("*")||r.endsWith("/*"),`Route path "${r}" will be treated as if it were "${r.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${r.replace(/\*$/,"/*")}".`);let c=[],d="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,N,p,m,v)=>{if(c.push({paramName:N,isOptional:p!=null}),p){let y=v.charAt(m+h.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return r.endsWith("*")?(c.push({paramName:"*"}),d+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):u?d+="\\/*$":r!==""&&r!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),c]}function $g(r){try{return r.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return qt(!1,`The URL path "${r}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),r}}function ma(r,o){if(o==="/")return r;if(!r.toLowerCase().startsWith(o.toLowerCase()))return null;let u=o.endsWith("/")?o.length-1:o.length,c=r.charAt(u);return c&&c!=="/"?null:r.slice(u)||"/"}function qg(r,o="/"){let{pathname:u,search:c="",hash:d=""}=typeof r=="string"?Jl(r):r,x;return u?(u=px(u),u.startsWith("/")?x=V0(u.substring(1),"/"):x=V0(u,o)):x=o,{pathname:x,search:Vg(c),hash:Xg(d)}}function V0(r,o){let u=wr(o).split("/");return r.split("/").forEach(d=>{d===".."?u.length>1&&u.pop():d!=="."&&u.push(d)}),u.length>1?u.join("/"):"/"}function lu(r,o,u,c){return`Cannot include a '${r}' character in a manually specified \`to.${o}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${u}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Yg(r){return r.filter((o,u)=>u===0||o.route.path&&o.route.path.length>0)}function gx(r){let o=Yg(r);return o.map((u,c)=>c===o.length-1?u.pathname:u.pathnameBase)}function gu(r,o,u,c=!1){let d;typeof r=="string"?d=Jl(r):(d={...r},Be(!d.pathname||!d.pathname.includes("?"),lu("?","pathname","search",d)),Be(!d.pathname||!d.pathname.includes("#"),lu("#","pathname","hash",d)),Be(!d.search||!d.search.includes("#"),lu("#","search","hash",d)));let x=r===""||d.pathname==="",h=x?"/":d.pathname,N;if(h==null)N=u;else{let y=o.length-1;if(!c&&h.startsWith("..")){let E=h.split("/");for(;E[0]==="..";)E.shift(),y-=1;d.pathname=E.join("/")}N=y>=0?o[y]:"/"}let p=qg(d,N),m=h&&h!=="/"&&h.endsWith("/"),v=(x||h===".")&&u.endsWith("/");return!p.pathname.endsWith("/")&&(m||v)&&(p.pathname+="/"),p}var px=r=>r.replace(/[\\/]{2,}/g,"/"),$t=r=>px(r.join("/")),wr=r=>r.replace(/\/+$/,""),Gg=r=>wr(r).replace(/^\/*/,"/"),Vg=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Xg=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r,Qg=class{constructor(r,o,u,c=!1){this.status=r,this.statusText=o||"",this.internal=c,u instanceof Error?(this.data=u.toString(),this.error=u):this.data=u}};function Zg(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}function Kg(r){let o=r.map(u=>u.route.path).filter(Boolean);return $t(o)||"/"}var yx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function vx(r,o){let u=r;if(typeof u!="string"||!hu.test(u))return{absoluteURL:void 0,isExternal:!1,to:u};let c=u,d=!1;if(yx)try{let x=new URL(window.location.href),h=ox.test(u)?new URL(Sg(u,x.protocol)):new URL(u),N=ma(h.pathname,o);h.origin===x.origin&&N!=null?u=N+h.search+h.hash:d=!0}catch{qt(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:d,to:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var bx=["POST","PUT","PATCH","DELETE"];new Set(bx);var Jg=["GET",...bx];new Set(Jg);var Wg=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Fg(r){try{return Wg.includes(new URL(r).protocol)}catch{return!1}}var Wl=j.createContext(null);Wl.displayName="DataRouter";var Tr=j.createContext(null);Tr.displayName="DataRouterState";var jx=j.createContext(!1);function Pg(){return j.useContext(jx)}var Nx=j.createContext({isTransitioning:!1});Nx.displayName="ViewTransition";var Ig=j.createContext(new Map);Ig.displayName="Fetchers";var ep=j.createContext(null);ep.displayName="Await";var Lt=j.createContext(null);Lt.displayName="Navigation";var In=j.createContext(null);In.displayName="Location";var Kt=j.createContext({outlet:null,matches:[],isDataRoute:!1});Kt.displayName="Route";var pu=j.createContext(null);pu.displayName="RouteError";var Sx="REACT_ROUTER_ERROR",tp="REDIRECT",ap="ROUTE_ERROR_RESPONSE";function lp(r){if(r.startsWith(`${Sx}:${tp}:{`))try{let o=JSON.parse(r.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function np(r){if(r.startsWith(`${Sx}:${ap}:{`))try{let o=JSON.parse(r.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new Qg(o.status,o.statusText,o.data)}catch{}}function sp(r,{relative:o}={}){Be(es(),"useHref() may be used only in the context of a <Router> component.");let{basename:u,navigator:c}=j.useContext(Lt),{hash:d,pathname:x,search:h}=ts(r,{relative:o}),N=x;return u!=="/"&&(N=x==="/"?u:$t([u,x])),c.createHref({pathname:N,search:h,hash:d})}function es(){return j.useContext(In)!=null}function Yt(){return Be(es(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(In).location}var Ex="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Cx(r){j.useContext(Lt).static||j.useLayoutEffect(r)}function yu(){let{isDataRoute:r}=j.useContext(Kt);return r?vp():rp()}function rp(){Be(es(),"useNavigate() may be used only in the context of a <Router> component.");let r=j.useContext(Wl),{basename:o,navigator:u}=j.useContext(Lt),{matches:c}=j.useContext(Kt),{pathname:d}=Yt(),x=JSON.stringify(gx(c)),h=j.useRef(!1);return Cx(()=>{h.current=!0}),j.useCallback((p,m={})=>{if(qt(h.current,Ex),!h.current)return;if(typeof p=="number"){u.go(p);return}let v=gu(p,JSON.parse(x),d,m.relative==="path");r==null&&o!=="/"&&(v.pathname=v.pathname==="/"?o:$t([o,v.pathname])),(m.replace?u.replace:u.push)(v,m.state,m)},[o,u,x,d,r])}j.createContext(null);function ip(){let{matches:r}=j.useContext(Kt);return r[r.length-1]?.params??{}}function ts(r,{relative:o}={}){let{matches:u}=j.useContext(Kt),{pathname:c}=Yt(),d=JSON.stringify(gx(u));return j.useMemo(()=>gu(r,JSON.parse(d),c,o==="path"),[r,d,c,o])}function cp(r,o){return wx(r,o)}function wx(r,o,u){Be(es(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=j.useContext(Lt),{matches:d}=j.useContext(Kt),x=d[d.length-1],h=x?x.params:{},N=x?x.pathname:"/",p=x?x.pathnameBase:"/",m=x&&x.route;{let b=m&&m.path||"";Ax(N,!m||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${N}" (under <Route path="${b}">) 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.
|
|
10
10
|
|
|
11
|
-
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let v=Yt(),y;if(o){let b=typeof o=="string"?Jl(o):o;Be(p==="/"||b.pathname?.startsWith(p),`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 "${p}" but pathname "${b.pathname}" was given in the \`location\` prop.`),y=b}else y=v;let w=y.pathname||"/",_=w;if(p!=="/"){let b=p.replace(/^\//,"").split("/");_="/"+w.replace(/^\//,"").split("/").slice(b.length).join("/")}let z=u&&u.state.matches.length?u.state.matches.map(b=>Object.assign(b,{route:u.manifest[b.route.id]||b.route})):ux(r,{pathname:_});qt(m||z!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),qt(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 R=up(z&&z.map(b=>Object.assign({},b,{params:Object.assign({},h,b.params),pathname:$t([p,c.encodeLocation?c.encodeLocation(b.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?p:$t([p,c.encodeLocation?c.encodeLocation(b.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),d,u);return o&&R?j.createElement(In.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},R):R}function sp(){let r=mp(),o=Xg(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),u=r instanceof Error?r.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},x={padding:"2px 4px",backgroundColor:c},h=null;return console.error("Error handled by React Router default ErrorBoundary:",r),h=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:x},"ErrorBoundary")," or"," ",j.createElement("code",{style:x},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},o),u?j.createElement("pre",{style:d},u):null,h)}var rp=j.createElement(sp,null),Sx=class extends j.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,o){return o.location!==r.location||o.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:o.error,location:o.location,revalidation:r.revalidation||o.revalidation}}componentDidCatch(r,o){this.props.onError?this.props.onError(r,o):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const u=ep(r.digest);u&&(r=u)}let o=r!==void 0?j.createElement(Kt.Provider,{value:this.props.routeContext},j.createElement(hu.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?j.createElement(ip,{error:r},o):o}};Sx.contextType=px;var lu=new WeakMap;function ip({children:r,error:o}){let{basename:u}=j.useContext(Lt);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let c=Ig(o.digest);if(c){let d=lu.get(o);if(d)throw d;let x=hx(c.location,u);if(mx&&!lu.get(o))if(x.isExternal||c.reloadDocument)window.location.href=x.absoluteURL||x.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:c.replace}));throw lu.set(o,h),h}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${x.absoluteURL||x.to}`})}}return r}function cp({routeContext:r,match:o,children:u}){let c=j.useContext(Wl);return c&&c.static&&c.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=o.route.id),j.createElement(Kt.Provider,{value:r},u)}function up(r,o=[],u){let c=u?.state;if(r==null){if(!c)return null;if(c.errors)r=c.matches;else if(o.length===0&&!c.initialized&&c.matches.length>0)r=c.matches;else return null}let d=r,x=c?.errors;if(x!=null){let v=d.findIndex(y=>y.route.id&&x?.[y.route.id]!==void 0);Be(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),d=d.slice(0,Math.min(d.length,v+1))}let h=!1,N=-1;if(u&&c){h=c.renderFallback;for(let v=0;v<d.length;v++){let y=d[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(N=v),y.route.id){let{loaderData:w,errors:_}=c,z=y.route.loader&&!w.hasOwnProperty(y.route.id)&&(!_||_[y.route.id]===void 0);if(y.route.lazy||z){u.isStatic&&(h=!0),N>=0?d=d.slice(0,N+1):d=[d[0]];break}}}}let p=u?.onError,m=c&&p?(v,y)=>{p(v,{location:c.location,params:c.matches?.[0]?.params??{},pattern:Qg(c.matches),errorInfo:y})}:void 0;return d.reduceRight((v,y,w)=>{let _,z=!1,R=null,b=null;c&&(_=x&&y.route.id?x[y.route.id]:void 0,R=y.route.errorElement||rp,h&&(N<0&&w===0?(Ex("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,b=null):N===w&&(z=!0,b=y.route.hydrateFallbackElement||null)));let C=o.concat(d.slice(0,w+1)),T=()=>{let U;return _?U=R:z?U=b:y.route.Component?U=j.createElement(y.route.Component,null):y.route.element?U=y.route.element:U=v,j.createElement(cp,{match:y,routeContext:{outlet:v,matches:C,isDataRoute:c!=null},children:U})};return c&&(y.route.ErrorBoundary||y.route.errorElement||w===0)?j.createElement(Sx,{location:c.location,revalidation:c.revalidation,component:R,error:_,children:T(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:m}):T()},null)}function pu(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function op(r){let o=j.useContext(Wl);return Be(o,pu(r)),o}function dp(r){let o=j.useContext(Tr);return Be(o,pu(r)),o}function fp(r){let o=j.useContext(Kt);return Be(o,pu(r)),o}function yu(r){let o=fp(r),u=o.matches[o.matches.length-1];return Be(u.route.id,`${r} can only be used on routes that contain a unique "id"`),u.route.id}function xp(){return yu("useRouteId")}function mp(){let r=j.useContext(hu),o=dp("useRouteError"),u=yu("useRouteError");return r!==void 0?r:o.errors?.[u]}function hp(){let{router:r}=op("useNavigate"),o=yu("useNavigate"),u=j.useRef(!1);return jx(()=>{u.current=!0}),j.useCallback(async(d,x={})=>{qt(u.current,bx),u.current&&(typeof d=="number"?await r.navigate(d):await r.navigate(d,{fromRouteId:o,...x}))},[r,o])}var V0={};function Ex(r,o,u){!o&&!V0[r]&&(V0[r]=!0,qt(!1,u))}j.memo(gp);function gp({routes:r,manifest:o,future:u,state:c,isStatic:d,onError:x}){return Nx(r,void 0,{manifest:o,state:c,isStatic:d,onError:x})}function We(r){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 pp({basename:r="/",children:o=null,location:u,navigationType:c="POP",navigator:d,static:x=!1,useTransitions:h}){Be(!es(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let N=r.replace(/^\/*/,"/"),p=j.useMemo(()=>({basename:N,navigator:d,static:x,useTransitions:h,future:{}}),[N,d,x,h]);typeof u=="string"&&(u=Jl(u));let{pathname:m="/",search:v="",hash:y="",state:w=null,key:_="default",mask:z}=u,R=j.useMemo(()=>{let b=ma(m,N);return b==null?null:{location:{pathname:b,search:v,hash:y,state:w,key:_,mask:z},navigationType:c}},[N,m,v,y,w,_,c,z]);return qt(R!=null,`<Router basename="${N}"> is not able to match the URL "${m}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:j.createElement(Lt.Provider,{value:p},j.createElement(In.Provider,{children:o,value:R}))}function yp({children:r,location:o}){return np(du(r),o)}function du(r,o=[]){let u=[];return j.Children.forEach(r,(c,d)=>{if(!j.isValidElement(c))return;let x=[...o,d];if(c.type===j.Fragment){u.push.apply(u,du(c.props.children,x));return}Be(c.type===We,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Be(!c.props.index||!c.props.children,"An index route cannot have child routes.");let h={id:c.props.id||x.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(h.children=du(c.props.children,x)),u.push(h)}),u}var Sr="get",Er="application/x-www-form-urlencoded";function Ar(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function vp(r){return Ar(r)&&r.tagName.toLowerCase()==="button"}function bp(r){return Ar(r)&&r.tagName.toLowerCase()==="form"}function jp(r){return Ar(r)&&r.tagName.toLowerCase()==="input"}function Np(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Sp(r,o){return r.button===0&&(!o||o==="_self")&&!Np(r)}function fu(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((o,u)=>{let c=r[u];return o.concat(Array.isArray(c)?c.map(d=>[u,d]):[[u,c]])},[]))}function Ep(r,o){let u=fu(r);return o&&o.forEach((c,d)=>{u.has(d)||o.getAll(d).forEach(x=>{u.append(d,x)})}),u}var jr=null;function Cp(){if(jr===null)try{new FormData(document.createElement("form"),0),jr=!1}catch{jr=!0}return jr}var wp=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nu(r){return r!=null&&!wp.has(r)?(qt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Er}"`),null):r}function Tp(r,o){let u,c,d,x,h;if(bp(r)){let N=r.getAttribute("action");c=N?ma(N,o):null,u=r.getAttribute("method")||Sr,d=nu(r.getAttribute("enctype"))||Er,x=new FormData(r)}else if(vp(r)||jp(r)&&(r.type==="submit"||r.type==="image")){let N=r.form;if(N==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=r.getAttribute("formaction")||N.getAttribute("action");if(c=p?ma(p,o):null,u=r.getAttribute("formmethod")||N.getAttribute("method")||Sr,d=nu(r.getAttribute("formenctype"))||nu(N.getAttribute("enctype"))||Er,x=new FormData(N,r),!Cp()){let{name:m,type:v,value:y}=r;if(v==="image"){let w=m?`${m}.`:"";x.append(`${w}x`,"0"),x.append(`${w}y`,"0")}else m&&x.append(m,y)}}else{if(Ar(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');u=Sr,c=null,d=Er,h=r}return x&&d==="text/plain"&&(h=x,x=void 0),{action:c,method:u.toLowerCase(),encType:d,formData:x,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vu(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function Cx(r,o,u,c){let d=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return u?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${c}`:d.pathname=`${d.pathname}.${c}`:d.pathname==="/"?d.pathname=`_root.${c}`:o&&ma(d.pathname,o)==="/"?d.pathname=`${wr(o)}/_root.${c}`:d.pathname=`${wr(d.pathname)}.${c}`,d}async function Ap(r,o){if(r.id in o)return o[r.id];try{let u=await import(r.module);return o[r.id]=u,u}catch(u){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(u),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Rp(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function Mp(r,o,u){let c=await Promise.all(r.map(async d=>{let x=o.routes[d.route.id];if(x){let h=await Ap(x,u);return h.links?h.links():[]}return[]}));return Op(c.flat(1).filter(Rp).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function X0(r,o,u,c,d,x){let h=(p,m)=>u[m]?p.route.id!==u[m].route.id:!0,N=(p,m)=>u[m].pathname!==p.pathname||u[m].route.path?.endsWith("*")&&u[m].params["*"]!==p.params["*"];return x==="assets"?o.filter((p,m)=>h(p,m)||N(p,m)):x==="data"?o.filter((p,m)=>{let v=c.routes[p.route.id];if(!v||!v.hasLoader)return!1;if(h(p,m)||N(p,m))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:u[0]?.params||{},nextUrl:new URL(r,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function _p(r,o,{includeHydrateFallback:u}={}){return zp(r.map(c=>{let d=o.routes[c.route.id];if(!d)return[];let x=[d.module];return d.clientActionModule&&(x=x.concat(d.clientActionModule)),d.clientLoaderModule&&(x=x.concat(d.clientLoaderModule)),u&&d.hydrateFallbackModule&&(x=x.concat(d.hydrateFallbackModule)),d.imports&&(x=x.concat(d.imports)),x}).flat(1))}function zp(r){return[...new Set(r)]}function Dp(r){let o={},u=Object.keys(r).sort();for(let c of u)o[c]=r[c];return o}function Op(r,o){let u=new Set;return new Set(o),r.reduce((c,d)=>{let x=JSON.stringify(Dp(d));return u.has(x)||(u.add(x),c.push({key:x,link:d})),c},[])}function bu(){let r=j.useContext(Wl);return vu(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function Up(){let r=j.useContext(Tr);return vu(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var ju=j.createContext(void 0);ju.displayName="FrameworkContext";function Nu(){let r=j.useContext(ju);return vu(r,"You must render this element inside a <HydratedRouter> element"),r}function Lp(r,o){let u=j.useContext(ju),[c,d]=j.useState(!1),[x,h]=j.useState(!1),{onFocus:N,onBlur:p,onMouseEnter:m,onMouseLeave:v,onTouchStart:y}=o,w=j.useRef(null);j.useEffect(()=>{if(r==="render"&&h(!0),r==="viewport"){let R=C=>{C.forEach(T=>{h(T.isIntersecting)})},b=new IntersectionObserver(R,{threshold:.5});return w.current&&b.observe(w.current),()=>{b.disconnect()}}},[r]),j.useEffect(()=>{if(c){let R=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(R)}}},[c]);let _=()=>{d(!0)},z=()=>{d(!1),h(!1)};return u?r!=="intent"?[x,w,{}]:[x,w,{onFocus:Zn(N,_),onBlur:Zn(p,z),onMouseEnter:Zn(m,_),onMouseLeave:Zn(v,z),onTouchStart:Zn(y,_)}]:[!1,w,{}]}function Zn(r,o){return u=>{r&&r(u),u.defaultPrevented||o(u)}}function Hp({page:r,...o}){let u=Kg(),{router:c}=bu(),d=j.useMemo(()=>ux(c.routes,r,c.basename),[c.routes,r,c.basename]);return d?u?j.createElement(kp,{page:r,matches:d,...o}):j.createElement($p,{page:r,matches:d,...o}):null}function Bp(r){let{manifest:o,routeModules:u}=Nu(),[c,d]=j.useState([]);return j.useEffect(()=>{let x=!1;return Mp(r,o,u).then(h=>{x||d(h)}),()=>{x=!0}},[r,o,u]),c}function kp({page:r,matches:o,...u}){let c=Yt(),{future:d}=Nu(),{basename:x}=bu(),h=j.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let N=Cx(r,x,d.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,m=[];for(let v of o)typeof v.route.shouldRevalidate=="function"?p=!0:m.push(v.route.id);return p&&m.length>0&&N.searchParams.set("_routes",m.join(",")),[N.pathname+N.search]},[x,d.v8_trailingSlashAwareDataRequests,r,c,o]);return j.createElement(j.Fragment,null,h.map(N=>j.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...u})))}function $p({page:r,matches:o,...u}){let c=Yt(),{future:d,manifest:x,routeModules:h}=Nu(),{basename:N}=bu(),{loaderData:p,matches:m}=Up(),v=j.useMemo(()=>X0(r,o,m,x,c,"data"),[r,o,m,x,c]),y=j.useMemo(()=>X0(r,o,m,x,c,"assets"),[r,o,m,x,c]),w=j.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let R=new Set,b=!1;if(o.forEach(T=>{let U=x.routes[T.route.id];!U||!U.hasLoader||(!v.some(J=>J.route.id===T.route.id)&&T.route.id in p&&h[T.route.id]?.shouldRevalidate||U.hasClientLoader?b=!0:R.add(T.route.id))}),R.size===0)return[];let C=Cx(r,N,d.v8_trailingSlashAwareDataRequests,"data");return b&&R.size>0&&C.searchParams.set("_routes",o.filter(T=>R.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[N,d.v8_trailingSlashAwareDataRequests,p,c,x,v,o,r,h]),_=j.useMemo(()=>_p(y,x),[y,x]),z=Bp(y);return j.createElement(j.Fragment,null,w.map(R=>j.createElement("link",{key:R,rel:"prefetch",as:"fetch",href:R,...u})),_.map(R=>j.createElement("link",{key:R,rel:"modulepreload",href:R,...u})),z.map(({key:R,link:b})=>j.createElement("link",{key:R,nonce:u.nonce,...b,crossOrigin:b.crossOrigin??u.crossOrigin})))}function qp(...r){return o=>{r.forEach(u=>{typeof u=="function"?u(o):u!=null&&(u.current=o)})}}var Yp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Yp&&(window.__reactRouterVersion="7.16.0")}catch{}function Gp({basename:r,children:o,useTransitions:u,window:c}){let d=j.useRef();d.current==null&&(d.current=bg({window:c,v5Compat:!0}));let x=d.current,[h,N]=j.useState({action:x.action,location:x.location}),p=j.useCallback(m=>{u===!1?N(m):j.startTransition(()=>N(m))},[u]);return j.useLayoutEffect(()=>x.listen(p),[x,p]),j.createElement(pp,{basename:r,children:o,location:h.location,navigationType:h.action,navigator:x,useTransitions:u})}var wx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,st=j.forwardRef(function({onClick:o,discover:u="render",prefetch:c="none",relative:d,reloadDocument:x,replace:h,mask:N,state:p,target:m,to:v,preventScrollReset:y,viewTransition:w,defaultShouldRevalidate:_,...z},R){let{basename:b,navigator:C,useTransitions:T}=j.useContext(Lt),U=typeof v=="string"&&wx.test(v),J=hx(v,b);v=J.to;let V=tp(v,{relative:d}),ae=Yt(),Z=null;if(N){let je=mu(N,[],ae.mask?ae.mask.pathname:"/",!0);b!=="/"&&(je.pathname=je.pathname==="/"?b:$t([b,je.pathname])),Z=C.createHref(je)}let[K,H,W]=Lp(c,z),I=Qp(v,{replace:h,mask:N,state:p,target:m,preventScrollReset:y,relative:d,viewTransition:w,defaultShouldRevalidate:_,useTransitions:T});function Ee(je){o&&o(je),je.defaultPrevented||I(je)}let He=!(J.isExternal||x),ze=j.createElement("a",{...z,...W,href:(He?Z:void 0)||J.absoluteURL||V,onClick:He?Ee:o,ref:qp(R,H),target:m,"data-discover":!U&&u==="render"?"true":void 0});return K&&!U?j.createElement(j.Fragment,null,ze,j.createElement(Hp,{page:V})):ze});st.displayName="Link";var Tx=j.forwardRef(function({"aria-current":o="page",caseSensitive:u=!1,className:c="",end:d=!1,style:x,to:h,viewTransition:N,children:p,...m},v){let y=ts(h,{relative:m.relative}),w=Yt(),_=j.useContext(Tr),{navigator:z,basename:R}=j.useContext(Lt),b=_!=null&&Fp(y)&&N===!0,C=z.encodeLocation?z.encodeLocation(y).pathname:y.pathname,T=w.pathname,U=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;u||(T=T.toLowerCase(),U=U?U.toLowerCase():null,C=C.toLowerCase()),U&&R&&(U=ma(U,R)||U);const J=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let V=T===C||!d&&T.startsWith(C)&&T.charAt(J)==="/",ae=U!=null&&(U===C||!d&&U.startsWith(C)&&U.charAt(C.length)==="/"),Z={isActive:V,isPending:ae,isTransitioning:b},K=V?o:void 0,H;typeof c=="function"?H=c(Z):H=[c,V?"active":null,ae?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let W=typeof x=="function"?x(Z):x;return j.createElement(st,{...m,"aria-current":K,className:H,ref:v,style:W,to:h,viewTransition:N},typeof p=="function"?p(Z):p)});Tx.displayName="NavLink";var Vp=j.forwardRef(({discover:r="render",fetcherKey:o,navigate:u,reloadDocument:c,replace:d,state:x,method:h=Sr,action:N,onSubmit:p,relative:m,preventScrollReset:v,viewTransition:y,defaultShouldRevalidate:w,..._},z)=>{let{useTransitions:R}=j.useContext(Lt),b=Jp(),C=Wp(N,{relative:m}),T=h.toLowerCase()==="get"?"get":"post",U=typeof N=="string"&&wx.test(N),J=V=>{if(p&&p(V),V.defaultPrevented)return;V.preventDefault();let ae=V.nativeEvent.submitter,Z=ae?.getAttribute("formmethod")||h,K=()=>b(ae||V.currentTarget,{fetcherKey:o,method:Z,navigate:u,replace:d,state:x,relative:m,preventScrollReset:v,viewTransition:y,defaultShouldRevalidate:w});R&&u!==!1?j.startTransition(()=>K()):K()};return j.createElement("form",{ref:z,method:T,action:C,onSubmit:c?p:J,..._,"data-discover":!U&&r==="render"?"true":void 0})});Vp.displayName="Form";function Xp(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ax(r){let o=j.useContext(Wl);return Be(o,Xp(r)),o}function Qp(r,{target:o,replace:u,mask:c,state:d,preventScrollReset:x,relative:h,viewTransition:N,defaultShouldRevalidate:p,useTransitions:m}={}){let v=gu(),y=Yt(),w=ts(r,{relative:h});return j.useCallback(_=>{if(Sp(_,o)){_.preventDefault();let z=u!==void 0?u:Pn(y)===Pn(w),R=()=>v(r,{replace:z,mask:c,state:d,preventScrollReset:x,relative:h,viewTransition:N,defaultShouldRevalidate:p});m?j.startTransition(()=>R()):R()}},[y,v,w,u,c,d,o,r,x,h,N,p,m])}function Rr(r){qt(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 o=j.useRef(fu(r)),u=j.useRef(!1),c=Yt(),d=j.useMemo(()=>Ep(c.search,u.current?null:o.current),[c.search]),x=gu(),h=j.useCallback((N,p)=>{const m=fu(typeof N=="function"?N(new URLSearchParams(d)):N);u.current=!0,x("?"+m,p)},[x,d]);return[d,h]}var Zp=0,Kp=()=>`__${String(++Zp)}__`;function Jp(){let{router:r}=Ax("useSubmit"),{basename:o}=j.useContext(Lt),u=xp(),c=r.fetch,d=r.navigate;return j.useCallback(async(x,h={})=>{let{action:N,method:p,encType:m,formData:v,body:y}=Tp(x,o);if(h.navigate===!1){let w=h.fetcherKey||Kp();await c(w,u,h.action||N,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:v,body:y,formMethod:h.method||p,formEncType:h.encType||m,flushSync:h.flushSync})}else await d(h.action||N,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:v,body:y,formMethod:h.method||p,formEncType:h.encType||m,replace:h.replace,state:h.state,fromRouteId:u,flushSync:h.flushSync,viewTransition:h.viewTransition})},[c,d,o,u])}function Wp(r,{relative:o}={}){let{basename:u}=j.useContext(Lt),c=j.useContext(Kt);Be(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),x={...ts(r||".",{relative:o})},h=Yt();if(r==null){x.search=h.search;let N=new URLSearchParams(x.search),p=N.getAll("index");if(p.some(v=>v==="")){N.delete("index"),p.filter(y=>y).forEach(y=>N.append("index",y));let v=N.toString();x.search=v?`?${v}`:""}}return(!r||r===".")&&d.route.index&&(x.search=x.search?x.search.replace(/^\?/,"?index&"):"?index"),u!=="/"&&(x.pathname=x.pathname==="/"?u:$t([u,x.pathname])),Pn(x)}function Fp(r,{relative:o}={}){let u=j.useContext(yx);Be(u!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=Ax("useViewTransitionState"),d=ts(r,{relative:o});if(!u.isTransitioning)return!1;let x=ma(u.currentLocation.pathname,c)||u.currentLocation.pathname,h=ma(u.nextLocation.pathname,c)||u.nextLocation.pathname;return Cr(d.pathname,h)!=null||Cr(d.pathname,x)!=null}const Rx=j.createContext({projects:[],activeProject:null,setActiveProject:()=>{},refreshProjects:()=>{}});function rl(){return j.useContext(Rx)}function Pp(){const[r,o]=j.useState([]),[u,c]=Rr(),d=j.useCallback(async()=>{try{const m=await(await fetch("/api/projects")).json();m.ok&&o(m.data||[])}catch{}},[]);j.useEffect(()=>{d()},[d]);const x=u.get("project"),h=x?r.find(p=>p.id===x)||r[0]||null:r[0]||null,N=j.useCallback(p=>{c(m=>(m.set("project",p),m))},[c]);return{projects:r,activeProject:h,setActiveProject:N,refreshProjects:d}}function Mx(r,o){const{timeout:u=3e4,retries:c=1,retryDelay:d=2e3}={},[x,h]=j.useState(null),[N,p]=j.useState(!0),[m,v]=j.useState(null),[y,w]=j.useState(0),[_,z]=j.useState(null),R=j.useCallback(()=>w(b=>b+1),[]);return j.useEffect(()=>{if(!r){p(!1),h(null),v(null);return}let b=!1;p(!0),v(null);async function C(T){const U=new AbortController,J=setTimeout(()=>U.abort(),u);try{const V=await fetch(r,{signal:U.signal});if(clearTimeout(J),!V.ok)throw new Error(`HTTP ${V.status}`);const ae=V.headers.get("content-type")||"";if(!ae.includes("application/json"))throw new Error(`Expected JSON response but got ${ae||"unknown"} — server may be restarting`);const Z=await V.json();b||(h(Z.data??Z),v(null),z(new Date),p(!1))}catch(V){if(clearTimeout(J),b)return;if(T>0&&V.name!=="AbortError")return await new Promise(ae=>setTimeout(ae,d)),b?void 0:C(T-1);V.name==="AbortError"?v(`Request timed out (${Math.round(u/1e3)}s)`):v(String(V.message||V)),p(!1)}}return C(c),()=>{b=!0}},[r,y,u,c,d]),{data:x,loading:N,error:m,refetch:R,fetchedAt:_}}function Te(r,o){const{activeProject:u}=rl(),c=r.includes("?")?"&":"?",d=u?`${r}${c}project=${u.id}`:r;return Mx(d)}const Su=j.createContext(null),Ip=["heartbeat","increment-update","analytics-event","cost-update","notification","sync-update","sync-audit","error-detected","config-changed","activity","command-output","command-complete","job-progress","marketplace-scan","submission-update","verification-complete","hook-event","hook-agent"];function ey({url:r="/api/events",children:o}){const[u,c]=j.useState("connecting"),d=j.useRef(null),x=j.useRef(null),h=j.useRef(new Map),N=j.useCallback(()=>{d.current&&d.current.close(),c("connecting");const m=new EventSource(r);d.current=m;for(const v of Ip)m.addEventListener(v,y=>{let w;try{w=JSON.parse(y.data)}catch{return}const _=h.current.get(v);if(_)for(const z of _)try{z(w)}catch{}});m.onopen=()=>c("connected"),m.onerror=()=>{m.close(),c("disconnected"),x.current=setTimeout(()=>{d.current===m&&N()},3e3)}},[r]);j.useEffect(()=>(N(),()=>{x.current&&(clearTimeout(x.current),x.current=null),d.current?.close(),d.current=null}),[N]);const p=j.useCallback((m,v)=>(h.current.has(m)||h.current.set(m,new Set),h.current.get(m).add(v),()=>{const y=h.current.get(m);y&&(y.delete(v),y.size===0&&h.current.delete(m))}),[]);return l.jsx(Su.Provider,{value:{status:u,subscribe:p},children:o})}function Ue(r,o){const u=j.useContext(Su),c=j.useRef(o);c.current=o,j.useEffect(()=>{if(!u)return;const d=x=>c.current(x);return u.subscribe(r,d)},[u,r])}function ty(){return j.useContext(Su)?.status??"disconnected"}const ay=[{path:"/",label:"Overview",icon:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-4 0a1 1 0 01-1-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 01-1 1"},{path:"/increments",label:"Increments",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"},{path:"/analytics",label:"Analytics",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{path:"/costs",label:"Costs",icon:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{path:"/sync",label:"Sync",icon:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},{path:"/errors",label:"Errors",icon:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"},{path:"/activity",label:"Activity",icon:"M13 10V3L4 14h7v7l9-11h-7z"},{path:"/notifications",label:"Notifications",icon:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",badge:!0},{path:"/config",label:"Config",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"},{path:"/plugins",label:"Plugins",icon:"M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z"},{path:"/marketplace",label:"Marketplace",icon:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 100 4 2 2 0 000-4z"},{path:"/repos",label:"Repos",icon:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},{path:"/workspace",label:"Workspace",icon:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"},{path:"/services",label:"Services",icon:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"},{path:"/hooks",label:"Hooks",icon:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},{path:"/agents",label:"Agents",icon:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}];function ly({d:r}){return l.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:r})})}function ny(){const{projects:r,activeProject:o,setActiveProject:u}=rl(),[c]=Rr(),{data:d}=Te("/api/overview"),[x,h]=j.useState(null),N=j.useCallback(w=>{const _=w;_?.pendingCount!=null&&h(_.pendingCount)},[]);Ue("notification",N);const p=ty(),m=x??d?.notifications?.pendingCount??0,v=c.get("project"),y=w=>v?`${w}?project=${v}`:w;return l.jsxs("aside",{className:"w-56 bg-gray-900 border-r border-gray-800 flex flex-col h-screen sticky top-0",children:[l.jsx("div",{className:"px-4 py-5 border-b border-gray-800",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-8 h-8 bg-indigo-500 rounded-lg flex items-center justify-center",children:l.jsx("span",{className:"text-white font-bold text-sm",children:"SW"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-white font-semibold text-sm",children:"SpecWeave"}),l.jsx("div",{className:"text-gray-500 text-xs",children:"Dashboard"})]})]})}),(r.length>0||v)&&l.jsxs("div",{className:"px-3 py-3 border-b border-gray-800",children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1 block",children:"Project"}),l.jsxs("select",{value:o?.id||v||"",onChange:w=>{w.target.value==="__add__"?window.location.href=y("/config"):u(w.target.value)},className:"w-full bg-gray-800 border border-gray-700 text-gray-300 text-xs rounded-lg px-2 py-1.5 focus:ring-indigo-500 focus:border-indigo-500",children:[r.map(w=>l.jsx("option",{value:w.id,children:w.name},w.id)),v&&!r.find(w=>w.id===v)&&l.jsxs("option",{value:v,children:[decodeURIComponent(v).split(/[-/]/).pop()||v," (not registered)"]}),l.jsx("option",{value:"__add__",children:"+ Add project..."})]})]}),l.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-2",children:ay.map(w=>l.jsxs(Tx,{to:y(w.path),end:w.path==="/",className:({isActive:_})=>`flex items-center gap-3 px-3 py-2 rounded-lg text-sm mb-0.5 transition-colors ${_?"bg-indigo-500/10 text-indigo-400":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"}`,children:[l.jsx(ly,{d:w.icon}),l.jsx("span",{className:"flex-1",children:w.label}),w.badge&&m>0&&l.jsx("span",{className:"min-w-[18px] h-[18px] px-1 bg-rose-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center",children:m>99?"99+":m})]},w.path))}),l.jsx("div",{className:"px-4 py-3 border-t border-gray-800",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${p==="connected"?"bg-emerald-400 pulse-dot":p==="connecting"?"bg-amber-400 pulse-dot":"bg-gray-500"}`}),l.jsx("span",{className:"text-xs text-gray-500",children:p==="connected"?"Connected":p==="connecting"?"Connecting...":"Disconnected"})]}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[r.length," project",r.length!==1?"s":""]})]})})]})}function sy(){const{data:r}=Mx("/api/health"),{activeProject:o}=rl(),u=o?.name||"Project",c=r?.uptime?ry(r.uptime):"...";return l.jsxs("header",{className:"h-14 bg-gray-900/50 backdrop-blur border-b border-gray-800 flex items-center justify-between px-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-gray-200 font-medium text-sm",children:u}),l.jsx("span",{className:"text-gray-600 text-xs",children:"|"}),l.jsxs("span",{className:"text-gray-500 text-xs",children:["Uptime: ",c]})]}),l.jsx("div",{className:"flex items-center gap-4",children:l.jsxs("span",{className:"text-gray-500 text-xs",children:[r?.connections??0," client",(r?.connections??0)!==1?"s":""]})})]})}function ry(r){if(r<60)return`${Math.floor(r)}s`;if(r<3600)return`${Math.floor(r/60)}m`;const o=Math.floor(r/3600),u=Math.floor(r%3600/60);return`${o}h ${u}m`}class iy extends j.Component{constructor(o){super(o),this.state={hasError:!1,error:null}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}componentDidCatch(o,u){console.error("[Dashboard ErrorBoundary]",o,u.componentStack)}componentDidUpdate(o){this.state.hasError&&o.resetKey!==this.props.resetKey&&this.setState({hasError:!1,error:null})}render(){return this.state.hasError?l.jsx("div",{className:"flex items-center justify-center min-h-[400px] p-8",children:l.jsxs("div",{className:"max-w-md text-center space-y-4",children:[l.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-rose-500/10 flex items-center justify-center",children:l.jsx("svg",{className:"w-6 h-6 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),l.jsx("h3",{className:"text-lg font-semibold text-gray-200",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-gray-500",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 justify-center",children:[l.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),className:"px-4 py-2 text-sm bg-gray-800 text-gray-300 rounded-lg hover:bg-gray-700 transition-colors",children:"Try Again"}),l.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition-colors",children:"Reload Page"}),l.jsx("a",{href:"/",className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors",children:"Go Home"})]})]})}):this.props.children}}const cy={indigo:"from-indigo-500/10 to-indigo-500/5 border-indigo-500/20",emerald:"from-emerald-500/10 to-emerald-500/5 border-emerald-500/20",amber:"from-amber-500/10 to-amber-500/5 border-amber-500/20",rose:"from-rose-500/10 to-rose-500/5 border-rose-500/20",cyan:"from-cyan-500/10 to-cyan-500/5 border-cyan-500/20"},uy={indigo:"text-indigo-400",emerald:"text-emerald-400",amber:"text-amber-400",rose:"text-rose-400",cyan:"text-cyan-400"};function ne({title:r,value:o,subtitle:u,tooltip:c,color:d="indigo"}){return l.jsxs("div",{className:`bg-gradient-to-br ${cy[d]} border rounded-xl p-4 relative group`,title:c,children:[l.jsx("div",{className:"text-gray-400 text-xs font-medium uppercase tracking-wider mb-2",children:r}),l.jsx("div",{className:`text-2xl font-bold ${uy[d]}`,children:o}),u&&l.jsx("div",{className:"text-gray-500 text-xs mt-1",children:u}),c&&l.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2.5 py-1.5 bg-gray-800 border border-gray-700 rounded-lg text-[10px] text-gray-300 whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10 shadow-lg",children:[c,l.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-px border-4 border-transparent border-t-gray-800"})]})]})}const oy={active:"#6366f1",completed:"#10b981",paused:"#f59e0b",planning:"#06b6d4",abandoned:"#ef4444",backlog:"#6b7280",ready_for_review:"#8b5cf6"};function dy(r){return oy[r]||"#6b7280"}function fy({segments:r,size:o=160,centerLabel:u,centerValue:c}){const d=r.reduce((p,m)=>p+m.value,0);if(d===0)return l.jsx("div",{className:"flex items-center justify-center",style:{width:o,height:o},children:l.jsx("span",{className:"text-gray-600 text-xs",children:"No data"})});const x=52,h=2*Math.PI*x;let N=0;return l.jsxs("div",{className:"relative inline-flex items-center justify-center",style:{width:o,height:o},children:[l.jsx("svg",{viewBox:"0 0 128 128",className:"w-full h-full -rotate-90",children:r.map((p,m)=>{const y=p.value/d*h,w=N;return N+=y,l.jsx("circle",{cx:"64",cy:"64",r:x,fill:"none",stroke:p.color,strokeWidth:"12",strokeDasharray:`${y} ${h-y}`,strokeDashoffset:-w,className:"transition-all duration-500"},m)})}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c!=null&&l.jsx("span",{className:"text-xl font-bold text-white",children:c}),u&&l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:u})]})]})}function xy(r){return Object.entries(r).filter(([o,u])=>u>0).map(([o,u])=>({label:o,value:u,color:dy(o)}))}const my={default:"bg-gray-800 text-gray-300",success:"bg-emerald-500/15 text-emerald-400",warning:"bg-amber-500/15 text-amber-400",error:"bg-rose-500/15 text-rose-400",info:"bg-cyan-500/15 text-cyan-400"};function ie({label:r,variant:o="default"}){return l.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${my[o]}`,children:r})}function Mr(r){switch(r){case"active":case"running":return"info";case"completed":case"success":return"success";case"paused":case"pending":case"planning":return"warning";case"failed":case"abandoned":case"error":return"error";default:return"default"}}function hy({size:r="md"}){const o={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};return l.jsxs("svg",{className:`${o[r]} animate-spin text-indigo-400`,viewBox:"0 0 24 24",fill:"none",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}function Ie(){return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(hy,{size:"lg"})})}function Gt({message:r,onRetry:o,title:u="Something went wrong"}){const c=r.toLowerCase().includes("timed out");return l.jsx("div",{className:"p-6",children:l.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-5 py-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-rose-300",children:u}),l.jsx("p",{className:"text-xs text-rose-400/80 mt-1",children:r})]}),o&&l.jsx("button",{onClick:o,className:"text-xs text-rose-400 hover:text-rose-200 px-3 py-1.5 border border-rose-700 rounded transition-colors flex-shrink-0",children:"Retry"})]}),c&&l.jsx("p",{className:"text-[10px] text-rose-400/60",children:"The server may be processing a large number of session logs. Try again in a moment."})]})})}function Q0(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function gy(r){switch(r){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return r||"Unknown"}}const su=r=>r.billingContext?.planType==="subscription";function py(){const[r,o]=j.useState(0),{data:u,loading:c,error:d,refetch:x}=Te(`/api/overview?_r=${r}`),[h,N]=j.useState([]),[p,m]=j.useState([]),[v,y]=j.useState([]),{activeProject:w}=rl();Ue("increment-update",()=>o(b=>b+1)),Ue("notification",()=>o(b=>b+1)),Ue("sync-update",()=>o(b=>b+1)),Ue("sync-error",()=>o(b=>b+1)),Ue("cost-update",()=>o(b=>b+1));const _=j.useRef(null);j.useEffect(()=>{if(!w||_.current===w.id)return;_.current=w.id;const b=`project=${w.id}`;fetch(`/api/activity/stream?limit=20&${b}`).then(C=>C.json()).then(C=>{C.ok&&Array.isArray(C.data)&&N(C.data)}).catch(()=>{})},[w]);const z=j.useCallback(b=>{N(C=>[b,...C].slice(0,20))},[]);if(Ue("activity",z),j.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=5").then(b=>b.json()).then(b=>{b.ok&&Array.isArray(b.data)&&m(b.data)}).catch(()=>{}),fetch("/api/sync/gaps").then(b=>b.json()).then(b=>{b.ok&&Array.isArray(b.data)&&y(b.data)}).catch(()=>{})},[r]),c)return l.jsx(Ie,{});if(d)return l.jsx(Gt,{message:d,onRetry:x});if(!u)return null;const R=xy(u.project.statusBreakdown);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("h2",{className:"text-lg font-semibold text-gray-200",children:[u.project.name||"Project"," Overview"]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(st,{to:"/increments?status=active",className:"group",children:l.jsx(ne,{title:"Active Increments",value:u.project.activeIncrements,subtitle:`${u.project.totalIncrements} total`,color:"indigo"})}),l.jsx(st,{to:"/increments?status=completed",className:"group",children:l.jsx(ne,{title:"Completed",value:u.project.completedIncrements,subtitle:`${Math.round(u.project.completedIncrements/Math.max(u.project.totalIncrements,1)*100)}% done`,color:"emerald"})}),l.jsx(st,{to:"/costs",className:"group",children:l.jsx(ne,{title:su(u.costs)?"Usage Value":"Total Cost",value:`$${u.costs.totalCost.toFixed(2)}`,subtitle:su(u.costs)?`via Claude Code · $${u.costs.billingContext?.monthlyAmount??"?"}/mo plan`:`via Claude Code · ${u.costs.sessionCount.toLocaleString()} sessions`,color:"amber"})}),l.jsx(st,{to:"/analytics",className:"group",children:l.jsx(ne,{title:"Events Today",value:u.analytics.last24hEvents,subtitle:`${u.analytics.totalEvents.toLocaleString()} total`,color:"cyan"})})]}),l.jsx(yy,{}),su(u.costs)&&l.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[l.jsx(ie,{label:"Subscription",variant:"info"}),l.jsx("span",{className:"text-xs text-gray-300",children:"Costs shown as API-equivalent usage value."})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Status"}),l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(fy,{segments:R,centerValue:u.project.totalIncrements,centerLabel:"total"})}),l.jsx("div",{className:"flex flex-wrap gap-2 mt-4 justify-center",children:R.map(b=>l.jsxs(st,{to:`/increments?status=${b.label.toLowerCase()}`,className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:b.color}}),l.jsxs("span",{className:"text-xs text-gray-500 hover:text-gray-300",children:[b.label," (",b.value,")"]})]},b.label))})]}),l.jsxs(st,{to:"/sync",className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 hover:border-gray-700 transition-colors block",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Health"}),l.jsx("div",{className:"space-y-3",children:Object.entries(u.sync.platforms).length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No sync platforms configured"}):Object.entries(u.sync.platforms).map(([b,C])=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-300 capitalize",children:b}),C.configDetail&&l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:C.configDetail}),!C.configDetail&&C.lastImport&&l.jsxs("div",{className:"text-xs text-gray-600 mt-0.5",children:["Last: ",new Date(C.lastImport).toLocaleDateString()]})]}),l.jsx(ie,{label:gy(C.connectionStatus||C.lastSyncResult),variant:Q0(C.connectionStatus)!=="default"?Q0(C.connectionStatus):Mr(C.lastSyncResult||"")})]},b))}),l.jsx("div",{className:"mt-4 pt-4 border-t border-gray-800",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:"Notifications"}),l.jsxs("div",{className:"flex gap-2",children:[u.notifications.criticalCount>0&&l.jsx(st,{to:"/notifications",onClick:b=>b.stopPropagation(),children:l.jsx(ie,{label:`${u.notifications.criticalCount} critical`,variant:"error"})}),l.jsx(st,{to:"/notifications",onClick:b=>b.stopPropagation(),children:l.jsx(ie,{label:`${u.notifications.pendingCount} pending`,variant:u.notifications.pendingCount>0?"warning":"default"})})]})]})})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Live Activity"}),l.jsx(st,{to:"/activity",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),l.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto custom-scrollbar",children:h.length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No recent activity"}):h.map((b,C)=>l.jsxs("div",{className:"flex items-start gap-2 py-1 slide-in",children:[l.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-1.5 ${b.severity==="error"?"bg-rose-400":b.severity==="warning"?"bg-amber-400":"bg-gray-600"}`}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-gray-400 truncate",children:b.title}),l.jsxs("div",{className:"text-[10px] text-gray-600",children:[b.category,b.timestamp&&` · ${Z0(b.timestamp)}`]})]})]},C))})]})]}),v.length>0&&l.jsxs(st,{to:"/sync",className:"bg-amber-500/10 border border-amber-500/20 rounded-xl px-4 py-3 flex items-center gap-3 hover:border-amber-500/30 transition-colors block",children:[l.jsx(ie,{label:`${v.length} gaps`,variant:"warning"}),l.jsxs("span",{className:"text-xs text-gray-300",children:[v.length," increment",v.length!==1?"s have":" has"," partial sync coverage"]})]}),p.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sync Errors"}),l.jsx(st,{to:"/sync",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),l.jsx("div",{className:"space-y-2",children:p.map((b,C)=>l.jsxs("div",{className:"flex items-start gap-2 p-3 bg-gray-800/50 rounded-lg",children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full mt-1.5 bg-rose-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-300 capitalize",children:b.provider}),l.jsx(ie,{label:b.incrementId,variant:"default"})]}),l.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:b.error}),l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:Z0(b.timestamp)})]})]},C))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Types"}),l.jsx("div",{className:"flex gap-4 flex-wrap",children:Object.entries(u.project.typeBreakdown).map(([b,C])=>l.jsxs(st,{to:`/increments?type=${b}`,className:"flex items-center gap-2 px-3 py-2 bg-gray-800/50 rounded-lg hover:bg-gray-800/80 transition-colors",children:[l.jsx("span",{className:"text-sm text-gray-300 capitalize",children:b}),l.jsx("span",{className:"text-xs text-gray-500 bg-gray-800 px-2 py-0.5 rounded",children:C})]},b))})]})]})}function yy(){const[r,o]=j.useState(0);Ue("error-detected",()=>o(_=>_+1));const{data:u}=Te(`/api/prompt-health?_r=${r}`);if(!u?.health||u.health.warningLevel==="normal")return null;const{health:c,alert:d}=u,x=d?.level==="emergency",h=c.warningLevel==="critical"||x,N=h?"border-rose-500/30":"border-amber-500/20",p=h?"bg-rose-500/10":"bg-amber-500/10",m=h?"text-rose-400":"text-amber-400",v=Math.round(c.baseline/1e3),y=Math.min(Math.round(c.baseline/2e5*100),100),w=h?"bg-rose-500":"bg-amber-500";return l.jsxs("div",{className:`${p} border ${N} rounded-xl px-4 py-3 space-y-2`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ie,{label:h?"Critical":"Warning",variant:h?"error":"warning"}),l.jsxs("span",{className:`text-xs ${m}`,children:["Prompt baseline: ",v,"KB (",y,"% of context window)"]})]}),l.jsx(st,{to:"/errors",className:"text-[10px] text-gray-500 hover:text-gray-300",children:"Details"})]}),l.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5",children:l.jsx("div",{className:`${w} h-1.5 rounded-full`,style:{width:`${y}%`}})}),l.jsxs("div",{className:"flex gap-4 text-[10px] text-gray-500",children:[l.jsxs("span",{children:["CLAUDE.md: ",Math.round(c.claudeMdSize/1e3),"KB"]}),l.jsxs("span",{children:["MEMORY.md: ",Math.round(c.memoryMdSize/1e3),"KB"]}),l.jsxs("span",{children:["Skills: ",Math.round(c.skillBudget/1e3),"KB"]}),d&&l.jsxs("span",{className:m,children:["Compactions: ",d.compactionCount]})]})]})}function Z0(r){try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function vy(){const r=gu(),[o]=Rr();return j.useCallback(u=>{const c=o.get("project");if(c){const d=u.includes("?")?"&":"?";r(`${u}${d}project=${encodeURIComponent(c)}`)}else r(u)},[r,o])}const Wn=new Map;let ru=!1,_x=null;function by(){ru||(ru=!0,queueMicrotask(()=>{ru=!1;const r=_x;if(!r||Wn.size===0){Wn.clear();return}const o=new Map(Wn);Wn.clear(),r(u=>{const c=new URLSearchParams(u);for(const[d,{value:x,defaultValue:h}]of o)x&&x!==h?c.set(d,x):c.delete(d);return c})}))}function Ut(r,o=""){const[u,c]=Rr(),d=u.get(r)??o,x=j.useCallback(h=>{_x=c,Wn.set(r,{value:h,defaultValue:o}),by()},[r,o,c]);return[d,x]}function Eu({title:r,description:o}){return l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mb-4",children:l.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})}),l.jsx("h3",{className:"text-gray-400 text-sm font-medium",children:r}),o&&l.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs",children:o})]})}const Kn=50;function jy(){const[r,o]=j.useState(0),[u,c]=j.useState(0),[d,x]=Ut("status","all"),[h,N]=Ut("type","all"),p=vy(),m=j.useRef();Ue("increment-update",()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>o(U=>U+1),500)}),j.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const v=new URLSearchParams({_r:String(r),limit:String(Kn),offset:String(u)});d!=="all"&&v.set("status",d),h!=="all"&&v.set("type",h);const{data:y,loading:w,error:_,refetch:z}=Te(`/api/increments?${v}`),R=j.useRef(d),b=j.useRef(h);if(j.useEffect(()=>{(R.current!==d||b.current!==h)&&(c(0),R.current=d,b.current=h)},[d,h]),w&&u===0)return l.jsx(Ie,{});if(_)return l.jsx(Gt,{message:_,onRetry:z});if(!y)return null;const C=Object.keys(y.summary).filter(U=>U!=="total"&&y.summary[U]>0),T=y.pagination;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Increments"}),l.jsxs("span",{className:"text-sm text-gray-500",children:[T?.total??y.increments.length," total"]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Status:"}),l.jsxs("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[l.jsx(iu,{label:"All",active:d==="all",onClick:()=>x("all"),count:y.summary.total}),C.map(U=>l.jsx(iu,{label:U,active:d===U,onClick:()=>x(U),count:y.summary[U]},U))]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Type:"}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:l.jsx(iu,{label:"All",active:h==="all",onClick:()=>N("all")})})]}),T&&T.total>0&&l.jsxs("span",{className:"text-xs text-gray-500",children:["Showing ",u+1,"–",Math.min(u+Kn,T.total)," of ",T.total]})]}),y.increments.length===0?l.jsx(Eu,{title:"No increments match filters",description:"Try adjusting your filters"}):l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ID"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Title"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Status"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Type"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Priority"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Tasks"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ACs"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Last Activity"})]})}),l.jsx("tbody",{children:y.increments.map(U=>l.jsxs("tr",{onClick:()=>p(`/increments/${U.id}`),className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors cursor-pointer",children:[l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:U.id})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-sm text-gray-300",children:U.title})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(ie,{label:U.status,variant:Mr(U.status)})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:U.type})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Ny,{priority:U.priority})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(K0,{completed:U.tasks.completed,total:U.tasks.total})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(K0,{completed:U.acs.completed,total:U.acs.total})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-gray-500",children:U.lastActivity?Sy(U.lastActivity):"-"})})]},U.id))})]})}),T&&T.total>Kn&&l.jsxs("div",{className:"flex justify-center gap-2",children:[l.jsx("button",{onClick:()=>c(Math.max(0,u-Kn)),disabled:u===0,className:"px-4 py-2 text-sm text-gray-300 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Previous"}),l.jsx("button",{onClick:()=>c(u+Kn),disabled:!T.hasMore,className:"px-4 py-2 text-sm text-gray-300 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Next"})]})]})}function iu({label:r,active:o,onClick:u,count:c}){return l.jsxs("button",{onClick:u,className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${o?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:[r,c!==void 0&&l.jsx("span",{className:"ml-1 text-[10px] text-gray-500",children:c})]})}function K0({completed:r,total:o}){const u=o>0?Math.round(r/o*100):0;return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-16 h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-indigo-500 rounded-full transition-all",style:{width:`${u}%`}})}),l.jsxs("span",{className:"text-xs text-gray-500",children:[r,"/",o]})]})}function Ny({priority:r}){const o={P0:"text-rose-400 bg-rose-500/10",P1:"text-amber-400 bg-amber-500/10",P2:"text-cyan-400 bg-cyan-500/10",P3:"text-gray-400 bg-gray-500/10"};return l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${o[r]||o.P2}`,children:r})}function Sy(r){try{const o=new Date(r),c=new Date().getTime()-o.getTime(),d=Math.floor(c/6e4);if(d<1)return"Just now";if(d<60)return`${d}m ago`;const x=Math.floor(d/60);if(x<24)return`${x}h ago`;const h=Math.floor(x/24);return h<7?`${h}d ago`:o.toLocaleDateString()}catch{return r}}function Ey(){const[r,o]=j.useState("skills"),[u,c]=j.useState(!1),[d,x]=j.useState(0);Ue("analytics-event",()=>x(C=>C+1));const{data:h,loading:N,error:p,refetch:m,fetchedAt:v}=Te(`/api/analytics/summary?_r=${d}`),{data:y,loading:w,refetch:_}=Te(`/api/analytics/skills?_r=${d}`);if(N||w)return l.jsx(Ie,{});if(p)return l.jsx(Gt,{message:p,onRetry:m});if(!h)return null;const z=h.topCommands?.reduce((C,T)=>C+T.count,0)||0,R=h.topSkills?.reduce((C,T)=>C+T.count,0)||0,b=h.topAgents?.reduce((C,T)=>C+T.count,0)||0;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Analytics"}),l.jsxs("div",{className:"flex items-center gap-3",children:[v&&l.jsxs("span",{className:"text-[10px] text-gray-600",children:["Updated ",v.toLocaleTimeString()]}),l.jsxs("span",{className:"text-sm text-gray-500",children:[h.totalEvents.toLocaleString()," total events"]}),l.jsx("button",{onClick:()=>{c(!0),m(),_(),setTimeout(()=>c(!1),600)},disabled:u,className:"p-1.5 text-gray-500 hover:text-gray-300 hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50",title:"Refresh analytics",children:l.jsx("svg",{className:`w-4 h-4 ${u?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Total Events",value:h.totalEvents.toLocaleString(),subtitle:`${h.successRate}% success rate`,color:"indigo",tooltip:`${h.totalEvents} events tracked from analytics JSONL`}),l.jsx(ne,{title:"Commands",value:z.toLocaleString(),subtitle:`${h.topCommands?.length||0} unique`,color:"cyan",tooltip:`${z} total command invocations across ${h.topCommands?.length||0} distinct commands`}),l.jsx(ne,{title:"Skills",value:R.toLocaleString(),subtitle:`${h.topSkills?.length||0} unique`,color:"emerald",tooltip:`${R} total skill activations across ${h.topSkills?.length||0} distinct skills`}),l.jsx(ne,{title:"Agents",value:b.toLocaleString(),subtitle:`${h.topAgents?.length||0} unique`,color:"amber",tooltip:`${b} agent spawns across ${h.topAgents?.length||0} distinct agent types`})]}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{key:"skills",label:"Skills"},{key:"commands",label:"Commands"},{key:"agents",label:"Agents"},{key:"daily",label:"Daily Trends"}].map(C=>l.jsx("button",{onClick:()=>o(C.key),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===C.key?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:C.label},C.key))}),r==="commands"&&l.jsx(Cy,{commands:h.topCommands||[]}),r==="skills"&&l.jsx(wy,{skills:y||[]}),r==="agents"&&l.jsx(Ty,{agents:h.topAgents||[]}),r==="daily"&&l.jsx(Ay,{days:h.dailySummaries||[]})]})}function Cy({commands:r}){if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No command data available"})});const o=[...r].sort((c,d)=>d.count-c.count),u=o[0]?.count||1;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Commands"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Command"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),l.jsx("tbody",{children:o.map((c,d)=>{const x=Math.max(2,c.count/u*100);return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",d+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300 font-mono",children:c.name})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-indigo-500/60 transition-all",style:{width:`${x}%`}})})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function wy({skills:r}){const o=[...r].sort((u,c)=>c.count-u.count);return o.length===0?l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No skill usage data available"})}):l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Skill Usage Leaderboard"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Skill Name"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Plugin"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Invocations"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Success Rate"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Last Used"})]})}),l.jsx("tbody",{children:o.map((u,c)=>{const d=u.count>0?Math.round(u.successCount/u.count*100):100,x=d>=90?"success":d>=70?"warning":"error";return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",c+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300 font-mono",children:u.name})}),l.jsx("td",{className:"px-4 py-2.5",children:u.plugin&&l.jsx("span",{className:"text-[10px] text-gray-600 bg-gray-800 px-1.5 py-0.5 rounded",children:u.plugin})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:u.count.toLocaleString()}),l.jsx("td",{className:"px-4 py-2.5 text-right",children:l.jsx(ie,{label:`${d}%`,variant:x})}),l.jsx("td",{className:"px-4 py-2.5 text-xs text-gray-600 text-right whitespace-nowrap",children:u.lastUsed?Ry(u.lastUsed):"-"})]},u.name)})})]})]})}function Ty({agents:r}){if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No agent data available"})});const o=[...r].sort((c,d)=>d.count-c.count),u=o[0]?.count||1;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Agents"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Agent"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),l.jsx("tbody",{children:o.map((c,d)=>{const x=Math.max(2,c.count/u*100);return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",d+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300",children:c.name})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-cyan-500/60 transition-all",style:{width:`${x}%`}})})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function Ay({days:r}){const o=r.slice(-14);if(o.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No daily data available"})});const u=Math.max(...o.map(x=>x.totalEvents),1),c=o.reduce((x,h)=>x+h.totalEvents,0),d=Math.round(c/o.length);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsx(ne,{title:"Period Total",value:c.toLocaleString(),subtitle:`Last ${o.length} days`,color:"indigo"}),l.jsx(ne,{title:"Daily Average",value:d.toLocaleString(),color:"cyan"}),l.jsx(ne,{title:"Peak Day",value:u.toLocaleString(),subtitle:o.find(x=>x.totalEvents===u)?.date||"",color:"emerald"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:["Daily Events (Last ",o.length," Days)"]}),l.jsx("div",{className:"flex items-end gap-1.5 h-40",children:o.map(x=>{const h=Math.max(2,x.totalEvents/u*100),N=x.date.slice(5);return l.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1",children:[l.jsx("span",{className:"text-[9px] text-gray-500",children:x.totalEvents}),l.jsx("div",{className:"w-full bg-indigo-500/40 rounded-t hover:bg-indigo-500/60 transition-colors cursor-default",style:{height:`${h}%`},title:`${x.date}: ${x.totalEvents} events`}),l.jsx("span",{className:"text-[8px] text-gray-700",children:N})]},x.date)})})]})]})}function Ry(r){if(!r)return"";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function zx({items:r,maxBars:o=10}){const u=[...r].sort((d,x)=>x.value-d.value).slice(0,o),c=Math.max(...u.map(d=>d.value),1);return l.jsx("div",{className:"space-y-2",children:u.map((d,x)=>l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-xs text-gray-400 w-28 truncate text-right",title:d.label,children:d.label}),l.jsx("div",{className:"flex-1 h-5 bg-gray-800 rounded overflow-hidden",children:l.jsx("div",{className:"h-full rounded transition-all duration-500",style:{width:`${d.value/c*100}%`,backgroundColor:d.color||"#6366f1"}})}),l.jsx("span",{className:"text-xs text-gray-500 w-10 text-right",children:d.value})]},x))})}const My={anthropic:"#6366f1",openai:"#10b981",google:"#f59e0b",mistral:"#ef4444",groq:"#8b5cf6",together:"#06b6d4","aws-bedrock":"#f97316","azure-openai":"#3b82f6"};function _y({data:r,showProviderLines:o=!1,height:u=200}){if(!r||r.length===0)return l.jsx("div",{className:"flex items-center justify-center h-40 text-gray-500 text-sm",children:"No spend data available"});const c={top:20,right:20,bottom:30,left:50},d=600,x=d-c.left-c.right,h=u-c.top-c.bottom,N=Math.max(...r.map(R=>R.total_cost),.01),p=R=>c.left+R/Math.max(r.length-1,1)*x,m=R=>c.top+h-R/N*h,v=r.map((R,b)=>`${b===0?"M":"L"} ${p(b).toFixed(1)} ${m(R.total_cost).toFixed(1)}`).join(" "),y=[];if(o){const R=new Set;r.forEach(b=>Object.keys(b.providers).forEach(C=>R.add(C)));for(const b of R){const C=r.map((T,U)=>{const J=T.providers[b]?.cost??0;return`${U===0?"M":"L"} ${p(U).toFixed(1)} ${m(J).toFixed(1)}`}).join(" ");y.push({provider:b,path:C,color:My[b]||"#9ca3af"})}}const w=[0,N/2,N].map(R=>({value:R,y:m(R),label:`$${R<1?R.toFixed(2):R.toFixed(0)}`})),_=Math.min(r.length,5),z=Array.from({length:_},(R,b)=>{const C=Math.round(b/Math.max(_-1,1)*(r.length-1));return{x:p(C),label:r[C].date.slice(5)}});return l.jsxs("div",{className:"w-full",children:[l.jsxs("svg",{viewBox:`0 0 ${d} ${u}`,className:"w-full",preserveAspectRatio:"xMidYMid meet",children:[w.map((R,b)=>l.jsx("line",{x1:c.left,y1:R.y,x2:d-c.right,y2:R.y,stroke:"#374151",strokeDasharray:"4 4"},b)),w.map((R,b)=>l.jsx("text",{x:c.left-8,y:R.y+4,textAnchor:"end",fill:"#9ca3af",fontSize:"10",children:R.label},`y-${b}`)),z.map((R,b)=>l.jsx("text",{x:R.x,y:u-5,textAnchor:"middle",fill:"#9ca3af",fontSize:"10",children:R.label},`x-${b}`)),y.map(R=>l.jsx("path",{d:R.path,fill:"none",stroke:R.color,strokeWidth:"1.5",strokeOpacity:"0.5"},R.provider)),l.jsx("path",{d:v,fill:"none",stroke:"#6366f1",strokeWidth:"2.5"}),r.map((R,b)=>l.jsx("circle",{cx:p(b),cy:m(R.total_cost),r:"3",fill:"#6366f1",className:"hover:r-5 transition-all",children:l.jsx("title",{children:`${R.date}: $${R.total_cost.toFixed(4)}`})},b))]}),o&&y.length>0&&l.jsx("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-gray-400",children:y.map(R=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-3 h-0.5",style:{backgroundColor:R.color}}),l.jsx("span",{children:R.provider})]},R.provider))})]})}const zy={anthropic:"bg-indigo-500/20 text-indigo-400",openai:"bg-emerald-500/20 text-emerald-400",google:"bg-amber-500/20 text-amber-400",mistral:"bg-red-500/20 text-red-400",groq:"bg-violet-500/20 text-violet-400",together:"bg-cyan-500/20 text-cyan-400","aws-bedrock":"bg-orange-500/20 text-orange-400","azure-openai":"bg-blue-500/20 text-blue-400"};function J0(r){return r<.01?`$${r.toFixed(4)}`:`$${r.toFixed(2)}`}function W0(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:String(r)}function Dy({data:r}){const[o,u]=j.useState(null);if(!r||Object.keys(r).length===0)return l.jsx("div",{className:"text-sm text-gray-500 py-4 text-center",children:"No multi-provider spend data"});const c=Object.entries(r).sort((d,x)=>x[1].total_cost-d[1].total_cost);return l.jsx("div",{className:"space-y-2",children:c.map(([d,x])=>l.jsxs("div",{children:[l.jsxs("button",{className:"w-full flex items-center justify-between p-2 rounded hover:bg-gray-800/50 transition-colors",onClick:()=>u(o===d?null:d),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${zy[d]||"bg-gray-500/20 text-gray-400"}`,children:d}),l.jsxs("span",{className:"text-xs text-gray-500",children:[x.sessions," sessions"]})]}),l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsxs("span",{className:"text-gray-400",children:[W0(x.total_tokens)," tokens"]}),l.jsx("span",{className:"text-white font-medium",children:J0(x.total_cost)}),l.jsx("span",{className:"text-gray-600",children:o===d?"▲":"▼"})]})]}),o===d&&l.jsx("div",{className:"ml-6 mt-1 space-y-1",children:Object.entries(x.models).sort((h,N)=>N[1].cost-h[1].cost).map(([h,N])=>l.jsxs("div",{className:"flex items-center justify-between py-1 px-2 text-xs text-gray-400",children:[l.jsx("span",{className:"truncate max-w-48",children:h}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{children:W0(N.tokens)}),l.jsx("span",{className:"text-gray-300",children:J0(N.cost)})]})]},h))})]},d))})}function Oy({currentSpend:r,monthlyLimit:o}){if(!o)return null;const u=r/o*100,c=Math.min(u,100);let d="bg-emerald-500",x="";return u>=100?(d="bg-red-500",x="animate-pulse ring-1 ring-red-500/50"):u>=80&&(d="bg-amber-500"),l.jsxs("div",{className:`rounded-lg p-3 bg-gray-800/50 ${x}`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Monthly Budget"}),l.jsxs("span",{className:"text-sm font-medium text-gray-200",children:["$",r.toFixed(2)," / $",o.toFixed(2)]})]}),l.jsx("div",{className:"h-2 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${d}`,style:{width:`${c}%`}})}),l.jsx("div",{className:"mt-1 text-right",children:l.jsxs("span",{className:"text-xs text-gray-500",children:[u.toFixed(1),"%"]})})]})}function Uy(){const[r,o]=j.useState("overview"),[u,c]=j.useState(null),[d,x]=j.useState(0);Ue("cost-update",()=>x(T=>T+1));const{data:h,loading:N,error:p,refetch:m}=Te(`/api/costs/summary?_r=${d}`);if(N)return l.jsx(Ie,{});if(p)return l.jsx(Gt,{message:p,onRetry:m});if(!h)return null;const v=h.sessions||[],y=h.billingContext?.planType==="subscription",w=h.modelBreakdown?Object.entries(h.modelBreakdown).map(([T,U])=>({model:T,...U})).sort((T,U)=>U.cost-T.cost):Hy(v),_=v.reduce((T,U)=>T+(U.inputTokens||0),0),z=v.reduce((T,U)=>T+(U.outputTokens||0),0),R=v.reduce((T,U)=>T+(U.cacheReadTokens||0),0),b=v.reduce((T,U)=>T+(U.cacheWriteTokens||0),0),C=_+z+R+b;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("svg",{className:"w-5 h-5 text-amber-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),l.jsx("path",{d:"M2 17l10 5 10-5"}),l.jsx("path",{d:"M2 12l10 5 10-5"})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Claude Code Usage"}),l.jsx("span",{className:"text-xs text-gray-500",children:y&&h.billingContext?.monthlyAmount?`$${h.billingContext.monthlyAmount}/mo plan`:"API-equivalent usage analytics"})]})]})}),y&&l.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[l.jsx(ie,{label:"Subscription",variant:"info"}),l.jsxs("span",{className:"text-xs text-gray-300",children:[h.billingContext?.monthlyAmount?`$${h.billingContext.monthlyAmount}/mo plan. `:"","Costs shown as API-equivalent value for usage analytics."]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:y?"API-Equivalent Value":"Total Cost",value:`$${h.totalCost.toFixed(2)}`,subtitle:y&&h.billingContext?.monthlyAmount?`Your plan: $${h.billingContext.monthlyAmount}/mo`:void 0,color:"amber"}),l.jsx(ne,{title:y?"Cache Efficiency":"Cache Savings",value:`$${h.totalSavings.toFixed(2)}`,subtitle:y?"API-equivalent savings from cache":void 0,color:"emerald"}),l.jsx(ne,{title:"Total Tokens",value:Zl(h.totalTokens),subtitle:By(h.totalTokens),color:"indigo"}),l.jsx(ne,{title:"Sessions",value:h.sessionCount.toLocaleString(),color:"cyan"})]}),h.budget&&h.budget.monthlyLimit>0&&l.jsx(Oy,{currentSpend:h.budget.currentSpend,monthlyLimit:h.budget.monthlyLimit}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["overview","trends","providers","sessions"].map(T=>{const U={overview:"Breakdown",trends:"Trends",providers:"Providers",sessions:`Sessions (${v.length})`};return l.jsx("button",{onClick:()=>o(T),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===T?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:U[T]},T)})}),r==="overview"&&l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:y?"Usage Value by Model":"Cost by Model"}),w.length>0?l.jsx(zx,{items:w.map(T=>({label:T.model,value:parseFloat(T.cost.toFixed(2)),color:"#f59e0b"}))}):l.jsx("p",{className:"text-gray-600 text-xs",children:"No model data"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Token Breakdown"}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(Nr,{label:"Input",value:_,total:C,color:"bg-indigo-500"}),l.jsx(Nr,{label:"Output",value:z,total:C,color:"bg-cyan-500"}),R>0&&l.jsx(Nr,{label:"Cache Read",value:R,total:C,color:"bg-emerald-500"}),b>0&&l.jsx(Nr,{label:"Cache Write",value:b,total:C,color:"bg-amber-500"})]})]}),w.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden lg:col-span-2",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Model Details"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tokens"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cost"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Avg/Session"})]})}),l.jsx("tbody",{children:w.map(T=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2 text-sm text-gray-300",children:T.model}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:T.sessions.toLocaleString()}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(T.tokens)}),l.jsxs("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:["$",T.cost.toFixed(2)]}),l.jsxs("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:["$",T.sessions>0?(T.cost/T.sessions).toFixed(4):"0"]})]},T.model))})]})]})]}),r==="trends"&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Daily Cost Trends"}),l.jsx(_y,{data:h.trends||[],showProviderLines:!0,height:250})]}),r==="providers"&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Provider Breakdown"}),l.jsx(Dy,{data:h.providerBreakdown})]}),r==="sessions"&&l.jsx(Ly,{sessions:v,expandedSession:u,onToggle:T=>c(u===T?null:T)}),l.jsx("div",{className:"text-center py-4 border-t border-gray-800/50",children:l.jsx("span",{className:"text-xs text-gray-600",children:"More providers coming soon"})})]})}const cu=37,F0=160,P0=5;function Ly({sessions:r,expandedSession:o,onToggle:u}){const c=j.useRef(null),[d,x]=j.useState(0),h=j.useCallback(()=>{c.current&&x(c.current.scrollTop)},[]),N=j.useMemo(()=>r.map(R=>(R.sessionId||"-")===o?F0:cu),[r,o]),p=j.useMemo(()=>{const R=[];let b=0;for(const C of N)R.push(b),b+=C;return R},[N]),m=p.length>0?p[p.length-1]+N[N.length-1]:0,v=Math.min(m,cu*20),y=j.useMemo(()=>{if(r.length===0)return{start:0,end:0};const R=d,b=d+v;let C=0,T=r.length-1;for(;C<T;){const V=C+T>>1;p[V]+N[V]<=R?C=V+1:T=V}const U=Math.max(0,C-P0);for(C=U,T=r.length-1;C<T;){const V=C+T+1>>1;p[V]>=b?T=V-1:C=V}const J=Math.min(r.length,C+P0+1);return{start:U,end:J}},[d,v,r.length,p,N]);if(j.useEffect(()=>{if(!o||!c.current)return;const R=r.findIndex(U=>(U.sessionId||"-")===o);if(R<0)return;const b=p[R],C=b+F0,T=c.current;C>T.scrollTop+v?T.scrollTop=C-v:b<T.scrollTop&&(T.scrollTop=b)},[o,r,p,v]),r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No session data available"})});const w=r.slice(y.start,y.end),_=y.start>0?p[y.start]:0,z=y.end<r.length?m-p[y.end]:0;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"}),l.jsxs("span",{className:"text-xs text-gray-500",children:[r.length," sessions"]})]}),l.jsx("table",{className:"w-full table-fixed",children:l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-8"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Input"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Output"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cache"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cost"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"When"})]})})}),l.jsx("div",{ref:c,onScroll:h,className:"overflow-y-auto custom-scrollbar",style:{maxHeight:`${v}px`},children:l.jsxs("div",{style:{height:`${m}px`,position:"relative"},children:[_>0&&l.jsx("div",{style:{height:`${_}px`}}),l.jsx("table",{className:"w-full table-fixed",children:l.jsx("tbody",{children:w.map(R=>{const b=R.sessionId||"-",C=o===b,T=(R.cacheReadTokens||0)+(R.cacheWriteTokens||0);return l.jsxs(j.Fragment,{children:[l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",style:{height:`${cu}px`},onClick:()=>u(b),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 w-8",children:l.jsx("span",{className:`inline-block transition-transform ${C?"rotate-90":""}`,children:"▸"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:b.slice(0,8)}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(ie,{label:R.model||"unknown",variant:"default"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(R.inputTokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(R.outputTokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:T>0?Zl(T):"-"}),l.jsxs("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:["$",R.cost?.toFixed(4)||"0.0000"]}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:R.duration?I0(R.duration):"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:ky(R.timestamp)})]}),C&&l.jsx("tr",{className:"border-b border-gray-800/50",children:l.jsx("td",{colSpan:9,className:"px-6 py-3 bg-gray-800/20",children:l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Input Tokens"}),l.jsx("span",{className:"text-gray-300 font-mono",children:R.inputTokens.toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Output Tokens"}),l.jsx("span",{className:"text-gray-300 font-mono",children:R.outputTokens.toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Write"}),l.jsx("span",{className:"text-gray-300 font-mono",children:(R.cacheWriteTokens||0).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Read"}),l.jsx("span",{className:"text-gray-300 font-mono",children:(R.cacheReadTokens||0).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cost"}),l.jsxs("span",{className:"text-amber-400 font-mono",children:["$",R.cost?.toFixed(6)||"0"]})]}),R.savings!=null&&R.savings>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Savings"}),l.jsxs("span",{className:"text-emerald-400 font-mono",children:["$",R.savings.toFixed(6)]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Duration"}),l.jsx("span",{className:"text-gray-300",children:R.duration?I0(R.duration):"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Session ID"}),l.jsx("span",{className:"text-gray-400 font-mono text-[10px]",children:R.sessionId})]})]})})})]},b)})})}),z>0&&l.jsx("div",{style:{height:`${z}px`}})]})})]})}function Nr({label:r,value:o,total:u,color:c}){const d=u>0?o/u*100:0,x={"bg-indigo-500":"rgb(99 102 241 / 0.6)","bg-cyan-500":"rgb(6 182 212 / 0.6)","bg-emerald-500":"rgb(16 185 129 / 0.6)","bg-amber-500":"rgb(245 158 11 / 0.6)"};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-xs text-gray-500",children:[Zl(o)," (",d.toFixed(1),"%)"]})]}),l.jsx("div",{className:"h-2 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full",style:{width:`${d}%`,backgroundColor:x[c]||c}})})]})}function Hy(r){const o=new Map;for(const u of r){const c=u.model||"unknown",d=o.get(c)||{cost:0,tokens:0,sessions:0};d.cost+=u.cost||0,d.tokens+=(u.inputTokens||0)+(u.outputTokens||0),d.sessions++,o.set(c,d)}return Array.from(o.entries()).map(([u,c])=>({model:u,...c})).sort((u,c)=>c.cost-u.cost)}function Zl(r){return r?r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:String(r):"0"}function By(r){return r?r.toLocaleString():"0"}function I0(r){const o=Math.round(r);if(o<60)return`${o}s`;const u=Math.floor(o/60),c=o%60;return u<60?`${u}m ${c}s`:`${Math.floor(u/60)}h ${u%60}m`}function ky(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function _r(){const[r,o]=j.useState(!1),[u,c]=j.useState(null),[d,x]=j.useState(null),[h,N]=j.useState([]),[p,m]=j.useState("idle"),v=j.useRef(null),y=j.useRef(null);Ue("command-output",z=>{const R=z;y.current&&R.executionId===y.current&&R.line&&N(b=>[...b,R.line])}),Ue("command-complete",z=>{const R=z;if(y.current&&R.executionId===y.current){if(v.current&&(clearTimeout(v.current),v.current=null),o(!1),R.exitCode===0)m("success"),N(b=>[...b,"Command completed successfully."]);else{m("error");const b=`Command failed (exit code ${R.exitCode??"unknown"})`;x(b),N(C=>[...C,b])}y.current=null}}),j.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const w=j.useCallback(async(z,R)=>{const b=R?.queryParams,C=R?.timeoutMs??6e4;o(!0),x(null),N([`> specweave ${z}${b?` (${Object.values(b).join(", ")})`:""}`]),m("running");try{const T=b?"?"+new URLSearchParams(b).toString():"",J=await(await fetch(`/api/commands/${z}${T}`,{method:"POST"})).json();if(!J.ok)return x(J.error||"Command failed"),m("error"),N(ae=>[...ae,`Error: ${J.error||"Command failed"}`]),o(!1),null;c(J.data),y.current=J.data?.id||null;const V=Math.round(C/1e3);return v.current=setTimeout(()=>{y.current&&(y.current=null,o(!1),m("error"),x(`Command timed out after ${V} seconds`),N(ae=>[...ae,`Timed out after ${V} seconds.`]))},C),J.data}catch(T){return x(String(T)),m("error"),N(U=>[...U,`Error: ${String(T)}`]),o(!1),null}},[]),_=j.useCallback(()=>{o(!1),c(null),x(null),N([]),m("idle"),y.current=null,v.current&&(clearTimeout(v.current),v.current=null)},[]);return{execute:w,running:r,result:u,error:d,output:h,status:p,reset:_}}function $y(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function qy(r){switch(r){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return r||"Unknown"}}function Yy(){const[r,o]=j.useState("health"),[u,c]=j.useState(null),[d,x]=j.useState(0),[h,N]=j.useState([]);Ue("sync-update",()=>x(H=>H+1)),Ue("sync-error",()=>x(H=>H+1));const{data:p,loading:m,error:v,refetch:y}=Te(`/api/sync/status?_r=${d}`);j.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=20").then(H=>H.json()).then(H=>{H.ok&&Array.isArray(H.data)&&N(H.data)}).catch(()=>{})},[d]);const{data:w,loading:_}=Te(`/api/sync/audit?limit=100&_r=${d}`),{data:z,loading:R}=Te(`/api/sync/audit/summary?_r=${d}`),{execute:b,running:C}=_r(),T=async(H,W)=>{const I=W?`${W}-${H}`:H;c(I);try{const Ee=new URLSearchParams(window.location.search).get("project")||"",He=new URLSearchParams;He.set("platform",H),W&&He.set("repo",W),Ee&&He.set("project",Ee);const ze=new AbortController,je=setTimeout(()=>ze.abort(),3e4);await fetch(`/api/sync/verify?${He.toString()}`,{method:"POST",signal:ze.signal}),clearTimeout(je),y()}catch{}c(null)};if(m||_||R)return l.jsx(Ie,{});if(v)return l.jsx(Gt,{message:v,onRetry:y});if(!p)return null;const U=w?.length||0,J=w?.filter(H=>H.result==="error").length||0,V=w?.filter(H=>H.conflict)||[],ae=p.isUmbrella&&p.repos&&p.repos.length>0;let Z=0,K=0;if(ae&&p.repos)for(const H of p.repos){const W=Object.values(H.platforms).filter(I=>I.connectionStatus!=="not_configured");K+=W.length,Z+=W.filter(I=>I.connectionStatus==="connected").length}else{const H=Object.entries(p.platforms).filter(([W])=>["github","jira","ado"].includes(W));K=H.length,Z=H.filter(([,W])=>W.connectionStatus==="connected").length}return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Sync Health"}),!ae&&l.jsx("button",{onClick:()=>b("sync-push"),disabled:C,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:C?"Syncing...":"Sync Now"})]}),p.permissions&&l.jsx(Gy,{permissions:p.permissions,onSave:y}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:ae?"Repos":"Platforms",value:ae?p.repos.length:K,subtitle:`${Z} connected`,color:"indigo"}),l.jsx(ne,{title:"Audit Entries",value:U,color:"cyan"}),l.jsx(ne,{title:"Errors",value:J,color:"rose"}),l.jsx(ne,{title:"Conflicts",value:V.length,color:"amber"})]}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["health","audit","conflicts"].map(H=>l.jsx("button",{onClick:()=>o(H),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===H?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H==="health"?"Platform Health":H==="audit"?"Audit Log":`Conflicts (${V.length})`},H))}),r==="health"&&l.jsx(l.Fragment,{children:ae&&p.repos?l.jsx(Vy,{repos:p.repos,auditSummary:z,verifying:u,onVerify:T,execute:b,running:C}):l.jsx(Xy,{platforms:p.platforms,auditSummary:z,verifying:u,onVerify:T})}),r==="health"&&h.length>0&&l.jsx(Qy,{errors:h}),r==="audit"&&l.jsx(ex,{entries:w||[]}),r==="conflicts"&&l.jsx(ex,{entries:V}),p.lastUpdated&&l.jsxs("p",{className:"text-xs text-gray-600",children:["Last metadata update: ",new Date(p.lastUpdated).toLocaleString()]})]})}function Gy({permissions:r,onSave:o}){const[u,c]=j.useState(r),[d,x]=j.useState(!1),[h,N]=j.useState(null),p=JSON.stringify(u)!==JSON.stringify(r),m=async()=>{x(!0),N(null);try{const y=new URLSearchParams(window.location.search).get("project")||"",w=y?`?project=${y}`:"",_=await fetch(`/api/config${w}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({sync:{settings:u}})});if(_.ok)o();else{const z=await _.json().catch(()=>({}));N(z.error||`Save failed (HTTP ${_.status})`)}}catch(y){N(String(y))}x(!1)},v=[{key:"canUpsertInternalItems",label:"Create/Update Internal",desc:"Can create/update items created by SpecWeave"},{key:"canUpdateExternalItems",label:"Update External",desc:"Can modify items originally from external tools"},{key:"canUpdateStatus",label:"Update Status",desc:"Can close/reopen issues on external platforms"},{key:"autoSyncOnCompletion",label:"Auto-Sync",desc:"Automatically sync when tasks are completed"}];return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Sync Permissions"}),p&&l.jsx("button",{onClick:m,disabled:d,className:"px-2.5 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-[10px] rounded transition-colors",children:d?"Saving...":"Save"})]}),h&&l.jsxs("p",{className:"text-xs text-red-400 mb-2",children:["Failed to save: ",h]}),l.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:v.map(({key:y,label:w,desc:_})=>l.jsxs("button",{onClick:()=>c(z=>({...z,[y]:!z[y]})),className:`text-left p-2.5 rounded-lg border transition-colors ${u[y]?"bg-emerald-500/10 border-emerald-500/30 hover:border-emerald-500/50":"bg-gray-800/30 border-gray-800 hover:border-gray-700"}`,children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${u[y]?"bg-emerald-400":"bg-gray-600"}`}),l.jsx("span",{className:"text-xs font-medium text-gray-300",children:w})]}),l.jsx("p",{className:"text-[10px] text-gray-500 leading-tight",children:_})]},y))})]})}function Vy({repos:r,auditSummary:o,verifying:u,onVerify:c,execute:d,running:x}){return r.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No child repositories configured"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Add repos in umbrella.childRepos in config.json"})]}):l.jsx("div",{className:"space-y-4",children:r.map(h=>{const p=Object.entries(h.platforms).filter(([m])=>["github","jira","ado"].includes(m)).filter(([,m])=>m.connectionStatus!=="not_configured");return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-gray-200",children:h.repoName}),h.hasSpecweave&&l.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-emerald-500/15 text-emerald-400 rounded",children:".specweave"}),!h.hasSpecweave&&l.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-gray-700/50 text-gray-500 rounded",children:"no .specweave"})]}),l.jsx("span",{className:"text-[10px] text-gray-600",children:h.repoPath})]}),l.jsx("button",{onClick:()=>d("sync-push",{queryParams:{repo:h.repoId}}),disabled:x||!h.hasSpecweave,title:h.hasSpecweave?"Sync this repository":"Initialize .specweave in this repo to enable sync",className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-xs rounded-lg transition-colors",children:x?"Syncing...":"Sync Now"})]}),p.length===0?l.jsxs("div",{className:"text-xs text-gray-600 p-3 bg-gray-800/20 rounded-lg",children:["No platforms configured for this repository.",l.jsx(st,{to:"/config",className:"ml-1 text-indigo-400 hover:text-indigo-300",children:"Configure"})]}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:p.map(([m,v])=>l.jsx(Dx,{platform:m,info:v,summary:o?.[m],verifying:u===`${h.repoId}-${m}`,onVerify:()=>c(m,h.repoId)},m))})]},h.repoId)})})}function Xy({platforms:r,auditSummary:o,verifying:u,onVerify:c}){const d=Object.entries(r).filter(([x])=>["github","jira","ado"].includes(x));return d.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No sync platforms configured"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Configure GitHub, JIRA, or ADO in your config"})]}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(([x,h])=>l.jsx(Dx,{platform:x,info:h,summary:o?.[x],verifying:u===x,onVerify:()=>c(x)},x))})}function Dx({platform:r,info:o,summary:u,verifying:c,onVerify:d}){const x=o.connectionStatus||"unknown";return l.jsxs("div",{className:"bg-gray-800/30 border border-gray-800/50 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Ox,{platform:r}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-gray-300 capitalize",children:r}),o.configDetail&&l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:o.configDetail})]})]}),l.jsx(ie,{label:qy(x),variant:$y(x)})]}),o.diagnosticMessage&&l.jsx("div",{className:"text-xs text-gray-500 mb-3 p-2 bg-gray-800/30 rounded-lg",children:o.diagnosticMessage}),x==="not_configured"&&l.jsx(st,{to:"/config",className:"block text-center text-xs text-indigo-400 hover:text-indigo-300 py-2 border border-gray-800 rounded-lg hover:border-indigo-500/30 transition-colors",children:"Configure in Settings"}),x==="configured_never_synced"&&l.jsx("button",{onClick:d,disabled:c,className:"w-full text-xs text-indigo-400 hover:text-indigo-300 py-2 border border-gray-800 rounded-lg hover:border-indigo-500/30 transition-colors disabled:opacity-50",children:c?"Verifying...":"Verify Connection"}),x==="sync_failed"&&l.jsx("button",{onClick:d,disabled:c,className:"w-full text-xs text-amber-400 hover:text-amber-300 py-2 border border-amber-500/20 rounded-lg hover:border-amber-500/40 transition-colors disabled:opacity-50",children:c?"Verifying...":"Retry Sync"}),l.jsxs("div",{className:"space-y-2 mt-3",children:[o.lastImport&&l.jsx(Xl,{label:"Last Import",value:new Date(o.lastImport).toLocaleString()}),x==="connected"&&!o.lastImport&&l.jsx(Xl,{label:"Status",value:"Connected, no imports yet"}),o.lastImportCount!=null&&o.lastImportCount>0&&l.jsx(Xl,{label:"Items Imported",value:o.lastImportCount.toLocaleString()}),o.lastSkippedCount!=null&&o.lastSkippedCount>0&&l.jsx(Xl,{label:"Skipped",value:o.lastSkippedCount.toLocaleString()}),u&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-gray-800 my-2"}),l.jsx(Xl,{label:"Total Ops",value:u.total.toLocaleString()}),l.jsx(Xl,{label:"Success",value:u.success.toLocaleString()}),u.errors>0&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:"Errors"}),l.jsx(ie,{label:String(u.errors),variant:"error"})]})]})]})]})}function Qy({errors:r}){const[o,u]=j.useState(null);return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Errors (last 24h)"}),l.jsx("div",{className:"space-y-2",children:r.map((c,d)=>{const x=`${c.provider}-${c.incrementId}-${d}`,h=o===x;return l.jsxs("div",{children:[l.jsxs("button",{"data-testid":`sync-error-row-${d}`,onClick:()=>u(h?null:x),className:"w-full flex items-start gap-2 p-3 bg-gray-800/50 rounded-lg hover:bg-gray-800/80 transition-colors text-left",children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full mt-1.5 bg-rose-400 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-300 capitalize",children:c.provider}),l.jsx(ie,{label:c.incrementId,variant:"default"}),l.jsx(ie,{label:c.outcome,variant:"error"})]}),l.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:c.error}),l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:Ux(c.timestamp)})]}),l.jsx("span",{className:"text-[10px] text-gray-600 mt-1",children:h?"▲":"▼"})]}),h&&l.jsxs("div",{"data-testid":`sync-error-detail-${d}`,className:"mt-1 p-3 bg-gray-800/30 rounded-lg border border-gray-800/50",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-2 font-medium",children:"Full Error"}),l.jsx("pre",{className:"text-xs text-gray-500 whitespace-pre-wrap font-mono mb-2",children:c.error}),c.errorStack&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1 font-medium",children:"Stack Trace"}),l.jsx("pre",{className:"text-xs text-gray-600 whitespace-pre-wrap font-mono max-h-32 overflow-y-auto",children:c.errorStack.split(`
|
|
11
|
+
Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let v=Yt(),y;if(o){let b=typeof o=="string"?Jl(o):o;Be(p==="/"||b.pathname?.startsWith(p),`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 "${p}" but pathname "${b.pathname}" was given in the \`location\` prop.`),y=b}else y=v;let E=y.pathname||"/",M=E;if(p!=="/"){let b=p.replace(/^\//,"").split("/");M="/"+E.replace(/^\//,"").split("/").slice(b.length).join("/")}let z=u&&u.state.matches.length?u.state.matches.map(b=>Object.assign(b,{route:u.manifest[b.route.id]||b.route})):dx(r,{pathname:M});qt(m||z!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),qt(z==null||z[z.length-1].route.element!==void 0||z[z.length-1].route.Component!==void 0||z[z.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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 R=xp(z&&z.map(b=>Object.assign({},b,{params:Object.assign({},h,b.params),pathname:$t([p,c.encodeLocation?c.encodeLocation(b.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?p:$t([p,c.encodeLocation?c.encodeLocation(b.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),d,u);return o&&R?j.createElement(In.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},R):R}function up(){let r=yp(),o=Zg(r)?`${r.status} ${r.statusText}`:r instanceof Error?r.message:JSON.stringify(r),u=r instanceof Error?r.stack:null,c="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:c},x={padding:"2px 4px",backgroundColor:c},h=null;return console.error("Error handled by React Router default ErrorBoundary:",r),h=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:x},"ErrorBoundary")," or"," ",j.createElement("code",{style:x},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},o),u?j.createElement("pre",{style:d},u):null,h)}var op=j.createElement(up,null),Tx=class extends j.Component{constructor(r){super(r),this.state={location:r.location,revalidation:r.revalidation,error:r.error}}static getDerivedStateFromError(r){return{error:r}}static getDerivedStateFromProps(r,o){return o.location!==r.location||o.revalidation!=="idle"&&r.revalidation==="idle"?{error:r.error,location:r.location,revalidation:r.revalidation}:{error:r.error!==void 0?r.error:o.error,location:o.location,revalidation:r.revalidation||o.revalidation}}componentDidCatch(r,o){this.props.onError?this.props.onError(r,o):console.error("React Router caught the following error during render",r)}render(){let r=this.state.error;if(this.context&&typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){const u=np(r.digest);u&&(r=u)}let o=r!==void 0?j.createElement(Kt.Provider,{value:this.props.routeContext},j.createElement(pu.Provider,{value:r,children:this.props.component})):this.props.children;return this.context?j.createElement(dp,{error:r},o):o}};Tx.contextType=jx;var nu=new WeakMap;function dp({children:r,error:o}){let{basename:u}=j.useContext(Lt);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let c=lp(o.digest);if(c){let d=nu.get(o);if(d)throw d;let x=vx(c.location,u),h=x.absoluteURL||x.to;if(Fg(h))throw new Error("Invalid redirect location");if(yx&&!nu.get(o))if(x.isExternal||c.reloadDocument)window.location.href=h;else{const N=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:c.replace}));throw nu.set(o,N),N}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return r}function fp({routeContext:r,match:o,children:u}){let c=j.useContext(Wl);return c&&c.static&&c.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=o.route.id),j.createElement(Kt.Provider,{value:r},u)}function xp(r,o=[],u){let c=u?.state;if(r==null){if(!c)return null;if(c.errors)r=c.matches;else if(o.length===0&&!c.initialized&&c.matches.length>0)r=c.matches;else return null}let d=r,x=c?.errors;if(x!=null){let v=d.findIndex(y=>y.route.id&&x?.[y.route.id]!==void 0);Be(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(x).join(",")}`),d=d.slice(0,Math.min(d.length,v+1))}let h=!1,N=-1;if(u&&c){h=c.renderFallback;for(let v=0;v<d.length;v++){let y=d[v];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(N=v),y.route.id){let{loaderData:E,errors:M}=c,z=y.route.loader&&!E.hasOwnProperty(y.route.id)&&(!M||M[y.route.id]===void 0);if(y.route.lazy||z){u.isStatic&&(h=!0),N>=0?d=d.slice(0,N+1):d=[d[0]];break}}}}let p=u?.onError,m=c&&p?(v,y)=>{p(v,{location:c.location,params:c.matches?.[0]?.params??{},pattern:Kg(c.matches),errorInfo:y})}:void 0;return d.reduceRight((v,y,E)=>{let M,z=!1,R=null,b=null;c&&(M=x&&y.route.id?x[y.route.id]:void 0,R=y.route.errorElement||op,h&&(N<0&&E===0?(Ax("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),z=!0,b=null):N===E&&(z=!0,b=y.route.hydrateFallbackElement||null)));let w=o.concat(d.slice(0,E+1)),T=()=>{let U;return M?U=R:z?U=b:y.route.Component?U=j.createElement(y.route.Component,null):y.route.element?U=y.route.element:U=v,j.createElement(fp,{match:y,routeContext:{outlet:v,matches:w,isDataRoute:c!=null},children:U})};return c&&(y.route.ErrorBoundary||y.route.errorElement||E===0)?j.createElement(Tx,{location:c.location,revalidation:c.revalidation,component:R,error:M,children:T(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:m}):T()},null)}function vu(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mp(r){let o=j.useContext(Wl);return Be(o,vu(r)),o}function hp(r){let o=j.useContext(Tr);return Be(o,vu(r)),o}function gp(r){let o=j.useContext(Kt);return Be(o,vu(r)),o}function bu(r){let o=gp(r),u=o.matches[o.matches.length-1];return Be(u.route.id,`${r} can only be used on routes that contain a unique "id"`),u.route.id}function pp(){return bu("useRouteId")}function yp(){let r=j.useContext(pu),o=hp("useRouteError"),u=bu("useRouteError");return r!==void 0?r:o.errors?.[u]}function vp(){let{router:r}=mp("useNavigate"),o=bu("useNavigate"),u=j.useRef(!1);return Cx(()=>{u.current=!0}),j.useCallback(async(d,x={})=>{qt(u.current,Ex),u.current&&(typeof d=="number"?await r.navigate(d):await r.navigate(d,{fromRouteId:o,...x}))},[r,o])}var X0={};function Ax(r,o,u){!o&&!X0[r]&&(X0[r]=!0,qt(!1,u))}j.memo(bp);function bp({routes:r,manifest:o,future:u,state:c,isStatic:d,onError:x}){return wx(r,void 0,{manifest:o,state:c,isStatic:d,onError:x})}function We(r){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 jp({basename:r="/",children:o=null,location:u,navigationType:c="POP",navigator:d,static:x=!1,useTransitions:h}){Be(!es(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let N=r.replace(/^\/*/,"/"),p=j.useMemo(()=>({basename:N,navigator:d,static:x,useTransitions:h,future:{}}),[N,d,x,h]);typeof u=="string"&&(u=Jl(u));let{pathname:m="/",search:v="",hash:y="",state:E=null,key:M="default",mask:z}=u,R=j.useMemo(()=>{let b=ma(m,N);return b==null?null:{location:{pathname:b,search:v,hash:y,state:E,key:M,mask:z},navigationType:c}},[N,m,v,y,E,M,c,z]);return qt(R!=null,`<Router basename="${N}"> is not able to match the URL "${m}${v}${y}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:j.createElement(Lt.Provider,{value:p},j.createElement(In.Provider,{children:o,value:R}))}function Np({children:r,location:o}){return cp(fu(r),o)}function fu(r,o=[]){let u=[];return j.Children.forEach(r,(c,d)=>{if(!j.isValidElement(c))return;let x=[...o,d];if(c.type===j.Fragment){u.push.apply(u,fu(c.props.children,x));return}Be(c.type===We,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Be(!c.props.index||!c.props.children,"An index route cannot have child routes.");let h={id:c.props.id||x.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(h.children=fu(c.props.children,x)),u.push(h)}),u}var Sr="get",Er="application/x-www-form-urlencoded";function Ar(r){return typeof HTMLElement<"u"&&r instanceof HTMLElement}function Sp(r){return Ar(r)&&r.tagName.toLowerCase()==="button"}function Ep(r){return Ar(r)&&r.tagName.toLowerCase()==="form"}function Cp(r){return Ar(r)&&r.tagName.toLowerCase()==="input"}function wp(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function Tp(r,o){return r.button===0&&(!o||o==="_self")&&!wp(r)}function xu(r=""){return new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((o,u)=>{let c=r[u];return o.concat(Array.isArray(c)?c.map(d=>[u,d]):[[u,c]])},[]))}function Ap(r,o){let u=xu(r);return o&&o.forEach((c,d)=>{u.has(d)||o.getAll(d).forEach(x=>{u.append(d,x)})}),u}var jr=null;function Rp(){if(jr===null)try{new FormData(document.createElement("form"),0),jr=!1}catch{jr=!0}return jr}var Mp=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function su(r){return r!=null&&!Mp.has(r)?(qt(!1,`"${r}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Er}"`),null):r}function _p(r,o){let u,c,d,x,h;if(Ep(r)){let N=r.getAttribute("action");c=N?ma(N,o):null,u=r.getAttribute("method")||Sr,d=su(r.getAttribute("enctype"))||Er,x=new FormData(r)}else if(Sp(r)||Cp(r)&&(r.type==="submit"||r.type==="image")){let N=r.form;if(N==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=r.getAttribute("formaction")||N.getAttribute("action");if(c=p?ma(p,o):null,u=r.getAttribute("formmethod")||N.getAttribute("method")||Sr,d=su(r.getAttribute("formenctype"))||su(N.getAttribute("enctype"))||Er,x=new FormData(N,r),!Rp()){let{name:m,type:v,value:y}=r;if(v==="image"){let E=m?`${m}.`:"";x.append(`${E}x`,"0"),x.append(`${E}y`,"0")}else m&&x.append(m,y)}}else{if(Ar(r))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');u=Sr,c=null,d=Er,h=r}return x&&d==="text/plain"&&(h=x,x=void 0),{action:c,method:u.toLowerCase(),encType:d,formData:x,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ju(r,o){if(r===!1||r===null||typeof r>"u")throw new Error(o)}function Rx(r,o,u,c){let d=typeof r=="string"?new URL(r,typeof window>"u"?"server://singlefetch/":window.location.origin):r;return u?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${c}`:d.pathname=`${d.pathname}.${c}`:d.pathname==="/"?d.pathname=`_root.${c}`:o&&ma(d.pathname,o)==="/"?d.pathname=`${wr(o)}/_root.${c}`:d.pathname=`${wr(d.pathname)}.${c}`,d}async function zp(r,o){if(r.id in o)return o[r.id];try{let u=await import(r.module);return o[r.id]=u,u}catch(u){return console.error(`Error loading route module \`${r.module}\`, reloading page...`),console.error(u),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Dp(r){return r==null?!1:r.href==null?r.rel==="preload"&&typeof r.imageSrcSet=="string"&&typeof r.imageSizes=="string":typeof r.rel=="string"&&typeof r.href=="string"}async function Op(r,o,u){let c=await Promise.all(r.map(async d=>{let x=o.routes[d.route.id];if(x){let h=await zp(x,u);return h.links?h.links():[]}return[]}));return Bp(c.flat(1).filter(Dp).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function Q0(r,o,u,c,d,x){let h=(p,m)=>u[m]?p.route.id!==u[m].route.id:!0,N=(p,m)=>u[m].pathname!==p.pathname||u[m].route.path?.endsWith("*")&&u[m].params["*"]!==p.params["*"];return x==="assets"?o.filter((p,m)=>h(p,m)||N(p,m)):x==="data"?o.filter((p,m)=>{let v=c.routes[p.route.id];if(!v||!v.hasLoader)return!1;if(h(p,m)||N(p,m))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:u[0]?.params||{},nextUrl:new URL(r,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function Up(r,o,{includeHydrateFallback:u}={}){return Lp(r.map(c=>{let d=o.routes[c.route.id];if(!d)return[];let x=[d.module];return d.clientActionModule&&(x=x.concat(d.clientActionModule)),d.clientLoaderModule&&(x=x.concat(d.clientLoaderModule)),u&&d.hydrateFallbackModule&&(x=x.concat(d.hydrateFallbackModule)),d.imports&&(x=x.concat(d.imports)),x}).flat(1))}function Lp(r){return[...new Set(r)]}function Hp(r){let o={},u=Object.keys(r).sort();for(let c of u)o[c]=r[c];return o}function Bp(r,o){let u=new Set;return new Set(o),r.reduce((c,d)=>{let x=JSON.stringify(Hp(d));return u.has(x)||(u.add(x),c.push({key:x,link:d})),c},[])}function Nu(){let r=j.useContext(Wl);return ju(r,"You must render this element inside a <DataRouterContext.Provider> element"),r}function kp(){let r=j.useContext(Tr);return ju(r,"You must render this element inside a <DataRouterStateContext.Provider> element"),r}var Su=j.createContext(void 0);Su.displayName="FrameworkContext";function Rr(){let r=j.useContext(Su);return ju(r,"You must render this element inside a <HydratedRouter> element"),r}function $p(r,o){let u=j.useContext(Su),[c,d]=j.useState(!1),[x,h]=j.useState(!1),{onFocus:N,onBlur:p,onMouseEnter:m,onMouseLeave:v,onTouchStart:y}=o,E=j.useRef(null);j.useEffect(()=>{if(r==="render"&&h(!0),r==="viewport"){let R=w=>{w.forEach(T=>{h(T.isIntersecting)})},b=new IntersectionObserver(R,{threshold:.5});return E.current&&b.observe(E.current),()=>{b.disconnect()}}},[r]),j.useEffect(()=>{if(c){let R=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(R)}}},[c]);let M=()=>{d(!0)},z=()=>{d(!1),h(!1)};return u?r!=="intent"?[x,E,{}]:[x,E,{onFocus:Zn(N,M),onBlur:Zn(p,z),onMouseEnter:Zn(m,M),onMouseLeave:Zn(v,z),onTouchStart:Zn(y,M)}]:[!1,E,{}]}function Zn(r,o){return u=>{r&&r(u),u.defaultPrevented||o(u)}}function qp({page:r,...o}){let u=Pg(),{nonce:c}=Rr(),{router:d}=Nu(),x=j.useMemo(()=>dx(d.routes,r,d.basename),[d.routes,r,d.basename]);return x?(o.nonce==null&&c&&(o={...o,nonce:c}),u?j.createElement(Gp,{page:r,matches:x,...o}):j.createElement(Vp,{page:r,matches:x,...o})):null}function Yp(r){let{manifest:o,routeModules:u}=Rr(),[c,d]=j.useState([]);return j.useEffect(()=>{let x=!1;return Op(r,o,u).then(h=>{x||d(h)}),()=>{x=!0}},[r,o,u]),c}function Gp({page:r,matches:o,...u}){let c=Yt(),{future:d}=Rr(),{basename:x}=Nu(),h=j.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let N=Rx(r,x,d.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,m=[];for(let v of o)typeof v.route.shouldRevalidate=="function"?p=!0:m.push(v.route.id);return p&&m.length>0&&N.searchParams.set("_routes",m.join(",")),[N.pathname+N.search]},[x,d.v8_trailingSlashAwareDataRequests,r,c,o]);return j.createElement(j.Fragment,null,h.map(N=>j.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...u})))}function Vp({page:r,matches:o,...u}){let c=Yt(),{future:d,manifest:x,routeModules:h}=Rr(),{basename:N}=Nu(),{loaderData:p,matches:m}=kp(),v=j.useMemo(()=>Q0(r,o,m,x,c,"data"),[r,o,m,x,c]),y=j.useMemo(()=>Q0(r,o,m,x,c,"assets"),[r,o,m,x,c]),E=j.useMemo(()=>{if(r===c.pathname+c.search+c.hash)return[];let R=new Set,b=!1;if(o.forEach(T=>{let U=x.routes[T.route.id];!U||!U.hasLoader||(!v.some(J=>J.route.id===T.route.id)&&T.route.id in p&&h[T.route.id]?.shouldRevalidate||U.hasClientLoader?b=!0:R.add(T.route.id))}),R.size===0)return[];let w=Rx(r,N,d.v8_trailingSlashAwareDataRequests,"data");return b&&R.size>0&&w.searchParams.set("_routes",o.filter(T=>R.has(T.route.id)).map(T=>T.route.id).join(",")),[w.pathname+w.search]},[N,d.v8_trailingSlashAwareDataRequests,p,c,x,v,o,r,h]),M=j.useMemo(()=>Up(y,x),[y,x]),z=Yp(y);return j.createElement(j.Fragment,null,E.map(R=>j.createElement("link",{key:R,rel:"prefetch",as:"fetch",href:R,...u})),M.map(R=>j.createElement("link",{key:R,rel:"modulepreload",href:R,...u})),z.map(({key:R,link:b})=>j.createElement("link",{key:R,nonce:u.nonce,...b,crossOrigin:b.crossOrigin??u.crossOrigin})))}function Xp(...r){return o=>{r.forEach(u=>{typeof u=="function"?u(o):u!=null&&(u.current=o)})}}var Qp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qp&&(window.__reactRouterVersion="7.18.1")}catch{}function Zp({basename:r,children:o,useTransitions:u,window:c}){let d=j.useRef();d.current==null&&(d.current=Eg({window:c,v5Compat:!0}));let x=d.current,[h,N]=j.useState({action:x.action,location:x.location}),p=j.useCallback(m=>{u===!1?N(m):j.startTransition(()=>N(m))},[u]);return j.useLayoutEffect(()=>x.listen(p),[x,p]),j.createElement(jp,{basename:r,children:o,location:h.location,navigationType:h.action,navigator:x,useTransitions:u})}var st=j.forwardRef(function({onClick:o,discover:u="render",prefetch:c="none",relative:d,reloadDocument:x,replace:h,mask:N,state:p,target:m,to:v,preventScrollReset:y,viewTransition:E,defaultShouldRevalidate:M,...z},R){let{basename:b,navigator:w,useTransitions:T}=j.useContext(Lt),U=typeof v=="string"&&hu.test(v),J=vx(v,b);v=J.to;let V=sp(v,{relative:d}),ae=Yt(),Z=null;if(N){let je=gu(N,[],ae.mask?ae.mask.pathname:"/",!0);b!=="/"&&(je.pathname=je.pathname==="/"?b:$t([b,je.pathname])),Z=w.createHref(je)}let[K,H,W]=$p(c,z),I=Wp(v,{replace:h,mask:N,state:p,target:m,preventScrollReset:y,relative:d,viewTransition:E,defaultShouldRevalidate:M,useTransitions:T});function Ee(je){o&&o(je),je.defaultPrevented||I(je)}let He=!(J.isExternal||x),ze=j.createElement("a",{...z,...W,href:(He?Z:void 0)||J.absoluteURL||V,onClick:He?Ee:o,ref:Xp(R,H),target:m,"data-discover":!U&&u==="render"?"true":void 0});return K&&!U?j.createElement(j.Fragment,null,ze,j.createElement(qp,{page:V})):ze});st.displayName="Link";var Mx=j.forwardRef(function({"aria-current":o="page",caseSensitive:u=!1,className:c="",end:d=!1,style:x,to:h,viewTransition:N,children:p,...m},v){let y=ts(h,{relative:m.relative}),E=Yt(),M=j.useContext(Tr),{navigator:z,basename:R}=j.useContext(Lt),b=M!=null&&ty(y)&&N===!0,w=z.encodeLocation?z.encodeLocation(y).pathname:y.pathname,T=E.pathname,U=M&&M.navigation&&M.navigation.location?M.navigation.location.pathname:null;u||(T=T.toLowerCase(),U=U?U.toLowerCase():null,w=w.toLowerCase()),U&&R&&(U=ma(U,R)||U);const J=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let V=T===w||!d&&T.startsWith(w)&&T.charAt(J)==="/",ae=U!=null&&(U===w||!d&&U.startsWith(w)&&U.charAt(w.length)==="/"),Z={isActive:V,isPending:ae,isTransitioning:b},K=V?o:void 0,H;typeof c=="function"?H=c(Z):H=[c,V?"active":null,ae?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let W=typeof x=="function"?x(Z):x;return j.createElement(st,{...m,"aria-current":K,className:H,ref:v,style:W,to:h,viewTransition:N},typeof p=="function"?p(Z):p)});Mx.displayName="NavLink";var Kp=j.forwardRef(({discover:r="render",fetcherKey:o,navigate:u,reloadDocument:c,replace:d,state:x,method:h=Sr,action:N,onSubmit:p,relative:m,preventScrollReset:v,viewTransition:y,defaultShouldRevalidate:E,...M},z)=>{let{useTransitions:R}=j.useContext(Lt),b=Ip(),w=ey(N,{relative:m}),T=h.toLowerCase()==="get"?"get":"post",U=typeof N=="string"&&hu.test(N),J=V=>{if(p&&p(V),V.defaultPrevented)return;V.preventDefault();let ae=V.nativeEvent.submitter,Z=ae?.getAttribute("formmethod")||h,K=()=>b(ae||V.currentTarget,{fetcherKey:o,method:Z,navigate:u,replace:d,state:x,relative:m,preventScrollReset:v,viewTransition:y,defaultShouldRevalidate:E});R&&u!==!1?j.startTransition(()=>K()):K()};return j.createElement("form",{ref:z,method:T,action:w,onSubmit:c?p:J,...M,"data-discover":!U&&r==="render"?"true":void 0})});Kp.displayName="Form";function Jp(r){return`${r} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _x(r){let o=j.useContext(Wl);return Be(o,Jp(r)),o}function Wp(r,{target:o,replace:u,mask:c,state:d,preventScrollReset:x,relative:h,viewTransition:N,defaultShouldRevalidate:p,useTransitions:m}={}){let v=yu(),y=Yt(),E=ts(r,{relative:h});return j.useCallback(M=>{if(Tp(M,o)){M.preventDefault();let z=u!==void 0?u:Pn(y)===Pn(E),R=()=>v(r,{replace:z,mask:c,state:d,preventScrollReset:x,relative:h,viewTransition:N,defaultShouldRevalidate:p});m?j.startTransition(()=>R()):R()}},[y,v,E,u,c,d,o,r,x,h,N,p,m])}function Mr(r){qt(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 o=j.useRef(xu(r)),u=j.useRef(!1),c=Yt(),d=j.useMemo(()=>Ap(c.search,u.current?null:o.current),[c.search]),x=yu(),h=j.useCallback((N,p)=>{const m=xu(typeof N=="function"?N(new URLSearchParams(d)):N);u.current=!0,x("?"+m,p)},[x,d]);return[d,h]}var Fp=0,Pp=()=>`__${String(++Fp)}__`;function Ip(){let{router:r}=_x("useSubmit"),{basename:o}=j.useContext(Lt),u=pp(),c=r.fetch,d=r.navigate;return j.useCallback(async(x,h={})=>{let{action:N,method:p,encType:m,formData:v,body:y}=_p(x,o);if(h.navigate===!1){let E=h.fetcherKey||Pp();await c(E,u,h.action||N,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:v,body:y,formMethod:h.method||p,formEncType:h.encType||m,flushSync:h.flushSync})}else await d(h.action||N,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:v,body:y,formMethod:h.method||p,formEncType:h.encType||m,replace:h.replace,state:h.state,fromRouteId:u,flushSync:h.flushSync,viewTransition:h.viewTransition})},[c,d,o,u])}function ey(r,{relative:o}={}){let{basename:u}=j.useContext(Lt),c=j.useContext(Kt);Be(c,"useFormAction must be used inside a RouteContext");let[d]=c.matches.slice(-1),x={...ts(r||".",{relative:o})},h=Yt();if(r==null){x.search=h.search;let N=new URLSearchParams(x.search),p=N.getAll("index");if(p.some(v=>v==="")){N.delete("index"),p.filter(y=>y).forEach(y=>N.append("index",y));let v=N.toString();x.search=v?`?${v}`:""}}return(!r||r===".")&&d.route.index&&(x.search=x.search?x.search.replace(/^\?/,"?index&"):"?index"),u!=="/"&&(x.pathname=x.pathname==="/"?u:$t([u,x.pathname])),Pn(x)}function ty(r,{relative:o}={}){let u=j.useContext(Nx);Be(u!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=_x("useViewTransitionState"),d=ts(r,{relative:o});if(!u.isTransitioning)return!1;let x=ma(u.currentLocation.pathname,c)||u.currentLocation.pathname,h=ma(u.nextLocation.pathname,c)||u.nextLocation.pathname;return Cr(d.pathname,h)!=null||Cr(d.pathname,x)!=null}const zx=j.createContext({projects:[],activeProject:null,setActiveProject:()=>{},refreshProjects:()=>{}});function rl(){return j.useContext(zx)}function ay(){const[r,o]=j.useState([]),[u,c]=Mr(),d=j.useCallback(async()=>{try{const m=await(await fetch("/api/projects")).json();m.ok&&o(m.data||[])}catch{}},[]);j.useEffect(()=>{d()},[d]);const x=u.get("project"),h=x?r.find(p=>p.id===x)||r[0]||null:r[0]||null,N=j.useCallback(p=>{c(m=>(m.set("project",p),m))},[c]);return{projects:r,activeProject:h,setActiveProject:N,refreshProjects:d}}function Dx(r,o){const{timeout:u=3e4,retries:c=1,retryDelay:d=2e3}={},[x,h]=j.useState(null),[N,p]=j.useState(!0),[m,v]=j.useState(null),[y,E]=j.useState(0),[M,z]=j.useState(null),R=j.useCallback(()=>E(b=>b+1),[]);return j.useEffect(()=>{if(!r){p(!1),h(null),v(null);return}let b=!1;p(!0),v(null);async function w(T){const U=new AbortController,J=setTimeout(()=>U.abort(),u);try{const V=await fetch(r,{signal:U.signal});if(clearTimeout(J),!V.ok)throw new Error(`HTTP ${V.status}`);const ae=V.headers.get("content-type")||"";if(!ae.includes("application/json"))throw new Error(`Expected JSON response but got ${ae||"unknown"} — server may be restarting`);const Z=await V.json();b||(h(Z.data??Z),v(null),z(new Date),p(!1))}catch(V){if(clearTimeout(J),b)return;if(T>0&&V.name!=="AbortError")return await new Promise(ae=>setTimeout(ae,d)),b?void 0:w(T-1);V.name==="AbortError"?v(`Request timed out (${Math.round(u/1e3)}s)`):v(String(V.message||V)),p(!1)}}return w(c),()=>{b=!0}},[r,y,u,c,d]),{data:x,loading:N,error:m,refetch:R,fetchedAt:M}}function Te(r,o){const{activeProject:u}=rl(),c=r.includes("?")?"&":"?",d=u?`${r}${c}project=${u.id}`:r;return Dx(d)}const Eu=j.createContext(null),ly=["heartbeat","increment-update","analytics-event","cost-update","notification","sync-update","sync-audit","error-detected","config-changed","activity","command-output","command-complete","job-progress","marketplace-scan","submission-update","verification-complete","hook-event","hook-agent"];function ny({url:r="/api/events",children:o}){const[u,c]=j.useState("connecting"),d=j.useRef(null),x=j.useRef(null),h=j.useRef(new Map),N=j.useCallback(()=>{d.current&&d.current.close(),c("connecting");const m=new EventSource(r);d.current=m;for(const v of ly)m.addEventListener(v,y=>{let E;try{E=JSON.parse(y.data)}catch{return}const M=h.current.get(v);if(M)for(const z of M)try{z(E)}catch{}});m.onopen=()=>c("connected"),m.onerror=()=>{m.close(),c("disconnected"),x.current=setTimeout(()=>{d.current===m&&N()},3e3)}},[r]);j.useEffect(()=>(N(),()=>{x.current&&(clearTimeout(x.current),x.current=null),d.current?.close(),d.current=null}),[N]);const p=j.useCallback((m,v)=>(h.current.has(m)||h.current.set(m,new Set),h.current.get(m).add(v),()=>{const y=h.current.get(m);y&&(y.delete(v),y.size===0&&h.current.delete(m))}),[]);return l.jsx(Eu.Provider,{value:{status:u,subscribe:p},children:o})}function Ue(r,o){const u=j.useContext(Eu),c=j.useRef(o);c.current=o,j.useEffect(()=>{if(!u)return;const d=x=>c.current(x);return u.subscribe(r,d)},[u,r])}function sy(){return j.useContext(Eu)?.status??"disconnected"}const ry=[{path:"/",label:"Overview",icon:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-4 0a1 1 0 01-1-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 01-1 1"},{path:"/increments",label:"Increments",icon:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"},{path:"/analytics",label:"Analytics",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{path:"/costs",label:"Costs",icon:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{path:"/sync",label:"Sync",icon:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},{path:"/errors",label:"Errors",icon:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"},{path:"/activity",label:"Activity",icon:"M13 10V3L4 14h7v7l9-11h-7z"},{path:"/notifications",label:"Notifications",icon:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",badge:!0},{path:"/config",label:"Config",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z"},{path:"/plugins",label:"Plugins",icon:"M17 14v6m-3-3h6M6 10h2a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2zm10 0h2a2 2 0 002-2V6a2 2 0 00-2-2h-2a2 2 0 00-2 2v2a2 2 0 002 2zM6 20h2a2 2 0 002-2v-2a2 2 0 00-2-2H6a2 2 0 00-2 2v2a2 2 0 002 2z"},{path:"/marketplace",label:"Marketplace",icon:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 100 4 2 2 0 000-4z"},{path:"/repos",label:"Repos",icon:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"},{path:"/workspace",label:"Workspace",icon:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"},{path:"/services",label:"Services",icon:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"},{path:"/hooks",label:"Hooks",icon:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"},{path:"/agents",label:"Agents",icon:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"}];function iy({d:r}){return l.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:r})})}function cy(){const{projects:r,activeProject:o,setActiveProject:u}=rl(),[c]=Mr(),{data:d}=Te("/api/overview"),[x,h]=j.useState(null),N=j.useCallback(E=>{const M=E;M?.pendingCount!=null&&h(M.pendingCount)},[]);Ue("notification",N);const p=sy(),m=x??d?.notifications?.pendingCount??0,v=c.get("project"),y=E=>v?`${E}?project=${v}`:E;return l.jsxs("aside",{className:"w-56 bg-gray-900 border-r border-gray-800 flex flex-col h-screen sticky top-0",children:[l.jsx("div",{className:"px-4 py-5 border-b border-gray-800",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-8 h-8 bg-indigo-500 rounded-lg flex items-center justify-center",children:l.jsx("span",{className:"text-white font-bold text-sm",children:"SW"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-white font-semibold text-sm",children:"SpecWeave"}),l.jsx("div",{className:"text-gray-500 text-xs",children:"Dashboard"})]})]})}),(r.length>0||v)&&l.jsxs("div",{className:"px-3 py-3 border-b border-gray-800",children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider mb-1 block",children:"Project"}),l.jsxs("select",{value:o?.id||v||"",onChange:E=>{E.target.value==="__add__"?window.location.href=y("/config"):u(E.target.value)},className:"w-full bg-gray-800 border border-gray-700 text-gray-300 text-xs rounded-lg px-2 py-1.5 focus:ring-indigo-500 focus:border-indigo-500",children:[r.map(E=>l.jsx("option",{value:E.id,children:E.name},E.id)),v&&!r.find(E=>E.id===v)&&l.jsxs("option",{value:v,children:[decodeURIComponent(v).split(/[-/]/).pop()||v," (not registered)"]}),l.jsx("option",{value:"__add__",children:"+ Add project..."})]})]}),l.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-2",children:ry.map(E=>l.jsxs(Mx,{to:y(E.path),end:E.path==="/",className:({isActive:M})=>`flex items-center gap-3 px-3 py-2 rounded-lg text-sm mb-0.5 transition-colors ${M?"bg-indigo-500/10 text-indigo-400":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"}`,children:[l.jsx(iy,{d:E.icon}),l.jsx("span",{className:"flex-1",children:E.label}),E.badge&&m>0&&l.jsx("span",{className:"min-w-[18px] h-[18px] px-1 bg-rose-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center",children:m>99?"99+":m})]},E.path))}),l.jsx("div",{className:"px-4 py-3 border-t border-gray-800",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${p==="connected"?"bg-emerald-400 pulse-dot":p==="connecting"?"bg-amber-400 pulse-dot":"bg-gray-500"}`}),l.jsx("span",{className:"text-xs text-gray-500",children:p==="connected"?"Connected":p==="connecting"?"Connecting...":"Disconnected"})]}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[r.length," project",r.length!==1?"s":""]})]})})]})}function uy(){const{data:r}=Dx("/api/health"),{activeProject:o}=rl(),u=o?.name||"Project",c=r?.uptime?oy(r.uptime):"...";return l.jsxs("header",{className:"h-14 bg-gray-900/50 backdrop-blur border-b border-gray-800 flex items-center justify-between px-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-gray-200 font-medium text-sm",children:u}),l.jsx("span",{className:"text-gray-600 text-xs",children:"|"}),l.jsxs("span",{className:"text-gray-500 text-xs",children:["Uptime: ",c]})]}),l.jsx("div",{className:"flex items-center gap-4",children:l.jsxs("span",{className:"text-gray-500 text-xs",children:[r?.connections??0," client",(r?.connections??0)!==1?"s":""]})})]})}function oy(r){if(r<60)return`${Math.floor(r)}s`;if(r<3600)return`${Math.floor(r/60)}m`;const o=Math.floor(r/3600),u=Math.floor(r%3600/60);return`${o}h ${u}m`}class dy extends j.Component{constructor(o){super(o),this.state={hasError:!1,error:null}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}componentDidCatch(o,u){console.error("[Dashboard ErrorBoundary]",o,u.componentStack)}componentDidUpdate(o){this.state.hasError&&o.resetKey!==this.props.resetKey&&this.setState({hasError:!1,error:null})}render(){return this.state.hasError?l.jsx("div",{className:"flex items-center justify-center min-h-[400px] p-8",children:l.jsxs("div",{className:"max-w-md text-center space-y-4",children:[l.jsx("div",{className:"w-12 h-12 mx-auto rounded-full bg-rose-500/10 flex items-center justify-center",children:l.jsx("svg",{className:"w-6 h-6 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),l.jsx("h3",{className:"text-lg font-semibold text-gray-200",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-gray-500",children:this.state.error?.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 justify-center",children:[l.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),className:"px-4 py-2 text-sm bg-gray-800 text-gray-300 rounded-lg hover:bg-gray-700 transition-colors",children:"Try Again"}),l.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 text-sm bg-indigo-600 text-white rounded-lg hover:bg-indigo-500 transition-colors",children:"Reload Page"}),l.jsx("a",{href:"/",className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors",children:"Go Home"})]})]})}):this.props.children}}const fy={indigo:"from-indigo-500/10 to-indigo-500/5 border-indigo-500/20",emerald:"from-emerald-500/10 to-emerald-500/5 border-emerald-500/20",amber:"from-amber-500/10 to-amber-500/5 border-amber-500/20",rose:"from-rose-500/10 to-rose-500/5 border-rose-500/20",cyan:"from-cyan-500/10 to-cyan-500/5 border-cyan-500/20"},xy={indigo:"text-indigo-400",emerald:"text-emerald-400",amber:"text-amber-400",rose:"text-rose-400",cyan:"text-cyan-400"};function ne({title:r,value:o,subtitle:u,tooltip:c,color:d="indigo"}){return l.jsxs("div",{className:`bg-gradient-to-br ${fy[d]} border rounded-xl p-4 relative group`,title:c,children:[l.jsx("div",{className:"text-gray-400 text-xs font-medium uppercase tracking-wider mb-2",children:r}),l.jsx("div",{className:`text-2xl font-bold ${xy[d]}`,children:o}),u&&l.jsx("div",{className:"text-gray-500 text-xs mt-1",children:u}),c&&l.jsxs("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 px-2.5 py-1.5 bg-gray-800 border border-gray-700 rounded-lg text-[10px] text-gray-300 whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-10 shadow-lg",children:[c,l.jsx("div",{className:"absolute top-full left-1/2 -translate-x-1/2 -mt-px border-4 border-transparent border-t-gray-800"})]})]})}const my={active:"#6366f1",completed:"#10b981",paused:"#f59e0b",planning:"#06b6d4",abandoned:"#ef4444",backlog:"#6b7280",ready_for_review:"#8b5cf6"};function hy(r){return my[r]||"#6b7280"}function gy({segments:r,size:o=160,centerLabel:u,centerValue:c}){const d=r.reduce((p,m)=>p+m.value,0);if(d===0)return l.jsx("div",{className:"flex items-center justify-center",style:{width:o,height:o},children:l.jsx("span",{className:"text-gray-600 text-xs",children:"No data"})});const x=52,h=2*Math.PI*x;let N=0;return l.jsxs("div",{className:"relative inline-flex items-center justify-center",style:{width:o,height:o},children:[l.jsx("svg",{viewBox:"0 0 128 128",className:"w-full h-full -rotate-90",children:r.map((p,m)=>{const y=p.value/d*h,E=N;return N+=y,l.jsx("circle",{cx:"64",cy:"64",r:x,fill:"none",stroke:p.color,strokeWidth:"12",strokeDasharray:`${y} ${h-y}`,strokeDashoffset:-E,className:"transition-all duration-500"},m)})}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c!=null&&l.jsx("span",{className:"text-xl font-bold text-white",children:c}),u&&l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:u})]})]})}function py(r){return Object.entries(r).filter(([o,u])=>u>0).map(([o,u])=>({label:o,value:u,color:hy(o)}))}const yy={default:"bg-gray-800 text-gray-300",success:"bg-emerald-500/15 text-emerald-400",warning:"bg-amber-500/15 text-amber-400",error:"bg-rose-500/15 text-rose-400",info:"bg-cyan-500/15 text-cyan-400"};function ie({label:r,variant:o="default"}){return l.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${yy[o]}`,children:r})}function _r(r){switch(r){case"active":case"running":return"info";case"completed":case"success":return"success";case"paused":case"pending":case"planning":return"warning";case"failed":case"abandoned":case"error":return"error";default:return"default"}}function vy({size:r="md"}){const o={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};return l.jsxs("svg",{className:`${o[r]} animate-spin text-indigo-400`,viewBox:"0 0 24 24",fill:"none",children:[l.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})}function Ie(){return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(vy,{size:"lg"})})}function Gt({message:r,onRetry:o,title:u="Something went wrong"}){const c=r.toLowerCase().includes("timed out");return l.jsx("div",{className:"p-6",children:l.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-5 py-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-medium text-rose-300",children:u}),l.jsx("p",{className:"text-xs text-rose-400/80 mt-1",children:r})]}),o&&l.jsx("button",{onClick:o,className:"text-xs text-rose-400 hover:text-rose-200 px-3 py-1.5 border border-rose-700 rounded transition-colors flex-shrink-0",children:"Retry"})]}),c&&l.jsx("p",{className:"text-[10px] text-rose-400/60",children:"The server may be processing a large number of session logs. Try again in a moment."})]})})}function Z0(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function by(r){switch(r){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return r||"Unknown"}}const ru=r=>r.billingContext?.planType==="subscription";function jy(){const[r,o]=j.useState(0),{data:u,loading:c,error:d,refetch:x}=Te(`/api/overview?_r=${r}`),[h,N]=j.useState([]),[p,m]=j.useState([]),[v,y]=j.useState([]),{activeProject:E}=rl();Ue("increment-update",()=>o(b=>b+1)),Ue("notification",()=>o(b=>b+1)),Ue("sync-update",()=>o(b=>b+1)),Ue("sync-error",()=>o(b=>b+1)),Ue("cost-update",()=>o(b=>b+1));const M=j.useRef(null);j.useEffect(()=>{if(!E||M.current===E.id)return;M.current=E.id;const b=`project=${E.id}`;fetch(`/api/activity/stream?limit=20&${b}`).then(w=>w.json()).then(w=>{w.ok&&Array.isArray(w.data)&&N(w.data)}).catch(()=>{})},[E]);const z=j.useCallback(b=>{N(w=>[b,...w].slice(0,20))},[]);if(Ue("activity",z),j.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=5").then(b=>b.json()).then(b=>{b.ok&&Array.isArray(b.data)&&m(b.data)}).catch(()=>{}),fetch("/api/sync/gaps").then(b=>b.json()).then(b=>{b.ok&&Array.isArray(b.data)&&y(b.data)}).catch(()=>{})},[r]),c)return l.jsx(Ie,{});if(d)return l.jsx(Gt,{message:d,onRetry:x});if(!u)return null;const R=py(u.project.statusBreakdown);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("h2",{className:"text-lg font-semibold text-gray-200",children:[u.project.name||"Project"," Overview"]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(st,{to:"/increments?status=active",className:"group",children:l.jsx(ne,{title:"Active Increments",value:u.project.activeIncrements,subtitle:`${u.project.totalIncrements} total`,color:"indigo"})}),l.jsx(st,{to:"/increments?status=completed",className:"group",children:l.jsx(ne,{title:"Completed",value:u.project.completedIncrements,subtitle:`${Math.round(u.project.completedIncrements/Math.max(u.project.totalIncrements,1)*100)}% done`,color:"emerald"})}),l.jsx(st,{to:"/costs",className:"group",children:l.jsx(ne,{title:ru(u.costs)?"Usage Value":"Total Cost",value:`$${u.costs.totalCost.toFixed(2)}`,subtitle:ru(u.costs)?`via Claude Code · $${u.costs.billingContext?.monthlyAmount??"?"}/mo plan`:`via Claude Code · ${u.costs.sessionCount.toLocaleString()} sessions`,color:"amber"})}),l.jsx(st,{to:"/analytics",className:"group",children:l.jsx(ne,{title:"Events Today",value:u.analytics.last24hEvents,subtitle:`${u.analytics.totalEvents.toLocaleString()} total`,color:"cyan"})})]}),l.jsx(Ny,{}),ru(u.costs)&&l.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[l.jsx(ie,{label:"Subscription",variant:"info"}),l.jsx("span",{className:"text-xs text-gray-300",children:"Costs shown as API-equivalent usage value."})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Status"}),l.jsx("div",{className:"flex items-center justify-center",children:l.jsx(gy,{segments:R,centerValue:u.project.totalIncrements,centerLabel:"total"})}),l.jsx("div",{className:"flex flex-wrap gap-2 mt-4 justify-center",children:R.map(b=>l.jsxs(st,{to:`/increments?status=${b.label.toLowerCase()}`,className:"flex items-center gap-1.5 hover:opacity-80 transition-opacity",children:[l.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:b.color}}),l.jsxs("span",{className:"text-xs text-gray-500 hover:text-gray-300",children:[b.label," (",b.value,")"]})]},b.label))})]}),l.jsxs(st,{to:"/sync",className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 hover:border-gray-700 transition-colors block",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Health"}),l.jsx("div",{className:"space-y-3",children:Object.entries(u.sync.platforms).length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No sync platforms configured"}):Object.entries(u.sync.platforms).map(([b,w])=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-300 capitalize",children:b}),w.configDetail&&l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:w.configDetail}),!w.configDetail&&w.lastImport&&l.jsxs("div",{className:"text-xs text-gray-600 mt-0.5",children:["Last: ",new Date(w.lastImport).toLocaleDateString()]})]}),l.jsx(ie,{label:by(w.connectionStatus||w.lastSyncResult),variant:Z0(w.connectionStatus)!=="default"?Z0(w.connectionStatus):_r(w.lastSyncResult||"")})]},b))}),l.jsx("div",{className:"mt-4 pt-4 border-t border-gray-800",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:"Notifications"}),l.jsxs("div",{className:"flex gap-2",children:[u.notifications.criticalCount>0&&l.jsx(st,{to:"/notifications",onClick:b=>b.stopPropagation(),children:l.jsx(ie,{label:`${u.notifications.criticalCount} critical`,variant:"error"})}),l.jsx(st,{to:"/notifications",onClick:b=>b.stopPropagation(),children:l.jsx(ie,{label:`${u.notifications.pendingCount} pending`,variant:u.notifications.pendingCount>0?"warning":"default"})})]})]})})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Live Activity"}),l.jsx(st,{to:"/activity",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),l.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto custom-scrollbar",children:h.length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No recent activity"}):h.map((b,w)=>l.jsxs("div",{className:"flex items-start gap-2 py-1 slide-in",children:[l.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-1.5 ${b.severity==="error"?"bg-rose-400":b.severity==="warning"?"bg-amber-400":"bg-gray-600"}`}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-gray-400 truncate",children:b.title}),l.jsxs("div",{className:"text-[10px] text-gray-600",children:[b.category,b.timestamp&&` · ${K0(b.timestamp)}`]})]})]},w))})]})]}),v.length>0&&l.jsxs(st,{to:"/sync",className:"bg-amber-500/10 border border-amber-500/20 rounded-xl px-4 py-3 flex items-center gap-3 hover:border-amber-500/30 transition-colors block",children:[l.jsx(ie,{label:`${v.length} gaps`,variant:"warning"}),l.jsxs("span",{className:"text-xs text-gray-300",children:[v.length," increment",v.length!==1?"s have":" has"," partial sync coverage"]})]}),p.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sync Errors"}),l.jsx(st,{to:"/sync",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),l.jsx("div",{className:"space-y-2",children:p.map((b,w)=>l.jsxs("div",{className:"flex items-start gap-2 p-3 bg-gray-800/50 rounded-lg",children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full mt-1.5 bg-rose-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-300 capitalize",children:b.provider}),l.jsx(ie,{label:b.incrementId,variant:"default"})]}),l.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:b.error}),l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:K0(b.timestamp)})]})]},w))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Increment Types"}),l.jsx("div",{className:"flex gap-4 flex-wrap",children:Object.entries(u.project.typeBreakdown).map(([b,w])=>l.jsxs(st,{to:`/increments?type=${b}`,className:"flex items-center gap-2 px-3 py-2 bg-gray-800/50 rounded-lg hover:bg-gray-800/80 transition-colors",children:[l.jsx("span",{className:"text-sm text-gray-300 capitalize",children:b}),l.jsx("span",{className:"text-xs text-gray-500 bg-gray-800 px-2 py-0.5 rounded",children:w})]},b))})]})]})}function Ny(){const[r,o]=j.useState(0);Ue("error-detected",()=>o(M=>M+1));const{data:u}=Te(`/api/prompt-health?_r=${r}`);if(!u?.health||u.health.warningLevel==="normal")return null;const{health:c,alert:d}=u,x=d?.level==="emergency",h=c.warningLevel==="critical"||x,N=h?"border-rose-500/30":"border-amber-500/20",p=h?"bg-rose-500/10":"bg-amber-500/10",m=h?"text-rose-400":"text-amber-400",v=Math.round(c.baseline/1e3),y=Math.min(Math.round(c.baseline/2e5*100),100),E=h?"bg-rose-500":"bg-amber-500";return l.jsxs("div",{className:`${p} border ${N} rounded-xl px-4 py-3 space-y-2`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ie,{label:h?"Critical":"Warning",variant:h?"error":"warning"}),l.jsxs("span",{className:`text-xs ${m}`,children:["Prompt baseline: ",v,"KB (",y,"% of context window)"]})]}),l.jsx(st,{to:"/errors",className:"text-[10px] text-gray-500 hover:text-gray-300",children:"Details"})]}),l.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5",children:l.jsx("div",{className:`${E} h-1.5 rounded-full`,style:{width:`${y}%`}})}),l.jsxs("div",{className:"flex gap-4 text-[10px] text-gray-500",children:[l.jsxs("span",{children:["CLAUDE.md: ",Math.round(c.claudeMdSize/1e3),"KB"]}),l.jsxs("span",{children:["MEMORY.md: ",Math.round(c.memoryMdSize/1e3),"KB"]}),l.jsxs("span",{children:["Skills: ",Math.round(c.skillBudget/1e3),"KB"]}),d&&l.jsxs("span",{className:m,children:["Compactions: ",d.compactionCount]})]})]})}function K0(r){try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function Sy(){const r=yu(),[o]=Mr();return j.useCallback(u=>{const c=o.get("project");if(c){const d=u.includes("?")?"&":"?";r(`${u}${d}project=${encodeURIComponent(c)}`)}else r(u)},[r,o])}const Wn=new Map;let iu=!1,Ox=null;function Ey(){iu||(iu=!0,queueMicrotask(()=>{iu=!1;const r=Ox;if(!r||Wn.size===0){Wn.clear();return}const o=new Map(Wn);Wn.clear(),r(u=>{const c=new URLSearchParams(u);for(const[d,{value:x,defaultValue:h}]of o)x&&x!==h?c.set(d,x):c.delete(d);return c})}))}function Ut(r,o=""){const[u,c]=Mr(),d=u.get(r)??o,x=j.useCallback(h=>{Ox=c,Wn.set(r,{value:h,defaultValue:o}),Ey()},[r,o,c]);return[d,x]}function Cu({title:r,description:o}){return l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mb-4",children:l.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})}),l.jsx("h3",{className:"text-gray-400 text-sm font-medium",children:r}),o&&l.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs",children:o})]})}const Kn=50;function Cy(){const[r,o]=j.useState(0),[u,c]=j.useState(0),[d,x]=Ut("status","all"),[h,N]=Ut("type","all"),p=Sy(),m=j.useRef();Ue("increment-update",()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>o(U=>U+1),500)}),j.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const v=new URLSearchParams({_r:String(r),limit:String(Kn),offset:String(u)});d!=="all"&&v.set("status",d),h!=="all"&&v.set("type",h);const{data:y,loading:E,error:M,refetch:z}=Te(`/api/increments?${v}`),R=j.useRef(d),b=j.useRef(h);if(j.useEffect(()=>{(R.current!==d||b.current!==h)&&(c(0),R.current=d,b.current=h)},[d,h]),E&&u===0)return l.jsx(Ie,{});if(M)return l.jsx(Gt,{message:M,onRetry:z});if(!y)return null;const w=Object.keys(y.summary).filter(U=>U!=="total"&&y.summary[U]>0),T=y.pagination;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Increments"}),l.jsxs("span",{className:"text-sm text-gray-500",children:[T?.total??y.increments.length," total"]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Status:"}),l.jsxs("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[l.jsx(cu,{label:"All",active:d==="all",onClick:()=>x("all"),count:y.summary.total}),w.map(U=>l.jsx(cu,{label:U,active:d===U,onClick:()=>x(U),count:y.summary[U]},U))]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs text-gray-500 w-14",children:"Type:"}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:l.jsx(cu,{label:"All",active:h==="all",onClick:()=>N("all")})})]}),T&&T.total>0&&l.jsxs("span",{className:"text-xs text-gray-500",children:["Showing ",u+1,"–",Math.min(u+Kn,T.total)," of ",T.total]})]}),y.increments.length===0?l.jsx(Cu,{title:"No increments match filters",description:"Try adjusting your filters"}):l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ID"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Title"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Status"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Type"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Priority"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Tasks"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"ACs"}),l.jsx("th",{className:"text-left px-4 py-3 text-xs text-gray-500 font-medium uppercase",children:"Last Activity"})]})}),l.jsx("tbody",{children:y.increments.map(U=>l.jsxs("tr",{onClick:()=>p(`/increments/${U.id}`),className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors cursor-pointer",children:[l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:U.id})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-sm text-gray-300",children:U.title})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(ie,{label:U.status,variant:_r(U.status)})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:U.type})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(wy,{priority:U.priority})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(J0,{completed:U.tasks.completed,total:U.tasks.total})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(J0,{completed:U.acs.completed,total:U.acs.total})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs text-gray-500",children:U.lastActivity?Ty(U.lastActivity):"-"})})]},U.id))})]})}),T&&T.total>Kn&&l.jsxs("div",{className:"flex justify-center gap-2",children:[l.jsx("button",{onClick:()=>c(Math.max(0,u-Kn)),disabled:u===0,className:"px-4 py-2 text-sm text-gray-300 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Previous"}),l.jsx("button",{onClick:()=>c(u+Kn),disabled:!T.hasMore,className:"px-4 py-2 text-sm text-gray-300 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Next"})]})]})}function cu({label:r,active:o,onClick:u,count:c}){return l.jsxs("button",{onClick:u,className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${o?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:[r,c!==void 0&&l.jsx("span",{className:"ml-1 text-[10px] text-gray-500",children:c})]})}function J0({completed:r,total:o}){const u=o>0?Math.round(r/o*100):0;return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-16 h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-indigo-500 rounded-full transition-all",style:{width:`${u}%`}})}),l.jsxs("span",{className:"text-xs text-gray-500",children:[r,"/",o]})]})}function wy({priority:r}){const o={P0:"text-rose-400 bg-rose-500/10",P1:"text-amber-400 bg-amber-500/10",P2:"text-cyan-400 bg-cyan-500/10",P3:"text-gray-400 bg-gray-500/10"};return l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${o[r]||o.P2}`,children:r})}function Ty(r){try{const o=new Date(r),c=new Date().getTime()-o.getTime(),d=Math.floor(c/6e4);if(d<1)return"Just now";if(d<60)return`${d}m ago`;const x=Math.floor(d/60);if(x<24)return`${x}h ago`;const h=Math.floor(x/24);return h<7?`${h}d ago`:o.toLocaleDateString()}catch{return r}}function Ay(){const[r,o]=j.useState("skills"),[u,c]=j.useState(!1),[d,x]=j.useState(0);Ue("analytics-event",()=>x(w=>w+1));const{data:h,loading:N,error:p,refetch:m,fetchedAt:v}=Te(`/api/analytics/summary?_r=${d}`),{data:y,loading:E,refetch:M}=Te(`/api/analytics/skills?_r=${d}`);if(N||E)return l.jsx(Ie,{});if(p)return l.jsx(Gt,{message:p,onRetry:m});if(!h)return null;const z=h.topCommands?.reduce((w,T)=>w+T.count,0)||0,R=h.topSkills?.reduce((w,T)=>w+T.count,0)||0,b=h.topAgents?.reduce((w,T)=>w+T.count,0)||0;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Analytics"}),l.jsxs("div",{className:"flex items-center gap-3",children:[v&&l.jsxs("span",{className:"text-[10px] text-gray-600",children:["Updated ",v.toLocaleTimeString()]}),l.jsxs("span",{className:"text-sm text-gray-500",children:[h.totalEvents.toLocaleString()," total events"]}),l.jsx("button",{onClick:()=>{c(!0),m(),M(),setTimeout(()=>c(!1),600)},disabled:u,className:"p-1.5 text-gray-500 hover:text-gray-300 hover:bg-gray-800 rounded-lg transition-colors disabled:opacity-50",title:"Refresh analytics",children:l.jsx("svg",{className:`w-4 h-4 ${u?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Total Events",value:h.totalEvents.toLocaleString(),subtitle:`${h.successRate}% success rate`,color:"indigo",tooltip:`${h.totalEvents} events tracked from analytics JSONL`}),l.jsx(ne,{title:"Commands",value:z.toLocaleString(),subtitle:`${h.topCommands?.length||0} unique`,color:"cyan",tooltip:`${z} total command invocations across ${h.topCommands?.length||0} distinct commands`}),l.jsx(ne,{title:"Skills",value:R.toLocaleString(),subtitle:`${h.topSkills?.length||0} unique`,color:"emerald",tooltip:`${R} total skill activations across ${h.topSkills?.length||0} distinct skills`}),l.jsx(ne,{title:"Agents",value:b.toLocaleString(),subtitle:`${h.topAgents?.length||0} unique`,color:"amber",tooltip:`${b} agent spawns across ${h.topAgents?.length||0} distinct agent types`})]}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{key:"skills",label:"Skills"},{key:"commands",label:"Commands"},{key:"agents",label:"Agents"},{key:"daily",label:"Daily Trends"}].map(w=>l.jsx("button",{onClick:()=>o(w.key),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===w.key?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:w.label},w.key))}),r==="commands"&&l.jsx(Ry,{commands:h.topCommands||[]}),r==="skills"&&l.jsx(My,{skills:y||[]}),r==="agents"&&l.jsx(_y,{agents:h.topAgents||[]}),r==="daily"&&l.jsx(zy,{days:h.dailySummaries||[]})]})}function Ry({commands:r}){if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No command data available"})});const o=[...r].sort((c,d)=>d.count-c.count),u=o[0]?.count||1;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Commands"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Command"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),l.jsx("tbody",{children:o.map((c,d)=>{const x=Math.max(2,c.count/u*100);return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",d+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300 font-mono",children:c.name})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-indigo-500/60 transition-all",style:{width:`${x}%`}})})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function My({skills:r}){const o=[...r].sort((u,c)=>c.count-u.count);return o.length===0?l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No skill usage data available"})}):l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Skill Usage Leaderboard"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Skill Name"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Plugin"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Invocations"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Success Rate"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Last Used"})]})}),l.jsx("tbody",{children:o.map((u,c)=>{const d=u.count>0?Math.round(u.successCount/u.count*100):100,x=d>=90?"success":d>=70?"warning":"error";return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",c+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300 font-mono",children:u.name})}),l.jsx("td",{className:"px-4 py-2.5",children:u.plugin&&l.jsx("span",{className:"text-[10px] text-gray-600 bg-gray-800 px-1.5 py-0.5 rounded",children:u.plugin})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:u.count.toLocaleString()}),l.jsx("td",{className:"px-4 py-2.5 text-right",children:l.jsx(ie,{label:`${d}%`,variant:x})}),l.jsx("td",{className:"px-4 py-2.5 text-xs text-gray-600 text-right whitespace-nowrap",children:u.lastUsed?Dy(u.lastUsed):"-"})]},u.name)})})]})]})}function _y({agents:r}){if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No agent data available"})});const o=[...r].sort((c,d)=>d.count-c.count),u=o[0]?.count||1;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Top Agents"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-12",children:"Rank"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Agent"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Usage"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"})]})}),l.jsx("tbody",{children:o.map((c,d)=>{const x=Math.max(2,c.count/u*100);return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsxs("td",{className:"px-4 py-2.5 text-xs text-gray-600",children:["#",d+1]}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("span",{className:"text-sm text-gray-300",children:c.name})}),l.jsx("td",{className:"px-4 py-2.5",children:l.jsx("div",{className:"w-full h-1.5 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-cyan-500/60 transition-all",style:{width:`${x}%`}})})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:c.count.toLocaleString()})]},c.name)})})]})]})}function zy({days:r}){const o=r.slice(-14);if(o.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No daily data available"})});const u=Math.max(...o.map(x=>x.totalEvents),1),c=o.reduce((x,h)=>x+h.totalEvents,0),d=Math.round(c/o.length);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsx(ne,{title:"Period Total",value:c.toLocaleString(),subtitle:`Last ${o.length} days`,color:"indigo"}),l.jsx(ne,{title:"Daily Average",value:d.toLocaleString(),color:"cyan"}),l.jsx(ne,{title:"Peak Day",value:u.toLocaleString(),subtitle:o.find(x=>x.totalEvents===u)?.date||"",color:"emerald"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:["Daily Events (Last ",o.length," Days)"]}),l.jsx("div",{className:"flex items-end gap-1.5 h-40",children:o.map(x=>{const h=Math.max(2,x.totalEvents/u*100),N=x.date.slice(5);return l.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1",children:[l.jsx("span",{className:"text-[9px] text-gray-500",children:x.totalEvents}),l.jsx("div",{className:"w-full bg-indigo-500/40 rounded-t hover:bg-indigo-500/60 transition-colors cursor-default",style:{height:`${h}%`},title:`${x.date}: ${x.totalEvents} events`}),l.jsx("span",{className:"text-[8px] text-gray-700",children:N})]},x.date)})})]})]})}function Dy(r){if(!r)return"";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function Ux({items:r,maxBars:o=10}){const u=[...r].sort((d,x)=>x.value-d.value).slice(0,o),c=Math.max(...u.map(d=>d.value),1);return l.jsx("div",{className:"space-y-2",children:u.map((d,x)=>l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"text-xs text-gray-400 w-28 truncate text-right",title:d.label,children:d.label}),l.jsx("div",{className:"flex-1 h-5 bg-gray-800 rounded overflow-hidden",children:l.jsx("div",{className:"h-full rounded transition-all duration-500",style:{width:`${d.value/c*100}%`,backgroundColor:d.color||"#6366f1"}})}),l.jsx("span",{className:"text-xs text-gray-500 w-10 text-right",children:d.value})]},x))})}const Oy={anthropic:"#6366f1",openai:"#10b981",google:"#f59e0b",mistral:"#ef4444",groq:"#8b5cf6",together:"#06b6d4","aws-bedrock":"#f97316","azure-openai":"#3b82f6"};function Uy({data:r,showProviderLines:o=!1,height:u=200}){if(!r||r.length===0)return l.jsx("div",{className:"flex items-center justify-center h-40 text-gray-500 text-sm",children:"No spend data available"});const c={top:20,right:20,bottom:30,left:50},d=600,x=d-c.left-c.right,h=u-c.top-c.bottom,N=Math.max(...r.map(R=>R.total_cost),.01),p=R=>c.left+R/Math.max(r.length-1,1)*x,m=R=>c.top+h-R/N*h,v=r.map((R,b)=>`${b===0?"M":"L"} ${p(b).toFixed(1)} ${m(R.total_cost).toFixed(1)}`).join(" "),y=[];if(o){const R=new Set;r.forEach(b=>Object.keys(b.providers).forEach(w=>R.add(w)));for(const b of R){const w=r.map((T,U)=>{const J=T.providers[b]?.cost??0;return`${U===0?"M":"L"} ${p(U).toFixed(1)} ${m(J).toFixed(1)}`}).join(" ");y.push({provider:b,path:w,color:Oy[b]||"#9ca3af"})}}const E=[0,N/2,N].map(R=>({value:R,y:m(R),label:`$${R<1?R.toFixed(2):R.toFixed(0)}`})),M=Math.min(r.length,5),z=Array.from({length:M},(R,b)=>{const w=Math.round(b/Math.max(M-1,1)*(r.length-1));return{x:p(w),label:r[w].date.slice(5)}});return l.jsxs("div",{className:"w-full",children:[l.jsxs("svg",{viewBox:`0 0 ${d} ${u}`,className:"w-full",preserveAspectRatio:"xMidYMid meet",children:[E.map((R,b)=>l.jsx("line",{x1:c.left,y1:R.y,x2:d-c.right,y2:R.y,stroke:"#374151",strokeDasharray:"4 4"},b)),E.map((R,b)=>l.jsx("text",{x:c.left-8,y:R.y+4,textAnchor:"end",fill:"#9ca3af",fontSize:"10",children:R.label},`y-${b}`)),z.map((R,b)=>l.jsx("text",{x:R.x,y:u-5,textAnchor:"middle",fill:"#9ca3af",fontSize:"10",children:R.label},`x-${b}`)),y.map(R=>l.jsx("path",{d:R.path,fill:"none",stroke:R.color,strokeWidth:"1.5",strokeOpacity:"0.5"},R.provider)),l.jsx("path",{d:v,fill:"none",stroke:"#6366f1",strokeWidth:"2.5"}),r.map((R,b)=>l.jsx("circle",{cx:p(b),cy:m(R.total_cost),r:"3",fill:"#6366f1",className:"hover:r-5 transition-all",children:l.jsx("title",{children:`${R.date}: $${R.total_cost.toFixed(4)}`})},b))]}),o&&y.length>0&&l.jsx("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-gray-400",children:y.map(R=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:"w-3 h-0.5",style:{backgroundColor:R.color}}),l.jsx("span",{children:R.provider})]},R.provider))})]})}const Ly={anthropic:"bg-indigo-500/20 text-indigo-400",openai:"bg-emerald-500/20 text-emerald-400",google:"bg-amber-500/20 text-amber-400",mistral:"bg-red-500/20 text-red-400",groq:"bg-violet-500/20 text-violet-400",together:"bg-cyan-500/20 text-cyan-400","aws-bedrock":"bg-orange-500/20 text-orange-400","azure-openai":"bg-blue-500/20 text-blue-400"};function W0(r){return r<.01?`$${r.toFixed(4)}`:`$${r.toFixed(2)}`}function F0(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:String(r)}function Hy({data:r}){const[o,u]=j.useState(null);if(!r||Object.keys(r).length===0)return l.jsx("div",{className:"text-sm text-gray-500 py-4 text-center",children:"No multi-provider spend data"});const c=Object.entries(r).sort((d,x)=>x[1].total_cost-d[1].total_cost);return l.jsx("div",{className:"space-y-2",children:c.map(([d,x])=>l.jsxs("div",{children:[l.jsxs("button",{className:"w-full flex items-center justify-between p-2 rounded hover:bg-gray-800/50 transition-colors",onClick:()=>u(o===d?null:d),children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium ${Ly[d]||"bg-gray-500/20 text-gray-400"}`,children:d}),l.jsxs("span",{className:"text-xs text-gray-500",children:[x.sessions," sessions"]})]}),l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsxs("span",{className:"text-gray-400",children:[F0(x.total_tokens)," tokens"]}),l.jsx("span",{className:"text-white font-medium",children:W0(x.total_cost)}),l.jsx("span",{className:"text-gray-600",children:o===d?"▲":"▼"})]})]}),o===d&&l.jsx("div",{className:"ml-6 mt-1 space-y-1",children:Object.entries(x.models).sort((h,N)=>N[1].cost-h[1].cost).map(([h,N])=>l.jsxs("div",{className:"flex items-center justify-between py-1 px-2 text-xs text-gray-400",children:[l.jsx("span",{className:"truncate max-w-48",children:h}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{children:F0(N.tokens)}),l.jsx("span",{className:"text-gray-300",children:W0(N.cost)})]})]},h))})]},d))})}function By({currentSpend:r,monthlyLimit:o}){if(!o)return null;const u=r/o*100,c=Math.min(u,100);let d="bg-emerald-500",x="";return u>=100?(d="bg-red-500",x="animate-pulse ring-1 ring-red-500/50"):u>=80&&(d="bg-amber-500"),l.jsxs("div",{className:`rounded-lg p-3 bg-gray-800/50 ${x}`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:"Monthly Budget"}),l.jsxs("span",{className:"text-sm font-medium text-gray-200",children:["$",r.toFixed(2)," / $",o.toFixed(2)]})]}),l.jsx("div",{className:"h-2 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${d}`,style:{width:`${c}%`}})}),l.jsx("div",{className:"mt-1 text-right",children:l.jsxs("span",{className:"text-xs text-gray-500",children:[u.toFixed(1),"%"]})})]})}function ky(){const[r,o]=j.useState("overview"),[u,c]=j.useState(null),[d,x]=j.useState(0);Ue("cost-update",()=>x(T=>T+1));const{data:h,loading:N,error:p,refetch:m}=Te(`/api/costs/summary?_r=${d}`);if(N)return l.jsx(Ie,{});if(p)return l.jsx(Gt,{message:p,onRetry:m});if(!h)return null;const v=h.sessions||[],y=h.billingContext?.planType==="subscription",E=h.modelBreakdown?Object.entries(h.modelBreakdown).map(([T,U])=>({model:T,...U})).sort((T,U)=>U.cost-T.cost):qy(v),M=v.reduce((T,U)=>T+(U.inputTokens||0),0),z=v.reduce((T,U)=>T+(U.outputTokens||0),0),R=v.reduce((T,U)=>T+(U.cacheReadTokens||0),0),b=v.reduce((T,U)=>T+(U.cacheWriteTokens||0),0),w=M+z+R+b;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("svg",{className:"w-5 h-5 text-amber-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[l.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),l.jsx("path",{d:"M2 17l10 5 10-5"}),l.jsx("path",{d:"M2 12l10 5 10-5"})]}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Claude Code Usage"}),l.jsx("span",{className:"text-xs text-gray-500",children:y&&h.billingContext?.monthlyAmount?`$${h.billingContext.monthlyAmount}/mo plan`:"API-equivalent usage analytics"})]})]})}),y&&l.jsxs("div",{className:"bg-indigo-500/10 border border-indigo-500/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[l.jsx(ie,{label:"Subscription",variant:"info"}),l.jsxs("span",{className:"text-xs text-gray-300",children:[h.billingContext?.monthlyAmount?`$${h.billingContext.monthlyAmount}/mo plan. `:"","Costs shown as API-equivalent value for usage analytics."]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:y?"API-Equivalent Value":"Total Cost",value:`$${h.totalCost.toFixed(2)}`,subtitle:y&&h.billingContext?.monthlyAmount?`Your plan: $${h.billingContext.monthlyAmount}/mo`:void 0,color:"amber"}),l.jsx(ne,{title:y?"Cache Efficiency":"Cache Savings",value:`$${h.totalSavings.toFixed(2)}`,subtitle:y?"API-equivalent savings from cache":void 0,color:"emerald"}),l.jsx(ne,{title:"Total Tokens",value:Zl(h.totalTokens),subtitle:Yy(h.totalTokens),color:"indigo"}),l.jsx(ne,{title:"Sessions",value:h.sessionCount.toLocaleString(),color:"cyan"})]}),h.budget&&h.budget.monthlyLimit>0&&l.jsx(By,{currentSpend:h.budget.currentSpend,monthlyLimit:h.budget.monthlyLimit}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["overview","trends","providers","sessions"].map(T=>{const U={overview:"Breakdown",trends:"Trends",providers:"Providers",sessions:`Sessions (${v.length})`};return l.jsx("button",{onClick:()=>o(T),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===T?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:U[T]},T)})}),r==="overview"&&l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:y?"Usage Value by Model":"Cost by Model"}),E.length>0?l.jsx(Ux,{items:E.map(T=>({label:T.model,value:parseFloat(T.cost.toFixed(2)),color:"#f59e0b"}))}):l.jsx("p",{className:"text-gray-600 text-xs",children:"No model data"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Token Breakdown"}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(Nr,{label:"Input",value:M,total:w,color:"bg-indigo-500"}),l.jsx(Nr,{label:"Output",value:z,total:w,color:"bg-cyan-500"}),R>0&&l.jsx(Nr,{label:"Cache Read",value:R,total:w,color:"bg-emerald-500"}),b>0&&l.jsx(Nr,{label:"Cache Write",value:b,total:w,color:"bg-amber-500"})]})]}),E.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden lg:col-span-2",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Model Details"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tokens"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cost"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Avg/Session"})]})}),l.jsx("tbody",{children:E.map(T=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2 text-sm text-gray-300",children:T.model}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:T.sessions.toLocaleString()}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(T.tokens)}),l.jsxs("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:["$",T.cost.toFixed(2)]}),l.jsxs("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:["$",T.sessions>0?(T.cost/T.sessions).toFixed(4):"0"]})]},T.model))})]})]})]}),r==="trends"&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Daily Cost Trends"}),l.jsx(Uy,{data:h.trends||[],showProviderLines:!0,height:250})]}),r==="providers"&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Provider Breakdown"}),l.jsx(Hy,{data:h.providerBreakdown})]}),r==="sessions"&&l.jsx($y,{sessions:v,expandedSession:u,onToggle:T=>c(u===T?null:T)}),l.jsx("div",{className:"text-center py-4 border-t border-gray-800/50",children:l.jsx("span",{className:"text-xs text-gray-600",children:"More providers coming soon"})})]})}const uu=37,P0=160,I0=5;function $y({sessions:r,expandedSession:o,onToggle:u}){const c=j.useRef(null),[d,x]=j.useState(0),h=j.useCallback(()=>{c.current&&x(c.current.scrollTop)},[]),N=j.useMemo(()=>r.map(R=>(R.sessionId||"-")===o?P0:uu),[r,o]),p=j.useMemo(()=>{const R=[];let b=0;for(const w of N)R.push(b),b+=w;return R},[N]),m=p.length>0?p[p.length-1]+N[N.length-1]:0,v=Math.min(m,uu*20),y=j.useMemo(()=>{if(r.length===0)return{start:0,end:0};const R=d,b=d+v;let w=0,T=r.length-1;for(;w<T;){const V=w+T>>1;p[V]+N[V]<=R?w=V+1:T=V}const U=Math.max(0,w-I0);for(w=U,T=r.length-1;w<T;){const V=w+T+1>>1;p[V]>=b?T=V-1:w=V}const J=Math.min(r.length,w+I0+1);return{start:U,end:J}},[d,v,r.length,p,N]);if(j.useEffect(()=>{if(!o||!c.current)return;const R=r.findIndex(U=>(U.sessionId||"-")===o);if(R<0)return;const b=p[R],w=b+P0,T=c.current;w>T.scrollTop+v?T.scrollTop=w-v:b<T.scrollTop&&(T.scrollTop=b)},[o,r,p,v]),r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No session data available"})});const E=r.slice(y.start,y.end),M=y.start>0?p[y.start]:0,z=y.end<r.length?m-p[y.end]:0;return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"}),l.jsxs("span",{className:"text-xs text-gray-500",children:[r.length," sessions"]})]}),l.jsx("table",{className:"w-full table-fixed",children:l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500 w-8"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Model"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Input"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Output"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cache"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Cost"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"When"})]})})}),l.jsx("div",{ref:c,onScroll:h,className:"overflow-y-auto custom-scrollbar",style:{maxHeight:`${v}px`},children:l.jsxs("div",{style:{height:`${m}px`,position:"relative"},children:[M>0&&l.jsx("div",{style:{height:`${M}px`}}),l.jsx("table",{className:"w-full table-fixed",children:l.jsx("tbody",{children:E.map(R=>{const b=R.sessionId||"-",w=o===b,T=(R.cacheReadTokens||0)+(R.cacheWriteTokens||0);return l.jsxs(j.Fragment,{children:[l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",style:{height:`${uu}px`},onClick:()=>u(b),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 w-8",children:l.jsx("span",{className:`inline-block transition-transform ${w?"rotate-90":""}`,children:"▸"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:b.slice(0,8)}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(ie,{label:R.model||"unknown",variant:"default"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(R.inputTokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Zl(R.outputTokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:T>0?Zl(T):"-"}),l.jsxs("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:["$",R.cost?.toFixed(4)||"0.0000"]}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:R.duration?ex(R.duration):"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Gy(R.timestamp)})]}),w&&l.jsx("tr",{className:"border-b border-gray-800/50",children:l.jsx("td",{colSpan:9,className:"px-6 py-3 bg-gray-800/20",children:l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Input Tokens"}),l.jsx("span",{className:"text-gray-300 font-mono",children:R.inputTokens.toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Output Tokens"}),l.jsx("span",{className:"text-gray-300 font-mono",children:R.outputTokens.toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Write"}),l.jsx("span",{className:"text-gray-300 font-mono",children:(R.cacheWriteTokens||0).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Read"}),l.jsx("span",{className:"text-gray-300 font-mono",children:(R.cacheReadTokens||0).toLocaleString()})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cost"}),l.jsxs("span",{className:"text-amber-400 font-mono",children:["$",R.cost?.toFixed(6)||"0"]})]}),R.savings!=null&&R.savings>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Cache Savings"}),l.jsxs("span",{className:"text-emerald-400 font-mono",children:["$",R.savings.toFixed(6)]})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Duration"}),l.jsx("span",{className:"text-gray-300",children:R.duration?ex(R.duration):"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Session ID"}),l.jsx("span",{className:"text-gray-400 font-mono text-[10px]",children:R.sessionId})]})]})})})]},b)})})}),z>0&&l.jsx("div",{style:{height:`${z}px`}})]})})]})}function Nr({label:r,value:o,total:u,color:c}){const d=u>0?o/u*100:0,x={"bg-indigo-500":"rgb(99 102 241 / 0.6)","bg-cyan-500":"rgb(6 182 212 / 0.6)","bg-emerald-500":"rgb(16 185 129 / 0.6)","bg-amber-500":"rgb(245 158 11 / 0.6)"};return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-xs text-gray-500",children:[Zl(o)," (",d.toFixed(1),"%)"]})]}),l.jsx("div",{className:"h-2 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full",style:{width:`${d}%`,backgroundColor:x[c]||c}})})]})}function qy(r){const o=new Map;for(const u of r){const c=u.model||"unknown",d=o.get(c)||{cost:0,tokens:0,sessions:0};d.cost+=u.cost||0,d.tokens+=(u.inputTokens||0)+(u.outputTokens||0),d.sessions++,o.set(c,d)}return Array.from(o.entries()).map(([u,c])=>({model:u,...c})).sort((u,c)=>c.cost-u.cost)}function Zl(r){return r?r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:String(r):"0"}function Yy(r){return r?r.toLocaleString():"0"}function ex(r){const o=Math.round(r);if(o<60)return`${o}s`;const u=Math.floor(o/60),c=o%60;return u<60?`${u}m ${c}s`:`${Math.floor(u/60)}h ${u%60}m`}function Gy(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function zr(){const[r,o]=j.useState(!1),[u,c]=j.useState(null),[d,x]=j.useState(null),[h,N]=j.useState([]),[p,m]=j.useState("idle"),v=j.useRef(null),y=j.useRef(null);Ue("command-output",z=>{const R=z;y.current&&R.executionId===y.current&&R.line&&N(b=>[...b,R.line])}),Ue("command-complete",z=>{const R=z;if(y.current&&R.executionId===y.current){if(v.current&&(clearTimeout(v.current),v.current=null),o(!1),R.exitCode===0)m("success"),N(b=>[...b,"Command completed successfully."]);else{m("error");const b=`Command failed (exit code ${R.exitCode??"unknown"})`;x(b),N(w=>[...w,b])}y.current=null}}),j.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]);const E=j.useCallback(async(z,R)=>{const b=R?.queryParams,w=R?.timeoutMs??6e4;o(!0),x(null),N([`> specweave ${z}${b?` (${Object.values(b).join(", ")})`:""}`]),m("running");try{const T=b?"?"+new URLSearchParams(b).toString():"",J=await(await fetch(`/api/commands/${z}${T}`,{method:"POST"})).json();if(!J.ok)return x(J.error||"Command failed"),m("error"),N(ae=>[...ae,`Error: ${J.error||"Command failed"}`]),o(!1),null;c(J.data),y.current=J.data?.id||null;const V=Math.round(w/1e3);return v.current=setTimeout(()=>{y.current&&(y.current=null,o(!1),m("error"),x(`Command timed out after ${V} seconds`),N(ae=>[...ae,`Timed out after ${V} seconds.`]))},w),J.data}catch(T){return x(String(T)),m("error"),N(U=>[...U,`Error: ${String(T)}`]),o(!1),null}},[]),M=j.useCallback(()=>{o(!1),c(null),x(null),N([]),m("idle"),y.current=null,v.current&&(clearTimeout(v.current),v.current=null)},[]);return{execute:E,running:r,result:u,error:d,output:h,status:p,reset:M}}function Vy(r){switch(r){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function Xy(r){switch(r){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return r||"Unknown"}}function Qy(){const[r,o]=j.useState("health"),[u,c]=j.useState(null),[d,x]=j.useState(0),[h,N]=j.useState([]);Ue("sync-update",()=>x(H=>H+1)),Ue("sync-error",()=>x(H=>H+1));const{data:p,loading:m,error:v,refetch:y}=Te(`/api/sync/status?_r=${d}`);j.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=20").then(H=>H.json()).then(H=>{H.ok&&Array.isArray(H.data)&&N(H.data)}).catch(()=>{})},[d]);const{data:E,loading:M}=Te(`/api/sync/audit?limit=100&_r=${d}`),{data:z,loading:R}=Te(`/api/sync/audit/summary?_r=${d}`),{execute:b,running:w}=zr(),T=async(H,W)=>{const I=W?`${W}-${H}`:H;c(I);try{const Ee=new URLSearchParams(window.location.search).get("project")||"",He=new URLSearchParams;He.set("platform",H),W&&He.set("repo",W),Ee&&He.set("project",Ee);const ze=new AbortController,je=setTimeout(()=>ze.abort(),3e4);await fetch(`/api/sync/verify?${He.toString()}`,{method:"POST",signal:ze.signal}),clearTimeout(je),y()}catch{}c(null)};if(m||M||R)return l.jsx(Ie,{});if(v)return l.jsx(Gt,{message:v,onRetry:y});if(!p)return null;const U=E?.length||0,J=E?.filter(H=>H.result==="error").length||0,V=E?.filter(H=>H.conflict)||[],ae=p.isUmbrella&&p.repos&&p.repos.length>0;let Z=0,K=0;if(ae&&p.repos)for(const H of p.repos){const W=Object.values(H.platforms).filter(I=>I.connectionStatus!=="not_configured");K+=W.length,Z+=W.filter(I=>I.connectionStatus==="connected").length}else{const H=Object.entries(p.platforms).filter(([W])=>["github","jira","ado"].includes(W));K=H.length,Z=H.filter(([,W])=>W.connectionStatus==="connected").length}return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Sync Health"}),!ae&&l.jsx("button",{onClick:()=>b("sync-push"),disabled:w,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:w?"Syncing...":"Sync Now"})]}),p.permissions&&l.jsx(Zy,{permissions:p.permissions,onSave:y}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:ae?"Repos":"Platforms",value:ae?p.repos.length:K,subtitle:`${Z} connected`,color:"indigo"}),l.jsx(ne,{title:"Audit Entries",value:U,color:"cyan"}),l.jsx(ne,{title:"Errors",value:J,color:"rose"}),l.jsx(ne,{title:"Conflicts",value:V.length,color:"amber"})]}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["health","audit","conflicts"].map(H=>l.jsx("button",{onClick:()=>o(H),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===H?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H==="health"?"Platform Health":H==="audit"?"Audit Log":`Conflicts (${V.length})`},H))}),r==="health"&&l.jsx(l.Fragment,{children:ae&&p.repos?l.jsx(Ky,{repos:p.repos,auditSummary:z,verifying:u,onVerify:T,execute:b,running:w}):l.jsx(Jy,{platforms:p.platforms,auditSummary:z,verifying:u,onVerify:T})}),r==="health"&&h.length>0&&l.jsx(Wy,{errors:h}),r==="audit"&&l.jsx(tx,{entries:E||[]}),r==="conflicts"&&l.jsx(tx,{entries:V}),p.lastUpdated&&l.jsxs("p",{className:"text-xs text-gray-600",children:["Last metadata update: ",new Date(p.lastUpdated).toLocaleString()]})]})}function Zy({permissions:r,onSave:o}){const[u,c]=j.useState(r),[d,x]=j.useState(!1),[h,N]=j.useState(null),p=JSON.stringify(u)!==JSON.stringify(r),m=async()=>{x(!0),N(null);try{const y=new URLSearchParams(window.location.search).get("project")||"",E=y?`?project=${y}`:"",M=await fetch(`/api/config${E}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({sync:{settings:u}})});if(M.ok)o();else{const z=await M.json().catch(()=>({}));N(z.error||`Save failed (HTTP ${M.status})`)}}catch(y){N(String(y))}x(!1)},v=[{key:"canUpsertInternalItems",label:"Create/Update Internal",desc:"Can create/update items created by SpecWeave"},{key:"canUpdateExternalItems",label:"Update External",desc:"Can modify items originally from external tools"},{key:"canUpdateStatus",label:"Update Status",desc:"Can close/reopen issues on external platforms"},{key:"autoSyncOnCompletion",label:"Auto-Sync",desc:"Automatically sync when tasks are completed"}];return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Sync Permissions"}),p&&l.jsx("button",{onClick:m,disabled:d,className:"px-2.5 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-[10px] rounded transition-colors",children:d?"Saving...":"Save"})]}),h&&l.jsxs("p",{className:"text-xs text-red-400 mb-2",children:["Failed to save: ",h]}),l.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:v.map(({key:y,label:E,desc:M})=>l.jsxs("button",{onClick:()=>c(z=>({...z,[y]:!z[y]})),className:`text-left p-2.5 rounded-lg border transition-colors ${u[y]?"bg-emerald-500/10 border-emerald-500/30 hover:border-emerald-500/50":"bg-gray-800/30 border-gray-800 hover:border-gray-700"}`,children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${u[y]?"bg-emerald-400":"bg-gray-600"}`}),l.jsx("span",{className:"text-xs font-medium text-gray-300",children:E})]}),l.jsx("p",{className:"text-[10px] text-gray-500 leading-tight",children:M})]},y))})]})}function Ky({repos:r,auditSummary:o,verifying:u,onVerify:c,execute:d,running:x}){return r.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No child repositories configured"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Add repos in umbrella.childRepos in config.json"})]}):l.jsx("div",{className:"space-y-4",children:r.map(h=>{const p=Object.entries(h.platforms).filter(([m])=>["github","jira","ado"].includes(m)).filter(([,m])=>m.connectionStatus!=="not_configured");return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm font-medium text-gray-200",children:h.repoName}),h.hasSpecweave&&l.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-emerald-500/15 text-emerald-400 rounded",children:".specweave"}),!h.hasSpecweave&&l.jsx("span",{className:"px-1.5 py-0.5 text-[9px] font-medium bg-gray-700/50 text-gray-500 rounded",children:"no .specweave"})]}),l.jsx("span",{className:"text-[10px] text-gray-600",children:h.repoPath})]}),l.jsx("button",{onClick:()=>d("sync-push",{queryParams:{repo:h.repoId}}),disabled:x||!h.hasSpecweave,title:h.hasSpecweave?"Sync this repository":"Initialize .specweave in this repo to enable sync",className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-40 disabled:cursor-not-allowed text-white text-xs rounded-lg transition-colors",children:x?"Syncing...":"Sync Now"})]}),p.length===0?l.jsxs("div",{className:"text-xs text-gray-600 p-3 bg-gray-800/20 rounded-lg",children:["No platforms configured for this repository.",l.jsx(st,{to:"/config",className:"ml-1 text-indigo-400 hover:text-indigo-300",children:"Configure"})]}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:p.map(([m,v])=>l.jsx(Lx,{platform:m,info:v,summary:o?.[m],verifying:u===`${h.repoId}-${m}`,onVerify:()=>c(m,h.repoId)},m))})]},h.repoId)})})}function Jy({platforms:r,auditSummary:o,verifying:u,onVerify:c}){const d=Object.entries(r).filter(([x])=>["github","jira","ado"].includes(x));return d.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No sync platforms configured"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Configure GitHub, JIRA, or ADO in your config"})]}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(([x,h])=>l.jsx(Lx,{platform:x,info:h,summary:o?.[x],verifying:u===x,onVerify:()=>c(x)},x))})}function Lx({platform:r,info:o,summary:u,verifying:c,onVerify:d}){const x=o.connectionStatus||"unknown";return l.jsxs("div",{className:"bg-gray-800/30 border border-gray-800/50 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Hx,{platform:r}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-gray-300 capitalize",children:r}),o.configDetail&&l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:o.configDetail})]})]}),l.jsx(ie,{label:Xy(x),variant:Vy(x)})]}),o.diagnosticMessage&&l.jsx("div",{className:"text-xs text-gray-500 mb-3 p-2 bg-gray-800/30 rounded-lg",children:o.diagnosticMessage}),x==="not_configured"&&l.jsx(st,{to:"/config",className:"block text-center text-xs text-indigo-400 hover:text-indigo-300 py-2 border border-gray-800 rounded-lg hover:border-indigo-500/30 transition-colors",children:"Configure in Settings"}),x==="configured_never_synced"&&l.jsx("button",{onClick:d,disabled:c,className:"w-full text-xs text-indigo-400 hover:text-indigo-300 py-2 border border-gray-800 rounded-lg hover:border-indigo-500/30 transition-colors disabled:opacity-50",children:c?"Verifying...":"Verify Connection"}),x==="sync_failed"&&l.jsx("button",{onClick:d,disabled:c,className:"w-full text-xs text-amber-400 hover:text-amber-300 py-2 border border-amber-500/20 rounded-lg hover:border-amber-500/40 transition-colors disabled:opacity-50",children:c?"Verifying...":"Retry Sync"}),l.jsxs("div",{className:"space-y-2 mt-3",children:[o.lastImport&&l.jsx(Xl,{label:"Last Import",value:new Date(o.lastImport).toLocaleString()}),x==="connected"&&!o.lastImport&&l.jsx(Xl,{label:"Status",value:"Connected, no imports yet"}),o.lastImportCount!=null&&o.lastImportCount>0&&l.jsx(Xl,{label:"Items Imported",value:o.lastImportCount.toLocaleString()}),o.lastSkippedCount!=null&&o.lastSkippedCount>0&&l.jsx(Xl,{label:"Skipped",value:o.lastSkippedCount.toLocaleString()}),u&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-gray-800 my-2"}),l.jsx(Xl,{label:"Total Ops",value:u.total.toLocaleString()}),l.jsx(Xl,{label:"Success",value:u.success.toLocaleString()}),u.errors>0&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:"Errors"}),l.jsx(ie,{label:String(u.errors),variant:"error"})]})]})]})]})}function Wy({errors:r}){const[o,u]=j.useState(null);return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Sync Errors (last 24h)"}),l.jsx("div",{className:"space-y-2",children:r.map((c,d)=>{const x=`${c.provider}-${c.incrementId}-${d}`,h=o===x;return l.jsxs("div",{children:[l.jsxs("button",{"data-testid":`sync-error-row-${d}`,onClick:()=>u(h?null:x),className:"w-full flex items-start gap-2 p-3 bg-gray-800/50 rounded-lg hover:bg-gray-800/80 transition-colors text-left",children:[l.jsx("div",{className:"w-1.5 h-1.5 rounded-full mt-1.5 bg-rose-400 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-300 capitalize",children:c.provider}),l.jsx(ie,{label:c.incrementId,variant:"default"}),l.jsx(ie,{label:c.outcome,variant:"error"})]}),l.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:c.error}),l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:Bx(c.timestamp)})]}),l.jsx("span",{className:"text-[10px] text-gray-600 mt-1",children:h?"▲":"▼"})]}),h&&l.jsxs("div",{"data-testid":`sync-error-detail-${d}`,className:"mt-1 p-3 bg-gray-800/30 rounded-lg border border-gray-800/50",children:[l.jsx("div",{className:"text-xs text-gray-400 mb-2 font-medium",children:"Full Error"}),l.jsx("pre",{className:"text-xs text-gray-500 whitespace-pre-wrap font-mono mb-2",children:c.error}),c.errorStack&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-xs text-gray-400 mb-1 font-medium",children:"Stack Trace"}),l.jsx("pre",{className:"text-xs text-gray-600 whitespace-pre-wrap font-mono max-h-32 overflow-y-auto",children:c.errorStack.split(`
|
|
12
12
|
`).slice(0,3).join(`
|
|
13
|
-
`)})]})]})]},x)})})]})}function ex({entries:r}){const[o,u]=j.useState(null);if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No audit entries"})});const c={success:"success",error:"error",denied:"warning",skipped:"default"};return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Time"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Platform"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Operation"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Item"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Direction"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Result"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"})]})}),l.jsx("tbody",{children:r.map((d,x)=>{const h=!!d.message,N=o===x;return l.jsxs("tr",{className:`border-b border-gray-800/50 hover:bg-gray-800/30 ${h?"cursor-pointer":""}`,onClick:()=>h&&u(N?null:x),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Ux(d.timestamp)}),l.jsx("td",{className:"px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Ox,{platform:d.platform}),l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:d.platform})]})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:d.operation}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 font-mono max-w-[120px] truncate",children:d.itemId||"-"}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(ie,{label:d.direction,variant:d.direction==="push"?"info":"default"})}),l.jsx("td",{className:"px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ie,{label:d.result,variant:c[d.result]||"default"}),h&&l.jsx("span",{className:"text-[10px] text-gray-600",children:N?"▲":"▼"})]})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 text-right",children:d.duration?`${d.duration}ms`:"-"})]},x)})})]}),o!==null&&r[o]?.message&&l.jsx("div",{className:"border-t border-gray-800 px-4 py-3 bg-gray-800/20",children:l.jsx("pre",{className:"text-xs text-gray-400 whitespace-pre-wrap font-mono max-h-40 overflow-y-auto",children:r[o].message})})]})}function Xl({label:r,value:o}){return l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:r}),l.jsx("span",{className:"text-xs text-gray-400",children:o})]})}function Ox({platform:r}){const o={github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return l.jsx("div",{className:`w-5 h-5 rounded ${o[r]||"bg-gray-700"} flex items-center justify-center`,children:l.jsx("span",{className:"text-[9px] text-white font-bold",children:r[0]?.toUpperCase()})})}function Ux(r){if(!r)return"-";try{const o=new Date(r).getTime();if(isNaN(o))return"-";const u=Date.now()-o,c=Math.floor(u/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}catch{return"-"}}const Lx={prompt_too_long:"error",api_error:"warning",tool_failure:"info",hook_error:"default",rate_limit:"warning",unknown:"default"},Fn=50;function Zy(){const[r,o]=Ut("tab","groups"),[u,c]=Ut("type",""),[d,x]=Ut("q",""),[h,N]=Ut("session",""),[p,m]=j.useState(0),[v,y]=j.useState(d),w=p*Fn,_=u?`&type=${encodeURIComponent(u)}`:"",z=d?`&search=${encodeURIComponent(d)}`:"",[R,b]=j.useState(0);Ue("error-detected",()=>b(ee=>ee+1));const{data:C,loading:T,error:U}=Te(r==="groups"?`/api/errors/groups?_r=${R}`:""),{data:J,loading:V,error:ae}=Te(r==="errors"||r==="groups"?`/api/errors/recent?limit=${Fn}&offset=${w}${_}${z}&_r=${R}`:""),{data:Z,loading:K,error:H}=Te(r==="sessions"||h?`/api/errors/sessions?limit=50&_r=${R}`:""),{data:W,loading:I,error:Ee}=Te(r==="timeline"?`/api/errors/timeline?bucket=60&_r=${R}`:""),He=j.useCallback(()=>{x(v.trim()),m(0),v.trim()&&o("errors")},[v,x,o]);j.useEffect(()=>{h&&Z&&!Z.find(ee=>ee.sessionId===h)&&N("")},[h,Z,N]);const ze=r==="groups"&&T||r==="errors"&&V||r==="timeline"&&I||r==="sessions"&&K,je=U||ae||(r==="sessions"?H:null)||(r==="timeline"?Ee:null),k=J?.total||0,X=J?.errors||[],se=C?.length||0,ye=C?.reduce((ee,Ke)=>ee+Ke.sessions,0)||0,Ne=C?.[0]?.type||"-",S=h?Z?.find(ee=>ee.sessionId===h):null,q=u?(Z||[]).filter(ee=>ee.errors.some(Ke=>Ke.type===u)):Z||[],Q=Math.ceil(k/Fn),P=ee=>{c(ee),o("errors"),N(""),m(0)},ce=ee=>{o(ee),N(""),ee!=="errors"&&m(0)},fe=()=>{c(""),x(""),y(""),m(0)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Error Tracing"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Observability for Claude Code sessions"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{type:"text",value:v,onChange:ee=>y(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&He(),placeholder:"Search errors by message, tool name, or context...",className:"w-full px-3 py-2 text-sm bg-gray-900/50 border border-gray-700 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500/30"}),d&&l.jsx("button",{onClick:()=>{x(""),y(""),m(0)},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 text-xs",children:"clear"})]}),l.jsx("button",{onClick:He,className:"px-4 py-2 text-sm bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg transition-colors",children:"Search"})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Total Errors",value:k,color:"rose"}),l.jsx(ne,{title:"Error Types",value:se,color:"amber"}),l.jsx(ne,{title:"Affected Sessions",value:ye,color:"indigo"}),l.jsx(ne,{title:"Most Common",value:Ne,color:"cyan"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["groups","errors","timeline","sessions"].map(ee=>l.jsx("button",{onClick:()=>ce(ee),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===ee?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:ee==="groups"?"Error Groups":ee==="errors"?"All Errors":ee==="timeline"?"Timeline":"Sessions"},ee))}),(u||d)&&l.jsxs("div",{className:"flex items-center gap-2",children:[u&&l.jsx(ie,{label:`type: ${u.replace(/_/g," ")}`,variant:"info"}),d&&l.jsx(ie,{label:`search: ${d.slice(0,20)}`,variant:"default"}),l.jsx("button",{onClick:fe,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"clear all"})]})]}),je&&l.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-3 flex items-center justify-between",children:[l.jsx("div",{className:"text-sm text-rose-300",children:je}),l.jsx("button",{onClick:()=>window.location.reload(),className:"text-xs text-rose-400 hover:text-rose-200 px-2 py-1 border border-rose-700 rounded transition-colors",children:"Retry"})]}),h&&S&&l.jsx(Py,{session:S,onClose:()=>N("")}),ze&&!h&&l.jsx(Ie,{}),!h&&!ze&&r==="groups"&&l.jsx(Ky,{groups:C||[],onGroupClick:P}),!h&&!ze&&r==="errors"&&l.jsx(Jy,{errors:X,total:k,page:p,totalPages:Q,onPageChange:m,onSessionClick:ee=>{N(ee),o("sessions")}}),!h&&!ze&&r==="timeline"&&l.jsx(Wy,{buckets:W||[],errors:X,onSessionClick:ee=>N(ee)}),!h&&!ze&&r==="sessions"&&l.jsx(Fy,{sessions:q,onSelect:ee=>N(ee)}),!ze&&!je&&k===0&&!h&&l.jsx(Eu,{title:"No errors detected",description:"Claude Code session logs are clean"})]})}function Ky({groups:r,onGroupClick:o}){return r.length===0?null:l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Groups"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Type"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Last Seen"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Sample Message"})]})}),l.jsx("tbody",{children:r.map(u=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2",children:l.jsx(ie,{label:u.type.replace(/_/g," "),variant:Lx[u.type]||"default"})}),l.jsx("td",{className:"px-4 py-2 text-right",children:l.jsx("button",{onClick:()=>o(u.type),className:"text-sm text-indigo-400 hover:text-indigo-300 font-mono transition-colors",title:`View all ${u.count} errors of this type`,children:u.count})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.sessions}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Kl(u.lastSeen),children:as(u.lastSeen)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 max-w-xs truncate",children:u.recentMessages[0]||"-"})]},u.type))})]})]})}function Jy({errors:r,total:o,page:u,totalPages:c,onPageChange:d,onSessionClick:x}){const[h,N]=j.useState(new Set),p=j.useCallback(y=>{N(w=>{const _=new Set(w);return _.has(y)?_.delete(y):_.add(y),_})},[]);if(r.length===0)return l.jsx(Eu,{title:"No errors",description:"No errors match the current filter"});const m=u*Fn+1,v=Math.min(u*Fn+r.length,o);return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Errors ",m,"–",v," of ",o]}),c>1&&l.jsx(tx,{page:u,totalPages:c,onChange:d})]}),l.jsx("div",{className:"divide-y divide-gray-800/50",children:r.map((y,w)=>{const _=h.has(w),z=y.message.length>120;return l.jsx("div",{className:"px-4 py-3 hover:bg-gray-800/20 transition-colors",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex-shrink-0 mt-0.5",children:l.jsx(ie,{label:y.type.replace(/_/g," "),variant:Lx[y.type]||"default"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:`text-xs text-gray-300 ${_?"whitespace-pre-wrap break-words":"truncate"} ${z?"cursor-pointer":""}`,onClick:()=>z&&p(w),title:z?_?"Click to collapse":"Click to expand details":void 0,children:[z&&l.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:_?"▼":"▶"}),_?y.message:y.message.slice(0,200),!_&&z&&l.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),y.context?.toolName&&l.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[l.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:y.context.toolName}),y.context.toolInput&&l.jsx("span",{className:"text-[10px] text-gray-500 font-mono truncate max-w-md",children:y.context.toolInput})]}),_&&l.jsx(Hx,{context:y.context})]}),l.jsxs("div",{className:"flex-shrink-0 text-right",children:[l.jsx("div",{className:"text-[10px] text-gray-300 font-mono",title:Kl(y.timestamp),children:as(y.timestamp)}),l.jsx("div",{className:"text-[10px] text-gray-600",children:Kl(y.timestamp)}),l.jsx("button",{onClick:()=>x(y.sessionId),className:"text-[10px] text-indigo-400 hover:text-indigo-300 font-mono mt-0.5 transition-colors",title:"View full session",children:y.sessionId.slice(0,8)}),y.context?.messageIndex!=null&&l.jsxs("div",{className:"text-[10px] text-gray-600",children:["msg #",y.context.messageIndex]})]})]})},`${y.sessionId}-${y.timestamp}-${w}`)})}),c>1&&l.jsx("div",{className:"px-5 py-3 border-t border-gray-800 flex justify-end",children:l.jsx(tx,{page:u,totalPages:c,onChange:d})})]})}function Hx({context:r}){if(!r)return null;const{precedingAction:o,recentTools:u}=r;return!o&&(!u||u.length===0)?null:l.jsxs("div",{className:"mt-2 p-2 bg-gray-900/60 border border-gray-800 rounded-lg space-y-1.5",children:[o&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"What preceded this error:"}),l.jsx("div",{className:"text-[11px] text-gray-400 font-mono mt-0.5",children:o})]}),u&&u.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Recent tool chain:"}),l.jsx("div",{className:"flex flex-col gap-0.5 mt-0.5",children:u.map((c,d)=>l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[l.jsxs("span",{className:"text-gray-600",children:[u.length-d,"."]}),l.jsx("span",{className:"font-mono text-amber-400/80",children:c.name}),c.input&&l.jsx("span",{className:"text-gray-600 font-mono truncate max-w-sm",children:c.input})]},d))})]})]})}function tx({page:r,totalPages:o,onChange:u}){return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:()=>u(Math.max(0,r-1)),disabled:r===0,className:"px-2 py-1 text-xs rounded transition-colors disabled:text-gray-700 text-gray-400 hover:text-white hover:bg-gray-700",children:"Prev"}),l.jsxs("span",{className:"text-[10px] text-gray-500 px-2",children:[r+1," / ",o]}),l.jsx("button",{onClick:()=>u(Math.min(o-1,r+1)),disabled:r>=o-1,className:"px-2 py-1 text-xs rounded transition-colors disabled:text-gray-700 text-gray-400 hover:text-white hover:bg-gray-700",children:"Next"})]})}function Wy({buckets:r,errors:o,onSessionClick:u}){const[c,d]=j.useState(null),x=Math.max(...r.map(m=>m.count),1),h={tool_failure:"bg-blue-500",prompt_too_long:"bg-rose-500",api_error:"bg-amber-500",hook_error:"bg-gray-500",rate_limit:"bg-amber-400",unknown:"bg-gray-600"},N=c?o.filter(m=>{const v=new Date(m.timestamp).getTime();return v>=new Date(c.start).getTime()&&v<new Date(c.end).getTime()}):o,p=m=>{try{return new Date(m).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return m}};return l.jsxs("div",{className:"space-y-4",children:[r.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Density (per hour)"}),c&&l.jsx("button",{onClick:()=>d(null),className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"Clear filter"})]}),l.jsx("div",{className:"flex items-end gap-px h-24",children:r.map((m,v)=>{const y=m.count/x*100,w=c?.start===m.start;return l.jsx("div",{className:"flex-1 flex flex-col items-center justify-end cursor-pointer group relative",onClick:()=>d(w?null:m),title:`${p(m.start)}: ${m.count} errors`,children:l.jsx("div",{className:`w-full min-h-[2px] rounded-t transition-all ${w?"bg-indigo-400":"bg-rose-500/70 group-hover:bg-rose-400"}`,style:{height:`${Math.max(y,2)}%`}})},v)})}),l.jsxs("div",{className:"flex justify-between mt-1",children:[l.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[0].start):""}),l.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[r.length-1].start):""})]}),l.jsx("div",{className:"flex gap-3 mt-2",children:Object.entries(h).map(([m,v])=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${v}`}),l.jsx("span",{className:"text-[9px] text-gray-600",children:m.replace(/_/g," ")})]},m))})]}),c&&l.jsxs("div",{className:"text-xs text-gray-400 px-1",children:["Showing ",N.length," errors from ",p(c.start)]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:c?"Filtered Errors":"Recent Errors"}),l.jsxs("div",{className:"space-y-1 max-h-[400px] overflow-y-auto custom-scrollbar",children:[N.length===0&&l.jsx("p",{className:"text-xs text-gray-600",children:"No errors in this time range"}),N.slice(0,100).map((m,v)=>l.jsxs("div",{className:"flex items-start gap-3 py-2 px-2 hover:bg-gray-800/30 rounded cursor-pointer",onClick:()=>u(m.sessionId),children:[l.jsx("div",{className:`w-2 h-2 rounded-full mt-1.5 flex-shrink-0 ${h[m.type]||"bg-gray-500"}`}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:m.type.replace(/_/g," ")}),m.context?.toolName&&l.jsx("span",{className:"text-[10px] font-mono px-1 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:m.context.toolName}),l.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:as(m.timestamp)}),l.jsx("span",{className:"text-[10px] text-gray-600",children:Kl(m.timestamp)})]}),l.jsx("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:m.message}),m.context?.precedingAction&&l.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5 truncate",children:["After: ",m.context.precedingAction]})]})]},v))]})]})]})}function Fy({sessions:r,onSelect:o}){return r.length===0?null:l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Branch"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Messages"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tool Calls"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Errors"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Started"})]})}),l.jsx("tbody",{children:r.map(u=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",onClick:()=>o(u.sessionId),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:u.sessionId.slice(0,8)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:u.gitBranch||"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.messageCount}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.toolCallCount}),l.jsx("td",{className:"px-4 py-2 text-right",children:u.errors.length>0?l.jsx(ie,{label:String(u.errors.length),variant:"error"}):l.jsx("span",{className:"text-xs text-gray-600",children:"0"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Kl(u.startTime),children:as(u.startTime)})]},u.sessionId))})]})]})}function Py({session:r,onClose:o}){const[u,c]=j.useState(new Set),d=x=>{c(h=>{const N=new Set(h);return N.has(x)?N.delete(x):N.add(x),N})};return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Session: ",l.jsx("span",{className:"font-mono",children:r.sessionId.slice(0,12)})]}),l.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5",children:["v",r.version," | ",r.gitBranch," | ",r.messageCount," messages | ",r.toolCallCount," tool calls"]})]}),l.jsx("button",{onClick:o,className:"px-2 py-1 text-xs text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors",children:"Back"})]}),l.jsxs("div",{className:"flex gap-3 mb-4",children:[l.jsxs("div",{className:"text-xs text-gray-500",children:["Started: ",new Date(r.startTime).toLocaleString()]}),r.endTime&&l.jsxs("div",{className:"text-xs text-gray-500",children:["Ended: ",new Date(r.endTime).toLocaleString()]})]}),r.errors.length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No errors in this session"}):l.jsx("div",{className:"space-y-2",children:r.errors.map((x,h)=>{const N=u.has(h),p=x.message.length>150;return l.jsxs("div",{className:"p-3 bg-gray-800/50 rounded-lg border-l-2 border-rose-500/50",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(ie,{label:x.type.replace(/_/g," "),variant:"error"}),x.context?.toolName&&l.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:x.context.toolName}),l.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:as(x.timestamp)}),l.jsx("span",{className:"text-[10px] text-gray-600",children:Kl(x.timestamp)})]}),l.jsxs("div",{className:`text-xs text-gray-400 ${N?"whitespace-pre-wrap break-words":""} ${p?"cursor-pointer":""}`,onClick:()=>p&&d(h),title:p?N?"Click to collapse":"Click to expand":void 0,children:[p&&l.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:N?"▼":"▶"}),N?x.message:x.message.slice(0,300),!N&&p&&l.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),x.context?.toolInput&&l.jsx("div",{className:"text-[10px] text-gray-500 font-mono mt-1.5 bg-gray-900/50 px-2 py-1 rounded",children:x.context.toolInput}),x.context?.messageIndex!=null&&l.jsxs("div",{className:"text-[10px] text-gray-600 mt-1",children:["At message #",x.context.messageIndex]}),N&&l.jsx(Hx,{context:x.context})]},h)})})]})}function Kl(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function as(r){if(!r)return"-";try{return new Date(r).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return r}}const Iy=[{value:"all",label:"All"},{value:"command",label:"Commands"},{value:"hook",label:"Hooks"},{value:"notification",label:"Notifications"},{value:"cost",label:"Cost"}],ev=[{value:"all",label:"All Levels"},{value:"error",label:"Errors"},{value:"warning",label:"Warnings"},{value:"info",label:"Info"}];function tv(){const[r,o]=Ut("category","all"),[u,c]=Ut("severity","all"),d=r||"all",x=u||"all",[h,N]=j.useState([]),[p,m]=j.useState(200),[v,y]=j.useState(null),w=new URLSearchParams;w.set("limit",String(p)),d!=="all"&&w.set("categories",d),x!=="all"&&w.set("severity",x);const{data:_,loading:z}=Te(`/api/activity/stream?${w.toString()}`),R=j.useCallback(H=>{N(W=>[H,...W].slice(0,50))},[]);if(Ue("activity",R),z)return l.jsx(Ie,{});const b=[...h,..._||[]],C=new Set,T=[];for(const H of b){const W=`${H.timestamp}:${H.title}`;C.has(W)||(C.add(W),T.push(H))}const U=T.filter(H=>!(d!=="all"&&H.category!==d||x!=="all"&&H.severity!==x)),J=T.filter(H=>H.severity==="error").length,V=T.filter(H=>H.severity==="warning").length,ae=new Set(T.map(H=>H.source)),Z=H=>{y(W=>W===H?null:H)},K=()=>{m(H=>H+200)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Activity Stream"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400 pulse-dot"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Live"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Total Events",value:T.length,color:"indigo"}),l.jsx(ne,{title:"Errors",value:J,color:"rose"}),l.jsx(ne,{title:"Warnings",value:V,color:"amber"}),l.jsx(ne,{title:"Sources",value:ae.size,color:"cyan"})]}),l.jsxs("div",{className:"flex flex-wrap gap-4",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:Iy.map(H=>l.jsx("button",{onClick:()=>o(H.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${d===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:ev.map(H=>l.jsx("button",{onClick:()=>c(H.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${x===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),l.jsxs("span",{className:"text-xs text-gray-500 self-center",children:[U.length," events"]})]}),l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl divide-y divide-gray-800/50",children:U.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No events match filters"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Try adjusting category or severity filters"})]}):l.jsxs(l.Fragment,{children:[U.slice(0,p).map((H,W)=>{const I=`${H.timestamp}-${W}`,Ee=v===I;return l.jsx(av,{event:H,isExpanded:Ee,onToggle:()=>Z(I)},I)}),U.length>=p&&l.jsx("div",{className:"p-4 text-center",children:l.jsx("button",{onClick:K,className:"px-4 py-2 text-xs text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded-lg transition-colors",children:"Load more events"})})]})})]})}function av({event:r,isExpanded:o,onToggle:u}){const c=r.severity==="error"?"bg-rose-400":r.severity==="warning"?"bg-amber-400":"bg-gray-600",d={command:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",hook:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101",notification:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",cost:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1",sync:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581"},x=r.detail||r.metadata&&Object.keys(r.metadata).length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`px-4 py-3 flex items-start gap-3 transition-colors ${x?"cursor-pointer hover:bg-gray-800/20":""}`,onClick:x?u:void 0,children:[l.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-2 flex-shrink-0 ${c}`}),l.jsx("div",{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-gray-500",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:d[r.category]||d.command})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-gray-300",children:r.title}),l.jsx(ie,{label:r.category,variant:Mr(r.severity)})]}),r.detail&&!o&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5 truncate",children:r.detail}),r.source&&l.jsxs("span",{className:"text-[10px] text-gray-600 mt-0.5 block",children:["via ",r.source]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[r.timestamp&&l.jsx("span",{className:"text-[10px] text-gray-600 whitespace-nowrap",children:lv(r.timestamp)}),x&&l.jsx("svg",{className:`w-4 h-4 text-gray-600 transition-transform duration-200 ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),o&&l.jsxs("div",{className:"px-4 pb-3 ml-10 space-y-2",children:[r.detail&&l.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Detail"}),l.jsx("p",{className:"text-xs text-gray-300 whitespace-pre-wrap",children:r.detail})]}),r.metadata&&Object.keys(r.metadata).length>0&&l.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Metadata"}),l.jsx("pre",{className:"text-xs text-gray-400 font-mono whitespace-pre-wrap overflow-x-auto",children:JSON.stringify(r.metadata,null,2)})]})]})]})}function lv(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function nv(){const[r,o]=j.useState(0);Ue("config-changed",()=>o(K=>K+1));const{data:u,loading:c,error:d,refetch:x}=Te(`/api/config?_r=${r}`),{activeProject:h}=rl(),[N,p]=j.useState(new Set),[m,v]=j.useState({}),[y,w]=j.useState(!1),[_,z]=j.useState(null),[R,b]=j.useState([]);if(c)return l.jsx(Ie,{});if(d)return l.jsx(Gt,{message:d,onRetry:x});if(!u)return null;const C=K=>{p(H=>{const W=new Set(H);return W.has(K)?W.delete(K):W.add(K),W})},T=Object.keys(m).length>0,U=(K,H)=>{v(W=>({...W,[K]:H})),b(W=>W.filter(I=>I.path!==K))},J=async()=>{if(T){w(!0),z(null),b([]);try{const K={};for(const[ze,je]of Object.entries(m))rv(K,ze,je);const H=h?`?project=${h.id}`:"",I=await(await fetch(`/api/config/validate${H}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})).json();if(I.errors&&I.errors.length>0){b(I.errors),z("Validation failed. Fix errors before saving."),w(!1);return}const He=await(await fetch(`/api/config${H}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})).json();He.ok?(z("Saved successfully"),v({}),b([]),x(),setTimeout(()=>z(null),3e3)):z(`Error: ${He.error}`)}catch(K){z(`Error: ${K}`)}finally{w(!1)}}},V=()=>{v({}),z(null),b([])},ae=Object.entries(u).filter(([K,H])=>typeof H=="object"&&H!==null),Z=Object.entries(u).filter(([K,H])=>typeof H!="object"||H===null);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Configuration"}),l.jsx("span",{className:"text-xs text-gray-500",children:".specweave/config.json"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[_&&l.jsx("span",{className:`text-xs ${_.startsWith("Error")||_.startsWith("Validation")?"text-rose-400":"text-emerald-400"}`,children:_}),T&&l.jsxs(l.Fragment,{children:[l.jsx(ie,{label:`${Object.keys(m).length} changes`,variant:"warning"}),l.jsx("button",{onClick:V,className:"px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200 border border-gray-700 rounded-lg transition-colors",children:"Discard"}),l.jsx("button",{onClick:J,disabled:y,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:y?"Saving...":"Save Changes"})]})]})]}),_&&!T&&_==="Saved successfully"&&l.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg px-4 py-2 flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400"}),l.jsx("span",{className:"text-xs text-emerald-400",children:"Configuration saved successfully"})]}),R.length>0&&l.jsxs("div",{className:"bg-rose-500/10 border border-rose-500/30 rounded-lg px-4 py-3 space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-rose-400"}),l.jsx("span",{className:"text-xs text-rose-400 font-medium",children:"Validation errors"})]}),R.map((K,H)=>l.jsxs("div",{className:"text-xs text-rose-300 pl-4",children:[l.jsx("span",{className:"font-mono text-rose-400",children:K.path}),": ",K.message]},H))]}),Z.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"General"}),l.jsx("div",{className:"space-y-3",children:Z.map(([K,H])=>l.jsx(kx,{path:K,label:K,value:m[K]!==void 0?m[K]:H,original:H,onChange:W=>U(K,W),edited:m[K]!==void 0,validationError:R.find(W=>W.path===K)?.message},K))})]}),ae.map(([K,H])=>l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("button",{onClick:()=>C(K),className:"w-full px-5 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 capitalize",children:K}),ax(m,K)>0&&l.jsx(ie,{label:`${ax(m,K)} edited`,variant:"warning"}),R.some(W=>W.path.startsWith(K+"."))&&l.jsx(ie,{label:"errors",variant:"error"})]}),l.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${N.has(K)?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),N.has(K)&&l.jsx("div",{className:"px-5 py-3 border-t border-gray-800",children:l.jsx(Bx,{data:H,path:K,edits:m,onChange:U,validationErrors:R,depth:0})})]},K))]})}function Bx({data:r,path:o,edits:u,onChange:c,validationErrors:d,depth:x}){return x>4?l.jsx("span",{className:"text-xs text-gray-600",children:"..."}):l.jsx("div",{className:"space-y-3",style:{marginLeft:x>0?16:0},children:Object.entries(r).map(([h,N])=>{const p=`${o}.${h}`;return N&&typeof N=="object"&&!Array.isArray(N)?l.jsxs("div",{children:[l.jsx("span",{className:"text-xs text-gray-400 font-mono font-medium",children:h}),l.jsx(Bx,{data:N,path:p,edits:u,onChange:c,validationErrors:d,depth:x+1})]},h):l.jsx(kx,{path:p,label:h,value:u[p]!==void 0?u[p]:N,original:N,onChange:m=>c(p,m),edited:u[p]!==void 0,validationError:d.find(m=>m.path===p)?.message},h)})})}function kx({path:r,label:o,value:u,original:c,onChange:d,edited:x,validationError:h}){return typeof c=="boolean"||typeof u=="boolean"?l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),l.jsx("button",{onClick:()=>d(!u),className:`relative w-9 h-5 rounded-full transition-colors ${u?"bg-indigo-600":"bg-gray-700"} ${x?"ring-1 ring-amber-500/50":""}`,children:l.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-transform ${u?"left-[18px]":"left-0.5"}`})})]}),h&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:h})]}):typeof c=="number"||typeof u=="number"?l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),l.jsx("input",{type:"number",value:String(u??""),onChange:N=>d(N.target.value?Number(N.target.value):0),className:`bg-gray-800 border text-xs text-amber-400 font-mono rounded px-2 py-1 w-24 text-right ${h?"border-rose-500":x?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),h&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:h})]}):Array.isArray(c)||Array.isArray(u)?l.jsx(sv,{path:r,label:o,value:Array.isArray(u)?u:Array.isArray(c)?c:[],edited:x,onChange:d,validationError:h}):l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),l.jsx("input",{type:"text",value:String(u??""),onChange:N=>d(N.target.value),className:`bg-gray-800 border text-xs text-gray-300 rounded px-2 py-1 w-48 text-right ${h?"border-rose-500":x?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),h&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:h})]})}function sv({path:r,label:o,value:u,edited:c,onChange:d,validationError:x}){const[h,N]=j.useState(!1),[p,m]=j.useState(""),v=_=>{const z=[...u];z.splice(_,1),d(z)},y=()=>{const _=p.trim();_&&(d([...u,_]),m(""))},w=_=>{_.key==="Enter"&&(_.preventDefault(),y())};return l.jsxs("div",{className:"py-1",children:[l.jsxs("button",{onClick:()=>N(_=>!_),className:"flex items-center justify-between w-full group",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),l.jsxs("div",{className:"flex items-center gap-2",children:[c&&l.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500"}),l.jsxs("span",{className:"text-xs text-gray-400 font-mono",children:["[",u.length," items]"]}),l.jsx("svg",{className:`w-3 h-3 text-gray-500 transition-transform duration-200 ${h?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),h&&l.jsxs("div",{className:"mt-2 ml-4 space-y-1",children:[u.length===0&&l.jsx("p",{className:"text-[10px] text-gray-600",children:"No items"}),u.map((_,z)=>l.jsxs("div",{className:"flex items-center gap-2 group/item",children:[l.jsx("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",children:String(_)}),l.jsx("button",{onClick:()=>v(z),className:"text-[10px] text-gray-600 hover:text-rose-400 opacity-0 group-hover/item:opacity-100 transition-opacity",children:"remove"})]},z)),l.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[l.jsx("input",{type:"text",value:p,onChange:_=>m(_.target.value),onKeyDown:w,placeholder:"Add item...",className:"bg-gray-800 border border-gray-700 text-xs text-gray-300 rounded px-2 py-1 flex-1 focus:ring-indigo-500 focus:border-indigo-500"}),l.jsx("button",{onClick:y,disabled:!p.trim(),className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded disabled:opacity-50 transition-colors",children:"Add"})]})]}),x&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:x})]})}function ax(r,o){return Object.keys(r).filter(u=>u.startsWith(o+".")).length}function rv(r,o,u){const c=o.split(".");let d=r;for(let x=0;x<c.length-1;x++)(!d[c[x]]||typeof d[c[x]]!="object")&&(d[c[x]]={}),d=d[c[x]];d[c[c.length-1]]=u}function Cu({lines:r,status:o,onDismiss:u}){const c=j.useRef(null);return j.useEffect(()=>{c.current?.scrollIntoView({behavior:"smooth"})},[r]),r.length===0&&o==="idle"?null:l.jsxs("div",{className:"mt-4 rounded-lg bg-gray-950 border border-gray-700 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-900 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${o==="running"?"bg-yellow-400 animate-pulse":o==="success"?"bg-green-400":o==="error"?"bg-red-400":"bg-gray-500"}`}),l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:o==="running"?"Running...":o==="success"?"Completed":o==="error"?"Failed":"Output"})]}),o!=="running"&&u&&l.jsx("button",{onClick:u,className:"text-gray-500 hover:text-gray-300 text-xs",children:"Dismiss"})]}),l.jsxs("div",{className:"p-3 max-h-48 overflow-y-auto font-mono text-xs text-gray-300 whitespace-pre-wrap",children:[r.map((d,x)=>l.jsx("div",{children:d},x)),l.jsx("div",{ref:c})]})]})}function iv(){const{data:r,loading:o}=Te("/api/plugins/full"),{execute:u,running:c,output:d,status:x,reset:h}=_r(),[N,p]=j.useState(null);if(o)return l.jsx(Ie,{});const m=r?.plugins||[],v=r?.skills||[],y=r?.lsp,w=r?.warmup,_=r?.triggerCount||0,z=m.reduce((T,U)=>T+U.skillCount,0),R=m.reduce((T,U)=>T+U.commandCount,0),b=T=>v.filter(U=>U.plugin===T).sort((U,J)=>J.count-U.count),C=T=>{p(U=>U===T?null:T)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Plugins & LSP"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>u("lsp-status"),disabled:c,className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Check LSP"}),l.jsx("button",{onClick:()=>u("refresh-plugins"),disabled:c,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:c?"Running...":"Refresh Plugins"})]})]}),l.jsx(Cu,{lines:d,status:x,onDismiss:h}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[l.jsx($a,{label:"Plugins",value:m.length}),l.jsx($a,{label:"Total Skills",value:z}),l.jsx($a,{label:"Total Commands",value:R}),l.jsx($a,{label:"Trigger Keywords",value:_})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Installed Plugins"})}),m.length===0?l.jsx("div",{className:"p-5 text-gray-500 text-xs",children:"No plugins installed"}):l.jsx("div",{className:"divide-y divide-gray-800/50",children:m.map(T=>{const U=N===T.name,J=b(T.name);return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>C(T.name),className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors text-left",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("span",{className:"text-sm text-gray-300",children:T.name}),l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:T.version})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ie,{label:`${T.skillCount} skills`,variant:"info"}),l.jsx(ie,{label:`${T.commandCount} cmds`,variant:"default"}),l.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${U?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),U&&l.jsx("div",{className:"px-4 pb-4 bg-gray-800/20",children:J.length===0?l.jsx("p",{className:"text-xs text-gray-600 py-2",children:"No skill usage data for this plugin"}):l.jsxs("div",{className:"space-y-1 mt-1",children:[l.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1",children:[l.jsx("span",{className:"text-[10px] text-gray-600 uppercase",children:"Skill"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Invocations"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Success"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Last Used"})]}),J.map(V=>l.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1.5 bg-gray-800/40 rounded",children:[l.jsx("span",{className:"text-xs text-gray-300 font-mono truncate",children:V.name}),l.jsx("span",{className:"text-xs text-gray-400 text-right font-mono",children:V.count}),l.jsxs("span",{className:"text-xs text-right font-mono",children:[l.jsx("span",{className:"text-emerald-400",children:V.successCount}),V.failureCount>0&&l.jsxs("span",{className:"text-rose-400",children:["/",V.failureCount]})]}),l.jsx("span",{className:"text-[10px] text-gray-500 text-right",children:V.lastUsed?cv(V.lastUsed):"-"})]},V.name))]})})]},T.name)})})]}),v.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Skill Usage Leaderboard"}),l.jsx(zx,{items:v.sort((T,U)=>U.count-T.count).slice(0,20).map(T=>({label:T.name,value:T.count,color:"#10b981"})),maxBars:20})]}),y&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Status"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ie,{label:y.status,variant:y.status==="ok"?"success":"warning"}),y.checked&&l.jsxs("span",{className:"text-[10px] text-gray-600",children:["Checked: ",new Date(y.checked).toLocaleDateString()]})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[l.jsx($a,{label:"Total Languages",value:y.stats.totalLanguages}),l.jsx($a,{label:"Checked",value:y.stats.checkedLanguages}),l.jsx($a,{label:"Binary Missing",value:y.stats.binaryMissing}),l.jsx($a,{label:"Plugin Missing",value:y.stats.pluginMissing})]}),y.missing.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-xs text-gray-500",children:"Missing Languages"}),y.missing.map((T,U)=>l.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-800/50 rounded",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ie,{label:T.type,variant:T.type==="binary"?"warning":"default"}),l.jsx("span",{className:"text-xs text-gray-300",children:T.language})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"text-[10px] text-gray-500",children:T.binaryInstall}),T.message&&l.jsx("span",{className:"text-[10px] text-gray-600 max-w-[200px] truncate",children:T.message})]})]},U))]})]}),w&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Warmup Status"}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[w.elapsed?`${(w.elapsed/1e3).toFixed(1)}s`:""," |"," ",w.timestamp?new Date(w.timestamp).toLocaleString():""]})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[w.warmedUp.map(T=>l.jsx(ie,{label:T,variant:"success"},T)),w.failed.map(T=>l.jsx(ie,{label:T,variant:"error"},T))]}),w.warmedUp.length===0&&w.failed.length===0&&l.jsx("p",{className:"text-gray-600 text-xs",children:"No warmup data"})]})]})}function $a({label:r,value:o}){return l.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-3 text-center",children:[l.jsx("div",{className:"text-lg font-bold text-gray-300",children:o}),l.jsx("div",{className:"text-[10px] text-gray-500",children:r})]})}function cv(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function uv(){const{data:r,loading:o}=Te("/api/links"),{data:u,loading:c,refetch:d}=Te("/api/services"),{execute:x,running:h,output:N,status:p,reset:m}=_r();if(o||c)return l.jsx(Ie,{});const v=(u||[]).filter(b=>b.status==="running").length,y=(u||[]).length,w=new Map;for(const b of u||[])if(b.port>0&&b.status==="running"){const C=w.get(b.port)||[];C.push(b.name),w.set(b.port,C)}const _=Array.from(w.entries()).filter(([,b])=>b.length>1),z=async b=>{await x(b,{timeoutMs:3e5}),setTimeout(()=>d(),3e3)},R=async b=>{await x(b,{timeoutMs:3e5}),setTimeout(()=>d(),2e3)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Services & Links"}),l.jsx(Cu,{lines:N,status:p,onDismiss:m}),_.length>0&&l.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl p-4 flex items-start gap-3",children:[l.jsx("svg",{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-amber-300",children:"Port Conflict Detected"}),l.jsx("div",{className:"text-xs text-amber-400/80 mt-1",children:_.map(([b,C])=>l.jsxs("span",{className:"block",children:["Port ",b," is used by: ",C.join(", ")]},b))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Services",value:y,color:"indigo",tooltip:`${y} managed services`}),l.jsx(ne,{title:"Running",value:v,color:"emerald",tooltip:`${v} services currently active`}),l.jsx(ne,{title:"External Links",value:(r||[]).length,color:"cyan",tooltip:"Configured external links (docs, repos, etc.)"}),l.jsx(ne,{title:"Stopped",value:y-v,color:"rose",tooltip:`${y-v} services not running`})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Service Status"}),l.jsx("div",{className:"space-y-3",children:(u||[]).map((b,C)=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${b.status==="running"?"bg-emerald-400":"bg-gray-600"}`}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-300",children:b.name}),l.jsx("div",{className:"text-[10px] text-gray-600",children:b.status==="running"&&b.detail?l.jsx("a",{href:b.detail,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 underline transition-colors",children:b.detail}):b.detail})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[b.status==="running"&&b.port>0&&l.jsx(ie,{label:`Port ${b.port}`,variant:"info"}),b.status==="running"?l.jsx(ie,{label:"Running",variant:"success"}):l.jsx(ie,{label:"Stopped",variant:"default"}),b.startCommand&&b.stopCommand?b.status==="running"?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("a",{href:b.detail,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded transition-colors",children:"Open"}),l.jsx("button",{onClick:()=>R(b.stopCommand),disabled:h,className:"px-2 py-1 text-[10px] text-rose-400 hover:text-rose-300 border border-rose-500/30 rounded transition-colors disabled:opacity-50",children:"Stop"})]}):l.jsx("button",{onClick:()=>z(b.startCommand),disabled:h,className:"px-2 py-1 text-[10px] text-emerald-400 hover:text-emerald-300 border border-emerald-500/30 rounded transition-colors disabled:opacity-50",children:h?"Starting...":"Start"}):b.status==="running"&&l.jsx("a",{href:b.detail,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded transition-colors",children:"Open"})]})]},C))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"External Links"}),(r||[]).length===0?l.jsx("p",{className:"text-xs text-gray-500",children:"No external links configured"}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:(r||[]).map((b,C)=>l.jsxs("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg hover:bg-gray-800 transition-colors group",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ov,{type:b.type}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm text-gray-300 group-hover:text-white transition-colors",children:b.name}),l.jsx("div",{className:"text-[10px] text-gray-600 truncate max-w-[200px]",children:b.url})]})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-600 group-hover:text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]},C))})]})]})}function ov({type:r}){const o={docs:"bg-indigo-600",github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return l.jsx("div",{className:`w-8 h-8 rounded-lg ${o[r]||"bg-gray-700"} flex items-center justify-center`,children:l.jsx("span",{className:"text-xs text-white font-bold",children:r[0]?.toUpperCase()})})}const lx={critical:0,warning:1,info:2};function dv(){const[r,o]=j.useState("pending"),[u,c]=j.useState(null),[d,x]=j.useState(0);Ue("notification",()=>x(H=>H+1));const{activeProject:h}=rl(),{data:N,loading:p,error:m,refetch:v}=Te(`/api/notifications?_r=${d}`);if(p)return l.jsx(Ie,{});if(m)return l.jsx(Gt,{message:m,onRetry:v});const y=N||[],w=y.filter(H=>!H.dismissedAt),_=y.filter(H=>!!H.dismissedAt),z=w.filter(H=>H.severity==="critical"),R=w.filter(H=>H.severity==="warning"),C=[...r==="pending"?w:r==="dismissed"?_:y].sort((H,W)=>{const I=lx[H.severity]??3,Ee=lx[W.severity]??3;return I!==Ee?I-Ee:new Date(W.createdAt).getTime()-new Date(H.createdAt).getTime()}),T=async H=>{c(H);try{const W=h?`?project=${h.id}`:"";(await fetch(`/api/notifications/${H}/dismiss${W}`,{method:"POST"})).ok&&v()}finally{c(null)}},U=async()=>{c("__all__");try{const H=h?`?project=${h.id}`:"";for(const W of w)await fetch(`/api/notifications/${W.id}/dismiss${H}`,{method:"POST"});v()}finally{c(null)}},J=H=>H==="critical"?"error":H==="warning"?"warning":"info",V=H=>H==="critical"?"border-l-rose-500":H==="warning"?"border-l-amber-500":"border-l-blue-500",Z=(H=>{const W={};for(const I of H)W[I.severity]||(W[I.severity]=[]),W[I.severity].push(I);return W})(C),K={critical:"Critical",warning:"Warnings",info:"Informational"};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Notifications"}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Pending",value:w.length,color:"indigo"}),l.jsx(ne,{title:"Critical",value:z.length,color:"rose"}),l.jsx(ne,{title:"Warnings",value:R.length,color:"amber"}),l.jsx(ne,{title:"Dismissed",value:_.length,color:"cyan"})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{value:"pending",label:`Pending (${w.length})`},{value:"dismissed",label:`Dismissed (${_.length})`},{value:"all",label:`All (${y.length})`}].map(H=>l.jsx("button",{onClick:()=>o(H.value),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${r===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),w.length>0&&l.jsx("button",{onClick:U,disabled:u==="__all__",className:"px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200 border border-gray-700 rounded-lg transition-colors disabled:opacity-50",children:u==="__all__"?"Dismissing...":"Dismiss All"})]}),C.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mx-auto mb-4",children:l.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})}),l.jsx("p",{className:"text-gray-400 text-sm font-medium",children:r==="pending"?"No pending notifications":"No notifications"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs mx-auto",children:"Notifications appear here when imports complete, discrepancies are found, or syncs fail"})]}):l.jsx("div",{className:"space-y-4",children:["critical","warning","info"].map(H=>{const W=Z[H];return!W||W.length===0?null:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h3",{className:"text-xs font-medium text-gray-400 uppercase",children:K[H]||H}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:["(",W.length,")"]})]}),l.jsx("div",{className:"space-y-2",children:W.map(I=>l.jsxs("div",{className:`bg-gray-900/50 border border-gray-800 border-l-4 ${V(I.severity)} rounded-xl p-4 flex items-start gap-4 ${I.dismissedAt?"opacity-60":""}`,children:[l.jsx(fv,{severity:I.severity}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"text-sm font-medium text-gray-200",children:I.title}),l.jsx(ie,{label:I.severity,variant:J(I.severity)}),I.type&&l.jsx(ie,{label:I.type,variant:"default"})]}),I.message&&l.jsx("p",{className:"text-xs text-gray-400 mb-2",children:I.message}),l.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-600",children:[l.jsx("span",{children:new Date(I.createdAt).toLocaleString()}),I.source&&l.jsxs("span",{children:["via ",I.source]}),I.dismissedAt&&l.jsxs("span",{children:["Dismissed ",new Date(I.dismissedAt).toLocaleString()]})]})]}),!I.dismissedAt&&l.jsx("button",{onClick:()=>T(I.id),disabled:u===I.id,className:"px-2 py-1 text-xs text-gray-500 hover:text-gray-300 hover:bg-gray-800 rounded transition-colors disabled:opacity-50 flex-shrink-0",children:u===I.id?"...":"Dismiss"})]},I.id))})]},H)})})]})}function fv({severity:r}){return r==="critical"?l.jsx("div",{className:"w-8 h-8 rounded-full bg-rose-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})})}):r==="warning"?l.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}):l.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})}function xv(r){if(!r)return null;if(r.startsWith("https://"))return r.replace(/\.git$/,"");const o=r.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(o)return`https://${o[1]}/${o[2]}`;const u=r.match(/^ssh:\/\/git@([^/]+)\/(.+?)(?:\.git)?$/);return u?`https://${u[1]}/${u[2]}`:null}function mv(){const{data:r,loading:o,error:u,refetch:c}=Te("/api/repos");if(o)return l.jsx(Ie,{});if(u)return l.jsx(Gt,{message:u,onRetry:c});const d=r||[],x=[...new Set(d.map(p=>p.org))],h=d.filter(p=>p.hasSpecweave||p.isUmbrellaManaged).length,N=d.find(p=>p.isCurrent);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Repositories"}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Repositories",value:d.length,color:"indigo"}),l.jsx(ne,{title:"Organizations",value:x.length,color:"cyan"}),l.jsx(ne,{title:"With SpecWeave",value:h,color:"emerald"}),l.jsx(ne,{title:"Current",value:N?N.name:"-",subtitle:N?`${N.org}/${N.name}`:"No current project",color:"amber"})]}),d.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories found"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"This project doesn't use multi-repo mode, or the repositories/ directory hasn't been set up yet"})]}):l.jsx(l.Fragment,{children:x.map(p=>{const m=d.filter(v=>v.org===p);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(hv,{}),l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:p}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[m.length," ",m.length===1?"repo":"repos"]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:m.map(v=>{const y=xv(v.remote);return l.jsxs("div",{className:`bg-gray-900/50 border rounded-xl p-4 ${v.isCurrent?"border-indigo-500/30":"border-gray-800"}`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(gv,{}),l.jsx("span",{className:"text-sm font-medium text-gray-300",children:v.name})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[v.isCurrent&&l.jsx(ie,{label:"Current Project",variant:"info"}),l.jsx(ie,{label:v.hasSpecweave?"SpecWeave":v.isUmbrellaManaged?"via umbrella":"No SpecWeave",variant:v.hasSpecweave?"success":v.isUmbrellaManaged?"info":"default"})]})]}),l.jsxs("div",{className:"space-y-1.5 mt-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Organization"}),l.jsx("span",{className:"text-[10px] text-gray-400",children:v.org})]}),v.branch&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Branch"}),l.jsx(ie,{label:v.branch,variant:"default"})]}),y&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),l.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-indigo-400 hover:text-indigo-300 hover:underline truncate max-w-[180px]",title:y,children:y.replace("https://","")})]}),!y&&v.remote&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),l.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:v.remote,children:v.remote})]}),v.path&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Path"}),l.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:v.path,children:v.path.split("/").slice(-3).join("/")})]}),v.lastModified&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Last Modified"}),l.jsx("span",{className:"text-[10px] text-gray-400",children:yv(v.lastModified)})]})]}),y&&l.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"mt-3 flex items-center justify-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 py-2 border border-gray-800 rounded-lg hover:border-gray-700 transition-colors",children:[l.jsx(pv,{}),"Open on GitHub"]})]},v.path||`${v.org}/${v.name}`)})})]},p)})})]})}function hv(){return l.jsx("div",{className:"w-6 h-6 rounded bg-gray-700 flex items-center justify-center",children:l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})})})}function gv(){return l.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function pv(){return l.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}function yv(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}const vv=[{value:"",label:"All"},{value:"discovered",label:"Discovered"},{value:"scanning",label:"Scanning"},{value:"tier1_passed",label:"Passed"},{value:"tier1_failed",label:"Failed"},{value:"verified",label:"Verified"},{value:"rejected",label:"Rejected"}],xa=20;function bv(r){switch(r){case"discovered":return"default";case"queued":return"info";case"scanning":return"warning";case"tier1_passed":return"success";case"tier1_failed":return"error";case"tier2_pending":return"info";case"verified":return"success";case"rejected":return"error";default:return"default"}}function jv(r){switch(r){case"discovered":return"Discovered";case"queued":return"Queued";case"scanning":return"Scanning";case"tier1_passed":return"T1 Passed";case"tier1_failed":return"T1 Failed";case"tier2_pending":return"T2 Pending";case"verified":return"Verified";case"rejected":return"Rejected";default:return r}}function nx(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function Nv(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function $x(r){const o=r.tier1Result?.score??0,u=r.tier2Result?.score??0;return o&&u?Math.round((o+u)/2):o||u}function Sv(r){return r>=80?"bg-emerald-500":r>=50?"bg-amber-500":"bg-rose-500"}function Ev(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function Cv(r){return r>=1e6?`${(r/1e6).toFixed(1)}m`:r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function sx(r){const o=Math.log10(Math.max(r.stars,1))*20,u=$x(r);return o+u}function wv(r,o){if(o===0)return"rose";const u=r/o;return u>.5?"emerald":u>.1?"amber":"rose"}function Tv(){const[r,o]=j.useState(""),[u,c]=j.useState(0),[d,x]=j.useState(0),[h,N]=j.useState(null),[p,m]=j.useState(""),{output:v,status:y,reset:w}=_r(),_=r?`status=${r}&limit=${xa}&offset=${u}`:`limit=${xa}&offset=${u}`,{data:z,loading:R,error:b,refetch:C}=Te(`/api/marketplace/scanner/status?_r=${d}`),{data:T,loading:U,refetch:J}=Te(`/api/marketplace/queue?${_}&_r=${d}`),{data:V,loading:ae}=Te(`/api/marketplace/verified?_r=${d}`),{data:Z,loading:K}=Te(`/api/marketplace/insights?_r=${d}`),H=j.useCallback(()=>{x(S=>S+1)},[]);Ue("submission-update",j.useCallback(()=>{H()},[H])),Ue("marketplace-scan",j.useCallback(()=>{H()},[H])),Ue("verification-complete",j.useCallback(()=>{H()},[H]));const W=async()=>{try{const S=new URLSearchParams(window.location.search).get("project")||"",q=S?`?project=${S}`:"";await fetch(`/api/marketplace/scanner/start${q}`,{method:"POST"}),C()}catch{}},I=async()=>{try{const S=new URLSearchParams(window.location.search).get("project")||"",q=S?`?project=${S}`:"";await fetch(`/api/marketplace/scanner/stop${q}`,{method:"POST"}),C()}catch{}},Ee=async S=>{N(S);try{const q=new URLSearchParams(window.location.search).get("project")||"",Q=q?`?project=${q}`:"";await fetch(`/api/marketplace/queue/${S}/approve${Q}`,{method:"POST"}),J()}catch{}N(null)},He=async S=>{N(S);try{const q=new URLSearchParams(window.location.search).get("project")||"",Q=q?`?project=${q}`:"";await fetch(`/api/marketplace/queue/${S}/reject${Q}`,{method:"POST"}),J()}catch{}N(null)};if(R&&U&&ae&&K)return l.jsx(Ie,{});const je=T?.items||[],k=T?.total||0,X=V||[],se=Math.floor(u/xa)+1,ye=Math.ceil(k/xa),Ne=S=>S==="tier1_passed"||S==="tier2_pending";return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Marketplace Scanner"}),l.jsx("div",{className:"flex gap-2",children:z?.running?l.jsx("button",{onClick:I,className:"px-3 py-1.5 bg-rose-600 hover:bg-rose-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Stop Scanner"}):l.jsx("button",{onClick:W,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Start Scanner"})})]}),l.jsx(Cu,{lines:v,status:y,onDismiss:w}),b&&l.jsx(Gt,{message:b,onRetry:C}),z?l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Scanner",value:z.running?"Running":"Stopped",subtitle:z.running?"Active":"Idle",color:z.running?"emerald":"amber"}),l.jsx(ne,{title:"Last Scan",value:z.lastScanTime?nx(z.lastScanTime):"Never",color:"cyan"}),l.jsx(ne,{title:"Repos Scanned",value:z.reposScanned,color:"indigo"}),l.jsx(ne,{title:"Rate Limit",value:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null?`${z.rateLimitRemaining}/${z.rateLimitTotal}`:"No token",subtitle:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null&&z.rateLimitTotal>0?`${Math.round(z.rateLimitRemaining/z.rateLimitTotal*100)}% remaining`:"Set GITHUB_TOKEN in environment",color:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null?wv(z.rateLimitRemaining,z.rateLimitTotal):"amber"})]}):!R&&!b?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("div",{className:"text-gray-400 text-sm mb-2",children:"No scanner data available"}),l.jsx("p",{className:"text-gray-600 text-xs mb-4",children:"Start the marketplace scanner to discover and verify community skills."}),l.jsx("button",{onClick:W,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white text-sm rounded-lg transition-colors",children:"Start Scanner"})]}):null,l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Submission Queue"}),l.jsxs("span",{className:"text-xs text-gray-500",children:[k," total"]})]}),l.jsx("div",{className:"flex gap-1 px-4 pt-3 pb-2 overflow-x-auto",children:vv.map(S=>l.jsx("button",{onClick:()=>{o(S.value),c(0)},className:`px-3 py-1.5 text-xs rounded-md transition-colors whitespace-nowrap ${r===S.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300 hover:bg-gray-800"}`,children:S.label},S.value))}),U?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(Ie,{})}):je.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No submissions found"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:r?"Try a different filter.":"Submissions will appear here once the scanner discovers repos."})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Repo"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Author"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Stars"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Status"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Tier"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Security"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Discovered"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Actions"})]})}),l.jsx("tbody",{children:je.map(S=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2",children:S.repoUrl?l.jsx("a",{href:S.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-400 hover:text-indigo-300 font-mono",children:S.repoFullName}):l.jsx("span",{className:"text-xs text-gray-300 font-mono",children:S.repoFullName})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:S.author}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 text-right font-mono",children:S.stars.toLocaleString()}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(ie,{label:jv(S.status),variant:bv(S.status)})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:S.tier||"-"}),l.jsx("td",{className:`px-4 py-2 text-xs text-right font-mono ${Nv(S.securityScore)}`,children:S.securityScore!=null?S.securityScore:"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:nx(S.discoveredAt)}),l.jsx("td",{className:"px-4 py-2 text-right",children:Ne(S.status)&&l.jsxs("div",{className:"flex gap-1 justify-end",children:[l.jsx("button",{onClick:()=>Ee(S.id),disabled:h===S.id,className:"px-2 py-1 bg-emerald-600/20 hover:bg-emerald-600/40 text-emerald-400 text-[10px] rounded transition-colors disabled:opacity-50",children:"Approve"}),l.jsx("button",{onClick:()=>He(S.id),disabled:h===S.id,className:"px-2 py-1 bg-rose-600/20 hover:bg-rose-600/40 text-rose-400 text-[10px] rounded transition-colors disabled:opacity-50",children:"Reject"})]})})]},S.id))})]})}),k>xa&&l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-800",children:[l.jsxs("span",{className:"text-xs text-gray-500",children:[u+1,"-",Math.min(u+xa,k)," of ",k]}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{onClick:()=>c(Math.max(0,u-xa)),disabled:u===0,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Prev"}),l.jsxs("span",{className:"px-2 py-1 text-xs text-gray-500",children:["Page ",se," of ",ye]}),l.jsx("button",{onClick:()=>c(u+xa),disabled:u+xa>=k,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between gap-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 shrink-0",children:"Popular Skills"}),X.length>0&&l.jsxs("div",{className:"relative max-w-xs w-full",children:[l.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),l.jsx("input",{type:"text",placeholder:"Discover popular skills...",value:p,onChange:S=>m(S.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-gray-800/50 border border-gray-700 rounded-lg text-xs text-gray-200 placeholder-gray-500 focus:outline-none focus:border-gray-600 transition-colors"})]})]}),ae?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(Ie,{})}):X.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No verified skills yet"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Skills will appear here after passing security verification."})]}):l.jsx(Av,{skills:X,search:p})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Insights"})}),K?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(Ie,{})}):Z?l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Discovered",value:Z.totalDiscovered,color:"cyan"}),l.jsx(ne,{title:"Verified",value:Z.totalVerified,color:"emerald"}),l.jsx(ne,{title:"Rejected",value:Z.totalRejected,color:"rose"}),l.jsx(ne,{title:"Pending",value:Z.totalPending,color:"amber"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(rx,{label:"Tier 1 Pass Rate",rate:Z.tier1PassRate}),l.jsx(rx,{label:"Tier 2 Pass Rate",rate:Z.tier2PassRate})]})]}):l.jsx("div",{className:"p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No insights data available"})})]})]})}function Av({skills:r,search:o}){const u=[...r].sort((x,h)=>sx(h)-sx(x)),c=new Set(u.slice(0,3).map(x=>x.id)),d=o?u.filter(x=>x.repoFullName.toLowerCase().includes(o.toLowerCase())||x.author.toLowerCase().includes(o.toLowerCase())):u;return d.length===0?l.jsx("div",{className:"p-8 text-center",children:l.jsxs("p",{className:"text-gray-500 text-sm",children:['No skills match "',o,'"']})}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-4",children:d.map(x=>l.jsx(Rv,{skill:x,trending:c.has(x.id)},x.id))})}function Rv({skill:r,trending:o}){const u=$x(r),c=Sv(u),d=Ev(u);return l.jsxs("div",{className:"bg-gray-800/50 border border-gray-700/50 rounded-lg p-4 hover:border-gray-600 transition-colors",children:[l.jsxs("div",{className:"flex items-start justify-between mb-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[r.repoUrl?l.jsx("a",{href:r.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-gray-200 hover:text-indigo-300 truncate block transition-colors",children:r.repoFullName.split("/").pop()}):l.jsx("div",{className:"text-sm font-medium text-gray-200 truncate",children:r.repoFullName.split("/").pop()}),l.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:r.author})]}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[o&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-orange-500/15 text-orange-400 text-[10px] font-medium rounded",children:[l.jsx("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z",clipRule:"evenodd"})}),"Hot"]}),l.jsx(ie,{label:"Verified",variant:"success"})]})]}),l.jsxs("div",{className:"mb-3",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Trust"}),l.jsx("span",{className:`text-xs font-mono font-medium ${d}`,children:u})]}),l.jsx("div",{className:"w-full h-1.5 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${u}%`}})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs text-gray-400 flex items-center gap-1",children:[l.jsx("svg",{className:"w-3.5 h-3.5 text-amber-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})}),Cv(r.stars)]}),r.repoUrl&&l.jsx("a",{href:r.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-gray-500 hover:text-gray-300 transition-colors",children:"View on GitHub"})]})]})}function rx({label:r,rate:o}){const u=Math.round(o),c=u>=70?"bg-emerald-500":u>=40?"bg-amber-500":"bg-rose-500";return l.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-sm font-bold text-gray-200",children:[u,"%"]})]}),l.jsx("div",{className:"w-full h-2 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${u}%`}})})]})}function Mv(){const{id:r}=lp(),[o,u]=j.useState(0);Ue("increment-update",()=>u(m=>m+1));const{data:c,loading:d,error:x,refetch:h}=Te(`/api/increments/${r||"_none"}?_r=${o}`);if(!r)return l.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"No increment ID specified"});if(d)return l.jsx(Ie,{});if(x)return l.jsx(Gt,{message:x,onRetry:h});if(!c)return l.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"Increment not found"});const N=c.taskSummary.total>0?Math.round(c.taskSummary.completed/c.taskSummary.total*100):0,p=c.acSummary.total>0?Math.round(c.acSummary.completed/c.acSummary.total*100):0;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[l.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:c.dirName}),l.jsx(ie,{label:c.metadata.status||"unknown",variant:Mr(c.metadata.status||"")}),c.metadata.type&&l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:c.metadata.type}),c.metadata.priority&&l.jsx(_v,{priority:c.metadata.priority})]}),l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:c.metadata.title||c.id}),c.metadata.project&&l.jsxs("span",{className:"text-xs text-gray-500",children:["Project: ",c.metadata.project]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Tasks",value:`${c.taskSummary.completed}/${c.taskSummary.total}`,color:"indigo"}),l.jsx(ne,{title:"Task Progress",value:`${N}%`,color:"cyan"}),l.jsx(ne,{title:"ACs",value:`${c.acSummary.completed}/${c.acSummary.total}`,color:"emerald"}),l.jsx(ne,{title:"AC Progress",value:`${p}%`,color:"amber"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 space-y-4",children:[l.jsx(ix,{label:"Tasks",completed:c.taskSummary.completed,total:c.taskSummary.total,color:"indigo"}),l.jsx(ix,{label:"Acceptance Criteria",completed:c.acSummary.completed,total:c.acSummary.total,color:"emerald"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Tasks (",c.tasks.length,")"]})}),c.tasks.length===0?l.jsx("div",{className:"p-5 text-center text-gray-500 text-xs",children:"No tasks found in tasks.md"}):l.jsx("div",{className:"divide-y divide-gray-800/50",children:c.tasks.map(m=>l.jsxs("div",{className:"px-5 py-3 flex items-center gap-3",children:[l.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ${m.status==="completed"?"bg-indigo-500/20 border-indigo-500 text-indigo-400":"border-gray-600"}`,children:m.status==="completed"&&l.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:m.id}),l.jsx("span",{className:`text-sm ${m.status==="completed"?"text-gray-500 line-through":"text-gray-300"}`,children:m.title})]}),(m.userStory||m.acs)&&l.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[m.userStory&&l.jsx("span",{className:"text-[10px] text-indigo-400",children:m.userStory}),m.acs?.map(v=>l.jsx("span",{className:"text-[10px] text-emerald-500",children:v},v))]})]})]},m.id))})]}),c.acs.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Acceptance Criteria (",c.acs.length,")"]})}),l.jsx("div",{className:"divide-y divide-gray-800/50",children:c.acs.map(m=>l.jsxs("div",{className:"px-5 py-3 flex items-start gap-3",children:[l.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 mt-0.5 ${m.completed?"bg-emerald-500/20 border-emerald-500 text-emerald-400":"border-gray-600"}`,children:m.completed&&l.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),l.jsxs("div",{children:[l.jsx("span",{className:"text-xs text-emerald-500 font-mono",children:m.id}),l.jsx("span",{className:`text-sm ml-2 ${m.completed?"text-gray-500 line-through":"text-gray-300"}`,children:m.text})]})]},m.id))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"Metadata"}),l.jsx("div",{className:"space-y-1.5",children:Object.entries(c.metadata).filter(([m])=>!["title"].includes(m)).map(([m,v])=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:m}),l.jsx("span",{className:"text-xs text-gray-400",children:typeof v=="object"?JSON.stringify(v):String(v??"")})]},m))})]})]})}function ix({label:r,completed:o,total:u,color:c}){const d=u>0?Math.round(o/u*100):0,x=c==="emerald"?"bg-emerald-500":"bg-indigo-500";return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-xs text-gray-500",children:[o,"/",u," (",d,"%)"]})]}),l.jsx("div",{className:"w-full h-2 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${x} rounded-full transition-all`,style:{width:`${d}%`}})})]})}function _v({priority:r}){const o={P0:"text-rose-400 bg-rose-500/10",P1:"text-amber-400 bg-amber-500/10",P2:"text-cyan-400 bg-cyan-500/10",P3:"text-gray-400 bg-gray-500/10"};return l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${o[r]||o.P2}`,children:r})}const zv=["All","PreToolUse","PostToolUse","Stop","SubagentStop","TaskCompleted","UserPromptSubmit","PostToolUseFailure","PermissionRequest","SessionStart","SessionEnd","Notification","SubagentStart","ConfigChange","PreCompact","TeammateIdle"],Dv=[{label:"All time",value:"0"},{label:"Last 1h",value:"3600000"},{label:"Last 6h",value:"21600000"},{label:"Last 24h",value:"86400000"}];function Ov(r){const o=Date.now()-new Date(r).getTime();return o<6e4?`${Math.floor(o/1e3)}s ago`:o<36e5?`${Math.floor(o/6e4)}m ago`:o<864e5?`${Math.floor(o/36e5)}h ago`:`${Math.floor(o/864e5)}d ago`}function Uv(r){const o=[];for(const u of r){const c=o[o.length-1];c&&c.type===u.eventName&&c.count<100?(c.count++,c.events.push(u)):o.push({type:u.eventName,count:1,events:[u],collapsed:!0})}return o}function Lv(){const{data:r,loading:o}=Te("/api/hooks/events?limit=200"),[u,c]=j.useState([]),[d,x]=Ut("eventType","All"),[h,N]=Ut("session",""),[p,m]=Ut("range","0"),[v,y]=j.useState(null),[w,_]=j.useState(new Set);Ue("hook-event",C=>{const T=C;T.id&&c(U=>[T,...U].slice(0,50))});const z=j.useMemo(()=>{const C=r?.data??[],T=new Set(C.map(J=>J.id));return[...u.filter(J=>!T.has(J.id)),...C].sort((J,V)=>new Date(V.timestamp).getTime()-new Date(J.timestamp).getTime())},[r,u]),R=j.useMemo(()=>{let C=z;d!=="All"&&(C=C.filter(U=>U.eventName===d)),h&&(C=C.filter(U=>U.sessionId.includes(h)));const T=parseInt(p,10);if(T>0){const U=Date.now()-T;C=C.filter(J=>new Date(J.timestamp).getTime()>U)}return C},[z,d,h,p]),b=j.useMemo(()=>Uv(R),[R]);return o&&!r?l.jsx("div",{className:"p-6 text-center text-gray-500",children:"Loading hook events..."}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-100",children:"Hook Events"}),l.jsxs("span",{className:"text-sm text-gray-500",children:[R.length," events"]})]}),l.jsxs("div",{className:"flex gap-3 flex-wrap",children:[l.jsx("select",{value:d,onChange:C=>x(C.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:zv.map(C=>l.jsx("option",{value:C,children:C},C))}),l.jsx("input",{type:"text",placeholder:"Filter by session ID...",value:h,onChange:C=>N(C.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5 w-48"}),l.jsx("select",{value:p,onChange:C=>m(C.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:Dv.map(C=>l.jsx("option",{value:C.value,children:C.label},C.value))})]}),l.jsxs("div",{className:"space-y-1",children:[b.map((C,T)=>{const U=w.has(T),J=C.count===1||U?C.events:[C.events[0]];return l.jsxs("div",{children:[C.count>1&&l.jsxs("button",{onClick:()=>{_(V=>{const ae=new Set(V);return ae.has(T)?ae.delete(T):ae.add(T),ae})},className:"w-full text-left px-3 py-1 text-xs text-gray-500 hover:text-gray-300 bg-gray-900 rounded",children:[U?"▾":"▸"," ",C.count,"× ",C.type]}),J.map(V=>{const ae=V.result?.decision==="deny"||V.result?.decision==="block";return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>y(v===V.id?null:V.id),className:`w-full text-left flex items-center gap-3 px-3 py-2 rounded text-sm hover:bg-gray-800/50 ${ae?"bg-red-950/30 border border-red-900/40":""}`,children:[l.jsx("span",{className:"text-gray-500 text-xs font-mono w-16 shrink-0",children:Ov(V.timestamp)}),l.jsx(ie,{label:V.eventName,variant:ae?"error":"default"}),l.jsx("span",{className:"text-gray-400 text-xs truncate",children:V.sessionId.slice(0,12)}),V.durationMs!=null&&l.jsxs("span",{className:"text-gray-600 text-xs ml-auto",children:[V.durationMs,"ms"]})]}),v===V.id&&l.jsx("pre",{className:"mx-3 mb-2 p-3 bg-gray-900 rounded text-xs text-gray-400 overflow-x-auto max-h-64",children:JSON.stringify(V.payload,null,2)})]},V.id)})]},T)}),b.length===0&&l.jsx("div",{className:"text-center text-gray-600 py-8",children:"No hook events yet"})]})]})}function cx(r){return r<1e3?`${r}ms`:r<6e4?`${Math.floor(r/1e3)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}function Hv(){const{data:r,loading:o}=Te("/api/hooks/agents"),[u,c]=j.useState([]),[d,x]=Ut("session",""),[,h]=j.useState(0);Ue("hook-agent",w=>{const _=w;_.agentId&&c(z=>{const R=z.findIndex(b=>b.agentId===_.agentId);if(R>=0){const b=[...z];return b[R]={...b[R],..._},b}return[_,...z]})});const N=j.useMemo(()=>{const w=r?.data??[],_=new Set(w.map(z=>z.agentId));return[...u.filter(z=>!_.has(z.agentId)),...w]},[r,u]),p=j.useMemo(()=>d?N.filter(w=>w.sessionId.includes(d)):N,[N,d]),m=j.useMemo(()=>{const w=new Set(N.map(_=>_.sessionId));return Array.from(w)},[N]),v=j.useMemo(()=>p.filter(w=>!w.stoppedAt).length,[p]);j.useEffect(()=>{if(v===0)return;const w=setInterval(()=>h(_=>_+1),1e3);return()=>clearInterval(w)},[v]);const y=j.useMemo(()=>{const w=p.filter(_=>_.durationMs!=null);return w.length===0?0:Math.round(w.reduce((_,z)=>_+(z.durationMs??0),0)/w.length)},[p]);return o&&!r?l.jsx("div",{className:"p-6 text-center text-gray-500",children:"Loading agents..."}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-100",children:"Agents"}),l.jsxs("div",{className:"flex gap-4 text-sm text-gray-400",children:[l.jsxs("span",{children:["Total: ",p.length]}),l.jsxs("span",{children:["Running: ",v]}),l.jsxs("span",{children:["Avg duration: ",cx(y)]})]})]}),l.jsx("div",{className:"flex gap-3",children:l.jsxs("select",{value:d,onChange:w=>x(w.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:[l.jsx("option",{value:"",children:"All sessions"}),m.map(w=>l.jsx("option",{value:w,children:w.slice(0,20)},w))]})}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-left text-gray-500 border-b border-gray-800",children:[l.jsx("th",{className:"py-2 px-3",children:"Agent ID"}),l.jsx("th",{className:"py-2 px-3",children:"Type"}),l.jsx("th",{className:"py-2 px-3",children:"Session"}),l.jsx("th",{className:"py-2 px-3",children:"Started"}),l.jsx("th",{className:"py-2 px-3",children:"Stopped"}),l.jsx("th",{className:"py-2 px-3",children:"Duration"}),l.jsx("th",{className:"py-2 px-3",children:"Status"})]})}),l.jsxs("tbody",{children:[p.map(w=>{const _=!w.stoppedAt,z=_?Date.now()-new Date(w.startedAt).getTime():w.durationMs??0;return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"py-2 px-3 font-mono text-xs text-gray-300",children:w.agentId.slice(0,16)}),l.jsx("td",{className:"py-2 px-3 text-gray-300",children:w.agentType}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:w.sessionId.slice(0,12)}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:new Date(w.startedAt).toLocaleTimeString()}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:w.stoppedAt?new Date(w.stoppedAt).toLocaleTimeString():"—"}),l.jsx("td",{className:"py-2 px-3 text-gray-400 text-xs",children:cx(z)}),l.jsx("td",{className:"py-2 px-3",children:l.jsx(ie,{label:_?"running":"stopped",variant:_?"success":"default"})})]},w.agentId)}),p.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:7,className:"py-8 text-center text-gray-600",children:"No agents tracked yet"})})]})]})})]})}function Jn({value:r,onSave:o,placeholder:u}){const[c,d]=j.useState(!1),[x,h]=j.useState(r),N=j.useRef(null);j.useEffect(()=>{c&&(N.current?.focus(),N.current?.select())},[c]);const p=()=>{x!==r&&o(x),d(!1)},m=()=>{h(r),d(!1)};return c?l.jsx("input",{ref:N,value:x,onChange:v=>h(v.target.value),onKeyDown:v=>{v.key==="Enter"&&p(),v.key==="Escape"&&m()},onBlur:p,className:"bg-gray-800 border border-indigo-500/50 text-gray-200 text-xs rounded px-2 py-1 w-full focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:u}):l.jsx("span",{onClick:()=>{h(r),d(!0)},className:"text-xs text-gray-400 cursor-pointer hover:text-gray-200 hover:bg-gray-800/50 rounded px-1.5 py-0.5 transition-colors min-w-[60px] inline-block",title:"Click to edit",children:r||l.jsx("span",{className:"text-gray-600 italic",children:u||"Click to set"})})}function Ql(r,o){return r?o==="github"&&r.github?`${r.github.owner}/${r.github.repo}`:o==="jira"&&r.jira?r.jira.projectKey:o==="ado"&&r.ado?r.ado.project:"":""}function uu(r,o){if(r==="github"){const u=o.split("/");return u.length===2?{github:{owner:u[0],repo:u[1]}}:{github:{owner:"",repo:o}}}return r==="jira"?{jira:{projectKey:o}}:r==="ado"?{ado:{project:o}}:{}}function Bv({onClose:r,onSubmit:o}){const[u,c]=j.useState(""),[d,x]=j.useState(""),[h,N]=j.useState(""),[p,m]=j.useState(""),[v,y]=j.useState(""),w=j.useRef(null);j.useEffect(()=>{w.current?.focus()},[]);const _=z=>{if(z.preventDefault(),!u.trim()||!d.trim()||!h.trim()){y("ID, Path, and Prefix are required");return}o({id:u.trim(),path:d.trim(),prefix:h.trim(),name:p.trim()||void 0})};return l.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",onClick:r,children:l.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-6 w-full max-w-md shadow-2xl",onClick:z=>z.stopPropagation(),children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-200 mb-4",children:"Add Repository"}),l.jsxs("form",{onSubmit:_,className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"ID *"}),l.jsx("input",{ref:w,value:u,onChange:z=>c(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., frontend-app"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Path *"}),l.jsx("input",{value:d,onChange:z=>x(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., repositories/acme/frontend-app"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Prefix *"}),l.jsx("input",{value:h,onChange:z=>N(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., FE"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Display Name"}),l.jsx("input",{value:p,onChange:z=>m(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., Frontend App"})]}),v&&l.jsx("p",{className:"text-xs text-rose-400",children:v}),l.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[l.jsx("button",{type:"button",onClick:r,className:"text-xs text-gray-400 hover:text-gray-200 px-3 py-1.5 border border-gray-700 rounded-lg transition-colors",children:"Cancel"}),l.jsx("button",{type:"submit",className:"text-xs text-white bg-indigo-600 hover:bg-indigo-500 px-4 py-1.5 rounded-lg transition-colors",children:"Add Repo"})]})]})]})})}function kv(){const{data:r,loading:o,error:u,refetch:c}=Te("/api/workspace"),{activeProject:d}=rl(),[x,h]=j.useState(!1),[N,p]=j.useState(null),m=d?.id?`?project=${d.id}`:"",v=j.useCallback(async(C,T)=>{try{p(null);const U=await fetch(`/api/workspace/repos/${encodeURIComponent(C)}${m}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!U.ok){const J=await U.json();p(J.error||`Failed to update ${C}`);return}c()}catch(U){p(U.message)}},[m,c]),y=j.useCallback(async C=>{try{p(null);const T=await fetch(`/api/workspace/repos${m}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)});if(!T.ok){const U=await T.json();p(U.error||"Failed to add repo");return}h(!1),c()}catch(T){p(T.message)}},[m,c]),w=j.useCallback(async C=>{if(confirm(`Remove "${C}" from workspace?`))try{p(null);const T=await fetch(`/api/workspace/repos/${encodeURIComponent(C)}${m}`,{method:"DELETE"});if(!T.ok&&T.status!==204){const U=await T.json();p(U.error||`Failed to remove ${C}`);return}c()}catch(T){p(T.message)}},[m,c]);if(o)return l.jsx(Ie,{});if(u)return l.jsx(Gt,{message:u,onRetry:c});const _=r||{name:"",rootRepo:null,repos:[]},z=_.repos.filter(C=>C.sync?.github).length,R=_.repos.filter(C=>C.sync?.jira).length,b=_.repos.filter(C=>C.sync?.ado).length;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Workspace"}),_.name&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:_.name})]}),l.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-1.5 text-xs text-white bg-indigo-600 hover:bg-indigo-500 px-3 py-1.5 rounded-lg transition-colors",children:[l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"Add Repo"]})]}),N&&l.jsx("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-2",children:l.jsx("p",{className:"text-xs text-rose-400",children:N})}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Repositories",value:_.repos.length,color:"indigo"}),l.jsx(ne,{title:"GitHub Mapped",value:z,color:"cyan"}),l.jsx(ne,{title:"Jira Mapped",value:R,color:"amber"}),l.jsx(ne,{title:"ADO Mapped",value:b,color:"emerald"})]}),_.rootRepo&&l.jsxs("div",{className:"bg-gray-900/50 border border-indigo-500/20 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(ie,{label:"Root",variant:"info"}),l.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Umbrella Repository"})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-3",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"GitHub"}),l.jsx("span",{className:"text-xs text-gray-400",children:Ql(_.rootRepo,"github")||"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Jira"}),l.jsx("span",{className:"text-xs text-gray-400",children:Ql(_.rootRepo,"jira")||"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"ADO"}),l.jsx("span",{className:"text-xs text-gray-400",children:Ql(_.rootRepo,"ado")||"-"})]})]})]}),_.repos.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories in workspace"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:'Click "Add Repo" to register your first repository'})]}):l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"ID"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Name"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Prefix"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"GitHub"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Jira"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"ADO"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Role"}),l.jsx("th",{className:"text-right text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3 w-10"})]})}),l.jsx("tbody",{children:_.repos.map(C=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors",children:[l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs font-mono text-gray-300",children:C.id})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:C.name||"",onSave:T=>v(C.id,{name:T}),placeholder:"Set name"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(ie,{label:C.prefix,variant:"default"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:Ql(C.sync,"github"),onSave:T=>v(C.id,{sync:{...C.sync,...uu("github",T)}}),placeholder:"owner/repo"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:Ql(C.sync,"jira"),onSave:T=>v(C.id,{sync:{...C.sync,...uu("jira",T)}}),placeholder:"PROJECT"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:Ql(C.sync,"ado"),onSave:T=>v(C.id,{sync:{...C.sync,...uu("ado",T)}}),placeholder:"project"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:C.role||"",onSave:T=>v(C.id,{role:T}),placeholder:"Set role"})}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsx("button",{onClick:()=>w(C.id),className:"text-gray-600 hover:text-rose-400 transition-colors p-1",title:"Remove from workspace",children:l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})})]},C.id))})]})})}),x&&l.jsx(Bv,{onClose:()=>h(!1),onSubmit:y})]})}function $v(){const r=Pp(),o=Yt();return l.jsx(Rx.Provider,{value:r,children:l.jsx(ey,{children:l.jsxs("div",{className:"flex min-h-screen bg-gray-950 text-gray-100",children:[l.jsx(ny,{}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[l.jsx(sy,{}),l.jsx("main",{className:"flex-1 overflow-y-auto",children:l.jsx(iy,{resetKey:o.pathname,children:l.jsxs(yp,{children:[l.jsx(We,{path:"/",element:l.jsx(py,{})}),l.jsx(We,{path:"/increments",element:l.jsx(jy,{})}),l.jsx(We,{path:"/increments/:id",element:l.jsx(Mv,{})}),l.jsx(We,{path:"/analytics",element:l.jsx(Ey,{})}),l.jsx(We,{path:"/costs",element:l.jsx(Uy,{})}),l.jsx(We,{path:"/sync",element:l.jsx(Yy,{})}),l.jsx(We,{path:"/errors",element:l.jsx(Zy,{})}),l.jsx(We,{path:"/activity",element:l.jsx(tv,{})}),l.jsx(We,{path:"/config",element:l.jsx(nv,{})}),l.jsx(We,{path:"/plugins",element:l.jsx(iv,{})}),l.jsx(We,{path:"/services",element:l.jsx(uv,{})}),l.jsx(We,{path:"/notifications",element:l.jsx(dv,{})}),l.jsx(We,{path:"/repos",element:l.jsx(mv,{})}),l.jsx(We,{path:"/marketplace",element:l.jsx(Tv,{})}),l.jsx(We,{path:"/hooks",element:l.jsx(Lv,{})}),l.jsx(We,{path:"/agents",element:l.jsx(Hv,{})}),l.jsx(We,{path:"/workspace",element:l.jsx(kv,{})}),l.jsx(We,{path:"*",element:l.jsxs("div",{className:"p-6 text-center",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200 mb-2",children:"Page Not Found"}),l.jsx("p",{className:"text-sm text-gray-500",children:"The page you're looking for doesn't exist."})]})})]})})})]})]})})})}vg.createRoot(document.getElementById("root")).render(l.jsx(j.StrictMode,{children:l.jsx(Gp,{children:l.jsx($v,{})})}));
|
|
13
|
+
`)})]})]})]},x)})})]})}function tx({entries:r}){const[o,u]=j.useState(null);if(r.length===0)return l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No audit entries"})});const c={success:"success",error:"error",denied:"warning",skipped:"default"};return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Time"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Platform"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Operation"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Item"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Direction"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Result"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Duration"})]})}),l.jsx("tbody",{children:r.map((d,x)=>{const h=!!d.message,N=o===x;return l.jsxs("tr",{className:`border-b border-gray-800/50 hover:bg-gray-800/30 ${h?"cursor-pointer":""}`,onClick:()=>h&&u(N?null:x),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Bx(d.timestamp)}),l.jsx("td",{className:"px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Hx,{platform:d.platform}),l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:d.platform})]})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:d.operation}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 font-mono max-w-[120px] truncate",children:d.itemId||"-"}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(ie,{label:d.direction,variant:d.direction==="push"?"info":"default"})}),l.jsx("td",{className:"px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(ie,{label:d.result,variant:c[d.result]||"default"}),h&&l.jsx("span",{className:"text-[10px] text-gray-600",children:N?"▲":"▼"})]})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 text-right",children:d.duration?`${d.duration}ms`:"-"})]},x)})})]}),o!==null&&r[o]?.message&&l.jsx("div",{className:"border-t border-gray-800 px-4 py-3 bg-gray-800/20",children:l.jsx("pre",{className:"text-xs text-gray-400 whitespace-pre-wrap font-mono max-h-40 overflow-y-auto",children:r[o].message})})]})}function Xl({label:r,value:o}){return l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:r}),l.jsx("span",{className:"text-xs text-gray-400",children:o})]})}function Hx({platform:r}){const o={github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return l.jsx("div",{className:`w-5 h-5 rounded ${o[r]||"bg-gray-700"} flex items-center justify-center`,children:l.jsx("span",{className:"text-[9px] text-white font-bold",children:r[0]?.toUpperCase()})})}function Bx(r){if(!r)return"-";try{const o=new Date(r).getTime();if(isNaN(o))return"-";const u=Date.now()-o,c=Math.floor(u/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const d=Math.floor(c/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}catch{return"-"}}const kx={prompt_too_long:"error",api_error:"warning",tool_failure:"info",hook_error:"default",rate_limit:"warning",unknown:"default"},Fn=50;function Fy(){const[r,o]=Ut("tab","groups"),[u,c]=Ut("type",""),[d,x]=Ut("q",""),[h,N]=Ut("session",""),[p,m]=j.useState(0),[v,y]=j.useState(d),E=p*Fn,M=u?`&type=${encodeURIComponent(u)}`:"",z=d?`&search=${encodeURIComponent(d)}`:"",[R,b]=j.useState(0);Ue("error-detected",()=>b(ee=>ee+1));const{data:w,loading:T,error:U}=Te(r==="groups"?`/api/errors/groups?_r=${R}`:""),{data:J,loading:V,error:ae}=Te(r==="errors"||r==="groups"?`/api/errors/recent?limit=${Fn}&offset=${E}${M}${z}&_r=${R}`:""),{data:Z,loading:K,error:H}=Te(r==="sessions"||h?`/api/errors/sessions?limit=50&_r=${R}`:""),{data:W,loading:I,error:Ee}=Te(r==="timeline"?`/api/errors/timeline?bucket=60&_r=${R}`:""),He=j.useCallback(()=>{x(v.trim()),m(0),v.trim()&&o("errors")},[v,x,o]);j.useEffect(()=>{h&&Z&&!Z.find(ee=>ee.sessionId===h)&&N("")},[h,Z,N]);const ze=r==="groups"&&T||r==="errors"&&V||r==="timeline"&&I||r==="sessions"&&K,je=U||ae||(r==="sessions"?H:null)||(r==="timeline"?Ee:null),k=J?.total||0,X=J?.errors||[],se=w?.length||0,ye=w?.reduce((ee,Ke)=>ee+Ke.sessions,0)||0,Ne=w?.[0]?.type||"-",S=h?Z?.find(ee=>ee.sessionId===h):null,q=u?(Z||[]).filter(ee=>ee.errors.some(Ke=>Ke.type===u)):Z||[],Q=Math.ceil(k/Fn),P=ee=>{c(ee),o("errors"),N(""),m(0)},ce=ee=>{o(ee),N(""),ee!=="errors"&&m(0)},fe=()=>{c(""),x(""),y(""),m(0)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Error Tracing"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Observability for Claude Code sessions"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{type:"text",value:v,onChange:ee=>y(ee.target.value),onKeyDown:ee=>ee.key==="Enter"&&He(),placeholder:"Search errors by message, tool name, or context...",className:"w-full px-3 py-2 text-sm bg-gray-900/50 border border-gray-700 rounded-lg text-gray-300 placeholder-gray-600 focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500/30"}),d&&l.jsx("button",{onClick:()=>{x(""),y(""),m(0)},className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-300 text-xs",children:"clear"})]}),l.jsx("button",{onClick:He,className:"px-4 py-2 text-sm bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg transition-colors",children:"Search"})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Total Errors",value:k,color:"rose"}),l.jsx(ne,{title:"Error Types",value:se,color:"amber"}),l.jsx(ne,{title:"Affected Sessions",value:ye,color:"indigo"}),l.jsx(ne,{title:"Most Common",value:Ne,color:"cyan"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:["groups","errors","timeline","sessions"].map(ee=>l.jsx("button",{onClick:()=>ce(ee),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${r===ee?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:ee==="groups"?"Error Groups":ee==="errors"?"All Errors":ee==="timeline"?"Timeline":"Sessions"},ee))}),(u||d)&&l.jsxs("div",{className:"flex items-center gap-2",children:[u&&l.jsx(ie,{label:`type: ${u.replace(/_/g," ")}`,variant:"info"}),d&&l.jsx(ie,{label:`search: ${d.slice(0,20)}`,variant:"default"}),l.jsx("button",{onClick:fe,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"clear all"})]})]}),je&&l.jsxs("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-3 flex items-center justify-between",children:[l.jsx("div",{className:"text-sm text-rose-300",children:je}),l.jsx("button",{onClick:()=>window.location.reload(),className:"text-xs text-rose-400 hover:text-rose-200 px-2 py-1 border border-rose-700 rounded transition-colors",children:"Retry"})]}),h&&S&&l.jsx(av,{session:S,onClose:()=>N("")}),ze&&!h&&l.jsx(Ie,{}),!h&&!ze&&r==="groups"&&l.jsx(Py,{groups:w||[],onGroupClick:P}),!h&&!ze&&r==="errors"&&l.jsx(Iy,{errors:X,total:k,page:p,totalPages:Q,onPageChange:m,onSessionClick:ee=>{N(ee),o("sessions")}}),!h&&!ze&&r==="timeline"&&l.jsx(ev,{buckets:W||[],errors:X,onSessionClick:ee=>N(ee)}),!h&&!ze&&r==="sessions"&&l.jsx(tv,{sessions:q,onSelect:ee=>N(ee)}),!ze&&!je&&k===0&&!h&&l.jsx(Cu,{title:"No errors detected",description:"Claude Code session logs are clean"})]})}function Py({groups:r,onGroupClick:o}){return r.length===0?null:l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Groups"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Type"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Count"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Sessions"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Last Seen"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Sample Message"})]})}),l.jsx("tbody",{children:r.map(u=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2",children:l.jsx(ie,{label:u.type.replace(/_/g," "),variant:kx[u.type]||"default"})}),l.jsx("td",{className:"px-4 py-2 text-right",children:l.jsx("button",{onClick:()=>o(u.type),className:"text-sm text-indigo-400 hover:text-indigo-300 font-mono transition-colors",title:`View all ${u.count} errors of this type`,children:u.count})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.sessions}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Kl(u.lastSeen),children:as(u.lastSeen)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 max-w-xs truncate",children:u.recentMessages[0]||"-"})]},u.type))})]})]})}function Iy({errors:r,total:o,page:u,totalPages:c,onPageChange:d,onSessionClick:x}){const[h,N]=j.useState(new Set),p=j.useCallback(y=>{N(E=>{const M=new Set(E);return M.has(y)?M.delete(y):M.add(y),M})},[]);if(r.length===0)return l.jsx(Cu,{title:"No errors",description:"No errors match the current filter"});const m=u*Fn+1,v=Math.min(u*Fn+r.length,o);return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Errors ",m,"–",v," of ",o]}),c>1&&l.jsx(ax,{page:u,totalPages:c,onChange:d})]}),l.jsx("div",{className:"divide-y divide-gray-800/50",children:r.map((y,E)=>{const M=h.has(E),z=y.message.length>120;return l.jsx("div",{className:"px-4 py-3 hover:bg-gray-800/20 transition-colors",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex-shrink-0 mt-0.5",children:l.jsx(ie,{label:y.type.replace(/_/g," "),variant:kx[y.type]||"default"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:`text-xs text-gray-300 ${M?"whitespace-pre-wrap break-words":"truncate"} ${z?"cursor-pointer":""}`,onClick:()=>z&&p(E),title:z?M?"Click to collapse":"Click to expand details":void 0,children:[z&&l.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:M?"▼":"▶"}),M?y.message:y.message.slice(0,200),!M&&z&&l.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),y.context?.toolName&&l.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[l.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:y.context.toolName}),y.context.toolInput&&l.jsx("span",{className:"text-[10px] text-gray-500 font-mono truncate max-w-md",children:y.context.toolInput})]}),M&&l.jsx($x,{context:y.context})]}),l.jsxs("div",{className:"flex-shrink-0 text-right",children:[l.jsx("div",{className:"text-[10px] text-gray-300 font-mono",title:Kl(y.timestamp),children:as(y.timestamp)}),l.jsx("div",{className:"text-[10px] text-gray-600",children:Kl(y.timestamp)}),l.jsx("button",{onClick:()=>x(y.sessionId),className:"text-[10px] text-indigo-400 hover:text-indigo-300 font-mono mt-0.5 transition-colors",title:"View full session",children:y.sessionId.slice(0,8)}),y.context?.messageIndex!=null&&l.jsxs("div",{className:"text-[10px] text-gray-600",children:["msg #",y.context.messageIndex]})]})]})},`${y.sessionId}-${y.timestamp}-${E}`)})}),c>1&&l.jsx("div",{className:"px-5 py-3 border-t border-gray-800 flex justify-end",children:l.jsx(ax,{page:u,totalPages:c,onChange:d})})]})}function $x({context:r}){if(!r)return null;const{precedingAction:o,recentTools:u}=r;return!o&&(!u||u.length===0)?null:l.jsxs("div",{className:"mt-2 p-2 bg-gray-900/60 border border-gray-800 rounded-lg space-y-1.5",children:[o&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"What preceded this error:"}),l.jsx("div",{className:"text-[11px] text-gray-400 font-mono mt-0.5",children:o})]}),u&&u.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Recent tool chain:"}),l.jsx("div",{className:"flex flex-col gap-0.5 mt-0.5",children:u.map((c,d)=>l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[l.jsxs("span",{className:"text-gray-600",children:[u.length-d,"."]}),l.jsx("span",{className:"font-mono text-amber-400/80",children:c.name}),c.input&&l.jsx("span",{className:"text-gray-600 font-mono truncate max-w-sm",children:c.input})]},d))})]})]})}function ax({page:r,totalPages:o,onChange:u}){return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:()=>u(Math.max(0,r-1)),disabled:r===0,className:"px-2 py-1 text-xs rounded transition-colors disabled:text-gray-700 text-gray-400 hover:text-white hover:bg-gray-700",children:"Prev"}),l.jsxs("span",{className:"text-[10px] text-gray-500 px-2",children:[r+1," / ",o]}),l.jsx("button",{onClick:()=>u(Math.min(o-1,r+1)),disabled:r>=o-1,className:"px-2 py-1 text-xs rounded transition-colors disabled:text-gray-700 text-gray-400 hover:text-white hover:bg-gray-700",children:"Next"})]})}function ev({buckets:r,errors:o,onSessionClick:u}){const[c,d]=j.useState(null),x=Math.max(...r.map(m=>m.count),1),h={tool_failure:"bg-blue-500",prompt_too_long:"bg-rose-500",api_error:"bg-amber-500",hook_error:"bg-gray-500",rate_limit:"bg-amber-400",unknown:"bg-gray-600"},N=c?o.filter(m=>{const v=new Date(m.timestamp).getTime();return v>=new Date(c.start).getTime()&&v<new Date(c.end).getTime()}):o,p=m=>{try{return new Date(m).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return m}};return l.jsxs("div",{className:"space-y-4",children:[r.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Error Density (per hour)"}),c&&l.jsx("button",{onClick:()=>d(null),className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"Clear filter"})]}),l.jsx("div",{className:"flex items-end gap-px h-24",children:r.map((m,v)=>{const y=m.count/x*100,E=c?.start===m.start;return l.jsx("div",{className:"flex-1 flex flex-col items-center justify-end cursor-pointer group relative",onClick:()=>d(E?null:m),title:`${p(m.start)}: ${m.count} errors`,children:l.jsx("div",{className:`w-full min-h-[2px] rounded-t transition-all ${E?"bg-indigo-400":"bg-rose-500/70 group-hover:bg-rose-400"}`,style:{height:`${Math.max(y,2)}%`}})},v)})}),l.jsxs("div",{className:"flex justify-between mt-1",children:[l.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[0].start):""}),l.jsx("span",{className:"text-[9px] text-gray-600",children:r.length>0?p(r[r.length-1].start):""})]}),l.jsx("div",{className:"flex gap-3 mt-2",children:Object.entries(h).map(([m,v])=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${v}`}),l.jsx("span",{className:"text-[9px] text-gray-600",children:m.replace(/_/g," ")})]},m))})]}),c&&l.jsxs("div",{className:"text-xs text-gray-400 px-1",children:["Showing ",N.length," errors from ",p(c.start)]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:c?"Filtered Errors":"Recent Errors"}),l.jsxs("div",{className:"space-y-1 max-h-[400px] overflow-y-auto custom-scrollbar",children:[N.length===0&&l.jsx("p",{className:"text-xs text-gray-600",children:"No errors in this time range"}),N.slice(0,100).map((m,v)=>l.jsxs("div",{className:"flex items-start gap-3 py-2 px-2 hover:bg-gray-800/30 rounded cursor-pointer",onClick:()=>u(m.sessionId),children:[l.jsx("div",{className:`w-2 h-2 rounded-full mt-1.5 flex-shrink-0 ${h[m.type]||"bg-gray-500"}`}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:m.type.replace(/_/g," ")}),m.context?.toolName&&l.jsx("span",{className:"text-[10px] font-mono px-1 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:m.context.toolName}),l.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:as(m.timestamp)}),l.jsx("span",{className:"text-[10px] text-gray-600",children:Kl(m.timestamp)})]}),l.jsx("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:m.message}),m.context?.precedingAction&&l.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5 truncate",children:["After: ",m.context.precedingAction]})]})]},v))]})]})]})}function tv({sessions:r,onSelect:o}){return r.length===0?null:l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Recent Sessions"})}),l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Session"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Branch"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Messages"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Tool Calls"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Errors"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Started"})]})}),l.jsx("tbody",{children:r.map(u=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",onClick:()=>o(u.sessionId),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:u.sessionId.slice(0,8)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:u.gitBranch||"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.messageCount}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:u.toolCallCount}),l.jsx("td",{className:"px-4 py-2 text-right",children:u.errors.length>0?l.jsx(ie,{label:String(u.errors.length),variant:"error"}):l.jsx("span",{className:"text-xs text-gray-600",children:"0"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Kl(u.startTime),children:as(u.startTime)})]},u.sessionId))})]})]})}function av({session:r,onClose:o}){const[u,c]=j.useState(new Set),d=x=>{c(h=>{const N=new Set(h);return N.has(x)?N.delete(x):N.add(x),N})};return l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Session: ",l.jsx("span",{className:"font-mono",children:r.sessionId.slice(0,12)})]}),l.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5",children:["v",r.version," | ",r.gitBranch," | ",r.messageCount," messages | ",r.toolCallCount," tool calls"]})]}),l.jsx("button",{onClick:o,className:"px-2 py-1 text-xs text-gray-400 hover:text-white hover:bg-gray-700 rounded transition-colors",children:"Back"})]}),l.jsxs("div",{className:"flex gap-3 mb-4",children:[l.jsxs("div",{className:"text-xs text-gray-500",children:["Started: ",new Date(r.startTime).toLocaleString()]}),r.endTime&&l.jsxs("div",{className:"text-xs text-gray-500",children:["Ended: ",new Date(r.endTime).toLocaleString()]})]}),r.errors.length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No errors in this session"}):l.jsx("div",{className:"space-y-2",children:r.errors.map((x,h)=>{const N=u.has(h),p=x.message.length>150;return l.jsxs("div",{className:"p-3 bg-gray-800/50 rounded-lg border-l-2 border-rose-500/50",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(ie,{label:x.type.replace(/_/g," "),variant:"error"}),x.context?.toolName&&l.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 bg-gray-800 border border-gray-700 rounded text-amber-400",children:x.context.toolName}),l.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:as(x.timestamp)}),l.jsx("span",{className:"text-[10px] text-gray-600",children:Kl(x.timestamp)})]}),l.jsxs("div",{className:`text-xs text-gray-400 ${N?"whitespace-pre-wrap break-words":""} ${p?"cursor-pointer":""}`,onClick:()=>p&&d(h),title:p?N?"Click to collapse":"Click to expand":void 0,children:[p&&l.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:N?"▼":"▶"}),N?x.message:x.message.slice(0,300),!N&&p&&l.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),x.context?.toolInput&&l.jsx("div",{className:"text-[10px] text-gray-500 font-mono mt-1.5 bg-gray-900/50 px-2 py-1 rounded",children:x.context.toolInput}),x.context?.messageIndex!=null&&l.jsxs("div",{className:"text-[10px] text-gray-600 mt-1",children:["At message #",x.context.messageIndex]}),N&&l.jsx($x,{context:x.context})]},h)})})]})}function Kl(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function as(r){if(!r)return"-";try{return new Date(r).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return r}}const lv=[{value:"all",label:"All"},{value:"command",label:"Commands"},{value:"hook",label:"Hooks"},{value:"notification",label:"Notifications"},{value:"cost",label:"Cost"}],nv=[{value:"all",label:"All Levels"},{value:"error",label:"Errors"},{value:"warning",label:"Warnings"},{value:"info",label:"Info"}];function sv(){const[r,o]=Ut("category","all"),[u,c]=Ut("severity","all"),d=r||"all",x=u||"all",[h,N]=j.useState([]),[p,m]=j.useState(200),[v,y]=j.useState(null),E=new URLSearchParams;E.set("limit",String(p)),d!=="all"&&E.set("categories",d),x!=="all"&&E.set("severity",x);const{data:M,loading:z}=Te(`/api/activity/stream?${E.toString()}`),R=j.useCallback(H=>{N(W=>[H,...W].slice(0,50))},[]);if(Ue("activity",R),z)return l.jsx(Ie,{});const b=[...h,...M||[]],w=new Set,T=[];for(const H of b){const W=`${H.timestamp}:${H.title}`;w.has(W)||(w.add(W),T.push(H))}const U=T.filter(H=>!(d!=="all"&&H.category!==d||x!=="all"&&H.severity!==x)),J=T.filter(H=>H.severity==="error").length,V=T.filter(H=>H.severity==="warning").length,ae=new Set(T.map(H=>H.source)),Z=H=>{y(W=>W===H?null:H)},K=()=>{m(H=>H+200)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Activity Stream"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400 pulse-dot"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Live"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Total Events",value:T.length,color:"indigo"}),l.jsx(ne,{title:"Errors",value:J,color:"rose"}),l.jsx(ne,{title:"Warnings",value:V,color:"amber"}),l.jsx(ne,{title:"Sources",value:ae.size,color:"cyan"})]}),l.jsxs("div",{className:"flex flex-wrap gap-4",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:lv.map(H=>l.jsx("button",{onClick:()=>o(H.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${d===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:nv.map(H=>l.jsx("button",{onClick:()=>c(H.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${x===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),l.jsxs("span",{className:"text-xs text-gray-500 self-center",children:[U.length," events"]})]}),l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl divide-y divide-gray-800/50",children:U.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No events match filters"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Try adjusting category or severity filters"})]}):l.jsxs(l.Fragment,{children:[U.slice(0,p).map((H,W)=>{const I=`${H.timestamp}-${W}`,Ee=v===I;return l.jsx(rv,{event:H,isExpanded:Ee,onToggle:()=>Z(I)},I)}),U.length>=p&&l.jsx("div",{className:"p-4 text-center",children:l.jsx("button",{onClick:K,className:"px-4 py-2 text-xs text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded-lg transition-colors",children:"Load more events"})})]})})]})}function rv({event:r,isExpanded:o,onToggle:u}){const c=r.severity==="error"?"bg-rose-400":r.severity==="warning"?"bg-amber-400":"bg-gray-600",d={command:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",hook:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101",notification:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",cost:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1",sync:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581"},x=r.detail||r.metadata&&Object.keys(r.metadata).length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`px-4 py-3 flex items-start gap-3 transition-colors ${x?"cursor-pointer hover:bg-gray-800/20":""}`,onClick:x?u:void 0,children:[l.jsx("div",{className:`w-1.5 h-1.5 rounded-full mt-2 flex-shrink-0 ${c}`}),l.jsx("div",{className:"w-5 h-5 flex-shrink-0 mt-0.5 text-gray-500",children:l.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:d[r.category]||d.command})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm text-gray-300",children:r.title}),l.jsx(ie,{label:r.category,variant:_r(r.severity)})]}),r.detail&&!o&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5 truncate",children:r.detail}),r.source&&l.jsxs("span",{className:"text-[10px] text-gray-600 mt-0.5 block",children:["via ",r.source]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[r.timestamp&&l.jsx("span",{className:"text-[10px] text-gray-600 whitespace-nowrap",children:iv(r.timestamp)}),x&&l.jsx("svg",{className:`w-4 h-4 text-gray-600 transition-transform duration-200 ${o?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),o&&l.jsxs("div",{className:"px-4 pb-3 ml-10 space-y-2",children:[r.detail&&l.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Detail"}),l.jsx("p",{className:"text-xs text-gray-300 whitespace-pre-wrap",children:r.detail})]}),r.metadata&&Object.keys(r.metadata).length>0&&l.jsxs("div",{className:"bg-gray-800/50 rounded p-3",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase block mb-1",children:"Metadata"}),l.jsx("pre",{className:"text-xs text-gray-400 font-mono whitespace-pre-wrap overflow-x-auto",children:JSON.stringify(r.metadata,null,2)})]})]})]})}function iv(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function cv(){const[r,o]=j.useState(0);Ue("config-changed",()=>o(K=>K+1));const{data:u,loading:c,error:d,refetch:x}=Te(`/api/config?_r=${r}`),{activeProject:h}=rl(),[N,p]=j.useState(new Set),[m,v]=j.useState({}),[y,E]=j.useState(!1),[M,z]=j.useState(null),[R,b]=j.useState([]);if(c)return l.jsx(Ie,{});if(d)return l.jsx(Gt,{message:d,onRetry:x});if(!u)return null;const w=K=>{p(H=>{const W=new Set(H);return W.has(K)?W.delete(K):W.add(K),W})},T=Object.keys(m).length>0,U=(K,H)=>{v(W=>({...W,[K]:H})),b(W=>W.filter(I=>I.path!==K))},J=async()=>{if(T){E(!0),z(null),b([]);try{const K={};for(const[ze,je]of Object.entries(m))ov(K,ze,je);const H=h?`?project=${h.id}`:"",I=await(await fetch(`/api/config/validate${H}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})).json();if(I.errors&&I.errors.length>0){b(I.errors),z("Validation failed. Fix errors before saving."),E(!1);return}const He=await(await fetch(`/api/config${H}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(K)})).json();He.ok?(z("Saved successfully"),v({}),b([]),x(),setTimeout(()=>z(null),3e3)):z(`Error: ${He.error}`)}catch(K){z(`Error: ${K}`)}finally{E(!1)}}},V=()=>{v({}),z(null),b([])},ae=Object.entries(u).filter(([K,H])=>typeof H=="object"&&H!==null),Z=Object.entries(u).filter(([K,H])=>typeof H!="object"||H===null);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Configuration"}),l.jsx("span",{className:"text-xs text-gray-500",children:".specweave/config.json"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[M&&l.jsx("span",{className:`text-xs ${M.startsWith("Error")||M.startsWith("Validation")?"text-rose-400":"text-emerald-400"}`,children:M}),T&&l.jsxs(l.Fragment,{children:[l.jsx(ie,{label:`${Object.keys(m).length} changes`,variant:"warning"}),l.jsx("button",{onClick:V,className:"px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200 border border-gray-700 rounded-lg transition-colors",children:"Discard"}),l.jsx("button",{onClick:J,disabled:y,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:y?"Saving...":"Save Changes"})]})]})]}),M&&!T&&M==="Saved successfully"&&l.jsxs("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg px-4 py-2 flex items-center gap-2",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-400"}),l.jsx("span",{className:"text-xs text-emerald-400",children:"Configuration saved successfully"})]}),R.length>0&&l.jsxs("div",{className:"bg-rose-500/10 border border-rose-500/30 rounded-lg px-4 py-3 space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("div",{className:"w-2 h-2 rounded-full bg-rose-400"}),l.jsx("span",{className:"text-xs text-rose-400 font-medium",children:"Validation errors"})]}),R.map((K,H)=>l.jsxs("div",{className:"text-xs text-rose-300 pl-4",children:[l.jsx("span",{className:"font-mono text-rose-400",children:K.path}),": ",K.message]},H))]}),Z.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"General"}),l.jsx("div",{className:"space-y-3",children:Z.map(([K,H])=>l.jsx(Yx,{path:K,label:K,value:m[K]!==void 0?m[K]:H,original:H,onChange:W=>U(K,W),edited:m[K]!==void 0,validationError:R.find(W=>W.path===K)?.message},K))})]}),ae.map(([K,H])=>l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("button",{onClick:()=>w(K),className:"w-full px-5 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 capitalize",children:K}),lx(m,K)>0&&l.jsx(ie,{label:`${lx(m,K)} edited`,variant:"warning"}),R.some(W=>W.path.startsWith(K+"."))&&l.jsx(ie,{label:"errors",variant:"error"})]}),l.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${N.has(K)?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),N.has(K)&&l.jsx("div",{className:"px-5 py-3 border-t border-gray-800",children:l.jsx(qx,{data:H,path:K,edits:m,onChange:U,validationErrors:R,depth:0})})]},K))]})}function qx({data:r,path:o,edits:u,onChange:c,validationErrors:d,depth:x}){return x>4?l.jsx("span",{className:"text-xs text-gray-600",children:"..."}):l.jsx("div",{className:"space-y-3",style:{marginLeft:x>0?16:0},children:Object.entries(r).map(([h,N])=>{const p=`${o}.${h}`;return N&&typeof N=="object"&&!Array.isArray(N)?l.jsxs("div",{children:[l.jsx("span",{className:"text-xs text-gray-400 font-mono font-medium",children:h}),l.jsx(qx,{data:N,path:p,edits:u,onChange:c,validationErrors:d,depth:x+1})]},h):l.jsx(Yx,{path:p,label:h,value:u[p]!==void 0?u[p]:N,original:N,onChange:m=>c(p,m),edited:u[p]!==void 0,validationError:d.find(m=>m.path===p)?.message},h)})})}function Yx({path:r,label:o,value:u,original:c,onChange:d,edited:x,validationError:h}){return typeof c=="boolean"||typeof u=="boolean"?l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),l.jsx("button",{onClick:()=>d(!u),className:`relative w-9 h-5 rounded-full transition-colors ${u?"bg-indigo-600":"bg-gray-700"} ${x?"ring-1 ring-amber-500/50":""}`,children:l.jsx("div",{className:`absolute top-0.5 w-4 h-4 bg-white rounded-full transition-transform ${u?"left-[18px]":"left-0.5"}`})})]}),h&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:h})]}):typeof c=="number"||typeof u=="number"?l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),l.jsx("input",{type:"number",value:String(u??""),onChange:N=>d(N.target.value?Number(N.target.value):0),className:`bg-gray-800 border text-xs text-amber-400 font-mono rounded px-2 py-1 w-24 text-right ${h?"border-rose-500":x?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),h&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:h})]}):Array.isArray(c)||Array.isArray(u)?l.jsx(uv,{path:r,label:o,value:Array.isArray(u)?u:Array.isArray(c)?c:[],edited:x,onChange:d,validationError:h}):l.jsxs("div",{className:"py-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),l.jsx("input",{type:"text",value:String(u??""),onChange:N=>d(N.target.value),className:`bg-gray-800 border text-xs text-gray-300 rounded px-2 py-1 w-48 text-right ${h?"border-rose-500":x?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),h&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:h})]})}function uv({path:r,label:o,value:u,edited:c,onChange:d,validationError:x}){const[h,N]=j.useState(!1),[p,m]=j.useState(""),v=M=>{const z=[...u];z.splice(M,1),d(z)},y=()=>{const M=p.trim();M&&(d([...u,M]),m(""))},E=M=>{M.key==="Enter"&&(M.preventDefault(),y())};return l.jsxs("div",{className:"py-1",children:[l.jsxs("button",{onClick:()=>N(M=>!M),className:"flex items-center justify-between w-full group",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:o}),l.jsxs("div",{className:"flex items-center gap-2",children:[c&&l.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-amber-500"}),l.jsxs("span",{className:"text-xs text-gray-400 font-mono",children:["[",u.length," items]"]}),l.jsx("svg",{className:`w-3 h-3 text-gray-500 transition-transform duration-200 ${h?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),h&&l.jsxs("div",{className:"mt-2 ml-4 space-y-1",children:[u.length===0&&l.jsx("p",{className:"text-[10px] text-gray-600",children:"No items"}),u.map((M,z)=>l.jsxs("div",{className:"flex items-center gap-2 group/item",children:[l.jsx("span",{className:"text-xs text-gray-300 font-mono flex-1 truncate",children:String(M)}),l.jsx("button",{onClick:()=>v(z),className:"text-[10px] text-gray-600 hover:text-rose-400 opacity-0 group-hover/item:opacity-100 transition-opacity",children:"remove"})]},z)),l.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[l.jsx("input",{type:"text",value:p,onChange:M=>m(M.target.value),onKeyDown:E,placeholder:"Add item...",className:"bg-gray-800 border border-gray-700 text-xs text-gray-300 rounded px-2 py-1 flex-1 focus:ring-indigo-500 focus:border-indigo-500"}),l.jsx("button",{onClick:y,disabled:!p.trim(),className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded disabled:opacity-50 transition-colors",children:"Add"})]})]}),x&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:x})]})}function lx(r,o){return Object.keys(r).filter(u=>u.startsWith(o+".")).length}function ov(r,o,u){const c=o.split(".");let d=r;for(let x=0;x<c.length-1;x++)(!d[c[x]]||typeof d[c[x]]!="object")&&(d[c[x]]={}),d=d[c[x]];d[c[c.length-1]]=u}function wu({lines:r,status:o,onDismiss:u}){const c=j.useRef(null);return j.useEffect(()=>{c.current?.scrollIntoView({behavior:"smooth"})},[r]),r.length===0&&o==="idle"?null:l.jsxs("div",{className:"mt-4 rounded-lg bg-gray-950 border border-gray-700 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-900 border-b border-gray-700",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${o==="running"?"bg-yellow-400 animate-pulse":o==="success"?"bg-green-400":o==="error"?"bg-red-400":"bg-gray-500"}`}),l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:o==="running"?"Running...":o==="success"?"Completed":o==="error"?"Failed":"Output"})]}),o!=="running"&&u&&l.jsx("button",{onClick:u,className:"text-gray-500 hover:text-gray-300 text-xs",children:"Dismiss"})]}),l.jsxs("div",{className:"p-3 max-h-48 overflow-y-auto font-mono text-xs text-gray-300 whitespace-pre-wrap",children:[r.map((d,x)=>l.jsx("div",{children:d},x)),l.jsx("div",{ref:c})]})]})}function dv(){const{data:r,loading:o}=Te("/api/plugins/full"),{execute:u,running:c,output:d,status:x,reset:h}=zr(),[N,p]=j.useState(null);if(o)return l.jsx(Ie,{});const m=r?.plugins||[],v=r?.skills||[],y=r?.lsp,E=r?.warmup,M=r?.triggerCount||0,z=m.reduce((T,U)=>T+U.skillCount,0),R=m.reduce((T,U)=>T+U.commandCount,0),b=T=>v.filter(U=>U.plugin===T).sort((U,J)=>J.count-U.count),w=T=>{p(U=>U===T?null:T)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Plugins & LSP"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>u("lsp-status"),disabled:c,className:"px-3 py-1.5 bg-gray-700 hover:bg-gray-600 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Check LSP"}),l.jsx("button",{onClick:()=>u("refresh-plugins"),disabled:c,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:c?"Running...":"Refresh Plugins"})]})]}),l.jsx(wu,{lines:d,status:x,onDismiss:h}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[l.jsx($a,{label:"Plugins",value:m.length}),l.jsx($a,{label:"Total Skills",value:z}),l.jsx($a,{label:"Total Commands",value:R}),l.jsx($a,{label:"Trigger Keywords",value:M})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Installed Plugins"})}),m.length===0?l.jsx("div",{className:"p-5 text-gray-500 text-xs",children:"No plugins installed"}):l.jsx("div",{className:"divide-y divide-gray-800/50",children:m.map(T=>{const U=N===T.name,J=b(T.name);return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>w(T.name),className:"w-full px-4 py-3 flex items-center justify-between hover:bg-gray-800/30 transition-colors text-left",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("span",{className:"text-sm text-gray-300",children:T.name}),l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:T.version})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ie,{label:`${T.skillCount} skills`,variant:"info"}),l.jsx(ie,{label:`${T.commandCount} cmds`,variant:"default"}),l.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${U?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),U&&l.jsx("div",{className:"px-4 pb-4 bg-gray-800/20",children:J.length===0?l.jsx("p",{className:"text-xs text-gray-600 py-2",children:"No skill usage data for this plugin"}):l.jsxs("div",{className:"space-y-1 mt-1",children:[l.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1",children:[l.jsx("span",{className:"text-[10px] text-gray-600 uppercase",children:"Skill"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Invocations"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Success"}),l.jsx("span",{className:"text-[10px] text-gray-600 uppercase text-right",children:"Last Used"})]}),J.map(V=>l.jsxs("div",{className:"grid grid-cols-[1fr,80px,80px,120px] gap-2 px-2 py-1.5 bg-gray-800/40 rounded",children:[l.jsx("span",{className:"text-xs text-gray-300 font-mono truncate",children:V.name}),l.jsx("span",{className:"text-xs text-gray-400 text-right font-mono",children:V.count}),l.jsxs("span",{className:"text-xs text-right font-mono",children:[l.jsx("span",{className:"text-emerald-400",children:V.successCount}),V.failureCount>0&&l.jsxs("span",{className:"text-rose-400",children:["/",V.failureCount]})]}),l.jsx("span",{className:"text-[10px] text-gray-500 text-right",children:V.lastUsed?fv(V.lastUsed):"-"})]},V.name))]})})]},T.name)})})]}),v.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Skill Usage Leaderboard"}),l.jsx(Ux,{items:v.sort((T,U)=>U.count-T.count).slice(0,20).map(T=>({label:T.name,value:T.count,color:"#10b981"})),maxBars:20})]}),y&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Status"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ie,{label:y.status,variant:y.status==="ok"?"success":"warning"}),y.checked&&l.jsxs("span",{className:"text-[10px] text-gray-600",children:["Checked: ",new Date(y.checked).toLocaleDateString()]})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[l.jsx($a,{label:"Total Languages",value:y.stats.totalLanguages}),l.jsx($a,{label:"Checked",value:y.stats.checkedLanguages}),l.jsx($a,{label:"Binary Missing",value:y.stats.binaryMissing}),l.jsx($a,{label:"Plugin Missing",value:y.stats.pluginMissing})]}),y.missing.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-xs text-gray-500",children:"Missing Languages"}),y.missing.map((T,U)=>l.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-800/50 rounded",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ie,{label:T.type,variant:T.type==="binary"?"warning":"default"}),l.jsx("span",{className:"text-xs text-gray-300",children:T.language})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"text-[10px] text-gray-500",children:T.binaryInstall}),T.message&&l.jsx("span",{className:"text-[10px] text-gray-600 max-w-[200px] truncate",children:T.message})]})]},U))]})]}),E&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"LSP Warmup Status"}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[E.elapsed?`${(E.elapsed/1e3).toFixed(1)}s`:""," |"," ",E.timestamp?new Date(E.timestamp).toLocaleString():""]})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[E.warmedUp.map(T=>l.jsx(ie,{label:T,variant:"success"},T)),E.failed.map(T=>l.jsx(ie,{label:T,variant:"error"},T))]}),E.warmedUp.length===0&&E.failed.length===0&&l.jsx("p",{className:"text-gray-600 text-xs",children:"No warmup data"})]})]})}function $a({label:r,value:o}){return l.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-3 text-center",children:[l.jsx("div",{className:"text-lg font-bold text-gray-300",children:o}),l.jsx("div",{className:"text-[10px] text-gray-500",children:r})]})}function fv(r){if(!r)return"-";const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function xv(){const{data:r,loading:o}=Te("/api/links"),{data:u,loading:c,refetch:d}=Te("/api/services"),{execute:x,running:h,output:N,status:p,reset:m}=zr();if(o||c)return l.jsx(Ie,{});const v=(u||[]).filter(b=>b.status==="running").length,y=(u||[]).length,E=new Map;for(const b of u||[])if(b.port>0&&b.status==="running"){const w=E.get(b.port)||[];w.push(b.name),E.set(b.port,w)}const M=Array.from(E.entries()).filter(([,b])=>b.length>1),z=async b=>{await x(b,{timeoutMs:3e5}),setTimeout(()=>d(),3e3)},R=async b=>{await x(b,{timeoutMs:3e5}),setTimeout(()=>d(),2e3)};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Services & Links"}),l.jsx(wu,{lines:N,status:p,onDismiss:m}),M.length>0&&l.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-xl p-4 flex items-start gap-3",children:[l.jsx("svg",{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm font-medium text-amber-300",children:"Port Conflict Detected"}),l.jsx("div",{className:"text-xs text-amber-400/80 mt-1",children:M.map(([b,w])=>l.jsxs("span",{className:"block",children:["Port ",b," is used by: ",w.join(", ")]},b))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Services",value:y,color:"indigo",tooltip:`${y} managed services`}),l.jsx(ne,{title:"Running",value:v,color:"emerald",tooltip:`${v} services currently active`}),l.jsx(ne,{title:"External Links",value:(r||[]).length,color:"cyan",tooltip:"Configured external links (docs, repos, etc.)"}),l.jsx(ne,{title:"Stopped",value:y-v,color:"rose",tooltip:`${y-v} services not running`})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"Service Status"}),l.jsx("div",{className:"space-y-3",children:(u||[]).map((b,w)=>l.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${b.status==="running"?"bg-emerald-400":"bg-gray-600"}`}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-300",children:b.name}),l.jsx("div",{className:"text-[10px] text-gray-600",children:b.status==="running"&&b.detail?l.jsx("a",{href:b.detail,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 underline transition-colors",children:b.detail}):b.detail})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[b.status==="running"&&b.port>0&&l.jsx(ie,{label:`Port ${b.port}`,variant:"info"}),b.status==="running"?l.jsx(ie,{label:"Running",variant:"success"}):l.jsx(ie,{label:"Stopped",variant:"default"}),b.startCommand&&b.stopCommand?b.status==="running"?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("a",{href:b.detail,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded transition-colors",children:"Open"}),l.jsx("button",{onClick:()=>R(b.stopCommand),disabled:h,className:"px-2 py-1 text-[10px] text-rose-400 hover:text-rose-300 border border-rose-500/30 rounded transition-colors disabled:opacity-50",children:"Stop"})]}):l.jsx("button",{onClick:()=>z(b.startCommand),disabled:h,className:"px-2 py-1 text-[10px] text-emerald-400 hover:text-emerald-300 border border-emerald-500/30 rounded transition-colors disabled:opacity-50",children:h?"Starting...":"Start"}):b.status==="running"&&l.jsx("a",{href:b.detail,target:"_blank",rel:"noopener noreferrer",className:"px-2 py-1 text-[10px] text-indigo-400 hover:text-indigo-300 border border-indigo-500/30 rounded transition-colors",children:"Open"})]})]},w))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-4",children:"External Links"}),(r||[]).length===0?l.jsx("p",{className:"text-xs text-gray-500",children:"No external links configured"}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:(r||[]).map((b,w)=>l.jsxs("a",{href:b.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg hover:bg-gray-800 transition-colors group",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(mv,{type:b.type}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm text-gray-300 group-hover:text-white transition-colors",children:b.name}),l.jsx("div",{className:"text-[10px] text-gray-600 truncate max-w-[200px]",children:b.url})]})]}),l.jsx("svg",{className:"w-4 h-4 text-gray-600 group-hover:text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]},w))})]})]})}function mv({type:r}){const o={docs:"bg-indigo-600",github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return l.jsx("div",{className:`w-8 h-8 rounded-lg ${o[r]||"bg-gray-700"} flex items-center justify-center`,children:l.jsx("span",{className:"text-xs text-white font-bold",children:r[0]?.toUpperCase()})})}const nx={critical:0,warning:1,info:2};function hv(){const[r,o]=j.useState("pending"),[u,c]=j.useState(null),[d,x]=j.useState(0);Ue("notification",()=>x(H=>H+1));const{activeProject:h}=rl(),{data:N,loading:p,error:m,refetch:v}=Te(`/api/notifications?_r=${d}`);if(p)return l.jsx(Ie,{});if(m)return l.jsx(Gt,{message:m,onRetry:v});const y=N||[],E=y.filter(H=>!H.dismissedAt),M=y.filter(H=>!!H.dismissedAt),z=E.filter(H=>H.severity==="critical"),R=E.filter(H=>H.severity==="warning"),w=[...r==="pending"?E:r==="dismissed"?M:y].sort((H,W)=>{const I=nx[H.severity]??3,Ee=nx[W.severity]??3;return I!==Ee?I-Ee:new Date(W.createdAt).getTime()-new Date(H.createdAt).getTime()}),T=async H=>{c(H);try{const W=h?`?project=${h.id}`:"";(await fetch(`/api/notifications/${H}/dismiss${W}`,{method:"POST"})).ok&&v()}finally{c(null)}},U=async()=>{c("__all__");try{const H=h?`?project=${h.id}`:"";for(const W of E)await fetch(`/api/notifications/${W.id}/dismiss${H}`,{method:"POST"});v()}finally{c(null)}},J=H=>H==="critical"?"error":H==="warning"?"warning":"info",V=H=>H==="critical"?"border-l-rose-500":H==="warning"?"border-l-amber-500":"border-l-blue-500",Z=(H=>{const W={};for(const I of H)W[I.severity]||(W[I.severity]=[]),W[I.severity].push(I);return W})(w),K={critical:"Critical",warning:"Warnings",info:"Informational"};return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Notifications"}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Pending",value:E.length,color:"indigo"}),l.jsx(ne,{title:"Critical",value:z.length,color:"rose"}),l.jsx(ne,{title:"Warnings",value:R.length,color:"amber"}),l.jsx(ne,{title:"Dismissed",value:M.length,color:"cyan"})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:[{value:"pending",label:`Pending (${E.length})`},{value:"dismissed",label:`Dismissed (${M.length})`},{value:"all",label:`All (${y.length})`}].map(H=>l.jsx("button",{onClick:()=>o(H.value),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${r===H.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:H.label},H.value))}),E.length>0&&l.jsx("button",{onClick:U,disabled:u==="__all__",className:"px-3 py-1.5 text-xs text-gray-400 hover:text-gray-200 border border-gray-700 rounded-lg transition-colors disabled:opacity-50",children:u==="__all__"?"Dismissing...":"Dismiss All"})]}),w.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mx-auto mb-4",children:l.jsx("svg",{className:"w-6 h-6 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})}),l.jsx("p",{className:"text-gray-400 text-sm font-medium",children:r==="pending"?"No pending notifications":"No notifications"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs mx-auto",children:"Notifications appear here when imports complete, discrepancies are found, or syncs fail"})]}):l.jsx("div",{className:"space-y-4",children:["critical","warning","info"].map(H=>{const W=Z[H];return!W||W.length===0?null:l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("h3",{className:"text-xs font-medium text-gray-400 uppercase",children:K[H]||H}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:["(",W.length,")"]})]}),l.jsx("div",{className:"space-y-2",children:W.map(I=>l.jsxs("div",{className:`bg-gray-900/50 border border-gray-800 border-l-4 ${V(I.severity)} rounded-xl p-4 flex items-start gap-4 ${I.dismissedAt?"opacity-60":""}`,children:[l.jsx(gv,{severity:I.severity}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"text-sm font-medium text-gray-200",children:I.title}),l.jsx(ie,{label:I.severity,variant:J(I.severity)}),I.type&&l.jsx(ie,{label:I.type,variant:"default"})]}),I.message&&l.jsx("p",{className:"text-xs text-gray-400 mb-2",children:I.message}),l.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-600",children:[l.jsx("span",{children:new Date(I.createdAt).toLocaleString()}),I.source&&l.jsxs("span",{children:["via ",I.source]}),I.dismissedAt&&l.jsxs("span",{children:["Dismissed ",new Date(I.dismissedAt).toLocaleString()]})]})]}),!I.dismissedAt&&l.jsx("button",{onClick:()=>T(I.id),disabled:u===I.id,className:"px-2 py-1 text-xs text-gray-500 hover:text-gray-300 hover:bg-gray-800 rounded transition-colors disabled:opacity-50 flex-shrink-0",children:u===I.id?"...":"Dismiss"})]},I.id))})]},H)})})]})}function gv({severity:r}){return r==="critical"?l.jsx("div",{className:"w-8 h-8 rounded-full bg-rose-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-rose-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4.5c-.77-.833-2.694-.833-3.464 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z"})})}):r==="warning"?l.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}):l.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-500/10 flex items-center justify-center flex-shrink-0",children:l.jsx("svg",{className:"w-4 h-4 text-blue-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})}function pv(r){if(!r)return null;if(r.startsWith("https://"))return r.replace(/\.git$/,"");const o=r.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(o)return`https://${o[1]}/${o[2]}`;const u=r.match(/^ssh:\/\/git@([^/]+)\/(.+?)(?:\.git)?$/);return u?`https://${u[1]}/${u[2]}`:null}function yv(){const{data:r,loading:o,error:u,refetch:c}=Te("/api/repos");if(o)return l.jsx(Ie,{});if(u)return l.jsx(Gt,{message:u,onRetry:c});const d=r||[],x=[...new Set(d.map(p=>p.org))],h=d.filter(p=>p.hasSpecweave||p.isUmbrellaManaged).length,N=d.find(p=>p.isCurrent);return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Repositories"}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Repositories",value:d.length,color:"indigo"}),l.jsx(ne,{title:"Organizations",value:x.length,color:"cyan"}),l.jsx(ne,{title:"With SpecWeave",value:h,color:"emerald"}),l.jsx(ne,{title:"Current",value:N?N.name:"-",subtitle:N?`${N.org}/${N.name}`:"No current project",color:"amber"})]}),d.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories found"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"This project doesn't use multi-repo mode, or the repositories/ directory hasn't been set up yet"})]}):l.jsx(l.Fragment,{children:x.map(p=>{const m=d.filter(v=>v.org===p);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(vv,{}),l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:p}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[m.length," ",m.length===1?"repo":"repos"]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:m.map(v=>{const y=pv(v.remote);return l.jsxs("div",{className:`bg-gray-900/50 border rounded-xl p-4 ${v.isCurrent?"border-indigo-500/30":"border-gray-800"}`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(bv,{}),l.jsx("span",{className:"text-sm font-medium text-gray-300",children:v.name})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[v.isCurrent&&l.jsx(ie,{label:"Current Project",variant:"info"}),l.jsx(ie,{label:v.hasSpecweave?"SpecWeave":v.isUmbrellaManaged?"via umbrella":"No SpecWeave",variant:v.hasSpecweave?"success":v.isUmbrellaManaged?"info":"default"})]})]}),l.jsxs("div",{className:"space-y-1.5 mt-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Organization"}),l.jsx("span",{className:"text-[10px] text-gray-400",children:v.org})]}),v.branch&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Branch"}),l.jsx(ie,{label:v.branch,variant:"default"})]}),y&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),l.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-indigo-400 hover:text-indigo-300 hover:underline truncate max-w-[180px]",title:y,children:y.replace("https://","")})]}),!y&&v.remote&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Remote"}),l.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:v.remote,children:v.remote})]}),v.path&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Path"}),l.jsx("span",{className:"text-[10px] text-gray-600 font-mono truncate max-w-[180px]",title:v.path,children:v.path.split("/").slice(-3).join("/")})]}),v.lastModified&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Last Modified"}),l.jsx("span",{className:"text-[10px] text-gray-400",children:Nv(v.lastModified)})]})]}),y&&l.jsxs("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:"mt-3 flex items-center justify-center gap-1.5 text-xs text-gray-400 hover:text-gray-200 py-2 border border-gray-800 rounded-lg hover:border-gray-700 transition-colors",children:[l.jsx(jv,{}),"Open on GitHub"]})]},v.path||`${v.org}/${v.name}`)})})]},p)})})]})}function vv(){return l.jsx("div",{className:"w-6 h-6 rounded bg-gray-700 flex items-center justify-center",children:l.jsx("svg",{className:"w-3.5 h-3.5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})})})}function bv(){return l.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}function jv(){return l.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:l.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}function Nv(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}const Sv=[{value:"",label:"All"},{value:"discovered",label:"Discovered"},{value:"scanning",label:"Scanning"},{value:"tier1_passed",label:"Passed"},{value:"tier1_failed",label:"Failed"},{value:"verified",label:"Verified"},{value:"rejected",label:"Rejected"}],xa=20;function Ev(r){switch(r){case"discovered":return"default";case"queued":return"info";case"scanning":return"warning";case"tier1_passed":return"success";case"tier1_failed":return"error";case"tier2_pending":return"info";case"verified":return"success";case"rejected":return"error";default:return"default"}}function Cv(r){switch(r){case"discovered":return"Discovered";case"queued":return"Queued";case"scanning":return"Scanning";case"tier1_passed":return"T1 Passed";case"tier1_failed":return"T1 Failed";case"tier2_pending":return"T2 Pending";case"verified":return"Verified";case"rejected":return"Rejected";default:return r}}function sx(r){if(!r)return"-";try{const o=Date.now()-new Date(r).getTime(),u=Math.floor(o/6e4);if(u<1)return"just now";if(u<60)return`${u}m ago`;const c=Math.floor(u/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function wv(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function Gx(r){const o=r.tier1Result?.score??0,u=r.tier2Result?.score??0;return o&&u?Math.round((o+u)/2):o||u}function Tv(r){return r>=80?"bg-emerald-500":r>=50?"bg-amber-500":"bg-rose-500"}function Av(r){return r>=80?"text-emerald-400":r>=50?"text-amber-400":"text-rose-400"}function Rv(r){return r>=1e6?`${(r/1e6).toFixed(1)}m`:r>=1e3?`${(r/1e3).toFixed(1)}k`:String(r)}function rx(r){const o=Math.log10(Math.max(r.stars,1))*20,u=Gx(r);return o+u}function Mv(r,o){if(o===0)return"rose";const u=r/o;return u>.5?"emerald":u>.1?"amber":"rose"}function _v(){const[r,o]=j.useState(""),[u,c]=j.useState(0),[d,x]=j.useState(0),[h,N]=j.useState(null),[p,m]=j.useState(""),{output:v,status:y,reset:E}=zr(),M=r?`status=${r}&limit=${xa}&offset=${u}`:`limit=${xa}&offset=${u}`,{data:z,loading:R,error:b,refetch:w}=Te(`/api/marketplace/scanner/status?_r=${d}`),{data:T,loading:U,refetch:J}=Te(`/api/marketplace/queue?${M}&_r=${d}`),{data:V,loading:ae}=Te(`/api/marketplace/verified?_r=${d}`),{data:Z,loading:K}=Te(`/api/marketplace/insights?_r=${d}`),H=j.useCallback(()=>{x(S=>S+1)},[]);Ue("submission-update",j.useCallback(()=>{H()},[H])),Ue("marketplace-scan",j.useCallback(()=>{H()},[H])),Ue("verification-complete",j.useCallback(()=>{H()},[H]));const W=async()=>{try{const S=new URLSearchParams(window.location.search).get("project")||"",q=S?`?project=${S}`:"";await fetch(`/api/marketplace/scanner/start${q}`,{method:"POST"}),w()}catch{}},I=async()=>{try{const S=new URLSearchParams(window.location.search).get("project")||"",q=S?`?project=${S}`:"";await fetch(`/api/marketplace/scanner/stop${q}`,{method:"POST"}),w()}catch{}},Ee=async S=>{N(S);try{const q=new URLSearchParams(window.location.search).get("project")||"",Q=q?`?project=${q}`:"";await fetch(`/api/marketplace/queue/${S}/approve${Q}`,{method:"POST"}),J()}catch{}N(null)},He=async S=>{N(S);try{const q=new URLSearchParams(window.location.search).get("project")||"",Q=q?`?project=${q}`:"";await fetch(`/api/marketplace/queue/${S}/reject${Q}`,{method:"POST"}),J()}catch{}N(null)};if(R&&U&&ae&&K)return l.jsx(Ie,{});const je=T?.items||[],k=T?.total||0,X=V||[],se=Math.floor(u/xa)+1,ye=Math.ceil(k/xa),Ne=S=>S==="tier1_passed"||S==="tier2_pending";return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Marketplace Scanner"}),l.jsx("div",{className:"flex gap-2",children:z?.running?l.jsx("button",{onClick:I,className:"px-3 py-1.5 bg-rose-600 hover:bg-rose-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Stop Scanner"}):l.jsx("button",{onClick:W,className:"px-3 py-1.5 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-xs rounded-lg transition-colors",children:"Start Scanner"})})]}),l.jsx(wu,{lines:v,status:y,onDismiss:E}),b&&l.jsx(Gt,{message:b,onRetry:w}),z?l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Scanner",value:z.running?"Running":"Stopped",subtitle:z.running?"Active":"Idle",color:z.running?"emerald":"amber"}),l.jsx(ne,{title:"Last Scan",value:z.lastScanTime?sx(z.lastScanTime):"Never",color:"cyan"}),l.jsx(ne,{title:"Repos Scanned",value:z.reposScanned,color:"indigo"}),l.jsx(ne,{title:"Rate Limit",value:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null?`${z.rateLimitRemaining}/${z.rateLimitTotal}`:"No token",subtitle:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null&&z.rateLimitTotal>0?`${Math.round(z.rateLimitRemaining/z.rateLimitTotal*100)}% remaining`:"Set GITHUB_TOKEN in environment",color:z.rateLimitRemaining!=null&&z.rateLimitTotal!=null?Mv(z.rateLimitRemaining,z.rateLimitTotal):"amber"})]}):!R&&!b?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("div",{className:"text-gray-400 text-sm mb-2",children:"No scanner data available"}),l.jsx("p",{className:"text-gray-600 text-xs mb-4",children:"Start the marketplace scanner to discover and verify community skills."}),l.jsx("button",{onClick:W,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white text-sm rounded-lg transition-colors",children:"Start Scanner"})]}):null,l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Submission Queue"}),l.jsxs("span",{className:"text-xs text-gray-500",children:[k," total"]})]}),l.jsx("div",{className:"flex gap-1 px-4 pt-3 pb-2 overflow-x-auto",children:Sv.map(S=>l.jsx("button",{onClick:()=>{o(S.value),c(0)},className:`px-3 py-1.5 text-xs rounded-md transition-colors whitespace-nowrap ${r===S.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300 hover:bg-gray-800"}`,children:S.label},S.value))}),U?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(Ie,{})}):je.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No submissions found"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:r?"Try a different filter.":"Submissions will appear here once the scanner discovers repos."})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Repo"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Author"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Stars"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Status"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Tier"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Security"}),l.jsx("th",{className:"text-left px-4 py-2 text-xs text-gray-500",children:"Discovered"}),l.jsx("th",{className:"text-right px-4 py-2 text-xs text-gray-500",children:"Actions"})]})}),l.jsx("tbody",{children:je.map(S=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"px-4 py-2",children:S.repoUrl?l.jsx("a",{href:S.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-400 hover:text-indigo-300 font-mono",children:S.repoFullName}):l.jsx("span",{className:"text-xs text-gray-300 font-mono",children:S.repoFullName})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:S.author}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 text-right font-mono",children:S.stars.toLocaleString()}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(ie,{label:Cv(S.status),variant:Ev(S.status)})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:S.tier||"-"}),l.jsx("td",{className:`px-4 py-2 text-xs text-right font-mono ${wv(S.securityScore)}`,children:S.securityScore!=null?S.securityScore:"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:sx(S.discoveredAt)}),l.jsx("td",{className:"px-4 py-2 text-right",children:Ne(S.status)&&l.jsxs("div",{className:"flex gap-1 justify-end",children:[l.jsx("button",{onClick:()=>Ee(S.id),disabled:h===S.id,className:"px-2 py-1 bg-emerald-600/20 hover:bg-emerald-600/40 text-emerald-400 text-[10px] rounded transition-colors disabled:opacity-50",children:"Approve"}),l.jsx("button",{onClick:()=>He(S.id),disabled:h===S.id,className:"px-2 py-1 bg-rose-600/20 hover:bg-rose-600/40 text-rose-400 text-[10px] rounded transition-colors disabled:opacity-50",children:"Reject"})]})})]},S.id))})]})}),k>xa&&l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-800",children:[l.jsxs("span",{className:"text-xs text-gray-500",children:[u+1,"-",Math.min(u+xa,k)," of ",k]}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{onClick:()=>c(Math.max(0,u-xa)),disabled:u===0,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Prev"}),l.jsxs("span",{className:"px-2 py-1 text-xs text-gray-500",children:["Page ",se," of ",ye]}),l.jsx("button",{onClick:()=>c(u+xa),disabled:u+xa>=k,className:"px-2 py-1 text-xs text-gray-400 hover:text-gray-200 disabled:opacity-30 disabled:cursor-not-allowed",children:"Next"})]})]})]})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-5 py-3 border-b border-gray-800 flex items-center justify-between gap-4",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 shrink-0",children:"Popular Skills"}),X.length>0&&l.jsxs("div",{className:"relative max-w-xs w-full",children:[l.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),l.jsx("input",{type:"text",placeholder:"Discover popular skills...",value:p,onChange:S=>m(S.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-gray-800/50 border border-gray-700 rounded-lg text-xs text-gray-200 placeholder-gray-500 focus:outline-none focus:border-gray-600 transition-colors"})]})]}),ae?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(Ie,{})}):X.length===0?l.jsxs("div",{className:"p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No verified skills yet"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:"Skills will appear here after passing security verification."})]}):l.jsx(zv,{skills:X,search:p})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:"Insights"})}),K?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(Ie,{})}):Z?l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Discovered",value:Z.totalDiscovered,color:"cyan"}),l.jsx(ne,{title:"Verified",value:Z.totalVerified,color:"emerald"}),l.jsx(ne,{title:"Rejected",value:Z.totalRejected,color:"rose"}),l.jsx(ne,{title:"Pending",value:Z.totalPending,color:"amber"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(ix,{label:"Tier 1 Pass Rate",rate:Z.tier1PassRate}),l.jsx(ix,{label:"Tier 2 Pass Rate",rate:Z.tier2PassRate})]})]}):l.jsx("div",{className:"p-8 text-center",children:l.jsx("p",{className:"text-gray-500 text-sm",children:"No insights data available"})})]})]})}function zv({skills:r,search:o}){const u=[...r].sort((x,h)=>rx(h)-rx(x)),c=new Set(u.slice(0,3).map(x=>x.id)),d=o?u.filter(x=>x.repoFullName.toLowerCase().includes(o.toLowerCase())||x.author.toLowerCase().includes(o.toLowerCase())):u;return d.length===0?l.jsx("div",{className:"p-8 text-center",children:l.jsxs("p",{className:"text-gray-500 text-sm",children:['No skills match "',o,'"']})}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-4",children:d.map(x=>l.jsx(Dv,{skill:x,trending:c.has(x.id)},x.id))})}function Dv({skill:r,trending:o}){const u=Gx(r),c=Tv(u),d=Av(u);return l.jsxs("div",{className:"bg-gray-800/50 border border-gray-700/50 rounded-lg p-4 hover:border-gray-600 transition-colors",children:[l.jsxs("div",{className:"flex items-start justify-between mb-2",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[r.repoUrl?l.jsx("a",{href:r.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-gray-200 hover:text-indigo-300 truncate block transition-colors",children:r.repoFullName.split("/").pop()}):l.jsx("div",{className:"text-sm font-medium text-gray-200 truncate",children:r.repoFullName.split("/").pop()}),l.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:r.author})]}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[o&&l.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 bg-orange-500/15 text-orange-400 text-[10px] font-medium rounded",children:[l.jsx("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 20 20",fill:"currentColor",children:l.jsx("path",{fillRule:"evenodd",d:"M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z",clipRule:"evenodd"})}),"Hot"]}),l.jsx(ie,{label:"Verified",variant:"success"})]})]}),l.jsxs("div",{className:"mb-3",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:"Trust"}),l.jsx("span",{className:`text-xs font-mono font-medium ${d}`,children:u})]}),l.jsx("div",{className:"w-full h-1.5 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${u}%`}})})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs text-gray-400 flex items-center gap-1",children:[l.jsx("svg",{className:"w-3.5 h-3.5 text-amber-400",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})}),Rv(r.stars)]}),r.repoUrl&&l.jsx("a",{href:r.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-gray-500 hover:text-gray-300 transition-colors",children:"View on GitHub"})]})]})}function ix({label:r,rate:o}){const u=Math.round(o),c=u>=70?"bg-emerald-500":u>=40?"bg-amber-500":"bg-rose-500";return l.jsxs("div",{className:"bg-gray-800/50 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-sm font-bold text-gray-200",children:[u,"%"]})]}),l.jsx("div",{className:"w-full h-2 bg-gray-700 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${c} rounded-full transition-all duration-500`,style:{width:`${u}%`}})})]})}function Ov(){const{id:r}=ip(),[o,u]=j.useState(0);Ue("increment-update",()=>u(m=>m+1));const{data:c,loading:d,error:x,refetch:h}=Te(`/api/increments/${r||"_none"}?_r=${o}`);if(!r)return l.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"No increment ID specified"});if(d)return l.jsx(Ie,{});if(x)return l.jsx(Gt,{message:x,onRetry:h});if(!c)return l.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"Increment not found"});const N=c.taskSummary.total>0?Math.round(c.taskSummary.completed/c.taskSummary.total*100):0,p=c.acSummary.total>0?Math.round(c.acSummary.completed/c.acSummary.total*100):0;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[l.jsx("span",{className:"text-xs text-indigo-400 font-mono",children:c.dirName}),l.jsx(ie,{label:c.metadata.status||"unknown",variant:_r(c.metadata.status||"")}),c.metadata.type&&l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:c.metadata.type}),c.metadata.priority&&l.jsx(Uv,{priority:c.metadata.priority})]}),l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:c.metadata.title||c.id}),c.metadata.project&&l.jsxs("span",{className:"text-xs text-gray-500",children:["Project: ",c.metadata.project]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Tasks",value:`${c.taskSummary.completed}/${c.taskSummary.total}`,color:"indigo"}),l.jsx(ne,{title:"Task Progress",value:`${N}%`,color:"cyan"}),l.jsx(ne,{title:"ACs",value:`${c.acSummary.completed}/${c.acSummary.total}`,color:"emerald"}),l.jsx(ne,{title:"AC Progress",value:`${p}%`,color:"amber"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 space-y-4",children:[l.jsx(cx,{label:"Tasks",completed:c.taskSummary.completed,total:c.taskSummary.total,color:"indigo"}),l.jsx(cx,{label:"Acceptance Criteria",completed:c.acSummary.completed,total:c.acSummary.total,color:"emerald"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Tasks (",c.tasks.length,")"]})}),c.tasks.length===0?l.jsx("div",{className:"p-5 text-center text-gray-500 text-xs",children:"No tasks found in tasks.md"}):l.jsx("div",{className:"divide-y divide-gray-800/50",children:c.tasks.map(m=>l.jsxs("div",{className:"px-5 py-3 flex items-center gap-3",children:[l.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ${m.status==="completed"?"bg-indigo-500/20 border-indigo-500 text-indigo-400":"border-gray-600"}`,children:m.status==="completed"&&l.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:m.id}),l.jsx("span",{className:`text-sm ${m.status==="completed"?"text-gray-500 line-through":"text-gray-300"}`,children:m.title})]}),(m.userStory||m.acs)&&l.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[m.userStory&&l.jsx("span",{className:"text-[10px] text-indigo-400",children:m.userStory}),m.acs?.map(v=>l.jsx("span",{className:"text-[10px] text-emerald-500",children:v},v))]})]})]},m.id))})]}),c.acs.length>0&&l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsx("div",{className:"px-5 py-3 border-b border-gray-800",children:l.jsxs("h3",{className:"text-sm font-medium text-gray-300",children:["Acceptance Criteria (",c.acs.length,")"]})}),l.jsx("div",{className:"divide-y divide-gray-800/50",children:c.acs.map(m=>l.jsxs("div",{className:"px-5 py-3 flex items-start gap-3",children:[l.jsx("div",{className:`w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 mt-0.5 ${m.completed?"bg-emerald-500/20 border-emerald-500 text-emerald-400":"border-gray-600"}`,children:m.completed&&l.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),l.jsxs("div",{children:[l.jsx("span",{className:"text-xs text-emerald-500 font-mono",children:m.id}),l.jsx("span",{className:`text-sm ml-2 ${m.completed?"text-gray-500 line-through":"text-gray-300"}`,children:m.text})]})]},m.id))})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5",children:[l.jsx("h3",{className:"text-sm font-medium text-gray-300 mb-3",children:"Metadata"}),l.jsx("div",{className:"space-y-1.5",children:Object.entries(c.metadata).filter(([m])=>!["title"].includes(m)).map(([m,v])=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:m}),l.jsx("span",{className:"text-xs text-gray-400",children:typeof v=="object"?JSON.stringify(v):String(v??"")})]},m))})]})]})}function cx({label:r,completed:o,total:u,color:c}){const d=u>0?Math.round(o/u*100):0,x=c==="emerald"?"bg-emerald-500":"bg-indigo-500";return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("span",{className:"text-xs text-gray-400",children:r}),l.jsxs("span",{className:"text-xs text-gray-500",children:[o,"/",u," (",d,"%)"]})]}),l.jsx("div",{className:"w-full h-2 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${x} rounded-full transition-all`,style:{width:`${d}%`}})})]})}function Uv({priority:r}){const o={P0:"text-rose-400 bg-rose-500/10",P1:"text-amber-400 bg-amber-500/10",P2:"text-cyan-400 bg-cyan-500/10",P3:"text-gray-400 bg-gray-500/10"};return l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded ${o[r]||o.P2}`,children:r})}const Lv=["All","PreToolUse","PostToolUse","Stop","SubagentStop","TaskCompleted","UserPromptSubmit","PostToolUseFailure","PermissionRequest","SessionStart","SessionEnd","Notification","SubagentStart","ConfigChange","PreCompact","TeammateIdle"],Hv=[{label:"All time",value:"0"},{label:"Last 1h",value:"3600000"},{label:"Last 6h",value:"21600000"},{label:"Last 24h",value:"86400000"}];function Bv(r){const o=Date.now()-new Date(r).getTime();return o<6e4?`${Math.floor(o/1e3)}s ago`:o<36e5?`${Math.floor(o/6e4)}m ago`:o<864e5?`${Math.floor(o/36e5)}h ago`:`${Math.floor(o/864e5)}d ago`}function kv(r){const o=[];for(const u of r){const c=o[o.length-1];c&&c.type===u.eventName&&c.count<100?(c.count++,c.events.push(u)):o.push({type:u.eventName,count:1,events:[u],collapsed:!0})}return o}function $v(){const{data:r,loading:o}=Te("/api/hooks/events?limit=200"),[u,c]=j.useState([]),[d,x]=Ut("eventType","All"),[h,N]=Ut("session",""),[p,m]=Ut("range","0"),[v,y]=j.useState(null),[E,M]=j.useState(new Set);Ue("hook-event",w=>{const T=w;T.id&&c(U=>[T,...U].slice(0,50))});const z=j.useMemo(()=>{const w=r?.data??[],T=new Set(w.map(J=>J.id));return[...u.filter(J=>!T.has(J.id)),...w].sort((J,V)=>new Date(V.timestamp).getTime()-new Date(J.timestamp).getTime())},[r,u]),R=j.useMemo(()=>{let w=z;d!=="All"&&(w=w.filter(U=>U.eventName===d)),h&&(w=w.filter(U=>U.sessionId.includes(h)));const T=parseInt(p,10);if(T>0){const U=Date.now()-T;w=w.filter(J=>new Date(J.timestamp).getTime()>U)}return w},[z,d,h,p]),b=j.useMemo(()=>kv(R),[R]);return o&&!r?l.jsx("div",{className:"p-6 text-center text-gray-500",children:"Loading hook events..."}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-100",children:"Hook Events"}),l.jsxs("span",{className:"text-sm text-gray-500",children:[R.length," events"]})]}),l.jsxs("div",{className:"flex gap-3 flex-wrap",children:[l.jsx("select",{value:d,onChange:w=>x(w.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:Lv.map(w=>l.jsx("option",{value:w,children:w},w))}),l.jsx("input",{type:"text",placeholder:"Filter by session ID...",value:h,onChange:w=>N(w.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5 w-48"}),l.jsx("select",{value:p,onChange:w=>m(w.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:Hv.map(w=>l.jsx("option",{value:w.value,children:w.label},w.value))})]}),l.jsxs("div",{className:"space-y-1",children:[b.map((w,T)=>{const U=E.has(T),J=w.count===1||U?w.events:[w.events[0]];return l.jsxs("div",{children:[w.count>1&&l.jsxs("button",{onClick:()=>{M(V=>{const ae=new Set(V);return ae.has(T)?ae.delete(T):ae.add(T),ae})},className:"w-full text-left px-3 py-1 text-xs text-gray-500 hover:text-gray-300 bg-gray-900 rounded",children:[U?"▾":"▸"," ",w.count,"× ",w.type]}),J.map(V=>{const ae=V.result?.decision==="deny"||V.result?.decision==="block";return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>y(v===V.id?null:V.id),className:`w-full text-left flex items-center gap-3 px-3 py-2 rounded text-sm hover:bg-gray-800/50 ${ae?"bg-red-950/30 border border-red-900/40":""}`,children:[l.jsx("span",{className:"text-gray-500 text-xs font-mono w-16 shrink-0",children:Bv(V.timestamp)}),l.jsx(ie,{label:V.eventName,variant:ae?"error":"default"}),l.jsx("span",{className:"text-gray-400 text-xs truncate",children:V.sessionId.slice(0,12)}),V.durationMs!=null&&l.jsxs("span",{className:"text-gray-600 text-xs ml-auto",children:[V.durationMs,"ms"]})]}),v===V.id&&l.jsx("pre",{className:"mx-3 mb-2 p-3 bg-gray-900 rounded text-xs text-gray-400 overflow-x-auto max-h-64",children:JSON.stringify(V.payload,null,2)})]},V.id)})]},T)}),b.length===0&&l.jsx("div",{className:"text-center text-gray-600 py-8",children:"No hook events yet"})]})]})}function ux(r){return r<1e3?`${r}ms`:r<6e4?`${Math.floor(r/1e3)}s`:r<36e5?`${Math.floor(r/6e4)}m ${Math.floor(r%6e4/1e3)}s`:`${Math.floor(r/36e5)}h ${Math.floor(r%36e5/6e4)}m`}function qv(){const{data:r,loading:o}=Te("/api/hooks/agents"),[u,c]=j.useState([]),[d,x]=Ut("session",""),[,h]=j.useState(0);Ue("hook-agent",E=>{const M=E;M.agentId&&c(z=>{const R=z.findIndex(b=>b.agentId===M.agentId);if(R>=0){const b=[...z];return b[R]={...b[R],...M},b}return[M,...z]})});const N=j.useMemo(()=>{const E=r?.data??[],M=new Set(E.map(z=>z.agentId));return[...u.filter(z=>!M.has(z.agentId)),...E]},[r,u]),p=j.useMemo(()=>d?N.filter(E=>E.sessionId.includes(d)):N,[N,d]),m=j.useMemo(()=>{const E=new Set(N.map(M=>M.sessionId));return Array.from(E)},[N]),v=j.useMemo(()=>p.filter(E=>!E.stoppedAt).length,[p]);j.useEffect(()=>{if(v===0)return;const E=setInterval(()=>h(M=>M+1),1e3);return()=>clearInterval(E)},[v]);const y=j.useMemo(()=>{const E=p.filter(M=>M.durationMs!=null);return E.length===0?0:Math.round(E.reduce((M,z)=>M+(z.durationMs??0),0)/E.length)},[p]);return o&&!r?l.jsx("div",{className:"p-6 text-center text-gray-500",children:"Loading agents..."}):l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h1",{className:"text-xl font-semibold text-gray-100",children:"Agents"}),l.jsxs("div",{className:"flex gap-4 text-sm text-gray-400",children:[l.jsxs("span",{children:["Total: ",p.length]}),l.jsxs("span",{children:["Running: ",v]}),l.jsxs("span",{children:["Avg duration: ",ux(y)]})]})]}),l.jsx("div",{className:"flex gap-3",children:l.jsxs("select",{value:d,onChange:E=>x(E.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:[l.jsx("option",{value:"",children:"All sessions"}),m.map(E=>l.jsx("option",{value:E,children:E.slice(0,20)},E))]})}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-left text-gray-500 border-b border-gray-800",children:[l.jsx("th",{className:"py-2 px-3",children:"Agent ID"}),l.jsx("th",{className:"py-2 px-3",children:"Type"}),l.jsx("th",{className:"py-2 px-3",children:"Session"}),l.jsx("th",{className:"py-2 px-3",children:"Started"}),l.jsx("th",{className:"py-2 px-3",children:"Stopped"}),l.jsx("th",{className:"py-2 px-3",children:"Duration"}),l.jsx("th",{className:"py-2 px-3",children:"Status"})]})}),l.jsxs("tbody",{children:[p.map(E=>{const M=!E.stoppedAt,z=M?Date.now()-new Date(E.startedAt).getTime():E.durationMs??0;return l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30",children:[l.jsx("td",{className:"py-2 px-3 font-mono text-xs text-gray-300",children:E.agentId.slice(0,16)}),l.jsx("td",{className:"py-2 px-3 text-gray-300",children:E.agentType}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:E.sessionId.slice(0,12)}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:new Date(E.startedAt).toLocaleTimeString()}),l.jsx("td",{className:"py-2 px-3 text-gray-500 text-xs",children:E.stoppedAt?new Date(E.stoppedAt).toLocaleTimeString():"—"}),l.jsx("td",{className:"py-2 px-3 text-gray-400 text-xs",children:ux(z)}),l.jsx("td",{className:"py-2 px-3",children:l.jsx(ie,{label:M?"running":"stopped",variant:M?"success":"default"})})]},E.agentId)}),p.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:7,className:"py-8 text-center text-gray-600",children:"No agents tracked yet"})})]})]})})]})}function Jn({value:r,onSave:o,placeholder:u}){const[c,d]=j.useState(!1),[x,h]=j.useState(r),N=j.useRef(null);j.useEffect(()=>{c&&(N.current?.focus(),N.current?.select())},[c]);const p=()=>{x!==r&&o(x),d(!1)},m=()=>{h(r),d(!1)};return c?l.jsx("input",{ref:N,value:x,onChange:v=>h(v.target.value),onKeyDown:v=>{v.key==="Enter"&&p(),v.key==="Escape"&&m()},onBlur:p,className:"bg-gray-800 border border-indigo-500/50 text-gray-200 text-xs rounded px-2 py-1 w-full focus:outline-none focus:ring-1 focus:ring-indigo-500",placeholder:u}):l.jsx("span",{onClick:()=>{h(r),d(!0)},className:"text-xs text-gray-400 cursor-pointer hover:text-gray-200 hover:bg-gray-800/50 rounded px-1.5 py-0.5 transition-colors min-w-[60px] inline-block",title:"Click to edit",children:r||l.jsx("span",{className:"text-gray-600 italic",children:u||"Click to set"})})}function Ql(r,o){return r?o==="github"&&r.github?`${r.github.owner}/${r.github.repo}`:o==="jira"&&r.jira?r.jira.projectKey:o==="ado"&&r.ado?r.ado.project:"":""}function ou(r,o){if(r==="github"){const u=o.split("/");return u.length===2?{github:{owner:u[0],repo:u[1]}}:{github:{owner:"",repo:o}}}return r==="jira"?{jira:{projectKey:o}}:r==="ado"?{ado:{project:o}}:{}}function Yv({onClose:r,onSubmit:o}){const[u,c]=j.useState(""),[d,x]=j.useState(""),[h,N]=j.useState(""),[p,m]=j.useState(""),[v,y]=j.useState(""),E=j.useRef(null);j.useEffect(()=>{E.current?.focus()},[]);const M=z=>{if(z.preventDefault(),!u.trim()||!d.trim()||!h.trim()){y("ID, Path, and Prefix are required");return}o({id:u.trim(),path:d.trim(),prefix:h.trim(),name:p.trim()||void 0})};return l.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",onClick:r,children:l.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-6 w-full max-w-md shadow-2xl",onClick:z=>z.stopPropagation(),children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-200 mb-4",children:"Add Repository"}),l.jsxs("form",{onSubmit:M,className:"space-y-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"ID *"}),l.jsx("input",{ref:E,value:u,onChange:z=>c(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., frontend-app"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Path *"}),l.jsx("input",{value:d,onChange:z=>x(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., repositories/acme/frontend-app"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Prefix *"}),l.jsx("input",{value:h,onChange:z=>N(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., FE"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Display Name"}),l.jsx("input",{value:p,onChange:z=>m(z.target.value),className:"w-full bg-gray-800 border border-gray-700 text-gray-200 text-xs rounded-lg px-3 py-2 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500",placeholder:"e.g., Frontend App"})]}),v&&l.jsx("p",{className:"text-xs text-rose-400",children:v}),l.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[l.jsx("button",{type:"button",onClick:r,className:"text-xs text-gray-400 hover:text-gray-200 px-3 py-1.5 border border-gray-700 rounded-lg transition-colors",children:"Cancel"}),l.jsx("button",{type:"submit",className:"text-xs text-white bg-indigo-600 hover:bg-indigo-500 px-4 py-1.5 rounded-lg transition-colors",children:"Add Repo"})]})]})]})})}function Gv(){const{data:r,loading:o,error:u,refetch:c}=Te("/api/workspace"),{activeProject:d}=rl(),[x,h]=j.useState(!1),[N,p]=j.useState(null),m=d?.id?`?project=${d.id}`:"",v=j.useCallback(async(w,T)=>{try{p(null);const U=await fetch(`/api/workspace/repos/${encodeURIComponent(w)}${m}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!U.ok){const J=await U.json();p(J.error||`Failed to update ${w}`);return}c()}catch(U){p(U.message)}},[m,c]),y=j.useCallback(async w=>{try{p(null);const T=await fetch(`/api/workspace/repos${m}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(!T.ok){const U=await T.json();p(U.error||"Failed to add repo");return}h(!1),c()}catch(T){p(T.message)}},[m,c]),E=j.useCallback(async w=>{if(confirm(`Remove "${w}" from workspace?`))try{p(null);const T=await fetch(`/api/workspace/repos/${encodeURIComponent(w)}${m}`,{method:"DELETE"});if(!T.ok&&T.status!==204){const U=await T.json();p(U.error||`Failed to remove ${w}`);return}c()}catch(T){p(T.message)}},[m,c]);if(o)return l.jsx(Ie,{});if(u)return l.jsx(Gt,{message:u,onRetry:c});const M=r||{name:"",rootRepo:null,repos:[]},z=M.repos.filter(w=>w.sync?.github).length,R=M.repos.filter(w=>w.sync?.jira).length,b=M.repos.filter(w=>w.sync?.ado).length;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200",children:"Workspace"}),M.name&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:M.name})]}),l.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-1.5 text-xs text-white bg-indigo-600 hover:bg-indigo-500 px-3 py-1.5 rounded-lg transition-colors",children:[l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"Add Repo"]})]}),N&&l.jsx("div",{className:"bg-rose-900/30 border border-rose-700 rounded-lg px-4 py-2",children:l.jsx("p",{className:"text-xs text-rose-400",children:N})}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(ne,{title:"Repositories",value:M.repos.length,color:"indigo"}),l.jsx(ne,{title:"GitHub Mapped",value:z,color:"cyan"}),l.jsx(ne,{title:"Jira Mapped",value:R,color:"amber"}),l.jsx(ne,{title:"ADO Mapped",value:b,color:"emerald"})]}),M.rootRepo&&l.jsxs("div",{className:"bg-gray-900/50 border border-indigo-500/20 rounded-xl p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx(ie,{label:"Root",variant:"info"}),l.jsx("span",{className:"text-sm font-medium text-gray-300",children:"Umbrella Repository"})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-3",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"GitHub"}),l.jsx("span",{className:"text-xs text-gray-400",children:Ql(M.rootRepo,"github")||"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"Jira"}),l.jsx("span",{className:"text-xs text-gray-400",children:Ql(M.rootRepo,"jira")||"-"})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider block mb-1",children:"ADO"}),l.jsx("span",{className:"text-xs text-gray-400",children:Ql(M.rootRepo,"ado")||"-"})]})]})]}),M.repos.length===0?l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-8 text-center",children:[l.jsx("p",{className:"text-gray-500 text-sm",children:"No repositories in workspace"}),l.jsx("p",{className:"text-gray-600 text-xs mt-1",children:'Click "Add Repo" to register your first repository'})]}):l.jsx("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-gray-800",children:[l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"ID"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Name"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Prefix"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"GitHub"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Jira"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"ADO"}),l.jsx("th",{className:"text-left text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3",children:"Role"}),l.jsx("th",{className:"text-right text-[10px] text-gray-500 uppercase tracking-wider px-4 py-3 w-10"})]})}),l.jsx("tbody",{children:M.repos.map(w=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 transition-colors",children:[l.jsx("td",{className:"px-4 py-3",children:l.jsx("span",{className:"text-xs font-mono text-gray-300",children:w.id})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:w.name||"",onSave:T=>v(w.id,{name:T}),placeholder:"Set name"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(ie,{label:w.prefix,variant:"default"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:Ql(w.sync,"github"),onSave:T=>v(w.id,{sync:{...w.sync,...ou("github",T)}}),placeholder:"owner/repo"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:Ql(w.sync,"jira"),onSave:T=>v(w.id,{sync:{...w.sync,...ou("jira",T)}}),placeholder:"PROJECT"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:Ql(w.sync,"ado"),onSave:T=>v(w.id,{sync:{...w.sync,...ou("ado",T)}}),placeholder:"project"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jn,{value:w.role||"",onSave:T=>v(w.id,{role:T}),placeholder:"Set role"})}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsx("button",{onClick:()=>E(w.id),className:"text-gray-600 hover:text-rose-400 transition-colors p-1",title:"Remove from workspace",children:l.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})})]},w.id))})]})})}),x&&l.jsx(Yv,{onClose:()=>h(!1),onSubmit:y})]})}function Vv(){const r=ay(),o=Yt();return l.jsx(zx.Provider,{value:r,children:l.jsx(ny,{children:l.jsxs("div",{className:"flex min-h-screen bg-gray-950 text-gray-100",children:[l.jsx(cy,{}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[l.jsx(uy,{}),l.jsx("main",{className:"flex-1 overflow-y-auto",children:l.jsx(dy,{resetKey:o.pathname,children:l.jsxs(Np,{children:[l.jsx(We,{path:"/",element:l.jsx(jy,{})}),l.jsx(We,{path:"/increments",element:l.jsx(Cy,{})}),l.jsx(We,{path:"/increments/:id",element:l.jsx(Ov,{})}),l.jsx(We,{path:"/analytics",element:l.jsx(Ay,{})}),l.jsx(We,{path:"/costs",element:l.jsx(ky,{})}),l.jsx(We,{path:"/sync",element:l.jsx(Qy,{})}),l.jsx(We,{path:"/errors",element:l.jsx(Fy,{})}),l.jsx(We,{path:"/activity",element:l.jsx(sv,{})}),l.jsx(We,{path:"/config",element:l.jsx(cv,{})}),l.jsx(We,{path:"/plugins",element:l.jsx(dv,{})}),l.jsx(We,{path:"/services",element:l.jsx(xv,{})}),l.jsx(We,{path:"/notifications",element:l.jsx(hv,{})}),l.jsx(We,{path:"/repos",element:l.jsx(yv,{})}),l.jsx(We,{path:"/marketplace",element:l.jsx(_v,{})}),l.jsx(We,{path:"/hooks",element:l.jsx($v,{})}),l.jsx(We,{path:"/agents",element:l.jsx(qv,{})}),l.jsx(We,{path:"/workspace",element:l.jsx(Gv,{})}),l.jsx(We,{path:"*",element:l.jsxs("div",{className:"p-6 text-center",children:[l.jsx("h2",{className:"text-lg font-semibold text-gray-200 mb-2",children:"Page Not Found"}),l.jsx("p",{className:"text-sm text-gray-500",children:"The page you're looking for doesn't exist."})]})})]})})})]})]})})})}Ng.createRoot(document.getElementById("root")).render(l.jsx(j.StrictMode,{children:l.jsx(Zp,{children:l.jsx(Vv,{})})}));
|