specweave 3.1.15 → 3.1.17
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/README.md +2 -2
- package/bin/help.js +18 -36
- package/bin/specweave.js +20 -19
- package/dist/dashboard/assets/index-Xf8t0BTq.js +16 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/src/adapters/generic/adapter.d.ts.map +1 -1
- package/dist/src/adapters/generic/adapter.js +4 -44
- package/dist/src/adapters/generic/adapter.js.map +1 -1
- package/dist/src/cli/commands/ac.d.ts +9 -0
- package/dist/src/cli/commands/ac.d.ts.map +1 -1
- package/dist/src/cli/commands/ac.js +20 -0
- package/dist/src/cli/commands/ac.js.map +1 -1
- package/dist/src/cli/commands/complete.d.ts +6 -0
- package/dist/src/cli/commands/complete.d.ts.map +1 -1
- package/dist/src/cli/commands/complete.js +18 -0
- package/dist/src/cli/commands/complete.js.map +1 -1
- package/dist/src/cli/commands/task.d.ts +19 -1
- package/dist/src/cli/commands/task.d.ts.map +1 -1
- package/dist/src/cli/commands/task.js +62 -5
- package/dist/src/cli/commands/task.js.map +1 -1
- package/dist/src/cli/helpers/init/gitignore-generator.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/gitignore-generator.js +32 -7
- package/dist/src/cli/helpers/init/gitignore-generator.js.map +1 -1
- package/dist/src/cli/helpers/init/next-steps.d.ts +3 -2
- package/dist/src/cli/helpers/init/next-steps.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/next-steps.js +18 -31
- package/dist/src/cli/helpers/init/next-steps.js.map +1 -1
- package/dist/src/cli/helpers/init/summary-banner.js +1 -1
- package/dist/src/cli/helpers/init/summary-banner.js.map +1 -1
- package/dist/src/core/increment/template-creator.js +1 -1
- package/dist/src/core/increment/template-creator.js.map +1 -1
- package/dist/src/core/session/handoff-all.d.ts +2 -0
- package/dist/src/core/session/handoff-all.d.ts.map +1 -1
- package/dist/src/core/session/handoff-all.js +12 -6
- package/dist/src/core/session/handoff-all.js.map +1 -1
- package/dist/src/core/session/handoff-doc-format.d.ts +2 -0
- package/dist/src/core/session/handoff-doc-format.d.ts.map +1 -1
- package/dist/src/core/session/handoff-doc-format.js +3 -1
- package/dist/src/core/session/handoff-doc-format.js.map +1 -1
- package/dist/src/core/session/handoff-report.d.ts.map +1 -1
- package/dist/src/core/session/handoff-report.js +8 -4
- package/dist/src/core/session/handoff-report.js.map +1 -1
- package/dist/src/core/session/pickup.d.ts.map +1 -1
- package/dist/src/core/session/pickup.js +5 -2
- package/dist/src/core/session/pickup.js.map +1 -1
- package/dist/src/core/session/work-handoff.d.ts.map +1 -1
- package/dist/src/core/session/work-handoff.js +2 -0
- package/dist/src/core/session/work-handoff.js.map +1 -1
- package/dist/src/core/tasks/accepted-skip.d.ts +15 -3
- package/dist/src/core/tasks/accepted-skip.d.ts.map +1 -1
- package/dist/src/core/tasks/accepted-skip.js +15 -6
- package/dist/src/core/tasks/accepted-skip.js.map +1 -1
- package/dist/src/core/tasks/closure-gate.d.ts.map +1 -1
- package/dist/src/core/tasks/closure-gate.js +3 -0
- package/dist/src/core/tasks/closure-gate.js.map +1 -1
- package/dist/src/core/tasks/task-board.d.ts +5 -2
- package/dist/src/core/tasks/task-board.d.ts.map +1 -1
- package/dist/src/core/tasks/task-board.js +6 -2
- package/dist/src/core/tasks/task-board.js.map +1 -1
- package/dist/src/core/tasks/verify-runner.d.ts +3 -0
- package/dist/src/core/tasks/verify-runner.d.ts.map +1 -1
- package/dist/src/core/tasks/verify-runner.js +6 -1
- package/dist/src/core/tasks/verify-runner.js.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/skills/do/SKILL.md +6 -4
- package/plugins/specweave/skills/done/SKILL.md +5 -1
- package/src/templates/.gitignore.template +1 -4
- package/src/templates/AGENTS.md.template +3 -5
- package/src/templates/CLAUDE.md.template +0 -1
- package/src/templates/README.md.template +1 -1
- package/dist/dashboard/assets/index-DjwOIk2X.js +0 -16
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))c(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const x of m.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&c(x)}).observe(document,{childList:!0,subtree:!0});function o(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(f){if(f.ep)return;f.ep=!0;const m=o(f);fetch(f.href,m)}})();var bu={exports:{}},ks={};var Ex;function Vy(){if(Ex)return ks;Ex=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function o(c,f,m){var x=null;if(m!==void 0&&(x=""+m),f.key!==void 0&&(x=""+f.key),"key"in f){m={};for(var b in f)b!=="key"&&(m[b]=f[b])}else m=f;return f=m.ref,{$$typeof:i,type:c,key:x,ref:f!==void 0?f:null,props:m}}return ks.Fragment=u,ks.jsx=o,ks.jsxs=o,ks}var Tx;function Gy(){return Tx||(Tx=1,bu.exports=Vy()),bu.exports}var l=Gy(),Nu={exports:{}},ge={};var Cx;function Qy(){if(Cx)return ge;Cx=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),x=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),O=Symbol.iterator;function _(C){return C===null||typeof C!="object"?null:(C=O&&C[O]||C["@@iterator"],typeof C=="function"?C:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,S={};function T(C,G,ce){this.props=C,this.context=G,this.refs=S,this.updater=ce||R}T.prototype.isReactComponent={},T.prototype.setState=function(C,G){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,G,"setState")},T.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function U(){}U.prototype=T.prototype;function ee(C,G,ce){this.props=C,this.context=G,this.refs=S,this.updater=ce||R}var Q=ee.prototype=new U;Q.constructor=ee,j(Q,T.prototype),Q.isPureReactComponent=!0;var ne=Array.isArray;function K(){}var X={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function F(C,G,ce){var W=ce.ref;return{$$typeof:i,type:C,key:G,ref:W!==void 0?W:null,props:ce}}function ae(C,G){return F(C.type,G,C.props)}function Se(C){return typeof C=="object"&&C!==null&&C.$$typeof===i}function Te(C){var G={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ce){return G[ce]})}var ze=/\/+/g;function se(C,G){return typeof C=="object"&&C!==null&&C.key!=null?Te(""+C.key):G.toString(36)}function Z(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(K,K):(C.status="pending",C.then(function(G){C.status==="pending"&&(C.status="fulfilled",C.value=G)},function(G){C.status==="pending"&&(C.status="rejected",C.reason=G)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function le(C,G,ce,W,je){var Re=typeof C;(Re==="undefined"||Re==="boolean")&&(C=null);var Oe=!1;if(C===null)Oe=!0;else switch(Re){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(C.$$typeof){case i:case u:Oe=!0;break;case p:return Oe=C._init,le(Oe(C._payload),G,ce,W,je)}}if(Oe)return je=je(C),Oe=W===""?"."+se(C,0):W,ne(je)?(ce="",Oe!=null&&(ce=Oe.replace(ze,"$&/")+"/"),le(je,G,ce,"",function(ba){return ba})):je!=null&&(Se(je)&&(je=ae(je,ce+(je.key==null||C&&C.key===je.key?"":(""+je.key).replace(ze,"$&/")+"/")+Oe)),G.push(je)),1;Oe=0;var oe=W===""?".":W+":";if(ne(C))for(var he=0;he<C.length;he++)W=C[he],Re=oe+se(W,he),Oe+=le(W,G,ce,Re,je);else if(he=_(C),typeof he=="function")for(C=he.call(C),he=0;!(W=C.next()).done;)W=W.value,Re=oe+se(W,he++),Oe+=le(W,G,ce,Re,je);else if(Re==="object"){if(typeof C.then=="function")return le(Z(C),G,ce,W,je);throw G=String(C),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function I(C,G,ce){if(C==null)return C;var W=[],je=0;return le(C,W,"","",function(Re){return G.call(ce,Re,je++)}),W}function J(C){if(C._status===-1){var G=C._result,ce=G();ce.then(function(W){(C._status===0||C._status===-1)&&(C._status=1,C._result=W,ce.status===void 0&&(ce.status="fulfilled",ce.value=W))},function(W){(C._status===0||C._status===-1)&&(C._status=2,C._result=W,ce.status===void 0&&(ce.status="rejected",ce.reason=W))}),C._status===-1&&(C._status=0,C._result=ce)}if(C._status===1)return C._result.default;throw C._result}var fe=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)};function B(C){var G=X.T,ce={};ce.types=G!==null?G.types:null,X.T=ce;try{var W=C(),je=X.S;je!==null&&je(ce,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(K,fe)}catch(Re){fe(Re)}finally{G!==null&&ce.types!==null&&(G.types=ce.types),X.T=G}}function V(C){var G=X.T;if(G!==null){var ce=G.types;ce===null?G.types=[C]:ce.indexOf(C)===-1&&ce.push(C)}else B(V.bind(null,C))}var P={map:I,forEach:function(C,G,ce){I(C,function(){G.apply(this,arguments)},ce)},count:function(C){var G=0;return I(C,function(){G++}),G},toArray:function(C){return I(C,function(G){return G})||[]},only:function(C){if(!Se(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return ge.Activity=h,ge.Children=P,ge.Component=T,ge.Fragment=o,ge.Profiler=f,ge.PureComponent=ee,ge.StrictMode=c,ge.Suspense=v,ge.ViewTransition=w,ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,ge.__COMPILER_RUNTIME={__proto__:null,c:function(C){return X.H.useMemoCache(C)}},ge.addTransitionType=V,ge.cache=function(C){return function(){return C.apply(null,arguments)}},ge.cacheSignal=function(){return null},ge.cloneElement=function(C,G,ce){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var W=j({},C.props),je=C.key;if(G!=null)for(Re in G.key!==void 0&&(je=""+G.key),G)!k.call(G,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&G.ref===void 0||(W[Re]=G[Re]);var Re=arguments.length-2;if(Re===1)W.children=ce;else if(1<Re){for(var Oe=Array(Re),oe=0;oe<Re;oe++)Oe[oe]=arguments[oe+2];W.children=Oe}return F(C.type,je,W)},ge.createContext=function(C){return C={$$typeof:x,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:m,_context:C},C},ge.createElement=function(C,G,ce){var W,je={},Re=null;if(G!=null)for(W in G.key!==void 0&&(Re=""+G.key),G)k.call(G,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(je[W]=G[W]);var Oe=arguments.length-2;if(Oe===1)je.children=ce;else if(1<Oe){for(var oe=Array(Oe),he=0;he<Oe;he++)oe[he]=arguments[he+2];je.children=oe}if(C&&C.defaultProps)for(W in Oe=C.defaultProps,Oe)je[W]===void 0&&(je[W]=Oe[W]);return F(C,Re,je)},ge.createRef=function(){return{current:null}},ge.forwardRef=function(C){return{$$typeof:b,render:C}},ge.isValidElement=Se,ge.lazy=function(C){return{$$typeof:p,_payload:{_status:-1,_result:C},_init:J}},ge.memo=function(C,G){return{$$typeof:y,type:C,compare:G===void 0?null:G}},ge.startTransition=B,ge.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},ge.use=function(C){return X.H.use(C)},ge.useActionState=function(C,G,ce){return X.H.useActionState(C,G,ce)},ge.useCallback=function(C,G){return X.H.useCallback(C,G)},ge.useContext=function(C){return X.H.useContext(C)},ge.useDebugValue=function(){},ge.useDeferredValue=function(C,G){return X.H.useDeferredValue(C,G)},ge.useEffect=function(C,G){return X.H.useEffect(C,G)},ge.useEffectEvent=function(C){return X.H.useEffectEvent(C)},ge.useId=function(){return X.H.useId()},ge.useImperativeHandle=function(C,G,ce){return X.H.useImperativeHandle(C,G,ce)},ge.useInsertionEffect=function(C,G){return X.H.useInsertionEffect(C,G)},ge.useLayoutEffect=function(C,G){return X.H.useLayoutEffect(C,G)},ge.useMemo=function(C,G){return X.H.useMemo(C,G)},ge.useOptimistic=function(C,G){return X.H.useOptimistic(C,G)},ge.useReducer=function(C,G,ce){return X.H.useReducer(C,G,ce)},ge.useRef=function(C){return X.H.useRef(C)},ge.useState=function(C){return X.H.useState(C)},ge.useSyncExternalStore=function(C,G,ce){return X.H.useSyncExternalStore(C,G,ce)},ge.useTransition=function(){return X.H.useTransition()},ge.version="19.3.1",ge}var Rx;function qu(){return Rx||(Rx=1,Nu.exports=Qy()),Nu.exports}var N=qu(),Su={exports:{}},Us={},wu={exports:{}},Eu={};var Ax;function Xy(){return Ax||(Ax=1,(function(i){function u(Z,le){var I=Z.length;Z.push(le);e:for(;0<I;){var J=I-1>>>1,fe=Z[J];if(0<f(fe,le))Z[J]=le,Z[I]=fe,I=J;else break e}}function o(Z){return Z.length===0?null:Z[0]}function c(Z){if(Z.length===0)return null;var le=Z[0],I=Z.pop();if(I!==le){Z[0]=I;e:for(var J=0,fe=Z.length,B=fe>>>1;J<B;){var V=2*(J+1)-1,P=Z[V],C=V+1,G=Z[C];if(0>f(P,I))C<fe&&0>f(G,P)?(Z[J]=G,Z[C]=I,J=C):(Z[J]=P,Z[V]=I,J=V);else if(C<fe&&0>f(G,I))Z[J]=G,Z[C]=I,J=C;else break e}}return le}function f(Z,le){var I=Z.sortIndex-le.sortIndex;return I!==0?I:Z.id-le.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var x=Date,b=x.now();i.unstable_now=function(){return x.now()-b}}var v=[],y=[],p=1,h=null,w=3,O=!1,_=!1,R=!1,j=!1,S=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,U=typeof setImmediate<"u"?setImmediate:null;function ee(Z){for(var le=o(y);le!==null;){if(le.callback===null)c(y);else if(le.startTime<=Z)c(y),le.sortIndex=le.expirationTime,u(v,le);else break;le=o(y)}}function Q(Z){if(R=!1,ee(Z),!_)if(o(v)!==null)_=!0,ne||(ne=!0,Se());else{var le=o(y);le!==null&&se(Q,le.startTime-Z)}}var ne=!1,K=-1,X=5,k=-1;function F(){return j?!0:!(i.unstable_now()-k<X)}function ae(){if(j=!1,ne){var Z=i.unstable_now();k=Z;var le=!0;try{e:{_=!1,R&&(R=!1,T(K),K=-1),O=!0;var I=w;try{t:{for(ee(Z),h=o(v);h!==null&&!(h.expirationTime>Z&&F());){var J=h.callback;if(typeof J=="function"){h.callback=null,w=h.priorityLevel;var fe=J(h.expirationTime<=Z);if(Z=i.unstable_now(),typeof fe=="function"){h.callback=fe,ee(Z),le=!0;break t}h===o(v)&&c(v),ee(Z)}else c(v);h=o(v)}if(h!==null)le=!0;else{var B=o(y);B!==null&&se(Q,B.startTime-Z),le=!1}}break e}finally{h=null,w=I,O=!1}le=void 0}}finally{le?Se():ne=!1}}}var Se;if(typeof U=="function")Se=function(){U(ae)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,ze=Te.port2;Te.port1.onmessage=ae,Se=function(){ze.postMessage(null)}}else Se=function(){S(ae,0)};function se(Z,le){K=S(function(){Z(i.unstable_now())},le)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(Z){Z.callback=null},i.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<Z?Math.floor(1e3/Z):5},i.unstable_getCurrentPriorityLevel=function(){return w},i.unstable_next=function(Z){switch(w){case 1:case 2:case 3:var le=3;break;default:le=w}var I=w;w=le;try{return Z()}finally{w=I}},i.unstable_requestPaint=function(){j=!0},i.unstable_runWithPriority=function(Z,le){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var I=w;w=Z;try{return le()}finally{w=I}},i.unstable_scheduleCallback=function(Z,le,I){var J=i.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?J+I:J):I=J,Z){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=I+fe,Z={id:p++,callback:le,priorityLevel:Z,startTime:I,expirationTime:fe,sortIndex:-1},I>J?(Z.sortIndex=I,u(y,Z),o(v)===null&&Z===o(y)&&(R?(T(K),K=-1):R=!0,se(Q,I-J))):(Z.sortIndex=fe,u(v,Z),_||O||(_=!0,ne||(ne=!0,Se()))),Z},i.unstable_shouldYield=F,i.unstable_wrapCallback=function(Z){var le=w;return function(){var I=w;w=le;try{return Z.apply(this,arguments)}finally{w=I}}}})(Eu)),Eu}var Ox;function Zy(){return Ox||(Ox=1,wu.exports=Xy()),wu.exports}var Tu={exports:{}},gt={};var Mx;function Ky(){if(Mx)return gt;Mx=1;var i=qu();function u(p){var h="https://react.dev/errors/"+p;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var w=2;w<arguments.length;w++)h+="&args[]="+encodeURIComponent(arguments[w])}return"Minified React error #"+p+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var c={d:{f:o,r:function(){throw Error(u(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},f=Symbol.for("react.portal"),m=Symbol.for("react.recoverable"),x=Symbol.for("react.optimistic_key");function b(p,h,w){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:O==null?null:O===x?x:""+O,children:p,containerInfo:h,implementation:w}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(p,h){if(p==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return gt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,gt.browser=function(p){return{$$typeof:m,_reason:p}},gt.createPortal=function(p,h){var w=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(u(299));return b(p,h,null,w)},gt.flushSync=function(p){var h=v.T,w=c.p;try{if(v.T=null,c.p=2,p)return p()}finally{v.T=h,c.p=w,c.d.f()}},gt.preconnect=function(p,h){typeof p=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,c.d.C(p,h))},gt.prefetchDNS=function(p){typeof p=="string"&&c.d.D(p)},gt.preinit=function(p,h){if(typeof p=="string"&&h&&typeof h.as=="string"){var w=h.as,O=y(w,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,R=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;w==="style"?c.d.S(p,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:O,integrity:_,fetchPriority:R}):w==="script"&&c.d.X(p,{crossOrigin:O,integrity:_,fetchPriority:R,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},gt.preinitModule=function(p,h){if(typeof p=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var w=y(h.as,h.crossOrigin);c.d.M(p,{crossOrigin:w,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0})}}else h==null&&c.d.M(p)},gt.preload=function(p,h){if(typeof p=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var w=h.as,O=y(w,h.crossOrigin);c.d.L(p,w,{crossOrigin:O,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},gt.preloadModule=function(p,h){if(typeof p=="string")if(h){var w=y(h.as,h.crossOrigin);c.d.m(p,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:w,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0})}else c.d.m(p)},gt.requestFormReset=function(p){c.d.r(p)},gt.unstable_batchedUpdates=function(p,h){return p(h)},gt.useFormState=function(p,h,w){return v.H.useFormState(p,h,w)},gt.useFormStatus=function(){return v.H.useHostTransitionStatus()},gt.version="19.3.1",gt}var _x;function Jy(){if(_x)return Tu.exports;_x=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),Tu.exports=Ky(),Tu.exports}var Dx;function Iy(){if(Dx)return Us;Dx=1;var i=Zy(),u=qu(),o=Jy();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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){for(var t=e,a=t;a&&!a.alternate;)t=a,(t.flags&4098)!==0&&(e=t.return),a=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function x(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 b(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 v(e){if(m(e)!==e)throw Error(c(188))}function y(e){var t=e.alternate;if(!t){if(t=m(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 r=s.alternate;if(r===null){if(n=s.return,n!==null){a=n;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===a)return v(s),e;if(r===n)return v(s),t;r=r.sibling}throw Error(c(188))}if(a.return!==n.return)a=s,n=r;else{for(var d=!1,g=s.child;g;){if(g===a){d=!0,a=s,n=r;break}if(g===n){d=!0,n=s,a=r;break}g=g.sibling}if(!d){for(g=r.child;g;){if(g===a){d=!0,a=r,n=s;break}if(g===n){d=!0,n=r,a=s;break}g=g.sibling}if(!d)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 p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,a,n,s,r){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&a(e,n,s,r)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,a,n,s,r))return!0;e=e.sibling}return!1}function w(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function O(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function _(e){var t=[null,null],a=w(e);return a===null||R(t,e,a.child,{foundSelf:!1}),t}function R(e,t,a,n){for(;a!==null;){if(a===t)n.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(n.foundSelf)return e[1]=a,!0;e[0]=a}else if((a.tag!==22||a.memoizedState===null)&&R(e,t,a.child,n))return!0;a=a.sibling}return!1}function j(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(c(559))}}var S=null,T=null;function U(e,t,a){return e===a?!0:e===t?(S=e,!0):!1}function ee(e,t,a){return e===a?(T=e,!1):e===t?(T!==null&&(S=e),!0):!1}function Q(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ne(e,t,a){for(var n=0,s=e;s;s=a(s))n++;s=0;for(var r=t;r;r=a(r))s++;for(;0<n-s;)e=a(e),n--;for(;0<s-n;)t=a(t),s--;for(;n--;){if(e===t||t!==null&&e===t.alternate)return e;e=a(e),t=a(t)}return null}var K=Object.assign,X=Symbol.for("react.element"),k=Symbol.for("react.transitional.element"),F=Symbol.for("react.portal"),ae=Symbol.for("react.fragment"),Se=Symbol.for("react.strict_mode"),Te=Symbol.for("react.profiler"),ze=Symbol.for("react.consumer"),se=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),V=Symbol.for("react.legacy_hidden"),P=Symbol.for("react.memo_cache_sentinel"),C=Symbol.for("react.view_transition"),G=Symbol.for("react.recoverable"),ce=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=ce&&e[ce]||e["@@iterator"],typeof e=="function"?e:null)}var je=Symbol.for("react.client.reference");function Re(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===je?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ae:return"Fragment";case Te:return"Profiler";case Se:return"StrictMode";case le:return"Suspense";case I:return"SuspenseList";case B:return"Activity";case C:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case F:return"Portal";case se:return e.displayName||"Context";case ze:return(e._context.displayName||"Context")+".Consumer";case Z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:Re(e.type)||"Memo";case fe:t=e._payload,e=e._init;try{return Re(e(t))}catch{}}return null}var Oe=Array.isArray,oe=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ba={pending:!1,data:null,method:null,action:null},Bi=[],ql=-1;function ra(e){return{current:e}}function ot(e){0>ql||(e.current=Bi[ql],Bi[ql]=null,ql--)}function qe(e,t){ql++,Bi[ql]=e.current,e.current=t}var ia=ra(null),Yn=ra(null),$a=ra(null),Js=ra(null);function Is(e,t){switch(qe($a,t),qe(Yn,e),qe(ia,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?zm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=zm(t),e=Lm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ot(ia),qe(ia,e)}function Yl(){ot(ia),ot(Yn),ot($a)}function $i(e){var t=e.memoizedState;t!==null&&(On._currentValue=t.memoizedState,qe(Js,e)),t=ia.current;var a=Lm(t,e.type);t!==a&&(qe(Yn,e),qe(ia,a))}function Fs(e){Yn.current===e&&(ot(ia),ot(Yn)),Js.current===e&&(ot(Js),On._currentValue=ba)}var qi,ed;function qa(e){if(qi===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);qi=t&&t[1]||"",ed=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+qi+e+ed}var Yi=!1;function Vi(e,t){if(!e||Yi)return"";Yi=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(te){var M=te}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(te){M=te}Y=!1;try{var H=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Y=!0,new e}finally{Y&&(H!==void 0?Object.defineProperty(e.prototype,"props",H):delete e.prototype.props)}}}else{try{throw Error()}catch(te){M=te}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(te){if(te&&M&&typeof te.stack=="string")return[te.stack,M.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=n.DetermineComponentFrameRoot(),d=r[0],g=r[1];if(d&&g){var E=d.split(`
|
|
4
|
-
`),z=g.split(`
|
|
5
|
-
`);for(s=n=0;n<E.length&&!E[n].includes("DetermineComponentFrameRoot");)n++;for(;s<z.length&&!z[s].includes("DetermineComponentFrameRoot");)s++;if(n===E.length||s===z.length)for(n=E.length-1,s=z.length-1;1<=n&&0<=s&&E[n]!==z[s];)s--;for(;1<=n&&0<=s;n--,s--)if(E[n]!==z[s]){if(n!==1||s!==1)do if(n--,s--,0>s||E[n]!==z[s]){var $=`
|
|
6
|
-
`+E[n].replace(" at new "," at ");return e.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",e.displayName)),$}while(1<=n&&0<=s);break}}}finally{Yi=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?qa(a):""}function Zh(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 Vi(e.type,!1);case 11:return Vi(e.type.render,!1);case 1:return Vi(e.type,!0);case 31:return qa("Activity");case 30:return qa("ViewTransition");default:return""}}function td(e){try{var t="",a=null;do t+=Zh(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
7
|
-
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}}var Gi=Object.prototype.hasOwnProperty,Qi=i.unstable_scheduleCallback,Xi=i.unstable_cancelCallback,Kh=i.unstable_shouldYield,Jh=i.unstable_requestPaint,At=i.unstable_now,Ih=i.unstable_getCurrentPriorityLevel,ad=i.unstable_ImmediatePriority,ld=i.unstable_UserBlockingPriority,Ps=i.unstable_NormalPriority,Fh=i.unstable_LowPriority,nd=i.unstable_IdlePriority,Ph=i.log,Wh=i.unstable_setDisableYieldValue,Vn=null,Ot=null;function Ya(e){if(typeof Ph=="function"&&Wh(e),Ot&&typeof Ot.setStrictMode=="function")try{Ot.setStrictMode(Vn,e)}catch{}}var Mt=Math.clz32?Math.clz32:ag,eg=Math.log,tg=Math.LN2;function ag(e){return e>>>=0,e===0?32:31-(eg(e)/tg|0)|0}var Ws=256,er=262144,tr=4194304;function gl(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&-e;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 ar(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=n&134217727;return g!==0?(n=g&~r,n!==0?s=gl(n):(d&=g,d!==0?s=gl(d):a||(a=g&~e,a!==0&&(s=gl(a))))):(g=n&~r,g!==0?s=gl(g):d!==0?s=gl(d):a||(a=n&~e,a!==0&&(s=gl(a)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,a=t&-t,r>=a||r===32&&(a&4194048)!==0)?t:s}function Gn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sd(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var n=31-Mt(a),s=1<<n;t|=e[n],a&=~s}return t}function lg(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 rd(){var e=tr;return tr<<=1,(tr&62914560)===0&&(tr=4194304),e}function Zi(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Qn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ng(e,t,a,n,s,r){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var g=e.entanglements,E=e.expirationTimes,z=e.hiddenUpdates;for(a=d&~a;0<a;){var $=31-Mt(a),Y=1<<$;g[$]=0,E[$]=-1;var M=z[$];if(M!==null)for(z[$]=null,$=0;$<M.length;$++){var H=M[$];H!==null&&(H.lane&=-536870913)}a&=~Y}n!==0&&id(e,n,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(d&~t))}function id(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Mt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function cd(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Mt(a),s=1<<n;s&t|e[n]&t&&(e[n]|=t),a&=~s}}function od(e,t){var a=t&-t;return a=(a&42)!==0?1:Ki(a),(a&(e.suspendedLanes|t))!==0?0:a}function Ki(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 Ji(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ud(){var e=he.p;return e!==0?e:(e=window.event,e===void 0?32:yx(e.type))}function dd(e,t){var a=he.p;try{return he.p=e,t()}finally{he.p=a}}var Na=Math.random().toString(36).slice(2),ut="__reactFiber$"+Na,St="__reactProps$"+Na,Vl="__reactContainer$"+Na,fd="__reactEvents$"+Na,sg="__reactListeners$"+Na,rg="__reactHandles$"+Na,md="__reactResources$"+Na,Xn="__reactMarker$"+Na,lr="__reactLoad$"+Na;function nr(e){delete e[ut],delete e[St],delete e[sg],delete e[rg]}function pl(e){var t;if(t=e[ut])return t;for(var a=e.parentNode;a;){if(t=a[Vl]||a[ut]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Pm(e);e!==null;){if(a=e[ut])return a;e=Pm(e)}return t}e=a,a=e.parentNode}return null}function Gl(e){if(e=e[ut]||e[Vl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Zn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Ql(e){var t=e[md];return t||(t=e[md]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function nt(e){e[Xn]=!0}function xd(e){e[lr]=void 0}var hd=new Set,gd={};function yl(e,t){Xl(e,t),Xl(e+"Capture",t)}function Xl(e,t){for(gd[e]=t,e=0;e<t.length;e++)hd.add(t[e])}var ig=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]*$"),pd={},yd={};function cg(e){return Gi.call(yd,e)?!0:Gi.call(pd,e)?!1:ig.test(e)?yd[e]=!0:(pd[e]=!0,!1)}var Ae=!1;function vd(){var e=Ae;return Ae=!1,e}function sr(e,t,a){if(cg(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 rr(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 Sa(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 _t(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function og(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,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){a=""+d,r.call(this,d)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ii(e){if(!e._valueTracker){var t=jd(e)?"checked":"value";e._valueTracker=og(e,t,""+e[t])}}function bd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=jd(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}var ug=/[\n"\\]/g;function $t(e){return e.replace(ug,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Fi(e,t,a,n,s,r,d,g){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+_t(t)):e.value!==""+_t(t)&&(e.value=""+_t(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?d==="number"&&e.value==t?Pi(e,_t(e.value)):Pi(e,_t(t)):a!=null?Pi(e,_t(a)):n!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+_t(g):e.removeAttribute("name")}function Nd(e,t,a,n,s,r,d,g){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||a!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Ii(e);return}a=a!=null?""+_t(a):"",t=t!=null?""+_t(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,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Ii(e)}function Pi(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Zl(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=""+_t(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 Sd(e,t,a){if(t!=null&&(t=""+_t(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+_t(a):""}function wd(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(Oe(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=_t(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Ii(e)}function Kl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var dg=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 Ed(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||dg.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Td(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]="",Ae=!0);for(var s in t)n=t[s],t.hasOwnProperty(s)&&a[s]!==n&&(Ed(e,s,n),Ae=!0)}else for(var r in t)t.hasOwnProperty(r)&&Ed(e,r,t[r])}function Wi(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 fg=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"],["maskType","mask-type"],["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"]]),mg=/^[\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 ir(e){return mg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ca(){}var ec=null;function tc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jl=null,Il=null;function Cd(e){var t=Gl(e);if(t&&(e=t.stateNode)){var a=e[St]||null;e:switch(e=t.stateNode,t.type){case"input":if(Fi(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="'+$t(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var s=n[St]||null;if(!s)throw Error(c(90));Fi(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&&bd(n)}break e;case"textarea":Sd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Zl(e,!!a.multiple,t,!1)}}}var ac=!1;function Rd(e,t,a){if(ac)return e(t,a);ac=!0;try{var n=e(t);return n}finally{if(ac=!1,(Jl!==null||Il!==null)&&(ii(),Jl&&(t=Jl,e=Il,Il=Jl=null,Cd(t),e)))for(t=0;t<e.length;t++)Cd(e[t])}}function Kn(e,t){var a=e.stateNode;if(a===null)return null;var n=a[St]||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 wa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lc=!1;if(wa)try{var Jn={};Object.defineProperty(Jn,"passive",{get:function(){lc=!0}}),window.addEventListener("test",Jn,Jn),window.removeEventListener("test",Jn,Jn)}catch{lc=!1}var Va=null,nc=null,cr=null;function Ad(){if(cr)return cr;var e,t=nc,a=t.length,n,s="value"in Va?Va.value:Va.textContent,r=s.length;for(e=0;e<a&&t[e]===s[e];e++);var d=a-e;for(n=1;n<=d&&t[a-n]===s[r-n];n++);return cr=s.slice(e,1<n?1-n:void 0)}function or(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 ur(){return!0}function Od(){return!1}function yt(e){function t(a,n,s,r,d){this._reactName=a,this._targetInst=s,this.type=n,this.nativeEvent=r,this.target=d,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(a=e[g],this[g]=a?a(r):r[g]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ur:Od,this.isPropagationStopped=Od,this}return K(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=ur)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ur)},persist:function(){},isPersistent:ur}),t}var Ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dr=yt(Ga),In=K({},Ga,{view:0,detail:0}),xg=yt(In),sc,rc,Fn,fr=K({},In,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cc,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!==Fn&&(Fn&&e.type==="mousemove"?(sc=e.screenX-Fn.screenX,rc=e.screenY-Fn.screenY):rc=sc=0,Fn=e),sc)},movementY:function(e){return"movementY"in e?e.movementY:rc}}),Md=yt(fr),hg=K({},fr,{dataTransfer:0}),gg=yt(hg),pg=K({},In,{relatedTarget:0}),ic=yt(pg),yg=K({},Ga,{animationName:0,elapsedTime:0,pseudoElement:0}),vg=yt(yg),jg=K({},Ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bg=yt(jg),Ng=K({},Ga,{data:0}),_d=yt(Ng),Sg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wg={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"},Eg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Eg[e])?!!t[e]:!1}function cc(){return Tg}var Cg=K({},In,{key:function(e){if(e.key){var t=Sg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=or(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cc,charCode:function(e){return e.type==="keypress"?or(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?or(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rg=yt(Cg),Ag=K({},fr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dd=yt(Ag),Og=K({},Ga,{submitter:0}),Mg=yt(Og),_g=K({},In,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cc}),Dg=yt(_g),zg=K({},Ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lg=yt(zg),kg=K({},fr,{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}),Ug=yt(kg),Hg=K({},Ga,{newState:0,oldState:0,source:0}),Bg=yt(Hg),$g=[9,13,27,32],oc=wa&&"CompositionEvent"in window,Pn=null;wa&&"documentMode"in document&&(Pn=document.documentMode);var qg=wa&&"TextEvent"in window&&!Pn,zd=wa&&(!oc||Pn&&8<Pn&&11>=Pn),Ld=" ",kd=!1;function Ud(e,t){switch(e){case"keyup":return $g.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Fl=!1;function Yg(e,t){switch(e){case"compositionend":return Hd(t);case"keypress":return t.which!==32?null:(kd=!0,Ld);case"textInput":return e=t.data,e===Ld&&kd?null:e;default:return null}}function Vg(e,t){if(Fl)return e==="compositionend"||!oc&&Ud(e,t)?(e=Ad(),cr=nc=Va=null,Fl=!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 zd&&t.locale!=="ko"?null:t.data;default:return null}}var Gg={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 Bd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gg[e.type]:t==="textarea"}function $d(e,t,a,n){Jl?Il?Il.push(n):Il=[n]:Jl=n,t=mi(t,"onChange"),0<t.length&&(a=new dr("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Wn=null,es=null;function Qg(e){Rm(e,0)}function mr(e){var t=Zn(e);if(bd(t))return e}function qd(e,t){if(e==="change")return t}var Yd=!1;if(wa){var uc;if(wa){var dc="oninput"in document;if(!dc){var Vd=document.createElement("div");Vd.setAttribute("oninput","return;"),dc=typeof Vd.oninput=="function"}uc=dc}else uc=!1;Yd=uc&&(!document.documentMode||9<document.documentMode)}function Gd(){Wn&&(Wn.detachEvent("onpropertychange",Qd),es=Wn=null)}function Qd(e){if(e.propertyName==="value"&&mr(es)){var t=[];$d(t,es,e,tc(e)),Rd(Qg,t)}}function Xg(e,t,a){e==="focusin"?(Gd(),Wn=t,es=a,Wn.attachEvent("onpropertychange",Qd)):e==="focusout"&&Gd()}function Zg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return mr(es)}function Kg(e,t){if(e==="click")return mr(t)}function Jg(e,t){if(e==="input"||e==="change")return mr(t)}function Ig(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:Ig;function ts(e,t){if(Dt(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(!Gi.call(t,s)||!Dt(e[s],t[s]))return!1}return!0}function fc(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}}function Xd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zd(e,t){var a=Xd(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=Xd(a)}}function Kd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=fc(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=fc(e.document)}return t}function mc(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 Fg=wa&&"documentMode"in document&&11>=document.documentMode,Pl=null,xc=null,as=null,hc=!1;function Id(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;hc||Pl==null||Pl!==fc(n)||(n=Pl,"selectionStart"in n&&mc(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}),as&&ts(as,n)||(as=n,n=mi(xc,"onSelect"),0<n.length&&(t=new dr("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Pl)))}function vl(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Wl={animationend:vl("Animation","AnimationEnd"),animationiteration:vl("Animation","AnimationIteration"),animationstart:vl("Animation","AnimationStart"),transitionrun:vl("Transition","TransitionRun"),transitionstart:vl("Transition","TransitionStart"),transitioncancel:vl("Transition","TransitionCancel"),transitionend:vl("Transition","TransitionEnd")},gc={},Fd={};wa&&(Fd=document.createElement("div").style,"AnimationEvent"in window||(delete Wl.animationend.animation,delete Wl.animationiteration.animation,delete Wl.animationstart.animation),"TransitionEvent"in window||delete Wl.transitionend.transition);function jl(e){if(gc[e])return gc[e];if(!Wl[e])return e;var t=Wl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Fd)return gc[e]=t[a];return e}var Pd=jl("animationend"),Wd=jl("animationiteration"),ef=jl("animationstart"),Pg=jl("transitionrun"),Wg=jl("transitionstart"),ep=jl("transitioncancel"),tf=jl("transitionend"),af=new Map,pc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");pc.push("scrollEnd");function It(e,t){af.set(e,t),yl(t,[e])}var tp=0;function Ea(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ea.identifierPrefix;var a=tp++;return e="_"+e+"t_"+a.toString(32)+"_",t.autoName=e}function lf(e){if(e==null||typeof e=="string")return e;var t=null,a=jn;if(a!==null)for(var n=0;n<a.length;n++){var s=e[a[n]];if(s!=null){if(s==="none")return"none";t=t==null?s:t+(" "+s)}}return t??e.default}function Ta(e,t){return e=lf(e),t=lf(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var xr=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)},qt=[],en=0,yc=0;function hr(){for(var e=en,t=yc=en=0;t<e;){var a=qt[t];qt[t++]=null;var n=qt[t];qt[t++]=null;var s=qt[t];qt[t++]=null;var r=qt[t];if(qt[t++]=null,n!==null&&s!==null){var d=n.pending;d===null?s.next=s:(s.next=d.next,d.next=s),n.pending=s}r!==0&&nf(a,s,r)}}function gr(e,t,a,n){qt[en++]=e,qt[en++]=t,qt[en++]=a,qt[en++]=n,yc|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function vc(e,t,a,n){return gr(e,t,a,n),pr(e)}function bl(e,t){return gr(e,null,null,t),pr(e)}function nf(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var s=!1,r=e.return;r!==null;)r.childLanes|=a,n=r.alternate,n!==null&&(n.childLanes|=a),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-Mt(a),e=r.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=a|536870912),r):null}function pr(e){if(50<ws)throw ws=0,ri=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var tn={};function ap(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 wt(e,t,a,n){return new ap(e,t,a,n)}function jc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ca(e,t){var a=e.alternate;return a===null?(a=wt(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&1206910976,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 sf(e,t){e.flags&=1206910978;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 yr(e,t,a,n,s,r){var d=0;if(n=e,typeof n=="function")jc(n)&&(d=1);else if(typeof n=="string")d=Oy(e,a,ia.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(n){case B:return e=wt(31,a,t,s),e.elementType=B,e.lanes=r,e;case ae:return Nl(a.children,s,r,t);case Se:d=8,s|=24;break;case Te:return e=wt(12,a,t,s|2),e.elementType=Te,e.lanes=r,e;case le:return e=wt(13,a,t,s),e.elementType=le,e.lanes=r,e;case I:return e=wt(19,a,t,s),e.elementType=I,e.lanes=r,e;case V:case C:return e=s|32,e=wt(30,a,t,e),e.elementType=C,e.lanes=r,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case se:d=10;break e;case ze:d=9;break e;case Z:d=11;break e;case J:d=14;break e;case fe:d=16,n=null;break e}d=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=wt(d,a,t,s),t.elementType=e,t.type=n,t.lanes=r,t}function Nl(e,t,a,n){return e=wt(7,e,n,t),e.lanes=a,e}function bc(e,t,a){return e=wt(6,e,null,t),e.lanes=a,e}function rf(e){var t=wt(18,null,null,0);return t.stateNode=e,t}function Nc(e,t,a){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var cf=new WeakMap;function Yt(e,t){if(typeof e=="object"&&e!==null){var a=cf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:td(t)},cf.set(e,t),t)}return{value:e,source:t,stack:td(t)}}var an=[],ln=0,vr=null,ls=0,Vt=[],Gt=0,Qa=null,oa=1,ua="";function Ra(e,t){an[ln++]=ls,an[ln++]=vr,vr=e,ls=t}function of(e,t,a){Vt[Gt++]=oa,Vt[Gt++]=ua,Vt[Gt++]=Qa,Qa=e;var n=oa;e=ua;var s=32-Mt(n)-1;n&=~(1<<s),a+=1;var r=32-Mt(t)+s;if(30<r){var d=s-s%5;r=(n&(1<<d)-1).toString(32),n>>=d,s-=d,oa=1<<32-Mt(t)+s|a<<s|n,ua=r+e}else oa=1<<r|a<<s|n,ua=e}function jr(e){e.return!==null&&(Ra(e,1),of(e,1,0))}function Sc(e){for(;e===vr;)vr=an[--ln],an[ln]=null,ls=an[--ln],an[ln]=null;for(;e===Qa;)Qa=Vt[--Gt],Vt[Gt]=null,ua=Vt[--Gt],Vt[Gt]=null,oa=Vt[--Gt],Vt[Gt]=null}function uf(e,t){Vt[Gt++]=oa,Vt[Gt++]=ua,Vt[Gt++]=Qa,oa=t.id,ua=t.overflow,Qa=e}var st=null,Ye=null,ve=!1,Xa=null,Qt=!1,wc=Error(c(519));function Za(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ns(Yt(t,e)),wc}function df(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[ut]=e,t[St]=n,a){case"dialog":Ne("cancel",t),Ne("close",t);break;case"iframe":case"object":case"embed":Ne("load",t);break;case"video":case"audio":for(a=0;a<Ts.length;a++)Ne(Ts[a],t);break;case"source":Ne("error",t);break;case"img":case"image":case"link":Ne("error",t),Ne("load",t);break;case"details":Ne("toggle",t);break;case"input":Ne("invalid",t),Nd(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ne("invalid",t);break;case"textarea":Ne("invalid",t),wd(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||_m(t.textContent,a)?(n.popover!=null&&(Ne("beforetoggle",t),Ne("toggle",t)),n.onScroll!=null&&Ne("scroll",t),n.onScrollEnd!=null&&Ne("scrollend",t),n.onClick!=null&&(t.onclick=ca),t=!0):t=!1,t||Za(e,!0)}function br(e){for(st=e.return;st;)switch(st.tag){case 5:case 31:case 13:Qt=!1;return;case 27:case 3:Qt=!0;return;default:st=st.return}}function nn(e){if(e!==st)return!1;if(!ve)return br(e),ve=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||tu(e.type,e.memoizedProps)),a=!a),a&&Ye&&Za(e),br(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ye=Fm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ye=Fm(e)}else t===27?(t=Ye,ol(e.type)?(e=uu,uu=null,Ye=e):Ye=t):Ye=st?Zt(e.stateNode.nextSibling):null;return!0}function Sl(){Ye=st=null,ve=!1}function Ec(){var e=Xa;return e!==null&&(Ct===null?Ct=e:Ct.push.apply(Ct,e),Xa=null),e}function ns(e){Xa===null?Xa=[e]:Xa.push(e)}var Tc=ra(null),wl=null,Aa=null;function Ka(e,t,a){qe(Tc,t._currentValue),t._currentValue=a}function Oa(e){e._currentValue=Tc.current,ot(Tc)}function Nr(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 Cc(e,t,a,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var d=s.child;r=r.firstContext;e:for(;r!==null;){var g=r;r=s;for(var E=0;E<t.length;E++)if(g.context===t[E]){r.lanes|=a,g=r.alternate,g!==null&&(g.lanes|=a),Nr(r.return,a,e),n||(d=null);break e}r=g.next}}else if(s.tag===18){if(d=s.return,d===null)throw Error(c(341));d.lanes|=a,r=d.alternate,r!==null&&(r.lanes|=a),Nr(d,a,e),d=null}else s.tag===13&&s.memoizedState!==null&&s.memoizedState.dehydrated===null?(s.lanes|=a,d=s.alternate,d!==null&&(d.lanes|=a),Nr(s.return,a,e),d=s.child,d=d!==null?d.sibling:null):d=s.child;if(d!==null)d.return=s;else for(d=s;d!==null;){if(d===e){d=null;break}if(s=d.sibling,s!==null){s.return=d.return,d=s;break}d=d.return}s=d}}function El(e,t,a,n){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var d=s.alternate;if(d===null)throw Error(c(387));if(d=d.memoizedProps,d!==null){var g=s.type;Dt(s.pendingProps.value,d.value)||(e!==null?e.push(g):e=[g])}}else if(s===Js.current){if(d=s.alternate,d===null)throw Error(c(387));d.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(On):e=[On])}s=s.return}return e!==null&&Cc(t,e,a,n),t.flags|=262144,e!==null}function Sr(e){for(e=e.firstContext;e!==null;){if(!Dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Tl(e){wl=e,Aa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function dt(e){return ff(wl,e)}function wr(e,t){return wl===null&&Tl(e),ff(e,t)}function ff(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Aa===null){if(e===null)throw Error(c(308));Aa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Aa=Aa.next=t;return a}var lp=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()})}},np=i.unstable_scheduleCallback,sp=i.unstable_NormalPriority,Pe={$$typeof:se,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rc(){return{controller:new lp,data:new Map,refCount:0}}function ss(e){e.refCount--,e.refCount===0&&np(sp,function(){e.controller.abort()})}function mf(e,t){if((e.pendingLanes&4194048)!==0){var a=e.transitionTypes;for(a===null&&(a=e.transitionTypes=[]),e=0;e<t.length;e++){var n=t[e];a.indexOf(n)===-1&&a.push(n)}}}var rs=null;function rp(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var is=null,Ac=0,Cl=0,sn=null;function ip(e,t){if(is===null){var a=is=[];Ac=0,Cl=Xo(),sn={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Ac++,t.then(xf,xf),t}function xf(){if(--Ac===0&&(rs=null,is!==null)){sn!==null&&(sn.status="fulfilled");var e=is;is=null,Cl=0,sn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function cp(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 hf=oe.S;oe.S=function(e,t){if(im=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ip(e,t),rs!==null)for(var a=wn;a!==null;)mf(a,rs),a=a.next;if(a=e.types,a!==null){for(var n=wn;n!==null;)mf(n,a),n=n.next;if(Cl!==0){n=rs,n===null&&(n=rs=[]);for(var s=0;s<a.length;s++){var r=a[s];n.indexOf(r)===-1&&n.push(r)}}}hf!==null&&hf(e,t)};var Rl=ra(null);function Oc(){var e=Rl.current;return e!==null?e:Be.pooledCache}function Er(e,t){t===null?qe(Rl,Rl.current):qe(Rl,t.pool)}function gf(){var e=Oc();return e===null?null:{parent:Pe._currentValue,pool:e}}var rn=Error(c(460)),Mc=Error(c(474)),Tr=Error(c(542)),Cr={then:function(){}};function pf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function yf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(ca,ca),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,jf(e),e===void 0&&!("reason"in t)?Error(c(600)):e;default:if(typeof t.status=="string")t.then(ca,ca);else{if(e=Be,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,jf(e),e}throw Ol=t,rn}}function Al(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ol=a,rn):a}}var Ol=null;function vf(){if(Ol===null)throw Error(c(459));var e=Ol;return Ol=null,e}function jf(e){if(e===rn||e===Tr)throw Error(c(483))}var cn=null,cs=0;function Rr(e){var t=cs;return cs+=1,cn===null&&(cn=[]),yf(cn,e,t)}function Ja(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ar(e,t){throw t.$$typeof===X?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bf(e){function t(D,A){if(e){var L=D.deletions;L===null?(D.deletions=[A],D.flags|=16):L.push(A)}}function a(D,A){if(!e)return null;for(;A!==null;)t(D,A),A=A.sibling;return null}function n(D){for(var A=new Map;D!==null;)D.key===null?A.set(D.index,D):A.set(D.key,D),D=D.sibling;return A}function s(D,A){return D=Ca(D,A),D.index=0,D.sibling=null,D}function r(D,A,L){return D.index=L,e?(L=D.alternate,L!==null?(L=L.index,L<A?(D.flags|=2,A):L):(D.flags|=134217730,A)):(D.flags|=1048576,A)}function d(D){return e&&D.alternate===null&&(D.flags|=134217730),D}function g(D,A,L,q){return A===null||A.tag!==6?(A=bc(L,D.mode,q),A.return=D,A):(A=s(A,L),A.return=D,A)}function E(D,A,L,q){var re=L.type;return re===ae?(D=$(D,A,L.props.children,q,L.key),Ja(D,L),D):A!==null&&(A.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===fe&&Al(re)===A.type)?(A=s(A,L.props),Ja(A,L),A.return=D,A):(A=yr(L.type,L.key,L.props,null,D.mode,q),Ja(A,L),A.return=D,A)}function z(D,A,L,q){return A===null||A.tag!==4||A.stateNode.containerInfo!==L.containerInfo||A.stateNode.implementation!==L.implementation?(A=Nc(L,D.mode,q),A.return=D,A):(A=s(A,L.children||[]),A.return=D,A)}function $(D,A,L,q,re){return A===null||A.tag!==7?(A=Nl(L,D.mode,q,re),A.return=D,A):(A=s(A,L),A.return=D,A)}function Y(D,A,L){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=bc(""+A,D.mode,L),A.return=D,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case k:return L=yr(A.type,A.key,A.props,null,D.mode,L),Ja(L,A),L.return=D,L;case F:return A=Nc(A,D.mode,L),A.return=D,A;case fe:return A=Al(A),Y(D,A,L)}if(Oe(A)||W(A))return A=Nl(A,D.mode,L,null),A.return=D,A;if(typeof A.then=="function")return Y(D,Rr(A),L);if(A.$$typeof===se)return Y(D,wr(D,A),L);Ar(D,A)}return null}function M(D,A,L,q){var re=A!==null?A.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return re!==null?null:g(D,A,""+L,q);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case k:return L.key===re?E(D,A,L,q):null;case F:return L.key===re?z(D,A,L,q):null;case fe:return L=Al(L),M(D,A,L,q)}if(Oe(L)||W(L))return re!==null?null:$(D,A,L,q,null);if(typeof L.then=="function")return M(D,A,Rr(L),q);if(L.$$typeof===se)return M(D,A,wr(D,L),q);Ar(D,L)}return null}function H(D,A,L,q,re){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return D=D.get(L)||null,g(A,D,""+q,re);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case k:return D=D.get(q.key===null?L:q.key)||null,E(A,D,q,re);case F:return D=D.get(q.key===null?L:q.key)||null,z(A,D,q,re);case fe:return q=Al(q),H(D,A,L,q,re)}if(Oe(q)||W(q))return D=D.get(L)||null,$(A,D,q,re,null);if(typeof q.then=="function")return H(D,A,L,Rr(q),re);if(q.$$typeof===se)return H(D,A,L,wr(A,q),re);Ar(A,q)}return null}function te(D,A,L,q){for(var re=null,Ee=null,ue=A,me=A=0,tt=null;ue!==null&&me<L.length;me++){ue.index>me?(tt=ue,ue=null):tt=ue.sibling;var Ce=M(D,ue,L[me],q);if(Ce===null){ue===null&&(ue=tt);break}e&&ue&&Ce.alternate===null&&t(D,ue),A=r(Ce,A,me),Ee===null?re=Ce:Ee.sibling=Ce,Ee=Ce,ue=tt}if(me===L.length)return a(D,ue),ve&&Ra(D,me),re;if(ue===null){for(;me<L.length;me++)ue=Y(D,L[me],q),ue!==null&&(A=r(ue,A,me),Ee===null?re=ue:Ee.sibling=ue,Ee=ue);return ve&&Ra(D,me),re}for(ue=n(ue);me<L.length;me++)tt=H(ue,D,me,L[me],q),tt!==null&&(e&&(Ce=tt.alternate,Ce!==null&&ue.delete(Ce.key===null?me:Ce.key)),A=r(tt,A,me),Ee===null?re=tt:Ee.sibling=tt,Ee=tt);return e&&ue.forEach(function(xl){return t(D,xl)}),ve&&Ra(D,me),re}function ie(D,A,L,q){if(L==null)throw Error(c(151));for(var re=null,Ee=null,ue=A,me=A=0,tt=null,Ce=L.next();ue!==null&&!Ce.done;me++,Ce=L.next()){ue.index>me?(tt=ue,ue=null):tt=ue.sibling;var xl=M(D,ue,Ce.value,q);if(xl===null){ue===null&&(ue=tt);break}e&&ue&&xl.alternate===null&&t(D,ue),A=r(xl,A,me),Ee===null?re=xl:Ee.sibling=xl,Ee=xl,ue=tt}if(Ce.done)return a(D,ue),ve&&Ra(D,me),re;if(ue===null){for(;!Ce.done;me++,Ce=L.next())Ce=Y(D,Ce.value,q),Ce!==null&&(A=r(Ce,A,me),Ee===null?re=Ce:Ee.sibling=Ce,Ee=Ce);return ve&&Ra(D,me),re}for(ue=n(ue);!Ce.done;me++,Ce=L.next())Ce=H(ue,D,me,Ce.value,q),Ce!==null&&(e&&(tt=Ce.alternate,tt!==null&&ue.delete(tt.key===null?me:tt.key)),A=r(Ce,A,me),Ee===null?re=Ce:Ee.sibling=Ce,Ee=Ce);return e&&ue.forEach(function(Yy){return t(D,Yy)}),ve&&Ra(D,me),re}function ye(D,A,L,q){if(typeof L=="object"&&L!==null&&L.type===ae&&L.key===null&&L.props.ref===void 0&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case k:e:{for(var re=L.key;A!==null;){if(A.key===re){if(re=L.type,re===ae){if(A.tag===7){a(D,A.sibling),q=s(A,L.props.children),Ja(q,L),q.return=D,D=q;break e}}else if(A.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===fe&&Al(re)===A.type){a(D,A.sibling),q=s(A,L.props),Ja(q,L),q.return=D,D=q;break e}a(D,A);break}else t(D,A);A=A.sibling}L.type===ae?(q=Nl(L.props.children,D.mode,q,L.key),Ja(q,L),q.return=D,D=q):(q=yr(L.type,L.key,L.props,null,D.mode,q),Ja(q,L),q.return=D,D=q)}return d(D);case F:e:{for(re=L.key;A!==null;){if(A.key===re)if(A.tag===4&&A.stateNode.containerInfo===L.containerInfo&&A.stateNode.implementation===L.implementation){a(D,A.sibling),q=s(A,L.children||[]),q.return=D,D=q;break e}else{a(D,A);break}else t(D,A);A=A.sibling}q=Nc(L,D.mode,q),q.return=D,D=q}return d(D);case fe:return L=Al(L),ye(D,A,L,q)}if(Oe(L))return te(D,A,L,q);if(W(L)){if(re=W(L),typeof re!="function")throw Error(c(150));return L=re.call(L),ie(D,A,L,q)}if(typeof L.then=="function")return ye(D,A,Rr(L),q);if(L.$$typeof===se)return ye(D,A,wr(D,L),q);Ar(D,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,A!==null&&A.tag===6?(a(D,A.sibling),q=s(A,L),q.return=D,D=q):(a(D,A),q=bc(L,D.mode,q),q.return=D,D=q),d(D)):a(D,A)}return function(D,A,L,q){try{cs=0;var re=ye(D,A,L,q);return cn=null,re}catch(ue){if(ue===rn||ue===Tr)throw ue;var Ee=wt(29,ue,null,D.mode);return Ee.lanes=q,Ee.return=D,Ee}}}var Ml=bf(!0),Nf=bf(!1),Ia=!1;function _c(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Dc(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 Fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Me&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=pr(e),nf(e,null,a),t}return gr(e,n,t,a),pr(e)}function os(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,cd(e,a)}}function zc(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var s=null,r=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};r===null?s=r=d:r=r.next=d,a=a.next}while(a!==null);r===null?s=r=t:r=r.next=t}else s=r=t;a={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:r,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 Lc=!1;function us(){if(Lc){var e=sn;if(e!==null)throw e}}function ds(e,t,a,n){Lc=!1;var s=e.updateQueue;Ia=!1;var r=s.firstBaseUpdate,d=s.lastBaseUpdate,g=s.shared.pending;if(g!==null){s.shared.pending=null;var E=g,z=E.next;E.next=null,d===null?r=z:d.next=z,d=E;var $=e.alternate;$!==null&&($=$.updateQueue,g=$.lastBaseUpdate,g!==d&&(g===null?$.firstBaseUpdate=z:g.next=z,$.lastBaseUpdate=E))}if(r!==null){var Y=s.baseState;d=0,$=z=E=null,g=r;do{var M=g.lane&-536870913,H=M!==g.lane;if(H?(we&M)===M:(n&M)===M){M!==0&&M===Cl&&(Lc=!0),$!==null&&($=$.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var te=e,ie=g;M=t;var ye=a;switch(ie.tag){case 1:if(te=ie.payload,typeof te=="function"){Y=te.call(ye,Y,M);break e}Y=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=ie.payload,M=typeof te=="function"?te.call(ye,Y,M):te,M==null)break e;Y=K({},Y,M);break e;case 2:Ia=!0}}M=g.callback,M!==null&&(e.flags|=64,H&&(e.flags|=8192),H=s.callbacks,H===null?s.callbacks=[M]:H.push(M))}else H={lane:M,tag:g.tag,payload:g.payload,callback:g.callback,next:null},$===null?(z=$=H,E=Y):$=$.next=H,d|=M;if(g=g.next,g===null){if(g=s.shared.pending,g===null)break;H=g,g=H.next,H.next=null,s.lastBaseUpdate=H,s.shared.pending=null}}while(!0);$===null&&(E=Y),s.baseState=E,s.firstBaseUpdate=z,s.lastBaseUpdate=$,r===null&&(s.shared.lanes=0),sl|=d,e.lanes=d,e.memoizedState=Y}}function Sf(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function wf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Sf(a[e],t)}var Wa=ra(null),Or=ra(0);function Ef(e,t){e=La,qe(Or,e),qe(Wa,t),La=e|t.baseLanes}function kc(){qe(Or,La),qe(Wa,Wa.current)}function Uc(){La=Or.current,ot(Wa),ot(Or)}var ft=ra(null),pt=null;function el(e){var t=e.alternate;qe(mt,mt.current&1),qe(ft,e),pt===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(pt=e)}function Hc(e){qe(mt,mt.current),qe(ft,e),pt===null&&(pt=e)}function Tf(e){e.tag===22?(qe(mt,mt.current),qe(ft,e),pt===null&&(pt=e)):tl()}function tl(){qe(mt,mt.current),qe(ft,ft.current)}function zt(e){ot(ft),pt===e&&(pt=null),ot(mt)}var mt=ra(0);function fs(e,t){qe(ft,ft.current),qe(mt,t)}function Bc(e){ot(mt),ot(ft),pt===e&&(pt=null)}function Mr(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||cu(a)||ou(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 Ma=0,pe=null,He=null,We=null,_r=!1,on=!1,_l=!1,Dr=0,ms=0,un=null,op=0;function Je(){throw Error(c(321))}function $c(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Dt(e[a],t[a]))return!1;return!0}function qc(e,t,a,n,s,r){return Ma=r,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oe.H=e===null||e.memoizedState===null?o0:u0,_l=!1,r=a(n,s),_l=!1,on&&(r=Rf(t,a,n,s)),Cf(e),r}function Cf(e){oe.H=$r;var t=He!==null&&He.next!==null;if(Ma=0,We=He=pe=null,_r=!1,ms=0,un=null,t)throw Error(c(300));e===null||et||(e=e.dependencies,e!==null&&Sr(e)&&(et=!0))}function Rf(e,t,a,n){pe=e;var s=0;do{if(on&&(un=null),ms=0,on=!1,25<=s)throw Error(c(301));if(s+=1,We=He=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}oe.H=pp,r=t(a,n)}while(on);return r}function up(){var e=oe.H,t=e.useState()[0];return t=typeof t.then=="function"?xs(t):t,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(pe.flags|=1024),t}function Yc(){var e=Dr!==0;return Dr=0,e}function Vc(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Gc(e){if(_r){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_r=!1}Ma=0,We=He=pe=null,on=!1,ms=Dr=0,un=null}function vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?pe.memoizedState=We=e:We=We.next=e,We}function Fe(){if(He===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=We===null?pe.memoizedState:We.next;if(t!==null)We=t,He=e;else{if(e===null)throw pe.alternate===null?Error(c(467)):Error(c(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},We===null?pe.memoizedState=We=e:We=We.next=e}return We}function zr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xs(e){var t=ms;return ms+=1,un===null&&(un=[]),e=yf(un,e,t),t=pe,(We===null?t.memoizedState:We.next)===null&&(t=t.alternate,oe.H=t===null||t.memoizedState===null?o0:u0),e}function Lr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xs(e);if(e.$$typeof===G)return;if(e.$$typeof===se)return dt(e)}throw Error(c(438,String(e)))}function Qc(e){var t=null,a=pe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=pe.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=zr(),pe.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]=P;return t.index++,a}function _a(e,t){return typeof t=="function"?t(e):t}function kr(e){var t=Fe();return Xc(t,He,e)}function Xc(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var s=e.baseQueue,r=n.pending;if(r!==null){if(s!==null){var d=s.next;s.next=r.next,r.next=d}t.baseQueue=s=r,n.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var g=d=null,E=null,z=t,$=!1;do{var Y=z.lane&-536870913;if(Y!==z.lane?(we&Y)===Y:(Ma&Y)===Y){var M=z.revertLane;if(M===0)E!==null&&(E=E.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Y===Cl&&($=!0);else if((Ma&M)===M){z=z.next,M===Cl&&($=!0);continue}else Y={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},E===null?(g=E=Y,d=r):E=E.next=Y,pe.lanes|=M,sl|=M;Y=z.action,_l&&a(r,Y),r=z.hasEagerState?z.eagerState:a(r,Y)}else M={lane:Y,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},E===null?(g=E=M,d=r):E=E.next=M,pe.lanes|=Y,sl|=Y;z=z.next}while(z!==null&&z!==t);if(E===null?d=r:E.next=g,!Dt(r,e.memoizedState)&&(et=!0,$&&(a=sn,a!==null)))throw a;e.memoizedState=r,e.baseState=d,e.baseQueue=E,n.lastRenderedState=r}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Zc(e){var t=Fe(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,s=a.pending,r=t.memoizedState;if(s!==null){a.pending=null;var d=s=s.next;do r=e(r,d.action),d=d.next;while(d!==s);Dt(r,t.memoizedState)||(et=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),a.lastRenderedState=r}return[r,n]}function Af(e,t,a){var n=pe,s=Fe(),r=ve;if(r){if(a===void 0)throw Error(c(407));a=a()}else a=t();var d=!Dt((He||s).memoizedState,a);if(d&&(s.memoizedState=a,et=!0),s=s.queue,Ic(_f.bind(null,n,s,e),[e]),e=s.getSnapshot!==t||d||We!==null&&(We.memoizedState.tag&1)!==0,dn(e?9:8,{destroy:void 0},Mf.bind(null,n,s,a,t),null),e){if(n.flags|=2048,Be===null)throw Error(c(349));r||(Ma&127)!==0||Of(n,t,a)}return a}function Of(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=pe.updateQueue,t===null?(t=zr(),pe.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Mf(e,t,a,n){t.value=a,t.getSnapshot=n,Df(t)&&zf(e)}function _f(e,t,a){return a(function(){Df(t)&&zf(e)})}function Df(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Dt(e,a)}catch{return!0}}function zf(e){var t=bl(e,2);t!==null&&Rt(t,e,2)}function Kc(e){var t=vt();if(typeof e=="function"){var a=e;if(e=a(),_l){Ya(!0);try{a()}finally{Ya(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:e},t}function Lf(e,t,a,n){return e.baseState=a,Xc(e,He,typeof n=="function"?n:_a)}function dp(e,t,a,n,s){if(Br(e))throw Error(c(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){r.listeners.push(d)}};oe.T!==null?a(!0):r.isTransition=!1,n(r),a=t.pending,a===null?(r.next=t.pending=r,kf(t,r)):(r.next=a.next,t.pending=a.next=r)}}function kf(e,t){var a=t.action,n=t.payload,s=e.state;if(t.isTransition){var r=oe.T,d={};d.types=r!==null?r.types:null,oe.T=d;try{var g=a(s,n),E=oe.S;E!==null&&E(d,g),Uf(e,t,g)}catch(z){Jc(e,t,z)}finally{r!==null&&d.types!==null&&(r.types=d.types),oe.T=r}}else try{r=a(s,n),Uf(e,t,r)}catch(z){Jc(e,t,z)}}function Uf(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Hf(e,t,n)},function(n){return Jc(e,t,n)}):Hf(e,t,a)}function Hf(e,t,a){t.status="fulfilled",t.value=a,Bf(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,kf(e,a)))}function Jc(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Bf(t),t=t.next;while(t!==n)}e.action=null}function Bf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $f(e,t){return t}function qf(e,t){if(ve){var a=Be.formState;if(a!==null){e:{var n=pe;if(ve){if(Ye){t:{for(var s=Ye,r=Qt;s.nodeType!==8;){if(!r){s=null;break t}if(s=Zt(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){Ye=Zt(s.nextSibling),n=s.data==="F!";break e}}Za(n)}n=!1}n&&(t=a[0])}}return a=vt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$f,lastRenderedState:t},a.queue=n,a=r0.bind(null,pe,n),n.dispatch=a,n=Kc(!1),r=to.bind(null,pe,!1,n.queue),n=vt(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,a=dp.bind(null,pe,s,r,a),s.dispatch=a,n.memoizedState=e,[t,a,!1]}function Yf(e){var t=Fe();return Vf(t,He,e)}function Vf(e,t,a){if(t=Xc(e,t,$f)[0],e=kr(_a)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=xs(t)}catch(d){throw d===rn?Tr:d}else n=t;t=Fe();var s=t.queue,r=s.dispatch;return a!==t.memoizedState&&(pe.flags|=2048,dn(9,{destroy:void 0},fp.bind(null,s,a),null)),[n,r,e]}function fp(e,t){e.action=t}function Gf(e){var t=Fe(),a=He;if(a!==null)return Vf(t,a,e);Fe(),t=t.memoizedState,a=Fe();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function dn(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=pe.updateQueue,t===null&&(t=zr(),pe.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 Qf(){return Fe().memoizedState}function Ur(e,t,a,n){var s=vt();pe.flags|=e,s.memoizedState=dn(1|t,{destroy:void 0},a,n===void 0?null:n)}function Hr(e,t,a,n){var s=Fe();n=n===void 0?null:n;var r=s.memoizedState.inst;He!==null&&n!==null&&$c(n,He.memoizedState.deps)?s.memoizedState=dn(t,r,a,n):(pe.flags|=e,s.memoizedState=dn(1|t,r,a,n))}function Xf(e,t){Ur(8390656,8,e,t)}function Ic(e,t){Hr(2048,8,e,t)}function mp(e){pe.flags|=4;var t=pe.updateQueue;if(t===null)t=zr(),pe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Zf(e){var t=Fe().memoizedState;return mp({ref:t,nextImpl:e}),function(){if((Me&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Kf(e,t){return Hr(4,2,e,t)}function Jf(e,t){return Hr(4,4,e,t)}function If(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 Ff(e,t,a){a=a!=null?a.concat([e]):null,Hr(4,4,If.bind(null,t,e),a)}function Fc(){}function Pf(e,t){var a=Fe();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&$c(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Wf(e,t){var a=Fe();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&$c(t,n[1]))return n[0];if(n=e(),_l){Ya(!0);try{e()}finally{Ya(!1)}}return a.memoizedState=[n,t],n}function Pc(e,t,a){return a===void 0||(Ma&1073741824)!==0&&(we&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=om(),pe.lanes|=e,sl|=e,a)}function e0(e,t,a,n){return Dt(a,t)?a:Wa.current!==null?(e=Pc(e,a,n),Dt(e,t)||(et=!0),e):(Ma&106)===0||(Ma&1073741824)!==0&&(we&261930)===0?(et=!0,e.memoizedState=a):(e=om(),pe.lanes|=e,sl|=e,t)}function t0(e,t,a,n,s){var r=he.p;he.p=r!==0&&8>r?r:8;var d=oe.T,g={};g.types=d!==null?d.types:null,oe.T=g,to(e,!1,t,a);try{var E=s(),z=oe.S;if(z!==null&&z(g,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var $=cp(E,n);hs(e,t,$,Ht(e))}else hs(e,t,n,Ht(e))}catch(Y){hs(e,t,{then:function(){},status:"rejected",reason:Y},Ht())}finally{he.p=r,d!==null&&g.types!==null&&(d.types=g.types),oe.T=d}}function xp(){}function Wc(e,t,a,n){if(e.tag!==5)throw Error(c(476));var s=a0(e).queue;t0(e,s,t,ba,a===null?xp:function(){return l0(e),a(n)})}function a0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ba,baseState:ba,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:ba},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_a,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function l0(e){var t=a0(e);t.next===null&&(t=e.alternate.memoizedState),hs(e,t.next.queue,{},Ht())}function eo(){return dt(On)}function n0(){return Fe().memoizedState}function s0(){return Fe().memoizedState}function hp(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ht();e=Fa(a);var n=Pa(t,e,a);n!==null&&(Rt(n,t,a),os(n,t,a)),t={cache:Rc()},e.payload=t;return}t=t.return}}function gp(e,t,a){var n=Ht();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Br(e)?i0(t,a):(a=vc(e,t,a,n),a!==null&&(Rt(a,e,n),c0(a,t,n)))}function r0(e,t,a){var n=Ht();hs(e,t,a,n)}function hs(e,t,a,n){var s={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Br(e))i0(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var d=t.lastRenderedState,g=r(d,a);if(s.hasEagerState=!0,s.eagerState=g,Dt(g,d))return gr(e,t,s,0),Be===null&&hr(),!1}catch{}if(a=vc(e,t,s,n),a!==null)return Rt(a,e,n),c0(a,t,n),!0}return!1}function to(e,t,a,n){if(n={lane:2,revertLane:Xo(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Br(e)){if(t)throw Error(c(479))}else t=vc(e,a,n,2),t!==null&&Rt(t,e,2)}function Br(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function i0(e,t){on=_r=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function c0(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,cd(e,a)}}var $r={readContext:dt,use:Lr,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useLayoutEffect:Je,useInsertionEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useSyncExternalStore:Je,useId:Je,useHostTransitionStatus:Je,useFormState:Je,useActionState:Je,useOptimistic:Je,useMemoCache:Je,useCacheRefresh:Je,useEffectEvent:Je},o0={readContext:dt,use:Lr,useCallback:function(e,t){return vt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:Xf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ur(4194308,4,If.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ur(4194308,4,e,t)},useInsertionEffect:function(e,t){Ur(4,2,e,t)},useMemo:function(e,t){var a=vt();t=t===void 0?null:t;var n=e();if(_l){Ya(!0);try{e()}finally{Ya(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=vt();if(a!==void 0){var s=a(t);if(_l){Ya(!0);try{a(t)}finally{Ya(!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=gp.bind(null,pe,e),[n.memoizedState,e]},useRef:function(e){var t=vt();return e={current:e},t.memoizedState=e},useState:function(e){e=Kc(e);var t=e.queue,a=r0.bind(null,pe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Fc,useDeferredValue:function(e,t){var a=vt();return Pc(a,e,t)},useTransition:function(){var e=Kc(!1);return e=t0.bind(null,pe,e.queue,!0,!1),vt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=pe,s=vt();if(ve){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),Be===null)throw Error(c(349));(we&127)!==0||Of(n,t,a)}s.memoizedState=a;var r={value:a,getSnapshot:t};return s.queue=r,Xf(_f.bind(null,n,r,e),[e]),n.flags|=2048,dn(9,{destroy:void 0},Mf.bind(null,n,r,a,t),null),a},useId:function(){var e=vt(),t=Be.identifierPrefix;if(ve){var a=ua,n=oa;a=(n&~(1<<32-Mt(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Dr++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=op++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:eo,useFormState:qf,useActionState:qf,useOptimistic:function(e){var t=vt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=to.bind(null,pe,!0,a),a.dispatch=t,[e,t]},useMemoCache:Qc,useCacheRefresh:function(){return vt().memoizedState=hp.bind(null,pe)},useEffectEvent:function(e){var t=vt(),a={impl:e};return t.memoizedState=a,function(){if((Me&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},u0={readContext:dt,use:Lr,useCallback:Pf,useContext:dt,useEffect:Ic,useImperativeHandle:Ff,useInsertionEffect:Kf,useLayoutEffect:Jf,useMemo:Wf,useReducer:kr,useRef:Qf,useState:function(){return kr(_a)},useDebugValue:Fc,useDeferredValue:function(e,t){var a=Fe();return e0(a,He.memoizedState,e,t)},useTransition:function(){var e=kr(_a)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:xs(e),t]},useSyncExternalStore:Af,useId:n0,useHostTransitionStatus:eo,useFormState:Yf,useActionState:Yf,useOptimistic:function(e,t){var a=Fe();return Lf(a,He,e,t)},useMemoCache:Qc,useCacheRefresh:s0,useEffectEvent:Zf},pp={readContext:dt,use:Lr,useCallback:Pf,useContext:dt,useEffect:Ic,useImperativeHandle:Ff,useInsertionEffect:Kf,useLayoutEffect:Jf,useMemo:Wf,useReducer:Zc,useRef:Qf,useState:function(){return Zc(_a)},useDebugValue:Fc,useDeferredValue:function(e,t){var a=Fe();return He===null?Pc(a,e,t):e0(a,He.memoizedState,e,t)},useTransition:function(){var e=Zc(_a)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:xs(e),t]},useSyncExternalStore:Af,useId:n0,useHostTransitionStatus:eo,useFormState:Gf,useActionState:Gf,useOptimistic:function(e,t){var a=Fe();return He!==null?Lf(a,He,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Qc,useCacheRefresh:s0,useEffectEvent:Zf};function ao(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:K({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var lo={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Ht(),s=Fa(n);s.payload=t,a!=null&&(s.callback=a),t=Pa(e,s,n),t!==null&&(Rt(t,e,n),os(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Ht(),s=Fa(n);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=Pa(e,s,n),t!==null&&(Rt(t,e,n),os(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ht(),n=Fa(a);n.tag=2,t!=null&&(n.callback=t),t=Pa(e,n,a),t!==null&&(Rt(t,e,a),os(t,e,a))}};function d0(e,t,a,n,s,r,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,r,d):t.prototype&&t.prototype.isPureReactComponent?!ts(a,n)||!ts(s,r):!0}function f0(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&&lo.enqueueReplaceState(t,t.state,null)}function Dl(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=K({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}function m0(e){xr(e)}function x0(e){console.error(e)}function h0(e){xr(e)}function qr(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function g0(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 no(e,t,a){return a=Fa(a),a.tag=3,a.payload={element:null},a.callback=function(){qr(e,t)},a}function p0(e){return e=Fa(e),e.tag=3,e}function y0(e,t,a,n){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var r=n.value;e.payload=function(){return s(r)},e.callback=function(){g0(t,a,n)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){g0(t,a,n),typeof s!="function"&&(rl===null?rl=new Set([this]):rl.add(this));var g=n.stack;this.componentDidCatch(n.value,{componentStack:g!==null?g:""})})}function yp(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=ft.current,a!==null){switch(a.tag){case 31:case 13:case 19:return pt===null?ci():a.alternate===null&&Ie===0&&(Ie=3),a.flags&=-257,a.flags|=65536,a.lanes=s,n===Cr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Vo(e,n,s)),!1;case 22:return a.flags|=65536,n===Cr?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)),Vo(e,n,s)),!1}throw Error(c(435,a.tag))}return Vo(e,n,s),ci(),!1}if(ve)return t=ft.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==wc&&(e=Error(c(422),{cause:n}),ns(Yt(e,a)))):(n!==wc&&(t=Error(c(423),{cause:n}),ns(Yt(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=Yt(n,a),s=no(e.stateNode,n,s),zc(e,s),Ie!==4&&(Ie=2)),!1;var r=Error(c(520),{cause:n});if(r=Yt(r,a),Ss===null?Ss=[r]:Ss.push(r),Ie!==4&&(Ie=2),t===null)return!0;n=Yt(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=no(a.stateNode,n,e),zc(a,e),!1;case 1:if(t=a.type,r=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(rl===null||!rl.has(r))))return a.flags|=65536,s&=-s,a.lanes|=s,s=p0(s),y0(s,e,a,n),zc(a,s),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var so=Error(c(461)),et=!1;function at(e,t,a,n){t.child=e===null?Nf(t,null,a,n):Ml(t,e.child,a,n)}function v0(e,t,a,n,s){a=a.render;var r=t.ref;if("ref"in n){var d={};for(var g in n)g!=="ref"&&(d[g]=n[g])}else d=n;return Tl(t),n=qc(e,t,a,d,r,s),g=Yc(),e!==null&&!et?(Vc(e,t,s),Da(e,t,s)):(ve&&g&&jr(t),t.flags|=1,at(e,t,n,s),t.child)}function j0(e,t,a,n,s){if(e===null){var r=a.type;return typeof r=="function"&&!jc(r)&&r.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=r,b0(e,t,r,n,s)):(e=yr(a.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!xo(e,s)){var d=r.memoizedProps;if(a=a.compare,a=a!==null?a:ts,a(d,n)&&e.ref===t.ref)return Da(e,t,s)}return t.flags|=1,e=Ca(r,n),e.ref=t.ref,e.return=t,t.child=e}function b0(e,t,a,n,s){if(e!==null){var r=e.memoizedProps;if(ts(r,n)&&e.ref===t.ref)if(et=!1,t.pendingProps=n=r,xo(e,s))(e.flags&131072)!==0&&(et=!0);else return t.lanes=e.lanes,Da(e,t,s)}return ro(e,t,a,n,s)}function N0(e,t,a,n){var s=n.children,r=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(r=r!==null?r.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&~r}else n=0,t.child=null;return S0(e,t,r,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Er(t,r!==null?r.cachePool:null),r!==null?Ef(t,r):kc(),Tf(t);else return n=t.lanes=536870912,S0(e,t,r!==null?r.baseLanes|a:a,a,n)}else r!==null?(Er(t,r.cachePool),Ef(t,r),tl(),t.memoizedState=null):(e!==null&&Er(t,null),kc(),tl());return at(e,t,s,a),t.child}function gs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function S0(e,t,a,n,s){var r=Oc();return r=r===null?null:{parent:Pe._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&Er(t,null),kc(),Tf(t),e!==null&&El(e,t,n,!0),t.childLanes=s,null}function Yr(e,t){return t=Vr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function w0(e,t,a){return Ml(t,e.child,null,a),e=Yr(t,t.pendingProps),e.flags|=2,zt(t),t.memoizedState=null,e}function vp(e,t,a){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ve){if(n.mode==="hidden")return e=Yr(t,n),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},gs(null,e);if(Hc(t),(e=Ye)?(e=Im(e,Qt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qa!==null?{id:oa,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},a=rf(e),a.return=t,t.child=a,st=t,Ye=null)):e=null,e===null)throw Za(t);return t.lanes=536870912,null}return Yr(t,n)}var r=e.memoizedState;if(r!==null){var d=r.dehydrated;if(Hc(t),s)if(t.flags&256)t.flags&=-257,t=w0(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(et||El(e,t,a,!1),s=(a&e.childLanes)!==0,et||s){if(Wa.current===null){if(n=Be,n!==null&&(d=od(n,a),d!==0&&d!==r.retryLane))throw r.retryLane=d,bl(e,d),Rt(n,e,d),so;ci()}t=w0(e,t,a)}else e=r.treeContext,Ye=Zt(d.nextSibling),st=t,ve=!0,Xa=null,Qt=!1,e!==null&&uf(t,e),t=Yr(t,n),t.flags|=134221824;return t}return e=Ca(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fn(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 ro(e,t,a,n,s){return Tl(t),a=qc(e,t,a,n,void 0,s),n=Yc(),e!==null&&!et?(Vc(e,t,s),Da(e,t,s)):(ve&&n&&jr(t),t.flags|=1,at(e,t,a,s),t.child)}function E0(e,t,a,n,s,r){return Tl(t),t.updateQueue=null,a=Rf(t,n,a,s),Cf(e),n=Yc(),e!==null&&!et?(Vc(e,t,r),Da(e,t,r)):(ve&&n&&jr(t),t.flags|=1,at(e,t,a,r),t.child)}function T0(e,t,a,n,s){if(Tl(t),t.stateNode===null){var r=tn,d=a.contextType;typeof d=="object"&&d!==null&&(r=dt(d)),r=new a(n,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=lo,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=n,r.state=t.memoizedState,r.refs={},_c(t),d=a.contextType,r.context=typeof d=="object"&&d!==null?dt(d):tn,r.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(ao(t,a,d,n),r.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(d=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),d!==r.state&&lo.enqueueReplaceState(r,r.state,null),ds(t,n,r,s),us(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){r=t.stateNode;var g=t.memoizedProps,E=Dl(a,g);r.props=E;var z=r.context,$=a.contextType;d=tn,typeof $=="object"&&$!==null&&(d=dt($));var Y=a.getDerivedStateFromProps;$=typeof Y=="function"||typeof r.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,$||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(g||z!==d)&&f0(t,r,n,d),Ia=!1;var M=t.memoizedState;r.state=M,ds(t,n,r,s),us(),z=t.memoizedState,g||M!==z||Ia?(typeof Y=="function"&&(ao(t,a,Y,n),z=t.memoizedState),(E=Ia||d0(t,a,E,n,M,z,d))?($||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=z),r.props=n,r.state=z,r.context=d,n=E):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{r=t.stateNode,Dc(e,t),d=t.memoizedProps,$=Dl(a,d),r.props=$,Y=t.pendingProps,M=r.context,z=a.contextType,E=tn,typeof z=="object"&&z!==null&&(E=dt(z)),g=a.getDerivedStateFromProps,(z=typeof g=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==Y||M!==E)&&f0(t,r,n,E),Ia=!1,M=t.memoizedState,r.state=M,ds(t,n,r,s),us();var H=t.memoizedState;d!==Y||M!==H||Ia||e!==null&&e.dependencies!==null&&Sr(e.dependencies)?(typeof g=="function"&&(ao(t,a,g,n),H=t.memoizedState),($=Ia||d0(t,a,$,n,M,H,E)||e!==null&&e.dependencies!==null&&Sr(e.dependencies))?(z||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(n,H,E),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(n,H,E)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=H),r.props=n,r.state=H,r.context=E,n=$):(typeof r.componentDidUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),n=!1)}return r=n,fn(e,t),n=(t.flags&128)!==0,r||n?(r=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&n?(t.child=Ml(t,e.child,null,s),t.child=Ml(t,null,a,s)):at(e,t,a,s),t.memoizedState=r.state,e=t.child):e=Da(e,t,s),e}function C0(e,t,a,n){return Sl(),t.flags|=256,at(e,t,a,n),t.child}var io={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function co(e){return{baseLanes:e,cachePool:gf()}}function oo(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ut),e}function R0(e,t,a){var n=t.pendingProps,s=!1,r=(t.flags&128)!==0,d;if((d=r)||(d=e!==null&&e.memoizedState===null?!1:(mt.current&2)!==0),d&&(s=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(ve){if(s?el(t):tl(),(e=Ye)?(e=Im(e,Qt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qa!==null?{id:oa,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},a=rf(e),a.return=t,t.child=a,st=t,Ye=null)):e=null,e===null)throw Za(t);return ou(e)?t.lanes=32:t.lanes=536870912,null}return r=n.children,n=n.fallback,s?(tl(),s=t.mode,r=Vr({mode:"hidden",children:r},s),n=Nl(n,s,a,null),r.return=t,n.return=t,r.sibling=n,t.child=r,n=t.child,n.memoizedState=co(a),n.childLanes=oo(e,d,a),t.memoizedState=io,gs(null,n)):(el(t),uo(t,r))}var g=e.memoizedState;if(g!==null){var E=g.dehydrated;if(E!==null)return jp(e,t,r,d,n,E,g,a)}return s?(tl(),s=n.fallback,r=t.mode,g=e.child,E=g.sibling,n=Ca(g,{mode:"hidden",children:n.children}),n.subtreeFlags=g.subtreeFlags&1206910976,E!==null?s=Ca(E,s):(s=Nl(s,r,a,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,gs(null,n),n=t.child,s=e.child.memoizedState,s===null?s=co(a):(r=s.cachePool,r!==null?(g=Pe._currentValue,r=r.parent!==g?{parent:g,pool:g}:r):r=gf(),s={baseLanes:s.baseLanes|a,cachePool:r}),n.memoizedState=s,n.childLanes=oo(e,d,a),t.memoizedState=io,gs(e.child,n)):(el(t),a=e.child,e=a.sibling,a=Ca(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function uo(e,t){return t=Vr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Vr(e,t){return e=wt(22,e,null,t),e.lanes=0,e}function Gr(e,t,a){return Ml(t,e.child,null,a),e=uo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jp(e,t,a,n,s,r,d,g){if(a)return t.flags&256?(el(t),t.flags&=-257,Gr(e,t,g)):t.memoizedState!==null?(tl(),t.child=e.child,t.flags|=128,null):(tl(),r=s.fallback,d=t.mode,s=Vr({mode:"visible",children:s.children},d),r=Nl(r,d,g,null),r.flags|=2,s.return=t,r.return=t,s.sibling=r,t.child=s,Ml(t,e.child,null,g),s=t.child,s.memoizedState=co(g),s.childLanes=oo(e,n,g),t.memoizedState=io,gs(null,s));if(el(t),ou(r)){if(n=r.nextSibling&&r.nextSibling.dataset,n)var E=n.dgst;return n=E,n!==""&&(s=Error(c(419)),s.stack="",s.digest=n,ns({value:s,source:null,stack:null})),Gr(e,t,g)}if(et||El(e,t,g,!1),n=(g&e.childLanes)!==0,et||n){if(Wa.current!==null)return Gr(e,t,g);if(n=Be,n!==null&&(s=od(n,g),s!==0&&s!==d.retryLane))throw d.retryLane=s,bl(e,s),Rt(n,e,s),so;return cu(r)||ci(),Gr(e,t,g)}return cu(r)?(t.flags|=192,t.child=e.child,null):(e=d.treeContext,Ye=Zt(r.nextSibling),st=t,ve=!0,Xa=null,Qt=!1,e!==null&&uf(t,e),t=uo(t,s.children),t.flags|=134221824,t)}function A0(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Nr(e.return,t,a)}function O0(e){for(var t=null;e!==null;){var a=e.alternate;a!==null&&Mr(a)===null&&(t=e),e=e.sibling}return t}function Qr(e,t,a,n,s,r){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:s,treeForkCount:r}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=n,d.tail=a,d.tailMode=s,d.treeForkCount=r)}function fo(e){var t=e.child;for(e.child=null;t!==null;){var a=t.sibling;t.sibling=e.child,e.child=t,t=a}}function mo(e,t,a){var n=t.pendingProps,s=n.revealOrder,r=n.tail;n=n.children;var d=mt.current;if(t.flags&128)return fs(t,d),null;var g=(d&2)!==0;if(g?(d=d&1|2,t.flags|=128):d&=1,fs(t,d),s==="backwards"&&e!==null?(fo(e),at(e,t,n,a),fo(e)):at(e,t,n,a),n=ve?ls:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&A0(e,a,t);else if(e.tag===19)A0(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"backwards":a=O0(t.child),a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null,fo(t)),Qr(t,!0,s,null,r,n);break;case"unstable_legacy-backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Mr(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}Qr(t,!0,a,null,r,n);break;case"together":Qr(t,!1,null,null,void 0,n);break;case"independent":t.memoizedState=null;break;default:a=O0(t.child),a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),Qr(t,!1,s,a,r,n)}return t.child}function M0(e,t,a){var n=t.pendingProps;return Ka(t,t.type,n.value),at(e,t,n.children,a),t.child}function Da(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),sl|=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=Ca(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Ca(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function xo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Sr(e)))}function bp(e,t,a){switch(t.tag){case 3:Is(t,t.stateNode.containerInfo),Ka(t,Pe,e.memoizedState.cache),Sl();break;case 27:case 5:$i(t);break;case 4:Is(t,t.stateNode.containerInfo);break;case 10:Ka(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Hc(t),null;break;case 13:var n=t.memoizedState;if(n!==null){if(n.dehydrated!==null)return el(t),t.flags|=128,null;n=El(e,t,a,!1);var s=t.child.childLanes;return n||(a&s)!==0?R0(e,t,a):(el(t),e=Da(e,t,a),e!==null?e.sibling:null)}el(t);break;case 19:if(t.flags&128)return mo(e,t,a);if(s=(e.flags&128)!==0,n=(a&t.childLanes)!==0,n||(El(e,t,a,!1),n=(a&t.childLanes)!==0),s){if(n)return mo(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fs(t,mt.current),n)break;return null;case 22:return t.lanes=0,N0(e,t,a,t.pendingProps);case 24:Ka(t,Pe,e.memoizedState.cache)}return Da(e,t,a)}function _0(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)et=!0;else{if(!xo(e,a)&&(t.flags&128)===0)return et=!1,bp(e,t,a);et=(e.flags&131072)!==0}else et=!1,ve&&(t.flags&1048576)!==0&&of(t,ls,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Al(t.elementType),t.type=e,typeof e=="function")jc(e)?(n=Dl(e,n),t.tag=1,t=T0(null,t,e,n,a)):(t.tag=0,t=ro(null,t,e,n,a));else{if(e!=null){var s=e.$$typeof;if(s===Z){t.tag=11,t=v0(null,t,e,n,a);break e}else if(s===J){t.tag=14,t=j0(null,t,e,n,a);break e}else if(s===se){t.tag=10,t.type=e,t=M0(null,t,a);break e}}throw t=Re(e)||e,Error(c(306,t,""))}}return t;case 0:return ro(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,s=Dl(n,t.pendingProps),T0(e,t,n,s,a);case 3:e:{if(Is(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var r=t.memoizedState;s=r.element,Dc(e,t),ds(t,n,null,a);var d=t.memoizedState;if(n=d.cache,Ka(t,Pe,n),n!==r.cache&&Cc(t,[Pe],a,!0),us(),n=d.element,r.isDehydrated)if(r={element:n,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=C0(e,t,n,a);break e}else if(n!==s){s=Yt(Error(c(424)),t),ns(s),t=C0(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,Ye=Zt(e.firstChild),st=t,ve=!0,Xa=null,Qt=!0,a=Nf(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling;else{if(Sl(),n===s){t=Da(e,t,a);break e}at(e,t,n,a)}t=t.child}return t;case 26:return fn(e,t),e===null?(a=lx(t.type,null,t.pendingProps,null))?t.memoizedState=a:ve||(t.stateNode=km(t.type,t.pendingProps,$a.current,t)):t.memoizedState=lx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return $i(t),e===null&&ve&&(n=t.stateNode=Wm(t.type,t.pendingProps,$a.current),st=t,Qt=!0,s=Ye,ol(t.type)?(uu=s,Ye=Zt(n.firstChild)):Ye=s),at(e,t,t.pendingProps.children,a),fn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ve&&((s=n=Ye)&&(n=hy(n,t.type,t.pendingProps,Qt),n!==null?(t.stateNode=n,st=t,Ye=Zt(n.firstChild),Qt=!1,s=!0):s=!1),s||Za(t)),$i(t),s=t.type,r=t.pendingProps,d=e!==null?e.memoizedProps:null,n=r.children,tu(s,r)?n=null:d!==null&&tu(s,d)&&(t.flags|=32),t.memoizedState!==null&&(s=qc(e,t,up,null,null,a),On._currentValue=s),fn(e,t),at(e,t,n,a),t.child;case 6:return e===null&&ve&&((e=a=Ye)&&(a=gy(a,t.pendingProps,Qt),a!==null?(t.stateNode=a,st=t,Ye=null,e=!0):e=!1),e||Za(t)),null;case 13:return R0(e,t,a);case 4:return Is(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ml(t,null,n,a):at(e,t,n,a),t.child;case 11:return v0(e,t,t.type,t.pendingProps,a);case 7:return n=t.pendingProps,fn(e,t),at(e,t,n,a),t.child;case 8:return at(e,t,t.pendingProps.children,a),t.child;case 12:return at(e,t,t.pendingProps.children,a),t.child;case 10:return M0(e,t,a);case 9:return s=t.type._context,n=t.pendingProps.children,Tl(t),s=dt(s),n=n(s),t.flags|=1,at(e,t,n,a),t.child;case 14:return j0(e,t,t.type,t.pendingProps,a);case 15:return b0(e,t,t.type,t.pendingProps,a);case 19:return mo(e,t,a);case 31:return vp(e,t,a);case 22:return N0(e,t,a,t.pendingProps);case 24:return Tl(t),n=dt(Pe),e===null?(s=Oc(),s===null&&(s=Be,r=Rc(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=a),s=r),t.memoizedState={parent:n,cache:s},_c(t),Ka(t,Pe,s)):((e.lanes&a)!==0&&(Dc(e,t),ds(t,null,null,a),us()),s=e.memoizedState,r=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Ka(t,Pe,n)):(n=r.cache,Ka(t,Pe,n),n!==s.cache&&Cc(t,[Pe],a,!0))),at(e,t,t.pendingProps.children,a),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),n=t.pendingProps,n.name!=null&&n.name!=="auto"?t.flags|=e===null?18882560:18874368:ve&&jr(t),e!==null&&e.memoizedProps.name!==n.name?t.flags|=4194816:fn(e,t),at(e,t,n.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function za(e){e.flags|=4}function ho(e,t,a,n,s){var r;if((r=(e.mode&32)!==0)&&(r=a===null?ix(t,n):ix(t,n)&&(n.src!==a.src||n.srcSet!==a.srcSet)),r){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(mm())e.flags|=8192;else throw Ol=Cr,Mc}else e.flags&=-16777217}function D0(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!cx(t))if(mm())e.flags|=8192;else throw Ol=Cr,Mc}function Xr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?rd():536870912,e.lanes|=t,pn|=t)}function ps(e,t){if(!ve)switch(e.tailMode){case"visible":break;case"collapsed":for(var a=e.tail,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;break;default:for(t=e.tail,a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null}}function Ve(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&1206910976,n|=s.flags&1206910976,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 Np(e,t,a){var n=t.pendingProps;switch(Sc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(t),null;case 1:return Ve(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Oa(Pe),Yl(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(nn(t)?za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ec())),Ve(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(za(t),r!==null?(Ve(t),D0(t,r)):(Ve(t),ho(t,s,null,n,a))):r?r!==e.memoizedState?(za(t),Ve(t),D0(t,r)):(Ve(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&za(t),Ve(t),ho(t,s,e,n,a)),null;case 27:if(Fs(t),a=$a.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&za(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Ve(t),t.subtreeFlags&=-33554433,null}e=ia.current,nn(t)?df(t):(e=Wm(s,n,a),t.stateNode=e,za(t))}return Ve(t),t.subtreeFlags&=-33554433,null;case 5:if(Fs(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&za(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return Ve(t),t.subtreeFlags&=-33554433,null}if(r=ia.current,nn(t))df(t);else{var d=Rs($a.current);switch(r){case 1:r=d.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=d.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=d.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=d.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof n.is=="string"?d.createElement("select",{is:n.is}):d.createElement("select"),n.multiple?r.multiple=!0:n.size&&(r.size=n.size);break;default:r=typeof n.is=="string"?d.createElement(s,{is:n.is}):d.createElement(s)}}r[ut]=t,r[St]=n;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)r.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=r;e:switch(ht(r,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&&za(t)}}return Ve(t),t.subtreeFlags&=-33554433,ho(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&za(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=$a.current,nn(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,s=st,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[ut]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||_m(e.nodeValue,a)),e||Za(t,!0)}else e=Rs(e).createTextNode(n),e[ut]=t,t.stateNode=e}return Ve(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=nn(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[ut]=t}else Sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),e=!1}else a=Ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(zt(t),t):(zt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Ve(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=nn(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[ut]=t}else Sl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),s=!1}else s=Ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(zt(t),t):(zt(t),null)}return zt(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),r=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(r=n.memoizedState.cachePool.pool),r!==s&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Xr(t,t.updateQueue),Ve(t),null);case 4:return Yl(),e===null&&Io(t.stateNode.containerInfo),t.flags|=67108864,Ve(t),null;case 10:return Oa(t.type),Ve(t),null;case 19:if(Bc(t),n=t.memoizedState,n===null)return Ve(t),null;if(s=(t.flags&128)!==0,r=n.rendering,r===null)if(s)ps(n,!1);else{if(Ie!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Mr(e),r!==null){for(t.flags|=128,ps(n,!1),e=r.updateQueue,t.updateQueue=e,Xr(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)sf(a,e),a=a.sibling;return fs(t,mt.current&1|2),ve&&Ra(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&At()>ni&&(t.flags|=128,s=!0,ps(n,!1),t.lanes=4194304)}else{if(!s)if(e=Mr(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,Xr(t,e),ps(n,!0),n.tail===null&&n.tailMode!=="collapsed"&&n.tailMode!=="visible"&&!r.alternate&&!ve)return Ve(t),null}else 2*At()-n.renderingStartTime>ni&&a!==536870912&&(t.flags|=128,s=!0,ps(n,!1),t.lanes=4194304);n.isBackwards?(r.sibling=t.child,t.child=r):(e=n.last,e!==null?e.sibling=r:t.child=r,n.last=r)}if(n.tail!==null){e=n.tail;e:{for(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return n.rendering=e,n.tail=e.sibling,n.renderingStartTime=At(),e.sibling=null,r=mt.current,r=s?r&1|2:r&1,n.tailMode==="visible"||n.tailMode==="collapsed"||!a||ve?fs(t,r):(a=r,qe(ft,t),qe(mt,a),pt===null&&(pt=t)),ve&&Ra(t,n.treeForkCount),e}return Ve(t),null;case 22:case 23:return zt(t),Uc(),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&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),a=t.updateQueue,a!==null&&Xr(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&&ot(Rl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Oa(Pe),Ve(t),null;case 25:return null;case 30:return t.flags|=33554432,Ve(t),null}throw Error(c(156,t.tag))}function Sp(e,t){switch(Sc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oa(Pe),Yl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Fs(t),null;case 31:if(t.memoizedState!==null){if(zt(t),t.alternate===null)throw Error(c(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Sl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bc(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Yl(),null;case 10:return Oa(t.type),null;case 22:case 23:return zt(t),Uc(),e!==null&&ot(Rl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Oa(Pe),null;case 25:return null;default:return null}}function z0(e,t){switch(Sc(t),t.tag){case 3:Oa(Pe),Yl();break;case 26:case 27:case 5:Fs(t);break;case 4:Yl();break;case 31:t.memoizedState!==null&&zt(t);break;case 13:zt(t);break;case 19:Bc(t);break;case 10:Oa(t.type);break;case 22:case 23:zt(t),Uc(),e!==null&&ot(Rl);break;case 24:Oa(Pe)}}function ys(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 r=a.create,d=a.inst;n=r(),d.destroy=n}a=a.next}while(a!==s)}}catch(g){ke(t,t.return,g)}}function al(e,t,a){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){var d=n.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,s=t;var E=a,z=g;try{z()}catch($){ke(s,E,$)}}}n=n.next}while(n!==r)}}catch($){ke(t,t.return,$)}}function L0(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{wf(t,a)}catch(n){ke(e,e.return,n)}}}function k0(e,t,a){a.props=Dl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){ke(e,t,n)}}function da(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:var s=e.stateNode,r=Ea(e.memoizedProps,s);(s.ref===null||s.ref.name!==r)&&(s.ref=Vm(r)),n=s.ref;break;case 7:if(e.stateNode===null){var d=new Bt(e);h(e.child,!1,my,d,void 0,void 0),e.stateNode=d}n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(g){ke(e,t,g)}}function xt(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(s){ke(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){ke(e,t,s)}else a.current=null}function Zr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a<t.length;a++)Jm(e.stateNode,t[a])}function U0(e){for(var t=e.return;t!==null&&(po(t)&&Jm(e.stateNode,t.stateNode),!go(t));)t=t.return}function vs(e){for(var t=e.return;t!==null&&(po(t)&&xy(e.stateNode,t.stateNode),!go(t));)t=t.return}function go(e){return e.tag===5||e.tag===3||e.tag===27}function po(e){return e&&e.tag===7&&e.stateNode!==null}function yo(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(s){ke(e,e.return,s)}}function vo(e,t,a){try{var n=e.stateNode;Jp(n,e.type,a,t),n[St]=t}catch(s){ke(e,e.return,s)}}function H0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ol(e.type)||e.tag===4}function jo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||H0(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&&ol(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 bo(e,t,a,n){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(s,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(s),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=ca)),Zr(e,n),Ae=!0;else if(s!==4&&(s===27&&(Zr(e,n),n=null,ol(e.type)&&(a=e.stateNode,t=null)),e=e.child,e!==null))for(bo(e,t,a,n),e=e.sibling;e!==null;)bo(e,t,a,n),e=e.sibling}function Kr(e,t,a,n){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?a.insertBefore(s,t):a.appendChild(s),Zr(e,n),Ae=!0;else if(s!==4&&(s===27&&(Zr(e,n),n=null,ol(e.type)&&(a=e.stateNode)),e=e.child,e!==null))for(Kr(e,t,a,n),e=e.sibling;e!==null;)Kr(e,t,a,n),e=e.sibling}function B0(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ht(t,n,a),t[ut]=e,t[St]=a}catch(r){ke(e,e.return,r)}}var Jr=!1,Lt=null;function $0(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Jr=!0)}var fa=null;function q0(){var e=fa;return fa=null,e}var Et=0;function mn(e,t,a,n,s){return Et=0,Y0(e.child,t,a,n,s)}function Y0(e,t,a,n,s){for(var r=!1;e!==null;){if(e.tag===5){var d=e.stateNode;if(n!==null){var g=nu(d);n.push(g),g.view&&(r=!0)}else r||nu(d).view&&(r=!0);Jr=!0,qm(d,Et===0?t:t+"_"+Et,a),Et++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&s||Y0(e.child,t,a,n,s)&&(r=!0));e=e.sibling}return r}function ma(e,t){for(;e!==null;)e.tag===5?Ym(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ma(e.child,t)),e=e.sibling}function Ir(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ir(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(c(544));var a=t.name;t=Ta(t.default,t.share),t!=="none"&&(mn(e,a,t,null,!1)||ma(e.child,!1))}e=e.sibling}}function No(e,t){if(e.tag===30){var a=e.stateNode,n=e.memoizedProps,s=Ea(n,a),r=Ta(n.default,a.paired?n.share:n.enter);r!=="none"?mn(e,s,r,null,!1)?(Ir(e),a.paired||t||bn(e,n.onEnter)):ma(e.child,!1):Ir(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)No(e,t),e=e.sibling;else Ir(e)}function So(e){if(Lt!==null&&Lt.size!==0){var t=Lt;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var a=e.memoizedProps,n=a.name;if(n!=null&&n!=="auto"){var s=t.get(n);if(s!==void 0){var r=Ta(a.default,a.share);if(r!=="none"&&(mn(e,n,r,null,!1)?(r=e.stateNode,s.paired=r,r.paired=s,bn(e,a.onShare)):ma(e.child,!1)),t.delete(n),t.size===0)break}}}So(e)}e=e.sibling}}}function wo(e){if(e.tag===30){var t=e.memoizedProps,a=Ea(t,e.stateNode),n=Lt!==null?Lt.get(a):void 0,s=Ta(t.default,n!==void 0?t.share:t.exit);s!=="none"&&(mn(e,a,s,null,!1)?n!==void 0?(s=e.stateNode,n.paired=s,s.paired=n,Lt.delete(a),bn(e,t.onShare)):bn(e,t.onExit):ma(e.child,!1)),Lt!==null&&So(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)wo(e),e=e.sibling;else Lt!==null&&So(e)}function V0(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,a=Ea(t,e.stateNode);t=Ta(t.default,t.update),e.flags&=-5,t!=="none"&&mn(e,a,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&V0(e);e=e.sibling}}function Eo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,ma(e.child,!1))}Eo(e)}e=e.sibling}}function Fr(e){if(e.tag===30)e.stateNode.paired=null,ma(e.child,!1),Eo(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Fr(e),e=e.sibling;else Eo(e)}function G0(e){for(e=e.child;e!==null;)e.tag===30?ma(e.child,!1):(e.subtreeFlags&33554432)!==0&&G0(e),e=e.sibling}function To(e,t,a,n,s,r,d){for(var g=!1;t!==null;){if(t.tag===5){var E=t.stateNode;if(r!==null&&Et<r.length){var z=r[Et],$=nu(E);(z.view||$.view)&&(g=!0);var Y;if(Y=(e.flags&4)===0)if($.clip)Y=!0;else{Y=z.rect;var M=$.rect;Y=Y.y!==M.y||Y.x!==M.x||Y.height!==M.height||Y.width!==M.width}Y&&(e.flags|=4),$.abs?$=!z.abs:(z=z.rect,$=$.rect,$=z.height!==$.height||z.width!==$.width),$&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&qm(E,Et===0?a:a+"_"+Et,s),g&&(e.flags&4)!==0||(fa===null&&(fa=[]),fa.push(E,Et===0?n:n+"_"+Et,t.memoizedProps)),Et++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&d?e.flags|=t.flags&32:To(e,t.child,a,n,s,r,d)&&(g=!0));t=t.sibling}return g}function Q0(e,t){for(e=e.child;e!==null;){if(e.tag===30){var a=e.memoizedProps,n=e.stateNode,s=Ea(a,n),r=Ta(a.default,a.update),d;d=e.memoizedState,e.memoizedState=null,n=e;var g=e.child;Et=0,s=To(n,g,s,s,r,d,!1),(e.flags&4)!==0&&s&&bn(e,a.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Q0(e);e=e.sibling}}var rt=!1,_e=!1,xa=!1,Co=!1,X0=typeof WeakSet=="function"?WeakSet:Set,it=null,ha=!1,js=!1,Pr=!1,Ro=!1;function wp(e,t,a){if(e=e.containerInfo,Wo=Mn,e=Jd(e),mc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,d=s.focusNode;s=s.focusOffset;try{n.nodeType,d.nodeType}catch{n=null;break e}var g=0,E=-1,z=-1,$=0,Y=0,M=e,H=null;t:for(;;){for(var te;M!==n||r!==0&&M.nodeType!==3||(E=g+r),M!==d||s!==0&&M.nodeType!==3||(z=g+s),M.nodeType===3&&(g+=M.nodeValue.length),(te=M.firstChild)!==null;)H=M,M=te;for(;;){if(M===e)break t;if(H===n&&++$===r&&(E=g),H===d&&++Y===s&&(z=g),(te=M.nextSibling)!==null)break;M=H,H=M.parentNode}M=te}n=E===-1||z===-1?null:{start:E,end:z}}else n=null}n=n||{start:0,end:0}}else n=null;for(eu={focusedElem:e,selectionRange:n},Mn=!1,a=(a&335544064)===a,it=t,t=a?9270:1024;it!==null;){if(e=it,a&&(n=e.deletions,n!==null))for(r=0;r<n.length;r++)a&&wo(n[r]);if(e.alternate===null&&(e.flags&2)!==0)a&&$0(e),Wr(a);else{if(e.tag===22){if(n=e.alternate,e.memoizedState!==null){n!==null&&n.memoizedState===null&&a&&wo(n),Wr(a);continue}else if(n!==null&&n.memoizedState!==null){a&&$0(e),Wr(a);continue}}n=e.child,(e.subtreeFlags&t)!==0&&n!==null?(n.return=e,it=n):(a&&V0(e),Wr(a))}}Lt=null}function Wr(e){for(;it!==null;){var t=it,a=e,n=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((s&1024)!==0&&n!==null){a=void 0,s=n.memoizedProps,n=n.memoizedState;var r=t.stateNode;try{var d=Dl(t.type,s);a=r.getSnapshotBeforeUpdate(d,n),r.__reactInternalSnapshotBeforeUpdate=a}catch(g){ke(t,t.return,g)}}break;case 3:if((s&1024)!==0){if(n=t.stateNode.containerInfo,a=n.nodeType,a===9)iu(n);else if(a===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":iu(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&n!==null&&(a=Ea(n.memoizedProps,n.stateNode),s=t.memoizedProps,s=Ta(s.default,s.update),s!=="none"&&mn(n,a,s,n.memoizedState=[],!0));break;default:if((s&1024)!==0)throw Error(c(163))}if(n=t.sibling,n!==null){n.return=t.return,it=n;break}it=t.return}}function Z0(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:ga(e,a),n&4&&ys(5,a);break;case 1:if(ga(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){ke(a,a.return,d)}else{var s=Dl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){ke(a,a.return,d)}}n&64&&L0(a),n&512&&da(a,a.return);break;case 3:if(ga(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{wf(e,t)}catch(d){ke(a,a.return,d)}}break;case 27:t===null&&n&4&&B0(a);case 26:case 5:ga(e,a),t===null&&n&4&&yo(a),n&512&&da(a,a.return);break;case 12:ga(e,a);break;case 31:ga(e,a),n&4&&F0(e,a);break;case 13:ga(e,a),n&4&&P0(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=kp.bind(null,a),py(e,a))));break;case 22:if(n=a.memoizedState!==null||rt,!n){var r=t!==null&&t.memoizedState!==null||_e;t=rt,s=_e,rt=n,(_e=r)&&!s?(n=2,(a.subtreeFlags&8772)!==0&&(n|=1),Wt(e,a,n)):ga(e,a),rt=t,_e=s}break;case 30:ga(e,a),n&512&&da(a,a.return);break;case 7:n&512&&da(a,a.return);default:ga(e,a)}}function Ao(e,t){for(e=e.child;e!==null;)K0(e,t),e=e.sibling}function K0(e,t){switch(e.tag){case 5:case 26:try{var a=e.stateNode;if(t){var n=a.style;typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"}else{var s=e.stateNode,r=e.memoizedProps.style,d=r!=null&&r.hasOwnProperty("display")?r.display:null;s.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(E){ke(e,e.return,E)}Oo(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ae=!0}catch(E){ke(e,e.return,E)}break;case 18:try{var g=e.stateNode;t?$m(g,!0):$m(e.stateNode,!1)}catch(E){ke(e,e.return,E)}break;case 22:case 23:e.memoizedState===null&&Ao(e,t);break;default:Ao(e,t)}}function Oo(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var a=e,n=t;switch(a.tag){case 4:K0(a,n);break e;case 22:a.memoizedState===null&&Oo(a,n);break e;default:Oo(a,n)}}e=e.sibling}}function J0(e){var t=e.alternate;t!==null&&(e.alternate=null,J0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&nr(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 Ge=null,Tt=!1;function Ft(e,t,a){for(a=a.child;a!==null;)I0(e,t,a),a=a.sibling}function I0(e,t,a){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(Vn,a)}catch{}switch(a.tag){case 26:_e||xt(a,t),Ft(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!_e&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:_e||xt(a,t),vs(a);var n=Ge,s=Tt;ol(a.type)&&(Ge=a.stateNode,Tt=!1),Ft(e,t,a),ex(a.stateNode,a.type,a.memoizedProps),Ge=n,Tt=s;break;case 5:_e||xt(a,t),vs(a);case 6:if(a.tag===6&&vs(a),n=Ge,s=Tt,Ge=null,Ft(e,t,a),Ge=n,Tt=s,Ge!==null)if(Tt)try{(Ge.nodeType===9?Ge.body:Ge.nodeName==="HTML"?Ge.ownerDocument.body:Ge).removeChild(a.stateNode),Ae=!0}catch(r){ke(a,t,r)}else try{Ge.removeChild(a.stateNode),Ae=!0}catch(r){ke(a,t,r)}break;case 18:Ge!==null&&(Tt?(e=Ge,Bm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),_n(e)):Bm(Ge,a.stateNode));break;case 4:n=Ge,s=Tt,Ge=a.stateNode.containerInfo,Tt=!0,Ft(e,t,a),Ge=n,Tt=s;break;case 0:case 11:case 14:case 15:al(2,a,t),_e||al(4,a,t),Ft(e,t,a);break;case 1:_e||(xt(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&k0(a,t,n)),Ft(e,t,a);break;case 21:Ft(e,t,a);break;case 22:_e=(n=_e)||a.memoizedState!==null,Ft(e,t,a),_e=n;break;case 30:xt(a,t),Ft(e,t,a);break;case 7:_e||xt(a,t),Ft(e,t,a);break;default:Ft(e,t,a)}}function F0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{_n(e)}catch(a){ke(t,t.return,a)}}}function P0(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{_n(e)}catch(a){ke(t,t.return,a)}}function Ep(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new X0),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new X0),t;default:throw Error(c(435,e.tag))}}function ei(e,t){var a=Ep(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var s=Up.bind(null,e,n);n.then(s,s)}})}function jt(e,t,a){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],d=e,g=t,E=g;e:for(;E!==null;){switch(E.tag){case 27:if(ol(E.type)){Ge=E.stateNode,Tt=!1;break e}break;case 5:Ge=E.stateNode,Tt=!1;break e;case 3:case 4:Ge=E.stateNode.containerInfo,Tt=!0;break e}E=E.return}if(Ge===null)throw Error(c(160));I0(d,g,r),Ge=null,Tt=!1,d=r.alternate,d!==null&&(d.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)W0(t,e,a),t=t.sibling}var Pt=null;function W0(e,t,a){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(s&4&&(n=e.updateQueue,n=n!==null?n.events:null,n!==null))for(var r=0;r<n.length;r++){var d=n[r];d.ref.impl=d.nextImpl}jt(t,e,a),bt(e),s&4&&(al(3,e,e.return),ys(3,e),al(5,e,e.return));break;case 1:jt(t,e,a),bt(e),s&512&&(_e||n===null||xt(n,n.return)),s&64&&rt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(r=Pt,jt(t,e,a),bt(e),s&512&&(_e||n===null||xt(n,n.return)),s&4)if(s=n!==null?n.memoizedState:null,a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null)if(rt)e.stateNode=km(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,a=e.memoizedProps,s=r.ownerDocument||r;t:switch(t){case"title":n=s.getElementsByTagName("title")[0],(!n||n[Xn]||n[ut]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=s.createElement(t),s.head.insertBefore(n,s.querySelector("head > title"))),ht(n,t,a),n[ut]=e,nt(n),t=n;break e;case"link":if(r=rx("link","href",s).get(t+(a.href||""))){for(d=0;d<r.length;d++)if(n=r[d],n.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&n.getAttribute("rel")===(a.rel==null?null:a.rel)&&n.getAttribute("title")===(a.title==null?null:a.title)&&n.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){r.splice(d,1);break t}}n=s.createElement(t),ht(n,t,a),s.head.appendChild(n);break;case"meta":if(r=rx("meta","content",s).get(t+(a.content||""))){for(d=0;d<r.length;d++)if(n=r[d],n.getAttribute("content")===(a.content==null?null:""+a.content)&&n.getAttribute("name")===(a.name==null?null:a.name)&&n.getAttribute("property")===(a.property==null?null:a.property)&&n.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&n.getAttribute("charset")===(a.charSet==null?null:a.charSet)){r.splice(d,1);break t}}n=s.createElement(t),ht(n,t,a),s.head.appendChild(n);break;default:throw Error(c(468,t))}n[ut]=e,nt(n),t=n}e.stateNode=t}else rt||xu(r,e.type,e.stateNode);else e.stateNode=sx(r,a,e.memoizedProps);else s!==a?(s===null?(t=n.stateNode,t===null||_e||t.parentNode.removeChild(t)):s.count--,a===null?rt||xu(r,e.type,e.stateNode):sx(r,a,e.memoizedProps)):a===null&&e.stateNode!==null&&vo(e,e.memoizedProps,n.memoizedProps);break;case 27:jt(t,e,a),bt(e),s&512&&(_e||n===null||xt(n,n.return)),n!==null&&s&4&&vo(e,e.memoizedProps,n.memoizedProps);break;case 5:if(r=xa,xa=!1,jt(t,e,a),xa=r,bt(e),s&512&&(_e||n===null||xt(n,n.return)),e.flags&32){t=e.stateNode;try{Kl(t,""),Ae=!0}catch($){ke(e,e.return,$)}}s&4&&e.stateNode!=null&&(t=e.memoizedProps,vo(e,t,n!==null?n.memoizedProps:t)),s&1024&&(Co=!0);break;case 6:if(jt(t,e,a),bt(e),s&4){if(e.stateNode===null)throw Error(c(162));t=e.memoizedProps,a=e.stateNode;try{a.nodeValue=t,Ae=!0}catch($){ke(e,e.return,$)}}break;case 3:if(Ae=!1,hi=null,r=Pt,Pt=As(t.containerInfo),jt(t,e,a),Pt=r,bt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{_n(t.containerInfo)}catch($){ke(e,e.return,$)}Co&&(Co=!1,em(e)),Ae=!1;break;case 4:s=xa,xa=rt,n=vd(),r=Pt,Pt=As(e.stateNode.containerInfo),jt(t,e,a),bt(e),Pt=r,Ae&&js&&(Pr=!0),Ae=n,xa=s;break;case 12:jt(t,e,a),bt(e);break;case 31:jt(t,e,a),bt(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ei(e,t)));break;case 13:jt(t,e,a),bt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(li=At()),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ei(e,t)));break;case 22:r=e.memoizedState!==null,d=n!==null&&n.memoizedState!==null;var g=rt,E=_e,z=xa;rt=g||r,xa=z||r,_e=E||d,jt(t,e,a),_e=E,xa=z,rt=g,bt(e),s&8192&&(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,!r||n===null||d||rt||_e||(t=d||_e,a=rt,n=_e,rt=r||rt,_e=t,ll(e,2),rt=a,_e=n),!r&&xa||Ao(e,r)),s&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,ei(e,a))));break;case 19:jt(t,e,a),bt(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ei(e,t)));break;case 30:s&512&&(_e||n===null||xt(n,n.return)),s=vd(),r=js,d=(a&335544064)===a,g=e.memoizedProps,js=d&&Ta(g.default,g.update)!=="none",jt(t,e,a),bt(e),d&&n!==null&&Ae&&(e.flags|=4),js=r,Ae=s;break;case 21:break;case 7:s&512&&(_e||n===null||xt(n,n.return)),n&&n.stateNode!==null&&(n.stateNode._fragmentFiber=e);default:jt(t,e,a),bt(e)}}function bt(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(H0(n)){a=n;break}n=n.return}n=null;for(var s=e.return;s!==null;){if(po(s)){var r=s.stateNode;n===null?n=[r]:n.push(r)}if(go(s))break;s=s.return}var d=n;if(a==null)throw Error(c(160));switch(a.tag){case 27:var g=a.stateNode,E=jo(e);Kr(e,E,g,d);break;case 5:var z=a.stateNode;a.flags&32&&(Kl(z,""),a.flags&=-33);var $=jo(e);Kr(e,$,z,d);break;case 3:case 4:var Y=a.stateNode.containerInfo,M=jo(e);bo(e,M,Y,d);break;default:throw Error(c(161))}}catch(H){ke(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function em(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;em(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Mn=!0,t.reset(),Mn=!1),e=e.sibling}}function xn(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)tm(t,e),t=t.sibling;else Q0(t)}function tm(e,t){var a=e.alternate;if(a===null)No(e,!1);else switch(e.tag){case 3:if(Ro=ha=!1,q0(),xn(t,e),!ha&&!Pr){if(e=fa,e!==null)for(var n=0;n<e.length;n+=3){a=e[n];var s=e[n+1];Ym(a,e[n+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+s+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),Ro=!0}fa=null;break;case 5:xn(t,e);break;case 4:n=ha,ha=!1,xn(t,e),ha&&(Pr=!0),ha=n;break;case 22:e.memoizedState===null&&(a.memoizedState!==null?No(e,!1):xn(t,e));break;case 30:n=ha,s=q0(),ha=!1,xn(t,e),ha&&(e.flags|=4);var r=e.memoizedProps,d=e.stateNode;t=Ea(r,d),d=Ea(a.memoizedProps,d);var g=Ta(r.default,r.update);g==="none"?t=!1:(r=a.memoizedState,a.memoizedState=null,a=e.child,Et=0,t=To(e,a,t,d,g,r,!0),Et!==(r===null?0:r.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(bn(e,e.memoizedProps.onUpdate),fa=s):s!==null&&(s.push.apply(s,fa),fa=s),ha=(e.flags&32)!==0?!0:n;break;default:xn(t,e)}}function ga(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Z0(e,t.alternate,t),t=t.sibling}function ll(e,t){for(e=e.child;e!==null;){var a=e,n=t;switch(a.tag){case 0:case 11:case 14:case 15:al(4,a,a.return),ll(a,n);break;case 1:xt(a,a.return);var s=a.stateNode;typeof s.componentWillUnmount=="function"&&k0(a,a.return,s),ll(a,n);break;case 27:(n&2)!==0&&ex(a.stateNode,a.type,a.memoizedProps);case 5:xt(a,a.return),a.tag!==5&&a.tag!==27||vs(a),ll(a,n);break;case 6:vs(a);break;case 26:xt(a,a.return),s=a.stateNode,a.memoizedState!==null||s===null||_e||s.parentNode.removeChild(s),ll(a,n);break;case 22:a.memoizedState===null&&ll(a,n);break;case 30:xt(a,a.return),ll(a,n);break;case 7:xt(a,a.return);default:ll(a,n)}e=e.sibling}}function Wt(e,t,a){for(a=(t.subtreeFlags&8772)!==0?a:a&-2,t=t.child;t!==null;){var n=t.alternate,s=e,r=t,d=r.flags,g=(a&1)!==0;switch(r.tag){case 0:case 11:case 15:Wt(s,r,a),ys(4,r);break;case 1:if(Wt(s,r,a),n=r,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch($){ke(n,n.return,$)}if(n=r,s=n.updateQueue,s!==null){var E=n.stateNode;try{var z=s.shared.hiddenCallbacks;if(z!==null)for(s.shared.hiddenCallbacks=null,s=0;s<z.length;s++)Sf(z[s],E)}catch($){ke(n,n.return,$)}}g&&d&64&&L0(r),da(r,r.return);break;case 27:(a&2)!==0&&B0(r);case 5:r.tag!==5&&r.tag!==27||U0(r),Wt(s,r,a),g&&n===null&&d&4&&yo(r),da(r,r.return);break;case 6:U0(r);break;case 26:E=r.stateNode,r.memoizedState!==null||E===null||rt||xu(As(E.ownerDocument),r.type,E),Wt(s,r,a),g&&n===null&&d&4&&yo(r),da(r,r.return);break;case 12:Wt(s,r,a);break;case 31:Wt(s,r,a),g&&d&4&&F0(s,r);break;case 13:Wt(s,r,a),g&&d&4&&P0(s,r);break;case 22:r.memoizedState===null&&Wt(s,r,a),da(r,r.return);break;case 30:Wt(s,r,a),da(r,r.return);break;case 7:da(r,r.return);default:Wt(s,r,a)}t=t.sibling}}function Mo(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&&ss(a))}function _o(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ss(e))}function Xt(e,t,a,n){var s=(a&335544064)===a;if(t.subtreeFlags&(s?10262:10256))for(t=t.child;t!==null;)am(e,t,a,n),t=t.sibling;else s&&G0(t)}function am(e,t,a,n){var s=(a&335544064)===a;s&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Fr(t);var r=t.flags;switch(t.tag){case 0:case 11:case 15:Xt(e,t,a,n),r&2048&&ys(9,t);break;case 1:Xt(e,t,a,n);break;case 3:Xt(e,t,a,n),s&&Ro&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),r&2048&&(r=null,t.alternate!==null&&(r=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==r&&(t.refCount++,r!=null&&ss(r)));break;case 12:if(r&2048){Xt(e,t,a,n),r=t.stateNode;try{var d=t.memoizedProps,g=d.id,E=d.onPostCommit;typeof E=="function"&&E(g,t.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(z){ke(t,t.return,z)}}else Xt(e,t,a,n);break;case 31:Xt(e,t,a,n);break;case 13:Xt(e,t,a,n);break;case 23:break;case 22:d=t.stateNode,g=t.alternate,t.memoizedState!==null?(s&&g!==null&&g.memoizedState===null&&Fr(g),d._visibility&2?Xt(e,t,a,n):bs(e,t)):(s&&g!==null&&g.memoizedState!==null&&Fr(t),d._visibility&2?Xt(e,t,a,n):(d._visibility|=2,hn(e,t,a,n,(t.subtreeFlags&10256)!==0||!1))),r&2048&&Mo(g,t);break;case 24:Xt(e,t,a,n),r&2048&&_o(t.alternate,t);break;case 30:s&&(r=t.alternate,r!==null&&(ma(r.child,!0),ma(t.child,!0))),Xt(e,t,a,n);break;default:Xt(e,t,a,n)}}function hn(e,t,a,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,d=t,g=a,E=n,z=d.flags;switch(d.tag){case 0:case 11:case 15:hn(r,d,g,E,s),ys(8,d);break;case 23:break;case 22:var $=d.stateNode;d.memoizedState!==null?$._visibility&2?hn(r,d,g,E,s):bs(r,d):($._visibility|=2,hn(r,d,g,E,s)),s&&z&2048&&Mo(d.alternate,d);break;case 24:hn(r,d,g,E,s),s&&z&2048&&_o(d.alternate,d);break;default:hn(r,d,g,E,s)}t=t.sibling}}function bs(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:bs(a,n),s&2048&&Mo(n.alternate,n);break;case 24:bs(a,n),s&2048&&_o(n.alternate,n);break;default:bs(a,n)}t=t.sibling}}var zl=8192;function Ll(e,t,a){if(e.subtreeFlags&zl)for(e=e.child;e!==null;)lm(e,t,a),e=e.sibling}function lm(e,t,a){switch(e.tag){case 26:Ll(e,t,a),e.flags&zl&&(e.memoizedState!==null?My(a,Pt,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&ux(a,e)));break;case 5:Ll(e,t,a),e.flags&zl&&(e=e.stateNode,(t&335544128)===t&&ux(a,e));break;case 3:case 4:var n=Pt;Pt=As(e.stateNode.containerInfo),Ll(e,t,a),Pt=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=zl,zl=16777216,Ll(e,t,a),zl=n):Ll(e,t,a));break;case 30:if((e.flags&zl)!==0&&(n=e.memoizedProps.name,n!=null&&n!=="auto")){var s=e.stateNode;s.paired=null,Lt===null&&(Lt=new Map),Lt.set(n,s)}Ll(e,t,a);break;default:Ll(e,t,a)}}function nm(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 Ns(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];it=n,rm(n,e)}nm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)sm(e),e=e.sibling}function sm(e){switch(e.tag){case 0:case 11:case 15:Ns(e),e.flags&2048&&al(9,e,e.return);break;case 3:Ns(e);break;case 12:Ns(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ti(e)):Ns(e);break;default:Ns(e)}}function ti(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];it=n,rm(n,e)}nm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:al(8,t,t.return),ti(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,ti(t));break;default:ti(t)}e=e.sibling}}function rm(e,t){for(;it!==null;){var a=it;switch(a.tag){case 0:case 11:case 15:al(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:ss(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,it=n;else e:for(a=e;it!==null;){n=it;var s=n.sibling,r=n.return;if(J0(n),n===a){it=null;break e}if(s!==null){s.return=r,it=s;break e}it=r}}}var Tp={getCacheForType:function(e){var t=dt(Pe),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return dt(Pe).controller.signal}},Cp=typeof WeakMap=="function"?WeakMap:Map,Me=0,Be=null,be=null,we=0,Le=0,kt=null,nl=!1,gn=!1,Do=!1,La=0,Ie=0,sl=0,kl=0,ai=0,Ut=0,pn=0,Ss=null,Ct=null,zo=!1,li=0,im=0,ni=1/0,si=null,rl=null,Xe=0,ea=null,Ul=null,pa=0,Lo=0,ko=null,cm=null,yn=null,vn=null,jn=null,ws=0,ri=null;function Ht(){return(Me&2)!==0&&we!==0?we&-we:oe.T!==null?Xo():ud()}function om(){if(Ut===0)if((we&536870912)===0||ve){var e=er;er<<=1,(er&3932160)===0&&(er=262144),Ut=e}else Ut=536870912;return e=ft.current,e!==null&&(e.flags|=32),Ut}function bn(e,t){if(t!=null){var a=e.stateNode,n=a.ref;n===null&&(n=a.ref=Vm(Ea(e.memoizedProps,a))),vn===null&&(vn=[]),vn.push(t.bind(null,n))}}function Rt(e,t,a){(e===Be&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(Nn(e,0),il(e,we,Ut,!1)),Qn(e,a),((Me&2)===0||e!==Be)&&(e===Be&&((Me&2)===0&&(kl|=a),Ie===4&&il(e,we,Ut,!1)),ya(e))}function um(e,t,a){if((Me&6)!==0)throw Error(c(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Gn(e,t),s=n?Op(e,t):Ho(e,t,!0),r=n;do{if(s===0){gn&&!n&&il(e,t,0,!1);break}else{if(a=e.current.alternate,r&&!Rp(a)){s=Ho(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var g=e;s=Ss;var E=g.current.memoizedState.isDehydrated;if(E&&(Nn(g,d).flags|=256),d=Ho(g,d,!1),d!==2&&d!==6){if(Do&&!E){g.errorRecoveryDisabledLanes|=r,kl|=r,s=4;break e}r=Ct,Ct=s,r!==null&&(Ct===null?Ct=r:Ct.push.apply(Ct,r))}s=d}if(r=!1,s!==2)continue}}if(s===1){Nn(e,0),il(e,t,0,!0);break}e:{switch(n=e,r=s,r){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:il(n,t,Ut,!nl);break e;case 2:Ct=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(s=li+300-At(),10<s)){if(il(n,t,Ut,!nl),ar(n,0,!0)!==0)break e;pa=t,n.timeoutHandle=lu(dm.bind(null,n,a,Ct,si,zo,t,Ut,kl,pn,nl,r,"Throttled",-0,0),s);break e}dm(n,a,Ct,si,zo,t,Ut,kl,pn,nl,r,null,-0,0)}}break}while(!0);ya(e)}function dm(e,t,a,n,s,r,d,g,E,z,$,Y,M,H){e.timeoutHandle=-1;var te=t.subtreeFlags,ie=(r&335544064)===r;if(Y=null,(ie||te&8192||(te&16785408)===16785408)&&(Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ca},Lt=null,lm(t,r,Y),ie&&(te=Y,ie=e.containerInfo,ie=(ie.nodeType===9?ie:ie.ownerDocument).__reactViewTransition,ie!=null&&(te.count++,te.waitingForViewTransition=!0,te=_s.bind(te),ie.finished.then(te,te))),te=(r&62914560)===r?li-At():(r&4194048)===r?im-At():0,te=_y(Y,te),te!==null)){pa=r,e.cancelPendingCommit=te(vm.bind(null,e,t,r,a,n,s,d,g,E,z,$,Y,null,M,H)),il(e,r,d,!z);return}vm(e,t,r,a,n,s,d,g,E,z,$,Y)}function Rp(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],r=s.getSnapshot;s=s.value;try{if(!Dt(r(),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 il(e,t,a,n){t=sd(e,t),t&=~ai,t&=~kl,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var r=31-Mt(s),d=1<<r;n[r]=-1,s&=~d}a!==0&&id(e,a,t)}function ii(){return(Me&6)===0?(Es(0),!1):!0}function Uo(){if(be!==null){if(Le===0)var e=be.return;else e=be,Aa=wl=null,Gc(e),cn=null,cs=0,e=be;for(;e!==null;)z0(e.alternate,e),e=e.return;be=null}}function Nn(e,t){var a=e.timeoutHandle;return a!==-1&&(e.timeoutHandle=-1,Pp(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),pa=0,Uo(),Be=e,be=a=Ca(e.current,null),we=t,Le=0,kt=null,nl=!1,gn=Gn(e,t),Do=!1,pn=Ut=ai=kl=sl=Ie=0,Ct=Ss=null,zo=!1,La=sd(e,t),hr(),a}function fm(e,t){pe=null,oe.H=$r,t===rn||t===Tr?(t=vf(),Le=3):t===Mc?(t=vf(),Le=4):Le=t===so?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,kt=t,be===null&&(Ie=1,qr(e,Yt(t,e.current)))}function mm(){var e=ft.current;return e===null?!0:(we&4194048)===we?pt===null:(we&62914560)===we||(we&536870912)!==0?e===pt:!1}function xm(){var e=oe.H;return oe.H=$r,e===null?$r:e}function hm(){var e=oe.A;return oe.A=Tp,e}function ci(){Ie=4,nl||(we&4194048)!==we&&ft.current!==null||(gn=!0),(sl&134217727)===0&&(kl&134217727)===0||Be===null||il(Be,we,Ut,!1)}function Ho(e,t,a){var n=Me;Me|=2;var s=xm(),r=hm();(Be!==e||we!==t)&&(si=null,Nn(e,t)),t=!1;var d=Ie;e:do try{if(Le!==0&&be!==null){var g=be,E=kt;switch(Le){case 8:Uo(),d=6;break e;case 3:case 2:case 9:case 6:ft.current===null&&(t=!0);var z=Le;if(Le=0,kt=null,Sn(e,g,E,z),a&&gn){d=0;break e}break;default:z=Le,Le=0,kt=null,Sn(e,g,E,z)}}Ap(),d=Ie;break}catch($){fm(e,$)}while(!0);return t&&e.shellSuspendCounter++,Aa=wl=null,Me=n,oe.H=s,oe.A=r,be===null&&(Be=null,we=0,hr()),d}function Ap(){for(;be!==null;)gm(be)}function Op(e,t){var a=Me;Me|=2;var n=xm(),s=hm();Be!==e||we!==t?(si=null,ni=At()+500,Nn(e,t)):gn=Gn(e,t);e:do try{if(Le!==0&&be!==null){t=be;var r=kt;t:switch(Le){case 1:Le=0,kt=null,Sn(e,t,r,1);break;case 2:case 9:if(pf(r)){Le=0,kt=null,pm(t);break}t=function(){Le!==2&&Le!==9||Be!==e||(Le=7),ya(e)},r.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:pf(r)?(Le=0,kt=null,pm(t)):(Le=0,kt=null,Sn(e,t,r,7));break;case 5:var d=null;switch(be.tag){case 26:d=be.memoizedState;case 5:case 27:var g=be;if(d?cx(d):g.stateNode.complete){Le=0,kt=null;var E=g.sibling;if(E!==null)be=E;else{var z=g.return;z!==null?(be=z,oi(z)):be=null}break t}}Le=0,kt=null,Sn(e,t,r,5);break;case 6:Le=0,kt=null,Sn(e,t,r,6);break;case 8:Uo(),Ie=6;break e;default:throw Error(c(462))}}Mp();break}catch($){fm(e,$)}while(!0);return Aa=wl=null,oe.H=n,oe.A=s,Me=a,be!==null?0:(Be=null,we=0,hr(),Ie)}function Mp(){for(;be!==null&&!Kh();)gm(be)}function gm(e){var t=_0(e.alternate,e,La);e.memoizedProps=e.pendingProps,t===null?oi(e):be=t}function pm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=E0(a,t,t.pendingProps,t.type,void 0,we);break;case 11:t=E0(a,t,t.pendingProps,t.type.render,t.ref,we);break;case 5:Gc(t);var n=t;n===st&&(ve?(br(n),n.tag===5&&n.stateNode!=null&&(Ye=n.stateNode)):(br(n),ve=!0));default:z0(a,t),t=be=sf(t,La),t=_0(a,t,La)}e.memoizedProps=e.pendingProps,t===null?oi(e):be=t}function Sn(e,t,a,n){Aa=wl=null,Gc(t),cn=null,cs=0;var s=t.return;try{if(yp(e,s,t,a,we)){Ie=1,qr(e,Yt(a,e.current)),be=null;return}}catch(r){if(s!==null)throw be=s,r;Ie=1,qr(e,Yt(a,e.current)),be=null;return}t.flags&32768?(ve||n===1?e=!0:gn||(we&536870912)!==0?e=!1:(nl=e=!0,(n===2||n===9||n===3||n===6)&&(n=ft.current,n!==null&&n.tag===13&&(n.flags|=16384))),ym(t,e)):oi(t)}function oi(e){var t=e;do{if((t.flags&32768)!==0){ym(t,nl);return}e=t.return;var a=Np(t.alternate,t,La);if(a!==null){be=a;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);Ie===0&&(Ie=5)}function ym(e,t){do{var a=Sp(e.alternate,e);if(a!==null){a.flags&=32767,be=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){be=e;return}be=e=a}while(e!==null);Ie=6,be=null}function vm(e,t,a,n,s,r,d,g,E,z,$,Y){e.cancelPendingCommit=null;do ui();while(Xe!==0);if((Me&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));e===Be&&(be=Be=null,we=0),Ul=t,ea=e,pa=a,ko=s,cm=n,_p(e,t,a,d,g,E,Y)}}function _p(e,t,a,n,s,r,d){var g=t.lanes|t.childLanes;if(Lo=g,g|=yc,ng(e,a,g,n,s,r),vn=null,(a&335544064)===a?(jn=rp(e),n=10262):(jn=null,n=10256),(t.subtreeFlags&n)!==0||(t.flags&n)!==0?(e.callbackNode=null,e.callbackPriority=0,Hp(Ps,function(){return Yo(),null})):(e.callbackNode=null,e.callbackPriority=0),Jr=!1,n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=oe.T,oe.T=null,s=he.p,he.p=2,r=Me,Me|=4;try{wp(e,t,a)}finally{Me=r,he.p=s,oe.T=n}}Xe=1,Jr?yn=ny(d,e.containerInfo,jn,Bo,$o,zp,qo,Yo,Dp):(Bo(),$o(),qo())}function Dp(e){if(Xe!==0){var t=ea.onRecoverableError;t(e,{componentStack:null})}}function zp(){Xe===3&&(Xe=0,tm(Ul,ea),Xe=4)}function Bo(){if(Xe===1){Xe=0;var e=ea,t=Ul,a=pa,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=oe.T,oe.T=null;var s=he.p;he.p=2;var r=Me;Me|=4;try{js=Pr=!1,W0(t,e,a),a=eu;var d=Jd(e.containerInfo),g=a.focusedElem,E=a.selectionRange;if(d!==g&&g&&g.ownerDocument&&Kd(g.ownerDocument.documentElement,g)){if(E!==null&&mc(g)){var z=E.start,$=E.end;if($===void 0&&($=z),"selectionStart"in g)g.selectionStart=z,g.selectionEnd=Math.min($,g.value.length);else{var Y=g.ownerDocument||document,M=Y&&Y.defaultView||window;if(M.getSelection){var H=M.getSelection(),te=g.textContent.length,ie=Math.min(E.start,te),ye=E.end===void 0?ie:Math.min(E.end,te);!H.extend&&ie>ye&&(d=ye,ye=ie,ie=d);var D=Zd(g,ie),A=Zd(g,ye);if(D&&A&&(H.rangeCount!==1||H.anchorNode!==D.node||H.anchorOffset!==D.offset||H.focusNode!==A.node||H.focusOffset!==A.offset)){var L=Y.createRange();L.setStart(D.node,D.offset),H.removeAllRanges(),ie>ye?(H.addRange(L),H.extend(A.node,A.offset)):(L.setEnd(A.node,A.offset),H.addRange(L))}}}}for(Y=[],H=g;H=H.parentNode;)H.nodeType===1&&Y.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<Y.length;g++){var q=Y[g];q.element.scrollLeft=q.left,q.element.scrollTop=q.top}}Mn=!!Wo,eu=Wo=null}finally{Me=r,he.p=s,oe.T=n}}e.current=t,Xe=2}}function $o(){if(Xe===2){Xe=0;var e=ea,t=Ul,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=oe.T,oe.T=null;var n=he.p;he.p=2;var s=Me;Me|=4;try{Z0(e,t.alternate,t)}finally{Me=s,he.p=n,oe.T=a}}Xe=3}}function qo(){if(Xe===4||Xe===3){Xe=0;var e=yn;yn=null,Jh();var t=ea,a=Ul,n=pa,s=cm,r=(n&335544064)===n?10262:10256;if((a.subtreeFlags&r)!==0||(a.flags&r)!==0?Xe=5:(Xe=0,Ul=ea=null,jm(t,t.pendingLanes)),r=t.pendingLanes,r===0&&(rl=null),Ji(n),a=a.stateNode,Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(Vn,a,void 0,(a.current.flags&128)===128)}catch{}if(s!==null){a=oe.T,r=he.p,he.p=2,oe.T=null;try{for(var d=t.onRecoverableError,g=0;g<s.length;g++){var E=s[g];d(E.value,{componentStack:E.stack})}}finally{oe.T=a,he.p=r}}if(s=vn,d=jn,jn=null,s!==null&&(vn=null,d===null&&(d=[]),e!==null))for(E=0;E<s.length;E++)a=(0,s[E])(d),a!==void 0&&e.finished.finally(a);(pa&3)!==0&&ui(),ya(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===ri?ws++:(ws=0,ri=t):(ws=0,ri=null),Es(0)}}function jm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ss(t)))}function ui(){return yn!==null&&(yn.skipTransition(),yn=null),Bo(),$o(),qo(),Yo()}function Yo(){if(Xe!==5)return!1;var e=ea,t=Lo;Lo=0;var a=Ji(pa),n=oe.T,s=he.p;try{he.p=32>a?32:a,oe.T=null,a=ko,ko=null;var r=ea,d=pa;if(Xe=0,Ul=ea=null,pa=0,(Me&6)!==0)throw Error(c(331));var g=Me;if(Me|=4,sm(r.current),am(r,r.current,d,a),Me=g,Es(0,!1),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(Vn,r)}catch{}return!0}finally{he.p=s,oe.T=n,jm(e,t)}}function bm(e,t,a){t=Yt(a,t),t=no(e.stateNode,t,2),e=Pa(e,t,2),e!==null&&(Qn(e,2),ya(e))}function ke(e,t,a){if(e.tag===3)bm(e,e,a);else for(;t!==null;){if(t.tag===3){bm(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(rl===null||!rl.has(n))){e=Yt(a,e),a=p0(2),n=Pa(t,a,2),n!==null&&(y0(a,n,t,e),Qn(n,2),ya(n));break}}t=t.return}}function Vo(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Cp;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)||(Do=!0,s.add(a),e=Lp.bind(null,e,t,a),t.then(e,e))}function Lp(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Be===e&&(we&a)===a&&((Ie===4||Ie===3&&(we&62914560)===we&&300>At()-li)&&(Me&2)===0?Nn(e,0):ai|=a,pn===we&&(pn=0)),ya(e)}function Nm(e,t){t===0&&(t=rd()),e=bl(e,t),e!==null&&(Qn(e,t),ya(e))}function kp(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Nm(e,a)}function Up(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),Nm(e,a)}function Hp(e,t){return Qi(e,t)}var wn=null,En=null,Go=!1,di=!1,Qo=!1,cl=0;function ya(e){e!==En&&e.next===null&&(En===null?wn=En=e:En=En.next=e),di=!0,Go||(Go=!0,$p())}function Es(e,t){if(!Qo&&di){Qo=!0;do for(var a=!1,n=wn;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var r=0;else{var d=n.suspendedLanes,g=n.pingedLanes;r=(1<<31-Mt(42|e)+1)-1,r&=s&~(d&~g),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(a=!0,Tm(n,r))}else r=we,r=ar(n,n===Be?r:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(r&3)===0||Gn(n,r)||(a=!0,Tm(n,r));n=n.next}while(a);Qo=!1}}function Bp(){Sm()}function Sm(){di=Go=!1;var e=0;cl!==0&&Fp()&&(e=cl);for(var t=At(),a=null,n=wn;n!==null;){var s=n.next,r=wm(n,t);r===0?(n.next=null,a===null?wn=s:a.next=s,s===null&&(En=a)):(a=n,(e!==0||(r&3)!==0)&&(di=!0)),n=s}Xe!==0&&Xe!==5||Es(e),cl!==0&&(cl=0)}function wm(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var d=31-Mt(r),g=1<<d,E=s[d];E===-1?((g&a)===0||(g&n)!==0)&&(s[d]=lg(g,t)):E<=t&&(e.expiredLanes|=g),r&=~g}if(t=Be,a=we,a=ar(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Xi(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Gn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&Xi(n),Ji(a)){case 2:case 8:a=ld;break;case 32:a=Ps;break;case 268435456:a=nd;break;default:a=Ps}return n=Em.bind(null,e),a=Qi(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&Xi(n),e.callbackPriority=2,e.callbackNode=null,2}function Em(e,t){if(Xe!==0&&Xe!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(ui()&&e.callbackNode!==a)return null;var n=we;return n=ar(e,e===Be?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(um(e,n,t),wm(e,At()),e.callbackNode!=null&&e.callbackNode===a?Em.bind(null,e):null)}function Tm(e,t){if(ui())return null;um(e,t,!0)}function $p(){Wp(function(){(Me&6)!==0?Qi(ad,Bp):Sm()})}function Xo(){if(cl===0){var e=Cl;e===0&&(e=Ws,Ws<<=1,(Ws&261888)===0&&(Ws=256)),cl=e}return cl}function Cm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ir(e)}function qp(e,t,a,n,s){if(t==="submit"&&a&&a.stateNode===s){var r=Cm((s[St]||null).action),d=n.submitter;d&&(t=(t=d[St]||null)?Cm(t.formAction):d.getAttribute("formAction"),t!==null&&(r=t,d=null));var g=new dr("action","action",null,n,s);e.push({event:g,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(cl!==0){var E=new FormData(s,d);Wc(a,{pending:!0,data:E,method:s.method,action:r},null,E)}}else typeof r=="function"&&(g.preventDefault(),E=new FormData(s,d),Wc(a,{pending:!0,data:E,method:s.method,action:r},r,E))},currentTarget:s}]})}}for(var Zo=0;Zo<pc.length;Zo++){var Ko=pc[Zo],Yp=Ko.toLowerCase(),Vp=Ko[0].toUpperCase()+Ko.slice(1);It(Yp,"on"+Vp)}It(Pd,"onAnimationEnd"),It(Wd,"onAnimationIteration"),It(ef,"onAnimationStart"),It("dblclick","onDoubleClick"),It("focusin","onFocus"),It("focusout","onBlur"),It(Pg,"onTransitionRun"),It(Wg,"onTransitionStart"),It(ep,"onTransitionCancel"),It(tf,"onTransitionEnd"),Xl("onMouseEnter",["mouseout","mouseover"]),Xl("onMouseLeave",["mouseout","mouseover"]),Xl("onPointerEnter",["pointerout","pointerover"]),Xl("onPointerLeave",["pointerout","pointerover"]),yl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),yl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),yl("onBeforeInput",["compositionend","keypress","textInput","paste"]),yl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),yl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),yl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ts="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(" "),Gp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ts));function Rm(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 r=void 0;if(t)for(var d=n.length-1;0<=d;d--){var g=n[d],E=g.instance,z=g.currentTarget;if(g=g.listener,E!==r&&s.isPropagationStopped())break e;r=g,s.currentTarget=z;try{r(s)}catch($){xr($)}s.currentTarget=null,r=E}else for(d=0;d<n.length;d++){if(g=n[d],E=g.instance,z=g.currentTarget,g=g.listener,E!==r&&s.isPropagationStopped())break e;r=g,s.currentTarget=z;try{r(s)}catch($){xr($)}s.currentTarget=null,r=E}}}}function Ne(e,t){var a=t[fd];a===void 0&&(a=t[fd]=new Set);var n=e+"__bubble";a.has(n)||(Am(t,e,2,!1),a.add(n))}function Jo(e,t,a){var n=0;t&&(n|=4),Am(a,e,n,t)}var fi="_reactListening"+Math.random().toString(36).slice(2);function Io(e){if(!e[fi]){e[fi]=!0,hd.forEach(function(a){a!=="selectionchange"&&(Gp.has(a)||Jo(a,!1,e),Jo(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fi]||(t[fi]=!0,Jo("selectionchange",!1,t))}}function Am(e,t,a,n){switch(yx(t)){case 2:var s=ky;break;case 8:s=Uy;break;default:s=gu}a=s.bind(null,t,a,e),s=void 0,!lc||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 Fo(e,t,a,n,s){var r=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var d=n.tag;if(d===3||d===4){var g=n.stateNode.containerInfo;if(g===s)break;if(d===4)for(d=n.return;d!==null;){var E=d.tag;if((E===3||E===4)&&d.stateNode.containerInfo===s)return;d=d.return}for(;g!==null;){if(d=pl(g),d===null)return;if(E=d.tag,E===5||E===6||E===26||E===27){n=r=d;continue e}g=g.parentNode}}n=n.return}Rd(function(){var z=r,$=tc(a),Y=[];e:{var M=af.get(e);if(M!==void 0){var H=dr,te=e;switch(e){case"keypress":if(or(a)===0)break e;case"keydown":case"keyup":H=Rg;break;case"focusin":te="focus",H=ic;break;case"focusout":te="blur",H=ic;break;case"beforeblur":case"afterblur":H=ic;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":H=Md;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=gg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=Dg;break;case Pd:case Wd:case ef:H=vg;break;case tf:H=Lg;break;case"scroll":case"scrollend":H=xg;break;case"wheel":H=Ug;break;case"copy":case"cut":case"paste":H=bg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Dd;break;case"submit":H=Mg;break;case"toggle":case"beforetoggle":H=Bg}var ie=(t&4)!==0,ye=!ie&&(e==="scroll"||e==="scrollend"),D=ie?M!==null?M+"Capture":null:M;ie=[];for(var A=z,L;A!==null;){var q=A;if(L=q.stateNode,q=q.tag,q!==5&&q!==26&&q!==27||L===null||D===null||(q=Kn(A,D),q!=null&&ie.push(Cs(A,q,L))),ye)break;A=A.return}0<ie.length&&(M=new H(M,te,null,a,$),Y.push({event:M,listeners:ie}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",M=e==="mouseout"||e==="pointerout",H&&a!==ec&&(te=a.relatedTarget||a.fromElement)&&(pl(te)||te[Vl]))break e;(M||H)&&(te=$.window===$?$:(H=$.ownerDocument)?H.defaultView||H.parentWindow:window,M?(H=a.relatedTarget||a.toElement,M=z,H=H?pl(H):null,H!==null&&(ye=m(H),ie=H.tag,H!==ye||ie!==5&&ie!==27&&ie!==6)&&(H=null)):(M=null,H=z),M!==H&&(ie=Md,q="onMouseLeave",D="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(ie=Dd,q="onPointerLeave",D="onPointerEnter",A="pointer"),ye=M==null?te:Zn(M),L=H==null?te:Zn(H),te=new ie(q,A+"leave",M,a,$),te.target=ye,te.relatedTarget=L,q=null,pl($)===z&&(ie=new ie(D,A+"enter",H,a,$),ie.target=L,ie.relatedTarget=ye,q=ie),ye=q,ie=M&&H?ne(M,H,Qp):null,M!==null&&Om(Y,te,M,ie,!1),H!==null&&ye!==null&&Om(Y,ye,H,ie,!0)))}e:{if(M=z?Zn(z):window,H=M.nodeName&&M.nodeName.toLowerCase(),H==="select"||H==="input"&&M.type==="file")var re=qd;else if(Bd(M))if(Yd)re=Jg;else{re=Zg;var Ee=Xg}else H=M.nodeName,!H||H.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?z&&Wi(z.elementType)&&(re=qd):re=Kg;if(re&&(re=re(e,z))){$d(Y,re,a,$);break e}Ee&&Ee(e,M,z)}switch(Ee=z?Zn(z):window,e){case"focusin":(Bd(Ee)||Ee.contentEditable==="true")&&(Pl=Ee,xc=z,as=null);break;case"focusout":as=xc=Pl=null;break;case"mousedown":hc=!0;break;case"contextmenu":case"mouseup":case"dragend":hc=!1,Id(Y,a,$);break;case"selectionchange":if(Fg)break;case"keydown":case"keyup":Id(Y,a,$)}var ue;if(oc)e:{switch(e){case"compositionstart":var me="onCompositionStart";break e;case"compositionend":me="onCompositionEnd";break e;case"compositionupdate":me="onCompositionUpdate";break e}me=void 0}else Fl?Ud(e,a)&&(me="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(me="onCompositionStart");me&&(zd&&a.locale!=="ko"&&(Fl||me!=="onCompositionStart"?me==="onCompositionEnd"&&Fl&&(ue=Ad()):(Va=$,nc="value"in Va?Va.value:Va.textContent,Fl=!0)),Ee=mi(z,me),0<Ee.length&&(me=new _d(me,e,null,a,$),Y.push({event:me,listeners:Ee}),ue?me.data=ue:(ue=Hd(a),ue!==null&&(me.data=ue)))),(ue=qg?Yg(e,a):Vg(e,a))&&(me=mi(z,"onBeforeInput"),0<me.length&&(Ee=new _d("onBeforeInput","beforeinput",null,a,$),Y.push({event:Ee,listeners:me}),Ee.data=ue)),qp(Y,e,z,a,$)}Rm(Y,t)})}function Cs(e,t,a){return{instance:e,listener:t,currentTarget:a}}function mi(e,t){for(var a=t+"Capture",n=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=Kn(e,a),s!=null&&n.unshift(Cs(e,s,r)),s=Kn(e,t),s!=null&&n.push(Cs(e,s,r))),e.tag===3)return n;e=e.return}return[]}function Qp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Om(e,t,a,n,s){for(var r=t._reactName,d=[];a!==null&&a!==n;){var g=a,E=g.alternate,z=g.stateNode;if(g=g.tag,E!==null&&E===n)break;g!==5&&g!==26&&g!==27||z===null||(E=z,s?(z=Kn(a,r),z!=null&&d.unshift(Cs(a,z,E))):s||(z=Kn(a,r),z!=null&&d.push(Cs(a,z,E)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var Xp=/\r\n?/g,Zp=/\u0000|\uFFFD/g;function Mm(e){return(typeof e=="string"?e:""+e).replace(Xp,`
|
|
9
|
-
`).replace(Zp,"")}function _m(e,t){return t=Mm(t),Mm(e)===t}function Ue(e,t,a,n,s,r){switch(a){case"children":if(typeof n=="string")t==="body"||t==="textarea"&&n===""||Kl(e,n);else if(typeof n=="number"||typeof n=="bigint")t!=="body"&&Kl(e,""+n);else return;break;case"className":rr(e,"class",n);break;case"tabIndex":rr(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":rr(e,a,n);break;case"style":Td(e,n,r);return;case"data":if(t!=="object"){rr(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=ir(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 r=="function"&&(a==="formAction"?(t!=="input"&&Ue(e,t,"name",s.name,s,null),Ue(e,t,"formEncType",s.formEncType,s,null),Ue(e,t,"formMethod",s.formMethod,s,null),Ue(e,t,"formTarget",s.formTarget,s,null)):(Ue(e,t,"encType",s.encType,s,null),Ue(e,t,"method",s.method,s,null),Ue(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=ir(n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=ca);return;case"onScroll":n!=null&&Ne("scroll",e);return;case"onScrollEnd":n!=null&&Ne("scrollend",e);return;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));r?.__html!==a&&(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=ir(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"credentialless":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":Ne("beforetoggle",e),Ne("toggle",e),sr(e,"popover",n);break;case"xlinkActuate":Sa(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Sa(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Sa(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Sa(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Sa(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Sa(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Sa(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":sr(e,"is",n);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=fg.get(a)||a,sr(e,a,n);else return}Ae=!0}function Po(e,t,a,n,s,r){switch(a){case"style":Td(e,n,r);return;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));r?.__html!==a&&(e.innerHTML=a)}}break;case"children":if(typeof n=="string")Kl(e,n);else if(typeof n=="number"||typeof n=="bigint")Kl(e,""+n);else return;break;case"onScroll":n!=null&&Ne("scroll",e);return;case"onScrollEnd":n!=null&&Ne("scrollend",e);return;case"onClick":n!=null&&(e.onclick=ca);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!gd.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),r=a.slice(2,s?a.length-7:void 0),t=e[St]||null,t=t!=null?t[a]:null,typeof t=="function"&&e.removeEventListener(r,t,s),typeof n=="function")){typeof t!="function"&&t!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(r,n,s);break e}Ae=!0,a in e?e[a]=n:n===!0?e.setAttribute(a,""):sr(e,a,n)}return}Ae=!0}function ht(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ne("error",e),Ne("load",e);var n=!1,s=!1,r;for(r in a)if(a.hasOwnProperty(r)){var d=a[r];if(d!=null)switch(r){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ue(e,t,r,d,a,null)}}s&&Ue(e,t,"srcSet",a.srcSet,a,null),n&&Ue(e,t,"src",a.src,a,null);return;case"input":Ne("invalid",e);var g=r=d=s=null,E=null,z=null;for(n in a)if(a.hasOwnProperty(n)){var $=a[n];if($!=null)switch(n){case"name":s=$;break;case"type":d=$;break;case"checked":E=$;break;case"defaultChecked":z=$;break;case"value":r=$;break;case"defaultValue":g=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(c(137,t));break;default:Ue(e,t,n,$,a,null)}}Nd(e,r,g,E,z,d,s,!1);return;case"select":Ne("invalid",e),n=d=r=null;for(s in a)if(a.hasOwnProperty(s)&&(g=a[s],g!=null))switch(s){case"value":r=g;break;case"defaultValue":d=g;break;case"multiple":n=g;default:Ue(e,t,s,g,a,null)}t=r,a=d,e.multiple=!!n,t!=null?Zl(e,!!n,t,!1):a!=null&&Zl(e,!!n,a,!0);return;case"textarea":Ne("invalid",e),r=s=n=null;for(d in a)if(a.hasOwnProperty(d)&&(g=a[d],g!=null))switch(d){case"value":n=g;break;case"defaultValue":s=g;break;case"children":r=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:Ue(e,t,d,g,a,null)}wd(e,n,s,r);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":Ue(e,t,E,n,a,null));return;case"dialog":Ne("beforetoggle",e),Ne("toggle",e),Ne("cancel",e),Ne("close",e);break;case"iframe":case"object":Ne("load",e);break;case"video":case"audio":for(n=0;n<Ts.length;n++)Ne(Ts[n],e);break;case"image":Ne("error",e),Ne("load",e);break;case"details":Ne("toggle",e);break;case"embed":case"source":case"link":Ne("error",e),Ne("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(z in a)if(a.hasOwnProperty(z)&&(n=a[z],n!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ue(e,t,z,n,a,null)}return;default:if(Wi(t)){for($ in a)a.hasOwnProperty($)&&(n=a[$],n!==void 0&&Po(e,t,$,n,a,void 0));return}}for(g in a)a.hasOwnProperty(g)&&(n=a[g],n!=null&&Ue(e,t,g,n,a,null))}var Kp={};function Jp(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,r=null,d=null,g=null,E=null,z=null,$=null;for(H in a){var Y=a[H];if(a.hasOwnProperty(H)&&Y!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":E=Y;default:n.hasOwnProperty(H)||Ue(e,t,H,null,n,Y)}}for(var M in n){var H=n[M];if(Y=a[M],n.hasOwnProperty(M)&&(H!=null||Y!=null))switch(M){case"type":H!==Y&&(Ae=!0),r=H;break;case"name":H!==Y&&(Ae=!0),s=H;break;case"checked":H!==Y&&(Ae=!0),z=H;break;case"defaultChecked":H!==Y&&(Ae=!0),$=H;break;case"value":H!==Y&&(Ae=!0),d=H;break;case"defaultValue":H!==Y&&(Ae=!0),g=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(c(137,t));break;default:H!==Y&&Ue(e,t,M,H,n,Y)}}Fi(e,d,g,E,z,$,r,s);return;case"select":H=d=g=M=null;for(r in a)if(E=a[r],a.hasOwnProperty(r)&&E!=null)switch(r){case"value":break;case"multiple":H=E;default:n.hasOwnProperty(r)||Ue(e,t,r,null,n,E)}for(s in n)if(r=n[s],E=a[s],n.hasOwnProperty(s)&&(r!=null||E!=null))switch(s){case"value":r!==E&&(Ae=!0),M=r;break;case"defaultValue":r!==E&&(Ae=!0),g=r;break;case"multiple":r!==E&&(Ae=!0),d=r;default:r!==E&&Ue(e,t,s,r,n,E)}t=g,a=d,n=H,M!=null?Zl(e,!!a,M,!1):!!n!=!!a&&(t!=null?Zl(e,!!a,t,!0):Zl(e,!!a,a?[]:"",!1));return;case"textarea":H=M=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:Ue(e,t,g,null,n,s)}for(d in n)if(s=n[d],r=a[d],n.hasOwnProperty(d)&&(s!=null||r!=null))switch(d){case"value":s!==r&&(Ae=!0),M=s;break;case"defaultValue":s!==r&&(Ae=!0),H=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(c(91));break;default:s!==r&&Ue(e,t,d,s,n,r)}Sd(e,M,H);return;case"option":for(var te in a)M=a[te],a.hasOwnProperty(te)&&M!=null&&!n.hasOwnProperty(te)&&(te==="selected"?e.selected=!1:Ue(e,t,te,null,n,M));for(E in n)M=n[E],H=a[E],n.hasOwnProperty(E)&&M!==H&&(M!=null||H!=null)&&(E==="selected"?(M!==H&&(Ae=!0),e.selected=M&&typeof M!="function"&&typeof M!="symbol"):Ue(e,t,E,M,n,H));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 ie in a)M=a[ie],a.hasOwnProperty(ie)&&M!=null&&!n.hasOwnProperty(ie)&&Ue(e,t,ie,null,n,M);for(z in n)if(M=n[z],H=a[z],n.hasOwnProperty(z)&&M!==H&&(M!=null||H!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(c(137,t));break;default:Ue(e,t,z,M,n,H)}return;default:if(Wi(t)){for(var ye in a)M=a[ye],a.hasOwnProperty(ye)&&M!==void 0&&!n.hasOwnProperty(ye)&&Po(e,t,ye,void 0,n,M);for($ in n)M=n[$],H=a[$],!n.hasOwnProperty($)||M===H||M===void 0&&H===void 0||Po(e,t,$,M,n,H);return}}for(var D in a)M=a[D],a.hasOwnProperty(D)&&M!=null&&!n.hasOwnProperty(D)&&Ue(e,t,D,null,n,M);for(Y in n)M=n[Y],H=a[Y],!n.hasOwnProperty(Y)||M===H||M==null&&H==null||Ue(e,t,Y,M,n,H)}function Dm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ip(){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],r=s.transferSize,d=s.initiatorType,g=s.duration;if(r&&g&&Dm(d)){for(d=0,g=s.responseEnd,n+=1;n<a.length;n++){var E=a[n],z=E.startTime;if(z>g)break;var $=E.transferSize,Y=E.initiatorType;$&&Dm(Y)&&(E=E.responseEnd,d+=$*(E<g?1:(g-z)/(E-z)))}if(--n,t+=8*(r+d)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Wo=null,eu=null;function Rs(e){return e.nodeType===9?e:e.ownerDocument}function zm(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 Lm(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 km(e,t,a,n){return a=Rs(a).createElement(e),a[ut]=n,a[St]=t,ht(a,e,t),nt(a),a}function tu(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 au=null;function Fp(){var e=window.event;return e&&e.type==="popstate"?e===au?!1:(au=e,!0):(au=null,!1)}var lu=typeof setTimeout=="function"?setTimeout:void 0,Pp=typeof clearTimeout=="function"?clearTimeout:void 0,Um=typeof Promise=="function"?Promise:void 0,Hm=typeof requestAnimationFrame=="function"?requestAnimationFrame:lu,Wp=typeof queueMicrotask=="function"?queueMicrotask:typeof Um<"u"?function(e){return Um.resolve(null).then(e).catch(ey)}:lu;function ey(e){setTimeout(function(){throw e})}function ol(e){return e==="head"}function Bm(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),_n(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")du(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,du(a);for(var r=a.firstChild;r;){var d=r.nextSibling,g=r.nodeName;r[Xn]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&r.rel.toLowerCase()==="stylesheet"||a.removeChild(r),r=d}}else a==="body"&&du(e.ownerDocument.body);a=s}while(a);_n(t)}function $m(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 qm(e,t,a){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,a!=null&&(e.style.viewTransitionClass=a),a=getComputedStyle(e),a.display==="inline"){if(t=e.getClientRects(),t.length===1)var n=1;else for(var s=n=0;s<t.length;s++){var r=t[s];0<r.width&&0<r.height&&n++}n===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+a.paddingTop,e.marginBottom="-"+a.paddingBottom)}}function Ym(e,t){e=e.style,t=t.style;var a=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(a=t.display,e.display=a==null||typeof a=="boolean"?"":a,a=t.margin,a!=null?e.margin=a:(a=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=a==null||typeof a=="boolean"?"":a,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function ty(e,t,a){return a=a.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=a.innerHeight&&e.left<=a.innerWidth}}function nu(e){var t=e.getBoundingClientRect(),a=getComputedStyle(e);return ty(t,a,e)}function ay(e){return e.documentElement.clientHeight}function ly(e){this.addEventListener("load",e),this.addEventListener("error",e)}function ny(e,t,a,n,s,r,d,g,E){var z=t.nodeType===9?t:t.ownerDocument;try{var $=z.startViewTransition({update:function(){var M=z.defaultView,H=M.navigation&&M.navigation.transition,te=z.fonts.status;n();var ie=[];if(te==="loaded"&&(ay(z),z.fonts.status==="loading"&&ie.push(z.fonts.ready)),te=ie.length,e!==null)for(var ye=e.suspenseyImages,D=0,A=0;A<ye.length;A++){var L=ye[A];if(!L.complete){var q=L.getBoundingClientRect();if(0<q.bottom&&0<q.right&&q.top<M.innerHeight&&q.left<M.innerWidth){if(D+=ox(L),D>gi){ie.length=te;break}L=new Promise(ly.bind(L)),ie.push(L)}}}if(0<ie.length)return M=Promise.race([Promise.all(ie),new Promise(function(re){return setTimeout(re,500)})]).then(s,s),(H?Promise.allSettled([H.finished,M]):M).then(r,r);if(s(),H)return H.finished.then(r,r);r()},types:a});z.__reactViewTransition=$;var Y=[];return $.ready.then(function(){for(var M=z.documentElement.getAnimations({subtree:!0}),H=0;H<M.length;H++){var te=M[H],ie=te.effect,ye=ie.pseudoElement;if(ye!=null&&ye.startsWith("::view-transition")){Y.push(te),te=ie.getKeyframes();for(var D=ye=void 0,A=!0,L=0;L<te.length;L++){var q=te[L],re=q.width;if(ye===void 0)ye=re;else if(ye!==re){A=!1;break}if(re=q.height,D===void 0)D=re;else if(D!==re){A=!1;break}delete q.width,delete q.height,q.transform==="none"&&delete q.transform}A&&ye!==void 0&&D!==void 0&&(ie.setKeyframes(te),A=getComputedStyle(ie.target,ie.pseudoElement),A.width!==ye||A.height!==D)&&(A=te[0],A.width=ye,A.height=D,A=te[te.length-1],A.width=ye,A.height=D,ie.setKeyframes(te))}}d()},function(M){z.__reactViewTransition===$&&(z.__reactViewTransition=null);try{typeof M=="object"&&M!==null&&M.name==="InvalidStateError"&&(M.message==="View transition was skipped because document visibility state is hidden."||M.message==="Skipping view transition because document visibility state has become hidden."||M.message==="Skipping view transition because viewport size changed."||M.message==="Transition was aborted because of invalid state")&&(M=null),M!==null&&E(M)}finally{n(),s(),d()}}),$.finished.finally(function(){for(var M=0;M<Y.length;M++)Y[M].cancel();z.__reactViewTransition===$&&(z.__reactViewTransition=null),g()}),$}catch{return n(),s(),d(),null}}function Hl(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Hl.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:K({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Hl.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,a=e.getAnimations({subtree:!0}),n=[],s=0;s<a.length;s++){var r=a[s].effect;r!==null&&r.target===e&&r.pseudoElement===t&&n.push(a[s])}return n},Hl.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vm(e){return{name:e,group:new Hl("group",e),imagePair:new Hl("image-pair",e),old:new Hl("old",e),new:new Hl("new",e)}}function Bt(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Bt.prototype.addEventListener=function(e,t,a){var n=null,s=null;if(!(a!=null&&typeof a!="boolean"&&(n=a.signal||null,n!==null&&n.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var r=this._eventListeners;if(Qm(r,e,t,a)===-1){var d=this,g=t;a!=null&&typeof a!="boolean"&&a.once===!0&&(g=function(E){d.removeEventListener(e,t,a),typeof t=="function"?t.call(this,E):t.handleEvent(E)}),n!==null&&(s=d.removeEventListener.bind(d,e,t,a),n.addEventListener("abort",s,{once:!0}),s=n.removeEventListener.bind(n,"abort",s)),n=Tn(a),r.push({type:e,listener:t,optionsOrUseCapture:a,attachedListener:g,cleanup:s}),h(this._fragmentFiber.child,!1,sy,e,g,n)}this._eventListeners=r}};function sy(e,t,a,n){return j(e).addEventListener(t,a,n),!1}Bt.prototype.removeEventListener=function(e,t,a){var n=this._eventListeners;if(n!==null&&(t=Qm(n,e,t,a),t!==-1)){var s=n[t];a=s.attachedListener;var r=s.cleanup;s=Tn(s.optionsOrUseCapture),h(this._fragmentFiber.child,!1,ry,e,a,s),n.splice(t,1),r!==null&&r()}};function ry(e,t,a,n){return j(e).removeEventListener(t,a,n),!1}function Tn(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gm(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Qm(e,t,a,n){if(e.length===0)return-1;n=Gm(n);for(var s=0;s<e.length;s++){var r=e[s];if(r.type===t&&r.listener===a&&Gm(r.optionsOrUseCapture)===n)return s}return-1}Bt.prototype.dispatchEvent=function(e){var t=w(this._fragmentFiber);if(t===null)return!0;t=j(t);var a=this._eventListeners;if(a!==null&&0<a.length||!e.bubbles){var n=t.nodeType===9?t.createComment(""):document.createTextNode("");if(a)for(var s=0;s<a.length;s++){var r=a[s];n.addEventListener(r.type,r.attachedListener,Tn(r.optionsOrUseCapture))}if(t.appendChild(n),e=n.dispatchEvent(e),a)for(s=0;s<a.length;s++)r=a[s],n.removeEventListener(r.type,r.attachedListener,Tn(r.optionsOrUseCapture));return t.removeChild(n),e}return t.dispatchEvent(e)},Bt.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Xm,e,void 0,void 0)};function Xm(e,t){return e.tag===6?!1:(e=j(e),yy(e,t))}Bt.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,su,t,void 0,void 0);for(var a=t.length-1;0<=a&&!Xm(t[a],e);a--);};function su(e,t){return t.push(e),!1}Bt.prototype.blur=function(){var e=w(this._fragmentFiber);e!==null&&(e=j(e),e=Rs(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,iy,e,void 0,void 0))};function iy(e,t){return e.tag===6?!1:(e=j(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Bt.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,cy,e,void 0,void 0)};function cy(e,t){return e.tag===6||(e=j(e),t.observe(e)),!1}Bt.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,oy,e,void 0,void 0);for(var a=t=0;a<ta.length;a++){var n=ta[a];n.fragmentInstance===this&&n.observer===e?e.unobserve(n.instance):ta[t++]=n}ta.length=t}};function oy(e,t){return e.tag===6||(e=j(e),t.unobserve(e)),!1}var ta=[],ru=!1;function uy(e,t,a){ta.push({fragmentInstance:e,observer:t,instance:a}),ru||(ru=!0,vy(function(){ru=!1;var n=ta;ta=[];for(var s=0;s<n.length;s++){var r=n[s];r.observer.unobserve(r.instance)}}))}Bt.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,dy,e,void 0,void 0),e};function dy(e,t){if(e.tag===6){e=e.stateNode;var a=e.ownerDocument.createRange();a.selectNodeContents(e),t.push.apply(t,a.getClientRects())}else e=j(e),t.push.apply(t,e.getClientRects());return!1}Bt.prototype.getRootNode=function(e){var t=w(this._fragmentFiber);return t===null?this:j(t).getRootNode(e)},Bt.prototype.compareDocumentPosition=function(e){var t=w(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];h(this._fragmentFiber.child,!1,su,a,void 0,void 0);var n=j(t);if(a.length===0){if(a=n,O(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(a=t)}t=this._fragmentFiber;var s=n=a.compareDocumentPosition(e);return a===e?s=Node.DOCUMENT_POSITION_CONTAINS:n&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=_(t)[1],a===null?s=Node.DOCUMENT_POSITION_PRECEDING:(e=j(a).compareDocumentPosition(e),s=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),s|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=j(a[0]),s=j(a[a.length-1]);var r=O(this._fragmentFiber)?t.parentElement:n;if(r==null)return Node.DOCUMENT_POSITION_DISCONNECTED;n=r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,r=r.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY;var d=t.compareDocumentPosition(e),g=s.compareDocumentPosition(e),E=d&Node.DOCUMENT_POSITION_CONTAINED_BY||g&Node.DOCUMENT_POSITION_CONTAINED_BY;return g=n&&r&&d&Node.DOCUMENT_POSITION_FOLLOWING&&g&Node.DOCUMENT_POSITION_PRECEDING,t=n&&t===e||r&&s===e||E||g?Node.DOCUMENT_POSITION_CONTAINED_BY:!n&&t===e||!r&&s===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:d,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||fy(t,this._fragmentFiber,a[0],a[a.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function fy(e,t,a,n,s){var r=pl(s);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!r)e:{for(;r!==null;){if(r.tag===7&&(r===t||r.alternate===t)){a=!0;break e}r=r.return}a=!1}return a}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(r===null)return r=s.ownerDocument,s===r||s===r.documentElement||s===r.body;e:{for(r=t,t=w(t);r!==null;){if(!(r.tag!==5&&r.tag!==3&&r.tag!==27||r!==t&&r.alternate!==t)){r=!0;break e}r=r.return}r=!1}return r}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!r)&&!(t=r===a)&&(t=ne(a,r,Q),t===null?t=!1:(h(t,!0,U,r,a),r=S,S=null,t=r!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!r)&&!(t=r===n)&&(t=ne(n,r,Q),t===null?t=!1:(h(t,!0,ee,r,n),r=S,T=S=null,t=r!==null)),t):!1}function Zm(e,t){var a=e.ownerDocument.createRange();a.selectNodeContents(e),e=a.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Bt.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(c(566));var t=[];h(this._fragmentFiber.child,!1,su,t,void 0,void 0);var a=e!==!1;if(t.length===0){var n=_(this._fragmentFiber);if(n=a?n[1]||n[0]||w(this._fragmentFiber):n[0]||n[1],n===null)return;if(n.tag===6){e=j(n),Zm(e,a);return}if(n=j(n),n.nodeType!==9){if(n.nodeType===11){a="host"in n?n.host:null,a!==null&&a.scrollIntoView(e);return}n.scrollIntoView(e)}}for(n=a?t.length-1:0;n!==(a?-1:t.length);){var s=t[n];s.tag===6?(s=j(s),Zm(s,a)):j(s).scrollIntoView(e),n+=a?-1:1}};function my(e,t){return e=j(e),Km(e,t),!1}function Km(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Jm(e,t){var a=t._eventListeners;if(a!==null)for(var n=0;n<a.length;n++){var s=a[n];e.addEventListener(s.type,s.attachedListener,Tn(s.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(r){for(var d=0,g=0;g<ta.length;g++){var E=ta[g];(E.fragmentInstance!==t||E.observer!==r||E.instance!==e)&&(ta[d++]=E)}ta.length=d,r.observe(e)}),Km(e,t))}function xy(e,t){var a=t._eventListeners;if(a!==null)for(var n=0;n<a.length;n++){var s=a[n];e.removeEventListener(s.type,s.attachedListener,Tn(s.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(r){typeof r.rootMargin=="string"?uy(t,r,e):r.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function iu(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":iu(a),nr(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function hy(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[Xn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==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(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Zt(e.nextSibling),e===null)break}return null}function gy(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Zt(e.nextSibling),e===null))return null;return e}function Im(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Zt(e.nextSibling),e===null))return null;return e}function cu(e){return e.data==="$?"||e.data==="$~"}function ou(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function py(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 Zt(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 uu=null;function Fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Zt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Pm(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 yy(e,t){function a(){n=!0}if(e.ownerDocument.activeElement===e)return!0;var n=!1;try{e.ownerDocument.addEventListener("focus",a,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",a,!0)}return n}function vy(e){Hm(function(){Hm(function(t){return e(t)})})}function Wm(e,t,a){switch(t=Rs(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 ex(e,t,a){for(var n in a){var s=a[n];a.hasOwnProperty(n)&&s!=null&&Ue(e,t,n,null,Kp,s)}a.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===ca&&(e.onclick=null),nr(e)}function du(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);nr(e)}var Kt=new Map,tx=new Set;function As(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var ka=he.d;he.d={f:jy,r:by,D:Ny,C:Sy,L:wy,m:Ey,X:Cy,S:Ty,M:Ry};function jy(){var e=ka.f(),t=ii();return e||t}function by(e){var t=Gl(e);t!==null&&t.tag===5&&t.type==="form"?l0(t):ka.r(e)}var Cn=typeof document>"u"?null:document;function ax(e,t,a){var n=Cn;if(n&&typeof t=="string"&&t){var s=$t(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),tx.has(s)||(tx.add(s),e={rel:e,crossOrigin:a,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),ht(t,"link",e),nt(t),n.head.appendChild(t)))}}function Ny(e){ka.D(e),ax("dns-prefetch",e,null)}function Sy(e,t){ka.C(e,t),ax("preconnect",e,t)}function wy(e,t,a){ka.L(e,t,a);var n=Cn;if(n&&e&&t){var s='link[rel="preload"][as="'+$t(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+$t(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+$t(a.imageSizes)+'"]')):s+='[href="'+$t(e)+'"]';var r=s;switch(t){case"style":r=Rn(e);break;case"script":r=An(e)}if(!(Kt.has(r)||(e=K({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Kt.set(r,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(Os(r))||t==="script"&&n.querySelector(Ms(r))))){var d=n.createElement("link");ht(d,"link",e),t==="style"&&(d[lr]=!0,d.onload=d.onerror=function(){xd(d)}),nt(d),n.head.appendChild(d)}}}function Ey(e,t){ka.m(e,t);var a=Cn;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+$t(n)+'"][href="'+$t(e)+'"]',r=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=An(e)}if(!Kt.has(r)&&(e=K({rel:"modulepreload",href:e},t),Kt.set(r,e),a.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ms(r)))return}n=a.createElement("link"),ht(n,"link",e),nt(n),a.head.appendChild(n)}}}function Ty(e,t,a){ka.S(e,t,a);var n=Cn;if(n&&e){var s=Ql(n).hoistableStyles,r=Rn(e);t=t||"default";var d=s.get(r);if(!d){var g={loading:0,preload:null};if(d=n.querySelector(Os(r)))g.loading=5;else{e=K({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Kt.get(r))&&fu(e,a);var E=d=n.createElement("link");nt(E),ht(E,"link",e),E._p=new Promise(function(z,$){E.onload=z,E.onerror=$}),E.addEventListener("load",function(){g.loading|=1}),E.addEventListener("error",function(){g.loading|=2}),g.loading|=4,xi(d,t,n)}d={type:"stylesheet",instance:d,count:1,state:g},s.set(r,d)}}}function Cy(e,t){ka.X(e,t);var a=Cn;if(a&&e){var n=Ql(a).hoistableScripts,s=An(e),r=n.get(s);r||(r=a.querySelector(Ms(s)),r||(e=K({src:e,async:!0},t),(t=Kt.get(s))&&mu(e,t),r=a.createElement("script"),nt(r),ht(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(s,r))}}function Ry(e,t){ka.M(e,t);var a=Cn;if(a&&e){var n=Ql(a).hoistableScripts,s=An(e),r=n.get(s);r||(r=a.querySelector(Ms(s)),r||(e=K({src:e,async:!0,type:"module"},t),(t=Kt.get(s))&&mu(e,t),r=a.createElement("script"),nt(r),ht(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(s,r))}}function lx(e,t,a,n){var s=(s=$a.current)?As(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"?(a=Rn(a.href),t=Ql(s).hoistableStyles,n=t.get(a),n||(n={type:"style",instance:null,count:0,state:null},t.set(a,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=Rn(a.href);var r=Ql(s).hoistableStyles,d=r.get(e);if(d||(s=s.ownerDocument||s,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,d),(r=s.querySelector(Os(e)))?r._p||(d.instance=r,d.state.loading=5):(r=Kt.get(e),r||(r={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Kt.set(e,r)),Ay(s,e,r,d.state))),t&&n===null)throw Error(c(528,""));return d}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"?(a=An(a),t=Ql(s).hoistableScripts,n=t.get(a),n||(n={type:"script",instance:null,count:0,state:null},t.set(a,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Rn(e){return'href="'+$t(e)+'"'}function Os(e){return'link[rel="stylesheet"]['+e+"]"}function nx(e){return K({},e,{"data-precedence":e.precedence,precedence:null})}function Ay(e,t,a,n){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[lr]!==!0){n.loading=1;return}}else t=e.createElement("link"),t[lr]=!0,t.onload=t.onerror=xd.bind(null,t),ht(t,"link",a),nt(t),e.head.appendChild(t);n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2})}function An(e){return'[src="'+$t(e)+'"]'}function Ms(e){return"script[async]"+e}function sx(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+$t(a.href)+'"]');if(n)return t.instance=n,nt(n),n;var s=K({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),nt(n),ht(n,"style",s),xi(n,a.precedence,e),t.instance=n;case"stylesheet":s=Rn(a.href);var r=e.querySelector(Os(s));if(r)return t.state.loading|=4,t.instance=r,nt(r),r;n=nx(a),(s=Kt.get(s))&&fu(n,s),r=(e.ownerDocument||e).createElement("link"),nt(r);var d=r;return d._p=new Promise(function(g,E){d.onload=g,d.onerror=E}),ht(r,"link",n),t.state.loading|=4,xi(r,a.precedence,e),t.instance=r;case"script":return r=An(a.src),(s=e.querySelector(Ms(r)))?(t.instance=s,nt(s),s):(n=a,(s=Kt.get(r))&&(n=K({},a),mu(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),nt(s),ht(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,xi(n,a.precedence,e));return t.instance}function xi(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,r=s,d=0;d<n.length;d++){var g=n[d];if(g.dataset.precedence===t)r=g;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function fu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function mu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var hi=null;function rx(e,t,a){if(hi===null){var n=new Map,s=hi=new Map;s.set(a,n)}else s=hi,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 r=a[s];if(!(r[Xn]||r[ut]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var d=r.getAttribute(t)||"";d=e+d;var g=n.get(d);g?g.push(r):n.set(d,[r])}}return n}function xu(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Oy(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 ix(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function cx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function ox(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function ux(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=ox(t),e.suspenseyImages.push(t)),e=Dy.bind(e),t.decode().then(e,e))}function My(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=Rn(n.href),r=t.querySelector(Os(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=_s.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=r,nt(r);return}r=t.ownerDocument||t,n=nx(n),(s=Kt.get(s))&&fu(n,s),r=r.createElement("link"),nt(r);var d=r;d._p=new Promise(function(g,E){d.onload=g,d.onerror=E}),ht(r,"link",n),a.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=_s.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var gi=0;function _y(e,t){return e.stylesheets&&e.count===0&&yi(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&yi(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&gi===0&&(gi=62500*Ip());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&yi(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>gi?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function dx(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)yi(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function _s(){this.count--,dx(this)}function Dy(){this.imgCount--,dx(this)}var pi=null;function yi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,pi=new Map,t.forEach(zy,e),pi=null,_s.call(e))}function zy(e,t){if(!(t.state.loading&4)){var a=pi.get(e);if(a)var n=a.get(null);else{a=new Map,pi.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var d=s[r];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),n=d)}n&&a.set(null,n)}s=t.instance,d=s.getAttribute("data-precedence"),r=a.get(d)||n,r===n&&a.set(null,s),a.set(d,s),this.count++,n=_s.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var On={$$typeof:se,Provider:null,Consumer:null,_currentValue:ba,_currentValue2:ba,_threadCount:0};function Ly(e,t,a,n,s,r,d,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=Zi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zi(0),this.hiddenUpdates=Zi(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=E,this.transitionTypes=null,this.incompleteTransitions=new Map}function fx(e,t,a,n,s,r,d,g,E,z,$,Y){return e=new Ly(e,t,a,d,E,z,$,Y,g),t=1,r===!0&&(t|=24),r=wt(3,null,null,t),e.current=r,r.stateNode=e,t=Rc(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:n,isDehydrated:a,cache:t},_c(r),e}function mx(e){return e?(e=tn,e):tn}function xx(e,t,a,n,s,r){s=mx(s),n.context===null?n.context=s:n.pendingContext=s,n=Fa(t),n.payload={element:a},r=r===void 0?null:r,r!==null&&(n.callback=r),a=Pa(e,n,t),a!==null&&(Rt(a,e,t),os(a,e,t))}function hx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function hu(e,t){hx(e,t),(e=e.alternate)&&hx(e,t)}function gx(e){if(e.tag===13||e.tag===31){var t=bl(e,67108864);t!==null&&Rt(t,e,67108864),hu(e,67108864)}}function px(e){if(e.tag===13||e.tag===31){var t=Ht();t=Ki(t);var a=bl(e,t);a!==null&&Rt(a,e,t),hu(e,t)}}var Mn=!0;function ky(e,t,a,n){var s=oe.T;oe.T=null;var r=he.p;try{he.p=2,gu(e,t,a,n)}finally{he.p=r,oe.T=s}}function Uy(e,t,a,n){var s=oe.T;oe.T=null;var r=he.p;try{he.p=8,gu(e,t,a,n)}finally{he.p=r,oe.T=s}}function gu(e,t,a,n){if(Mn){var s=pu(n);if(s===null)Fo(e,t,n,vi,a),vx(e,n);else if(By(s,e,t,a,n))n.stopPropagation();else if(vx(e,n),t&4&&-1<Hy.indexOf(e)){for(;s!==null;){var r=Gl(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var d=gl(r.pendingLanes);if(d!==0){var g=r;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var E=1<<31-Mt(d);g.entanglements[1]|=E,d&=~E}ya(r),(Me&6)===0&&(ni=At()+500,Es(0))}}break;case 31:case 13:g=bl(r,2),g!==null&&Rt(g,r,2),ii(),hu(r,2)}if(r=pu(n),r===null&&Fo(e,t,n,vi,a),r===s)break;s=r}s!==null&&n.stopPropagation()}else Fo(e,t,n,null,a)}}function pu(e){return e=tc(e),yu(e)}var vi=null;function yu(e){if(vi=null,e=pl(e),e!==null){var t=m(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=x(t),e!==null)return e;e=null}else if(a===31){if(e=b(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 vi=e,null}function yx(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ih()){case ad:return 2;case ld:return 8;case Ps:case Fh:return 32;case nd:return 268435456;default:return 32}default:return 32}}var vu=!1,ul=null,dl=null,fl=null,Ds=new Map,zs=new Map,ml=[],Hy="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 vx(e,t){switch(e){case"focusin":case"focusout":ul=null;break;case"dragenter":case"dragleave":dl=null;break;case"mouseover":case"mouseout":fl=null;break;case"pointerover":case"pointerout":Ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zs.delete(t.pointerId)}}function Ls(e,t,a,n,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:r,targetContainers:[s]},t!==null&&(t=Gl(t),t!==null&&gx(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function By(e,t,a,n,s){switch(t){case"focusin":return ul=Ls(ul,e,t,a,n,s),!0;case"dragenter":return dl=Ls(dl,e,t,a,n,s),!0;case"mouseover":return fl=Ls(fl,e,t,a,n,s),!0;case"pointerover":var r=s.pointerId;return Ds.set(r,Ls(Ds.get(r)||null,e,t,a,n,s)),!0;case"gotpointercapture":return r=s.pointerId,zs.set(r,Ls(zs.get(r)||null,e,t,a,n,s)),!0}return!1}function jx(e){var t=pl(e.target);if(t!==null){var a=m(t);if(a!==null){if(t=a.tag,t===13){if(t=x(a),t!==null){e.blockedOn=t,dd(e.priority,function(){px(a)});return}}else if(t===31){if(t=b(a),t!==null){e.blockedOn=t,dd(e.priority,function(){px(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 ji(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=pu(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);ec=n,a.target.dispatchEvent(n),ec=null}else return t=Gl(a),t!==null&&gx(t),e.blockedOn=a,!1;t.shift()}return!0}function bx(e,t,a){ji(e)&&a.delete(t)}function $y(){vu=!1,ul!==null&&ji(ul)&&(ul=null),dl!==null&&ji(dl)&&(dl=null),fl!==null&&ji(fl)&&(fl=null),Ds.forEach(bx),zs.forEach(bx)}function bi(e,t){e.blockedOn===t&&(e.blockedOn=null,vu||(vu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,$y)))}var Ni=null;function Nx(e){Ni!==e&&(Ni=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Ni===e&&(Ni=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(yu(n||a)===null)continue;break}var r=Gl(a);r!==null&&(e.splice(t,3),t-=3,Wc(r,{pending:!0,data:s,method:a.method,action:n},n,s))}}))}function _n(e){function t(E){return bi(E,e)}ul!==null&&bi(ul,e),dl!==null&&bi(dl,e),fl!==null&&bi(fl,e),Ds.forEach(t),zs.forEach(t);for(var a=0;a<ml.length;a++){var n=ml[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<ml.length&&(a=ml[0],a.blockedOn===null);)jx(a),a.blockedOn===null&&ml.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var s=a[n],r=a[n+1],d=s[St]||null;if(typeof r=="function")d||Nx(a);else if(d){var g=null;if(r&&r.hasAttribute("formAction")){if(s=r,d=r[St]||null)g=d.formAction;else if(yu(s)!==null)continue}else g=d.action;typeof g=="function"?a[n+1]=g:(a.splice(n,3),n-=3),Nx(a)}}}function Sx(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(d){return s=d})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.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 ju(e){this._internalRoot=e}Si.prototype.render=ju.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=Ht();xx(a,n,e,t,null,null)},Si.prototype.unmount=ju.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xx(e.current,2,null,e,null,null),ii(),t[Vl]=null}};function Si(e){this._internalRoot=e}Si.prototype.unstable_scheduleHydration=function(e){if(e){var t=ud();e={blockedOn:null,target:e,priority:t};for(var a=0;a<ml.length&&t!==0&&t<ml[a].priority;a++);ml.splice(a,0,e),a===0&&jx(e)}};var wx=u.version;if(wx!=="19.3.1")throw Error(c(527,wx,"19.3.1"));he.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=y(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var qy={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:oe,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wi.isDisabled&&wi.supportsFiber)try{Vn=wi.inject(qy),Ot=wi}catch{}}return Us.createRoot=function(e,t){if(!f(e))throw Error(c(299));var a=!1,n="",s=m0,r=x0,d=h0;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&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=fx(e,1,!1,null,null,a,n,null,s,r,d,Sx),e[Vl]=t.current,Io(e),new ju(t)},Us.hydrateRoot=function(e,t,a){if(!f(e))throw Error(c(299));var n=!1,s="",r=m0,d=x0,g=h0,E=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(r=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(g=a.onRecoverableError),a.formState!==void 0&&(E=a.formState)),t=fx(e,1,!0,t,a??null,n,s,E,r,d,g,Sx),t.context=mx(null),a=t.current,n=Ht(),n=Ki(n),s=Fa(n),s.callback=null,Pa(a,s,n),a=n,t.current.lanes=a,Qn(t,a),ya(t),e[Vl]=t.current,Io(e),new Si(t)},Us.version="19.3.1",Us}var zx;function Fy(){if(zx)return Su.exports;zx=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),Su.exports=Iy(),Su.exports}var Py=Fy();var Yu=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,dh=/^[\\/]{2}/;function Wy(i,u){return u+i.replace(/\\/g,"/")}var Lx="popstate";function kx(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function ev(i={}){function u(c,f){let m=f.state?.masked,{pathname:x,search:b,hash:v}=m||c.location;return ku("",{pathname:x,search:b,hash:v},f.state&&f.state.usr||null,f.state&&f.state.key||"default",m?{pathname:c.location.pathname,search:c.location.search,hash:c.location.hash}:void 0)}function o(c,f){return typeof f=="string"?f:Un(f)}return av(u,o,null,i)}function Ke(i,u){if(i===!1||i===null||typeof i>"u")throw new Error(u)}function la(i,u){if(!i){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function tv(){return Math.random().toString(36).substring(2,10)}function Ux(i,u){return{usr:i.state,key:i.key,idx:u,masked:i.mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function ku(i,u,o=null,c,f){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof u=="string"?$n(u):u,state:o,key:u&&u.key||c||tv(),mask:f}}function Un({pathname:i="/",search:u="",hash:o=""}){return u&&u!=="?"&&(i+=u.charAt(0)==="?"?u:"?"+u),o&&o!=="#"&&(i+=o.charAt(0)==="#"?o:"#"+o),i}function $n(i){let u={};if(i){let o=i.indexOf("#");o>=0&&(u.hash=i.substring(o),i=i.substring(0,o));let c=i.indexOf("?");c>=0&&(u.search=i.substring(c),i=i.substring(0,c)),i&&(u.pathname=i)}return u}function av(i,u,o,c={}){let{window:f=document.defaultView,v5Compat:m=!1}=c,x=f.history,b="POP",v=null,y=p();y==null&&(y=0,x.replaceState({...x.state,idx:y},""));function p(){return(x.state||{idx:null}).idx}function h(){b="POP";let j=p(),S=j==null?null:j-y;y=j,v&&v({action:b,location:R.location,delta:S})}function w(j,S){b="PUSH";let T=kx(j)?j:ku(R.location,j,S);y=p()+1;let U=Ux(T,y),ee=R.createHref(T.mask||T);try{x.pushState(U,"",ee)}catch(Q){if(Q instanceof DOMException&&Q.name==="DataCloneError")throw Q;f.location.assign(ee)}m&&v&&v({action:b,location:R.location,delta:1})}function O(j,S){b="REPLACE";let T=kx(j)?j:ku(R.location,j,S);y=p();let U=Ux(T,y),ee=R.createHref(T.mask||T);x.replaceState(U,"",ee),m&&v&&v({action:b,location:R.location,delta:0})}function _(j){return lv(f,j)}let R={get action(){return b},get location(){return i(f,x)},listen(j){if(v)throw new Error("A history only accepts one active listener");return f.addEventListener(Lx,h),v=j,()=>{f.removeEventListener(Lx,h),v=null}},createHref(j){return u(f,j)},createURL:_,encodeLocation(j){let S=_(j);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:w,replace:O,go(j){return x.go(j)}};return R}function lv(i,u,o=!1){let c="http://localhost";i&&(c=i.location.origin!=="null"?i.location.origin:i.location.href),Ke(c,"No window.location.(origin|href) available to create URL");let f=typeof u=="string"?u:Un(u);return f=f.replace(/ $/,"%20"),!o&&dh.test(f)&&(f=c+f),new URL(f,c)}function fh(i,u,o="/"){return nv(i,u,o,!1)}function nv(i,u,o,c,f){let m=typeof u=="string"?$n(u):u,x=Ba(m.pathname||"/",o);if(x==null)return null;let b=sv(i),v=null,y=gv(x);for(let p=0;v==null&&p<b.length;++p)v=hv(b[p],y,c);return v}function sv(i){let u=mh(i);return rv(u),u}function mh(i,u=[],o=[],c="",f=!1){let m=(x,b,v=f,y)=>{let p={relativePath:y===void 0?x.path||"":y,caseSensitive:x.caseSensitive===!0,childrenIndex:b,route:x};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(c)&&v)return;Ke(p.relativePath.startsWith(c),`Absolute route path "${p.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(c.length)}let h=aa([c,p.relativePath]),w=o.concat(p);x.children&&x.children.length>0&&(Ke(x.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),mh(x.children,u,w,h,v)),!(x.path==null&&!x.index)&&u.push({path:h,score:mv(h,x.index),routesMeta:w.map((O,_)=>{let[R,j]=gh(O.relativePath,O.caseSensitive,_===w.length-1);return{...O,matcher:R,compiledParams:j}})})};return i.forEach((x,b)=>{if(x.path===""||!x.path?.includes("?"))m(x,b);else for(let v of xh(x.path))m(x,b,!0,v)}),u}function xh(i){let u=i.split("/");if(u.length===0)return[];let[o,...c]=u,f=o.endsWith("?"),m=o.replace(/\?$/,"");if(c.length===0)return f?[m,""]:[m];let x=xh(c.join("/")),b=[];return b.push(...x.map(v=>v===""?m:[m,v].join("/"))),f&&b.push(...x),b.map(v=>i.startsWith("/")&&v===""?"/":v)}function rv(i){i.sort((u,o)=>u.score!==o.score?o.score-u.score:xv(u.routesMeta.map(c=>c.childrenIndex),o.routesMeta.map(c=>c.childrenIndex)))}var iv=/^:[\w-]+$/,cv=3,ov=2,uv=1,dv=10,fv=-2,Hx=i=>i==="*";function mv(i,u){let o=i.split("/"),c=o.length;return o.some(Hx)&&(c+=fv),u&&(c+=ov),o.filter(f=>!Hx(f)).reduce((f,m)=>f+(iv.test(m)?cv:m===""?uv:dv),c)}function xv(i,u){return i.length===u.length&&i.slice(0,-1).every((c,f)=>c===u[f])?i[i.length-1]-u[u.length-1]:0}function hv(i,u,o=!1){let{routesMeta:c}=i,f={},m="/",x=[];for(let b=0;b<c.length;++b){let v=c[b],y=b===c.length-1,p=m==="/"?u:u.slice(m.length)||"/",h={path:v.relativePath,caseSensitive:v.caseSensitive,end:y},w=v.matcher&&v.compiledParams?hh(h,p,v.matcher,v.compiledParams):Oi(h,p),O=v.route;if(!w&&y&&o&&!c[c.length-1].route.index&&(w=Oi({path:v.relativePath,caseSensitive:v.caseSensitive,end:!1},p)),!w)return null;Object.assign(f,w.params),x.push({params:f,pathname:aa([m,w.pathname]),pathnameBase:vv(aa([m,w.pathnameBase])),route:O}),w.pathnameBase!=="/"&&(m=aa([m,w.pathnameBase]))}return x}function Oi(i,u){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[o,c]=gh(i.path,i.caseSensitive,i.end);return hh(i,u,o,c)}function hh(i,u,o,c){let f=u.match(o);if(!f)return null;let m=f[0],x=Hn(m,1),b=f.slice(1);return{params:c.reduce((y,{paramName:p,isOptional:h},w)=>{if(p==="*"){let _=b[w]||"";x=Hn(m.slice(0,m.length-_.length),1)}const O=b[w];return h&&!O?y[p]=void 0:y[p]=(O||"").replace(/%2F/g,"/"),y},{}),pathname:m,pathnameBase:x,pattern:i}}function gh(i,u=!1,o=!0){la(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let c=[],f="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(x,b,v,y,p)=>{if(c.push({paramName:b,isOptional:v!=null}),v){let h=p.charAt(y+x.length);return h&&h!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(c.push({paramName:"*"}),f+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?f+="\\/*$":i!==""&&i!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,u?void 0:"i"),c]}function gv(i){try{return i.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return la(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),i}}function Ba(i,u){if(u==="/")return i;if(!i.toLowerCase().startsWith(u.toLowerCase()))return null;let o=u.endsWith("/")?u.length-1:u.length,c=i.charAt(o);return c&&c!=="/"?null:i.slice(o)||"/"}function pv(i,u="/"){let{pathname:o,search:c="",hash:f=""}=typeof i=="string"?$n(i):i,m;return o?(o=yh(o),o.startsWith("/")||o.startsWith("\\")?m=Bx(o.substring(1),"/"):m=Bx(o,u)):m=u,{pathname:m,search:jv(c),hash:bv(f)}}function Bx(i,u){let o=Hn(u).split("/");return i.split("/").forEach(f=>{f===".."?o.length>1&&o.pop():f!=="."&&o.push(f)}),o.length>1?o.join("/"):"/"}function Cu(i,u,o,c){return`Cannot include a '${i}' character in a manually specified \`to.${u}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function yv(i){return i.filter((u,o)=>o===0||u.route.path&&u.route.path.length>0)}function ph(i){let u=yv(i);return u.map((o,c)=>c===u.length-1?o.pathname:o.pathnameBase)}function Vu(i,u,o,c=!1){let f;typeof i=="string"?f=$n(i):(f={...i},Ke(!f.pathname||!f.pathname.includes("?"),Cu("?","pathname","search",f)),Ke(!f.pathname||!f.pathname.includes("#"),Cu("#","pathname","hash",f)),Ke(!f.search||!f.search.includes("#"),Cu("#","search","hash",f)));let m=i===""||f.pathname==="",x=m?"/":f.pathname,b;if(x==null)b=o;else{let h=u.length-1;if(!c&&x.startsWith("..")){let w=x.split("/");for(;w[0]==="..";)w.shift(),h-=1;f.pathname=w.join("/")}b=h>=0?u[h]:"/"}let v=pv(f,b),y=x&&x!=="/"&&x.endsWith("/"),p=(m||x===".")&&o.endsWith("/");return!v.pathname.endsWith("/")&&(y||p)&&(v.pathname+="/"),v}var yh=i=>i.replace(/[\\/]{2,}/g,"/"),aa=i=>yh(i.join("/"));function Hn(i,u=0){let o=i.length;for(;o>u&&i.charCodeAt(o-1)===47;)o--;return o===i.length?i:i.slice(0,o)}var vv=i=>Hn(i).replace(/^\/*/,"/"),jv=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,bv=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,Nv=class{constructor(i,u,o,c=!1){this.status=i,this.statusText=u||"",this.internal=c,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function Sv(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function wv(i){let u=i.map(o=>o.route.path).filter(Boolean);return aa(u)||"/"}var vh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jh(i,u){let o=i;if(typeof o!="string"||!Yu.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let c=o,f=!1;if(vh)try{let m=new URL(window.location.href),x=dh.test(o)?new URL(Wy(o,m.protocol)):new URL(o),b=Ba(x.pathname,u);x.origin===m.origin&&b!=null?o=b+x.search+x.hash:f=!0}catch{la(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:f,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var $x=new URL("http://localhost");function bh(i){if(i.createURL)return i.createURL("/");try{return new URL(i.createHref("/"),$x)}catch{return $x}}function Ru(i,u){return i.origin===u.origin&&(i.origin!=="null"||i.protocol===u.protocol&&i.host===u.host)}function Ev(i,u){if(i.startsWith("//"))return!0;let o=u.protocol.toLowerCase();return i.toLowerCase().startsWith(o)?u.host===""||i.slice(o.length).startsWith("//"):!1}function Nh(i,u,o,c){let f=null;try{f=i==null?null:new URL(i,o)}catch{}let m=new URL(u,o),x=f!=null&&!Ru(f,o),b=!Ru(m,o);if(c==="reject"){if(x||b)throw new Error("External navigation is not allowed")}else if(b&&(f==null||!Ev(i,f)||!Ru(f,m)))throw new Error("External navigation is not allowed")}var Sh=["POST","PUT","PATCH","DELETE"];new Set(Sh);var Tv=["GET",...Sh];new Set(Tv);var Cv=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Rv(i){try{return Cv.includes(new URL(i).protocol)}catch{return!1}}var qn=N.createContext(null);qn.displayName="DataRouter";var _i=N.createContext(null);_i.displayName="DataRouterState";var wh=N.createContext(!1);function Av(){return N.useContext(wh)}var Eh=N.createContext({isTransitioning:!1});Eh.displayName="ViewTransition";var Ov=N.createContext(new Map);Ov.displayName="Fetchers";var Mv=N.createContext(null);Mv.displayName="Await";var Jt=N.createContext(null);Jt.displayName="Navigation";var Qs=N.createContext(null);Qs.displayName="Location";var va=N.createContext({outlet:null,matches:[],isDataRoute:!1});va.displayName="Route";var Gu=N.createContext(null);Gu.displayName="RouteError";var Th="REACT_ROUTER_ERROR",_v="REDIRECT",Dv="ROUTE_ERROR_RESPONSE";function zv(i){if(i.startsWith(`${Th}:${_v}:{`))try{let u=JSON.parse(i.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function Lv(i){if(i.startsWith(`${Th}:${Dv}:{`))try{let u=JSON.parse(i.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new Nv(u.status,u.statusText,u.data)}catch{}}function kv(i,{relative:u}={}){Ke(Xs(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:c}=N.useContext(Jt),{hash:f,pathname:m,search:x}=Zs(i,{relative:u}),b=m;return o!=="/"&&(b=m==="/"?o:aa([o,m])),c.createHref({pathname:b,search:x,hash:f})}function Xs(){return N.useContext(Qs)!=null}function na(){return Ke(Xs(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(Qs).location}var Ch="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Rh(i){N.useContext(Jt).static||N.useLayoutEffect(i)}function Di(){let{isDataRoute:i}=N.useContext(va);return i?Iv():Uv()}function Uv(){Ke(Xs(),"useNavigate() may be used only in the context of a <Router> component.");let i=N.useContext(qn),{basename:u,navigator:o}=N.useContext(Jt),{matches:c}=N.useContext(va),{pathname:f}=na(),m=JSON.stringify(ph(c)),x=N.useRef(!1);return Rh(()=>{x.current=!0}),N.useCallback((v,y={})=>{if(la(x.current,Ch),!x.current)return;if(typeof v=="number"){o.go(v);return}let p=Vu(v,JSON.parse(m),f,y.relative==="path");i==null&&u!=="/"&&(p.pathname=p.pathname==="/"?u:aa([u,p.pathname])),Nh(typeof v=="string"?v:Un(v),o.createHref(p),bh(o),"reject"),(y.replace?o.replace:o.push)(p,y.state,y)},[u,o,m,f,i])}N.createContext(null);function Hv(){let{matches:i}=N.useContext(va);return i[i.length-1]?.params??{}}function Zs(i,{relative:u}={}){let{matches:o}=N.useContext(va),{pathname:c}=na(),f=JSON.stringify(ph(o));return N.useMemo(()=>Vu(i,JSON.parse(f),c,u==="path"),[i,f,c,u])}function Bv(i,u){return Ah(i,u)}function Ah(i,u,o){Ke(Xs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=N.useContext(Jt),{matches:f}=N.useContext(va),m=f[f.length-1],x=m?m.params:{},b=m?m.pathname:"/",v=m?m.pathnameBase:"/",y=m&&m.route;{let j=y&&y.path||"";Mh(b,!y||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${j}">) 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
|
-
|
|
11
|
-
Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let p=na(),h;if(u){let j=typeof u=="string"?$n(u):u;Ke(v==="/"||j.pathname?.startsWith(v),`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 "${v}" but pathname "${j.pathname}" was given in the \`location\` prop.`),h=j}else h=p;let w=h.pathname||"/",O=w;if(v!=="/"){let j=v.replace(/^\//,"").split("/");O="/"+w.replace(/^\//,"").split("/").slice(j.length).join("/")}let _=o&&o.state.matches.length?o.state.matches.map(j=>Object.assign(j,{route:o.manifest[j.route.id]||j.route})):fh(i,{pathname:O});la(y||_!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),la(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.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=Gv(_&&_.map(j=>Object.assign({},j,{params:Object.assign({},x,j.params),pathname:aa([v,c.encodeLocation?c.encodeLocation(j.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?v:aa([v,c.encodeLocation?c.encodeLocation(j.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),f,o);return u&&R?N.createElement(Qs.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...h},navigationType:"POP"}},R):R}function $v(){let i=Jv(),u=Sv(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),o=i instanceof Error?i.stack:null,c="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:c},m={padding:"2px 4px",backgroundColor:c},x=null;return console.error("Error handled by React Router default ErrorBoundary:",i),x=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:m},"ErrorBoundary")," or"," ",N.createElement("code",{style:m},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},u),o?N.createElement("pre",{style:f},o):null,x)}var qv=N.createElement($v,null),Oh=class extends N.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,u){return u.location!==i.location||u.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:u.error,location:u.location,revalidation:i.revalidation||u.revalidation}}componentDidCatch(i,u){this.props.onError?this.props.onError(i,u):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const o=Lv(i.digest);o&&(i=o)}let u=i!==void 0?N.createElement(va.Provider,{value:this.props.routeContext},N.createElement(Gu.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?N.createElement(Yv,{error:i},u):u}};Oh.contextType=wh;var Au=new WeakMap;function Yv({children:i,error:u}){let{basename:o,navigator:c}=N.useContext(Jt);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let f=zv(u.digest);if(f){let m=Au.get(u);if(m)throw m;let x=jh(f.location,o),b=x.absoluteURL||x.to;if(Nh(f.location,b,bh(c),"allow-explicit"),Rv(b))throw new Error("Invalid redirect location");if(vh&&!Au.get(u))if(x.isExternal||f.reloadDocument)window.location.href=b;else{const v=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:f.replace}));throw Au.set(u,v),v}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${b}`})}}return i}function Vv({routeContext:i,match:u,children:o}){let c=N.useContext(qn);return c&&c.static&&c.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=u.route.id),N.createElement(va.Provider,{value:i},o)}function Gv(i,u=[],o){let c=o?.state;if(i==null){if(!c)return null;if(c.errors)i=c.matches;else if(u.length===0&&!c.initialized&&c.matches.length>0)i=c.matches;else return null}let f=i,m=c?.errors;if(m!=null){let p=f.findIndex(h=>h.route.id&&m?.[h.route.id]!==void 0);Ke(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),f=f.slice(0,Math.min(f.length,p+1))}let x=!1,b=-1;if(o&&c){x=c.renderFallback;for(let p=0;p<f.length;p++){let h=f[p];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(b=p),h.route.id){let{loaderData:w,errors:O}=c,_=h.route.loader&&!w.hasOwnProperty(h.route.id)&&(!O||O[h.route.id]===void 0);if(h.route.lazy||_){o.isStatic&&(x=!0),b>=0?f=f.slice(0,b+1):f=[f[0]];break}}}}let v=o?.onError,y=c&&v?(p,h)=>{v(p,{location:c.location,params:c.matches?.[0]?.params??{},pattern:wv(c.matches),errorInfo:h})}:void 0;return f.reduceRight((p,h,w)=>{let O,_=!1,R=null,j=null;c&&(O=m&&h.route.id?m[h.route.id]:void 0,R=h.route.errorElement||qv,x&&(b<0&&w===0?(Mh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,j=null):b===w&&(_=!0,j=h.route.hydrateFallbackElement||null)));let S=u.concat(f.slice(0,w+1)),T=()=>{let U;return O?U=R:_?U=j:h.route.Component?U=N.createElement(h.route.Component,null):h.route.element?U=h.route.element:U=p,N.createElement(Vv,{match:h,routeContext:{outlet:p,matches:S,isDataRoute:c!=null},children:U})};return c&&(h.route.ErrorBoundary||h.route.errorElement||w===0)?N.createElement(Oh,{location:c.location,revalidation:c.revalidation,component:R,error:O,children:T(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:y}):T()},null)}function Qu(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qv(i){let u=N.useContext(qn);return Ke(u,Qu(i)),u}function Xv(i){let u=N.useContext(_i);return Ke(u,Qu(i)),u}function Zv(i){let u=N.useContext(va);return Ke(u,Qu(i)),u}function Xu(i){let u=Zv(i),o=u.matches[u.matches.length-1];return Ke(o.route.id,`${i} can only be used on routes that contain a unique "id"`),o.route.id}function Kv(){return Xu("useRouteId")}function Jv(){let i=N.useContext(Gu),u=Xv("useRouteError"),o=Xu("useRouteError");return i!==void 0?i:u.errors?.[o]}function Iv(){let{router:i}=Qv("useNavigate"),u=Xu("useNavigate"),o=N.useRef(!1);return Rh(()=>{o.current=!0}),N.useCallback(async(f,m={})=>{la(o.current,Ch),o.current&&(typeof f=="number"?await i.navigate(f):await i.navigate(f,{fromRouteId:u,...m}))},[i,u])}var qx={};function Mh(i,u,o){!u&&!qx[i]&&(qx[i]=!0,la(!1,o))}N.memo(Fv);function Fv({routes:i,manifest:u,future:o,state:c,isStatic:f,onError:m}){return Ah(i,void 0,{manifest:u,state:c,isStatic:f,onError:m})}function Ze(i){Ke(!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 Pv({basename:i="/",children:u=null,location:o,navigationType:c="POP",navigator:f,static:m=!1,useTransitions:x}){Ke(!Xs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let b=i.replace(/^\/*/,"/"),v=N.useMemo(()=>({basename:b,navigator:f,static:m,useTransitions:x,future:{}}),[b,f,m,x]);typeof o=="string"&&(o=$n(o));let{pathname:y="/",search:p="",hash:h="",state:w=null,key:O="default",mask:_}=o,R=N.useMemo(()=>{let j=Ba(y,b);return j==null?null:{location:{pathname:j,search:p,hash:h,state:w,key:O,mask:_},navigationType:c}},[b,y,p,h,w,O,c,_]);return la(R!=null,`<Router basename="${b}"> is not able to match the URL "${y}${p}${h}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:N.createElement(Jt.Provider,{value:v},N.createElement(Qs.Provider,{children:u,value:R}))}function Wv({children:i,location:u}){return Bv(Uu(i),u)}function Uu(i,u=[]){let o=[];return N.Children.forEach(i,(c,f)=>{if(!N.isValidElement(c))return;let m=[...u,f];if(c.type===N.Fragment){o.push.apply(o,Uu(c.props.children,m));return}Ke(c.type===Ze,`[${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>`),Ke(!c.props.index||!c.props.children,"An index route cannot have child routes.");let x={id:c.props.id||m.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&&(x.children=Uu(c.props.children,m)),o.push(x)}),o}var Ci="get",Ri="application/x-www-form-urlencoded";function zi(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function ej(i){return zi(i)&&i.tagName.toLowerCase()==="button"}function tj(i){return zi(i)&&i.tagName.toLowerCase()==="form"}function aj(i){return zi(i)&&i.tagName.toLowerCase()==="input"}function lj(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function nj(i,u){return i.button===0&&(!u||u==="_self")&&!lj(i)}function Hu(i=""){return new URLSearchParams(typeof i=="string"||Array.isArray(i)||i instanceof URLSearchParams?i:Object.keys(i).reduce((u,o)=>{let c=i[o];return u.concat(Array.isArray(c)?c.map(f=>[o,f]):[[o,c]])},[]))}function sj(i,u){let o=Hu(i);return u&&u.forEach((c,f)=>{o.has(f)||u.getAll(f).forEach(m=>{o.append(f,m)})}),o}var Ei=null;function rj(){if(Ei===null)try{new FormData(document.createElement("form"),0),Ei=!1}catch{Ei=!0}return Ei}var ij=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ou(i){return i!=null&&!ij.has(i)?(la(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ri}"`),null):i}function cj(i,u){let o,c,f,m,x;if(tj(i)){let b=i.getAttribute("action");c=b?Ba(b,u):null,o=i.getAttribute("method")||Ci,f=Ou(i.getAttribute("enctype"))||Ri,m=new FormData(i)}else if(ej(i)||aj(i)&&(i.type==="submit"||i.type==="image")){let b=i.form;if(b==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let v=i.getAttribute("formaction")||b.getAttribute("action");if(c=v?Ba(v,u):null,o=i.getAttribute("formmethod")||b.getAttribute("method")||Ci,f=Ou(i.getAttribute("formenctype"))||Ou(b.getAttribute("enctype"))||Ri,m=new FormData(b,i),!rj()){let{name:y,type:p,value:h}=i;if(p==="image"){let w=y?`${y}.`:"";m.append(`${w}x`,"0"),m.append(`${w}y`,"0")}else y&&m.append(y,h)}}else{if(zi(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Ci,c=null,f=Ri,x=i}return m&&f==="text/plain"&&(x=m,m=void 0),{action:c,method:o.toLowerCase(),encType:f,formData:m,body:x}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Zu(i,u){if(i===!1||i===null||typeof i>"u")throw new Error(u)}function _h(i,u,o,c){let f=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return o?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${c}`:f.pathname=`${f.pathname}.${c}`:f.pathname==="/"?f.pathname=`_root.${c}`:u&&Ba(f.pathname,u)==="/"?f.pathname=`${Hn(u)}/_root.${c}`:f.pathname=`${Hn(f.pathname)}.${c}`,f}async function oj(i,u){if(i.id in u)return u[i.id];try{let o=await import(i.module);return u[i.id]=o,o}catch(o){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function uj(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function dj(i,u,o){let c=await Promise.all(i.map(async f=>{let m=u.routes[f.route.id];if(m){let x=await oj(m,o);return x.links?x.links():[]}return[]}));return hj(c.flat(1).filter(uj).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function Yx(i,u,o,c,f,m){let x=(v,y)=>o[y]?v.route.id!==o[y].route.id:!0,b=(v,y)=>o[y].pathname!==v.pathname||o[y].route.path?.endsWith("*")&&o[y].params["*"]!==v.params["*"];return m==="assets"?u.filter((v,y)=>x(v,y)||b(v,y)):m==="data"?u.filter((v,y)=>{let p=c.routes[v.route.id];if(!p||!p.hasLoader)return!1;if(x(v,y)||b(v,y))return!0;if(v.route.shouldRevalidate){let h=v.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(i,window.origin),nextParams:v.params,defaultShouldRevalidate:!0});if(typeof h=="boolean")return h}return!0}):[]}function fj(i,u,{includeHydrateFallback:o}={}){return mj(i.map(c=>{let f=u.routes[c.route.id];if(!f)return[];let m=[f.module];return f.clientActionModule&&(m=m.concat(f.clientActionModule)),f.clientLoaderModule&&(m=m.concat(f.clientLoaderModule)),o&&f.hydrateFallbackModule&&(m=m.concat(f.hydrateFallbackModule)),f.imports&&(m=m.concat(f.imports)),m}).flat(1))}function mj(i){return[...new Set(i)]}function xj(i){let u={},o=Object.keys(i).sort();for(let c of o)u[c]=i[c];return u}function hj(i,u){let o=new Set;return new Set(u),i.reduce((c,f)=>{let m=JSON.stringify(xj(f));return o.has(m)||(o.add(m),c.push({key:m,link:f})),c},[])}function Ku(){let i=N.useContext(qn);return Zu(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function gj(){let i=N.useContext(_i);return Zu(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Ju=N.createContext(void 0);Ju.displayName="FrameworkContext";function Li(){let i=N.useContext(Ju);return Zu(i,"You must render this element inside a <HydratedRouter> element"),i}function pj(i,u){let o=N.useContext(Ju),[c,f]=N.useState(!1),[m,x]=N.useState(!1),{onFocus:b,onBlur:v,onMouseEnter:y,onMouseLeave:p,onTouchStart:h}=u,w=N.useRef(null);N.useEffect(()=>{if(i==="render"&&x(!0),i==="viewport"){let R=S=>{S.forEach(T=>{x(T.isIntersecting)})},j=new IntersectionObserver(R,{threshold:.5});return w.current&&j.observe(w.current),()=>{j.disconnect()}}},[i]),N.useEffect(()=>{if(c){let R=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(R)}}},[c]);let O=()=>{f(!0)},_=()=>{f(!1),x(!1)};return o?i!=="intent"?[m,w,{}]:[m,w,{onFocus:Hs(b,O),onBlur:Hs(v,_),onMouseEnter:Hs(y,O),onMouseLeave:Hs(p,_),onTouchStart:Hs(h,O)}]:[!1,w,{}]}function Hs(i,u){return o=>{i&&i(o),o.defaultPrevented||u(o)}}function yj({page:i,...u}){let o=Av(),{nonce:c}=Li(),{router:f}=Ku(),m=N.useMemo(()=>fh(f.routes,i,f.basename),[f.routes,i,f.basename]);return m?(u.nonce==null&&c&&(u={...u,nonce:c}),o?N.createElement(jj,{page:i,matches:m,...u}):N.createElement(bj,{page:i,matches:m,...u})):null}function vj(i){let{manifest:u,routeModules:o}=Li(),[c,f]=N.useState([]);return N.useEffect(()=>{let m=!1;return dj(i,u,o).then(x=>{m||f(x)}),()=>{m=!0}},[i,u,o]),c}function jj({page:i,matches:u,...o}){let c=na(),{future:f}=Li(),{basename:m}=Ku(),x=N.useMemo(()=>{if(i===c.pathname+c.search+c.hash)return[];let b=_h(i,m,f.v8_trailingSlashAwareDataRequests,"rsc"),v=!1,y=[];for(let p of u)typeof p.route.shouldRevalidate=="function"?v=!0:y.push(p.route.id);return v&&y.length>0&&b.searchParams.set("_routes",y.join(",")),[b.pathname+b.search]},[m,f.v8_trailingSlashAwareDataRequests,i,c,u]);return N.createElement(N.Fragment,null,x.map(b=>N.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...o})))}function bj({page:i,matches:u,...o}){let c=na(),{future:f,manifest:m,routeModules:x}=Li(),{basename:b}=Ku(),{loaderData:v,matches:y}=gj(),p=N.useMemo(()=>Yx(i,u,y,m,c,"data"),[i,u,y,m,c]),h=N.useMemo(()=>Yx(i,u,y,m,c,"assets"),[i,u,y,m,c]),w=N.useMemo(()=>{if(i===c.pathname+c.search+c.hash)return[];let R=new Set,j=!1;if(u.forEach(T=>{let U=m.routes[T.route.id];!U||!U.hasLoader||(!p.some(ee=>ee.route.id===T.route.id)&&T.route.id in v&&x[T.route.id]?.shouldRevalidate||U.hasClientLoader?j=!0:R.add(T.route.id))}),R.size===0)return[];let S=_h(i,b,f.v8_trailingSlashAwareDataRequests,"data");return j&&R.size>0&&S.searchParams.set("_routes",u.filter(T=>R.has(T.route.id)).map(T=>T.route.id).join(",")),[S.pathname+S.search]},[b,f.v8_trailingSlashAwareDataRequests,v,c,m,p,u,i,x]),O=N.useMemo(()=>fj(h,m),[h,m]),_=vj(h);return N.createElement(N.Fragment,null,w.map(R=>N.createElement("link",{key:R,rel:"prefetch",as:"fetch",href:R,...o})),O.map(R=>N.createElement("link",{key:R,rel:"modulepreload",href:R,...o})),_.map(({key:R,link:j})=>N.createElement("link",{key:R,nonce:o.nonce,...j,crossOrigin:j.crossOrigin??o.crossOrigin})))}function Nj(...i){return u=>{i.forEach(o=>{typeof o=="function"?o(u):o!=null&&(o.current=u)})}}var Sj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Sj&&(window.__reactRouterVersion="7.18.4")}catch{}function wj({basename:i,children:u,useTransitions:o,window:c}){let f=N.useRef();f.current==null&&(f.current=ev({window:c,v5Compat:!0}));let m=f.current,[x,b]=N.useState({action:m.action,location:m.location}),v=N.useCallback(y=>{o===!1?b(y):N.startTransition(()=>b(y))},[o]);return N.useLayoutEffect(()=>m.listen(v),[m,v]),N.createElement(Pv,{basename:i,children:u,location:x.location,navigationType:x.action,navigator:m,useTransitions:o})}var Qe=N.forwardRef(function({onClick:u,discover:o="render",prefetch:c="none",relative:f,reloadDocument:m,replace:x,mask:b,state:v,target:y,to:p,preventScrollReset:h,viewTransition:w,defaultShouldRevalidate:O,..._},R){let{basename:j,navigator:S,useTransitions:T}=N.useContext(Jt),U=typeof p=="string"&&Yu.test(p),ee=jh(p,j);p=ee.to;let Q=kv(p,{relative:f}),ne=na(),K=null;if(b){let se=Vu(b,[],ne.mask?ne.mask.pathname:"/",!0);j!=="/"&&(se.pathname=se.pathname==="/"?j:aa([j,se.pathname])),K=S.createHref(se)}let[X,k,F]=pj(c,_),ae=Cj(p,{replace:x,mask:b,state:v,target:y,preventScrollReset:h,relative:f,viewTransition:w,defaultShouldRevalidate:O,useTransitions:T});function Se(se){u&&u(se),se.defaultPrevented||ae(se)}let Te=!(ee.isExternal||m),ze=N.createElement("a",{..._,...F,href:(Te?K:void 0)||ee.absoluteURL||Q,onClick:Te?Se:u,ref:Nj(R,k),target:y,"data-discover":!U&&o==="render"?"true":void 0});return X&&!U?N.createElement(N.Fragment,null,ze,N.createElement(yj,{page:Q})):ze});Qe.displayName="Link";var Bu=N.forwardRef(function({"aria-current":u="page",caseSensitive:o=!1,className:c="",end:f=!1,style:m,to:x,viewTransition:b,children:v,...y},p){let h=Zs(x,{relative:y.relative}),w=na(),O=N.useContext(_i),{navigator:_,basename:R}=N.useContext(Jt),j=O!=null&&_j(h)&&b===!0,S=_.encodeLocation?_.encodeLocation(h).pathname:h.pathname,T=w.pathname,U=O&&O.navigation&&O.navigation.location?O.navigation.location.pathname:null;o||(T=T.toLowerCase(),U=U?U.toLowerCase():null,S=S.toLowerCase()),U&&R&&(U=Ba(U,R)||U);const ee=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let Q=T===S||!f&&T.startsWith(S)&&T.charAt(ee)==="/",ne=U!=null&&(U===S||!f&&U.startsWith(S)&&U.charAt(S.length)==="/"),K={isActive:Q,isPending:ne,isTransitioning:j},X=Q?u:void 0,k;typeof c=="function"?k=c(K):k=[c,Q?"active":null,ne?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let F=typeof m=="function"?m(K):m;return N.createElement(Qe,{...y,"aria-current":X,className:k,ref:p,style:F,to:x,viewTransition:b},typeof v=="function"?v(K):v)});Bu.displayName="NavLink";var Ej=N.forwardRef(({discover:i="render",fetcherKey:u,navigate:o,reloadDocument:c,replace:f,state:m,method:x=Ci,action:b,onSubmit:v,relative:y,preventScrollReset:p,viewTransition:h,defaultShouldRevalidate:w,...O},_)=>{let{useTransitions:R}=N.useContext(Jt),j=Oj(),S=Mj(b,{relative:y}),T=x.toLowerCase()==="get"?"get":"post",U=typeof b=="string"&&Yu.test(b),ee=Q=>{if(v&&v(Q),Q.defaultPrevented)return;Q.preventDefault();let ne=Q.nativeEvent.submitter,K=ne?.getAttribute("formmethod")||x,X=()=>j(ne||Q.currentTarget,{fetcherKey:u,method:K,navigate:o,replace:f,state:m,relative:y,preventScrollReset:p,viewTransition:h,defaultShouldRevalidate:w});R&&o!==!1?N.startTransition(()=>X()):X()};return N.createElement("form",{ref:_,method:T,action:S,onSubmit:c?v:ee,...O,"data-discover":!U&&i==="render"?"true":void 0})});Ej.displayName="Form";function Tj(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Dh(i){let u=N.useContext(qn);return Ke(u,Tj(i)),u}function Cj(i,{target:u,replace:o,mask:c,state:f,preventScrollReset:m,relative:x,viewTransition:b,defaultShouldRevalidate:v,useTransitions:y}={}){let p=Di(),h=na(),w=Zs(i,{relative:x});return N.useCallback(O=>{if(nj(O,u)){O.preventDefault();let _=o!==void 0?o:Un(h)===Un(w),R=()=>p(i,{replace:_,mask:c,state:f,preventScrollReset:m,relative:x,viewTransition:b,defaultShouldRevalidate:v});y?N.startTransition(()=>R()):R()}},[h,p,w,o,c,f,u,i,m,x,b,v,y])}function ki(i){la(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 u=N.useRef(Hu(i)),o=N.useRef(!1),c=na(),f=N.useMemo(()=>sj(c.search,o.current?null:u.current),[c.search]),m=Di(),x=N.useCallback((b,v)=>{const y=Hu(typeof b=="function"?b(new URLSearchParams(f)):b);o.current=!0,m("?"+y,v)},[m,f]);return[f,x]}var Rj=0,Aj=()=>`__${String(++Rj)}__`;function Oj(){let{router:i}=Dh("useSubmit"),{basename:u}=N.useContext(Jt),o=Kv(),c=i.fetch,f=i.navigate;return N.useCallback(async(m,x={})=>{let{action:b,method:v,encType:y,formData:p,body:h}=cj(m,u);if(x.navigate===!1){let w=x.fetcherKey||Aj();await c(w,o,x.action||b,{defaultShouldRevalidate:x.defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:p,body:h,formMethod:x.method||v,formEncType:x.encType||y,flushSync:x.flushSync})}else await f(x.action||b,{defaultShouldRevalidate:x.defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:p,body:h,formMethod:x.method||v,formEncType:x.encType||y,replace:x.replace,state:x.state,fromRouteId:o,flushSync:x.flushSync,viewTransition:x.viewTransition})},[c,f,u,o])}function Mj(i,{relative:u}={}){let{basename:o}=N.useContext(Jt),c=N.useContext(va);Ke(c,"useFormAction must be used inside a RouteContext");let[f]=c.matches.slice(-1),m={...Zs(i||".",{relative:u})},x=na();if(i==null){m.search=x.search;let b=new URLSearchParams(m.search),v=b.getAll("index");if(v.some(p=>p==="")){b.delete("index"),v.filter(h=>h).forEach(h=>b.append("index",h));let p=b.toString();m.search=p?`?${p}`:""}}return(!i||i===".")&&f.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(m.pathname=m.pathname==="/"?o:aa([o,m.pathname])),Un(m)}function _j(i,{relative:u}={}){let o=N.useContext(Eh);Ke(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=Dh("useViewTransitionState"),f=Zs(i,{relative:u});if(!o.isTransitioning)return!1;let m=Ba(o.currentLocation.pathname,c)||o.currentLocation.pathname,x=Ba(o.nextLocation.pathname,c)||o.nextLocation.pathname;return Oi(f.pathname,x)!=null||Oi(f.pathname,m)!=null}function Iu(i,u){const{timeout:o=3e4,retries:c=1,retryDelay:f=2e3}={},[m,x]=N.useState(null),[b,v]=N.useState(!0),[y,p]=N.useState(null),[h,w]=N.useState(0),[O,_]=N.useState(null),R=N.useCallback(()=>w(j=>j+1),[]);return N.useEffect(()=>{if(!i){v(!1),x(null),p(null);return}let j=!1;v(!0),p(null);async function S(T){const U=new AbortController,ee=setTimeout(()=>U.abort(),o);try{const Q=await fetch(i,{signal:U.signal});if(clearTimeout(ee),!Q.ok)throw new Error(`HTTP ${Q.status}`);const ne=Q.headers.get("content-type")||"";if(!ne.includes("application/json"))throw new Error(`Expected JSON response but got ${ne||"unknown"} — server may be restarting`);const K=await Q.json();j||(x(K.data??K),p(null),_(new Date),v(!1))}catch(Q){if(clearTimeout(ee),j)return;if(T>0&&Q.name!=="AbortError")return await new Promise(ne=>setTimeout(ne,f)),j?void 0:S(T-1);Q.name==="AbortError"?p(`Request timed out (${Math.round(o/1e3)}s)`):p(String(Q.message||Q)),v(!1)}}return S(c),()=>{j=!0}},[i,h,o,c,f]),{data:m,loading:b,error:y,refetch:R,fetchedAt:O}}const zh=N.createContext({projects:[],activeProject:null,setActiveProject:()=>{},refreshProjects:()=>{}});function ja(){return N.useContext(zh)}function Dj(){const[i,u]=N.useState([]),[o,c]=ki(),f=N.useCallback(async()=>{try{const y=await(await fetch("/api/projects")).json();y.ok&&u(y.data||[])}catch{}},[]);N.useEffect(()=>{f()},[f]);const m=o.get("project"),x=m?i.find(v=>v.id===m)||i[0]||null:i[0]||null,b=N.useCallback(v=>{c(y=>(y.set("project",v),y))},[c]);return{projects:i,activeProject:x,setActiveProject:b,refreshProjects:f}}function De(i,u){const{activeProject:o}=ja(),c=i.includes("?")?"&":"?",f=o?`${i}${c}project=${o.id}`:i;return Iu(f)}const Ys=new Map;let Mu=!1,Lh=null;function zj(){Mu||(Mu=!0,queueMicrotask(()=>{Mu=!1;const i=Lh;if(!i||Ys.size===0){Ys.clear();return}const u=new Map(Ys);Ys.clear(),i(o=>{const c=new URLSearchParams(o);for(const[f,{value:m,defaultValue:x}]of u)m&&m!==x?c.set(f,m):c.delete(f);return c})}))}function lt(i,u=""){const[o,c]=ki(),f=o.get(i)??u,m=N.useCallback(x=>{Lh=c,Ys.set(i,{value:x,defaultValue:u}),zj()},[i,u,c]);return[f,m]}const Fu=N.createContext(null),Lj=["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 kj({url:i="/api/events",children:u}){const[o,c]=N.useState("connecting"),f=N.useRef(null),m=N.useRef(null),x=N.useRef(new Map),b=N.useCallback(()=>{f.current&&f.current.close(),c("connecting");const y=new EventSource(i);f.current=y;for(const p of Lj)y.addEventListener(p,h=>{let w;try{w=JSON.parse(h.data)}catch{return}const O=x.current.get(p);if(O)for(const _ of O)try{_(w)}catch{}});y.onopen=()=>c("connected"),y.onerror=()=>{y.close(),c("disconnected"),m.current=setTimeout(()=>{f.current===y&&b()},3e3)}},[i]);N.useEffect(()=>(b(),()=>{m.current&&(clearTimeout(m.current),m.current=null),f.current?.close(),f.current=null}),[b]);const v=N.useCallback((y,p)=>(x.current.has(y)||x.current.set(y,new Set),x.current.get(y).add(p),()=>{const h=x.current.get(y);h&&(h.delete(p),h.size===0&&x.current.delete(y))}),[]);return l.jsx(Fu.Provider,{value:{status:o,subscribe:v},children:u})}function $e(i,u){const o=N.useContext(Fu),c=N.useRef(u);c.current=u,N.useEffect(()=>{if(!o)return;const f=m=>c.current(m);return o.subscribe(i,f)},[o,i])}function kh(){return N.useContext(Fu)?.status??"disconnected"}const Vx=["backlog","active","blocked","review","done"],Bs={backlog:"Backlog",active:"In progress",blocked:"Blocked",review:"Review",done:"Done"},Ai=i=>i?new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Unknown",Ln=i=>i||"Unknown";function Gx({title:i,children:u,onClose:o}){const c=N.useRef(null);return N.useEffect(()=>{c.current?.showModal()},[]),l.jsxs("dialog",{ref:c,className:"work-dialog",onCancel:o,onClose:o,"aria-label":i,children:[l.jsxs("div",{className:"work-dialog-heading",children:[l.jsx("h2",{children:i}),l.jsx("button",{type:"button",className:"work-icon-button","aria-label":"Close dialog",onClick:o,children:"×"})]}),u]})}function Qx({sessionsOnly:i=!1}){const{activeProject:u}=ja(),{data:o,error:c,loading:f,refetch:m}=De("/api/work"),[x,b]=N.useState(""),[v,y]=N.useState(null),[p,h]=N.useState(!1),[w,O]=N.useState(!1),[_,R]=N.useState(""),[j,S]=N.useState(""),[T,U]=N.useState(null),ee=u?`?project=${encodeURIComponent(u.id)}`:"",{data:Q,loading:ne,refetch:K}=Iu(i||v?`/api/work/sessions${ee}`:""),X=kh();$e("increment-update",m),N.useEffect(()=>{const B=setInterval(()=>{m(),(i||v)&&K()},15e3);return()=>clearInterval(B)},[m,K,i,v]),N.useEffect(()=>{y(null),h(!1)},[u?.id]);async function k(B,V,P){if(w)return!1;O(!0),S("");try{const C=u?`?project=${encodeURIComponent(u.id)}`:"",G=await fetch(`/api/work${B}${C}`,{method:V,headers:{"Content-Type":"application/json"},body:JSON.stringify(P)}),ce=await G.json();if(!G.ok||!ce.ok)throw new Error(ce.error||"Could not save work");return m(),!0}catch(C){return S(C instanceof Error?C.message:"Could not save work"),m(),!1}finally{O(!1)}}async function F(B,V){V!==B.state&&await k(`/${encodeURIComponent(B.id)}`,"PATCH",{revision:B.revision,state:V})&&R(`${B.title} moved to ${Bs[V]}.`)}const[ae,Se]=lt("tool","all"),[Te,ze]=lt("done","14"),se=[...new Set((o?.items??[]).flatMap(B=>B.executions.map(V=>V.actor.split("@")[0]).filter(Boolean)))].sort(),Z=i||Te==="all"?0:Date.now()-Number(Te)*864e5,le=(o?.items??[]).filter(B=>`${B.title} ${B.summary} ${B.incrementId??""}`.toLowerCase().includes(x.toLowerCase())&&(ae==="all"||B.executions.some(V=>V.actor.split("@")[0]===ae))&&(B.state!=="done"||!Z||Date.parse(B.updatedAt)>=Z)),I=o?.items.find(B=>B.id===v),J=[...new Map((o?.items??[]).filter(B=>B.incrementId).map(B=>[B.incrementId,B])).values()],fe=u?`?project=${encodeURIComponent(u.id)}`:"";return l.jsxs("div",{className:"work-page",children:[l.jsxs("div",{className:"work-eyebrow",children:[l.jsx("span",{className:`work-live-dot ${X==="connected"?"connected":""}`}),X==="connected"?"LIVE WORKSPACE":"WORKSPACE",l.jsx("span",{children:"LOCAL · NO MODEL CALLS"})]}),l.jsxs("div",{className:"work-heading",children:[l.jsxs("div",{children:[l.jsx("h1",{children:i?"Execution history":"Work, without the reset."}),l.jsx("p",{children:i?"Follow the tools and people that carried each intent forward.":"Keep the intent. See the progress. Pick up with any tool."})]}),!i&&l.jsx("button",{className:"work-primary",onClick:()=>h(!0),children:"+ New intent"})]}),l.jsxs("div",{className:"work-metrics",children:[l.jsxs("div",{children:[l.jsx("span",{children:"In progress"}),l.jsx("strong",{children:o?.counts.active??"—"}),l.jsx("small",{children:"moving forward"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"Needs attention"}),l.jsx("strong",{className:"work-amber",children:o?.counts.blocked??"—"}),l.jsx("small",{children:"blocked or stale claims"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"Tasks complete"}),l.jsxs("strong",{children:[o?.totals.done??"—",l.jsxs("em",{children:[" / ",o?.totals.tasks??"—"]})]}),l.jsx("small",{children:"from the task ledger"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"Verification passed"}),l.jsx("strong",{children:o?.totals.verified??"—"}),l.jsx("small",{children:"linked increments with current reports"})]})]}),l.jsxs("div",{className:"work-toolbar",children:[l.jsxs("div",{className:"work-view-label",children:[i?"SETUPS & CONTINUATIONS":"INTENT BOARD",l.jsxs("span",{children:[le.length," items"]})]}),l.jsxs("div",{className:"work-filters",children:[l.jsxs("select",{"aria-label":"Agent tool",value:ae,onChange:B=>Se(B.target.value),children:[l.jsx("option",{value:"all",children:"All agents"}),se.map(B=>l.jsx("option",{value:B,children:B},B))]}),!i&&l.jsxs("select",{"aria-label":"Done window",value:Te,onChange:B=>ze(B.target.value),children:[l.jsx("option",{value:"7",children:"Done: last 7 days"}),l.jsx("option",{value:"14",children:"Done: last 14 days"}),l.jsx("option",{value:"30",children:"Done: last 30 days"}),l.jsx("option",{value:"all",children:"Done: all"})]})]}),l.jsxs("label",{className:"work-search",children:[l.jsx("span",{"aria-hidden":"true",children:"⌕"}),l.jsx("input",{"aria-label":"Search work",value:x,onChange:B=>b(B.target.value),placeholder:"Find an intent or increment…"})]})]}),(j||c)&&l.jsxs("div",{role:"alert",className:"work-error",children:[j||c,l.jsx("button",{onClick:m,children:"Retry"})]}),l.jsx("span",{className:"work-sr-only",role:"status","aria-live":"polite",children:_}),o?.warnings.map(B=>l.jsx("p",{className:"work-warning",children:B},B)),f&&!o?l.jsx("p",{className:"work-empty",children:"Reading local work…"}):i?l.jsxs("div",{className:"work-session-list",children:[l.jsx(Uj,{sessions:Q||[],loading:ne,items:o?.items||[],saving:w,link:async(B,V)=>{await k(`/${encodeURIComponent(V.id)}`,"PATCH",{revision:V.revision,sessionRef:B})&&R("Session linked to intent.")}}),le.filter(B=>B.executions.length).map(B=>l.jsxs("section",{className:"work-session-group",children:[l.jsxs("button",{onClick:()=>y(B.id),children:[B.title," ",l.jsx("span",{children:"↗"})]}),l.jsx($u,{item:B})]},B.id)),!le.some(B=>B.executions.length)&&l.jsx("p",{className:"work-empty",children:"No execution history yet. Claims appear automatically; add a setup to an intent to record its model and effort."})]}):l.jsx("div",{className:"work-board-scroll",children:l.jsx("div",{className:"work-board",children:Vx.map(B=>l.jsxs("section",{className:`work-column state-${B} ${T===B?"is-drop-target":""}`,"aria-label":`${Bs[B]} column`,onDragOver:V=>{V.dataTransfer.types.includes("application/specweave-intent")&&(V.preventDefault(),U(B))},onDragLeave:V=>{V.currentTarget.contains(V.relatedTarget)||U(null)},onDrop:V=>{V.preventDefault(),U(null);const P=o?.items.find(C=>C.id===V.dataTransfer.getData("application/specweave-intent"));P&&F(P,B)},children:[l.jsxs("div",{className:"work-column-title",children:[l.jsx("span",{className:"work-state-dot"}),l.jsx("h2",{children:Bs[B]}),l.jsx("span",{className:"work-count",children:le.filter(V=>V.state===B).length})]}),l.jsxs("div",{className:"work-cards",children:[le.filter(V=>V.state===B).map(V=>l.jsxs("article",{className:"work-card","data-intent-id":V.id,draggable:!w,onDragStart:P=>{P.dataTransfer.setData("application/specweave-intent",V.id),P.dataTransfer.effectAllowed="move"},onDragEnd:()=>U(null),children:[l.jsxs("div",{className:"work-card-top",children:[l.jsx("span",{children:V.incrementId?`INC ${V.incrementId.split("-")[0]}`:"INTENT"}),l.jsx("span",{className:"work-drag","aria-hidden":"true",children:"⠿"})]}),l.jsx("button",{className:"work-card-title",onClick:()=>y(V.id),children:V.title}),l.jsx("p",{className:"work-card-summary",children:V.summary||"Add a short outcome so the next session starts with context."}),V.tasks.total>0&&l.jsxs("div",{className:"work-progress",children:[l.jsxs("div",{children:[l.jsxs("span",{children:[V.tasks.done,"/",V.tasks.total," tasks"]}),l.jsxs("span",{children:[V.acs.done,"/",V.acs.total," ACs"]})]}),l.jsx("progress",{"aria-label":`${V.title} task progress`,value:V.tasks.done,max:V.tasks.total}),V.tasks.skipped>0&&l.jsxs("small",{children:[V.tasks.skipped," skipped"]})]}),l.jsxs("div",{className:"work-card-proof",children:[l.jsx("span",{className:`proof-${V.verification.status}`,children:V.verification.status==="passed"?"✓ Verified":V.verification.status==="failed"?"× Check failed":V.verification.status==="stale"?"↻ Recheck needed":V.incrementId?"○ Not verified":"○ No increment"}),V.incrementId&&l.jsx(Qe,{to:`/increments/${encodeURIComponent(V.incrementId)}${fe}`,"aria-label":`Evidence for ${V.title}`,children:"Evidence ↗"})]}),V.executions.length>0&&l.jsxs("div",{className:"work-card-actor",children:[l.jsx("span",{className:"work-avatar",children:(V.executions[V.executions.length-1]?.harness||"?").slice(0,1).toUpperCase()}),l.jsxs("span",{children:[Ln(V.executions[V.executions.length-1].harness),l.jsx("small",{children:V.executions[V.executions.length-1].model||"Model unknown"})]}),V.executions.length>1&&l.jsxs("span",{className:"work-setup-count",children:["+",V.executions.length-1]})]}),l.jsxs("label",{className:"work-state-control",children:[l.jsxs("span",{className:"work-sr-only",children:["State for ",V.title]}),l.jsx("select",{value:V.state,disabled:w,onChange:P=>{F(V,P.target.value)},children:Vx.map(P=>l.jsx("option",{value:P,children:Bs[P]},P))})]})]},V.id)),!le.some(V=>V.state===B)&&l.jsx("div",{className:"work-column-empty",children:B==="backlog"?"A clear intent is enough to start.":B==="done"?"Finished work lands here.":"No work here yet."})]})]},B))})}),l.jsxs("div",{className:"work-footnote",children:[l.jsx("span",{children:"Board state organizes work. Verification comes from linked increments."}),l.jsx("span",{children:o?`Updated ${Ai(o.generatedAt)}`:""})]}),p&&l.jsx(Gx,{title:"Capture an intent",onClose:()=>h(!1),children:l.jsxs("form",{className:"work-form",onSubmit:async B=>{B.preventDefault();const V=new FormData(B.currentTarget);await k("","POST",Object.fromEntries(V))&&(h(!1),R("Intent created."))},children:[l.jsx("p",{children:"Describe the outcome. Small work can start without an increment."}),l.jsxs("label",{children:["Title",l.jsx("input",{name:"title",required:!0,maxLength:180,autoFocus:!0,placeholder:"What should be different when this is done?"})]}),l.jsxs("label",{children:["Intent",l.jsx("textarea",{name:"summary",rows:3,maxLength:2e3,placeholder:"Why it matters, expected result, or context for the next session."})]}),l.jsxs("label",{children:["Linked increment",l.jsxs("select",{name:"incrementId",children:[l.jsx("option",{value:"",children:"No increment yet"}),J.map(B=>l.jsx("option",{value:B.incrementId,children:B.incrementId},B.incrementId))]})]}),j&&l.jsx("p",{role:"alert",className:"work-error",children:j}),l.jsx("button",{disabled:w,className:"work-primary",children:w?"Saving…":"Create intent"})]})}),I&&l.jsx(Gx,{title:I.title,onClose:()=>y(null),children:l.jsxs("div",{className:"work-detail",children:[l.jsxs("div",{className:"work-detail-meta",children:[l.jsx("span",{children:Bs[I.state]}),l.jsx("span",{children:I.incrementId||"No increment linked"})]}),l.jsxs("form",{className:"work-form",onSubmit:async B=>{B.preventDefault();const V=Object.fromEntries(new FormData(B.currentTarget));await k(`/${encodeURIComponent(I.id)}`,"PATCH",{...V,revision:I.revision})&&R("Intent updated.")},children:[l.jsxs("label",{children:["Intent",l.jsx("textarea",{name:"summary",defaultValue:I.summary,rows:3,maxLength:2e3})]}),l.jsxs("label",{children:["Linked increment",l.jsxs("select",{name:"incrementId",defaultValue:I.incrementId||"",children:[l.jsx("option",{value:"",children:"No increment"}),J.map(B=>l.jsx("option",{value:B.incrementId,children:B.incrementId},B.incrementId))]})]}),l.jsx("button",{className:"work-secondary",disabled:w,children:"Save context"})]},`${I.id}-summary`),l.jsxs("section",{className:"work-evidence",children:[l.jsx("h3",{children:"Delivery evidence"}),l.jsxs("div",{children:[l.jsxs("strong",{children:[I.tasks.done,"/",I.tasks.total]}),l.jsxs("span",{children:["tasks complete · ",I.evidenceCount," with ledger evidence"]})]}),l.jsxs("p",{children:[I.acs.done,"/",I.acs.total," acceptance criteria · Verification"," ",I.verification.status,I.verification.ranAt?` · ${Ai(I.verification.ranAt)}`:""]}),I.incrementId?l.jsx(Qe,{to:`/increments/${encodeURIComponent(I.incrementId)}${fe}`,children:"Open specification, tasks and verification ↗"}):l.jsx("p",{children:"Attach an increment when this work needs a specification and checks."})]}),l.jsxs("section",{children:[l.jsx("h3",{children:"Execution history"}),l.jsx("p",{className:"work-muted",children:"A tool change keeps the same intent. Ledger actors are observed; added setups are declared. Unknown facts remain unknown."}),l.jsx($u,{item:I})]}),l.jsxs("details",{className:"work-add-setup",children:[l.jsx("summary",{children:"Link a local Codex or Claude Code session"}),l.jsx("p",{className:"work-muted",children:"Only sessions rooted in this project appear. Linking associates the observed setup with this intent; it never imports conversation text."}),ne?l.jsx("p",{className:"work-muted",children:"Reading metadata…"}):l.jsxs("form",{className:"work-form",onSubmit:async B=>{B.preventDefault();const V=new FormData(B.currentTarget).get("sessionRef");await k(`/${encodeURIComponent(I.id)}`,"PATCH",{revision:I.revision,sessionRef:V})&&R("Session linked.")},children:[l.jsxs("label",{children:["Local session",l.jsxs("select",{"aria-label":"Local session",name:"sessionRef",required:!0,defaultValue:"",children:[l.jsx("option",{value:"",disabled:!0,children:"Select a session"}),(Q||[]).map(B=>l.jsxs("option",{value:B.key,children:[B.harness," · ",B.sessionId.slice(0,8)," · ",Ai(B.updatedAt)]},B.key))]})]}),l.jsx("button",{className:"work-secondary",disabled:w||!Q?.length,children:"Link observed session"}),!Q?.length&&l.jsx("p",{children:"No supported local session metadata found. Record a setup below."})]})]}),l.jsxs("details",{className:"work-add-setup",children:[l.jsx("summary",{children:"+ Record a setup or continuation"}),l.jsxs("form",{className:"work-form",onSubmit:async B=>{B.preventDefault();const V=B.currentTarget,P=Object.fromEntries(new FormData(V));await k(`/${encodeURIComponent(I.id)}/executions`,"POST",{...P,revision:I.revision})&&(V.reset(),R("Execution setup recorded."))},children:[l.jsxs("div",{className:"work-form-grid",children:[l.jsxs("label",{children:["Harness",l.jsx("input",{name:"harness",required:!0,placeholder:"Codex, Claude Code, Cursor…",maxLength:120})]}),l.jsxs("label",{children:["Model",l.jsx("input",{name:"model",placeholder:"Exact model ID, if known",maxLength:120})]}),l.jsxs("label",{children:["Effort",l.jsx("input",{name:"effort",placeholder:"e.g. high",maxLength:80})]}),l.jsxs("label",{children:["Provider",l.jsx("input",{name:"provider",placeholder:"e.g. OpenAI, OpenRouter",maxLength:120})]}),l.jsxs("label",{children:["Surface",l.jsx("input",{name:"surface",placeholder:"Desktop, terminal, VS Code…",maxLength:120})]}),l.jsxs("label",{children:["Session ID",l.jsx("input",{name:"sessionId",placeholder:"Optional source session",maxLength:200})]})]}),l.jsxs("label",{children:["Continuation note",l.jsx("input",{name:"note",placeholder:"What changed or where to continue",maxLength:500})]}),l.jsx("button",{className:"work-primary",disabled:w,children:"Record setup"})]})]}),I.handoff&&l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Latest handoff"}),l.jsx("pre",{children:I.handoff})]}),j&&l.jsx("p",{role:"alert",className:"work-error",children:j})]})})]})}function $u({item:i}){return i.executions.length?l.jsx("ol",{className:"work-timeline",children:i.executions.map(u=>l.jsxs("li",{children:[l.jsx("div",{className:"work-timeline-dot"}),l.jsxs("div",{children:[l.jsxs("div",{className:"work-timeline-title",children:[l.jsx("strong",{children:Ln(u.harness)}),l.jsx("span",{children:Ln(u.model)}),l.jsx("small",{children:u.source==="ledger"?"Ledger":u.source==="session"?"Observed":"Declared"})]}),l.jsxs("p",{children:["Effort ",Ln(u.effort)," · Provider ",Ln(u.provider)," · ",Ln(u.surface)]}),l.jsxs("p",{children:[Ai(u.startedAt)," · ",u.actor,u.sessionId?` · ${u.sessionId}`:""]}),u.note&&l.jsx("p",{className:"work-timeline-note",children:u.note})]})]},u.id))}):l.jsx("p",{className:"work-empty small",children:"No execution recorded. Task claims will appear here automatically."})}function Uj({sessions:i,loading:u,items:o,saving:c,link:f}){return l.jsxs("section",{className:"work-local-sessions",children:[l.jsx("h2",{children:"Local sessions"}),l.jsx("p",{className:"work-muted",children:"Project-scoped Codex and Claude Code metadata. Associate sessions with an intent explicitly. Model changes in large logs may be missing between observed windows."}),u&&l.jsx("p",{className:"work-empty",children:"Reading local metadata…"}),!u&&!i.length&&l.jsx("p",{className:"work-empty",children:"No supported session metadata found for this project."}),i.map(m=>l.jsxs("article",{className:"work-session-group",children:[l.jsxs("div",{className:"work-local-session-heading",children:[l.jsx("strong",{children:m.harness}),l.jsx("span",{children:m.sessionId.slice(0,8)}),l.jsx("small",{children:m.coverage==="partial"?"Partial log coverage":"Full log coverage"})]}),l.jsx($u,{item:{executions:m.segments}}),l.jsxs("form",{className:"work-session-link",onSubmit:async x=>{x.preventDefault();const b=o.find(v=>v.id===new FormData(x.currentTarget).get("intent"));b&&await f(m.key,b)},children:[l.jsxs("label",{children:[l.jsxs("span",{className:"work-sr-only",children:["Intent for session ",m.sessionId]}),l.jsxs("select",{name:"intent",required:!0,defaultValue:"",children:[l.jsx("option",{value:"",disabled:!0,children:"Link to an intent…"}),o.map(x=>l.jsx("option",{value:x.id,children:x.title},x.id))]})]}),l.jsx("button",{className:"work-secondary",disabled:c||!o.length,children:"Link session"})]})]},m.key))]})}function Hj(){const{activeProject:i}=ja();return i?l.jsx(Bj,{projectId:i.id},i.id):l.jsx("div",{className:"hub-page",role:"status",children:"Loading project…"})}function Bj({projectId:i}){const u=i?`?project=${encodeURIComponent(i)}`:"",{data:o,loading:c,error:f,refetch:m}=Iu(`/api/project-hub${u}`),[x,b]=N.useState(null),[v,y]=N.useState(0),[p,h]=N.useState(!1),[w,O]=N.useState(""),[_,R]=N.useState(!1),[j,S]=N.useState(""),[T,U]=N.useState(""),[ee,Q]=N.useState("codex"),[ne,K]=N.useState(!1),X=N.useRef(null),k=N.useRef(null);$e("increment-update",m),N.useEffect(()=>{const J=setInterval(m,15e3);return()=>clearInterval(J)},[m]),N.useEffect(()=>{T&&X.current?.showModal()},[T]);function F(J){y(o?.hub.revision??0),b(J),O(""),S(""),R(!1)}async function ae(J,fe,B){if(p)return!1;h(!0),O(""),S("");try{const V=await fetch(`/api/project-hub${J}${u}`,{method:fe,headers:{"Content-Type":"application/json"},body:JSON.stringify(B)}),P=await V.json();if(!V.ok||!P.ok)throw V.status===409&&(R(!0),m()),new Error(P.error||"Could not save");return m(),!0}catch(V){return O(V instanceof Error?V.message:String(V)),!1}finally{h(!1)}}async function Se(J){J.preventDefault();const fe=Object.fromEntries(new FormData(J.currentTarget));await ae(x==="profile"?"":x==="work"?"/work":x==="artifact"?"/artifacts":"/routines",x==="profile"?"PATCH":"POST",{...fe,revision:v})&&(b(null),S(x==="routine"?"Routine saved. Configure its schedule in your AI tool when ready.":"Saved to this project."))}async function Te(J,fe){if(ne)return;K(!0),O("");const B=new URLSearchParams({harness:ee,...i?{project:i}:{},...J?{intent:J}:{},...fe?{routine:fe}:{}});try{const V=await fetch(`/api/project-hub/brief?${B}`),P=await V.json();if(!V.ok||!P.ok)throw new Error(P.error||"Could not prepare brief");U(P.data.text)}catch(V){O(V instanceof Error?V.message:String(V))}finally{K(!1)}}async function ze(){try{await navigator.clipboard.writeText(T),S("Worker brief copied.")}catch{k.current?.focus(),k.current?.select(),S("Select and copy the brief below.")}}const se=o?.hub,Z=o?.work.items??[],le=Z.filter(J=>J.state!=="done"),I=`/${u}`;return!se&&c?l.jsx("div",{className:"hub-page",role:"status",children:"Loading project…"}):se?l.jsxs("div",{className:"hub-page",children:[l.jsxs("header",{className:"hub-heading",children:[l.jsxs("div",{children:[l.jsx("p",{className:"hub-eyebrow",children:"PROJECT HUB / SHARED CONTEXT"}),l.jsx("h1",{children:se.name}),l.jsx("p",{className:"hub-lede",children:"One goal. Every task starts with the same context."})]}),l.jsxs("div",{className:"hub-actions",children:[l.jsxs("label",{className:"hub-harness",children:["Prepare for",l.jsxs("select",{"aria-label":"Brief target",value:ee,onChange:J=>Q(J.target.value),children:[l.jsx("option",{value:"codex",children:"Codex"}),l.jsx("option",{value:"claude",children:"Claude Code"}),l.jsx("option",{value:"generic",children:"Any AI tool"})]})]}),l.jsx("button",{className:"hub-primary",disabled:ne,onClick:()=>Te(),children:ne?"Preparing…":"Coordinator brief ↗"})]})]}),(f||w)&&l.jsxs("div",{className:"hub-error",role:"alert",children:[w||f," ",l.jsx("button",{onClick:m,children:"Refresh"}),_&&x&&l.jsxs("p",{children:["Review the current project details above before retrying your draft. ",l.jsx("button",{disabled:c,onClick:()=>{y(se.revision),R(!1),O(""),S("Draft retained. Save when ready to apply it to the current revision.")},children:"Use latest revision for draft"})]})]}),j&&l.jsx("p",{role:"status",className:"hub-notice",children:j}),o?.work.warnings.map(J=>l.jsx("p",{className:"hub-error",children:J},J)),l.jsxs("div",{className:"hub-grid",children:[l.jsxs("section",{className:"hub-purpose",children:[l.jsxs("div",{className:"hub-section-head",children:[l.jsx("h2",{children:"Project brief"}),l.jsx("button",{onClick:()=>F("profile"),children:se.goal?"Edit brief":"Set project goal"})]}),l.jsx("p",{className:"hub-goal",children:se.goal||"Give this project a clear outcome."}),l.jsx("h3",{children:"Shared context"}),l.jsx("p",{className:"hub-context",children:se.context||"Keep decisions, working agreements and useful background here. Future tasks can pick up where you left off."}),l.jsxs("div",{className:"hub-meta",children:[se.updatedAt?`Updated ${new Date(se.updatedAt).toLocaleDateString()}`:"Ready for your first brief",l.jsxs("span",{children:["Revision ",se.revision]})]})]}),l.jsxs("section",{className:"hub-work",children:[l.jsxs("div",{className:"hub-section-head",children:[l.jsxs("h2",{children:["Work in motion ",l.jsx("span",{children:le.length})]}),l.jsx("button",{onClick:()=>F("work"),children:"+ Add work"})]}),l.jsx("p",{className:"hub-description",children:"Prepare an assignment, then continue in your preferred AI tool."}),l.jsx("div",{className:"hub-work-list",children:le.slice(0,8).map(J=>l.jsxs("article",{className:"hub-work-row",children:[l.jsxs("div",{children:[l.jsx("span",{className:`hub-state hub-state-${J.state}`,children:J.state==="active"?"In progress":J.state}),l.jsx("h3",{children:J.title}),l.jsx("p",{children:J.summary||"No description yet"})]}),l.jsx("button",{"aria-label":`Prepare ${J.title}`,disabled:ne,onClick:()=>Te(J.id),children:"Prepare ↗"})]},J.id))}),!le.length&&l.jsx("p",{className:"hub-empty",children:"No open work. Add a distinct outcome to get started."}),l.jsxs(Qe,{className:"hub-text-link",to:I,children:["Open work board ",le.length>8?`· ${le.length} open items`:"→"]})]})]}),x&&l.jsxs("section",{className:"hub-form-panel","aria-label":`Add or edit ${x}`,children:[l.jsxs("div",{className:"hub-section-head",children:[l.jsx("h2",{children:x==="profile"?"Edit project brief":`Add ${x}`}),l.jsx("button",{onClick:()=>b(null),disabled:p,children:"Cancel"})]}),l.jsxs("form",{onSubmit:Se,children:[x==="profile"?l.jsxs(l.Fragment,{children:[l.jsxs("label",{children:["Project name",l.jsx("input",{name:"name",required:!0,maxLength:180,defaultValue:se.name,autoFocus:!0})]}),l.jsxs("label",{children:["Goal",l.jsx("textarea",{"aria-label":"Goal",name:"goal",required:!0,maxLength:2e3,defaultValue:se.goal,rows:2})]}),l.jsxs("label",{children:["Shared context",l.jsx("textarea",{"aria-label":"Shared context",name:"context",maxLength:16e3,defaultValue:se.context,rows:5})]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("label",{children:["Title",l.jsx("input",{name:"title",required:!0,maxLength:180,autoFocus:!0})]}),x==="work"&&l.jsxs("label",{children:["Outcome and scope",l.jsx("textarea",{name:"summary",maxLength:2e3,rows:3})]}),x==="artifact"&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{children:["File path or HTTPS link",l.jsx("input",{name:"location",required:!0,maxLength:2e3,placeholder:"reports/research.md or https://…"})]}),l.jsxs("label",{children:["Related work",l.jsxs("select",{name:"intentId",children:[l.jsx("option",{value:"",children:"Shared with the whole project"}),Z.map(J=>l.jsx("option",{value:J.id,children:J.title},J.id))]})]})]}),x==="routine"&&l.jsxs(l.Fragment,{children:[l.jsxs("label",{children:["Requested cadence",l.jsx("input",{name:"cadence",required:!0,maxLength:180,placeholder:"Mondays at 9am, America/New_York"})]}),l.jsxs("label",{children:["Instructions",l.jsx("textarea",{name:"instructions",required:!0,maxLength:8e3,rows:4})]}),l.jsx("p",{className:"hub-description",children:"This saves a reusable routine. It does not schedule or start an agent."})]})]}),l.jsx("button",{className:"hub-primary",disabled:p,type:"submit",children:p?"Saving…":"Save"})]},x)]}),l.jsxs("div",{className:"hub-grid hub-libraries",children:[l.jsxs("section",{children:[l.jsxs("div",{className:"hub-section-head",children:[l.jsxs("h2",{children:["Artifact library ",l.jsx("span",{children:se.artifacts.length})]}),l.jsx("button",{onClick:()=>F("artifact"),children:"+ Add artifact"})]}),l.jsx("p",{className:"hub-description",children:"Documents, designs, code and research. Kept with their work."}),!se.artifacts.length&&l.jsx("p",{className:"hub-empty",children:"Add a file or link to keep useful outputs within reach."}),se.artifacts.map(J=>l.jsxs("article",{className:"hub-library-row",children:[l.jsxs("div",{children:[l.jsxs("small",{children:[J.kind==="file"?"FILE":"LINK"," · ",Z.find(fe=>fe.id===J.intentId)?.title||(J.intentId?"Linked work unavailable":"PROJECT")]}),l.jsx("h3",{children:J.title}),J.kind==="link"&&/^https:\/\//i.test(J.location)?l.jsx("a",{href:J.location,target:"_blank",rel:"noreferrer",children:J.location}):l.jsxs("a",{href:`/api/project-hub/artifacts/${J.id}/download${u}`,download:!0,children:[J.location," ↓"]})]}),l.jsx("button",{"aria-label":`Remove ${J.title}`,disabled:p,onClick:()=>ae(`/artifacts/${J.id}`,"DELETE",{revision:se.revision}),children:"Remove"})]},J.id))]}),l.jsxs("section",{children:[l.jsxs("div",{className:"hub-section-head",children:[l.jsxs("h2",{children:["Routines ",l.jsx("span",{children:se.routines.length})]}),l.jsx("button",{onClick:()=>F("routine"),children:"+ Add routine"})]}),l.jsx("p",{className:"hub-description",children:"Reusable assignments. Scheduling stays in your AI tool."}),!se.routines.length&&l.jsx("p",{className:"hub-empty",children:"Capture a repeatable workflow, then prepare it whenever needed."}),se.routines.map(J=>l.jsxs("article",{className:"hub-library-row",children:[l.jsxs("div",{children:[l.jsxs("small",{children:["DEFINITION · ",J.cadence]}),l.jsx("h3",{children:J.title}),l.jsx("p",{children:J.instructions}),l.jsx("span",{className:"hub-schedule-status",children:"No schedule managed here"})]}),l.jsxs("div",{className:"hub-row-actions",children:[l.jsx("button",{disabled:ne,onClick:()=>Te(void 0,J.id),children:"Prepare ↗"}),l.jsx("button",{"aria-label":`Remove ${J.title}`,disabled:p,onClick:()=>ae(`/routines/${J.id}`,"DELETE",{revision:se.revision}),children:"Remove"})]})]},J.id))]})]}),l.jsxs("footer",{className:"hub-footer",children:[l.jsx("span",{children:"Shared files stay with your project."}),l.jsx(Qe,{to:`/sessions${u}`,children:"Sessions & execution history ↗"})]}),l.jsxs("dialog",{className:"hub-dialog",ref:X,onClose:()=>U(""),"aria-label":"Portable worker brief",children:[l.jsxs("div",{className:"hub-section-head",children:[l.jsx("h2",{children:"Portable worker brief"}),l.jsx("button",{onClick:()=>X.current?.close(),"aria-label":"Close worker brief",children:"Close"})]}),l.jsx("p",{children:"Fresh context for your next task. Copy into your chosen AI tool."}),l.jsx("textarea",{ref:k,"aria-label":"Worker brief text",readOnly:!0,value:T}),l.jsx("button",{className:"hub-primary",onClick:ze,children:"Copy brief"})]})]}):l.jsxs("div",{className:"hub-page",children:[l.jsx("div",{role:"alert",children:f||"Project unavailable"}),l.jsx("button",{onClick:m,children:"Retry"})]})}const $j=[["/project","Project hub","◈"],["/","Work board","▥"],["/timeline","Timeline","≡"],["/increments","Evidence","▤"],["/sessions","Sessions","↗"],["/sync","Connections","⇄"]],qj=[["/overview","Overview"],["/activity","Activity"],["/costs","Usage & estimates"],["/analytics","Analytics"],["/errors","Errors"],["/notifications","Notifications"],["/workspace","Workspace"],["/repos","Repositories"],["/plugins","Plugins"],["/marketplace","Marketplace"],["/hooks","Hooks"],["/agents","Agents"],["/services","Services"],["/config","Settings"]];function Yj(){const{projects:i,activeProject:u,setActiveProject:o}=ja(),[c]=ki(),f=kh(),m=x=>c.get("project")?`${x}?project=${encodeURIComponent(c.get("project"))}`:x;return l.jsxs("aside",{className:"work-sidebar",children:[l.jsx(Vj,{}),l.jsxs("div",{className:"work-project-select",children:[l.jsx("label",{htmlFor:"workspace-project",children:"WORKSPACE"}),l.jsx("select",{id:"workspace-project",value:u?.id||"",onChange:x=>o(x.target.value),children:i.map(x=>l.jsx("option",{value:x.id,children:x.name},x.id))})]}),l.jsx("nav",{"aria-label":"Main navigation",className:"work-navigation",children:$j.map(([x,b,v])=>l.jsxs(Bu,{title:b,end:x==="/",to:m(x),className:({isActive:y})=>y?"active":"",children:[l.jsx("span",{"aria-hidden":"true",className:"work-nav-icon",children:v}),l.jsx("span",{className:"work-nav-label",children:b})]},x))}),l.jsxs("div",{className:"work-sidebar-note",children:[l.jsx("span",{children:"ONE INTENT."}),l.jsxs("strong",{children:["Every tool.",l.jsx("br",{}),"Every next step."]}),l.jsx("p",{children:"Your work stays in your project."})]}),l.jsxs("details",{className:"work-advanced",children:[l.jsx("summary",{title:"Diagnostics and settings",children:"Diagnostics & settings"}),l.jsx("nav",{"aria-label":"Advanced navigation",children:qj.map(([x,b])=>l.jsx(Bu,{to:m(x),children:b},x))})]}),l.jsxs("div",{className:"work-sidebar-footer",children:[l.jsx("span",{className:`work-live-dot ${f==="connected"?"connected":""}`}),l.jsx("span",{children:f==="connected"?"Live connection":"Reconnecting…"})]})]})}function Vj(){return l.jsxs("div",{className:"work-brand",children:[l.jsxs("div",{"aria-hidden":"true",className:"work-brand-mark",children:["S",l.jsx("span",{children:"W"})]}),l.jsxs("span",{children:["SpecWeave",l.jsx("small",{children:"WORK CONTINUITY"})]})]})}function Gj(){const{activeProject:i}=ja();return l.jsxs("header",{className:"work-header",children:[l.jsxs("span",{children:["Workspace ",l.jsx("b",{children:"/"})," ",l.jsx("strong",{children:i?.name||"Project"})]}),l.jsx("span",{children:"Intent → evidence → continuation"})]})}class Qj extends N.Component{constructor(u){super(u),this.state={hasError:!1,error:null}}static getDerivedStateFromError(u){return{hasError:!0,error:u}}componentDidCatch(u,o){console.error("[Dashboard ErrorBoundary]",u,o.componentStack)}componentDidUpdate(u){this.state.hasError&&u.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 Xj={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"},Zj={indigo:"text-indigo-400",emerald:"text-emerald-400",amber:"text-amber-400",rose:"text-rose-400",cyan:"text-cyan-400"};function de({title:i,value:u,subtitle:o,tooltip:c,color:f="indigo"}){return l.jsxs("div",{className:`bg-gradient-to-br ${Xj[f]} 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:i}),l.jsx("div",{className:`text-2xl font-bold ${Zj[f]}`,children:u}),o&&l.jsx("div",{className:"text-gray-500 text-xs mt-1",children:o}),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 Kj={active:"#6366f1",completed:"#10b981",paused:"#f59e0b",planning:"#06b6d4",abandoned:"#ef4444",backlog:"#6b7280",ready_for_review:"#8b5cf6"};function Jj(i){return Kj[i]||"#6b7280"}function Ij({segments:i,size:u=160,centerLabel:o,centerValue:c}){const f=i.reduce((v,y)=>v+y.value,0);if(f===0)return l.jsx("div",{className:"flex items-center justify-center",style:{width:u,height:u},children:l.jsx("span",{className:"text-gray-600 text-xs",children:"No data"})});const m=52,x=2*Math.PI*m;let b=0;return l.jsxs("div",{className:"relative inline-flex items-center justify-center",style:{width:u,height:u},children:[l.jsx("svg",{viewBox:"0 0 128 128",className:"w-full h-full -rotate-90",children:i.map((v,y)=>{const h=v.value/f*x,w=b;return b+=h,l.jsx("circle",{cx:"64",cy:"64",r:m,fill:"none",stroke:v.color,strokeWidth:"12",strokeDasharray:`${h} ${x-h}`,strokeDashoffset:-w,className:"transition-all duration-500"},y)})}),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-gray-200",children:c}),o&&l.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-wider",children:o})]})]})}function Fj(i){return Object.entries(i).filter(([u,o])=>o>0).map(([u,o])=>({label:u,value:o,color:Jj(u)}))}const Pj={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 xe({label:i,variant:u="default"}){return l.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-md text-xs font-medium ${Pj[u]}`,children:i})}function Ui(i){switch(i){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 Wj({size:i="md"}){const u={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};return l.jsxs("svg",{className:`${u[i]} 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 ct(){return l.jsx("div",{className:"flex items-center justify-center h-64",children:l.jsx(Wj,{size:"lg"})})}function sa({message:i,onRetry:u,title:o="Something went wrong"}){const c=i.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:o}),l.jsx("p",{className:"text-xs text-rose-400/80 mt-1",children:i})]}),u&&l.jsx("button",{onClick:u,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 Xx(i){switch(i){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function eb(i){switch(i){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return i||"Unknown"}}const Zx=i=>i.billingContext?.planType==="subscription";function tb(){const[i,u]=N.useState(0),{data:o,loading:c,error:f,refetch:m}=De(`/api/overview?_r=${i}`),[x,b]=N.useState([]),[v,y]=N.useState([]),[p,h]=N.useState([]),{activeProject:w}=ja();$e("increment-update",()=>u(j=>j+1)),$e("notification",()=>u(j=>j+1)),$e("sync-update",()=>u(j=>j+1)),$e("sync-error",()=>u(j=>j+1)),$e("cost-update",()=>u(j=>j+1));const O=N.useRef(null);N.useEffect(()=>{if(!w||O.current===w.id)return;O.current=w.id;const j=`project=${w.id}`;fetch(`/api/activity/stream?limit=20&${j}`).then(S=>S.json()).then(S=>{S.ok&&Array.isArray(S.data)&&b(S.data)}).catch(()=>{})},[w]);const _=N.useCallback(j=>{b(S=>[j,...S].slice(0,20))},[]);if($e("activity",_),N.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=5").then(j=>j.json()).then(j=>{j.ok&&Array.isArray(j.data)&&y(j.data)}).catch(()=>{}),fetch("/api/sync/gaps").then(j=>j.json()).then(j=>{j.ok&&Array.isArray(j.data)&&h(j.data)}).catch(()=>{})},[i]),c)return l.jsx(ct,{});if(f)return l.jsx(sa,{message:f,onRetry:m});if(!o)return null;const R=Fj(o.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:[o.project.name||"Project"," Overview"]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(Qe,{to:"/increments?status=active",className:"group",children:l.jsx(de,{title:"Active Increments",value:o.project.activeIncrements,subtitle:`${o.project.totalIncrements} total`,color:"indigo"})}),l.jsx(Qe,{to:"/increments?status=completed",className:"group",children:l.jsx(de,{title:"Completed",value:o.project.completedIncrements,subtitle:`${Math.round(o.project.completedIncrements/Math.max(o.project.totalIncrements,1)*100)}% done`,color:"emerald"})}),l.jsx(Qe,{to:"/costs",className:"group",children:l.jsx(de,{title:"Estimated API Value",value:o.costs.totalCost==null?"Unknown":`$${o.costs.totalCost.toFixed(2)}`,subtitle:Zx(o.costs)?`via Claude Code · $${o.costs.billingContext?.monthlyAmount??"?"}/mo plan`:`Claude Code · ${o.costs.sessionCount.toLocaleString()} sessions · legacy estimates`,color:"amber"})}),l.jsx(Qe,{to:"/analytics",className:"group",children:l.jsx(de,{title:"Events Today",value:o.analytics.last24hEvents,subtitle:`${o.analytics.totalEvents.toLocaleString()} total`,color:"cyan"})})]}),l.jsx(ab,{}),Zx(o.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(xe,{label:"Subscription",variant:"info"}),l.jsx("span",{className:"text-xs text-gray-300",children:"Legacy rate estimates from Claude Code logs; actual bills may differ."})]}),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(Ij,{segments:R,centerValue:o.project.totalIncrements,centerLabel:"total"})}),l.jsx("div",{className:"flex flex-wrap gap-2 mt-4 justify-center",children:R.map(j=>l.jsxs(Qe,{to:`/increments?status=${j.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:j.color}}),l.jsxs("span",{className:"text-xs text-gray-500 hover:text-gray-300",children:[j.label," (",j.value,")"]})]},j.label))})]}),l.jsxs(Qe,{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(o.sync.platforms).length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No sync platforms configured"}):Object.entries(o.sync.platforms).map(([j,S])=>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:j}),S.configDetail&&l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:S.configDetail}),!S.configDetail&&S.lastImport&&l.jsxs("div",{className:"text-xs text-gray-600 mt-0.5",children:["Last: ",new Date(S.lastImport).toLocaleDateString()]})]}),l.jsx(xe,{label:eb(S.connectionStatus||S.lastSyncResult),variant:Xx(S.connectionStatus)!=="default"?Xx(S.connectionStatus):Ui(S.lastSyncResult||"")})]},j))}),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:[o.notifications.criticalCount>0&&l.jsx(Qe,{to:"/notifications",onClick:j=>j.stopPropagation(),children:l.jsx(xe,{label:`${o.notifications.criticalCount} critical`,variant:"error"})}),l.jsx(Qe,{to:"/notifications",onClick:j=>j.stopPropagation(),children:l.jsx(xe,{label:`${o.notifications.pendingCount} pending`,variant:o.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(Qe,{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:x.length===0?l.jsx("p",{className:"text-gray-600 text-xs",children:"No recent activity"}):x.map((j,S)=>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 ${j.severity==="error"?"bg-rose-400":j.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:j.title}),l.jsxs("div",{className:"text-[10px] text-gray-600",children:[j.category,j.timestamp&&` · ${Kx(j.timestamp)}`]})]})]},S))})]})]}),p.length>0&&l.jsxs(Qe,{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(xe,{label:`${p.length} gaps`,variant:"warning"}),l.jsxs("span",{className:"text-xs text-gray-300",children:[p.length," increment",p.length!==1?"s have":" has"," partial sync coverage"]})]}),v.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(Qe,{to:"/sync",className:"text-[10px] text-indigo-400 hover:text-indigo-300",children:"View all"})]}),l.jsx("div",{className:"space-y-2",children:v.map((j,S)=>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:j.provider}),l.jsx(xe,{label:j.incrementId,variant:"default"})]}),l.jsx("div",{className:"text-xs text-gray-500 mt-1 truncate",children:j.error}),l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:Kx(j.timestamp)})]})]},S))})]}),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(o.project.typeBreakdown).map(([j,S])=>l.jsxs(Qe,{to:`/increments?type=${j}`,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:j}),l.jsx("span",{className:"text-xs text-gray-500 bg-gray-800 px-2 py-0.5 rounded",children:S})]},j))})]})]})}function ab(){const[i,u]=N.useState(0);$e("error-detected",()=>u(O=>O+1));const{data:o}=De(`/api/prompt-health?_r=${i}`);if(!o?.health||o.health.warningLevel==="normal")return null;const{health:c,alert:f}=o,m=f?.level==="emergency",x=c.warningLevel==="critical"||m,b=x?"border-rose-500/30":"border-amber-500/20",v=x?"bg-rose-500/10":"bg-amber-500/10",y=x?"text-rose-400":"text-amber-400",p=Math.round(c.baseline/1e3),h=Math.min(Math.round(c.baseline/2e5*100),100),w=x?"bg-rose-500":"bg-amber-500";return l.jsxs("div",{className:`${v} border ${b} 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(xe,{label:x?"Critical":"Warning",variant:x?"error":"warning"}),l.jsxs("span",{className:`text-xs ${y}`,children:["Prompt baseline: ",p,"KB (",h,"% of context window)"]})]}),l.jsx(Qe,{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:`${h}%`}})}),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"]}),f&&l.jsxs("span",{className:y,children:["Compactions: ",f.compactionCount]})]})]})}function Kx(i){try{const u=Date.now()-new Date(i).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function lb(){const i=Di(),[u]=ki();return N.useCallback(o=>{const c=u.get("project");if(c){const f=o.includes("?")?"&":"?";i(`${o}${f}project=${encodeURIComponent(c)}`)}else i(o)},[i,u])}function Pu({title:i,description:u}){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:i}),u&&l.jsx("p",{className:"text-gray-600 text-xs mt-1 max-w-xs",children:u})]})}const $s=50;function nb(){const[i,u]=N.useState(0),[o,c]=N.useState(0),[f,m]=lt("status","all"),[x,b]=lt("type","all"),v=lb(),y=N.useRef(void 0);$e("increment-update",()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>u(U=>U+1),500)}),N.useEffect(()=>()=>{y.current&&clearTimeout(y.current)},[]);const p=new URLSearchParams({_r:String(i),limit:String($s),offset:String(o)});f!=="all"&&p.set("status",f),x!=="all"&&p.set("type",x);const{data:h,loading:w,error:O,refetch:_}=De(`/api/increments?${p}`),R=N.useRef(f),j=N.useRef(x);if(N.useEffect(()=>{(R.current!==f||j.current!==x)&&(c(0),R.current=f,j.current=x)},[f,x]),w&&o===0)return l.jsx(ct,{});if(O)return l.jsx(sa,{message:O,onRetry:_});if(!h)return null;const S=Object.keys(h.summary).filter(U=>U!=="total"&&h.summary[U]>0),T=h.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??h.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(_u,{label:"All",active:f==="all",onClick:()=>m("all"),count:h.summary.total}),S.map(U=>l.jsx(_u,{label:U,active:f===U,onClick:()=>m(U),count:h.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(_u,{label:"All",active:x==="all",onClick:()=>b("all")})})]}),T&&T.total>0&&l.jsxs("span",{className:"text-xs text-gray-500",children:["Showing ",o+1,"–",Math.min(o+$s,T.total)," of ",T.total]})]}),h.increments.length===0?l.jsx(Pu,{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:h.increments.map(U=>l.jsxs("tr",{onClick:()=>v(`/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(xe,{label:U.status,variant:Ui(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(sb,{priority:U.priority})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jx,{completed:U.tasks.completed,total:U.tasks.total})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(Jx,{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?rb(U.lastActivity):"-"})})]},U.id))})]})}),T&&T.total>$s&&l.jsxs("div",{className:"flex justify-center gap-2",children:[l.jsx("button",{onClick:()=>c(Math.max(0,o-$s)),disabled:o===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(o+$s),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 _u({label:i,active:u,onClick:o,count:c}){return l.jsxs("button",{onClick:o,className:`px-3 py-1 text-xs rounded-md transition-colors capitalize ${u?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:[i,c!==void 0&&l.jsx("span",{className:"ml-1 text-[10px] text-gray-500",children:c})]})}function Jx({completed:i,total:u}){const o=u>0?Math.round(i/u*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:`${o}%`}})}),l.jsxs("span",{className:"text-xs text-gray-500",children:[i,"/",u]})]})}function sb({priority:i}){const u={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 ${u[i]||u.P2}`,children:i})}function rb(i){try{const u=new Date(i),c=new Date().getTime()-u.getTime(),f=Math.floor(c/6e4);if(f<1)return"Just now";if(f<60)return`${f}m ago`;const m=Math.floor(f/60);if(m<24)return`${m}h ago`;const x=Math.floor(m/24);return x<7?`${x}d ago`:u.toLocaleDateString()}catch{return i}}function ib(){const[i,u]=N.useState("skills"),[o,c]=N.useState(!1),[f,m]=N.useState(0);$e("analytics-event",()=>m(S=>S+1));const{data:x,loading:b,error:v,refetch:y,fetchedAt:p}=De(`/api/analytics/summary?_r=${f}`),{data:h,loading:w,refetch:O}=De(`/api/analytics/skills?_r=${f}`);if(b||w)return l.jsx(ct,{});if(v)return l.jsx(sa,{message:v,onRetry:y});if(!x)return null;const _=x.topCommands?.reduce((S,T)=>S+T.count,0)||0,R=x.topSkills?.reduce((S,T)=>S+T.count,0)||0,j=x.topAgents?.reduce((S,T)=>S+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:[p&&l.jsxs("span",{className:"text-[10px] text-gray-600",children:["Updated ",p.toLocaleTimeString()]}),l.jsxs("span",{className:"text-sm text-gray-500",children:[x.totalEvents.toLocaleString()," total events"]}),l.jsx("button",{onClick:()=>{c(!0),y(),O(),setTimeout(()=>c(!1),600)},disabled:o,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 ${o?"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(de,{title:"Total Events",value:x.totalEvents.toLocaleString(),subtitle:`${x.successRate}% success rate`,color:"indigo",tooltip:`${x.totalEvents} events tracked from analytics JSONL`}),l.jsx(de,{title:"Commands",value:_.toLocaleString(),subtitle:`${x.topCommands?.length||0} unique`,color:"cyan",tooltip:`${_} total command invocations across ${x.topCommands?.length||0} distinct commands`}),l.jsx(de,{title:"Skills",value:R.toLocaleString(),subtitle:`${x.topSkills?.length||0} unique`,color:"emerald",tooltip:`${R} total skill activations across ${x.topSkills?.length||0} distinct skills`}),l.jsx(de,{title:"Agents",value:j.toLocaleString(),subtitle:`${x.topAgents?.length||0} unique`,color:"amber",tooltip:`${j} agent spawns across ${x.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(S=>l.jsx("button",{onClick:()=>u(S.key),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${i===S.key?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:S.label},S.key))}),i==="commands"&&l.jsx(cb,{commands:x.topCommands||[]}),i==="skills"&&l.jsx(ob,{skills:h||[]}),i==="agents"&&l.jsx(ub,{agents:x.topAgents||[]}),i==="daily"&&l.jsx(db,{days:x.dailySummaries||[]})]})}function cb({commands:i}){if(i.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 u=[...i].sort((c,f)=>f.count-c.count),o=u[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:u.map((c,f)=>{const m=Math.max(2,c.count/o*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:["#",f+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:`${m}%`}})})}),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 ob({skills:i}){const u=[...i].sort((o,c)=>c.count-o.count);return u.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:u.map((o,c)=>{const f=o.count>0?Math.round(o.successCount/o.count*100):100,m=f>=90?"success":f>=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:o.name})}),l.jsx("td",{className:"px-4 py-2.5",children:o.plugin&&l.jsx("span",{className:"text-[10px] text-gray-600 bg-gray-800 px-1.5 py-0.5 rounded",children:o.plugin})}),l.jsx("td",{className:"px-4 py-2.5 text-sm font-mono text-gray-400 text-right",children:o.count.toLocaleString()}),l.jsx("td",{className:"px-4 py-2.5 text-right",children:l.jsx(xe,{label:`${f}%`,variant:m})}),l.jsx("td",{className:"px-4 py-2.5 text-xs text-gray-600 text-right whitespace-nowrap",children:o.lastUsed?fb(o.lastUsed):"-"})]},o.name)})})]})]})}function ub({agents:i}){if(i.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 u=[...i].sort((c,f)=>f.count-c.count),o=u[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:u.map((c,f)=>{const m=Math.max(2,c.count/o*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:["#",f+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:`${m}%`}})})}),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 db({days:i}){const u=i.slice(-14);if(u.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 o=Math.max(...u.map(m=>m.totalEvents),1),c=u.reduce((m,x)=>m+x.totalEvents,0),f=Math.round(c/u.length);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsx(de,{title:"Period Total",value:c.toLocaleString(),subtitle:`Last ${u.length} days`,color:"indigo"}),l.jsx(de,{title:"Daily Average",value:f.toLocaleString(),color:"cyan"}),l.jsx(de,{title:"Peak Day",value:o.toLocaleString(),subtitle:u.find(m=>m.totalEvents===o)?.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 ",u.length," Days)"]}),l.jsx("div",{className:"flex items-end gap-1.5 h-40",children:u.map(m=>{const x=Math.max(2,m.totalEvents/o*100),b=m.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:m.totalEvents}),l.jsx("div",{className:"w-full bg-indigo-500/40 rounded-t hover:bg-indigo-500/60 transition-colors cursor-default",style:{height:`${x}%`},title:`${m.date}: ${m.totalEvents} events`}),l.jsx("span",{className:"text-[8px] text-gray-700",children:b})]},m.date)})})]})]})}function fb(i){if(!i)return"";try{const u=Date.now()-new Date(i).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return""}}function Uh({items:i,maxBars:u=10}){const o=[...i].sort((f,m)=>m.value-f.value).slice(0,u),c=Math.max(...o.map(f=>f.value),1);return l.jsx("div",{className:"space-y-2",children:o.map((f,m)=>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:f.label,children:f.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:`${f.value/c*100}%`,backgroundColor:f.color||"#6366f1"}})}),l.jsx("span",{className:"text-xs text-gray-500 w-10 text-right",children:f.value})]},m))})}const mb={anthropic:"#6366f1",openai:"#10b981",google:"#f59e0b",mistral:"#ef4444",groq:"#8b5cf6",together:"#06b6d4","aws-bedrock":"#f97316","azure-openai":"#3b82f6"};function xb({data:i,showProviderLines:u=!1,height:o=200}){if(!i||i.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},f=600,m=f-c.left-c.right,x=o-c.top-c.bottom,b=Math.max(...i.map(R=>R.total_cost),.01),v=R=>c.left+R/Math.max(i.length-1,1)*m,y=R=>c.top+x-R/b*x,p=i.map((R,j)=>`${j===0?"M":"L"} ${v(j).toFixed(1)} ${y(R.total_cost).toFixed(1)}`).join(" "),h=[];if(u){const R=new Set;i.forEach(j=>Object.keys(j.providers).forEach(S=>R.add(S)));for(const j of R){const S=i.map((T,U)=>{const ee=T.providers[j]?.cost??0;return`${U===0?"M":"L"} ${v(U).toFixed(1)} ${y(ee).toFixed(1)}`}).join(" ");h.push({provider:j,path:S,color:mb[j]||"#9ca3af"})}}const w=[0,b/2,b].map(R=>({value:R,y:y(R),label:`$${R<1?R.toFixed(2):R.toFixed(0)}`})),O=Math.min(i.length,5),_=Array.from({length:O},(R,j)=>{const S=Math.round(j/Math.max(O-1,1)*(i.length-1));return{x:v(S),label:i[S].date.slice(5)}});return l.jsxs("div",{className:"w-full",children:[l.jsxs("svg",{viewBox:`0 0 ${f} ${o}`,className:"w-full",preserveAspectRatio:"xMidYMid meet",children:[w.map((R,j)=>l.jsx("line",{x1:c.left,y1:R.y,x2:f-c.right,y2:R.y,stroke:"#374151",strokeDasharray:"4 4"},j)),w.map((R,j)=>l.jsx("text",{x:c.left-8,y:R.y+4,textAnchor:"end",fill:"#9ca3af",fontSize:"10",children:R.label},`y-${j}`)),_.map((R,j)=>l.jsx("text",{x:R.x,y:o-5,textAnchor:"middle",fill:"#9ca3af",fontSize:"10",children:R.label},`x-${j}`)),h.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:p,fill:"none",stroke:"#6366f1",strokeWidth:"2.5"}),i.map((R,j)=>l.jsx("circle",{cx:v(j),cy:y(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)}`})},j))]}),u&&h.length>0&&l.jsx("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-gray-400",children:h.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 hb={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 Ix(i){return i<.01?`$${i.toFixed(4)}`:`$${i.toFixed(2)}`}function Fx(i){return i>=1e6?`${(i/1e6).toFixed(1)}M`:i>=1e3?`${(i/1e3).toFixed(1)}K`:String(i)}function gb({data:i}){const[u,o]=N.useState(null);if(!i||Object.keys(i).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(i).sort((f,m)=>m[1].total_cost-f[1].total_cost);return l.jsx("div",{className:"space-y-2",children:c.map(([f,m])=>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:()=>o(u===f?null:f),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 ${hb[f]||"bg-gray-500/20 text-gray-400"}`,children:f}),l.jsxs("span",{className:"text-xs text-gray-500",children:[m.sessions," sessions"]})]}),l.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[l.jsxs("span",{className:"text-gray-400",children:[Fx(m.total_tokens)," tokens"]}),l.jsx("span",{className:"text-gray-200 font-medium",children:Ix(m.total_cost)}),l.jsx("span",{className:"text-gray-600",children:u===f?"▲":"▼"})]})]}),u===f&&l.jsx("div",{className:"ml-6 mt-1 space-y-1",children:Object.entries(m.models).sort((x,b)=>b[1].cost-x[1].cost).map(([x,b])=>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:x}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{children:Fx(b.tokens)}),l.jsx("span",{className:"text-gray-300",children:Ix(b.cost)})]})]},x))})]},f))})}function pb({currentSpend:i,monthlyLimit:u}){if(!u)return null;const o=i/u*100,c=Math.min(o,100);let f="bg-emerald-500",m="";return o>=100?(f="bg-red-500",m="animate-pulse ring-1 ring-red-500/50"):o>=80&&(f="bg-amber-500"),l.jsxs("div",{className:`rounded-lg p-3 bg-gray-800/50 ${m}`,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:["$",i.toFixed(2)," / $",u.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 ${f}`,style:{width:`${c}%`}})}),l.jsx("div",{className:"mt-1 text-right",children:l.jsxs("span",{className:"text-xs text-gray-500",children:[o.toFixed(1),"%"]})})]})}function yb(){const[i,u]=N.useState("overview"),[o,c]=N.useState(null),[f,m]=N.useState(0);$e("cost-update",()=>m(T=>T+1));const{data:x,loading:b,error:v,refetch:y}=De(`/api/costs/summary?_r=${f}`);if(b)return l.jsx(ct,{});if(v)return l.jsx(sa,{message:v,onRetry:y});if(!x)return null;const p=x.sessions||[],h=x.billingContext?.planType==="subscription",w=x.modelBreakdown?Object.entries(x.modelBreakdown).map(([T,U])=>({model:T,...U})).sort((T,U)=>(U.cost??-1)-(T.cost??-1)):jb(p),O=p.reduce((T,U)=>T+(U.inputTokens||0),0),_=p.reduce((T,U)=>T+(U.outputTokens||0),0),R=p.reduce((T,U)=>T+(U.cacheReadTokens||0),0),j=p.reduce((T,U)=>T+(U.cacheWriteTokens||0),0),S=O+_+R+j;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:h&&x.billingContext?.monthlyAmount?`$${x.billingContext.monthlyAmount}/mo plan`:"API-equivalent usage analytics"})]})]})}),l.jsxs("p",{className:"text-xs text-gray-400 border border-gray-800 rounded-lg px-4 py-3",children:["Local Claude Code logs only. Prices use exact matches in the ",x.pricingAsOf||"2026-03"," legacy rate table. These are API estimates, not bills. Unknown or mixed-model sessions are unpriced.",!!x.unpricedSessionCount&&l.jsxs("span",{className:"block mt-1 text-amber-300",children:[x.unpricedSessionCount," unpriced session",x.unpricedSessionCount===1?"":"s"," · Priced subtotal: ",Bl(x.estimatedSubtotal)]})]}),h&&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(xe,{label:"Subscription",variant:"info"}),l.jsxs("span",{className:"text-xs text-gray-300",children:[x.billingContext?.monthlyAmount?`$${x.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(de,{title:"Estimated API Value",value:Bl(x.totalCost),subtitle:h&&x.billingContext?.monthlyAmount?`Your plan: $${x.billingContext.monthlyAmount}/mo`:void 0,color:"amber"}),l.jsx(de,{title:"Estimated Cache Savings",value:Bl(x.totalSavings),subtitle:h?"API-equivalent savings from cache":void 0,color:"emerald"}),l.jsx(de,{title:"Total Tokens",value:kn(x.totalTokens),subtitle:bb(x.totalTokens),color:"indigo"}),l.jsx(de,{title:"Sessions",value:x.sessionCount.toLocaleString(),color:"cyan"})]}),x.budget&&x.budget.monthlyLimit>0&&l.jsx(pb,{currentSpend:x.budget.currentSpend,monthlyLimit:x.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 (${p.length})`};return l.jsx("button",{onClick:()=>u(T),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${i===T?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:U[T]},T)})}),i==="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:"Priced Model Estimates"}),w.some(T=>T.cost!=null)?l.jsx(Uh,{items:w.filter(T=>T.cost!=null).map(T=>({label:T.model,value:Number(T.cost?.toFixed(2)),color:"#f59e0b"}))}):l.jsx("p",{className:"text-gray-600 text-xs",children:"No priced model estimates"})]}),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(Ti,{label:"Input",value:O,total:S,color:"bg-indigo-500"}),l.jsx(Ti,{label:"Output",value:_,total:S,color:"bg-cyan-500"}),R>0&&l.jsx(Ti,{label:"Cache Read",value:R,total:S,color:"bg-emerald-500"}),j>0&&l.jsx(Ti,{label:"Cache Write",value:j,total:S,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:"Estimate"}),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:kn(T.tokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:Bl(T.cost)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:Bl(T.cost!=null&&T.sessions>0?T.cost/T.sessions:null,4)})]},T.model))})]})]})]}),i==="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(xb,{data:x.trends||[],showProviderLines:!0,height:250})]}),i==="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(gb,{data:x.providerBreakdown})]}),i==="sessions"&&l.jsx(vb,{sessions:p,expandedSession:o,onToggle:T=>c(o===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 Du=37,Px=210,Wx=5;function vb({sessions:i,expandedSession:u,onToggle:o}){const c=N.useRef(null),[f,m]=N.useState(0),x=N.useCallback(()=>{c.current&&m(c.current.scrollTop)},[]),b=N.useMemo(()=>i.map(R=>(R.sessionId||"-")===u?Px:Du),[i,u]),v=N.useMemo(()=>{const R=[];let j=0;for(const S of b)R.push(j),j+=S;return R},[b]),y=v.length>0?v[v.length-1]+b[b.length-1]:0,p=Math.min(y,Du*20),h=N.useMemo(()=>{if(i.length===0)return{start:0,end:0};const R=f,j=f+p;let S=0,T=i.length-1;for(;S<T;){const Q=S+T>>1;v[Q]+b[Q]<=R?S=Q+1:T=Q}const U=Math.max(0,S-Wx);for(S=U,T=i.length-1;S<T;){const Q=S+T+1>>1;v[Q]>=j?T=Q-1:S=Q}const ee=Math.min(i.length,S+Wx+1);return{start:U,end:ee}},[f,p,i.length,v,b]);if(N.useEffect(()=>{if(!u||!c.current)return;const R=i.findIndex(U=>(U.sessionId||"-")===u);if(R<0)return;const j=v[R],S=j+Px,T=c.current;S>T.scrollTop+p?T.scrollTop=S-p:j<T.scrollTop&&(T.scrollTop=j)},[u,i,v,p]),i.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=i.slice(h.start,h.end),O=h.start>0?v[h.start]:0,_=h.end<i.length?y-v[h.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:[i.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:"Estimate"}),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:x,className:"overflow-y-auto custom-scrollbar",style:{maxHeight:`${p}px`},children:l.jsxs("div",{style:{height:`${y}px`,position:"relative"},children:[O>0&&l.jsx("div",{style:{height:`${O}px`}}),l.jsx("table",{className:"w-full table-fixed",children:l.jsx("tbody",{children:w.map(R=>{const j=R.sessionId||"-",S=u===j,T=(R.cacheReadTokens||0)+(R.cacheWriteTokens||0);return l.jsxs(N.Fragment,{children:[l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",style:{height:`${Du}px`},onClick:()=>o(j),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 ${S?"rotate-90":""}`,children:"▸"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:j.slice(0,8)}),l.jsx("td",{className:"px-4 py-2",title:R.models?.join(" → "),children:l.jsx(xe,{label:R.model||"unknown",variant:"default"})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:kn(R.inputTokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:kn(R.outputTokens)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:T>0?kn(T):"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-amber-400 text-right",children:Bl(R.cost,4)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:R.duration?eh(R.duration):"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:Nb(R.timestamp)})]}),S&&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",{className:"col-span-full",children:[l.jsx("span",{className:"text-gray-500 block mb-1",children:"Observed model IDs"}),l.jsx("span",{className:"text-gray-300 font-mono break-all",children:R.models?.join(" → ")||R.model||"unknown"})]}),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:"API Estimate"}),l.jsx("span",{className:"text-amber-400 font-mono",children:Bl(R.cost,6)})]}),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?eh(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})]})]})})})]},j)})})}),_>0&&l.jsx("div",{style:{height:`${_}px`}})]})})]})}function Ti({label:i,value:u,total:o,color:c}){const f=o>0?u/o*100:0,m={"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:i}),l.jsxs("span",{className:"text-xs text-gray-500",children:[kn(u)," (",f.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:`${f}%`,backgroundColor:m[c]||c}})})]})}function jb(i){const u=new Map;for(const o of i){const c=o.model||"unknown",f=u.get(c)||{cost:0,tokens:0,sessions:0};f.cost=f.cost==null||o.cost==null?null:f.cost+o.cost,f.tokens+=(o.inputTokens||0)+(o.outputTokens||0),f.sessions++,u.set(c,f)}return Array.from(u.entries()).map(([o,c])=>({model:o,...c})).sort((o,c)=>(c.cost??-1)-(o.cost??-1))}function kn(i){return i?i>=1e6?`${(i/1e6).toFixed(1)}M`:i>=1e3?`${(i/1e3).toFixed(1)}K`:String(i):"0"}function bb(i){return i?i.toLocaleString():"0"}function eh(i){const u=Math.round(i);if(u<60)return`${u}s`;const o=Math.floor(u/60),c=u%60;return o<60?`${o}m ${c}s`:`${Math.floor(o/60)}h ${o%60}m`}function Nb(i){if(!i)return"-";try{const u=Date.now()-new Date(i).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function Bl(i,u=2){return i==null?"Unknown":`$${i.toFixed(u)}`}function Hi(){const[i,u]=N.useState(!1),[o,c]=N.useState(null),[f,m]=N.useState(null),[x,b]=N.useState([]),[v,y]=N.useState("idle"),p=N.useRef(null),h=N.useRef(null);$e("command-output",_=>{const R=_;h.current&&R.executionId===h.current&&R.line&&b(j=>[...j,R.line])}),$e("command-complete",_=>{const R=_;if(h.current&&R.executionId===h.current){if(p.current&&(clearTimeout(p.current),p.current=null),u(!1),R.exitCode===0)y("success"),b(j=>[...j,"Command completed successfully."]);else{y("error");const j=`Command failed (exit code ${R.exitCode??"unknown"})`;m(j),b(S=>[...S,j])}h.current=null}}),N.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const w=N.useCallback(async(_,R)=>{const j=R?.queryParams,S=R?.timeoutMs??6e4;u(!0),m(null),b([`> specweave ${_}${j?` (${Object.values(j).join(", ")})`:""}`]),y("running");try{const T=j?"?"+new URLSearchParams(j).toString():"",ee=await(await fetch(`/api/commands/${_}${T}`,{method:"POST"})).json();if(!ee.ok)return m(ee.error||"Command failed"),y("error"),b(ne=>[...ne,`Error: ${ee.error||"Command failed"}`]),u(!1),null;c(ee.data),h.current=ee.data?.id||null;const Q=Math.round(S/1e3);return p.current=setTimeout(()=>{h.current&&(h.current=null,u(!1),y("error"),m(`Command timed out after ${Q} seconds`),b(ne=>[...ne,`Timed out after ${Q} seconds.`]))},S),ee.data}catch(T){return m(String(T)),y("error"),b(U=>[...U,`Error: ${String(T)}`]),u(!1),null}},[]),O=N.useCallback(()=>{u(!1),c(null),m(null),b([]),y("idle"),h.current=null,p.current&&(clearTimeout(p.current),p.current=null)},[]);return{execute:w,running:i,result:o,error:f,output:x,status:v,reset:O}}function Sb(i){switch(i){case"connected":return"success";case"sync_failed":return"warning";case"configured_never_synced":return"info";default:return"default"}}function wb(i){switch(i){case"connected":return"Connected";case"sync_failed":return"Sync Failed";case"configured_never_synced":return"Ready";case"not_configured":return"Not Configured";default:return i||"Unknown"}}function Eb(){const[i,u]=N.useState("health"),[o,c]=N.useState(null),[f,m]=N.useState(0),[x,b]=N.useState([]);$e("sync-update",()=>m(k=>k+1)),$e("sync-error",()=>m(k=>k+1));const{data:v,loading:y,error:p,refetch:h}=De(`/api/sync/status?_r=${f}`);N.useEffect(()=>{fetch("/api/sync/errors?hours=24&limit=20").then(k=>k.json()).then(k=>{k.ok&&Array.isArray(k.data)&&b(k.data)}).catch(()=>{})},[f]);const{data:w,loading:O}=De(`/api/sync/audit?limit=100&_r=${f}`),{data:_,loading:R}=De(`/api/sync/audit/summary?_r=${f}`),{execute:j,running:S}=Hi(),T=async(k,F)=>{const ae=F?`${F}-${k}`:k;c(ae);try{const Se=new URLSearchParams(window.location.search).get("project")||"",Te=new URLSearchParams;Te.set("platform",k),F&&Te.set("repo",F),Se&&Te.set("project",Se);const ze=new AbortController,se=setTimeout(()=>ze.abort(),3e4);await fetch(`/api/sync/verify?${Te.toString()}`,{method:"POST",signal:ze.signal}),clearTimeout(se),h()}catch{}c(null)};if(y||O||R)return l.jsx(ct,{});if(p)return l.jsx(sa,{message:p,onRetry:h});if(!v)return null;const U=w?.length||0,ee=w?.filter(k=>k.result==="error").length||0,Q=w?.filter(k=>k.conflict)||[],ne=v.isUmbrella&&v.repos&&v.repos.length>0;let K=0,X=0;if(ne&&v.repos)for(const k of v.repos){const F=Object.values(k.platforms).filter(ae=>ae.connectionStatus!=="not_configured");X+=F.length,K+=F.filter(ae=>ae.connectionStatus==="connected").length}else{const k=Object.entries(v.platforms).filter(([F])=>["github","jira","ado"].includes(F));X=k.length,K=k.filter(([,F])=>F.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"}),!ne&&l.jsx("button",{onClick:()=>j("sync-push"),disabled:S,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:S?"Syncing...":"Sync Now"})]}),v.permissions&&l.jsx(Tb,{permissions:v.permissions,onSave:h}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(de,{title:ne?"Repos":"Platforms",value:ne?v.repos.length:X,subtitle:`${K} connected`,color:"indigo"}),l.jsx(de,{title:"Audit Entries",value:U,color:"cyan"}),l.jsx(de,{title:"Errors",value:ee,color:"rose"}),l.jsx(de,{title:"Conflicts",value:Q.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(k=>l.jsx("button",{onClick:()=>u(k),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${i===k?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:k==="health"?"Platform Health":k==="audit"?"Audit Log":`Conflicts (${Q.length})`},k))}),i==="health"&&l.jsx(l.Fragment,{children:ne&&v.repos?l.jsx(Cb,{repos:v.repos,auditSummary:_,verifying:o,onVerify:T,execute:j,running:S}):l.jsx(Rb,{platforms:v.platforms,auditSummary:_,verifying:o,onVerify:T})}),i==="health"&&x.length>0&&l.jsx(Ab,{errors:x}),i==="audit"&&l.jsx(th,{entries:w||[]}),i==="conflicts"&&l.jsx(th,{entries:Q}),v.lastUpdated&&l.jsxs("p",{className:"text-xs text-gray-600",children:["Last metadata update: ",new Date(v.lastUpdated).toLocaleString()]})]})}function Tb({permissions:i,onSave:u}){const[o,c]=N.useState(i),[f,m]=N.useState(!1),[x,b]=N.useState(null),v=JSON.stringify(o)!==JSON.stringify(i),y=async()=>{m(!0),b(null);try{const h=new URLSearchParams(window.location.search).get("project")||"",w=h?`?project=${h}`:"",O=await fetch(`/api/config${w}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({sync:{settings:o}})});if(O.ok)u();else{const _=await O.json().catch(()=>({}));b(_.error||`Save failed (HTTP ${O.status})`)}}catch(h){b(String(h))}m(!1)},p=[{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"}),v&&l.jsx("button",{onClick:y,disabled:f,className:"px-2.5 py-1 bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white text-[10px] rounded transition-colors",children:f?"Saving...":"Save"})]}),x&&l.jsxs("p",{className:"text-xs text-red-400 mb-2",children:["Failed to save: ",x]}),l.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:p.map(({key:h,label:w,desc:O})=>l.jsxs("button",{onClick:()=>c(_=>({..._,[h]:!_[h]})),className:`text-left p-2.5 rounded-lg border transition-colors ${o[h]?"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 ${o[h]?"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:O})]},h))})]})}function Cb({repos:i,auditSummary:u,verifying:o,onVerify:c,execute:f,running:m}){return i.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:i.map(x=>{const v=Object.entries(x.platforms).filter(([y])=>["github","jira","ado"].includes(y)).filter(([,y])=>y.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:x.repoName}),x.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"}),!x.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:x.repoPath})]}),l.jsx("button",{onClick:()=>f("sync-push",{queryParams:{repo:x.repoId}}),disabled:m||!x.hasSpecweave,title:x.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:m?"Syncing...":"Sync Now"})]}),v.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(Qe,{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:v.map(([y,p])=>l.jsx(Hh,{platform:y,info:p,summary:u?.[y],verifying:o===`${x.repoId}-${y}`,onVerify:()=>c(y,x.repoId)},y))})]},x.repoId)})})}function Rb({platforms:i,auditSummary:u,verifying:o,onVerify:c}){const f=Object.entries(i).filter(([m])=>["github","jira","ado"].includes(m));return f.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:f.map(([m,x])=>l.jsx(Hh,{platform:m,info:x,summary:u?.[m],verifying:o===m,onVerify:()=>c(m)},m))})}function Hh({platform:i,info:u,summary:o,verifying:c,onVerify:f}){const m=u.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(Bh,{platform:i}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-gray-300 capitalize",children:i}),u.configDetail&&l.jsx("div",{className:"text-[10px] text-gray-600 mt-0.5",children:u.configDetail})]})]}),l.jsx(xe,{label:wb(m),variant:Sb(m)})]}),u.diagnosticMessage&&l.jsx("div",{className:"text-xs text-gray-500 mb-3 p-2 bg-gray-800/30 rounded-lg",children:u.diagnosticMessage}),m==="not_configured"&&l.jsx(Qe,{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"}),m==="configured_never_synced"&&l.jsx("button",{onClick:f,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"}),m==="sync_failed"&&l.jsx("button",{onClick:f,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:[u.lastImport&&l.jsx(Dn,{label:"Last Import",value:new Date(u.lastImport).toLocaleString()}),m==="connected"&&!u.lastImport&&l.jsx(Dn,{label:"Status",value:"Connected, no imports yet"}),u.lastImportCount!=null&&u.lastImportCount>0&&l.jsx(Dn,{label:"Items Imported",value:u.lastImportCount.toLocaleString()}),u.lastSkippedCount!=null&&u.lastSkippedCount>0&&l.jsx(Dn,{label:"Skipped",value:u.lastSkippedCount.toLocaleString()}),o&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-gray-800 my-2"}),l.jsx(Dn,{label:"Total Ops",value:o.total.toLocaleString()}),l.jsx(Dn,{label:"Success",value:o.success.toLocaleString()}),o.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(xe,{label:String(o.errors),variant:"error"})]})]})]})]})}function Ab({errors:i}){const[u,o]=N.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:i.map((c,f)=>{const m=`${c.provider}-${c.incrementId}-${f}`,x=u===m;return l.jsxs("div",{children:[l.jsxs("button",{"data-testid":`sync-error-row-${f}`,onClick:()=>o(x?null:m),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(xe,{label:c.incrementId,variant:"default"}),l.jsx(xe,{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:$h(c.timestamp)})]}),l.jsx("span",{className:"text-[10px] text-gray-600 mt-1",children:x?"▲":"▼"})]}),x&&l.jsxs("div",{"data-testid":`sync-error-detail-${f}`,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
|
-
`).slice(0,3).join(`
|
|
13
|
-
`)})]})]})]},m)})})]})}function th({entries:i}){const[u,o]=N.useState(null);if(i.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:i.map((f,m)=>{const x=!!f.message,b=u===m;return l.jsxs("tr",{className:`border-b border-gray-800/50 hover:bg-gray-800/30 ${x?"cursor-pointer":""}`,onClick:()=>x&&o(b?null:m),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:$h(f.timestamp)}),l.jsx("td",{className:"px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Bh,{platform:f.platform}),l.jsx("span",{className:"text-xs text-gray-400 capitalize",children:f.platform})]})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:f.operation}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 font-mono max-w-[120px] truncate",children:f.itemId||"-"}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(xe,{label:f.direction,variant:f.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(xe,{label:f.result,variant:c[f.result]||"default"}),x&&l.jsx("span",{className:"text-[10px] text-gray-600",children:b?"▲":"▼"})]})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-600 text-right",children:f.duration?`${f.duration}ms`:"-"})]},m)})})]}),u!==null&&i[u]?.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:i[u].message})})]})}function Dn({label:i,value:u}){return l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500",children:i}),l.jsx("span",{className:"text-xs text-gray-400",children:u})]})}function Bh({platform:i}){const u={github:"bg-gray-700",jira:"bg-blue-700",ado:"bg-blue-600"};return l.jsx("div",{className:`w-5 h-5 rounded ${u[i]||"bg-gray-700"} flex items-center justify-center`,children:l.jsx("span",{className:"text-[9px] text-white font-bold",children:i[0]?.toUpperCase()})})}function $h(i){if(!i)return"-";try{const u=new Date(i).getTime();if(isNaN(u))return"-";const o=Date.now()-u,c=Math.floor(o/6e4);if(c<1)return"just now";if(c<60)return`${c}m ago`;const f=Math.floor(c/60);return f<24?`${f}h ago`:`${Math.floor(f/24)}d ago`}catch{return"-"}}const qh={prompt_too_long:"error",api_error:"warning",tool_failure:"info",hook_error:"default",rate_limit:"warning",unknown:"default"},Vs=50;function Ob(){const[i,u]=lt("tab","groups"),[o,c]=lt("type",""),[f,m]=lt("q",""),[x,b]=lt("session",""),[v,y]=N.useState(0),[p,h]=N.useState(f),w=v*Vs,O=o?`&type=${encodeURIComponent(o)}`:"",_=f?`&search=${encodeURIComponent(f)}`:"",[R,j]=N.useState(0);$e("error-detected",()=>j(W=>W+1));const{data:S,loading:T,error:U}=De(i==="groups"?`/api/errors/groups?_r=${R}`:""),{data:ee,loading:Q,error:ne}=De(i==="errors"||i==="groups"?`/api/errors/recent?limit=${Vs}&offset=${w}${O}${_}&_r=${R}`:""),{data:K,loading:X,error:k}=De(i==="sessions"||x?`/api/errors/sessions?limit=50&_r=${R}`:""),{data:F,loading:ae,error:Se}=De(i==="timeline"?`/api/errors/timeline?bucket=60&_r=${R}`:""),Te=N.useCallback(()=>{m(p.trim()),y(0),p.trim()&&u("errors")},[p,m,u]);N.useEffect(()=>{x&&K&&!K.find(W=>W.sessionId===x)&&b("")},[x,K,b]);const ze=i==="groups"&&T||i==="errors"&&Q||i==="timeline"&&ae||i==="sessions"&&X,se=U||ne||(i==="sessions"?k:null)||(i==="timeline"?Se:null),Z=ee?.total||0,le=ee?.errors||[],I=S?.length||0,J=S?.reduce((W,je)=>W+je.sessions,0)||0,fe=S?.[0]?.type||"-",B=x?K?.find(W=>W.sessionId===x):null,V=o?(K||[]).filter(W=>W.errors.some(je=>je.type===o)):K||[],P=Math.ceil(Z/Vs),C=W=>{c(W),u("errors"),b(""),y(0)},G=W=>{u(W),b(""),W!=="errors"&&y(0)},ce=()=>{c(""),m(""),h(""),y(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:p,onChange:W=>h(W.target.value),onKeyDown:W=>W.key==="Enter"&&Te(),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"}),f&&l.jsx("button",{onClick:()=>{m(""),h(""),y(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:Te,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(de,{title:"Total Errors",value:Z,color:"rose"}),l.jsx(de,{title:"Error Types",value:I,color:"amber"}),l.jsx(de,{title:"Affected Sessions",value:J,color:"indigo"}),l.jsx(de,{title:"Most Common",value:fe,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(W=>l.jsx("button",{onClick:()=>G(W),className:`flex-1 px-3 py-1.5 text-xs rounded-md transition-colors ${i===W?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:W==="groups"?"Error Groups":W==="errors"?"All Errors":W==="timeline"?"Timeline":"Sessions"},W))}),(o||f)&&l.jsxs("div",{className:"flex items-center gap-2",children:[o&&l.jsx(xe,{label:`type: ${o.replace(/_/g," ")}`,variant:"info"}),f&&l.jsx(xe,{label:`search: ${f.slice(0,20)}`,variant:"default"}),l.jsx("button",{onClick:ce,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"clear all"})]})]}),se&&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:se}),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"})]}),x&&B&&l.jsx(Lb,{session:B,onClose:()=>b("")}),ze&&!x&&l.jsx(ct,{}),!x&&!ze&&i==="groups"&&l.jsx(Mb,{groups:S||[],onGroupClick:C}),!x&&!ze&&i==="errors"&&l.jsx(_b,{errors:le,total:Z,page:v,totalPages:P,onPageChange:y,onSessionClick:W=>{b(W),u("sessions")}}),!x&&!ze&&i==="timeline"&&l.jsx(Db,{buckets:F||[],errors:le,onSessionClick:W=>b(W)}),!x&&!ze&&i==="sessions"&&l.jsx(zb,{sessions:V,onSelect:W=>b(W)}),!ze&&!se&&Z===0&&!x&&l.jsx(Pu,{title:"No errors detected",description:"Claude Code session logs are clean"})]})}function Mb({groups:i,onGroupClick:u}){return i.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:i.map(o=>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(xe,{label:o.type.replace(/_/g," "),variant:qh[o.type]||"default"})}),l.jsx("td",{className:"px-4 py-2 text-right",children:l.jsx("button",{onClick:()=>u(o.type),className:"text-sm text-indigo-400 hover:text-indigo-300 font-mono transition-colors",title:`View all ${o.count} errors of this type`,children:o.count})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:o.sessions}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-300 font-mono",title:Bn(o.lastSeen),children:Ks(o.lastSeen)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 max-w-xs truncate",children:o.recentMessages[0]||"-"})]},o.type))})]})]})}function _b({errors:i,total:u,page:o,totalPages:c,onPageChange:f,onSessionClick:m}){const[x,b]=N.useState(new Set),v=N.useCallback(h=>{b(w=>{const O=new Set(w);return O.has(h)?O.delete(h):O.add(h),O})},[]);if(i.length===0)return l.jsx(Pu,{title:"No errors",description:"No errors match the current filter"});const y=o*Vs+1,p=Math.min(o*Vs+i.length,u);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 ",y,"–",p," of ",u]}),c>1&&l.jsx(ah,{page:o,totalPages:c,onChange:f})]}),l.jsx("div",{className:"divide-y divide-gray-800/50",children:i.map((h,w)=>{const O=x.has(w),_=h.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(xe,{label:h.type.replace(/_/g," "),variant:qh[h.type]||"default"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:`text-xs text-gray-300 ${O?"whitespace-pre-wrap break-words":"truncate"} ${_?"cursor-pointer":""}`,onClick:()=>_&&v(w),title:_?O?"Click to collapse":"Click to expand details":void 0,children:[_&&l.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:O?"▼":"▶"}),O?h.message:h.message.slice(0,200),!O&&_&&l.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),h.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:h.context.toolName}),h.context.toolInput&&l.jsx("span",{className:"text-[10px] text-gray-500 font-mono truncate max-w-md",children:h.context.toolInput})]}),O&&l.jsx(Yh,{context:h.context})]}),l.jsxs("div",{className:"flex-shrink-0 text-right",children:[l.jsx("div",{className:"text-[10px] text-gray-300 font-mono",title:Bn(h.timestamp),children:Ks(h.timestamp)}),l.jsx("div",{className:"text-[10px] text-gray-600",children:Bn(h.timestamp)}),l.jsx("button",{onClick:()=>m(h.sessionId),className:"text-[10px] text-indigo-400 hover:text-indigo-300 font-mono mt-0.5 transition-colors",title:"View full session",children:h.sessionId.slice(0,8)}),h.context?.messageIndex!=null&&l.jsxs("div",{className:"text-[10px] text-gray-600",children:["msg #",h.context.messageIndex]})]})]})},`${h.sessionId}-${h.timestamp}-${w}`)})}),c>1&&l.jsx("div",{className:"px-5 py-3 border-t border-gray-800 flex justify-end",children:l.jsx(ah,{page:o,totalPages:c,onChange:f})})]})}function Yh({context:i}){if(!i)return null;const{precedingAction:u,recentTools:o}=i;return!u&&(!o||o.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:[u&&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:u})]}),o&&o.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:o.map((c,f)=>l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px]",children:[l.jsxs("span",{className:"text-gray-600",children:[o.length-f,"."]}),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})]},f))})]})]})}function ah({page:i,totalPages:u,onChange:o}){return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{onClick:()=>o(Math.max(0,i-1)),disabled:i===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:[i+1," / ",u]}),l.jsx("button",{onClick:()=>o(Math.min(u-1,i+1)),disabled:i>=u-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 Db({buckets:i,errors:u,onSessionClick:o}){const[c,f]=N.useState(null),m=Math.max(...i.map(y=>y.count),1),x={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"},b=c?u.filter(y=>{const p=new Date(y.timestamp).getTime();return p>=new Date(c.start).getTime()&&p<new Date(c.end).getTime()}):u,v=y=>{try{return new Date(y).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return y}};return l.jsxs("div",{className:"space-y-4",children:[i.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:()=>f(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:i.map((y,p)=>{const h=y.count/m*100,w=c?.start===y.start;return l.jsx("div",{className:"flex-1 flex flex-col items-center justify-end cursor-pointer group relative",onClick:()=>f(w?null:y),title:`${v(y.start)}: ${y.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(h,2)}%`}})},p)})}),l.jsxs("div",{className:"flex justify-between mt-1",children:[l.jsx("span",{className:"text-[9px] text-gray-600",children:i.length>0?v(i[0].start):""}),l.jsx("span",{className:"text-[9px] text-gray-600",children:i.length>0?v(i[i.length-1].start):""})]}),l.jsx("div",{className:"flex gap-3 mt-2",children:Object.entries(x).map(([y,p])=>l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${p}`}),l.jsx("span",{className:"text-[9px] text-gray-600",children:y.replace(/_/g," ")})]},y))})]}),c&&l.jsxs("div",{className:"text-xs text-gray-400 px-1",children:["Showing ",b.length," errors from ",v(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:[b.length===0&&l.jsx("p",{className:"text-xs text-gray-600",children:"No errors in this time range"}),b.slice(0,100).map((y,p)=>l.jsxs("div",{className:"flex items-start gap-3 py-2 px-2 hover:bg-gray-800/30 rounded cursor-pointer",onClick:()=>o(y.sessionId),children:[l.jsx("div",{className:`w-2 h-2 rounded-full mt-1.5 flex-shrink-0 ${x[y.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:y.type.replace(/_/g," ")}),y.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:y.context.toolName}),l.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:Ks(y.timestamp)}),l.jsx("span",{className:"text-[10px] text-gray-600",children:Bn(y.timestamp)})]}),l.jsx("div",{className:"text-xs text-gray-500 truncate mt-0.5",children:y.message}),y.context?.precedingAction&&l.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5 truncate",children:["After: ",y.context.precedingAction]})]})]},p))]})]})]})}function zb({sessions:i,onSelect:u}){return i.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:i.map(o=>l.jsxs("tr",{className:"border-b border-gray-800/50 hover:bg-gray-800/30 cursor-pointer",onClick:()=>u(o.sessionId),children:[l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 font-mono",children:o.sessionId.slice(0,8)}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:o.gitBranch||"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:o.messageCount}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500 text-right",children:o.toolCallCount}),l.jsx("td",{className:"px-4 py-2 text-right",children:o.errors.length>0?l.jsx(xe,{label:String(o.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:Bn(o.startTime),children:Ks(o.startTime)})]},o.sessionId))})]})]})}function Lb({session:i,onClose:u}){const[o,c]=N.useState(new Set),f=m=>{c(x=>{const b=new Set(x);return b.has(m)?b.delete(m):b.add(m),b})};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:i.sessionId.slice(0,12)})]}),l.jsxs("div",{className:"text-[10px] text-gray-600 mt-0.5",children:["v",i.version," | ",i.gitBranch," | ",i.messageCount," messages | ",i.toolCallCount," tool calls"]})]}),l.jsx("button",{onClick:u,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(i.startTime).toLocaleString()]}),i.endTime&&l.jsxs("div",{className:"text-xs text-gray-500",children:["Ended: ",new Date(i.endTime).toLocaleString()]})]}),i.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:i.errors.map((m,x)=>{const b=o.has(x),v=m.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(xe,{label:m.type.replace(/_/g," "),variant:"error"}),m.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:m.context.toolName}),l.jsx("span",{className:"text-[10px] text-gray-300 font-mono",children:Ks(m.timestamp)}),l.jsx("span",{className:"text-[10px] text-gray-600",children:Bn(m.timestamp)})]}),l.jsxs("div",{className:`text-xs text-gray-400 ${b?"whitespace-pre-wrap break-words":""} ${v?"cursor-pointer":""}`,onClick:()=>v&&f(x),title:v?b?"Click to collapse":"Click to expand":void 0,children:[v&&l.jsx("span",{className:"text-indigo-400 mr-1 text-[10px] inline-block w-3",children:b?"▼":"▶"}),b?m.message:m.message.slice(0,300),!b&&v&&l.jsx("span",{className:"text-indigo-400 ml-1",children:"...more"})]}),m.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:m.context.toolInput}),m.context?.messageIndex!=null&&l.jsxs("div",{className:"text-[10px] text-gray-600 mt-1",children:["At message #",m.context.messageIndex]}),b&&l.jsx(Yh,{context:m.context})]},x)})})]})}function Bn(i){if(!i)return"-";const u=Date.now()-new Date(i).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Ks(i){if(!i)return"-";try{return new Date(i).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return i}}const kb=[{value:"all",label:"All"},{value:"command",label:"Commands"},{value:"hook",label:"Hooks"},{value:"notification",label:"Notifications"},{value:"cost",label:"Cost"}],Ub=[{value:"all",label:"All Levels"},{value:"error",label:"Errors"},{value:"warning",label:"Warnings"},{value:"info",label:"Info"}];function Hb(){const[i,u]=lt("category","all"),[o,c]=lt("severity","all"),f=i||"all",m=o||"all",[x,b]=N.useState([]),[v,y]=N.useState(200),[p,h]=N.useState(null),w=new URLSearchParams;w.set("limit",String(v)),f!=="all"&&w.set("categories",f),m!=="all"&&w.set("severity",m);const{data:O,loading:_}=De(`/api/activity/stream?${w.toString()}`),R=N.useCallback(k=>{b(F=>[k,...F].slice(0,50))},[]);if($e("activity",R),_)return l.jsx(ct,{});const j=[...x,...O||[]],S=new Set,T=[];for(const k of j){const F=`${k.timestamp}:${k.title}`;S.has(F)||(S.add(F),T.push(k))}const U=T.filter(k=>!(f!=="all"&&k.category!==f||m!=="all"&&k.severity!==m)),ee=T.filter(k=>k.severity==="error").length,Q=T.filter(k=>k.severity==="warning").length,ne=new Set(T.map(k=>k.source)),K=k=>{h(F=>F===k?null:k)},X=()=>{y(k=>k+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(de,{title:"Total Events",value:T.length,color:"indigo"}),l.jsx(de,{title:"Errors",value:ee,color:"rose"}),l.jsx(de,{title:"Warnings",value:Q,color:"amber"}),l.jsx(de,{title:"Sources",value:ne.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:kb.map(k=>l.jsx("button",{onClick:()=>u(k.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${f===k.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:k.label},k.value))}),l.jsx("div",{className:"flex gap-1 bg-gray-900/50 border border-gray-800 rounded-lg p-1",children:Ub.map(k=>l.jsx("button",{onClick:()=>c(k.value),className:`px-3 py-1 text-xs rounded-md transition-colors ${m===k.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:k.label},k.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,v).map((k,F)=>{const ae=`${k.timestamp}-${F}`,Se=p===ae;return l.jsx(Bb,{event:k,isExpanded:Se,onToggle:()=>K(ae)},ae)}),U.length>=v&&l.jsx("div",{className:"p-4 text-center",children:l.jsx("button",{onClick:X,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 Bb({event:i,isExpanded:u,onToggle:o}){const c=i.severity==="error"?"bg-rose-400":i.severity==="warning"?"bg-amber-400":"bg-gray-600",f={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"},m=i.detail||i.metadata&&Object.keys(i.metadata).length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`px-4 py-3 flex items-start gap-3 transition-colors ${m?"cursor-pointer hover:bg-gray-800/20":""}`,onClick:m?o: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:f[i.category]||f.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:i.title}),l.jsx(xe,{label:i.category,variant:Ui(i.severity)})]}),i.detail&&!u&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5 truncate",children:i.detail}),i.source&&l.jsxs("span",{className:"text-[10px] text-gray-600 mt-0.5 block",children:["via ",i.source]})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[i.timestamp&&l.jsx("span",{className:"text-[10px] text-gray-600 whitespace-nowrap",children:$b(i.timestamp)}),m&&l.jsx("svg",{className:`w-4 h-4 text-gray-600 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.jsxs("div",{className:"px-4 pb-3 ml-10 space-y-2",children:[i.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:i.detail})]}),i.metadata&&Object.keys(i.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(i.metadata,null,2)})]})]})]})}function $b(i){if(!i)return"-";const u=Date.now()-new Date(i).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function qb(){const[i,u]=N.useState(0);$e("config-changed",()=>u(X=>X+1));const{data:o,loading:c,error:f,refetch:m}=De(`/api/config?_r=${i}`),{activeProject:x}=ja(),[b,v]=N.useState(new Set),[y,p]=N.useState({}),[h,w]=N.useState(!1),[O,_]=N.useState(null),[R,j]=N.useState([]);if(c)return l.jsx(ct,{});if(f)return l.jsx(sa,{message:f,onRetry:m});if(!o)return null;const S=X=>{v(k=>{const F=new Set(k);return F.has(X)?F.delete(X):F.add(X),F})},T=Object.keys(y).length>0,U=(X,k)=>{p(F=>({...F,[X]:k})),j(F=>F.filter(ae=>ae.path!==X))},ee=async()=>{if(T){w(!0),_(null),j([]);try{const X={};for(const[ze,se]of Object.entries(y))Vb(X,ze,se);const k=x?`?project=${x.id}`:"",ae=await(await fetch(`/api/config/validate${k}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)})).json();if(ae.errors&&ae.errors.length>0){j(ae.errors),_("Validation failed. Fix errors before saving."),w(!1);return}const Te=await(await fetch(`/api/config${k}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(X)})).json();Te.ok?(_("Saved successfully"),p({}),j([]),m(),setTimeout(()=>_(null),3e3)):_(`Error: ${Te.error}`)}catch(X){_(`Error: ${X}`)}finally{w(!1)}}},Q=()=>{p({}),_(null),j([])},ne=Object.entries(o).filter(([X,k])=>typeof k=="object"&&k!==null),K=Object.entries(o).filter(([X,k])=>typeof k!="object"||k===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:[O&&l.jsx("span",{className:`text-xs ${O.startsWith("Error")||O.startsWith("Validation")?"text-rose-400":"text-emerald-400"}`,children:O}),T&&l.jsxs(l.Fragment,{children:[l.jsx(xe,{label:`${Object.keys(y).length} changes`,variant:"warning"}),l.jsx("button",{onClick:Q,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:ee,disabled:h,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:h?"Saving...":"Save Changes"})]})]})]}),O&&!T&&O==="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((X,k)=>l.jsxs("div",{className:"text-xs text-rose-300 pl-4",children:[l.jsx("span",{className:"font-mono text-rose-400",children:X.path}),": ",X.message]},k))]}),K.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:K.map(([X,k])=>l.jsx(Gh,{path:X,label:X,value:y[X]!==void 0?y[X]:k,original:k,onChange:F=>U(X,F),edited:y[X]!==void 0,validationError:R.find(F=>F.path===X)?.message},X))})]}),ne.map(([X,k])=>l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl overflow-hidden",children:[l.jsxs("button",{onClick:()=>S(X),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:X}),lh(y,X)>0&&l.jsx(xe,{label:`${lh(y,X)} edited`,variant:"warning"}),R.some(F=>F.path.startsWith(X+"."))&&l.jsx(xe,{label:"errors",variant:"error"})]}),l.jsx("svg",{className:`w-4 h-4 text-gray-500 transition-transform duration-200 ${b.has(X)?"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"})})]}),b.has(X)&&l.jsx("div",{className:"px-5 py-3 border-t border-gray-800",children:l.jsx(Vh,{data:k,path:X,edits:y,onChange:U,validationErrors:R,depth:0})})]},X))]})}function Vh({data:i,path:u,edits:o,onChange:c,validationErrors:f,depth:m}){return m>4?l.jsx("span",{className:"text-xs text-gray-600",children:"..."}):l.jsx("div",{className:"space-y-3",style:{marginLeft:m>0?16:0},children:Object.entries(i).map(([x,b])=>{const v=`${u}.${x}`;return b&&typeof b=="object"&&!Array.isArray(b)?l.jsxs("div",{children:[l.jsx("span",{className:"text-xs text-gray-400 font-mono font-medium",children:x}),l.jsx(Vh,{data:b,path:v,edits:o,onChange:c,validationErrors:f,depth:m+1})]},x):l.jsx(Gh,{path:v,label:x,value:o[v]!==void 0?o[v]:b,original:b,onChange:y=>c(v,y),edited:o[v]!==void 0,validationError:f.find(y=>y.path===v)?.message},x)})})}function Gh({path:i,label:u,value:o,original:c,onChange:f,edited:m,validationError:x}){return typeof c=="boolean"||typeof o=="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:u}),l.jsx("button",{onClick:()=>f(!o),className:`relative w-9 h-5 rounded-full transition-colors ${o?"bg-indigo-600":"bg-gray-700"} ${m?"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 ${o?"left-[18px]":"left-0.5"}`})})]}),x&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:x})]}):typeof c=="number"||typeof o=="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:u}),l.jsx("input",{type:"number",value:String(o??""),onChange:b=>f(b.target.value?Number(b.target.value):0),className:`bg-gray-800 border text-xs text-amber-400 font-mono rounded px-2 py-1 w-24 text-right ${x?"border-rose-500":m?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),x&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:x})]}):Array.isArray(c)||Array.isArray(o)?l.jsx(Yb,{path:i,label:u,value:Array.isArray(o)?o:Array.isArray(c)?c:[],edited:m,onChange:f,validationError:x}):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:u}),l.jsx("input",{type:"text",value:String(o??""),onChange:b=>f(b.target.value),className:`bg-gray-800 border text-xs text-gray-300 rounded px-2 py-1 w-48 text-right ${x?"border-rose-500":m?"border-amber-500/50":"border-gray-700"} focus:ring-indigo-500 focus:border-indigo-500`})]}),x&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5 text-right",children:x})]})}function Yb({path:i,label:u,value:o,edited:c,onChange:f,validationError:m}){const[x,b]=N.useState(!1),[v,y]=N.useState(""),p=O=>{const _=[...o];_.splice(O,1),f(_)},h=()=>{const O=v.trim();O&&(f([...o,O]),y(""))},w=O=>{O.key==="Enter"&&(O.preventDefault(),h())};return l.jsxs("div",{className:"py-1",children:[l.jsxs("button",{onClick:()=>b(O=>!O),className:"flex items-center justify-between w-full group",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:u}),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:["[",o.length," items]"]}),l.jsx("svg",{className:`w-3 h-3 text-gray-500 transition-transform duration-200 ${x?"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"})})]})]}),x&&l.jsxs("div",{className:"mt-2 ml-4 space-y-1",children:[o.length===0&&l.jsx("p",{className:"text-[10px] text-gray-600",children:"No items"}),o.map((O,_)=>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(O)}),l.jsx("button",{onClick:()=>p(_),className:"text-[10px] text-gray-600 hover:text-rose-400 opacity-0 group-hover/item:opacity-100 transition-opacity",children:"remove"})]},_)),l.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[l.jsx("input",{type:"text",value:v,onChange:O=>y(O.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:h,disabled:!v.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"})]})]}),m&&l.jsx("p",{className:"text-[10px] text-rose-400 mt-0.5",children:m})]})}function lh(i,u){return Object.keys(i).filter(o=>o.startsWith(u+".")).length}function Vb(i,u,o){const c=u.split(".");let f=i;for(let m=0;m<c.length-1;m++)(!f[c[m]]||typeof f[c[m]]!="object")&&(f[c[m]]={}),f=f[c[m]];f[c[c.length-1]]=o}function Wu({lines:i,status:u,onDismiss:o}){const c=N.useRef(null);return N.useEffect(()=>{c.current?.scrollIntoView({behavior:"smooth"})},[i]),i.length===0&&u==="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 ${u==="running"?"bg-yellow-400 animate-pulse":u==="success"?"bg-green-400":u==="error"?"bg-red-400":"bg-gray-500"}`}),l.jsx("span",{className:"text-xs text-gray-400 font-mono",children:u==="running"?"Running...":u==="success"?"Completed":u==="error"?"Failed":"Output"})]}),u!=="running"&&o&&l.jsx("button",{onClick:o,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:[i.map((f,m)=>l.jsx("div",{children:f},m)),l.jsx("div",{ref:c})]})]})}function Gb(){const{data:i,loading:u}=De("/api/plugins/full"),{execute:o,running:c,output:f,status:m,reset:x}=Hi(),[b,v]=N.useState(null);if(u)return l.jsx(ct,{});const y=i?.plugins||[],p=i?.skills||[],h=i?.lsp,w=i?.warmup,O=i?.triggerCount||0,_=y.reduce((T,U)=>T+U.skillCount,0),R=y.reduce((T,U)=>T+U.commandCount,0),j=T=>p.filter(U=>U.plugin===T).sort((U,ee)=>ee.count-U.count),S=T=>{v(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:()=>o("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:()=>o("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:f,status:m,onDismiss:x}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:[l.jsx(hl,{label:"Plugins",value:y.length}),l.jsx(hl,{label:"Total Skills",value:_}),l.jsx(hl,{label:"Total Commands",value:R}),l.jsx(hl,{label:"Trigger Keywords",value:O})]}),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"})}),y.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:y.map(T=>{const U=b===T.name,ee=j(T.name);return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>S(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(xe,{label:`${T.skillCount} skills`,variant:"info"}),l.jsx(xe,{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:ee.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"})]}),ee.map(Q=>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:Q.name}),l.jsx("span",{className:"text-xs text-gray-400 text-right font-mono",children:Q.count}),l.jsxs("span",{className:"text-xs text-right font-mono",children:[l.jsx("span",{className:"text-emerald-400",children:Q.successCount}),Q.failureCount>0&&l.jsxs("span",{className:"text-rose-400",children:["/",Q.failureCount]})]}),l.jsx("span",{className:"text-[10px] text-gray-500 text-right",children:Q.lastUsed?Qb(Q.lastUsed):"-"})]},Q.name))]})})]},T.name)})})]}),p.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(Uh,{items:p.sort((T,U)=>U.count-T.count).slice(0,20).map(T=>({label:T.name,value:T.count,color:"#10b981"})),maxBars:20})]}),h&&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(xe,{label:h.status,variant:h.status==="ok"?"success":"warning"}),h.checked&&l.jsxs("span",{className:"text-[10px] text-gray-600",children:["Checked: ",new Date(h.checked).toLocaleDateString()]})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 mb-4",children:[l.jsx(hl,{label:"Total Languages",value:h.stats.totalLanguages}),l.jsx(hl,{label:"Checked",value:h.stats.checkedLanguages}),l.jsx(hl,{label:"Binary Missing",value:h.stats.binaryMissing}),l.jsx(hl,{label:"Plugin Missing",value:h.stats.pluginMissing})]}),h.missing.length>0&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-xs text-gray-500",children:"Missing Languages"}),h.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(xe,{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(xe,{label:T,variant:"success"},T)),w.failed.map(T=>l.jsx(xe,{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 hl({label:i,value:u}){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:u}),l.jsx("div",{className:"text-[10px] text-gray-500",children:i})]})}function Qb(i){if(!i)return"-";const u=Date.now()-new Date(i).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function Xb(){const{data:i,loading:u}=De("/api/links"),{data:o,loading:c,refetch:f}=De("/api/services"),{execute:m,running:x,output:b,status:v,reset:y}=Hi();if(u||c)return l.jsx(ct,{});const p=(o||[]).filter(j=>j.status==="running").length,h=(o||[]).length,w=new Map;for(const j of o||[])if(j.port>0&&j.status==="running"){const S=w.get(j.port)||[];S.push(j.name),w.set(j.port,S)}const O=Array.from(w.entries()).filter(([,j])=>j.length>1),_=async j=>{await m(j,{timeoutMs:3e5}),setTimeout(()=>f(),3e3)},R=async j=>{await m(j,{timeoutMs:3e5}),setTimeout(()=>f(),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:b,status:v,onDismiss:y}),O.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:O.map(([j,S])=>l.jsxs("span",{className:"block",children:["Port ",j," is used by: ",S.join(", ")]},j))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(de,{title:"Services",value:h,color:"indigo",tooltip:`${h} managed services`}),l.jsx(de,{title:"Running",value:p,color:"emerald",tooltip:`${p} services currently active`}),l.jsx(de,{title:"External Links",value:(i||[]).length,color:"cyan",tooltip:"Configured external links (docs, repos, etc.)"}),l.jsx(de,{title:"Stopped",value:h-p,color:"rose",tooltip:`${h-p} 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:(o||[]).map((j,S)=>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 ${j.status==="running"?"bg-emerald-400":"bg-gray-600"}`}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm text-gray-300",children:j.name}),l.jsx("div",{className:"text-[10px] text-gray-600",children:j.status==="running"&&j.detail?l.jsx("a",{href:j.detail,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 underline transition-colors",children:j.detail}):j.detail})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[j.status==="running"&&j.port>0&&l.jsx(xe,{label:`Port ${j.port}`,variant:"info"}),j.status==="running"?l.jsx(xe,{label:"Running",variant:"success"}):l.jsx(xe,{label:"Stopped",variant:"default"}),j.startCommand&&j.stopCommand?j.status==="running"?l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("a",{href:j.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(j.stopCommand),disabled:x,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:()=>_(j.startCommand),disabled:x,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:x?"Starting...":"Start"}):j.status==="running"&&l.jsx("a",{href:j.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"})]})]},S))})]}),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"}),(i||[]).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:(i||[]).map((j,S)=>l.jsxs("a",{href:j.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(Zb,{type:j.type}),l.jsxs("div",{children:[l.jsx("div",{className:"text-sm text-gray-300 transition-colors",children:j.name}),l.jsx("div",{className:"text-[10px] text-gray-600 truncate max-w-[200px]",children:j.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"})})]},S))})]})]})}function Zb({type:i}){const u={docs:"bg-indigo-600",github:"bg-indigo-600",jira:"bg-blue-700",ado:"bg-blue-600"};return l.jsx("div",{className:`w-8 h-8 rounded-lg ${u[i]||"bg-indigo-600"} flex items-center justify-center`,children:l.jsx("span",{className:"text-xs text-white font-bold",children:i[0]?.toUpperCase()})})}const nh={critical:0,warning:1,info:2};function Kb(){const[i,u]=N.useState("pending"),[o,c]=N.useState(null),[f,m]=N.useState(0);$e("notification",()=>m(k=>k+1));const{activeProject:x}=ja(),{data:b,loading:v,error:y,refetch:p}=De(`/api/notifications?_r=${f}`);if(v)return l.jsx(ct,{});if(y)return l.jsx(sa,{message:y,onRetry:p});const h=b||[],w=h.filter(k=>!k.dismissedAt),O=h.filter(k=>!!k.dismissedAt),_=w.filter(k=>k.severity==="critical"),R=w.filter(k=>k.severity==="warning"),S=[...i==="pending"?w:i==="dismissed"?O:h].sort((k,F)=>{const ae=nh[k.severity]??3,Se=nh[F.severity]??3;return ae!==Se?ae-Se:new Date(F.createdAt).getTime()-new Date(k.createdAt).getTime()}),T=async k=>{c(k);try{const F=x?`?project=${x.id}`:"";(await fetch(`/api/notifications/${k}/dismiss${F}`,{method:"POST"})).ok&&p()}finally{c(null)}},U=async()=>{c("__all__");try{const k=x?`?project=${x.id}`:"";for(const F of w)await fetch(`/api/notifications/${F.id}/dismiss${k}`,{method:"POST"});p()}finally{c(null)}},ee=k=>k==="critical"?"error":k==="warning"?"warning":"info",Q=k=>k==="critical"?"border-l-rose-500":k==="warning"?"border-l-amber-500":"border-l-blue-500",K=(k=>{const F={};for(const ae of k)F[ae.severity]||(F[ae.severity]=[]),F[ae.severity].push(ae);return F})(S),X={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(de,{title:"Pending",value:w.length,color:"indigo"}),l.jsx(de,{title:"Critical",value:_.length,color:"rose"}),l.jsx(de,{title:"Warnings",value:R.length,color:"amber"}),l.jsx(de,{title:"Dismissed",value:O.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 (${O.length})`},{value:"all",label:`All (${h.length})`}].map(k=>l.jsx("button",{onClick:()=>u(k.value),className:`px-3 py-1.5 text-xs rounded-md transition-colors ${i===k.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300"}`,children:k.label},k.value))}),w.length>0&&l.jsx("button",{onClick:U,disabled:o==="__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:o==="__all__"?"Dismissing...":"Dismiss All"})]}),S.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:i==="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(k=>{const F=K[k];return!F||F.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:X[k]||k}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:["(",F.length,")"]})]}),l.jsx("div",{className:"space-y-2",children:F.map(ae=>l.jsxs("div",{className:`bg-gray-900/50 border border-gray-800 border-l-4 ${Q(ae.severity)} rounded-xl p-4 flex items-start gap-4 ${ae.dismissedAt?"opacity-60":""}`,children:[l.jsx(Jb,{severity:ae.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:ae.title}),l.jsx(xe,{label:ae.severity,variant:ee(ae.severity)}),ae.type&&l.jsx(xe,{label:ae.type,variant:"default"})]}),ae.message&&l.jsx("p",{className:"text-xs text-gray-400 mb-2",children:ae.message}),l.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-600",children:[l.jsx("span",{children:new Date(ae.createdAt).toLocaleString()}),ae.source&&l.jsxs("span",{children:["via ",ae.source]}),ae.dismissedAt&&l.jsxs("span",{children:["Dismissed ",new Date(ae.dismissedAt).toLocaleString()]})]})]}),!ae.dismissedAt&&l.jsx("button",{onClick:()=>T(ae.id),disabled:o===ae.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:o===ae.id?"...":"Dismiss"})]},ae.id))})]},k)})})]})}function Jb({severity:i}){return i==="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"})})}):i==="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 Ib(i){if(!i)return null;if(i.startsWith("https://"))return i.replace(/\.git$/,"");const u=i.match(/^git@([^:]+):(.+?)(?:\.git)?$/);if(u)return`https://${u[1]}/${u[2]}`;const o=i.match(/^ssh:\/\/git@([^/]+)\/(.+?)(?:\.git)?$/);return o?`https://${o[1]}/${o[2]}`:null}function Fb(){const{data:i,loading:u,error:o,refetch:c}=De("/api/repos");if(u)return l.jsx(ct,{});if(o)return l.jsx(sa,{message:o,onRetry:c});const f=i||[],m=[...new Set(f.map(v=>v.org))],x=f.filter(v=>v.hasSpecweave||v.isUmbrellaManaged).length,b=f.find(v=>v.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(de,{title:"Repositories",value:f.length,color:"indigo"}),l.jsx(de,{title:"Organizations",value:m.length,color:"cyan"}),l.jsx(de,{title:"With SpecWeave",value:x,color:"emerald"}),l.jsx(de,{title:"Current",value:b?b.name:"-",subtitle:b?`${b.org}/${b.name}`:"No current project",color:"amber"})]}),f.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:m.map(v=>{const y=f.filter(p=>p.org===v);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(Pb,{}),l.jsx("h3",{className:"text-sm font-medium text-gray-300",children:v}),l.jsxs("span",{className:"text-[10px] text-gray-600",children:[y.length," ",y.length===1?"repo":"repos"]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:y.map(p=>{const h=Ib(p.remote);return l.jsxs("div",{className:`bg-gray-900/50 border rounded-xl p-4 ${p.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(Wb,{}),l.jsx("span",{className:"text-sm font-medium text-gray-300",children:p.name})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[p.isCurrent&&l.jsx(xe,{label:"Current Project",variant:"info"}),l.jsx(xe,{label:p.hasSpecweave?"SpecWeave":p.isUmbrellaManaged?"via umbrella":"No SpecWeave",variant:p.hasSpecweave?"success":p.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:p.org})]}),p.branch&&l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] text-gray-500",children:"Branch"}),l.jsx(xe,{label:p.branch,variant:"default"})]}),h&&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:h,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-indigo-400 hover:text-indigo-300 hover:underline truncate max-w-[180px]",title:h,children:h.replace("https://","")})]}),!h&&p.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:p.remote,children:p.remote})]}),p.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:p.path,children:p.path.split("/").slice(-3).join("/")})]}),p.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:t1(p.lastModified)})]})]}),h&&l.jsxs("a",{href:h,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(e1,{}),"Open on GitHub"]})]},p.path||`${p.org}/${p.name}`)})})]},v)})})]})}function Pb(){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 Wb(){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 e1(){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 t1(i){if(!i)return"-";try{const u=Date.now()-new Date(i).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}const a1=[{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"}],Ua=20;function l1(i){switch(i){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 n1(i){switch(i){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 i}}function sh(i){if(!i)return"-";try{const u=Date.now()-new Date(i).getTime(),o=Math.floor(u/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}catch{return"-"}}function s1(i){return i>=80?"text-emerald-400":i>=50?"text-amber-400":"text-rose-400"}function Qh(i){const u=i.tier1Result?.score??0,o=i.tier2Result?.score??0;return u&&o?Math.round((u+o)/2):u||o}function r1(i){return i>=80?"bg-emerald-500":i>=50?"bg-amber-500":"bg-rose-500"}function i1(i){return i>=80?"text-emerald-400":i>=50?"text-amber-400":"text-rose-400"}function c1(i){return i>=1e6?`${(i/1e6).toFixed(1)}m`:i>=1e3?`${(i/1e3).toFixed(1)}k`:String(i)}function rh(i){const u=Math.log10(Math.max(i.stars,1))*20,o=Qh(i);return u+o}function o1(i,u){if(u===0)return"rose";const o=i/u;return o>.5?"emerald":o>.1?"amber":"rose"}function u1(){const[i,u]=N.useState(""),[o,c]=N.useState(0),[f,m]=N.useState(0),[x,b]=N.useState(null),[v,y]=N.useState(""),{output:p,status:h,reset:w}=Hi(),O=i?`status=${i}&limit=${Ua}&offset=${o}`:`limit=${Ua}&offset=${o}`,{data:_,loading:R,error:j,refetch:S}=De(`/api/marketplace/scanner/status?_r=${f}`),{data:T,loading:U,refetch:ee}=De(`/api/marketplace/queue?${O}&_r=${f}`),{data:Q,loading:ne}=De(`/api/marketplace/verified?_r=${f}`),{data:K,loading:X}=De(`/api/marketplace/insights?_r=${f}`),k=N.useCallback(()=>{m(B=>B+1)},[]);$e("submission-update",N.useCallback(()=>{k()},[k])),$e("marketplace-scan",N.useCallback(()=>{k()},[k])),$e("verification-complete",N.useCallback(()=>{k()},[k]));const F=async()=>{try{const B=new URLSearchParams(window.location.search).get("project")||"",V=B?`?project=${B}`:"";await fetch(`/api/marketplace/scanner/start${V}`,{method:"POST"}),S()}catch{}},ae=async()=>{try{const B=new URLSearchParams(window.location.search).get("project")||"",V=B?`?project=${B}`:"";await fetch(`/api/marketplace/scanner/stop${V}`,{method:"POST"}),S()}catch{}},Se=async B=>{b(B);try{const V=new URLSearchParams(window.location.search).get("project")||"",P=V?`?project=${V}`:"";await fetch(`/api/marketplace/queue/${B}/approve${P}`,{method:"POST"}),ee()}catch{}b(null)},Te=async B=>{b(B);try{const V=new URLSearchParams(window.location.search).get("project")||"",P=V?`?project=${V}`:"";await fetch(`/api/marketplace/queue/${B}/reject${P}`,{method:"POST"}),ee()}catch{}b(null)};if(R&&U&&ne&&X)return l.jsx(ct,{});const se=T?.items||[],Z=T?.total||0,le=Q||[],I=Math.floor(o/Ua)+1,J=Math.ceil(Z/Ua),fe=B=>B==="tier1_passed"||B==="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:_?.running?l.jsx("button",{onClick:ae,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:F,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:p,status:h,onDismiss:w}),j&&l.jsx(sa,{message:j,onRetry:S}),_?l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(de,{title:"Scanner",value:_.running?"Running":"Stopped",subtitle:_.running?"Active":"Idle",color:_.running?"emerald":"amber"}),l.jsx(de,{title:"Last Scan",value:_.lastScanTime?sh(_.lastScanTime):"Never",color:"cyan"}),l.jsx(de,{title:"Repos Scanned",value:_.reposScanned,color:"indigo"}),l.jsx(de,{title:"Rate Limit",value:_.rateLimitRemaining!=null&&_.rateLimitTotal!=null?`${_.rateLimitRemaining}/${_.rateLimitTotal}`:"No token",subtitle:_.rateLimitRemaining!=null&&_.rateLimitTotal!=null&&_.rateLimitTotal>0?`${Math.round(_.rateLimitRemaining/_.rateLimitTotal*100)}% remaining`:"Set GITHUB_TOKEN in environment",color:_.rateLimitRemaining!=null&&_.rateLimitTotal!=null?o1(_.rateLimitRemaining,_.rateLimitTotal):"amber"})]}):!R&&!j?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:F,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:[Z," total"]})]}),l.jsx("div",{className:"flex gap-1 px-4 pt-3 pb-2 overflow-x-auto",children:a1.map(B=>l.jsx("button",{onClick:()=>{u(B.value),c(0)},className:`px-3 py-1.5 text-xs rounded-md transition-colors whitespace-nowrap ${i===B.value?"bg-gray-700 text-white":"text-gray-400 hover:text-gray-300 hover:bg-gray-800"}`,children:B.label},B.value))}),U?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(ct,{})}):se.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:i?"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:se.map(B=>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:B.repoUrl?l.jsx("a",{href:B.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-indigo-400 hover:text-indigo-300 font-mono",children:B.repoFullName}):l.jsx("span",{className:"text-xs text-gray-300 font-mono",children:B.repoFullName})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:B.author}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400 text-right font-mono",children:B.stars.toLocaleString()}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(xe,{label:n1(B.status),variant:l1(B.status)})}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:B.tier||"-"}),l.jsx("td",{className:`px-4 py-2 text-xs text-right font-mono ${s1(B.securityScore)}`,children:B.securityScore!=null?B.securityScore:"-"}),l.jsx("td",{className:"px-4 py-2 text-xs text-gray-500",children:sh(B.discoveredAt)}),l.jsx("td",{className:"px-4 py-2 text-right",children:fe(B.status)&&l.jsxs("div",{className:"flex gap-1 justify-end",children:[l.jsx("button",{onClick:()=>Se(B.id),disabled:x===B.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:()=>Te(B.id),disabled:x===B.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"})]})})]},B.id))})]})}),Z>Ua&&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:[o+1,"-",Math.min(o+Ua,Z)," of ",Z]}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx("button",{onClick:()=>c(Math.max(0,o-Ua)),disabled:o===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 ",I," of ",J]}),l.jsx("button",{onClick:()=>c(o+Ua),disabled:o+Ua>=Z,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"}),le.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:v,onChange:B=>y(B.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"})]})]}),ne?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(ct,{})}):le.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(d1,{skills:le,search:v})]}),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"})}),X?l.jsx("div",{className:"p-8 flex justify-center",children:l.jsx(ct,{})}):K?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(de,{title:"Discovered",value:K.totalDiscovered,color:"cyan"}),l.jsx(de,{title:"Verified",value:K.totalVerified,color:"emerald"}),l.jsx(de,{title:"Rejected",value:K.totalRejected,color:"rose"}),l.jsx(de,{title:"Pending",value:K.totalPending,color:"amber"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(ih,{label:"Tier 1 Pass Rate",rate:K.tier1PassRate}),l.jsx(ih,{label:"Tier 2 Pass Rate",rate:K.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 d1({skills:i,search:u}){const o=[...i].sort((m,x)=>rh(x)-rh(m)),c=new Set(o.slice(0,3).map(m=>m.id)),f=u?o.filter(m=>m.repoFullName.toLowerCase().includes(u.toLowerCase())||m.author.toLowerCase().includes(u.toLowerCase())):o;return f.length===0?l.jsx("div",{className:"p-8 text-center",children:l.jsxs("p",{className:"text-gray-500 text-sm",children:['No skills match "',u,'"']})}):l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-4",children:f.map(m=>l.jsx(f1,{skill:m,trending:c.has(m.id)},m.id))})}function f1({skill:i,trending:u}){const o=Qh(i),c=r1(o),f=i1(o);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:[i.repoUrl?l.jsx("a",{href:i.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-gray-200 hover:text-indigo-300 truncate block transition-colors",children:i.repoFullName.split("/").pop()}):l.jsx("div",{className:"text-sm font-medium text-gray-200 truncate",children:i.repoFullName.split("/").pop()}),l.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:i.author})]}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 ml-2",children:[u&&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(xe,{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 ${f}`,children:o})]}),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:`${o}%`}})})]}),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"})}),c1(i.stars)]}),i.repoUrl&&l.jsx("a",{href:i.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-gray-500 hover:text-gray-300 transition-colors",children:"View on GitHub"})]})]})}function ih({label:i,rate:u}){const o=Math.round(u),c=o>=70?"bg-emerald-500":o>=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:i}),l.jsxs("span",{className:"text-sm font-bold text-gray-200",children:[o,"%"]})]}),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:`${o}%`}})})]})}function m1(){const{id:i}=Hv(),[u,o]=N.useState(0);$e("increment-update",()=>o(y=>y+1));const{data:c,loading:f,error:m,refetch:x}=De(`/api/increments/${i||"_none"}?_r=${u}`);if(!i)return l.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"No increment ID specified"});if(f)return l.jsx(ct,{});if(m)return l.jsx(sa,{message:m,onRetry:x});if(!c)return l.jsx("div",{className:"p-6 text-gray-500 text-sm",children:"Increment not found"});const b=c.taskSummary.total>0?Math.round(c.taskSummary.completed/c.taskSummary.total*100):0,v=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(xe,{label:c.metadata.status||"unknown",variant:Ui(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(x1,{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(de,{title:"Tasks",value:`${c.taskSummary.completed}/${c.taskSummary.total}`,color:"indigo"}),l.jsx(de,{title:"Task Progress",value:`${b}%`,color:"cyan"}),l.jsx(de,{title:"ACs",value:`${c.acSummary.completed}/${c.acSummary.total}`,color:"emerald"}),l.jsx(de,{title:"AC Progress",value:`${v}%`,color:"amber"})]}),l.jsxs("div",{className:"bg-gray-900/50 border border-gray-800 rounded-xl p-5 space-y-4",children:[l.jsx(ch,{label:"Tasks",completed:c.taskSummary.completed,total:c.taskSummary.total,color:"indigo"}),l.jsx(ch,{label:"Acceptance Criteria",completed:c.acSummary.completed,total:c.acSummary.total,color:"emerald"})]}),l.jsxs("section",{className:"work-evidence",children:[l.jsx("h3",{children:"Verification and specification"}),l.jsxs("p",{children:["Verification ",c.verification?.status||"missing",c.verification?.ranAt?` · ${c.verification.ranAt}`:""]}),l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Read specification"}),l.jsx("pre",{children:c.spec||"No specification found."})]}),c.verify&&Object.keys(c.verify).length>0&&l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Verification report"}),l.jsx("pre",{children:JSON.stringify(c.verify,null,2)})]}),c.handoff&&l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Latest handoff"}),l.jsx("pre",{children:c.handoff})]}),l.jsxs("details",{className:"work-handoff",children:[l.jsx("summary",{children:"Task evidence"}),c.tasks.map(y=>l.jsxs("div",{className:"py-3",children:[l.jsxs("strong",{children:[y.id," · ",y.status]}),l.jsx("p",{children:y.actor||"Actor unknown"}),l.jsx("pre",{children:y.evidence||y.note||"No ledger evidence recorded."})]},y.id))]})]}),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(y=>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 ${y.status==="completed"?"bg-indigo-500/20 border-indigo-500 text-indigo-400":"border-gray-600"}`,children:y.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:y.id}),l.jsx("span",{className:`text-sm ${y.status==="completed"?"text-gray-500 line-through":"text-gray-300"}`,children:y.title})]}),(y.userStory||y.acs)&&l.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[y.userStory&&l.jsx("span",{className:"text-[10px] text-indigo-400",children:y.userStory}),y.acs?.map(p=>l.jsx("span",{className:"text-[10px] text-emerald-500",children:p},p))]})]})]},y.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(y=>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 ${y.completed?"bg-emerald-500/20 border-emerald-500 text-emerald-400":"border-gray-600"}`,children:y.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:y.id}),l.jsx("span",{className:`text-sm ml-2 ${y.completed?"text-gray-500 line-through":"text-gray-300"}`,children:y.text})]})]},y.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(([y])=>!["title"].includes(y)).map(([y,p])=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-xs text-gray-500 font-mono",children:y}),l.jsx("span",{className:"text-xs text-gray-400",children:typeof p=="object"?JSON.stringify(p):String(p??"")})]},y))})]})]})}function ch({label:i,completed:u,total:o,color:c}){const f=o>0?Math.round(u/o*100):0,m=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:i}),l.jsxs("span",{className:"text-xs text-gray-500",children:[u,"/",o," (",f,"%)"]})]}),l.jsx("div",{className:"w-full h-2 bg-gray-800 rounded-full overflow-hidden",children:l.jsx("div",{className:`h-full ${m} rounded-full transition-all`,style:{width:`${f}%`}})})]})}function x1({priority:i}){const u={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 ${u[i]||u.P2}`,children:i})}const h1=["All","PreToolUse","PostToolUse","Stop","SubagentStop","TaskCompleted","UserPromptSubmit","PostToolUseFailure","PermissionRequest","SessionStart","SessionEnd","Notification","SubagentStart","ConfigChange","PreCompact","TeammateIdle"],g1=[{label:"All time",value:"0"},{label:"Last 1h",value:"3600000"},{label:"Last 6h",value:"21600000"},{label:"Last 24h",value:"86400000"}];function p1(i){const u=Date.now()-new Date(i).getTime();return u<6e4?`${Math.floor(u/1e3)}s ago`:u<36e5?`${Math.floor(u/6e4)}m ago`:u<864e5?`${Math.floor(u/36e5)}h ago`:`${Math.floor(u/864e5)}d ago`}function y1(i){const u=[];for(const o of i){const c=u[u.length-1];c&&c.type===o.eventName&&c.count<100?(c.count++,c.events.push(o)):u.push({type:o.eventName,count:1,events:[o],collapsed:!0})}return u}function v1(){const{data:i,loading:u}=De("/api/hooks/events?limit=200"),[o,c]=N.useState([]),[f,m]=lt("eventType","All"),[x,b]=lt("session",""),[v,y]=lt("range","0"),[p,h]=N.useState(null),[w,O]=N.useState(new Set);$e("hook-event",S=>{const T=S;T.id&&c(U=>[T,...U].slice(0,50))});const _=N.useMemo(()=>{const S=i?.data??[],T=new Set(S.map(ee=>ee.id));return[...o.filter(ee=>!T.has(ee.id)),...S].sort((ee,Q)=>new Date(Q.timestamp).getTime()-new Date(ee.timestamp).getTime())},[i,o]),R=N.useMemo(()=>{let S=_;f!=="All"&&(S=S.filter(U=>U.eventName===f)),x&&(S=S.filter(U=>U.sessionId.includes(x)));const T=parseInt(v,10);if(T>0){const U=Date.now()-T;S=S.filter(ee=>new Date(ee.timestamp).getTime()>U)}return S},[_,f,x,v]),j=N.useMemo(()=>y1(R),[R]);return u&&!i?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:f,onChange:S=>m(S.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:h1.map(S=>l.jsx("option",{value:S,children:S},S))}),l.jsx("input",{type:"text",placeholder:"Filter by session ID...",value:x,onChange:S=>b(S.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:v,onChange:S=>y(S.target.value),className:"bg-gray-800 border border-gray-700 text-gray-200 text-sm rounded px-3 py-1.5",children:g1.map(S=>l.jsx("option",{value:S.value,children:S.label},S.value))})]}),l.jsxs("div",{className:"space-y-1",children:[j.map((S,T)=>{const U=w.has(T),ee=S.count===1||U?S.events:[S.events[0]];return l.jsxs("div",{children:[S.count>1&&l.jsxs("button",{onClick:()=>{O(Q=>{const ne=new Set(Q);return ne.has(T)?ne.delete(T):ne.add(T),ne})},className:"w-full text-left px-3 py-1 text-xs text-gray-500 hover:text-gray-300 bg-gray-900 rounded",children:[U?"▾":"▸"," ",S.count,"× ",S.type]}),ee.map(Q=>{const ne=Q.result?.decision==="deny"||Q.result?.decision==="block";return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>h(p===Q.id?null:Q.id),className:`w-full text-left flex items-center gap-3 px-3 py-2 rounded text-sm hover:bg-gray-800/50 ${ne?"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:p1(Q.timestamp)}),l.jsx(xe,{label:Q.eventName,variant:ne?"error":"default"}),l.jsx("span",{className:"text-gray-400 text-xs truncate",children:Q.sessionId.slice(0,12)}),Q.durationMs!=null&&l.jsxs("span",{className:"text-gray-600 text-xs ml-auto",children:[Q.durationMs,"ms"]})]}),p===Q.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(Q.payload,null,2)})]},Q.id)})]},T)}),j.length===0&&l.jsx("div",{className:"text-center text-gray-600 py-8",children:"No hook events yet"})]})]})}function oh(i){return i<1e3?`${i}ms`:i<6e4?`${Math.floor(i/1e3)}s`:i<36e5?`${Math.floor(i/6e4)}m ${Math.floor(i%6e4/1e3)}s`:`${Math.floor(i/36e5)}h ${Math.floor(i%36e5/6e4)}m`}function j1(){const{data:i,loading:u}=De("/api/hooks/agents"),[o,c]=N.useState([]),[f,m]=lt("session",""),[,x]=N.useState(0);$e("hook-agent",w=>{const O=w;O.agentId&&c(_=>{const R=_.findIndex(j=>j.agentId===O.agentId);if(R>=0){const j=[..._];return j[R]={...j[R],...O},j}return[O,..._]})});const b=N.useMemo(()=>{const w=i?.data??[],O=new Set(w.map(_=>_.agentId));return[...o.filter(_=>!O.has(_.agentId)),...w]},[i,o]),v=N.useMemo(()=>f?b.filter(w=>w.sessionId.includes(f)):b,[b,f]),y=N.useMemo(()=>{const w=new Set(b.map(O=>O.sessionId));return Array.from(w)},[b]),p=N.useMemo(()=>v.filter(w=>!w.stoppedAt).length,[v]);N.useEffect(()=>{if(p===0)return;const w=setInterval(()=>x(O=>O+1),1e3);return()=>clearInterval(w)},[p]);const h=N.useMemo(()=>{const w=v.filter(O=>O.durationMs!=null);return w.length===0?0:Math.round(w.reduce((O,_)=>O+(_.durationMs??0),0)/w.length)},[v]);return u&&!i?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: ",v.length]}),l.jsxs("span",{children:["Running: ",p]}),l.jsxs("span",{children:["Avg duration: ",oh(h)]})]})]}),l.jsx("div",{className:"flex gap-3",children:l.jsxs("select",{value:f,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:[l.jsx("option",{value:"",children:"All sessions"}),y.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:[v.map(w=>{const O=!w.stoppedAt,_=O?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:oh(_)}),l.jsx("td",{className:"py-2 px-3",children:l.jsx(xe,{label:O?"running":"stopped",variant:O?"success":"default"})})]},w.agentId)}),v.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 qs({value:i,onSave:u,placeholder:o}){const[c,f]=N.useState(!1),[m,x]=N.useState(i),b=N.useRef(null);N.useEffect(()=>{c&&(b.current?.focus(),b.current?.select())},[c]);const v=()=>{m!==i&&u(m),f(!1)},y=()=>{x(i),f(!1)};return c?l.jsx("input",{ref:b,value:m,onChange:p=>x(p.target.value),onKeyDown:p=>{p.key==="Enter"&&v(),p.key==="Escape"&&y()},onBlur:v,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:o}):l.jsx("span",{onClick:()=>{x(i),f(!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:i||l.jsx("span",{className:"text-gray-600 italic",children:o||"Click to set"})})}function zn(i,u){return i?u==="github"&&i.github?`${i.github.owner}/${i.github.repo}`:u==="jira"&&i.jira?i.jira.projectKey:u==="ado"&&i.ado?i.ado.project:"":""}function zu(i,u){if(i==="github"){const o=u.split("/");return o.length===2?{github:{owner:o[0],repo:o[1]}}:{github:{owner:"",repo:u}}}return i==="jira"?{jira:{projectKey:u}}:i==="ado"?{ado:{project:u}}:{}}function b1({onClose:i,onSubmit:u}){const[o,c]=N.useState(""),[f,m]=N.useState(""),[x,b]=N.useState(""),[v,y]=N.useState(""),[p,h]=N.useState(""),w=N.useRef(null);N.useEffect(()=>{w.current?.focus()},[]);const O=_=>{if(_.preventDefault(),!o.trim()||!f.trim()||!x.trim()){h("ID, Path, and Prefix are required");return}u({id:o.trim(),path:f.trim(),prefix:x.trim(),name:v.trim()||void 0})};return l.jsx("div",{className:"fixed inset-0 bg-black/60 flex items-center justify-center z-50",onClick:i,children:l.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-xl p-6 w-full max-w-md shadow-2xl",onClick:_=>_.stopPropagation(),children:[l.jsx("h3",{className:"text-sm font-semibold text-gray-200 mb-4",children:"Add Repository"}),l.jsxs("form",{onSubmit:O,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:o,onChange:_=>c(_.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:f,onChange:_=>m(_.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:x,onChange:_=>b(_.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:v,onChange:_=>y(_.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"})]}),p&&l.jsx("p",{className:"text-xs text-rose-400",children:p}),l.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[l.jsx("button",{type:"button",onClick:i,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 N1(){const{data:i,loading:u,error:o,refetch:c}=De("/api/workspace"),{activeProject:f}=ja(),[m,x]=N.useState(!1),[b,v]=N.useState(null),y=f?.id?`?project=${f.id}`:"",p=N.useCallback(async(S,T)=>{try{v(null);const U=await fetch(`/api/workspace/repos/${encodeURIComponent(S)}${y}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(!U.ok){const ee=await U.json();v(ee.error||`Failed to update ${S}`);return}c()}catch(U){v(U.message)}},[y,c]),h=N.useCallback(async S=>{try{v(null);const T=await fetch(`/api/workspace/repos${y}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)});if(!T.ok){const U=await T.json();v(U.error||"Failed to add repo");return}x(!1),c()}catch(T){v(T.message)}},[y,c]),w=N.useCallback(async S=>{if(confirm(`Remove "${S}" from workspace?`))try{v(null);const T=await fetch(`/api/workspace/repos/${encodeURIComponent(S)}${y}`,{method:"DELETE"});if(!T.ok&&T.status!==204){const U=await T.json();v(U.error||`Failed to remove ${S}`);return}c()}catch(T){v(T.message)}},[y,c]);if(u)return l.jsx(ct,{});if(o)return l.jsx(sa,{message:o,onRetry:c});const O=i||{name:"",rootRepo:null,repos:[]},_=O.repos.filter(S=>S.sync?.github).length,R=O.repos.filter(S=>S.sync?.jira).length,j=O.repos.filter(S=>S.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"}),O.name&&l.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:O.name})]}),l.jsxs("button",{onClick:()=>x(!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"]})]}),b&&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:b})}),l.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(de,{title:"Repositories",value:O.repos.length,color:"indigo"}),l.jsx(de,{title:"GitHub Mapped",value:_,color:"cyan"}),l.jsx(de,{title:"Jira Mapped",value:R,color:"amber"}),l.jsx(de,{title:"ADO Mapped",value:j,color:"emerald"})]}),O.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(xe,{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:zn(O.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:zn(O.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:zn(O.rootRepo,"ado")||"-"})]})]})]}),O.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:O.repos.map(S=>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:S.id})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(qs,{value:S.name||"",onSave:T=>p(S.id,{name:T}),placeholder:"Set name"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(xe,{label:S.prefix,variant:"default"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(qs,{value:zn(S.sync,"github"),onSave:T=>p(S.id,{sync:{...S.sync,...zu("github",T)}}),placeholder:"owner/repo"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(qs,{value:zn(S.sync,"jira"),onSave:T=>p(S.id,{sync:{...S.sync,...zu("jira",T)}}),placeholder:"PROJECT"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(qs,{value:zn(S.sync,"ado"),onSave:T=>p(S.id,{sync:{...S.sync,...zu("ado",T)}}),placeholder:"project"})}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(qs,{value:S.role||"",onSave:T=>p(S.id,{role:T}),placeholder:"Set role"})}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsx("button",{onClick:()=>w(S.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"})})})})]},S.id))})]})})}),m&&l.jsx(b1,{onClose:()=>x(!1),onSubmit:h})]})}const Nt=864e5,S1={"7d":7,"30d":30,"90d":90,all:0},w1={backlog:"Backlog",active:"In progress",blocked:"Blocked",review:"Review",done:"Done"},E1={claim:"claimed",done:"finished",skip:"skipped",block:"blocked",release:"released",note:"noted",handoff:"handed off",pickup:"picked up",wait:"waiting"},Lu=40,$l=i=>new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}),Xh=i=>new Date(i).toLocaleDateString([],{month:"short",day:"numeric"});function Mi(i){if(i<60)return`${Math.max(1,Math.round(i))} min`;const u=i/60;return u<10?`${u.toFixed(1)} h`:`${Math.round(u)} h`}function T1(i,u){const o=(u-Date.parse(i))/6e4;return o<1?"now":o<60?`${Math.round(o)}m ago`:o<1440?`${Math.round(o/60)}h ago`:`${Math.round(o/1440)}d ago`}const Ha=i=>i.state!=="done"&&i.status!=="completed"&&i.status!=="abandoned",C1=["claude","codex","copilot","cursor","gemini","grok"],Gs=i=>C1.find(u=>i===u||i.startsWith(`${u}-`))??"other",uh={"1d":1,"3d":3,"7d":7,window:0};function R1(){const{activeProject:i}=ja(),u=Di(),{data:o,error:c,loading:f,refetch:m}=De("/api/plan"),[x,b]=lt("q"),[v,y]=lt("scope","open"),[p,h]=lt("tool","all"),[w,O]=lt("window","30d"),[_,R]=lt("zoom","1d"),[j,S]=N.useState(!1),[T,U]=N.useState(()=>Date.now());$e("increment-update",m),N.useEffect(()=>{const P=setInterval(()=>{m(),U(Date.now())},15e3);return()=>clearInterval(P)},[m]);const ee=i?`?project=${encodeURIComponent(i.id)}`:"",Q=P=>`/increments/${encodeURIComponent(P)}${ee}`,ne=S1[w]??30,K=ne?T-ne*Nt:0,X=x.trim().toLowerCase(),k=N.useMemo(()=>(o?.rows??[]).filter(C=>!(v==="open"&&!Ha(C)||v==="done"&&Ha(C)||p!=="all"&&!C.tools.includes(p)||X&&!`${C.incrementId} ${C.title}`.toLowerCase().includes(X)||K&&!Ha(C)&&Date.parse(C.end??C.start)<K)).sort((C,G)=>Ha(C)!==Ha(G)?Ha(C)?-1:1:(G.lastEvent?.at??G.end??G.start).localeCompare(C.lastEvent?.at??C.end??C.start)),[o,v,p,X,K]),F=N.useMemo(()=>new Set(k.map(P=>P.incrementId)),[k]),ae=N.useMemo(()=>(o?.activity??[]).filter(P=>F.has(P.incrementId)&&(p==="all"||P.tool===p)&&(!K||Date.parse(P.at)>=K)),[o,F,p,K]),Se=N.useMemo(()=>(o?.closes??[]).filter(P=>F.has(P.incrementId)&&(p==="all"||P.tool===p)),[o,F,p]),Te=N.useMemo(()=>O1(Se,T),[Se,T]),ze=N.useMemo(()=>[...new Set((o?.rows??[]).flatMap(P=>P.tools))].sort(),[o]),se=k.filter(P=>P.remaining),Z=se.reduce((P,C)=>P+(C.remaining?.p50Minutes??0),0),le=se.reduce((P,C)=>P+(C.remaining?.p80Minutes??0),0),I=Math.max(1,Math.min(o?.lanes??1,se.length||1)),J=se.reduce((P,C)=>P+(C.remaining?.tasks??0),0),fe=k.filter(P=>!Ha(P)&&P.tasks.done+P.tasks.skipped>=2),B=fe.filter(P=>!P.recordedAfter).length,V=Se.filter(P=>Date.parse(P.at)>=T-7*Nt).length;return l.jsxs("div",{className:"work-page timeline-page",children:[l.jsxs("div",{className:"work-eyebrow",children:[l.jsx("span",{className:"work-live-dot connected"}),"TIMELINE",l.jsx("span",{children:"FROM THE TASK LEDGER · NO MODEL CALLS"})]}),l.jsxs("div",{className:"work-heading",children:[l.jsxs("div",{children:[l.jsx("h1",{children:"Where the work is, and when it lands."}),l.jsx("p",{children:"Every increment on one timeline, with forecasts from this project's own pace."})]}),l.jsx(Qe,{className:"work-secondary",to:`/${ee}`,children:"Kanban board ↗"})]}),l.jsxs("div",{className:"timeline-filters",role:"group","aria-label":"Timeline filters",children:[l.jsx("div",{className:"timeline-segmented",role:"radiogroup","aria-label":"Status",children:[["open","Open"],["all","All"],["done","Done"]].map(([P,C])=>l.jsx("button",{role:"radio","aria-checked":v===P,className:v===P?"on":"",onClick:()=>y(P),children:C},P))}),l.jsxs("label",{children:[l.jsx("span",{children:"Agent"}),l.jsxs("select",{"aria-label":"Agent tool",value:p,onChange:P=>h(P.target.value),children:[l.jsx("option",{value:"all",children:"All agents"}),ze.map(P=>l.jsx("option",{value:P,children:P},P))]})]}),l.jsxs("label",{children:[l.jsx("span",{children:"Window"}),l.jsxs("select",{"aria-label":"Time window",value:w,onChange:P=>O(P.target.value),children:[l.jsx("option",{value:"7d",children:"Last 7 days"}),l.jsx("option",{value:"30d",children:"Last 30 days"}),l.jsx("option",{value:"90d",children:"Last 90 days"}),l.jsx("option",{value:"all",children:"All time"})]})]}),l.jsxs("label",{children:[l.jsx("span",{children:"Gantt"}),l.jsxs("select",{"aria-label":"Gantt range",value:_,onChange:P=>R(P.target.value),children:[l.jsx("option",{value:"1d",children:"Last day + forecast"}),l.jsx("option",{value:"3d",children:"Last 3 days + forecast"}),l.jsx("option",{value:"7d",children:"Last 7 days + forecast"}),l.jsx("option",{value:"window",children:"Whole window"})]})]}),l.jsxs("label",{className:"work-search",children:[l.jsx("span",{"aria-hidden":"true",children:"⌕"}),l.jsx("input",{"aria-label":"Search increments",value:x,onChange:P=>b(P.target.value),placeholder:"Find an increment…"})]})]}),c&&l.jsxs("div",{role:"alert",className:"work-error",children:[c,l.jsx("button",{onClick:m,children:"Retry"})]}),l.jsxs("div",{className:"work-metrics timeline-metrics","data-testid":"timeline-kpis",children:[l.jsxs("div",{children:[l.jsx("span",{children:"Open increments"}),l.jsx("strong",{children:se.length}),l.jsxs("small",{children:[J," tasks left"]})]}),l.jsxs("div",{children:[l.jsxs("span",{children:["Forecast, ",I," ",I===1?"agent":"agents in parallel"]}),l.jsx("strong",{children:se.length?Z/I<1440?$l(T+Z*6e4/I):Xh(T+Z*6e4/I):"—"}),l.jsx("small",{children:se.length?`${Mi(Z/I)} at the median pace, ${Mi(le/I)} at p80 (${$l(T+le*6e4/I)})`:"nothing open in this view"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"Closed in the last 7 days"}),l.jsx("strong",{children:V}),l.jsx("small",{children:"tasks done or skipped"})]}),l.jsxs("div",{children:[l.jsx("span",{children:"Planned before the work"}),l.jsx("strong",{className:fe.length&&B/fe.length<.5?"timeline-warn":"",children:fe.length?`${Math.round(B/fe.length*100)}%`:"—"}),l.jsxs("small",{children:[fe.length-B," of ",fe.length," recorded after the fact · ",o?.smallFixes??0," small fixes"]})]})]}),f&&!o?l.jsx("p",{className:"work-empty",children:"Reading the ledger…"}):l.jsxs(l.Fragment,{children:[l.jsx(A1,{rows:j?k:k.slice(0,Lu),now:T,rangeStart:uh[_]?T-uh[_]*Nt:K,detail:Q,onOpen:P=>u(Q(P))}),k.length>Lu&&l.jsx("button",{className:"work-secondary timeline-more",onClick:()=>S(!j),children:j?`Show the first ${Lu}`:`Show all ${k.length} increments`}),l.jsxs("div",{className:"timeline-lower",children:[l.jsxs("section",{className:"timeline-panel","aria-label":"Throughput",children:[l.jsxs("h2",{children:["Throughput ",l.jsx("span",{children:"tasks closed per day, last 30 days"})]}),l.jsx(M1,{data:Te}),l.jsx(_1,{payload:o})]}),l.jsxs("section",{className:"timeline-panel","aria-label":"Latest activity",children:[l.jsxs("h2",{children:["Latest activity ",l.jsxs("span",{children:[ae.length," events"]})]}),l.jsx(D1,{items:ae.slice(0,40),now:T,detail:Q})]})]})]})]})}function A1({rows:i,now:u,rangeStart:o,detail:c,onOpen:f}){if(!i.length)return l.jsx("p",{className:"work-empty",children:"No increments match these filters."});const m=i.map(S=>Date.parse(S.start)),x=Math.max(u,...i.map(S=>S.remaining?u+S.remaining.p80Minutes*6e4:0)),b=Math.max(Math.min(...m),o||0),v=Math.max(u-b,36e5),y=Math.min(Math.max(x+v*.05,u+v/4),u+14*Nt),p=y-b,h=S=>`${Math.min(100,Math.max(0,(S-b)/p*100))}%`,w=(S,T)=>`${Math.max(.35,(Math.min(T,y)-Math.max(S,b))/p*100)}%`,O=[],_=p>45*Nt?7*Nt:p>12*Nt?2*Nt:p>4*Nt?Nt:p>1.5*Nt?Nt/4:Nt/8,R=new Date(b);R.setHours(0,0,0,0);for(let S=R.getTime()+_;S<y-_/3;S+=_)S>b+_/3&&O.push(S);const j=S=>_>=Nt||new Date(S).getHours()===0?Xh(S):new Date(S).toLocaleTimeString([],{hour:"numeric"});return l.jsxs("section",{className:"timeline-gantt","aria-label":"Gantt chart","data-testid":"gantt",children:[l.jsxs("div",{className:"gantt-head",children:[l.jsx("div",{className:"gantt-label",children:"Increment"}),l.jsxs("div",{className:"gantt-track",children:[O.map(S=>l.jsx("span",{className:"gantt-tick",style:{left:h(S)},children:j(S)},S)),l.jsx("span",{className:"gantt-now-label",style:{left:h(u)},children:"Now"})]})]}),i.map(S=>{const T=Date.parse(S.start),U=Ha(S)?u:S.end?Date.parse(S.end):T,ee=S.remaining?u+S.remaining.p50Minutes*6e4:0,Q=S.remaining?u+S.remaining.p80Minutes*6e4:0,ne=S.tasks.total?`${S.tasks.done+S.tasks.skipped}/${S.tasks.total} tasks`:"no tasks";return l.jsxs("div",{className:`gantt-row state-${S.state}`,"data-increment":S.incrementId,children:[l.jsxs("div",{className:"gantt-label",children:[l.jsxs(Qe,{to:c(S.incrementId),title:S.title,children:[l.jsx("code",{children:S.incrementId.split("-")[0]})," ",S.title]}),l.jsxs("small",{children:[w1[S.state]," · ",ne,S.recordedAfter&&l.jsx("em",{title:"Most tasks were closed with no live claim-to-done span",children:" · recorded after"})," · ",l.jsx("a",{href:`vscode://file${S.specPath}`,title:S.specPath,children:"spec.md"})]})]}),l.jsxs("div",{className:"gantt-track",onClick:()=>f(S.incrementId),role:"presentation",children:[O.map(K=>l.jsx("span",{className:"gantt-grid",style:{left:h(K)}},K)),S.lastEvent&&U>=b&&l.jsx("span",{className:"gantt-bar",style:{left:h(T),width:w(T,U)},title:`${S.title}
|
|
14
|
-
${$l(T)} → ${Ha(S)?"now":$l(U)}
|
|
15
|
-
${ne}, ${S.acs.done}/${S.acs.total} ACs`}),S.remaining&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"gantt-forecast",style:{left:h(u),width:w(u,ee)},title:`Forecast: ${S.remaining.tasks} tasks, ${Mi(S.remaining.p50Minutes)} (p50) to ${Mi(S.remaining.p80Minutes)} (p80) of uninterrupted work
|
|
16
|
-
Lands ${$l(ee)}, by ${$l(Q)} at p80`}),l.jsx("span",{className:"gantt-whisker",style:{left:h(ee),width:w(ee,Q)}})]}),l.jsx("span",{className:"gantt-now",style:{left:h(u)}})]})]},S.incrementId)}),l.jsxs("div",{className:"gantt-legend",children:[l.jsx("span",{className:"legend-live",children:"Worked"}),l.jsx("span",{className:"legend-forecast",children:"Forecast (p50)"}),l.jsx("span",{className:"legend-whisker",children:"to p80"}),l.jsx("span",{children:"Forecasts assume uninterrupted work at this project's measured pace."})]})]})}function O1(i,u){const o=f=>new Date(f).toLocaleDateString("en-CA"),c=new Map;for(let f=29;f>=0;f--){const m=o(u-f*Nt);c.set(m,{date:m,byFamily:{}})}for(const f of i){const m=c.get(o(Date.parse(f.at)));m&&(m.byFamily[Gs(f.tool)]=(m.byFamily[Gs(f.tool)]??0)+1)}return[...c.values()]}function M1({data:i}){const u=i.map(b=>b.byFamily),o=u.map(b=>Object.values(b).reduce((v,y)=>v+y,0)),c=Math.max(1,...o),f=[...new Set(u.flatMap(b=>Object.keys(b)))],m=120,x=100/Math.max(1,i.length);return l.jsxs("figure",{className:"timeline-throughput",children:[l.jsx("svg",{viewBox:`0 0 100 ${m}`,preserveAspectRatio:"none",role:"img","aria-label":`Tasks closed per day; peak ${c}`,children:u.map((b,v)=>{let y=m;return f.map(p=>{const h=(b[p]??0)/c*(m-6);return h?(y-=h,l.jsx("rect",{className:`tool-${Gs(p)}`,x:v*x+x*.15,y,width:x*.7,height:h,children:l.jsx("title",{children:`${i[v].date}: ${b[p]} by ${p}`})},`${v}-${p}`)):null})})}),l.jsxs("figcaption",{children:[l.jsx("span",{children:i[0]?.date}),l.jsxs("span",{children:["peak ",c,"/day"]}),l.jsx("span",{children:i[i.length-1]?.date})]}),l.jsx("div",{className:"timeline-tool-legend",children:f.slice(0,8).map(b=>l.jsx("span",{className:`tool-${Gs(b)}`,children:b},b))})]})}function _1({payload:i}){if(!i)return null;const{overall:u,byTool:o,byModel:c,fallback:f}=i.rates,m=[...c.slice(0,4).map(x=>({...x,kind:"model"})),...o.slice(0,5).map(x=>({...x,kind:"agent"}))];return l.jsxs("div",{className:"timeline-pace",children:[l.jsxs("h3",{children:["Pace ",l.jsxs("span",{children:["minutes per task weight unit, from ",u.samples," tasks tracked live"]})]}),f&&l.jsx("p",{className:"work-warning",children:"Too little live history; forecasts use 30 min (p50) and 60 min (p80) per unit."}),l.jsxs("table",{children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Source"}),l.jsx("th",{children:"Tasks"}),l.jsx("th",{children:"p50"}),l.jsx("th",{children:"p80"})]})}),l.jsxs("tbody",{children:[l.jsxs("tr",{children:[l.jsx("td",{children:"All work"}),l.jsx("td",{children:u.samples}),l.jsx("td",{children:u.p50}),l.jsx("td",{children:u.p80})]}),m.map(x=>l.jsxs("tr",{children:[l.jsxs("td",{children:[l.jsx("small",{children:x.kind})," ",x.key]}),l.jsx("td",{children:x.samples}),l.jsx("td",{children:x.p50}),l.jsx("td",{children:x.p80})]},`${x.kind}-${x.key}`))]})]})]})}function D1({items:i,now:u,detail:o}){return i.length?l.jsx("ol",{className:"timeline-activity",children:i.map((c,f)=>l.jsxs("li",{children:[l.jsx("time",{dateTime:c.at,title:$l(Date.parse(c.at)),children:T1(c.at,u)}),l.jsx("span",{className:`activity-event event-${c.event}`,children:E1[c.event]??c.event}),l.jsxs("div",{children:[l.jsxs(Qe,{to:o(c.incrementId),children:[l.jsx("code",{children:c.incrementId.split("-")[0]})," ",c.task!=="*"?`${c.task} · `:"",c.title]}),c.note&&l.jsx("p",{children:c.note}),l.jsxs("small",{children:[l.jsx("span",{className:`tool-dot tool-${Gs(c.tool)}`})," ",c.by,c.model?` · ${c.model}`:""]})]})]},`${c.at}-${c.incrementId}-${c.task}-${f}`))}):l.jsx("p",{className:"work-empty",children:"No ledger activity in this view."})}function z1(){const i=Dj(),u=na();return l.jsx(zh.Provider,{value:i,children:l.jsx(kj,{children:l.jsxs("div",{className:"work-shell flex min-h-screen text-gray-100",children:[l.jsx(Yj,{}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[l.jsx(Gj,{}),l.jsx("main",{className:"flex-1 overflow-y-auto",children:l.jsx(Qj,{resetKey:u.pathname,children:l.jsxs(Wv,{children:[l.jsx(Ze,{path:"/",element:l.jsx(Qx,{})}),l.jsx(Ze,{path:"/project",element:l.jsx(Hj,{})}),l.jsx(Ze,{path:"/timeline",element:l.jsx(R1,{})}),l.jsx(Ze,{path:"/sessions",element:l.jsx(Qx,{sessionsOnly:!0})}),l.jsx(Ze,{path:"/overview",element:l.jsx(tb,{})}),l.jsx(Ze,{path:"/increments",element:l.jsx(nb,{})}),l.jsx(Ze,{path:"/increments/:id",element:l.jsx(m1,{})}),l.jsx(Ze,{path:"/analytics",element:l.jsx(ib,{})}),l.jsx(Ze,{path:"/costs",element:l.jsx(yb,{})}),l.jsx(Ze,{path:"/sync",element:l.jsx(Eb,{})}),l.jsx(Ze,{path:"/errors",element:l.jsx(Ob,{})}),l.jsx(Ze,{path:"/activity",element:l.jsx(Hb,{})}),l.jsx(Ze,{path:"/config",element:l.jsx(qb,{})}),l.jsx(Ze,{path:"/plugins",element:l.jsx(Gb,{})}),l.jsx(Ze,{path:"/services",element:l.jsx(Xb,{})}),l.jsx(Ze,{path:"/notifications",element:l.jsx(Kb,{})}),l.jsx(Ze,{path:"/repos",element:l.jsx(Fb,{})}),l.jsx(Ze,{path:"/marketplace",element:l.jsx(u1,{})}),l.jsx(Ze,{path:"/hooks",element:l.jsx(v1,{})}),l.jsx(Ze,{path:"/agents",element:l.jsx(j1,{})}),l.jsx(Ze,{path:"/workspace",element:l.jsx(N1,{})}),l.jsx(Ze,{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."})]})})]})})})]})]})})})}Py.createRoot(document.getElementById("root")).render(l.jsx(N.StrictMode,{children:l.jsx(wj,{children:l.jsx(z1,{})})}));
|