@a5c-ai/agent-mux-webui 5.0.1-staging.686c8b317 → 5.0.1-staging.69cb593ea536

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.
@@ -0,0 +1,45 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var F=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&&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)},I={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ee}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,F)}catch(e){F(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),p=s(((e,t)=>{t.exports=f()})),m=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),h=s(((e,t)=>{t.exports=m()})),g=s((e=>{var t=p();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),_=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=s((e=>{var t=h(),n=p(),r=_();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,m=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var ee=Array.isArray,F=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function ie(e){return{current:e}}function L(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function R(e,t){re++,ne[re]=e.current,e.current=t}var ae=ie(null),oe=ie(null),se=ie(null),ce=ie(null);function le(e,t){switch(R(se,t),R(oe,e),R(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}L(ae),R(ae,e)}function ue(){L(ae),L(oe),L(se)}function z(e){e.memoizedState!==null&&R(ce,e);var t=ae.current,n=Ud(t,e.type);t!==n&&(R(oe,e),R(ae,n))}function de(e){oe.current===e&&(L(ae),L(oe)),ce.current===e&&(L(ce),Qf._currentValue=te)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,B=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Te=t.unstable_ImmediatePriority,Ee=t.unstable_UserBlockingPriority,V=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var Pe=Math.clz32?Math.clz32:Le,Fe=Math.log,Ie=Math.LN2;function Le(e){return e>>>=0,e===0?32:31-(Fe(e)/Ie|0)|0}var Re=256,ze=262144,Be=4194304;function Ve(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(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 Ge(){var e=Be;return Be<<=1,!(Be&62914560)&&(Be=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Pe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function H(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(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 Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=I.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function et(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,U=`__reactEvents$`+tt,at=`__reactListeners$`+tt,ot=`__reactHandles$`+tt,st=`__reactResources$`+tt,ct=`__reactMarker$`+tt;function lt(e){delete e[nt],delete e[rt],delete e[U],delete e[at],delete e[ot]}function ut(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[nt])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function W(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function dt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ft(e){var t=e[st];return t||=e[st]={hoistableStyles:new Map,hoistableScripts:new Map},t}function pt(e){e[ct]=!0}var mt=new Set,ht={};function gt(e,t){_t(e,t),_t(e+`Capture`,t)}function _t(e,t){for(ht[e]=t,e=0;e<t.length;e++)mt.add(t[e])}var vt=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]*$`),yt={},bt={};function xt(e){return ye.call(bt,e)?!0:ye.call(yt,e)?!1:vt.test(e)?bt[e]=!0:(yt[e]=!0,!1)}function St(e,t,n){if(xt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ct(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function wt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Tt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Et(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Dt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ot(e){if(!e._valueTracker){var t=Et(e)?`checked`:`value`;e._valueTracker=Dt(e,t,``+e[t])}}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Et(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function kt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var At=/[\n"\\]/g;function jt(e){return e.replace(At,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Mt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Tt(t)):e.value!==``+Tt(t)&&(e.value=``+Tt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Pt(e,o,Tt(n)):Pt(e,o,Tt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Tt(s):e.removeAttribute(`name`)}function Nt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ot(e);return}n=n==null?``:``+Tt(n),t=t==null?n:``+Tt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ot(e)}function Pt(e,t,n){t===`number`&&kt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ft(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Tt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function It(e,t,n){if(t!=null&&(t=``+Tt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Tt(n)}function K(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ee(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Tt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ot(e)}function q(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lt=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 Rt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Lt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function zt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Rt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Rt(e,o,t[o])}function Bt(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 Vt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Ht=/^[\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 Ut(e){return Ht.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function J(){}var Wt=null;function Gt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kt=null,qt=null;function Jt(e){var t=W(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Mt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Mt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&G(r)}break a;case`textarea`:It(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ft(e,!!n.multiple,t,!1)}}}var Yt=!1;function Xt(e,t,n){if(Yt)return e(t,n);Yt=!0;try{return e(t)}finally{if(Yt=!1,(Kt!==null||qt!==null)&&(vu(),Kt&&(t=Kt,e=qt,qt=Kt=null,Jt(t),e)))for(t=0;t<e.length;t++)Jt(e[t])}}function Zt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Qt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),$t=!1;if(Qt)try{var en={};Object.defineProperty(en,`passive`,{get:function(){$t=!0}}),window.addEventListener(`test`,en,en),window.removeEventListener(`test`,en,en)}catch{$t=!1}var tn=null,nn=null,rn=null;function an(){if(rn)return rn;var e,t=nn,n=t.length,r,i=`value`in tn?tn.value:tn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return rn=i.slice(e,1<r?1-r:void 0)}function on(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 sn(){return!0}function cn(){return!1}function ln(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?sn:cn,this.isPropagationStopped=cn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=sn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=sn)},persist:function(){},isPersistent:sn}),t}var un={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=ln(un),fn=f({},un,{view:0,detail:0}),pn=ln(fn),mn,hn,gn,_n=f({},fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:On,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!==gn&&(gn&&e.type===`mousemove`?(mn=e.screenX-gn.screenX,hn=e.screenY-gn.screenY):hn=mn=0,gn=e),mn)},movementY:function(e){return`movementY`in e?e.movementY:hn}}),vn=ln(_n),yn=ln(f({},_n,{dataTransfer:0})),bn=ln(f({},fn,{relatedTarget:0})),xn=ln(f({},un,{animationName:0,elapsedTime:0,pseudoElement:0})),Sn=ln(f({},un,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Cn=ln(f({},un,{data:0})),wn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Tn={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`},En={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Dn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=En[e])?!!t[e]:!1}function On(){return Dn}var kn=ln(f({},fn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=on(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Tn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:On,charCode:function(e){return e.type===`keypress`?on(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?on(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),An=ln(f({},_n,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),jn=ln(f({},fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:On})),Y=ln(f({},un,{propertyName:0,elapsedTime:0,pseudoElement:0})),Mn=ln(f({},_n,{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})),Nn=ln(f({},un,{newState:0,oldState:0})),Pn=[9,13,27,32],Fn=Qt&&`CompositionEvent`in window,In=null;Qt&&`documentMode`in document&&(In=document.documentMode);var Ln=Qt&&`TextEvent`in window&&!In,Rn=Qt&&(!Fn||In&&8<In&&11>=In),zn=` `,Bn=!1;function Vn(e,t){switch(e){case`keyup`:return Pn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Hn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Un=!1;function Wn(e,t){switch(e){case`compositionend`:return Hn(t);case`keypress`:return t.which===32?(Bn=!0,zn):null;case`textInput`:return e=t.data,e===zn&&Bn?null:e;default:return null}}function Gn(e,t){if(Un)return e===`compositionend`||!Fn&&Vn(e,t)?(e=an(),rn=nn=tn=null,Un=!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 Rn&&t.locale!==`ko`?null:t.data;default:return null}}var Kn={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 qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Kn[e.type]:t===`textarea`}function Jn(e,t,n,r){Kt?qt?qt.push(r):qt=[r]:Kt=r,t=Ed(t,`onChange`),0<t.length&&(n=new dn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Xn=null;function Zn(e){vd(e,0)}function Qn(e){if(G(dt(e)))return e}function $n(e,t){if(e===`change`)return t}var er=!1;if(Qt){var tr;if(Qt){var nr=`oninput`in document;if(!nr){var rr=document.createElement(`div`);rr.setAttribute(`oninput`,`return;`),nr=typeof rr.oninput==`function`}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function ir(){Yn&&(Yn.detachEvent(`onpropertychange`,ar),Xn=Yn=null)}function ar(e){if(e.propertyName===`value`&&Qn(Xn)){var t=[];Jn(t,Xn,e,Gt(e)),Xt(Zn,t)}}function or(e,t,n){e===`focusin`?(ir(),Yn=t,Xn=n,Yn.attachEvent(`onpropertychange`,ar)):e===`focusout`&&ir()}function sr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Qn(Xn)}function cr(e,t){if(e===`click`)return Qn(t)}function lr(e,t){if(e===`input`||e===`change`)return Qn(t)}function ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var dr=typeof Object.is==`function`?Object.is:ur;function fr(e,t){if(dr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!dr(e[i],t[i]))return!1}return!0}function pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mr(e,t){var n=pr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=pr(n)}}function hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=kt(e.document)}return t}function _r(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 vr=Qt&&`documentMode`in document&&11>=document.documentMode,yr=null,br=null,xr=null,Sr=!1;function Cr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sr||yr==null||yr!==kt(r)||(r=yr,`selectionStart`in r&&_r(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),xr&&fr(xr,r)||(xr=r,r=Ed(br,`onSelect`),0<r.length&&(t=new dn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=yr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Tr={animationend:wr(`Animation`,`AnimationEnd`),animationiteration:wr(`Animation`,`AnimationIteration`),animationstart:wr(`Animation`,`AnimationStart`),transitionrun:wr(`Transition`,`TransitionRun`),transitionstart:wr(`Transition`,`TransitionStart`),transitioncancel:wr(`Transition`,`TransitionCancel`),transitionend:wr(`Transition`,`TransitionEnd`)},Er={},Dr={};Qt&&(Dr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Tr.animationend.animation,delete Tr.animationiteration.animation,delete Tr.animationstart.animation),`TransitionEvent`in window||delete Tr.transitionend.transition);function Or(e){if(Er[e])return Er[e];if(!Tr[e])return e;var t=Tr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Dr)return Er[e]=t[n];return e}var kr=Or(`animationend`),Ar=Or(`animationiteration`),jr=Or(`animationstart`),Mr=Or(`transitionrun`),Nr=Or(`transitionstart`),Pr=Or(`transitioncancel`),Fr=Or(`transitionend`),Ir=new Map,Lr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Lr.push(`scrollEnd`);function Rr(e,t){Ir.set(e,t),gt(t,[e])}var zr=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&&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)},Br=[],Vr=0,Hr=0;function Ur(){for(var e=Vr,t=Hr=Vr=0;t<e;){var n=Br[t];Br[t++]=null;var r=Br[t];Br[t++]=null;var i=Br[t];Br[t++]=null;var a=Br[t];if(Br[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&qr(n,i,a)}}function Wr(e,t,n,r){Br[Vr++]=e,Br[Vr++]=t,Br[Vr++]=n,Br[Vr++]=r,Hr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Gr(e,t,n,r){return Wr(e,t,n,r),Jr(e)}function Kr(e,t){return Wr(e,null,null,t),Jr(e)}function qr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Pe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Jr(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Yr={};function Xr(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(e,t,n,r){return new Xr(e,t,n,r)}function Qr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $r(e,t){var n=e.alternate;return n===null?(n=Zr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ei(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ti(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)Qr(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=Zr(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ni(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=Zr(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=Zr(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=Zr(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Zr(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ni(e,t,n,r){return e=Zr(7,e,r,t),e.lanes=n,e}function ri(e,t,n){return e=Zr(6,e,null,t),e.lanes=n,e}function ii(e){var t=Zr(18,null,null,0);return t.stateNode=e,t}function ai(e,t,n){return t=Zr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var oi=new WeakMap;function si(e,t){if(typeof e==`object`&&e){var n=oi.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},oi.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var ci=[],li=0,ui=null,di=0,fi=[],pi=0,mi=null,hi=1,gi=``;function _i(e,t){ci[li++]=di,ci[li++]=ui,ui=e,di=t}function vi(e,t,n){fi[pi++]=hi,fi[pi++]=gi,fi[pi++]=mi,mi=e;var r=hi;e=gi;var i=32-Pe(r)-1;r&=~(1<<i),n+=1;var a=32-Pe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,hi=1<<32-Pe(t)+i|n<<i|r,gi=a+e}else hi=1<<a|n<<i|r,gi=e}function yi(e){e.return!==null&&(_i(e,1),vi(e,1,0))}function bi(e){for(;e===ui;)ui=ci[--li],ci[li]=null,di=ci[--li],ci[li]=null;for(;e===mi;)mi=fi[--pi],fi[pi]=null,gi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null}function xi(e,t){fi[pi++]=hi,fi[pi++]=gi,fi[pi++]=mi,hi=t.id,gi=t.overflow,mi=e}var Si=null,Ci=null,wi=!1,Ti=null,Ei=!1,Di=Error(i(519));function Oi(e){throw Pi(si(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Di}function ki(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[nt]=e,t[rt]=r,n){case`dialog`:yd(`cancel`,t),yd(`close`,t);break;case`iframe`:case`object`:case`embed`:yd(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)yd(gd[n],t);break;case`source`:yd(`error`,t);break;case`img`:case`image`:case`link`:yd(`error`,t),yd(`load`,t);break;case`details`:yd(`toggle`,t);break;case`input`:yd(`invalid`,t),Nt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:yd(`invalid`,t);break;case`textarea`:yd(`invalid`,t),K(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(yd(`beforetoggle`,t),yd(`toggle`,t)),r.onScroll!=null&&yd(`scroll`,t),r.onScrollEnd!=null&&yd(`scrollend`,t),r.onClick!=null&&(t.onclick=J),t=!0):t=!1,t||Oi(e,!0)}function Ai(e){for(Si=e.return;Si;)switch(Si.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:Si=Si.return}}function ji(e){if(e!==Si)return!1;if(!wi)return Ai(e),wi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Wd(e.type,e.memoizedProps)),n=!n),n&&Ci&&Oi(e),Ai(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ci=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ci=df(e)}else t===27?(t=Ci,Qd(e.type)?(e=uf,uf=null,Ci=e):Ci=t):Ci=Si?lf(e.stateNode.nextSibling):null;return!0}function Mi(){Ci=Si=null,wi=!1}function Ni(){var e=Ti;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Ti=null),e}function Pi(e){Ti===null?Ti=[e]:Ti.push(e)}var Fi=ie(null),Ii=null,Li=null;function Ri(e,t,n){R(Fi,t._currentValue),t._currentValue=n}function zi(e){e._currentValue=Fi.current,L(Fi)}function Bi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Vi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Bi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Bi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Hi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;dr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Vi(t,e,n,r),t.flags|=262144}function Ui(e){for(e=e.firstContext;e!==null;){if(!dr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wi(e){Ii=e,Li=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gi(e){return qi(Ii,e)}function Ki(e,t){return Ii===null&&Wi(e),qi(e,t)}function qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Li===null){if(e===null)throw Error(i(308));Li=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Li=Li.next=t;return n}var Ji=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Yi=t.unstable_scheduleCallback,Xi=t.unstable_NormalPriority,Zi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qi(){return{controller:new Ji,data:new Map,refCount:0}}function $i(e){e.refCount--,e.refCount===0&&Yi(Xi,function(){e.controller.abort()})}var ea=null,ta=0,na=0,ra=null;function ia(e,t){if(ea===null){var n=ea=[];ta=0,na=ud(),ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ta++,t.then(aa,aa),t}function aa(){if(--ta===0&&ea!==null){ra!==null&&(ra.status=`fulfilled`);var e=ea;ea=null,na=0,ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function oa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var sa=F.S;F.S=function(e,t){Ql=B(),typeof t==`object`&&t&&typeof t.then==`function`&&ia(e,t),sa!==null&&sa(e,t)};var ca=ie(null);function la(){var e=ca.current;return e===null?Fl.pooledCache:e}function ua(e,t){t===null?R(ca,ca.current):R(ca,t.pool)}function da(){var e=la();return e===null?null:{parent:Zi._currentValue,pool:e}}var fa=Error(i(460)),pa=Error(i(474)),ma=Error(i(542)),ha={then:function(){}};function ga(e){return e=e.status,e===`fulfilled`||e===`rejected`}function _a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(J,J),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,xa(e),e;default:if(typeof t.status==`string`)t.then(J,J);else{if(e=Fl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,xa(e),e}throw ya=t,fa}}function va(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ya=e,fa):e}}var ya=null;function ba(){if(ya===null)throw Error(i(459));var e=ya;return ya=null,e}function xa(e){if(e===fa||e===ma)throw Error(i(483))}var Sa=null,Ca=0;function wa(e){var t=Ca;return Ca+=1,Sa===null&&(Sa=[]),_a(Sa,e,t)}function Ta(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ea(e,t){throw t.$$typeof===m?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Da(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=$r(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ri(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&va(i)===t.type)?(t=a(t,n.props),Ta(t,n),t.return=e,t):(t=ti(n.type,n.key,n.props,null,e.mode,r),Ta(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ai(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ri(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=ti(t.type,t.key,t.props,null,e.mode,n),Ta(n,t),n.return=e,n;case v:return t=ai(t,e.mode,n),t.return=e,t;case O:return t=va(t),f(e,t,n)}if(ee(t)||M(t))return t=ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,wa(t),n);if(t.$$typeof===C)return f(e,Ki(e,t),n);Ea(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=va(n),p(e,t,n,r)}if(ee(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,wa(n),r);if(n.$$typeof===C)return p(e,t,Ki(e,n),r);Ea(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=va(r),m(e,t,n,r,i)}if(ee(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,wa(r),i);if(r.$$typeof===C)return m(e,t,n,Ki(t,r),i);Ea(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),wi&&_i(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return wi&&_i(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),wi&&_i(i,h),l}function _(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),wi&&_i(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return wi&&_i(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),wi&&_i(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&va(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ta(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ni(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ti(o.type,o.key,o.props,null,e.mode,c),Ta(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ai(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=va(o),b(e,r,o,c)}if(ee(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),_(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,wa(o),c);if(o.$$typeof===C)return b(e,r,Ki(e,o),c);Ea(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ri(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ca=0;var i=b(e,t,n,r);return Sa=null,i}catch(t){if(t===fa||t===ma)throw t;var a=Zr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Oa=Da(!0),ka=Da(!1),Aa=!1;function ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ma(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 Na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Jr(e),qr(e,null,n),t}return Wr(e,r,t,n),Jr(e)}function Fa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function Ia(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var La=!1;function Ra(){if(La){var e=ra;if(e!==null)throw e}}function za(e,t,n,r){La=!1;var i=e.updateQueue;Aa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Q&p)===p:(r&p)===p){p!==0&&p===na&&(La=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Aa=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ba(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Va(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ba(n[e],t)}var Ha=ie(null),Ua=ie(0);function Wa(e,t){e=Vl,R(Ua,e),R(Ha,t),Vl=e|t.baseLanes}function Ga(){R(Ua,Vl),R(Ha,Ha.current)}function Ka(){Vl=Ua.current,L(Ha),L(Ua)}var qa=ie(null),Ja=null;function Ya(e){var t=e.alternate;R(eo,eo.current&1),R(qa,e),Ja===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(Ja=e)}function Xa(e){R(eo,eo.current),R(qa,e),Ja===null&&(Ja=e)}function Za(e){e.tag===22?(R(eo,eo.current),R(qa,e),Ja===null&&(Ja=e)):Qa(e)}function Qa(){R(eo,eo.current),R(qa,qa.current)}function $a(e){L(qa),Ja===e&&(Ja=null),L(eo)}var eo=ie(0);function to(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)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 no=0,X=null,ro=null,io=null,ao=!1,oo=!1,so=!1,co=0,lo=0,uo=null,fo=0;function po(){throw Error(i(321))}function mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dr(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,a){return no=a,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Ms:Ns,so=!1,a=n(r,i),so=!1,oo&&(a=_o(t,n,r,i)),go(e),a}function go(e){F.H=js;var t=ro!==null&&ro.next!==null;if(no=0,io=ro=X=null,ao=!1,lo=0,uo=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Ui(e)&&(Xs=!0))}function _o(e,t,n,r){X=e;var a=0;do{if(oo&&(uo=null),lo=0,oo=!1,25<=a)throw Error(i(301));if(a+=1,io=ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Ps,o=t(n,r)}while(oo);return o}function vo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?To(t):t,e=e.useState()[0],(ro===null?null:ro.memoizedState)!==e&&(X.flags|=1024),t}function yo(){var e=co!==0;return co=0,e}function bo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function xo(e){if(ao){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ao=!1}no=0,io=ro=X=null,oo=!1,lo=co=0,uo=null}function So(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return io===null?X.memoizedState=io=e:io=io.next=e,io}function Co(){if(ro===null){var e=X.alternate;e=e===null?null:e.memoizedState}else e=ro.next;var t=io===null?X.memoizedState:io.next;if(t!==null)io=t,ro=e;else{if(e===null)throw X.alternate===null?Error(i(467)):Error(i(310));ro=e,e={memoizedState:ro.memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},io===null?X.memoizedState=io=e:io=io.next=e}return io}function wo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=lo;return lo+=1,uo===null&&(uo=[]),e=_a(uo,e,t),t=X,(io===null?t.memoizedState:io.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Ms:Ns),e}function Eo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return To(e);if(e.$$typeof===C)return Gi(e)}throw Error(i(438,String(e)))}function Do(e){var t=null,n=X.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=X.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=wo(),X.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Oo(e,t){return typeof t==`function`?t(e):t}function ko(e){return Ao(Co(),ro,e)}function Ao(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(no&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===na&&(d=!0);else if((no&p)===p){u=u.next,p===na&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,X.lanes|=p,Ul|=p;f=u.action,so&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,X.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!dr(o,e.memoizedState)&&(Xs=!0,d&&(n=ra,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function jo(e){var t=Co(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);dr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mo(e,t,n){var r=X,a=Co(),o=wi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!dr((ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,rs(Fo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||io!==null&&io.memoizedState.tag&1){if(r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||no&127||No(r,t,n)}return n}function No(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=X.updateQueue,t===null?(t=wo(),X.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Po(e,t,n,r){t.value=n,t.getSnapshot=r,Io(t)&&Lo(e)}function Fo(e,t,n){return n(function(){Io(t)&&Lo(e)})}function Io(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dr(e,n)}catch{return!0}}function Lo(e){var t=Kr(e,2);t!==null&&pu(t,e,2)}function Ro(e){var t=So();if(typeof e==`function`){var n=e;if(e=n(),so){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t}function zo(e,t,n,r){return e.baseState=n,Ao(e,ro,typeof r==`function`?r:Oo)}function Bo(e,t,n,r,a){if(Os(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Vo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Vo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),Ho(e,t,s)}catch(n){Wo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),Ho(e,t,a)}catch(n){Wo(e,t,n)}}function Ho(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Uo(e,t,n)},function(n){return Wo(e,t,n)}):Uo(e,t,n)}function Uo(e,t,n){t.status=`fulfilled`,t.value=n,Go(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vo(e,n)))}function Wo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Go(t),t=t.next;while(t!==r)}e.action=null}function Go(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ko(e,t){return t}function qo(e,t){if(wi){var n=Fl.formState;if(n!==null){a:{var r=X;if(wi){if(Ci){b:{for(var i=Ci,a=Ei;i.nodeType!==8;){if(!a){i=null;break b}if(i=lf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ci=lf(i.nextSibling),r=i.data===`F!`;break a}}Oi(r)}r=!1}r&&(t=n[0])}}return n=So(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:t},n.queue=r,n=Ts.bind(null,X,r),r.dispatch=n,r=Ro(!1),a=Ds.bind(null,X,!1,r.queue),r=So(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Bo.bind(null,X,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Jo(e){return Yo(Co(),ro,e)}function Yo(e,t,n){if(t=Ao(e,t,Ko)[0],e=ko(Oo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=To(t)}catch(e){throw e===fa?ma:e}else r=t;t=Co();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(X.flags|=2048,Qo(9,{destroy:void 0},Xo.bind(null,i,n),null)),[r,a,e]}function Xo(e,t){e.action=t}function Zo(e){var t=Co(),n=ro;if(n!==null)return Yo(t,n,e);Co(),t=t.memoizedState,n=Co();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=X.updateQueue,t===null&&(t=wo(),X.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function $o(){return Co().memoizedState}function es(e,t,n,r){var i=So();X.flags|=e,i.memoizedState=Qo(1|t,{destroy:void 0},n,r===void 0?null:r)}function ts(e,t,n,r){var i=Co();r=r===void 0?null:r;var a=i.memoizedState.inst;ro!==null&&r!==null&&mo(r,ro.memoizedState.deps)?i.memoizedState=Qo(t,a,n,r):(X.flags|=e,i.memoizedState=Qo(1|t,a,n,r))}function ns(e,t){es(8390656,8,e,t)}function rs(e,t){ts(2048,8,e,t)}function is(e){X.flags|=4;var t=X.updateQueue;if(t===null)t=wo(),X.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function as(e){var t=Co().memoizedState;return is({ref:t,nextImpl:e}),function(){if(Pl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function os(e,t){return ts(4,2,e,t)}function ss(e,t){return ts(4,4,e,t)}function cs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ls(e,t,n){n=n==null?null:n.concat([e]),ts(4,4,cs.bind(null,t,e),n)}function us(){}function ds(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fs(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&mo(t,r[1]))return r[0];if(r=e(),so){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function ps(e,t,n){return n===void 0||no&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),X.lanes|=e,Ul|=e,n)}function ms(e,t,n,r){return dr(n,t)?n:Ha.current===null?!(no&42)||no&1073741824&&!(Q&261930)?(Xs=!0,e.memoizedState=n):(e=fu(),X.lanes|=e,Ul|=e,t):(e=ps(e,n,r),dr(e,t)||(Xs=!0),e)}function hs(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,Ds(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Es(e,t,oa(c,r),du(e)):Es(e,t,r,du(e))}catch(n){Es(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function gs(){}function _s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=vs(e).queue;hs(e,a,t,te,n===null?gs:function(){return ys(e),n(r)})}function vs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ys(e){var t=vs(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},du())}function bs(){return Gi(Qf)}function xs(){return Co().memoizedState}function Ss(){return Co().memoizedState}function Cs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Na(n);var r=Pa(t,e,n);r!==null&&(pu(r,t,n),Fa(r,t,n)),t={cache:Qi()},e.payload=t;return}t=t.return}}function ws(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e)?ks(t,n):(n=Gr(e,t,n,r),n!==null&&(pu(n,e,r),As(n,t,r)))}function Ts(e,t,n){Es(e,t,n,du())}function Es(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,dr(s,o))return Wr(e,t,i,0),Fl===null&&Ur(),!1}catch{}if(n=Gr(e,t,i,r),n!==null)return pu(n,e,r),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(i(479))}else t=Gr(e,n,r,2),t!==null&&pu(t,e,2)}function Os(e){var t=e.alternate;return e===X||t!==null&&t===X}function ks(e,t){oo=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var js={readContext:Gi,use:Eo,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useLayoutEffect:po,useInsertionEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useSyncExternalStore:po,useId:po,useHostTransitionStatus:po,useFormState:po,useActionState:po,useOptimistic:po,useMemoCache:po,useCacheRefresh:po};js.useEffectEvent=po;var Ms={readContext:Gi,use:Eo,useCallback:function(e,t){return So().memoizedState=[e,t===void 0?null:t],e},useContext:Gi,useEffect:ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),es(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){es(4,2,e,t)},useMemo:function(e,t){var n=So();t=t===void 0?null:t;var r=e();if(so){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=So();if(n!==void 0){var i=n(t);if(so){Ne(!0);try{n(t)}finally{Ne(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ws.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=So();return e={current:e},t.memoizedState=e},useState:function(e){e=Ro(e);var t=e.queue,n=Ts.bind(null,X,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:us,useDeferredValue:function(e,t){return ps(So(),e,t)},useTransition:function(){var e=Ro(!1);return e=hs.bind(null,X,e.queue,!0,!1),So().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=X,a=So();if(wi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Q&127||No(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Fl.identifierPrefix;if(wi){var n=gi,r=hi;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=co++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=fo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:bs,useFormState:qo,useActionState:qo,useOptimistic:function(e){var t=So();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ds.bind(null,X,!0,n),n.dispatch=t,[e,t]},useMemoCache:Do,useCacheRefresh:function(){return So().memoizedState=Cs.bind(null,X)},useEffectEvent:function(e){var t=So(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ns={readContext:Gi,use:Eo,useCallback:ds,useContext:Gi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:ko,useRef:$o,useState:function(){return ko(Oo)},useDebugValue:us,useDeferredValue:function(e,t){return ms(Co(),ro.memoizedState,e,t)},useTransition:function(){var e=ko(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){return zo(Co(),ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ns.useEffectEvent=as;var Ps={readContext:Gi,use:Eo,useCallback:ds,useContext:Gi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:jo,useRef:$o,useState:function(){return jo(Oo)},useDebugValue:us,useDeferredValue:function(e,t){var n=Co();return ro===null?ps(n,e,t):ms(n,ro.memoizedState,e,t)},useTransition:function(){var e=jo(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){var n=Co();return ro===null?(n.baseState=e,[e,n.queue.dispatch]):zo(n,ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ps.useEffectEvent=as;function Fs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Na(r);i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,r),t!==null&&(pu(t,e,r),Fa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Na(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,r),t!==null&&(pu(t,e,r),Fa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Na(n);r.tag=2,t!=null&&(r.callback=t),t=Pa(e,r,n),t!==null&&(pu(t,e,n),Fa(t,e,n))}};function Ls(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!fr(n,r)||!fr(i,a):!0}function Rs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Is.enqueueReplaceState(t,t.state,null)}function zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){zr(e)}function Vs(e){console.error(e)}function Hs(e){zr(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){return n=Na(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Na(e),e.tag=3,e}function qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Hi(t,n,a,!0),n=qa.current,n!==null){switch(n.tag){case 31:case 13:return Ja===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===ha?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(wi)return t=qa.current,t===null?(r!==Di&&(t=Error(i(423),{cause:r}),Pi(si(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=si(r,n),a=Gs(e.stateNode,r,a),Ia(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Di&&(e=Error(i(422),{cause:r}),Pi(si(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=si(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=si(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Ia(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Ia(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?ka(t,null,n,r):Oa(t,e.child,n,r)}function Qs(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Wi(t),r=ho(e,t,n,o,a,i),s=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(wi&&s&&yi(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Qr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=ti(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?fr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=$r(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(fr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return rc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ua(t,a===null?null:a.cachePool),a===null?Ga():Wa(t,a),Za(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ua(t,null),Ga(),Qa(t)):(ua(t,a.cachePool),Wa(t,a),Qa(t),t.memoizedState=null);return Zs(e,t,i,n),t.child}function nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rc(e,t,n,r,i){var a=la();return a=a===null?null:{parent:Zi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ua(t,null),Ga(),Za(t),e!==null&&Hi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return Oa(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,$a(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(wi){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(Xa(t),(e=Ci)?(e=af(e,Ei),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mi===null?null:{id:hi,overflow:gi},retryLane:536870912,hydrationErrors:null},n=ii(e),n.return=t,t.child=n,Si=t,Ci=null)):e=null,e===null)throw Oi(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Xa(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Hi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Fl,r!==null&&(s=H(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Kr(e,s),pu(r,e,s),Ys;Tu(),t=ac(e,t,n)}else e=o.treeContext,Ci=lf(s.nextSibling),Si=t,wi=!0,Ti=null,Ei=!1,e!==null&&xi(t,e),t=ic(t,r),t.flags|=4096;return t}return e=$r(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function cc(e,t,n,r,i){return Wi(t),n=ho(e,t,n,r,void 0,i),r=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(wi&&r&&yi(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Wi(t),t.updateQueue=null,n=_o(t,r,n,i),go(e),r=yo(),e!==null&&!Xs?(bo(e,t,a),Sc(e,t,a)):(wi&&r&&yi(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Wi(t),t.stateNode===null){var a=Yr,o=n.contextType;typeof o==`object`&&o&&(a=Gi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Is,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ja(t),o=n.contextType,a.context=typeof o==`object`&&o?Gi(o):Yr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Is.enqueueReplaceState(a,a.state,null),za(t,r,a,i),Ra(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Yr,typeof u==`object`&&u&&(o=Gi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Rs(t,a,r,o),Aa=!1;var f=t.memoizedState;a.state=f,za(t,r,a,i),Ra(),l=t.memoizedState,s||f!==l||Aa?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=Aa||Ls(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ma(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Yr,typeof l==`object`&&l&&(c=Gi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Rs(t,a,r,c),Aa=!1,f=t.memoizedState,a.state=f,za(t,r,a,i),Ra();var p=t.memoizedState;o!==d||f!==p||Aa||e!==null&&e.dependencies!==null&&Ui(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=Aa||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ui(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,sc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Oa(t,e.child,null,i),t.child=Oa(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Mi(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:da()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(eo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(wi){if(a?Ya(t):Qa(t),(e=Ci)?(e=af(e,Ei),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mi===null?null:{id:hi,overflow:gi},retryLane:536870912,hydrationErrors:null},n=ii(e),n.return=t,t.child=n,Si=t,Ci=null)):e=null,e===null)throw Oi(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Qa(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=ni(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(Ya(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ya(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(Qa(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=ni(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Oa(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(Qa(t),t.child=e.child,t.flags|=128,t=null);else if(Ya(t),sf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Pi({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Hi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Fl,s!==null&&(r=H(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Kr(e,r),pu(s,e,r),Ys;of(c)||Tu(),t=vc(e,t,n)}else of(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ci=lf(c.nextSibling),Si=t,wi=!0,Ti=null,Ei=!1,e!==null&&xi(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(Qa(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=$r(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ni(c,a,n,null),c.flags|=2):c=$r(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=da():(l=Zi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(Ya(t),n=e.child,e=n.sibling,n=$r(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=Zr(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return Oa(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bi(e.return,t,n)}function bc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=eo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,R(eo,o),Zs(e,t,r,n),r=wi?di:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&to(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&to(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=$r(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$r(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ui(e))):!0}function wc(e,t,n){switch(t.tag){case 3:le(t,t.stateNode.containerInfo),Ri(t,Zi,e.memoizedState.cache),Mi();break;case 27:case 5:z(t);break;case 4:le(t,t.stateNode.containerInfo);break;case 10:Ri(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Xa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ya(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(Ya(t),t.flags|=128,null);Ya(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Hi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),R(eo,eo.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Ri(t,Zi,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,wi&&t.flags&1048576&&vi(t,di,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=va(t.elementType),t.type=e,typeof e==`function`)Qr(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(le(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ma(e,t),za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ri(t,Zi,r),r!==o.cache&&Vi(t,[Zi],n,!0),Ra(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=dc(e,t,r,n);break a}else if(r!==a){a=si(Error(i(424)),t),Pi(a),t=dc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ci=lf(e.firstChild),Si=t,wi=!0,Ti=null,Ei=!0,n=ka(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Mi(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:wi||(n=t.type,e=t.pendingProps,r=Vd(se.current).createElement(n),r[nt]=t,r[rt]=e,Fd(r,n,e),pt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return z(t),e===null&&wi&&(r=t.stateNode=pf(t.type,t.pendingProps,se.current),Si=t,Ei=!0,a=Ci,Qd(t.type)?(uf=a,Ci=lf(r.firstChild)):Ci=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&wi&&((a=r=Ci)&&(r=nf(r,t.type,t.pendingProps,Ei),r===null?a=!1:(t.stateNode=r,Si=t,Ci=lf(r.firstChild),Ei=!1,a=!0)),a||Oi(t)),z(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Wd(a,o)?r=null:s!==null&&Wd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ho(e,t,vo,null,null,n),Qf._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&wi&&((e=n=Ci)&&(n=rf(n,t.pendingProps,Ei),n===null?e=!1:(t.stateNode=n,Si=t,Ci=null,e=!0)),e||Oi(t)),null;case 13:return hc(e,t,n);case 4:return le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Oa(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ri(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Wi(t),a=Gi(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Wi(t),r=Gi(Zi),e===null?(a=la(),a===null&&(a=Fl,o=Qi(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ja(t),Ri(t,Zi,a)):((e.lanes&n)!==0&&(Ma(e,t),za(t,null,null,n),Ra()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ri(t,Zi,r),r!==a.cache&&Vi(t,[Zi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ri(t,Zi,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw ya=ha,pa}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw ya=ha,pa}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,ql|=t)}function Ac(e,t){if(!wi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function jc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mc(e,t,n){var r=t.pendingProps;switch(bi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),zi(Zi),ue(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ji(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ni())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(de(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=ae.current,ji(t)?ki(t,e):(e=pf(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=ae.current,ji(t))ki(t,o);else{var s=Vd(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[nt]=t,o[rt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,ji(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Si,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Oi(t,!0)}else e=Vd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ji(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[nt]=t}else Mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?($a(t),t):($a(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ji(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[nt]=t}else Mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?($a(t),t):($a(t),null)}return $a(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kc(t,t.updateQueue),jc(t),null);case 4:return ue(),e===null&&Sd(t.stateNode.containerInfo),jc(t),null;case 10:return zi(t.type),jc(t),null;case 19:if(L(eo),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=to(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ei(n,e),n=n.sibling;return R(eo,eo.current&1|2),wi&&_i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&B()>$l&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=to(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!wi)return jc(t),null}else 2*B()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=B(),e.sibling=null,n=eo.current,R(eo,a?n&1|2:n&1),wi&&_i(t,r.treeForkCount),e);case 22:case 23:return $a(t),Ka(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&L(ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zi(Zi),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zi(Zi),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if($a(t),t.alternate===null)throw Error(i(340));Mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($a(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(eo),null;case 4:return ue(),null;case 10:return zi(t.type),null;case 22:case 23:return $a(t),Ka(),e!==null&&L(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zi(Zi),null;case 25:return null;default:return null}}function Pc(e,t){switch(bi(t),t.tag){case 3:zi(Zi),ue();break;case 26:case 27:case 5:de(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&$a(t);break;case 13:$a(t);break;case 19:L(eo);break;case 10:zi(t.type);break;case 22:case 23:$a(t),Ka(),e!==null&&L(ca);break;case 24:zi(Zi)}}function Fc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Ic(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Va(t,n)}catch(t){Uu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Vc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[rt]=t}catch(t){Uu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=J));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[nt]=e,t[rt]=n}catch(t){Uu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,zd=sp,e=gr(e),_r(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},sp=!1,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Va(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,(n.subtreeFlags&8772)!=0):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lt(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 nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;Qd(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),mf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null)if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:nl!==null&&(rl?(e=nl,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):$d(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Qd(c.type)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ct]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Fd(o,r,n),o[nt]=e,pt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,pt(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{q(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=dl,dl=_f(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=_f(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=B()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ef(m,!0):ef(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(q(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:mf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:_l(i,a,n),Fc(4,a);break;case 1:if(_l(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ba(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&$i(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e)));break;case 12:if(i&2048){bl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Gf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=_f(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(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 Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:$i(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=Gi(Zi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Gi(Zi).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Pl&2&&Q!==0?Q&-Q:F.T===null?$e():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||wi){var e=ze;ze<<=1,!(ze&3932160)&&(ze=262144),Kl=e}else Kl=536870912;return e=qa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Fl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Q,Kl,!1)),qe(e,n),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(Pl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ue(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-B(),10<a)){if(_u(r,t,Kl,!Rl),He(r,0,!0)!==0)break a;au=t,r.timeoutHandle=qd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:J},El(t,a,d);var m=(a&62914560)===a?Zl-B():(a&4194048)===a?Ql-B():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!dr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Pe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function vu(){return Pl&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Li=Ii=null,xo(e),Sa=null,Ca=0,e=Z;for(;e!==null;)Pc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=$r(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=Ue(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Pe(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Ur(),n}function xu(e,t){X=null,F.H=js,t===fa||t===ma?(t=ba(),Il=3):t===pa?(t=ba(),Il=4):Il=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Us(e,si(t,e.current)))}function Su(){var e=qa.current;return e===null?!0:(Q&4194048)===Q?Ja===null:(Q&62914560)===Q||Q&536870912?e===Ja:!1}function Cu(){var e=F.H;return F.H=js,e===null?js:e}function wu(){var e=F.A;return F.A=Ml,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&qa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=Pl;Pl|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:qa.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Li=Ii=null,Pl=r,F.H=i,F.A=a,Z===null&&(Fl=null,Q=0,Ur()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=Pl;Pl|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=B()+500,bu(e,t)):zl=Ue(e,t);a:do try{if(Il!==0&&Z!==null){t=Z;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(ga(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Fl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:ga(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Li=Ii=null,F.H=r,F.A=a,Pl=n,Z===null?(Fl=null,Q=0,Ur(),Hl):0}function ku(){for(;Z!==null&&!Se();)Au(Z)}function Au(e){var t=Tc(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:xo(t);default:Pc(n,t),t=Z=ei(t,Vl),t=Tc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Li=Ii=null,xo(t),Sa=null,Ca=0;var i=t.return;try{if(Js(e,i,t,n,Q)){Hl=1,Us(e,si(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Us(e,si(n,e.current)),Z=null;return}t.flags&32768?(wi||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Mc(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Hr,Je(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Q=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(V,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,a=I.p,I.p=2,s=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=s,I.p=a,F.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Pl;Pl|=4;try{fl(t,e);var a=Bd,o=gr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&hr(s.ownerDocument.documentElement,s)){if(c!==null&&_r(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=mr(s,h),v=mr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!zd,Bd=zd=null}finally{Pl=i,I.p=r,F.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,I.p=r,F.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,Ce();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),Qe(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=I.p,I.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,I.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$i(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=Qe(au),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,rd(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{I.p=a,F.T=r,zu(e,t)}}function Hu(e,t,n){t=si(n,t),t=Gs(e.stateNode,t,2),e=Pa(e,t,2),e!==null&&(qe(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=si(n,e),n=Ks(2),r=Pa(t,n,2),r!==null&&(qs(n,r,t,e),qe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>B()-Zl?!(Pl&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Ge()),e=Kr(e,t),e!==null&&(qe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return be(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Q,a=He(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Kd()&&(e=td);for(var t=B(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Pe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),Qe(n)){case 2:case 8:n=Ee;break;case 32:n=V;break;case 268435456:n=Oe;break;default:n=V}return r=sd.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Q;return r=He(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,B()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Xd(function(){Pl&6?be(Te,id):ad()})}function ud(){if(td===0){var e=na;e===0&&(e=Re,Re<<=1,!(Re&261888)&&(Re=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Ut(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new dn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);_s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),_s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Lr.length;md++){var hd=Lr[md];Rr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Rr(kr,`onAnimationEnd`),Rr(Ar,`onAnimationIteration`),Rr(jr,`onAnimationStart`),Rr(`dblclick`,`onDoubleClick`),Rr(`focusin`,`onFocus`),Rr(`focusout`,`onBlur`),Rr(Mr,`onTransitionRun`),Rr(Nr,`onTransitionStart`),Rr(Pr,`onTransitionCancel`),Rr(Fr,`onTransitionEnd`),_t(`onMouseEnter`,[`mouseout`,`mouseover`]),_t(`onMouseLeave`,[`mouseout`,`mouseover`]),_t(`onPointerEnter`,[`pointerout`,`pointerover`]),_t(`onPointerLeave`,[`pointerout`,`pointerover`]),gt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),gt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),gt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),gt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),gt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`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(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){zr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){zr(e)}i.currentTarget=null,a=c}}}}function yd(e,t){var n=t[U];n===void 0&&(n=t[U]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,mt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!$t||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ut(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Xt(function(){var r=a,i=Gt(n),s=[];a:{var c=Ir.get(e);if(c!==void 0){var l=dn,u=e;switch(e){case`keypress`:if(on(n)===0)break a;case`keydown`:case`keyup`:l=kn;break;case`focusin`:u=`focus`,l=bn;break;case`focusout`:u=`blur`,l=bn;break;case`beforeblur`:case`afterblur`:l=bn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=yn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=jn;break;case kr:case Ar:case jr:l=xn;break;case Fr:l=Y;break;case`scroll`:case`scrollend`:l=pn;break;case`wheel`:l=Mn;break;case`copy`:case`cut`:case`paste`:l=Sn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=An;break;case`toggle`:case`beforetoggle`:l=Nn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Zt(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Wt&&(u=n.relatedTarget||n.fromElement)&&(ut(u)||u[it]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ut(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=An,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:dt(l),h=u==null?c:dt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ut(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?dt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=$n;else if(qn(c))if(er)v=lr;else{v=sr;var y=or}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Bt(r.elementType)&&(v=$n):v=cr;if(v&&=v(e,r)){Jn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Pt(c,`number`,c.value)}switch(y=r?dt(r):window,e){case`focusin`:(qn(y)||y.contentEditable===`true`)&&(yr=y,br=r,xr=null);break;case`focusout`:xr=br=yr=null;break;case`mousedown`:Sr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Sr=!1,Cr(s,n,i);break;case`selectionchange`:if(vr)break;case`keydown`:case`keyup`:Cr(s,n,i)}var b;if(Fn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Un?Vn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Rn&&n.locale!==`ko`&&(Un||x!==`onCompositionStart`?x===`onCompositionEnd`&&Un&&(b=an()):(tn=i,nn=`value`in tn?tn.value:tn.textContent,Un=!0)),y=Ed(r,x),0<y.length&&(x=new Cn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Hn(n),b!==null&&(x.data=b)))),(b=Ln?Wn(e,n):Gn(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Cn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Zt(e,n),i!=null&&r.unshift(Td(e,i,a)),i=Zt(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Zt(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=Zt(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
9
+ `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||q(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&q(e,``+r);break;case`className`:Ct(e,`class`,r);break;case`tabIndex`:Ct(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ct(e,n,r);break;case`style`:zt(e,r,o);break;case`data`:if(t!==`object`){Ct(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Ut(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Ut(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=J);break;case`onScroll`:r!=null&&yd(`scroll`,e);break;case`onScrollEnd`:r!=null&&yd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Ut(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:yd(`beforetoggle`,e),yd(`toggle`,e),St(e,`popover`,r);break;case`xlinkActuate`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:wt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:wt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:St(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Vt.get(n)||n,St(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?q(e,r):(typeof r==`number`||typeof r==`bigint`)&&q(e,``+r);break;case`onScroll`:r!=null&&yd(`scroll`,e);break;case`onScrollEnd`:r!=null&&yd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=J);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ht.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):St(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:yd(`error`,e),yd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,o,s,n,null)}}a&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:yd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Nd(e,t,r,d,n,null)}}Nt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in yd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Nd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ft(e,!!r,n,!0):Ft(e,!!r,t,!1);return;case`textarea`:for(s in yd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Nd(e,t,s,c,n,null)}K(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Nd(e,t,l,r,n,null)}return;case`dialog`:yd(`beforetoggle`,e),yd(`toggle`,e),yd(`cancel`,e),yd(`close`,e);break;case`iframe`:case`object`:yd(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)yd(gd[r],e);break;case`image`:yd(`error`,e),yd(`load`,e);break;case`details`:yd(`toggle`,e);break;case`embed`:case`source`:case`link`:yd(`error`,e),yd(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,u,r,n,null)}return;default:if(Bt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Nd(e,t,c,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Nd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Nd(e,t,p,m,r,f)}}Mt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Nd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Nd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ft(e,!!n,n?[]:``,!1):Ft(e,!!n,t,!0)):Ft(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Nd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Nd(e,t,s,a,r,o)}It(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Nd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Nd(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Nd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Nd(e,t,u,p,r,m)}return;default:if(Bt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Nd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Nd(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ld(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.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 zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(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 Ud(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 Wd(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 Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e===Gd?!1:(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ct]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body);n=i}while(n);Np(t)}function ef(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:tf(n),lt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ct])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lf(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 uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pf(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lt(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var vf=I.d;I.d={f:yf,r:bf,D:Cf,C:wf,L:Tf,m:$,X:Df,S:Ef,M:Of};function yf(){var e=vf.f(),t=vu();return e||t}function bf(e){var t=W(e);t!==null&&t.tag===5&&t.type===`form`?ys(t):vf.r(e)}var xf=typeof document>`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+jt(n.imageSizes)+`"]`)):i+=`[href="`+jt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}hf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Fd(t,`link`,e),pt(t),r.head.appendChild(t)))}}function $(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+jt(r)+`"][href="`+jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!hf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),pt(r),n.head.appendChild(r)}}}function Ef(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=ft(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);pt(c),Fd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=ft(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0},t),(t=hf.get(i))&&zf(e,t),a=n.createElement(`script`),pt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=ft(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&zf(e,t),a=n.createElement(`script`),pt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=se.current)?_f(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=ft(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=ft(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=ft(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+jt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),pt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+jt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+jt(n.href)+`"]`);if(r)return t.instance=r,pt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),pt(r),Fd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,pt(o),o;r=Mf(n),(a=hf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),pt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,pt(a),a):(r=n,(a=hf.get(o))&&(r=f({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),pt(a),Fd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ct]||a[nt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,pt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=hf.get(i))&&Rf(r,i),a=a.createElement(`link`),pt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Zr(3,null,null,t),e.current=a,a.stateNode=e,t=Qi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ja(a),e}function tp(e){return e?(e=Yr,e):Yr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Na(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Pa(e,r,t),n!==null&&(pu(n,e,t),Fa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Kr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=Ze(t);var n=Kr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,up(e,t,n,r)}finally{I.p=a,F.T=i}}function lp(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,up(e,t,n,r)}finally{I.p=a,F.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=W(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ve(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Pe(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Pl&6)&&($l=B()+500,rd(0,!1))}}break;case 31:case 13:s=Kr(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=Gt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ut(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(we()){case Te:return 2;case Ee:return 8;case V:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=W(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ut(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Wt=r,n.target.dispatchEvent(r),Wt=null}else return t=W(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=W(n);a!==null&&(e.splice(t,3),t-=3,_s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[rt]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[it]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.6`)throw Error(i(527,Lp,`19.2.6`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{je=zp.inject(Rp),Me=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[it]=t.current,Sd(e),new Fp(t)}})),y=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=v()})),b=u(p()),x=u(y(),1),S=typeof window>`u`?null:window;S&&(S.process||={env:{},platform:`win32`,version:`0.0.0`,versions:{node:`0.0.0`,v8:`0.0.0`,uv:`0.0.0`,zlib:`0.0.0`,brotli:`0.0.0`,ares:`0.0.0`,modules:`0`,nghttp2:`0.0.0`,napi:`0`,llhttp:`0.0.0`,openssl:`0.0.0`,cldr:`0.0.0`,icu:`0.0.0`,tz:`0.0.0`,unicode:`0.0.0`,http_parser:`0.0.0`},argv:[],execArgv:[],pid:0,ppid:0,arch:`x64`,title:`browser`,browser:!0,execPath:``,cwd(){return`/`},chdir(){},umask(){return 0},nextTick(e,...t){setTimeout(()=>e(...t),0)},exit(){throw Error(`process.exit is unavailable in the browser`)},on(){return S.process},off(){return S.process},once(){return S.process},emit(){return!1},removeListener(){return S.process},addListener(){return S.process},prependListener(){return S.process},prependOnceListener(){return S.process},removeAllListeners(){return S.process},listeners(){return[]},rawListeners(){return[]},listenerCount(){return 0},eventNames(){return[]},getMaxListeners(){return 0},setMaxListeners(){return S.process},stdout:void 0,stderr:void 0,stdin:void 0,disconnect(){},connected:!1,kill(){return!1},memoryUsage(){return{rss:0,heapTotal:0,heapUsed:0,external:0,arrayBuffers:0}},cpuUsage(){return{user:0,system:0}},uptime(){return 0},hrtime(e){return[0,0]},dlopen(){throw Error(`process.dlopen is unavailable in the browser`)},release:{name:`node`,sourceUrl:``,headersUrl:``,libUrl:``},config:{variables:{}}},S.global||=globalThis);var C=u(_());function w(){return w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},w.apply(this,arguments)}var T;(function(e){e.Pop=`POP`,e.Push=`PUSH`,e.Replace=`REPLACE`})(T||={});var E=`popstate`;function D(e){e===void 0&&(e={});function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return M(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:N(t)}return ee(t,n,null,e)}function O(e,t){if(e===!1||e==null)throw Error(t)}function k(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function A(){return Math.random().toString(36).substr(2,8)}function j(e,t){return{usr:e.state,key:e.key,idx:t}}function M(e,t,n,r){return n===void 0&&(n=null),w({pathname:typeof e==`string`?e:e.pathname,search:``,hash:``},typeof t==`string`?P(t):t,{state:n,key:t&&t.key||r||A()})}function N(e){let{pathname:t=`/`,search:n=``,hash:r=``}=e;return n&&n!==`?`&&(t+=n.charAt(0)===`?`?n:`?`+n),r&&r!==`#`&&(t+=r.charAt(0)===`#`?r:`#`+r),t}function P(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ee(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=T.Pop,c=null,l=u();l??(l=0,o.replaceState(w({},o.state,{idx:l}),``));function u(){return(o.state||{idx:null}).idx}function d(){s=T.Pop;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=T.Push;let r=M(h.location,e,t);n&&n(r,e),l=u()+1;let d=j(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=T.Replace;let r=M(h.location,e,t);n&&n(r,e),l=u();let i=j(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){let t=i.location.origin===`null`?i.location.href:i.location.origin,n=typeof e==`string`?e:N(e);return n=n.replace(/ $/,`%20`),O(t,`No window.location.(origin|href) available to create URL for href: `+n),new URL(n,t)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(E,d),c=e,()=>{i.removeEventListener(E,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}var F;(function(e){e.data=`data`,e.deferred=`deferred`,e.redirect=`redirect`,e.error=`error`})(F||={});function I(e,t,n){return n===void 0&&(n=`/`),te(e,t,n,!1)}function te(e,t,n,r){let i=he((typeof t==`string`?P(t):t).pathname||`/`,n);if(i==null)return null;let a=ne(e);ie(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=me(i);o=de(a[e],t,r)}return o}function ne(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r=``);let i=(e,i,a)=>{let o={relativePath:a===void 0?e.path||``:a,caseSensitive:e.caseSensitive===!0,childrenIndex:i,route:e};o.relativePath.startsWith(`/`)&&(O(o.relativePath.startsWith(r),`Absolute route path "`+o.relativePath+`" nested under path `+(`"`+r+`" is not valid. An absolute child route path `)+`must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(r.length));let s=B([r,o.relativePath]),c=n.concat(o);e.children&&e.children.length>0&&(O(e.index!==!0,`Index routes must not have child routes. Please remove `+(`all child routes from route path "`+s+`".`)),ne(e.children,t,c,s)),!(e.path==null&&!e.index)&&t.push({path:s,score:ue(s,e.index),routesMeta:c})};return e.forEach((e,t)=>{var n;if(e.path===``||!((n=e.path)!=null&&n.includes(`?`)))i(e,t);else for(let n of re(e.path))i(e,t,n)}),t}function re(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=re(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ie(e){e.sort((e,t)=>e.score===t.score?z(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var L=/^:[\w-]+$/,R=3,ae=2,oe=1,se=10,ce=-2,le=e=>e===`*`;function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(le)&&(r+=ce),t&&(r+=ae),n.filter(e=>!le(e)).reduce((e,t)=>e+(L.test(t)?R:t===``?oe:se),r)}function z(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function de(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=fe({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=fe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:B([a,u.pathname]),pathnameBase:we(B([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=B([a,u.pathnameBase]))}return o}function fe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pe(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:i}=t;if(r===`*`){let e=s[n]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let c=s[n];return i&&!c?e[r]=void 0:e[r]=(c||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function pe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),k(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "`+e+`" will be treated as if it were `+(`"`+e.replace(/\*$/,`/*`)+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+(`please change the route path to "`+e.replace(/\*$/,`/*`)+`".`));let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`));return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return k(!1,`The URL path "`+e+`" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent `+(`encoding (`+t+`).`)),e}}function he(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var ge=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_e=e=>ge.test(e);function ve(e,t){t===void 0&&(t=`/`);let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?P(e):e,a;if(n)if(_e(n))a=n;else{if(n.includes(`//`)){let e=n;n=n.replace(/\/\/+/g,`/`),k(!1,`Pathnames cannot have embedded double slashes - normalizing `+(e+` -> `+n))}a=n.startsWith(`/`)?ye(n.substring(1),`/`):ye(n,t)}else a=t;return{pathname:a,search:Te(r),hash:Ee(i)}}function ye(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function be(e,t,n,r){return`Cannot include a '`+e+`' character in a manually specified `+("`to."+t+"` field ["+JSON.stringify(r)+`]. Please separate it out to the `)+("`to."+n+"` field. Alternatively you may provide the full path as ")+`a string in <Link to="..."> and the router will parse it for you.`}function xe(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Se(e,t){let n=xe(e);return t?n.map((e,t)=>t===n.length-1?e.pathname:e.pathnameBase):n.map(e=>e.pathnameBase)}function Ce(e,t,n,r){r===void 0&&(r=!1);let i;typeof e==`string`?i=P(e):(i=w({},e),O(!i.pathname||!i.pathname.includes(`?`),be(`?`,`pathname`,`search`,i)),O(!i.pathname||!i.pathname.includes(`#`),be(`#`,`pathname`,`hash`,i)),O(!i.search||!i.search.includes(`#`),be(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ve(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var B=e=>e.join(`/`).replace(/\/\/+/g,`/`),we=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),Te=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ee=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e;function V(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}var De=[`post`,`put`,`patch`,`delete`];new Set(De);var Oe=[`get`,...De];new Set(Oe);function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke.apply(this,arguments)}var Ae=b.createContext(null),je=b.createContext(null),Me=b.createContext(null),Ne=b.createContext(null),Pe=b.createContext({outlet:null,matches:[],isDataRoute:!1}),Fe=b.createContext(null);function Ie(e,t){let{relative:n}=t===void 0?{}:t;!Le()&&O(!1);let{basename:r,navigator:i}=b.useContext(Me),{hash:a,pathname:o,search:s}=Ge(e,{relative:n}),c=o;return r!==`/`&&(c=o===`/`?r:B([r,o])),i.createHref({pathname:c,search:s,hash:a})}function Le(){return b.useContext(Ne)!=null}function Re(){return!Le()&&O(!1),b.useContext(Ne).location}function ze(e){b.useContext(Me).static||b.useLayoutEffect(e)}function Be(){let{isDataRoute:e}=b.useContext(Pe);return e?U():Ve()}function Ve(){!Le()&&O(!1);let e=b.useContext(Ae),{basename:t,future:n,navigator:r}=b.useContext(Me),{matches:i}=b.useContext(Pe),{pathname:a}=Re(),o=JSON.stringify(Se(i,n.v7_relativeSplatPath)),s=b.useRef(!1);return ze(()=>{s.current=!0}),b.useCallback(function(n,i){if(i===void 0&&(i={}),!s.current)return;if(typeof n==`number`){r.go(n);return}let c=Ce(n,JSON.parse(o),a,i.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:B([t,c.pathname])),(i.replace?r.replace:r.push)(c,i.state,i)},[t,r,o,a,e])}var He=b.createContext(null);function Ue(e){let t=b.useContext(Pe).outlet;return t&&b.createElement(He.Provider,{value:e},t)}function We(){let{matches:e}=b.useContext(Pe),t=e[e.length-1];return t?t.params:{}}function Ge(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(Me),{matches:i}=b.useContext(Pe),{pathname:a}=Re(),o=JSON.stringify(Se(i,r.v7_relativeSplatPath));return b.useMemo(()=>Ce(e,JSON.parse(o),a,n===`path`),[e,o,a,n])}function Ke(e,t){return qe(e,t)}function qe(e,t,n,r){!Le()&&O(!1);let{navigator:i}=b.useContext(Me),{matches:a}=b.useContext(Pe),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:`/`;o&&o.route;let l=Re(),u;if(t){let e=typeof t==`string`?P(t):t;!(c===`/`||e.pathname?.startsWith(c))&&O(!1),u=e}else u=l;let d=u.pathname||`/`,f=d;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);f=`/`+d.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let p=I(e,{pathname:f}),m=Ze(p&&p.map(e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:B([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:B([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,n,r);return t&&m?b.createElement(Ne.Provider,{value:{location:ke({pathname:`/`,search:``,hash:``,state:null,key:`default`},u),navigationType:T.Pop}},m):m}function Je(){let e=it(),t=V(e)?e.status+` `+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return b.createElement(b.Fragment,null,b.createElement(`h2`,null,`Unexpected Application Error!`),b.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?b.createElement(`pre`,{style:{padding:`0.5rem`,backgroundColor:`rgba(200,200,200, 0.5)`}},n):null,null)}var Ye=b.createElement(Je,null),Xe=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error(`React Router caught the following error during render`,e,t)}render(){return this.state.error===void 0?this.props.children:b.createElement(Pe.Provider,{value:this.props.routeContext},b.createElement(Fe.Provider,{value:this.state.error,children:this.props.component}))}};function H(e){let{routeContext:t,match:n,children:r}=e,i=b.useContext(Ae);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Pe.Provider,{value:t},r)}function Ze(e,t,n,r){if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);!(e>=0)&&O(!1),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&e[t.route.id]===void 0&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}return a.reduceRight((e,r,i)=>{let l,u=!1,d=null,f=null;n&&(l=o&&r.route.id?o[r.route.id]:void 0,d=r.route.errorElement||Ye,s&&(c<0&&i===0?(ot(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),u=!0,f=null):c===i&&(u=!0,f=r.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,i+1)),m=()=>{let t;return t=l?d:u?f:r.route.Component?b.createElement(r.route.Component,null):r.route.element?r.route.element:e,b.createElement(H,{match:r,routeContext:{outlet:e,matches:p,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?b.createElement(Xe,{location:n.location,revalidation:n.revalidation,component:d,error:l,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()},null)}var Qe=function(e){return e.UseBlocker=`useBlocker`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e}(Qe||{}),$e=function(e){return e.UseBlocker=`useBlocker`,e.UseLoaderData=`useLoaderData`,e.UseActionData=`useActionData`,e.UseRouteError=`useRouteError`,e.UseNavigation=`useNavigation`,e.UseRouteLoaderData=`useRouteLoaderData`,e.UseMatches=`useMatches`,e.UseRevalidator=`useRevalidator`,e.UseNavigateStable=`useNavigate`,e.UseRouteId=`useRouteId`,e}($e||{});function et(e){let t=b.useContext(Ae);return!t&&O(!1),t}function tt(e){let t=b.useContext(je);return!t&&O(!1),t}function nt(e){let t=b.useContext(Pe);return!t&&O(!1),t}function rt(e){let t=nt(e),n=t.matches[t.matches.length-1];return!n.route.id&&O(!1),n.route.id}function it(){let e=b.useContext(Fe),t=tt($e.UseRouteError),n=rt($e.UseRouteError);return e===void 0?t.errors?.[n]:e}function U(){let{router:e}=et(Qe.UseNavigateStable),t=rt($e.UseNavigateStable),n=b.useRef(!1);return ze(()=>{n.current=!0}),b.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r==`number`?e.navigate(r):e.navigate(r,ke({fromRouteId:t},i)))},[e,t])}var at={};function ot(e,t,n){!t&&!at[e]&&(at[e]=!0)}var st=(e,t,n)=>(``+t+("You can use the `"+e+"` future flag to opt-in early. ")+(`For more information, see `+n+`.`),void 0);function ct(e,t){e?.v7_startTransition===void 0&&st(`v7_startTransition`,"React Router will begin wrapping state updates in `React.startTransition` in v7",`https://reactrouter.com/v6/upgrading/future#v7_starttransition`),e?.v7_relativeSplatPath===void 0&&(!t||t.v7_relativeSplatPath===void 0)&&st(`v7_relativeSplatPath`,`Relative route resolution within Splat routes is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath`),t&&(t.v7_fetcherPersist===void 0&&st(`v7_fetcherPersist`,`The persistence behavior of fetchers is changing in v7`,`https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist`),t.v7_normalizeFormMethod===void 0&&st(`v7_normalizeFormMethod`,"Casing of `formMethod` fields is being normalized to uppercase in v7",`https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod`),t.v7_partialHydration===void 0&&st(`v7_partialHydration`,"`RouterProvider` hydration behavior is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_partialhydration`),t.v7_skipActionErrorRevalidation===void 0&&st(`v7_skipActionErrorRevalidation`,"The revalidation behavior after 4xx/5xx `action` responses is changing in v7",`https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation`))}function lt(e){let{to:t,replace:n,state:r,relative:i}=e;!Le()&&O(!1);let{future:a,static:o}=b.useContext(Me),{matches:s}=b.useContext(Pe),{pathname:c}=Re(),l=Be(),u=Ce(t,Se(s,a.v7_relativeSplatPath),c,i===`path`),d=JSON.stringify(u);return b.useEffect(()=>l(JSON.parse(d),{replace:n,state:r,relative:i}),[l,d,i,n,r]),null}function ut(e){return Ue(e.context)}function W(e){O(!1)}function dt(e){let{basename:t=`/`,children:n=null,location:r,navigationType:i=T.Pop,navigator:a,static:o=!1,future:s}=e;Le()&&O(!1);let c=t.replace(/^\/*/,`/`),l=b.useMemo(()=>({basename:c,navigator:a,static:o,future:ke({v7_relativeSplatPath:!1},s)}),[c,s,a,o]);typeof r==`string`&&(r=P(r));let{pathname:u=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`}=r,h=b.useMemo(()=>{let e=he(u,c);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m},navigationType:i}},[c,u,d,f,p,m,i]);return h==null?null:b.createElement(Me.Provider,{value:l},b.createElement(Ne.Provider,{children:n,value:h}))}function ft(e){let{children:t,location:n}=e;return Ke(mt(t),n)}var pt=function(e){return e[e.pending=0]=`pending`,e[e.success=1]=`success`,e[e.error=2]=`error`,e}(pt||{});new Promise(()=>{}),b.Component;function mt(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(e,r)=>{if(!b.isValidElement(e))return;let i=[...t,r];if(e.type===b.Fragment){n.push.apply(n,mt(e.props.children,i));return}e.type!==W&&O(!1),!(!e.props.index||!e.props.children)&&O(!1);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=mt(e.props.children,i)),n.push(a)}),n}function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ht.apply(this,arguments)}function gt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function _t(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vt(e,t){return e.button===0&&(!t||t===`_self`)&&!_t(e)}function yt(e){return e===void 0&&(e=``),new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function bt(e,t){let n=yt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var xt=[`onClick`,`relative`,`reloadDocument`,`replace`,`state`,`target`,`to`,`preventScrollReset`,`viewTransition`],St=[`aria-current`,`caseSensitive`,`className`,`end`,`style`,`to`,`viewTransition`,`children`],Ct=`6`;try{window.__reactRouterVersion=Ct}catch{}var wt=b.createContext({isTransitioning:!1}),Tt=b.startTransition;function Et(e){let{basename:t,children:n,future:r,window:i}=e,a=b.useRef();a.current??=D({window:i,v5Compat:!0});let o=a.current,[s,c]=b.useState({action:o.action,location:o.location}),{v7_startTransition:l}=r||{},u=b.useCallback(e=>{l&&Tt?Tt(()=>c(e)):c(e)},[c,l]);return b.useLayoutEffect(()=>o.listen(u),[o,u]),b.useEffect(()=>ct(r),[r]),b.createElement(dt,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}var Dt=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ot=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,G=b.forwardRef(function(e,t){let{onClick:n,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,viewTransition:u}=e,d=gt(e,xt),{basename:f}=b.useContext(Me),p,m=!1;if(typeof c==`string`&&Ot.test(c)&&(p=c,Dt))try{let e=new URL(window.location.href),t=c.startsWith(`//`)?new URL(e.protocol+c):new URL(c),n=he(t.pathname,f);t.origin===e.origin&&n!=null?c=n+t.search+t.hash:m=!0}catch{}let h=Ie(c,{relative:r}),g=Nt(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,viewTransition:u});function _(e){n&&n(e),e.defaultPrevented||g(e)}return b.createElement(`a`,ht({},d,{href:p||h,onClick:m||i?n:_,ref:t,target:s}))}),kt=b.forwardRef(function(e,t){let{"aria-current":n=`page`,caseSensitive:r=!1,className:i=``,end:a=!1,style:o,to:s,viewTransition:c,children:l}=e,u=gt(e,St),d=Ge(s,{relative:u.relative}),f=Re(),p=b.useContext(je),{navigator:m,basename:h}=b.useContext(Me),g=p!=null&&Ft(d)&&c===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;r||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=he(y,h)||y);let x=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,S=v===_||!a&&v.startsWith(_)&&v.charAt(x)===`/`,C=y!=null&&(y===_||!a&&y.startsWith(_)&&y.charAt(_.length)===`/`),w={isActive:S,isPending:C,isTransitioning:g},T=S?n:void 0,E;E=typeof i==`function`?i(w):[i,S?`active`:null,C?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let D=typeof o==`function`?o(w):o;return b.createElement(G,ht({},u,{"aria-current":T,className:E,ref:t,style:D,to:s,viewTransition:c}),typeof l==`function`?l(w):l)}),At;(function(e){e.UseScrollRestoration=`useScrollRestoration`,e.UseSubmit=`useSubmit`,e.UseSubmitFetcher=`useSubmitFetcher`,e.UseFetcher=`useFetcher`,e.useViewTransitionState=`useViewTransitionState`})(At||={});var jt;(function(e){e.UseFetcher=`useFetcher`,e.UseFetchers=`useFetchers`,e.UseScrollRestoration=`useScrollRestoration`})(jt||={});function Mt(e){let t=b.useContext(Ae);return!t&&O(!1),t}function Nt(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,c=Be(),l=Re(),u=Ge(e,{relative:o});return b.useCallback(t=>{vt(t,n)&&(t.preventDefault(),c(e,{replace:r===void 0?N(l)===N(u):r,state:i,preventScrollReset:a,relative:o,viewTransition:s}))},[l,c,u,r,i,n,e,a,o,s])}function Pt(e){let t=b.useRef(yt(e)),n=b.useRef(!1),r=Re(),i=b.useMemo(()=>bt(r.search,n.current?null:t.current),[r.search]),a=Be();return[i,b.useCallback((e,t)=>{let r=yt(typeof e==`function`?e(i):e);n.current=!0,a(`?`+r,t)},[a,i])]}function Ft(e,t){t===void 0&&(t={});let n=b.useContext(wt);n??O(!1);let{basename:r}=Mt(At.useViewTransitionState),i=Ge(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=he(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=he(n.nextLocation.pathname,r)||n.nextLocation.pathname;return fe(i.pathname,o)!=null||fe(i.pathname,a)!=null}var It=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),K=s(((e,t)=>{t.exports=It()}))();function q(...e){return e.filter(Boolean).join(` `)}function Lt(e,t,n=!0){(0,b.useEffect)(()=>{if(!n)return;let r=n=>{let r=e.current;r&&!r.contains(n.target)&&t(n)};return document.addEventListener(`mousedown`,r),()=>document.removeEventListener(`mousedown`,r)},[n,t])}function Rt(e,t,n=!0){(0,b.useEffect)(()=>{if(!n)return;let r=n=>{n.key===e&&t(n)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e,n,t])}function zt(e,t,n){let[r,i]=(0,b.useState)(t),a=e!==void 0;return[a?e:r,(0,b.useCallback)(e=>{a||i(e),n&&n(e)},[a,n])]}function Bt(e,t,n=`bottom-start`){let[r,i]=(0,b.useState)({top:0,left:0,width:0});return(0,b.useLayoutEffect)(()=>{if(!t||!e.current)return;let r=()=>{let t=e.current.getBoundingClientRect(),r=t.bottom+4,a=t.left;n===`bottom-end`&&(a=t.right),n===`top-start`&&(r=t.top-4),i({top:r+window.scrollY,left:a+window.scrollX,width:t.width})};return r(),window.addEventListener(`scroll`,r,!0),window.addEventListener(`resize`,r),()=>{window.removeEventListener(`scroll`,r,!0),window.removeEventListener(`resize`,r)}},[t,n]),r}var Vt=({children:e})=>{let[t]=(0,b.useState)(()=>{let e=document.createElement(`div`);return e.setAttribute(`data-tkc-portal`,``),e});return(0,b.useEffect)(()=>(document.body.appendChild(t),()=>{document.body.removeChild(t)}),[t]),(0,C.createPortal)(e,t)},Ht={check:`M4 8l3 3 5-7`,dash:`M4 8h8`,caret:`M6 4l4 4-4 4`,x:`M4 4l8 8M12 4l-8 8`,plus:`M8 3v10M3 8h10`,minus:`M3 8h10`,search:[`M7.5 13a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11zM11.5 11.5L14 14`,null],folder:`M2 4.5C2 3.67 2.67 3 3.5 3h2.3l1 1.5H12.5c.83 0 1.5.67 1.5 1.5V12c0 .83-.67 1.5-1.5 1.5h-9A1.5 1.5 0 0 1 2 12z`,file:`M4 2h5l3 3v9H4z M9 2v3h3`,gear:`M8 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM8 1v2M8 13v2M1 8h2M13 8h2M3 3l1.5 1.5M11.5 11.5L13 13M3 13l1.5-1.5M11.5 4.5L13 3`,calendar:`M3 5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zM3 7h10M5 3v2M11 3v2`,clock:[`M8 2.5A5.5 5.5 0 1 0 8 13.5 5.5 5.5 0 0 0 8 2.5zM8 5v3l2 1.5`,null],pencil:`M3 13l1-3 7-7 2 2-7 7-3 1z`,upload:`M8 11V3M5 6l3-3 3 3M3 13h10`,bell:`M4 11a4 4 0 0 1 8 0v1l1 1H3l1-1zM6 13a2 2 0 0 0 4 0`,info:[`M8 1.5A6.5 6.5 0 1 0 8 14.5 6.5 6.5 0 0 0 8 1.5zM8 7v4.5M8 5h.01`,null],chevronRight:`M6 3l5 5-5 5`,chevronDown:`M3 6l5 5 5-5`},Ut=({name:e,size:t=14,className:n=``,style:r})=>{let i=Ht[e]||``;return(0,K.jsx)(`svg`,{className:n,width:t,height:t,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,style:{display:`inline-block`,verticalAlign:`middle`,...r},children:Array.isArray(i)?i.map((e,t)=>e?(0,K.jsx)(`path`,{d:e},t):null):(0,K.jsx)(`path`,{d:i})})},J=({variant:e=`default`,size:t,loading:n,disabled:r,leading:i,trailing:a,className:o,children:s,onClick:c,...l})=>(0,K.jsxs)(`button`,{className:q(`tkc-btn`,e===`primary`&&`tkc-btn--primary`,e===`ghost`&&`tkc-btn--ghost`,t===`sm`&&`tkc-btn--sm`,o),disabled:r,"data-loading":n||void 0,onClick:c,...l,children:[n&&(0,K.jsx)(`span`,{className:`tkc-btn__spin`}),!n&&i,s,!n&&a]}),Wt=(0,b.forwardRef)(({className:e,invalid:t,...n},r)=>(0,K.jsx)(`input`,{ref:r,className:q(`tkc-input`,t&&`tkc-input--invalid`,e),...n}));Wt.displayName=`Input`;var Gt=(0,b.forwardRef)(({className:e,invalid:t,rows:n=3,...r},i)=>(0,K.jsx)(`textarea`,{ref:i,className:q(`tkc-textarea`,t&&`tkc-input--invalid`,e),rows:n,style:{resize:`vertical`},...r}));Gt.displayName=`Textarea`;var Kt=({label:e,hint:t,error:n,children:r})=>(0,K.jsxs)(`label`,{className:`tkc-field`,children:[e&&(0,K.jsx)(`span`,{className:`tkc-field__label`,children:e}),r,n?(0,K.jsx)(`span`,{className:`tkc-field__error`,children:n}):t?(0,K.jsx)(`span`,{className:`tkc-field__hint`,children:t}):null]}),qt=({children:e,onRemove:t,removing:n})=>(0,K.jsxs)(`span`,{className:q(`tkc-tag`,n&&`tkc-tag--removing`),children:[e,t&&(0,K.jsx)(`button`,{type:`button`,className:`tkc-tag__x`,onClick:t,"aria-label":`remove`,children:(0,K.jsx)(Ut,{name:`x`,size:10})})]}),Jt=e=>{let t=[[`X`,10],[`IX`,9],[`V`,5],[`IV`,4],[`I`,1]],n=``;for(let[r,i]of t)for(;e>=i;)n+=r,e-=i;return n},Yt=({items:e,defaultOpen:t=null,type:n=`single`})=>{let[r,i]=(0,b.useState)(n===`single`?t??null:Array.isArray(t)?t:[]),a=e=>n===`single`?r===e:r.includes(e),o=e=>{i(n===`single`?r===e?null:e:r.includes(e)?r.filter(t=>t!==e):[...r,e])};return(0,K.jsx)(`div`,{className:`tkc-acc`,children:e.map((e,t)=>(0,K.jsxs)(`div`,{className:`tkc-acc__item`,"data-open":a(t)||void 0,children:[(0,K.jsxs)(`button`,{type:`button`,className:`tkc-acc__trigger`,onClick:()=>o(t),children:[(0,K.jsx)(`span`,{className:`tkc-acc__num`,children:e.num||Jt(t+1)}),(0,K.jsx)(`span`,{children:e.title}),(0,K.jsx)(`span`,{className:`tkc-acc__caret`,children:(0,K.jsx)(Ut,{name:`chevronRight`,size:12})})]}),(0,K.jsx)(`div`,{className:`tkc-acc__panel`,children:(0,K.jsx)(`div`,{className:`tkc-acc__body`,children:e.body})})]},t))})},Xt=({value:e,defaultValue:t,onChange:n,items:r=[]})=>{let[i,a]=zt(e,t||r&&r[0]?.value,n);return(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`tkc-tabs`,role:`tablist`,children:r.map(e=>(0,K.jsxs)(`button`,{type:`button`,role:`tab`,className:`tkc-tab`,"data-active":i===e.value||void 0,onClick:()=>a(e.value),children:[e.label,e.badge!=null&&(0,K.jsx)(`span`,{className:`tkc-badge`,style:{marginLeft:8},children:e.badge})]},e.value))}),r.map(e=>i===e.value?(0,K.jsx)(`div`,{role:`tabpanel`,style:{paddingTop:16},children:e.body},e.value):null)]})},Zt=({node:e,depth:t=0,expanded:n,setExpanded:r,selected:i,setSelected:a})=>{let o=n.has(e.id),s=!!(e.children&&e.children.length>0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`tkc-tree__node`,"data-open":o||void 0,"data-selected":i===e.id||void 0,style:{paddingLeft:6+t*16},onClick:()=>{if(a(e.id),s){let t=new Set(n);t.has(e.id)?t.delete(e.id):t.add(e.id),r(t)}},children:[(0,K.jsx)(`span`,{className:`tkc-tree__caret`,children:s?(0,K.jsx)(Ut,{name:`chevronRight`,size:11}):null}),(0,K.jsx)(Ut,{name:s?`folder`:`file`,size:13,style:{color:`var(--tkc-ink-soft)`}}),(0,K.jsx)(`span`,{children:e.label}),e.count!=null&&(0,K.jsx)(`span`,{className:`tkc-tree__count`,children:e.count})]}),s&&o&&e.children.map(e=>(0,K.jsx)(Zt,{node:e,depth:t+1,expanded:n,setExpanded:r,selected:i,setSelected:a},e.id))]})},Qt=({item:e,active:t,onSelect:n,depth:r=0})=>{let[i,a]=(0,b.useState)(!1),o=!!(e.children&&e.children.length>0);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`tkc-tree__node`,"data-selected":t===e.value||void 0,style:{paddingLeft:6+r*16},onClick:()=>{o&&a(e=>!e),n&&n(e.value)},children:[e.icon&&(0,K.jsx)(Ut,{name:e.icon,size:13,style:{color:`var(--tkc-ink-soft)`}}),(0,K.jsx)(`span`,{children:e.label}),o&&(0,K.jsx)(`span`,{className:`tkc-tree__caret`,children:(0,K.jsx)(Ut,{name:`chevronRight`,size:11})})]}),o&&i&&e.children.map(e=>(0,K.jsx)(Qt,{item:e,active:t,onSelect:n,depth:r+1},e.value))]})},$t=({text:e,children:t,placement:n=`top`,delay:r=250})=>{let[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)({top:0,left:0}),c=(0,b.useRef)(null),l=(0,b.useRef)(null),u=()=>{if(!c.current)return;let e=c.current.getBoundingClientRect();s({top:(n===`bottom`?e.bottom+8:e.top-8)+window.scrollY,left:e.left+e.width/2+window.scrollX})},d=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{u(),a(!0)},r)},f=()=>{l.current&&clearTimeout(l.current),a(!1)};return(0,K.jsxs)(K.Fragment,{children:[b.cloneElement(t,{ref:e=>{c.current=e;let n=t.ref;typeof n==`function`?n(e):n&&typeof n==`object`&&`current`in n&&(n.current=e)},onMouseEnter:d,onMouseLeave:f,onFocus:d,onBlur:f}),i&&(0,K.jsx)(Vt,{children:(0,K.jsx)(`div`,{className:`tkc-tip`,style:{top:o.top,left:o.left,transform:`translate(-50%, ${n===`bottom`?`0`:`-100%`})`},children:e})})]})},en=({value:e,defaultValue:t,onChange:n,options:r,placeholder:i=`Select…`,disabled:a})=>{let[o,s]=zt(e,t,n),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(0),f=(0,b.useRef)(null),p=(0,b.useRef)(null),m=Bt(f,c),h=r.map(e=>typeof e==`string`?{value:e,label:e}:e);Lt(p,()=>l(!1),c),Rt(`Escape`,()=>l(!1),c);let g=h.find(e=>e.value===o),_=e=>{if(!c){(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(l(!0),e.preventDefault());return}e.key===`ArrowDown`?(d(e=>(e+1)%h.length),e.preventDefault()):e.key===`ArrowUp`?(d(e=>(e-1+h.length)%h.length),e.preventDefault()):e.key===`Enter`&&(s(h[u].value),l(!1),e.preventDefault())};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`button`,{ref:f,type:`button`,className:`tkc-select tkc-focus`,"data-open":c||void 0,disabled:a,onClick:()=>!a&&l(e=>!e),onKeyDown:_,children:[(0,K.jsx)(`span`,{className:g?``:`tkc-select__placeholder`,children:g?g.label:i}),(0,K.jsx)(`span`,{className:`tkc-select__caret`,children:(0,K.jsx)(Ut,{name:`chevronDown`,size:12})})]}),c&&(0,K.jsx)(Vt,{children:(0,K.jsx)(`div`,{ref:p,className:`tkc-pop`,style:{top:m.top,left:m.left,minWidth:m.width},onKeyDown:_,children:h.map((e,t)=>(0,K.jsxs)(`div`,{className:`tkc-pop__item`,"data-active":t===u||void 0,"data-selected":e.value===o||void 0,onMouseEnter:()=>d(t),onClick:()=>{s(e.value),l(!1)},children:[(0,K.jsx)(`span`,{children:e.label}),(0,K.jsx)(`span`,{className:`tkc-pop__check`,children:(0,K.jsx)(Ut,{name:`check`,size:12})})]},e.value))})})]})},tn=({open:e,onClose:t,title:n,children:r,footer:i})=>(Rt(`Escape`,()=>t&&t(),e),(0,b.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]),e?(0,K.jsxs)(Vt,{children:[(0,K.jsx)(`div`,{className:`tkc-scrim`,onClick:t}),(0,K.jsxs)(`div`,{className:`tkc-modal`,role:`dialog`,"aria-modal":`true`,children:[n&&(0,K.jsxs)(`div`,{className:`tkc-modal__head`,children:[(0,K.jsx)(`span`,{style:{flex:1},children:n}),(0,K.jsx)(`button`,{type:`button`,className:`tkc-toast__x`,onClick:t,"aria-label":`close`,children:(0,K.jsx)(Ut,{name:`x`,size:14})})]}),(0,K.jsx)(`div`,{className:`tkc-modal__body`,children:r}),i&&(0,K.jsx)(`div`,{className:`tkc-modal__foot`,children:i})]})]}):null),nn=({open:e,onClose:t,items:n,placeholder:r=`Type a command…`,onSelect:i})=>{let[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(0),l=(0,b.useRef)(null);Rt(`Escape`,()=>t&&t(),e),(0,b.useEffect)(()=>{e&&(o(``),c(0),setTimeout(()=>l.current?.focus(),0))},[e]);let u=n.filter(e=>e.label.toLowerCase().includes(a.toLowerCase())),d=e=>{e.onSelect&&e.onSelect(),i&&i(e),t&&t()};return e?(0,K.jsxs)(Vt,{children:[(0,K.jsx)(`div`,{className:`tkc-scrim`,onClick:t}),(0,K.jsxs)(`div`,{className:`tkc-modal`,role:`dialog`,"aria-modal":`true`,style:{width:`min(520px, 92vw)`,padding:0},children:[(0,K.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 14px`,borderBottom:`1.5px solid var(--tkc-rule-m)`},children:[(0,K.jsx)(Ut,{name:`search`,size:15,style:{color:`var(--tkc-ink-quiet)`}}),(0,K.jsx)(`input`,{ref:l,style:{border:0,background:`transparent`,outline:0,flex:1,font:`inherit`,fontSize:15,color:`var(--tkc-ink)`},placeholder:r,value:a,onChange:e=>{o(e.target.value),c(0)},onKeyDown:e=>{e.key===`ArrowDown`?(c(e=>Math.min(u.length-1,e+1)),e.preventDefault()):e.key===`ArrowUp`?(c(e=>Math.max(0,e-1)),e.preventDefault()):e.key===`Enter`&&u[s]&&(d(u[s]),e.preventDefault())}})]}),(0,K.jsx)(`div`,{style:{maxHeight:320,overflow:`auto`,padding:4},children:u.length===0?(0,K.jsx)(`div`,{className:`tkc-pop__empty`,children:`No commands found`}):u.map((e,t)=>(0,K.jsxs)(`div`,{className:`tkc-pop__item`,"data-active":t===s||void 0,onMouseEnter:()=>c(t),onClick:()=>d(e),children:[e.icon&&(0,K.jsx)(Ut,{name:e.icon,size:13}),(0,K.jsx)(`span`,{children:e.label}),e.shortcut&&(0,K.jsx)(`span`,{style:{marginLeft:`auto`,fontFamily:`var(--font-mono)`,fontSize:10,letterSpacing:`.1em`,color:`var(--tkc-ink-quiet)`},children:e.shortcut})]},e.id))})]})]}):null},rn=(0,b.createContext)(null),an=({children:e})=>{let[t,n]=(0,b.useState)([]),[r,i]=(0,b.useState)({}),a=(0,b.useCallback)(e=>{i(t=>({...t,[e]:!0})),setTimeout(()=>{n(t=>t.filter(t=>t.id!==e)),i(t=>{let n={...t};return delete n[e],n})},220)},[]),o=(0,b.useCallback)(e=>{let t=Math.random().toString(36).slice(2,9),r={id:t,kind:`info`,duration:4500,...typeof e==`string`?{title:e}:e};return n(e=>[...e,r]),r.duration&&setTimeout(()=>a(t),r.duration),t},[a]);return(0,K.jsxs)(rn.Provider,{value:{push:o,close:a},children:[e,(0,K.jsx)(`div`,{className:`tkc-toasts`,children:t.map((e,t)=>(0,K.jsxs)(`div`,{className:q(`tkc-toast`,e.kind&&`tkc-toast--${e.kind}`),"data-closing":r[e.id]||void 0,children:[(0,K.jsx)(`span`,{className:`tkc-toast__num`,children:e.kind===`success`?`✓`:e.kind===`warn`?`!`:e.kind===`error`?`×`:t+1}),(0,K.jsxs)(`div`,{className:`tkc-toast__body`,children:[e.title&&(0,K.jsx)(`div`,{className:`t`,children:e.title}),e.message&&(0,K.jsx)(`div`,{className:`s`,children:e.message})]}),(0,K.jsx)(`button`,{type:`button`,className:`tkc-toast__x`,onClick:()=>a(e.id),"aria-label":`dismiss`,children:(0,K.jsx)(Ut,{name:`x`,size:14})})]},e.id))})]})},on=()=>{let e=(0,b.useContext)(rn);if(!e)throw Error(`useToasts must be used within a ToastProvider`);return e},sn=e=>(0,K.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 400 120`,width:400,height:120,...e,children:[(0,K.jsxs)(`g`,{stroke:`#1B1611`,strokeWidth:1,fill:`none`,children:[(0,K.jsx)(`path`,{d:`M10 10 h14 M10 10 v14`}),(0,K.jsx)(`path`,{d:`M390 10 h-14 M390 10 v14`}),(0,K.jsx)(`path`,{d:`M10 110 h14 M10 110 v-14`}),(0,K.jsx)(`path`,{d:`M390 110 h-14 M390 110 v-14`})]}),(0,K.jsxs)(`g`,{transform:`translate(36, 30)`,fill:`none`,stroke:`#1B1611`,strokeWidth:1.6,strokeLinecap:`round`,children:[(0,K.jsx)(`circle`,{cx:30,cy:30,r:28}),(0,K.jsx)(`path`,{d:`M14 44 L30 10 L46 44 M20 36 H40`}),(0,K.jsx)(`text`,{x:30,y:56,textAnchor:`middle`,className:`wm-mono`,fontSize:9,fill:`#1B1611`,stroke:`none`,children:`V.c`})]}),(0,K.jsxs)(`text`,{x:112,y:62,className:`wm-serif`,fontSize:44,fill:`#1B1611`,children:[`a5c`,(0,K.jsx)(`tspan`,{fill:`#C03A2B`,children:`.`}),`ai`]}),(0,K.jsx)(`text`,{x:112,y:86,className:`wm-mono`,fontSize:9,fill:`#5A4E3C`,children:`CODEX · OF · RELIABLE · AUTONOMY`}),(0,K.jsx)(`text`,{x:390,y:118,textAnchor:`end`,className:`wm-mono`,fontSize:8,fill:`#8C7E65`,children:`fol. I`})]});function cn(e,t={}){let n=t.baseMs??500,r=t.maxMs??3e4,i=t.jitterFactor??.2,a=Math.min(r,n*2**Math.max(0,e-1)),o=a*i*Math.random();return Math.round(a+o)}var ln=class extends Error{constructor(e){super(e),this.name=`GatewayClientError`}},un=class extends ln{constructor(e){super(e),this.name=`GatewayClientTimeoutError`}},dn=class extends ln{constructor(e){super(e),this.name=`GatewayClientDisconnectedError`}};function fn(e){let t=new WebSocket(e);return{send(e){t.send(e)},close(e,n){t.close(e,n)},onOpen(e){t.addEventListener(`open`,e)},onMessage(e){t.addEventListener(`message`,t=>e(String(t.data)))},onClose(e){t.addEventListener(`close`,t=>e({code:t.code,reason:t.reason}))},onError(e){t.addEventListener(`error`,e)}}}var pn=class{options;socket=null;pending=new Map;listeners=new Map;runSubscriptions=new Map;sessionSubscriptions=new Map;requestTimeoutMs;shouldReconnect;reconnectTimer=null;reconnectAttempt=0;closedManually=!1;ready=!1;nextId=0;constructor(e){this.options=e,this.requestTimeoutMs=e.requestTimeoutMs??1e4,this.shouldReconnect=e.shouldReconnect??!0}async connect(){this.closedManually=!1,await this.openSocket()}async close(){this.closedManually=!0,this.ready=!1,this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null),this.socket?.close(1e3,`client close`),this.socket=null}async request(e){let t=typeof e.id==`string`?e.id:this.allocateId(),n={...e,id:t},r=this.socket;if(!r)throw new dn(`Gateway socket is not connected`);return await new Promise((e,i)=>{let a=setTimeout(()=>{this.pending.delete(t),i(new un(`Timed out waiting for response to frame ${t}`))},this.requestTimeoutMs);this.pending.set(t,{resolve:e,reject:i,timer:a}),r.send(JSON.stringify(n))})}async startSession(e){return await this.request({type:`session.start`,...e})}async sendSessionMessage(e){return await this.request({type:`session.message`,...e})}subscribeRun(e,t){let n=this.runSubscriptions.get(e),r=n??{runId:e,sinceSeq:0,callbacks:new Set,subscriberCount:0};return r.subscriberCount+=1,t&&r.callbacks.add(t),this.runSubscriptions.set(e,r),n||this.sendFrame({type:`subscribe`,runId:e,sinceSeq:r.sinceSeq}),()=>{let n=this.runSubscriptions.get(e);n&&(n.subscriberCount=Math.max(0,n.subscriberCount-1),t&&n.callbacks.delete(t),!(n.subscriberCount>0)&&(this.runSubscriptions.delete(e),this.sendFrame({type:`unsubscribe`,runId:e})))}}subscribeSession(e,t){return this.sessionSubscriptions.set(e,{sessionId:e,callback:t}),this.sendFrame({type:`session.subscribe`,sessionId:e}),()=>{this.sessionSubscriptions.delete(e),this.sendFrame({type:`session.unsubscribe`,sessionId:e})}}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),()=>{n?.delete(t)}}async openSocket(){let e=(this.options.createSocket??fn)(this.options.url,this.options.token);this.socket=e,this.ready=!1;let t=!1;await new Promise((n,r)=>{e.onOpen(()=>{e.send(JSON.stringify({type:`auth`,token:this.options.token}))}),e.onError(e=>{this.emit(`error`,e),t||r(e)}),e.onMessage(e=>{this.handleMessage(e),t||JSON.parse(e).type===`hello`&&(t=!0,this.ready=!0,this.reconnectAttempt=0,this.emit(`connected`),this.replaySubscriptions(),n())}),e.onClose(e=>{if(this.ready=!1,this.emit(`disconnected`,e??{}),!t){r(new dn(`Gateway socket closed before authentication completed`));return}!this.closedManually&&this.shouldReconnect&&this.scheduleReconnect()})})}sendFrame(e){!this.socket||!this.ready||this.socket.send(JSON.stringify(e))}handleMessage(e){let t=JSON.parse(e),n=typeof t.id==`string`?t.id:null;if(n){let e=this.pending.get(n);e&&(clearTimeout(e.timer),this.pending.delete(n),e.resolve(t))}if(t.type===`run.event`&&typeof t.runId==`string`&&typeof t.seq==`number`){let e=this.runSubscriptions.get(t.runId);if(e){e.sinceSeq=Math.max(e.sinceSeq,Number(t.seq));for(let n of e.callbacks)n(t)}}if(t.type===`hook.request`){let e=t,n=this.runSubscriptions.get(e.runId);if(n){let t={type:`run.event`,runId:e.runId,seq:e.deadlineTs,source:`gateway`,event:e};for(let e of n.callbacks)e(t)}}this.emit(`frame`,t)}replaySubscriptions(){for(let e of this.runSubscriptions.values())this.sendFrame({type:`subscribe`,runId:e.runId,sinceSeq:e.sinceSeq});for(let e of this.sessionSubscriptions.values())this.sendFrame({type:`session.subscribe`,sessionId:e.sessionId})}scheduleReconnect(){let e=cn(++this.reconnectAttempt);this.reconnectTimer=setTimeout(()=>{this.openSocket().catch(e=>{this.emit(`error`,e),this.scheduleReconnect()})},e)}emit(e,...t){let n=this.listeners.get(e);if(n)for(let e of n)e(...t)}allocateId(){return this.nextId+=1,`req-${this.nextId}`}},mn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},hn=(e=>e?mn(e):mn);function gn(){return{seqs:[],sources:[],events:[]}}function _n(e,t,n,r){let i=0,a=e.seqs.length;for(;i<a;){let n=Math.floor((i+a)/2),r=e.seqs[n];if(r===t)return e;r<t?i=n+1:a=n}return{seqs:[...e.seqs.slice(0,i),t,...e.seqs.slice(i)],sources:[...e.sources.slice(0,i),n,...e.sources.slice(i)],events:[...e.events.slice(0,i),r,...e.events.slice(i)]}}function vn(e){return hn((t,n)=>({client:e,connection:{status:`disconnected`,error:null},agents:{items:[],byId:{}},sessions:{byId:{}},runs:{byId:{}},events:{byRunId:{}},hooks:{byRunId:{}},actions:{setConnection(e,n=null){t(t=>({...t,connection:{status:e,error:n}}))},setAgents(e){t(t=>({...t,agents:{items:e.map(e=>e.agent),byId:Object.fromEntries(e.map(e=>[e.agent,e]))}}))},mergeSession(e,n){t(t=>({...t,sessions:{byId:{...t.sessions.byId,[e]:{...t.sessions.byId[e]??{},sessionId:e,...n}}}}))},mergeRun(e,n){t(t=>({...t,runs:{byId:{...t.runs.byId,[e]:{...t.runs.byId[e]??{},runId:e,...n}}}}))},mergeRunEvent(e,n,r,i){t(t=>{let a=t.events.byRunId[e]??gn(),o=_n(a,n,r,i);return o===a?t:{...t,events:{byRunId:{...t.events.byRunId,[e]:o}}}})},addHookRequest(e){t(t=>({...t,hooks:{byRunId:{...t.hooks.byRunId,[e.runId]:[...(t.hooks.byRunId[e.runId]??[]).filter(t=>t.hookRequestId!==e.hookRequestId),e]}}}))},resolveHookRequest(e,n){t(t=>({...t,hooks:{byRunId:{...t.hooks.byRunId,[e]:(t.hooks.byRunId[e]??[]).filter(e=>e.hookRequestId!==n)}}}))}}}))}var yn=[];function bn(e,t){if(t)return e.hooks.byRunId[t]??yn;let n=Object.values(e.hooks.byRunId).flat();return n.length>0?n:yn}function xn(e,t=180){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,Math.max(0,t-1))}…`}function Sn(e){if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Cn(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`){let t=Date.parse(e);if(Number.isFinite(t))return t}return null}function wn(e,t,n){let r=t!=null&&n!=null?Math.max(0,n-t):0;return r>0?Math.max(1,Math.min(10,Math.round(r/1e3)+1)):Math.max(1,Math.min(7,Math.ceil(Math.max(16,e.length)/28)))}function Tn(e,t){for(let n of t)n.length===0||e.includes(n)||e.push(n)}var En=new Set([`path`,`paths`,`file`,`files`,`file_path`,`filePath`,`filePaths`,`relative_path`,`relativePath`,`target`,`target_path`,`targetPath`,`source_path`,`sourcePath`,`oldPath`,`newPath`,`output_path`,`outputPath`]),Dn=/^(dockerfile|makefile|procfile|gemfile|rakefile|justfile|readme(?:\.[^.]+)?|license(?:\.[^.]+)?|jenkinsfile|brewfile|tiltfile|vagrantfile)$/i;function On(e){let t=e.trim().replace(/^["'`]+|["'`]+$/g,``);if(t.length===0||t.length>300||/[\r\n]/.test(t)||t.endsWith(`/`)||t.endsWith(`\\`))return null;let n=t.replace(/^vscode:\/\/file/,``),r=n.split(/[\\/]/).filter(Boolean).at(-1)??n;return/\.[A-Za-z0-9_-]{1,16}$/.test(r)||Dn.test(r)?n:null}function kn(e,t=0,n=new Set){if(t>5||e==null)return n;if(typeof e==`string`){let t=On(e);return t&&n.add(t),n}if(Array.isArray(e)){for(let r of e)kn(r,t+1,n);return n}if(typeof e==`object`)for(let[r,i]of Object.entries(e)){if(En.has(r)){kn(i,t+1,n);continue}t<4&&kn(i,t+1,n)}return n}function An(e,t){let n=e.timestamp??e.startedAt??0,r=t.timestamp??t.startedAt??0;return n===r?String(e.path??``).localeCompare(String(t.path??``)):n-r}function jn(e){return typeof e==`object`&&!!e}function Y(e){return typeof e==`string`?e:null}function Mn(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function Nn(e){let t=e.timestamp;return typeof t==`string`||typeof t==`number`?t:void 0}function Pn(e){if(!jn(e))return null;let t={totalUsd:Mn(e.totalUsd)??void 0,inputTokens:Mn(e.inputTokens)??void 0,outputTokens:Mn(e.outputTokens)??void 0,thinkingTokens:Mn(e.thinkingTokens)??void 0,cachedTokens:Mn(e.cachedTokens)??void 0,cacheCreationTokens:Mn(e.cacheCreationTokens)??void 0,cacheReadTokens:Mn(e.cacheReadTokens)??void 0};return Object.values(t).some(e=>e!=null)?t:null}function Fn(e){let t=Y(e.toolCallId);if(!t)return null;let n=Nn(e);switch(e.type){case`tool_call_start`:{let r=Y(e.toolName),i=Y(e.inputAccumulated);return r&&i!=null?{type:`tool_call_start`,toolCallId:t,toolName:r,inputAccumulated:i,timestamp:n}:null}case`tool_call_ready`:{let r=Y(e.toolName);return r?{type:`tool_call_ready`,toolCallId:t,toolName:r,input:e.input,timestamp:n}:null}case`tool_input_delta`:{let r=Y(e.inputAccumulated);return r==null?null:{type:`tool_input_delta`,toolCallId:t,inputAccumulated:r,timestamp:n}}case`tool_result`:{let r=Y(e.toolName);return r?{type:`tool_result`,toolCallId:t,toolName:r,output:e.output,timestamp:n}:null}case`tool_error`:{let r=Y(e.toolName),i=Y(e.error);return r&&i!=null?{type:`tool_error`,toolCallId:t,toolName:r,error:i,timestamp:n}:null}default:return null}}function In(e){let t=Y(e.toolCallId),n=Y(e.server),r=Y(e.toolName);if(!t||!n||!r)return null;let i=Nn(e);switch(e.type){case`mcp_tool_call_start`:return{type:`mcp_tool_call_start`,toolCallId:t,server:n,toolName:r,input:e.input,timestamp:i};case`mcp_tool_result`:return{type:`mcp_tool_result`,toolCallId:t,server:n,toolName:r,output:e.output,timestamp:i};case`mcp_tool_error`:{let a=Y(e.error);return a==null?null:{type:`mcp_tool_error`,toolCallId:t,server:n,toolName:r,error:a,timestamp:i}}default:return null}}function Ln(e){let t=Y(e.agentName);if(!t)return null;let n=Nn(e);switch(e.type){case`subagent_spawn`:{let r=Y(e.prompt);return r==null?null:{type:`subagent_spawn`,agentName:t,prompt:r,timestamp:n}}case`subagent_result`:{let r=Y(e.summary);return r==null?null:{type:`subagent_result`,agentName:t,summary:r,timestamp:n}}case`subagent_error`:{let r=Y(e.error);return r==null?null:{type:`subagent_error`,agentName:t,error:r,timestamp:n}}default:return null}}function Rn(e){let t=Nn(e);switch(e.type){case`session_start`:case`session_resume`:case`session_end`:case`session_fork`:return{type:e.type,timestamp:t};case`turn_start`:case`turn_end`:{let n=Mn(e.turnIndex);return n==null?null:{type:e.type,turnIndex:n,timestamp:t}}case`step_start`:{let n=Y(e.stepType),r=Mn(e.stepIndex);return n!=null&&r!=null?{type:`step_start`,stepType:n,stepIndex:r,timestamp:t}:null}case`step_end`:{let n=Mn(e.stepIndex);return n==null?null:{type:`step_end`,stepIndex:n,timestamp:t}}default:return null}}function zn(e){let t=Y(e.path);if(!t)return null;let n=Nn(e);switch(e.type){case`file_read`:case`file_write`:case`file_create`:case`file_delete`:return{type:e.type,path:t,timestamp:n};case`file_patch`:return{type:`file_patch`,path:t,diff:Y(e.diff)??``,timestamp:n};default:return null}}function Bn(e){let t=Nn(e);switch(e.type){case`approval_request`:{let n=Y(e.interactionId),r=Y(e.action),i=Y(e.detail),a=Y(e.riskLevel);return!n||!r||i==null||a!==`low`&&a!==`medium`&&a!==`high`?null:{type:`approval_request`,interactionId:n,action:r,detail:i,toolName:Y(e.toolName)??void 0,riskLevel:a,timestamp:t}}case`approval_granted`:{let n=Y(e.interactionId);return n?{type:`approval_granted`,interactionId:n,timestamp:t}:null}case`approval_denied`:{let n=Y(e.interactionId);return n?{type:`approval_denied`,interactionId:n,reason:Y(e.reason)??void 0,timestamp:t}:null}case`hook_requested`:{let n=Y(e.hookRequestId),r=Y(e.hookKind);return!n||!r?null:{type:`hook_requested`,hookRequestId:n,hookKind:r,payload:e.payload,deadlineTs:Mn(e.deadlineTs)??void 0,timestamp:t}}case`hook_decision`:{let n=Y(e.hookRequestId),r=e.decision===`deny`?`deny`:e.decision===`allow`?`allow`:null;return!n||!r?null:{type:`hook_decision`,hookRequestId:n,hookKind:Y(e.hookKind)??void 0,decision:r,reason:Y(e.reason)??void 0,resolvedBy:Y(e.resolvedBy)??void 0,timestamp:t}}case`shell_start`:{let n=Y(e.command);return n==null?null:{type:`shell_start`,command:n,timestamp:t}}case`shell_exit`:{let n=Mn(e.exitCode);return n==null?null:{type:`shell_exit`,exitCode:n,timestamp:t}}case`plugin_loaded`:case`plugin_invoked`:{let n=Y(e.pluginName),r=Y(e.pluginId);return n&&r?{type:e.type,pluginName:n,pluginId:r,timestamp:t}:null}case`plugin_error`:{let n=Y(e.pluginName),r=Y(e.pluginId),i=Y(e.error);return n&&r&&i!=null?{type:`plugin_error`,pluginName:n,pluginId:r,error:i,timestamp:t}:null}case`skill_loaded`:case`skill_invoked`:{let n=Y(e.skillName);return n?{type:e.type,skillName:n,timestamp:t}:null}case`agentdoc_read`:{let n=Y(e.path);return n?{type:`agentdoc_read`,path:n,timestamp:t}:null}case`image_output`:return{type:`image_output`,filePath:Y(e.filePath)??void 0,timestamp:t};default:return null}}function Vn(e){if(!jn(e))return null;let t=Y(e.type);if(!t)return null;let n=e;switch(t){case`user_message`:{let e=Y(n.text);return e==null?null:{type:t,text:e,sessionId:Y(n.sessionId)??void 0,timestamp:Nn(n)}}case`thinking_delta`:{let e=Y(n.delta);return e==null?null:{type:t,delta:e,timestamp:Nn(n)}}case`thinking_stop`:{let e=Y(n.thinking);return e==null?null:{type:t,thinking:e,timestamp:Nn(n)}}case`text_delta`:{let e=Y(n.delta);return e==null?null:{type:t,delta:e,timestamp:Nn(n)}}case`message_stop`:{let e=Y(n.text);return e==null?null:{type:t,text:e,timestamp:Nn(n)}}case`tool_call_start`:case`tool_call_ready`:case`tool_input_delta`:case`tool_result`:case`tool_error`:return Fn(n);case`mcp_tool_call_start`:case`mcp_tool_result`:case`mcp_tool_error`:return In(n);case`subagent_spawn`:case`subagent_result`:case`subagent_error`:return Ln(n);case`session_start`:case`session_resume`:case`session_end`:case`session_fork`:case`turn_start`:case`turn_end`:case`step_start`:case`step_end`:return Rn(n);case`file_read`:case`file_write`:case`file_create`:case`file_delete`:case`file_patch`:return zn(n);case`shell_start`:case`shell_exit`:case`approval_request`:case`approval_granted`:case`approval_denied`:case`hook_requested`:case`hook_decision`:case`plugin_loaded`:case`plugin_invoked`:case`plugin_error`:case`skill_loaded`:case`skill_invoked`:case`agentdoc_read`:case`image_output`:return Bn(n);case`cost`:{let e=Pn(n.cost);return e?{type:`cost`,cost:e,timestamp:Nn(n)}:null}case`error`:{let e=Y(n.message)??Y(n.error);return e==null?null:{type:`error`,message:e,timestamp:Nn(n)}}default:return null}}function Hn(e){if(!e)return[];let t=[];for(let n of e.events){let e=Vn(n);e&&t.push(e)}return t}function Un(e){let t=typeof e.runId==`string`?e.runId:``;return t.length===0?null:{runId:t,agent:typeof e.agent==`string`&&e.agent.length>0?e.agent:`unknown`,status:typeof e.status==`string`&&e.status.length>0?e.status:`unknown`,startedAt:Cn(e.startedAt)??0}}function Wn(e,t){let n={totalUsd:0,inputTokens:0,outputTokens:0,thinkingTokens:0,cachedTokens:0,cacheCreationTokens:0,cacheReadTokens:0},r=!1;for(let i of e)for(let e of Hn(t[i]))e.type===`cost`&&(n.totalUsd=(n.totalUsd??0)+Number(e.cost.totalUsd??0),n.inputTokens=(n.inputTokens??0)+Number(e.cost.inputTokens??0),n.outputTokens=(n.outputTokens??0)+Number(e.cost.outputTokens??0),n.thinkingTokens=(n.thinkingTokens??0)+Number(e.cost.thinkingTokens??0),n.cachedTokens=(n.cachedTokens??0)+Number(e.cost.cachedTokens??0),n.cacheCreationTokens=(n.cacheCreationTokens??0)+Number(e.cost.cacheCreationTokens??0),n.cacheReadTokens=(n.cacheReadTokens??0)+Number(e.cost.cacheReadTokens??0),r=!0);return r?n:null}function Gn(e,t){let n=e.timestamp;if(n instanceof Date)return n.getTime();if(typeof n==`number`&&Number.isFinite(n))return n;if(typeof n==`string`){let e=Date.parse(n);if(Number.isFinite(e))return e}return t}function Kn(e){if(typeof e==`string`)return e;if(Array.isArray(e)){let t=e.flatMap(e=>{if(typeof e==`string`)return[e];if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.type==`string`?t.type:``;return n===`tool_use`?[]:n===`text`&&typeof t.text==`string`?[t.text]:n===`tool_result`?[Kn(t.content??t.output??t.tool_use_result)]:typeof t.text==`string`?[t.text]:`content`in t?[Kn(t.content)]:[]}).filter(e=>e.length>0);if(t.length>0)return t.join(`
10
+
11
+ `)}if(e&&typeof e==`object`){let t=e;if(typeof t.text==`string`)return t.text;if(`content`in t){let e=Kn(t.content);if(e.length>0)return e}}return e==null?``:Sn(e)}function qn(e,t){let n=[];for(let[r,i]of t.entries()){let t=`${e}:native:${r}`,a=Gn(i,r),o=Kn(i.content);if(i.role===`user`&&o.length>0){n.push({id:`${t}:user`,kind:`user`,label:`user`,text:o,runId:t,timestamp:a,filePaths:[]});continue}if(typeof i.thinking==`string`&&i.thinking.length>0&&n.push({id:`${t}:thinking`,kind:`thinking`,label:`thinking`,text:i.thinking,runId:t,timestamp:a+.1,filePaths:[]}),Array.isArray(i.toolCalls))for(let[e,r]of i.toolCalls.entries()){let i=[...kn(r.input),...kn(r.output)];n.push({id:`${t}:tool:${e}`,kind:`tool`,label:String(r.toolName??`tool`),text:Sn({input:r.input,output:r.output,durationMs:r.durationMs}),runId:t,timestamp:a+.2+e/10,filePaths:i})}if(i.role===`tool`&&i.toolResult){let e=o.length>0?o:Sn(i.toolResult.output);n.push({id:`${t}:tool-result`,kind:`tool`,label:String(i.toolResult.toolName??`tool`),text:e,runId:t,timestamp:a+.25,filePaths:[...kn(i.toolResult.output)]});continue}if(i.role===`assistant`&&o.length>0){n.push({id:`${t}:assistant`,kind:`assistant`,label:`assistant`,text:o,runId:t,timestamp:a+.3,filePaths:[]});continue}i.role===`system`&&o.length>0&&n.push({id:`${t}:system`,kind:`system`,label:`system`,text:o,runId:t,timestamp:a+.4,filePaths:[]})}return n}function Jn(e,t,n,r){if(t.length===0)return null;let i=qn(e,t).map((t,n)=>({id:`${e}:native:segment:${n}`,kind:t.kind,title:t.label,detail:xn(t.text,220),weight:wn(t.text,null,null),startedAt:typeof t.timestamp==`number`?t.timestamp:null,endedAt:typeof t.timestamp==`number`?t.timestamp:null,status:t.kind===`error`?`error`:`complete`,filePaths:t.filePaths})),a=i.filter(e=>e.kind===`tool`).length;return{runId:`${e}:native`,laneKey:`${e}:native`,agent:n,status:r,startedAt:0,lastEventAt:t.length,segmentCount:i.length,toolCount:a,totalUsd:null,segments:i}}function Yn(e,t,n,r,i,a){let o=e.get(t)??{path:t,reads:0,writes:0,touches:0,lastEventAt:null,runIds:[],tools:[]};n===`read`?o.reads+=1:o.writes+=1,o.touches+=1,o.lastEventAt=i??o.lastEventAt,o.runIds.includes(r)||o.runIds.push(r),a&&!o.tools.includes(a)&&o.tools.push(a),e.set(t,o)}function Xn(e,t){for(let n of t){let t=e.get(n.path);if(!t){e.set(n.path,{...n,runIds:[...n.runIds],tools:[...n.tools]});continue}t.reads+=n.reads,t.writes+=n.writes,t.touches+=n.touches,t.lastEventAt=Math.max(t.lastEventAt??0,n.lastEventAt??0)||null,Tn(t.runIds,n.runIds),Tn(t.tools,n.tools)}}function Zn(e){return e.type===`turn_start`||e.type===`turn_end`?`turn ${String(e.turnIndex??`?`)}`:e.type===`step_start`||e.type===`step_end`?`step ${String((`stepType`in e?e.stepType:void 0)??e.stepIndex??`?`)}`:e.type===`session_start`||e.type===`session_resume`||e.type===`session_end`||e.type===`session_fork`?`session ${e.type.replace(`session_`,``)}`:e.type.replace(/_/g,` `)}function Qn(e){switch(e.type){case`approval_request`:return`approval requested`;case`approval_granted`:return`approval granted`;case`approval_denied`:return`approval denied`;case`hook_requested`:return`runtime hook ${e.hookKind}`;case`hook_decision`:return`hook ${e.decision}`;case`shell_start`:return`shell ${xn(e.command,48)}`;case`shell_exit`:return`shell exit ${String(e.exitCode??`?`)}`;case`file_read`:case`file_write`:case`file_create`:case`file_delete`:case`file_patch`:return`${e.type.replace(`file_`,``)} ${xn(e.path,36)}`;case`mcp_tool_call_start`:case`mcp_tool_result`:case`mcp_tool_error`:return`${e.toolName} · ${e.server}`;case`plugin_loaded`:case`plugin_invoked`:case`plugin_error`:return`${e.type.replace(`plugin_`,``)} ${e.pluginName??e.pluginId??`plugin`}`;case`skill_loaded`:case`skill_invoked`:return`${e.type.replace(`skill_`,``)} ${e.skillName}`;case`agentdoc_read`:return`agent doc ${xn(e.path,36)}`;default:return e.type.replace(/_/g,` `)}}function $n(e,t){return t?`${e} · ${t}`:e}function er(e){let t=Sn(e.payload),n=e.deadlineTs?`deadline ${new Date(e.deadlineTs).toLocaleTimeString()}`:`pending`;return t.length>0?`Runtime hook ${e.hookKind} opened (${n}).\n${t}`:`Runtime hook ${e.hookKind} opened (${n}).`}function tr(e){let t=[`Runtime hook ${e.hookKind??e.hookRequestId} resolved: ${e.decision}.`];return e.reason&&t.push(`Reason: ${e.reason}`),e.resolvedBy&&t.push(`Resolved by: ${e.resolvedBy}`),t.join(`
12
+ `)}function nr(e){if(e.type===`approval_request`){let t=[`Approval requested: ${e.action}.`,e.detail];return e.toolName&&t.push(`Tool: ${e.toolName}`),t.push(`Risk: ${e.riskLevel}`),t.join(`
13
+ `)}return e.type===`approval_denied`&&e.reason?`Approval denied.\nReason: ${e.reason}`:e.type===`approval_granted`?`Approval granted.`:`Approval denied.`}function rr(e,t){let n=[],r=[],i=[],a=new Map,o=new Map,s=``,c=null,l=``,u=null,d=0,f=0,p=!1,m=e.startedAt,h=(t,a,o,s,c,l,u)=>{let d=xn(o.length>0?o:a,220),f=[...u?.filePaths??[]],p={id:`${e.runId}-${n.length}-${t}`,kind:t,title:a,detail:d,weight:wn(d,s,c),startedAt:s,endedAt:c,status:l,secondaryLabel:u?.secondaryLabel,filePaths:f};if(n.push(p),i.push({id:`timeline-${p.id}`,runId:e.runId,laneKey:e.runId,kind:t,title:u?.secondaryLabel?$n(a,u.secondaryLabel):a,detail:d,timestamp:s??c,status:l,filePaths:f}),u?.includeTranscript&&t!==`lifecycle`){let n=t===`user`||t===`assistant`||t===`thinking`||t===`tool`||t===`system`||t===`branch`?t:`error`;r.push({id:`transcript-${p.id}`,kind:n,label:u?.secondaryLabel?$n(a,u.secondaryLabel):a,text:o,runId:e.runId,timestamp:s??c,status:l,filePaths:f})}},g=e=>{s&&(h(`assistant`,`assistant`,s,c,e??c,`complete`,{includeTranscript:!0}),s=``,c=null)},_=e=>{l&&(h(`thinking`,`thinking`,l,u,e??u,`complete`,{includeTranscript:!0}),l=``,u=null)};for(let n of t){let t=Cn(n.timestamp)??e.startedAt;if(m=Math.max(m,t),n.type===`cost`){f+=Number(n.cost.totalUsd??0),p=!0;continue}if(n.type===`user_message`){_(t),g(t),n.text.length>0&&h(`user`,`user`,n.text,t,t,`complete`,{includeTranscript:!0});continue}if(n.type===`thinking_delta`){u??=t,l+=n.delta;continue}if(n.type===`thinking_stop`){n.thinking.length>0&&(l=n.thinking),_(t);continue}if(n.type===`text_delta`){_(t),c??=t,s+=n.delta;continue}if(n.type===`message_stop`){_(t),n.text.length>0&&(s=n.text),g(t);continue}if(_(t),g(t),n.type===`hook_requested`){let e=[...kn(n.payload)];h(`system`,Qn(n),er(n),t,t,`complete`,{includeTranscript:!0,filePaths:e});continue}if(n.type===`hook_decision`){h(`system`,Qn(n),tr(n),t,t,`complete`,{includeTranscript:!0});continue}if(n.type===`approval_request`||n.type===`approval_granted`||n.type===`approval_denied`){h(n.type===`approval_denied`?`error`:`system`,Qn(n),nr(n),t,t,n.type===`approval_denied`?`error`:`complete`,{includeTranscript:!0});continue}if(n.type===`tool_call_start`||n.type===`tool_call_ready`||n.type===`tool_input_delta`){let r=n.toolCallId,i=o.get(r),s=`toolName`in n?n.toolName:i?.toolName??`tool`,c=n.type===`tool_call_ready`?Sn(n.input):n.type===`tool_call_start`?n.inputAccumulated:n.inputAccumulated||i?.detail||``,l=[...kn(n.type===`tool_call_ready`?n.input:c)];for(let n of l)Yn(a,n,`read`,e.runId,t,s);o.set(r,{toolName:s,startedAt:i?.startedAt??t,detail:c,filePaths:l});continue}if(n.type===`tool_result`||n.type===`tool_error`){let r=o.get(n.toolCallId),i=r?.toolName??n.toolName,s=n.type===`tool_error`?n.error:Sn(n.output),c=r?.filePaths??[],l=n.type===`tool_result`?[...kn(n.output),...kn(s)].filter(e=>!c.includes(e)):[],u=[...new Set([...c,...l])],f=/write|edit|patch/i.test(i),p=f?u:l;for(let n of p)Yn(a,n,f?`write`:`read`,e.runId,t,i);h(n.type===`tool_error`?`error`:`tool`,i,s,r?.startedAt??t,t,n.type===`tool_error`?`error`:`complete`,{includeTranscript:!0,filePaths:u}),o.delete(n.toolCallId),d+=1;continue}if(n.type===`mcp_tool_call_start`){let r=Sn(n.input),i=[...kn(n.input)];for(let r of i)Yn(a,r,`read`,e.runId,t,n.toolName);o.set(n.toolCallId,{toolName:n.toolName,secondaryLabel:n.server,startedAt:t,detail:r,filePaths:i});continue}if(n.type===`mcp_tool_result`||n.type===`mcp_tool_error`){let e=o.get(n.toolCallId),r=n.type===`mcp_tool_error`?n.error:Sn(n.output);h(n.type===`mcp_tool_error`?`error`:`tool`,e?.toolName??n.toolName,r,e?.startedAt??t,t,n.type===`mcp_tool_error`?`error`:`complete`,{secondaryLabel:e?.secondaryLabel??n.server,includeTranscript:!0,filePaths:e?.filePaths??[]}),o.delete(n.toolCallId),d+=1;continue}if(n.type===`subagent_spawn`||n.type===`subagent_result`||n.type===`subagent_error`){let e=n.type===`subagent_spawn`?n.prompt:n.type===`subagent_result`?n.summary:n.error;h(n.type===`subagent_error`?`error`:`branch`,n.agentName,e,t,t,n.type===`subagent_error`?`error`:`complete`,{includeTranscript:!0});continue}if(n.type===`session_start`||n.type===`session_resume`||n.type===`session_end`||n.type===`session_fork`||n.type===`turn_start`||n.type===`turn_end`||n.type===`step_start`||n.type===`step_end`){let e=Zn(n);h(`lifecycle`,e,e,t,t,`complete`);continue}if(n.type===`file_read`||n.type===`file_write`||n.type===`file_create`||n.type===`file_delete`||n.type===`file_patch`){n.path.length>0&&Yn(a,n.path,n.type===`file_read`?`read`:`write`,e.runId,t);let r=Qn(n);h(`system`,r,r,t,t,`complete`,{includeTranscript:!0,filePaths:n.path.length>0?[n.path]:[]});continue}if(n.type===`shell_start`||n.type===`shell_exit`||n.type===`plugin_loaded`||n.type===`plugin_invoked`||n.type===`plugin_error`||n.type===`skill_loaded`||n.type===`skill_invoked`||n.type===`agentdoc_read`||n.type===`image_output`){let e=Qn(n);h(n.type.endsWith(`error`)?`error`:`system`,e,e,t,t,n.type.endsWith(`error`)?`error`:`complete`,{includeTranscript:!0,filePaths:[...kn(n)]});continue}n.type===`error`&&h(`error`,`error`,n.message,t,t,`error`,{includeTranscript:!0})}_(m||null),g(m||null);for(let[t,n]of o.entries())h(`tool`,n.toolName,n.detail.length>0?n.detail:n.toolName,n.startedAt,n.startedAt,`running`,{secondaryLabel:n.secondaryLabel,includeTranscript:!0,filePaths:n.filePaths}),i[i.length-1].id=`timeline-${e.runId}-${t}-pending`,r[r.length-1].id=`transcript-${e.runId}-${t}-pending`,d+=1;return{lane:{runId:e.runId,laneKey:e.runId,agent:e.agent,status:e.status,startedAt:e.startedAt,lastEventAt:m,segmentCount:n.length,toolCount:d,totalUsd:p?f:null,segments:n},transcript:r,timeline:i,files:Array.from(a.values())}}function ir(e){return e.map(e=>({id:`${e.id}:timeline`,runId:e.runId,laneKey:e.runId,kind:e.kind,title:e.label,detail:e.text,timestamp:e.timestamp,status:e.status??`complete`,filePaths:e.filePaths}))}function ar(e){let t=new Map;for(let n of e)for(let e of n.filePaths){let r=t.get(e)??{path:e,reads:0,writes:0,touches:0,lastEventAt:null,runIds:[],tools:[]};r.touches+=1,r.runIds.includes(n.runId)||r.runIds.push(n.runId),n.kind===`tool`&&!r.tools.includes(n.label)&&r.tools.push(n.label),typeof n.timestamp==`number`&&(r.lastEventAt=Math.max(r.lastEventAt??0,n.timestamp)||null),t.set(e,r)}return Array.from(t.values()).sort((e,t)=>e.touches===t.touches?(t.lastEventAt??0)-(e.lastEventAt??0):t.touches-e.touches)}function or(e,t){let n=e.map(e=>Un(e)).filter(e=>e!=null).sort((e,t)=>e.startedAt-t.startedAt),r=[],i=[],a=[],o=new Map;for(let e of n){let n=rr(e,Hn(t[e.runId]));r.push(n.lane),i.push(...n.transcript),a.push(...n.timeline),Xn(o,n.files)}let s=[...a].sort(An),c=[...i].sort(An),l=Array.from(o.values()).sort((e,t)=>e.touches===t.touches?(t.lastEventAt??0)-(e.lastEventAt??0):t.touches-e.touches),u=0,d=!1,f=0,p=0,m=0;for(let e of r)f+=e.toolCount,m+=e.segmentCount,p+=e.segments.filter(e=>e.kind===`tool`&&e.status===`running`).length,e.totalUsd!=null&&(u+=e.totalUsd,d=!0);return{lanes:r,transcript:c,timeline:s,files:l,summary:{totalRuns:r.length,totalSegments:m,totalTools:f,pendingTools:p,fileCount:l.length,totalUsd:d?u:null}}}var sr=(0,b.createContext)(null),cr=(0,b.createContext)(null);function lr(e,t){let n=[e.on(`connected`,()=>t.getState().actions.setConnection(`connected`)),e.on(`disconnected`,e=>t.getState().actions.setConnection(`disconnected`,e.reason??null)),e.on(`error`,e=>t.getState().actions.setConnection(`disconnected`,e instanceof Error?e.message:String(e))),e.on(`frame`,e=>{let n=e.type;if(n===`run.event`&&typeof e.runId==`string`&&typeof e.seq==`number`){let n=e.runId,r=e.event;if(t.getState().actions.mergeRunEvent(n,e.seq,String(e.source??`gateway`),r),r.type===`session_start`&&typeof r.sessionId==`string`&&(t.getState().actions.mergeRun(n,{sessionId:r.sessionId}),t.getState().actions.mergeSession(r.sessionId,{agent:r.agent,activeRunId:n,latestRunId:n,status:`active`})),r.type===`run.finalized`){let e=String(r.exitReason??`failed`),i=e===`completed`?`completed`:e===`aborted`||e===`interrupted`||e===`killed`?`aborted`:`failed`;t.getState().actions.mergeRun(n,{status:i,exitReason:e});let a=t.getState().runs.byId[n],o=typeof a?.sessionId==`string`?a.sessionId:null;o&&t.getState().actions.mergeSession(o,{status:`inactive`,activeRunId:null,latestRunId:n})}}if(n===`hook.request`&&t.getState().actions.addHookRequest({hookRequestId:String(e.hookRequestId),runId:String(e.runId),hookKind:String(e.hookKind),payload:e.payload??{},deadlineTs:Number(e.deadlineTs??0)}),n===`hook.resolved`){let n=Object.entries(t.getState().hooks.byRunId);for(let[r,i]of n)i.some(t=>t.hookRequestId===e.hookRequestId)&&t.getState().actions.resolveHookRequest(r,String(e.hookRequestId))}})];return()=>{for(let e of n)e()}}function ur({client:e,children:t}){let n=(0,b.useMemo)(()=>vn(e),[e]);return(0,b.useEffect)(()=>{n.getState().actions.setConnection(`connecting`);let t=lr(e,n);return e.connect().catch(e=>{n.getState().actions.setConnection(`disconnected`,e instanceof Error?e.message:String(e))}),()=>{t(),e.close()}},[e,n]),(0,K.jsx)(sr.Provider,{value:e,children:(0,K.jsx)(cr.Provider,{value:n,children:t})})}function dr(){let e=(0,b.useContext)(sr),t=(0,b.useContext)(cr);if(!e||!t)throw Error(`useGateway must be used inside a GatewayProvider`);return{client:e,store:t}}var fr=e=>e;function pr(e,t=fr){let n=b.useSyncExternalStore(e.subscribe,b.useCallback(()=>t(e.getState()),[e,t]),b.useCallback(()=>t(e.getInitialState()),[e,t]));return b.useDebugValue(n),n}function mr(){let{store:e}=dr();return pr(e,e=>e.connection)}function hr(){let{store:e}=dr();return pr(e,e=>e.agents.items)}var gr=e=>Symbol.iterator in e,_r=e=>`entries`in e,vr=(e,t)=>{let n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(let[e,t]of n)if(!r.has(e)||!Object.is(t,r.get(e)))return!1;return!0},yr=(e,t)=>{let n=e[Symbol.iterator](),r=t[Symbol.iterator](),i=n.next(),a=r.next();for(;!i.done&&!a.done;){if(!Object.is(i.value,a.value))return!1;i=n.next(),a=r.next()}return!!i.done&&!!a.done};function br(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?!1:gr(e)&&gr(t)?_r(e)&&_r(t)?vr(e,t):yr(e,t):vr({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}function xr(e){let t=b.useRef(void 0);return n=>{let r=e(n);return br(t.current,r)?t.current:t.current=r}}function Sr(e){let{store:t}=dr();return pr(t,t=>t.runs.byId[e]??null)}function Cr(){let{client:e}=dr();return async t=>await e.request({type:`run.stop`,runId:t})}function wr(e){let{store:t}=dr();return pr(t,xr(t=>bn(t,e)))}var Tr={colors:{background:`#f6f3ec`,surface:`#ffffff`,border:`#d8d0c5`,text:`#1d1a17`,mutedText:`#6c6258`,primary:`#0f766e`},spacing:{xs:4,sm:8,md:12,lg:16},radius:{sm:8,md:14}},Er=(0,b.createContext)(Tr);function Dr(e){return b.createElement(Er.Provider,{value:e.value},e.children)}function Or(){return(0,b.useContext)(Er)}var kr=e=>e.disabled||Array.isArray(e.accessibilityStates)&&e.accessibilityStates.indexOf(`disabled`)>-1,Ar={adjustable:`slider`,button:`button`,header:`heading`,image:`img`,imagebutton:null,keyboardkey:null,label:null,link:`link`,none:`presentation`,search:`search`,summary:`region`,text:null},jr=e=>{var t=e.accessibilityRole,n=e.role||t;if(n){var r=Ar[n];if(r!==null)return r||n}},Mr={article:`article`,banner:`header`,blockquote:`blockquote`,button:`button`,code:`code`,complementary:`aside`,contentinfo:`footer`,deletion:`del`,emphasis:`em`,figure:`figure`,insertion:`ins`,form:`form`,list:`ul`,listitem:`li`,main:`main`,navigation:`nav`,paragraph:`p`,region:`section`,strong:`strong`},Nr={},Pr={isDisabled:kr,propsToAccessibilityComponent:function(e){if(e===void 0&&(e=Nr),(e.role||e.accessibilityRole)===`label`)return`label`;var t=jr(e);if(t){if(t===`heading`){var n=e.accessibilityLevel||e[`aria-level`];return n==null?`h1`:`h`+n}return Mr[t]}},propsToAriaRole:jr};function Fr(e){"@babel/helpers - typeof";return Fr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Fr(e)}function Ir(e,t){if(Fr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Fr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Lr(e){var t=Ir(e,`string`);return Fr(t)==`symbol`?t:t+``}function Rr(e,t,n){return(t=Lr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zr(Object(n),!0).forEach(function(t){Rr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Hr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},Ur=[`ms`,`Moz`,`O`,`Webkit`],Wr=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(Hr).forEach(e=>{Ur.forEach(t=>{Hr[Wr(t,e)]=Hr[e]})});var Gr=e=>e===`currentcolor`||e===`currentColor`||e===`inherit`||e.indexOf(`var(`)===0,Kr=u(s(((e,t)=>{function n(e){if(typeof e==`number`)return e>>>0===e&&e>=0&&e<=4294967295?e:null;if(typeof e!=`string`)return null;let t=f(),n;return(n=t.hex6.exec(e))?parseInt(n[1]+`ff`,16)>>>0:_(e)??((n=t.rgb.exec(e))?(p(n[1])<<24|p(n[2])<<16|p(n[3])<<8|255)>>>0:(n=t.rgba.exec(e))?n[6]===void 0?(p(n[2])<<24|p(n[3])<<16|p(n[4])<<8|h(n[5]))>>>0:(p(n[6])<<24|p(n[7])<<16|p(n[8])<<8|h(n[9]))>>>0:(n=t.hex3.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+`ff`,16)>>>0:(n=t.hex8.exec(e))?parseInt(n[1],16)>>>0:(n=t.hex4.exec(e))?parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0:(n=t.hsl.exec(e))?(i(m(n[1]),g(n[2]),g(n[3]))|255)>>>0:(n=t.hsla.exec(e))?n[6]===void 0?(i(m(n[2]),g(n[3]),g(n[4]))|h(n[5]))>>>0:(i(m(n[6]),g(n[7]),g(n[8]))|h(n[9]))>>>0:(n=t.hwb.exec(e))?(a(m(n[1]),g(n[2]),g(n[3]))|255)>>>0:null)}function r(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function i(e,t,n){let i=n<.5?n*(1+t):n+t-n*t,a=2*n-i,o=r(a,i,e+1/3),s=r(a,i,e),c=r(a,i,e-1/3);return Math.round(o*255)<<24|Math.round(s*255)<<16|Math.round(c*255)<<8}function a(e,t,n){if(t+n>=1){let e=Math.round(t*255/(t+n));return e<<24|e<<16|e<<8}let i=r(0,1,e+1/3)*(1-t-n)+t,a=r(0,1,e)*(1-t-n)+t,o=r(0,1,e-1/3)*(1-t-n)+t;return Math.round(i*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}var o=`[-+]?\\d*\\.?\\d+`,s=o+`%`;function c(...e){return`\\(\\s*(`+e.join(`)\\s*,?\\s*(`)+`)\\s*\\)`}function l(...e){return`\\(\\s*(`+e.slice(0,e.length-1).join(`)\\s*,?\\s*(`)+`)\\s*/\\s*(`+e[e.length-1]+`)\\s*\\)`}function u(...e){return`\\(\\s*(`+e.join(`)\\s*,\\s*(`)+`)\\s*\\)`}var d;function f(){return d===void 0&&(d={rgb:RegExp(`rgb`+c(o,o,o)),rgba:RegExp(`rgba(`+u(o,o,o,o)+`|`+l(o,o,o,o)+`)`),hsl:RegExp(`hsl`+c(o,s,s)),hsla:RegExp(`hsla(`+u(o,s,s,o)+`|`+l(o,s,s,o)+`)`),hwb:RegExp(`hwb`+c(o,s,s)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),d}function p(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function m(e){return(parseFloat(e)%360+360)%360/360}function h(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function g(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function _(e){switch(e){case`transparent`:return 0;case`aliceblue`:return 4042850303;case`antiquewhite`:return 4209760255;case`aqua`:return 16777215;case`aquamarine`:return 2147472639;case`azure`:return 4043309055;case`beige`:return 4126530815;case`bisque`:return 4293182719;case`black`:return 255;case`blanchedalmond`:return 4293643775;case`blue`:return 65535;case`blueviolet`:return 2318131967;case`brown`:return 2771004159;case`burlywood`:return 3736635391;case`burntsienna`:return 3934150143;case`cadetblue`:return 1604231423;case`chartreuse`:return 2147418367;case`chocolate`:return 3530104575;case`coral`:return 4286533887;case`cornflowerblue`:return 1687547391;case`cornsilk`:return 4294499583;case`crimson`:return 3692313855;case`cyan`:return 16777215;case`darkblue`:return 35839;case`darkcyan`:return 9145343;case`darkgoldenrod`:return 3095792639;case`darkgray`:return 2846468607;case`darkgreen`:return 6553855;case`darkgrey`:return 2846468607;case`darkkhaki`:return 3182914559;case`darkmagenta`:return 2332068863;case`darkolivegreen`:return 1433087999;case`darkorange`:return 4287365375;case`darkorchid`:return 2570243327;case`darkred`:return 2332033279;case`darksalmon`:return 3918953215;case`darkseagreen`:return 2411499519;case`darkslateblue`:return 1211993087;case`darkslategray`:return 793726975;case`darkslategrey`:return 793726975;case`darkturquoise`:return 13554175;case`darkviolet`:return 2483082239;case`deeppink`:return 4279538687;case`deepskyblue`:return 12582911;case`dimgray`:return 1768516095;case`dimgrey`:return 1768516095;case`dodgerblue`:return 512819199;case`firebrick`:return 2988581631;case`floralwhite`:return 4294635775;case`forestgreen`:return 579543807;case`fuchsia`:return 4278255615;case`gainsboro`:return 3705462015;case`ghostwhite`:return 4177068031;case`gold`:return 4292280575;case`goldenrod`:return 3668254975;case`gray`:return 2155905279;case`green`:return 8388863;case`greenyellow`:return 2919182335;case`grey`:return 2155905279;case`honeydew`:return 4043305215;case`hotpink`:return 4285117695;case`indianred`:return 3445382399;case`indigo`:return 1258324735;case`ivory`:return 4294963455;case`khaki`:return 4041641215;case`lavender`:return 3873897215;case`lavenderblush`:return 4293981695;case`lawngreen`:return 2096890111;case`lemonchiffon`:return 4294626815;case`lightblue`:return 2916673279;case`lightcoral`:return 4034953471;case`lightcyan`:return 3774873599;case`lightgoldenrodyellow`:return 4210742015;case`lightgray`:return 3553874943;case`lightgreen`:return 2431553791;case`lightgrey`:return 3553874943;case`lightpink`:return 4290167295;case`lightsalmon`:return 4288707327;case`lightseagreen`:return 548580095;case`lightskyblue`:return 2278488831;case`lightslategray`:return 2005441023;case`lightslategrey`:return 2005441023;case`lightsteelblue`:return 2965692159;case`lightyellow`:return 4294959359;case`lime`:return 16711935;case`limegreen`:return 852308735;case`linen`:return 4210091775;case`magenta`:return 4278255615;case`maroon`:return 2147483903;case`mediumaquamarine`:return 1724754687;case`mediumblue`:return 52735;case`mediumorchid`:return 3126187007;case`mediumpurple`:return 2473647103;case`mediumseagreen`:return 1018393087;case`mediumslateblue`:return 2070474495;case`mediumspringgreen`:return 16423679;case`mediumturquoise`:return 1221709055;case`mediumvioletred`:return 3340076543;case`midnightblue`:return 421097727;case`mintcream`:return 4127193855;case`mistyrose`:return 4293190143;case`moccasin`:return 4293178879;case`navajowhite`:return 4292783615;case`navy`:return 33023;case`oldlace`:return 4260751103;case`olive`:return 2155872511;case`olivedrab`:return 1804477439;case`orange`:return 4289003775;case`orangered`:return 4282712319;case`orchid`:return 3664828159;case`palegoldenrod`:return 4008225535;case`palegreen`:return 2566625535;case`paleturquoise`:return 2951671551;case`palevioletred`:return 3681588223;case`papayawhip`:return 4293907967;case`peachpuff`:return 4292524543;case`peru`:return 3448061951;case`pink`:return 4290825215;case`plum`:return 3718307327;case`powderblue`:return 2967529215;case`purple`:return 2147516671;case`rebeccapurple`:return 1714657791;case`red`:return 4278190335;case`rosybrown`:return 3163525119;case`royalblue`:return 1097458175;case`saddlebrown`:return 2336560127;case`salmon`:return 4202722047;case`sandybrown`:return 4104413439;case`seagreen`:return 780883967;case`seashell`:return 4294307583;case`sienna`:return 2689740287;case`silver`:return 3233857791;case`skyblue`:return 2278484991;case`slateblue`:return 1784335871;case`slategray`:return 1887473919;case`slategrey`:return 1887473919;case`snow`:return 4294638335;case`springgreen`:return 16744447;case`steelblue`:return 1182971135;case`tan`:return 3535047935;case`teal`:return 8421631;case`thistle`:return 3636451583;case`tomato`:return 4284696575;case`turquoise`:return 1088475391;case`violet`:return 4001558271;case`wheat`:return 4125012991;case`white`:return 4294967295;case`whitesmoke`:return 4126537215;case`yellow`:return 4294902015;case`yellowgreen`:return 2597139199}return null}t.exports=n}))()),qr=e=>{if(e==null)return e;var t=(0,Kr.default)(e);if(t!=null)return t=(t<<24|t>>>8)>>>0,t},Jr=function(e,t){if(t===void 0&&(t=1),e!=null){if(typeof e==`string`&&Gr(e))return e;var n=qr(e);if(n!=null){var r=n>>16&255,i=n>>8&255,a=n&255,o=((n>>24&255)/255*t).toFixed(2);return`rgba(`+r+`,`+i+`,`+a+`,`+o+`)`}}},Yr={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0};function Xr(e,t){var n=e;return(t==null||!Hr[t])&&typeof e==`number`?n=e+`px`:t!=null&&Yr[t]&&(n=Jr(e)),n}var Zr=!!(typeof window<`u`&&window.document&&window.document.createElement),Qr={},$r=!Zr||window.CSS!=null&&window.CSS.supports!=null&&(window.CSS.supports(`text-decoration-line`,`none`)||window.CSS.supports(`-webkit-text-decoration-line`,`none`)),ei=`monospace,monospace`,ti=`-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif`,ni={borderColor:[`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`],borderBlockColor:[`borderTopColor`,`borderBottomColor`],borderInlineColor:[`borderRightColor`,`borderLeftColor`],borderRadius:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`],borderStyle:[`borderTopStyle`,`borderRightStyle`,`borderBottomStyle`,`borderLeftStyle`],borderBlockStyle:[`borderTopStyle`,`borderBottomStyle`],borderInlineStyle:[`borderRightStyle`,`borderLeftStyle`],borderWidth:[`borderTopWidth`,`borderRightWidth`,`borderBottomWidth`,`borderLeftWidth`],borderBlockWidth:[`borderTopWidth`,`borderBottomWidth`],borderInlineWidth:[`borderRightWidth`,`borderLeftWidth`],insetBlock:[`top`,`bottom`],insetInline:[`left`,`right`],marginBlock:[`marginTop`,`marginBottom`],marginInline:[`marginRight`,`marginLeft`],paddingBlock:[`paddingTop`,`paddingBottom`],paddingInline:[`paddingRight`,`paddingLeft`],overflow:[`overflowX`,`overflowY`],overscrollBehavior:[`overscrollBehaviorX`,`overscrollBehaviorY`],borderBlockStartColor:[`borderTopColor`],borderBlockStartStyle:[`borderTopStyle`],borderBlockStartWidth:[`borderTopWidth`],borderBlockEndColor:[`borderBottomColor`],borderBlockEndStyle:[`borderBottomStyle`],borderBlockEndWidth:[`borderBottomWidth`],borderEndStartRadius:[`borderBottomLeftRadius`],borderEndEndRadius:[`borderBottomRightRadius`],borderStartStartRadius:[`borderTopLeftRadius`],borderStartEndRadius:[`borderTopRightRadius`],insetBlockEnd:[`bottom`],insetBlockStart:[`top`],marginBlockStart:[`marginTop`],marginBlockEnd:[`marginBottom`],paddingBlockStart:[`paddingTop`],paddingBlockEnd:[`paddingBottom`]},ri=(e,t)=>{if(!e)return Qr;var n={},r=function(){var r=e[i];if(r==null)return`continue`;if(i===`backgroundClip`)r===`text`&&(n.backgroundClip=r,n.WebkitBackgroundClip=r);else if(i===`flex`)r===-1?(n.flexGrow=0,n.flexShrink=1,n.flexBasis=`auto`):n.flex=r;else if(i===`font`)n[i]=r.replace(`System`,ti);else if(i===`fontFamily`)if(r.indexOf(`System`)>-1){var a=r.split(/,\s*/);a[a.indexOf(`System`)]=ti,n[i]=a.join(`,`)}else r===`monospace`?n[i]=ei:n[i]=r;else if(i===`textDecorationLine`)$r?n.textDecorationLine=r:n.textDecoration=r;else if(i===`writingDirection`)n.direction=r;else{var o=Xr(e[i],i),s=ni[i];t&&i===`inset`?(e.insetInline??(n.left=o,n.right=o),e.insetBlock??(n.top=o,n.bottom=o)):t&&i===`margin`?(e.marginInline??(n.marginLeft=o,n.marginRight=o),e.marginBlock??(n.marginTop=o,n.marginBottom=o)):t&&i===`padding`?(e.paddingInline??(n.paddingLeft=o,n.paddingRight=o),e.paddingBlock??(n.paddingTop=o,n.paddingBottom=o)):s?s.forEach((t,r)=>{e[t]??(n[t]=o)}):n[i]=o}};for(var i in e)if(r()===`continue`)continue;return n};function ii(e,t){for(var n=e.length,r=t^n,i=0,a;n>=4;)a=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)^a,n-=4,++i;switch(n){case 3:r^=(e.charCodeAt(i+2)&255)<<16;case 2:r^=(e.charCodeAt(i+1)&255)<<8;case 1:r^=e.charCodeAt(i)&255,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16)}return r^=r>>>13,r=(r&65535)*1540483477+(((r>>>16)*1540483477&65535)<<16),r^=r>>>15,r>>>0}var ai=e=>ii(e,1).toString(36),oi=/[A-Z]/g,si=/^ms-/,ci={};function li(e){return`-`+e.toLowerCase()}function ui(e){if(e in ci)return ci[e];var t=e.replace(oi,li);return ci[e]=si.test(t)?`-`+t:t}var di=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(e){return e.charAt(0).toUpperCase()+e.slice(1)}})),fi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var t=n(di());function n(e){return e&&e.__esModule?e:{default:e}}function r(e,n,r){var i=e[n];if(i&&r.hasOwnProperty(n))for(var a=(0,t.default)(n),o=0;o<i.length;++o){var s=i[o]+a;r[s]||(r[s]=r[n])}return r}})),pi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(e,t,n,r,i){for(var a=0,o=e.length;a<o;++a){var s=e[a](t,n,r,i);if(s)return s}}})),mi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=n;function t(e,t){e.indexOf(t)===-1&&e.push(t)}function n(e,n){if(Array.isArray(n))for(var r=0,i=n.length;r<i;++r)t(e,n[r]);else t(e,n)}})),hi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(e){return e instanceof Object&&!Array.isArray(e)}})),gi=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=o;var t=a(fi()),n=a(pi()),r=a(mi()),i=a(hi());function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var a=e.prefixMap,o=e.plugins;return function e(s){for(var c in s){var l=s[c];if((0,i.default)(l))s[c]=e(l);else if(Array.isArray(l)){for(var u=[],d=0,f=l.length;d<f;++d){var p=(0,n.default)(o,c,l[d],s,a);(0,r.default)(u,p||l[d])}u.length>0&&(s[c]=u)}else{var m=(0,n.default)(o,c,l,s,a);m&&(s[c]=m),s=(0,t.default)(a,c,s)}}return s}}}));function _i(e){"@babel/helpers - typeof";return _i=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},_i(e)}function vi(e){return Si(e)||xi(e)||bi(e)||yi()}function yi(){throw TypeError(`Invalid attempt to spread non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bi(e,t){if(e){if(typeof e==`string`)return Ci(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ci(e,t)}}function xi(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function Si(e){if(Array.isArray(e))return Ci(e)}function Ci(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wi(e){return e.filter(function(t,n){return e.lastIndexOf(t)===n})}function Ti(e){for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;++t){var r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];for(var i in r){var a=r[i],o=e[i];if(o&&a){if(Array.isArray(o)){e[i]=wi(o.concat(a));continue}if(Array.isArray(a)){e[i]=wi([o].concat(vi(a)));continue}if(_i(a)===`object`){e[i]=Ti({},o,a);continue}}e[i]=a}}return e}var Ei=o((()=>{}));function Di(e){return e[1].toUpperCase()}function Oi(e){if(ji.hasOwnProperty(e))return ji[e];var t=e.replace(ki,Di).replace(Ai,`ms`);return ji[e]=t,t}var ki,Ai,ji,Mi=o((()=>{ki=/-([a-z])/g,Ai=/^Ms/g,ji={}})),Ni=c({default:()=>Fi});function Pi(e){return`-`+e.toLowerCase()}function Fi(e){if(Ri.hasOwnProperty(e))return Ri[e];var t=e.replace(Ii,Pi);return Ri[e]=Li.test(t)?`-`+t:t}var Ii,Li,Ri,zi=o((()=>{Ii=/[A-Z]/g,Li=/^ms-/,Ri={}}));function Bi(e){return Fi(e)}var Vi=o((()=>{zi()}));function Hi(e,t){return Bi(e)+`:`+t}var Ui=o((()=>{Vi()}));function Wi(e){var t=``;for(var n in e){var r=e[n];typeof r!=`string`&&typeof r!=`number`||(t&&(t+=`;`),t+=Hi(n,r))}return t}var Gi=o((()=>{Ui()}));function Ki(e){return qi.test(e)}var qi,Ji=o((()=>{qi=/^(Webkit|Moz|O|ms)/}));function Yi(e){return typeof e==`string`&&Xi.test(e)}var Xi,Zi=o((()=>{Xi=/-webkit-|-moz-|-ms-/}));function Qi(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}function $i(e){return ea.hasOwnProperty(e)}var ea,ta,na,ra,ia,aa,oa,sa,ca=o((()=>{for(Vi(),ea={borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ta=[`animationIterationCount`,`boxFlex`,`boxFlexGroup`,`boxOrdinalGroup`,`columnCount`,`flex`,`flexGrow`,`flexPositive`,`flexShrink`,`flexNegative`,`flexOrder`,`gridColumn`,`gridColumnEnd`,`gridColumnStart`,`gridRow`,`gridRowEnd`,`gridRowStart`,`lineClamp`,`order`],na=[`Webkit`,`ms`,`Moz`,`O`],ra=0,ia=ta.length;ra<ia;++ra)for(aa=ta[ra],ea[aa]=!0,oa=0,sa=na.length;oa<sa;++oa)ea[Qi(na[oa],aa)]=!0;for(var e in ea)ea[Bi(e)]=!0}));function la(e){var t=e.replace(ua,``);return t.charAt(0).toLowerCase()+t.slice(1)}var ua,da=o((()=>{ua=/^(ms|Webkit|Moz|O)/}));function fa(e){return la(Oi(e))}var pa=o((()=>{Mi(),da()}));function ma(e,t){return t.join(`;`+Bi(e)+`:`)}var ha=o((()=>{Vi()}));function ga(e){return typeof e==`string`?e.replace(_a,``):e}var _a,va=o((()=>{_a=/(-ms-|-webkit-|-moz-|-o-)/g})),ya=c({assignStyle:()=>Ti,camelCaseProperty:()=>Oi,cssifyDeclaration:()=>Hi,cssifyObject:()=>Wi,hyphenateProperty:()=>Bi,isPrefixedProperty:()=>Ki,isPrefixedValue:()=>Yi,isUnitlessProperty:()=>$i,normalizeProperty:()=>fa,resolveArrayValue:()=>ma,unprefixProperty:()=>la,unprefixValue:()=>ga}),ba=o((()=>{Ei(),Mi(),Ui(),Gi(),Vi(),Ji(),Zi(),ca(),pa(),ha(),da(),va()})),xa=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=i;var t=(ba(),d(ya)),n=/cross-fade\(/g,r=[`-webkit-`,``];function i(e,i){if(typeof i==`string`&&!(0,t.isPrefixedValue)(i)&&i.indexOf(`cross-fade(`)!==-1)return r.map(function(e){return i.replace(n,e+`cross-fade(`)})}})),Sa=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=n;var t=/-webkit-|-moz-|-ms-/;function n(e){return typeof e==`string`&&t.test(e)}})),Ca=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=i;var t=n(Sa());function n(e){return e&&e.__esModule?e:{default:e}}var r=[`-webkit-`,``];function i(e,n){if(typeof n==`string`&&!(0,t.default)(n)&&n.indexOf(`image-set(`)>-1)return r.map(function(e){return n.replace(/image-set\(/g,e+`image-set(`)})}})),wa=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=n;var t={marginBlockStart:[`WebkitMarginBefore`],marginBlockEnd:[`WebkitMarginAfter`],marginInlineStart:[`WebkitMarginStart`,`MozMarginStart`],marginInlineEnd:[`WebkitMarginEnd`,`MozMarginEnd`],paddingBlockStart:[`WebkitPaddingBefore`],paddingBlockEnd:[`WebkitPaddingAfter`],paddingInlineStart:[`WebkitPaddingStart`,`MozPaddingStart`],paddingInlineEnd:[`WebkitPaddingEnd`,`MozPaddingEnd`],borderBlockStart:[`WebkitBorderBefore`],borderBlockStartColor:[`WebkitBorderBeforeColor`],borderBlockStartStyle:[`WebkitBorderBeforeStyle`],borderBlockStartWidth:[`WebkitBorderBeforeWidth`],borderBlockEnd:[`WebkitBorderAfter`],borderBlockEndColor:[`WebkitBorderAfterColor`],borderBlockEndStyle:[`WebkitBorderAfterStyle`],borderBlockEndWidth:[`WebkitBorderAfterWidth`],borderInlineStart:[`WebkitBorderStart`,`MozBorderStart`],borderInlineStartColor:[`WebkitBorderStartColor`,`MozBorderStartColor`],borderInlineStartStyle:[`WebkitBorderStartStyle`,`MozBorderStartStyle`],borderInlineStartWidth:[`WebkitBorderStartWidth`,`MozBorderStartWidth`],borderInlineEnd:[`WebkitBorderEnd`,`MozBorderEnd`],borderInlineEndColor:[`WebkitBorderEndColor`,`MozBorderEndColor`],borderInlineEndStyle:[`WebkitBorderEndStyle`,`MozBorderEndStyle`],borderInlineEndWidth:[`WebkitBorderEndWidth`,`MozBorderEndWidth`]};function n(e,n,r){if(Object.prototype.hasOwnProperty.call(t,e))for(var i=t[e],a=0,o=i.length;a<o;++a)r[i[a]]=n}})),Ta=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=t;function t(e,t){if(e===`position`&&t===`sticky`)return[`-webkit-sticky`,`sticky`]}})),Ea=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=i;var t=[`-webkit-`,`-moz-`,``],n={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},r={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function i(e,i){if(n.hasOwnProperty(e)&&r.hasOwnProperty(i))return t.map(function(e){return e+i})}})),Da=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var t=n((zi(),d(Ni)));function n(e){return e&&e.__esModule?e:{default:e}}function r(e){return(0,t.default)(e)}})),Oa=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=c;var t=i(Da()),n=i(Sa()),r=i(di());function i(e){return e&&e.__esModule?e:{default:e}}var a={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},o={Webkit:`-webkit-`,Moz:`-moz-`,ms:`-ms-`};function s(e,r){if((0,n.default)(e))return e;for(var i=e.split(/,(?![^()]*(?:\([^()]*\))?\))/g),a=0,s=i.length;a<s;++a){var c=i[a],l=[c];for(var u in r){var d=(0,t.default)(u);if(c.indexOf(d)>-1&&d!==`order`)for(var f=r[u],p=0,m=f.length;p<m;++p)l.unshift(c.replace(d,o[f[p]]+d))}i[a]=l.join(`,`)}return i.join(`,`)}function c(e,t,n,i){if(typeof t==`string`&&a.hasOwnProperty(e)){var o=s(t,i),c=o.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-moz-|-ms-/.test(e)}).join(`,`);if(e.indexOf(`Webkit`)>-1)return c;var l=o.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(e){return!/-webkit-|-ms-/.test(e)}).join(`,`);return e.indexOf(`Moz`)>-1?l:(n[`Webkit`+(0,r.default)(e)]=c,n[`Moz`+(0,r.default)(e)]=l,o)}}})),ka=u(xa()),Aa=u(Ca()),ja=u(wa()),Ma=u(Ta()),Na=u(Ea()),Pa=u(Oa()),Fa=[`Webkit`],Ia=[`Moz`],La=[`Webkit`,`Moz`],Ra=[`Webkit`,`ms`],za={plugins:[ka.default,Aa.default,ja.default,Ma.default,Na.default,Pa.default],prefixMap:{appearance:[`Webkit`,`Moz`,`ms`],userSelect:La,textEmphasisPosition:Ra,textEmphasis:Ra,textEmphasisStyle:Ra,textEmphasisColor:Ra,boxDecorationBreak:Ra,clipPath:Fa,maskImage:Ra,maskMode:Ra,maskRepeat:Ra,maskPosition:Ra,maskClip:Ra,maskOrigin:Ra,maskSize:Ra,maskComposite:Ra,mask:Ra,maskBorderSource:Ra,maskBorderMode:Ra,maskBorderSlice:Ra,maskBorderWidth:Ra,maskBorderOutset:Ra,maskBorderRepeat:Ra,maskBorder:Ra,maskType:Ra,textDecorationStyle:Fa,textDecorationSkip:Fa,textDecorationLine:Fa,textDecorationColor:Fa,filter:Fa,breakAfter:Fa,breakBefore:Fa,breakInside:Fa,columnCount:Fa,columnFill:Fa,columnGap:Fa,columnRule:Fa,columnRuleColor:Fa,columnRuleStyle:Fa,columnRuleWidth:Fa,columns:Fa,columnSpan:Fa,columnWidth:Fa,backdropFilter:Fa,hyphens:Fa,flowInto:Fa,flowFrom:Fa,regionFragment:Fa,textOrientation:Fa,tabSize:Ia,fontKerning:Fa,textSizeAdjust:Fa}},Ba=(0,u(gi()).default)(za),Va=[`animationKeyframes`],Ha=new Map,Ua={},Wa=1,Ga=3,Ka={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},qa=`borderTopLeftRadius`,Ja=`borderTopRightRadius`,Ya=`borderBottomLeftRadius`,Xa=`borderBottomRightRadius`,Za=`borderLeftColor`,Qa=`borderLeftStyle`,$a=`borderLeftWidth`,eo=`borderRightColor`,to=`borderRightStyle`,no=`borderRightWidth`,X=`right`,ro=`marginLeft`,io=`marginRight`,ao=`paddingLeft`,oo=`paddingRight`,so=`left`,co={[qa]:Ja,[Ja]:qa,[Ya]:Xa,[Xa]:Ya,[Za]:eo,[Qa]:to,[$a]:no,[eo]:Za,[to]:Qa,[no]:$a,[so]:X,[ro]:io,[io]:ro,[ao]:oo,[oo]:ao,[X]:so},lo={borderStartStartRadius:qa,borderStartEndRadius:Ja,borderEndStartRadius:Ya,borderEndEndRadius:Xa,borderInlineStartColor:Za,borderInlineStartStyle:Qa,borderInlineStartWidth:$a,borderInlineEndColor:eo,borderInlineEndStyle:to,borderInlineEndWidth:no,insetInlineEnd:X,insetInlineStart:so,marginInlineStart:ro,marginInlineEnd:io,paddingInlineStart:ao,paddingInlineEnd:oo},uo=[`clear`,`float`,`textAlign`];function fo(e){var t={$$css:!0},n=[];function r(e,t,r){var i=ho(r,t),a=t+i,o=Ha.get(a),s;if(o!=null)s=o[0],n.push(o[1]);else{s=vo(`r`,e,e===t?i:a);var c=Ka[e]||Ga,l=[go(s,t,r),c];n.push(l),Ha.set(a,[s,l])}return s}return Object.keys(e).sort().forEach(n=>{var i=e[n];if(i!=null){var a;if(uo.indexOf(n)>-1){var o=r(n,n,`left`),s=r(n,n,`right`);i===`start`?a=[o,s]:i===`end`&&(a=[s,o])}var c=lo[n];if(c!=null&&(a=[r(n,c,i),r(n,co[c],i)]),n===`transitionProperty`){for(var l=Array.isArray(i)?i:[i],u=[],d=0;d<l.length;d++){var f=l[d];typeof f==`string`&&lo[f]!=null&&u.push(d)}if(u.length>0){var p=[...l],m=[...l];u.forEach(e=>{var t=p[e];if(typeof t==`string`){var i=lo[t],o=co[i];p[e]=i,m[e]=o,a=[r(n,n,p),r(n,n,m)]}})}}a==null?a=r(n,n,i):t.$$css$localize=!0,t[n]=a}}),[t,n]}function po(e,t){var n={$$css:!0},r=[],i=e.animationKeyframes,a=Vr(e,Va),o=vo(`css`,t,JSON.stringify(e)),s=`.`+o,c;if(i!=null){var l=bo(i),u=l[0],d=l[1];c=u.join(`,`),r.push(...d)}var f=_o(Br(Br({},a),{},{animationName:c}));return r.push(``+s+f),n[o]=o,[n,[[r,Wa]]]}function mo(e,t){var n=e||Ua,r={},i={},a=function(){var e=n[o],a=o,s=e;if(!Object.prototype.hasOwnProperty.call(n,o)||e==null)return`continue`;uo.indexOf(o)>-1&&(e===`start`?s=t?`right`:`left`:e===`end`&&(s=t?`left`:`right`));var c=lo[o];if(c!=null&&(a=t?co[c]:c),o===`transitionProperty`){var l=Array.isArray(e)?e:[e];l.forEach((e,n)=>{if(typeof e==`string`){var r=lo[e];r!=null&&(l[n]=t?co[r]:r,s=l.join(` `))}})}r[a]||(i[a]=s),a===o&&(r[a]=!0)};for(var o in n)if(a()===`continue`)continue;return ri(i,!0)}function ho(e,t){var n=Xr(e,t);return typeof n==`string`?n:JSON.stringify(n||``)}function go(e,t,n){var r=[],i=`.`+e;switch(t){case`animationKeyframes`:var a=bo(n),o=a[0],s=a[1],c=_o({animationName:o.join(`,`)});r.push(``+i+c,...s);break;case`placeholderTextColor`:var l=_o({color:n,opacity:1});r.push(i+`::-webkit-input-placeholder`+l,i+`::-moz-placeholder`+l,i+`:-ms-input-placeholder`+l,i+`::placeholder`+l);break;case`pointerEvents`:var u=n;if(n===`auto`)u=`auto!important`;else if(n===`none`){u=`none!important`;var d=_o({pointerEvents:`none`});r.push(i+`>* `+d)}else if(n===`box-none`){u=`none!important`;var f=_o({pointerEvents:`auto`});r.push(i+`>* `+f)}else if(n===`box-only`){u=`auto!important`;var p=_o({pointerEvents:`none`});r.push(i+`>* `+p)}var m=_o({pointerEvents:u});r.push(``+i+m);break;case`scrollbarWidth`:n===`none`&&r.push(i+`::-webkit-scrollbar{display:none}`);var h=_o({scrollbarWidth:n});r.push(``+i+h);break;default:var g=_o({[t]:n});r.push(``+i+g);break}return r}function _o(e){var t=Ba(ri(e));return`{`+Object.keys(t).map(e=>{var n=t[e],r=ui(e);return Array.isArray(n)?n.map(e=>r+`:`+e).join(`;`):r+`:`+n}).sort().join(`;`)+`;}`}function vo(e,t,n){var r=ai(t+n);return e+`-`+r}function yo(e){var t=[`-webkit-`,``],n=vo(`r`,`animation`,JSON.stringify(e)),r=`{`+Object.keys(e).map(t=>{var n=e[t],r=_o(n);return``+t+r}).join(``)+`}`;return[n,t.map(e=>`@`+e+`keyframes `+n+r)]}function bo(e){if(typeof e==`number`)throw Error(`Invalid CSS keyframes type: `+typeof e);var t=[],n=[];return(Array.isArray(e)?e:[e]).forEach(e=>{if(typeof e==`string`)t.push(e);else{var r=yo(e),i=r[0],a=r[1];t.push(i),n.push(...a)}}),[t,n]}function xo(e,t,n){if(Zr){var r=t??document,i=r.getElementById(e);if(i==null)if(i=document.createElement(`style`),i.setAttribute(`id`,e),typeof n==`string`&&i.appendChild(document.createTextNode(n)),r instanceof ShadowRoot)r.insertBefore(i,r.firstChild);else{var a=r.head;a&&a.insertBefore(i,a.firstChild)}return i.sheet}else return null}var So=Array.prototype.slice;function Co(e){var t={},n={};if(e!=null){var r;So.call(e.cssRules).forEach((e,i)=>{var a=e.cssText;if(a.indexOf(`stylesheet-group`)>-1)r=Eo(e),t[r]={start:i,rules:[a]};else{var o=ko(a);o!=null&&(n[o]=!0,t[r].rules.push(a))}})}function i(e,n,r){var i=Do(t),a=i.indexOf(n)+1,o=i[a],s=o!=null&&t[o].start!=null?t[o].start:e.cssRules.length,c=Ao(e,r,s);if(c){t[n].start??(t[n].start=s);for(var l=a;l<i.length;l+=1){var u=i[l],d=t[u].start||0;t[u].start=d+1}}return c}return{getTextContent(){return Do(t).map(e=>{var n=t[e].rules,r=n.shift();return n.sort(),n.unshift(r),n.join(`
15
+ `)}).join(`
16
+ `)},insert(r,a){var o=Number(a);if(t[o]==null){var s=wo(o);t[o]={start:null,rules:[s]},e!=null&&i(e,o,s)}var c=ko(r);c!=null&&n[c]==null&&(n[c]=!0,t[o].rules.push(r),e!=null&&(i(e,o,r)||t[o].rules.pop()))}}}function wo(e){return`[stylesheet-group="`+e+`"]{}`}var To=/["']/g;function Eo(e){return Number(e.selectorText.split(To)[1])}function Do(e){return Object.keys(e).map(Number).sort((e,t)=>e>t?1:-1)}var Oo=/\s*([,])\s*/g;function ko(e){var t=e.split(`{`)[0].trim();return t===``?null:t.replace(Oo,`$1`)}function Ao(e,t,n){try{return e.insertRule(t,n),!0}catch{return!1}}var jo=`react-native-stylesheet`,Mo=new WeakMap,No=[],Po=[`html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}`,`body{margin:0;}`,`button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}`,`input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}`];function Fo(e,t){t===void 0&&(t=jo);var n;if(Zr){var r=e==null?document:e.getRootNode();if(No.length===0)n=Co(xo(t)),Po.forEach(e=>{n.insert(e,0)}),Mo.set(r,No.length),No.push(n);else{var i=Mo.get(r);if(i==null){var a=No[0],o=a==null?``:a.getTextContent();n=Co(xo(t,r,o)),Mo.set(r,No.length),No.push(n)}else n=No[i]}}else No.length===0?(n=Co(xo(t)),Po.forEach(e=>{n.insert(e,0)}),No.push(n)):n=No[0];return{getTextContent(){return n.getTextContent()},id:t,insert(e,t){No.forEach(n=>{n.insert(e,t)})}}}var Io=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.localizeStyle=i;var t=new WeakMap,n=`$$css$localize`;function r(e,t){var r={};for(var i in e)if(i!==n){var a=e[i];Array.isArray(a)?r[i]=t?a[1]:a[0]:r[i]=a}return r}function i(e,i){if(e[n]!=null){var a=+!!i;if(t.has(e)){var o=t.get(e),s=o[a];return s??(s=r(e,i),o[a]=s,t.set(e,o)),s}var c=r(e,i),l=[,,];return l[a]=c,t.set(e,l),c}return e}})),Lo=s(((e,t)=>{t.exports=Io()})),Ro={},zo={height:0,width:0},Bo=e=>{var t=e.shadowColor,n=e.shadowOffset,r=e.shadowOpacity,i=e.shadowRadius,a=n||zo,o=a.height,s=a.width,c=Xr(s),l=Xr(o),u=Xr(i||0),d=Jr(t||`black`,r);if(d!=null&&c!=null&&l!=null&&u!=null)return c+` `+l+` `+u+` `+d},Vo=e=>{var t=e.textShadowColor,n=e.textShadowOffset,r=e.textShadowRadius,i=n||zo,a=i.height,o=i.width,s=r||0,c=Xr(o),l=Xr(a),u=Xr(s),d=Xr(t,`textShadowColor`);if(d&&(a!==0||o!==0||s!==0)&&c!=null&&l!=null&&u!=null)return c+` `+l+` `+u+` `+d},Ho=e=>{if(typeof e==`string`)return e;var t=Xr(e.offsetX)||0,n=Xr(e.offsetY)||0,r=Xr(e.blurRadius)||0,i=Xr(e.spreadDistance)||0,a=Jr(e.color)||`black`;return(e.inset?`inset `:``)+t+` `+n+` `+r+` `+i+` `+a},Uo=e=>e.map(Ho).join(`, `),Wo=e=>{var t=Object.keys(e)[0],n=e[t];if(t===`matrix`||t===`matrix3d`)return t+`(`+n.join(`,`)+`)`;var r=Xr(n,t);return t+`(`+r+`)`},Go=e=>e.map(Wo).join(` `),Ko=e=>e.map(e=>Xr(e)).join(` `),qo={borderBottomEndRadius:`borderEndEndRadius`,borderBottomStartRadius:`borderEndStartRadius`,borderTopEndRadius:`borderStartEndRadius`,borderTopStartRadius:`borderStartStartRadius`,borderEndColor:`borderInlineEndColor`,borderEndStyle:`borderInlineEndStyle`,borderEndWidth:`borderInlineEndWidth`,borderStartColor:`borderInlineStartColor`,borderStartStyle:`borderInlineStartStyle`,borderStartWidth:`borderInlineStartWidth`,end:`insetInlineEnd`,marginEnd:`marginInlineEnd`,marginHorizontal:`marginInline`,marginStart:`marginInlineStart`,marginVertical:`marginBlock`,paddingEnd:`paddingInlineEnd`,paddingHorizontal:`paddingInline`,paddingStart:`paddingInlineStart`,paddingVertical:`paddingBlock`,start:`insetInlineStart`},Jo={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},Yo=function(e,t){t===void 0&&(t={});var n=e||Ro,r={};if(t.shadow,n.shadowColor!=null||n.shadowOffset!=null||n.shadowOpacity!=null||n.shadowRadius!=null){var i=Bo(n);i!=null&&(r.boxShadow=i)}if(t.textShadow,n.textShadowColor!=null||n.textShadowOffset!=null||n.textShadowRadius!=null){var a=Vo(n);if(a!=null&&r.textShadow==null){var o=n.textShadow;r.textShadow=o?o+`, `+a:a}}for(var s in n)if(!(Jo[s]!=null||s===`shadowColor`||s===`shadowOffset`||s===`shadowOpacity`||s===`shadowRadius`||s===`textShadowColor`||s===`textShadowOffset`||s===`textShadowRadius`)){var c=n[s],l=qo[s]||s,u=c;if(!(!Object.prototype.hasOwnProperty.call(n,s)||l!==s&&n[l]!=null))if(l===`aspectRatio`&&typeof u==`number`)r[l]=u.toString();else if(l===`boxShadow`){Array.isArray(u)&&(u=Uo(u));var d=r.boxShadow;r.boxShadow=d?u+`, `+d:u}else l===`fontVariant`?(Array.isArray(u)&&u.length>0&&(u=u.join(` `)),r[l]=u):l===`textAlignVertical`?n.verticalAlign??(r.verticalAlign=u===`center`?`middle`:u):l===`transform`?(Array.isArray(u)&&(u=Go(u)),r.transform=u):l===`transformOrigin`?(Array.isArray(u)&&(u=Ko(u)),r.transformOrigin=u):r[l]=u}return r},Xo=s((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.styleq=void 0;var t=new WeakMap,n=`$$css`;function r(e){var r,i,a;return e!=null&&(r=e.disableCache===!0,i=e.disableMix===!0,a=e.transform),function(){for(var e=[],o=``,s=null,c=r?null:t,l=Array(arguments.length),u=0;u<arguments.length;u++)l[u]=arguments[u];for(;l.length>0;){var d=l.pop();if(!(d==null||d===!1)){if(Array.isArray(d)){for(var f=0;f<d.length;f++)l.push(d[f]);continue}var p=a==null?d:a(d);if(p.$$css){var m=``;if(c!=null&&c.has(p)){var h=c.get(p);h!=null&&(m=h[0],e.push.apply(e,h[1]),c=h[2])}else{var g=[];for(var _ in p){var v=p[_];_!==n&&(typeof v==`string`||v===null?e.includes(_)||(e.push(_),c!=null&&g.push(_),typeof v==`string`&&(m+=m?` `+v:v)):console.error(`styleq: ${_} typeof ${String(v)} is not "string" or "null".`))}if(c!=null){var y=new WeakMap;c.set(p,[m,g,y]),c=y}}m&&(o=o?m+` `+o:m)}else if(i)s??={},s=Object.assign({},p,s);else{var b=null;for(var x in p){var S=p[x];S!==void 0&&(e.includes(x)||(S!=null&&(s??={},b??={},b[x]=S),e.push(x),c=null))}b!=null&&(s=Object.assign(b,s))}}}return[o,s]}}var i=r();e.styleq=i,i.factory=r})),Zo=Lo(),Qo=Xo(),$o=[`writingDirection`],es=new WeakMap,ts=Fo(),ns={shadow:!0,textShadow:!0};function rs(e,t){t===void 0&&(t={});var n=t,r=n.writingDirection,i=Vr(n,$o),a=r===`rtl`;return Qo.styleq.factory({transform(e){var t=es.get(e);return t==null?Yo(e,Br(Br({},ns),i)):(0,Zo.localizeStyle)(t,a)}})(e)}function is(e){e.forEach(e=>{var t=e[0],n=e[1];ts!=null&&t.forEach(e=>{ts.insert(e,n)})})}function as(e){var t=fo(Yo(e,ns)),n=t[0],r=t[1];return is(r),n}function os(e,t){var n=po(e,t),r=n[0],i=n[1];return is(i),r}var ss={position:`absolute`,left:0,right:0,top:0,bottom:0},cs=ls({x:Br({},ss)}).x;function ls(e){return Object.keys(e).forEach(t=>{var n=e[t];if(n!=null&&n.$$css!==!0){var r=t.indexOf(`$raw`)>-1?os(n,t.split(`$raw`)[0]):as(n);es.set(n,r)}}),e}function us(e,t){return[e,t]}function ds(){for(var e=[...arguments].flat(1/0),t={},n=0;n<e.length;n++){var r=e[n];typeof r==`object`&&r&&Object.assign(t,r)}return t}function fs(){return{id:ts.id,textContent:ts.getTextContent()}}function ps(e,t){t===void 0&&(t={});var n=t.writingDirection===`rtl`,r=rs(e,t);return Array.isArray(r)&&r[1]!=null&&(r[1]=mo(r[1],n)),r}ps.absoluteFill=cs,ps.absoluteFillObject=ss,ps.create=ls,ps.compose=us,ps.flatten=ds,ps.getSheet=fs,ps.hairlineWidth=1,Zr&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=ps.flatten);var ms=ps,hs=`aria-activedescendant.accessibilityActiveDescendant.aria-atomic.accessibilityAtomic.aria-autocomplete.accessibilityAutoComplete.aria-busy.accessibilityBusy.aria-checked.accessibilityChecked.aria-colcount.accessibilityColumnCount.aria-colindex.accessibilityColumnIndex.aria-colspan.accessibilityColumnSpan.aria-controls.accessibilityControls.aria-current.accessibilityCurrent.aria-describedby.accessibilityDescribedBy.aria-details.accessibilityDetails.aria-disabled.accessibilityDisabled.aria-errormessage.accessibilityErrorMessage.aria-expanded.accessibilityExpanded.aria-flowto.accessibilityFlowTo.aria-haspopup.accessibilityHasPopup.aria-hidden.accessibilityHidden.aria-invalid.accessibilityInvalid.aria-keyshortcuts.accessibilityKeyShortcuts.aria-label.accessibilityLabel.aria-labelledby.accessibilityLabelledBy.aria-level.accessibilityLevel.aria-live.accessibilityLiveRegion.aria-modal.accessibilityModal.aria-multiline.accessibilityMultiline.aria-multiselectable.accessibilityMultiSelectable.aria-orientation.accessibilityOrientation.aria-owns.accessibilityOwns.aria-placeholder.accessibilityPlaceholder.aria-posinset.accessibilityPosInSet.aria-pressed.accessibilityPressed.aria-readonly.accessibilityReadOnly.aria-required.accessibilityRequired.role.accessibilityRole.aria-roledescription.accessibilityRoleDescription.aria-rowcount.accessibilityRowCount.aria-rowindex.accessibilityRowIndex.aria-rowspan.accessibilityRowSpan.aria-selected.accessibilitySelected.aria-setsize.accessibilitySetSize.aria-sort.accessibilitySort.aria-valuemax.accessibilityValueMax.aria-valuemin.accessibilityValueMin.aria-valuenow.accessibilityValueNow.aria-valuetext.accessibilityValueText.dataSet.focusable.id.nativeID.pointerEvents.style.tabIndex.testID`.split(`.`),gs={},_s=Object.prototype.hasOwnProperty,vs=Array.isArray,ys=/[A-Z]/g;function bs(e){return`-`+e.toLowerCase()}function xs(e){return e.replace(ys,bs)}function Ss(e){return vs(e)?e.join(` `):e}var Cs=ms.create({auto:{pointerEvents:`auto`},"box-none":{pointerEvents:`box-none`},"box-only":{pointerEvents:`box-only`},none:{pointerEvents:`none`}}),ws=(e,t,n)=>{t||=gs;var r=t,i=r[`aria-activedescendant`],a=r.accessibilityActiveDescendant,o=r[`aria-atomic`],s=r.accessibilityAtomic,c=r[`aria-autocomplete`],l=r.accessibilityAutoComplete,u=r[`aria-busy`],d=r.accessibilityBusy,f=r[`aria-checked`],p=r.accessibilityChecked,m=r[`aria-colcount`],h=r.accessibilityColumnCount,g=r[`aria-colindex`],_=r.accessibilityColumnIndex,v=r[`aria-colspan`],y=r.accessibilityColumnSpan,b=r[`aria-controls`],x=r.accessibilityControls,S=r[`aria-current`],C=r.accessibilityCurrent,w=r[`aria-describedby`],T=r.accessibilityDescribedBy,E=r[`aria-details`],D=r.accessibilityDetails,O=r[`aria-disabled`],k=r.accessibilityDisabled,A=r[`aria-errormessage`],j=r.accessibilityErrorMessage,M=r[`aria-expanded`],N=r.accessibilityExpanded,P=r[`aria-flowto`],ee=r.accessibilityFlowTo,F=r[`aria-haspopup`],I=r.accessibilityHasPopup,te=r[`aria-hidden`],ne=r.accessibilityHidden,re=r[`aria-invalid`],ie=r.accessibilityInvalid,L=r[`aria-keyshortcuts`],R=r.accessibilityKeyShortcuts,ae=r[`aria-label`],oe=r.accessibilityLabel,se=r[`aria-labelledby`],ce=r.accessibilityLabelledBy,le=r[`aria-level`],ue=r.accessibilityLevel,z=r[`aria-live`],de=r.accessibilityLiveRegion,fe=r[`aria-modal`],pe=r.accessibilityModal,me=r[`aria-multiline`],he=r.accessibilityMultiline,ge=r[`aria-multiselectable`],_e=r.accessibilityMultiSelectable,ve=r[`aria-orientation`],ye=r.accessibilityOrientation,be=r[`aria-owns`],xe=r.accessibilityOwns,Se=r[`aria-placeholder`],Ce=r.accessibilityPlaceholder,B=r[`aria-posinset`],we=r.accessibilityPosInSet,Te=r[`aria-pressed`],Ee=r.accessibilityPressed,V=r[`aria-readonly`],De=r.accessibilityReadOnly,Oe=r[`aria-required`],ke=r.accessibilityRequired;r.role,r.accessibilityRole;var Ae=r[`aria-roledescription`],je=r.accessibilityRoleDescription,Me=r[`aria-rowcount`],Ne=r.accessibilityRowCount,Pe=r[`aria-rowindex`],Fe=r.accessibilityRowIndex,Ie=r[`aria-rowspan`],Le=r.accessibilityRowSpan,Re=r[`aria-selected`],ze=r.accessibilitySelected,Be=r[`aria-setsize`],Ve=r.accessibilitySetSize,He=r[`aria-sort`],Ue=r.accessibilitySort,We=r[`aria-valuemax`],Ge=r.accessibilityValueMax,Ke=r[`aria-valuemin`],qe=r.accessibilityValueMin,Je=r[`aria-valuenow`],Ye=r.accessibilityValueNow,Xe=r[`aria-valuetext`],H=r.accessibilityValueText,Ze=r.dataSet,Qe=r.focusable,$e=r.id,et=r.nativeID,tt=r.pointerEvents,nt=r.style,rt=r.tabIndex,it=r.testID,U=Vr(r,hs),at=O||k,ot=Pr.propsToAriaRole(t),st=i??a;st!=null&&(U[`aria-activedescendant`]=st);var ct=o==null?s:i;ct!=null&&(U[`aria-atomic`]=ct);var lt=c??l;lt!=null&&(U[`aria-autocomplete`]=lt);var ut=u??d;ut!=null&&(U[`aria-busy`]=ut);var W=f??p;W!=null&&(U[`aria-checked`]=W);var dt=m??h;dt!=null&&(U[`aria-colcount`]=dt);var ft=g??_;ft!=null&&(U[`aria-colindex`]=ft);var pt=v??y;pt!=null&&(U[`aria-colspan`]=pt);var mt=b??x;mt!=null&&(U[`aria-controls`]=Ss(mt));var ht=S??C;ht!=null&&(U[`aria-current`]=ht);var gt=w??T;gt!=null&&(U[`aria-describedby`]=Ss(gt));var _t=E??D;_t!=null&&(U[`aria-details`]=_t),at===!0&&(U[`aria-disabled`]=!0,(e===`button`||e===`form`||e===`input`||e===`select`||e===`textarea`)&&(U.disabled=!0));var vt=A??j;vt!=null&&(U[`aria-errormessage`]=vt);var yt=M??N;yt!=null&&(U[`aria-expanded`]=yt);var bt=P??ee;bt!=null&&(U[`aria-flowto`]=Ss(bt));var xt=F??I;xt!=null&&(U[`aria-haspopup`]=xt);var St=te??ne;St===!0&&(U[`aria-hidden`]=St);var Ct=re??ie;Ct!=null&&(U[`aria-invalid`]=Ct);var wt=L??R;wt!=null&&(U[`aria-keyshortcuts`]=Ss(wt));var Tt=ae??oe;Tt!=null&&(U[`aria-label`]=Tt);var Et=se??ce;Et!=null&&(U[`aria-labelledby`]=Ss(Et));var Dt=le??ue;Dt!=null&&(U[`aria-level`]=Dt);var Ot=z??de;Ot!=null&&(U[`aria-live`]=Ot===`none`?`off`:Ot);var G=fe??pe;G!=null&&(U[`aria-modal`]=G);var kt=me??he;kt!=null&&(U[`aria-multiline`]=kt);var At=ge??_e;At!=null&&(U[`aria-multiselectable`]=At);var jt=ve??ye;jt!=null&&(U[`aria-orientation`]=jt);var Mt=be??xe;Mt!=null&&(U[`aria-owns`]=Ss(Mt));var Nt=Se??Ce;Nt!=null&&(U[`aria-placeholder`]=Nt);var Pt=B??we;Pt!=null&&(U[`aria-posinset`]=Pt);var Ft=Te??Ee;Ft!=null&&(U[`aria-pressed`]=Ft);var It=V??De;It!=null&&(U[`aria-readonly`]=It,(e===`input`||e===`select`||e===`textarea`)&&(U.readOnly=!0));var K=Oe??ke;K!=null&&(U[`aria-required`]=K,(e===`input`||e===`select`||e===`textarea`)&&(U.required=ke)),ot!=null&&(U.role=ot===`none`?`presentation`:ot);var q=Ae??je;q!=null&&(U[`aria-roledescription`]=q);var Lt=Me??Ne;Lt!=null&&(U[`aria-rowcount`]=Lt);var Rt=Pe??Fe;Rt!=null&&(U[`aria-rowindex`]=Rt);var zt=Ie??Le;zt!=null&&(U[`aria-rowspan`]=zt);var Bt=Re??ze;Bt!=null&&(U[`aria-selected`]=Bt);var Vt=Be??Ve;Vt!=null&&(U[`aria-setsize`]=Vt);var Ht=He??Ue;Ht!=null&&(U[`aria-sort`]=Ht);var Ut=We??Ge;Ut!=null&&(U[`aria-valuemax`]=Ut);var J=Ke??qe;J!=null&&(U[`aria-valuemin`]=J);var Wt=Je??Ye;Wt!=null&&(U[`aria-valuenow`]=Wt);var Gt=Xe??H;if(Gt!=null&&(U[`aria-valuetext`]=Gt),Ze!=null){for(var Kt in Ze)if(_s.call(Ze,Kt)){var qt=xs(Kt),Jt=Ze[Kt];Jt!=null&&(U[`data-`+qt]=Jt)}}rt===0||rt===`0`||rt===-1||rt===`-1`?U.tabIndex=rt:(Qe===!1&&(U.tabIndex=`-1`),e===`a`||e===`button`||e===`input`||e===`select`||e===`textarea`?(Qe===!1||k===!0)&&(U.tabIndex=`-1`):ot===`button`||ot===`checkbox`||ot===`link`||ot===`radio`||ot===`textbox`||ot===`switch`?Qe!==!1&&(U.tabIndex=`0`):Qe===!0&&(U.tabIndex=`0`));var Yt=ms([nt,tt&&Cs[tt]],Br({writingDirection:`ltr`},n)),Xt=Yt[0],Zt=Yt[1];Xt&&(U.className=Xt),Zt&&(U.style=Zt);var Qt=$e??et;return Qt!=null&&(U.id=Qt),it!=null&&(U[`data-testid`]=it),U.type==null&&e===`button`&&(U.type=`button`),U},Ts=new Set([`Arab`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),Es=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`far`,`glk`,`he`,`iw`,`khw`,`ks`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]),Ds=new Map;function Os(e){var t=Ds.get(e);if(t)return t;var n=!1;if(Intl.Locale)try{var r=new Intl.Locale(e).maximize().script;n=Ts.has(r)}catch{var i=e.split(`-`)[0];n=Es.has(i)}else{var a=e.split(`-`)[0];n=Es.has(a)}return Ds.set(e,n),n}var ks=(0,b.createContext)({direction:`ltr`,locale:`en-US`});function As(e){return Os(e)?`rtl`:`ltr`}function js(e){var t=e.direction,n=e.locale,r=e.children;return t||n?b.createElement(ks.Provider,{children:r,value:{direction:n?As(n):t,locale:n}}):r}function Ms(){return(0,b.useContext)(ks)}var Ns=(e,t,n)=>{var r;e&&e.constructor===String&&(r=Pr.propsToAccessibilityComponent(t));var i=r||e,a=ws(i,t,n),o=b.createElement(i,a);return a.dir?b.createElement(js,{children:o,direction:a.dir,locale:a.lang}):o},Ps=e=>{if(e!=null&&e.nodeType===1&&typeof e.getBoundingClientRect==`function`)return e.getBoundingClientRect()},Fs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},Is=[`ms`,`Moz`,`O`,`Webkit`],Ls=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(Fs).forEach(e=>{Is.forEach(t=>{Fs[Ls(t,e)]=Fs[e]})});function Rs(e,t,n){return t==null||typeof t==`boolean`||t===``?``:!n&&typeof t==`number`&&t!==0&&!(Fs.hasOwnProperty(e)&&Fs[e])?t+`px`:(``+t).trim()}function zs(e,t){var n=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf(`--`)===0,a=Rs(r,t[r],i);r===`float`&&(r=`cssFloat`),i?n.setProperty(r,a):n[r]=a}}var Bs=e=>{var t=e.offsetHeight,n=e.offsetWidth,r=e.offsetLeft,i=e.offsetTop;for(e=e.offsetParent;e&&e.nodeType===1;)r+=e.offsetLeft+e.clientLeft-e.scrollLeft,i+=e.offsetTop+e.clientTop-e.scrollTop,e=e.offsetParent;return i-=window.scrollY,r-=window.scrollX,{width:n,height:t,top:i,left:r}},Vs=(e,t,n)=>{var r=t||e&&e.parentNode;e&&r&&setTimeout(()=>{if(e.isConnected&&r.isConnected){var t=Bs(r),i=Bs(e),a=i.height,o=i.left,s=i.top,c=i.width;n(o-t.left,s-t.top,c,a,o,s)}},0)},Hs={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},Us={blur(e){try{e.blur()}catch{}},focus(e){try{var t=e.nodeName;e.getAttribute(`tabIndex`)==null&&e.isContentEditable!==!0&&Hs[t]==null&&e.setAttribute(`tabIndex`,`-1`),e.focus()}catch{}},measure(e,t){Vs(e,null,t)},measureInWindow(e,t){e&&setTimeout(()=>{var n=Ps(e),r=n.height,i=n.left,a=n.top,o=n.width;t(i,a,o,r)},0)},measureLayout(e,t,n,r){Vs(e,t,r)},updateView(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];switch(n){case`style`:zs(e,r);break;case`class`:case`className`:e.setAttribute(`class`,r);break;case`text`:case`value`:e.value=r;break;default:e.setAttribute(n,r)}}},configureNextLayoutAnimation(e,t){t()},setLayoutAnimationEnabledExperimental(){}};function Ws(){return Ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ws.apply(null,arguments)}var Gs={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},Ks={"aria-activedescendant":!0,"aria-atomic":!0,"aria-autocomplete":!0,"aria-busy":!0,"aria-checked":!0,"aria-colcount":!0,"aria-colindex":!0,"aria-colspan":!0,"aria-controls":!0,"aria-current":!0,"aria-describedby":!0,"aria-details":!0,"aria-disabled":!0,"aria-errormessage":!0,"aria-expanded":!0,"aria-flowto":!0,"aria-haspopup":!0,"aria-hidden":!0,"aria-invalid":!0,"aria-keyshortcuts":!0,"aria-label":!0,"aria-labelledby":!0,"aria-level":!0,"aria-live":!0,"aria-modal":!0,"aria-multiline":!0,"aria-multiselectable":!0,"aria-orientation":!0,"aria-owns":!0,"aria-placeholder":!0,"aria-posinset":!0,"aria-pressed":!0,"aria-readonly":!0,"aria-required":!0,inert:!0,role:!0,"aria-roledescription":!0,"aria-rowcount":!0,"aria-rowindex":!0,"aria-rowspan":!0,"aria-selected":!0,"aria-setsize":!0,"aria-sort":!0,"aria-valuemax":!0,"aria-valuemin":!0,"aria-valuenow":!0,"aria-valuetext":!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},qs={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},Js={onBlur:!0,onFocus:!0},Ys={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},Xs={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},Zs={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},Qs={style:!0};function $s(e,t){var n={};for(var r in e)e.hasOwnProperty(r)&&t[r]===!0&&(n[r]=e[r]);return n}var ec=Zr?b.useLayoutEffect:b.useEffect,tc=`__reactLayoutHandler`,nc=null;function rc(){return Zr&&window.ResizeObserver!==void 0&&(nc??=new window.ResizeObserver(function(e){e.forEach(e=>{var t=e.target,n=t[tc];typeof n==`function`&&Us.measure(t,(t,r,i,a,o,s)=>{var c={nativeEvent:{layout:{x:t,y:r,width:i,height:a,left:o,top:s}},timeStamp:Date.now()};Object.defineProperty(c.nativeEvent,`target`,{enumerable:!0,get:()=>e.target}),n(c)})})})),nc}function ic(e,t){var n=rc();ec(()=>{var n=e.current;n!=null&&(n[tc]=t)},[e,t]),ec(()=>{var t=e.current;return t!=null&&n!=null&&(typeof t[tc]==`function`?n.observe(t):n.unobserve(t)),()=>{t!=null&&n!=null&&n.unobserve(t)}},[e,n])}function ac(){var e=[...arguments];return function(t){e.forEach(e=>{if(e!=null){if(typeof e==`function`){e(t);return}if(typeof e==`object`){e.current=t;return}console.error(`mergeRefs cannot handle Refs of type boolean, number or string, received ref `+String(e))}})}}function oc(){var e=[...arguments];return b.useMemo(()=>ac(...e),[...e])}var sc=typeof Symbol==`function`&&typeof Symbol()==`symbol`?Symbol():Object.freeze({});function cc(e){var t=b.useRef(sc);return t.current===sc&&(t.current=e()),t.current}function lc(e){return e.pointerEvents,e.style,cc(()=>e=>{e!=null&&(e.measure=t=>Us.measure(e,t),e.measureLayout=(t,n,r)=>Us.measureLayout(e,t,r,n),e.measureInWindow=t=>Us.measureInWindow(e,t))})}var uc=()=>{},dc={},fc=[];function pc(e){return e>20?e%20:e}function mc(e,t){var n,r=!1,i,a,o=e.changedTouches,s=e.type,c=e.metaKey===!0,l=e.shiftKey===!0,u=o&&o[0].force||0,d=pc(o&&o[0].identifier||0),f=o&&o[0].clientX||e.clientX,p=o&&o[0].clientY||e.clientY,m=o&&o[0].pageX||e.pageX,h=o&&o[0].pageY||e.pageY,g=typeof e.preventDefault==`function`?e.preventDefault.bind(e):uc,_=e.timeStamp;function v(e){return Array.prototype.slice.call(e).map(e=>({force:e.force,identifier:pc(e.identifier),get locationX(){return x(e.clientX)},get locationY(){return S(e.clientY)},pageX:e.pageX,pageY:e.pageY,target:e.target,timestamp:_}))}if(o!=null)i=v(o),a=v(e.touches);else{var y=[{force:u,identifier:d,get locationX(){return x(f)},get locationY(){return S(p)},pageX:m,pageY:h,target:e.target,timestamp:_}];i=y,a=s===`mouseup`||s===`dragstart`?fc:y}var b={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:e.defaultPrevented,dispatchConfig:dc,eventPhase:e.eventPhase,isDefaultPrevented(){return e.defaultPrevented},isPropagationStopped(){return r},isTrusted:e.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:c,shiftKey:l,changedTouches:i,force:u,identifier:d,get locationX(){return x(f)},get locationY(){return S(p)},pageX:m,pageY:h,target:e.target,timestamp:_,touches:a,type:s},persist:uc,preventDefault:g,stopPropagation(){r=!0},target:e.target,timeStamp:_,touchHistory:t.touchHistory};function x(e){if(n||=Ps(b.currentTarget),n)return e-n.left}function S(e){if(n||=Ps(b.currentTarget),n)return e-n.top}return b}var hc=`scroll`;function gc(e){return e===`touchstart`||e===`mousedown`}function _c(e){return e===`touchmove`||e===`mousemove`}function vc(e){return e===`touchend`||e===`mouseup`||yc(e)}function yc(e){return e===`touchcancel`||e===`dragstart`}function bc(e){return e===hc}function xc(e){return e===`select`||e===`selectionchange`}function Sc(){var e=window.getSelection(),t=e.toString(),n=e.anchorNode,r=e.focusNode,i=n&&n.nodeType===window.Node.TEXT_NODE||r&&r.nodeType===window.Node.TEXT_NODE;return t.length>=1&&t!==`
17
+ `&&i}var Cc=`__reactResponderId`;function wc(e){if(e.type===`selectionchange`){var t=window.getSelection().anchorNode;return Tc(t)}else return e.composedPath==null?Tc(e.target):e.composedPath()}function Tc(e){for(var t=[];e!=null&&e!==document.body;)t.push(e),e=e.parentNode;return t}function Ec(e){return e==null?null:e[Cc]}function Dc(e,t){e!=null&&(e[Cc]=t)}function Oc(e){for(var t=[],n=[],r=wc(e),i=0;i<r.length;i++){var a=r[i],o=Ec(a);o!=null&&(t.push(o),n.push(a))}return{idPath:t,nodePath:n}}function kc(e,t){var n=e.length,r=t.length;if(n===0||r===0||e[n-1]!==t[r-1])return null;var i=e[0],a=0,o=t[0],s=0;n-r>0&&(a=n-r,i=e[a],n=r),r-n>0&&(s=r-n,o=t[s],r=n);for(var c=n;c--;){if(i===o)return i;i=e[a++],o=t[s++]}return null}function Ac(e,t){if(!t||t.length===0)return!1;for(var n=0;n<t.length;n++){var r=t[n].target;if(r!=null&&e.contains(r))return!0}return!1}function jc(e){return e.type===`selectionchange`?Sc():e.type===`select`}function Mc(e){var t=e.altKey,n=e.button,r=e.buttons,i=e.ctrlKey,a=e.type,o=a===`touchstart`||a===`touchmove`,s=a===`mousedown`&&(n===0||r===1),c=a===`mousemove`&&r===1,l=t===!1&&i===!1;return!!(o||s&&l||c&&l)}var Nc=!1,Pc=20;function Fc(e){return e.timeStamp||e.timestamp}function Ic(e){return{touchActive:!0,startPageX:e.pageX,startPageY:e.pageY,startTimeStamp:Fc(e),currentPageX:e.pageX,currentPageY:e.pageY,currentTimeStamp:Fc(e),previousPageX:e.pageX,previousPageY:e.pageY,previousTimeStamp:Fc(e)}}function Lc(e,t){e.touchActive=!0,e.startPageX=t.pageX,e.startPageY=t.pageY,e.startTimeStamp=Fc(t),e.currentPageX=t.pageX,e.currentPageY=t.pageY,e.currentTimeStamp=Fc(t),e.previousPageX=t.pageX,e.previousPageY=t.pageY,e.previousTimeStamp=Fc(t)}function Rc(e){var t=e.identifier;return t??console.error(`Touch object is missing identifier.`),Nc&&t>Pc&&console.error(`Touch identifier %s is greater than maximum supported %s which causes performance issues backfilling array locations for all of the indices.`,t,Pc),t}function zc(e,t){var n=Rc(e),r=t.touchBank[n];r?Lc(r,e):t.touchBank[n]=Ic(e),t.mostRecentTimeStamp=Fc(e)}function Bc(e,t){var n=t.touchBank[Rc(e)];n?(n.touchActive=!0,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=e.pageX,n.currentPageY=e.pageY,n.currentTimeStamp=Fc(e),t.mostRecentTimeStamp=Fc(e)):console.warn(`Cannot record touch move without a touch start.
18
+ `,`Touch Move: `+Hc(e)+`
19
+ `,`Touch Bank: `+Uc(t))}function Vc(e,t){var n=t.touchBank[Rc(e)];n?(n.touchActive=!1,n.previousPageX=n.currentPageX,n.previousPageY=n.currentPageY,n.previousTimeStamp=n.currentTimeStamp,n.currentPageX=e.pageX,n.currentPageY=e.pageY,n.currentTimeStamp=Fc(e),t.mostRecentTimeStamp=Fc(e)):console.warn(`Cannot record touch end without a touch start.
20
+ `,`Touch End: `+Hc(e)+`
21
+ `,`Touch Bank: `+Uc(t))}function Hc(e){return JSON.stringify({identifier:e.identifier,pageX:e.pageX,pageY:e.pageY,timestamp:Fc(e)})}function Uc(e){var t=e.touchBank,n=JSON.stringify(t.slice(0,Pc));return t.length>Pc&&(n+=` (original size: `+t.length+`)`),n}var Wc=class{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(e,t){var n=this._touchHistory;if(_c(e))t.changedTouches.forEach(e=>Bc(e,n));else if(gc(e))t.changedTouches.forEach(e=>zc(e,n)),n.numberActiveTouches=t.touches.length,n.numberActiveTouches===1&&(n.indexOfSingleActiveTouch=t.touches[0].identifier);else if(vc(e)&&(t.changedTouches.forEach(e=>Vc(e,n)),n.numberActiveTouches=t.touches.length,n.numberActiveTouches===1)){for(var r=n.touchBank,i=0;i<r.length;i++){var a=r[i];if(a!=null&&a.touchActive){n.indexOfSingleActiveTouch=i;break}}if(Nc){var o=r[n.indexOfSingleActiveTouch];o!=null&&o.touchActive||console.error(`Cannot find single active touch.`)}}}get touchHistory(){return this._touchHistory}},Gc={},Kc=[`onStartShouldSetResponderCapture`,`onStartShouldSetResponder`,{bubbles:!0}],qc=[`onMoveShouldSetResponderCapture`,`onMoveShouldSetResponder`,{bubbles:!0}],Jc={touchstart:Kc,mousedown:Kc,touchmove:qc,mousemove:qc,scroll:[`onScrollShouldSetResponderCapture`,`onScrollShouldSetResponder`,{bubbles:!1}]},Yc={id:null,idPath:null,node:null},Xc=new Map,Zc=!1,Qc=0,$c={id:null,node:null,idPath:null},el=new Wc;function tl(e){$c=e}function nl(e){return Xc.get(e)??Gc}function rl(e){var t=e.type,n=e.target;if(t===`touchstart`&&(Zc=!0),(t===`touchmove`||Qc>1)&&(Zc=!1),!(t===`mousedown`&&Zc||t===`mousemove`&&Zc||t===`mousemove`&&Qc<1)){if(Zc&&t===`mouseup`){Qc===0&&(Zc=!1);return}var r=gc(t)&&Mc(e),i=_c(t),a=vc(t),o=bc(t),s=xc(t),c=mc(e,el);(r||i||a)&&(e.touches?Qc=e.touches.length:r?Qc=1:a&&(Qc=0),el.recordTouchTrack(t,c.nativeEvent));var l=Oc(e),u=!1,d;if(r||i||o&&Qc>0){var f=$c.idPath,p=l.idPath;if(f!=null&&p!=null){var m=kc(f,p);if(m!=null){var h=p.indexOf(m)+ +(m===$c.id);l={idPath:p.slice(h),nodePath:l.nodePath.slice(h)}}else l=null}l!=null&&(d=il(l,e,c),d!=null&&(al(c,d),u=!0))}if($c.id!=null&&$c.node!=null){var g=$c,_=g.id,v=g.node,y=nl(_),b=y.onResponderStart,x=y.onResponderMove,S=y.onResponderEnd,C=y.onResponderRelease,w=y.onResponderTerminate,T=y.onResponderTerminationRequest;if(c.bubbles=!1,c.cancelable=!1,c.currentTarget=v,r)b!=null&&(c.dispatchConfig.registrationName=`onResponderStart`,b(c));else if(i)x!=null&&(c.dispatchConfig.registrationName=`onResponderMove`,x(c));else{var E=yc(t)||t===`contextmenu`||t===`blur`&&n===window||t===`blur`&&n.contains(v)&&e.relatedTarget!==v||o&&Qc===0||o&&n.contains(v)&&n!==v||s&&jc(e),D=a&&!E&&!Ac(v,e.touches);if(a&&S!=null&&(c.dispatchConfig.registrationName=`onResponderEnd`,S(c)),D&&(C!=null&&(c.dispatchConfig.registrationName=`onResponderRelease`,C(c)),tl(Yc)),E){var O=!0;(t===`contextmenu`||t===`scroll`||t===`selectionchange`)&&(u?O=!1:T!=null&&(c.dispatchConfig.registrationName=`onResponderTerminationRequest`,T(c)===!1&&(O=!1))),O&&(w!=null&&(c.dispatchConfig.registrationName=`onResponderTerminate`,w(c)),tl(Yc),Zc=!1,Qc=0)}}}}}function il(e,t,n){var r=Jc[t.type];if(r!=null){for(var i=e.idPath,a=e.nodePath,o=r[0],s=r[1],c=r[2].bubbles,l=function(e,t,r){var a=nl(e)[r];if(a!=null&&(n.currentTarget=t,a(n)===!0))return{id:e,node:t,idPath:i.slice(i.indexOf(e))}},u=i.length-1;u>=0;u--){var d=i[u],f=a[u],p=l(d,f,o);if(p!=null)return p;if(n.isPropagationStopped()===!0)return}if(c)for(var m=0;m<i.length;m++){var h=i[m],g=a[m],_=l(h,g,s);if(_!=null)return _;if(n.isPropagationStopped()===!0)return}else{var v=i[0],y=a[0];if(t.target===y)return l(v,y,s)}}}function al(e,t){var n=$c,r=n.id,i=n.node,a=t.id,o=t.node,s=nl(a),c=s.onResponderGrant,l=s.onResponderReject;if(e.bubbles=!1,e.cancelable=!1,e.currentTarget=o,r==null)c!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName=`onResponderGrant`,c(e)),tl(t);else{var u=nl(r),d=u.onResponderTerminate,f=u.onResponderTerminationRequest,p=!0;f!=null&&(e.currentTarget=i,e.dispatchConfig.registrationName=`onResponderTerminationRequest`,f(e)===!1&&(p=!1)),p?(d!=null&&(e.currentTarget=i,e.dispatchConfig.registrationName=`onResponderTerminate`,d(e)),c!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName=`onResponderGrant`,c(e)),tl(t)):l!=null&&(e.currentTarget=o,e.dispatchConfig.registrationName=`onResponderReject`,l(e))}}var ol=[`blur`,`scroll`],sl=[`mousedown`,`mousemove`,`mouseup`,`dragstart`,`touchstart`,`touchmove`,`touchend`,`touchcancel`,`contextmenu`,`select`,`selectionchange`];function cl(){Zr&&window.__reactResponderSystemActive==null&&(window.addEventListener(`blur`,rl),sl.forEach(e=>{document.addEventListener(e,rl)}),ol.forEach(e=>{document.addEventListener(e,rl,!0)}),window.__reactResponderSystemActive=!0)}function ll(e,t,n){Dc(t,e),Xc.set(e,n)}function ul(e){$c.id===e&&dl(),Xc.has(e)&&Xc.delete(e)}function dl(){var e=$c,t=e.id,n=e.node;if(t!=null&&n!=null){var r=nl(t).onResponderTerminate;if(r!=null){var i=mc({},el);i.currentTarget=n,r(i)}tl(Yc)}Zc=!1,Qc=0}function fl(){return $c.node}var pl={},ml=0;function hl(e){var t=b.useRef(null);return t.current??=e(),t.current}function gl(e,t){t===void 0&&(t=pl);var n=hl(()=>ml++),r=b.useRef(!1);b.useEffect(()=>(cl(),()=>{ul(n)}),[n]),b.useEffect(()=>{var i=t,a=i.onMoveShouldSetResponder,o=i.onMoveShouldSetResponderCapture,s=i.onScrollShouldSetResponder,c=i.onScrollShouldSetResponderCapture,l=i.onSelectionChangeShouldSetResponder,u=i.onSelectionChangeShouldSetResponderCapture,d=i.onStartShouldSetResponder,f=i.onStartShouldSetResponderCapture,p=a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f!=null,m=e.current;p?(ll(n,m,t),r.current=!0):r.current&&=(ul(n),!1)},[t,e,n]),b.useDebugValue({isResponder:e.current===fl()}),b.useDebugValue(t)}var _l=(0,b.createContext)(!1),vl=[`hrefAttrs`,`onLayout`,`onMoveShouldSetResponder`,`onMoveShouldSetResponderCapture`,`onResponderEnd`,`onResponderGrant`,`onResponderMove`,`onResponderReject`,`onResponderRelease`,`onResponderStart`,`onResponderTerminate`,`onResponderTerminationRequest`,`onScrollShouldSetResponder`,`onScrollShouldSetResponderCapture`,`onSelectionChangeShouldSetResponder`,`onSelectionChangeShouldSetResponderCapture`,`onStartShouldSetResponder`,`onStartShouldSetResponderCapture`],yl=Object.assign({},Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),bl=e=>$s(e,yl),xl=b.forwardRef((e,t)=>{var n=e.hrefAttrs,r=e.onLayout,i=e.onMoveShouldSetResponder,a=e.onMoveShouldSetResponderCapture,o=e.onResponderEnd,s=e.onResponderGrant,c=e.onResponderMove,l=e.onResponderReject,u=e.onResponderRelease,d=e.onResponderStart,f=e.onResponderTerminate,p=e.onResponderTerminationRequest,m=e.onScrollShouldSetResponder,h=e.onScrollShouldSetResponderCapture,g=e.onSelectionChangeShouldSetResponder,_=e.onSelectionChangeShouldSetResponderCapture,v=e.onStartShouldSetResponder,y=e.onStartShouldSetResponderCapture,x=Vr(e,vl),S=b.useContext(_l),C=b.useRef(null),w=Ms().direction;ic(C,r),gl(C,{onMoveShouldSetResponder:i,onMoveShouldSetResponderCapture:a,onResponderEnd:o,onResponderGrant:s,onResponderMove:c,onResponderReject:l,onResponderRelease:u,onResponderStart:d,onResponderTerminate:f,onResponderTerminationRequest:p,onScrollShouldSetResponder:m,onScrollShouldSetResponderCapture:h,onSelectionChangeShouldSetResponder:g,onSelectionChangeShouldSetResponderCapture:_,onStartShouldSetResponder:v,onStartShouldSetResponderCapture:y});var T=`div`,E=e.lang==null?null:As(e.lang),D=e.dir||E,O=D||w,k=bl(x);if(k.dir=D,k.style=[Sl.view$raw,S&&Sl.inline,e.style],e.href!=null&&(T=`a`,n!=null)){var A=n.download,j=n.rel,M=n.target;A!=null&&(k.download=A),j!=null&&(k.rel=j),typeof M==`string`&&(k.target=M.charAt(0)===`_`?M:`_`+M)}return k.ref=oc(C,lc(k),t),Ns(T,k,{writingDirection:O})});xl.displayName=`View`;var Sl=ms.create({view$raw:{alignContent:`flex-start`,alignItems:`stretch`,backgroundColor:`transparent`,border:`0 solid black`,boxSizing:`border-box`,display:`flex`,flexBasis:`auto`,flexDirection:`column`,flexShrink:0,listStyle:`none`,margin:0,minHeight:0,minWidth:0,padding:0,position:`relative`,textDecoration:`none`,zIndex:0},inline:{display:`inline-flex`}}),Cl=[`hrefAttrs`,`numberOfLines`,`onClick`,`onLayout`,`onPress`,`onMoveShouldSetResponder`,`onMoveShouldSetResponderCapture`,`onResponderEnd`,`onResponderGrant`,`onResponderMove`,`onResponderReject`,`onResponderRelease`,`onResponderStart`,`onResponderTerminate`,`onResponderTerminationRequest`,`onScrollShouldSetResponder`,`onScrollShouldSetResponderCapture`,`onSelectionChangeShouldSetResponder`,`onSelectionChangeShouldSetResponderCapture`,`onStartShouldSetResponder`,`onStartShouldSetResponderCapture`,`selectable`],wl=Object.assign({},Gs,Ks,qs,Js,Ys,Xs,Zs,Qs,{href:!0,lang:!0,pointerEvents:!0}),Tl=e=>$s(e,wl),El=b.forwardRef((e,t)=>{var n=e.hrefAttrs,r=e.numberOfLines,i=e.onClick,a=e.onLayout,o=e.onPress,s=e.onMoveShouldSetResponder,c=e.onMoveShouldSetResponderCapture,l=e.onResponderEnd,u=e.onResponderGrant,d=e.onResponderMove,f=e.onResponderReject,p=e.onResponderRelease,m=e.onResponderStart,h=e.onResponderTerminate,g=e.onResponderTerminationRequest,_=e.onScrollShouldSetResponder,v=e.onScrollShouldSetResponderCapture,y=e.onSelectionChangeShouldSetResponder,x=e.onSelectionChangeShouldSetResponderCapture,S=e.onStartShouldSetResponder,C=e.onStartShouldSetResponderCapture,w=e.selectable,T=Vr(e,Cl),E=b.useContext(_l),D=b.useRef(null),O=Ms().direction;ic(D,a),gl(D,{onMoveShouldSetResponder:s,onMoveShouldSetResponderCapture:c,onResponderEnd:l,onResponderGrant:u,onResponderMove:d,onResponderReject:f,onResponderRelease:p,onResponderStart:m,onResponderTerminate:h,onResponderTerminationRequest:g,onScrollShouldSetResponder:_,onScrollShouldSetResponderCapture:v,onSelectionChangeShouldSetResponder:y,onSelectionChangeShouldSetResponderCapture:x,onStartShouldSetResponder:S,onStartShouldSetResponderCapture:C});var k=b.useCallback(e=>{i==null?o!=null&&(e.stopPropagation(),o(e)):i(e)},[i,o]),A=E?`span`:`div`,j=e.lang==null?null:As(e.lang),M=e.dir||j,N=M||O,P=Tl(T);if(P.dir=M,E||(P.dir=M??`auto`),(i||o)&&(P.onClick=k),P.style=[r!=null&&r>1&&{WebkitLineClamp:r},E===!0?Ol.textHasAncestor$raw:Ol.text$raw,r===1&&Ol.textOneLine,r!=null&&r>1&&Ol.textMultiLine,e.style,w===!0&&Ol.selectable,w===!1&&Ol.notSelectable,o&&Ol.pressable],e.href!=null&&(A=`a`,n!=null)){var ee=n.download,F=n.rel,I=n.target;ee!=null&&(P.download=ee),F!=null&&(P.rel=F),typeof I==`string`&&(P.target=I.charAt(0)===`_`?I:`_`+I)}P.ref=oc(D,lc(P),t);var te=Ns(A,P,{writingDirection:N});return E?te:b.createElement(_l.Provider,{value:!0},te)});El.displayName=`Text`;var Dl={backgroundColor:`transparent`,border:`0 solid black`,boxSizing:`border-box`,color:`black`,display:`inline`,font:`14px System`,listStyle:`none`,margin:0,padding:0,position:`relative`,textAlign:`start`,textDecoration:`none`,whiteSpace:`pre-wrap`,wordWrap:`break-word`},Ol=ms.create({text$raw:Dl,textHasAncestor$raw:Br(Br({},Dl),{},{color:`inherit`,font:`inherit`,textAlign:`inherit`,whiteSpace:`inherit`}),textOneLine:{maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,wordWrap:`normal`},textMultiLine:{display:`-webkit-box`,maxWidth:`100%`,overflow:`clip`,textOverflow:`ellipsis`,WebkitBoxOrient:`vertical`},notSelectable:{userSelect:`none`},selectable:{userSelect:`text`},pressable:{cursor:`pointer`}}),kl=`DELAY`,Al=`ERROR`,jl=`LONG_PRESS_DETECTED`,Ml=`NOT_RESPONDER`,Nl=`RESPONDER_ACTIVE_LONG_PRESS_START`,Pl=`RESPONDER_ACTIVE_PRESS_START`,Fl=`RESPONDER_INACTIVE_PRESS_START`,Z=`RESPONDER_GRANT`,Q=`RESPONDER_RELEASE`,Il=`RESPONDER_TERMINATED`,Ll=Object.freeze({NOT_RESPONDER:{DELAY:Al,RESPONDER_GRANT:Fl,RESPONDER_RELEASE:Al,RESPONDER_TERMINATED:Al,LONG_PRESS_DETECTED:Al},RESPONDER_INACTIVE_PRESS_START:{DELAY:Pl,RESPONDER_GRANT:Al,RESPONDER_RELEASE:Ml,RESPONDER_TERMINATED:Ml,LONG_PRESS_DETECTED:Al},RESPONDER_ACTIVE_PRESS_START:{DELAY:Al,RESPONDER_GRANT:Al,RESPONDER_RELEASE:Ml,RESPONDER_TERMINATED:Ml,LONG_PRESS_DETECTED:Nl},RESPONDER_ACTIVE_LONG_PRESS_START:{DELAY:Al,RESPONDER_GRANT:Al,RESPONDER_RELEASE:Ml,RESPONDER_TERMINATED:Ml,LONG_PRESS_DETECTED:Nl},ERROR:{DELAY:Ml,RESPONDER_GRANT:Fl,RESPONDER_RELEASE:Ml,RESPONDER_TERMINATED:Ml,LONG_PRESS_DETECTED:Ml}}),Rl=e=>e.getAttribute(`role`),zl=e=>e.tagName.toLowerCase(),Bl=e=>e===Pl||e===Nl,Vl=e=>Rl(e)===`button`,Hl=e=>e===Fl||e===Pl||e===Nl,Ul=e=>e===Il||e===Q,Wl=e=>{var t=e.key,n=e.target,r=t===` `||t===`Spacebar`,i=zl(n)===`button`||Vl(n);return t===`Enter`||r&&i},Gl=450,Kl=50,ql=class{constructor(e){this._eventHandlers=null,this._isPointerTouch=!1,this._longPressDelayTimeout=null,this._longPressDispatched=!1,this._pressDelayTimeout=null,this._pressOutDelayTimeout=null,this._touchState=Ml,this._responderElement=null,this.configure(e)}configure(e){this._config=e}reset(){this._cancelLongPressDelayTimeout(),this._cancelPressDelayTimeout(),this._cancelPressOutDelayTimeout()}getEventHandlers(){return this._eventHandlers??=this._createEventHandlers(),this._eventHandlers}_createEventHandlers(){var e=(e,t)=>{e.persist(),this._cancelPressOutDelayTimeout(),this._longPressDispatched=!1,this._selectionTerminated=!1,this._touchState=Ml,this._isPointerTouch=e.nativeEvent.type===`touchstart`,this._receiveSignal(Z,e);var n=Jl(this._config.delayPressStart,0,Kl);t!==!1&&n>0?this._pressDelayTimeout=setTimeout(()=>{this._receiveSignal(kl,e)},n):this._receiveSignal(kl,e);var r=Jl(this._config.delayLongPress,10,Gl);this._longPressDelayTimeout=setTimeout(()=>{this._handleLongPress(e)},r+n)},t=e=>{this._receiveSignal(Q,e)},n=e=>{var r=this._config.onPress,i=e.target;if(this._touchState!==Ml&&Wl(e)){t(e),document.removeEventListener(`keyup`,n);var a=i.getAttribute(`role`),o=zl(i),s=a===`link`||o===`a`||o===`button`||o===`input`||o===`select`||o===`textarea`,c=this._responderElement===i;r!=null&&!s&&c&&r(e),this._responderElement=null}};return{onStartShouldSetResponder:e=>{var t=this._config.disabled;return t&&Vl(e.currentTarget)&&e.stopPropagation(),t==null?!0:!t},onKeyDown:t=>{var r=this._config.disabled,i=t.key,a=t.target;if(!r&&Wl(t)){this._touchState===Ml&&(e(t,!1),this._responderElement=a,document.addEventListener(`keyup`,n));var o=i===` `||i===`Spacebar`,s=Rl(a);o&&(s===`button`||s===`menuitem`)&&zl(a)!==`button`&&t.preventDefault(),t.stopPropagation()}},onResponderGrant:t=>e(t),onResponderMove:e=>{this._config.onPressMove!=null&&this._config.onPressMove(e);var t=Yl(e);if(this._touchActivatePosition!=null){var n=this._touchActivatePosition.pageX-t.pageX,r=this._touchActivatePosition.pageY-t.pageY;Math.hypot(n,r)>10&&this._cancelLongPressDelayTimeout()}},onResponderRelease:e=>t(e),onResponderTerminate:e=>{e.nativeEvent.type===`selectionchange`&&(this._selectionTerminated=!0),this._receiveSignal(Il,e)},onResponderTerminationRequest:e=>{var t=this._config,n=t.cancelable,r=t.disabled,i=t.onLongPress;return!r&&i!=null&&this._isPointerTouch&&e.nativeEvent.type===`contextmenu`?!1:n??!0},onClick:e=>{var t=this._config,n=t.disabled,r=t.onPress;n?Vl(e.currentTarget)&&e.stopPropagation():(e.stopPropagation(),this._longPressDispatched||this._selectionTerminated?e.preventDefault():r!=null&&e.altKey===!1&&r(e))},onContextMenu:e=>{var t=this._config,n=t.disabled,r=t.onLongPress;n?Vl(e.currentTarget)&&e.stopPropagation():r!=null&&this._isPointerTouch&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation())}}}_receiveSignal(e,t){var n=this._touchState,r=null;Ll[n]!=null&&(r=Ll[n][e]),!(this._touchState===Ml&&e===Q)&&(r==null||r===Al?console.error(`PressResponder: Invalid signal `+e+` for state `+n+` on responder`):n!==r&&(this._performTransitionSideEffects(n,r,e,t),this._touchState=r))}_performTransitionSideEffects(e,t,n,r){if(Ul(n)&&(setTimeout(()=>{this._isPointerTouch=!1},0),this._touchActivatePosition=null,this._cancelLongPressDelayTimeout()),Hl(e)&&n===jl){var i=this._config.onLongPress;i!=null&&r.nativeEvent.key==null&&(i(r),this._longPressDispatched=!0)}var a=Bl(e),o=Bl(t);if(!a&&o?this._activate(r):a&&!o&&this._deactivate(r),Hl(e)&&n===Q){var s=this._config,c=s.onLongPress;s.onPress!=null&&(c!=null&&e===Nl||!o&&!a&&(this._activate(r),this._deactivate(r)))}this._cancelPressDelayTimeout()}_activate(e){var t=this._config,n=t.onPressChange,r=t.onPressStart,i=Yl(e);this._touchActivatePosition={pageX:i.pageX,pageY:i.pageY},r?.(e),n?.(!0)}_deactivate(e){var t=this._config,n=t.onPressChange,r=t.onPressEnd;function i(){r?.(e),n?.(!1)}var a=Jl(this._config.delayPressEnd);a>0?this._pressOutDelayTimeout=setTimeout(()=>{i()},a):i()}_handleLongPress(e){(this._touchState===Pl||this._touchState===Nl)&&this._receiveSignal(jl,e)}_cancelLongPressDelayTimeout(){this._longPressDelayTimeout!=null&&(clearTimeout(this._longPressDelayTimeout),this._longPressDelayTimeout=null)}_cancelPressDelayTimeout(){this._pressDelayTimeout!=null&&(clearTimeout(this._pressDelayTimeout),this._pressDelayTimeout=null)}_cancelPressOutDelayTimeout(){this._pressOutDelayTimeout!=null&&(clearTimeout(this._pressOutDelayTimeout),this._pressOutDelayTimeout=null)}};function Jl(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=0),Math.max(t,e??n)}function Yl(e){var t=e.nativeEvent,n=t.changedTouches,r=t.touches;return r!=null&&r.length>0?r[0]:n!=null&&n.length>0?n[0]:e.nativeEvent}function Xl(e,t){var n=(0,b.useRef)(null);n.current??=new ql(t);var r=n.current;return(0,b.useEffect)(()=>{r.configure(t)},[t,r]),(0,b.useEffect)(()=>()=>{r.reset()},[r]),(0,b.useDebugValue)(t),r.getEventHandlers()}var Zl=()=>{};function Ql(){var e=!1;if(Zr)try{var t={};Object.defineProperty(t,`passive`,{get(){return e=!0,!1}}),window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t)}catch{}return e}var $l=Ql();function eu(e){return e==null?!1:$l?e:!!e.capture}function tu(){return this.cancelBubble}function nu(){return this.defaultPrevented}function ru(e){return e.nativeEvent=e,e.persist=Zl,e.isDefaultPrevented=nu,e.isPropagationStopped=tu,e}function iu(e,t,n,r){var i=eu(r),a=e=>n(ru(e));return e.addEventListener(t,a,i),function(){e?.removeEventListener(t,a,i)}}var au=()=>typeof window<`u`&&window.PointerEvent!=null,ou=`keyboard`,su=`keyboard`,cu,lu,uu=!1,du=new Set,fu=`keyboard`,pu=`mouse`,mu=`touch`,hu=`blur`,gu=`contextmenu`,_u=`focus`,vu=`keydown`,yu=`mousedown`,bu=`mousemove`,xu=`mouseup`,Su=`pointerdown`,Cu=`pointermove`,wu=`scroll`,Tu=`selectionchange`,Eu=`touchcancel`,Du=`touchmove`,Ou=`touchstart`,ku=`visibilitychange`,Au={passive:!0},ju={capture:!0,passive:!0};function Mu(){(cu!=null||lu!=null)&&(cu!=null&&(su=cu,cu=null),lu!=null&&(ou=lu,lu=null),Ru())}function Nu(){cu=su,lu=ou,ou=fu,su=fu,Ru(),uu=!1}function Pu(){Mu()}function Fu(e){e.metaKey||e.altKey||e.ctrlKey||su!==fu&&(su=fu,ou=fu,Ru())}function Iu(){document.visibilityState!==`hidden`&&Mu()}function Lu(e){var t=e.type;if(au()){if(t===Su){ou!==e.pointerType&&(su=e.pointerType,ou=e.pointerType,Ru());return}if(t===Cu){su!==e.pointerType&&(su=e.pointerType,Ru());return}}else{if(uu||(t===yu&&ou!==pu&&(su=pu,ou=pu,Ru()),t===bu&&su!==pu&&(su=pu,Ru())),t===Ou){uu=!0,e.touches&&e.touches.length>1&&(uu=!1),ou!==mu&&(su=mu,ou=mu,Ru());return}(t===gu||t===xu||t===Tu||t===wu||t===Eu||t===Du)&&(uu=!1)}}Zr&&(iu(window,hu,Nu,Au),iu(window,_u,Pu,Au),iu(document,vu,Fu,ju),iu(document,ku,Iu,ju),iu(document,Su,Lu,ju),iu(document,Cu,Lu,ju),iu(document,gu,Lu,ju),iu(document,yu,Lu,ju),iu(document,bu,Lu,ju),iu(document,xu,Lu,ju),iu(document,Eu,Lu,ju),iu(document,Du,Lu,ju),iu(document,Ou,Lu,ju),iu(document,Tu,Lu,ju),iu(document,wu,Lu,ju));function Ru(){var e={activeModality:ou,modality:su};du.forEach(t=>{t(e)})}function zu(){return su}function Bu(e,t){var n=cc(()=>new Map),r=cc(()=>(r,i)=>{n.get(r)?.(),i??=(n.delete(r),()=>{});var a=iu(r,e,i,t);return n.set(r,a),a});return ec(()=>()=>{n.forEach(e=>{e()}),n.clear()},[n]),r}var Vu={},Hu={passive:!0},Uu=`react-gui:hover:lock`,Wu=`react-gui:hover:unlock`,Gu=()=>typeof window<`u`&&window.PointerEvent!=null;function Ku(e,t,n){var r=document.createEvent(`CustomEvent`),i=n||Vu,a=i.bubbles,o=a===void 0?!0:a,s=i.cancelable,c=s===void 0?!0:s,l=i.detail;r.initCustomEvent(t,o,c,l),e.dispatchEvent(r)}function qu(e){return e.pointerType??zu()}function Ju(e,t){var n=t.contain,r=t.disabled,i=t.onHoverStart,a=t.onHoverChange,o=t.onHoverUpdate,s=t.onHoverEnd,c=Gu(),l=Bu(c?`pointermove`:`mousemove`,Hu),u=Bu(c?`pointerenter`:`mouseenter`,Hu),d=Bu(c?`pointerleave`:`mouseleave`,Hu),f=Bu(Uu,Hu),p=Bu(Wu,Hu);ec(()=>{var t=e.current;if(t!==null){var c=function(e){s?.(e),a?.(!1),l(t,null),d(t,null)},m=function(t){var r=e.current;r!=null&&qu(t)!==`touch`&&(n&&Ku(r,Wu),c(t))},h=function(e){qu(e)!==`touch`&&o!=null&&(e.x??=e.clientX,e.y??=e.clientY,o(e))},g=function(e){i?.(e),a?.(!0),o!=null&&l(t,r?null:h),d(t,r?null:m)};u(t,r?null:function(t){var i=e.current;i!=null&&qu(t)!==`touch`&&(n&&Ku(i,Uu),g(t),f(i,r?null:function(e){e.target!==i&&c(t)}),p(i,r?null:function(e){e.target!==i&&g(t)}))})}},[u,l,d,f,p,n,r,i,a,o,s,e])}var Yu=[`children`,`delayLongPress`,`delayPressIn`,`delayPressOut`,`disabled`,`onBlur`,`onContextMenu`,`onFocus`,`onHoverIn`,`onHoverOut`,`onKeyDown`,`onLongPress`,`onPress`,`onPressMove`,`onPressIn`,`onPressOut`,`style`,`tabIndex`,`testOnly_hovered`,`testOnly_pressed`];function Xu(e,t){var n=e.children,r=e.delayLongPress,i=e.delayPressIn,a=e.delayPressOut,o=e.disabled,s=e.onBlur,c=e.onContextMenu,l=e.onFocus,u=e.onHoverIn,d=e.onHoverOut,f=e.onKeyDown,p=e.onLongPress,m=e.onPress,h=e.onPressMove,g=e.onPressIn,_=e.onPressOut,v=e.style,y=e.tabIndex,x=e.testOnly_hovered,S=e.testOnly_pressed,C=Vr(e,Yu),w=Zu(x===!0),T=w[0],E=w[1],D=Zu(!1),O=D[0],k=D[1],A=Zu(S===!0),j=A[0],M=A[1],N=(0,b.useRef)(null),P=oc(t,N),ee=Xl(N,(0,b.useMemo)(()=>({delayLongPress:r,delayPressStart:i,delayPressEnd:a,disabled:o,onLongPress:p,onPress:m,onPressChange:M,onPressStart:g,onPressMove:h,onPressEnd:_}),[r,i,a,o,p,m,g,h,_,M])),F=ee.onContextMenu,I=ee.onKeyDown;Ju(N,{contain:!0,disabled:o,onHoverChange:E,onHoverStart:u,onHoverEnd:d});var te={hovered:T,focused:O,pressed:j},ne=b.useCallback(e=>{e.nativeEvent.target===N.current&&(k(!1),s?.(e))},[N,k,s]),re=b.useCallback(e=>{e.nativeEvent.target===N.current&&(k(!0),l?.(e))},[N,k,l]),ie=b.useCallback(e=>{F?.(e),c?.(e)},[c,F]),L=b.useCallback(e=>{I?.(e),f?.(e)},[f,I]),R=y===void 0?o?-1:0:y;return b.createElement(xl,Ws({},C,ee,{"aria-disabled":o,onBlur:ne,onContextMenu:ie,onFocus:re,onKeyDown:L,ref:P,style:[o?Qu.disabled:Qu.active,typeof v==`function`?v(te):v],tabIndex:R}),typeof n==`function`?n(te):n)}function Zu(e){var t=(0,b.useState)(!1),n=t[0],r=t[1];return[n||e,r]}var Qu=ms.create({active:{cursor:`pointer`,touchAction:`manipulation`},disabled:{pointerEvents:`box-none`}}),$u=(0,b.memo)((0,b.forwardRef)(Xu));$u.displayName=`Pressable`;function ed(e){let t=Or();return(0,K.jsx)(El,{...e,style:[td.base,{color:t.colors.text},e.style]})}var td=ms.create({base:{fontSize:14,lineHeight:20}});function nd({label:e,onPress:t}){let n=Or();return(0,K.jsx)($u,{onPress:t,children:(0,K.jsx)(xl,{style:[rd.button,{backgroundColor:n.colors.primary,borderRadius:n.radius.md}],children:(0,K.jsx)(ed,{style:rd.label,children:e})})})}var rd=ms.create({button:{paddingHorizontal:16,paddingVertical:10},label:{color:`#ffffff`,fontWeight:`600`}});ms.create({content:{flexGrow:1}});function id(e){let t=Or();return(0,K.jsx)(xl,{...e,style:[ad.card,{backgroundColor:t.colors.surface,borderColor:t.colors.border,borderRadius:t.radius.md},e.style]})}var ad=ms.create({card:{borderWidth:1,padding:12}}),od={destructive:!0,readOnly:!1,network:!1,longRunning:!1,handlesSecrets:!1},sd={"*":[{test:/^(read|cat|view|open_file|read_file|file_read|glob|grep|search_files|file_search|list_dir|ls|find)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(fetch|web(fetch|search)?|search_query|browser_(navigate|open|visit|search)|open_url|http_request)$/i,value:{destructive:!1,readOnly:!0,network:!0}},{test:/^(bash|shell|exec_command|run_shell_command|terminal|command)$/i,value:{longRunning:!0},inputTest:/\b(rm|del|remove-item|mv|move|cp|copy|chmod|chown|git\s+(commit|push|reset|clean|checkout)|npm\s+publish)\b/i},{test:/^(bash|shell|exec_command|run_shell_command|terminal|command)$/i,value:{destructive:!1,readOnly:!0,longRunning:!0},inputTest:/\b(ls|dir|cat|type|pwd|echo|grep|rg|find|git\s+(status|diff|log)|npm\s+(test|run\s+lint)|vitest|eslint|tsc)\b/i},{test:/^(write|edit|multi(edit)?|replace|patch|apply_patch|notebook(edit|_write)|file_(write|create|delete|patch)|create|mkdir|delete|remove|rename|move|copy)$/i,value:{destructive:!0,readOnly:!1}},{test:/^(secret|credential|credentials|auth|login|token|env|keychain|vault)/i,value:{handlesSecrets:!0}}],claude:[{test:/^(Read|Grep|Glob|LS|NotebookRead|TodoRead)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(Write|Edit|MultiEdit|NotebookEdit|TodoWrite)$/i,value:{destructive:!0,readOnly:!1}},{test:/^Web(Fetch|Search)$/i,value:{destructive:!1,readOnly:!0,network:!0}},{test:/^Bash$/i,value:{longRunning:!0}},{test:/^Task$/i,value:{longRunning:!0}}],codex:[{test:/^(view_image|read_mcp_resource|list_mcp_resources|list_mcp_resource_templates)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(exec_command|write_stdin)$/i,value:{longRunning:!0}},{test:/^apply_patch$/i,value:{destructive:!0,readOnly:!1}}],gemini:[{test:/^(read_file|grep_in_files|search_codebase)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write_file|replace_file_text|create_file|delete_file)$/i,value:{destructive:!0,readOnly:!1}},{test:/^google_search$/i,value:{destructive:!1,readOnly:!0,network:!0}},{test:/^run_shell_command$/i,value:{longRunning:!0}}],copilot:[{test:/^(readFile|findTextInFiles|search)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(createFile|editFile|deleteFile)$/i,value:{destructive:!0,readOnly:!1}}],cursor:[{test:/^(read_file|search_files|list_files)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(edit_file|create_file|delete_file)$/i,value:{destructive:!0,readOnly:!1}}],opencode:[{test:/^(read|grep|glob|ls)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write|edit|patch)$/i,value:{destructive:!0,readOnly:!1}}],openclaw:[{test:/^(channel-plugin|webhook)$/i,value:{network:!0,longRunning:!0}}],pi:[{test:/^(read_file|search_files)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write_file|edit_file)$/i,value:{destructive:!0,readOnly:!1}}],omp:[{test:/^(read|grep|glob)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write|edit|patch)$/i,value:{destructive:!0,readOnly:!1}}],hermes:[{test:/^(read_file|grep|glob)$/i,value:{destructive:!1,readOnly:!0}},{test:/^(write_file|edit_file|patch_file)$/i,value:{destructive:!0,readOnly:!1}}]};function cd(e,t,n){let r=String(e).toLowerCase(),i=typeof n==`string`?n:JSON.stringify(n??``),a=[...sd[`*`]??[],...sd[r]??[]],o={...od};for(let e of a)e.test.test(t)&&(e.inputTest&&!e.inputTest.test(i)||Object.assign(o,e.value));return o}var ld=[];function ud(e){let t=ld.findIndex(t=>t.id===e.id);t>=0&&ld.splice(t,1),ld.push(e),ld.sort((e,t)=>t.priority-e.priority)}function dd(e,t,n){let r=cd(e,t,n),i=ld.find(e=>e.match({toolName:t,classification:r}));if(!i)throw Error(`No tool-call renderer registered. Register generic last.`);return i}function fd(e,t,n){return(0,K.jsxs)(id,{children:[(0,K.jsx)(ed,{style:{fontWeight:`700`,color:n?`#b91c1c`:void 0},children:e}),(0,K.jsx)(ed,{children:t})]})}var pd={id:`generic`,priority:0,match:()=>!0,compact(e){return fd(e.toolName,md(e.input),e.classification.destructive)},expanded(e){return fd(e.toolName,`${md(e.input)}\n${md(e.output)}`,e.classification.destructive)},approvalPreview(e){return fd(`Approve ${e.toolName}?`,md(e.input),e.classification.destructive)}};function md(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}var hd={...pd,id:`bash`,priority:99,match:({toolName:e})=>/bash|shell|exec_command|terminal/i.test(e)},gd={...pd,id:`edit`,priority:93,match:({toolName:e})=>/edit|patch|replace/i.test(e)},_d={...pd,id:`glob`,priority:91,match:({toolName:e})=>/glob|ls|find/i.test(e)},vd={...pd,id:`grep`,priority:91,match:({toolName:e})=>/grep|search/i.test(e)},yd={...pd,id:`read`,priority:90,match:({toolName:e})=>/read|cat|view/i.test(e)},bd={...pd,id:`web-fetch`,priority:94,match:({toolName:e})=>/fetch/i.test(e)},xd={...pd,id:`web-search`,priority:94,match:({toolName:e})=>/search/i.test(e)&&/web|browser/i.test(e)},Sd={...pd,id:`write`,priority:92,match:({toolName:e})=>/write|create/i.test(e)},Cd=!1;function wd(){if(!Cd){Cd=!0;for(let e of[hd,bd,xd,gd,Sd,vd,_d,yd,pd])ud(e)}}function Td(e){wd();let t=dd(e.agent,e.toolName,e.input),n=cd(e.agent,e.toolName,e.input);return(0,K.jsxs)(id,{children:[(0,K.jsxs)(xl,{style:{gap:12},children:[(0,K.jsx)(ed,{style:{fontWeight:`700`},children:`Hook Approval`}),(0,K.jsx)(ed,{children:`Decision in ${e.secondsRemaining}s`}),t.approvalPreview({agent:e.agent,toolName:e.toolName,input:e.input,classification:n})]}),(0,K.jsxs)(xl,{style:{flexDirection:`row`,gap:8,marginTop:12},children:[(0,K.jsx)(nd,{label:`Allow`,onPress:e.onAllow}),(0,K.jsx)(nd,{label:`Deny`,onPress:e.onDeny}),e.onModify?(0,K.jsx)(nd,{label:`Modify`,onPress:e.onModify}):null]})]})}function Ed(e){return(0,K.jsx)(xl,{style:{flexDirection:`row`,flexWrap:`wrap`,gap:8},children:e.agents.map(t=>(0,K.jsx)(nd,{label:t===e.selected?`${t} *`:t,onPress:()=>e.onSelect(t)},t))})}function Dd(e){return e.status===`connected`&&!e.error?null:(0,K.jsx)(id,{children:(0,K.jsx)(ed,{children:e.error??e.status})})}ms.create({container:{flex:1,gap:12},summaryRow:{flexDirection:`row`,flexWrap:`wrap`,gap:8},chip:{borderWidth:1,borderRadius:999,paddingHorizontal:10,paddingVertical:6},chipText:{fontSize:12,lineHeight:16,fontWeight:`600`},tabRow:{flexDirection:`row`,flexWrap:`wrap`,gap:8},tab:{borderWidth:1,borderRadius:999,paddingHorizontal:12,paddingVertical:8,flexDirection:`row`,alignItems:`center`,gap:8},tabText:{fontWeight:`700`},tabTextActive:{color:`#ffffff`},tabBadge:{fontSize:12,lineHeight:16,fontWeight:`700`},scroll:{flex:1},scrollContent:{gap:10,paddingBottom:16},sectionCard:{gap:10},cardHeader:{flexDirection:`row`,flexWrap:`wrap`,justifyContent:`space-between`,alignItems:`flex-start`,gap:10},cardHeaderText:{flexShrink:1,gap:4},cardTitle:{fontWeight:`700`},segmentRow:{flexDirection:`row`,flexWrap:`wrap`,gap:10},segmentCard:{minWidth:180,flexBasis:180,borderWidth:1,borderRadius:12,padding:10,gap:8},segmentHeader:{flexDirection:`row`,flexWrap:`wrap`,alignItems:`center`,gap:8},segmentTitle:{fontWeight:`600`},metaRow:{flexDirection:`row`,flexWrap:`wrap`,gap:8},mutedText:{fontSize:12,lineHeight:16,opacity:.8},emptyState:{borderWidth:1,borderStyle:`dashed`,borderRadius:14,padding:14}});function Od(e){return(0,K.jsx)(xl,{children:(0,K.jsx)(Ed,{agents:hr(),selected:e.selected,onSelect:e.onSelect})})}ms.create({screen:{flex:1,gap:12},heading:{fontWeight:`700`}});function kd(){let e=wr(),{client:t}=dr();return(0,K.jsx)(xl,{children:e.map(e=>(0,K.jsx)(Td,{agent:`claude`,toolName:String(e.payload.toolName??e.hookKind),input:e.payload,secondsRemaining:Math.max(0,Math.floor((e.deadlineTs-Date.now())/1e3)),onAllow:()=>void t.request({type:`hook.decision`,hookRequestId:e.hookRequestId,decision:`allow`}),onDeny:()=>void t.request({type:`hook.decision`,hookRequestId:e.hookRequestId,decision:`deny`})},e.hookRequestId))})}function Ad(){let e=mr();return(0,K.jsx)(xl,{children:(0,K.jsx)(Dd,{status:e.status,error:e.error})})}var jd={colors:{background:`#151819`,surface:`#1f2628`,border:`#344144`,text:`#f4f2ee`,mutedText:`#a7b0b1`,primary:`#7dd3c7`},spacing:{xs:4,sm:8,md:12,lg:16},radius:{sm:8,md:14}};function Md(e){return{gatewayUrl:Bd(e.gatewayUrl),token:e.token.trim()}}var Nd=`amux.webui.auth`,Pd=`amux.webui.auth-error`,Fd=15e3,Id=(0,b.createContext)(null),Ld=class extends Error{status;constructor(e){super(`Gateway request failed: ${e}`),this.name=`GatewayHttpError`,this.status=e}};function Rd(e){return e.replace(/\/+$/,``)}var zd=[/\/api\/v1(?:\/.*)?$/i,/\/api\/gateway-proxy(?:\/.*)?$/i,/\/sessions(?:\/.*)?$/i,/\/dispatches(?:\/.*)?$/i,/\/runs(?:\/.*)?$/i,/\/projects(?:\/.*)?$/i,/\/workspaces(?:\/.*)?$/i,/\/settings(?:\/.*)?$/i,/\/login$/i,/\/pair(?:\/.*)?$/i];function Bd(e){let t=e.trim();if(!t)return``;let n;try{n=new URL(t)}catch{return Rd(t)}let r=n.pathname.replace(/\/+$/,``);for(let e of zd)if(e.test(r)){r=r.replace(e,``);break}return n.pathname=r.length>0?r:`/`,n.search=``,n.hash=``,Rd(n.toString())}function Vd(e){return e.startsWith(`https://`)?`wss://${e.slice(8)}`:e.startsWith(`http://`)?`ws://${e.slice(7)}`:e}function Hd(){return typeof window>`u`?`http://127.0.0.1:7878`:`${window.location.protocol}//${window.location.host}`}function Ud(){if(typeof window>`u`)return null;let e=window.localStorage.getItem(Nd);if(!e)return null;try{let t=JSON.parse(e);return!t.token||!t.gatewayUrl?null:Md(t)}catch{return null}}function Wd(e){return`${Rd(e.gatewayUrl)}\n${e.token}`}function Gd(e){typeof window>`u`||(e&&e.length>0?window.sessionStorage.setItem(Pd,e):window.sessionStorage.removeItem(Pd))}function Kd(){if(typeof window>`u`)return null;let e=window.sessionStorage.getItem(Pd);return e&&e.length>0?e:null}function qd(e){return e instanceof Ld?e.status===401:e instanceof Error&&/\b401\b/.test(e.message)}async function Jd(e){let t=Md(e),n=new pn({url:Vd(t.gatewayUrl),token:t.token});try{await n.connect(),await n.request({type:`agents.list`})}finally{await n.close()}}async function Yd(e,t,n,r){let i=await fetch(`${Rd(Bd(e))}${n}`,{...r,headers:{"content-type":`application/json`,authorization:`Bearer ${t}`,...r?.headers??{}}});if(!i.ok)throw new Ld(i.status);return await i.json()}function Xd(e){let{client:t,store:n}=dr(),r=(0,b.useRef)(new Map),i=(0,b.useRef)(null);function a(e){return Array.isArray(e)?e.flatMap(e=>{if(typeof e==`string`)return[{agent:e,displayName:e}];if(!e||typeof e!=`object`)return[];let t=e,n=typeof t.agent==`string`?t.agent:``;return n?[{agent:n,displayName:typeof t.displayName==`string`?t.displayName:n,adapterType:typeof t.adapterType==`string`?t.adapterType:void 0,structuredSessionTransport:t.structuredSessionTransport===`restart-per-turn`||t.structuredSessionTransport===`persistent`?t.structuredSessionTransport:`none`,sessionControlPlane:t.sessionControlPlane===`external-host`||t.sessionControlPlane===`mcp-mediated`?t.sessionControlPlane:`self-managed`,supportsInteractiveMode:typeof t.supportsInteractiveMode==`boolean`?t.supportsInteractiveMode:void 0,canResume:typeof t.canResume==`boolean`?t.canResume:void 0,supportsImageInput:typeof t.supportsImageInput==`boolean`?t.supportsImageInput:void 0,supportsFileAttachments:typeof t.supportsFileAttachments==`boolean`?t.supportsFileAttachments:void 0,approvalModes:Array.isArray(t.approvalModes)?t.approvalModes.filter(e=>e===`yolo`||e===`prompt`||e===`deny`):void 0}]:[]}):[]}return(0,b.useEffect)(()=>{let o=!1,s=null;async function c(){if(i.current)return await i.current;let s=(async()=>{let[i,s,c]=await Promise.allSettled([Yd(e.gatewayUrl,e.token,`/api/v1/agents`),Yd(e.gatewayUrl,e.token,`/api/v1/dispatches`),Yd(e.gatewayUrl,e.token,`/api/v1/sessions`)]);if(o)return;if([i,s,c].filter(e=>e.status===`rejected`).some(e=>qd(e.reason))){e.onAuthFailure(`Stored gateway access expired or was rejected. Connect again.`);return}let l=n.getState().actions;i.status===`fulfilled`&&l.setAgents(a(i.value.agentDescriptors??i.value.agents));let u=s.status===`fulfilled`?s.value.dispatches??s.value.runs??[]:[];for(let e of u){let t=String(e.runId??``);t&&(l.mergeRun(t,e),typeof e.sessionId==`string`&&l.mergeSession(e.sessionId,{agent:e.agent}))}let d=new Set;for(let e of c.status===`fulfilled`?c.value.sessions:[]){let t=typeof e.sessionId==`string`?e.sessionId:``;t&&(l.mergeSession(t,e),typeof e.activeRunId==`string`&&e.activeRunId.length>0&&d.add(e.activeRunId))}for(let[e,t]of r.current.entries())d.has(e)||(t(),r.current.delete(e));for(let e of d)r.current.has(e)||r.current.set(e,t.subscribeRun(e))})().finally(()=>{i.current=null});return i.current=s,await s}function l(){o||(s=window.setTimeout(async()=>{try{await c()}finally{l()}},Fd))}return c().finally(()=>{l()}),()=>{o=!0,s!=null&&window.clearTimeout(s);for(let e of r.current.values())e();r.current.clear()}},[t,e.gatewayUrl,e.token,n]),(0,K.jsx)(K.Fragment,{children:e.children})}function Zd(e){let[t,n]=(0,b.useState)(()=>Ud()),[r,i]=(0,b.useState)(()=>t===null),[a,o]=(0,b.useState)(null),s=(0,b.useCallback)(e=>{typeof window<`u`&&window.localStorage.removeItem(Nd),Gd(e),o(null),n(null),i(!0)},[]);(0,b.useEffect)(()=>{if(!t)return;let e=Md(t),r=JSON.stringify(e);window.localStorage.getItem(Nd)!==r&&window.localStorage.setItem(Nd,r),(e.gatewayUrl!==t.gatewayUrl||e.token!==t.token)&&n(e)},[t]),(0,b.useEffect)(()=>{if(!t){i(!0);return}let e=Wd(t);if(a===e){i(!0);return}let n=!1;return i(!1),Jd(t).then(()=>{n||(Gd(),o(e),i(!0))}).catch(()=>{n||s(`Stored gateway access expired or was rejected. Connect again.`)}),()=>{n=!0}},[t,s,a]);let c=(0,b.useMemo)(()=>({auth:t,isAuthenticated:t!==null&&r,isReady:r,async login(e){let t=Md({gatewayUrl:e.gatewayUrl||Hd(),token:e.token});await Jd(t),Gd(),window.localStorage.setItem(Nd,JSON.stringify(t)),o(Wd(t)),i(!0),n(t)},logout(e){s(e)}}),[t,s,r]),l=(0,b.useMemo)(()=>{if(!t||!r)return null;let e=Md(t);return new pn({url:Vd(e.gatewayUrl),token:e.token})},[t,r]);return(0,K.jsx)(Id.Provider,{value:c,children:l&&t&&r?(0,K.jsx)(ur,{client:l,children:(0,K.jsx)(Xd,{gatewayUrl:Bd(t.gatewayUrl),token:t.token.trim(),onAuthFailure:s,children:e.children})}):e.children})}function Qd(){let e=(0,b.useContext)(Id);if(!e)throw Error(`useGatewayAuth must be used inside the web gateway provider`);return e}function $d(){let{auth:e,logout:t}=Qd();return(0,b.useMemo)(()=>async(n,r)=>{if(!e)throw Error(`Gateway auth is required`);let i=Md(e),a=await fetch(`${Rd(i.gatewayUrl)}${n}`,{...r,headers:{authorization:`Bearer ${i.token}`,...r?.headers??{}}});return a.status===401&&t(`Stored gateway access expired or was rejected. Connect again.`),a},[e,t])}async function ef(){typeof Notification>`u`||Notification.permission!==`default`||await Notification.requestPermission()}function tf(e){if(typeof Notification>`u`||Notification.permission!==`granted`)return;let t=new Notification(e.title,{body:e.body});t.onclick=()=>{window.focus(),e.onClick(),t.close()}}function nf(){let e=Be(),t=wr(),{push:n}=on(),r=(0,b.useRef)(new Set);return(0,b.useEffect)(()=>{ef()},[]),(0,b.useEffect)(()=>{for(let i of t)r.current.has(i.hookRequestId)||(r.current.add(i.hookRequestId),n({title:`Hook request`,message:i.hookKind||`Pending approval`,kind:`info`}),typeof document<`u`&&document.visibilityState!==`visible`&&tf({title:`agent-mux hook approval`,body:`${i.hookKind} requires attention`,onClick:()=>e(`/inbox`)}))},[t,e,n]),null}function rf(e){let{isAuthenticated:t}=Qd();return(0,K.jsxs)(K.Fragment,{children:[t?(0,K.jsx)(nf,{}):null,e.children]})}var af=`amux.webui.theme`,of=(0,b.createContext)(null);function sf(){return typeof window>`u`?`light`:window.localStorage.getItem(af)===`dark`?`dark`:`light`}function cf(e){let[t,n]=(0,b.useState)(()=>sf());(0,b.useEffect)(()=>{typeof document>`u`||(document.documentElement.dataset.theme=t,document.documentElement.dataset.compendiumTheme=t===`light`?`vellum`:`void`)},[t]);let r=(0,b.useMemo)(()=>({mode:t,toggle(){let e=t===`light`?`dark`:`light`;window.localStorage.setItem(af,e),n(e)}}),[t]);return(0,K.jsx)(of.Provider,{value:r,children:(0,K.jsx)(Dr,{value:t===`light`?Tr:jd,children:e.children})})}function lf(){let e=(0,b.useContext)(of);if(!e)throw Error(`useThemeMode must be used inside ThemeProvider`);return e}var uf=`page-shell__container`,df=`page-section`,ff=`page-section page-section--inset`;function pf(e){return(0,K.jsx)(`div`,{className:q(`page-shell`,(e.background??`ambient`)===`ambient`?`page-shell--ambient`:`page-shell--plain`),children:(0,K.jsx)(`div`,{className:q(uf,e.className),children:e.children})})}function mf(e){return(0,K.jsx)(`section`,{className:q(e.inset?ff:df,e.className),children:e.children})}function hf(e){return(0,K.jsx)(`section`,{className:q(`page-hero-grid`,e.className),children:e.children})}function gf(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.currentPath==`string`&&t.currentPath.length>0?t.currentPath:typeof t.workspaceDefaultCwd==`string`&&t.workspaceDefaultCwd.length>0?t.workspaceDefaultCwd:typeof t.workspaceRootPath==`string`&&t.workspaceRootPath.length>0?t.workspaceRootPath:null}function _f(e){return!Number.isFinite(e)||e<=0?`No heartbeat yet`:new Date(e).toLocaleString()}function vf(e){return`/workspaces?workspace=${encodeURIComponent(e)}`}function yf(){let{store:e}=dr(),t=pr(e,xr(e=>Object.values(e.sessions.byId))),n=pr(e,e=>e.agents.items),r=(0,b.useMemo)(()=>[...t].sort((e,t)=>Number(t.updatedAt??0)-Number(e.updatedAt??0)).slice(0,6),[t]),i=t.filter(e=>e.status===`active`).length,a=t.filter(e=>e.status!==`active`).length,o=t.filter(e=>typeof e.cwd==`string`&&e.cwd.length>0?!0:gf(e.workspace)!=null).length;return(0,K.jsxs)(pf,{children:[(0,K.jsx)(mf,{children:(0,K.jsxs)(hf,{className:`session-browser__hero-grid`,children:[(0,K.jsxs)(`div`,{className:`session-browser__hero-copy`,children:[(0,K.jsx)(`p`,{className:`page-kicker`,children:`Workbench`}),(0,K.jsx)(`h1`,{className:`page-title`,children:`Plan in projects. Work inside sessions. Ship from workspaces.`}),(0,K.jsx)(`p`,{className:`page-copy page-copy--wide`,children:`The web UI works best when planning, conversation, and workspace control stay connected. Start from projects, continue in the session chat, and keep the linked workspace beside that conversation instead of splitting the workflow across unrelated pages.`}),(0,K.jsxs)(`div`,{className:`page-actions`,children:[(0,K.jsx)(G,{to:`/projects`,className:`session-browser__action session-browser__action--primary`,children:`Open projects`}),(0,K.jsx)(G,{to:`/sessions`,className:`session-browser__action`,children:`Open sessions`}),(0,K.jsx)(G,{to:`/workspaces`,className:`session-browser__action`,children:`Open workspaces`})]})]}),(0,K.jsxs)(`div`,{className:`session-browser__hero-kpis`,children:[(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Live sessions`}),(0,K.jsx)(`strong`,{children:i})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Paused sessions`}),(0,K.jsx)(`strong`,{children:a})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Workspace-linked`}),(0,K.jsx)(`strong`,{children:o})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Available agents`}),(0,K.jsx)(`strong`,{children:n.length})]})]})]})}),(0,K.jsxs)(mf,{inset:!0,children:[(0,K.jsx)(`div`,{className:`session-browser__section-header`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker page-kicker--compact`,children:`Focus`}),(0,K.jsx)(`h2`,{className:`page-title page-title--secondary`,children:`The main unit is the conversation, not the dispatch id.`}),(0,K.jsx)(`p`,{className:`page-copy`,children:`Projects decide what to work on. Sessions hold the live transcript and next turn. Workspaces keep the code, runtime, and review context attached to that same thread.`})]})}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-3`,children:[(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Plan`}),(0,K.jsx)(`strong`,{children:`Drive the board from projects`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`Backlog, workspace creation, and review handoff stay in one project surface.`})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Work`}),(0,K.jsx)(`strong`,{children:`Keep the chat visible`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`Session detail is now a chat-first shell with transcript, flow, and runtime beside it.`})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Ship`}),(0,K.jsx)(`strong`,{children:`Operate from the workspace shell`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`The selected workspace now shows the associated session chat instead of hiding it on another route.`})]})]})]}),(0,K.jsxs)(mf,{children:[(0,K.jsxs)(`div`,{className:`session-browser__section-header`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker page-kicker--compact`,children:`Recent`}),(0,K.jsx)(`h2`,{className:`page-title page-title--secondary`,children:`Resume the most recent conversations`}),(0,K.jsx)(`p`,{className:`page-copy`,children:`Open the chat directly, or jump into the linked workspace when you need the code and runtime around it.`})]}),(0,K.jsx)(`div`,{className:`page-actions`,children:(0,K.jsx)(G,{to:`/sessions`,className:`session-browser__action`,children:`View all sessions`})})]}),(0,K.jsxs)(`div`,{className:`session-browser__row-list`,children:[r.map(e=>{let t=typeof e.cwd==`string`&&e.cwd.length>0?e.cwd:gf(e.workspace),n=typeof e.activeRunId==`string`?e.activeRunId:typeof e.latestRunId==`string`?e.latestRunId:null;return(0,K.jsx)(`article`,{className:`session-browser__row`,children:(0,K.jsxs)(`div`,{className:`session-browser__row-main`,children:[(0,K.jsxs)(`div`,{className:`session-browser__row-copy`,children:[(0,K.jsxs)(`div`,{className:`session-browser__row-topline`,children:[(0,K.jsx)(`h3`,{children:String(e.title??e.sessionId)}),(0,K.jsx)(`span`,{className:`status-badge status-${String(e.status??`inactive`)}`,children:String(e.status??`inactive`)}),(0,K.jsx)(`span`,{className:`meta-chip`,children:String(e.agent??`unknown`)})]}),(0,K.jsxs)(`div`,{className:`session-browser__meta-row`,children:[(0,K.jsx)(`span`,{className:`page-chip page-chip--muted`,children:String(e.sessionId)}),(0,K.jsxs)(`span`,{className:`page-chip page-chip--muted`,children:[`Updated `,_f(Number(e.updatedAt??0))]})]}),t?(0,K.jsx)(`div`,{className:`session-browser__path`,title:t,children:t}):null]}),(0,K.jsxs)(`div`,{className:`session-browser__actions`,children:[(0,K.jsx)(G,{to:`/sessions/${e.sessionId}`,className:`session-browser__action session-browser__action--primary`,children:`Open chat`}),t?(0,K.jsx)(G,{to:vf(t),className:`session-browser__action`,children:`Workspace`}):null,n?(0,K.jsx)(G,{to:`/dispatches/${n}`,className:`session-browser__action`,children:`Dispatch handoff`}):null]})]})},String(e.sessionId))}),r.length===0?(0,K.jsxs)(`div`,{className:`empty-card`,children:[(0,K.jsx)(`strong`,{children:`No sessions have been created yet.`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`Start from projects or create a new session to begin a chat-first workflow.`})]}):null]})]})]})}function bf(){let e=Be(),t=Re(),{auth:n,isAuthenticated:r,isReady:i,login:a}=Qd(),[o,s]=(0,b.useState)(()=>`${window.location.protocol}//${window.location.host}`),[c,l]=(0,b.useState)(``),[u,d]=(0,b.useState)(()=>Kd()),[f,p]=(0,b.useState)(!1);if((0,b.useEffect)(()=>{if(!r){n||d(Kd());return}e(t.state?.from??`/`,{replace:!0})},[n,r,t.state,e]),n&&!i)return(0,K.jsx)(`main`,{className:`login-page`,children:(0,K.jsxs)(`section`,{className:`login-card auth-card`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`agent-mux webui`}),(0,K.jsx)(`h1`,{children:`Checking saved gateway access`}),(0,K.jsx)(`p`,{className:`lede auth-note`,children:`Revalidating the stored gateway token before reconnecting this browser to the gateway.`})]})});async function m(n){n.preventDefault(),p(!0),d(null);try{await a({gatewayUrl:o,token:c}),e(t.state?.from??`/`,{replace:!0})}catch(e){d(e instanceof Error?e.message:String(e))}finally{p(!1)}}return(0,K.jsx)(`main`,{className:`login-page`,children:(0,K.jsxs)(`section`,{className:`login-card auth-card`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`agent-mux webui`}),(0,K.jsx)(`h1`,{children:`Attach to your gateway`}),(0,K.jsxs)(`p`,{className:`lede auth-note`,children:[`The token is stored in `,(0,K.jsx)(`code`,{children:`localStorage.amux.webui.auth`}),`. That is convenient and less secure than an OS keychain.`]}),(0,K.jsxs)(`form`,{onSubmit:m,className:`auth-form`,children:[(0,K.jsxs)(`label`,{className:`auth-field`,children:[(0,K.jsx)(`span`,{children:`Gateway URL`}),(0,K.jsx)(`input`,{className:`auth-input`,value:o,onChange:e=>s(e.target.value),placeholder:`http://127.0.0.1:7878`})]}),(0,K.jsxs)(`label`,{className:`auth-field`,children:[(0,K.jsx)(`span`,{children:`Bearer token`}),(0,K.jsx)(`input`,{className:`auth-input`,type:`password`,value:c,onChange:e=>l(e.target.value),placeholder:`paste token`})]}),u?(0,K.jsx)(`p`,{className:`error-banner`,children:u}):null,(0,K.jsx)(`button`,{type:`submit`,className:`auth-submit`,disabled:f||!c.trim(),children:f?`Connecting...`:`Connect`})]})]})})}function xf(){let[e,t]=(0,b.useState)();return(0,K.jsxs)(`section`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Agents`})}),(0,K.jsx)(Od,{selected:e,onSelect:t})]})}var Sf=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Cf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),wf={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Tf=(0,b.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,b.createElement)(`svg`,{ref:c,...wf,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Cf(`lucide`,i),...s},[...o.map(([e,t])=>(0,b.createElement)(e,t)),...Array.isArray(a)?a:[a]])),$=(e,t)=>{let n=(0,b.forwardRef)(({className:n,...r},i)=>(0,b.createElement)(Tf,{ref:i,iconNode:t,className:Cf(`lucide-${Sf(e)}`,n),...r}));return n.displayName=`${e}`,n},Ef=$(`Activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Df=$(`Archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),Of=$(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),kf=$(`ArrowRightLeft`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),Af=$(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),jf=$(`ArrowUpDown`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Mf=$(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Nf=$(`Bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Pf=$(`Boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),Ff=$(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),If=$(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Lf=$(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Rf=$(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),zf=$(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Bf=$(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Vf=$(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Hf=$(`CirclePlay`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polygon`,{points:`10 8 16 12 10 16 10 8`,key:`1cimsy`}]]),Uf=$(`CircleX`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Wf=$(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Gf=$(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),Kf=$(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),qf=$(`Command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),Jf=$(`CornerDownRight`,[[`polyline`,{points:`15 10 20 15 15 20`,key:`1q7qjw`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),Yf=$(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),Xf=$(`ExternalLink`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Zf=$(`EyeOff`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Qf=$(`Eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),$f=$(`FileDiff`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),ep=$(`FileImage`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]),tp=$(`FileStack`,[[`path`,{d:`M21 7h-3a2 2 0 0 1-2-2V2`,key:`9rb54x`}],[`path`,{d:`M21 6v6.5c0 .8-.7 1.5-1.5 1.5h-7c-.8 0-1.5-.7-1.5-1.5v-9c0-.8.7-1.5 1.5-1.5H17Z`,key:`1059l0`}],[`path`,{d:`M7 8v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H15`,key:`16874u`}],[`path`,{d:`M3 12v8.8c0 .3.2.6.4.8.2.2.5.4.8.4H11`,key:`k2ox98`}]]),np=$(`FileText`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),rp=$(`Files`,[[`path`,{d:`M20 7h-3a2 2 0 0 1-2-2V2`,key:`x099mo`}],[`path`,{d:`M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z`,key:`18t6ie`}],[`path`,{d:`M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8`,key:`1nja0z`}]]),ip=$(`FolderGit2`,[[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`path`,{d:`M18 19c-2.8 0-5-2.2-5-5v8`,key:`pkpw2h`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),ap=$(`FolderKanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),op=$(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),sp=$(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),cp=$(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),lp=$(`Hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),up=$(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),dp=$(`Inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),fp=$(`LaptopMinimal`,[[`rect`,{width:`18`,height:`12`,x:`3`,y:`4`,rx:`2`,ry:`2`,key:`1qhy41`}],[`line`,{x1:`2`,x2:`22`,y1:`20`,y2:`20`,key:`ni3hll`}]]),pp=$(`Layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),mp=$(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),hp=$(`LifeBuoy`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m4.93 4.93 4.24 4.24`,key:`1ymg45`}],[`path`,{d:`m14.83 9.17 4.24-4.24`,key:`1cb5xl`}],[`path`,{d:`m14.83 14.83 4.24 4.24`,key:`q42g0n`}],[`path`,{d:`m9.17 14.83-4.24 4.24`,key:`bqpfvv`}],[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}]]),gp=$(`Link2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),_p=$(`ListTodo`,[[`rect`,{x:`3`,y:`5`,width:`6`,height:`6`,rx:`1`,key:`1defrl`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),vp=$(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),yp=$(`Logs`,[[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M3 12h1`,key:`lp3yf2`}],[`path`,{d:`M3 18h1`,key:`1eiwyy`}],[`path`,{d:`M3 6h1`,key:`rgxa97`}],[`path`,{d:`M8 12h1`,key:`1con00`}],[`path`,{d:`M8 18h1`,key:`13wk12`}],[`path`,{d:`M8 6h1`,key:`tn6mkg`}]]),bp=$(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),xp=$(`MessageSquareWarning`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M12 7v2`,key:`stiyo7`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}]]),Sp=$(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Cp=$(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),wp=$(`PanelLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Tp=$(`PanelRight`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Ep=$(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),Dp=$(`PinOff`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),Op=$(`Pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),kp=$(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Ap=$(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),jp=$(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Mp=$(`Radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Np=$(`RefreshCcw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),Pp=$(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Fp=$(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Ip=$(`Route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Lp=$(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),Rp=$(`ServerCog`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5`,key:`tn8das`}],[`path`,{d:`M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5`,key:`1g2pve`}],[`path`,{d:`M6 6h.01`,key:`1utrut`}],[`path`,{d:`M6 18h.01`,key:`uhywen`}],[`path`,{d:`m15.7 13.4-.9-.3`,key:`1jwmzr`}],[`path`,{d:`m9.2 10.9-.9-.3`,key:`qapnim`}],[`path`,{d:`m10.6 15.7.3-.9`,key:`quwk0k`}],[`path`,{d:`m13.6 15.7-.4-1`,key:`cb9xp7`}],[`path`,{d:`m10.8 9.3-.4-1`,key:`1uaiz5`}],[`path`,{d:`m8.3 13.6 1-.4`,key:`s6srou`}],[`path`,{d:`m14.7 10.8 1-.4`,key:`4d31cq`}],[`path`,{d:`m13.4 8.3-.3.9`,key:`1bm987`}]]),zp=$(`Settings2`,[[`path`,{d:`M20 7h-9`,key:`3s1dr2`}],[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Bp=$(`Settings`,[[`path`,{d:`M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z`,key:`1qme2f`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Vp=$(`ShieldAlert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Hp=$(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Up=$(`Siren`,[[`path`,{d:`M7 18v-6a5 5 0 1 1 10 0v6`,key:`pcx96s`}],[`path`,{d:`M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z`,key:`1b4s83`}],[`path`,{d:`M21 12h1`,key:`jtio3y`}],[`path`,{d:`M18.5 4.5 18 5`,key:`g5sp9y`}],[`path`,{d:`M2 12h1`,key:`1uaihz`}],[`path`,{d:`M12 2v1`,key:`11qlp1`}],[`path`,{d:`m4.929 4.929.707.707`,key:`1i51kw`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}]]),Wp=$(`Smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Gp=$(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),Kp=$(`SquarePlay`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 8 6 4-6 4Z`,key:`f1r3lt`}]]),qp=$(`SquareTerminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),Jp=$(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),Yp=$(`TabletSmartphone`,[[`rect`,{width:`10`,height:`14`,x:`3`,y:`8`,rx:`2`,key:`1vrsiq`}],[`path`,{d:`M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4`,key:`1j4zmg`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),Xp=$(`Tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),Zp=$(`TimerReset`,[[`path`,{d:`M10 2h4`,key:`n1abiw`}],[`path`,{d:`M12 14v-4`,key:`1evpnu`}],[`path`,{d:`M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6`,key:`1ts96g`}],[`path`,{d:`M9 17H4v5`,key:`8t5av`}]]),Qp=$(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),$p=$(`TriangleAlert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),em=$(`UserRoundPlus`,[[`path`,{d:`M2 21a8 8 0 0 1 13.292-6`,key:`bjp14o`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M19 16v6`,key:`tddt3s`}],[`path`,{d:`M22 19h-6`,key:`vcuq98`}]]),tm=$(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),nm=$(`WandSparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),rm=$(`Webhook`,[[`path`,{d:`M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2`,key:`q3hayz`}],[`path`,{d:`m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06`,key:`1go1hn`}],[`path`,{d:`m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8`,key:`qlwsc0`}]]),im=$(`WifiOff`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),am=$(`Workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),om=$(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),sm=$(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),cm=1400;function lm(e,t=cm){let n=(0,b.useRef)(!1),r=(0,b.useRef)(e),i=(0,b.useRef)(null),a=(0,b.useRef)(null),[o,s]=(0,b.useState)(!1);return(0,b.useEffect)(()=>()=>{i.current&&clearTimeout(i.current),a.current!=null&&cancelAnimationFrame(a.current)},[]),(0,b.useEffect)(()=>{if(!n.current){n.current=!0,r.current=e;return}r.current!==e&&(r.current=e,i.current&&=(clearTimeout(i.current),null),a.current!=null&&(cancelAnimationFrame(a.current),a.current=null),s(!1),a.current=requestAnimationFrame(()=>{s(!0),i.current=setTimeout(()=>{s(!1),i.current=null},t),a.current=null}))},[t,e]),o}var um=24;function dm(e){return e==null||!Number.isFinite(e)?null:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:4}).format(e)}function fm(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.currentPath==`string`&&t.currentPath.length>0?t.currentPath:typeof t.workspaceDefaultCwd==`string`&&t.workspaceDefaultCwd.length>0?t.workspaceDefaultCwd:typeof t.workspaceRootPath==`string`&&t.workspaceRootPath.length>0?t.workspaceRootPath:null}function pm(e){return!Number.isFinite(e)||e<=0?`No heartbeat yet`:new Date(e).toLocaleString()}function mm(e){let t=[];e.messageCount!=null&&t.push(`${e.messageCount} messages`),e.turnCount!=null&&t.push(`${e.turnCount} turns`);let n=dm(e.costTotalUsd);return n&&t.push(n),t.length>0?t.join(` · `):`No turns recorded yet`}function hm(e){return`/workspaces?workspace=${encodeURIComponent(e)}`}function gm(e){return[e.status,e.updatedAt,e.messageCount??``,e.turnCount??``,e.costTotalUsd??``,e.activeRunId??``,e.latestRunId??``,e.workspacePath??``].join(`|`)}function _m(e){let t=e.session.activeRunId??e.session.latestRunId;return(0,K.jsxs)(`article`,{className:q(`session-browser__spotlight-card`,lm(gm(e.session))&&`session-browser__item--fresh-update`),"data-testid":`session-card-${e.session.sessionId}`,children:[(0,K.jsxs)(`div`,{className:`session-browser__spotlight-header`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`session-browser__eyebrow`,children:e.session.status===`active`?`Live session`:`Recent session`}),(0,K.jsx)(`h3`,{children:e.session.title??e.session.sessionId})]}),(0,K.jsxs)(`div`,{className:`status-stack`,children:[(0,K.jsx)(`span`,{className:`status-badge status-${e.session.status}`,children:e.session.status}),(0,K.jsx)(`span`,{className:`meta-chip`,children:e.session.agent})]})]}),(0,K.jsx)(`p`,{className:`muted-copy`,children:mm(e.session)}),(0,K.jsxs)(`div`,{className:`session-browser__meta-row`,children:[(0,K.jsx)(`span`,{className:`page-chip page-chip--muted`,children:e.session.sessionId}),(0,K.jsxs)(`span`,{className:`page-chip page-chip--muted`,children:[`Updated `,pm(e.session.updatedAt)]})]}),e.session.workspacePath?(0,K.jsx)(`div`,{className:`session-browser__path`,title:e.session.workspacePath,children:e.session.workspacePath}):null,(0,K.jsxs)(`div`,{className:`session-browser__actions`,children:[(0,K.jsx)(G,{to:`/sessions/${e.session.sessionId}`,className:`session-browser__action session-browser__action--primary`,children:e.session.status===`active`?`Open live chat`:`Resume chat`}),e.session.workspacePath?(0,K.jsx)(G,{to:hm(e.session.workspacePath),className:`session-browser__action`,children:`Open workspace`}):null,t?(0,K.jsx)(G,{to:`/dispatches/${t}`,className:`session-browser__action`,children:`Open dispatch`}):null]})]})}function vm(e){let t=e.session.activeRunId??e.session.latestRunId;return(0,K.jsx)(`article`,{className:q(`session-browser__row`,lm(gm(e.session))&&`session-browser__item--fresh-update`),"data-testid":`session-row-${e.session.sessionId}`,children:(0,K.jsxs)(`div`,{className:`session-browser__row-main`,children:[(0,K.jsxs)(`div`,{className:`session-browser__row-copy`,children:[(0,K.jsxs)(`div`,{className:`session-browser__row-topline`,children:[(0,K.jsx)(`h3`,{children:e.session.title??e.session.sessionId}),(0,K.jsx)(`span`,{className:`status-badge status-${e.session.status}`,children:e.session.status}),(0,K.jsx)(`span`,{className:`meta-chip`,children:e.session.agent})]}),(0,K.jsxs)(`div`,{className:`session-browser__meta-row`,children:[(0,K.jsx)(`span`,{className:`page-chip page-chip--muted`,children:e.session.sessionId}),(0,K.jsx)(`span`,{className:`page-chip page-chip--muted`,children:mm(e.session)}),(0,K.jsxs)(`span`,{className:`page-chip page-chip--muted`,children:[`Updated `,pm(e.session.updatedAt)]})]}),e.session.workspacePath?(0,K.jsx)(`div`,{className:`session-browser__path`,title:e.session.workspacePath,children:e.session.workspacePath}):null]}),(0,K.jsxs)(`div`,{className:`session-browser__actions`,children:[(0,K.jsx)(G,{to:`/sessions/${e.session.sessionId}`,className:`session-browser__action session-browser__action--primary`,children:e.session.status===`active`?`Open live chat`:`Open chat`}),e.session.workspacePath?(0,K.jsx)(G,{to:hm(e.session.workspacePath),className:`session-browser__action`,children:`Workspace`}):null,t?(0,K.jsx)(G,{to:`/dispatches/${t}`,className:`session-browser__action`,children:`Dispatch`}):null]})]})})}function ym(){let{store:e}=dr(),t=$d(),n=pr(e,xr(e=>Object.values(e.sessions.byId))),r=pr(e,xr(e=>Object.values(e.runs.byId))),i=pr(e,e=>e.events.byRunId),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(`all`),[l,u]=(0,b.useState)(0),d=(0,b.useDeferredValue)(a).trim().toLowerCase();(0,b.useEffect)(()=>{let n=!1,r=null,i=async()=>{try{let r=await t(`/api/v1/sessions`);if(!r.ok||n)return;let i=await r.json(),a=e.getState().actions.mergeSession;for(let e of i.sessions??[]){let t=typeof e.sessionId==`string`?e.sessionId:``;t&&a(t,e)}}catch{}};return i(),r=window.setInterval(()=>{i()},2e3),()=>{n=!0,r!=null&&window.clearInterval(r)}},[t,e]);let f=(0,b.useMemo)(()=>n.map(e=>{let t=String(e.sessionId),n=r.filter(e=>String(e.sessionId??``)===t).reduce((e,t)=>{let n=i[String(t.runId??``)];return n?e+n.events.reduce((e,t)=>{if(t.type!==`cost`)return e;let n=t.cost;return!n||typeof n!=`object`?e:e+Number(n.totalUsd??0)},0):e},0);return{sessionId:t,agent:String(e.agent??`unknown`),status:String(e.status??`inactive`),activeRunId:typeof e.activeRunId==`string`?e.activeRunId:null,latestRunId:typeof e.latestRunId==`string`?e.latestRunId:null,updatedAt:Number(e.updatedAt??0),title:typeof e.title==`string`?e.title:null,turnCount:typeof e.turnCount==`number`?e.turnCount:null,messageCount:typeof e.messageCount==`number`?e.messageCount:null,costTotalUsd:e.cost&&typeof e.cost==`object`&&typeof e.cost.totalUsd==`number`?e.cost.totalUsd??null:n>0?n:null,workspacePath:typeof e.cwd==`string`&&e.cwd.length>0?e.cwd:fm(e.workspace)}}).sort((e,t)=>t.updatedAt-e.updatedAt),[i,r,n]),p=(0,b.useMemo)(()=>f.filter(e=>s===`active`&&e.status!==`active`||s===`inactive`&&e.status===`active`?!1:d.length===0?!0:[e.sessionId,e.title??``,e.agent,e.status,e.workspacePath??``,e.activeRunId??``,e.latestRunId??``].join(` `).toLowerCase().includes(d)),[s,d,f]),m=Math.max(1,Math.ceil(p.length/um)),h=Math.min(l,m-1),g=(0,b.useMemo)(()=>p.slice(h*um,(h+1)*um),[p,h]),_=f.filter(e=>e.status===`active`),v=f.filter(e=>e.status!==`active`),y=g.filter(e=>e.status===`active`),x=g.filter(e=>e.status!==`active`),S=f.reduce((e,t)=>e+(t.costTotalUsd??0),0),C=f.filter(e=>e.workspacePath!=null).length,w=y.slice(0,3),T=x.slice(0,3);return(0,b.useEffect)(()=>{u(0)},[s,d]),(0,b.useEffect)(()=>{l!==h&&u(h)},[l,h]),(0,K.jsxs)(pf,{children:[(0,K.jsx)(mf,{children:(0,K.jsxs)(`div`,{className:`session-browser__intro`,children:[(0,K.jsxs)(`div`,{className:`session-browser__intro-header`,children:[(0,K.jsxs)(`div`,{className:`session-browser__intro-copy`,children:[(0,K.jsx)(`p`,{className:`page-kicker`,children:`Sessions`}),(0,K.jsx)(`h1`,{className:`page-title page-title--secondary`,children:`Jump back into the right chat.`}),(0,K.jsx)(`p`,{className:`page-copy page-copy--wide`,children:`Live conversations, paused threads, linked workspaces, and the latest dispatch stay on one surface so you can resume work without hunting across routes.`})]}),(0,K.jsxs)(`div`,{className:`page-actions`,children:[(0,K.jsx)(G,{to:`/sessions/new`,className:`session-browser__action session-browser__action--primary`,children:`Start session`}),(0,K.jsx)(G,{to:`/workspaces`,className:`session-browser__action`,children:`Browse workspaces`})]})]}),(0,K.jsxs)(`div`,{className:`session-browser__controls`,children:[(0,K.jsxs)(`label`,{className:`session-browser__search`,"aria-label":`Search sessions`,children:[(0,K.jsx)(Lp,{className:`h-4 w-4`}),(0,K.jsx)(`input`,{value:a,onChange:e=>o(e.target.value),placeholder:`Search session id, title, agent, workspace, or dispatch id`})]}),(0,K.jsx)(`div`,{className:`session-browser__filters`,role:`tablist`,"aria-label":`Session filters`,children:[[`all`,`All sessions (${f.length})`],[`active`,`Active (${_.length})`],[`inactive`,`Inactive (${v.length})`]].map(([e,t])=>(0,K.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":s===e,className:`session-browser__filter ${s===e?`session-browser__filter--active`:``}`,onClick:()=>c(e),children:t},e))}),(0,K.jsxs)(`div`,{className:`session-browser__visible-count`,children:[p.length,` visible · page `,h+1,` of `,m]})]}),(0,K.jsxs)(`div`,{className:`session-browser__summary-strip`,children:[(0,K.jsxs)(`span`,{className:`page-chip session-browser__summary-chip`,children:[(0,K.jsx)(`strong`,{children:`Live`}),(0,K.jsx)(`span`,{children:_.length})]}),(0,K.jsxs)(`span`,{className:`page-chip session-browser__summary-chip`,children:[(0,K.jsx)(`strong`,{children:`Paused`}),(0,K.jsx)(`span`,{children:v.length})]}),(0,K.jsxs)(`span`,{className:`page-chip session-browser__summary-chip`,children:[(0,K.jsx)(`strong`,{children:`Workspace-linked`}),(0,K.jsx)(`span`,{children:C})]}),(0,K.jsxs)(`span`,{className:`page-chip session-browser__summary-chip`,children:[(0,K.jsx)(`strong`,{children:`Observed cost`}),(0,K.jsx)(`span`,{children:f.length>0?dm(S)??`unavailable`:`No usage yet`})]})]})]})}),(0,K.jsxs)(hf,{className:`session-browser__spotlight-grid`,children:[(0,K.jsxs)(mf,{children:[(0,K.jsx)(`div`,{className:`session-browser__section-header`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker page-kicker--compact`,children:`Live`}),(0,K.jsx)(`h2`,{className:`page-title page-title--secondary`,children:`Active chats`})]})}),(0,K.jsxs)(`div`,{className:`session-browser__spotlight-list`,children:[w.map(e=>(0,K.jsx)(_m,{session:e},e.sessionId)),w.length===0?(0,K.jsxs)(`div`,{className:`empty-card`,children:[(0,K.jsx)(`strong`,{children:`No active sessions match the current filter.`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`Start a new session or widen the current search to reopen live work.`})]}):null]})]}),(0,K.jsxs)(mf,{children:[(0,K.jsx)(`div`,{className:`session-browser__section-header`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker page-kicker--compact`,children:`Recent`}),(0,K.jsx)(`h2`,{className:`page-title page-title--secondary`,children:`Paused chats`})]})}),(0,K.jsxs)(`div`,{className:`session-browser__spotlight-list`,children:[T.map(e=>(0,K.jsx)(_m,{session:e},e.sessionId)),T.length===0?(0,K.jsxs)(`div`,{className:`empty-card`,children:[(0,K.jsx)(`strong`,{children:`No inactive sessions match the current filter.`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`Completed or paused sessions will collect here for quick resume.`})]}):null]})]})]}),(0,K.jsxs)(mf,{children:[(0,K.jsx)(`div`,{className:`session-browser__section-header`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker page-kicker--compact`,children:`Directory`}),(0,K.jsx)(`h2`,{className:`page-title page-title--secondary`,children:`All tracked sessions`})]})}),(0,K.jsxs)(`div`,{className:`session-browser__row-list`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-border bg-background/70 px-4 py-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`text-foreground-muted`,children:[`Showing sessions `,h*um+1,`-`,Math.min((h+1)*um,p.length),` of `,p.length]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,className:`session-browser__action`,disabled:h===0,onClick:()=>u(e=>Math.max(0,e-1)),children:`Previous`}),(0,K.jsx)(`button`,{type:`button`,className:`session-browser__action`,disabled:h>=m-1,onClick:()=>u(e=>Math.min(m-1,e+1)),children:`Next`})]})]}),g.map(e=>(0,K.jsx)(vm,{session:e},e.sessionId)),p.length===0?(0,K.jsxs)(`div`,{className:`empty-card`,children:[(0,K.jsx)(`strong`,{children:`No sessions match the current filter.`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`Adjust the search or status filter to widen the results.`})]}):null]})]})]})}var bm={default:`bg-primary`,success:`bg-success`,error:`bg-error`,warning:`bg-warning`},xm={default:`shadow-progress-glow-primary`,success:`shadow-progress-glow-success`,error:`shadow-progress-glow-error`,warning:`shadow-progress-glow-warning`};function Sm({value:e,variant:t=`default`,glow:n=!1,className:r}){let i=Math.min(100,Math.max(0,e)),a=i===100;return(0,K.jsx)(`div`,{className:q(`h-2 w-full overflow-hidden rounded-full bg-background-muted`,r),children:(0,K.jsx)(`div`,{className:q(`h-full transition-all duration-500 ease-out`,bm[t],n&&xm[t],a?`rounded-full`:`rounded-l-full`),style:{width:`${i}%`}})})}function Cm(e,t){if(t==null)return null;let n=e.slice(0,t),r=n.lastIndexOf(`@`);if(r<0)return null;let i=r===0?``:n.slice(r-1,r);if(i&&/[A-Za-z0-9_]/.test(i))return null;let a=n.slice(r+1);return a.includes(`@`)||/\s/.test(a)?null:{start:r,end:t,query:a}}function wm(e,t){let n=t.trim().toLowerCase();return n.length===0?e:e.filter(e=>{let t=e.key.toLowerCase(),r=e.label.toLowerCase();return t.includes(n)||r.includes(n)})}function Tm({value:e,onValueChange:t,taskTags:n,disabled:r=!1,className:i,emptyText:a=`No matching Task Tags.`,renderTextarea:o}){let s=(0,b.useRef)(null),[c,l]=(0,b.useState)(null),[u,d]=(0,b.useState)(0),f=(0,b.useId)(),p=(0,b.useMemo)(()=>c?wm(n,c.query):[],[c,n]);(0,b.useEffect)(()=>{d(0)},[c?.query]);function m(){return s.current?.querySelector(`textarea`)??null}function h(t){l(Cm(e,t))}function g(n){c&&(t(e.slice(0,c.start)+n.content+e.slice(c.end)),l(null),d(0),queueMicrotask(()=>{let e=m();if(!e)return;let t=c.start+n.content.length;e.focus(),e.setSelectionRange(t,t)}))}function _(e){if(c){if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),l(null);return}if(p.length!==0){if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation(),d(e=>(e+1)%p.length);return}if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation(),d(e=>(e-1+p.length)%p.length);return}(e.key===`Enter`||e.key===`Tab`)&&(e.preventDefault(),e.stopPropagation(),g(p[u]??p[0]))}}}let v=c&&p.length>0?`${f}-option-${u}`:void 0,y={value:e,disabled:r,onChange:e=>{t(e.currentTarget.value),l(Cm(e.currentTarget.value,e.currentTarget.selectionStart))},onClick:e=>{h(e.currentTarget.selectionStart)},onBlur:()=>{queueMicrotask(()=>{s.current?.contains(document.activeElement)||l(null)})},onKeyDown:_,onKeyUp:e=>{e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Enter`||e.key===`Tab`||e.key===`Escape`||h(e.currentTarget.selectionStart)},onSelect:e=>{h(e.currentTarget.selectionStart)},"aria-autocomplete":`list`,"aria-controls":c?f:void 0,"aria-expanded":c?!0:void 0,"aria-activedescendant":v};return(0,K.jsxs)(`div`,{className:q(`relative`,i),ref:s,children:[o?o(y):(0,K.jsx)(`textarea`,{...y}),c?(0,K.jsx)(`div`,{className:`absolute inset-x-0 top-full z-20 mt-2 overflow-hidden rounded-2xl border border-border bg-card shadow-xl`,children:p.length>0?(0,K.jsx)(`ul`,{id:f,role:`listbox`,className:`max-h-64 overflow-y-auto py-2`,children:p.map((e,t)=>(0,K.jsxs)(`li`,{id:`${f}-option-${t}`,role:`option`,"aria-selected":t===u,className:q(`cursor-pointer px-4 py-3 transition-colors`,t===u?`bg-primary/10`:`hover:bg-background/70`),onMouseDown:t=>{t.preventDefault(),g(e)},children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),(0,K.jsxs)(`span`,{className:`font-mono text-xs text-foreground-muted`,children:[`@`,e.key]})]}),e.description?(0,K.jsx)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:e.description}):null]},e.id))}):(0,K.jsx)(`div`,{className:`px-4 py-3 text-sm text-foreground-muted`,children:a})}):null]})}function Em(e){return e>=500||e===404}function Dm(e){return e instanceof DOMException&&e.name===`AbortError`}function Om(e){let t=e.trimStart();return t.startsWith(`<!DOCTYPE`)||t.startsWith(`<html`)||t.startsWith(`<pre`)||t.startsWith(`<script`)||t.startsWith(`<div`)||t.startsWith(`<head`)}function km(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason??new DOMException(`Aborted`,`AbortError`));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t.reason??new DOMException(`Aborted`,`AbortError`))};t?.addEventListener(`abort`,a,{once:!0})})}function Am(e,t){let n=new AbortController,r=setTimeout(()=>{n.abort(new DOMException(`Request timed out`,`TimeoutError`))},e),i=()=>{clearTimeout(r),n.abort(t.reason??new DOMException(`Aborted`,`AbortError`))};return t?.aborted?(clearTimeout(r),n.abort(t.reason??new DOMException(`Aborted`,`AbortError`))):t?.addEventListener(`abort`,i,{once:!0}),{signal:n.signal,cleanup:()=>{clearTimeout(r),t?.removeEventListener(`abort`,i)}}}var jm=new Map,Mm=100;function Nm(){if(jm.size<=Mm)return;let e=Array.from(jm.keys()).slice(0,jm.size-Mm);for(let t of e)jm.delete(t)}async function Pm(e,t={}){let{signal:n,retries:r=2,retryDelay:i=1e3,timeout:a=1e4,method:o=`GET`,headers:s,body:c}=t,l={...s},u=jm.get(e);u&&o===`GET`&&(l[`If-None-Match`]=u.etag);let d;for(let t=0;t<=r;t++){let{signal:s,cleanup:f}=Am(a,n);try{let a=await fetch(e,{method:o,headers:l,body:c,signal:s});if(a.status===304&&u)return f(),{ok:!0,data:u.data,status:304};if(a.ok){let o=a.headers.get(`Content-Type`)||``;if(!o.includes(`application/json`)&&o.includes(`text/html`)){f(),d={status:a.status,message:`Server temporarily unavailable (recompiling)`,isRetryable:!0,isAborted:!1},t<r&&await km(i*2**t,n);continue}let s;try{s=await a.json()}catch{if(f(),d={status:a.status,message:`Server temporarily unavailable (recompiling)`,isRetryable:!0,isAborted:!1},t<r){let e=i*2**t;try{await km(e,n)}catch{return{ok:!1,error:{status:0,message:`Request aborted`,isRetryable:!1,isAborted:!0}}}}continue}let c=a.headers.get(`ETag`);return c&&(jm.set(e,{etag:c,data:s}),Nm()),f(),{ok:!0,data:s,status:a.status}}let p=Em(a.status),m;try{let e=await a.text();m=e&&Om(e)?`Server temporarily unavailable (HTTP ${a.status})`:e||`HTTP ${a.status}`}catch{m=`HTTP ${a.status}`}if(f(),d={status:a.status,message:m,isRetryable:p,isAborted:!1},!p)return{ok:!1,error:d};t<r&&await km(i*2**t,n)}catch(e){if(f(),Dm(e)||e instanceof DOMException&&e.name===`TimeoutError`){let e=s.reason,t=e instanceof DOMException&&e.name===`TimeoutError`;return{ok:!1,error:{status:0,message:t?`Request timed out`:`Request aborted`,isRetryable:!1,isAborted:!t}}}if(d={status:0,message:e instanceof Error?e.message:`Network error`,isRetryable:!0,isAborted:!1},t<r)try{await km(i*2**t,n)}catch{return{ok:!1,error:{status:0,message:`Request aborted`,isRetryable:!1,isAborted:!0}}}}}return{ok:!1,error:d??{status:0,message:`Unknown error`,isRetryable:!1,isAborted:!1}}}var Fm=null,Im=0,Lm=0,Rm=null,zm=new Set;function Bm(){let e=[1e3,2e3,4e3,8e3,3e4];return e[Math.min(Lm,e.length-1)]}function Vm(){if(typeof EventSource>`u`)return console.warn(`EventSource not supported in this environment`),null;let e=new EventSource(`/api/stream`);return e.onopen=()=>{Lm=0,zm.forEach(e=>e({type:`connected`}))},e.onmessage=e=>{try{let t=JSON.parse(e.data);zm.forEach(e=>e(t))}catch(e){console.error(`Failed to parse SSE message:`,e)}},e.onerror=()=>{if(e.close(),Fm=null,zm.forEach(e=>e({type:`disconnect`})),Im>0){Lm++;let e=Bm();Rm=setTimeout(()=>{Im>0&&(Fm=Vm())},e)}},e}function Hm(e){return zm.add(e),Im++,Im===1&&!Fm&&(Fm=Vm()),()=>{zm.delete(e),Im--,Im===0&&(Rm&&=(clearTimeout(Rm),null),Fm&&=(Fm.close(),null),Lm=0)}}function Um(e,t={}){let{interval:n=5e3,sseFilter:r,enabled:i=!0,suppressSseRefetch:a=!1}=t,[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(i&&!!e),[u,d]=(0,b.useState)(null),f=(0,b.useRef)(!0),p=(0,b.useRef)(r);p.current=r;let m=(0,b.useRef)(!1),h=(0,b.useRef)(null),g=(0,b.useRef)(null),_=(0,b.useRef)(null),v=(0,b.useRef)(a);v.current=a;let y=(0,b.useCallback)(async()=>{if(!e||!i)return;g.current?.abort(),g.current=new AbortController;let t=await Pm(e,{signal:g.current.signal});if(!t.ok){if(t.error.isAborted)return;f.current&&(d(t.error.message),l(!1));return}f.current&&(t.status!==304&&(0,b.startTransition)(()=>{s(t.data)}),d(null),l(!1))},[e,i]);return(0,b.useEffect)(()=>{if(f.current=!0,!i||!e){l(!1);return}l(!0),y();function t(){h.current&&clearInterval(h.current);let e=m.current?Math.max(n*3,15e3):n;h.current=setInterval(y,e)}return t(),()=>{f.current=!1,g.current?.abort(),h.current&&=(clearInterval(h.current),null)}},[y,n,i,e]),(0,b.useEffect)(()=>{if(!i||!p.current)return;let e=Hm(e=>{if(e.type===`connected`){if(!m.current){m.current=!0,h.current&&clearInterval(h.current);let e=Math.max(n*3,15e3);h.current=setInterval(y,e)}return}if(e.type===`disconnect`||e.type===`error`){m.current&&(m.current=!1,h.current&&clearInterval(h.current),h.current=setInterval(y,n));return}if(p.current?.(e)){if(v.current)return;_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{_.current=null,y()},1500)}});return()=>{e(),m.current=!1,_.current&&=(clearTimeout(_.current),null)}},[i,y,n]),{data:o,loading:c,error:u,refresh:y}}async function Wm(){let e=await Pm(`/api/task-tags`);if(!e.ok)throw Error(e.error.message);return e.data.taskTags}async function Gm(e){let t=await Pm(`/api/task-tags`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(t.error.message);return t.data}async function Km(e,t){let n=await Pm(`/api/task-tags/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(n.error.message);return n.data}async function qm(e){let t=await Pm(`/api/task-tags/${e}`,{method:`DELETE`});if(!t.ok)throw Error(t.error.message);return t.data}async function Jm(e){let t=await Pm(`/api/dispatch-context-labels`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(t.error.message);return t.data}async function Ym(e,t){let n=await Pm(`/api/dispatch-context-labels/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(n.error.message);return n.data}async function Xm(e){let t=await Pm(`/api/dispatch-context-labels/${e}`,{method:`DELETE`});if(!t.ok)throw Error(t.error.message);return t.data}function Zm(e=15e3){let[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(!1),[s,c]=(0,b.useState)(null),{data:l,loading:u,error:d,refresh:f}=Um(`/api/backlog`,{interval:e,sseFilter:e=>e.type===`update`||e.type===`new-run`});async function p(e,t){i(t),c(null);try{let n=await Pm(`/api/backlog`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok){let e={issueId:t,message:n.error.message};throw c(e),Error(e.message)}return await f(),n.data}catch(e){throw e instanceof Error&&c({issueId:t,message:e.message}),e}finally{i(null)}}async function m(e,t){n(e);try{await p({action:`move-issue`,issueId:e,toState:t},e)}finally{n(null)}}async function h(e){await p({action:`link-repository`,...e},e.issueId)}async function g(e){await p({action:`update-repository-settings`,...e},e.issueId)}async function _(e){await p({action:`create-pull-request`,...e},e.issueId)}async function v(e){await p({action:`update-project-collaboration`,...e},e.projectId)}async function y(e){await p({action:`update-issue-collaboration`,...e},e.issueId)}async function x(e){await p({action:`update-issue-dispatch-context-labels`,...e},e.issueId)}async function S(e){o(!0);try{return await p({action:`create-issue`,...e},e.projectId)}finally{o(!1)}}async function C(e){await p({action:`create-sub-issue`,...e},e.parentIssueId)}async function w(e){await p({action:`link-child-issue`,...e},e.parentIssueId)}async function T(e){return p({action:`update-issue-detail`,...e},e.issueId)}async function E(e){await p({action:`create-issue-workspace`,issueId:e},e)}async function D(e){await p({action:`link-issue-workspace`,...e},e.issueId)}return{snapshot:l?.snapshot,board:l?.board,summary:l?.summary,loading:u,error:d,refresh:f,moveIssue:m,linkRepository:h,updateRepositorySettings:g,createPullRequest:_,createIssue:S,updateProjectCollaboration:v,updateIssueCollaboration:y,updateIssueDispatchContextLabels:x,createSubIssue:C,linkChildIssue:w,updateIssueDetail:T,createIssueWorkspace:E,linkIssueWorkspace:D,movingIssueId:t,mutatingIssueId:r,creatingIssue:a,mutationError:s}}function Qm(){let[e,t]=(0,b.useState)([]),[n,r]=(0,b.useState)(!0),[i,a]=(0,b.useState)(null);return(0,b.useEffect)(()=>{let e=!1;return Wm().then(n=>{e||(t(n),a(null))}).catch(n=>{e||(t([]),a(n instanceof Error?n.message:String(n)))}).finally(()=>{e||r(!1)}),()=>{e=!0}},[]),{taskTags:e,loading:n,error:i}}function $m(e){return e==null||!Number.isFinite(e)?`unavailable`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:4}).format(e)}function eh(e){return e==null||!Number.isFinite(e)||e<=0?`0`:new Intl.NumberFormat(`en-US`).format(e)}function th(e){return e==null||!Number.isFinite(e)||e<=0?`timestamp unavailable`:new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function nh(e){return!Number.isFinite(e)||e<=0?`0 B`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function rh(e){return e.startsWith(`/`)||e.startsWith(`\\\\`)||/^[a-zA-Z]:[\\/]/.test(e)}function ih(e,t){let n=e.includes(`\\`)?`\\`:`/`;return`${e.replace(/[\\/]+$/,``)}${n}${t.replace(/^[./\\\/]+/,``)}`}function ah(e,t){return t.trim()?rh(t)?t:e?ih(e,t):null:null}function oh(e){return`vscode://file${e}`}function sh(e,t){return t.trim()?e.trim()?`${e.trimEnd()}\n${t}`:t:e}function ch(e){return`Relevant file: ${e}`}function lh(e){return`Use the attached file: ${e}`}function uh(e){return e.split(/[\\/]/).filter(Boolean).at(-1)??e}function dh(e,t){if(t===`error`||e===`error`)return`border-error/25 bg-error/8`;switch(e){case`user`:return`border-primary/20 bg-primary/6`;case`assistant`:return`border-success/20 bg-success/6`;case`thinking`:return`border-warning/25 bg-warning/8`;case`tool`:return`border-info/25 bg-info/8`;case`system`:return`border-border bg-background/75`;case`branch`:return`border-primary/20 bg-primary/8`;default:return`border-border bg-background/75`}}function fh(e,t){if(t===`error`||e===`error`)return`border-error/25 bg-error/10 text-error`;switch(e){case`user`:return`border-primary/20 bg-primary/10 text-primary`;case`assistant`:return`border-success/20 bg-success/10 text-success`;case`thinking`:return`border-warning/20 bg-warning/10 text-warning`;case`tool`:return`border-info/20 bg-info/10 text-info`;case`branch`:return`border-primary/20 bg-primary/10 text-primary`;default:return`border-border bg-background text-foreground-muted`}}function ph(e){switch(e){case`yolo`:return`Auto approve`;case`deny`:return`Auto deny`;default:return`Prompt`}}function mh(e){let t=Array.isArray(e?.approvalModes)?e.approvalModes.filter(e=>e===`yolo`||e===`prompt`||e===`deny`):[];return t.length>0?t:[`prompt`]}function hh(e){let t=[...e].reverse().find(e=>e.status===`running`);if(!t)return e.length>0?100:0;let n=t.segments.length;if(n===0)return 0;let r=t.segments.filter(e=>e.status!==`running`).length;return Math.round(r/n*100)}async function gh(e){return await new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{if(typeof r.result==`string`){t(r.result);return}n(Error(`Failed to read ${e.name}`))},r.onerror=()=>n(r.error??Error(`Failed to read ${e.name}`)),r.readAsDataURL(e)})}async function _h(e){return!e||e.length===0?[]:await Promise.all(Array.from(e).map(async(e,t)=>{let n=await gh(e),[,r=``]=n.split(`,`,2),i=e.type||`application/octet-stream`,a=i.startsWith(`image/`);return{id:typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`${Date.now()}-${t}-${e.name}`,name:e.name,mimeType:i,base64:r,size:e.size,isImage:a,previewUrl:a?n:void 0}}))}function vh(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border px-4 py-6 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-2 leading-6 text-foreground-muted`,children:e.body})]})}function yh(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-3`,children:[(0,K.jsx)(`div`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-semibold text-foreground`,children:e.value}),e.detail?(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:e.detail}):null]})}function bh(e){return(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-[11px] uppercase tracking-[0.16em]`,e.segment.status===`error`?`border-error/25 bg-error/10 text-error`:e.segment.status===`running`?`border-warning/20 bg-warning/10 text-warning`:`border-border bg-background text-foreground-muted`),children:e.segment.kind})}function xh(e){let t=e.node.filePaths.slice(0,6);return(0,K.jsx)(`div`,{className:q(`flex`,e.node.kind===`user`?`justify-end`:`justify-start`),children:(0,K.jsxs)(`article`,{className:q(`w-full max-w-[96%] rounded-[24px] border p-4 shadow-sm`,dh(e.node.kind,e.node.status)),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em]`,fh(e.node.kind,e.node.status)),children:e.node.kind}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:e.node.label}),(0,K.jsx)(G,{to:`/dispatches/${e.node.runId}`,className:`text-xs text-primary`,children:e.node.runId}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:th(e.node.timestamp)})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>e.onReuseText(e.node.text),children:e.node.kind===`user`?`Edit`:`Reuse`})})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words text-sm leading-6 text-foreground-secondary`,children:e.node.text}),t.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:t.map(t=>{let n=ah(e.workspacePath,t);return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 rounded-full border border-border bg-background px-3 py-1.5 text-xs`,children:[n?(0,K.jsx)(`a`,{href:oh(n),target:`_blank`,rel:`noreferrer`,className:`text-primary`,children:t}):(0,K.jsx)(`span`,{className:`text-foreground-secondary`,children:t}),(0,K.jsx)(`button`,{type:`button`,className:`text-foreground-muted hover:text-foreground`,onClick:()=>e.onMentionFile(t),children:e.mentionLabel})]},`${e.node.id}-${t}`)})}):null]})})}function Sh(e){let t=ah(e.workspacePath,e.file.path);return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[t?(0,K.jsx)(`a`,{href:oh(t),target:`_blank`,rel:`noreferrer`,className:`text-sm font-medium text-primary`,children:e.file.path}):(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.file.path}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[e.file.runIds.length,` runs · `,e.file.tools.length,` tools`]})]}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>e.onMentionFile(e.file.path),children:e.mentionLabel})]}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-4`,children:[(0,K.jsx)(yh,{label:`Touches`,value:eh(e.file.touches)}),(0,K.jsx)(yh,{label:`Reads`,value:eh(e.file.reads)}),(0,K.jsx)(yh,{label:`Writes`,value:eh(e.file.writes)}),(0,K.jsx)(yh,{label:`Last event`,value:th(e.file.lastEventAt)})]}),e.file.tools.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.file.tools.map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:t},`${e.file.path}-${t}`))}):null]})}function Ch(e){let{store:t}=dr(),n=Be(),{taskTags:r}=Qm(),i=(0,b.useRef)(null),a=(0,b.useRef)(null),[o,s]=(0,b.useState)(`transcript`),[c,l]=(0,b.useState)(``),[u,d]=(0,b.useState)(e.sessionAgent),[f,p]=(0,b.useState)(e.sessionModel??``),[m,h]=(0,b.useState)(`prompt`),[g,_]=(0,b.useState)([]),[v,y]=(0,b.useState)(!1),[x,S]=(0,b.useState)(null),[C,w]=(0,b.useState)(!0),T=pr(t,e=>e.agents.byId),E=(0,b.useMemo)(()=>e.runs.map(e=>String(e.runId??``)).filter(e=>e.length>0),[e.runs]),D=(0,b.useMemo)(()=>e.flowModelOverride??or(e.runs,e.eventBuffers),[e.eventBuffers,e.flowModelOverride,e.runs]),O=(0,b.useMemo)(()=>e.sessionCostOverride??Wn(E,e.eventBuffers),[e.eventBuffers,e.sessionCostOverride,E]),k=(0,b.useMemo)(()=>hh(D.lanes),[D.lanes]),A=(0,b.useMemo)(()=>Object.values(T).sort((e,t)=>String(e.displayName??e.agent).localeCompare(String(t.displayName??t.agent))),[T]),j=T[u],M=(0,b.useMemo)(()=>mh(j??null),[j]),N=j?.supportsImageInput===!0,P=j?.supportsFileAttachments===!0,ee=N||P,F=P?`Attach file`:`Insert path`,I=u!==e.sessionAgent,te=(0,b.useMemo)(()=>D.transcript.map(e=>`${e.id}:${e.timestamp??0}:${e.text.length}`).join(`|`),[D.transcript]);(0,b.useEffect)(()=>{l(``),S(null),_([]),d(e.sessionAgent),p(e.sessionModel??``),h(`prompt`),w(!0)},[e.sessionAgent,e.sessionId,e.sessionModel]),(0,b.useEffect)(()=>{M.includes(m)||h(M[0]??`prompt`)},[M,m]),(0,b.useEffect)(()=>{ee||_([])},[ee]),(0,b.useEffect)(()=>{if(o!==`transcript`)return;let e=a.current;if(!e||!C)return;let t=()=>{e.scrollTop=e.scrollHeight};if(typeof window<`u`&&typeof window.requestAnimationFrame==`function`){let e=window.requestAnimationFrame(t);return()=>window.cancelAnimationFrame(e)}t()},[C,te,o]),(0,b.useEffect)(()=>{if(o!==`transcript`)return;let e=e=>{if(e.key!==`PageUp`&&e.key!==`Home`)return;let t=e.target;t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.tagName===`SELECT`||t?.isContentEditable||w(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]);function ne(e){return e.scrollHeight-(e.scrollTop+e.clientHeight)<=48}function re(e){o===`transcript`&&w(ne(e.currentTarget))}function ie(e){l(t=>sh(t,e)),S(null)}function L(t){let n=ah(e.workspacePath,t);if(P&&n){_(e=>e.some(e=>e.filePath===n)?e:[...e,{id:`file:${n}`,filePath:n,name:uh(t),size:0,isImage:!1}]),l(e=>sh(e,lh(t))),S(null),s(`transcript`);return}l(e=>sh(e,ch(n??t))),S(P&&!n?`This agent can take files, but the workspace path could not be resolved. The path was inserted into the prompt instead.`:null),s(`transcript`)}async function R(e){try{let t=await _h(e.currentTarget.files);_(e=>[...e,...t]),S(null)}catch(e){S(e instanceof Error?e.message:String(e))}finally{e.currentTarget.value=``}}async function ae(t){if(t.preventDefault(),!(e.disabled||v||!c.trim()&&g.length===0)){y(!0),S(null);try{await e.onSubmit({sessionId:e.sessionId,prompt:c,agent:u,model:f.trim()||void 0,attachments:g.map(({id:e,isImage:t,previewUrl:n,size:r,...i})=>i),approvalMode:m}),l(``),_([])}catch(e){S(e instanceof Error?e.message:String(e))}finally{y(!1)}}}let oe=[{id:`transcript`,label:`Chat`,icon:Sp},{id:`flow`,label:`Trace`,icon:Gp},{id:`files`,label:`Files`,icon:rp}];return(0,K.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:`Conversation`}),(0,K.jsx)(`div`,{className:`mt-1 text-sm font-medium text-foreground`,children:e.sessionLabel}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.sessionStatus}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.sessionAgent}),e.sessionModel?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.sessionModel}):null,e.runtime?.preview?.status===`ready`?(0,K.jsx)(`span`,{className:`rounded-full border border-success/20 bg-success/10 px-2 py-1 text-success`,children:`preview ready`}):null]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[e.openSessionHref?(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>n(e.openSessionHref),children:`Open session`}):null,e.workspacePath?(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>n(`/workspaces?workspace=${encodeURIComponent(e.workspacePath)}`),children:`Open workspace`}):null]})]})}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:oe.map(e=>{let t=e.icon;return(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:o===e.id?`default`:`ghost`,onClick:()=>s(e.id),children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]},e.id)})}),(0,K.jsx)(`div`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:`Transcript first, trace on demand`})]}),(0,K.jsxs)(`div`,{ref:a,className:`mt-4 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1`,"data-testid":`conversation-scroll-region`,onScroll:re,children:[o===`transcript`?(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[D.transcript.map(t=>(0,K.jsx)(xh,{node:t,workspacePath:e.workspacePath,onReuseText:ie,onMentionFile:L,mentionLabel:F},t.id)),D.transcript.length===0?(0,K.jsx)(vh,{title:e.emptyStateTitle,body:e.emptyStateBody}):null]}):null,o===`flow`?(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[D.lanes.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.status}),(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.agent}),(0,K.jsx)(G,{to:`/dispatches/${e.runId}`,className:`text-xs text-primary`,children:e.runId})]}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[th(e.startedAt),` · `,e.segmentCount,` segments · `,e.toolCount,` tools`]})]}),(0,K.jsx)(`div`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:$m(e.totalUsd)})]}),(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:e.segments.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(bh,{segment:e}),(0,K.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:e.title})]}),(0,K.jsx)(`div`,{className:`mt-1 max-w-[18rem] text-xs text-foreground-muted`,children:e.detail})]},e.id))})]},e.runId)),D.lanes.length===0?(0,K.jsx)(vh,{title:`No flow events`,body:`Run lanes will appear here once the session starts publishing structured events.`}):null]}):null,o===`files`?(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[D.files.map(t=>(0,K.jsx)(Sh,{file:t,workspacePath:e.workspacePath,onMentionFile:L,mentionLabel:F},t.path)),D.files.length===0?(0,K.jsx)(vh,{title:`No file attention yet`,body:`File touches will appear once the session reads or modifies paths through tools or system events.`}):null]}):null,(0,K.jsxs)(`details`,{className:`mt-4 rounded-2xl border border-border bg-card/60`,"data-testid":`conversation-stats-details`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm font-medium text-foreground`,children:`Session stats`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-t border-border px-4 py-4 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[eh(D.transcript.length),` messages`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[eh(D.files.filter(e=>e.writes>0).length),` files changed`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[$m(O?.totalUsd),` total cost`]})]}),(0,K.jsxs)(`div`,{className:`grid gap-3 border-t border-border px-4 py-4 sm:grid-cols-2 xl:grid-cols-5`,children:[(0,K.jsx)(yh,{label:`Token usage`,value:eh((O?.inputTokens??0)+(O?.outputTokens??0)+(O?.thinkingTokens??0)),detail:`${eh(O?.inputTokens)} in · ${eh(O?.outputTokens)} out`}),(0,K.jsx)(yh,{label:`Cost`,value:$m(O?.totalUsd),detail:`${eh(O?.thinkingTokens)} thinking tokens`}),(0,K.jsx)(yh,{label:`Task progress`,value:`${k}%`,detail:`${D.summary.pendingTools} pending tools`}),(0,K.jsx)(yh,{label:`File changes`,value:eh(D.files.filter(e=>e.writes>0).length),detail:`${eh(D.summary.fileCount)} files touched`}),(0,K.jsx)(yh,{label:`Tools`,value:eh(D.summary.totalTools),detail:`${eh(D.summary.pendingTools)} still running`})]}),(0,K.jsx)(`div`,{className:`border-t border-border px-4 py-4`,children:(0,K.jsx)(Sm,{value:k,variant:`default`,glow:!0})})]})]}),(0,K.jsx)(`div`,{className:`sticky bottom-0 z-10 mt-4 shrink-0 rounded-3xl border border-border bg-card/95 px-4 py-4 shadow-lg supports-[backdrop-filter]:bg-card/92`,"data-testid":`conversation-composer`,children:(0,K.jsxs)(`form`,{onSubmit:ae,className:`grid gap-3`,children:[(0,K.jsxs)(`label`,{className:`grid gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Send another turn`}),(0,K.jsx)(Tm,{taskTags:r,value:c,onValueChange:l,disabled:e.disabled,renderTextarea:t=>(0,K.jsx)(`textarea`,{...t,rows:6,placeholder:e.placeholder,className:`min-h-36 rounded-2xl border border-border bg-background/70 px-4 py-3 text-sm text-foreground outline-none transition-colors focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-60`})})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:"Task tags via `@tag`"}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:ee?`Attachments enabled`:`This agent does not advertise attachment support`}),N?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:`Image input ready`}):null]}),I?(0,K.jsx)(`div`,{className:`rounded-2xl border border-warning/20 bg-warning/10 px-4 py-3 text-sm text-warning`,children:`Switching agents continues this prompt in a new session. The new session keeps the current workspace and issue link, then becomes the focused chat.`}):null,(0,K.jsxs)(`details`,{className:`rounded-2xl border border-border bg-card/60`,"data-testid":`composer-options-details`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm font-medium text-foreground`,children:`Dispatch options`}),(0,K.jsxs)(`div`,{className:`grid gap-3 border-t border-border px-4 py-4 xl:grid-cols-[minmax(0,1fr)_minmax(16rem,0.9fr)_minmax(12rem,0.7fr)]`,children:[(0,K.jsxs)(`label`,{className:`grid gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Agent`}),(0,K.jsx)(en,{value:u,disabled:e.disabled||A.length===0,onChange:d,options:A.length===0?[{label:u,value:u}]:A.map(e=>({label:String(e.displayName??e.agent),value:e.agent}))})]}),(0,K.jsxs)(`label`,{className:`grid gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Variant / model`}),(0,K.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),disabled:e.disabled,placeholder:`Leave blank for session default`,className:`rounded-2xl border border-border bg-background/70 px-4 py-3 text-sm text-foreground outline-none transition-colors focus:border-primary/40 disabled:cursor-not-allowed disabled:opacity-60`})]}),(0,K.jsxs)(`label`,{className:`grid gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:`Approvals`}),(0,K.jsx)(en,{value:m,onChange:e=>h(e),disabled:e.disabled,options:M.map(e=>({label:ph(e),value:e}))})]})]})]}),g.length>0?(0,K.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:g.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.isImage?(0,K.jsx)(ep,{className:`h-4 w-4 text-primary`}):(0,K.jsx)(tp,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`attachment`})]}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:e.filePath?`workspace file`:`${e.mimeType??`application/octet-stream`} · ${nh(e.size)}`})]}),(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-foreground-muted hover:text-foreground`,onClick:()=>_(t=>t.filter(t=>t.id!==e.id)),children:`Remove`})]}),e.previewUrl?(0,K.jsx)(`img`,{src:e.previewUrl,alt:e.name??`attachment preview`,className:`mt-3 max-h-36 rounded-xl border border-border object-cover`}):null]},e.id))}):null,x?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/20 bg-error-muted px-4 py-3 text-sm text-error`,children:x}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsx)(`input`,{ref:i,type:`file`,multiple:!0,accept:P?void 0:N?`image/*`:void 0,className:`hidden`,onChange:e=>void R(e)}),(0,K.jsx)(J,{type:`submit`,disabled:e.disabled||v||!c.trim()&&g.length===0,children:v?`Sending...`:e.submitLabel??`Send turn`}),(0,K.jsxs)(J,{type:`button`,variant:`ghost`,disabled:e.disabled||!ee,onClick:()=>i.current?.click(),children:[N?(0,K.jsx)(ep,{className:`h-4 w-4`}):(0,K.jsx)(rp,{className:`h-4 w-4`}),`Attach`]}),(0,K.jsx)(`div`,{className:`rounded-full border border-border px-3 py-2 text-xs text-foreground-muted`,children:m===`prompt`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Hf,{className:`mr-1 inline h-3.5 w-3.5`}),`Interactive approvals`]}):m===`yolo`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(nm,{className:`mr-1 inline h-3.5 w-3.5`}),`Auto-approve on restart`]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)($p,{className:`mr-1 inline h-3.5 w-3.5`}),`Auto-deny on restart`]})}),v?(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-border px-3 py-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(vp,{className:`h-3.5 w-3.5 animate-spin`}),`Dispatching turn`]}):null,!v&&D.summary.pendingTools>0?(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 rounded-full border border-warning/20 bg-warning/8 px-3 py-2 text-xs text-warning`,children:[(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`}),D.summary.pendingTools,` tool calls still running`]}):null]})]})})]})}function wh(e){switch(e){case`dispatch`:return`Ready for dispatch`;case`executing`:return`Executing on the board`;case`review`:return`Approval and review`;case`recovery`:return`Recovery required`;case`done`:return`Execution landed`}}function Th(e){if(!e)return 0;let t=Date.parse(e);return Number.isFinite(t)?t:0}function Eh(e){return e&&typeof e==`object`?e:null}function Dh(e){return e.tasks.find(e=>e.kind===`breakpoint`&&e.status===`requested`)??null}function Oh(e){if(!e.snapshot||!e.board)return[];let t=e.nowMs??Date.now(),n=new Map(e.runs.map(e=>[e.runId,e])),r=new Map(e.board.projects.flatMap(e=>e.cards.map(e=>[e.issueId,e]))),i=new Map((e.reviewArtifacts??[]).map(e=>[e.targetId,e])),a=[];for(let o of e.snapshot.issues){let e=r.get(o.id);if(!e)continue;let s=(o.dispatch?.runIds??[]).map(e=>n.get(e)).filter(e=>!!e).sort((e,t)=>Th(t.updatedAt)-Th(e.updatedAt)),c=i.get(o.id),l=s.filter(e=>Dh(e)).length,u=s.filter(e=>e.status===`pending`||e.status===`waiting`).length,d=s.filter(e=>e.status===`failed`).length,f=s.filter(e=>e.status===`completed`).length,p=s.filter(e=>e.isStale).length,m=s[0],h=Math.max(0,s.length-1),g=p>0||s.some(e=>e.status!==`pending`&&e.status!==`waiting`?!1:t-Th(e.updatedAt)>900*1e3),_=`dispatch`;d>0||p>0||g?_=`recovery`:l>0||e.workflowState===`review`||c?.decision===`changes-requested`||c?.decision===`pending`?_=`review`:u>0||e.workflowState===`in-progress`?_=`executing`:(e.workflowState===`done`||s.length>0&&f===s.length)&&(_=`done`),a.push({issueId:o.id,issueKey:o.key,issueTitle:o.title,workflowState:e.workflowState,stage:_,stageLabel:wh(_),reviewDecision:c?.decision,runIds:s.map(e=>e.runId),sessionIds:Array.from(new Set(o.dispatch?.sessionIds??s.map(e=>e.sessionId??``).filter(Boolean))),runCount:s.length,activeRuns:u,failedRuns:d,completedRuns:f,staleRuns:p,retryCount:h,pendingBreakpoints:l,stuck:g,primaryRunId:m?.runId,primarySessionId:m?.sessionId??o.dispatch?.sessionIds?.[0],updatedAt:m?.updatedAt??o.updatedAt})}return a.sort((e,t)=>{let n=[`recovery`,`review`,`executing`,`dispatch`,`done`],r=n.indexOf(e.stage)-n.indexOf(t.stage);return r===0?Th(t.updatedAt)-Th(e.updatedAt):r})}function kh(e,t=Date.now()){let n=new Map;for(let t of e){let e=t.sessionId&&t.sessionId.length>0?`session:${t.sessionId}`:`process:${t.projectName??`unknown`}:${t.processId}`,r=n.get(e);r?r.push(t):n.set(e,[t])}return Array.from(n.values()).map(e=>e.sort((e,t)=>Th(t.updatedAt)-Th(e.updatedAt))[0]).map(e=>{let r=e.sessionId&&e.sessionId.length>0?`session:${e.sessionId}`:`process:${e.projectName??`unknown`}:${e.processId}`,i=Math.max(0,(n.get(r)?.length??1)-1),a=e.tasks.filter(e=>e.kind===`breakpoint`&&e.status===`requested`).length,o=e.isStale===!0||(e.status===`pending`||e.status===`waiting`)&&t-Th(e.updatedAt)>900*1e3,s=e.tasks.filter(e=>e.status===`error`).length,c=Dh(e),l=`healthy`;e.status===`failed`||o?l=`critical`:(a>0||s>0||i>0)&&(l=`attention`);let u=[];return a>0&&u.push(`${a} breakpoint${a===1?``:`s`}`),i>0&&u.push(`${i} retr${i===1?`y`:`ies`}`),o&&u.push(`stuck-task signal`),u.length===0&&u.push(`${e.completedTasks}/${e.totalTasks} tasks complete`),{runId:e.runId,processId:e.processId,projectName:e.projectName,sessionId:e.sessionId,status:e.status,retryCount:i,stuck:o,pendingBreakpoints:a,severity:l,recoveryHref:e.sessionId?`/sessions/${e.sessionId}`:`/dispatches/${e.runId}`,reviewHref:c?`/dispatches/${e.runId}?effectId=${encodeURIComponent(c.effectId)}`:void 0,summary:u.join(` · `),updatedAt:e.updatedAt}}).sort((e,t)=>{let n={critical:0,attention:1,healthy:2},r=n[e.severity]-n[t.severity];return r===0?Th(t.updatedAt)-Th(e.updatedAt):r})}function Ah(e){return e.map(e=>{let t=Array.isArray(e.tasks)?e.tasks:[],n=t.find(e=>{let t=Eh(e);return t?.kind===`breakpoint`&&t.status===`requested`&&typeof t.effectId==`string`}),r=t.find(e=>{let t=Eh(e);return t?.status===`error`&&typeof t.effectId==`string`});return{runId:String(e.runId??``),processId:String(e.processId??`unknown`),status:e.status??`pending`,sessionId:typeof e.sessionId==`string`?e.sessionId:void 0,breakpointEffectId:n?.effectId,errorEffectId:r?.effectId,logTaskCount:t.filter(e=>{let t=Eh(e);return!!(t?.stdout||t?.stderr)}).length,resultTaskCount:t.filter(e=>!!Eh(e)?.result).length,pendingBreakpointCount:t.filter(e=>{let t=Eh(e);return t?.kind===`breakpoint`&&t.status===`requested`}).length,failedTaskCount:t.filter(e=>Eh(e)?.status===`error`).length}})}function jh(e){return e==null||!Number.isFinite(e)||e<=0?`unknown`:new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function Mh(e){return!e||typeof e!=`object`?null:e}function Nh(e){return e.startsWith(`/`)||e.startsWith(`\\\\`)||/^[a-zA-Z]:[\\/]/.test(e)}function Ph(e,t){let n=e.includes(`\\`)?`\\`:`/`;return`${e.replace(/[\\/]+$/,``)}${n}${t.replace(/^[./\\\/]+/,``)}`}function Fh(e,t){return t.trim()?Nh(t)?t:e?Ph(e,t):null:null}function Ih(e){return`vscode://file${e}`}function Lh(e){return typeof e?.preview?.primaryUrl==`string`&&e.preview.primaryUrl.length>0?e.preview.primaryUrl:typeof e?.devServer?.primaryUrl==`string`&&e.devServer.primaryUrl.length>0?e.devServer.primaryUrl:null}function Rh(e){return[`inline-flex items-center gap-1 rounded-full border border-border px-2 py-1 text-xs`,e.external?`text-foreground-muted hover:text-foreground`:`text-primary`].join(` `)}function zh(e){return e.actions.length===0?null:(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:e.actions.map(e=>e.external?(0,K.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:Rh(e),children:e.label},e.key):(0,K.jsx)(G,{to:e.href,className:Rh(e),children:e.label},e.key))})}function Bh(e){let[t,n]=(0,b.useState)(`flow`),r=(0,b.useMemo)(()=>e.flowModelOverride??or(e.runs,e.eventBuffers),[e.eventBuffers,e.flowModelOverride,e.runs]),i=Ah(e.runs),a=Lh(e.runtime??null),o=(0,b.useMemo)(()=>{let t=new Map(i.map(e=>[e.runId,e])),n=e.runs.map(n=>{let r=String(n.runId??``),i=t.get(r),o=typeof n.cwd==`string`&&n.cwd.length>0?n.cwd:e.workspacePath??null,s=Lh(Mh(n.runtime)??e.runtime??null)??a;return[r,{runId:r,runHref:`/dispatches/${encodeURIComponent(r)}`,workspaceHref:o?Ih(o):void 0,runtimeHref:s??void 0,breakpointHref:i?.breakpointEffectId?`/dispatches/${encodeURIComponent(r)}?effectId=${encodeURIComponent(i.breakpointEffectId)}`:void 0,failedTaskHref:i?.errorEffectId?`/dispatches/${encodeURIComponent(r)}?effectId=${encodeURIComponent(i.errorEffectId)}`:void 0,fileHref:e=>{let t=Fh(o,e);return t?Ih(t):null}}]});return new Map(n)},[a,e.runs,e.runtime,e.workspacePath,i]),s=(e,t,n)=>{let r=o.get(e);if(!r)return[];let i=[{key:`${e}:run`,label:`Open dispatch`,href:r.runHref}];n?.includeFailures&&r.breakpointHref&&i.push({key:`${e}:breakpoint`,label:`Review breakpoint`,href:r.breakpointHref}),n?.includeFailures&&r.failedTaskHref&&i.push({key:`${e}:failed`,label:`Open failed task`,href:r.failedTaskHref});let a=t.map(e=>({path:e,href:r.fileHref(e)})).find(e=>e.href!=null);return a?.href&&i.push({key:`${e}:file:${a.path}`,label:`Open file`,href:a.href,external:!0}),r.workspaceHref&&i.push({key:`${e}:workspace`,label:`Open workspace`,href:r.workspaceHref,external:!0}),r.runtimeHref&&i.push({key:`${e}:runtime`,label:`Open runtime`,href:r.runtimeHref,external:!0}),i},c=[{value:`flow`,label:`Trace`,badge:r.lanes.length,body:(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[r.lanes.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.agent}),(0,K.jsxs)(`div`,{className:`text-xs text-foreground-muted`,children:[e.startedAt>0?`${jh(e.startedAt)} · `:``,`dispatch `,e.runId]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5`,children:e.status}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5`,children:[e.segmentCount,` phases`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5`,children:[e.toolCount,` tools`]})]})]}),(0,K.jsx)(`div`,{className:`mt-4 flex gap-3 overflow-x-auto pb-1`,children:e.segments.map(t=>(0,K.jsxs)(`article`,{className:`min-w-44 rounded-2xl border border-border bg-card p-4`,style:{flexGrow:t.weight},children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:t.title}),t.secondaryLabel?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:t.secondaryLabel}):null]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-secondary`,children:t.detail}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:t.kind}),(0,K.jsx)(`span`,{children:t.status}),t.filePaths.length>0?(0,K.jsxs)(`span`,{children:[t.filePaths.length,` files`]}):null]}),(0,K.jsx)(zh,{actions:s(e.runId,t.filePaths,{includeFailures:!0})})]},t.id))})]},e.runId)),r.lanes.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`No structured execution flow is available for this session yet.`}):null]})},{value:`files`,label:`Files`,badge:r.files.length,body:(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[r.files.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-sm text-foreground`,children:e.path}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[e.touches,` touches`]})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[e.reads,` reads`]}),(0,K.jsxs)(`span`,{children:[e.writes,` writes`]}),(0,K.jsxs)(`span`,{children:[e.runIds.length,` dispatches`]}),e.tools.length>0?(0,K.jsxs)(`span`,{children:[e.tools.length,` tools`]}):null]}),(0,K.jsx)(zh,{actions:s(e.runIds[0]??``,[e.path],{includeFailures:!0})})]},e.path)),r.files.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`File attention will appear here once the session touches the workspace.`}):null]})}];return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Realtime execution`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:`Dispatch trace reconstructed on the gateway stack`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Trace lanes and file attention are projected from the same live event buffers so session review stays aligned with current dispatch activity.`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[`Session `,e.sessionId]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1`,children:[r.summary.totalRuns,` dispatches`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1`,children:[r.summary.totalSegments,` segments`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1`,children:[r.summary.totalTools,` tools`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1`,children:[r.summary.fileCount,` files`]})]}),(0,K.jsxs)(`div`,{className:`mt-6 grid gap-6 xl:grid-cols-[minmax(0,1.2fr)_360px]`,children:[(0,K.jsx)(`div`,{children:(0,K.jsx)(Xt,{value:t,onChange:e=>n(e),items:c})}),(0,K.jsxs)(`aside`,{className:`space-y-4`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(qp,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Artifact shortcuts`})]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[i.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(G,{to:`/dispatches/${e.runId}`,className:`font-mono text-sm text-primary`,children:e.runId}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:e.status})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:e.processId}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[e.logTaskCount,` log tasks`]}),(0,K.jsxs)(`span`,{children:[e.resultTaskCount,` result payloads`]}),e.failedTaskCount>0?(0,K.jsxs)(`span`,{children:[e.failedTaskCount,` failed tasks`]}):null]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[e.breakpointEffectId?(0,K.jsxs)(G,{to:`/dispatches/${e.runId}?effectId=${encodeURIComponent(e.breakpointEffectId)}`,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(lp,{className:`h-3 w-3`}),`Review breakpoint`]}):null,e.errorEffectId?(0,K.jsxs)(G,{to:`/dispatches/${e.runId}?effectId=${encodeURIComponent(e.errorEffectId)}`,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)($p,{className:`h-3 w-3`}),`Open failed task`]}):null,(0,K.jsxs)(G,{to:`/dispatches/${e.runId}`,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(Mf,{className:`h-3 w-3`}),`Open dispatch`]})]})]},e.runId)),i.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`Dispatch artifacts will appear here once the session emits execution data.`}):null]})]}),(0,K.jsx)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,K.jsx)(Vf,{className:`h-4 w-4 text-success`}),`Kanban now shows the same reconstructed realtime execution story as agent-mux instead of a reduced overlay summary.`]})})]})]})]})}function Vh(e){let t=(0,b.useRef)(e);t.current=e,(0,b.useEffect)(()=>{let e=e=>{let n=e.target;if(!(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.tagName===`SELECT`||n.isContentEditable)){for(let n of t.current)if(e.key===n.key&&!!e.ctrlKey==!!n.ctrl&&!!e.shiftKey==!!n.shift){e.preventDefault(),n.action();return}}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[])}var Hh=`kanban:`,Uh=typeof window<`u`?b.useLayoutEffect:b.useEffect;function Wh(e,t){let n=e.startsWith(Hh)?e:`${Hh}${e}`,[r,i]=(0,b.useState)(t);return Uh(()=>{try{let e=window.localStorage.getItem(n);e!==null&&i(JSON.parse(e))}catch{}},[n]),[r,(0,b.useCallback)(e=>{i(t=>{let r=typeof e==`function`?e(t):e;try{typeof window<`u`&&window.localStorage.setItem(n,JSON.stringify(r))}catch{}return r})},[n])]}var Gh=[`sidebar`,`conversation`,`context`,`details`],Kh={sidebar:20,conversation:36,context:24,details:20},qh=1280;function Jh(e){return Object.values(e).some(Boolean)?e:{...e,conversation:!0}}function Yh(e){let t=Jh(e);return Gh.filter(e=>t[e])}function Xh(e,t){return Jh({...e,[t]:!e[t]})}function Zh(e,t){let n=Jh(t),r=Yh(n),i=r.reduce((t,n)=>t+Math.max(e[n],0),0),a=r.reduce((e,t)=>e+Kh[t],0);return Gh.reduce((t,r)=>{if(!n[r])return t[r]=e[r],t;let o=i>0?e[r]:Kh[r],s=i>0?i:a;return t[r]=s>0?o/s*100:0,t},{...e})}function Qh(e){let{sizes:t,visibility:n,leftPanel:r,rightPanel:i,deltaPercentage:a,minPercentage:o=14}=e,s=Jh(n);if(!s[r]||!s[i])return t;let c=Zh(t,s),l=c[r],u=c[i],d=o-l,f=u-o,p=Math.max(d,Math.min(a,f));return{...t,[r]:l+p,[i]:u-p}}function $h(e){return(0,K.jsxs)(`section`,{className:e.className,children:[(0,K.jsx)(`h3`,{className:`text-lg font-semibold tracking-tight`,children:e.title}),e.audits.length===0?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border bg-background/60 p-4 text-sm text-foreground-muted`,children:e.emptyText}):(0,K.jsx)(`div`,{className:`mt-3 grid gap-3`,children:e.audits.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:e.issueKey}),(0,K.jsx)(`div`,{className:`mt-1 text-sm font-semibold text-foreground`,children:e.issueTitle})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[e.executionContext.metadata.labelCount,` label`,e.executionContext.metadata.labelCount===1?``:`s`]})]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:e.executionContext.appliedLabels.map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:t.key},`${e.issueId}-${t.labelId}`))}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-foreground-muted md:grid-cols-3`,children:[(0,K.jsx)(eg,{label:`Source`,value:e.executionContext.source}),(0,K.jsx)(eg,{label:`Label ids`,value:e.executionContext.metadata.labelIds.join(`, `)}),(0,K.jsx)(eg,{label:`Last dispatched`,value:e.lastDispatchedAt?new Date(e.lastDispatchedAt).toLocaleString():`Unavailable`})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:e.executionContext.renderedBlock})]},`${e.issueId}-${e.lastDispatchedAt??`pending`}`))})]})}function eg(e){return(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card/80 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`uppercase tracking-[0.18em]`,children:e.label}),(0,K.jsx)(`div`,{className:`mt-1 break-words font-mono text-[11px] text-foreground-secondary`,children:e.value})]})}function tg(e){return e.contexts.length===0?null:(0,K.jsxs)(`section`,{className:q(`rounded-3xl border border-border bg-card p-5 shadow-lg`,e.className),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Execution context`}),(0,K.jsx)(`h3`,{className:`mt-2 text-xl font-semibold tracking-tight`,children:e.title??`Attached dispatch context`}),e.description?(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm text-foreground-muted`,children:e.description}):null]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:[e.contexts.length,` linked issue`,e.contexts.length===1?``:`s`]})]}),(0,K.jsx)(`div`,{className:q(`mt-4 grid gap-4`,e.compact?``:`xl:grid-cols-2`),children:e.contexts.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.project.key?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:e.project.key}):null,(0,K.jsx)(`span`,{className:`rounded-full border border-info/20 bg-info/10 px-2 py-0.5 text-xs text-info`,children:e.issue.key}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:e.issue.id})]}),(0,K.jsx)(`h4`,{className:`mt-3 text-sm font-semibold text-foreground`,children:e.issue.title}),(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsxs)(`div`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:[`Applied labels (`,e.dispatch.labelIds.length,`)`]}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[e.dispatch.labels.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-card px-2.5 py-1 text-xs text-foreground-secondary`,children:[e.label,` · `,e.key]},e.labelId)),e.dispatch.labels.length===0&&e.dispatch.labelIds.length>0?e.dispatch.labelIds.map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-border bg-card px-2.5 py-1 text-xs text-foreground-secondary`,children:e},e)):null]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[`Run IDs: `,e.dispatch.runIds.length>0?e.dispatch.runIds.join(`, `):`none`]}),(0,K.jsxs)(`span`,{children:[`Session IDs: `,e.dispatch.sessionIds.length>0?e.dispatch.sessionIds.join(`, `):`none`]}),(0,K.jsxs)(`span`,{children:[`Last dispatched: `,e.dispatch.lastDispatchedAt??`none`]})]}),(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`div`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Rendered block`}),(0,K.jsx)(`pre`,{className:`mt-2 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:e.block})]})]},e.issue.id))})]})}function ng(e){return!e||!Number.isFinite(e)?`unavailable`:new Date(e).toLocaleString()}function rg(e){return e===`running`||e===`ready`||e===`active`?`border-success/20 bg-success/10 text-success`:e===`starting`?`border-info/20 bg-info/10 text-info`:e===`error`||e===`failed`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}function ig(e){switch(e){case`mobile`:return Wp;case`tablet`:return Yp;default:return fp}}function ag(e){return e.id===`mobile`?720:e.id===`tablet`?680:640}function og(e){let t=e.width/e.height;return Math.min(e.width,960,Math.round(ag(e)*t))}function sg(e,t){let n=e.command.trim();return n.length>0?n:`Process ${t+1}`}function cg(e){let t=e.terminal.commands.map((e,t)=>({id:e.id,label:sg(e,t),sourceLabel:e.source,status:e.status,command:e.command,toolName:e.toolName,startedAt:e.startedAt,endedAt:e.endedAt,exitCode:e.exitCode,logs:e.logs}));return e.devServer.status===`idle`&&!e.devServer.command&&e.devServer.logs.length===0&&e.devServer.urls.length===0?t:[...t,{id:`dev-server`,label:e.devServer.command?.trim()||`Dev server`,sourceLabel:`dev server`,status:e.devServer.status,command:e.devServer.command,logs:e.devServer.logs}]}function lg(e){return e.exitCode==null?`Process failed before emitting logs.`:`Process exited with code ${e.exitCode} before emitting logs.`}function ug(e){return(0,K.jsx)(`div`,{className:q(`rounded-2xl border px-4 py-5 text-sm`,e.tone===`error`?`border-error/20 bg-error/5 text-error`:`border-dashed border-border bg-background/60 text-foreground-muted`),children:e.text})}function dg(e,t){let n=t.trim().toLowerCase();return n?e.filter(e=>e.text.toLowerCase().includes(n)):[...e]}function fg(e){let t=e.rebase&&e.rebase.status===`rebase-conflicts`?`rebase`:e.runtime.preview.primaryUrl?`preview`:e.runtime.terminal.commands.length>0?`logs`:`dev-server`,n=e.runtime.preview.deviceProfiles,[r,i]=(0,b.useState)(t),[a,o]=(0,b.useState)(n[0]?.id??`desktop`),[s,c]=(0,b.useState)(``),l=(0,b.useDeferredValue)(s),[u,d]=(0,b.useState)(null),f=(0,b.useMemo)(()=>n.find(e=>e.id===a)??n[0]??{id:`desktop`,label:`Desktop 1440`,width:1440,height:960},[a,n]),p=(0,b.useMemo)(()=>cg(e.runtime),[e.runtime]),m=(0,b.useMemo)(()=>p.find(e=>e.id===u)??p[0]??null,[p,u]),h=(0,b.useMemo)(()=>dg(m?.logs??[],l),[m?.logs,l]),g=e.sessionStatus!=null&&e.sessionStatus!==`active`;return(0,b.useEffect)(()=>{m&&m.id!==u&&d(m.id)},[m,u]),(0,K.jsxs)(`section`,{className:q(`rounded-3xl border border-border bg-card p-5 shadow-lg`,e.className),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Runtime surfaces`}),(0,K.jsx)(`h3`,{className:`mt-2 text-xl font-semibold tracking-tight`,children:`Preview, logs, inspect, and dev server`}),(0,K.jsxs)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:[`Derived from agent-mux session state and recent run events.`,e.sessionId?` Session ${e.sessionId}.`:``]})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:[`Updated `,ng(e.runtime.updatedAt)]})]}),(0,K.jsx)(Xt,{value:r,onChange:i,items:[{value:`preview`,label:`Preview`,body:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:n.map(e=>{let t=ig(e.id);return(0,K.jsxs)(J,{type:`button`,variant:e.id===f.id?`default`:`ghost`,size:`sm`,onClick:()=>o(e.id),children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]},e.id)})}),e.runtime.preview.primaryUrl?(0,K.jsx)(J,{variant:`ghost`,size:`sm`,children:(0,K.jsxs)(`a`,{href:e.runtime.preview.primaryUrl,target:`_blank`,rel:`noreferrer`,children:[`Open preview`,(0,K.jsx)(Xf,{className:`h-4 w-4`})]})}):null]}),e.runtime.preview.primaryUrl?(0,K.jsx)(`div`,{className:`rounded-[28px] border border-border bg-background/70 p-3 sm:p-4`,children:(0,K.jsxs)(`div`,{className:`mx-auto w-full rounded-[24px] border border-border bg-card p-2 shadow-sm sm:p-3`,style:{maxWidth:`${og(f)}px`},children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-center justify-between rounded-2xl border border-border bg-background/75 px-4 py-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:f.label}),(0,K.jsxs)(`span`,{children:[f.width,` x `,f.height]})]}),(0,K.jsx)(`div`,{className:`overflow-hidden rounded-2xl border border-border bg-white`,style:{aspectRatio:`${f.width} / ${f.height}`},children:(0,K.jsx)(`iframe`,{title:`Preview for ${e.runtime.workspacePath??`workspace`}`,src:e.runtime.preview.primaryUrl,className:`h-full w-full bg-white`})})]})}):(0,K.jsx)(mg,{text:`No preview URL has been detected from the workspace runtime yet.`})]})},{value:`logs`,label:`Logs`,body:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[!m&&g?(0,K.jsx)(mg,{icon:im,text:`Logs disconnected. The selected session is not publishing runtime output right now.`}):null,!m&&!g?(0,K.jsx)(mg,{text:`No active processes are publishing logs yet.`}):null,m?(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,260px)_minmax(0,1fr)]`,children:[(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:p.map(e=>(0,K.jsx)(`button`,{type:`button`,"aria-label":e.label,onClick:()=>d(e.id),className:q(`h-auto w-full rounded-2xl border bg-background/70 px-3 py-3 text-left transition-colors`,e.id===m.id?`border-primary/30 bg-primary/8`:`border-border`),children:(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.label}),(0,K.jsxs)(`div`,{"aria-hidden":`true`,className:`mt-1 flex flex-wrap items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.sourceLabel}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5`,rg(e.status)),children:e.status})]})]})},e.id))}),(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h4`,{className:`text-sm font-semibold text-foreground`,children:m.label}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs uppercase`,rg(m.status)),children:m.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:m.sourceLabel}),m.toolName?(0,K.jsx)(`span`,{className:`rounded-full border border-info/20 bg-info/10 px-2 py-0.5 text-xs text-info`,children:m.toolName}):null]}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-4 text-xs text-foreground-muted`,children:[m.startedAt?(0,K.jsxs)(`span`,{children:[`Started `,ng(m.startedAt)]}):null,m.endedAt?(0,K.jsxs)(`span`,{children:[`Ended `,ng(m.endedAt)]}):null,m.exitCode==null?null:(0,K.jsxs)(`span`,{children:[`Exit code `,m.exitCode]})]})]}),(0,K.jsxs)(`label`,{className:`flex min-w-[220px] flex-1 items-center gap-2 rounded-2xl border border-border bg-card px-3 py-2 text-sm text-foreground-muted sm:max-w-sm`,children:[(0,K.jsx)(Lp,{className:`h-4 w-4`}),(0,K.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`Search logs`,className:`w-full bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-muted`})]})]}),m.command?(0,K.jsx)(`pre`,{className:`mt-4 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:m.command}):null]}),(0,K.jsx)(`div`,{style:{overflowY:`auto`},className:`max-h-[460px] rounded-2xl border border-border bg-slate-950`,children:(0,K.jsxs)(`div`,{className:`space-y-2 p-4 font-mono text-xs leading-6 text-slate-100`,children:[m.logs.length===0?m.status===`failed`||m.status===`error`?(0,K.jsx)(ug,{text:lg(m),tone:`error`}):(0,K.jsx)(ug,{text:`Waiting for runtime output from this process.`}):null,m.logs.length>0&&h.length===0?(0,K.jsx)(ug,{text:`No log lines match "${l}" for this process.`}):null,h.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`mb-1 text-[10px] uppercase tracking-[0.18em] text-slate-400`,children:[e.stream,` · `,ng(e.timestamp)]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:e.text})]},`${m.id}:${e.timestamp}:${t}`))]})})]})]}):null]})},{value:`terminal`,label:`Terminal`,body:(0,K.jsx)(`div`,{className:`space-y-4`,children:(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[minmax(0,1fr)_360px]`,children:[(0,K.jsx)(`div`,{style:{overflowY:`auto`},className:`max-h-[420px] rounded-2xl border border-border bg-background/80`,children:(0,K.jsxs)(`div`,{className:`grid gap-3 p-4`,children:[e.runtime.terminal.commands.map((e,t)=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card/90 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs uppercase`,rg(e.status)),children:e.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:e.source}),e.toolName?(0,K.jsx)(`span`,{className:`rounded-full border border-info/20 bg-info/10 px-2 py-0.5 text-xs text-info`,children:e.toolName}):null]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:sg(e,t)}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[`Started `,ng(e.startedAt)]}),e.endedAt?(0,K.jsxs)(`span`,{children:[`Ended `,ng(e.endedAt)]}):null,e.exitCode==null?null:(0,K.jsxs)(`span`,{children:[`Exit code `,e.exitCode]})]})]},e.id)),e.runtime.terminal.commands.length===0?(0,K.jsx)(mg,{text:`No shell or terminal commands have been captured for this workspace yet.`}):null]})}),(0,K.jsx)(`div`,{style:{overflowY:`auto`},className:`max-h-[420px] rounded-2xl border border-border bg-slate-950`,children:(0,K.jsxs)(`div`,{className:`space-y-2 p-4 font-mono text-xs leading-6 text-slate-100`,children:[e.runtime.terminal.commands.flatMap(e=>e.logs.map((t,n)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`mb-1 text-[10px] uppercase tracking-[0.18em] text-slate-400`,children:[t.stream,` · `,ng(t.timestamp)]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:t.text})]},`${e.id}:${n}`))),e.runtime.terminal.commands.every(e=>e.logs.length===0)?(0,K.jsx)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2 text-slate-400`,children:`No terminal output captured yet.`}):null]})})]})})},{value:`dev-server`,label:`Dev server`,body:(0,K.jsx)(`div`,{className:`space-y-4`,children:(0,K.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1fr)_360px]`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs uppercase`,rg(e.runtime.devServer.status)),children:e.runtime.devServer.status}),e.runtime.devServer.port?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[`Port `,e.runtime.devServer.port]}):null]}),e.runtime.devServer.command?(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:e.runtime.devServer.command}):null,(0,K.jsxs)(`div`,{className:`mt-4 grid gap-2 text-sm text-foreground-muted`,children:[e.runtime.devServer.primaryUrl?(0,K.jsxs)(`a`,{href:e.runtime.devServer.primaryUrl,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-2 text-primary`,children:[e.runtime.devServer.primaryUrl,(0,K.jsx)(Xf,{className:`h-4 w-4`})]}):(0,K.jsx)(`span`,{children:`No previewable dev-server endpoint has been detected yet.`}),(0,K.jsxs)(`span`,{children:[`Last signal `,ng(e.runtime.devServer.detectedAt)]})]})]}),(0,K.jsx)(`div`,{style:{overflowY:`auto`},className:`max-h-[420px] rounded-2xl border border-border bg-slate-950`,children:(0,K.jsxs)(`div`,{className:`space-y-2 p-4 font-mono text-xs leading-6 text-slate-100`,children:[e.runtime.devServer.logs.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`mb-1 text-[10px] uppercase tracking-[0.18em] text-slate-400`,children:[e.stream,` · `,ng(e.timestamp)]}),(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-words`,children:e.text})]},`${e.timestamp}:${t}`)),e.runtime.devServer.logs.length===0?(0,K.jsx)(`div`,{className:`rounded-xl border border-slate-800 bg-slate-900/80 px-3 py-2 text-slate-400`,children:`No dev-server logs captured yet.`}):null]})})]})})},{value:`rebase`,label:`Rebase`,body:(0,K.jsx)(`div`,{className:`space-y-4`,children:e.rebase?(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs uppercase`,rg(e.rebase.status===`rebase-conflicts`?`failed`:e.rebase.status===`rebase-needed`?`starting`:`ready`)),children:e.rebase.status.replace(/-/g,` `)}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[`Attempt `,e.rebase.attemptCount]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[`Ready for `,e.rebase.readyFor]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2`,children:[(0,K.jsx)(pg,{icon:sp,label:`Target branch`,value:e.rebase.targetBranch??`main`}),(0,K.jsx)(pg,{icon:sp,label:`Unresolved`,value:String(e.rebase.unresolvedFiles.length)})]}),e.rebase.followUpInstructions.length>0?(0,K.jsx)(`div`,{className:`mt-4 grid gap-2 text-sm text-foreground-muted`,children:e.rebase.followUpInstructions.map(e=>(0,K.jsx)(`div`,{className:`rounded-xl border border-border bg-card/70 px-3 py-2`,children:e},e))}):null,e.rebase.unresolvedFiles.length>0?(0,K.jsx)(`pre`,{className:`mt-4 whitespace-pre-wrap break-words rounded-2xl bg-slate-950 px-4 py-3 text-xs leading-6 text-slate-100`,children:e.rebase.unresolvedFiles.join(`
22
+ `)}):null]}):(0,K.jsx)(mg,{text:`No rebase workflow state has been detected for this workspace yet.`})})},{value:`execution-context`,label:`Execution context`,body:(0,K.jsx)(`div`,{className:`space-y-4`,children:e.executionContexts&&e.executionContexts.length>0?(0,K.jsx)(tg,{contexts:e.executionContexts,compact:!0,className:`border-border/70 bg-card/70 p-4 shadow-none`,title:`Workspace-linked issue context`,description:`The workspace runtime inherits dispatch context from the linked issue session.`}):(0,K.jsx)(mg,{text:`No linked dispatch-context labels have been associated with this workspace session yet.`})})},{value:`inspect`,label:`Inspect`,body:(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-4`,children:[(0,K.jsx)(pg,{icon:Mp,label:`Workspace`,value:e.runtime.workspacePath??`unavailable`,mono:!0}),(0,K.jsx)(pg,{icon:yp,label:`Commands`,value:String(e.runtime.terminal.commands.length)}),(0,K.jsx)(pg,{icon:qp,label:`Terminal`,value:e.runtime.terminal.status}),(0,K.jsx)(pg,{icon:Xf,label:`Preview origin`,value:e.runtime.preview.primaryUrl??`unavailable`}),(0,K.jsx)(pg,{icon:sp,label:`Rebase`,value:e.rebase?.status??`unavailable`})]}),(0,K.jsx)($h,{title:`Dispatch audit envelope`,audits:e.audits??[],emptyText:`No dispatch-context label projection is linked to this workspace runtime yet.`}),(0,K.jsx)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:"The inspect surface keeps the workspace path, preview origin, terminal activity, dev-server status, and process logs visible together so the kanban UI can act as the shell while runtime ownership remains in `agent-mux`."})]})}]})]})}function pg(e){let t=e.icon;return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]}),(0,K.jsx)(`div`,{className:q(`mt-3 text-sm font-medium`,e.mono?`break-all font-mono text-xs`:``),children:e.value})]})}function mg(e){let t=e.icon;return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border bg-background/60 p-4 text-sm text-foreground-muted`,children:[t?(0,K.jsx)(t,{className:`mb-2 h-4 w-4`}):null,e.text]})}var hg=[{key:`sidebar`,label:`Workspace`,shortcut:`Shift+W`,icon:wp},{key:`conversation`,label:`Chat`,shortcut:`Shift+C`,icon:Sp},{key:`context`,label:`Trace`,shortcut:`Shift+X`,icon:am},{key:`details`,label:`Runtime`,shortcut:`Shift+D`,icon:Tp}],gg={sidebar:16,conversation:62,context:12,details:10};function _g(e){return typeof e.status==`string`&&e.status.length>0?e.status:`unknown`}function vg(e,t){return typeof e.agent==`string`&&e.agent.length>0?e.agent:t}function yg(e){return`/workspaces?workspace=${encodeURIComponent(e)}`}function bg(e,t){let n=Yh(e);return n.includes(t)?t:n[0]}function xg(e){let t=(0,b.useMemo)(()=>hg.map(t=>({id:t.key,label:t.label,shortcut:t.shortcut,group:`Panels`,onSelect:()=>{e.onTogglePanel(t.key),e.onOpenChange(!1)}})),[e]);return(0,K.jsx)(nn,{open:e.open,onClose:()=>e.onOpenChange(!1),items:t,placeholder:`Toggle workspace panels`})}function Sg(e){return(0,K.jsxs)(`section`,{"data-testid":`workspace-panel-${e.panelKey}`,className:`flex h-full min-h-0 flex-col rounded-3xl border border-border bg-card shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`border-b border-border px-4 py-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:e.title}),e.subtitle?(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.subtitle}):null]}),(0,K.jsx)(`div`,{className:e.bodyClassName??`min-h-0 flex-1 overflow-auto p-4`,children:e.children})]})}function Cg(e){return(0,K.jsx)(`button`,{type:`button`,"data-testid":e.testId,"aria-label":`Resize panels`,onMouseDown:e.onMouseDown,className:`group flex h-full w-full cursor-col-resize items-center justify-center rounded-full bg-transparent text-foreground-muted transition-colors hover:bg-primary/8 hover:text-primary`,children:(0,K.jsx)(cp,{className:`h-4 w-4`})})}function wg(e){let t=Be(),n=e.shellStorageKeyPrefix??`session-workspace-layout-v4.${e.sessionId}`,[r,i]=Wh(`${n}.sidebar-open`,!0),[a,o]=Wh(`${n}.conversation-open`,!0),[s,c]=Wh(`${n}.context-open`,!1),[l,u]=Wh(`${n}.details-open`,!1),[d,f]=Wh(`${n}.desktop-sizes`,e.desktopPanelSizes??gg),[p,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(`conversation`),[_,v]=(0,b.useState)(()=>typeof window>`u`?qh:window.innerWidth),y=(0,b.useRef)(null),x=(0,b.useMemo)(()=>Jh({sidebar:r,conversation:a,context:s,details:l}),[s,a,l,r]),S=(0,b.useMemo)(()=>Yh(x),[x]),C=(0,b.useMemo)(()=>Zh(d,x),[d,x]),w=_<qh;(0,b.useEffect)(()=>{let e=()=>v(window.innerWidth);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,b.useEffect)(()=>{g(e=>bg(x,e))},[x]),(0,b.useEffect)(()=>{let e=e=>{let t=e.target;if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`){if(t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.tagName===`SELECT`||t?.isContentEditable)return;e.preventDefault(),m(!0)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let T=e=>{let t=Jh(e);i(t.sidebar),o(t.conversation),c(t.context),u(t.details),g(e=>bg(t,e))},E=e=>{T(Xh(x,e))},D=(e,t)=>n=>{if(w||!y.current)return;n.preventDefault();let r=y.current.getBoundingClientRect().width||1,i=n.clientX,a=d,o=n=>{f(Qh({sizes:a,visibility:x,leftPanel:e,rightPanel:t,deltaPercentage:(n.clientX-i)/r*100}))},s=()=>{window.removeEventListener(`mousemove`,o),window.removeEventListener(`mouseup`,s)};window.addEventListener(`mousemove`,o),window.addEventListener(`mouseup`,s)};Vh([{key:`W`,shift:!0,action:()=>E(`sidebar`),description:`Toggle workspace sidebar`},{key:`C`,shift:!0,action:()=>E(`conversation`),description:`Toggle conversation panel`},{key:`X`,shift:!0,action:()=>E(`context`),description:`Toggle context panel`},{key:`D`,shift:!0,action:()=>E(`details`),description:`Toggle details sidebar`}]);let O=(0,b.useMemo)(()=>{let e=[];return S.forEach((t,n)=>{e.push(`minmax(0, ${C[t]}fr)`),n<S.length-1&&e.push(`0.85rem`)}),e.join(` `)},[C,S]),k=n=>n===`sidebar`?(0,K.jsx)(Sg,{panelKey:`sidebar`,title:`Workspace`,subtitle:`Session context and quick links`,children:(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:`Session`}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-medium text-foreground`,children:e.sessionTitle}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.sessionStatus}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.sessionAgent}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1`,children:e.totalCostLabel})]})]}),e.workspacePath?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:`Workspace path`}),(0,K.jsx)(`div`,{className:`mt-2 break-all font-mono text-xs text-foreground-secondary`,children:e.workspacePath}),(0,K.jsx)(`div`,{className:`mt-4`,children:(0,K.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>t(yg(e.workspacePath)),children:`Open workspace`})})]}):null,(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(mp,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Dispatches in this session`})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[e.runs.map(t=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card/80 p-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(G,{to:`/dispatches/${String(t.runId)}`,className:`font-mono text-sm text-primary`,children:String(t.runId)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:_g(t)})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground-muted`,children:vg(t,e.sessionAgent)})]},String(t.runId))),e.runs.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border px-4 py-6 text-sm text-foreground-muted`,children:`No dispatches recorded for this session yet.`}):null]})]})]})}):n===`conversation`?(0,K.jsxs)(Sg,{panelKey:`conversation`,title:`Chat`,subtitle:`Transcript and the next turn`,bodyClassName:`min-h-0 flex-1 overflow-hidden p-4`,children:[e.conversationSupplement?(0,K.jsx)(`div`,{className:`mb-4`,children:e.conversationSupplement}):null,(0,K.jsx)(Ch,{sessionId:e.sessionId,sessionLabel:e.sessionTitle,sessionAgent:e.sessionAgent,sessionStatus:e.sessionStatus,sessionModel:e.sessionModel,runs:e.runs,eventBuffers:e.eventBuffers,workspacePath:e.workspacePath,runtime:e.runtime,disabled:e.conversationDisabled,emptyStateTitle:e.conversationEmptyStateTitle??`No transcript events yet`,emptyStateBody:e.conversationEmptyStateBody??`The transcript will appear here as soon as the gateway or native session history has something to show.`,placeholder:e.conversationPlaceholder??`Continue the session...`,submitLabel:e.conversationSubmitLabel,flowModelOverride:e.flowModelOverride,sessionCostOverride:e.sessionCostOverride,onSubmit:e.onSubmit})]}):n===`context`?(0,K.jsx)(Sg,{panelKey:`context`,title:`Trace`,subtitle:`Dispatch flow, files, and breakpoint context`,children:(0,K.jsx)(Bh,{sessionId:e.sessionId,runs:e.runs,eventBuffers:e.eventBuffers,workspacePath:e.workspacePath,runtime:e.runtime,flowModelOverride:e.flowModelOverride})}):(0,K.jsx)(Sg,{panelKey:`details`,title:`Runtime`,subtitle:`Preview, shell, and live workspace output`,children:e.runtime?(0,K.jsx)(fg,{runtime:e.runtime,sessionId:e.sessionId,sessionStatus:e.sessionStatus,className:`border-0 bg-transparent p-0 shadow-none`}):(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(qp,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Runtime details unavailable`})]}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:`Preview, terminal, and dev-server details will appear here once this session starts publishing them.`})]}),e.workspacePath?(0,K.jsxs)(`a`,{href:yg(e.workspacePath),className:`inline-flex items-center gap-2 rounded-2xl border border-border bg-background/65 px-4 py-3 text-sm text-primary transition-colors hover:border-primary/30`,children:[(0,K.jsx)(Xf,{className:`h-4 w-4`}),`Open workspace`]}):null]})});return(0,K.jsxs)(`div`,{"data-testid":`workspace-shell`,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 overflow-hidden px-3 py-4 sm:px-5 sm:py-6 xl:px-6`,children:[(0,K.jsxs)(`section`,{className:`shrink-0 rounded-3xl border border-border bg-card p-4 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(G,{to:`/sessions`,className:`text-primary`,children:`Sessions`}),(0,K.jsx)(`span`,{children:`/`}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-foreground-secondary`,children:e.sessionId})]}),(0,K.jsx)(`div`,{className:`mt-3 text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:e.heroEyebrow??`Session workspace`}),(0,K.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight`,style:{fontSize:`1.5rem`,lineHeight:1.1},children:e.sessionTitle}),(0,K.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-foreground-muted`,children:e.heroBody??`Keep the chat primary while dispatch trace, runtime hook history, and runtime stay close enough to open only when needed.`})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:hg.map(e=>{let t=e.icon;return(0,K.jsxs)(J,{type:`button`,variant:x[e.key]?`default`:`ghost`,size:`sm`,"data-testid":`panel-toggle-${e.key}`,"aria-pressed":x[e.key],onClick:()=>E(e.key),children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]},e.key)})})]}),(0,K.jsxs)(`details`,{className:`mt-3 rounded-2xl border border-border bg-background/65`,children:[(0,K.jsxs)(`summary`,{className:`flex cursor-pointer flex-wrap items-center justify-between gap-2 px-4 py-3 text-sm font-medium text-foreground`,children:[(0,K.jsx)(`span`,{children:`Shortcuts and layout`}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:`Reveal keyboard hints and the command bar only when needed`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-border px-4 py-4 text-xs text-foreground-muted`,children:[hg.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[e.label,`: `,e.shortcut]},e.key)),(0,K.jsxs)(J,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`workspace-command-bar-trigger`,onClick:()=>m(!0),children:[(0,K.jsx)(Lp,{className:`h-4 w-4`}),`Command bar`]})]})]})]}),w?(0,K.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-3xl border border-border bg-card p-4 shadow-lg`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,"data-testid":`workspace-mobile-panel-selector`,children:S.map(e=>(0,K.jsx)(J,{type:`button`,"data-testid":`workspace-mobile-panel-${e}`,variant:h===e?`default`:`ghost`,size:`sm`,onClick:()=>g(e),children:hg.find(t=>t.key===e)?.label??e},e))}),(0,K.jsx)(`div`,{className:`mt-4 min-h-0 flex-1`,children:k(h)})]}):(0,K.jsx)(`div`,{ref:y,"data-testid":`workspace-desktop-panels`,className:`grid min-h-0 flex-1 items-stretch overflow-hidden`,style:{gridTemplateColumns:O},children:S.map((e,t)=>{let n=S[t+1];return(0,K.jsxs)(`div`,{className:`contents`,children:[(0,K.jsx)(`div`,{className:`min-h-0`,children:k(e)}),n?(0,K.jsx)(Cg,{testId:`workspace-resize-${e}-${n}`,onMouseDown:D(e,n)}):null]},e)})}),(0,K.jsx)(xg,{open:p,visibility:x,onOpenChange:m,onTogglePanel:E})]})}function Tg(e,t){let n=Date.parse(e.lastDispatchedAt??``),r=Date.parse(t.lastDispatchedAt??``);return(Number.isFinite(r)?r:0)-(Number.isFinite(n)?n:0)||t.runIds.length-e.runIds.length||e.issueKey.localeCompare(t.issueKey)}function Eg(e){return e.dispatch.executionContext?{issueId:e.id,issueKey:e.key,issueTitle:e.title,runIds:e.dispatch.runIds,sessionIds:e.dispatch.sessionIds,lastDispatchedAt:e.dispatch.lastDispatchedAt,executionContext:e.dispatch.executionContext}:null}function Dg(e,t){return!e||!t?[]:e.issues.flatMap(e=>{let n=Eg(e);return n&&n.sessionIds.includes(t)?[n]:[]}).sort(Tg)}var Og=60;function kg(e){return e==null||!Number.isFinite(e)?`unavailable`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:4}).format(e)}function Ag(e,t){let n=t[e]?.structuredSessionTransport;return n===`persistent`||n===`restart-per-turn`?n:`none`}function jg(e){return!e||typeof e!=`object`?null:e}function Mg(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.currentPath==`string`&&t.currentPath.length>0?t.currentPath:typeof t.workspaceDefaultCwd==`string`&&t.workspaceDefaultCwd.length>0?t.workspaceDefaultCwd:typeof t.workspaceRootPath==`string`&&t.workspaceRootPath.length>0?t.workspaceRootPath:null}function Ng(e){let t=qn(e.sessionId,e.nativeMessages),n=Jn(e.sessionId,e.nativeMessages,e.resolvedAgent,e.status),r=e.status===`active`?e.eventFlowModel.transcript.length>0?e.eventFlowModel.transcript:t:t.length>0?t:e.eventFlowModel.transcript,i=e.eventFlowModel.lanes.length>0?e.eventFlowModel.lanes:n?[n]:[],a=e.eventFlowModel.timeline.length>0?e.eventFlowModel.timeline:ir(r),o=e.eventFlowModel.files.length>0?e.eventFlowModel.files:ar(r),s=i.map(e=>e.totalUsd).filter(e=>e!=null&&Number.isFinite(e));return{lanes:i,transcript:r,timeline:a,files:o,summary:{totalRuns:Math.max(e.eventFlowModel.summary.totalRuns,e.runCount,i.length),totalSegments:i.length>0?i.reduce((e,t)=>e+t.segmentCount,0):e.eventFlowModel.summary.totalSegments,totalTools:i.length>0?i.reduce((e,t)=>e+t.toolCount,0):e.eventFlowModel.summary.totalTools,pendingTools:i.length>0?i.reduce((e,t)=>e+t.segments.filter(e=>e.kind===`tool`&&e.status===`running`).length,0):e.eventFlowModel.summary.pendingTools,fileCount:o.length,totalUsd:e.eventFlowModel.summary.totalUsd??(s.length>0?s.reduce((e,t)=>e+t,0):null)}}}function Pg(){let e=We().sessionId??``,t=Be(),[n]=Pt(),r=$d(),{client:i,store:a}=dr(),{snapshot:o}=Zm(),s=pr(a,e=>e.agents.byId),c=pr(a,t=>t.sessions.byId[e]??null),l=pr(a,xr(t=>Object.values(t.runs.byId).filter(t=>t.sessionId===e).sort((e,t)=>Number(t.startedAt??0)-Number(e.startedAt??0)))),u=pr(a,e=>e.events.byRunId),[d,f]=(0,b.useState)(null),[p,m]=(0,b.useState)([]),[h,g]=(0,b.useState)(null),[_,v]=(0,b.useState)({total:0,offset:0,limit:Og,hasMore:!1}),y=(0,b.useRef)(null),x=(0,b.useRef)([]),S=(0,b.useRef)(0),C=(0,b.useMemo)(()=>[...typeof c?.agent==`string`?[c.agent]:[],...l.map(e=>typeof e.agent==`string`?e.agent:null).filter(e=>e!=null)],[l,c?.agent]),w=C[0]??`unknown`,T=String(c?.status??`inactive`),E=C.reduce((e,t)=>{let n=Ag(t,s);return n===`persistent`||e===`none`&&n===`restart-per-turn`?n:e},`none`),D=T!==`active`||E===`persistent`,O=typeof c?.cwd==`string`&&c.cwd.length>0?c.cwd:Mg(c?.workspace),k=jg(c?.runtime),A=(0,b.useMemo)(()=>Dg(o,e)[0]??null,[e,o]),j=n.get(`issueId`)??A?.issueId??null,M=n.get(`issueKey`)??A?.issueKey??null,N=(0,b.useMemo)(()=>or(l,u),[u,l]),P=(0,b.useMemo)(()=>Ng({eventFlowModel:N,nativeMessages:p,sessionId:e,resolvedAgent:w,status:T,runCount:l.length}),[N,p,w,l.length,e,T]),ee=(0,b.useMemo)(()=>Wn(l.map(e=>String(e.runId??``)),u),[u,l]),F=c?.cost&&typeof c.cost==`object`?c.cost:ee,I=typeof l[0]?.runId==`string`?String(l[0]?.runId):null;(0,b.useEffect)(()=>{if(e)return i.subscribeSession(e)},[i,e]),(0,b.useEffect)(()=>()=>{for(let e of x.current)window.clearTimeout(e);x.current=[]},[]),(0,b.useEffect)(()=>{if(!e){f(null);return}let t=!1;return(async()=>{try{let n=await r(`/api/v1/sessions/${encodeURIComponent(e)}`);if(!n.ok){if(n.status===404||t)return;throw Error(`Gateway request failed: ${n.status}`)}let i=await n.json();t||a.getState().actions.mergeSession(e,i)}catch(e){t||f(e instanceof Error?e.message:String(e))}})(),()=>{t=!0}},[r,e,a]),(0,b.useEffect)(()=>{g(null)},[e]);let te=(0,b.useCallback)(async(t=!1)=>{if(!e){m([]),v({total:0,offset:0,limit:Og,hasMore:!1});return}if(!t&&T===`active`&&N.transcript.length>0)return;let n=++S.current;f(null);try{let t=new URLSearchParams;t.set(`limit`,String(Og)),h==null?t.set(`tail`,`true`):t.set(`offset`,String(h));let i=await r(`/api/v1/sessions/${encodeURIComponent(e)}/messages?${t.toString()}`);if(!i.ok){if(i.status===404){n===S.current&&(m([]),v({total:0,offset:0,limit:Og,hasMore:!1}));return}throw Error(`Gateway request failed: ${i.status}`)}let a=await i.json();if(n!==S.current)return;Array.isArray(a.messages)&&m(a.messages),v({total:Number(a.pagination?.total??a.messages?.length??0),offset:Number(a.pagination?.offset??0),limit:Number(a.pagination?.limit??Og),hasMore:a.pagination?.hasMore===!0})}catch(e){n===S.current&&f(e instanceof Error?e.message:String(e))}},[N.transcript.length,r,h,e,T]);(0,b.useEffect)(()=>{te(!1)},[te]),(0,b.useEffect)(()=>{if(!j||!e)return;let t=`${j}:${e}:${I??``}`;y.current!==t&&(y.current=t,fetch(`/api/backlog`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`link-issue-session`,issueId:j,sessionId:e,runId:I??void 0})}).catch(()=>{y.current=null}))},[I,j,e]);async function ne(e){if(e.agent&&e.agent!==w){let n=await r(`/api/v1/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:e.agent,prompt:e.prompt,model:e.model,attachments:e.attachments,approvalMode:e.approvalMode,forkSessionId:e.sessionId,workspaceId:typeof c?.workspaceId==`string`?c.workspaceId:void 0,cwd:O??void 0})});if(!n.ok)throw Error(`Gateway request failed: ${n.status}`);let o=await n.json(),s=typeof o.run?.runId==`string`?o.run.runId:null,l=typeof o.run?.sessionId==`string`?o.run.sessionId:null;if(!s)throw Error(`Gateway did not return a dispatch id`);a.getState().actions.mergeRun(s,o.run??{}),i.subscribeRun(s),j&&await fetch(`/api/backlog`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`link-issue-session`,issueId:j,sessionId:l??void 0,runId:s})}).catch(()=>void 0);let u=j?`?issueId=${encodeURIComponent(j)}${M?`&issueKey=${encodeURIComponent(M)}`:``}`:``;t(l?`/sessions/${l}${u}`:`/sessions/pending/${s}${u}`);return}let n=await r(`/api/v1/sessions/${encodeURIComponent(e.sessionId)}/messages`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({prompt:e.prompt,agent:e.agent??w,model:e.model,attachments:e.attachments,approvalMode:e.approvalMode})});if(!n.ok)throw Error(`Gateway request failed: ${n.status}`);g(null);let o=await n.json();if(o.run&&typeof o.run.runId==`string`){a.getState().actions.mergeRun(o.run.runId,o.run);let e=()=>{for(let e of x.current)window.clearTimeout(e);x.current=[0,600,1800,3200].map(e=>window.setTimeout(()=>{te(!0)},e))};e(),i.subscribeRun(o.run.runId,t=>{t.event?.type===`run.finalized`&&e()})}o.session&&typeof o.session.sessionId==`string`&&a.getState().actions.mergeSession(o.session.sessionId,o.session)}let re=P.transcript.length===p.length&&_.total>_.limit?(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-border bg-background/65 px-4 py-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`text-foreground-muted`,children:[`Showing messages `,_.offset+1,`-`,Math.min(_.offset+p.length,_.total),` of `,_.total]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,disabled:_.offset<=0,onClick:()=>g(Math.max(0,_.offset-_.limit)),children:`Older`}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,disabled:_.offset+_.limit>=_.total,onClick:()=>g(Math.min(Math.max(0,_.total-_.limit),_.offset+_.limit)),children:`Newer`})]})]}):null;return(0,K.jsxs)(K.Fragment,{children:[d?(0,K.jsx)(`div`,{className:`w-full px-3 pt-4 sm:px-5 sm:pt-6 xl:px-6`,children:(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/20 bg-error-muted px-4 py-3 text-sm text-error`,children:d})}):null,(0,K.jsx)(wg,{sessionId:e,sessionTitle:String(c?.title??e??`Missing session id`),sessionAgent:w,sessionStatus:T,totalCostLabel:kg(F?.totalUsd??null),runs:l,eventBuffers:u,workspacePath:O,runtime:k??void 0,sessionModel:typeof c?.model==`string`?c.model:null,flowModelOverride:P,sessionCostOverride:F,conversationSupplement:re,conversationDisabled:!D,conversationPlaceholder:T===`active`&&E!==`persistent`?`The live session is still running…`:`Continue the session...`,conversationSubmitLabel:`Continue session`,conversationEmptyStateTitle:`No transcript yet`,conversationEmptyStateBody:`The transcript will appear here as soon as the gateway or native session history has something to show.`,heroEyebrow:`Live session`,heroBody:`Keep the transcript open, continue the session from here, and pull in runtime or execution detail only when you need it.`,onSubmit:ne})]})}var Fg=`h-3.5 w-3.5`,Ig={completed:{variant:`success`,icon:(0,K.jsx)(Vf,{className:q(Fg,`drop-shadow-[var(--drop-glow-success)]`)}),label:`Completed`,extraClass:`ring-success/30 shadow-neon-glow-success-sm`},resolved:{variant:`success`,icon:(0,K.jsx)(Vf,{className:q(Fg,`drop-shadow-[var(--drop-glow-success)]`)}),label:`Done`,extraClass:`ring-success/30 shadow-neon-glow-success-sm`},ok:{variant:`success`,icon:(0,K.jsx)(Vf,{className:q(Fg,`drop-shadow-[var(--drop-glow-success)]`)}),label:`OK`,extraClass:`ring-success/30 shadow-neon-glow-success-sm`},failed:{variant:`error`,icon:(0,K.jsx)(Uf,{className:q(Fg,`drop-shadow-[var(--drop-glow-error)]`)}),label:`Failed`,extraClass:`ring-error/30 shadow-neon-glow-error-sm`},aborted:{variant:`warning`,icon:(0,K.jsx)(Uf,{className:q(Fg,`drop-shadow-[var(--drop-glow-warning)]`)}),label:`Stopped`,extraClass:`ring-warning/30 shadow-neon-glow-warning-sm`},error:{variant:`error`,icon:(0,K.jsx)(Uf,{className:q(Fg,`drop-shadow-[var(--drop-glow-error)]`)}),label:`Error`,extraClass:`ring-error/30 shadow-neon-glow-error-sm`},waiting:{variant:`warning`,icon:(0,K.jsx)(Kf,{className:q(Fg,`drop-shadow-[var(--drop-glow-warning)]`)}),label:`Waiting`,extraClass:`ring-warning/30 shadow-neon-glow-warning-sm`},waiting_breakpoint:{variant:`warning`,icon:(0,K.jsx)(lp,{className:q(Fg,`animate-pulse drop-shadow-[var(--drop-glow-warning)]`)}),label:`Approval Needed`,extraClass:`ring-warning/40 animate-breakpoint-glow`},waiting_task:{variant:`info`,icon:(0,K.jsx)(vp,{className:q(Fg,`animate-spin drop-shadow-[var(--drop-glow-cyan)]`)}),label:`Working`,extraClass:`ring-info/30 shadow-neon-glow-cyan-sm`},breakpoint_awaiting:{variant:`warning`,icon:(0,K.jsx)(lp,{className:q(Fg,`animate-pulse drop-shadow-[var(--drop-glow-warning)]`)}),label:`Needs Approval`,extraClass:`ring-warning/40 animate-breakpoint-glow`},requested:{variant:`info`,icon:(0,K.jsx)(vp,{className:q(Fg,`animate-spin drop-shadow-[var(--drop-glow-cyan)]`)}),label:`Running`,extraClass:`ring-info/30 shadow-neon-glow-cyan-sm`},pending:{variant:`pending`,icon:(0,K.jsx)(Wf,{className:Fg}),label:`Pending`}};function Lg({status:e,className:t,waitingKind:n,isStale:r}){let i=Ig[e]||Ig.pending;e===`waiting`&&n&&(i=Ig[`waiting_${n}`]||i);let a=r&&(e===`pending`||e===`waiting`&&!n);return(0,K.jsxs)(`span`,{"data-testid":`status-badge-${e}`,className:q(`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium`,r?`opacity-60 text-zinc-500 ring-zinc-500/20 bg-zinc-500/10 shadow-none`:i.extraClass,t),children:[i.icon,a?`Interrupted`:i.label]})}function Rg(e,t=`Unknown`){return typeof e==`string`&&e.length>0?e:t}function zg(e){return typeof e==`string`&&e.length>0?e:null}function Bg(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function Vg(e){if(typeof e==`number`&&Number.isFinite(e))return new Date(e).toLocaleString();if(typeof e==`string`&&e.length>0){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}return`Unavailable`}function Hg(e){let t=String(e?.status??``);return t===`queued`||t===`starting`||t===`pending`||t===`waiting`||t===`running`}function Ug(e){return e===`queued`||e===`starting`||e===`pending`||e===`waiting`||e===`running`}function Wg(e){return(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:e.label}),(0,K.jsx)(`strong`,{children:e.value}),e.detail?(0,K.jsx)(`p`,{className:`muted-copy mt-2`,children:e.detail}):null]})}function Gg(){let e=We(),t=Re(),n=$d(),{client:r,store:i}=dr(),a=e.runId??``,o=Sr(a),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(null),d=String(o?.agent??`unknown`),f=String(o?.status??`starting`),p=zg(o?.sessionId)??s;return(0,b.useEffect)(()=>{if(a)return r.subscribeRun(a)},[r,a]),(0,b.useEffect)(()=>{if(!a||p)return;let e=!1,t=null,r=n=>{e||t!=null||(t=setTimeout(()=>{t=null,o()},n))},o=async()=>{try{let t=await n(`/api/v1/dispatches/${encodeURIComponent(a)}`);if(!t.ok){if(t.status===404||e)return;throw Error(`Gateway request failed: ${t.status}`)}let o=await t.json();if(e)return;i.getState().actions.mergeRun(a,o);let s=zg(o.sessionId);if(s){i.getState().actions.mergeSession(s,{sessionId:s,agent:o.agent,latestRunId:a,activeRunId:Ug(String(o.status??``))?a:null}),c(s),u(null);return}if(Ug(String(o.status??``))){r(1e3);return}u(`This dispatch finished before the gateway exposed a durable session id.`)}catch(t){e||(u(t instanceof Error?t.message:String(t)),r(1500))}};return o(),()=>{e=!0,t!=null&&clearTimeout(t)}},[r,n,a,p,i]),p?(0,K.jsx)(lt,{to:`/sessions/${p}${t.search}`,replace:!0}):(0,K.jsxs)(pf,{children:[(0,K.jsx)(mf,{children:(0,K.jsxs)(hf,{className:`session-browser__hero-grid`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker`,children:`Dispatch handoff`}),(0,K.jsx)(`h1`,{className:`page-title page-title--secondary`,children:`Waiting for this dispatch to bind to its session.`}),(0,K.jsx)(`p`,{className:`page-copy page-copy--wide`,children:`The browser is holding this bootstrap route only long enough for the gateway to attach the dispatch to a durable session id. As soon as that happens, this page redirects into the live session chat automatically.`}),l?(0,K.jsx)(`p`,{className:`mt-4 rounded-2xl border border-warning/20 bg-warning/8 px-4 py-3 text-sm text-warning`,children:l}):null,(0,K.jsxs)(`div`,{className:`page-actions`,children:[(0,K.jsx)(G,{to:`/sessions`,className:`session-browser__action session-browser__action--primary`,children:`Open sessions`}),(0,K.jsx)(G,{to:`/projects`,className:`session-browser__action`,children:`Open projects`})]})]}),(0,K.jsxs)(`div`,{className:`session-browser__hero-kpis`,children:[(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Dispatch id`}),(0,K.jsx)(`strong`,{children:a||`pending session`})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Agent`}),(0,K.jsx)(`strong`,{children:d})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`State`}),(0,K.jsx)(`strong`,{children:f})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Next hop`}),(0,K.jsx)(`strong`,{children:`Session chat`})]})]})]})}),(0,K.jsxs)(mf,{inset:!0,children:[(0,K.jsx)(`div`,{className:`session-browser__section-header`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker page-kicker--compact`,children:`What Happens Next`}),(0,K.jsx)(`h2`,{className:`page-title page-title--secondary`,children:`Dispatches are only the transport bootstrap.`}),(0,K.jsx)(`p`,{className:`page-copy`,children:"Once the harness publishes the final `sessionId`, the session route becomes the real working surface. That keeps transcript, approvals, runtime context, and follow-up turns on one stable screen instead of forcing users to stay on a dispatch-centric detail view."})]})}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-3`,children:[(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Until then`}),(0,K.jsx)(`strong`,{children:`Keep this route lightweight`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`It exists to hand off into the session, not to become the primary UI.`})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`If it stalls`}),(0,K.jsx)(`strong`,{children:`Check the session list`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`The session may already be visible there even if this route has not redirected yet.`})]}),(0,K.jsxs)(`div`,{className:`summary-card`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`If it fails`}),(0,K.jsx)(`strong`,{children:`Return to projects or workspaces`}),(0,K.jsx)(`p`,{className:`muted-copy`,children:`Recovery, retries, and workflow context live in those surfaces.`})]})]}),(0,K.jsxs)(`div`,{className:`page-actions`,children:[(0,K.jsx)(G,{to:`/sessions`,className:`session-browser__action`,children:`Back to sessions`}),(0,K.jsx)(G,{to:`/workspaces`,className:`session-browser__action`,children:`Open workspaces`})]})]})]})}function Kg(){let{runId:e=``}=We(),t=Sr(e),n=$d(),r=Cr(),{client:i,store:a}=dr(),[o,s]=(0,b.useState)(!0),[c,l]=(0,b.useState)(null),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(!1);(0,b.useEffect)(()=>{if(!e)return;let t=i.subscribeRun(e);return()=>{t()}},[i,e]),(0,b.useEffect)(()=>{if(!e){s(!1),l(`Missing dispatch id.`);return}let t=!1;return s(!0),l(null),(async()=>{try{let r=await n(`/api/v1/dispatches/${e}`);if(!r.ok)throw Error(`Gateway request failed: ${r.status}`);let i=await r.json();if(t)return;a.getState().actions.mergeRun(e,i);let o=zg(i.sessionId);o&&a.getState().actions.mergeSession(o,{sessionId:o,agent:i.agent,latestRunId:e})}catch(e){t||l(e instanceof Error?e.message:String(e))}finally{t||s(!1)}})(),()=>{t=!0}},[n,e,a]),(0,b.useEffect)(()=>{Hg(t)||p(!1)},[t]);let m=Rg(t?.agent,`Unknown agent`),h=Rg(t?.processId,`Unknown process`),g=String(t?.status??(o?`loading`:`unknown`)),_=zg(t?.sessionId),v=zg(t?.cwd)??zg(t?.workspacePath)??zg(t?.workspaceRootPath),y=zg(t?.failureMessage)??zg(t?.failureError)??zg(t?.exitReason),x=(0,b.useMemo)(()=>{let e=Bg(t?.totalTasks)??0,n=Bg(t?.completedTasks)??0;return e<=0?null:`${n}/${e} tasks completed`},[t]),S=Hg(t)&&!f;async function C(){if(!(!e||!S)){d(null),p(!0);try{if(!(await r(e))?.stopped)throw Error(`Gateway refused to stop this dispatch`)}catch(e){p(!1),d(e instanceof Error?e.message:String(e))}}}return(0,K.jsxs)(pf,{children:[(0,K.jsx)(mf,{children:(0,K.jsxs)(hf,{className:`session-browser__hero-grid`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker`,children:`Dispatch detail`}),(0,K.jsx)(`h1`,{className:`page-title page-title--secondary`,children:`Manage this live dispatch without leaving the queue.`}),(0,K.jsx)(`p`,{className:`page-copy page-copy--wide`,children:`Use this surface to inspect the active dispatch, jump to its linked session or workspace, and stop it when the underlying subprocess or in-process loop needs to be interrupted.`}),(0,K.jsxs)(`div`,{className:`page-actions`,children:[_?(0,K.jsx)(G,{to:`/sessions/${_}`,className:`session-browser__action session-browser__action--primary`,children:`Open session chat`}):null,v?(0,K.jsx)(G,{to:`/workspaces?workspace=${encodeURIComponent(v)}`,className:`session-browser__action`,children:`Open workspace`}):null,(0,K.jsx)(G,{to:`/dispatches`,className:`session-browser__action`,children:`Back to dispatches`})]})]}),(0,K.jsxs)(`div`,{className:`session-browser__hero-kpis`,children:[(0,K.jsx)(Wg,{label:`Dispatch id`,value:e||`Unavailable`}),(0,K.jsx)(Wg,{label:`Agent`,value:m}),(0,K.jsx)(Wg,{label:`State`,value:(0,K.jsx)(Lg,{status:g})}),(0,K.jsx)(Wg,{label:`Session`,value:_??`Not attached yet`})]})]})}),(0,K.jsxs)(mf,{inset:!0,children:[c?(0,K.jsxs)(`div`,{className:`summary-card border border-error/20 bg-error/5`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Dispatch unavailable`}),(0,K.jsx)(`strong`,{children:c})]}):null,u?(0,K.jsxs)(`div`,{className:`summary-card border border-error/20 bg-error/5`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Stop request failed`}),(0,K.jsx)(`strong`,{children:u})]}):null,f?(0,K.jsxs)(`div`,{className:`summary-card border border-warning/25 bg-warning/8`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Stop requested`}),(0,K.jsx)(`strong`,{children:`The gateway is terminating this dispatch now.`}),(0,K.jsx)(`p`,{className:`muted-copy mt-2`,children:`Subprocess-backed dispatches receive a terminate signal and are force-killed if they do not exit. In-process agent-mux loops are aborted through the same control path.`})]}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,K.jsx)(Wg,{label:`Process`,value:h}),(0,K.jsx)(Wg,{label:`Created`,value:Vg(t?.createdAt)}),(0,K.jsx)(Wg,{label:`Updated`,value:Vg(t?.updatedAt)}),(0,K.jsx)(Wg,{label:`Progress`,value:x??`No task breakdown`})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-2`,children:[(0,K.jsx)(Wg,{label:`Workspace`,value:v??`No workspace attached`,detail:v?`Jump back into the workspace shell from the actions above.`:null}),(0,K.jsx)(Wg,{label:`Stop control`,value:S?`Available`:`Not available`,detail:S?`Use stop when the dispatch is still active and needs to be interrupted.`:f?`A stop request is already in flight.`:`Only active dispatches can be interrupted.`})]}),y?(0,K.jsxs)(`div`,{className:`summary-card mt-5 border border-error/20 bg-error/5`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Latest failure or exit detail`}),(0,K.jsx)(`strong`,{children:y})]}):null,(0,K.jsxs)(`div`,{className:`page-actions mt-5`,children:[(0,K.jsx)(J,{type:`button`,variant:`primary`,disabled:!S,onClick:()=>void C(),children:f?`Stopping dispatch`:`Stop dispatch`}),_?(0,K.jsx)(G,{to:`/sessions/${_}`,className:`session-browser__action`,children:`Open linked session`}):null]}),!t&&o?(0,K.jsxs)(`div`,{className:`summary-card mt-5`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Loading`}),(0,K.jsx)(`strong`,{children:`Fetching live dispatch state…`})]}):null]})]})}function qg(e,t){return t&&e.includes(t)?t:e[0]??`codex`}function Jg(e){return e?.supportsInteractiveMode===!0||e?.structuredSessionTransport===`persistent`||e?.canResume===!0}function Yg(e){switch(e){case`external-host`:return`Live session owner: external host surface.`;case`mcp-mediated`:return`Live session owner: host-mediated channel.`;default:return`Live session owner: agent-mux managed process or SDK.`}}function Xg(){let e=Be(),t=$d(),{client:n,store:r}=dr(),[i]=Pt(),a=hr(),o=i.get(`agent`),s=i.get(`workspaceId`),c=i.get(`workspacePath`),l=i.get(`issueId`),u=i.get(`issueKey`),[d,f]=(0,b.useState)(()=>qg(a,o)),[p,m]=(0,b.useState)(``),[h,g]=(0,b.useState)(s??``),[_,v]=(0,b.useState)(s||c?`existing`:`none`),[y,x]=(0,b.useState)(`session-workspace`),[S,C]=(0,b.useState)(`worktree`),[w,T]=(0,b.useState)(``),[E,D]=(0,b.useState)([]),[O,k]=(0,b.useState)(!1),[A,j]=(0,b.useState)(null),M=pr(r,e=>e.agents.byId),N=pr(r,e=>e.agents.byId[d]??null),P=(0,b.useMemo)(()=>{let e=a.filter(e=>Jg(M[e]??null));return e.length>0?e:a},[M,a]);(0,b.useEffect)(()=>{f(e=>P.length===0||P.includes(e)?e:qg(P,o))},[o,P]),(0,b.useEffect)(()=>{let e=!1;return(async()=>{try{let n=await t(`/api/v1/workspaces`);if(!n.ok)return;let r=await n.json();e||D(r.workspaces??[])}catch{}})(),()=>{e=!0}},[t]),(0,b.useEffect)(()=>{if(!s&&!c)return;let e=E.find(e=>s&&e.id===s?!0:c?e.defaultCwd===c||e.rootPath===c:!1);e&&(v(`existing`),g(e.id))},[s,c,E]);async function ee(i){if(i.preventDefault(),!(!p.trim()||!d)){k(!0),j(null);try{let i,a;if(_===`create`){let e=w.split(`
23
+ `).map(e=>e.trim()).filter(Boolean),n=await t(`/api/v1/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`create`,name:y,mode:S,repos:e.map(e=>({path:e}))})});if(!n.ok)throw Error(`Workspace creation failed: ${n.status}`);let r=await n.json();i=typeof r.workspace?.id==`string`?r.workspace.id:void 0,a=typeof r.workspace?.defaultCwd==`string`?r.workspace.defaultCwd:typeof r.workspace?.rootPath==`string`?r.workspace.rootPath:void 0}else if(_===`existing`&&h){let e=E.find(e=>e.id===h);i=h,a=e?.defaultCwd??e?.rootPath}else c&&(a=c);let o=await t(`/api/v1/sessions`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({agent:d,prompt:p,workspaceId:i,cwd:a})});if(!o.ok)throw Error(`Gateway request failed: ${o.status}`);let s=(await o.json()).run,u=typeof s?.runId==`string`?s.runId:null;if(!u)throw Error(`Gateway did not return a run id`);r.getState().actions.mergeRun(u,s??{}),typeof s?.sessionId==`string`&&s.sessionId.length>0&&r.getState().actions.mergeSession(s.sessionId,{sessionId:s.sessionId,agent:d,activeRunId:u,latestRunId:u,status:`active`}),l&&await fetch(`/api/backlog`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`link-issue-session`,issueId:l,sessionId:typeof s?.sessionId==`string`?s.sessionId:void 0,runId:u})}).catch(()=>void 0),n.subscribeRun(u);let f=l?`?issueId=${encodeURIComponent(l)}`:``;if(typeof s?.sessionId==`string`&&s.sessionId.length>0){e(`/sessions/${s.sessionId}${f}`);return}e(`/sessions/pending/${u}${f}`)}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}}}return(0,K.jsxs)(`section`,{className:`flow-grid`,children:[(0,K.jsxs)(`article`,{className:`panel hero-panel`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`New Session`}),(0,K.jsx)(`h2`,{children:`Start a real conversation`}),(0,K.jsx)(`p`,{className:`lede`,children:`This creates a real session on the selected harness. If the harness does not emit its session id immediately, the browser stays inside the sessions flow until the live session is ready.`}),c?(0,K.jsxs)(`p`,{className:`muted-copy`,children:[`This session will stay attached to the selected workspace`,u?` and ${u}`:``,`.`]}):null]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Compose First Turn`})}),(0,K.jsxs)(`form`,{className:`stack`,onSubmit:ee,children:[(0,K.jsx)(Kt,{label:`Agent`,children:(0,K.jsx)(en,{value:d,onChange:f,options:P.map(e=>({label:e,value:e}))})}),N?(0,K.jsxs)(`p`,{className:`muted-copy`,children:[Yg(N.sessionControlPlane),` `,N.structuredSessionTransport===`persistent`?`Later turns stay on the same live structured channel.`:N.structuredSessionTransport===`restart-per-turn`?`Later turns reconnect the same session with a fresh execution.`:`Structured multi-turn transport is unavailable.`]}):null,P.length===a.length?null:(0,K.jsx)(`p`,{className:`muted-copy`,children:`The browser is showing only transports that can keep a session interactive or persistent.`}),(0,K.jsx)(Kt,{label:`Prompt`,children:(0,K.jsx)(Gt,{value:p,onChange:e=>m(e.target.value),placeholder:`Describe the task you want the agent to handle...`,rows:10})}),(0,K.jsx)(Kt,{label:`Workspace`,children:(0,K.jsx)(en,{value:_,onChange:e=>v(e===`create`||e===`existing`?e:`none`),options:[{label:`No workspace`,value:`none`},{label:`Use existing workspace`,value:`existing`},{label:`Create workspace now`,value:`create`}]})}),_===`existing`?(0,K.jsx)(Kt,{label:`Existing workspace`,children:(0,K.jsx)(en,{value:h,onChange:g,options:E.map(e=>({label:`${e.name} · ${e.defaultCwd}`,value:e.id}))})}):null,_===`create`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Kt,{label:`Workspace name`,children:(0,K.jsx)(`input`,{value:y,onChange:e=>x(e.target.value)})}),(0,K.jsx)(Kt,{label:`Materialization`,children:(0,K.jsx)(en,{value:S,onChange:e=>C(e===`symlink`?`symlink`:`worktree`),options:[{label:`Git worktrees`,value:`worktree`},{label:`Symbolic links`,value:`symlink`}]})}),(0,K.jsx)(Kt,{label:`Repo paths`,children:(0,K.jsx)(Gt,{value:w,onChange:e=>T(e.target.value),rows:4,placeholder:`/abs/path/to/repo-one
24
+ /abs/path/to/repo-two`})})]}):null,A?(0,K.jsx)(`p`,{className:`error-banner`,children:A}):null,(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(J,{type:`submit`,variant:`primary`,loading:O,disabled:O||!p.trim(),children:`Start session`}),(0,K.jsx)(G,{className:`ghost-link`,to:`/workspaces`,children:`Manage workspaces`}),(0,K.jsx)(G,{className:`ghost-link`,to:`/sessions`,children:`Browse sessions`})]})]})]})]})}function Zg(){return(0,K.jsxs)(`section`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Hook inbox`})}),(0,K.jsx)(kd,{})]})}function Qg(){let[e,t]=(0,b.useState)([]),[n,r]=(0,b.useState)(`default`),i=(0,b.useRef)(0);(0,b.useEffect)(()=>{typeof window<`u`&&`Notification`in window&&r(Notification.permission)},[]);let a=(0,b.useCallback)(async()=>{typeof window>`u`||!(`Notification`in window)||r(await Notification.requestPermission())},[]);return{notifications:e,notify:(0,b.useCallback)((e,r,a=`info`,o)=>{let s=`notif-${++i.current}-${Date.now()}`,c={id:s,title:e,body:r,type:a,timestamp:Date.now(),href:o?.href,persistent:o?.persistent};if(t(e=>[...e,c]),o?.persistent||setTimeout(()=>{t(e=>e.filter(e=>e.id!==s))},5e3),n===`granted`&&typeof window<`u`&&document.hidden)try{new Notification(e,{body:r,tag:s})}catch{}},[n]),dismiss:(0,b.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),requestPermission:a,permission:n}}function $g(e,t={}){let{interval:n=2e3,enabled:r=!0}=t,[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(r&&!!e),[c,l]=(0,b.useState)(null),u=(0,b.useRef)(!0),d=(0,b.useRef)(null),f=(0,b.useCallback)(async()=>{if(!e)return;d.current?.abort(),d.current=new AbortController;let t=await Pm(e,{signal:d.current.signal});if(!t.ok){if(t.error.isAborted)return;u.current&&(l(t.error.message),s(!1));return}u.current&&(a(t.data),l(null),s(!1))},[e]);return(0,b.useEffect)(()=>{if(u.current=!0,!r||!e){s(!1);return}s(!0),f();let t=setInterval(f,n);return()=>{u.current=!1,d.current?.abort(),clearInterval(t)}},[f,n,r,e]),{data:i,loading:o,error:c,refresh:f}}function e_(e){if(e==null||e<0)return`—`;if(e===0)return`<1s`;if(e<1e3)return`${e}ms`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60),r=t%60;return n<60?`${n}m ${r}s`:`${Math.floor(n/60)}h ${n%60}m`}function t_(e){if(!e)return``;try{let t=Date.now()-new Date(e).getTime();return t<0||t<5e3?`just now`:t<6e4?`${Math.floor(t/1e3)}s ago`:t<36e5?`${Math.floor(t/6e4)}m ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:`${Math.floor(t/864e5)}d ago`}catch{return``}}function n_(e,t=4){return e?e.length<=t?e:`...`+e.slice(-t):`—`}function r_(e){return e?e.split(/[-/]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):``}var i_={success:`success`,error:`error`,warning:`warn`,info:`info`},a_=(0,b.createContext)({notify:()=>{},requestPermission:()=>{},permission:`default`,notifications:[],dismiss:()=>{}}),o_=()=>(0,b.useContext)(a_);function s_({children:e}){let{notifications:t,notify:n,dismiss:r,requestPermission:i,permission:a}=Qg(),{push:o}=on(),{data:s}=$g(`/api/digest`,{interval:3e3}),c=(0,b.useRef)(new Map),l=(0,b.useRef)(Date.now()),u=(0,b.useCallback)((e,t,r=`info`,i)=>{n(e,t,r,i),o({title:e,message:t,kind:i_[r],duration:i?.persistent?0:void 0})},[n,o]);return(0,b.useEffect)(()=>{if(!s)return;let e=c.current;if(Date.now()-l.current<1e4){for(let t of s.runs)e.set(t.runId,{status:t.status,completedTasks:t.completedTasks,pendingBreakpoints:t.pendingBreakpoints||0,notifiedCompleted:t.status===`completed`,notifiedFailed:t.status===`failed`,notifiedWaiting:t.status===`waiting`});return}for(let t of s.runs){let n=e.get(t.runId);if(!n){e.set(t.runId,{status:t.status,completedTasks:t.completedTasks,pendingBreakpoints:t.pendingBreakpoints||0,notifiedCompleted:t.status===`completed`,notifiedFailed:t.status===`failed`,notifiedWaiting:t.status===`waiting`}),u(`New Run Started`,`${n_(t.runId,4)} started`,`info`,{href:`/dispatches/${t.runId}`});continue}if(t.status===`completed`&&!n.notifiedCompleted&&(n.notifiedCompleted=!0,u(`Run Completed`,`${n_(t.runId,4)} finished successfully`,`success`,{href:`/dispatches/${t.runId}`})),t.status===`failed`&&!n.notifiedFailed&&(n.notifiedFailed=!0,u(`Run Failed`,`${n_(t.runId,4)} failed`,`error`,{href:`/dispatches/${t.runId}`})),t.completedTasks>n.completedTasks&&(n.completedTasks=t.completedTasks),t.status===`waiting`&&!n.notifiedWaiting){n.notifiedWaiting=!0;let e=t.breakpointQuestion||`Review required`;u(`Run ${n_(t.runId,4)} needs attention`,e,`warning`,{href:`/dispatches/${t.runId}`,persistent:!0})}t.status!==`waiting`&&n.notifiedWaiting&&(n.notifiedWaiting=!1),n.pendingBreakpoints>0&&(t.pendingBreakpoints===0||t.pendingBreakpoints===void 0)&&u(`Breakpoint Resolved`,`Breakpoint in ${n_(t.runId,4)} was approved`,`success`,{href:`/dispatches/${t.runId}`}),n.pendingBreakpoints=t.pendingBreakpoints||0,n.status=t.status}},[s,u]),(0,K.jsx)(a_.Provider,{value:{notify:u,requestPermission:i,permission:a,notifications:t,dismiss:r},children:e})}function c_({children:e,className:t}){return(0,K.jsx)(`kbd`,{className:q(`inline-flex h-5 min-w-[20px] items-center justify-center rounded`,`border border-[var(--kbd-border)] bg-background-secondary`,`px-1.5 font-mono text-xs leading-tight text-foreground-muted`,`shadow-kbd`,t),children:e})}var l_=[{keys:[`?`],description:`Show this help`,context:`global`},{keys:[`n`],description:`Toggle notifications`,context:`global`},{keys:[`/`],description:`Focus search`,context:`dashboard`},{keys:[`j`],description:`Next item`,context:`run-detail`},{keys:[`k`],description:`Previous item`,context:`run-detail`},{keys:[`Enter`],description:`Open selected`,context:`run-detail`},{keys:[`Esc`],description:`Go back / Close`,context:`run-detail`},{keys:[`e`],description:`Toggle event stream`,context:`run-detail`},{keys:[`1`],description:`Agent tab`,context:`run-detail`},{keys:[`2`],description:`Timing tab`,context:`run-detail`},{keys:[`3`],description:`Logs tab`,context:`run-detail`},{keys:[`4`],description:`Data tab`,context:`run-detail`},{keys:[`5`],description:`Approval tab`,context:`run-detail`},{keys:[`Shift`,`W`],description:`Toggle workspace sidebar`,context:`session-workspace`},{keys:[`Shift`,`C`],description:`Toggle conversation panel`,context:`session-workspace`},{keys:[`Shift`,`X`],description:`Toggle context panel`,context:`session-workspace`},{keys:[`Shift`,`D`],description:`Toggle details sidebar`,context:`session-workspace`},{keys:[`Ctrl/Cmd`,`K`],description:`Open workspace command bar`,context:`session-workspace`}],u_={global:`Global`,dashboard:`Dashboard`,"run-detail":`Run Detail`,"session-workspace":`Session Workspace`};function d_(){let[e,t]=(0,b.useState)(!1),n=Re().pathname,r=n?.startsWith(`/dispatches/`)||n?.startsWith(`/runs/`)||!1,i=n?.startsWith(`/sessions/`)??!1;Vh([{key:`?`,action:()=>t(!0),description:`Show shortcuts help`},{key:`Escape`,action:()=>t(!1),description:`Close shortcuts help`}]),(0,b.useEffect)(()=>{let e=()=>t(!0);return window.addEventListener(`open-shortcuts-help`,e),()=>window.removeEventListener(`open-shortcuts-help`,e)},[]);let a=l_.filter(e=>!!(e.context===`global`||e.context===`dashboard`&&!r||e.context===`run-detail`&&r||e.context===`session-workspace`&&i)).reduce((e,t)=>((e[t.context]??=[]).push(t),e),{});return(0,K.jsx)(tn,{open:e,onClose:()=>t(!1),title:`Keyboard Shortcuts`,children:(0,K.jsx)(`div`,{className:`space-y-4 overflow-y-auto pr-1`,children:Object.entries(a).map(([e,t])=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h3`,{className:`text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2`,children:u_[e]??e}),(0,K.jsx)(`div`,{className:`space-y-2`,children:t.map(({keys:e,description:t})=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-2 py-1 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsx)(`span`,{className:`text-sm text-foreground-secondary`,children:t}),(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:e.map(e=>(0,K.jsx)(c_,{children:e},e))})]},t))})]},e))})})}function f_(){return(0,K.jsx)(an,{children:(0,K.jsxs)(s_,{children:[(0,K.jsx)(ut,{}),(0,K.jsx)(d_,{})]})})}function p_(){let{snapshot:e,summary:t,loading:n,error:r}=Zm();return n&&!e?(0,K.jsx)(pf,{children:(0,K.jsxs)(`div`,{className:`projects-page__loading`,children:[(0,K.jsx)(`div`,{className:`projects-page__loading-title`}),(0,K.jsx)(`div`,{className:`projects-page__loading-grid`,children:Array.from({length:3}).map((e,t)=>(0,K.jsx)(`div`,{className:`projects-page__loading-card`},t))})]})}):r||!e?(0,K.jsx)(pf,{children:(0,K.jsx)(`div`,{className:`projects-page__error`,children:`Failed to load project planning workspace.`})}):(0,K.jsxs)(pf,{children:[(0,K.jsxs)(mf,{className:`projects-page__hero`,children:[(0,K.jsx)(`p`,{className:`page-kicker`,children:`Projects`}),(0,K.jsx)(`h1`,{className:`page-title`,children:`Planning starts from projects and board routes now`}),(0,K.jsx)(`p`,{className:`page-copy page-copy--wide`,children:`The main surface is no longer a dashboard-first run list. Choose a project board, switch to list mode when you need linear triage, and use the routed workspace to move issues, filter planning state, and provision execution context.`}),(0,K.jsxs)(`div`,{className:`page-chip-row`,children:[(0,K.jsxs)(`span`,{className:`page-chip`,children:[(0,K.jsx)(ip,{className:`h-4 w-4`}),e.projects.length,` project boards`]}),(0,K.jsxs)(`span`,{className:`page-chip`,children:[(0,K.jsx)(am,{className:`h-4 w-4`}),t?.issueCount??0,` issues tracked`]})]})]}),(0,K.jsx)(`section`,{className:`projects-page__grid`,children:e.projects.map(e=>(0,K.jsxs)(`article`,{className:`projects-page__card`,children:[(0,K.jsxs)(`div`,{className:`projects-page__card-header`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`page-kicker page-kicker--compact`,children:e.key}),(0,K.jsx)(`h2`,{className:`projects-page__card-title`,children:e.name})]}),(0,K.jsxs)(`span`,{className:`page-chip page-chip--muted`,children:[e.metrics.totalIssues,` issues`]})]}),(0,K.jsxs)(`div`,{className:`projects-page__stats`,children:[(0,K.jsxs)(`div`,{className:`projects-page__stat`,children:[(0,K.jsx)(`div`,{className:`projects-page__stat-value`,children:e.metrics.inProgressIssues}),(0,K.jsx)(`div`,{children:`Active work`})]}),(0,K.jsxs)(`div`,{className:`projects-page__stat`,children:[(0,K.jsx)(`div`,{className:`projects-page__stat-value`,children:e.metrics.readyIssues}),(0,K.jsx)(`div`,{children:`Ready issues`})]}),(0,K.jsxs)(`div`,{className:`projects-page__stat`,children:[(0,K.jsx)(`div`,{className:`projects-page__stat-value`,children:e.team.members.length}),(0,K.jsx)(`div`,{children:`Collaborators`})]})]}),(0,K.jsx)(`div`,{className:`projects-page__labels`,children:e.labels.slice(0,4).map(e=>(0,K.jsx)(`span`,{className:`page-chip page-chip--muted`,children:e.name},e.id))}),(0,K.jsxs)(`div`,{className:`projects-page__actions`,children:[(0,K.jsxs)(G,{to:`/projects/${e.id}/board`,className:`projects-page__action projects-page__action--primary`,children:[(0,K.jsx)(pp,{className:`h-4 w-4`}),`Open board`]}),(0,K.jsxs)(G,{to:`/projects/${e.id}/list`,className:`projects-page__action`,children:[(0,K.jsx)(_p,{className:`h-4 w-4`}),`Open list`]}),(0,K.jsxs)(G,{to:`/projects/${e.id}/workspaces/new`,className:`projects-page__action`,children:[(0,K.jsx)(ip,{className:`h-4 w-4`}),`Create workspace`]}),(0,K.jsxs)(`span`,{className:`projects-page__action projects-page__action--static`,children:[(0,K.jsx)(tm,{className:`h-4 w-4`}),e.team.members.length,` teammates on this board`]})]})]},e.id))})]})}function m_({title:e=`No dispatches found`,description:t=`Start a babysitter dispatch to see it here.`,className:n,compact:r=!1}){return(0,K.jsxs)(`div`,{className:q(`flex flex-col items-center justify-center rounded-3xl border border-dashed border-border bg-background/50 px-6 text-center`,r?`py-10`:`py-16`,n),children:[(0,K.jsx)(`div`,{className:`mb-4 flex h-14 w-14 items-center justify-center rounded-2xl border border-border bg-card/80 shadow-sm`,children:(0,K.jsx)(dp,{className:`h-6 w-6 text-foreground-muted/60`})}),(0,K.jsx)(`h3`,{className:`text-base font-semibold tracking-tight text-foreground`,children:e}),(0,K.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-foreground-muted`,children:t})]})}var h_={totalCount:0,visibleCount:0,stateCounts:{draft:0,active:0,paused:0,disabled:0,archived:0},triggerCounts:{timer:0,webhook:0},executionCount:0,failureCount:0,failingCount:0},g_=[`critical`,`high`,`medium`,`low`],__=[`manual`,`api`,`external-system`,`config-file`];function v_(e){return{name:``,triggerType:`timer`,cron:`0 9 * * 1-5`,timezone:`UTC`,webhookPort:`4100`,webhookPath:`/automations/incoming`,webhookAuthType:`none`,webhookToken:``,webhookSourceEvent:``,targetProjectId:e[0]?.projectId??``,templateTitle:``,templateSummary:``,templateDescription:``,templatePriority:`medium`,acceptanceCriteria:``,sourceKind:`manual`,sourceProvider:``,sourceExternalId:``,sourcePath:``}}function y_(e){return{name:e.name,triggerType:e.trigger.type,cron:e.trigger.type===`timer`?e.trigger.cron:`0 9 * * 1-5`,timezone:e.trigger.type===`timer`?e.trigger.timezone??`UTC`:`UTC`,webhookPort:e.trigger.type===`webhook`?String(e.trigger.port):`4100`,webhookPath:e.trigger.type===`webhook`?e.trigger.path??``:`/automations/incoming`,webhookAuthType:e.trigger.type===`webhook`&&e.trigger.auth?.type===`bearer`?`bearer`:`none`,webhookToken:e.trigger.type===`webhook`&&e.trigger.auth?.type===`bearer`?e.trigger.auth.token:``,webhookSourceEvent:e.trigger.type===`webhook`?e.trigger.sourceEvent??``:``,targetProjectId:e.target.projectId,templateTitle:e.template.title,templateSummary:e.template.summary??``,templateDescription:e.template.description??``,templatePriority:e.template.priority??`medium`,acceptanceCriteria:(e.template.acceptanceCriteria??[]).join(`
25
+ `),sourceKind:e.source.kind,sourceProvider:e.source.provider??``,sourceExternalId:e.source.externalId??``,sourcePath:e.source.path??``}}function b_(e){return e?new Date(e).toLocaleString():`Not yet triggered`}function x_(e){return e.charAt(0).toUpperCase()+e.slice(1)}function S_(e){return e===`timer`?{label:`Timer`,icon:(0,K.jsx)(Gf,{className:`h-3.5 w-3.5`}),variant:`info`}:{label:`Webhook`,icon:(0,K.jsx)(rm,{className:`h-3.5 w-3.5`}),variant:`warning`}}function C_(e){switch(e){case`created`:return(0,K.jsx)(Vf,{className:`h-3.5 w-3.5`});case`coalesced`:return(0,K.jsx)($p,{className:`h-3.5 w-3.5`});case`rejected`:return(0,K.jsx)(Uf,{className:`h-3.5 w-3.5`})}}function w_(e,t){let n=e.metadata?.[t];return typeof n==`string`&&n.trim()?n.trim():void 0}function T_(e){return w_(e,`triggerEventSummary`)??w_(e,`eventName`)??e.reason??(e.status===`created`?`Created work item`:`${x_(e.status)} delivery`)}function E_(e){let t=new URLSearchParams;e.issueId&&t.set(`issueId`,e.issueId),e.issueKey&&t.set(`issueKey`,e.issueKey);let n=t.toString(),r=`/projects/${encodeURIComponent(e.boardProjectId)}/board`;return n?`${r}?${n}`:r}function D_(e){return e.trigger.type===`timer`?`${e.trigger.cron}${e.trigger.timezone?` · ${e.trigger.timezone}`:``}`:[`POST ${e.trigger.path||`/`}`,`:${e.trigger.port}`,e.trigger.sourceEvent?`event ${e.trigger.sourceEvent}`:null].filter(Boolean).join(` · `)}function O_(e,t){return t.find(t=>t.projectId===e.target.projectId)}function k_(e){let t=e.split(`
26
+ `).map(e=>e.trim()).filter(Boolean);return t.length>0?t:void 0}function A_(e,t){let n=t.find(t=>t.projectId===e.targetProjectId);if(!n)throw Error(`Select a target project before saving.`);let r={projectId:n.projectId,boardProjectId:n.boardProjectId},i=e.triggerType===`timer`?{type:`timer`,cron:e.cron.trim(),timezone:e.timezone.trim()||void 0}:{type:`webhook`,port:Number.parseInt(e.webhookPort,10),path:e.webhookPath.trim()||void 0,method:`POST`,auth:e.webhookAuthType===`bearer`?{type:`bearer`,token:e.webhookToken.trim()}:{type:`none`},sourceEvent:e.webhookSourceEvent.trim()||void 0},a={title:e.templateTitle.trim(),summary:e.templateSummary.trim()||void 0,description:e.templateDescription.trim()||void 0,priority:e.templatePriority,acceptanceCriteria:k_(e.acceptanceCriteria)},o={kind:e.sourceKind,provider:e.sourceProvider.trim()||void 0,externalId:e.sourceExternalId.trim()||void 0,path:e.sourcePath.trim()||void 0};return{name:e.name.trim(),trigger:i,target:r,routing:{issue:{action:`canonical-issue-create`,projectId:r.projectId},board:{action:`shared-board-derive`,boardProjectId:r.boardProjectId},mutateBoardDirectly:!1},template:a,source:o}}async function j_(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Request failed: ${e.status}`);return t}function M_(){let e=Be(),[t,n]=(0,b.useState)(null),[r,i]=(0,b.useState)(()=>v_([])),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(!0),[l,u]=(0,b.useState)(!1),[d,f]=(0,b.useState)(!1),[p,m]=(0,b.useState)(null),[h,g]=(0,b.useState)(null);async function _(e){let t=e?.preserveForm??!1;u(!0),m(null);try{let e=await j_(await fetch(`/api/automations`));n(e),t?a||i(t=>({...t,targetProjectId:t.targetProjectId||e.targetOptions[0]?.projectId||``})):(i(v_(e.targetOptions)),o(null))}catch(e){m(e instanceof Error?e.message:String(e))}finally{c(!1),u(!1)}}(0,b.useEffect)(()=>{_()},[]);let v=t?.rules??[],y=t?.targetOptions??[],x=t?.summary??h_,S=(0,b.useMemo)(()=>y.find(e=>e.projectId===r.targetProjectId),[r.targetProjectId,y]);function C(e,t){i(n=>({...n,[e]:t}))}function w(){o(null),i(v_(y)),m(null)}function T(e){o(e.id),i(y_(e)),m(null)}async function E(e){e.preventDefault(),f(!0),m(null);try{let e=A_(r,y);await j_(await fetch(a?`/api/automations/${a}`:`/api/automations`,{method:a?`PATCH`:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...e,...a?{updatedBy:`operator`}:{createdBy:`operator`}})})),await _()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}async function D(e,t){g(`${t}:${e.id}`),m(null);try{t===`delete`?await j_(await fetch(`/api/automations/${e.id}`,{method:`DELETE`})):await j_(await fetch(`/api/automations/${e.id}/lifecycle`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:t,updatedBy:`operator`})})),await _({preserveForm:a!==null})}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(null)}}return(0,K.jsxs)(pf,{children:[(0,K.jsxs)(mf,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Automation control plane`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Dedicated rule authoring and operational control`}),(0,K.jsx)(`p`,{className:`mt-3 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Manage timer and webhook rules here so the board stays focused on generated work. This surface exposes lifecycle state, target routing, and automation authorship through the existing shared automation API.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsxs)(J,{variant:`ghost`,onClick:()=>void _({preserveForm:a!==null}),disabled:l,children:[(0,K.jsx)(Pp,{className:q(`mr-2 h-4 w-4`,l&&`animate-spin`)}),`Refresh rules`]}),(0,K.jsx)(J,{variant:`ghost`,onClick:()=>e(`/projects`),children:`Back to board`})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-7`,children:[(0,K.jsx)(N_,{label:`Visible rules`,value:String(x.visibleCount),tone:`info`}),(0,K.jsx)(N_,{label:`Active`,value:String(x.stateCounts.active),tone:`success`}),(0,K.jsx)(N_,{label:`Paused`,value:String(x.stateCounts.paused),tone:`warning`}),(0,K.jsx)(N_,{label:`Failing`,value:String(x.failingCount),tone:`error`}),(0,K.jsx)(N_,{label:`Timers`,value:String(x.triggerCounts.timer),tone:`info`}),(0,K.jsx)(N_,{label:`Webhooks`,value:String(x.triggerCounts.webhook),tone:`warning`}),(0,K.jsx)(N_,{label:`Failures`,value:String(x.failureCount),tone:`error`})]})]}),p?(0,K.jsx)(`section`,{className:`rounded-3xl border border-error/30 bg-error/10 p-4 text-sm text-error`,children:p}):null,(0,K.jsxs)(`div`,{className:`grid gap-6 xl:grid-cols-[minmax(0,0.95fr)_minmax(0,1.4fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-3xl`,children:[(0,K.jsx)(`div`,{className:`border-b border-border/70 pb-4`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.22em] text-primary/80`,children:a?`Edit rule`:`Create rule`}),(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:a?`Update an automation rule`:`Author a new automation rule`})]}),a?(0,K.jsx)(J,{variant:`ghost`,onClick:w,children:`New rule`}):null]})}),(0,K.jsx)(`div`,{className:`pt-4`,children:(0,K.jsxs)(`form`,{className:`grid gap-4`,onSubmit:E,children:[(0,K.jsx)(P_,{label:`Rule name`,children:(0,K.jsx)(`input`,{value:r.name,onChange:e=>C(`name`,e.target.value),placeholder:`Daily digest triage`,className:`tkc-input`,required:!0})}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(P_,{label:`Trigger type`,children:(0,K.jsxs)(`select`,{value:r.triggerType,onChange:e=>C(`triggerType`,e.target.value),className:`tkc-input`,children:[(0,K.jsx)(`option`,{value:`timer`,children:`Timer`}),(0,K.jsx)(`option`,{value:`webhook`,children:`Webhook`})]})}),(0,K.jsx)(P_,{label:`Target project`,children:(0,K.jsx)(`select`,{value:r.targetProjectId,onChange:e=>C(`targetProjectId`,e.target.value),className:`tkc-input`,required:!0,children:y.map(e=>(0,K.jsxs)(`option`,{value:e.projectId,children:[e.key,` · `,e.name]},e.projectId))})})]}),r.triggerType===`timer`?(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(P_,{label:`Cron schedule`,children:(0,K.jsx)(`input`,{value:r.cron,onChange:e=>C(`cron`,e.target.value),placeholder:`0 9 * * 1-5`,className:`tkc-input font-mono`,required:!0})}),(0,K.jsx)(P_,{label:`Timezone`,children:(0,K.jsx)(`input`,{value:r.timezone,onChange:e=>C(`timezone`,e.target.value),placeholder:`UTC`,className:`tkc-input`})})]}):(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(P_,{label:`Webhook port`,children:(0,K.jsx)(`input`,{type:`number`,value:r.webhookPort,onChange:e=>C(`webhookPort`,e.target.value),min:1,className:`tkc-input font-mono`,required:!0})}),(0,K.jsx)(P_,{label:`Webhook path`,children:(0,K.jsx)(`input`,{value:r.webhookPath,onChange:e=>C(`webhookPath`,e.target.value),placeholder:`/automations/incoming`,className:`tkc-input font-mono`})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,K.jsx)(P_,{label:`Auth`,children:(0,K.jsxs)(`select`,{value:r.webhookAuthType,onChange:e=>C(`webhookAuthType`,e.target.value),className:`tkc-input`,children:[(0,K.jsx)(`option`,{value:`none`,children:`None`}),(0,K.jsx)(`option`,{value:`bearer`,children:`Bearer token`})]})}),(0,K.jsx)(P_,{label:`Source event`,children:(0,K.jsx)(`input`,{value:r.webhookSourceEvent,onChange:e=>C(`webhookSourceEvent`,e.target.value),placeholder:`github.issue.created`,className:`tkc-input`})}),(0,K.jsx)(P_,{label:`HTTP method`,children:(0,K.jsx)(`input`,{value:`POST`,className:`tkc-input font-mono text-foreground-muted`,disabled:!0})})]}),r.webhookAuthType===`bearer`?(0,K.jsx)(P_,{label:`Bearer token`,children:(0,K.jsx)(`input`,{value:r.webhookToken,onChange:e=>C(`webhookToken`,e.target.value),placeholder:`secret-token`,className:`tkc-input font-mono`,required:!0})}):null]}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(P_,{label:`Task title`,children:(0,K.jsx)(`input`,{value:r.templateTitle,onChange:e=>C(`templateTitle`,e.target.value),placeholder:`Review the daily digest`,className:`tkc-input`,required:!0})}),(0,K.jsx)(P_,{label:`Priority`,children:(0,K.jsx)(`select`,{value:r.templatePriority,onChange:e=>C(`templatePriority`,e.target.value),className:`tkc-input`,children:g_.map(e=>(0,K.jsx)(`option`,{value:e,children:e},e))})})]}),(0,K.jsx)(P_,{label:`Task summary`,children:(0,K.jsx)(`input`,{value:r.templateSummary,onChange:e=>C(`templateSummary`,e.target.value),placeholder:`Create a triage issue on the shared board.`,className:`tkc-input`})}),(0,K.jsx)(P_,{label:`Task description`,children:(0,K.jsx)(`textarea`,{value:r.templateDescription,onChange:e=>C(`templateDescription`,e.target.value),placeholder:`Include operator instructions, expected routing, and follow-up notes.`,className:`tkc-input min-h-28 resize-y`})}),(0,K.jsx)(P_,{label:`Acceptance criteria`,children:(0,K.jsx)(`textarea`,{value:r.acceptanceCriteria,onChange:e=>C(`acceptanceCriteria`,e.target.value),placeholder:`Issue lands on the correct board
27
+ Owner sees routing metadata`,className:`tkc-input min-h-24 resize-y`})}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(P_,{label:`Source kind`,children:(0,K.jsx)(`select`,{value:r.sourceKind,onChange:e=>C(`sourceKind`,e.target.value),className:`tkc-input`,children:__.map(e=>(0,K.jsx)(`option`,{value:e,children:e},e))})}),(0,K.jsx)(P_,{label:`Source provider`,children:(0,K.jsx)(`input`,{value:r.sourceProvider,onChange:e=>C(`sourceProvider`,e.target.value),placeholder:`github`,className:`tkc-input`})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,K.jsx)(P_,{label:`Source external id`,children:(0,K.jsx)(`input`,{value:r.sourceExternalId,onChange:e=>C(`sourceExternalId`,e.target.value),placeholder:`digest-job`,className:`tkc-input`})}),(0,K.jsx)(P_,{label:`Source path`,children:(0,K.jsx)(`input`,{value:r.sourcePath,onChange:e=>C(`sourcePath`,e.target.value),placeholder:`configs/automations.yml`,className:`tkc-input font-mono`})})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background-secondary/50 p-4 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{className:`font-semibold text-foreground`,children:`Resolved routing`}),(0,K.jsxs)(`p`,{className:`mt-2`,children:[`Canonical issue create →`,(0,K.jsxs)(`span`,{className:`font-mono`,children:[` `,S?.projectId??`select a project`]})]}),(0,K.jsxs)(`p`,{className:`mt-1`,children:[`Shared board derive →`,(0,K.jsxs)(`span`,{className:`font-mono`,children:[` `,S?.boardProjectId??`select a board`]})]}),(0,K.jsx)(`p`,{className:`mt-1`,children:`Board mutation stays indirect so generated work still flows through issues.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsx)(J,{type:`submit`,variant:`primary`,disabled:d||y.length===0,children:d?`Saving...`:a?`Save changes`:`Create rule`}),a?(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:w,children:`Cancel edit`}):null]})]})})]}),(0,K.jsx)(`div`,{className:`grid gap-4`,children:s?(0,K.jsx)(`div`,{className:`rounded-3xl p-6 text-sm text-foreground-muted`,children:`Loading automation rules…`}):v.length===0?(0,K.jsx)(`div`,{className:`rounded-3xl p-6`,children:(0,K.jsx)(m_,{title:`No automation rules yet`,description:`Create a timer or webhook rule to route generated work into the board without crowding the dashboard.`})}):v.map(e=>{let t=S_(e.triggerType),n=O_(e,y);return(0,K.jsxs)(`div`,{className:`tkc-panel rounded-3xl`,children:[(0,K.jsx)(`div`,{className:`border-b border-border/70 pb-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:e.name}),(0,K.jsx)(qt,{children:e.state}),e.executionSummary.isFailing?(0,K.jsx)(qt,{children:`failing`}):null,(0,K.jsxs)(qt,{children:[t.icon,t.label]})]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:D_(e)})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{variant:`ghost`,onClick:()=>T(e),children:`Edit`}),e.allowedActions.map(t=>(0,K.jsx)(L_,{action:t,disabled:h===`${t}:${e.id}`,onClick:()=>void D(e,t)},t))]})]})}),(0,K.jsxs)(`div`,{className:`grid gap-4 pt-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]`,children:[(0,K.jsx)(F_,{title:`Target routing`,icon:(0,K.jsx)(kf,{className:`h-4 w-4`}),lines:[`${n?.key??`UNK`} · ${n?.name??e.target.projectId}`,`Issue target: ${e.routing.issue.projectId}`,`Board target: ${e.routing.board.boardProjectId}`,n?.linkedRunProjectName?`Linked run project: ${n.linkedRunProjectName}`:`Project id: ${e.target.projectId}`]}),(0,K.jsx)(F_,{title:`Operational state`,icon:(0,K.jsx)(Up,{className:`h-4 w-4`}),lines:[`State: ${e.executionSummary.isFailing?`${e.state} · failing`:e.state}`,`Allowed actions: ${e.allowedActions.join(`, `)}`,`Created: ${b_(e.audit.createdAt)}`,`Updated: ${b_(e.audit.updatedAt)}`,`Last triggered: ${b_(e.audit.lastTriggeredAt)}`,`Last failure: ${b_(e.executionSummary.lastFailureAt)}`]}),(0,K.jsx)(F_,{title:`Template payload`,lines:[e.template.title,e.template.summary??`No summary`,`Priority: ${e.template.priority??`medium`}`,e.template.acceptanceCriteria?.length?`Acceptance: ${e.template.acceptanceCriteria.join(` · `)}`:`Acceptance: none`]}),(0,K.jsx)(F_,{title:`Source metadata`,lines:[`Kind: ${e.source.kind}`,`Provider: ${e.source.provider??`n/a`}`,`External id: ${e.source.externalId??`n/a`}`,`Path: ${e.source.path??`n/a`}`]}),(0,K.jsx)(I_,{rule:e})]})]},e.id)})})]})]})}function N_(e){return(0,K.jsxs)(`div`,{className:q(`rounded-2xl border px-4 py-4 shadow-sm`,e.tone===`success`&&`border-success/20 bg-success/10`,e.tone===`warning`&&`border-warning/20 bg-warning/10`,e.tone===`info`&&`border-info/20 bg-info/10`,e.tone===`error`&&`border-error/20 bg-error/10`),children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.22em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:e.value})]})}function P_(e){return(0,K.jsxs)(`label`,{className:`grid gap-2 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),e.children]})}function F_(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border/70 bg-background-secondary/45 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.22em] text-foreground-muted`,children:[e.icon,e.title]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 text-sm text-foreground-muted`,children:e.lines.map(e=>(0,K.jsx)(`p`,{children:e},e))})]})}function I_(e){return(0,K.jsxs)(`div`,{className:`lg:col-span-2 rounded-2xl border border-border/70 bg-background-secondary/45 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.22em] text-foreground-muted`,children:[(0,K.jsx)(Up,{className:`h-4 w-4`}),`Recent deliveries`]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(qt,{children:[e.rule.executionSummary.totalCount,` total`]}),(0,K.jsxs)(qt,{children:[e.rule.executionSummary.createdCount,` created`]}),(0,K.jsxs)(qt,{children:[e.rule.executionSummary.coalescedCount,` coalesced`]}),(0,K.jsxs)(qt,{children:[e.rule.executionSummary.rejectedCount,` rejected`]})]})]}),e.rule.recentExecutions.length===0?(0,K.jsx)(`p`,{className:`mt-3 text-sm text-foreground-muted`,children:`No deliveries have been recorded for this rule yet.`}):(0,K.jsx)(`div`,{className:`mt-4 grid gap-3`,children:e.rule.recentExecutions.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(qt,{children:[C_(e.status),e.status]}),(0,K.jsxs)(qt,{children:[e.triggerType===`timer`?(0,K.jsx)(Gf,{className:`h-3.5 w-3.5`}):(0,K.jsx)(rm,{className:`h-3.5 w-3.5`}),e.triggerType]}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:b_(e.triggeredAt)})]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm font-medium text-foreground`,children:T_(e)}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-3 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{children:[`Actor: `,e.triggeredBy]}),e.deliveryId?(0,K.jsxs)(`span`,{children:[`Delivery: `,e.deliveryId]}):null,w_(e,`triggerEventSource`)?(0,K.jsxs)(`span`,{children:[`Event: `,w_(e,`triggerEventSource`)]}):null]})]}),e.issueId?(0,K.jsxs)(J,{variant:`ghost`,onClick:()=>{typeof window<`u`&&window.location.assign(E_(e))},children:[e.issueKey??e.issueId,(0,K.jsx)(Xf,{className:`ml-2 h-4 w-4`})]}):null]}),e.reason?(0,K.jsx)(`p`,{className:`mt-3 text-sm text-foreground-muted`,children:e.reason}):null]},e.id))})]})}function L_(e){let t=(()=>{switch(e.action){case`enable`:case`resume`:return{icon:(0,K.jsx)(kp,{className:`mr-2 h-4 w-4`}),label:e.action===`enable`?`Enable`:`Resume`,variant:`ghost`};case`pause`:return{icon:(0,K.jsx)(Ep,{className:`mr-2 h-4 w-4`}),label:`Pause`,variant:`ghost`};case`disable`:return{icon:(0,K.jsx)(jp,{className:`mr-2 h-4 w-4`}),label:`Disable`,variant:`ghost`};case`delete`:return{icon:(0,K.jsx)(jp,{className:`mr-2 h-4 w-4`}),label:`Delete`,variant:`ghost`}}})();return(0,K.jsxs)(J,{type:`button`,variant:t.variant,onClick:e.onClick,disabled:e.disabled,children:[t.icon,t.label]})}function R_(){return(0,K.jsx)(M_,{})}var z_=(0,b.createContext)(null);function B_(){return(0,b.useContext)(z_)||{theme:`dark`,toggle:()=>void 0}}function V_(){return{key:``,label:``,description:``,instruction:``}}var H_=[{id:`general`,title:`General`,summary:`Local Babysitter framing, config locations, theme, gateway access, and runtime overview.`,icon:Ef},{id:`repositories-projects`,title:`Repositories & Projects`,summary:`Project policy, linked repositories, and dispatch-context definitions.`,icon:Pf},{id:`organization`,title:`Organization`,summary:`Team, visibility, default roles, and shared permission context.`,icon:tm},{id:`remote-project`,title:`Remote Projects`,summary:`Host/org/project binding state and blocked-action guidance per provider.`,icon:Cp},{id:`agent-configuration`,title:`Agent Configuration`,summary:`Default model/provider settings with validation-aware save behavior.`,icon:Yf},{id:`mcp-servers`,title:`MCP Servers`,summary:`Per-agent MCP transport definitions with draft preservation and validation.`,icon:Rp},{id:`editor-integration`,title:`Editor Integration`,summary:`Workspace-first editing flow, command-bar shortcuts, and session handoff guidance.`,icon:Pf},{id:`git`,title:`Git`,summary:`Branch defaults, review policy, auto-merge posture, and provider readiness context.`,icon:Hp},{id:`notifications`,title:`Notifications`,summary:`In-app alerts, browser permission state, and breakpoint/run attention behavior.`,icon:Ef},{id:`task-tags`,title:`Task Tags`,summary:`Reusable @ snippets kept as a first-class settings surface.`,icon:Pf},{id:`keyboard-shortcuts`,title:`Keyboard Shortcuts`,summary:`Current shortcut groups for dashboard, runs, and session workspaces.`,icon:Yf}],U_=`~/.a5c/kanban.json`,W_=`~/.a5c/kanban-settings-sections.json`;function G_(){return{status:`idle`,data:null,error:null}}function K_(e){let t=e.trim();if(!t.startsWith(`{`))return e;try{let n=JSON.parse(t);return typeof n.error==`string`&&n.error.length>0?n.error:e}catch{return e}}function q_(e){return{...e,configuredModel:e.configuredModel??``,configuredProvider:e.configuredProvider??``,maxTokens:e.maxTokens??``}}function J_(e){return{name:e.name.trim(),transport:e.transport,command:e.command.trim(),url:e.url.trim(),argsText:e.argsText.trim(),envText:e.envText.trim()}}function Y_(e){return[...e].sort((e,t)=>e.fullName.localeCompare(t.fullName))}function X_(e,t){return e?{reviewRequiredForDone:e.settings.reviewRequiredForDone,activityScope:e.settings.activityScope,workspaceProvisioning:e.settings.workspaceProvisioning,repositories:Y_(e.repositories.map(e=>({id:e.id,fullName:e.fullName,linkedIssueId:t.find(t=>t.repositoryLifecycle?.repositoryId===e.id)?.id??null,baseBranch:e.settings.baseBranch,ciProvider:e.settings.ciProvider??``,publishTarget:e.settings.publishTarget??``,autoMerge:e.settings.autoMerge,requiredApprovals:e.settings.requiredApprovals})))}:null}function Z_(e){return e?{teamName:e.team.name,visibility:e.team.settings.visibility,defaultRole:e.team.settings.defaultRole,allowSelfAssign:e.team.settings.allowSelfAssign}:null}async function Q_(){let e=await Pm(`/api/settings/agent-configuration`);if(!e.ok)throw Error(K_(e.error.message));return{agents:e.data.agents.map(q_)}}async function $_(e){let t=await Pm(`/api/settings/agent-configuration`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(K_(t.error.message));return{agents:t.data.agents.map(q_)}}async function ev(){let e=await Pm(`/api/settings/mcp-servers`);if(!e.ok)throw Error(K_(e.error.message));return{agents:e.data.agents.map(e=>({...e,servers:e.servers.map(J_)}))}}async function tv(e){let t=await Pm(`/api/settings/mcp-servers`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({agent:e.agent,servers:e.servers.map(J_)})});if(!t.ok)throw Error(K_(t.error.message));return{agents:t.data.agents.map(e=>({...e,servers:e.servers.map(J_)}))}}function nv(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function rv(){let e=Be(),{theme:t}=B_(),{auth:n,logout:r,isAuthenticated:i}=Qd(),{notifications:a,permission:o,requestPermission:s}=o_(),{snapshot:c,refresh:l,loading:u,error:d,updateProjectCollaboration:f,updateRepositorySettings:p}=Zm(),m=c?.projects[0],h=c?.dispatchContextLabels??[],g=c?.issues??[],[_,v]=(0,b.useState)(`general`),[y,x]=(0,b.useState)(null),[S,C]=(0,b.useState)(null),[w,T]=(0,b.useState)(null),[E,D]=(0,b.useState)(null),[O,k]=(0,b.useState)(null),[A,j]=(0,b.useState)(null),[M,N]=(0,b.useState)(!1),[P,ee]=(0,b.useState)(!1),[F,I]=(0,b.useState)(null),[te,ne]=(0,b.useState)(null),[re,ie]=(0,b.useState)(null),[L,R]=(0,b.useState)(null),[ae,oe]=(0,b.useState)(G_()),[se,ce]=(0,b.useState)({}),[le,ue]=(0,b.useState)({}),[z,de]=(0,b.useState)(null),[fe,pe]=(0,b.useState)(!1),[me,he]=(0,b.useState)(null),[ge,_e]=(0,b.useState)(null),[ve,ye]=(0,b.useState)(G_()),[be,xe]=(0,b.useState)({}),[Se,Ce]=(0,b.useState)({}),[B,we]=(0,b.useState)(null),[Te,Ee]=(0,b.useState)(!1),[V,De]=(0,b.useState)(null),[Oe,ke]=(0,b.useState)(null),Ae=E?.repositories.find(e=>e.id===S)??E?.repositories[0]??null,je=E?.repositories.length??m?.repositories.length??0,Me=E?.repositories.filter(e=>e.autoMerge).length??m?.repositories.filter(e=>e.settings.autoMerge).length??0;m?.integrations.length;let Ne=m?.integrations.filter(e=>e.prerequisites.some(e=>!e.satisfied)).length??0,Pe=m?.integrations.filter(e=>e.status===`connected`).length??0,Fe=Object.entries(l_.reduce((e,t)=>((e[t.context]??=[]).push(t),e),{})),Ie=l_.filter(e=>e.context===`session-workspace`),Le=o===`granted`?`Browser notifications allowed`:o===`denied`?`Browser notifications blocked`:`Browser notification permission pending`;(0,b.useEffect)(()=>{let e=X_(m,g);(!nv(w,E)&&nv(w,e)||w===null)&&(T(e),D(e))},[g,m,w,E]),(0,b.useEffect)(()=>{let e=Z_(m);(!nv(O,A)&&nv(O,e)||O===null)&&(k(e),j(e))},[O,A,m]),(0,b.useEffect)(()=>{E?.repositories.length&&!S&&C(E.repositories[0].id),S&&E?.repositories.every(e=>e.id!==S)&&C(E.repositories[0]?.id??null)},[E,S]),(0,b.useEffect)(()=>{_!==`agent-configuration`||ae.status!==`idle`||(oe({status:`loading`,data:null,error:null}),Q_().then(e=>{oe({status:`ready`,data:e,error:null});let t=Object.fromEntries(e.agents.map(e=>[e.agent,e]));ce(t),ue(t),de(t=>t??e.agents[0]?.agent??null)}).catch(e=>{oe({status:`error`,data:null,error:e instanceof Error?e.message:`Failed to load agent configuration.`})}))},[ae.status,_]),(0,b.useEffect)(()=>{_!==`mcp-servers`||ve.status!==`idle`||(ye({status:`loading`,data:null,error:null}),ev().then(e=>{ye({status:`ready`,data:e,error:null});let t=Object.fromEntries(e.agents.map(e=>[e.agent,e.servers.map(J_)]));xe(t),Ce(t),we(t=>t??e.agents[0]?.agent??null)}).catch(e=>{ye({status:`error`,data:null,error:e instanceof Error?e.message:`Failed to load MCP servers.`})}))},[ve.status,_]);let Re=nv(w,E),ze=nv(O,A),Ve=JSON.stringify(se)!==JSON.stringify(le),He=JSON.stringify(be)!==JSON.stringify(Se),Ue=_===`repositories-projects`&&Re||_===`organization`&&ze||_===`agent-configuration`&&Ve||_===`mcp-servers`&&He;function We(e){if(e!==_){if(Ue){x(e);return}v(e),x(null)}}function Ge(){_===`repositories-projects`&&(D(w),ie(null),I(null)),_===`organization`&&(j(O),R(null),ne(null)),_===`agent-configuration`&&(ue(se),he(null),_e(null)),_===`mcp-servers`&&(Ce(be),De(null),ke(null)),y&&(v(y),x(null))}async function Ke(){if(!(!m||!E||!w)){N(!0),ie(null),I(null);try{(E.reviewRequiredForDone!==w.reviewRequiredForDone||E.activityScope!==w.activityScope||E.workspaceProvisioning!==w.workspaceProvisioning)&&await f({projectId:m.id,teamName:m.team.name,visibility:m.team.settings.visibility,defaultRole:m.team.settings.defaultRole,allowSelfAssign:m.team.settings.allowSelfAssign,reviewRequiredForDone:E.reviewRequiredForDone,activityScope:E.activityScope,workspaceProvisioning:E.workspaceProvisioning,members:m.team.members.map(e=>({id:e.id,displayName:e.displayName,email:e.email,role:e.role})),permissions:m.permissions.map(e=>({action:e.action,description:e.description,roles:[...e.roles]}))});for(let e of E.repositories){let t=w.repositories.find(t=>t.id===e.id);if(t&&JSON.stringify(e)!==JSON.stringify(t)){if(!e.linkedIssueId)throw Error(`Repository ${e.fullName} is missing the linked issue/work item context required for persistence.`);await p({issueId:e.linkedIssueId,baseBranch:e.baseBranch,ciProvider:e.ciProvider||void 0,publishTarget:e.publishTarget||void 0,autoMerge:e.autoMerge,requiredApprovals:e.requiredApprovals})}}await l(),T(E),D(E),I(`Saved repositories/projects settings.`)}catch(e){ie(e instanceof Error?e.message:`Failed to save repositories/projects settings.`)}finally{N(!1)}}}async function qe(){if(!(!m||!A)){ee(!0),R(null),ne(null);try{await f({projectId:m.id,teamName:A.teamName,visibility:A.visibility,defaultRole:A.defaultRole,allowSelfAssign:A.allowSelfAssign,reviewRequiredForDone:m.settings.reviewRequiredForDone,activityScope:m.settings.activityScope,workspaceProvisioning:m.settings.workspaceProvisioning,members:m.team.members.map(e=>({id:e.id,displayName:e.displayName,email:e.email,role:e.role})),permissions:m.permissions.map(e=>({action:e.action,description:e.description,roles:[...e.roles]}))}),await l(),k(A),j(A),ne(`Saved organization settings.`)}catch(e){R(e instanceof Error?e.message:`Failed to save organization settings.`)}finally{ee(!1)}}}async function Je(){if(!z||!le[z])return;let e=le[z];pe(!0),he(null),_e(null);try{let t=await $_({agent:z,model:e.configuredModel,provider:e.configuredProvider,approvalMode:e.approvalMode,maxTokens:e.maxTokens}),n=Object.fromEntries(t.agents.map(e=>[e.agent,e]));oe({status:`ready`,data:t,error:null}),ce(n),ue(n),_e(`Saved agent configuration for ${z}.`)}catch(e){he(e instanceof Error?e.message:`Failed to save agent configuration.`)}finally{pe(!1)}}async function Ye(){if(B){Ee(!0),De(null),ke(null);try{let e=await tv({agent:B,servers:Se[B]??[]}),t=Object.fromEntries(e.agents.map(e=>[e.agent,e.servers.map(J_)]));ye({status:`ready`,data:e,error:null}),xe(t),Ce(t),ke(`Saved MCP server settings for ${B}.`)}catch(e){De(e instanceof Error?e.message:`Failed to save MCP servers.`)}finally{Ee(!1)}}}return(0,K.jsxs)(pf,{children:[(0,K.jsxs)(mf,{children:[(0,K.jsx)(`p`,{className:`page-kicker`,children:`Settings`}),(0,K.jsx)(`div`,{className:`page-logo`,children:(0,K.jsx)(sn,{className:`h-6 w-auto`})}),(0,K.jsx)(`h1`,{className:`page-title`,children:`Settings breadth parity`}),(0,K.jsx)(`p`,{className:`page-copy page-copy--wide`,children:`The local kanban settings surface keeps its Babysitter-specific framing while expanding to the broader upstream settings breadth: general preferences, repositories/projects, organization, remote-project bindings, agents, MCP, editor integration, git, notifications, task tags, and keyboard shortcuts all live as explicit sections.`})]}),(0,K.jsxs)(`div`,{className:`settings-layout`,children:[(0,K.jsxs)(`aside`,{className:`settings-nav`,children:[(0,K.jsx)(`div`,{className:`settings-nav__label`,children:`Settings sections`}),(0,K.jsx)(`div`,{className:`settings-nav__list`,children:H_.map(e=>{let t=e.icon,n=e.id===_;return(0,K.jsxs)(`button`,{type:`button`,"data-testid":`settings-nav-${e.id}`,onClick:()=>We(e.id),className:[`settings-nav__button`,n?`settings-nav__button--active`:null].filter(Boolean).join(` `),children:[(0,K.jsxs)(`div`,{className:`settings-nav__title`,children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.title]}),(0,K.jsx)(`div`,{className:`settings-nav__summary`,children:e.summary})]},e.id)})})]}),(0,K.jsxs)(`div`,{className:`settings-stack`,children:[y?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-amber-500/30 bg-amber-500/10 p-4 text-sm`,"data-testid":`settings-dirty-switch-guard`,children:[(0,K.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,K.jsx)($p,{className:`mt-0.5 h-4 w-4 text-amber-500`}),(0,K.jsxs)(`div`,{className:`flex-1`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Unsaved changes are still open.`}),(0,K.jsx)(`div`,{className:`mt-1 text-foreground-muted`,children:`Switching sections now would drop the current draft. Discard the draft or stay on the current section.`})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:`primary`,onClick:Ge,children:`Discard changes`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>x(null),children:`Keep editing`})]})]}):null,_===`general`?(0,K.jsxs)(`section`,{className:`space-y-6`,"data-testid":`general-settings`,children:[(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`General settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`This local surface stays opinionated for Babysitter workflows: filesystem-backed config, gateway connectivity, live runs, and app theme are treated as first-class operator preferences instead of being hidden behind a runtime-only modal.`})]}),(0,K.jsxs)(`div`,{className:`grid min-w-[240px] gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(Sv,{label:`Theme`,value:t}),(0,K.jsx)(Sv,{label:`Gateway`,value:n?.gatewayUrl??`not connected`}),(0,K.jsx)(Sv,{label:`Notifications`,value:Le}),(0,K.jsx)(Sv,{label:`Config files`,value:`2 local files`})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Local runtime framing`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(Sv,{label:`Kanban config`,value:U_}),(0,K.jsx)(Sv,{label:`Section storage`,value:W_}),(0,K.jsx)(Sv,{label:`Saved access`,value:n?`configured`:`missing`}),(0,K.jsx)(Sv,{label:`Linked repos`,value:String(je)})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{variant:`primary`,onClick:()=>e(`/login`),children:i?`Reconnect gateway`:`Connect gateway`}),i?(0,K.jsx)(J,{onClick:()=>r(),variant:`ghost`,type:`button`,children:`Forget access`}):null]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Breadth without losing local voice`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`Repositories, organization, remote-project bindings, agent configuration, MCP servers, editor integration, git, notifications, task tags, and keyboard shortcuts are all navigable here.`}),(0,K.jsx)(`p`,{children:`The local package still centers Babysitter operations: linked repository defaults, workspace-driven editing, run attention, and filesystem-backed configuration remain visible instead of being flattened into generic settings copy.`})]})]})]})]}),(0,K.jsx)(xv,{})]}):null,_===`repositories-projects`?(0,K.jsxs)(`section`,{className:`space-y-6`,"data-testid":`repositories-projects-settings`,children:[(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Repositories and projects`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Shared project policy and linked repository defaults live here, alongside the reusable authoring surfaces that stay tied to project execution context.`})]}),(0,K.jsxs)(`div`,{className:`grid min-w-[220px] gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(Sv,{label:`Projects`,value:String(c?.projects.length??0)}),(0,K.jsx)(Sv,{label:`Linked repos`,value:String(E?.repositories.length??0)})]})]}),u?(0,K.jsx)(iv,{text:`Loading repositories and project settings…`}):d?(0,K.jsx)(ov,{title:`Failed to load project settings`,message:d}):!E||!m?(0,K.jsx)(av,{title:`Project context is missing`,message:`No local kanban project snapshot is available yet, so repository and project settings cannot be edited.`}):(0,K.jsxs)(`div`,{className:`mt-5 space-y-5`,children:[re?(0,K.jsx)(sv,{message:re}):null,F?(0,K.jsx)(cv,{message:F}):null,(0,K.jsxs)(`div`,{className:`grid gap-5 xl:grid-cols-[minmax(0,340px)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Project policy`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4`,children:[(0,K.jsx)(pv,{label:`Review required before done`,checked:E.reviewRequiredForDone,onChange:e=>D(t=>t&&{...t,reviewRequiredForDone:e})}),(0,K.jsx)(fv,{label:`Activity scope`,value:E.activityScope,onChange:e=>D(t=>t&&{...t,activityScope:e}),options:[{value:`project-and-issues`,label:`Project and issues`},{value:`all-board-entities`,label:`All board entities`}]}),(0,K.jsx)(fv,{label:`Workspace provisioning`,value:E.workspaceProvisioning,onChange:e=>D(t=>t&&{...t,workspaceProvisioning:e}),options:[{value:`owners-maintainers`,label:`Owners and maintainers`},{value:`contributors-and-up`,label:`Contributors and up`}]})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Repository defaults`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Each repository persists through the existing issue-linked mutation seam, so missing work-item context is called out explicitly.`})]}),(0,K.jsx)(`select`,{"aria-label":`Repository selector`,value:S??``,onChange:e=>C(e.target.value),className:`h-10 rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:E.repositories.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.fullName},e.id))})]}),E.repositories.length===0?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border bg-card px-4 py-4 text-sm text-foreground-muted`,children:`No linked repositories exist yet.`}):Ae?(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4`,children:[Ae.linkedIssueId?null:(0,K.jsx)(`div`,{className:`rounded-2xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-foreground`,"data-testid":`missing-project-context`,children:`This repository is visible in the snapshot, but there is no linked issue/work item available to persist repository settings through the current kanban API seam.`}),(0,K.jsx)(lv,{label:`Base branch`,value:Ae.baseBranch,onChange:e=>D(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===Ae.id?{...t,baseBranch:e}:t)})}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsx)(lv,{label:`CI provider`,value:Ae.ciProvider,onChange:e=>D(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===Ae.id?{...t,ciProvider:e}:t)})}),(0,K.jsx)(lv,{label:`Publish target`,value:Ae.publishTarget,onChange:e=>D(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===Ae.id?{...t,publishTarget:e}:t)})})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsx)(pv,{label:`Auto merge`,checked:Ae.autoMerge,onChange:e=>D(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===Ae.id?{...t,autoMerge:e}:t)})}),(0,K.jsx)(dv,{label:`Required approvals`,value:Ae.requiredApprovals,min:0,onChange:e=>D(t=>t&&{...t,repositories:t.repositories.map(t=>t.id===Ae.id?{...t,requiredApprovals:Math.max(0,e)}:t)})})]})]},Ae.id):null]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:`primary`,onClick:()=>void Ke(),disabled:M||!Re,children:M?`Saving…`:`Save repositories/projects`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>{D(w),ie(null),I(null)},disabled:!Re||M,children:`Discard changes`})]})]})]}),(0,K.jsx)(bv,{dispatchContextLabels:h,issues:g,onRefresh:l})]}):null,_===`organization`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`organization-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Organization settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Team identity, visibility, default role, and roster policy are treated as a separate organization section instead of being buried in the default settings body.`}),u?(0,K.jsx)(iv,{text:`Loading organization settings…`}):d?(0,K.jsx)(ov,{title:`Failed to load organization settings`,message:d}):!m||!A?(0,K.jsx)(av,{title:`Organization context is missing`,message:`No project/team data is available in the local backlog snapshot.`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 lg:grid-cols-3`,children:[(0,K.jsx)(Sv,{label:`Team`,value:`${m.team.name} (${m.team.members.length} members)`}),(0,K.jsx)(Sv,{label:`Visibility`,value:`${m.team.settings.visibility} / default ${m.team.settings.defaultRole}`}),(0,K.jsx)(Sv,{label:`Workspace policy`,value:m.settings.workspaceProvisioning})]}),L?(0,K.jsx)(sv,{message:L}):null,te?(0,K.jsx)(cv,{message:te}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Organization policy`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4`,children:[(0,K.jsx)(lv,{label:`Team name`,value:A.teamName,onChange:e=>j(t=>t&&{...t,teamName:e})}),(0,K.jsx)(fv,{label:`Visibility`,value:A.visibility,onChange:e=>j(t=>t&&{...t,visibility:e}),options:[{value:`private`,label:`Private`},{value:`team`,label:`Team`},{value:`workspace-shared`,label:`Workspace shared`}]}),(0,K.jsx)(fv,{label:`Default role`,value:A.defaultRole,onChange:e=>j(t=>t&&{...t,defaultRole:e}),options:[{value:`owner`,label:`Owner`},{value:`maintainer`,label:`Maintainer`},{value:`contributor`,label:`Contributor`},{value:`viewer`,label:`Viewer`}]}),(0,K.jsx)(pv,{label:`Allow self assign`,checked:A.allowSelfAssign,onChange:e=>j(t=>t&&{...t,allowSelfAssign:e})})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:`primary`,onClick:()=>void qe(),disabled:!ze||P,children:P?`Saving…`:`Save organization`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>{j(O),R(null),ne(null)},disabled:!ze||P,children:`Discard changes`})]})]}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(tm,{className:`h-4 w-4`}),`Team roster`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:m.team.members.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-border bg-card px-3 py-2 text-sm`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.displayName}),(0,K.jsx)(`div`,{className:`text-xs text-foreground-muted`,children:e.email??e.id})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:e.role})]},e.id))})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Hp,{className:`h-4 w-4`}),`Permission policy`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:m.permissions.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.action}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:e.description}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.roles.map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:t},`${e.action}-${t}`))})]},e.action))})]})]})]})]})]}):null,_===`remote-project`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`remote-project-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Remote-project settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Remote host, organization, and project binding state is surfaced explicitly so linked PR and review failures are explainable before operators leave the page.`}),u?(0,K.jsx)(iv,{text:`Loading remote-project settings…`}):d?(0,K.jsx)(ov,{title:`Failed to load remote-project settings`,message:d}):m?m.integrations.length===0?(0,K.jsx)(av,{title:`Host context is missing`,message:`No remote host integrations are configured for this project yet.`}):(0,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[m.integrations.some(e=>e.prerequisites.some(e=>!e.satisfied))?(0,K.jsx)(`div`,{className:`rounded-2xl border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm text-foreground`,"data-testid":`missing-host-context`,children:`One or more remote hosts are missing organization or project binding prerequisites. Fix those prerequisites before relying on linked PR actions.`}):null,(0,K.jsx)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:m.integrations.map(e=>(0,K.jsx)(wv,{integration:e},e.provider))})]}):(0,K.jsx)(av,{title:`Project context is missing`,message:`Remote-project bindings depend on a loaded project snapshot.`})]}):null,_===`agent-configuration`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`agent-configuration-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Agent configuration`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Default model, provider, approval mode, and token limits are validated and saved as a distinct section with its own loading and retry behavior.`}),ae.status===`loading`||ae.status===`idle`?(0,K.jsx)(iv,{text:`Loading agent configuration…`}):ae.status===`error`?(0,K.jsx)(ov,{title:`Failed to load agent configuration`,message:ae.error??`Unknown error`}):!ae.data||ae.data.agents.length===0?(0,K.jsx)(av,{title:`No agent configuration is available`,message:`No agent definitions were returned for this settings surface.`}):(0,K.jsxs)(K.Fragment,{children:[me?(0,K.jsx)(sv,{message:me}):null,ge?(0,K.jsx)(cv,{message:ge}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[220px_minmax(0,1fr)]`,children:[(0,K.jsx)(`div`,{className:`space-y-2`,children:ae.data.agents.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>de(e.agent),className:[`w-full rounded-2xl border px-4 py-3 text-left`,z===e.agent?`border-primary/30 bg-primary/10`:`border-border bg-background/60`].join(` `),children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.displayName}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[`default `,e.defaultModel||`unconfigured`]})]},e.agent))}),z&&le[z]?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsx)(lv,{label:`Model`,value:le[z].configuredModel,onChange:e=>ue(t=>({...t,[z]:{...t[z],configuredModel:e}})),listId:`agent-models-${z}`}),(0,K.jsx)(`datalist`,{id:`agent-models-${z}`,children:le[z].availableModels.map(e=>(0,K.jsx)(`option`,{value:e.modelId},e.modelId))}),(0,K.jsx)(lv,{label:`Provider`,value:le[z].configuredProvider,onChange:e=>ue(t=>({...t,[z]:{...t[z],configuredProvider:e}}))}),(0,K.jsx)(fv,{label:`Approval mode`,value:le[z].approvalMode,onChange:e=>ue(t=>({...t,[z]:{...t[z],approvalMode:e}})),options:[{value:`prompt`,label:`Prompt`},{value:`yolo`,label:`Yolo`},{value:`deny`,label:`Deny`}]}),(0,K.jsx)(lv,{label:`Max tokens`,value:le[z].maxTokens,onChange:e=>ue(t=>({...t,[z]:{...t[z],maxTokens:e}}))})]}),(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card px-4 py-3 text-xs text-foreground-muted`,children:[`Known models:`,` `,le[z].availableModels.map(e=>e.deprecated&&e.successorModelId?`${e.modelId} -> ${e.successorModelId}`:e.modelId).join(`, `)]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:`primary`,onClick:()=>void Je(),disabled:!Ve||fe,children:fe?`Saving…`:`Save agent configuration`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>{ue(se),he(null),_e(null)},disabled:!Ve||fe,children:`Discard changes`})]})]}):null]})]})]}):null,_===`mcp-servers`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`mcp-server-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`MCP server settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Per-agent MCP transport definitions are edited as structured drafts so invalid entries fail safely without wiping the current form state.`}),ve.status===`loading`||ve.status===`idle`?(0,K.jsx)(iv,{text:`Loading MCP server settings…`}):ve.status===`error`?(0,K.jsx)(ov,{title:`Failed to load MCP server settings`,message:ve.error??`Unknown error`}):!ve.data||ve.data.agents.length===0?(0,K.jsx)(av,{title:`No MCP server settings are available`,message:`No agents were returned for the MCP settings section.`}):(0,K.jsxs)(K.Fragment,{children:[V?(0,K.jsx)(sv,{message:V}):null,Oe?(0,K.jsx)(cv,{message:Oe}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[220px_minmax(0,1fr)]`,children:[(0,K.jsx)(`div`,{className:`space-y-2`,children:ve.data.agents.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>we(e.agent),className:[`w-full rounded-2xl border px-4 py-3 text-left`,B===e.agent?`border-primary/30 bg-primary/10`:`border-border bg-background/60`].join(` `),children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.displayName}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[(Se[e.agent]??[]).length,` server(s)`]})]},e.agent))}),B?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`text-sm font-semibold text-foreground`,children:[`MCP definitions for `,B]}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>Ce(e=>({...e,[B]:[...e[B]??[],{name:``,transport:`stdio`,command:``,url:``,argsText:``,envText:``}]})),children:`Add server`})]}),(Se[B]??[]).length===0?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border bg-card px-4 py-4 text-sm text-foreground-muted`,children:`No MCP servers configured for this agent yet.`}):(0,K.jsx)(`div`,{className:`mt-4 space-y-4`,children:(Se[B]??[]).map((e,t)=>(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsx)(lv,{label:`Name`,value:e.name,onChange:e=>Ce(n=>({...n,[B]:(n[B]??[]).map((n,r)=>r===t?{...n,name:e}:n)}))}),(0,K.jsx)(fv,{label:`Transport`,value:e.transport,onChange:e=>Ce(n=>({...n,[B]:(n[B]??[]).map((n,r)=>r===t?{...n,transport:e}:n)})),options:[{value:`stdio`,label:`stdio`},{value:`sse`,label:`sse`},{value:`streamable-http`,label:`streamable-http`}]})]}),e.transport===`stdio`?(0,K.jsx)(lv,{label:`Command`,value:e.command,onChange:e=>Ce(n=>({...n,[B]:(n[B]??[]).map((n,r)=>r===t?{...n,command:e}:n)}))}):(0,K.jsx)(lv,{label:`URL`,value:e.url,onChange:e=>Ce(n=>({...n,[B]:(n[B]??[]).map((n,r)=>r===t?{...n,url:e}:n)}))}),(0,K.jsx)(uv,{label:`Args`,value:e.argsText,onChange:e=>Ce(n=>({...n,[B]:(n[B]??[]).map((n,r)=>r===t?{...n,argsText:e}:n)})),placeholder:`One argument per line`}),(0,K.jsx)(uv,{label:`Environment`,value:e.envText,onChange:e=>Ce(n=>({...n,[B]:(n[B]??[]).map((n,r)=>r===t?{...n,envText:e}:n)})),placeholder:`KEY=value`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>Ce(e=>({...e,[B]:(e[B]??[]).filter((e,n)=>n!==t)})),children:`Remove server`})]})},`${B}-${t}`))}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:`primary`,onClick:()=>void Ye(),disabled:!He||Te,children:Te?`Saving…`:`Save MCP servers`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>{Ce(be),De(null),ke(null)},disabled:!He||Te,children:`Discard changes`})]})]}):null]})]})]}):null,_===`editor-integration`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`editor-integration-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Editor integration`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`The local package is workspace-first. Editing happens through sessions and workspaces, with keyboard-driven panels and command-bar access layered on top instead of hidden in a separate IDE-only integration surface.`}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(Sv,{label:`Workspace shortcuts`,value:String(Ie.length)}),(0,K.jsx)(Sv,{label:`Primary route`,value:`/workspaces`}),(0,K.jsx)(Sv,{label:`Command bar`,value:`Ctrl/Cmd + K`}),(0,K.jsx)(Sv,{label:`Session route`,value:`/sessions`})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{variant:`primary`,onClick:()=>e(`/workspaces`),children:`Open workspaces`}),(0,K.jsx)(J,{variant:`ghost`,onClick:()=>e(`/sessions`),children:`Open sessions`})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Active editor conventions`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`Session workspaces expose panel toggles for workspace, conversation, context, and details alongside a command bar for fast navigation.`}),(0,K.jsx)(`p`,{children:`Settings breadth here keeps those local editing conventions visible instead of pretending editor integration is only an external IDE handshake.`})]})]})]})]}):null,_===`git`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`git-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Git settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Repository policy is still edited through project-backed seams, but the git section summarizes the current branch, review, merge, and provider readiness posture in one place.`}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-4`,children:[(0,K.jsx)(Sv,{label:`Linked repos`,value:String(je)}),(0,K.jsx)(Sv,{label:`Auto-merge enabled`,value:String(Me)}),(0,K.jsx)(Sv,{label:`Connected providers`,value:String(Pe)}),(0,K.jsx)(Sv,{label:`Missing bindings`,value:String(Ne)})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Repository defaults`}),je===0?(0,K.jsx)(`div`,{className:`mt-3 text-sm text-foreground-muted`,children:`No linked repositories are available yet.`}):(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:(E?.repositories??[]).map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.fullName}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Base branch `,e.baseBranch,` · approvals `,e.requiredApprovals,` · auto-merge`,` `,e.autoMerge?`on`:`off`]})]},e.id))})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Remote readiness`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`Provider connectivity and missing project bindings affect linked PR workflows, review sync, and approval automation.`}),(0,K.jsx)(`p`,{children:`Use the Repositories & Projects and Remote Projects sections to change persisted policy; this section keeps the current git posture visible at a glance.`})]})]})]})]}):null,_===`notifications`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`notification-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Notification settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Run completion, failure, and waiting-for-review events surface in-app first, with browser notifications available when permission is granted and the tab is hidden.`}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-4`,children:[(0,K.jsx)(Sv,{label:`Browser permission`,value:Le}),(0,K.jsx)(Sv,{label:`In-app queue`,value:String(a.length)}),(0,K.jsx)(Sv,{label:`Persistent alerts`,value:`breakpoints stay pinned`}),(0,K.jsx)(Sv,{label:`Digest polling`,value:`3s`})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,1fr)_minmax(0,1.1fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Current behavior`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`New runs, completions, failures, and breakpoint attention all publish to the in-app stack.`}),(0,K.jsx)(`p`,{children:`Browser notifications only fire when permission is granted and the document is hidden.`}),(0,K.jsx)(`p`,{children:`Breakpoint notifications stay persistent until operators resolve them.`})]}),o===`granted`?null:(0,K.jsx)(`div`,{className:`mt-4`,children:(0,K.jsx)(J,{type:`button`,variant:`primary`,onClick:s,children:`Enable browser notifications`})})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Why this is explicit here`}),(0,K.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`p`,{children:`Upstream breadth includes notifications, but the local package needs to explain the Babysitter-specific attention model: runs can require review, not just passive status updates.`}),(0,K.jsx)(`p`,{children:`This section keeps notification policy visible without forcing operators to infer it from transient toasts alone.`})]})]})]})]}):null,_===`task-tags`?(0,K.jsx)(yv,{}):null,_===`keyboard-shortcuts`?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`keyboard-shortcut-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Keyboard shortcut settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Shortcut visibility is explicit here so the app shell, dispatch detail view, and session workspace remain keyboard-driven without hiding the available commands behind memory alone.`}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 lg:grid-cols-3`,children:[(0,K.jsx)(Sv,{label:`Shortcut groups`,value:String(Fe.length)}),(0,K.jsx)(Sv,{label:`Global shortcuts`,value:String(l_.filter(e=>e.context===`global`).length)}),(0,K.jsx)(Sv,{label:`Workspace shortcuts`,value:String(Ie.length)})]}),(0,K.jsx)(`div`,{className:`mt-5 space-y-4`,children:Fe.map(([e,t])=>(0,K.jsxs)(`section`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:u_[e]??e}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:t.map(t=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:t.description}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:t.keys.join(` + `)})]},`${e}-${t.description}`))})]},e))})]}):null]})]})]})}function iv(e){return(0,K.jsx)(`div`,{className:`mt-5 rounded-2xl border border-border bg-background/60 px-4 py-4 text-sm text-foreground-muted`,children:e.text})}function av(e){return(0,K.jsxs)(`div`,{className:`mt-5 rounded-2xl border border-dashed border-border bg-background/40 px-4 py-4`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.title}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.message})]})}function ov(e){return(0,K.jsxs)(`div`,{className:`mt-5 rounded-2xl border border-error/25 bg-error-muted px-4 py-4`,children:[(0,K.jsx)(`div`,{className:`font-medium text-error`,children:e.title}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-error`,children:e.message})]})}function sv(e){return(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/25 bg-error-muted px-4 py-3 text-sm text-error`,children:e.message})}function cv(e){return(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-green-500/25 bg-green-500/10 px-4 py-3 text-sm text-green-700 dark:text-green-300`,children:e.message})}function lv(e){return(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[e.label,(0,K.jsx)(`input`,{value:e.value,onChange:t=>e.onChange(t.target.value),list:e.listId,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]})}function uv(e){return(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[e.label,(0,K.jsx)(`textarea`,{value:e.value,onChange:t=>e.onChange(t.target.value),placeholder:e.placeholder,className:`mt-2 min-h-24 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]})}function dv(e){return(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[e.label,(0,K.jsx)(`input`,{type:`number`,min:e.min,value:e.value,onChange:t=>e.onChange(Number.parseInt(t.target.value,10)||0),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]})}function fv(e){return(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[e.label,(0,K.jsx)(`select`,{value:e.value,onChange:t=>e.onChange(t.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:e.options.map(e=>(0,K.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})}function pv(e){return(0,K.jsxs)(`label`,{className:`flex items-center justify-between gap-4 rounded-2xl border border-border bg-card px-4 py-3 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),(0,K.jsx)(`input`,{type:`checkbox`,checked:e.checked,onChange:t=>e.onChange(t.target.checked),className:`h-4 w-4`})]})}var mv=/^[a-z0-9]+(?:_[a-z0-9]+)*$/,hv={key:``,label:``,content:``,description:``};function gv(e){return[...e].sort((e,t)=>e.order-t.order||e.key.localeCompare(t.key)||e.label.localeCompare(t.label))}function _v(e,t,n){let r={key:e.key.trim(),label:e.label.trim(),content:e.content.trim(),description:e.description.trim()},i={};return r.key?mv.test(r.key)?t.some(e=>e.key===r.key&&e.id!==n)&&(i.key=`Key ${r.key} already exists.`):i.key=`Key must use lowercase snake_case.`:i.key=`Key is required.`,r.label||(i.label=`Label is required.`),r.content||(i.content=`Snippet content is required.`),{normalized:r,errors:i}}function vv(e){return e.includes(`snake_case`)?{key:`Key must use lowercase snake_case.`}:e.includes(`already exists`)?{key:e}:{}}function yv(){let[e,t]=(0,b.useState)([]),[n,r]=(0,b.useState)(!0),[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(hv),[c,l]=(0,b.useState)(null),[u,d]=(0,b.useState)({}),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(null),[g,_]=(0,b.useState)(!1),[v,y]=(0,b.useState)(null);(0,b.useEffect)(()=>{let e=!0;async function n(){r(!0),a(null);try{let n=await Wm();if(!e)return;t(gv(n))}catch(t){if(!e)return;a(t instanceof Error?t.message:`Failed to load Task Tags.`)}finally{e&&r(!1)}}return n(),()=>{e=!1}},[]);let x=gv(e);function S(){s(hv),l(null),d({})}function C(e){l(e.id),s({key:e.key,label:e.label,content:e.content,description:e.description??``}),d({}),p(null),h(null)}async function w(e){e.preventDefault();let{normalized:n,errors:r}=_v(o,x,c);if(Object.keys(r).length>0){d(r),p(null);return}_(!0),d({}),p(null),h(null);try{let e={key:n.key,label:n.label,content:n.content,description:n.description||void 0};t(gv((c?await Km(c,e):await Gm({...e,order:x.length})).taskTags)),h(c?`Updated @${n.key}.`:`Created @${n.key}.`),S()}catch(e){let t=e instanceof Error?e.message:`Failed to save Task Tag.`,n=vv(t);d(n),p(Object.keys(n).length>0?null:t)}finally{_(!1)}}async function T(e){y(e.id),p(null),h(null);try{t(gv((await qm(e.id)).taskTags)),h(`Deleted @${e.key}.`),c===e.id&&S()}catch(e){p(e instanceof Error?e.message:`Failed to delete Task Tag.`)}finally{y(null)}}async function E(n,r){let i=x.findIndex(e=>e.id===n),a=i+r;if(i<0||a<0||a>=x.length)return;let o=[...x],[s]=o.splice(i,1);if(!s)return;o.splice(a,0,s);let c=o.map((e,t)=>({...e,order:t}));y(n),p(null),h(null);try{let n=e;for(let e of c){let t=x.find(t=>t.id===e.id);!t||t.order===e.order||(n=[...(await Km(e.id,{order:e.order})).taskTags])}t(gv(n)),h(`Updated Task Tag order.`)}catch(e){p(e instanceof Error?e.message:`Failed to reorder Task Tags.`)}finally{y(null)}}return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`task-tag-settings`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Task Tags`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:"Reusable snippet tags stay separate from issue labels and Dispatch Context Labels. This Settings surface manages the shared `@` library that authoring flows consume."})]}),(0,K.jsxs)(`div`,{className:`grid min-w-[220px] gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(Sv,{label:`Definitions`,value:String(x.length)}),(0,K.jsx)(Sv,{label:`Sort rule`,value:x.length>0?`order then key`:`empty library`})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-6 xl:grid-cols-[minmax(0,1.1fr)_minmax(0,1.4fr)]`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:c?`Edit Task Tag`:`Create Task Tag`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:"Keys must be unique lowercase snake_case tokens used after `@`."})]}),c?(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:S,children:`Cancel edit`}):null]}),(0,K.jsxs)(`form`,{className:`mt-4 space-y-4`,onSubmit:w,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Key`,(0,K.jsx)(`input`,{"aria-label":`Task Tag key`,value:o.key,onChange:e=>s(t=>({...t,key:e.target.value})),placeholder:`bug_report`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 font-mono text-sm text-foreground placeholder:text-foreground-muted/60`}),u.key?(0,K.jsx)(`span`,{className:`mt-2 block text-xs normal-case tracking-normal text-error`,children:u.key}):null]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Label`,(0,K.jsx)(`input`,{"aria-label":`Task Tag label`,value:o.label,onChange:e=>s(t=>({...t,label:e.target.value})),placeholder:`Bug Report`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground placeholder:text-foreground-muted/60`}),u.label?(0,K.jsx)(`span`,{className:`mt-2 block text-xs normal-case tracking-normal text-error`,children:u.label}):null]})]}),(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Description`,(0,K.jsx)(`input`,{"aria-label":`Task Tag description`,value:o.description,onChange:e=>s(t=>({...t,description:e.target.value})),placeholder:`Optional guidance for when this snippet should be used.`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground placeholder:text-foreground-muted/60`})]}),(0,K.jsxs)(`label`,{className:`block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Snippet content`,(0,K.jsx)(`textarea`,{"aria-label":`Task Tag content`,value:o.content,onChange:e=>s(t=>({...t,content:e.target.value})),placeholder:`Describe the bug, impact, expected behavior, and steps to reproduce.`,className:`mt-2 min-h-28 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-foreground-muted/60`}),u.content?(0,K.jsx)(`span`,{className:`mt-2 block text-xs normal-case tracking-normal text-error`,children:u.content}):null]}),f?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:f}):null,m?(0,K.jsx)(`div`,{className:`rounded-2xl border border-success/30 bg-success-muted px-4 py-3 text-sm text-success`,children:m}):null,(0,K.jsx)(J,{type:`submit`,variant:`primary`,disabled:g||v!==null,children:g?`Saving Task Tag…`:c?`Save Task Tag`:`Create Task Tag`})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Reusable library`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:"Ordering is explicit. Move controls patch stored `order` values to keep autocomplete deterministic."})]}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>{r(!0),a(null),Wm().then(e=>t(gv(e))).catch(e=>a(e instanceof Error?e.message:`Failed to load Task Tags.`)).finally(()=>r(!1))},disabled:n,children:`Refresh`})]}),i?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:i}):null,n?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card px-4 py-4 text-sm text-foreground-muted`,children:`Loading Task Tags…`}):x.length===0?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border bg-card px-4 py-4 text-sm text-foreground-muted`,children:`No Task Tags yet. Create one to seed the reusable snippet library.`}):(0,K.jsx)(`div`,{className:`mt-4 space-y-3`,children:x.map((e,t)=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`task-tag-item-${e.id}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.label}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs font-mono text-foreground-muted`,children:[`@`,e.key]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[`order `,e.order]})]}),e.description?(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:e.description}):null]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>void E(e.id,-1),disabled:t===0||v!==null||g,"aria-label":`Move ${e.label} up`,children:`Move up`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>void E(e.id,1),disabled:t===x.length-1||v!==null||g,"aria-label":`Move ${e.label} down`,children:`Move down`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>C(e),disabled:v!==null||g,children:`Edit`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>void T(e),disabled:v!==null||g,children:v===e.id?`Deleting…`:`Delete`})]})]}),(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap rounded-xl border border-border bg-background/80 px-3 py-3 text-xs text-foreground-secondary`,children:e.content})]},e.id))})]})]})]})}function bv(e){let[t,n]=(0,b.useState)(V_()),[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(null),[d,f]=(0,b.useState)(null);async function p(t,n){c(t),u(null),f(null);try{await n(),await e.onRefresh()}catch(e){throw u(e instanceof Error?e.message:`Dispatch Context Label update failed.`),e}finally{c(null)}}async function m(){await p(`create-dispatch-context-label`,async()=>{await Jm({key:t.key,label:t.label,description:t.description||void 0,instruction:t.instruction}),n(V_()),f(`Created Dispatch Context Label definition.`)})}async function h(){!r||!a||await p(`save-${r}`,async()=>{await Ym(r,{key:a.key,label:a.label,description:a.description||void 0,instruction:a.instruction}),i(null),o(null),f(`Updated Dispatch Context Label definition.`)})}async function g(e){await p(`delete-${e}`,async()=>{await Xm(e),r===e&&(i(null),o(null)),f(`Deleted Dispatch Context Label definition.`)})}return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`dispatch-context-label-settings`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Dispatch Context Labels`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Manage reusable execution-context definitions here. These definitions stay separate from board labels, Task Tags, and default agent selection so reviewers can inspect exactly what dispatch instructions are reusable and where they are attached.`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,K.jsx)(Sv,{label:`Definitions`,value:String(e.dispatchContextLabels.length)}),(0,K.jsx)(Sv,{label:`Attached issues`,value:String(e.issues.filter(e=>e.dispatch.contextLabels.length>0).length)}),(0,K.jsx)(Sv,{label:`Rendered projections`,value:String(e.issues.filter(e=>(e.dispatch.renderedContext??``).length>0).length)})]}),l?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/25 bg-error-muted px-4 py-3 text-sm text-error`,children:l}):null,d?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-success/30 bg-success-muted px-4 py-3 text-sm text-success`,children:d}):null,(0,K.jsxs)(`div`,{className:`mt-5 grid gap-5 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]`,children:[(0,K.jsxs)(`form`,{className:`rounded-2xl border border-border bg-background/60 p-4`,onSubmit:e=>{e.preventDefault(),m().catch(()=>void 0)},children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Create reusable definition`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Define the reusable dispatch instruction once, then attach it by reference on the issue surface instead of copying prompt text into board labels or Task Tags.`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Dispatch Context Label key`,(0,K.jsx)(`input`,{"aria-label":`Dispatch Context Label key`,value:t.key,onChange:e=>n(t=>({...t,key:e.target.value})),placeholder:`tests_first`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Display label`,(0,K.jsx)(`input`,{"aria-label":`Dispatch Context Label name`,value:t.label,onChange:e=>n(t=>({...t,label:e.target.value})),placeholder:`Tests First`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Helper description`,(0,K.jsx)(`textarea`,{"aria-label":`Dispatch Context Label description`,value:t.description,onChange:e=>n(t=>({...t,description:e.target.value})),placeholder:`Explain when to attach this reusable context label.`,className:`mt-2 min-h-20 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Dispatch instruction`,(0,K.jsx)(`textarea`,{"aria-label":`Dispatch Context Label instruction`,value:t.instruction,onChange:e=>n(t=>({...t,instruction:e.target.value})),placeholder:`Write or update deterministic verification before implementation changes.`,className:`mt-2 min-h-32 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:s===`create-dispatch-context-label`,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:s===`create-dispatch-context-label`?`Creating definition…`:`Create Dispatch Context Label`})]})]}),(0,K.jsxs)(`div`,{className:`space-y-3`,children:[e.dispatchContextLabels.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border bg-background/40 p-4 text-sm text-foreground-muted`,children:`No Dispatch Context Label definitions exist yet. Create one here, then attach it from the issue surface.`}):null,e.dispatchContextLabels.map(t=>{let n=e.issues.filter(e=>e.dispatch.contextLabels.some(e=>e.labelId===t.id));return(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:r===t.id&&a!==null?(0,K.jsxs)(`form`,{className:`grid gap-3`,onSubmit:e=>{e.preventDefault(),h().catch(()=>void 0)},children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Edit definition`}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[n.length,` issue`,n.length===1?``:`s`]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Dispatch Context Label key`,(0,K.jsx)(`input`,{"aria-label":`Dispatch Context Label key ${t.key}`,value:a.key,onChange:e=>o(t=>t&&{...t,key:e.target.value}),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Display label`,(0,K.jsx)(`input`,{"aria-label":`Dispatch Context Label name ${t.key}`,value:a.label,onChange:e=>o(t=>t&&{...t,label:e.target.value}),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Helper description`,(0,K.jsx)(`textarea`,{"aria-label":`Dispatch Context Label description ${t.key}`,value:a.description,onChange:e=>o(t=>t&&{...t,description:e.target.value}),className:`mt-2 min-h-20 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Dispatch instruction`,(0,K.jsx)(`textarea`,{"aria-label":`Dispatch Context Label instruction ${t.key}`,value:a.instruction,onChange:e=>o(t=>t&&{...t,instruction:e.target.value}),className:`mt-2 min-h-28 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(`button`,{type:`submit`,disabled:s===`save-${t.id}`,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:s===`save-${t.id}`?`Saving…`:`Save definition`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{i(null),o(null),u(null)},className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Cancel edit`})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:t.label}),(0,K.jsx)(`div`,{className:`text-xs text-foreground-muted`,children:t.key})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[n.length,` issue`,n.length===1?``:`s`]})]}),t.description?(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:t.description}):null,(0,K.jsx)(`pre`,{className:`mt-3 whitespace-pre-wrap rounded-xl border border-border bg-card px-3 py-3 text-xs text-foreground-secondary`,children:t.instruction}),n.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:n.map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:e.key},`${t.id}-${e.id}`))}):(0,K.jsx)(`div`,{className:`mt-3 text-xs text-foreground-muted`,children:`Not attached to any issue yet.`}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>{i(t.id),o({key:t.key,label:t.label,description:t.description??``,instruction:t.instruction}),u(null),f(null)},className:`inline-flex h-11 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground`,children:`Edit definition`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void g(t.id).catch(()=>void 0),disabled:s===`delete-${t.id}`,className:`inline-flex h-11 items-center justify-center rounded-xl border border-error/30 bg-error-muted px-4 text-sm font-semibold text-error disabled:opacity-50`,children:s===`delete-${t.id}`?`Deleting…`:`Delete definition`})]})]})},t.id)})]})]})]})}function xv(){let e=mr(),{store:t}=dr(),n=pr(t,e=>e.agents.items.length),r=pr(t,e=>Object.keys(e.sessions.byId).length),i=pr(t,e=>Object.keys(e.runs.byId).length);return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Live state`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,K.jsx)(Sv,{label:`Socket status`,value:e.status}),(0,K.jsx)(Sv,{label:`Agents`,value:String(n)}),(0,K.jsx)(Sv,{label:`Sessions`,value:String(r)}),(0,K.jsx)(Sv,{label:`Dispatches`,value:String(i)})]}),e.error?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/20 bg-error-muted px-4 py-3 text-sm text-error`,children:e.error}):null]})}function Sv(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.2em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-medium`,children:e.value})]})}function Cv(e){switch(e){case`connected`:return`border-success/20 bg-success/10 text-success`;case`partial-setup`:case`missing-scopes`:return`border-warning/20 bg-warning/10 text-warning`;case`expired-auth`:case`failing`:return`border-error/20 bg-error/10 text-error`;default:return`border-border bg-background text-foreground-muted`}}function wv(e){let{integration:t}=e,n=[t.actions.canCreatePullRequest?null:`create linked PRs`,t.actions.canManagePullRequest?null:`sync linked PR state`,t.actions.canApproveFromReview?null:`approve from review`].filter(Boolean);return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/60 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:t.label}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:t.accountLabel??`No account selected`})]}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Cv(t.status)}`,children:t.status.replace(/-/g,` `)})]}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:t.guidance}),t.failureMessage?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-error/20 bg-error/10 px-3 py-2 text-sm text-error`,children:t.failureMessage}):null,t.missingScopes?.length?(0,K.jsxs)(`div`,{className:`mt-3 rounded-2xl border border-warning/20 bg-warning/10 px-3 py-2 text-sm text-warning`,children:[`Missing scopes: `,t.missingScopes.join(`, `)]}):null,(0,K.jsx)(`div`,{className:`mt-4 space-y-2`,children:t.prerequisites.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),(0,K.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-xs ${e.satisfied?`border-success/20 bg-success/10 text-success`:`border-warning/20 bg-warning/10 text-warning`}`,children:e.satisfied?`ready`:`missing`})]}),e.guidance?(0,K.jsx)(`div`,{className:`mt-2 text-xs leading-5 text-foreground-muted`,children:e.guidance}):null]},e.key))}),n.length>0?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card px-3 py-3 text-sm text-foreground-muted`,children:[`Blocked actions: `,n.join(`, `),`.`,t.actions.reason?` ${t.actions.reason}`:``]}):null]})}function Tv(e){let t=Be(),{isAuthenticated:n}=Qd();return n?(0,K.jsx)(K.Fragment,{children:e.children}):(0,K.jsx)(`section`,{className:`mx-auto flex w-full max-w-3xl flex-1 items-center justify-center px-6 py-10`,children:(0,K.jsxs)(`div`,{className:`w-full rounded-3xl border border-border bg-card p-8 shadow-lg`,children:[(0,K.jsx)(`p`,{className:`mb-2 text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Gateway Required`}),(0,K.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e.title??`Connect agent-mux before using this page`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:e.body??`This surface wraps live agent-mux sessions and hooks. Connect through the gateway login flow, then come back here.`}),(0,K.jsxs)(`div`,{className:`mt-6 flex gap-3`,children:[(0,K.jsx)(J,{variant:`primary`,onClick:()=>t(`/login`),children:`Connect gateway`}),(0,K.jsx)(J,{variant:`ghost`,onClick:()=>t(`/settings`),children:`Open settings`})]})]})})}async function Ev(e){let t=await Pm(`/api/reviews`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(t.error.message);return t.data}function Dv(e={},t=15e3){let n=(0,b.useMemo)(()=>{let t=new URLSearchParams;return e.targetType&&t.set(`targetType`,e.targetType),e.targetId&&t.set(`targetId`,e.targetId),`/api/reviews${t.size>0?`?${t.toString()}`:``}`},[e.targetId,e.targetType]),[r,i]=(0,b.useState)(null),{data:a,loading:o,error:s,refresh:c}=Um(n,{interval:t,sseFilter:e=>e.type===`update`||e.type===`new-run`});async function l(e){i(e.artifactId);try{let t=await Ev(e);return await c(),t}finally{i(null)}}let u=a?.artifacts??[];return{snapshot:a,artifacts:u,queue:a?.queue??[],summary:a?.summary,loading:o,error:s,refresh:c,actOnReview:l,pendingArtifactId:r,selectedArtifact:e=>u.find(t=>t.id===e)??null}}var Ov=[`recovery`,`review`,`executing`,`dispatch`,`done`];function kv(e){switch(e){case`recovery`:return`Recovery`;case`review`:return`Approval`;case`executing`:return`Execution`;case`dispatch`:return`Dispatch`;case`done`:return`Done`}}function Av(e){switch(e){case`recovery`:return`border-error/25 bg-error-muted`;case`review`:return`border-warning/25 bg-warning-muted`;case`executing`:return`border-primary/25 bg-primary/10`;case`dispatch`:return`border-border bg-background/80`;case`done`:return`border-success/25 bg-success-muted`}}function jv(e){switch(e){case`critical`:return`border-error/25 bg-error-muted text-error`;case`attention`:return`border-warning/25 bg-warning-muted text-warning`;default:return`border-success/25 bg-success-muted text-success`}}function Mv(){let{snapshot:e,board:t,loading:n,error:r}=Zm(),i=Dv({},15e3),{data:a,loading:o,error:s}=Um(`/api/runs?limit=200&sort=activity`,{interval:5e3,sseFilter:()=>!0}),c=a?.runs??[],l=Oh({snapshot:e,board:t,runs:c,reviewArtifacts:i.artifacts}),u=kh(c).slice(0,6);return n&&o||!e&&!t&&!a&&!r&&!s?(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-border bg-card p-6 shadow-lg`,children:(0,K.jsxs)(`div`,{className:`animate-pulse space-y-4`,children:[(0,K.jsx)(`div`,{className:`h-4 w-48 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-8 w-96 rounded bg-background-secondary`}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.5fr_1fr]`,children:[(0,K.jsx)(`div`,{className:`h-80 rounded-2xl bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-80 rounded-2xl bg-background-secondary`})]})]})}):r||s?(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error shadow-lg`,children:`Failed to build the Babysitter execution overlay.`}):(0,K.jsxs)(`section`,{className:`mb-6 rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`babysitter-overlay-panel`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-4xl`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Babysitter-native overlay`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:`Board stages now carry run health, approval state, and recovery context`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:`The board remains the planning surface, but Babysitter run state now maps directly into execution lanes with retry signals, stuck-task detection, breakpoint review entry points, and direct navigation into session and run artifacts.`})]}),(0,K.jsxs)(`div`,{className:`min-w-[260px] rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:`Overlay coverage`}),(0,K.jsxs)(`div`,{className:`mt-3 grid gap-2 text-sm text-foreground-muted`,children:[(0,K.jsxs)(`div`,{children:[l.length,` board cards with linked Babysitter context`]}),(0,K.jsxs)(`div`,{children:[u.filter(e=>e.severity!==`healthy`).length,` runs need operator attention`]}),(0,K.jsxs)(`div`,{children:[i.summary?.openCommentCount??0,` review comments still open`]})]})]})]}),(0,K.jsxs)(`div`,{className:`mt-6 grid gap-6 xl:grid-cols-[1.5fr_1fr]`,children:[(0,K.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:Ov.map(e=>{let t=l.filter(t=>t.stage===e).slice(0,4);return(0,K.jsxs)(`article`,{className:`rounded-2xl border p-4 ${Av(e)}`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:kv(e)}),(0,K.jsxs)(`div`,{className:`text-xs text-foreground-muted`,children:[t.length,` issue overlays`]})]}),(0,K.jsx)(Ip,{className:`h-4 w-4 text-foreground-muted`})]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[t.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-current/10 bg-card/75 p-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-current/15 px-2 py-0.5 text-[11px] uppercase tracking-[0.18em]`,children:e.issueKey}),e.pendingBreakpoints>0?(0,K.jsxs)(`span`,{className:`rounded-full border border-warning/25 bg-warning/10 px-2 py-0.5 text-[11px] text-warning`,children:[e.pendingBreakpoints,` approval`]}):null,e.retryCount>0?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:[e.retryCount,` retries`]}):null]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-semibold text-foreground`,children:e.issueTitle}),(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-foreground-muted`,children:[e.stageLabel,e.stuck?` · stuck-task signal`:``]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[e.primaryRunId?(0,K.jsxs)(G,{to:`/dispatches/${e.primaryRunId}`,className:`inline-flex items-center gap-1 text-primary`,children:[`Run`,(0,K.jsx)(Mf,{className:`h-3 w-3`})]}):null,e.primarySessionId?(0,K.jsxs)(G,{to:`/sessions/${e.primarySessionId}`,className:`inline-flex items-center gap-1 text-primary`,children:[`Session`,(0,K.jsx)(Mf,{className:`h-3 w-3`})]}):null,(0,K.jsxs)(G,{to:`/projects`,className:`inline-flex items-center gap-1 text-primary`,children:[`Board`,(0,K.jsx)(Mf,{className:`h-3 w-3`})]})]})]},e.issueId)),t.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No issues in this overlay lane.`}):null]})]},e)})}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Hp,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Run health and recovery`})]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[u.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(G,{to:`/dispatches/${e.runId}`,className:`font-mono text-sm text-primary`,children:e.runId}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${jv(e.severity)}`,children:e.severity})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:e.processId}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:e.summary}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[(0,K.jsxs)(G,{to:e.recoveryHref,className:`inline-flex items-center gap-1 text-primary`,children:[e.stuck||e.status===`failed`?(0,K.jsx)(hp,{className:`h-3 w-3`}):(0,K.jsx)(Gf,{className:`h-3 w-3`}),`Recovery`]}),e.reviewHref?(0,K.jsxs)(G,{to:e.reviewHref,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(lp,{className:`h-3 w-3`}),`Breakpoint`]}):null]})]},e.runId)),u.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No linked runs yet.`}):null]})]}),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Np,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Operator shortcuts`})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(G,{to:`/inbox`,className:`rounded-2xl border border-border bg-card px-4 py-3 text-left hover:border-primary/30 hover:text-foreground`,children:`Inbox surfaces workspaces that need recovery, rebase, or review action.`}),(0,K.jsx)(G,{to:`/sessions`,className:`rounded-2xl border border-border bg-card px-4 py-3 text-left hover:border-primary/30 hover:text-foreground`,children:`Session detail merges transcript activity with run milestones and artifacts.`}),(0,K.jsx)(G,{to:`/workspaces`,className:`rounded-2xl border border-border bg-card px-4 py-3 text-left hover:border-primary/30 hover:text-foreground`,children:`Workspace recovery stays the control plane for failed or cleaned execution contexts.`}),(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-card px-4 py-3`,children:(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,K.jsx)($p,{className:`h-4 w-4 text-warning`}),`Retries are surfaced by linked-run history, so repeated attempts stay visible on the board instead of disappearing into raw run lists.`]})})]})]})]})]})]})}function Nv(e){switch(e){case`approved`:return`Approved`;case`changes-requested`:return`Changes Requested`;default:return`Pending Review`}}function Pv(e){switch(e){case`approved`:return`border-success/20 bg-success/10 text-success`;case`changes-requested`:return`border-error/20 bg-error/10 text-error`;default:return`border-primary/20 bg-primary/10 text-primary`}}function Fv(e){switch(e){case`completed`:return`border-success/20 bg-success/10 text-success`;case`in-review`:return`border-warning/20 bg-warning/10 text-warning`;default:return`border-border text-foreground-muted`}}function Iv(e){switch(e){case`connected`:return`border-success/20 bg-success/10 text-success`;case`partial-setup`:case`missing-scopes`:return`border-warning/20 bg-warning/10 text-warning`;case`expired-auth`:case`failing`:return`border-error/20 bg-error/10 text-error`;default:return`border-border text-foreground-muted`}}function Lv(e){return e===`azure-repos`?`Azure Repos`:`GitHub`}function Rv(e){switch(e){case`approved`:case`ready`:case`passing`:case`published`:case`merged`:return`border-success/20 bg-success/10 text-success`;case`pending`:case`in-review`:return`border-warning/20 bg-warning/10 text-warning`;case`changes-requested`:case`blocked`:case`failing`:case`failed`:return`border-error/20 bg-error/10 text-error`;default:return`border-border text-foreground-muted`}}function zv(e){return e===`add`?`bg-success/10`:e===`delete`?`bg-error/10`:`bg-transparent`}function Bv(e,t,n){return typeof n.newLineNumber==`number`?{fileId:e.id,filePath:e.path,hunkId:t,side:`head`,line:n.newLineNumber}:typeof n.oldLineNumber==`number`?{fileId:e.id,filePath:e.path,hunkId:t,side:`base`,line:n.oldLineNumber}:null}function Vv(e){return`${e.fileId}:${e.hunkId}:${e.side}:${e.line}`}function Hv(e){return`review-line-${e.fileId}-${e.hunkId}-${e.side}-${e.line}`}function Uv(e){let t=typeof e.oldLineNumber==`number`?String(e.oldLineNumber):``,n=typeof e.newLineNumber==`number`?String(e.newLineNumber):``;return`${t.padStart(4,` `)} ${n.padStart(4,` `)}`}function Wv(e,t){if(!t)return[];let n=Vv(t);return e.filter(e=>Vv(e.anchor)===n)}function Gv(e,t){return e.comments.filter(e=>e.anchor.fileId===t&&e.status===`open`).length}function Kv(e){let t=new Map;e.targetType===`issue`&&t.set(`issue:${e.targetId}`,{id:`issue:${e.targetId}`,label:`Issue`,href:`/issues/${encodeURIComponent(e.targetId)}`}),e.targetType===`workspace`&&t.set(`workspace:${e.targetId}`,{id:`workspace:${e.targetId}`,label:`Workspace`,href:`/workspaces?workspace=${encodeURIComponent(e.targetId)}`});for(let n of e.executionTargets??[])t.set(`execution:${n.id}`,{id:`execution:${n.id}`,label:n.label,href:n.href});for(let n of e.comments){let e=n.feedbackSource;!e||e.kind!==`agent-feedback`||(e.runId&&t.set(`run:${e.runId}:${e.effectId??``}`,{id:`run:${e.runId}:${e.effectId??``}`,label:e.effectId?`Run task`:`Run`,href:e.effectId?`/dispatches/${e.runId}?effectId=${encodeURIComponent(e.effectId)}`:`/dispatches/${e.runId}`}),e.sessionId&&t.set(`session:${e.sessionId}`,{id:`session:${e.sessionId}`,label:`Session`,href:`/sessions/${e.sessionId}`}))}return Array.from(t.values())}function qv(e){return e.hunks.some(e=>e.lines.some(e=>typeof e.oldLineNumber==`number`||typeof e.newLineNumber==`number`))}function Jv(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 px-3 py-2`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:`mt-1 text-lg font-semibold text-foreground`,children:e.value})]})}function Yv(e){let[t,n]=(0,b.useState)(e.artifact.latestSubmission?.summary??``),[r,i]=(0,b.useState)(e.artifact.latestSubmission?.executionTargetId??``);(0,b.useEffect)(()=>{n(e.artifact.latestSubmission?.summary??``),i(e.artifact.latestSubmission?.executionTargetId??``)},[e.artifact.id,e.artifact.latestSubmission?.executionTargetId,e.artifact.latestSubmission?.summary]);let a=typeof e.onSubmitReview==`function`;async function o(n){if(a){await e.onSubmitReview?.({artifactId:e.artifact.id,decision:n,summary:t.trim()||void 0,executionTargetId:r||void 0});return}if(n===`approved`){await e.onApprove(e.artifact.id);return}await e.onRequestChanges(e.artifact.id)}return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)($f,{className:`h-4 w-4 text-primary`}),`Review submission`]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Submit a decision from the review surface and optionally route the follow-up back into a workspace, session, or run context.`}),(0,K.jsxs)(`label`,{className:`mt-3 block text-xs font-medium text-foreground-muted`,children:[`Review summary`,(0,K.jsx)(`textarea`,{className:`mt-2 min-h-[112px] w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none`,placeholder:`Summarize what changed, what still needs work, or what follow-up the execution owner should take.`,value:t,onChange:e=>n(e.target.value)})]}),(e.artifact.executionTargets?.length??0)>0?(0,K.jsxs)(`label`,{className:`mt-3 block text-xs font-medium text-foreground-muted`,children:[`Route follow-up to`,(0,K.jsxs)(`select`,{className:`mt-2 w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none`,value:r,onChange:e=>i(e.target.value),children:[(0,K.jsx)(`option`,{value:``,children:`No direct handoff target`}),e.artifact.executionTargets?.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsxs)(J,{type:`button`,variant:`ghost`,onClick:()=>void o(`changes-requested`),disabled:e.pending,children:[(0,K.jsx)(Uf,{className:`mr-2 h-4 w-4`}),`Request changes`]}),(0,K.jsxs)(J,{type:`button`,variant:`default`,onClick:()=>void o(`approved`),disabled:e.pending,children:[(0,K.jsx)(Vf,{className:`mr-2 h-4 w-4`}),`Approve review`]})]}),e.artifact.latestSubmission?(0,K.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs`,Pv(e.artifact.latestSubmission.decision)),children:Nv(e.artifact.latestSubmission.decision)}),(0,K.jsxs)(`span`,{className:`ml-2`,children:[`Last submitted `,new Date(e.artifact.latestSubmission.submittedAt).toLocaleString()]}),e.artifact.latestSubmission.executionTargetLabel?(0,K.jsxs)(`p`,{className:`mt-2`,children:[`Follow-up routed to `,e.artifact.latestSubmission.executionTargetLabel,`.`]}):null]}):null]})}function Xv(e){return(0,K.jsx)(`div`,{className:`space-y-4`,children:e.file.hunks.map(t=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80`,children:[(0,K.jsx)(`div`,{className:`border-b border-border px-4 py-2 text-xs font-medium text-foreground-muted`,children:t.header}),(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsx)(`div`,{className:`min-w-[640px] space-y-1 p-3 font-mono text-xs`,children:t.lines.map((n,r)=>{let i=Bv(e.file,t.id,n),a=Wv(e.artifact.comments,i),o=i&&e.draftAnchor&&Vv(i)===Vv(e.draftAnchor),s=i&&e.focusedAnchorKey===Vv(i);return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{id:i?Hv(i):void 0,className:q(`grid grid-cols-[96px_minmax(0,1fr)_auto] items-start gap-3 rounded-lg px-3 py-2`,zv(n.kind),s?`ring-1 ring-primary/40`:void 0),children:[(0,K.jsx)(`div`,{className:`text-[11px] text-foreground-muted`,children:Uv(n)}),(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words text-foreground`,children:n.content}),i?(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-full border border-border px-2 py-1 text-[11px] text-foreground-muted hover:border-primary/30 hover:text-foreground`,onClick:()=>{e.onFocusAnchor(i),e.onChangeDraftBody(``)},children:[(0,K.jsx)(Jf,{className:`h-3 w-3`}),`Comment`]}):(0,K.jsx)(`span`,{})]}),a.length>0?(0,K.jsx)(`div`,{className:`space-y-2 px-4 pb-3`,children:a.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author.name}),(0,K.jsx)(`span`,{children:e.author.kind}),e.feedbackSource?(0,K.jsx)(`span`,{className:`rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-primary`,children:e.feedbackSource.label}):null]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground`,children:e.body})]},e.id))}):null,o&&i?(0,K.jsxs)(`form`,{className:`mx-4 mb-3 rounded-2xl border border-primary/20 bg-primary/5 p-3`,onSubmit:t=>{t.preventDefault();let n=e.draftBody.trim();n&&(e.onAddComment({artifactId:e.artifact.id,body:n,anchor:i,feedbackSource:e.mapFeedback?{kind:`agent-feedback`,label:`Mapped from inline review follow-up`,sessionId:e.artifact.targetType===`workspace`?`workspace-review-follow-up`:`issue-review-follow-up`}:void 0}),e.onChangeDraftBody(``),e.onFocusAnchor(null))},children:[(0,K.jsxs)(`label`,{className:`text-xs font-medium text-foreground-muted`,children:[`Inline review comment`,(0,K.jsx)(`textarea`,{className:`mt-2 min-h-[96px] w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none`,value:e.draftBody,onChange:t=>e.onChangeDraftBody(t.target.value),placeholder:`Explain the requested change or approval note.`})]}),(0,K.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.mapFeedback,onChange:t=>e.onChangeMapFeedback(t.target.checked)}),`Map this comment back to agent feedback metadata`]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsxs)(J,{type:`submit`,variant:`default`,size:`sm`,children:[(0,K.jsx)(bp,{className:`mr-2 h-4 w-4`}),`Save comment`]}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.onFocusAnchor(null),children:`Cancel`})]})]}):null]},`${t.id}-${r}`)})})})]},t.id))})}function Zv(e){return(0,K.jsx)(`div`,{className:`space-y-4`,children:e.file.hunks.map(t=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80`,children:[(0,K.jsx)(`div`,{className:`border-b border-border px-4 py-2 text-xs font-medium text-foreground-muted`,children:t.header}),(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsxs)(`div`,{className:`min-w-[960px] p-3`,children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] gap-3 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`rounded-lg border border-border px-3 py-2`,children:`Base`}),(0,K.jsx)(`div`,{className:`rounded-lg border border-border px-3 py-2`,children:`Head`}),(0,K.jsx)(`div`,{})]}),(0,K.jsx)(`div`,{className:`mt-2 space-y-1 font-mono text-xs`,children:t.lines.map((n,r)=>{let i=Bv(e.file,t.id,n),a=i&&e.focusedAnchorKey===Vv(i),o=Wv(e.artifact.comments,i),s=i&&e.draftAnchor&&Vv(i)===Vv(e.draftAnchor);return(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{id:i?Hv(i):void 0,className:q(`grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-start gap-3 rounded-lg px-2 py-2`,zv(n.kind),a?`ring-1 ring-primary/40`:void 0),children:[(0,K.jsxs)(`div`,{className:`rounded-lg border border-border/60 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`text-[11px] text-foreground-muted`,children:typeof n.oldLineNumber==`number`?n.oldLineNumber:``}),(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words text-foreground`,children:n.kind===`add`?``:n.content})]}),(0,K.jsxs)(`div`,{className:`rounded-lg border border-border/60 px-3 py-2`,children:[(0,K.jsx)(`div`,{className:`text-[11px] text-foreground-muted`,children:typeof n.newLineNumber==`number`?n.newLineNumber:``}),(0,K.jsx)(`pre`,{className:`whitespace-pre-wrap break-words text-foreground`,children:n.kind===`delete`?``:n.content})]}),i?(0,K.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1 rounded-full border border-border px-2 py-1 text-[11px] text-foreground-muted hover:border-primary/30 hover:text-foreground`,onClick:()=>e.onFocusAnchor(i),children:[(0,K.jsx)(Jf,{className:`h-3 w-3`}),`Comment`]}):(0,K.jsx)(`span`,{})]}),o.length>0?(0,K.jsx)(`div`,{className:`space-y-2 px-4 pb-3`,children:o.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author.name}),(0,K.jsxs)(`span`,{children:[e.anchor.side,`:`,e.anchor.line]})]}),(0,K.jsx)(`p`,{className:`mt-2 text-foreground`,children:e.body})]},e.id))}):null,s&&i?(0,K.jsxs)(`form`,{className:`mx-4 mb-3 rounded-2xl border border-primary/20 bg-primary/5 p-3`,onSubmit:t=>{t.preventDefault();let n=e.draftBody.trim();n&&(e.onAddComment({artifactId:e.artifact.id,body:n,anchor:i,feedbackSource:e.mapFeedback?{kind:`agent-feedback`,label:`Mapped from inline review follow-up`,sessionId:e.artifact.targetType===`workspace`?`workspace-review-follow-up`:`issue-review-follow-up`}:void 0}),e.onChangeDraftBody(``),e.onFocusAnchor(null))},children:[(0,K.jsxs)(`label`,{className:`text-xs font-medium text-foreground-muted`,children:[`Inline review comment`,(0,K.jsx)(`textarea`,{className:`mt-2 min-h-[96px] w-full rounded-2xl border border-border bg-background px-3 py-2 text-sm text-foreground outline-none`,value:e.draftBody,onChange:t=>e.onChangeDraftBody(t.target.value),placeholder:`Explain the requested change or approval note.`})]}),(0,K.jsxs)(`label`,{className:`mt-3 flex items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.mapFeedback,onChange:t=>e.onChangeMapFeedback(t.target.checked)}),`Map this comment back to agent feedback metadata`]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsxs)(J,{type:`submit`,variant:`default`,size:`sm`,children:[(0,K.jsx)(bp,{className:`mr-2 h-4 w-4`}),`Save comment`]}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>e.onFocusAnchor(null),children:`Cancel`})]})]}):null]},`${t.id}-${r}`)})})]})})]},t.id))})}function Qv(e){let[t,n]=(0,b.useState)(e.artifacts[0]?.id??null),[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(!0),[d,f]=(0,b.useState)(null),[p,m]=(0,b.useState)(`unified`);(0,b.useEffect)(()=>{if(e.artifacts.length===0){n(null);return}(!t||!e.artifacts.some(e=>e.id===t))&&n(e.artifacts[0]?.id??null)},[e.artifacts,t]);let h=(0,b.useMemo)(()=>e.artifacts.find(e=>e.id===t)??null,[e.artifacts,t]),g=(0,b.useMemo)(()=>h?Kv(h):[],[h]);(0,b.useEffect)(()=>{if(!h){i(null);return}(!r||!h.diff.some(e=>e.id===r))&&i(h.diff[0]?.id??null),m(h.preferredPresentation??`unified`)},[h,r]);let _=(0,b.useMemo)(()=>h?.diff.find(e=>e.id===r)??h?.diff[0]??null,[h,r]),v=_?qv(_):!1,y=(0,b.useMemo)(()=>h?h.comments.filter(e=>e.status===`open`):[],[h]),x=(0,b.useMemo)(()=>_&&h?h.comments.filter(e=>e.anchor.fileId===_.id):[],[h,_]);return e.loading&&e.artifacts.length===0?(0,K.jsx)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`review-panel-loading`,children:(0,K.jsxs)(`div`,{className:`animate-pulse space-y-3`,children:[(0,K.jsx)(`div`,{className:`h-4 w-40 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-8 w-72 rounded bg-background-secondary`}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,K.jsx)(`div`,{className:`h-64 rounded-2xl bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-64 rounded-2xl bg-background-secondary`})]})]})}):e.error?(0,K.jsx)(`section`,{className:`rounded-3xl border border-error/30 bg-error/10 p-6 text-sm text-error shadow-lg`,children:e.error}):e.artifacts.length===0||!h?(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Review Queue`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:e.empty})]}):(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`review-panel`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`max-w-4xl`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Review Queue`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:e.description})]}),e.summary?(0,K.jsxs)(`div`,{className:`grid min-w-[280px] gap-2 sm:grid-cols-2`,children:[(0,K.jsx)(Jv,{label:`Queued`,value:String(e.summary.pendingCount+e.summary.changesRequestedCount)}),(0,K.jsx)(Jv,{label:`Approved`,value:String(e.summary.approvedCount)}),(0,K.jsx)(Jv,{label:`Open comments`,value:String(e.summary.openCommentCount)}),(0,K.jsx)(Jv,{label:`Artifacts`,value:String(e.summary.total)})]}):null]}),(0,K.jsxs)(`div`,{className:`mt-6 grid gap-6 xl:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,K.jsx)(`aside`,{className:`space-y-3`,children:e.queue.map(e=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>{n(e.artifactId),o(null),c(``),f(null)},className:q(`w-full rounded-2xl border p-4 text-left transition-colors`,t===e.artifactId?`border-primary/30 bg-primary/5`:`border-border bg-background/70 hover:border-primary/20 hover:bg-background`),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.targetType}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs`,Pv(e.decision)),children:Nv(e.decision)})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm font-semibold text-foreground`,children:e.targetLabel}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.title}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5`,Fv(e.queueState)),children:e.queueState}),(0,K.jsxs)(`span`,{children:[e.openCommentCount,` open comments`]})]})]},e.artifactId))}),(0,K.jsxs)(`div`,{className:`space-y-5`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-5`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:h.targetLabel}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs`,Pv(h.decision)),children:Nv(h.decision)}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs`,Fv(h.queueState)),children:h.queueState})]}),(0,K.jsx)(`h3`,{className:`mt-3 text-xl font-semibold tracking-tight`,children:h.title}),h.summary?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:h.summary}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[h.branch?(0,K.jsxs)(`span`,{children:[`Branch: `,h.branch]}):null,(0,K.jsxs)(`span`,{children:[h.diff.length,` files changed`]}),(0,K.jsxs)(`span`,{children:[h.comments.length,` comments`]})]}),g.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:g.map(e=>(0,K.jsxs)(G,{to:e.href,className:`inline-flex items-center gap-1 rounded-full border border-border px-2.5 py-1 text-foreground-muted hover:border-primary/30 hover:text-primary`,children:[e.label,(0,K.jsx)(Jf,{className:`h-3 w-3`})]},e.id))}):null]})}),h.linkedPullRequest||h.integration?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[h.linkedPullRequest?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[Lv(h.linkedPullRequest.provider),` PR`,` `,h.linkedPullRequest.number?`#${h.linkedPullRequest.number}`:``]}):null,h.linkedPullRequest?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:h.linkedPullRequest.linkState===`partially-linked`?`partially linked`:h.linkedPullRequest.linkState}):null,h.integration?(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs`,Iv(h.integration.status)),children:h.integration.status.replace(/-/g,` `)}):null]}),h.linkedPullRequest?.title?(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground`,children:h.linkedPullRequest.title}):null,h.linkedPullRequest?(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[h.linkedPullRequest.reviewStatus?(0,K.jsxs)(`span`,{className:q(`rounded-full border px-2 py-0.5`,Rv(h.linkedPullRequest.reviewStatus)),children:[`Review `,h.linkedPullRequest.reviewStatus]}):null,h.linkedPullRequest.mergeStatus?(0,K.jsxs)(`span`,{className:q(`rounded-full border px-2 py-0.5`,Rv(h.linkedPullRequest.mergeStatus)),children:[`Merge `,h.linkedPullRequest.mergeStatus]}):null,h.linkedPullRequest.publishStatus?(0,K.jsxs)(`span`,{className:q(`rounded-full border px-2 py-0.5`,Rv(h.linkedPullRequest.publishStatus)),children:[`Publish `,h.linkedPullRequest.publishStatus]}):null]}):null,(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:h.integration?.guidance??h.linkedPullRequest?.guidance??`No linked PR guidance available.`}),h.linkedPullRequest?.ciGates?.length?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:h.linkedPullRequest.ciGates.map(e=>(0,K.jsxs)(`span`,{className:q(`rounded-full border px-2 py-0.5`,Rv(e.status)),children:[e.name,`: `,e.status]},`${h.id}-${e.id}`))}):null,h.integration?.actions.reason?(0,K.jsx)(`div`,{className:`mt-3 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-sm text-warning`,children:h.integration.actions.reason}):null]}):null]}),(0,K.jsx)(Yv,{artifact:h,pending:e.pendingArtifactId===h.id,onApprove:e.onApprove,onRequestChanges:e.onRequestChanges,onSubmitReview:e.onSubmitReview}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[280px_minmax(0,1fr)]`,children:[(0,K.jsxs)(`aside`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)($f,{className:`h-4 w-4 text-primary`}),`File navigator`]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:p===`unified`?`default`:`ghost`,size:`sm`,onClick:()=>m(`unified`),children:`Unified`}),(0,K.jsx)(J,{type:`button`,variant:p===`split`?`default`:`ghost`,size:`sm`,onClick:()=>m(`split`),disabled:!v,children:`Side by side`})]}),(0,K.jsx)(`div`,{className:`mt-4 space-y-2`,children:h.diff.map(e=>{let t=Gv(h,e.id);return(0,K.jsxs)(`button`,{type:`button`,"data-testid":`review-file-${e.id}`,onClick:()=>{i(e.id),f(null),o(null)},className:q(`w-full rounded-2xl border p-3 text-left transition-colors`,_?.id===e.id?`border-primary/30 bg-primary/5`:`border-border bg-card hover:border-primary/20 hover:bg-background`),children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.path}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-success/20 bg-success/10 px-2 py-0.5 text-success`,children:[`+`,e.additions]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-error/20 bg-error/10 px-2 py-0.5 text-error`,children:[`-`,e.deletions]}),(0,K.jsxs)(`span`,{children:[t,` open comments`]})]})]},e.id)})})]}),(0,K.jsxs)(`div`,{className:`space-y-4`,children:[_?(0,K.jsxs)(`article`,{className:`overflow-hidden rounded-2xl border border-border bg-background/80`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-border px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)($f,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:_.path})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-success/20 bg-success/10 px-2 py-0.5 text-success`,children:[`+`,_.additions]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-error/20 bg-error/10 px-2 py-0.5 text-error`,children:[`-`,_.deletions]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:p===`split`?`Side by side`:`Unified`})]})]}),(0,K.jsxs)(`div`,{className:`border-b border-border px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(xp,{className:`h-4 w-4 text-primary`}),(0,K.jsxs)(`span`,{children:[x.length,` comments on this file`]})]}),x.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:x.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted hover:border-primary/30 hover:text-primary`,onClick:()=>{f(Vv(e.anchor)),i(e.anchor.fileId),o(e.anchor)},children:[e.anchor.side,`:`,e.anchor.line,` · `,e.author.name]},e.id))}):null]}),(0,K.jsx)(`div`,{className:`p-4`,children:p===`split`&&v?(0,K.jsx)(Zv,{artifact:h,file:_,draftAnchor:a,draftBody:s,mapFeedback:l,focusedAnchorKey:d,onChangeDraftBody:c,onChangeMapFeedback:u,onFocusAnchor:e=>{o(e),f(e?Vv(e):null)},onAddComment:e.onAddComment}):(0,K.jsx)(Xv,{artifact:h,file:_,draftAnchor:a,draftBody:s,mapFeedback:l,focusedAnchorKey:d,onChangeDraftBody:c,onChangeMapFeedback:u,onFocusAnchor:e=>{o(e),f(e?Vv(e):null)},onAddComment:e.onAddComment})})]}):null,(h.executionTargets?.length??0)>0?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)($f,{className:`h-4 w-4 text-primary`}),`Feedback loop handoff`]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:h.executionTargets?.map(e=>(0,K.jsxs)(G,{to:e.href,className:`rounded-2xl border border-border bg-card px-4 py-3 transition-colors hover:border-primary/30 hover:bg-background`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:e.actionLabel??e.label}),(0,K.jsx)(`div`,{className:`mt-1 text-xs uppercase tracking-[0.18em] text-foreground-muted`,children:e.kind}),e.description?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:e.description}):null]},e.id))})]}):null]})]}),y.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-4 text-sm text-foreground-muted`,children:`No review comments yet.`}):(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,K.jsx)(xp,{className:`h-4 w-4 text-primary`}),`Review activity`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2 text-sm text-foreground-muted`,children:h.comments.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author.name}),(0,K.jsx)(`span`,{children:e.anchor.filePath}),(0,K.jsxs)(`span`,{children:[e.anchor.side,`:`,e.anchor.line]})]}),(0,K.jsx)(`p`,{className:`mt-1 text-foreground`,children:e.body})]},`${h.id}-${e.id}`))})]})]})]})]})}var $v=[`todo`,`in-progress`,`review`,`done`];function ey(e){return e.blocked?`border-error/30 bg-error-muted/70 text-error`:e.workflowState===`done`?`border-success/25 bg-success-muted text-success`:e.workflowState===`review`?`border-primary/25 bg-primary/10 text-primary`:e.workflowState===`in-progress`?`border-warning/25 bg-warning-muted text-warning`:`border-border bg-background text-foreground-secondary`}function ty(e,t){if(t)return`border-error/30 bg-error-muted/60`;switch(e){case`todo`:return`border-border bg-background/80`;case`in-progress`:return`border-warning/25 bg-warning-muted/50`;case`review`:return`border-primary/20 bg-primary/5`;case`done`:return`border-success/20 bg-success-muted/60`}}function ny(e){switch(e){case`todo`:return`Todo`;case`in-progress`:return`In Progress`;case`review`:return`Review`;case`done`:return`Done`}}function ry(e,t,n){return e.cards.filter(e=>e.swimlaneId===t&&e.workflowState===n)}function iy(e){switch(e){case`approved`:case`ready`:case`passing`:case`published`:case`merged`:return`border-success/25 bg-success-muted text-success`;case`pending`:case`in-review`:return`border-warning/25 bg-warning-muted text-warning`;case`changes-requested`:case`blocked`:case`failing`:case`failed`:return`border-error/25 bg-error-muted text-error`;default:return`border-border bg-background text-foreground-muted`}}function ay(e){return e===`azure-repos`?`Azure Repos`:e}function oy(e){switch(e){case`connected`:return`border-success/25 bg-success-muted text-success`;case`partial-setup`:case`missing-scopes`:return`border-warning/25 bg-warning-muted text-warning`;case`expired-auth`:case`failing`:return`border-error/25 bg-error-muted text-error`;default:return`border-border bg-background text-foreground-muted`}}function sy(e){return e.replace(/-/g,` `)}function cy(e){return e===`partially-linked`?`partially linked`:e}function ly(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function uy(e){return iy(e.status)}function dy(e){return e.charAt(0).toUpperCase()+e.slice(1)}function fy(e){return e?new Date(e).toLocaleString(`en-US`,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}):`No activity yet`}function py(e){return`/workspaces?workspace=${encodeURIComponent(e)}`}function my(e,t){return`/projects/${encodeURIComponent(e)}/issues/${encodeURIComponent(t)}`}function hy(e){return`/projects/${encodeURIComponent(e)}/issues/new`}function gy(e){return`/projects/${encodeURIComponent(e)}/workspaces/new`}function _y(e,t){return`/projects/${encodeURIComponent(e)}/issues/${encodeURIComponent(t)}/workspace/new`}function vy(e){switch(e){case`active`:return`border-success/25 bg-success-muted text-success`;case`archived`:return`border-warning/25 bg-warning-muted text-warning`;case`missing`:return`border-error/25 bg-error-muted text-error`;default:return`border-border bg-background text-foreground-muted`}}function yy(e){let t=e.source===`created-from-issue`?`created here`:`linked workspace`;return e.branchName?`${t} · ${e.branchName}`:t}async function by(){let e=await fetch(`/api/workspaces`,{cache:`no-store`});if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error??`Workspace inventory request failed: ${e.status}`)}return await e.json()}function xy(e=`todo`){return{title:``,summary:``,description:``,workflowState:e,status:Sy(e),priority:e===`in-progress`||e===`review`?`high`:`medium`,assigneeIds:[],labelIds:[],dependencies:[],acceptanceCriteria:[]}}function Sy(e){switch(e){case`in-progress`:return`in-progress`;case`review`:return`review`;case`done`:return`done`;default:return`backlog`}}function Cy(e){return e.trim().toLowerCase()}function wy(e,t){return[e.issueKey,e.title,e.summary??``,e.priority,e.readiness,...e.labelNames,...e.assigneeNames,...e.collaboratorNames,...(t?.dispatch.contextLabelProjections??[]).flatMap(e=>[e.key,e.label,e.instruction])].join(` `).toLowerCase()}function Ty(e){switch(e){case`critical`:return 0;case`high`:return 1;case`medium`:return 2;default:return 3}}function Ey(e){switch(e){case`saving`:return`Autosaving draft…`;case`saved`:return`Draft autosaved locally.`;case`partial`:return`Issue save failed. Draft preserved locally for retry.`;default:return`Draft is empty.`}}function Dy(e){return{title:e.title,summary:e.summary??``,description:e.description??``,status:e.status,priority:e.priority,assigneeIds:e.assignees.map(e=>e.id),labelIds:e.labels.map(e=>e.id),dependencies:e.dependencies.map(e=>({issueId:e.issueId,type:e.type})),acceptanceCriteria:e.acceptanceCriteria.map(e=>({id:e.id,title:e.title,satisfied:e.satisfied,notes:e.notes??``})),baseUpdatedAt:e.updatedAt}}function Oy(){return{metadata:{status:`idle`,message:null},description:{status:`idle`,message:null},priority:{status:`idle`,message:null},assignees:{status:`idle`,message:null},labels:{status:`idle`,message:null}}}function ky(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Ay(e,t){return e.length===t.length&&e.every((e,n)=>e.issueId===t[n]?.issueId&&e.type===t[n]?.type)}function jy(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id&&e.title===t[n]?.title&&e.satisfied===t[n]?.satisfied&&e.notes===t[n]?.notes)}function My(e,t,n){switch(e){case`metadata`:return t.title!==n.title||t.summary!==(n.summary??``)||t.status!==n.status||!Ay(t.dependencies,n.dependencies.map(e=>({issueId:e.issueId,type:e.type})))||!jy(t.acceptanceCriteria,n.acceptanceCriteria.map(e=>({id:e.id,title:e.title,satisfied:e.satisfied,notes:e.notes??``})));case`description`:return t.description!==(n.description??``);case`priority`:return t.priority!==n.priority;case`assignees`:return!ky(t.assigneeIds,n.assignees.map(e=>e.id));case`labels`:return!ky(t.labelIds,n.labels.map(e=>e.id))}}function Ny(e,t){return My(`metadata`,e,t)||My(`description`,e,t)||My(`priority`,e,t)||My(`assignees`,e,t)||My(`labels`,e,t)}function Py(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function Fy({draft:e,project:t,issues:n,taskTags:r,autosaveStatus:i,creatingIssue:a,error:o,validationError:s,onChange:c,onClose:l,onSubmit:u}){let d=n.filter(e=>e.projectId===t.id),[f,p]=(0,b.useState)(d[0]?.id??``),[m,h]=(0,b.useState)(`blocked-by`);return(0,b.useEffect)(()=>{p(e=>e&&d.some(t=>t.id===e)?e:d[0]?.id??``)},[d]),(0,K.jsxs)(`aside`,{className:`rounded-3xl border border-primary/20 bg-background p-5 shadow-lg`,"data-testid":`create-issue-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Create mode`}),(0,K.jsx)(`h3`,{className:`mt-1 text-xl font-semibold text-foreground`,children:`Create issue beside the board`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`New issues open from board-level entry points and stay anchored to the planning surface while draft, validation, save, autosave, and failure state remain explicit.`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:l,className:`inline-flex h-10 items-center justify-center rounded-xl border border-border px-3 text-sm text-foreground-muted`,children:`Close`})]}),(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card px-4 py-3 text-sm text-foreground-muted`,children:Ey(i)}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Target column `,ny(e.workflowState)]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Status `,Ly(e.status)]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Priority `,e.priority]})]}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-4`,onSubmit:e=>{e.preventDefault(),u()},children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Title`,(0,K.jsx)(`input`,{"aria-label":`Issue title`,value:e.title,onChange:e=>c(t=>({...t,title:e.target.value})),placeholder:`Summarize the work item`,className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Summary`,(0,K.jsx)(Tm,{taskTags:r,value:e.summary,onValueChange:e=>c(t=>({...t,summary:e})),className:`mt-2`,renderTextarea:e=>(0,K.jsx)(`textarea`,{...e,"aria-label":`Issue summary`,placeholder:`Capture the outcome expected from this issue.`,className:`min-h-24 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Description`,(0,K.jsx)(`textarea`,{"aria-label":`Issue description`,value:e.description,onChange:e=>c(t=>({...t,description:e.target.value})),placeholder:`Describe the implementation, rollout, and acceptance notes.`,className:`mt-2 min-h-28 w-full rounded-xl border border-border bg-card px-3 py-2 text-sm text-foreground`})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Target column`,(0,K.jsx)(`select`,{"aria-label":`Target column`,value:e.workflowState,onChange:e=>c(t=>({...t,workflowState:e.target.value,status:Sy(e.target.value)})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:$v.map(e=>(0,K.jsx)(`option`,{value:e,children:ny(e)},e))})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Status`,(0,K.jsxs)(`select`,{"aria-label":`Issue status`,value:e.status,onChange:e=>c(t=>({...t,status:e.target.value})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`backlog`,children:`Backlog`}),(0,K.jsx)(`option`,{value:`ready`,children:`Ready`}),(0,K.jsx)(`option`,{value:`in-progress`,children:`In Progress`}),(0,K.jsx)(`option`,{value:`blocked`,children:`Blocked`}),(0,K.jsx)(`option`,{value:`review`,children:`Review`}),(0,K.jsx)(`option`,{value:`done`,children:`Done`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Priority`,(0,K.jsxs)(`select`,{"aria-label":`Priority`,value:e.priority,onChange:e=>c(t=>({...t,priority:e.target.value})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,K.jsx)(`option`,{value:`high`,children:`High`}),(0,K.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,K.jsx)(`option`,{value:`low`,children:`Low`})]})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Assignees`}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:t.team.members.length>0?t.team.members.map(t=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.assigneeIds.includes(t.id),onChange:()=>c(e=>({...e,assigneeIds:Py(e.assigneeIds,t.id)}))}),(0,K.jsx)(`span`,{children:t.displayName})]},`create-issue-assignee-${t.id}`)):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No assignees are configured for this project yet.`})})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Tags`}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:t.labels.length>0?t.labels.map(t=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.labelIds.includes(t.id),onChange:()=>c(e=>({...e,labelIds:Py(e.labelIds,t.id)}))}),(0,K.jsx)(`span`,{children:t.name})]},`create-issue-label-${t.id}`)):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No project tags are available yet.`})})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Dependencies`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Link existing issues while authoring instead of patching them later.`})]})}),d.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-[minmax(0,1fr)_160px_auto]`,children:[(0,K.jsx)(`select`,{"aria-label":`Dependency issue`,value:f,onChange:e=>p(e.target.value),className:`h-10 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:d.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.key,`: `,e.title]},`create-dependency-${e.id}`))}),(0,K.jsxs)(`select`,{"aria-label":`Dependency type`,value:m,onChange:e=>h(e.target.value),className:`h-10 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`blocked-by`,children:`Blocked by`}),(0,K.jsx)(`option`,{value:`blocks`,children:`Blocks`}),(0,K.jsx)(`option`,{value:`related`,children:`Related`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{f&&c(e=>{let t={issueId:f,type:m};return e.dependencies.some(e=>e.issueId===t.issueId&&e.type===t.type)?e:{...e,dependencies:[...e.dependencies,t]}})},className:`inline-flex h-10 items-center justify-center rounded-xl border border-border px-3 text-sm font-semibold text-foreground`,children:`Add`})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.dependencies.length>0?e.dependencies.map((e,t)=>{let n=d.find(t=>t.id===e.issueId);return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:n?.key??e.issueId}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:n?.title??`Linked dependency`}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,K.jsxs)(`select`,{value:e.type,onChange:e=>c(n=>({...n,dependencies:n.dependencies.map((n,r)=>r===t?{...n,type:e.target.value}:n)})),className:`h-9 rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`blocked-by`,children:`Blocked by`}),(0,K.jsx)(`option`,{value:`blocks`,children:`Blocks`}),(0,K.jsx)(`option`,{value:`related`,children:`Related`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(e=>({...e,dependencies:e.dependencies.filter((e,n)=>n!==t)})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Remove`})]})]},`create-dependency-draft-${e.issueId}-${t}`)}):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No dependencies configured.`})})]}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No same-project issues are available to link as dependencies yet.`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Acceptance criteria`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Author criteria up front so issue readiness is explicit from creation time.`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(e=>({...e,acceptanceCriteria:[...e.acceptanceCriteria,{title:``,satisfied:!1,notes:``}]})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Add criterion`})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.acceptanceCriteria.length>0?e.acceptanceCriteria.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3`,children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.satisfied,onChange:e=>c(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,satisfied:e.target.checked}:n)}))}),`Satisfied`]}),(0,K.jsx)(`input`,{"aria-label":`Acceptance criterion ${t+1} title`,value:e.title,onChange:e=>c(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,title:e.target.value}:n)})),placeholder:`Describe the acceptance condition`,className:`mt-3 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(`input`,{"aria-label":`Acceptance criterion ${t+1} notes`,value:e.notes,onChange:e=>c(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,notes:e.target.value}:n)})),placeholder:`Optional note`,className:`mt-2 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>c(e=>({...e,acceptanceCriteria:e.acceptanceCriteria.filter((e,n)=>n!==t)})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Remove`})})]},`create-criterion-draft-${e.id??t}`)):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No acceptance criteria authored yet.`})})]})]}),s?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:s}):null,o?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:o}):null,(0,K.jsxs)(`button`,{type:`submit`,disabled:a,className:`inline-flex h-11 items-center justify-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:[(0,K.jsx)(Ap,{className:`h-4 w-4`}),a?`Creating issue…`:`Create issue`]})]})]})}function Iy(e,t,n,r,i,a,o,s,c){return(0,K.jsxs)(`article`,{id:`kanban-issue-${e.issueId}`,className:`rounded-2xl border p-4 ${ey(e)} ${n?`ring-2 ring-primary/50 ring-offset-2 ring-offset-background`:``}`,"data-testid":`kanban-list-card-${e.issueKey}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`label`,{className:`inline-flex items-center gap-2 text-xs text-foreground-muted`,children:(0,K.jsx)(`input`,{type:`checkbox`,checked:i,onChange:()=>a(e.issueId),className:`h-4 w-4 rounded border border-border`,"aria-label":`Select ${e.issueKey}`})}),(0,K.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.18em]`,children:e.issueKey}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:ny(e.workflowState)}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:e.priority}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:e.readiness})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>t&&r(t),className:`mt-2 text-left text-base font-semibold underline-offset-4 hover:underline`,"data-testid":`open-list-issue-${e.issueKey}`,children:e.title}),e.summary?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 opacity-90`,children:e.summary}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3 text-xs opacity-80`,children:[(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(sp,{className:`h-3.5 w-3.5`}),e.dependencyCount,` dependencies`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(am,{className:`h-3.5 w-3.5`}),e.childCount,` child issues`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Vf,{className:`h-3.5 w-3.5`}),e.acceptanceProgress.satisfied,`/`,e.acceptanceProgress.total,` accepted`]})]}),(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:e.moveTargets.map(t=>(0,K.jsxs)(`button`,{disabled:!t.allowed||s===e.issueId,onClick:()=>o(e.issueId,t.state),className:`inline-flex h-11 items-center justify-center gap-2 rounded-md border border-border-hover bg-transparent px-3 text-xs font-medium italic tracking-[0.04em] text-foreground transition-all duration-200 hover:bg-card hover:border-primary/30 hover:shadow-sm disabled:pointer-events-none disabled:opacity-50 font-serif`,"data-testid":`move-list-${e.issueKey}-${t.state}`,children:[(0,K.jsx)(Af,{className:`h-3.5 w-3.5`}),ny(t.state)]},`${e.issueId}-${t.state}`))}),c&&e.moveTargets.some(e=>e.signals.length>0)?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.moveTargets.flatMap(t=>t.signals.map((n,r)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-xs text-foreground-muted`,children:[ny(t.state),`: `,n.message]},`${e.issueId}-${t.state}-${n.hookId}-${r}`)))}):null]},`list-${e.issueId}`)}function Ly(e){return e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function Ry(e){switch(e){case`done`:return`border-success/25 bg-success-muted text-success`;case`review`:return`border-primary/25 bg-primary/10 text-primary`;case`in-progress`:return`border-warning/25 bg-warning-muted text-warning`;case`blocked`:return`border-error/25 bg-error-muted text-error`;default:return`border-border bg-background text-foreground-muted`}}function zy(e,t){let n=new Set,r=[...e.childIssueIds];for(;r.length>0;){let e=r.shift();if(!e||n.has(e))continue;n.add(e);let i=t.get(e);i&&r.push(...i.childIssueIds)}return n}function By({project:e,mutating:t,onSave:n}){let[r,i]=(0,b.useState)(e.team.name),[a,o]=(0,b.useState)(e.team.settings.visibility),[s,c]=(0,b.useState)(e.team.settings.defaultRole),[l,u]=(0,b.useState)(e.team.settings.allowSelfAssign),[d,f]=(0,b.useState)(e.settings.reviewRequiredForDone),[p,m]=(0,b.useState)(e.settings.activityScope),[h,g]=(0,b.useState)(e.settings.workspaceProvisioning),[_,v]=(0,b.useState)(e.team.members.map(e=>({id:e.id,displayName:e.displayName,email:e.email??``,role:e.role})));return(0,K.jsxs)(`div`,{className:`mt-5 rounded-3xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Team and permissions`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Shared collaboration state now lives beside the board model`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Team roster, project policy, activity visibility, and role-based permissions now exist as shared kanban primitives instead of implicit gateway-token access.`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[e.team.members.length,` collaborators`]})]}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 xl:grid-cols-2`,onSubmit:t=>{t.preventDefault(),n({projectId:e.id,teamName:r,visibility:a,defaultRole:s,allowSelfAssign:l,reviewRequiredForDone:d,activityScope:p,workspaceProvisioning:h,members:_.map(e=>({...e,email:e.email||void 0})),permissions:[...e.permissions]})},children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Team name`,(0,K.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Visibility`,(0,K.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`private`,children:`Private`}),(0,K.jsx)(`option`,{value:`team`,children:`Team`}),(0,K.jsx)(`option`,{value:`workspace-shared`,children:`Workspace shared`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Default role`,(0,K.jsxs)(`select`,{value:s,onChange:e=>c(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`owner`,children:`Owner`}),(0,K.jsx)(`option`,{value:`maintainer`,children:`Maintainer`}),(0,K.jsx)(`option`,{value:`contributor`,children:`Contributor`}),(0,K.jsx)(`option`,{value:`viewer`,children:`Viewer`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Workspace provisioning`,(0,K.jsxs)(`select`,{value:h,onChange:e=>g(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`owners-maintainers`,children:`Owners and maintainers`}),(0,K.jsx)(`option`,{value:`contributors-and-up`,children:`Contributors and up`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Activity scope`,(0,K.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`project-and-issues`,children:`Project and issues`}),(0,K.jsx)(`option`,{value:`all-board-entities`,children:`All board entities`})]})]}),(0,K.jsxs)(`label`,{className:`col-span-full flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>u(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Allow contributors to self-assign issues`]}),(0,K.jsxs)(`label`,{className:`col-span-full flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Require review completion before cards can reach done`]}),(0,K.jsxs)(`div`,{className:`col-span-full rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(tm,{className:`h-4 w-4`}),`Team roster`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>v(e=>[...e,{id:`member-${e.length+1}`,displayName:``,email:``,role:s}]),className:`inline-flex items-center gap-2 rounded-xl border border-border px-3 py-2 text-xs font-semibold text-foreground`,children:[(0,K.jsx)(em,{className:`h-3.5 w-3.5`}),`Add member`]})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:_.map((e,t)=>(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[1fr_1fr_180px_auto]`,children:[(0,K.jsx)(`input`,{value:e.displayName,onChange:e=>v(n=>n.map((n,r)=>r===t?{...n,displayName:e.target.value}:n)),placeholder:`Display name`,className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`}),(0,K.jsx)(`input`,{value:e.email,onChange:e=>v(n=>n.map((n,r)=>r===t?{...n,email:e.target.value}:n)),placeholder:`email@example.com`,className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`}),(0,K.jsxs)(`select`,{value:e.role,onChange:e=>v(n=>n.map((n,r)=>r===t?{...n,role:e.target.value}:n)),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`owner`,children:`Owner`}),(0,K.jsx)(`option`,{value:`maintainer`,children:`Maintainer`}),(0,K.jsx)(`option`,{value:`contributor`,children:`Contributor`}),(0,K.jsx)(`option`,{value:`viewer`,children:`Viewer`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(e=>e.filter((e,n)=>n!==t)),className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-3 text-sm text-foreground-muted`,children:(0,K.jsx)(Qp,{className:`h-4 w-4`})})]},`${e.id}-${t}`))})]}),(0,K.jsxs)(`div`,{className:`col-span-full rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Hp,{className:`h-4 w-4`}),`Permission matrix`]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-3 xl:grid-cols-2`,children:e.permissions.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e.action}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.description}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.roles.map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:dy(t)},`${e.action}-${t}`))})]},e.action))})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:t,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Save collaboration settings`})]}),(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Ef,{className:`h-4 w-4`}),`Project activity`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:e.activity.slice(0,4).map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.actor.displayName}),(0,K.jsx)(`span`,{children:fy(e.createdAt)})]}),(0,K.jsx)(`div`,{className:`mt-1 text-sm font-semibold text-foreground`,children:e.summary})]},e.id))})]})]})}function Vy({card:e,project:t,activityEntries:n,mutating:r,onSave:i}){let[a,o]=(0,b.useState)(t.team.members.filter(t=>e.assigneeNames.includes(t.displayName)).map(e=>e.id)),[s,c]=(0,b.useState)(t.team.members.filter(t=>e.collaboratorNames.includes(t.displayName)).map(e=>e.id));return(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border/80 bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(tm,{className:`h-4 w-4`}),`Collaboration`]}),(0,K.jsxs)(`div`,{className:`mt-2 text-sm text-foreground-muted`,children:[e.assigneeNames.length,` assignees, `,e.collaboratorNames.length,` collaborators,`,` `,e.activityCount,` activity entries`]}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-4 lg:grid-cols-2`,onSubmit:t=>{t.preventDefault(),i({issueId:e.issueId,assigneeIds:a,collaboratorIds:s})},children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Assignees`}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:t.team.members.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:a.includes(e.id),onChange:t=>o(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id)),className:`h-4 w-4 rounded border border-border`}),(0,K.jsx)(`span`,{className:`text-foreground`,children:e.displayName}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:dy(e.role)})]},`assignee-${e.id}`))})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Collaborators`}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:t.team.members.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:s.includes(e.id),onChange:t=>c(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id)),className:`h-4 w-4 rounded border border-border`}),(0,K.jsx)(`span`,{className:`text-foreground`,children:e.displayName}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:dy(e.role)})]},`collaborator-${e.id}`))})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:r,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Save collaboration`})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[e.assigneeNames.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[`Assignee `,e]},`assignee-chip-${e}`)),e.collaboratorNames.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[`Collaborator `,e]},`collaborator-chip-${e}`))]}),(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card p-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Ef,{className:`h-4 w-4`}),`Issue activity`]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:n.slice(0,3).map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.actor.displayName}),(0,K.jsx)(`span`,{children:fy(e.createdAt)})]}),(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground`,children:e.summary})]},e.id))})]})]})}function Hy({issue:e,dispatchContextLabels:t,mutating:n,onSave:r}){let[i,a]=(0,b.useState)(e.dispatch.contextLabels.map(e=>e.labelId));return(0,b.useEffect)(()=>{a(e.dispatch.contextLabels.map(e=>e.labelId))},[e.id,e.dispatch.contextLabels]),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,"data-testid":`issue-dispatch-context-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Dispatch Context Labels`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Attach reusable dispatch instructions here. These are not board labels, Task Tags, or default agent settings.`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[i.length,` attached`]})]}),t.length>0?(0,K.jsxs)(`form`,{className:`mt-4`,onSubmit:t=>{t.preventDefault(),r({issueId:e.id,dispatchContextLabelIds:i})},children:[(0,K.jsx)(`div`,{className:`space-y-2`,children:t.map(e=>(0,K.jsxs)(`label`,{className:`flex items-start gap-3 rounded-2xl border border-border bg-card px-3 py-3 text-sm`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:i.includes(e.id),onChange:t=>a(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id)),className:`mt-1 h-4 w-4 rounded border border-border`}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`block font-semibold text-foreground`,children:e.label}),(0,K.jsx)(`span`,{className:`block text-xs text-foreground-muted`,children:e.key}),e.description?(0,K.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-foreground-muted`,children:e.description}):null]})]},e.id))}),(0,K.jsx)(`button`,{type:`submit`,disabled:n,className:`mt-4 inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Save dispatch context`})]}):(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No reusable Dispatch Context Labels exist yet. Create definitions in Settings first, then attach them here by reference.`}),(e.dispatch.contextLabelProjections??[]).length>0?(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:(e.dispatch.contextLabelProjections??[]).map(t=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:t.key},`${e.id}-${t.labelId}`))}):null,e.dispatch.renderedContext?(0,K.jsx)(`pre`,{className:`mt-4 whitespace-pre-wrap rounded-2xl border border-border bg-card px-3 py-3 text-xs text-foreground-secondary`,children:e.dispatch.renderedContext}):(0,K.jsx)(`div`,{className:`mt-4 text-xs text-foreground-muted`,children:`No dispatch context is currently rendered for this issue.`})]})}function Uy({card:e,mutating:t,onLinkRepository:n,onUpdateRepositorySettings:r,onCreatePullRequest:i}){let a=e.repository,o=e.repositoryLifecycle,s=o?.integration,[c,l]=(0,b.useState)(a?.owner??`a5c-ai`),[u,d]=(0,b.useState)(a?.name??`babysitter`),[f,p]=(0,b.useState)(a?.provider===`azure-repos`?`azure-repos`:`github`),[m,h]=(0,b.useState)(o?.branchName??`feature/${e.issueKey.toLowerCase()}`),[g,_]=(0,b.useState)(a?.defaultBranch??`main`),[v,y]=(0,b.useState)(a?.settings.baseBranch??`main`),[x,S]=(0,b.useState)(a?.settings.ciProvider??`GitHub Actions`),[C,w]=(0,b.useState)(a?.settings.publishTarget??`npm`),[T,E]=(0,b.useState)(a?.settings.requiredApprovals??1),[D,O]=(0,b.useState)(a?.settings.autoMerge??!1),[k,A]=(0,b.useState)(`${e.issueKey}: ${e.title}`),[j,M]=(0,b.useState)(o?.pullRequest?.reviewLinks.map(e=>e.reviewer??e.label).join(`, `)??`kanban-maintainers`);return!a||!o?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-dashed border-border/80 bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(ip,{className:`h-4 w-4`}),`Repository lifecycle`]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Link this work item to a shared repository context before opening a PR or surfacing CI, merge, and publish state.`}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 md:grid-cols-2`,onSubmit:t=>{t.preventDefault(),n({issueId:e.issueId,provider:f,owner:c,name:u,branchName:m,defaultBranch:g})},children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Provider`,(0,K.jsxs)(`select`,{value:f,onChange:e=>p(e.target.value===`azure-repos`?`azure-repos`:`github`),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`github`,children:`GitHub`}),(0,K.jsx)(`option`,{value:`azure-repos`,children:`Azure Repos`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Repo owner`,(0,K.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Repo name`,(0,K.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Branch`,(0,K.jsx)(`input`,{value:m,onChange:e=>h(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Default branch`,(0,K.jsx)(`input`,{value:g,onChange:e=>_(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:t,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Link repository`})]})]}):(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border/80 bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(ip,{className:`h-4 w-4`}),a.fullName]}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:["Branch `",o.branchName,"` into `",a.settings.baseBranch,"`"]})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:ay(a.provider)})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${iy(o.reviewStatus)}`,children:[`Review `,ly(o.reviewStatus)]}),(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${iy(o.mergeStatus)}`,children:[`Merge `,ly(o.mergeStatus)]}),(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${iy(o.publishStatus)}`,children:[`Publish `,ly(o.publishStatus)]}),s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${oy(s.status)}`,children:[ay(s.provider),` `,sy(s.status)]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[`PR `,cy(s.linkState)]})]}):null]}),s?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Integration guidance`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:s.guidance}),s.actions.reason?(0,K.jsx)(`div`,{className:`mt-3 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-sm text-warning`,children:s.actions.reason}):null,s.missingScopes?.length?(0,K.jsxs)(`div`,{className:`mt-3 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-sm text-warning`,children:[`Missing scopes: `,s.missingScopes.join(`, `)]}):null]}):null,o.pullRequest?(0,K.jsxs)(`div`,{className:`mt-4 rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(sp,{className:`h-4 w-4`}),`PR #`,o.pullRequest.number,(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${iy(o.pullRequest.status)}`,children:ly(o.pullRequest.status)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:cy(o.pullRequest.linkState??`linked`)})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:o.pullRequest.title}),o.pullRequest.reviewLinks.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:o.pullRequest.reviewLinks.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${uy(e)}`,children:[e.label,`: `,ly(e.status)]},e.id))}):null]}):(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 md:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]`,onSubmit:t=>{t.preventDefault(),i({issueId:e.issueId,title:k,reviewers:j})},children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`PR title`,(0,K.jsx)(`input`,{value:k,onChange:e=>A(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Reviewers`,(0,K.jsx)(`input`,{value:j,onChange:e=>M(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:t||(s?!s.actions.canCreatePullRequest:!1),className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Create PR`})]}),s&&!s.actions.canCreatePullRequest&&!o.pullRequest?(0,K.jsxs)(`p`,{className:`mt-3 text-sm text-warning`,children:[`Linked PR creation is disabled until `,ay(s.provider),` setup issues are resolved.`]}):null,(0,K.jsxs)(`div`,{className:`mt-4`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`CI gates`}),(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:o.ciGates.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${iy(e.status)}`,children:[e.name,`: `,ly(e.status)]},e.id))})]}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 md:grid-cols-2`,onSubmit:t=>{t.preventDefault(),r({issueId:e.issueId,baseBranch:v,ciProvider:x,publishTarget:C,autoMerge:D,requiredApprovals:T})},children:[(0,K.jsxs)(`div`,{className:`col-span-full flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[(0,K.jsx)(Bp,{className:`h-4 w-4`}),`Repo settings`]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Base branch`,(0,K.jsx)(`input`,{value:v,onChange:e=>y(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`CI provider`,(0,K.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Publish target`,(0,K.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Required approvals`,(0,K.jsx)(`input`,{type:`number`,min:0,value:T,onChange:e=>E(Number(e.target.value)||0),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`col-span-full flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:D,onChange:e=>O(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Enable auto-merge when approvals and CI gates pass`]}),(0,K.jsx)(`button`,{type:`submit`,disabled:t,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Save repo settings`})]})]})}function Wy({issue:e,card:t,reviewArtifact:n,project:r,issues:i,dispatchContextLabels:a,taskTags:o,loading:s,mutating:c,mutationError:l,draft:u,fieldStates:d,priorityEditing:f,assigneeEditing:p,labelEditing:m,onFocusIssue:h,onOpenDedicatedPage:g,onClose:_,onChangeDraft:v,onResetDraft:y,onRetryDescriptionSave:x,onSaveField:S,onSetPriorityEditing:C,onSetAssigneeEditing:w,onSetLabelEditing:T,onResetField:E,onCreateSubIssue:D,onLinkChildIssue:O,onSaveDispatchContextLabels:k,workspaceInventory:A,onRefreshWorkspaceInventory:j,onCreateIssueWorkspace:M,onLinkIssueWorkspace:N,onOpenWorkspacePath:P}){let ee=new Map(i.map(e=>[e.id,e])),F=e.parentIssueId?ee.get(e.parentIssueId):void 0,I=e.childIssueIds.map(e=>ee.get(e)).filter(e=>!!e),te=zy(e,ee),ne=new Set,re=e.parentIssueId;for(;re;)ne.add(re),re=ee.get(re)?.parentIssueId;let ie=i.filter(t=>t.projectId===e.projectId&&t.id!==e.id&&!e.childIssueIds.includes(t.id)&&!te.has(t.id)&&!ne.has(t.id)&&!t.parentIssueId),L=i.filter(t=>t.projectId===e.projectId&&t.id!==e.id),[R,ae]=(0,b.useState)(``),[oe,se]=(0,b.useState)(``),[ce,le]=(0,b.useState)(`medium`),[ue,z]=(0,b.useState)(`backlog`),[de,fe]=(0,b.useState)(ie[0]?.id??``),[pe,me]=(0,b.useState)(L[0]?.id??``),[he,ge]=(0,b.useState)(`blocked-by`),_e=(0,b.useRef)(null),ve=r.labels,ye=Ny(u,e),be=ye&&u.baseUpdatedAt!==e.updatedAt,xe=l?.issueId===e.id?l.message:null,Se=n?.linkedPullRequest,Ce=Se?.ciGates??t?.repositoryLifecycle?.ciGates??[],B=[...n?.comments??[]].slice(-2).reverse(),we=(0,b.useMemo)(()=>new Map(A.items.map(e=>[e.path,e])),[A.items]),Te=e.workspaceLinks??[],Ee=A.items.filter(e=>!e.missing&&!Te.some(t=>t.workspacePath===e.path)),[V,De]=(0,b.useState)(Ee[0]?.path??``);(0,b.useEffect)(()=>{fe(e=>e&&ie.some(t=>t.id===e)?e:ie[0]?.id??``)},[ie]),(0,b.useEffect)(()=>{De(e=>e&&Ee.some(t=>t.path===e)?e:Ee[0]?.path??``)},[Ee]),(0,b.useEffect)(()=>{me(e=>e&&L.some(t=>t.id===e)?e:L[0]?.id??``)},[L]);function Oe(e){let t=_e.current;if(!t){v(t=>({...t,description:t.description?`${t.description}\n${e}`:e}));return}let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length,i=t.value.slice(0,n),a=t.value.slice(r);v(t=>({...t,description:`${i}${e}${a}`})),requestAnimationFrame(()=>{t.focus();let r=n+e.length;t.setSelectionRange(r,r)})}function ke(e){return e.trim()?(0,K.jsx)(`div`,{className:`space-y-2 text-sm leading-6 text-foreground`,children:e.split(`
28
+ `).map((e,t)=>{let n=e.trim();return n?n.startsWith(`# `)?(0,K.jsx)(`div`,{className:`text-lg font-semibold text-foreground`,children:n.slice(2)},`description-preview-${t}`):n.startsWith(`- [ ] `)?(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`span`,{className:`mt-1 h-4 w-4 rounded border border-border`}),(0,K.jsx)(`span`,{children:n.slice(6)})]},`description-preview-${t}`):n.startsWith(`- `)?(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(`span`,{className:`mt-1.5 h-2 w-2 rounded-full bg-foreground-muted`}),(0,K.jsx)(`span`,{children:n.slice(2)})]},`description-preview-${t}`):(0,K.jsx)(`p`,{children:n},`description-preview-${t}`):(0,K.jsx)(`div`,{className:`h-2`},`description-preview-${t}`)})}):(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted`,children:`No description authored yet.`})}return(0,K.jsxs)(`aside`,{className:`rounded-3xl border border-border bg-card p-5 shadow-lg`,"data-testid":`issue-detail-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Issue detail`}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`h3`,{className:`text-2xl font-semibold tracking-tight text-foreground`,children:e.key}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Ry(e.status)}`,children:Ly(e.status)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:e.dispatch.readiness})]}),(0,K.jsx)(`p`,{className:`mt-2 text-base font-semibold text-foreground`,children:e.title}),e.summary?(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:e.summary}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[e.childIssueIds.length,` child issues`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[e.dependencies.length,` dependencies`]}),t?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[ny(t.workflowState),` context`]}):null]})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>g(e),className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Open page`}),(0,K.jsx)(`button`,{type:`button`,onClick:_,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Close issue`})]}),be?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-warning/30 bg-warning-muted px-4 py-3 text-sm text-warning`,children:`Server state changed while unsaved edits were still open. Reset to the latest version or keep your local draft and retry after refreshing.`}):null,xe?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-error/30 bg-error-muted px-4 py-3 text-sm text-error`,children:xe}):null,(0,K.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Issue profile`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Edit the core issue details here without leaving the planning flow.`})]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[My(`metadata`,u,e)?(0,K.jsx)(`button`,{type:`button`,onClick:()=>E(`metadata`),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Reset`}):null,(0,K.jsx)(`button`,{type:`button`,onClick:()=>S(`metadata`),disabled:!My(`metadata`,u,e)||d.metadata.status===`saving`,className:`inline-flex h-9 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:d.metadata.status===`saving`?`Saving…`:`Save profile`})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Title`,(0,K.jsx)(`input`,{value:u.title,onChange:e=>v(t=>({...t,title:e.target.value})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Status`,(0,K.jsxs)(`select`,{value:u.status,onChange:e=>v(t=>({...t,status:e.target.value})),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`backlog`,children:`Backlog`}),(0,K.jsx)(`option`,{value:`ready`,children:`Ready`}),(0,K.jsx)(`option`,{value:`in-progress`,children:`In Progress`}),(0,K.jsx)(`option`,{value:`blocked`,children:`Blocked`}),(0,K.jsx)(`option`,{value:`review`,children:`Review`}),(0,K.jsx)(`option`,{value:`done`,children:`Done`})]})]})]}),(0,K.jsxs)(`label`,{className:`mt-4 block text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Summary`,(0,K.jsx)(Tm,{taskTags:o,value:u.summary,onValueChange:e=>v(t=>({...t,summary:e})),className:`mt-2`,renderTextarea:e=>(0,K.jsx)(`textarea`,{...e,className:`min-h-24 w-full rounded-2xl border border-border bg-card px-3 py-3 text-sm text-foreground`})})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Dependencies`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Link blockers and related work directly from the detail surface.`})]})}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,K.jsx)(`select`,{value:pe,onChange:e=>me(e.target.value),className:`h-10 min-w-[180px] flex-1 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:L.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.key,` · `,e.title]},`dependency-option-${e.id}`))}),(0,K.jsxs)(`select`,{value:he,onChange:e=>ge(e.target.value),className:`h-10 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`blocked-by`,children:`Blocked by`}),(0,K.jsx)(`option`,{value:`blocks`,children:`Blocks`}),(0,K.jsx)(`option`,{value:`related`,children:`Related`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{pe&&v(e=>e.dependencies.some(e=>e.issueId===pe&&e.type===he)?e:{...e,dependencies:[...e.dependencies,{issueId:pe,type:he}]})},className:`inline-flex h-10 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Add`})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.dependencies.length>0?u.dependencies.map((e,t)=>{let n=ee.get(e.issueId);return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>n&&h(n),className:`text-sm font-semibold text-foreground underline-offset-4 hover:underline`,children:n?.key??e.issueId}),(0,K.jsx)(`span`,{className:`text-sm text-foreground-muted`,children:n?.title??`Linked dependency`})]}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,K.jsxs)(`select`,{value:e.type,onChange:e=>v(n=>({...n,dependencies:n.dependencies.map((n,r)=>r===t?{...n,type:e.target.value}:n)})),className:`h-9 rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`blocked-by`,children:`Blocked by`}),(0,K.jsx)(`option`,{value:`blocks`,children:`Blocks`}),(0,K.jsx)(`option`,{value:`related`,children:`Related`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(e=>({...e,dependencies:e.dependencies.filter((e,n)=>n!==t)})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Remove`})]})]},`dependency-draft-${e.issueId}-${e.type}-${t}`)}):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No dependencies configured.`})})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Acceptance criteria`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Criteria now stay editable instead of living only in seeded snapshots.`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(e=>({...e,acceptanceCriteria:[...e.acceptanceCriteria,{title:``,satisfied:!1,notes:``}]})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Add criterion`})]}),(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:u.acceptanceCriteria.length>0?u.acceptanceCriteria.map((e,t)=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-3`,children:[(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:e.satisfied,onChange:e=>v(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,satisfied:e.target.checked}:n)}))}),`Satisfied`]}),(0,K.jsx)(`input`,{value:e.title,onChange:e=>v(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,title:e.target.value}:n)})),placeholder:`Describe the acceptance condition`,className:`mt-3 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(`input`,{value:e.notes,onChange:e=>v(n=>({...n,acceptanceCriteria:n.acceptanceCriteria.map((n,r)=>r===t?{...n,notes:e.target.value}:n)})),placeholder:`Optional note`,className:`mt-2 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,K.jsx)(`button`,{type:`button`,onClick:()=>v(e=>({...e,acceptanceCriteria:e.acceptanceCriteria.filter((e,n)=>n!==t)})),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Remove`})})]},`criterion-draft-${e.id??t}`)):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No acceptance criteria authored yet.`})})]})]}),d.metadata.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.metadata.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.metadata.message}):null]}),(0,K.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Description`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`The panel now behaves like an authoring surface, not a static summary.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${d.description.status===`error`?`border-error/25 bg-error-muted text-error`:d.description.status===`saving`?`border-warning/25 bg-warning-muted text-warning`:d.description.status===`saved`?`border-success/25 bg-success-muted text-success`:`border-border text-foreground-muted`}`,children:d.description.status===`saving`?`Autosaving`:d.description.status===`saved`?`Saved`:d.description.status===`error`?`Recovery needed`:ye?`Local draft`:`In sync`}),ye?(0,K.jsx)(`button`,{type:`button`,onClick:y,className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Reset draft`}):null]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>Oe(`# `),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Heading`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>Oe(`- `),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Bullet`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>Oe(`- [ ] `),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Checklist`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>Oe("```\n\n```"),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Code`}),d.description.status===`error`?(0,K.jsx)(`button`,{type:`button`,onClick:x,className:`inline-flex h-9 items-center justify-center rounded-xl border border-error/30 bg-error-muted px-3 text-xs font-semibold text-error`,children:`Retry save`}):null]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 xl:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Editor`,(0,K.jsx)(`textarea`,{ref:_e,value:u.description,onChange:e=>v(t=>({...t,description:e.target.value})),placeholder:`Describe the work, add checklists, and capture recovery notes.`,className:`mt-2 min-h-40 w-full rounded-2xl border border-border bg-card px-3 py-3 text-sm text-foreground`,"data-testid":`issue-description-editor`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`issue-description-preview`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Preview`}),(0,K.jsx)(`div`,{className:`mt-3`,children:ke(u.description)})]})]}),d.description.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.description.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.description.message}):null]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-4`,children:[n||t?.repositoryLifecycle?(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Review and PR context`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Shared review output and linked PR state stay visible on the active issue, not only in the queue panel.`})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[n?(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${iy(n.decision)}`,children:[`Review `,n.decision]}):null,(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${iy(Se?.reviewStatus??t?.repositoryLifecycle?.reviewStatus??`unlinked`)}`,children:[`PR review `,Se?.reviewStatus??t?.repositoryLifecycle?.reviewStatus??`unlinked`]}),(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${iy(Se?.mergeStatus??t?.repositoryLifecycle?.mergeStatus??`not-ready`)}`,children:[`Merge `,Se?.mergeStatus??t?.repositoryLifecycle?.mergeStatus??`not-ready`]}),(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${iy(Se?.publishStatus??t?.repositoryLifecycle?.publishStatus??`not-ready`)}`,children:[`Publish `,Se?.publishStatus??t?.repositoryLifecycle?.publishStatus??`not-ready`]})]}),Se?.title||t?.repositoryLifecycle?.pullRequest?.title?(0,K.jsxs)(`div`,{className:`mt-3 rounded-2xl border border-border bg-card px-4 py-3`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:Se?.title??t?.repositoryLifecycle?.pullRequest?.title}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:Se?`${ay(Se.provider)} PR ${Se.number?`#${Se.number}`:``}`:t?.repositoryLifecycle?.pullRequest?`PR #${t.repositoryLifecycle.pullRequest.number}`:`Linked PR`})]}):null,Ce.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:Ce.map(e=>(0,K.jsxs)(`span`,{className:`rounded-full border px-2.5 py-1 ${iy(e.status)}`,children:[e.name,`: `,ly(e.status)]},`issue-detail-${e.id}`))}):null,B.length>0?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:B.map(e=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[11px] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:e.author.name}),(0,K.jsx)(`span`,{children:e.anchor.filePath}),(0,K.jsxs)(`span`,{children:[e.anchor.side,`:`,e.anchor.line]})]}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:e.body})]},`issue-review-${e.id}`))}):n?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No review comments have been mapped back to this issue yet.`}):null]}):null,(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Priority`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Field-level save keeps rank changes separate from editor autosave.`})]}),(0,K.jsx)(`div`,{className:`flex gap-2`,children:f?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>S(`priority`),disabled:!My(`priority`,u,e)||d.priority.status===`saving`,className:`inline-flex h-9 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:d.priority.status===`saving`?`Saving…`:`Save`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{E(`priority`),C(!1)},className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Cancel`})]}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>C(!0),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Edit`})})]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`Loading priority controls…`}):f?(0,K.jsx)(`div`,{className:`mt-3`,children:(0,K.jsxs)(`select`,{"aria-label":`Issue priority`,value:u.priority,onChange:e=>v(t=>({...t,priority:e.target.value})),className:`h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,K.jsx)(`option`,{value:`high`,children:`High`}),(0,K.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,K.jsx)(`option`,{value:`low`,children:`Low`})]})}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-border bg-card px-4 py-3 text-sm text-foreground`,children:e.priority}),d.priority.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.priority.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.priority.message}):null]}),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Assignees`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Empty, loading, edit, and error states stay explicit.`})]}),(0,K.jsx)(`div`,{className:`flex gap-2`,children:p?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>S(`assignees`),disabled:!My(`assignees`,u,e)||d.assignees.status===`saving`,className:`inline-flex h-9 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:d.assignees.status===`saving`?`Saving…`:`Save`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{E(`assignees`),w(!1)},className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Cancel`})]}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>w(!0),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Edit`})})]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`Loading assignee options…`}):p?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,"data-testid":`issue-assignee-edit`,children:r.team.members.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:u.assigneeIds.includes(e.id),onChange:()=>v(t=>({...t,assigneeIds:Py(t.assigneeIds,e.id)}))}),(0,K.jsx)(`span`,{children:e.displayName})]},`issue-assignee-${e.id}`))}):e.assignees.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.assignees.map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:e.displayName},`issue-assignee-chip-${e.id}`))}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`issue-assignee-empty`,children:`No assignees yet.`}),d.assignees.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.assignees.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.assignees.message}):null]}),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Tags`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Shared project labels now behave like editable issue tags from the side panel.`})]}),ve.length>0?(0,K.jsx)(`div`,{className:`flex gap-2`,children:m?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>S(`labels`),disabled:!My(`labels`,u,e)||d.labels.status===`saving`,className:`inline-flex h-9 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:d.labels.status===`saving`?`Saving…`:`Save`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{E(`labels`),T(!1)},className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted`,children:`Cancel`})]}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>T(!0),className:`inline-flex h-9 items-center justify-center rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,children:`Edit`})}):null]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`Loading tag controls…`}):ve.length===0?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`issue-tags-empty`,children:`No project tags configured yet.`}):m?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,"data-testid":`issue-tags-edit`,children:ve.map(e=>(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:u.labelIds.includes(e.id),onChange:()=>v(t=>({...t,labelIds:Py(t.labelIds,e.id)}))}),(0,K.jsx)(`span`,{children:e.name})]},`issue-label-${e.id}`))}):e.labels.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.labels.map(e=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:[(0,K.jsx)(Xp,{className:`h-3.5 w-3.5`}),e.name]},`issue-label-chip-${e.id}`))}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No tags applied to this issue.`}),d.labels.message?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border px-4 py-3 text-sm ${d.labels.status===`error`?`border-error/30 bg-error-muted text-error`:`border-success/30 bg-success-muted text-success`}`,children:d.labels.message}):null]}),(0,K.jsx)(Hy,{issue:e,dispatchContextLabels:a,mutating:c,onSave:k})]}),(0,K.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-border bg-background/80 p-4`,"data-testid":`issue-workspace-panel`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(ip,{className:`h-4 w-4`}),`Linked workspaces`]}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:`Create a new execution workspace from this issue or attach one or more existing workspaces.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>M(e),disabled:c,className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-3 text-xs font-semibold text-primary disabled:opacity-50`,children:[(0,K.jsx)(Ap,{className:`h-3.5 w-3.5`}),`Create workspace`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:j,disabled:A.loading,className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-border px-3 text-xs font-semibold text-foreground-muted disabled:opacity-50`,children:[(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`}),`Refresh`]})]})]}),A.loading?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`issue-workspace-loading`,children:`Loading workspace association state…`}):null,A.error?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-error/25 bg-error-muted p-3 text-sm text-error`,"data-testid":`issue-workspace-error`,children:A.error}):null,Te.length>0?(0,K.jsx)(`div`,{className:`mt-4 space-y-3`,"data-testid":`linked-workspaces-list`,children:Te.map(t=>{let n=we.get(t.workspacePath),r=n?.status??`stale-link`;return(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-card p-4`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:t.workspaceName}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${vy(r)}`,children:r===`stale-link`?`stale link`:r}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:t.source===`created-from-issue`?`created from issue`:`linked existing workspace`})]}),(0,K.jsx)(`div`,{className:`mt-2 font-mono text-xs text-foreground-muted`,children:t.workspacePath}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[t.branchName?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:t.branchName}):null,(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Linked `,fy(t.linkedAt)]}),n?.issues&&n.issues.length>1?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[n.issues.length,` issue associations`]}):null]})]}),n?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>P(n.path),className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,"data-testid":`open-workspace-${n.path}`,children:[(0,K.jsx)(gp,{className:`h-3.5 w-3.5`}),`Open workspace`]}):(0,K.jsxs)(`button`,{type:`button`,onClick:()=>P(),className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-border px-3 text-xs font-semibold text-foreground`,"data-testid":`recover-workspace-${t.workspacePath}`,children:[(0,K.jsx)(Pp,{className:`h-3.5 w-3.5`}),`Open workspaces`]})]})},`${e.id}-${t.workspacePath}`)})}):A.loading?null:(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`issue-workspace-empty`,children:`No workspaces are linked to this issue yet.`}),(0,K.jsxs)(`form`,{className:`mt-4 rounded-2xl border border-border bg-card p-4`,onSubmit:t=>{t.preventDefault(),V&&N({issueId:e.id,workspacePath:V}).then(()=>j())},"data-testid":`link-workspace-form`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Link existing workspace`}),Ee.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`select`,{"aria-label":`Existing workspace`,value:V,onChange:e=>De(e.target.value),className:`mt-3 h-11 w-full rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:Ee.map(e=>(0,K.jsxs)(`option`,{value:e.path,children:[e.name,` - `,e.path]},e.path))}),(0,K.jsx)(`button`,{type:`submit`,disabled:c||!V,className:`mt-3 inline-flex h-11 items-center justify-center rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Link workspace`})]}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`link-workspace-empty`,children:`Every available workspace is already attached or waiting on recovery.`})]})]}),(0,K.jsxs)(`section`,{className:`mt-5 rounded-2xl border border-border bg-background/80 p-4`,"data-testid":`issue-relationship-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(am,{className:`h-4 w-4`}),`Parent and child issue flow`]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-2`,children:[(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`parent-relationship-section`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(Of,{className:`h-4 w-4`}),`Parent issue`]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`parent-relationship-loading`,children:`Refreshing parent relationship state…`}):xe?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-error/25 bg-error-muted p-3 text-sm text-error`,"data-testid":`parent-relationship-error`,children:xe}):F?(0,K.jsxs)(`div`,{className:`mt-3 rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>h(F),className:`text-sm font-semibold text-foreground underline-offset-4 hover:underline`,"data-testid":`back-to-parent-${F.key}`,children:[`Back to `,F.key]}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Ry(F.status)}`,children:Ly(F.status)})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:F.title}),(0,K.jsxs)(`div`,{className:`mt-2 text-xs text-foreground-muted`,children:[`Parent readiness: `,F.dispatch.readiness]})]}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`parent-relationship-empty`,children:`No parent issue linked.`})]}),(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`child-relationship-section`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(am,{className:`h-4 w-4`}),`Child issues`]}),s?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`child-relationship-loading`,children:`Refreshing child relationship state…`}):xe?(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-error/25 bg-error-muted p-3 text-sm text-error`,"data-testid":`child-relationship-error`,children:xe}):I.length>0?(0,K.jsx)(`div`,{className:`mt-3 space-y-3`,children:I.map(e=>(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>h(e),className:`text-sm font-semibold text-foreground underline-offset-4 hover:underline`,"data-testid":`child-nav-${e.key}`,children:e.key}),(0,K.jsx)(`span`,{className:`rounded-full border px-2.5 py-1 text-xs ${Ry(e.status)}`,children:Ly(e.status)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:e.dispatch.readiness})]}),(0,K.jsx)(`div`,{className:`mt-2 text-sm text-foreground`,children:e.title})]},e.id))}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`child-relationship-empty`,children:`No child issues linked yet.`}),(0,K.jsxs)(`form`,{className:`mt-4 grid gap-3 rounded-2xl border border-border bg-background p-4`,onSubmit:t=>{t.preventDefault(),R.trim()&&D({parentIssueId:e.id,title:R,summary:oe||void 0,priority:ce,status:ue}).then(()=>{ae(``),se(``),le(`medium`),z(`backlog`)}).catch(()=>void 0)},"data-testid":`create-sub-issue-form`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Create sub-issue`}),(0,K.jsx)(`input`,{"aria-label":`Sub-issue title`,value:R,onChange:e=>ae(e.target.value),placeholder:`Break out a child issue`,className:`h-11 rounded-xl border border-border bg-card px-3 text-sm text-foreground`}),(0,K.jsx)(Tm,{taskTags:o,value:oe,onValueChange:se,className:`min-h-24`,renderTextarea:e=>(0,K.jsx)(`textarea`,{...e,"aria-label":`Sub-issue summary`,placeholder:`Optional context for the child issue`,className:`min-h-24 rounded-xl border border-border bg-card px-3 py-3 text-sm text-foreground`})}),(0,K.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Priority`,(0,K.jsxs)(`select`,{"aria-label":`Sub-issue priority`,value:ce,onChange:e=>le(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`critical`,children:`Critical`}),(0,K.jsx)(`option`,{value:`high`,children:`High`}),(0,K.jsx)(`option`,{value:`medium`,children:`Medium`}),(0,K.jsx)(`option`,{value:`low`,children:`Low`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Initial status`,(0,K.jsxs)(`select`,{"aria-label":`Sub-issue status`,value:ue,onChange:e=>z(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,K.jsx)(`option`,{value:`backlog`,children:`Backlog`}),(0,K.jsx)(`option`,{value:`ready`,children:`Ready`}),(0,K.jsx)(`option`,{value:`in-progress`,children:`In Progress`}),(0,K.jsx)(`option`,{value:`blocked`,children:`Blocked`}),(0,K.jsx)(`option`,{value:`review`,children:`Review`}),(0,K.jsx)(`option`,{value:`done`,children:`Done`})]})]})]}),(0,K.jsx)(`button`,{type:`submit`,disabled:c,className:`inline-flex h-11 items-center justify-center rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Create child issue`})]}),(0,K.jsxs)(`form`,{className:`mt-4 rounded-2xl border border-border bg-background p-4`,onSubmit:t=>{t.preventDefault(),de&&O({parentIssueId:e.id,childIssueId:de}).catch(()=>void 0)},"data-testid":`link-child-issue-form`,children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Link existing child issue`}),ie.length>0?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`select`,{"aria-label":`Existing child issue`,value:de,onChange:e=>fe(e.target.value),className:`mt-3 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:ie.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.key,` - `,e.title]},e.id))}),(0,K.jsx)(`button`,{type:`submit`,disabled:c,className:`mt-3 inline-flex h-11 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Link child issue`})]}):(0,K.jsx)(`div`,{className:`mt-3 rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,"data-testid":`link-child-issue-empty`,children:`No unparented sibling issues are available to link here.`})]})]})]})]})]})}function Gy({projectId:e,routeBasePath:t,forcedPresentation:n,routeMode:r=`board`,initialIssueId:i,initialIssueKey:a,initialProjectId:o}={}){let s=Be(),[c]=Pt(),{taskTags:l}=Qm(),{snapshot:u,board:d,summary:f,loading:p,error:m,moveIssue:h,linkRepository:g,updateRepositorySettings:_,createPullRequest:v,createIssue:y,updateProjectCollaboration:x,updateIssueCollaboration:S,updateIssueDispatchContextLabels:C,createSubIssue:w,linkChildIssue:T,updateIssueDetail:E,createIssueWorkspace:D,linkIssueWorkspace:O,movingIssueId:k,mutatingIssueId:A,creatingIssue:j,mutationError:M,refresh:N}=Zm(),P=Dv({targetType:`issue`}),ee=(0,b.useMemo)(()=>new Map(P.artifacts.map(e=>[e.targetId,e])),[P.artifacts]),F=r===`board`?c.get(`issueId`):i??null,I=r===`board`?c.get(`issueKey`):a??null,te=e??o??`default`,[ne,re]=Wh(`backlog-presentation`,`board`),ie=n??ne,[L,R]=Wh(`kanban-search-${te}`,``),[ae,oe]=Wh(`kanban-workflow-filter-${te}`,`all`),[se,ce]=Wh(`kanban-readiness-filter-${te}`,`all`),[le,ue]=Wh(`kanban-assignee-filter-${te}`,`all`),[z,de]=Wh(`kanban-tag-filter-${te}`,`all`),[fe,pe]=Wh(`kanban-sort-mode-${te}`,`board-order`),[me,he]=Wh(`kanban-show-empty-swimlanes-${te}`,!1),[ge,_e]=Wh(`kanban-show-policy-signals-v2-${te}`,!1),[ve,ye]=(0,b.useState)([]),[be,xe]=(0,b.useState)(`in-progress`),[Se,Ce]=(0,b.useState)(null),[B,we]=(0,b.useState)(null),[Te,Ee]=(0,b.useState)(r===`create`?{source:`header`,workflowState:`todo`}:null),[V,De]=Wh(`board-create-draft`,xy()),[Oe,ke]=(0,b.useState)(`idle`),[Ae,je]=(0,b.useState)(null),[Me,Ne]=(0,b.useState)(null),[Pe,Fe]=(0,b.useState)(null),[Ie,Le]=Wh(`issue-detail-drafts`,{}),[Re,ze]=(0,b.useState)(Oy()),[Ve,He]=(0,b.useState)(!1),[Ue,We]=(0,b.useState)(!1),[Ge,Ke]=(0,b.useState)(!1),[qe,Je]=(0,b.useState)({items:[],loading:!1,error:null}),Ye=(0,b.useRef)(null);(0,b.useEffect)(()=>{let e=F?document.getElementById(`kanban-issue-${F}`):I?document.querySelector(`[data-testid="kanban-card-${I}"]`):null;e&&typeof e.scrollIntoView==`function`&&e.scrollIntoView({behavior:`smooth`,block:`center`})},[F,I]),(0,b.useEffect)(()=>{if(!Te)return;let e=xy(Te.workflowState);if(V.title===e.title&&V.summary===e.summary&&V.description===e.description&&V.workflowState===e.workflowState&&V.status===e.status&&V.priority===e.priority&&ky(V.assigneeIds,e.assigneeIds)&&ky(V.labelIds,e.labelIds)&&Ay(V.dependencies,e.dependencies)&&jy(V.acceptanceCriteria,e.acceptanceCriteria)){ke(`idle`);return}ke(`saving`);let t=window.setTimeout(()=>{ke(`saved`)},250);return()=>window.clearTimeout(t)},[Te,V.acceptanceCriteria,V.assigneeIds,V.dependencies,V.description,V.labelIds,V.priority,V.status,V.summary,V.title,V.workflowState]);let Xe=new Map((u?.issues??[]).map(e=>[e.id,e])),H=(F?Xe.get(F):void 0)??(I?u?.issues.find(e=>e.key===I):void 0),Ze=(e?u?.projects.find(t=>t.id===e):void 0)??(o?u?.projects.find(e=>e.id===o):void 0)??(H?u?.projects.find(e=>e.id===H.projectId):void 0)??u?.projects[0],Qe=Ze?d?.projects.find(e=>e.projectId===Ze.id):void 0,$e=H&&Qe?Qe.cards.find(e=>e.issueId===H.id):void 0,et=H?Ie[H.id]??Dy(H):null,tt=u?.issues.find(e=>e.key===`KANBAN-GAP-004`)??u?.issues.find(e=>e.key===`KANBAN-DEBT-003`),nt=Cy(L);(0,b.useEffect)(()=>{let e=H?.id??null;Ye.current!==e&&(Ye.current=e,ze(Oy()),He(!1),We(!1),Ke(!1))},[H?.id]),(0,b.useEffect)(()=>{H&&Le(e=>{let t=e[H.id],n=Dy(H);return!t||!Ny(t,H)?{...e,[H.id]:n}:e})},[H,Le]),(0,b.useEffect)(()=>{if(!H||!et||!My(`description`,et,H)||et.baseUpdatedAt!==H.updatedAt)return;ze(e=>({...e,description:{status:`saving`,message:null}}));let e=window.setTimeout(()=>{vt(`description`)},450);return()=>window.clearTimeout(e)},[H,et]),(0,b.useEffect)(()=>{if(!H)return;let e=!1;return Je(e=>({...e,loading:!0,error:null})),by().then(t=>{e||Je({items:[...t.workspaces],loading:!1,error:null})}).catch(t=>{e||Je({items:[],loading:!1,error:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},[H?.id]);let rt=Qe?Qe.swimlanes.flatMap(e=>$v.flatMap(t=>ry(Qe,e.id,t))):[],it=new Map(rt.map((e,t)=>[e.issueId,t])),U=rt.filter(e=>{let t=Xe.get(e.issueId);return!(!t||ae!==`all`&&e.workflowState!==ae||se!==`all`&&e.readiness!==se||le!==`all`&&!t.assignees.some(e=>e.id===le)||z!==`all`&&!t.labels.some(e=>e.id===z)||nt.length>0&&!wy(e,t).includes(nt))}).slice().sort((e,t)=>fe===`priority`?Ty(e.priority)-Ty(t.priority)||(it.get(e.issueId)??0)-(it.get(t.issueId)??0):fe===`activity`?Date.parse(t.latestActivityAt??``)-Date.parse(e.latestActivityAt??``)||(it.get(e.issueId)??0)-(it.get(t.issueId)??0):fe===`title`?e.title.localeCompare(t.title)||e.issueKey.localeCompare(t.issueKey):(it.get(e.issueId)??0)-(it.get(t.issueId)??0)),at=new Set(U.map(e=>e.issueId)),ot=U.map(e=>e.issueId).join(`|`),st=U.filter(e=>ve.includes(e.issueId)),ct=U.length>0&&U.every(e=>ve.includes(e.issueId)),lt=Ze?.team.members??[],ut=Ze?.labels??[],W=[ae!==`all`,se!==`all`,le!==`all`,z!==`all`,nt.length>0].filter(Boolean).length,dt=t?`${t}/${ie}`:`/`,ft=$v.filter(e=>st.every(t=>t.moveTargets.some(t=>t.state===e)));if((0,b.useEffect)(()=>{ye(e=>{let t=e.filter(e=>at.has(e));return t.length===e.length?e:t})},[ot]),p&&!u)return(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`backlog-overview-loading`,children:(0,K.jsxs)(`div`,{className:`animate-pulse space-y-3`,children:[(0,K.jsx)(`div`,{className:`h-4 w-36 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`h-8 w-80 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`grid gap-3 md:grid-cols-4`,children:Array.from({length:4}).map((e,t)=>(0,K.jsx)(`div`,{className:`h-20 rounded-2xl bg-background-secondary`},t))})]})});if(m||!u||!f||!d)return(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error shadow-lg`,"data-testid":`backlog-overview-error`,children:`Failed to load issue backlog model.`});if(!Ze||!Qe)return null;if(r===`create`)return(0,K.jsxs)(`section`,{className:`mb-6 space-y-4`,"data-testid":`issue-create-route`,children:[(0,K.jsx)(`div`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Issue authoring`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight text-foreground`,children:`Create a first-class issue`}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:`Create an issue in its own focused route, then return to the board when you want to keep moving work across columns.`})]}),(0,K.jsx)(`button`,{type:`button`,onClick:Dt,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Back to board`})]})}),Te?(0,K.jsx)(Fy,{draft:V,project:Ze,issues:u.issues.filter(e=>e.projectId===Ze.id),taskTags:l,autosaveStatus:Oe,creatingIssue:j,error:Ae,validationError:Me,onChange:e=>{Ne(null),je(null),De(t=>e(t))},onClose:Dt,onSubmit:()=>void yt()}):null]});if(r===`issue`)return!H||!et?(0,K.jsx)(`section`,{className:`mb-6 rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error shadow-lg`,children:`Issue not found in the current backlog snapshot.`}):(0,K.jsxs)(`section`,{className:`mb-6 space-y-4`,"data-testid":`issue-detail-route`,children:[(0,K.jsx)(`div`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Issue detail`}),(0,K.jsx)(`h2`,{className:`mt-2 text-2xl font-semibold tracking-tight text-foreground`,children:H.key}),(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:`Dedicated issue routes now sit beside the board so issue authoring and maintenance can happen on stable deep links instead of only inside the home-page side panel.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s(hy(H.projectId)),className:`inline-flex h-11 items-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary`,children:[(0,K.jsx)(Ap,{className:`h-4 w-4`}),`New issue`]}),(0,K.jsx)(`button`,{type:`button`,onClick:Dt,className:`inline-flex h-11 items-center justify-center rounded-xl border border-border px-4 text-sm font-semibold text-foreground-muted`,children:`Back to board`})]})]})}),(0,K.jsx)(Wy,{issue:H,card:$e,reviewArtifact:ee.get(H.id),project:Ze,issues:u.issues.filter(e=>e.projectId===Ze.id),dispatchContextLabels:u.dispatchContextLabels??[],taskTags:l,loading:p,mutating:A===H.id,mutationError:M,draft:et,fieldStates:Re,priorityEditing:Ve,assigneeEditing:Ue,labelEditing:Ge,onFocusIssue:Et,onOpenDedicatedPage:e=>s(my(e.projectId,e.id)),onClose:Dt,onChangeDraft:ht,onResetDraft:_t,onRetryDescriptionSave:()=>void vt(`description`),onSaveField:e=>void vt(e),onSetPriorityEditing:He,onSetAssigneeEditing:We,onSetLabelEditing:Ke,onResetField:gt,onCreateSubIssue:w,onLinkChildIssue:T,onSaveDispatchContextLabels:C,workspaceInventory:qe,onRefreshWorkspaceInventory:Ot,onCreateIssueWorkspace:kt,onLinkIssueWorkspace:O,onOpenWorkspacePath:G})]});function pt(e,t=`todo`){Dt(),Ee({source:e,workflowState:t}),De(xy(t)),je(null),Ne(null),ke(`idle`),Fe(null)}function mt(){Ee(null),De(xy()),je(null),Ne(null),ke(`idle`)}function ht(e){H&&Le(t=>{let n=t[H.id]??Dy(H);return{...t,[H.id]:e(n)}})}function gt(e){if(!H)return;let t=Dy(H);ht(n=>({...n,title:e===`metadata`?t.title:n.title,summary:e===`metadata`?t.summary:n.summary,status:e===`metadata`?t.status:n.status,priority:e===`priority`?t.priority:n.priority,assigneeIds:e===`assignees`?t.assigneeIds:n.assigneeIds,labelIds:e===`labels`?t.labelIds:n.labelIds,dependencies:e===`metadata`?t.dependencies:n.dependencies,acceptanceCriteria:e===`metadata`?t.acceptanceCriteria:n.acceptanceCriteria})),ze(t=>({...t,[e]:{status:`idle`,message:null}}))}function _t(){H&&(Le(e=>({...e,[H.id]:Dy(H)})),ze(Oy()))}async function vt(e){if(!H||!et)return;let t=e===`metadata`?{title:et.title,summary:et.summary,status:et.status,dependencies:et.dependencies,acceptanceCriteria:et.acceptanceCriteria.map(e=>({id:e.id,title:e.title,satisfied:e.satisfied,notes:e.notes.trim()||void 0}))}:e===`description`?{description:et.description}:e===`priority`?{priority:et.priority}:e===`assignees`?{assigneeIds:et.assigneeIds}:{labelIds:et.labelIds};ze(t=>({...t,[e]:{status:`saving`,message:null}}));try{let n=(await E({issueId:H.id,expectedUpdatedAt:et.baseUpdatedAt,...t})).snapshot.issues.find(e=>e.id===H.id);n&&Le(e=>({...e,[H.id]:Dy(n)})),ze(t=>({...t,[e]:{status:`saved`,message:e===`metadata`?`Issue profile saved.`:e===`description`?`Description saved.`:e===`priority`?`Priority saved.`:e===`assignees`?`Assignees saved.`:`Tags saved.`}})),e===`priority`&&He(!1),e===`assignees`&&We(!1),e===`labels`&&Ke(!1)}catch(t){ze(n=>({...n,[e]:{status:`error`,message:t instanceof Error?t.message:e===`metadata`?`Issue profile save failed.`:e===`description`?`Description save failed.`:`Field save failed.`}}))}}async function yt(){if(Te){if(!V.title.trim()){Ne(`Title is required before the issue can be created.`);return}if(Ne(null),je(null),!Ze){Ne(`A project must be selected before creating an issue.`);return}try{let t=await y({projectId:e??o??Ze.id,title:V.title.trim(),summary:V.summary.trim()||void 0,description:V.description.trim()||void 0,status:V.status,assigneeIds:V.assigneeIds,labelIds:V.labelIds,dependencies:V.dependencies,acceptanceCriteria:V.acceptanceCriteria.map(e=>({id:e.id,title:e.title,satisfied:e.satisfied,notes:e.notes.trim()||void 0})),priority:V.priority,metadata:{createSource:Te.source,createWorkflowState:V.workflowState,createMode:r===`create`?`route`:`board`}});if(r===`create`){s(my(t.issue.projectId,t.issue.id));return}Fe(`Created ${t.issue.key} from ${Te.source===`column`?`column header`:`board header`} create mode.`),mt()}catch(e){je(e instanceof Error?e.message:`Failed to create issue.`),ke(`partial`)}}}let bt=e=>{if(t){let n=new URLSearchParams(c.toString()).toString();s(n?`${t}/${e}?${n}`:`${t}/${e}`);return}re(e)},xt=e=>{ye(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},St=()=>{ye(e=>ct?e.filter(e=>!at.has(e)):Array.from(new Set([...e,...U.map(e=>e.issueId)])))},Ct=(e,t)=>{h(e,t)};async function wt(){if(st.length===0)return;Ce(`move`),we(null);let e=0,t=0;try{for(let n of st){if(!n.moveTargets.find(e=>e.state===be)?.allowed){t+=1;continue}await h(n.issueId,be),e+=1}ye([]),we(t>0?`Moved ${e} issue${e===1?``:`s`} to ${ny(be)}. ${t} stayed put because policy checks blocked the transition.`:`Moved ${e} issue${e===1?``:`s`} to ${ny(be)}.`)}finally{Ce(null)}}async function Tt(){if(st.length===0)return;Ce(`workspace`),we(null);let e=0,t=0;try{for(let n of st){let r=Xe.get(n.issueId);if(!r||(r.workspaceLinks?.length??0)>0){t+=1;continue}await D(n.issueId),e+=1}ye([]),we(t>0?`Provisioned ${e} workspace${e===1?``:`s`}. ${t} issue${t===1?``:`s`} already had a linked workspace.`:`Provisioned ${e} workspace${e===1?``:`s`} from the current selection.`)}finally{Ce(null)}}function Et(e){if(r===`issue`){s(my(e.projectId,e.id));return}mt();let t=new URLSearchParams(c.toString());t.set(`issueId`,e.id),t.set(`issueKey`,e.key),s(`${dt}?${t.toString()}`)}function Dt(){if(r===`issue`||r===`create`){s(dt);return}let e=new URLSearchParams(c.toString());e.delete(`issueId`),e.delete(`issueKey`);let t=e.toString();s(t?`${dt}?${t}`:dt)}function Ot(){H&&(Je(e=>({...e,loading:!0,error:null})),by().then(e=>{Je({items:[...e.workspaces],loading:!1,error:null})}).catch(e=>{Je({items:[],loading:!1,error:e instanceof Error?e.message:String(e)})}))}function G(e){s(e?py(e):`/workspaces`)}function kt(e){s(_y(e.projectId,e.id))}let At=H?`issue`:Te?`create`:null;return(0,K.jsxs)(`section`,{className:`backlog-overview-surface mb-4 rounded-3xl border border-border bg-card p-4 shadow-lg`,"data-testid":`backlog-overview`,children:[(0,K.jsx)(`div`,{className:`backlog-overview__hero flex flex-wrap items-end justify-between gap-3`,children:(0,K.jsxs)(`div`,{className:`flex min-w-[280px] flex-1 flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1.5 font-semibold uppercase tracking-[0.2em] text-primary/80`,children:`Kanban board`}),(0,K.jsx)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1.5`,children:Ze.name}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1.5`,children:[f.issueCount,` issues`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1.5`,children:[f.inProgressCount,` in progress`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1.5`,children:[(P.summary?.pendingCount??0)+(P.summary?.changesRequestedCount??0),` in review`]}),Ze.linkedRunSummary?(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1.5`,children:[Ze.linkedRunSummary.activeRuns,` live runs linked`]}):null]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight text-foreground`,children:`Move work first and reveal planning detail only when needed`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>bt(`board`),className:`inline-flex h-10 items-center gap-2 rounded-xl border px-3 text-sm font-semibold ${ie===`board`?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-background text-foreground-muted`}`,children:[(0,K.jsx)(pp,{className:`h-4 w-4`}),`Board view`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>bt(`list`),className:`inline-flex h-10 items-center gap-2 rounded-xl border px-3 text-sm font-semibold ${ie===`list`?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-background text-foreground-muted`}`,children:[(0,K.jsx)(_p,{className:`h-4 w-4`}),`List view`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>pt(`header`),className:`inline-flex h-10 items-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary`,"data-testid":`board-header-create`,children:[(0,K.jsx)(Ap,{className:`h-4 w-4`}),`Create issue`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s(gy(Ze.id)),className:`inline-flex h-10 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground`,"data-testid":`board-header-create-workspace`,children:[(0,K.jsx)(ip,{className:`h-4 w-4`}),`Create workspace`]})]})]})]})}),(0,K.jsxs)(`div`,{className:`backlog-overview__controls mt-2 rounded-3xl border border-border bg-background/70 p-3`,children:[(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[minmax(0,1.9fr)_auto]`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Search`,(0,K.jsxs)(`div`,{className:`mt-2 flex h-11 items-center gap-2 rounded-xl border border-border bg-card px-3`,children:[(0,K.jsx)(Lp,{className:`h-4 w-4 text-foreground-muted`}),(0,K.jsx)(`input`,{value:L,onChange:e=>R(e.target.value),placeholder:`Search key, title, summary, tags, or assignees`,className:`w-full bg-transparent text-sm text-foreground outline-none`,"aria-label":`Planning search`})]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end gap-2`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-2 text-xs text-foreground-muted`,children:[U.length,` visible`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-2 text-xs text-foreground-muted`,children:[W,` active filter`,W===1?``:`s`]}),st.length>0?(0,K.jsxs)(`span`,{className:`rounded-full border border-primary/20 bg-primary/10 px-3 py-2 text-xs font-semibold text-primary`,children:[st.length,` selected`]}):null]})]}),(0,K.jsxs)(`details`,{className:`backlog-overview__planning-details mt-4`,"data-testid":`board-controls-details`,open:st.length>0||H?!0:void 0,children:[(0,K.jsxs)(`summary`,{className:`backlog-overview__planning-summary`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Board controls`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Open filters, triage, and bulk actions only when you need them`})]}),(0,K.jsxs)(`div`,{className:`backlog-overview__planning-badges`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[`Sort `,fe.replace(`-`,` `)]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[st.length,` selected`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[W,` active filters`]})]})]}),(0,K.jsxs)(`div`,{className:`backlog-overview__planning-body`,children:[(0,K.jsxs)(`div`,{className:`backlog-overview__metrics-grid grid gap-3 md:grid-cols-4`,children:[(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(pp,{className:`h-4 w-4`}),`Scope`]}),(0,K.jsx)(`div`,{className:`mt-3 text-2xl font-semibold text-foreground`,children:f.issueCount}),(0,K.jsxs)(`div`,{className:`text-sm text-foreground-muted`,children:[f.projectCount,` project models`]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-warning/25 bg-warning-muted p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-warning`,children:[(0,K.jsx)(am,{className:`h-4 w-4`}),`Active WIP`]}),(0,K.jsx)(`div`,{className:`mt-3 text-2xl font-semibold text-warning`,children:f.inProgressCount}),(0,K.jsxs)(`div`,{className:`text-sm text-warning/80`,children:[f.needsDecompositionCount,` waiting on decomposition`]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-primary/25 bg-primary/10 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-primary`,children:[(0,K.jsx)(Zp,{className:`h-4 w-4`}),`Review Queue`]}),(0,K.jsx)(`div`,{className:`mt-3 text-2xl font-semibold text-primary`,children:(P.summary?.pendingCount??0)+(P.summary?.changesRequestedCount??0)}),(0,K.jsx)(`div`,{className:`text-sm text-primary/80`,children:`reviews waiting for action`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-error/25 bg-error-muted p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-error`,children:[(0,K.jsx)(Bf,{className:`h-4 w-4`}),`Blocked`]}),(0,K.jsx)(`div`,{className:`mt-3 text-2xl font-semibold text-error`,children:f.blockedCount}),(0,K.jsxs)(`div`,{className:`text-sm text-error/80`,children:[f.completedCount,` completed`]})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[repeat(2,minmax(0,220px))_auto]`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Workflow`,(0,K.jsxs)(`select`,{value:ae,onChange:e=>oe(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,"aria-label":`Workflow filter`,children:[(0,K.jsx)(`option`,{value:`all`,children:`All columns`}),$v.map(e=>(0,K.jsx)(`option`,{value:e,children:ny(e)},e))]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Readiness`,(0,K.jsxs)(`select`,{value:se,onChange:e=>ce(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,"aria-label":`Readiness filter`,children:[(0,K.jsx)(`option`,{value:`all`,children:`All readiness`}),(0,K.jsx)(`option`,{value:`needs-decomposition`,children:`Needs decomposition`}),(0,K.jsx)(`option`,{value:`ready`,children:`Ready`}),(0,K.jsx)(`option`,{value:`blocked`,children:`Blocked`}),(0,K.jsx)(`option`,{value:`dispatched`,children:`Dispatched`}),(0,K.jsx)(`option`,{value:`completed`,children:`Completed`})]})]})]}),(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-[repeat(2,minmax(0,180px))_auto]`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Assignee`,(0,K.jsxs)(`select`,{value:le,onChange:e=>ue(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,"aria-label":`Assignee filter`,children:[(0,K.jsx)(`option`,{value:`all`,children:`All assignees`}),lt.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.displayName},e.id))]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Tag`,(0,K.jsxs)(`select`,{value:z,onChange:e=>de(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,"aria-label":`Tag filter`,children:[(0,K.jsx)(`option`,{value:`all`,children:`All tags`}),ut.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end gap-3`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Sort`,(0,K.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 rounded-xl border border-border bg-card px-3`,children:[(0,K.jsx)(jf,{className:`h-4 w-4 text-foreground-muted`}),(0,K.jsxs)(`select`,{value:fe,onChange:e=>pe(e.target.value),className:`h-11 bg-transparent pr-2 text-sm text-foreground outline-none`,"aria-label":`Sort cards`,children:[(0,K.jsx)(`option`,{value:`board-order`,children:`Board order`}),(0,K.jsx)(`option`,{value:`priority`,children:`Priority`}),(0,K.jsx)(`option`,{value:`activity`,children:`Recent activity`}),(0,K.jsx)(`option`,{value:`title`,children:`Title`})]})]})]}),(0,K.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:me,onChange:e=>he(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Show empty swimlanes`]}),(0,K.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:ge,onChange:e=>_e(e.target.checked),className:`h-4 w-4 rounded border border-border`}),`Show policy feedback`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3 rounded-2xl border border-border bg-card px-4 py-3`,children:[(0,K.jsxs)(`label`,{className:`inline-flex items-center gap-2 text-sm text-foreground`,children:[(0,K.jsx)(`input`,{type:`checkbox`,checked:ct,onChange:St,className:`h-4 w-4 rounded border border-border`,"aria-label":`Select visible issues`}),`Select visible`]}),(0,K.jsxs)(`span`,{className:`text-sm text-foreground-muted`,children:[st.length,` selected`]}),(0,K.jsx)(`select`,{value:be,onChange:e=>xe(e.target.value),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,"aria-label":`Bulk move target`,children:$v.map(e=>(0,K.jsxs)(`option`,{value:e,disabled:!ft.includes(e),children:[`Move to `,ny(e)]},e))}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void wt(),disabled:st.length===0||Se!==null||!ft.includes(be),className:`inline-flex h-11 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground disabled:opacity-50`,children:`Move selected`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void Tt(),disabled:st.length===0||Se!==null,className:`inline-flex h-11 items-center gap-2 rounded-xl border border-primary/30 bg-primary/10 px-4 text-sm font-semibold text-primary disabled:opacity-50`,children:`Create workspaces`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>ye([]),disabled:st.length===0||Se!==null,className:`inline-flex h-11 items-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-semibold text-foreground-muted disabled:opacity-50`,children:`Clear selection`})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 xl:grid-cols-[minmax(0,1.45fr)_repeat(3,minmax(0,180px))]`,children:[(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-card px-4 py-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Board focus`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm font-semibold text-foreground`,children:H?`${H.key} · ${H.title}`:`No issue selected`}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-foreground-muted`,children:H?`The detail panel is open beside the board so you can edit without losing column context.`:`Open any card to inspect acceptance criteria, review state, workspace links, and child issues.`})]}),H?(0,K.jsx)(`button`,{type:`button`,onClick:Dt,className:`inline-flex h-10 items-center rounded-xl border border-border bg-background px-3 text-xs font-semibold text-foreground`,children:`Clear focus`}):null]})}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card px-4 py-3`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Filters`}),(0,K.jsx)(`p`,{className:`mt-2 text-base font-semibold text-foreground`,children:W}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-foreground-muted`,children:W===0?`Board showing the default scope.`:`Filters actively narrowing the board.`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card px-4 py-3`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Selection`}),(0,K.jsx)(`p`,{className:`mt-2 text-base font-semibold text-foreground`,children:st.length}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-foreground-muted`,children:`Cards ready for bulk move or workspace creation.`})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card px-4 py-3`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:`Review queue`}),(0,K.jsx)(`p`,{className:`mt-2 text-base font-semibold text-foreground`,children:(P.summary?.pendingCount??0)+(P.summary?.changesRequestedCount??0)}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-foreground-muted`,children:`Artifacts waiting on review, approval, or rework.`})]})]})]})]})]}),Pe?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-success/30 bg-success-muted px-4 py-3 text-sm text-success`,children:Pe}):null,B?(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-primary/20 bg-primary/10 px-4 py-3 text-sm text-primary`,children:B}):null,(0,K.jsxs)(`div`,{className:`backlog-overview__workspace mt-6 grid gap-5 ${At?`xl:grid-cols-[minmax(0,1.7fr)_minmax(320px,400px)]`:`grid-cols-1`}`,children:[(0,K.jsxs)(`div`,{className:`backlog-overview__board-stack space-y-5`,children:[U.length===0?(0,K.jsx)(`div`,{className:`rounded-3xl border border-dashed border-border bg-background/70 p-6 text-sm text-foreground-muted`,children:`No issues match the current planning filters. Adjust search, workflow, readiness, assignee, or tag filters to widen the board.`}):null,ie===`board`?(0,K.jsx)(`div`,{className:`backlog-overview__board space-y-5`,"data-testid":`kanban-board`,children:Qe.swimlanes.filter(e=>{let t=U.filter(t=>t.swimlaneId===e.id).length;return me||t>0}).map(e=>(0,K.jsxs)(`section`,{className:`backlog-overview__swimlane rounded-3xl border border-border bg-background/70 p-4`,"data-testid":`kanban-swimlane-${e.id}`,children:[(0,K.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Swimlane`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:e.name})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[U.filter(t=>t.swimlaneId===e.id).length,` visible`]})]}),(0,K.jsx)(`div`,{className:`backlog-overview__swimlane-grid grid gap-4`,children:$v.map(t=>{let n=Qe.columns.find(e=>e.id===t),r=U.filter(n=>n.swimlaneId===e.id&&n.workflowState===t);return n?(0,K.jsxs)(`div`,{className:`backlog-overview__column rounded-2xl border p-4 ${ty(t,n.isOverLimit)}`,"data-testid":`kanban-column-${e.id}-${t}`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:ny(t)}),(0,K.jsxs)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:[r.length,` visible in this lane`]})]}),(0,K.jsxs)(`div`,{className:`text-right text-xs text-foreground-muted`,children:[(0,K.jsxs)(`div`,{children:[n.issueCount,` total`]}),typeof n.wipLimit==`number`?(0,K.jsxs)(`div`,{className:n.isOverLimit?`text-error`:void 0,children:[`WIP `,n.issueCount,`/`,n.wipLimit]}):(0,K.jsx)(`div`,{children:`No WIP cap`})]})]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>pt(`column`,t),className:`mt-4 inline-flex h-10 items-center gap-2 rounded-xl border border-border bg-card px-3 text-xs font-semibold text-foreground`,"data-testid":`create-column-${e.id}-${t}`,children:[(0,K.jsx)(Ap,{className:`h-3.5 w-3.5`}),`Add issue`]}),(0,K.jsxs)(`div`,{className:`backlog-overview__column-cards mt-4 space-y-3`,children:[r.length===0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border p-3 text-sm text-foreground-muted`,children:`No cards`}):null,r.map(e=>{let t=Xe.get(e.issueId),n=t?.parentIssueId?Xe.get(t.parentIssueId):void 0,r=t?.workspaceLinks?.length??0,i=t?.workspaceLinks?.[0],a=e.moveTargets.filter(e=>e.allowed),o=a[0]??null,c=a.slice(1),l=t!=null,d=!!e.repositoryLifecycle||e.collaboratorNames.length>0||e.assigneeNames.length>0||e.labelNames.length>0,f=l||d||c.length>0||e.dependencyCount>0||e.childCount>0||e.acceptanceProgress.total>0||ge&&(e.policySignals.length>0||e.moveTargets.some(e=>e.signals.length>0));return(0,K.jsxs)(`article`,{id:`kanban-issue-${e.issueId}`,className:`backlog-overview__card rounded-2xl border p-4 ${ey(e)} ${F===e.issueId||I===e.issueKey?`ring-2 ring-primary/50 ring-offset-2 ring-offset-background`:``}`,"data-testid":`kanban-card-${e.issueKey}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`label`,{className:`inline-flex items-center gap-2 text-xs text-foreground-muted`,children:(0,K.jsx)(`input`,{type:`checkbox`,checked:ve.includes(e.issueId),onChange:()=>xt(e.issueId),className:`h-4 w-4 rounded border border-border`,"aria-label":`Select ${e.issueKey}`})}),(0,K.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-[0.18em]`,children:e.issueKey}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:e.priority}),(0,K.jsx)(`span`,{className:`rounded-full border border-current/20 px-2 py-0.5 text-xs`,children:e.readiness})]}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>t&&Et(t),className:`mt-2 text-left text-base font-semibold underline-offset-4 hover:underline`,"data-testid":`open-issue-${e.issueKey}`,children:e.title}),e.summary?(0,K.jsx)(`p`,{className:`backlog-overview__card-summary-copy mt-2 text-sm leading-6 opacity-90`,children:e.summary}):null,n||e.review?(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[n?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>Et(n),className:`rounded-full border border-current/20 px-2.5 py-1 text-left font-semibold opacity-85`,"data-testid":`open-parent-${e.issueKey}`,children:[`Parent `,n.key]}):null,e.review?(0,K.jsxs)(`span`,{className:`rounded-full border border-current/20 px-2.5 py-1 opacity-85`,children:[`Review `,e.review.decision,e.review.openCommentCount>0?` · ${e.review.openCommentCount} open`:``]}):null]}):null,(0,K.jsx)(`div`,{className:`mt-4 rounded-2xl border border-current/15 bg-card/70 p-3 text-current/90`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] opacity-70`,children:`Workspace`}),(0,K.jsx)(`div`,{className:`mt-1 text-sm font-medium`,children:r>0?`${r} linked workspace${r===1?``:`s`}`:`No workspace linked yet`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs opacity-75`,children:r>1?`${r-1} additional link${r-1==1?``:`s`} in details`:r===1?`Open the linked workspace`:`Create or link it when the issue is ready`})]}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:r===0?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>s(_y(Ze.id,e.issueId)),className:`inline-flex h-10 items-center gap-2 rounded-xl border border-current/20 bg-background/70 px-3 text-xs font-semibold`,"data-testid":`create-workspace-${e.issueKey}`,children:[(0,K.jsx)(Ap,{className:`h-3.5 w-3.5`}),`Create workspace`]}):(0,K.jsx)(K.Fragment,{children:i?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>G(i.workspacePath),className:`inline-flex h-10 items-center gap-2 rounded-xl border border-current/20 bg-background/70 px-3 text-xs font-semibold`,"data-testid":`open-linked-workspace-${e.issueKey}`,children:[(0,K.jsx)(ip,{className:`h-3.5 w-3.5`}),`Open workspace`]}):null})})]})}),o?(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,K.jsxs)(`button`,{type:`button`,disabled:k===e.issueId,onClick:()=>Ct(e.issueId,o.state),className:`inline-flex h-11 items-center justify-center gap-2 rounded-xl border border-primary/25 bg-primary/10 px-4 text-xs font-semibold tracking-[0.04em] text-primary transition-all duration-200 hover:border-primary/40 hover:bg-primary/15 hover:shadow-sm disabled:pointer-events-none disabled:opacity-50`,"data-testid":`move-${e.issueKey}-${o.state}`,children:[(0,K.jsx)(Af,{className:`h-3.5 w-3.5`}),`Move to `,ny(o.state)]}),c.length>0?(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background/70 px-3 py-1.5 text-xs text-foreground-muted`,children:[`+`,c.length,` more move`,c.length===1?``:`s`,` in details`]}):null]}):null,f?(0,K.jsxs)(`details`,{className:`backlog-overview__card-details mt-4`,children:[(0,K.jsxs)(`summary`,{className:`backlog-overview__card-summary`,children:[(0,K.jsx)(`span`,{children:`More details`}),(0,K.jsxs)(`span`,{children:[e.dependencyCount,` dep`,e.dependencyCount===1?``:`s`,` · `,e.childCount,` child`,e.childCount===1?``:`ren`]})]}),(0,K.jsxs)(`div`,{className:`backlog-overview__card-details-body`,children:[l?(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:`Workspace options`}),r>0?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(t?.workspaceLinks??[]).map(t=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>G(t.workspacePath),className:`rounded-full border border-current/20 bg-background/70 px-3 py-1.5 text-left text-xs`,"data-testid":`card-workspace-${e.issueKey}-${t.workspaceName}`,children:[(0,K.jsx)(`span`,{className:`font-semibold`,children:t.workspaceName}),(0,K.jsx)(`span`,{className:`ml-2 opacity-75`,children:yy(t)})]},`${e.issueId}-${t.workspacePath}`))}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[i?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>G(i.workspacePath),className:`inline-flex h-10 items-center gap-2 rounded-xl border border-current/20 bg-background/70 px-3 text-xs font-semibold`,"data-testid":`open-linked-workspace-details-${e.issueKey}`,children:[(0,K.jsx)(ip,{className:`h-3.5 w-3.5`}),`Open workspace`]}):null,r===0?(0,K.jsxs)(`button`,{type:`button`,onClick:()=>t&&Et(t),className:`inline-flex h-10 items-center gap-2 rounded-xl border border-border bg-background px-3 text-xs font-semibold text-foreground transition-all duration-200 hover:border-primary/30 hover:bg-card hover:shadow-sm`,"data-testid":`link-existing-${e.issueKey}`,children:[(0,K.jsx)(gp,{className:`h-3.5 w-3.5`}),`Link existing workspace`]}):(0,K.jsxs)(`button`,{type:`button`,onClick:()=>t&&Et(t),className:`inline-flex h-10 items-center gap-2 rounded-xl border border-border bg-background px-3 text-xs font-semibold text-foreground transition-all duration-200 hover:border-primary/30 hover:bg-card hover:shadow-sm`,"data-testid":`manage-workspaces-${e.issueKey}`,children:[(0,K.jsx)(gp,{className:`h-3.5 w-3.5`}),`Manage workspace links`]})]})]}):null,(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Dependencies`}),(0,K.jsx)(`div`,{className:`mt-1`,children:e.dependencyCount})]}),(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Child issues`}),(0,K.jsx)(`div`,{className:`mt-1`,children:e.childCount})]}),(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:`Acceptance`}),(0,K.jsxs)(`div`,{className:`mt-1`,children:[e.acceptanceProgress.satisfied,`/`,e.acceptanceProgress.total,` accepted`]})]})]}),ge&&e.policySignals.length>0?(0,K.jsx)(`div`,{className:`space-y-2`,children:e.policySignals.map((t,n)=>(0,K.jsx)(`div`,{className:`rounded-xl border border-current/15 bg-card/70 px-3 py-2 text-xs`,children:t.message},`${e.issueId}-${t.hookId}-${n}`))}):null,ge&&e.moveTargets.some(e=>e.signals.length>0)?(0,K.jsx)(`div`,{className:`space-y-2`,children:e.moveTargets.flatMap(t=>t.signals.map((n,r)=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-background px-3 py-2 text-xs text-foreground-muted`,children:[ny(t.state),`: `,n.message]},`${e.issueId}-${t.state}-${n.hookId}-${r}`)))}):null,c.length>0?(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:`Alternate moves`}),(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:c.map(t=>(0,K.jsxs)(`button`,{type:`button`,disabled:k===e.issueId,onClick:()=>Ct(e.issueId,t.state),className:`inline-flex h-10 items-center justify-center gap-2 rounded-xl border border-border bg-background px-3 text-xs font-semibold text-foreground transition-all duration-200 hover:border-primary/30 hover:bg-card hover:shadow-sm disabled:pointer-events-none disabled:opacity-50`,"data-testid":`move-secondary-${e.issueKey}-${t.state}`,children:[(0,K.jsx)(Af,{className:`h-3.5 w-3.5`}),`Move to `,ny(t.state)]},`${e.issueId}-${t.state}`))})]}):null,(0,K.jsx)(Uy,{card:e,mutating:k===e.issueId||A===e.issueId,onLinkRepository:g,onUpdateRepositorySettings:_,onCreatePullRequest:v}),(0,K.jsx)(Vy,{card:e,project:Ze,activityEntries:u.issues.find(t=>t.id===e.issueId)?.activity??[],mutating:k===e.issueId||A===e.issueId,onSave:S})]})]}):null]},e.issueId)})]})]},`${e.id}-${t}`):null})})]},e.id))}):(0,K.jsxs)(`div`,{className:`backlog-overview__list space-y-4`,"data-testid":`kanban-list`,children:[(0,K.jsx)(`div`,{className:`rounded-3xl border border-border bg-background/70 p-4`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`List view`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Shared issue inventory in linear order`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[U.length,` cards`]})]})}),U.map(e=>Iy(e,Xe.get(e.issueId),F===e.issueId||I===e.issueKey,Et,ve.includes(e.issueId),xt,Ct,k,ge))]})]}),H&&et?(0,K.jsx)(Wy,{issue:H,card:$e,reviewArtifact:ee.get(H.id),project:Ze,issues:u.issues.filter(e=>e.projectId===Ze.id),dispatchContextLabels:u.dispatchContextLabels??[],taskTags:l,loading:p,mutating:A===H.id,mutationError:M,draft:et,fieldStates:Re,priorityEditing:Ve,assigneeEditing:Ue,labelEditing:Ge,onFocusIssue:Et,onOpenDedicatedPage:e=>s(my(e.projectId,e.id)),onClose:Dt,onChangeDraft:ht,onResetDraft:_t,onRetryDescriptionSave:()=>void vt(`description`),onSaveField:e=>void vt(e),onSetPriorityEditing:He,onSetAssigneeEditing:We,onSetLabelEditing:Ke,onResetField:gt,onCreateSubIssue:w,onLinkChildIssue:T,onSaveDispatchContextLabels:C,workspaceInventory:qe,onRefreshWorkspaceInventory:Ot,onCreateIssueWorkspace:kt,onLinkIssueWorkspace:O,onOpenWorkspacePath:G}):Te?(0,K.jsx)(Fy,{draft:V,project:Ze,issues:u.issues.filter(e=>e.projectId===Ze.id),taskTags:l,autosaveStatus:Oe,creatingIssue:j,error:Ae,validationError:Me,onChange:e=>{Ne(null),je(null),De(t=>e(t))},onClose:mt,onSubmit:()=>void yt()}):null]}),(0,K.jsxs)(`details`,{className:`backlog-overview__support-details`,children:[(0,K.jsxs)(`summary`,{className:`backlog-overview__support-summary`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Supporting context`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Board notes and shared settings`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Keep the board primary. Open this only when you need project-wide notes, repository settings, or collaboration rules.`})]}),(0,K.jsxs)(`div`,{className:`backlog-overview__support-badges`,children:[tt?(0,K.jsx)(`span`,{className:`rounded-full border border-primary/25 bg-primary/10 px-3 py-1 text-xs font-semibold text-primary`,children:tt.key}):null,(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[Ze.repositories.length,` repos`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[Qe.policyHooks.length,` policies`]})]})]}),(0,K.jsxs)(`div`,{className:`backlog-overview__support-body`,children:[tt?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-primary/25 bg-primary/10 px-2.5 py-1 text-xs font-semibold text-primary`,children:tt.key}),(0,K.jsx)(`span`,{className:`text-sm font-semibold text-foreground`,children:tt.title}),(0,K.jsx)(`span`,{className:`text-sm text-foreground-muted`,children:tt.status})]}),tt.summary?(0,K.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-foreground-muted`,children:tt.summary}):null,(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:tt.acceptanceCriteria.map(e=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border bg-card px-2.5 py-1 text-xs text-foreground-secondary`,children:[(0,K.jsx)(Vf,{className:`h-3.5 w-3.5`}),e.title]},e.id))})]}):null,Ze.repositories.length>0?(0,K.jsxs)(`div`,{className:`rounded-3xl border border-border bg-background p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Repository context`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Shared repository settings`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1 text-xs text-foreground-muted`,children:[Ze.repositories.length,` linked repos`]})]}),(0,K.jsx)(`div`,{className:`mt-4 grid gap-3 xl:grid-cols-2`,children:Ze.repositories.map(e=>(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-card p-4`,"data-testid":`repository-context-${e.id}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-semibold text-foreground`,children:[(0,K.jsx)(ip,{className:`h-4 w-4`}),e.fullName]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-xs text-foreground-muted`,children:ay(e.provider)})]}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Base `,e.settings.baseBranch]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`CI `,e.settings.ciProvider??`Unconfigured`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[`Publish `,e.settings.publishTarget??`Unconfigured`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2.5 py-1`,children:[e.settings.requiredApprovals,` approvals`]})]})]},e.id))})]}):null,(0,K.jsx)(By,{project:Ze,mutating:!!A,onSave:x}),Qe.policyHooks.length>0?(0,K.jsx)(`div`,{className:`backlog-overview__policy-strip mt-5 flex flex-wrap gap-2`,children:Qe.policyHooks.map(e=>(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[(0,K.jsx)(Vp,{className:`h-3.5 w-3.5`}),e.name]},e.id))}):null]})]}),(0,K.jsxs)(`details`,{className:`backlog-overview__support-details mt-6`,"data-testid":`board-review-details`,children:[(0,K.jsxs)(`summary`,{className:`backlog-overview__support-summary`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.2em] text-foreground-muted`,children:`Review queue`}),(0,K.jsx)(`h3`,{className:`mt-1 text-lg font-semibold text-foreground`,children:`Issue diff and feedback loop`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`Keep comments and approvals available, but out of the main board until you explicitly open them.`})]}),(0,K.jsxs)(`div`,{className:`backlog-overview__support-badges`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[P.artifacts.length,` reviews`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border bg-background px-3 py-1 text-xs text-foreground-muted`,children:[(P.summary?.pendingCount??0)+(P.summary?.changesRequestedCount??0),` waiting`]})]})]}),(0,K.jsx)(`div`,{className:`backlog-overview__support-body`,children:(0,K.jsx)(Qv,{title:`Issue diff and feedback loop`,description:`Review, comments, and approval state for issues stay together here.`,empty:`No issue reviews are queued yet.`,loading:P.loading,error:P.error,artifacts:P.artifacts,queue:P.queue,summary:P.summary,pendingArtifactId:P.pendingArtifactId,onApprove:e=>P.actOnReview({action:`approve`,artifactId:e}).then(()=>N()),onRequestChanges:e=>P.actOnReview({action:`request-changes`,artifactId:e}).then(()=>N()),onSubmitReview:e=>P.actOnReview({action:`submit-review`,...e}).then(()=>N()),onAddComment:e=>P.actOnReview({action:`add-comment`,...e}).then(()=>N())})})]})]})}async function Ky(e,t,n){let r=n.trim();if(!e||!t||!r)return{success:!1,error:`Run ID, effect ID, and answer are required`};let i=await Pm(`/api/runs/${encodeURIComponent(e)}/tasks/${encodeURIComponent(t)}/approve`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({answer:r}),retries:0});return i.ok?i.data.success===!0?{success:!0}:{success:!1,error:i.data.error??`Breakpoint approval failed`}:{success:!1,error:i.error.message}}var qy=2e4,Jy=12e4,Yy=`kanban:dismissed-breakpoints`;function Xy({bp:e,stale:t,onDismiss:n}){let[r,i]=(0,b.useTransition)(),[a,o]=(0,b.useState)(null);return a?.ok?(0,K.jsxs)(`div`,{className:q(`group relative flex items-center gap-3 px-4 py-3 rounded-lg`,`bg-success-muted border border-success/30`),children:[(0,K.jsx)(Vf,{className:`h-5 w-5 text-success shrink-0`}),(0,K.jsxs)(`span`,{className:`text-sm text-success font-medium`,children:[`Approved — `,e.projectName]})]}):(0,K.jsxs)(`div`,{className:q(`group relative flex items-center gap-3 px-4 py-3 rounded-lg`,`bg-warning-muted border border-warning/30`,`shadow-breakpoint-glow animate-breakpoint-glow`,t&&`opacity-70`),children:[(0,K.jsxs)(G,{to:`/dispatches/${e.runId}`,className:`flex items-center gap-3 flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,K.jsx)(lp,{className:`h-5 w-5 text-warning animate-pulse-dot`}),(0,K.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 h-2 w-2 rounded-full bg-warning animate-ping`})]}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,K.jsx)($p,{className:`h-3 w-3 text-warning shrink-0`}),(0,K.jsx)(`span`,{className:`text-xs font-bold text-warning uppercase tracking-wider`,children:`Approval Needed`}),t&&(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted italic`,"data-testid":`staleness-indicator`,children:`(checking...)`}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted font-medium`,children:e.projectName}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-info`,children:e.runId.slice(0,8)})]}),(0,K.jsx)(`p`,{className:`text-sm text-foreground truncate`,children:e.breakpointQuestion})]})]}),(0,K.jsxs)(`button`,{onClick:t=>{t.preventDefault(),t.stopPropagation(),i(()=>{Ky(e.runId,e.effectId,`Approved from dashboard`).then(e=>{o(e.success?{ok:!0}:{ok:!1,msg:e.error})})})},disabled:r||!e.effectId,className:q(`shrink-0 flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold`,`bg-success/20 text-success border border-success/30`,`hover:bg-success/30 hover:border-success/50`,`disabled:opacity-50 disabled:cursor-not-allowed`,`transition-colors`),title:`Approve this breakpoint`,children:[(0,K.jsx)(Ff,{className:`h-3.5 w-3.5`}),r?`Approving...`:`Approve`]}),t&&n&&(0,K.jsx)(`button`,{onClick:e=>{e.preventDefault(),e.stopPropagation(),n()},className:q(`shrink-0 p-1 rounded text-foreground-muted/50`,`hover:text-foreground-muted hover:bg-foreground-muted/10`,`transition-colors`),title:`Dismiss this stale breakpoint`,"data-testid":`dismiss-breakpoint`,children:(0,K.jsx)(sm,{className:`h-3.5 w-3.5`})}),a&&!a.ok&&(0,K.jsx)(`span`,{className:`text-xs text-error ml-2`,children:a.msg})]})}function Zy({breakpointRuns:e}){let[t,n]=(0,b.useState)([]),r=(0,b.useRef)(new Map),i=(0,b.useRef)(new Map),[a,o]=(0,b.useState)(new Set);(0,b.useLayoutEffect)(()=>{try{let e=localStorage.getItem(Yy);e&&o(new Set(JSON.parse(e)))}catch{}},[]);let s=(0,b.useCallback)(e=>{o(t=>{let n=new Set(t);n.add(e);try{localStorage.setItem(Yy,JSON.stringify([...n]))}catch{}return n})},[]);(0,b.useEffect)(()=>{let t=new Set(e.map(e=>e.runId));o(e=>{let n=new Set([...e].filter(e=>t.has(e)));if(n.size!==e.size){try{localStorage.setItem(Yy,JSON.stringify([...n]))}catch{}return n}return e})},[e]);let[,c]=(0,b.useState)(0);(0,b.useEffect)(()=>{let t=new Set(e.map(e=>e.runId)),a=Date.now(),o=[];for(let[e,n]of r.current)t.has(e)||(o.push({bp:n,resolvedAt:a}),i.current.delete(e));o.length>0&&n(e=>[...e,...o]);for(let t of e)i.current.has(t.runId)||i.current.set(t.runId,a);r.current=new Map(e.map(e=>[e.runId,e]))},[e]),(0,b.useEffect)(()=>{if(e.length===0)return;let t=setInterval(()=>{c(e=>e+1)},1e4);return()=>clearInterval(t)},[e.length]);let l=(0,b.useCallback)(e=>{let t=i.current.get(e);return t?Date.now()-t>Jy:!1},[]);(0,b.useEffect)(()=>{if(t.length===0)return;let e=setInterval(()=>{let e=Date.now();n(t=>t.filter(t=>e-t.resolvedAt<qy))},1e3);return()=>clearInterval(e)},[t.length]);let u=e.filter(e=>!a.has(e.runId)),d=u.length>0,f=t.length>0;return!d&&!f?null:(0,K.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,"aria-atomic":`true`,className:`flex flex-col gap-2 mb-6`,"data-testid":`breakpoint-banner`,children:[u.map(e=>(0,K.jsx)(Xy,{bp:e,stale:l(e.runId),onDismiss:()=>s(e.runId)},e.runId)),t.map(e=>(0,K.jsxs)(G,{to:`/dispatches/${e.bp.runId}`,className:q(`group relative flex items-center gap-3 px-4 py-3 rounded-lg`,`bg-success-muted border border-success/30`,`shadow-glow-success`,`hover:border-success/50`,`transition-colors cursor-pointer`),children:[(0,K.jsx)(`div`,{className:`relative shrink-0`,children:(0,K.jsx)(Vf,{className:`h-5 w-5 text-success`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,K.jsx)(Vf,{className:`h-3 w-3 text-success shrink-0`}),(0,K.jsx)(`span`,{className:`text-xs font-bold text-success uppercase tracking-wider`,children:`Approved`}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted font-medium`,children:e.bp.projectName}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-info`,children:e.bp.runId.slice(0,8)})]}),(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted truncate`,children:e.bp.breakpointQuestion})]})]},`resolved-${e.bp.runId}`)),u.length>1&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1`,children:[(0,K.jsx)(lp,{className:`h-3.5 w-3.5 text-warning`}),(0,K.jsxs)(`span`,{className:`text-xs font-semibold text-warning`,children:[u.length,` approvals pending`]})]})]})}function Qy(e){if(!e)return null;let t=[];return e.failedRuns>0&&t.push(`${e.failedRuns} failed`),e.pendingBreakpoints>0&&t.push(`${e.pendingBreakpoints} awaiting input`),e.completedRuns>0&&t.push(`${e.completedRuns} completed`),t.length===0?null:t.join(`, `)}function $y({catchUp:e,summary:t}){if(!e.active)return null;let n=Qy(t);return(0,K.jsxs)(`div`,{"data-testid":`catch-up-banner`,className:q(`flex items-center gap-3 px-4 py-2.5 mb-4 rounded-lg`,`bg-info-muted border border-info/20`,`animate-in fade-in slide-in-from-top-2 duration-300`),children:[(0,K.jsx)(`div`,{className:`rounded-md p-1.5 bg-info/10`,children:(0,K.jsx)(dp,{className:`h-4 w-4 text-info`})}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`p`,{className:`text-sm text-foreground`,children:[(0,K.jsx)(`span`,{className:`font-semibold tabular-nums`,children:e.bufferedCount}),` `,`runs updated while you were away`]}),n&&(0,K.jsx)(`p`,{"data-testid":`catch-up-summary`,className:`text-xs text-foreground-muted mt-0.5 truncate`,children:n})]}),(0,K.jsxs)(`button`,{onClick:e.flush,"data-testid":`catch-up-refresh-btn`,className:q(`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold`,`bg-info/10 border border-info/20 text-info`,`hover:bg-info/20 transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-info/50`),children:[(0,K.jsx)(Pp,{className:`h-3 w-3`}),`Refresh now`]})]})}function eb(e){let t=[],n=`healthy`;if(e.failedRuns>0&&(t.push({text:`${e.failedRuns} run${e.failedRuns===1?``:`s`} failing`,filter:`failed`}),n=`red`),e.pendingBreakpoints>0&&(t.push({text:`${e.pendingBreakpoints} approval${e.pendingBreakpoints===1?``:`s`} need${e.pendingBreakpoints===1?`s`:``} your attention`,filter:`waiting`}),n!==`red`&&(n=`amber`)),e.staleRuns>0&&(t.push({text:`${e.staleRuns} stale run${e.staleRuns===1?``:`s`}`,filter:`stale`}),n!==`red`&&(n=`amber`)),t.length===0){let t=e.totalProjects===1?`project`:`projects`;return{severity:`healthy`,issues:[{text:e.activeRuns>0?`All ${e.totalProjects} ${t} healthy \u2014 ${e.activeRuns} run${e.activeRuns===1?``:`s`} in progress`:`All ${e.totalProjects} ${t} healthy`,filter:null}],icon:(0,K.jsx)(Vf,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`})}}return{severity:n,issues:t,icon:n===`red`?(0,K.jsx)(Uf,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}):(0,K.jsx)($p,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`})}}var tb={healthy:{container:`border-success/25 bg-success-muted shadow-neon-glow-success-sm`,text:`text-success`,iconColor:`text-success`},amber:{container:`border-warning/25 bg-warning-muted shadow-neon-glow-warning-sm`,text:`text-warning`,iconColor:`text-warning`},red:{container:`border-error/25 bg-error-muted shadow-neon-glow-error-sm`,text:`text-error`,iconColor:`text-error`}};function nb({metrics:e,onFilterChange:t,dismissed:n,onDismiss:r}){let i=(0,b.useMemo)(()=>eb(e),[e]),a=tb[i.severity];return n?null:(0,K.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,"data-testid":`executive-summary-banner`,className:q(`flex items-center gap-2.5 rounded-xl border px-4 py-3 mb-6 shadow-sm transition-all duration-300`,a.container),children:[(0,K.jsx)(`span`,{className:a.iconColor,children:i.icon}),(0,K.jsx)(`p`,{className:q(`text-sm font-medium leading-snug flex-1`,a.text),children:i.issues.map((e,n)=>(0,K.jsxs)(`span`,{children:[n>0&&`, `,e.filter&&t?(0,K.jsx)(`button`,{onClick:()=>t(e.filter),className:`underline decoration-dotted underline-offset-2 hover:decoration-solid transition-all`,children:e.text}):e.text]},n))}),i.severity!==`healthy`&&r&&(0,K.jsx)(`button`,{"data-testid":`executive-summary-dismiss`,onClick:r,className:q(`rounded-md p-1.5 min-h-[44px] min-w-[44px] flex items-center justify-center transition-colors`,a.iconColor,`opacity-60 hover:opacity-100`),"aria-label":`Dismiss banner`,children:(0,K.jsx)(sm,{className:`h-3.5 w-3.5`})})]})}function rb(){let e=Be(),[t,n]=(0,b.useState)(``),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)([]),[s,c]=(0,b.useState)(!1),[l,u]=(0,b.useState)(!1),[d,f]=(0,b.useState)(-1),[p,m]=(0,b.useState)(!1),h=(0,b.useRef)(null),g=(0,b.useRef)(null),_=(0,b.useRef)(null);(0,b.useEffect)(()=>{let e=setTimeout(()=>{i(t.trim())},300);return()=>clearTimeout(e)},[t]),(0,b.useEffect)(()=>{if(!r){o([]),m(!1),f(-1);return}let e=!1;async function t(){u(!0);try{let t=new URLSearchParams({search:r,limit:`10`}),n=await fetch(`/api/runs?${t}`);if(!n.ok)throw Error(`Search failed`);let i=await n.json();e||(o(i.runs??[]),m(!0),f(-1))}catch{e||(o([]),m(!0))}finally{e||u(!1)}}return t(),()=>{e=!0}},[r]);let v=(0,b.useCallback)(t=>{c(!1),n(``),o([]),m(!1),e(`/dispatches/${t}`)},[e]),y=(0,b.useCallback)(e=>{if(s)switch(e.key){case`ArrowDown`:e.preventDefault(),f(e=>e<a.length-1?e+1:0);break;case`ArrowUp`:e.preventDefault(),f(e=>e>0?e-1:a.length-1);break;case`Enter`:e.preventDefault(),d>=0&&d<a.length&&v(a[d].runId);break;case`Escape`:e.preventDefault(),c(!1),h.current?.blur();break}},[s,a,d,v]);(0,b.useEffect)(()=>{d>=0&&_.current&&_.current.querySelectorAll(`[data-search-item]`)[d]?.scrollIntoView({block:`nearest`})},[d]),(0,b.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),h.current?.focus(),c(!0)),e.key===`/`&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!(e.target instanceof HTMLInputElement)&&!(e.target instanceof HTMLTextAreaElement)&&!(e.target instanceof HTMLSelectElement)&&!e.target?.isContentEditable&&(e.preventDefault(),h.current?.focus(),c(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,b.useEffect)(()=>{let e=e=>{g.current&&!g.current.contains(e.target)&&c(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let x=s&&t.trim().length>0;return(0,K.jsxs)(`div`,{ref:g,className:`relative w-full max-w-xl mx-auto mb-6`,children:[(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(Lp,{className:`absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-foreground-muted pointer-events-none`}),(0,K.jsx)(`input`,{ref:h,type:`text`,value:t,onChange:e=>{n(e.target.value),c(!0)},onFocus:()=>{t.trim()&&c(!0)},onKeyDown:y,placeholder:`Search runs by ID, process name, or task title...`,className:q(`w-full rounded-lg border border-border bg-card/80 backdrop-blur-sm`,`pl-10 pr-20 py-2.5 text-sm text-foreground`,`placeholder:text-foreground-muted/60`,`focus:border-primary/40 focus:outline-none focus:ring-2 focus:ring-primary/30`,`focus:shadow-neon-glow-primary-focus transition-all`),"data-testid":`global-search-input`}),(0,K.jsxs)(`div`,{className:`absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1.5`,children:[t&&(0,K.jsx)(`button`,{onClick:()=>{n(``),o([]),m(!1),c(!1),h.current?.focus()},className:`rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary transition-colors`,"aria-label":`Clear search`,children:(0,K.jsx)(sm,{className:`h-3.5 w-3.5`})}),(0,K.jsxs)(`kbd`,{className:`hidden sm:inline-flex items-center gap-0.5 rounded border border-border bg-background-secondary px-1.5 py-0.5 text-xs font-medium text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`text-xs`,children:typeof navigator<`u`&&/Mac/i.test(navigator.userAgent)?`⌘`:`Ctrl`}),(0,K.jsx)(`span`,{children:`K`})]})]})]}),x&&(0,K.jsxs)(`div`,{className:q(`absolute z-50 top-full left-0 right-0 mt-1.5`,`rounded-lg border border-border bg-card/95 backdrop-blur-md shadow-xl`,`overflow-hidden`),"data-testid":`global-search-dropdown`,children:[l&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`h-3 w-3 rounded-full border-2 border-primary/40 border-t-primary animate-spin`}),`Searching...`]}),!l&&p&&a.length===0&&(0,K.jsxs)(`div`,{className:`px-4 py-6 text-center`,children:[(0,K.jsx)(Lp,{className:`h-5 w-5 text-foreground-muted/30 mx-auto mb-2`}),(0,K.jsxs)(`p`,{className:`text-xs text-foreground-muted`,children:[`No dispatches found for “`,r,`”`]})]}),!l&&a.length>0&&(0,K.jsx)(`ul`,{ref:_,className:`max-h-80 overflow-y-auto py-1`,role:`listbox`,children:a.map((e,t)=>(0,K.jsxs)(`li`,{"data-search-item":!0,role:`option`,"aria-selected":t===d,onClick:()=>v(e.runId),className:q(`flex items-center gap-3 px-4 py-2.5 cursor-pointer transition-colors`,t===d?`bg-primary/10`:`hover:bg-background-secondary/60`),children:[(0,K.jsx)(`span`,{className:q(`h-2 w-2 rounded-full shrink-0`,e.status===`completed`?`bg-success`:e.status===`failed`?`bg-error`:e.status===`waiting`||e.status===`pending`?`bg-warning`:`bg-foreground-muted`)}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-foreground truncate`,children:r_(e.processId)}),(0,K.jsx)(Lg,{status:e.status,waitingKind:e.waitingKind,isStale:e.isStale})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[e.projectName&&(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:e.projectName}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-info`,children:n_(e.runId,8)})]})]}),(0,K.jsx)(Af,{className:q(`h-3.5 w-3.5 shrink-0 transition-colors`,t===d?`text-primary`:`text-foreground-muted/40`)})]},e.runId))})]})]})}function ib(e,t=600){let[n,r]=(0,b.useState)(e),i=(0,b.useRef)(null),a=(0,b.useRef)(null),o=(0,b.useRef)(e),s=(0,b.useRef)(e),c=(0,b.useCallback)(e=>1-(1-e)**3,[]);return(0,b.useEffect)(()=>{let n=o.current;if(o.current=e,n===e)return;i.current!==null&&(cancelAnimationFrame(i.current),i.current=null);let l=s.current,u=e-l;if(u===0){r(e),s.current=e;return}if(Math.abs(u)<=2){r(e),s.current=e;return}let d=performance.now();a.current={value:l,time:d};function f(n){let a=n-d,o=Math.min(a/t,1),p=c(o),m=Math.round(l+u*p);s.current=m,r(m),o<1?i.current=requestAnimationFrame(f):(i.current=null,s.current=e,r(e))}return i.current=requestAnimationFrame(f),()=>{i.current!==null&&(cancelAnimationFrame(i.current),i.current=null)}},[e,t,c]),n}var ab={primary:{text:`text-primary`,bg:`bg-primary/10`,glow:`shadow-neon-glow-primary-xs`,borderL:``,ring:`ring-primary/50`},success:{text:`text-success`,bg:`bg-success/10`,glow:`shadow-neon-glow-success-sm`,borderL:`border-l-success/60`,ring:`ring-success/50`},warning:{text:`text-warning`,bg:`bg-warning/10`,glow:`shadow-neon-glow-warning-sm`,borderL:`border-l-warning/60`,ring:`ring-warning/50`},error:{text:`text-error`,bg:`bg-error/10`,glow:`shadow-neon-glow-error-sm`,borderL:`border-l-error/60`,ring:`ring-error/50`},muted:{text:`text-zinc-500`,bg:`bg-zinc-500/10`,glow:``,borderL:`border-l-zinc-500/60`,ring:`ring-zinc-500/50`}};function ob({label:e,value:t,icon:n,color:r,pulse:i,testId:a,active:o,onClick:s}){let c=ab[r],l=!!s,u=ib(t);return(0,K.jsxs)(`div`,{"data-testid":a,role:l?`button`:void 0,"aria-pressed":l?!!o:void 0,tabIndex:l?0:void 0,onClick:s,onKeyDown:l?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s?.())}:void 0,className:q(`rounded-xl border border-border bg-card/90 p-3 flex items-center gap-3 transition-all shadow-sm`,t>0&&r!==`primary`&&`border-l-2`,t>0&&r!==`primary`&&c.borderL,c.glow,l&&`cursor-pointer hover:bg-background-secondary/65 hover:shadow-md`,o&&`ring-2`,o&&c.ring),children:[(0,K.jsx)(`div`,{className:q(`rounded-md p-2`,c.bg),children:(0,K.jsx)(`span`,{className:q(c.text,i&&`animate-pulse-dot`),children:n})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:q(`text-lg font-bold tabular-nums leading-none mb-0.5`,c.text),children:u}),(0,K.jsx)(`p`,{className:`text-[11px] leading-tight text-foreground-muted uppercase tracking-[0.12em] font-medium`,children:e})]})]})}function sb({metrics:e,statusFilter:t,hasStaleRuns:n,onToggleFilter:r}){return(0,K.jsxs)(`div`,{"data-testid":`kpi-grid`,"aria-live":`polite`,"aria-label":`Key metrics`,className:q(`grid gap-3 mb-6`,n?`grid-cols-2 sm:grid-cols-5`:`grid-cols-2 sm:grid-cols-4`),children:[(0,K.jsx)(ob,{label:`Total Dispatches`,value:e.totalRuns,icon:(0,K.jsx)(pp,{className:`h-4 w-4`}),color:`primary`,testId:`metric-tile-total-runs`,onClick:()=>r(`all`),active:t===`all`}),(0,K.jsx)(ob,{label:`In Progress`,value:e.activeRuns,icon:(0,K.jsx)(Ef,{className:`h-4 w-4`}),color:`warning`,pulse:e.activeRuns>0,testId:`metric-tile-active`,onClick:()=>r(`waiting`),active:t===`waiting`}),n&&(0,K.jsx)(ob,{label:`Stale`,value:e.staleRuns,icon:(0,K.jsx)(Ep,{className:`h-4 w-4`}),color:`muted`,testId:`metric-tile-stale`,onClick:()=>r(`stale`),active:t===`stale`}),(0,K.jsx)(ob,{label:`Completed`,value:e.completedRuns,icon:(0,K.jsx)(Vf,{className:`h-4 w-4`}),color:`success`,testId:`metric-tile-completed`,onClick:()=>r(`completed`),active:t===`completed`}),(0,K.jsx)(ob,{label:`Failed`,value:e.failedRuns,icon:(0,K.jsx)(Bf,{className:`h-4 w-4`}),color:`error`,testId:`metric-tile-failed`,onClick:()=>r(`failed`),active:t===`failed`})]})}var cb=class extends b.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`ErrorBoundary caught an error:`,e,t)}handleRetry=()=>{this.setState({hasError:!1,error:null})};render(){return this.state.hasError?this.props.section?(0,K.jsxs)(`div`,{className:`rounded-lg border border-error/20 bg-error-muted p-4 text-center`,children:[(0,K.jsxs)(`p`,{className:`text-sm font-medium text-error mb-1`,children:[this.props.section,` failed to load`]}),(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted mb-2`,children:`This section encountered an error. Other sections are unaffected.`}),(0,K.jsx)(J,{onClick:this.handleRetry,size:`sm`,variant:`primary`,children:`Retry`})]}):(0,K.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background p-6`,children:(0,K.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,K.jsx)(`h2`,{className:`mb-2 text-lg font-semibold text-foreground`,children:`Something went wrong`}),(0,K.jsx)(`p`,{className:`mb-4 text-sm text-foreground-muted`,children:`An unexpected error occurred. Please try again.`}),(0,K.jsx)(J,{onClick:()=>window.location.reload(),variant:`primary`,children:`Try Again`})]})}):this.props.children}};function lb({sessionId:e,active:t=!1,className:n}){let[r,i]=(0,b.useState)(!1);return e?(0,K.jsx)($t,{text:r?`Copied!`:`Session: ${e} (click to copy)`,children:(0,K.jsxs)(`span`,{className:q(`relative inline-flex items-center gap-1.5 rounded-full bg-background-secondary px-2.5 py-0.5 text-xs font-mono text-foreground-muted cursor-pointer transition-all hover:bg-background-tertiary select-none`,t&&`shadow-neon-glow-cyan-sm`,n),onClick:t=>{t.stopPropagation(),t.preventDefault(),navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)},children:[(0,K.jsx)(`span`,{className:q(`h-1.5 w-1.5 rounded-full`,t?`bg-secondary shadow-[0_0_6px_var(--secondary)] animate-pulse-dot`:`bg-foreground-muted/40`)}),n_(e,4),r&&(0,K.jsx)(`span`,{className:`absolute -top-7 left-1/2 -translate-x-1/2 rounded-md bg-primary px-2 py-0.5 text-xs leading-tight font-sans font-medium text-primary-foreground whitespace-nowrap animate-slide-in-right`,children:`Copied!`})]})}):null}function ub({id:e,chars:t=4,className:n}){let[r,i]=(0,b.useState)(!1),a=t=>{t.stopPropagation(),t.preventDefault(),navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)};return(0,K.jsx)($t,{text:r?`Copied!`:e,children:(0,K.jsx)(`span`,{className:q(`inline-flex items-center justify-center rounded px-2 py-1 min-h-[44px] min-w-[44px] font-mono text-xs`,`bg-background-secondary text-info/80`,`hover:bg-background-tertiary hover:text-info`,`cursor-pointer transition-colors select-none`,r&&`text-primary`,n),onClick:a,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a(e))},children:n_(e,t)})})}function db(e){switch(e){case`completed`:return`success`;case`failed`:return`error`;case`waiting`:return`warning`;default:return`default`}}function fb(e){return e.status===`completed`?100:e.totalTasks>0?Math.round(e.completedTasks/e.totalTasks*100):0}function pb(e){let t=t_(e);return t?`Stale (${t})`:`Stale`}function mb(e,t){if(e.selected!==t.selected||e.stopping!==t.stopping)return!1;let n=e.run,r=t.run;return n.runId===r.runId&&n.status===r.status&&n.updatedAt===r.updatedAt&&n.completedTasks===r.completedTasks&&n.totalTasks===r.totalTasks&&n.duration===r.duration&&n.isStale===r.isStale&&n.waitingKind===r.waitingKind&&n.breakpointQuestion===r.breakpointQuestion&&n.failedStep===r.failedStep&&n.failureMessage===r.failureMessage}var hb=(0,b.memo)(function({run:e,selected:t,stopping:n=!1,onStop:r}){let i=fb(e),a=e.status===`waiting`||e.status===`pending`,o=e.isStale===!0,s=typeof r==`function`&&a&&!o,c=e.tasks.find(e=>e.kind===`breakpoint`&&e.status===`requested`),l=e.breakpointQuestion??c?.breakpointQuestion,u=!o&&(!!c||e.status===`waiting`&&e.waitingKind===`breakpoint`),d=e.status===`failed`?e.failedStep||(e.failureMessage?`${e.failureMessage}`:void 0):void 0;return(0,K.jsx)(`div`,{className:q(`tkc-panel`,`cursor-pointer p-4 transition-all card-hover-lift`,`hover:shadow-md`,t&&`ring-1 ring-primary shadow-glow-primary`,a&&!o&&!u&&`border-[var(--border-hover)]`,u&&`border-warning/40 shadow-glow-warning ring-1 ring-warning/20 animate-breakpoint-glow`,o&&`opacity-50`),children:(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(G,{to:`/dispatches/${e.runId}`,className:`flex-1 min-w-0 block`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,K.jsx)(`span`,{className:q(`h-2 w-2 rounded-full shrink-0`,o?`bg-zinc-500`:u?`bg-warning shadow-[0_0_8px_var(--warning)] animate-pulse-dot`:e.status===`completed`?`bg-success shadow-[0_0_6px_var(--success)]`:e.status===`failed`?`bg-error shadow-[0_0_6px_var(--error)]`:e.status===`waiting`?`bg-warning shadow-[0_0_6px_var(--warning)] animate-pulse-dot`:`bg-pending`)}),(0,K.jsx)(`span`,{className:`text-lg font-semibold italic font-serif text-foreground truncate`,children:r_(e.processId)}),u&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-warning/15 border border-warning/30 px-2.5 py-1 text-[11px] leading-tight font-bold text-warning uppercase tracking-[0.12em] shrink-0 animate-pulse-dot`,children:[(0,K.jsx)(lp,{className:`h-2.5 w-2.5`}),`Approval Required`]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap mb-1`,children:[(0,K.jsx)(Lg,{status:e.status,waitingKind:e.waitingKind,isStale:o}),o&&(0,K.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-zinc-500/10 border border-zinc-500/20 px-2 py-0.5 text-xs leading-tight font-medium text-zinc-500 shrink-0`,children:pb(e.updatedAt)}),(0,K.jsx)(ub,{id:e.runId,chars:4,className:`text-foreground-secondary`}),e.projectName&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-background-secondary px-2 py-0.5 text-xs leading-tight font-medium text-foreground-muted shrink-0`,children:[(0,K.jsx)(Xp,{className:`h-2.5 w-2.5`}),e.projectName]})]}),d&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-2 px-2 py-1 rounded-md bg-error-muted border border-error/20 border-l-2 border-l-error shadow-glow-error`,children:[(0,K.jsx)(Bf,{className:`h-3.5 w-3.5 text-error shrink-0`}),(0,K.jsxs)(`span`,{className:`text-xs text-error truncate`,children:[`Failed at: `,d.length>80?d.slice(0,80)+`...`:d]})]}),u&&l&&(0,K.jsx)(`div`,{className:`mt-2 px-3 py-2 rounded-md bg-warning-muted border border-warning/25 border-l-2 border-l-warning shadow-breakpoint-glow`,children:(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(lp,{className:`h-4 w-4 text-warning shrink-0 mt-0.5 animate-pulse-dot`}),(0,K.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,K.jsx)(`span`,{className:`text-xs font-bold text-warning uppercase tracking-wider block mb-0.5`,children:`Awaiting approval`}),(0,K.jsx)(`span`,{className:`text-sm text-foreground leading-snug block`,children:l})]}),(0,K.jsxs)(`span`,{className:q(`shrink-0 inline-flex items-center gap-1 px-2 py-1 rounded-md`,`bg-warning/10 border border-warning/20`,`text-xs font-semibold text-warning`,`hover:bg-warning/20 transition-colors`),children:[`Review & Approve`,(0,K.jsx)(Xf,{className:`h-2.5 w-2.5`})]})]})}),u&&!l&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 px-3 py-2 rounded-md bg-warning-muted border border-warning/25 border-l-2 border-l-warning shadow-breakpoint-glow`,children:[(0,K.jsx)(lp,{className:`h-4 w-4 text-warning shrink-0 animate-pulse-dot`}),(0,K.jsx)(`span`,{className:`text-xs font-semibold text-warning`,children:`Approval needed`}),(0,K.jsxs)(`span`,{className:q(`ml-auto shrink-0 inline-flex items-center gap-1 px-2 py-1 rounded-md`,`bg-warning/10 border border-warning/20`,`text-xs font-semibold text-warning`),children:[`Review & Approve`,(0,K.jsx)(Xf,{className:`h-2.5 w-2.5`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(lb,{sessionId:e.sessionId,active:a&&!o}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(pp,{className:`h-3 w-3`}),e.completedTasks,`/`,e.totalTasks,` tasks`]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Kf,{className:`h-3 w-3`}),e_(e.duration)]})]}),e.totalTasks>0&&(0,K.jsx)(Sm,{value:i,variant:db(e.status),glow:a&&!o,className:`mt-4`})]}),s?(0,K.jsxs)(`button`,{type:`button`,"aria-label":`Stop dispatch ${e.runId}`,disabled:n,onClick:t=>{t.preventDefault(),t.stopPropagation(),r?.(e)},className:q(`inline-flex min-h-[40px] shrink-0 items-center gap-1 rounded-md border px-3 py-2 text-xs font-semibold transition-colors`,n?`cursor-wait border-warning/30 bg-warning/10 text-warning`:`border-error/25 bg-error/8 text-error hover:bg-error/14`),title:n?`Stopping dispatch`:`Stop dispatch`,children:[n?(0,K.jsx)(vp,{className:`h-3.5 w-3.5 animate-spin`}):(0,K.jsx)(Jp,{className:`h-3.5 w-3.5`}),n?`Stopping`:`Stop`]}):null]})})},mb);function gb(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o;n.key&&n.debug?.call(n)&&(o=Date.now());let s=e();if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug?.call(n)&&(c=Date.now()),i=t(...s),n.key&&n.debug?.call(n)){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
29
+ font-size: .6rem;
30
+ font-weight: bold;
31
+ color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i}return o.updateDeps=e=>{r=e},o}function _b(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var vb=(e,t)=>Math.abs(e-t)<1.01,yb=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},bb=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},xb=e=>e,Sb=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=n;e++)r.push(e);return r},Cb=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(bb(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(bb(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},wb={passive:!0},Tb=typeof window>`u`?!0:`onscrollend`in window,Eb=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,a=e.options.useScrollendEvent&&Tb?()=>void 0:yb(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),o=r=>()=>{let{horizontal:o,isRtl:s}=e.options;i=o?n.scrollLeft*(s&&-1||1):n.scrollTop,a(),t(i,r)},s=o(!0),c=o(!1);n.addEventListener(`scroll`,s,wb);let l=e.options.useScrollendEvent&&Tb;return l&&n.addEventListener(`scrollend`,c,wb),()=>{n.removeEventListener(`scroll`,s),l&&n.removeEventListener(`scrollend`,c)}},Db=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Ob=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;let o=e+t;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:o,behavior:n})},kb=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{n===void 0&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:xb,rangeExtractor:Sb,onChange:()=>{},measureElement:Db,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,...e}},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=gb(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=gb(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=gb(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);let l=this.measurementsCache.slice(0,c),u=Array(a).fill(void 0);for(let e=0;e<c;e++){let t=l[e];t&&(u[t.lane]=e)}for(let i=c;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),c,d,f=o===`estimate`||s.has(e);if(a!==void 0&&this.options.lanes>1){c=a;let e=u[c],r=e===void 0?void 0:l[e];d=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?l[i-1]:this.getFurthestMeasurement(l,i);d=e?e.end+this.options.gap:t+n,c=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,c)}let p=s.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=d+m;l[i]={index:i,start:d,size:m,end:h,key:e,lane:c},u[c]=i}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=gb(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?jb({measurements:e,outerSize:t,scrollOffset:n,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=gb(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{let n=this.measurementsCache[e];if(!n)return;let r=t-(this.itemSizeCache.get(n.key)??n.size);r!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?n.start<this.getScrollOffset()+this.scrollAdjustments:this.shouldAdjustScrollPositionOnItemSizeChange(n,r,this))&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,t)),this.notify(!1))},this.getVirtualItems=gb(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length!==0)return _b(t[Ab(0,t.length-1,e=>_b(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=e[e.length-1]?.end??0;else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&vb(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.scrollState=null;return}}else this.scrollState.stableFrames=0,n&&(this.scrollState.lastTargetOffset=t,this.scrollState.behavior=`auto`,this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}));this.scheduleScrollReconcile()}},Ab=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function jb({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){let i=e.length-1,a=t=>e[t].start;if(e.length<=r)return{startIndex:0,endIndex:i};let o=Ab(0,i,a,n),s=o;if(r===1)for(;s<i&&e[s].end<n+t;)s++;else if(r>1){let a=Array(r).fill(0);for(;s<i&&a.some(e=>e<n+t);){let t=e[s];a[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(i,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var Mb=typeof document<`u`?b.useLayoutEffect:b.useEffect;function Nb({useFlushSync:e=!0,...t}){let n=b.useReducer(()=>({}),{})[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,C.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=b.useState(()=>new kb(r));return i.setOptions(r),Mb(()=>i._didMount(),[]),Mb(()=>i._willUpdate()),i}function Pb(e){return Nb({observeElementRect:Cb,observeElementOffset:Eb,scrollToFn:Ob,...e})}var Fb=140,Ib=3,Lb=15;function Rb({runs:e,className:t,maxHeight:n=600,renderItem:r,onStopRun:i,stoppingRunIds:a}){let o=(0,b.useRef)(null),s=(0,b.useMemo)(()=>e,[e]),c=(0,b.useCallback)(e=>s[e]?.runId??e,[s]),l=Pb({count:s.length,getScrollElement:()=>o.current,estimateSize:()=>Fb,overscan:Ib,getItemKey:c});if(s.length<Lb)return(0,K.jsx)(`div`,{className:t,"data-testid":`run-list-flat`,children:(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:s.map((e,t)=>r?(0,K.jsx)(`div`,{children:r(e,t)},e.runId):(0,K.jsx)(hb,{run:e,onStop:i,stopping:a?.has(e.runId)},e.runId))})});let u=l.getVirtualItems();return(0,K.jsx)(`div`,{ref:o,className:t,"data-testid":`run-list-virtualized`,style:{maxHeight:n,overflow:`auto`,contain:`strict`},children:(0,K.jsx)(`div`,{style:{height:`${l.getTotalSize()}px`,width:`100%`,position:`relative`},children:u.map(e=>{let t=s[e.index];return t?(0,K.jsx)(`div`,{"data-index":e.index,ref:l.measureElement,style:{position:`absolute`,top:0,left:0,width:`100%`,transform:`translateY(${e.start}px)`},children:(0,K.jsx)(`div`,{style:{paddingBottom:8},children:r?r(t,e.index):(0,K.jsx)(hb,{run:t,onStop:i,stopping:a?.has(t.runId)})})},e.key):null})})})}function zb({currentPage:e,totalItems:t,itemsPerPage:n,onPageChange:r,className:i}){let a=Math.ceil(t/n),o=e*n+1,s=Math.min((e+1)*n,t),c=e>0,l=e<a-1;if(t===0)return null;let u=[];if(a<=5)for(let e=0;e<a;e++)u.push(e);else{u.push(0),e>2&&u.push(`ellipsis`);for(let t=Math.max(1,e-1);t<=Math.min(a-2,e+1);t++)u.push(t);e<a-3&&u.push(`ellipsis`),u.push(a-1)}return(0,K.jsxs)(`div`,{className:q(`flex items-center justify-between border-t border-border pt-3`,i),children:[(0,K.jsxs)(`span`,{className:`text-xs text-foreground-muted tabular-nums`,children:[o,`–`,s,` of `,t]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[(0,K.jsx)(`button`,{onClick:()=>r(e-1),disabled:!c,className:q(`inline-flex h-11 w-11 items-center justify-center rounded-md text-xs transition-all`,c?`text-foreground hover:bg-primary-muted hover:text-primary hover:shadow-neon-glow-primary-xs cursor-pointer`:`text-foreground-muted cursor-not-allowed opacity-40`),"aria-label":`Previous page`,children:(0,K.jsx)(Lf,{className:`h-4 w-4`})}),u.map((t,n)=>t===`ellipsis`?(0,K.jsx)(`span`,{className:`inline-flex h-11 w-5 items-center justify-center text-xs text-foreground-muted`,children:`...`},`ellipsis-${n}`):(0,K.jsx)(`button`,{onClick:()=>r(t),className:q(`inline-flex h-11 min-w-[44px] items-center justify-center rounded-md px-1.5 text-xs font-medium tabular-nums transition-all`,t===e?`text-primary bg-primary/10`:`text-foreground-muted hover:bg-background-secondary hover:text-foreground-secondary cursor-pointer`),children:t+1},t)),(0,K.jsx)(`button`,{onClick:()=>r(e+1),disabled:!l,className:q(`inline-flex h-11 w-11 items-center justify-center rounded-md text-xs transition-all`,l?`text-foreground hover:bg-primary-muted hover:text-primary hover:shadow-neon-glow-primary-xs cursor-pointer`:`text-foreground-muted cursor-not-allowed opacity-40`),"aria-label":`Next page`,children:(0,K.jsx)(Rf,{className:`h-4 w-4`})})]})]})}function Bb(e,t={}){let{limit:n=10,offset:r=0,search:i=``,status:a=``,sort:o=`status`,enabled:s=!0}=t,c=new URLSearchParams;c.set(`project`,e),c.set(`limit`,String(n)),c.set(`offset`,String(r)),i&&c.set(`search`,i),a&&c.set(`status`,a),o&&o!==`status`&&c.set(`sort`,o);let{data:l,loading:u,error:d,refresh:f}=Um(`/api/runs?${c.toString()}`,{interval:5e3,sseFilter:()=>!0,enabled:s});return{runs:s&&l?l.runs:[],totalCount:s&&l?l.totalCount:0,loading:u,error:d,refresh:f}}function Vb(e){return e.failedRuns>0?`failing`:e.activeRuns>0?`active`:e.staleRuns>0?`stale`:`healthy`}var Hb={healthy:{dotClass:`bg-success shadow-[0_0_6px_var(--success)]`,borderClass:`border-success/20 hover:border-success/40`,icon:Vf,label:`Healthy`,barColor:`bg-success`},active:{dotClass:`bg-warning shadow-[0_0_6px_var(--warning)] animate-pulse-dot`,borderClass:`border-warning/20 hover:border-warning/40`,icon:Ef,label:`Active`,barColor:`bg-warning`},stale:{dotClass:`bg-zinc-500`,borderClass:`border-zinc-500/20 hover:border-zinc-500/40`,icon:Ep,label:`Stale`,barColor:`bg-zinc-500`},failing:{dotClass:`bg-error shadow-[0_0_6px_var(--error)]`,borderClass:`border-error/20 hover:border-error/40`,icon:Bf,label:`Failing`,barColor:`bg-error`}},Ub=5;function Wb({project:e,statusFilter:t,sortMode:n=`status`,onHide:r,onStopRun:i,stoppingRunIds:a}){let[o,s]=(0,b.useState)(!1),c=(0,b.useCallback)(async t=>{t.stopPropagation(),s(!0);let n=await Pm(`/api/config`);if(!n.ok){s(!1);return}let i=n.data.hiddenProjects??[];if(i.includes(e.projectName)){s(!1),r?.(e.projectName);return}let a=[...i,e.projectName],o=await Pm(`/api/config`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sources:n.data.sources,pollInterval:n.data.pollInterval,theme:n.data.theme,retentionDays:n.data.retentionDays,hiddenProjects:a})});s(!1),o.ok&&r?.(e.projectName)},[e.projectName,r]),[l,u]=Wh(`project-expanded:${e.projectName}`,!1),[d,f]=(0,b.useState)(0),[p,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(!1),[_,v]=(0,b.useState)(`all`),y=Hb[Vb(e)],x=y.icon,S=e.totalTasks>0?Math.round(e.completedTasksAggregate/e.totalTasks*100):0,C=_===`all`?t:_,{runs:w,totalCount:T,loading:E}=Bb(e.projectName,{limit:Ub,offset:d*Ub,status:C===`all`?``:C,sort:n,enabled:l}),D=e=>{v(t=>t===e?`all`:e),f(0)};return(0,K.jsxs)(`div`,{"data-testid":`project-card-${e.projectName}`,className:q(`transition-all duration-200 overflow-hidden card-hover-lift`,y.borderClass,l&&`ring-1 ring-primary/20`),children:[(0,K.jsxs)(`button`,{onClick:()=>u(e=>!e),className:`w-full text-left p-4 hover:bg-background-secondary/30 transition-colors`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 truncate flex-1`,children:[(0,K.jsx)(`h3`,{className:`text-lg font-semibold text-foreground truncate`,children:e.projectName}),e.pendingBreakpoints>0&&(0,K.jsxs)(`span`,{className:q(`inline-flex items-center gap-1 rounded-full px-2 py-0.5 shrink-0`,`bg-warning/15 border border-warning/30`,`text-xs leading-tight font-bold text-warning`,`animate-pulse-dot`),children:[(0,K.jsx)(lp,{className:`h-2.5 w-2.5`}),e.pendingBreakpoints,` Pending`]})]}),(0,K.jsxs)(`div`,{className:`flex items-center shrink-0 ml-2 gap-1`,children:[(0,K.jsx)(`span`,{role:`button`,tabIndex:0,onClick:c,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c(e))},className:q(`rounded-md p-2 min-h-[44px] min-w-[44px] inline-flex items-center justify-center transition-colors`,o?`text-foreground-muted cursor-wait`:`text-foreground-muted/40 hover:text-foreground-muted hover:bg-background-secondary`),title:`Hide project from dashboard`,children:o?(0,K.jsx)(vp,{className:`h-3.5 w-3.5 animate-spin`}):(0,K.jsx)(Zf,{className:`h-3.5 w-3.5`})}),l?(0,K.jsx)(zf,{className:`h-4 w-4 text-foreground-muted`}):(0,K.jsx)(If,{className:`h-4 w-4 text-foreground-muted`})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:q(`h-2.5 w-2.5 rounded-full shrink-0`,y.dotClass)}),(0,K.jsx)(x,{className:`h-3 w-3`}),y.label]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(pp,{className:`h-3 w-3`}),e.totalRuns]}),(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,K.jsx)(Kf,{className:`h-3 w-3`}),t_(e.latestUpdate)]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.activeRuns>0&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full bg-warning/10 border border-warning/20 px-1.5 py-0.5 text-xs leading-tight font-medium text-warning tabular-nums`,title:`${e.activeRuns} active`,children:[(0,K.jsx)(Ef,{className:`h-3 w-3`}),e.activeRuns]}),e.staleRuns>0&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full bg-zinc-500/10 border border-zinc-500/20 px-1.5 py-0.5 text-xs leading-tight font-medium text-zinc-500 tabular-nums`,title:`${e.staleRuns} stale`,children:[(0,K.jsx)(Ep,{className:`h-3 w-3`}),e.staleRuns]}),e.completedRuns>0&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full bg-success/10 border border-success/20 px-1.5 py-0.5 text-xs leading-tight font-medium text-success tabular-nums`,title:`${e.completedRuns} completed`,children:[(0,K.jsx)(Vf,{className:`h-3 w-3`}),e.completedRuns]}),e.failedRuns>0&&(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 rounded-full bg-error/10 border border-error/20 px-1.5 py-0.5 text-xs leading-tight font-medium text-error tabular-nums`,title:`${e.failedRuns} failed`,children:[(0,K.jsx)(Bf,{className:`h-3 w-3`}),e.failedRuns]})]})]}),e.totalTasks>0&&(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,K.jsxs)(`span`,{className:`text-xs leading-tight text-foreground-muted`,children:[e.completedTasksAggregate,`/`,e.totalTasks,` tasks`]}),(0,K.jsxs)(`span`,{className:`text-xs leading-tight text-foreground-muted tabular-nums`,children:[S,`%`]})]}),(0,K.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-background-secondary overflow-hidden`,children:(0,K.jsx)(`div`,{className:q(`h-full rounded-full transition-all duration-500`,y.barColor),style:{width:`${S}%`}})})]})]}),l&&(()=>{let t=w.filter(e=>e.status===`waiting`||e.status===`pending`||e.isStale),r=w.filter(e=>e.status===`completed`&&!e.isStale),o=w.filter(e=>e.status===`failed`&&!e.isStale),s=t.length>0,c=r.length>0,l=o.length>0;return(0,K.jsxs)(`div`,{className:`border-t border-border px-4 pb-4 pt-3`,children:[E&&w.length===0?(0,K.jsx)(`div`,{className:`flex flex-col gap-2`,children:[1,2].map(e=>(0,K.jsxs)(`div`,{className:`rounded-lg border border-border bg-background p-3 animate-pulse`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,K.jsx)(`div`,{className:`h-2 w-2 rounded-full bg-foreground-muted/20`}),(0,K.jsx)(`div`,{className:`h-3 w-32 rounded bg-foreground-muted/10`})]}),(0,K.jsx)(`div`,{className:`h-2 w-full rounded bg-foreground-muted/10`})]},e))}):w.length===0?(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted text-center py-4`,children:`No matching runs`}):n===`activity`?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:q(`grid gap-2 mb-3`,e.staleRuns>0?`grid-cols-4`:`grid-cols-3`),children:[(0,K.jsx)(Gb,{icon:(0,K.jsx)(Ef,{className:`h-3.5 w-3.5`}),count:e.activeRuns,label:`Active`,colorClass:`text-warning`,bgClass:`bg-warning/10`,pulse:e.activeRuns>0,active:_===`waiting`,onClick:e=>{e.stopPropagation(),D(`waiting`)}}),e.staleRuns>0&&(0,K.jsx)(Gb,{icon:(0,K.jsx)(Ep,{className:`h-3.5 w-3.5`}),count:e.staleRuns,label:`Stale`,colorClass:`text-zinc-500`,bgClass:`bg-zinc-500/10`,active:_===`waiting`,onClick:e=>{e.stopPropagation(),D(`waiting`)}}),(0,K.jsx)(Gb,{icon:(0,K.jsx)(Vf,{className:`h-3.5 w-3.5`}),count:e.completedRuns,label:`Completed`,colorClass:`text-success`,bgClass:`bg-success/10`,active:_===`completed`,onClick:e=>{e.stopPropagation(),D(`completed`)}}),(0,K.jsx)(Gb,{icon:(0,K.jsx)(Bf,{className:`h-3.5 w-3.5`}),count:e.failedRuns,label:`Failed`,colorClass:`text-error`,bgClass:`bg-error/10`,active:_===`failed`,onClick:e=>{e.stopPropagation(),D(`failed`)}})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,K.jsx)(Kf,{className:`h-3.5 w-3.5 text-primary`}),(0,K.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`Timeline`}),(0,K.jsx)(`span`,{className:`rounded-full bg-primary/10 border border-primary/20 px-2 py-px text-xs font-semibold text-primary tabular-nums`,children:w.length})]}),(0,K.jsx)(Rb,{runs:w,maxHeight:500,renderItem:e=>(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(hb,{run:e,onStop:i,stopping:a?.has(e.runId)}),(0,K.jsxs)(`span`,{className:`absolute top-2 right-2 inline-flex items-center gap-1 rounded-full bg-background/80 backdrop-blur-sm border border-border px-2 py-0.5 text-xs text-foreground-muted tabular-nums pointer-events-none z-10`,children:[(0,K.jsx)(Kf,{className:`h-2.5 w-2.5`}),t_(e.updatedAt)]})]})})]}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,K.jsxs)(`div`,{className:q(`grid gap-2 mb-3`,e.staleRuns>0?`grid-cols-4`:`grid-cols-3`),children:[(0,K.jsx)(Gb,{icon:(0,K.jsx)(Ef,{className:`h-3.5 w-3.5`}),count:e.activeRuns,label:`Active`,colorClass:`text-warning`,bgClass:`bg-warning/10`,pulse:e.activeRuns>0,active:_===`waiting`,onClick:e=>{e.stopPropagation(),D(`waiting`)}}),e.staleRuns>0&&(0,K.jsx)(Gb,{icon:(0,K.jsx)(Ep,{className:`h-3.5 w-3.5`}),count:e.staleRuns,label:`Stale`,colorClass:`text-zinc-500`,bgClass:`bg-zinc-500/10`,active:_===`waiting`,onClick:e=>{e.stopPropagation(),D(`waiting`)}}),(0,K.jsx)(Gb,{icon:(0,K.jsx)(Vf,{className:`h-3.5 w-3.5`}),count:e.completedRuns,label:`Completed`,colorClass:`text-success`,bgClass:`bg-success/10`,active:_===`completed`,onClick:e=>{e.stopPropagation(),D(`completed`)}}),(0,K.jsx)(Gb,{icon:(0,K.jsx)(Bf,{className:`h-3.5 w-3.5`}),count:e.failedRuns,label:`Failed`,colorClass:`text-error`,bgClass:`bg-error/10`,active:_===`failed`,onClick:e=>{e.stopPropagation(),D(`failed`)}})]}),s&&(0,K.jsxs)(`div`,{className:`mb-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,K.jsx)(Ef,{className:`h-3.5 w-3.5 text-warning animate-pulse-dot`}),(0,K.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:`In Progress`}),(0,K.jsx)(`span`,{className:`rounded-full bg-warning/10 border border-warning/20 px-2 py-px text-xs font-semibold text-warning tabular-nums`,children:t.length})]}),(0,K.jsx)(Rb,{runs:t,maxHeight:500,onStopRun:i,stoppingRunIds:a})]}),l&&(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),g(e=>!e)},className:`flex items-center gap-2 py-1.5 text-xs group w-fit`,children:[(0,K.jsx)(Bf,{className:`h-3.5 w-3.5 text-error/70`}),(0,K.jsx)(`span`,{className:`font-semibold text-error/80 group-hover:text-error transition-colors`,children:`Failed Dispatches`}),(0,K.jsx)(`span`,{className:`rounded-full bg-error/10 border border-error/20 px-2 py-px text-xs font-semibold text-error tabular-nums`,children:o.length}),h?(0,K.jsx)(zf,{className:`h-3 w-3 text-error/40 group-hover:text-error/60`}):(0,K.jsx)(If,{className:`h-3 w-3 text-error/40 group-hover:text-error/60`})]}),h&&(0,K.jsx)(`div`,{className:`mt-1 opacity-70`,children:(0,K.jsx)(Rb,{runs:o,maxHeight:400,onStopRun:i,stoppingRunIds:a})})]}),c&&(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),m(e=>!e)},className:`flex items-center gap-2 py-1.5 text-xs group w-fit`,children:[(0,K.jsx)(up,{className:`h-3.5 w-3.5 text-foreground-muted/70`}),(0,K.jsx)(`span`,{className:`font-semibold text-foreground-muted group-hover:text-foreground-secondary transition-colors`,children:`Completed History`}),(0,K.jsx)(`span`,{className:`rounded-full bg-background-secondary border border-border px-2 py-px text-xs font-semibold text-foreground-muted tabular-nums`,children:r.length}),p?(0,K.jsx)(zf,{className:`h-3 w-3 text-foreground-muted/60 group-hover:text-foreground-muted`}):(0,K.jsx)(If,{className:`h-3 w-3 text-foreground-muted/60 group-hover:text-foreground-muted`})]}),p&&(0,K.jsx)(`div`,{className:`mt-1 opacity-60`,children:(0,K.jsx)(Rb,{runs:r,maxHeight:400,onStopRun:i,stoppingRunIds:a})})]})]}),T>Ub&&(0,K.jsx)(zb,{currentPage:d,totalItems:T,itemsPerPage:Ub,onPageChange:f,className:`mt-3`})]})})()]})}function Gb({icon:e,count:t,label:n,colorClass:r,bgClass:i,pulse:a,active:o,onClick:s}){let c=!!s;return(0,K.jsxs)(`div`,{role:c?`button`:void 0,tabIndex:c?0:void 0,onClick:s,onKeyDown:c?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s?.(e))}:void 0,className:q(`rounded-md px-2.5 py-1.5 flex items-center gap-2 transition-all`,i,c&&`cursor-pointer hover:opacity-80`,o&&`ring-2 ring-offset-1 ring-offset-card`,o&&r.replace(`text-`,`ring-`).replace(/\/\d+$/,`/50`)),children:[(0,K.jsx)(`span`,{className:q(r,a&&`animate-pulse`),children:e}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:q(`text-sm font-bold tabular-nums leading-none`,r),children:t}),(0,K.jsx)(`p`,{className:`text-xs leading-tight text-foreground-muted uppercase tracking-wider`,children:n})]})]})}function Kb(){return(0,K.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 items-start`,children:[1,2,3].map(e=>(0,K.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 animate-pulse`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,K.jsx)(`div`,{className:`h-2.5 w-2.5 rounded-full bg-foreground-muted/20`}),(0,K.jsx)(`div`,{className:`h-4 w-32 rounded bg-foreground-muted/10`})]}),(0,K.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-foreground-muted/10 mb-3`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`h-5 w-16 rounded-full bg-foreground-muted/10`}),(0,K.jsx)(`div`,{className:`h-5 w-16 rounded-full bg-foreground-muted/10`}),(0,K.jsx)(`div`,{className:`h-3 w-12 rounded bg-foreground-muted/10`})]})]},e))})}function qb({error:e}){return(0,K.jsxs)(`div`,{"data-testid":`error-banner`,className:`rounded-lg border border-error/20 bg-error-muted p-4 text-sm text-error`,children:[`Failed to load projects: `,e]})}function Jb(){return(0,K.jsxs)(`div`,{"data-testid":`empty-state`,className:`text-center py-16`,children:[(0,K.jsx)(op,{className:`h-10 w-10 text-foreground-muted/30 mx-auto mb-3`}),(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted mb-1`,children:`No projects found`}),(0,K.jsxs)(`p`,{className:`text-xs text-foreground-muted/60`,children:[`Configure watch sources in`,` `,(0,K.jsx)(`button`,{onClick:()=>window.dispatchEvent(new CustomEvent(`open-settings`)),className:`text-primary hover:underline`,children:`Settings`}),` `,`or edit `,(0,K.jsx)(`span`,{className:`font-mono`,children:`~/.a5c/kanban.json`})]})]})}function Yb(){return(0,K.jsxs)(`div`,{"data-testid":`idle-empty-state`,className:`text-center py-16`,children:[(0,K.jsx)(Qf,{className:`h-10 w-10 text-foreground-muted/30 mx-auto mb-3`}),(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted mb-1`,children:`All quiet — no active orchestration runs`}),(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted/60`,children:`Dispatches will appear here when babysitter processes are started`})]})}function Xb({loading:e,error:t,filteredProjects:n,activeProjects:r,historyProjects:i,statusFilter:a,sortMode:o,cardStatusFilter:s,historyCollapsed:c,onHistoryCollapsedChange:l,onHideProject:u,onStopRun:d,stoppingRunIds:f}){return e?(0,K.jsx)(Kb,{}):t?(0,K.jsx)(qb,{error:t}):n.length===0?(0,K.jsx)(Jb,{}):(0,K.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[r.length===0&&i.length===0&&(0,K.jsx)(Yb,{}),r.length===0&&i.length>0&&(a===`all`||a===`stale`)&&(0,K.jsxs)(`div`,{"data-testid":`idle-with-history-banner`,className:`flex items-center gap-2 px-3 py-2 rounded-md bg-background-secondary/50 border border-border w-fit`,children:[(0,K.jsx)(Ef,{className:`h-3.5 w-3.5 text-foreground-muted/50`}),(0,K.jsx)(`span`,{className:`text-xs text-foreground-muted`,children:o===`activity`?`No activity in the last 24 hours`:`No dispatches in progress`})]}),r.length>0&&(a===`all`||a===`stale`||a===`waiting`)&&(0,K.jsx)(cb,{section:`Active Dispatches`,children:(0,K.jsxs)(`section`,{"data-testid":`active-runs-section`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[o===`activity`?(0,K.jsx)(Kf,{className:`h-4 w-4 text-primary`}):(0,K.jsx)(Ef,{className:`h-4 w-4 text-warning animate-pulse-dot`}),(0,K.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:o===`activity`?`Recent Activity`:`In Progress`}),(0,K.jsx)(`span`,{className:q(`rounded-full px-2 py-px text-xs font-semibold tabular-nums`,o===`activity`?`bg-primary/10 border border-primary/20 text-primary`:`bg-warning/10 border border-warning/20 text-warning`),children:r.length})]}),(0,K.jsx)(`div`,{"data-testid":`project-grid-active`,className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 items-start`,children:r.map(e=>(0,K.jsx)(Wb,{project:e,statusFilter:s,sortMode:o,onHide:u,onStopRun:d,stoppingRunIds:f},e.projectName))})]})}),(a===`completed`||a===`failed`)&&(0,K.jsx)(cb,{section:`Filtered Results`,children:(0,K.jsx)(`div`,{"data-testid":`project-grid-filtered`,className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 items-start`,children:n.map(e=>(0,K.jsx)(Wb,{project:e,statusFilter:s,sortMode:o,onStopRun:d,stoppingRunIds:f},e.projectName))})}),i.length>0&&(a===`all`||a===`stale`)&&(0,K.jsx)(cb,{section:`Recent History`,children:(0,K.jsxs)(`section`,{"data-testid":`recent-history-section`,children:[(0,K.jsxs)(`button`,{onClick:()=>l(e=>!e),className:`flex items-center gap-2 mb-3 group w-fit`,children:[(0,K.jsx)(up,{className:`h-4 w-4 text-foreground-muted/70`}),(0,K.jsx)(`h2`,{className:`text-sm font-semibold text-foreground-muted group-hover:text-foreground-secondary transition-colors`,children:o===`activity`?`Earlier`:`Recent History`}),(0,K.jsx)(`span`,{className:`rounded-full bg-background-secondary border border-border px-2 py-px text-xs font-semibold text-foreground-muted tabular-nums`,children:i.length}),c?(0,K.jsx)(If,{className:`h-3.5 w-3.5 text-foreground-muted/60 group-hover:text-foreground-muted transition-colors`}):(0,K.jsx)(zf,{className:`h-3.5 w-3.5 text-foreground-muted/60 group-hover:text-foreground-muted transition-colors`})]}),!c&&(0,K.jsx)(`div`,{className:`opacity-70`,children:(0,K.jsx)(`div`,{"data-testid":`project-grid-history`,className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 items-start`,children:i.map(e=>(0,K.jsx)(Wb,{project:e,statusFilter:s,sortMode:o,onStopRun:d,stoppingRunIds:f},e.projectName))})})]})})]})}var Zb=[{label:`All`,value:`all`},{label:`Running`,value:`waiting`},{label:`Stale`,value:`stale`},{label:`Completed`,value:`completed`},{label:`Failed`,value:`failed`}];function Qb({statusFilter:e,onStatusFilterChange:t,filterCounts:n,sortMode:r,onSortModeToggle:i,filteredProjectCount:a}){return(0,K.jsx)(`div`,{className:`mb-5`,children:(0,K.jsxs)(`div`,{"data-testid":`filter-bar`,className:`flex items-center gap-1`,children:[Zb.map(r=>{let i=n[r.value]??0;return r.value===`stale`&&i===0?null:(0,K.jsxs)(`button`,{"data-testid":`filter-pill-${r.value}`,"aria-pressed":e===r.value,onClick:()=>t(r.value),className:q(`rounded-md px-3 py-1.5 min-h-[44px] text-xs font-medium transition-all inline-flex items-center gap-1.5`,e===r.value?r.value===`stale`?`bg-zinc-500/10 text-zinc-500`:`bg-primary/10 text-primary shadow-neon-glow-primary-xs`:`text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary`),children:[r.label,i>0&&(0,K.jsx)(`span`,{className:q(`rounded-full px-1.5 py-px text-xs leading-tight font-semibold tabular-nums`,e===r.value?r.value===`stale`?`bg-zinc-500/20 text-zinc-500`:`bg-primary/20 text-primary`:`bg-background-secondary text-foreground-muted`),children:i})]},r.value)}),(0,K.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,K.jsxs)(`button`,{"data-testid":`sort-toggle`,onClick:i,className:q(`rounded-md px-2.5 py-1.5 min-h-[44px] text-xs font-medium inline-flex items-center gap-1.5`,`transition-all duration-200 ease-in-out`,r===`status`?`bg-warning/10 border border-warning/30 text-warning hover:bg-warning/15 hover:border-warning/40 shadow-sm`:`bg-primary/10 border border-primary/30 text-primary hover:bg-primary/15 hover:border-primary/40 shadow-sm`),title:r===`status`?`Currently sorting by status priority (active first, then failed, then completed). Click to switch to chronological activity view.`:`Currently sorting by most recent activity (newest updates first). Click to switch to status-grouped view.`,children:[r===`status`?(0,K.jsx)(jf,{className:`h-3 w-3 transition-transform duration-200`}):(0,K.jsx)(Kf,{className:`h-3 w-3 transition-transform duration-200`}),r===`status`?`By Status`:`By Activity`]}),(0,K.jsxs)(`span`,{"data-testid":`project-count`,className:`text-xs text-foreground-muted tabular-nums`,children:[a,` project`,a===1?``:`s`]})]})]})})}function $b(e,t){return`/projects/${encodeURIComponent(e)}/issues/${encodeURIComponent(t)}`}function ex(e){return`/projects/${encodeURIComponent(e)}/board`}function tx(e){return e===`azure-repos`?`Azure Repos`:`GitHub`}function nx(e){return e.mode===`issue`&&e.issueKey?e.issueKey:e.mode===`host`&&e.projectKey&&e.hostProvider?`${e.projectKey}-${e.hostProvider}`:e.projectKey??`workspace`}function rx(e){let t=Be(),{snapshot:n,loading:r,error:i}=Zm(),[a,o]=(0,b.useState)(e.projectId??``),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(!1),[p,m]=(0,b.useState)(null),h=n?.projects??[],g=(0,b.useMemo)(()=>h.find(e=>e.id===a)??(e.projectId?void 0:h[0]),[h,e.projectId,a]),_=(0,b.useMemo)(()=>e.issueId?n?.issues.find(t=>t.id===e.issueId&&(!g||t.projectId===g.id)):void 0,[e.issueId,g,n?.issues]),v=g?.integrations??[];(0,b.useEffect)(()=>{!a&&g?.id&&o(g.id)},[g?.id,a]),(0,b.useEffect)(()=>{if(v.length===0){c(``);return}s&&v.some(e=>e.provider===s)||c((v.find(e=>e.prerequisites.every(e=>e.satisfied))??v[0])?.provider??``)},[v,s]),(0,b.useEffect)(()=>{u(nx({mode:e.mode,projectKey:g?.key,issueKey:_?.key,hostProvider:s||void 0}))},[e.mode,s,_?.key,g?.key]);let y=(0,b.useMemo)(()=>v.find(e=>e.provider===s),[v,s]),x=e.mode===`issue`?`Create issue-owned workspace`:e.mode===`project`?`Create project-owned workspace`:`Create host-scoped workspace`,S=e.mode===`issue`?`This route provisions a workspace from the current issue and redirects directly into the workspace shell.`:e.mode===`project`?`This route provisions a workspace owned by the current project without requiring an issue-first entry point.`:`This route starts from the workspace host surface and still records the selected project and host context explicitly.`,C=e.mode===`issue`&&_?$b(_.projectId,_.id):g?ex(g.id):`/workspaces`;async function w(n){if(n.preventDefault(),!(!g||!l.trim())){f(!0),m(null);try{let n=await fetch(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`provision`,scope:e.mode,projectId:g.id,issueId:e.mode===`issue`?_?.id:void 0,hostProvider:(e.mode===`host`||e.mode,s||void 0),workspaceName:l.trim()})});if(!n.ok){let e=await n.json().catch(()=>null);throw Error(e?.error??`Workspace provisioning failed: ${n.status}`)}let r=await n.json();t(`/workspaces?workspace=${encodeURIComponent(r.workspace.workspacePath)}`)}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}}return r&&!n?(0,K.jsx)(`div`,{className:`mx-auto flex w-full max-w-[960px] flex-1 px-4 py-6 sm:px-6`,children:(0,K.jsxs)(`section`,{className:`w-full animate-pulse rounded-3xl border border-border bg-card p-6`,children:[(0,K.jsx)(`div`,{className:`h-5 w-48 rounded bg-background-secondary`}),(0,K.jsx)(`div`,{className:`mt-4 h-20 rounded-2xl bg-background-secondary`})]})}):i||!n?(0,K.jsx)(`div`,{className:`mx-auto flex w-full max-w-[960px] flex-1 px-4 py-6 sm:px-6`,children:(0,K.jsx)(`section`,{className:`w-full rounded-3xl border border-error/25 bg-error-muted p-6 text-sm text-error`,children:`Failed to load workspace provisioning context.`})}):(0,K.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[960px] flex-1 flex-col gap-6 px-4 py-6 sm:px-6`,children:[(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspace provisioning`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight text-foreground`,children:x}),(0,K.jsx)(`p`,{className:`mt-3 max-w-3xl text-sm leading-6 text-foreground-muted`,children:S})]}),(0,K.jsx)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:(0,K.jsxs)(`form`,{className:`grid gap-5`,onSubmit:w,children:[e.mode===`host`?(0,K.jsxs)(`label`,{className:`grid gap-2 text-sm font-medium text-foreground`,children:[`Project`,(0,K.jsx)(`select`,{value:a,onChange:e=>o(e.target.value),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:h.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.key,` - `,e.name]},e.id))})]}):null,g?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:[(0,K.jsx)(`div`,{className:`font-semibold text-foreground`,children:g.key}),(0,K.jsx)(`div`,{className:`mt-1`,children:g.name}),_?(0,K.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border bg-card px-3 py-2 text-xs text-foreground-muted`,children:[`Issue owner: `,(0,K.jsx)(`span`,{className:`font-semibold text-foreground`,children:_.key}),` ·`,` `,_.title]}):null]}):null,v.length>0?(0,K.jsxs)(`label`,{className:`grid gap-2 text-sm font-medium text-foreground`,children:[`Host context`,(0,K.jsx)(`select`,{value:s,onChange:e=>c(e.target.value),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground`,children:v.map(e=>(0,K.jsxs)(`option`,{value:e.provider,children:[e.label,` · `,e.accountLabel??e.status]},e.provider))})]}):null,y?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:[(0,K.jsxs)(`div`,{className:`font-semibold text-foreground`,children:[tx(y.provider),` ownership metadata will be attached`]}),(0,K.jsx)(`div`,{className:`mt-1`,children:y.guidance})]}):null,(0,K.jsxs)(`label`,{className:`grid gap-2 text-sm font-medium text-foreground`,children:[`Workspace name`,(0,K.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),className:`h-11 rounded-xl border border-border bg-background px-3 text-sm text-foreground outline-none`,placeholder:`workspace name`})]}),p?(0,K.jsx)(`div`,{className:`rounded-2xl border border-error/25 bg-error-muted px-4 py-3 text-sm text-error`,children:p}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsx)(J,{type:`submit`,variant:`primary`,disabled:!g||!l.trim(),loading:d,children:`Create workspace`}),(0,K.jsx)(J,{variant:`ghost`,onClick:()=>t(C),children:`Cancel`})]})]})})]})}function ix(e){return Array.from(new Set(e.map(e=>e.labelId?.trim()||``).filter(Boolean))).map(e=>({labelId:e}))}function ax(e){let t=Array.from(new Set(e.labelIds??[])),n=e.labels??[],r=e.projectKey?.trim()?e.projectName?.trim()?`${e.projectKey} (${e.projectName})`:e.projectKey:e.projectName?.trim()||e.projectId,i=n.length>0?n.map(e=>`- ${e.key} (${e.labelId}): ${e.label}`).join(`
32
+ `):t.length>0?t.map(e=>`- ${e}`).join(`
33
+ `):`- none`,a=e.renderedContext?.trim()||`- none`,o=(e.runIds??[]).length>0?(e.runIds??[]).join(`, `):`none`,s=(e.sessionIds??[]).length>0?(e.sessionIds??[]).join(`, `):`none`;return[`Execution Context`,`Project: ${r}`,`Issue: ${e.issueKey} (${e.issueId})`,`Title: ${e.issueTitle}`,`Applied Dispatch Context Labels (${t.length}):`,i,`Run IDs: ${o}`,`Session IDs: ${s}`,`Last Dispatched At: ${e.lastDispatchedAt??`none`}`,`Rendered Dispatch Context:`,a].join(`
34
+ `)}function ox(e){let t=ix(e.issue.dispatch.contextLabels).map(e=>e.labelId),n=e.issue.dispatch.contextLabelProjections??[],r=e.issue.dispatch.renderedContext?.trim()||void 0;if(!(t.length===0&&n.length===0&&!r))return{kind:`dispatch-context-labels`,project:{id:e.project?.id??e.issue.projectId,key:e.project?.key,name:e.project?.name},issue:{id:e.issue.id,key:e.issue.key,title:e.issue.title},dispatch:{runIds:Array.from(new Set(e.issue.dispatch.runIds??[])),sessionIds:Array.from(new Set(e.issue.dispatch.sessionIds??[])),labelIds:t,labels:n,renderedContext:r,lastDispatchedAt:e.issue.dispatch.lastDispatchedAt},block:ax({projectId:e.project?.id??e.issue.projectId,projectKey:e.project?.key,projectName:e.project?.name,issueId:e.issue.id,issueKey:e.issue.key,issueTitle:e.issue.title,runIds:e.issue.dispatch.runIds,sessionIds:e.issue.dispatch.sessionIds,labelIds:t,labels:n,renderedContext:r,lastDispatchedAt:e.issue.dispatch.lastDispatchedAt})}}function sx(e,t){let n=new Map(e.projects.map(e=>[e.id,e]));return e.issues.filter(t).map(e=>ox({issue:e,project:n.get(e.projectId)})).filter(e=>!!e).sort((e,t)=>e.issue.key.localeCompare(t.issue.key)||e.issue.id.localeCompare(t.issue.id))}function cx(e,t){let n=t.trim();return n?sx(e,e=>e.dispatch.sessionIds.includes(n)):[]}function lx(e){return e?new Date(e).toLocaleString():`Unavailable`}function ux(e){return!e||!Number.isFinite(e)?`Unavailable`:new Date(e).toLocaleString()}function dx(e){return e===`success`?`border-success/20 bg-success/10 text-success`:e===`warning`?`border-warning/20 bg-warning/10 text-warning`:e===`error`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}function fx(e){return e===`approved`||e===`ready`||e===`passing`||e===`published`||e===`merged`?`border-success/20 bg-success/10 text-success`:e===`pending`||e===`in-review`?`border-warning/20 bg-warning/10 text-warning`:e===`changes-requested`||e===`blocked`||e===`failing`||e===`failed`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}function px(e){return e===`azure-repos`?`Azure Repos`:`GitHub`}function mx(e){return e?[...e.terminal.commands].sort((e,t)=>t.startedAt-e.startedAt)[0]??null:null}function hx(e){return[...e].sort((e,t)=>{let n=e=>e===`running`||e===`pending`||e===`waiting`?0:e===`failed`?1:e===`completed`?2:3,r=n(e.status)-n(t.status);return r===0?e.runId.localeCompare(t.runId):r})}function gx(e){return e===`active`||e===`running`||e===`ready`||e===`completed`?`success`:e===`starting`||e===`pending`||e===`queued`?`warning`:e===`inactive`||e===`failed`||e===`error`||e===`blocked`?`error`:`neutral`}function _x(e){let t=Be(),n=e.workspace.notes?.value??``,r=e.workspace.notes?.updatedAt??null,[i,a]=(0,b.useState)(n),o=(0,b.useMemo)(()=>mx(e.runtime),[e.runtime]),s=e.reviewArtifact?.linkedPullRequest,c=e.reviewArtifact?.integration,l=e.runtime?.preview.primaryUrl??e.runtime?.devServer.primaryUrl??null,u=e.workspace.git.root?.split(`/`).filter(Boolean).at(-1)??`Unavailable`,d=!e.workspace.git.root||!e.workspace.git.branch,f=e.workspace.git.uncommittedCount,p=e.workspace.links?.editorHref??null,m=e.workspace.sessions.items.find(t=>t.sessionId===e.sessionId)??(e.sessionId==null?e.workspace.sessions.items[0]??null:null),h=(0,b.useMemo)(()=>hx(e.workspace.runs.items??[]).slice(0,3),[e.workspace.runs.items]),g=h[0]??null,_=e.workspace.git.ahead==null||e.workspace.git.behind==null?`No upstream tracking`:`${e.workspace.git.ahead} ahead / ${e.workspace.git.behind} behind`,[v,y]=(0,b.useState)(c?.provider??s?.provider??`github`),[x,S]=(0,b.useState)(s?.branchName??e.workspace.git.branch??e.workspace.name),[C,w]=(0,b.useState)(s?.baseBranch??e.workspace.git.trackingBranch?.split(`/`).at(-1)??`main`),[T,E]=(0,b.useState)(s?.title??`${e.workspace.name}: ${e.workspace.git.branch??`workspace`} review`),[D,O]=(0,b.useState)(`kanban-maintainers`),[k,A]=(0,b.useState)(s?.number?String(s.number):``),[j,M]=(0,b.useState)(s?.title??``),N=(0,b.useMemo)(()=>[...e.reviewArtifact?.comments??[]].slice(-2).reverse(),[e.reviewArtifact?.comments]),P=!!(e.runtime||o),ee=!!(e.reviewArtifact||s||c||N.length>0);(0,b.useEffect)(()=>{a(n)},[n,e.workspace.path]),(0,b.useEffect)(()=>{y(c?.provider??s?.provider??`github`),S(s?.branchName??e.workspace.git.branch??e.workspace.name),w(s?.baseBranch??e.workspace.git.trackingBranch?.split(`/`).at(-1)??`main`),E(s?.title??`${e.workspace.name}: ${e.workspace.git.branch??`workspace`} review`),A(s?.number?String(s.number):``),M(s?.title??``)},[c?.provider,s?.baseBranch,s?.branchName,s?.number,s?.provider,s?.title,e.workspace.git.branch,e.workspace.git.trackingBranch,e.workspace.name]);let F=t=>`${t}:${e.workspace.path}`,I=e.pendingAction!=null||e.reviewPending;return(0,K.jsxs)(`aside`,{className:`rounded-[28px] border border-border bg-card p-4 shadow-lg`,"aria-label":`Workspace details for ${e.workspace.name}`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.22em] text-primary/80`,children:`Workspace`}),(0,K.jsx)(`h2`,{className:`mt-2 text-lg font-semibold tracking-tight`,children:`Context and handoff`})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2.5 py-1 text-[11px] text-foreground-muted`,children:e.workspace.status})]}),(0,K.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,K.jsx)(vx,{title:`Status`,icon:Bf,children:(0,K.jsxs)(`div`,{className:`space-y-3`,"data-testid":`workspace-status-panel`,children:[m?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5`,dx(gx(e.sessionStatus??m.status))),children:e.sessionStatus??m.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:m.agent})]}),(0,K.jsx)(`p`,{className:`mt-2 text-sm font-semibold text-foreground`,children:m.title??m.sessionId}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Session `,m.sessionId]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>t(`/sessions/${m.sessionId}`),children:`Open session`})})]}):(0,K.jsx)(xx,{tone:`neutral`,title:`No active session selected`,body:`Select a session to align this sidebar with the chat and runtime panels.`}),e.runtime?(0,K.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(bx,{label:`Runtime updated`,value:ux(e.runtime.updatedAt)}),(0,K.jsx)(bx,{label:`Terminal`,value:`${e.runtime.terminal.status} · ${e.runtime.terminal.commands.length} command${e.runtime.terminal.commands.length===1?``:`s`}`}),(0,K.jsx)(bx,{label:`Dev server`,value:e.runtime.devServer.status}),(0,K.jsx)(bx,{label:`Preview`,value:l?`Available`:`Unavailable`})]}):(0,K.jsx)(xx,{tone:`error`,title:`Runtime disconnected`,body:`Runtime, terminal, and preview status will appear here when the selected session publishes again.`}),g?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:`Recent dispatches`}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5`,fx(g.status)),children:g.status})]}),(0,K.jsx)(`div`,{className:`mt-3 grid gap-2`,children:h.map(t=>(0,K.jsx)(G,{to:`/dispatches/${encodeURIComponent(t.runId)}`,"data-testid":`workspace-status-run-${t.runId}`,className:`rounded-xl border border-border bg-background/70 px-3 py-2 transition-colors hover:border-primary/30`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-xs text-primary`,children:t.runId}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-[11px]`,fx(t.status)),children:t.status})]})},`${e.workspace.path}:${t.runId}`))})]}):(0,K.jsx)(xx,{tone:`neutral`,title:`No workspace dispatches yet`,body:`Dispatch status will appear here once this workspace starts publishing executions.`})]})}),(0,K.jsx)(vx,{title:`Git`,icon:sp,children:d?(0,K.jsx)(xx,{tone:`error`,title:`Repository metadata unavailable`,body:`The workspace path exists, but git root or branch metadata could not be resolved.`}):(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[(0,K.jsx)(bx,{label:`Repository`,value:u,mono:!1}),(0,K.jsx)(bx,{label:`Branch`,value:e.workspace.git.branch??`Unavailable`,mono:!0}),(0,K.jsx)(bx,{label:`Tracking`,value:e.workspace.git.trackingBranch??`Unavailable`,mono:!0}),(0,K.jsx)(bx,{label:`Sync`,value:_}),(0,K.jsx)(bx,{label:`Uncommitted`,value:f==null?`Unavailable`:f===0?`0 changes`:`${f} change${f===1?``:`s`}`})]})}),P?(0,K.jsx)(yx,{title:`Terminal`,summary:o?`Most recent command and captured output`:`Runtime shell output is available`,defaultOpen:!!o,children:e.runtime?o?(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-[11px] uppercase`,dx(o.status===`completed`?`success`:o.status===`failed`?`error`:`warning`)),children:o.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:o.source}),o.toolName?(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:o.toolName}):null]}),(0,K.jsx)(`pre`,{className:`overflow-x-auto rounded-2xl border border-border bg-slate-950 px-3 py-2 text-xs text-slate-100`,children:o.command}),(0,K.jsxs)(`p`,{className:`text-xs text-foreground-muted`,children:[`Captured `,ux(o.startedAt),o.exitCode==null?``:` · exit ${o.exitCode}`]}),o.logs.length>0?(0,K.jsx)(`div`,{className:`rounded-2xl border border-border bg-background/80 px-3 py-2 text-xs text-foreground-muted`,children:o.logs.slice(-2).map((e,t)=>(0,K.jsxs)(`p`,{className:`break-words`,children:[(0,K.jsx)(`span`,{className:`font-mono`,children:e.stream}),`: `,e.text]},`${e.timestamp}:${t}`))}):(0,K.jsx)(xx,{tone:`neutral`,title:`No command output yet`,body:`The runtime captured the command but has not attached log lines.`})]}):(0,K.jsxs)(`div`,{className:`space-y-3`,children:[(0,K.jsx)(xx,{tone:`neutral`,title:`No terminal activity yet`,body:`The selected session has not published a captured command yet.`}),(0,K.jsx)(`pre`,{className:`overflow-x-auto rounded-2xl border border-border bg-background/80 px-3 py-2 text-xs text-foreground-muted`,children:`cd ${e.workspace.path}\ngit status --short`})]}):(0,K.jsx)(xx,{tone:`error`,title:`Runtime disconnected`,body:`No active runtime is currently publishing shell state for this workspace.`})}):null,(0,K.jsx)(vx,{title:`Notes`,icon:np,children:(0,K.jsxs)(`div`,{className:`space-y-3`,children:[n.trim().length===0?(0,K.jsx)(xx,{tone:`neutral`,title:`No workspace notes yet`,body:`Capture next steps, blockers, or handoff notes for this workspace.`}):(0,K.jsxs)(`p`,{className:`text-xs text-foreground-muted`,children:[`Last updated `,lx(r)]}),(0,K.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),className:`min-h-28 w-full rounded-2xl border border-border bg-background/80 px-3 py-2 text-sm outline-none transition focus:border-primary/50`,placeholder:`Add workspace notes, follow-up context, or handoff details.`,"aria-label":`Notes for ${e.workspace.name}`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`ghost`,disabled:e.notesSaving,onClick:()=>e.onSaveNote(e.workspace,i),children:[e.notesSaving?(0,K.jsx)(vp,{className:`mr-2 h-4 w-4 animate-spin`}):null,`Save note`]}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,disabled:e.notesSaving||i.length===0,onClick:()=>e.onSaveNote(e.workspace,``),children:`Clear`})]})]})}),(0,K.jsx)(yx,{title:`Pull request`,summary:s?`Linked review state and status`:`Create or attach a pull request only when needed`,defaultOpen:ee,children:(0,K.jsxs)(`div`,{className:`space-y-3`,children:[s?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:[px(s.provider),` PR `,s.number?`#${s.number}`:``]}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5`,fx(s.status)),children:s.status}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:s.linkState===`partially-linked`?`partially linked`:s.linkState})]}),(0,K.jsx)(`h4`,{className:`mt-2 text-sm font-semibold`,children:s.title}),(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:[s.reviewStatus?(0,K.jsxs)(`span`,{className:q(`rounded-full border px-2 py-0.5`,fx(s.reviewStatus)),children:[`Review `,s.reviewStatus]}):null,s.mergeStatus?(0,K.jsxs)(`span`,{className:q(`rounded-full border px-2 py-0.5`,fx(s.mergeStatus)),children:[`Merge `,s.mergeStatus]}):null,s.publishStatus?(0,K.jsxs)(`span`,{className:q(`rounded-full border px-2 py-0.5`,fx(s.publishStatus)),children:[`Publish `,s.publishStatus]}):null]}),s.ciGates?.length?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2 text-xs`,children:s.ciGates.map(t=>(0,K.jsxs)(`span`,{className:q(`rounded-full border px-2 py-0.5`,fx(t.status)),children:[t.name,`: `,t.status]},`${e.workspace.path}-${t.id}`))}):null,(0,K.jsx)(`p`,{className:`mt-3 text-xs text-foreground-muted`,children:c?.guidance??s.guidance??`No linked PR guidance available.`}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:s.url?(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>window.open(s.url,`_blank`,`noopener,noreferrer`),children:[`Open PR`,(0,K.jsx)(Xf,{className:`ml-2 h-4 w-4`})]}):null})]}):(0,K.jsx)(xx,{tone:`neutral`,title:`No linked PR yet`,body:`Create a PR from this workspace or attach an existing one to keep review and merge status visible.`}),c?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 px-3 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-foreground-muted`,children:px(c.provider)}),(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5`,fx(c.status)),children:c.status.replace(/-/g,` `)})]}),(0,K.jsx)(`p`,{className:`mt-2 text-xs text-foreground-muted`,children:c.guidance}),c.actions.reason?(0,K.jsx)(`div`,{className:`mt-3 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning`,children:c.actions.reason}):null,c.missingScopes?.length?(0,K.jsxs)(`div`,{className:`mt-2 rounded-xl border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning`,children:[`Missing scopes: `,c.missingScopes.join(`, `)]}):null]}):null,s?null:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`form`,{className:`grid gap-3`,onSubmit:t=>{t.preventDefault(),e.onCreatePullRequest(e.workspace,{provider:v,title:T,reviewers:D,branchName:x,baseBranch:C})},children:[(0,K.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Provider`,(0,K.jsx)(`div`,{className:`mt-2`,children:(0,K.jsx)(en,{value:v,onChange:e=>y(e===`azure-repos`?`azure-repos`:`github`),options:[{label:`GitHub`,value:`github`},{label:`Azure Repos`,value:`azure-repos`}]})})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Branch`,(0,K.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Base branch`,(0,K.jsx)(`input`,{value:C,onChange:e=>w(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`Reviewers`,(0,K.jsx)(`input`,{value:D,onChange:e=>O(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`PR title`,(0,K.jsx)(`input`,{value:T,onChange:e=>E(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsx)(J,{type:`submit`,size:`sm`,disabled:I||(c?!c.actions.canCreatePullRequest:!1),children:`Create PR`})]}),(0,K.jsxs)(`form`,{className:`grid gap-3 rounded-2xl border border-border bg-background/70 px-3 py-3`,onSubmit:t=>{t.preventDefault(),e.onLinkPullRequest(e.workspace,{provider:v,number:Number(k),title:j,branchName:x,baseBranch:C})},children:[(0,K.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:`Link existing PR`}),(0,K.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`PR number`,(0,K.jsx)(`input`,{type:`number`,min:1,value:k,onChange:e=>A(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]}),(0,K.jsxs)(`label`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:[`PR title`,(0,K.jsx)(`input`,{value:j,onChange:e=>M(e.target.value),className:`mt-2 h-11 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`})]})]}),(0,K.jsx)(J,{type:`submit`,size:`sm`,variant:`ghost`,disabled:I||(c?!c.actions.canManagePullRequest:!1),children:`Link PR`})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/70 px-3 py-3`,children:[(0,K.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:`Review feedback`}),N.length>0?(0,K.jsx)(`div`,{className:`mt-3 space-y-2`,children:N.map(t=>(0,K.jsxs)(`div`,{className:`rounded-xl border border-border bg-card/80 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[11px] text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:t.author.name}),(0,K.jsx)(`span`,{children:t.anchor.filePath}),(0,K.jsxs)(`span`,{children:[t.anchor.side,`:`,t.anchor.line]})]}),(0,K.jsx)(`p`,{className:`mt-1 text-sm text-foreground`,children:t.body})]},`${e.workspace.path}-${t.id}`))}):(0,K.jsx)(`p`,{className:`mt-2 text-xs text-foreground-muted`,children:`No review comments have been mapped back to this workspace yet.`})]})]})}),(0,K.jsx)(vx,{title:`Actions`,icon:om,children:(0,K.jsxs)(`div`,{className:`space-y-3`,children:[e.workspace.rebase?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-3`,children:[(0,K.jsx)(`p`,{className:`text-[11px] font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:`Rebase workflow`}),(0,K.jsx)(`h4`,{className:`mt-1 text-sm font-semibold`,children:e.workspace.rebase.status===`rebase-needed`?`Rebase required before this workspace can move forward`:e.workspace.rebase.status===`rebase-conflicts`?`Resolve conflicts before returning to review or merge`:`Ready for ${e.workspace.rebase.readyFor}`}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Attempt `,e.workspace.rebase.attemptCount," · target `",e.workspace.rebase.targetBranch??`main`,"`"]}),e.workspace.rebase.followUpInstructions.length>0?(0,K.jsx)(`div`,{className:`mt-3 grid gap-2 text-xs text-foreground-muted`,children:e.workspace.rebase.followUpInstructions.map(e=>(0,K.jsx)(`div`,{className:`rounded-xl border border-border bg-background/70 px-3 py-2`,children:e},e))}):null]}):null,(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`default`,onClick:()=>e.workspace.actions.canRebaseOpenInEditor?e.onAction(`rebase-open-in-editor`,e.workspace):e.onOpenInEditor(e.workspace,p),disabled:I||!p,children:`Open in editor`}),e.sessionId?(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>t(`/sessions/${e.sessionId}`),children:`View session`}):null,l?(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>window.open(l,`_blank`,`noopener,noreferrer`),children:[`Open preview`,(0,K.jsx)(Xf,{className:`ml-2 h-4 w-4`})]}):(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,disabled:!0,children:`Open preview`})]}),e.workspace.rebase?(0,K.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[e.workspace.actions.canRebaseStart?(0,K.jsx)(Sx,{disabled:e.pendingAction===F(`rebase-start`),onClick:()=>e.onAction(`rebase-start`,e.workspace),children:`Retry rebase`}):null,e.workspace.actions.canRebaseAutoResolve?(0,K.jsx)(Sx,{disabled:e.pendingAction===F(`rebase-auto-resolve`),onClick:()=>e.onAction(`rebase-auto-resolve`,e.workspace),children:`Auto-resolve`}):null,e.workspace.actions.canRebaseMarkResolved?(0,K.jsx)(Sx,{disabled:e.pendingAction===F(`rebase-mark-resolved`),onClick:()=>e.onAction(`rebase-mark-resolved`,e.workspace),children:`Mark resolved`}):null,e.workspace.actions.canRebaseAbort?(0,K.jsx)(Sx,{disabled:e.pendingAction===F(`rebase-abort`),onClick:()=>e.onAction(`rebase-abort`,e.workspace),children:`Abort rebase`}):null]}):null,e.feedback?(0,K.jsx)(xx,{tone:e.feedback.tone,title:e.feedback.tone===`error`?`Action failed`:`Action updated`,body:e.feedback.message}):(0,K.jsx)(`p`,{className:`text-xs text-foreground-muted`,children:`Keep editor, preview, and rebase helpers close, without taking over the main workspace summary.`})]})})]})]})}function vx(e){let t=e.icon;return(0,K.jsxs)(`section`,{className:`rounded-2xl border border-border bg-background/60 p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:[(0,K.jsx)(t,{className:`h-4 w-4`}),(0,K.jsx)(`span`,{children:e.title})]}),e.children]})}function yx(e){let[t,n]=(0,b.useState)(e.defaultOpen??!1);return(0,b.useEffect)(()=>{n(e.defaultOpen??!1)},[e.defaultOpen,e.title]),(0,K.jsxs)(`section`,{className:`rounded-2xl border border-border bg-background/60 p-3`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex w-full items-start justify-between gap-3 text-left`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-foreground-muted`,children:e.title}),(0,K.jsx)(`div`,{className:`mt-1 text-xs text-foreground-muted`,children:e.summary})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-[11px] text-foreground-muted`,children:t?`Hide`:`Show`})]}),t?(0,K.jsx)(`div`,{className:`mt-3`,children:e.children}):null]})}function bx(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card/80 px-3 py-2`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:q(`mt-1 text-sm font-medium`,e.mono?`break-all font-mono text-xs`:``),children:e.value})]})}function xx(e){return(0,K.jsxs)(`div`,{className:q(`rounded-2xl border px-3 py-2`,dx(e.tone===`success`?`success`:e.tone===`error`?`error`:`neutral`)),children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[e.tone===`error`?(0,K.jsx)(Bf,{className:`h-4 w-4`}):e.tone===`success`?(0,K.jsx)(jf,{className:`h-4 w-4`}):null,(0,K.jsx)(`span`,{children:e.title})]}),(0,K.jsx)(`p`,{className:`mt-1 text-xs`,children:e.body})]})}function Sx(e){return(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,disabled:e.disabled,onClick:e.onClick,className:`justify-start`,children:e.children})}var Cx=[{key:`sidebar`,label:`Workspace`,shortcut:`Shift+W`,icon:wp},{key:`conversation`,label:`Chat`,shortcut:`Shift+C`,icon:Sp},{key:`context`,label:`Trace`,shortcut:`Shift+X`,icon:am},{key:`details`,label:`Runtime`,shortcut:`Shift+D`,icon:Tp}],wx={sidebar:22,conversation:58,context:12,details:8};function Tx(e,t){let n=e.ownership?.project?.projectId??e.issues?.find(e=>e.issueId===t)?.projectId;return n?`/projects/${encodeURIComponent(n)}/issues/${encodeURIComponent(t)}`:`/issues/${encodeURIComponent(t)}`}function Ex(e,t){let n=Yh(e);return n.includes(t)?t:n[0]}function Dx(e){return!e||!Number.isFinite(e)?`No live session heartbeat`:new Date(e).toLocaleString()}function Ox(e){return e===`active`?`border-success/20 bg-success/10 text-success`:`border-border text-foreground-muted`}function kx(e){let t=(0,b.useMemo)(()=>e.panels.map(t=>({id:t.key,label:t.label,shortcut:t.shortcut,group:`Panels`,onSelect:()=>{e.onTogglePanel(t.key),e.onOpenChange(!1)}})),[e]);return(0,K.jsx)(nn,{open:e.open,onClose:()=>e.onOpenChange(!1),items:t,placeholder:`Toggle workspace panels`})}function Ax(e){return(0,K.jsxs)(`section`,{"data-testid":`workspace-panel-${e.panelKey}`,className:`flex h-full min-h-0 flex-col rounded-3xl border border-border bg-card shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`border-b border-border px-4 py-3`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:e.title}),e.subtitle?(0,K.jsx)(`div`,{className:`mt-1 text-sm text-foreground-muted`,children:e.subtitle}):null]}),(0,K.jsx)(`div`,{className:e.bodyClassName??`min-h-0 flex-1 overflow-auto p-4`,children:e.children})]})}function jx(e){return(0,K.jsx)(`button`,{type:`button`,"data-testid":e.testId,"aria-label":`Resize panels`,onMouseDown:e.onMouseDown,className:`group flex h-full w-full cursor-col-resize items-center justify-center rounded-full bg-transparent text-foreground-muted transition-colors hover:bg-primary/8 hover:text-primary`,children:(0,K.jsx)(cp,{className:`h-4 w-4`})})}function Mx(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border px-4 py-6 text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium text-foreground`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-2 leading-6 text-foreground-muted`,children:e.body})]})}function Nx(e){let t=Be(),n=`workspace-detail-layout-v4.${e.workspace.path}`,[r,i]=Wh(`${n}.sidebar-open`,!0),[a,o]=Wh(`${n}.conversation-open`,!0),[s,c]=Wh(`${n}.context-open`,!1),[l,u]=Wh(`${n}.details-open`,!1),[d,f]=Wh(`${n}.desktop-sizes`,wx),[p,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(`conversation`),[_,v]=(0,b.useState)(()=>typeof window>`u`?qh:window.innerWidth),[y,x]=(0,b.useState)(null),S=(0,b.useRef)(null),C=e.workspace.issues?.[0]??null,w=`/sessions/new?workspacePath=${encodeURIComponent(e.workspace.path)}${C?`&issueId=${encodeURIComponent(C.issueId)}&issueKey=${encodeURIComponent(C.issueKey)}`:``}`,T=e.sessions.length>0,E=T?Cx:Cx.filter(e=>e.key===`sidebar`),D=(0,b.useMemo)(()=>Jh({sidebar:r,conversation:a,context:s,details:l}),[s,a,l,r]),O=(0,b.useMemo)(()=>Yh(D),[D]),k=(0,b.useMemo)(()=>Zh(d,D),[d,D]),A=_<qh;(0,b.useEffect)(()=>{let e=()=>v(window.innerWidth);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,b.useEffect)(()=>{g(e=>Ex(D,e))},[D]),(0,b.useEffect)(()=>{let e=e=>{let t=e.target;if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`){if(t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.tagName===`SELECT`||t?.isContentEditable)return;e.preventDefault(),m(!0)}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let j=e=>{let t=Jh(e);i(t.sidebar),o(t.conversation),c(t.context),u(t.details),g(e=>Ex(t,e))},M=e=>{!T&&e!==`sidebar`||j(Xh(D,e))},N=(e,t)=>n=>{if(A||!S.current)return;n.preventDefault();let r=S.current.getBoundingClientRect().width||1,i=n.clientX,a=d,o=n=>{f(Qh({sizes:a,visibility:D,leftPanel:e,rightPanel:t,deltaPercentage:(n.clientX-i)/r*100}))},s=()=>{window.removeEventListener(`mousemove`,o),window.removeEventListener(`mouseup`,s)};window.addEventListener(`mousemove`,o),window.addEventListener(`mouseup`,s)};Vh([{key:`W`,shift:!0,action:()=>M(`sidebar`),description:`Toggle workspace sidebar`},{key:`C`,shift:!0,action:()=>M(`conversation`),description:`Toggle session panel`},{key:`X`,shift:!0,action:()=>M(`context`),description:`Toggle context panel`},{key:`D`,shift:!0,action:()=>M(`details`),description:`Toggle runtime panel`}]);let P=(0,b.useMemo)(()=>{let e=[];return O.forEach((t,n)=>{e.push(`minmax(0, ${k[t]}fr)`),n<O.length-1&&e.push(`0.85rem`)}),e.join(` `)},[k,O]),ee=e.activeSession?.title??e.activeSession?.sessionId??`No session selected`,F=e.activeSession?.runtime,I=e.canSendMessages??!0,te=!e.activeSession&&e.sessions.length===0;(0,b.useEffect)(()=>{if(!te){x(null);return}y!==e.workspace.path&&(o(!1),c(!1),u(!1),x(e.workspace.path))},[te,y,e.workspace.path,c,o,u]),(0,b.useEffect)(()=>{e.activeSession&&(i(!0),o(!0),g(`conversation`))},[e.activeSession,e.workspace.path,o,i]);let ne=n=>n===`sidebar`?(0,K.jsx)(Ax,{panelKey:`sidebar`,title:`Workspace`,subtitle:T?`Issue link, session roster, and quick actions`:`Issue link, workspace status, and next steps`,children:(0,K.jsxs)(`div`,{className:`grid gap-4`,children:[T?(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(mp,{className:`h-4 w-4 text-primary`}),(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`Workspace sessions`})]}),(0,K.jsx)(`div`,{className:`mt-4 grid gap-3`,children:e.sessions.map(t=>(0,K.jsxs)(`button`,{type:`button`,onClick:()=>e.onSelectSession(t.sessionId),className:`rounded-2xl border bg-card/80 p-3 text-left transition-colors hover:border-primary/30 ${t.sessionId===e.selectedSessionId?`border-primary/40`:`border-border`}`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:t.title??t.sessionId}),(0,K.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-xs ${Ox(t.status)}`,children:t.status})]}),(0,K.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsx)(`span`,{children:t.agent}),t.latestRunId?(0,K.jsx)(`span`,{children:t.latestRunId}):null]})]},t.sessionId))})]}):(0,K.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border bg-background/65 p-4`,children:[(0,K.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`No linked session yet`}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:`This workspace still keeps its issue and repo context here. Link or start a session from the board when you want the chat and runtime to appear beside it.`}),(0,K.jsx)(`div`,{className:`mt-4`,children:(0,K.jsx)(J,{type:`button`,size:`sm`,onClick:()=>t(w),children:`Start workspace session`})})]}),(0,K.jsx)(_x,{workspace:e.workspace,runtime:F,reviewArtifact:e.reviewArtifact,sessionId:e.activeSession?.sessionId,sessionStatus:e.activeSession?.status,pendingAction:e.pendingAction,notesSaving:e.notesSaving,reviewPending:e.reviewPending,feedback:e.feedback,onAction:e.onAction,onOpenInEditor:e.onOpenInEditor,onSaveNote:e.onSaveNote,onCreatePullRequest:e.onCreatePullRequest,onLinkPullRequest:e.onLinkPullRequest})]})}):n===`conversation`?I?(0,K.jsx)(Ax,{panelKey:`conversation`,title:`Session chat`,subtitle:`Transcript first, controls second`,bodyClassName:`min-h-0 flex-1 overflow-hidden p-4`,children:(0,K.jsx)(Ch,{sessionId:e.activeSession?.sessionId??`no-session`,sessionLabel:ee,sessionAgent:e.activeSession?.agent??`unknown`,sessionStatus:e.activeSession?.status??`inactive`,sessionModel:null,runs:e.runs,eventBuffers:e.eventBuffers,workspacePath:e.workspace.path,runtime:F,disabled:!e.activeSession||!I,emptyStateTitle:`No transcript events`,emptyStateBody:e.activeSession?I?`The selected session has not published transcript, tool, or file attention events yet.`:`Connect the gateway to continue this session from the workspace view.`:`Select a session from this workspace to inspect transcript activity and continue the conversation.`,openSessionHref:e.activeSession?`/sessions/${e.activeSession.sessionId}`:void 0,placeholder:e.activeSession?I?`Continue the selected session...`:`Connect the gateway to send a new message.`:`Select a session to continue the conversation.`,onSubmit:e.onSubmit})}):(0,K.jsx)(Ax,{panelKey:`conversation`,title:`Session chat`,subtitle:`Selected session transcript, runtime notes, and next-turn input`,children:(0,K.jsx)(Mx,{title:`Connect the gateway to open live chat`,body:`This workspace can still be browsed locally, but session transcript and new messages require a connected gateway.`})}):n===`context`?(0,K.jsx)(Ax,{panelKey:`context`,title:`Trace`,subtitle:`Dispatch trace, files, and execution history`,children:e.activeSession?(0,K.jsx)(Bh,{sessionId:e.activeSession.sessionId,runs:e.runs,eventBuffers:e.eventBuffers,workspacePath:e.workspace.path,runtime:F}):(0,K.jsx)(Mx,{title:`No session context`,body:`Choose a session to unlock trace and file activity beside the chat.`})}):(0,K.jsx)(Ax,{panelKey:`details`,title:`Runtime`,subtitle:`Preview, shell, and workspace output`,children:F?(0,K.jsx)(fg,{runtime:F,rebase:e.workspace.rebase,sessionId:e.activeSession?.sessionId,sessionStatus:e.activeSession?.status??`inactive`,className:`border-0 bg-transparent p-0 shadow-none`}):(0,K.jsx)(Mx,{title:`Runtime details unavailable`,body:`The selected session is not currently publishing preview, terminal, or dev-server output.`})});return(0,K.jsxs)(`div`,{"data-testid":`workspace-shell`,className:`flex h-full min-h-0 w-full flex-1 flex-col gap-4 overflow-hidden px-3 py-4 sm:px-5 sm:py-6 xl:px-6`,children:[(0,K.jsxs)(`section`,{className:`shrink-0 rounded-3xl border border-border bg-card p-4 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-foreground-muted`,children:[(0,K.jsxs)(G,{to:`/workspaces`,className:`inline-flex items-center gap-1 text-primary`,children:[(0,K.jsx)(Lf,{className:`h-4 w-4`}),`Workspaces`]}),(0,K.jsx)(`span`,{children:`/`}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-foreground-secondary`,children:e.workspace.path})]}),(0,K.jsx)(`h1`,{className:`mt-2 text-2xl font-semibold tracking-tight`,style:{fontSize:`1.5rem`,lineHeight:1.1},children:e.workspace.name}),(0,K.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-foreground-muted`,children:C?`${C.issueKey} stays pinned here while the linked session chat and runtime stay beside it.`:`Keep the workspace, chat, and runtime together so you can continue work without losing context.`}),C?(0,K.jsx)(`div`,{className:`mt-3`,children:(0,K.jsxs)(G,{to:Tx(e.workspace,C.issueId),className:`inline-flex rounded-full border border-border px-3 py-1.5 text-sm text-primary`,"data-testid":`workspace-primary-issue-link-${C.issueKey}`,children:[C.issueKey,(0,K.jsxs)(`span`,{className:`ml-1 text-foreground-muted`,children:[`· `,C.issueTitle]})]})}):null]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsxs)(J,{type:`button`,variant:`ghost`,onClick:()=>e.onOpenInEditor(e.workspace,e.workspace.links.editorHref),children:[(0,K.jsx)(Xf,{className:`h-4 w-4`}),`Open in editor`]}),e.activeSession?(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>t(`/sessions/${e.activeSession.sessionId}`),children:`View session`}):null,(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>t(w),children:`New session`}),E.map(e=>{let t=e.icon;return(0,K.jsxs)(J,{type:`button`,variant:D[e.key]?`default`:`ghost`,size:`sm`,"data-testid":`panel-toggle-${e.key}`,"aria-pressed":D[e.key],onClick:()=>M(e.key),children:[(0,K.jsx)(t,{className:`h-4 w-4`}),e.label]},e.key)})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4 xl:grid-cols-[minmax(0,1.3fr)_minmax(18rem,0.7fr)]`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsxs)(`div`,{className:`rounded-full border border-border bg-background/65 px-3 py-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-foreground-muted`,children:`Status`}),(0,K.jsx)(`span`,{className:`ml-2 font-medium text-foreground`,children:e.workspace.status})]}),(0,K.jsxs)(`div`,{className:`rounded-full border border-border bg-background/65 px-3 py-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-foreground-muted`,children:`Branch`}),(0,K.jsx)(`span`,{className:`ml-2 font-mono text-foreground`,children:e.workspace.git.branch??`Unavailable`})]}),(0,K.jsxs)(`div`,{className:`rounded-full border border-border bg-background/65 px-3 py-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-foreground-muted`,children:`Sessions`}),(0,K.jsxs)(`span`,{className:`ml-2 font-medium text-foreground`,children:[e.workspace.sessions.active,`/`,e.workspace.sessions.total]})]}),(0,K.jsxs)(`div`,{className:`rounded-full border border-border bg-background/65 px-3 py-1.5 text-sm`,children:[(0,K.jsx)(`span`,{className:`text-foreground-muted`,children:`Dispatches`}),(0,K.jsxs)(`span`,{className:`ml-2 font-medium text-foreground`,children:[e.workspace.runs.active,`/`,e.workspace.runs.total]})]})]}),(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-background/65 p-4`,"data-testid":`workspace-context-bar`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:T?`Session`:`Workspace focus`}),(0,K.jsx)(`p`,{className:`mt-1 text-sm font-medium text-foreground`,children:T?ee:`Issue and repo stay visible here until a session attaches`}),e.activeSession?(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:[`Updated `,Dx(e.activeSession.updatedAt)]}):T?null:(0,K.jsx)(`p`,{className:`mt-1 text-xs text-foreground-muted`,children:`Open the linked issue or board when you want to create a session against this workspace.`}),e.workspace.ownership?(0,K.jsxs)(`div`,{className:`mt-3 text-xs text-foreground-muted`,"data-testid":`workspace-ownership-summary`,children:[(0,K.jsx)(`span`,{className:`font-semibold text-foreground`,children:`Linked to:`}),` `,e.workspace.ownership.project?e.workspace.ownership.project.projectKey:`Unassigned`,e.workspace.ownership.issue?` / ${e.workspace.ownership.issue.issueKey}`:``,e.workspace.ownership.host?` · ${e.workspace.ownership.host.label}`:``]}):null]}),T?(0,K.jsxs)(`label`,{className:`w-full xl:max-w-sm`,"data-testid":`workspace-session-select`,children:[(0,K.jsx)(`span`,{className:`sr-only`,children:`Select workspace session`}),(0,K.jsx)(en,{value:e.selectedSessionId??``,onChange:e.onSelectSession,options:e.sessions.map(e=>({label:`${e.title??e.sessionId} · ${e.status} · ${e.agent}`,value:e.sessionId}))})]}):(0,K.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border px-4 py-3 text-sm text-foreground-muted`,children:`No sessions attached`})]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:(e.workspace.issues??[]).length>0?(e.workspace.issues??[]).map(t=>(0,K.jsxs)(G,{to:Tx(e.workspace,t.issueId),className:`rounded-full border border-border px-3 py-1.5 text-xs text-primary`,"data-testid":`workspace-issue-link-${t.issueKey}`,title:t.issueTitle,children:[t.issueKey,(0,K.jsxs)(`span`,{className:`ml-1 text-foreground-muted`,children:[`· `,t.issueTitle]})]},`${e.workspace.path}-${t.issueId}`)):(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-xs text-foreground-muted`,children:`No linked issues`})})]})]})]}),A?(0,K.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-3xl border border-border bg-card p-4 shadow-lg`,children:[(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,"data-testid":`workspace-mobile-panel-selector`,children:O.map(e=>(0,K.jsx)(J,{type:`button`,"data-testid":`workspace-mobile-panel-${e}`,variant:h===e?`default`:`ghost`,size:`sm`,onClick:()=>g(e),children:Cx.find(t=>t.key===e)?.label??e},e))}),(0,K.jsx)(`div`,{className:`mt-4 min-h-0 flex-1`,children:ne(h)})]}):(0,K.jsx)(`div`,{ref:S,"data-testid":`workspace-desktop-panels`,className:`grid min-h-0 flex-1 items-stretch overflow-hidden`,style:{gridTemplateColumns:P},children:O.map((e,t)=>{let n=O[t+1];return(0,K.jsxs)(`div`,{className:`contents`,children:[ne(e),n?(0,K.jsx)(`div`,{className:`flex items-stretch justify-center py-2`,children:(0,K.jsx)(jx,{testId:`workspace-resize-${e}-${n}`,onMouseDown:N(e,n)})}):null]},e)})}),(0,K.jsx)(kx,{open:p,panels:E,visibility:D,onOpenChange:m,onTogglePanel:M})]})}function Px(e){return e?new Date(e).toLocaleString():`No recent activity`}function Fx(e){return e.length<=72?e:`${e.slice(0,32)}...${e.slice(-28)}`}function Ix(e){return`/workspaces?workspace=${encodeURIComponent(e)}`}function Lx(e){let t=e.replace(/[\\/]+/g,`/`).replace(/\/$/,``).split(`/`);return t[t.length-1]||e}function Rx(e){return e==null||!Number.isFinite(e)?`unavailable`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:e>=1?2:4,maximumFractionDigits:4}).format(e)}function zx(e){return e===`approved`||e===`ready`||e===`passing`||e===`published`||e===`merged`?`border-success/20 bg-success/10 text-success`:e===`pending`||e===`in-review`?`border-warning/20 bg-warning/10 text-warning`:e===`changes-requested`||e===`blocked`||e===`failing`||e===`failed`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}function Bx(e,t){let n=!1,r=0;for(let i of e){let e=t[i];if(e)for(let t of e.events)t.type!==`cost`||!t.cost||typeof t.cost!=`object`||(r+=Number(t.cost.totalUsd??0),n=!0)}return n?r:null}function Vx(e,t,n=[]){return n.length>0?`Explicit ownership: ${n.filter(e=>!!e.ownership?.issue).length} issue, ${n.filter(e=>e.ownership?.source===`created-from-project`).length} project, ${n.filter(e=>e.ownership?.source===`created-from-host`).length} host`:e?`${t.length} live session${t.length===1?``:`s`} attached to the current workspace inventory`:`Gateway disconnected: browsing saved workspaces and local worktrees only`}function Hx(e,t){let n=e.ownership?.project?.projectId??e.issues?.find(e=>e.issueId===t)?.projectId;return n?`/projects/${encodeURIComponent(n)}/issues/${encodeURIComponent(t)}`:`/issues/${encodeURIComponent(t)}`}function Ux(e){return e.ownership?.issue&&e.ownership.project?`${e.ownership.project.projectKey} / ${e.ownership.issue.issueKey}`:e.ownership?.source===`created-from-host`&&e.ownership.project&&e.ownership.host?`${e.ownership.project.projectKey} / ${e.ownership.host.label}`:e.ownership?.project?`${e.ownership.project.projectKey} project`:e.ownership?.host?`${e.ownership.host.label} host`:null}function Wx(e){return e.trim().toLowerCase()}function Gx(e){return[e.name,e.path,e.git.branch??``,e.git.root??``,Ux(e)??``,...(e.issues??[]).flatMap(e=>[e.issueKey,e.issueTitle,e.projectKey,e.projectName])].join(`
35
+ `).toLowerCase()}function Kx(e,t){return t?Gx(e).includes(t):!0}function qx(e){return e===`active`?0:e===`idle`?1:e===`archived`?2:3}function Jx(e){return[...e].sort((e,t)=>{let n=Number(!!t.pinnedAt)-Number(!!e.pinnedAt);if(n!==0)return n;let r=qx(e.status)-qx(t.status);return r===0?e.path.localeCompare(t.path):r})}async function Yx(e,t){let n=t?.trim()||null,r=e.length===0?await fetch(n?`/api/workspaces?workspace=${encodeURIComponent(n)}`:`/api/workspaces`):await fetch(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({sessions:e,...n?{focusWorkspacePath:n}:{}})});if(!r.ok)throw Error(`Workspace inventory request failed: ${r.status}`);return await r.json()}async function Xx(e,t,n,r){let i=await fetch(`/api/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:e,workspacePath:t,sessions:n,note:r})});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error??`Workspace action failed: ${i.status}`)}return await i.json()}function Zx(e){switch(e){case`ready-for-review`:case`ready-for-merge`:return`border-success/20 bg-success/10 text-success`;case`rebase-needed`:return`border-warning/20 bg-warning/10 text-warning`;case`rebase-conflicts`:return`border-error/20 bg-error/10 text-error`;default:return`border-border text-foreground-muted`}}function Qx(e){return e.replace(/-/g,` `)}function $x(e){return new Map(e.map(e=>[e.targetId,{decision:e.decision,queueState:e.queueState,commentCount:e.comments.length,openCommentCount:e.comments.filter(e=>e.status===`open`).length,latestActivityAt:e.updatedAt}]))}function eS(e){return new Map(e.map(e=>[e.targetId,e]))}function tS(e){switch(e){case`connected`:return`border-success/20 bg-success/10 text-success`;case`partial-setup`:case`missing-scopes`:return`border-warning/20 bg-warning/10 text-warning`;case`expired-auth`:case`failing`:return`border-error/20 bg-error/10 text-error`;default:return`border-border text-foreground-muted`}}function nS(e){return e===`azure-repos`?`Azure Repos`:`GitHub`}function rS(e){let t=[];return e.status===`missing`&&t.push(`Recovery required`),e.rebase&&t.push(`Rebase ${Qx(e.rebase.status)}`),e.review&&(e.review.decision===`changes-requested`?t.push(`Changes requested`):(e.review.decision===`pending`||e.review.queueState!==`completed`)&&t.push(`Review pending`),e.review.openCommentCount>0&&t.push(`${e.review.openCommentCount} open comment${e.review.openCommentCount===1?``:`s`}`)),t}function iS(e){return rS(e).length>0}function aS(e,t,n){let r=[],i=e.status===`active`||e.sessions.active>0||e.runs.active>0;r.push({label:e.status===`missing`?`Missing`:e.status===`archived`?`Archived`:i?`Running`:`Idle`,className:e.status===`missing`?`border-error/20 bg-error/10 text-error`:e.status===`archived`?`border-warning/20 bg-warning/10 text-warning`:i?`border-success/20 bg-success/10 text-success`:`border-border text-foreground-muted`}),iS(e)&&r.push({label:`Needs attention`,className:`border-warning/20 bg-warning/10 text-warning`}),e.pinnedAt&&r.push({label:`Pinned`,className:`border-primary/20 bg-primary/10 text-primary`});let a=t?.runtime?.devServer.status;return a&&r.push({label:`Dev server ${a.replace(/-/g,` `)}`,className:a===`running`?`border-success/20 bg-success/10 text-success`:a===`error`?`border-error/20 bg-error/10 text-error`:`border-border text-foreground-muted`}),n&&r.push({label:`PR ${n.status.replace(/-/g,` `)}`,className:q(`border px-2 py-0.5 text-xs`,zx(n.status))}),r}function oS(e){return e.status===`missing`||e.rebase?.status===`rebase-conflicts`?0:e.review?.decision===`changes-requested`?1:e.rebase?.status===`rebase-needed`||e.review?.decision===`pending`||e.review?.queueState===`queued`||e.review?.queueState===`in-review`||(e.review?.openCommentCount??0)>0?2:e.rebase?3:4}var sS=24;function cS(e,t){let n=oS(e)-oS(t);if(n!==0)return n;let r=Date.parse(e.lastActivityAt??``),i=Date.parse(t.lastActivityAt??``),a=(Number.isFinite(i)?i:0)-(Number.isFinite(r)?r:0);return a===0?e.path.localeCompare(t.path):a}function lS(e){let t=Be(),[n]=Pt(),[r,i]=(0,b.useState)(null),[a,o]=(0,b.useState)(null),[s,c]=(0,b.useState)(!0),[l,u]=(0,b.useState)(!1),[d,f]=(0,b.useState)(null),[p,m]=(0,b.useState)(null),[h,g]=(0,b.useState)({}),[_,v]=(0,b.useState)(null),[y,x]=Wh(`workspace-sidebar.layout-mode`,`grouped`),[S,C]=Wh(`workspace-sidebar.search`,``),[w,T]=(0,b.useState)(0),[E,D]=(0,b.useTransition)(),{snapshot:O}=Zm(),k=Dv({targetType:`workspace`}),A=e.mode??`full`,j=e.selectedWorkspacePath??(n.get(`workspace`)?.trim()||null),M=s||l,N=(0,b.useMemo)(()=>e.sessions,[(0,b.useMemo)(()=>JSON.stringify(e.sessions.map(e=>({sessionId:e.sessionId,status:e.status,cwd:e.cwd??``,activeRunId:e.activeRunId??``,latestRunId:e.latestRunId??``}))),[e.sessions])]);(0,b.useEffect)(()=>{let e=!1;return r?u(!0):c(!0),o(null),Yx(N,j).then(t=>{e||i(t)}).catch(t=>{e||o(t instanceof Error?t.message:String(t))}).finally(()=>{e||(c(!1),u(!1))}),()=>{e=!0}},[N,j]);let P=r?.summary??{total:0,active:0,idle:0,archived:0,missing:0},ee=(0,b.useMemo)(()=>$x(k.artifacts),[k.artifacts]),F=(0,b.useMemo)(()=>eS(k.artifacts),[k.artifacts]),I=(0,b.useMemo)(()=>(r?.workspaces??[]).map(e=>({...e,review:ee.get(e.path)??e.review})),[r?.workspaces,ee]),te=(0,b.useMemo)(()=>Wx(S),[S]),ne=(0,b.useMemo)(()=>Jx(I.filter(e=>Kx(e,te))),[te,I]),re=(0,b.useMemo)(()=>({pinned:ne.filter(e=>!!e.pinnedAt),active:ne.filter(e=>e.status===`active`&&!e.pinnedAt),idle:ne.filter(e=>e.status===`idle`&&!e.pinnedAt),archived:ne.filter(e=>e.status===`archived`&&!e.pinnedAt),missing:ne.filter(e=>e.status===`missing`&&!e.pinnedAt)}),[ne]),ie=Math.max(1,Math.ceil(ne.length/sS)),L=Math.min(w,ie-1),R=(0,b.useMemo)(()=>ne.slice(L*sS,(L+1)*sS),[ne,L]),ae=(0,b.useMemo)(()=>({pinned:R.filter(e=>!!e.pinnedAt),active:R.filter(e=>e.status===`active`&&!e.pinnedAt),idle:R.filter(e=>e.status===`idle`&&!e.pinnedAt),archived:R.filter(e=>e.status===`archived`&&!e.pinnedAt),missing:R.filter(e=>e.status===`missing`&&!e.pinnedAt)}),[R]),oe=I.length-ne.length,se=te?`No workspaces match "${S}". Clear the search or adjust the layout to widen the sidebar.`:`No workspaces are currently tracked in the sidebar.`,ce=(0,b.useMemo)(()=>[...I].filter(iS).sort(cS),[I]),le=(0,b.useMemo)(()=>({total:ce.length,recovery:ce.filter(e=>e.status===`missing`).length,rebase:ce.filter(e=>!!e.rebase).length,review:ce.filter(e=>!!e.review&&(e.review?.decision!==`approved`||e.review?.queueState!==`completed`||(e.review?.openCommentCount??0)>0)).length}),[ce]),ue=(0,b.useMemo)(()=>O?new Map(e.sessions.map(e=>[e.sessionId,cx(O,e.sessionId)])):new Map,[e.sessions,O]),z=(0,b.useMemo)(()=>j?I.find(e=>e.path===j)??null:null,[j,I]),de=(0,b.useMemo)(()=>z?z.sessions.items.map(t=>e.sessions.find(e=>e.sessionId===t.sessionId)??t).sort((e,t)=>e.status===t.status?Number(t.updatedAt??0)-Number(e.updatedAt??0):e.status===`active`?-1:1):[],[e.sessions,z]);(0,b.useEffect)(()=>{if(de.length===0){v(null);return}v(e=>e&&de.some(t=>t.sessionId===e)?e:de.find(e=>e.status===`active`)?.sessionId??de[0]?.sessionId??null)},[de]);let fe=(0,b.useMemo)(()=>de.find(e=>e.sessionId===_)??null,[_,de]),pe=(0,b.useMemo)(()=>(e.allRuns??[]).filter(e=>String(e.sessionId??``)===_).sort((e,t)=>Number(t.startedAt??0)-Number(e.startedAt??0)),[e.allRuns,_]),me=e.eventBuffers??{},he=(0,b.useMemo)(()=>pe.map(e=>String(e.runId??``)),[pe]),ge=(0,b.useMemo)(()=>Bx(he,me),[me,he]),_e=k.artifacts.length>0||(k.summary?.pendingCount??0)>0||(k.summary?.approvedCount??0)>0||(k.summary?.openCommentCount??0)>0;(0,b.useEffect)(()=>{T(0)},[S,y]),(0,b.useEffect)(()=>{w!==L&&T(L)},[w,L]),(0,b.useEffect)(()=>{if(!j)return;let e=Array.from(document.querySelectorAll(`[data-workspace-path]`)).find(e=>e.getAttribute(`data-workspace-path`)===j);!e||typeof e.scrollIntoView!=`function`||e.scrollIntoView({behavior:`smooth`,block:`center`})},[j,r?.workspaces.length]);function ve(){D(()=>{r?u(!0):c(!0),o(null),Yx(N,j).then(e=>i(e)).catch(e=>o(e instanceof Error?e.message:String(e))).finally(()=>{c(!1),u(!1)})})}function ye(e,t){g(n=>({...n,[e]:t}))}function be(e,t,n){return typeof window>`u`?!1:t?window.open(t,`_blank`,`noopener,noreferrer`)?(ye(e.path,{tone:`success`,message:n}),!0):(ye(e.path,{tone:`error`,message:`Editor action failed for ${e.path}. The link may have been blocked by the browser or the editor handler is unavailable.`}),!1):(ye(e.path,{tone:`error`,message:`Editor action failed for ${e.path}: no editor link is available.`}),!1)}function xe(t,n){let r=t===`cleanup`?`Remove the git worktree at ${n.path}? This should only be used for archived, inactive workspaces.`:t===`archive`?`Archive ${n.path} in the kanban workspace inventory?`:t===`recover`?`Recover ${n.path} back into the active inventory?`:t===`rebase-abort`?`Abort the current rebase workflow for ${n.path}?`:null;r&&typeof window<`u`&&!window.confirm(r)||(f(`${t}:${n.path}`),o(null),ye(n.path,null),D(()=>{Xx(t,n.path,e.sessions).then(e=>{i(e);let r=e.workspaces.find(e=>e.path===n.path),a=e.result?.message??`Updated ${n.path}.`;if(t===`rebase-open-in-editor`&&typeof window<`u`){let e=r?.rebase?.editorHref;if(!be({path:n.path,links:{editorHref:e??r?.links.editorHref??n.links.editorHref}},e??r?.links.editorHref??n.links.editorHref,a))return}ye(n.path,{tone:`success`,message:a})}).catch(e=>{let t=e instanceof Error?e.message:String(e);o(t),ye(n.path,{tone:`error`,message:t})}).finally(()=>f(null))}))}function Se(t,n){m(t.path),o(null),ye(t.path,null),D(()=>{Xx(`notes-save`,t.path,e.sessions,n).then(e=>{i(e);let n=e.result?.message??`Updated notes for ${t.path}.`;ye(t.path,{tone:`success`,message:n})}).catch(e=>{let n=e instanceof Error?e.message:String(e);o(n),ye(t.path,{tone:`error`,message:n})}).finally(()=>m(null))})}function Ce(e,t,n){if(!t){let t=`Workspace review artifact not found for ${e.path}.`;o(t),ye(e.path,{tone:`error`,message:t});return}o(null),ye(e.path,null),D(()=>{k.actOnReview({action:`create-pull-request`,artifactId:t.id,...n}).then(()=>{ye(e.path,{tone:`success`,message:`Created linked PR for ${e.path}.`})}).catch(t=>{let n=t instanceof Error?t.message:String(t);o(n),ye(e.path,{tone:`error`,message:n})})})}function B(e,t,n){if(!t){let t=`Workspace review artifact not found for ${e.path}.`;o(t),ye(e.path,{tone:`error`,message:t});return}o(null),ye(e.path,null),D(()=>{k.actOnReview({action:`link-pull-request`,artifactId:t.id,...n}).then(()=>{ye(e.path,{tone:`success`,message:`Linked PR #${n.number} to ${e.path}.`})}).catch(t=>{let n=t instanceof Error?t.message:String(t);o(n),ye(e.path,{tone:`error`,message:n})})})}async function we(t){if(!_||!e.onSendPrompt)return;let n=await e.onSendPrompt({...t,sessionId:_,agent:t.agent??fe?.agent});n?.sessionId&&n.sessionId!==_&&(v(n.sessionId),ve())}if(j){let n=z==null?void 0:F.get(z.path)??void 0;return s&&!r?(0,K.jsxs)(pf,{children:[(0,K.jsx)(`section`,{className:`rounded-3xl border border-border bg-card p-5 shadow-lg`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`button`,{type:`button`,className:`inline-flex items-center gap-1 text-primary`,onClick:()=>t(`/workspaces`),children:`Back to workspaces`}),(0,K.jsx)(`span`,{children:`/`}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-foreground-secondary`,children:Fx(j)})]}),(0,K.jsx)(`div`,{className:`mt-3 text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspace`}),(0,K.jsx)(`h1`,{className:`mt-3 text-3xl font-semibold tracking-tight`,children:Lx(j)}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Loading the linked issue, session roster, and runtime so you can stay on this route instead of bouncing through a waiting screen.`})]}),(0,K.jsx)(`span`,{className:`rounded-full border border-border bg-background/65 px-3 py-1.5 text-xs text-foreground-muted`,children:`Workspace handoff`})]})}),(0,K.jsxs)(`div`,{"data-testid":`workspace-loading-shell`,className:`grid gap-5 xl:grid-cols-[minmax(18rem,0.95fr)_minmax(0,1.7fr)]`,children:[(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-5 shadow-lg`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspace`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[(0,K.jsx)(`div`,{className:`h-20 rounded-2xl border border-dashed border-border bg-background/65`}),(0,K.jsx)(`div`,{className:`h-40 rounded-2xl border border-dashed border-border bg-background/65`})]})]}),(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-5 shadow-lg`,children:[(0,K.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Chat`}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3`,children:[(0,K.jsx)(`div`,{className:`h-24 rounded-2xl border border-dashed border-border bg-background/65`}),(0,K.jsx)(`div`,{className:`h-24 rounded-2xl border border-dashed border-border bg-background/65`}),(0,K.jsx)(`div`,{className:`h-36 rounded-2xl border border-dashed border-border bg-background/65`})]})]})]})]}):z?(0,K.jsx)(Nx,{workspace:z,sessions:de,activeSession:fe,runs:pe,eventBuffers:me,totalCostLabel:Rx(ge),selectedSessionId:_,onSelectSession:v,pendingAction:d,notesSaving:p===z.path,canSendMessages:!!e.onSendPrompt,feedback:h[z.path]??null,onSubmit:we,onAction:xe,onOpenInEditor:(e,t)=>be(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:Se,reviewArtifact:n,reviewPending:k.pendingArtifactId===n?.id,onCreatePullRequest:(e,t)=>Ce(e,n,t),onLinkPullRequest:(e,t)=>B(e,n,t)}):(0,K.jsx)(pf,{children:(0,K.jsxs)(mf,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspace`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Workspace not found`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`The selected workspace is not in the current workspace list. Refresh and try again, or go back to all workspaces.`}),(0,K.jsx)(`div`,{className:`mt-5`,children:(0,K.jsx)(J,{variant:`ghost`,onClick:()=>t(`/workspaces`),children:`Back to workspaces`})})]})})}return A===`attention`?(0,K.jsxs)(pf,{children:[(0,K.jsxs)(mf,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Inbox`}),(0,K.jsx)(`h1`,{className:`mt-2 text-3xl font-semibold tracking-tight`,children:`Workspaces that need attention`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Only actionable workspaces appear here. Recovery states, rebase workflows, and review handoffs stay in the inbox so active or idle worktrees do not create noise.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsx)(J,{variant:`ghost`,onClick:()=>t(`/workspaces`),children:`Open full inventory`}),(0,K.jsxs)(J,{variant:`ghost`,onClick:ve,disabled:M||E,children:[(0,K.jsx)(Pp,{className:`mr-2 h-4 w-4`}),`Refresh inbox`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-5 grid gap-3 md:grid-cols-4`,children:[(0,K.jsx)(uS,{label:`Needs attention`,value:String(le.total)}),(0,K.jsx)(uS,{label:`Recovery`,value:String(le.recovery)}),(0,K.jsx)(uS,{label:`Rebase`,value:String(le.rebase)}),(0,K.jsx)(uS,{label:`Review`,value:String(le.review)})]}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:Vx(e.isAuthenticated,e.sessions)}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:`The inbox excludes healthy active and idle workspaces.`})]})]}),a?(0,K.jsx)(`section`,{className:`rounded-3xl border border-error/30 bg-error/10 p-4 text-sm text-error`,children:a}):null,(0,K.jsx)(dS,{title:`Needs attention`,icon:$p,empty:`No workspaces currently need attention.`,workspaces:ce,artifactByPath:F,reviewByPath:ee,executionContextsBySessionId:ue,pendingAction:d,onAction:xe,onOpenInEditor:(e,t)=>be(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:Se,pendingNotePath:p,feedbackByWorkspacePath:h,selectedWorkspacePath:j,reviewPendingArtifactId:k.pendingArtifactId,onCreatePullRequest:Ce,onLinkPullRequest:B,highlightReasons:!0})]}):(0,K.jsxs)(pf,{children:[a?(0,K.jsx)(`section`,{className:`rounded-3xl border border-error/30 bg-error/10 p-4 text-sm text-error`,children:a}):null,(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,"data-testid":`workspace-sidebar-surface`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-end justify-between gap-4`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Workspaces`}),(0,K.jsx)(`h1`,{className:`mt-2 max-w-4xl font-semibold tracking-tight`,style:{fontSize:`clamp(2.35rem, 4.2vw, 4.4rem)`,lineHeight:.94},children:`Find the right workspace and jump back into the session`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Search by issue, branch, or ownership, open the workspace you need, and reveal review or maintenance detail only when it becomes relevant.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,K.jsx)(J,{variant:`primary`,onClick:()=>t(`/workspaces/new`),children:`Provision workspace`}),(0,K.jsxs)(J,{variant:`ghost`,onClick:ve,disabled:M||E,children:[(0,K.jsx)(Pp,{className:`mr-2 h-4 w-4`}),`Refresh inventory`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:Vx(e.isAuthenticated,e.sessions,I)}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[P.total,` known`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[P.active,` active`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[ce.length,` need attention`]})]}),(0,K.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-sm text-foreground-muted`,children:[(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:`Open the workspace first`}),(0,K.jsx)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:`Reveal maintenance only on demand`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{type:`button`,variant:y===`grouped`?`primary`:`ghost`,size:`sm`,onClick:()=>x(`grouped`),"aria-pressed":y===`grouped`,children:`Grouped`}),(0,K.jsx)(J,{type:`button`,variant:y===`flat`?`primary`:`ghost`,size:`sm`,onClick:()=>x(`flat`),"aria-pressed":y===`flat`,children:`Flat`})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,K.jsxs)(`label`,{className:`relative min-w-[260px] flex-1`,children:[(0,K.jsx)(Lp,{className:`pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-foreground-muted`}),(0,K.jsx)(`input`,{value:S,onChange:e=>C(e.target.value),placeholder:`Search workspaces, branches, issues, or ownership`,"aria-label":`Workspace search`,className:`h-11 w-full rounded-2xl border border-border bg-background pl-10 pr-3 text-sm outline-none transition focus:border-primary/40`})]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-sm text-foreground-muted`,children:[ne.length,` visible`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-sm text-foreground-muted`,children:[`Page `,L+1,` of `,ie]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-sm text-foreground-muted`,children:[re.pinned.length,` pinned`]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5 text-sm text-foreground-muted`,children:[ce.length,` need attention`]}),oe>0?(0,K.jsxs)(`span`,{className:`rounded-full border border-warning/20 bg-warning/10 px-3 py-1.5 text-sm text-warning`,children:[oe,` hidden by search`]}):null]}),s&&I.length===0?(0,K.jsx)(`div`,{className:`mt-5 rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:`Loading workspace sidebar…`}):null,!s&&ne.length===0?(0,K.jsx)(`div`,{className:`mt-5 rounded-2xl border border-border bg-background/70 p-4 text-sm text-foreground-muted`,children:se}):null,ne.length>0?(0,K.jsxs)(`div`,{className:`mt-5 space-y-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-border bg-background/70 px-4 py-3 text-sm`,children:[(0,K.jsxs)(`div`,{className:`text-foreground-muted`,children:[`Showing workspaces `,L*sS+1,`-`,Math.min((L+1)*sS,ne.length),` of `,ne.length]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,disabled:L===0,onClick:()=>T(e=>Math.max(0,e-1)),children:`Previous`}),(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,disabled:L>=ie-1,onClick:()=>T(e=>Math.min(ie-1,e+1)),children:`Next`})]})]}),y===`flat`?(0,K.jsx)(dS,{title:`Workspace list`,icon:ip,empty:se,workspaces:R,reviewByPath:ee,artifactByPath:F,executionContextsBySessionId:ue,pendingAction:d,onAction:xe,onOpenInEditor:(e,t)=>be(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:Se,pendingNotePath:p,feedbackByWorkspacePath:h,selectedWorkspacePath:j,reviewPendingArtifactId:k.pendingArtifactId,onCreatePullRequest:Ce,onLinkPullRequest:B,highlightReasons:!0}):(0,K.jsx)(Yt,{items:[...ae.pinned.length>0?[{title:`Pinned workspaces (${ae.pinned.length})`,body:(0,K.jsx)(dS,{title:`Pinned workspaces`,icon:Op,empty:`No pinned workspaces match the current sidebar filters.`,workspaces:ae.pinned,reviewByPath:ee,artifactByPath:F,executionContextsBySessionId:ue,pendingAction:d,onAction:xe,onOpenInEditor:(e,t)=>be(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:Se,pendingNotePath:p,feedbackByWorkspacePath:h,selectedWorkspacePath:j,reviewPendingArtifactId:k.pendingArtifactId,onCreatePullRequest:Ce,onLinkPullRequest:B,highlightReasons:!0})}]:[],...[{key:`active`,title:`Active workspaces`,icon:ip,empty:`No active workspaces are currently visible.`,workspaces:ae.active},{key:`idle`,title:`Idle workspaces`,icon:om,empty:`No idle workspaces are currently visible.`,workspaces:ae.idle},{key:`archived`,title:`Archived workspaces`,icon:Df,empty:`No archived workspaces are currently visible.`,workspaces:ae.archived},{key:`missing`,title:`Recovery queue`,icon:$p,empty:`No missing workspaces are currently visible.`,workspaces:ae.missing}].map(e=>({title:`${e.title} (${e.workspaces.length})`,body:(0,K.jsx)(dS,{title:e.title,icon:e.icon,empty:e.empty,workspaces:e.workspaces,reviewByPath:ee,artifactByPath:F,executionContextsBySessionId:ue,pendingAction:d,onAction:xe,onOpenInEditor:(e,t)=>be(e,t,`Opened ${e.path} in the configured editor.`),onSaveNote:Se,pendingNotePath:p,feedbackByWorkspacePath:h,selectedWorkspacePath:j,reviewPendingArtifactId:k.pendingArtifactId,onCreatePullRequest:Ce,onLinkPullRequest:B,highlightReasons:!0})}))]})]}):null]}),_e?(0,K.jsxs)(`details`,{className:`rounded-3xl border border-border bg-card shadow-lg`,"data-testid":`workspace-review-queue-details`,children:[(0,K.jsxs)(`summary`,{className:`flex cursor-pointer flex-wrap items-start justify-between gap-4 px-6 py-5`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-primary/80`,children:`Review queue`}),(0,K.jsx)(`h2`,{className:`mt-2 text-xl font-semibold tracking-tight`,children:`Workspace diff and approval handoff`}),(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-foreground-muted`,children:`Keep review, comments, and approval state nearby without letting it crowd the inventory by default.`})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 text-xs text-foreground-muted`,children:[(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[`queued `,k.summary?.pendingCount??0]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[`approved `,k.summary?.approvedCount??0]}),(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-3 py-1.5`,children:[`open comments `,k.summary?.openCommentCount??0]})]})]}),(0,K.jsx)(`div`,{className:`border-t border-border px-6 py-6`,children:(0,K.jsx)(Qv,{title:`Workspace diff and approval handoff`,description:`Workspace review, comments, and approval state stay together here.`,empty:`No workspace reviews are queued yet.`,loading:k.loading,error:k.error,artifacts:k.artifacts,queue:k.queue,summary:k.summary,pendingArtifactId:k.pendingArtifactId,onApprove:e=>k.actOnReview({action:`approve`,artifactId:e}).then(()=>ve()),onRequestChanges:e=>k.actOnReview({action:`request-changes`,artifactId:e}).then(()=>ve()),onSubmitReview:e=>k.actOnReview({action:`submit-review`,...e}).then(()=>ve()),onAddComment:e=>k.actOnReview({action:`add-comment`,...e}).then(()=>ve())})})]}):null]})}function uS(e){return(0,K.jsxs)(`article`,{className:`rounded-2xl border border-border bg-background/70 p-4`,children:[(0,K.jsx)(`p`,{className:`text-xs uppercase tracking-[0.2em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:`mt-2 text-2xl font-semibold tracking-tight`,children:e.value})]})}function dS(e){let t=e.icon,n=Be(),[r,i]=(0,b.useState)({});function a(e){i(t=>({...t,[e]:!t[e]}))}return(0,K.jsxs)(`section`,{className:`rounded-3xl border border-border bg-card p-6 shadow-lg`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-2xl border border-primary/20 bg-primary/10 text-primary`,children:(0,K.jsx)(t,{className:`h-4 w-4`})}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:e.title}),(0,K.jsxs)(`p`,{className:`text-sm text-foreground-muted`,children:[e.workspaces.length,` tracked`]})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-4`,children:[e.workspaces.map(t=>{let i=e.highlightReasons?rS(t):[],o=`pin:${t.path}`,s=`unpin:${t.path}`,c=`archive:${t.path}`,l=`cleanup:${t.path}`,u=`recover:${t.path}`,d=t.sessions.items.find(e=>e.status===`active`&&e.runtime)??t.sessions.items.find(e=>e.runtime),f=t.sessions.items.find(e=>e.status===`active`)??d??t.sessions.items[0]??null,p=t.issues?.[0]??null,m=e.reviewByPath.get(t.path)??t.review,h=e.artifactByPath.get(t.path),g=h?.linkedPullRequest,_=h?.integration,v=aS(t,d??null,g),y=e.selectedWorkspacePath===t.path,b=!!y||!!r[t.path];return(0,K.jsxs)(`article`,{"data-workspace-path":t.path,className:q(`rounded-2xl border bg-background/70 p-4`,y?`border-primary/40 ring-1 ring-primary/20`:`border-border`),children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(`strong`,{className:`text-base`,children:t.name}),v.map(e=>(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs`,e.className),children:e.label},`${t.path}:${e.label}`)),t.git.branch?(0,K.jsx)(`span`,{className:`rounded-full border border-info/20 bg-info/10 px-2 py-0.5 text-xs text-info`,children:t.git.branch}):null,t.rebase?(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs`,Zx(t.rebase.status)),children:Qx(t.rebase.status)}):null,m?(0,K.jsxs)(`span`,{className:`rounded-full border border-primary/20 bg-primary/10 px-2 py-0.5 text-xs text-primary`,children:[m.decision,` · `,m.openCommentCount,` open`]}):null,g?(0,K.jsxs)(`span`,{className:`rounded-full border border-border px-2 py-0.5 text-xs text-foreground-muted`,children:[nS(g.provider),` PR `,g.status.replace(/-/g,` `)]}):null]}),(0,K.jsx)(`p`,{className:`mt-2 font-mono text-xs text-foreground-muted`,title:t.path,children:Fx(t.path)}),Ux(t)?(0,K.jsxs)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:[`Workspace owner `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:Ux(t)})]}):null,f?(0,K.jsxs)(`p`,{className:`mt-2 text-sm text-foreground-muted`,children:[`Resume `,(0,K.jsx)(`span`,{className:`font-medium text-foreground`,children:f.title??f.sessionId}),` `,`from here instead of hunting through workspace maintenance.`]}):null,i.length>0?(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:i.map(e=>(0,K.jsx)(`span`,{className:`rounded-full border border-warning/20 bg-warning/10 px-2 py-0.5 text-xs text-warning`,children:e},`${t.path}:${e}`))}):null]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>a(t.path),children:b?`Hide details`:`Show details`}),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>e.onAction(t.pinnedAt?`unpin`:`pin`,t),disabled:t.pinnedAt?!t.actions.canUnpin||e.pendingAction===s:!t.actions.canPin||e.pendingAction===o,children:[t.pinnedAt?(0,K.jsx)(Dp,{className:`mr-2 h-4 w-4`}):(0,K.jsx)(Op,{className:`mr-2 h-4 w-4`}),t.pinnedAt?`Unpin`:`Pin`]}),p?(0,K.jsx)(G,{to:Hx(t,p.issueId),className:`inline-flex h-9 items-center rounded-xl border border-border bg-transparent px-3 text-sm font-medium text-foreground transition-colors hover:border-primary/30 hover:bg-card`,children:`Open issue`}):null,f?(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>n(`/sessions/${f.sessionId}`),children:`Open chat`}):null,(0,K.jsx)(J,{variant:`ghost`,size:`sm`,onClick:()=>n(Ix(t.path)),children:`Open shell`})]})]}),(0,K.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2 xl:grid-cols-4`,children:[(0,K.jsx)(fS,{label:`Sessions`,value:`${t.sessions.active}/${t.sessions.total}`}),(0,K.jsx)(fS,{label:`Dispatches`,value:`${t.runs.active}/${t.runs.total}`}),(0,K.jsx)(fS,{label:`Git`,value:t.git.isPrimary?`primary`:t.git.isWorktree?`worktree`:`repo`}),(0,K.jsx)(fS,{label:`Changes`,value:t.git.dirty==null?`unknown`:t.git.dirty?`dirty`:`clean`})]}),(t.issues??[]).length>0?(0,K.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:(t.issues??[]).map(e=>(0,K.jsxs)(G,{to:Hx(t,e.issueId),className:`rounded-full border border-border px-2.5 py-1 text-xs text-primary`,title:e.issueTitle,children:[e.issueKey,(0,K.jsxs)(`span`,{className:`ml-1 text-foreground-muted`,children:[`· `,e.issueTitle]})]},`${t.path}-${e.issueId}`))}):null,(0,K.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-3 text-sm text-foreground-muted`,children:[t.sessions.items.slice(0,2).map(e=>(0,K.jsxs)(G,{to:`/sessions/${e.sessionId}`,className:`text-primary`,children:[`Session `,e.sessionId]},e.sessionId)),t.sessions.items.length>2?(0,K.jsxs)(`span`,{children:[`+`,t.sessions.items.length-2,` more sessions`]}):null,t.git.root?(0,K.jsxs)(`span`,{children:[`Root: `,Fx(t.git.root)]}):null]}),(0,K.jsxs)(`p`,{className:`mt-3 text-xs text-foreground-muted`,children:[`Last activity: `,Px(t.lastActivityAt),t.archivedAt?` · archived ${Px(t.archivedAt)}`:``,t.cleanedAt?` · cleaned ${Px(t.cleanedAt)}`:``]}),b?(0,K.jsxs)(K.Fragment,{children:[t.actions.canArchive||t.actions.canRecover||t.actions.canCleanup?(0,K.jsxs)(`details`,{className:`mt-4 rounded-2xl border border-border bg-card/70`,children:[(0,K.jsx)(`summary`,{className:`cursor-pointer px-4 py-3 text-sm font-medium text-foreground`,children:`Workspace maintenance`}),(0,K.jsxs)(`div`,{className:`flex flex-wrap gap-2 border-t border-border px-4 py-4`,children:[(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>e.onAction(`archive`,t),disabled:!t.actions.canArchive||e.pendingAction===c,children:[(0,K.jsx)(Df,{className:`mr-2 h-4 w-4`}),`Archive`]}),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>e.onAction(`recover`,t),disabled:!t.actions.canRecover||e.pendingAction===u,children:[(0,K.jsx)(Fp,{className:`mr-2 h-4 w-4`}),`Recover`]}),(0,K.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:()=>e.onAction(`cleanup`,t),disabled:!t.actions.canCleanup||e.pendingAction===l,children:[(0,K.jsx)(Qp,{className:`mr-2 h-4 w-4`}),`Cleanup`]})]})]}):null,_||g?(0,K.jsxs)(`section`,{className:`mt-4 rounded-2xl border border-border bg-card/80 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-foreground-muted`,children:`Pull request`}),(0,K.jsx)(`h3`,{className:`mt-1 text-sm font-semibold text-foreground`,children:g?`${nS(g.provider)} PR ${g.number?`#${g.number}`:``} ${g.linkState===`partially-linked`?`is partially linked`:`is linked`}`:`Integration prerequisites are blocking pull request actions`})]}),_?(0,K.jsx)(`span`,{className:q(`rounded-full border px-2 py-0.5 text-xs`,tS(_.status)),children:_.status.replace(/-/g,` `)}):null]}),g?.title?(0,K.jsx)(`p`,{className:`mt-2 text-sm text-foreground`,children:g.title}):null,(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-foreground-muted`,children:_?.guidance??g?.guidance??`No additional pull request guidance.`})]}):null,(0,K.jsxs)(`div`,{className:q(`mt-5 grid gap-4`,d?.runtime?`xl:grid-cols-[minmax(0,1fr)_360px]`:``),children:[d?.runtime?(0,K.jsx)(fg,{className:`border-border/70 bg-card/70`,runtime:d.runtime,rebase:t.rebase,sessionId:d.sessionId,sessionStatus:d.status,executionContexts:e.executionContextsBySessionId.get(d.sessionId)??[]}):null,(0,K.jsx)(_x,{workspace:t,runtime:d?.runtime,reviewArtifact:h,sessionId:d?.sessionId,sessionStatus:d?.status,pendingAction:e.pendingAction,notesSaving:e.pendingNotePath===t.path,reviewPending:e.reviewPendingArtifactId===h?.id,feedback:e.feedbackByWorkspacePath[t.path]??null,onAction:e.onAction,onOpenInEditor:e.onOpenInEditor,onSaveNote:e.onSaveNote,onCreatePullRequest:(t,n)=>e.onCreatePullRequest(t,h,n),onLinkPullRequest:(t,n)=>e.onLinkPullRequest(t,h,n)})]})]}):null]},t.path)}),e.workspaces.length===0?(0,K.jsx)(`p`,{className:`text-sm text-foreground-muted`,children:e.empty}):null]})]})}function fS(e){return(0,K.jsxs)(`div`,{className:`rounded-2xl border border-border bg-card px-3 py-2`,children:[(0,K.jsx)(`p`,{className:`text-[11px] uppercase tracking-[0.18em] text-foreground-muted`,children:e.label}),(0,K.jsx)(`p`,{className:`mt-1 text-sm font-medium`,children:e.value})]})}function pS(e=5e3,t=!1){let{data:n,loading:r,error:i,refresh:a}=Um(`/api/runs?mode=projects`,{interval:e,sseFilter:e=>e.type===`update`||e.type===`new-run`,suppressSseRefetch:t});return{projects:n?.projects||[],recentCompletionWindowMs:n?.recentCompletionWindowMs??144e5,loading:r,error:i,refresh:a}}var mS=5e3,hS=3e3;function gS(e={}){let{sseFilter:t,onFlush:n,enabled:r=!0}=e,[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(0),c=(0,b.useRef)([]),l=(0,b.useRef)(!1),u=(0,b.useRef)(null),d=(0,b.useRef)(t);d.current=t;let f=(0,b.useRef)(n);f.current=n;let p=(0,b.useCallback)(()=>{l.current=!1,a(!1),s(0),c.current=[],u.current&&=(clearTimeout(u.current),null),f.current?.()},[]),m=(0,b.useCallback)(()=>{l.current&&p()},[p]);return(0,b.useEffect)(()=>{if(!r)return;let e=Hm(e=>{if(e.type===`connected`||e.type===`disconnect`||e.type===`error`||d.current&&!d.current(e))return;let t=Date.now();c.current.push(t),c.current=c.current.filter(e=>t-e<mS),l.current?(s(e=>e+1),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p()},hS)):c.current.length>=10&&(l.current=!0,a(!0),s(c.current.length),u.current=setTimeout(()=>{p()},hS))});return()=>{e(),u.current&&=(clearTimeout(u.current),null)}},[r,p]),{active:i,bufferedCount:o,flush:m}}function _S(){let e=(0,b.useRef)(()=>{}),t=gS({sseFilter:(0,b.useCallback)(e=>e.type===`update`||e.type===`new-run`,[]),onFlush:()=>e.current()}),{projects:n,recentCompletionWindowMs:r,loading:i,error:a,refresh:o}=pS(5e3,t.active);e.current=o;let[s,c]=(0,b.useState)(`all`),[l,u]=Wh(`sort-mode`,`status`),[d,f]=Wh(`banner-dismissed-fingerprint`,null),p=(0,b.useCallback)(e=>{c(t=>t===e?`all`:e)},[]),m=(0,b.useCallback)(e=>{o()},[o]),h=(0,b.useMemo)(()=>({totalRuns:n.reduce((e,t)=>e+t.totalRuns,0),activeRuns:n.reduce((e,t)=>e+t.activeRuns,0),completedRuns:n.reduce((e,t)=>e+t.completedRuns,0),failedRuns:n.reduce((e,t)=>e+t.failedRuns,0),staleRuns:n.reduce((e,t)=>e+t.staleRuns,0),totalTasks:n.reduce((e,t)=>e+t.totalTasks,0),completedTasks:n.reduce((e,t)=>e+t.completedTasksAggregate,0)}),[n]),g=(0,b.useMemo)(()=>n.flatMap(e=>e.breakpointRuns??[]),[n]),_=(0,b.useMemo)(()=>({totalProjects:n.length,activeRuns:h.activeRuns,failedRuns:h.failedRuns,completedRuns:h.completedRuns,staleRuns:h.staleRuns,pendingBreakpoints:n.reduce((e,t)=>e+t.pendingBreakpoints,0)}),[n,h]),v=`${_.failedRuns}-${_.staleRuns}-${_.pendingBreakpoints}`,y=d===v,x=(0,b.useMemo)(()=>({all:h.totalRuns,waiting:h.activeRuns,stale:h.staleRuns,completed:h.completedRuns,failed:h.failedRuns,pending:0}),[h]),S=(0,b.useMemo)(()=>s===`all`?n:s===`stale`?n.filter(e=>e.staleRuns>0):n.filter(e=>s===`waiting`?e.activeRuns>0:s===`completed`?e.completedRuns>0:s===`failed`?e.failedRuns>0:!1),[n,s]),C=s===`stale`?`all`:s,{activeProjects:w,historyProjects:T}=(0,b.useMemo)(()=>{let e=Date.now();if(l===`activity`){let t=1440*60*1e3;return{activeProjects:S.filter(n=>e-new Date(n.latestUpdate).getTime()<t),historyProjects:S.filter(n=>e-new Date(n.latestUpdate).getTime()>=t)}}return{activeProjects:S.filter(t=>t.activeRuns>0||t.staleRuns>0||e-new Date(t.latestUpdate).getTime()<r),historyProjects:S.filter(t=>t.activeRuns===0&&t.staleRuns===0&&e-new Date(t.latestUpdate).getTime()>=r)}},[S,r,l]),[E,D]=Wh(`history-collapsed`,T.length>5);return{projects:n,loading:i,error:a,metrics:h,allBreakpointRuns:g,summaryMetrics:_,bannerFingerprint:v,bannerDismissed:y,filterCounts:x,filteredProjects:S,activeProjects:w,historyProjects:T,statusFilter:s,sortMode:l,historyCollapsed:E,cardStatusFilter:C,hasStaleRuns:h.staleRuns>0,catchUp:t,setStatusFilter:c,setSortMode:u,setHistoryCollapsed:D,setDismissedFingerprint:f,toggleMetricFilter:p,handleHideProject:m}}function vS(e){if(!(!e||typeof e!=`object`))return e}function yS(e){let t=typeof e.sessionId==`string`?e.sessionId:``,n=typeof e.agent==`string`?e.agent:``,r=vS(e.runtime),i=typeof e.cwd==`string`&&e.cwd.length>0?e.cwd:typeof r?.workspacePath==`string`&&r.workspacePath.length>0?r.workspacePath:void 0,a=e.status===`active`?`active`:`inactive`;return!t||!n||!i?[]:[{sessionId:t,agent:n,status:a,cwd:i,title:typeof e.title==`string`?e.title:void 0,updatedAt:typeof e.updatedAt==`number`?e.updatedAt:void 0,activeRunId:typeof e.activeRunId==`string`?e.activeRunId:null,latestRunId:typeof e.latestRunId==`string`?e.latestRunId:null,runtime:r}]}function bS(){return(0,K.jsx)(p_,{})}function xS(){return(0,K.jsx)(R_,{})}function SS(){return(0,K.jsx)(rv,{})}function CS(){let{projectId:e=``}=We();return(0,K.jsx)(pf,{className:`gap-0 page-shell__container--board`,children:(0,K.jsx)(Gy,{projectId:e,routeBasePath:`/projects/${e}`,forcedPresentation:`board`})})}function wS(){let{projectId:e=``}=We();return(0,K.jsx)(pf,{className:`gap-0 page-shell__container--board`,children:(0,K.jsx)(Gy,{projectId:e,routeBasePath:`/projects/${e}`,forcedPresentation:`list`})})}function TS(){let{projectId:e=``,issueId:t=``}=We();return(0,K.jsx)(Gy,{routeMode:`issue`,initialProjectId:e,initialIssueId:t})}function ES(){let{issueId:e=``}=We();return(0,K.jsx)(Gy,{routeMode:`issue`,initialIssueId:e})}function DS(){let{projectId:e=``}=We();return(0,K.jsx)(Gy,{routeMode:`create`,initialProjectId:e})}function OS(){let{projectId:e=``}=We();return(0,K.jsx)(rx,{mode:`project`,projectId:e})}function kS(){let{projectId:e=``,issueId:t=``}=We();return(0,K.jsx)(rx,{mode:`issue`,projectId:e,issueId:t})}function AS(){return(0,K.jsx)(rx,{mode:`host`})}function jS(){let e=Be(),{isAuthenticated:t}=Qd(),{store:n}=dr(),r=Cr(),[i,a]=(0,b.useState)(()=>new Set),[o,s]=(0,b.useState)(null),{projects:c,loading:l,error:u,metrics:d,allBreakpointRuns:f,summaryMetrics:p,bannerFingerprint:m,bannerDismissed:h,filterCounts:g,filteredProjects:_,activeProjects:v,historyProjects:y,statusFilter:x,sortMode:S,historyCollapsed:C,cardStatusFilter:w,hasStaleRuns:T,catchUp:E,setStatusFilter:D,setSortMode:O,setHistoryCollapsed:k,setDismissedFingerprint:A,toggleMetricFilter:j,handleHideProject:M}=_S(),N=pr(n,xr(e=>Object.values(e.runs.byId))),P=!l&&!u&&c.length>0;(0,b.useEffect)(()=>{let e=new Set(N.filter(e=>{let t=String(e.status??``);return t===`pending`||t===`waiting`}).map(e=>String(e.runId??``)).filter(e=>e.length>0));a(t=>{let n=!1,r=new Set;for(let i of t)e.has(i)?r.add(i):n=!0;return n?r:t})},[N]);let ee=(0,b.useCallback)(async e=>{if(e.runId){s(null),a(t=>{if(t.has(e.runId))return t;let n=new Set(t);return n.add(e.runId),n});try{if(!(await r(e.runId))?.stopped)throw Error(`Gateway refused to stop this dispatch`)}catch(t){a(t=>{if(!t.has(e.runId))return t;let n=new Set(t);return n.delete(e.runId),n}),s(t instanceof Error?t.message:String(t))}}},[r]);return(0,K.jsxs)(pf,{children:[(0,K.jsxs)(hf,{children:[(0,K.jsxs)(mf,{children:[(0,K.jsx)(`p`,{className:`page-kicker`,children:`Dispatches`}),(0,K.jsx)(`div`,{className:`page-logo`,children:(0,K.jsx)(sn,{className:`h-6 w-auto`})}),(0,K.jsx)(`h1`,{className:`page-title`,children:`Dispatch queue and approvals`}),(0,K.jsx)(`p`,{className:`page-copy`,children:`Inspect live dispatch activity, breakpoints, and recent history here, then jump back to the linked project, workspace, or chat without losing context.`}),(0,K.jsxs)(`div`,{className:`page-actions`,children:[(0,K.jsx)(J,{variant:`primary`,onClick:()=>e(`/projects`),children:`Projects`}),(0,K.jsx)(J,{variant:`ghost`,onClick:()=>e(`/sessions/new`),children:`New session`}),(0,K.jsx)(J,{variant:`ghost`,onClick:()=>e(`/workspaces`),children:`Workspaces`}),(0,K.jsx)(J,{variant:`ghost`,onClick:()=>e(`/inbox`),children:`Inbox`})]})]}),(0,K.jsxs)(mf,{children:[(0,K.jsx)(`p`,{className:`page-kicker`,children:`Gateway`}),(0,K.jsx)(`h2`,{className:`page-title page-title--secondary`,children:t?`Connected and streaming`:`Reconnect the gateway`}),(0,K.jsx)(`p`,{className:`page-copy`,children:t?`Live sessions, workspace attention, and dispatch telemetry are available now.`:`Reconnect to create sessions, continue chats, and pull live workspace context into the same surface.`}),(0,K.jsx)(`div`,{className:`page-actions`,children:(0,K.jsx)(J,{variant:`ghost`,onClick:()=>e(t?`/sessions`:`/login`),children:t?`Open sessions`:`Connect gateway`})})]})]}),(0,K.jsx)(rb,{}),(0,K.jsx)(Mv,{}),P?(0,K.jsx)(cb,{section:`Executive Summary`,children:(0,K.jsx)(nb,{metrics:p,onFilterChange:D,dismissed:h,onDismiss:()=>A(m)})}):null,P?(0,K.jsx)(cb,{section:`KPI Metrics`,children:(0,K.jsx)(sb,{metrics:d,statusFilter:x,hasStaleRuns:T,onToggleFilter:j})}):null,E.active?(0,K.jsx)($y,{catchUp:E,summary:{failedRuns:p.failedRuns,completedRuns:p.completedRuns,pendingBreakpoints:p.pendingBreakpoints}}):null,!l&&!u&&f.length>0?(0,K.jsx)(cb,{section:`Breakpoint Banner`,children:(0,K.jsx)(`div`,{className:`sticky top-0 z-40`,children:(0,K.jsx)(Zy,{breakpointRuns:f})})}):null,o?(0,K.jsxs)(`div`,{className:`summary-card border border-error/20 bg-error/5`,children:[(0,K.jsx)(`span`,{className:`summary-label`,children:`Stop request failed`}),(0,K.jsx)(`strong`,{children:o})]}):null,(0,K.jsx)(Qb,{statusFilter:x,onStatusFilterChange:D,filterCounts:g,sortMode:S,onSortModeToggle:()=>O(e=>e===`status`?`activity`:`status`),filteredProjectCount:_.length}),(0,K.jsx)(Xb,{loading:l,error:u,filteredProjects:_,activeProjects:v,historyProjects:y,statusFilter:x,sortMode:S,cardStatusFilter:w,historyCollapsed:C,onHistoryCollapsedChange:k,onHideProject:M,onStopRun:ee,stoppingRunIds:i})]})}function MS(){let{isAuthenticated:e}=Qd();return e?(0,K.jsx)(PS,{}):(0,K.jsx)(NS,{})}function NS(){let[e]=Pt();return(0,K.jsx)(lS,{isAuthenticated:!1,sessions:[],selectedWorkspacePath:e.get(`workspace`)})}function PS(){let[e]=Pt(),t=e.get(`workspace`),n=$d(),{store:r}=dr(),i=pr(r,xr(e=>Object.values(e.sessions.byId))),a=pr(r,xr(e=>Object.values(e.runs.byId))),o=pr(r,e=>e.events.byRunId),s=(0,b.useMemo)(()=>i.flatMap(e=>yS(e)),[i]);async function c(e){let t=i.find(t=>String(t.sessionId)===e.sessionId),a=typeof t?.agent==`string`?t.agent:void 0,o=e.agent&&a&&e.agent!==a,s=await n(o?`/api/v1/sessions`:`/api/v1/sessions/${e.sessionId}/messages`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(o?{agent:e.agent,prompt:e.prompt,model:e.model,attachments:e.attachments,approvalMode:e.approvalMode,forkSessionId:e.sessionId,workspaceId:typeof t?.workspaceId==`string`?t.workspaceId:void 0,cwd:typeof t?.cwd==`string`?t.cwd:void 0}:{prompt:e.prompt,agent:e.agent,model:e.model,attachments:e.attachments,approvalMode:e.approvalMode})});if(!s.ok)throw Error(`Gateway request failed: ${s.status}`);let c=await s.json();return c.run?.runId&&r.getState().actions.mergeRun(String(c.run.runId),c.run),c.session?.sessionId&&r.getState().actions.mergeSession(String(c.session.sessionId),c.session),{runId:typeof c.run?.runId==`string`?c.run.runId:void 0,sessionId:typeof c.run?.sessionId==`string`?c.run.sessionId:typeof c.session?.sessionId==`string`?c.session.sessionId:void 0}}return(0,K.jsx)(lS,{isAuthenticated:!0,sessions:s,selectedWorkspacePath:t,allRuns:a,eventBuffers:o,onSendPrompt:c})}function FS(){return(0,K.jsx)(Tv,{children:(0,K.jsx)(IS,{})})}function IS(){let{store:e}=dr(),t=pr(e,xr(e=>Object.values(e.sessions.byId)));return(0,K.jsx)(lS,{isAuthenticated:!0,sessions:(0,b.useMemo)(()=>t.flatMap(e=>yS(e)),[t]),mode:`attention`})}function LS(){let{auth:e,logout:t}=Qd(),{mode:n,toggle:r}=lf();return(0,K.jsxs)(`section`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Settings`})}),(0,K.jsx)(Ad,{}),(0,K.jsxs)(`div`,{className:`settings-grid`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:`Gateway`}),(0,K.jsx)(`p`,{children:e?.gatewayUrl??`not connected`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:`Theme`}),(0,K.jsxs)(J,{type:`button`,onClick:r,children:[`Toggle to `,n===`light`?`dark`:`light`]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:`Token`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>t(),children:`Forget saved token`})]})]})]})}var RS=s(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),zS=s((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),BS=s((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),VS=s(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),HS=s(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),US=s((e=>{var t=zS().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),WS=s((e=>{var t=zS().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),GS=s((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),KS=s((e=>{var t=BS(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),qS=s((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),JS=s((e=>{var t=qS();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),YS=s(((e,t)=>{var n=JS();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),XS=s((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),ZS=s((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
36
+ ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),QS=s((e=>{var t=XS(),n=ZS();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),$S=s((e=>{var t=zS(),n=KS(),r=BS(),i=QS(),a=XS(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),eC=s((e=>{var t=zS(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),tC=s(((e,t)=>{var n=QS();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),nC=s(((e,t)=>{var n=QS(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),rC=s(((e,t)=>{var n=QS();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),iC=s(((e,t)=>{var n=QS(),r=zS();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
37
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),aC=s(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),oC=s((e=>{var t=QS(),n=tC(),r=nC(),i=rC(),a=iC(),o=ZS(),s=zS(),c=aC();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
38
+ Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),sC=s((e=>{var t=zS(),n=BS(),r=VS(),i=HS(),a=US(),o=WS(),s=GS(),c=KS(),l=YS(),u=$S(),d=eC(),f=QS(),p=oC();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
39
+ The chosen QR Code version cannot contain this amount of data.
40
+ Minimum version required to store current data is: `+c+`.
41
+ `);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),cC=s((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),lC=s((e=>{var t=cC();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),uC=s((e=>{var t=cC();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
42
+ `;return typeof a==`function`&&a(null,p),p}})),dC=u(s((e=>{var t=RS(),n=sC(),r=lC(),i=uC();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))(),1);async function fC(e){await navigator.clipboard.writeText(e)}function pC(){return Array.from({length:8},()=>Math.floor(Math.random()*10)).join(``)}function mC(){let{auth:e}=Qd(),t=$d(),[n]=(0,b.useState)(()=>pC()),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(null),s=(0,b.useMemo)(()=>JSON.stringify({url:e?.gatewayUrl,token:e?.token}),[e?.gatewayUrl,e?.token]);return(0,b.useEffect)(()=>{dC.toDataURL(s,{margin:1,width:256}).then(i)},[s]),(0,b.useEffect)(()=>{e&&t(`/api/v1/pairing/register`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({code:n,url:e.gatewayUrl,token:e.token})}).then(e=>e.json()).then(e=>o(e.expiresAt))},[e,n,t]),(0,K.jsxs)(`section`,{className:`pairing-layout`,children:[(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Direct QR pairing`})}),(0,K.jsx)(`p`,{children:`Scan this from a phone to attach immediately with the current token.`}),r?(0,K.jsx)(`img`,{className:`qr`,src:r,alt:`Pairing QR code`}):(0,K.jsx)(`p`,{children:`Rendering QR…`})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Short code pairing`})}),(0,K.jsx)(`p`,{children:`Use this for TV and no-camera flows. Codes expire after five minutes and are consumed once.`}),(0,K.jsx)(`div`,{className:`pairing-code`,children:n}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(J,{type:`button`,onClick:()=>void fC(n),children:`Copy code`}),(0,K.jsx)(J,{type:`button`,variant:`ghost`,onClick:()=>void fC(s),children:`Copy QR payload`})]}),(0,K.jsx)(`p`,{children:a?`Expires at ${new Date(a).toLocaleTimeString()}`:`Registering code…`})]})]})}function hC(){let e=$d(),[t,n]=(0,b.useState)([]),[r,i]=(0,b.useState)(!0),[a,o]=(0,b.useState)(!1),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(`session-workspace`),[d,f]=(0,b.useState)(`worktree`),[p,m]=(0,b.useState)(``);async function h(){i(!0),c(null);try{let t=await e(`/api/v1/workspaces`);if(!t.ok)throw Error(`Gateway request failed: ${t.status}`);n((await t.json()).workspaces??[])}catch(e){c(e instanceof Error?e.message:String(e))}finally{i(!1)}}(0,b.useEffect)(()=>{h()},[]);async function g(t){t.preventDefault();let n=p.split(`
43
+ `).map(e=>e.trim()).filter(Boolean);if(!(!l.trim()||n.length===0)){o(!0),c(null);try{let t=await e(`/api/v1/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:`create`,name:l,mode:d,repos:n.map(e=>({path:e}))})});if(!t.ok)throw Error(`Workspace creation failed: ${t.status}`);m(``),await h()}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}}async function _(t,n){o(!0),c(null);try{let r=await e(`/api/v1/workspaces`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({action:n,workspaceId:t,force:n===`delete`})});if(!r.ok)throw Error(`Workspace action failed: ${r.status}`);await h()}catch(e){c(e instanceof Error?e.message:String(e))}finally{o(!1)}}return(0,K.jsxs)(`section`,{className:`flow-grid`,children:[(0,K.jsxs)(`article`,{className:`panel hero-panel`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`Workspaces`}),(0,K.jsx)(`h2`,{children:`Stage temp directories, worktrees, and linked repos`}),(0,K.jsxs)(`p`,{className:`lede`,children:[`Workspaces live under `,(0,K.jsx)(`code`,{children:`~/.a5c/workspaces`}),` and can bind directly to live sessions.`]})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Create workspace`})}),(0,K.jsxs)(`form`,{className:`stack`,onSubmit:g,children:[(0,K.jsx)(Kt,{label:`Name`,children:(0,K.jsx)(`input`,{value:l,onChange:e=>u(e.target.value)})}),(0,K.jsx)(Kt,{label:`Mode`,children:(0,K.jsx)(en,{value:d,onChange:e=>f(e===`symlink`?`symlink`:`worktree`),options:[{label:`Git worktrees`,value:`worktree`},{label:`Symbolic links`,value:`symlink`}]})}),(0,K.jsx)(Kt,{label:`Repo paths`,children:(0,K.jsx)(Gt,{value:p,onChange:e=>m(e.target.value),rows:5,placeholder:`/abs/path/to/repo-one
44
+ /abs/path/to/repo-two`})}),s?(0,K.jsx)(`p`,{className:`error-banner`,children:s}):null,(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsx)(J,{type:`submit`,variant:`primary`,loading:a,disabled:a,children:`Create workspace`})})]})]}),(0,K.jsxs)(`article`,{className:`panel`,children:[(0,K.jsx)(`header`,{children:(0,K.jsx)(`h2`,{children:`Tracked workspaces`})}),r?(0,K.jsx)(`p`,{className:`muted-copy`,children:`Loading workspaces…`}):null,!r&&t.length===0?(0,K.jsx)(`p`,{className:`muted-copy`,children:`No workspaces have been created yet.`}):null,(0,K.jsx)(`div`,{className:`stack`,children:t.map(e=>(0,K.jsx)(`article`,{className:`panel panel-muted`,children:(0,K.jsxs)(`div`,{className:`stack`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`strong`,{children:e.name}),` `,(0,K.jsxs)(`span`,{className:`muted-copy`,children:[`(`,e.id,`)`]})]}),(0,K.jsx)(`p`,{className:`muted-copy`,children:e.defaultCwd}),e.defaultCwd===e.rootPath?null:(0,K.jsxs)(`p`,{className:`muted-copy`,children:[`root: `,e.rootPath]}),(0,K.jsxs)(`p`,{className:`muted-copy`,children:[e.status,` · `,e.mode,` · `,e.sessions.length,` session`,e.sessions.length===1?``:`s`]}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(J,{variant:`default`,disabled:a,onClick:()=>void _(e.id,`archive`),children:`Archive`}),(0,K.jsx)(J,{variant:`default`,disabled:a,onClick:()=>void _(e.id,`cleanup`),children:`Cleanup`}),(0,K.jsx)(J,{variant:`default`,disabled:a,onClick:()=>void _(e.id,`recover`),children:`Recover`}),(0,K.jsx)(J,{variant:`default`,disabled:a,onClick:()=>void _(e.id,`delete`),children:`Delete`})]})]})},e.id))})]})]})}function gC(e){let t=(0,b.useMemo)(()=>e.actions.map(e=>({id:e.id,label:e.label,onSelect:e.run})),[e.actions]);return(0,K.jsx)(nn,{open:e.open,items:t,placeholder:`Jump, toggle, start…`,onClose:e.onClose})}function _C(e){return e===`/`||e===`/projects`?`Projects`:/^\/projects\/[^/]+\/board$/.test(e)?`Project Board`:/^\/projects\/[^/]+\/list$/.test(e)?`Project List`:/^\/projects\/[^/]+\/issues\/new$/.test(e)?`New Issue`:/^\/projects\/[^/]+\/issues\/[^/]+$/.test(e)?`Issue Detail`:/^\/projects\/[^/]+\/workspaces\/new$/.test(e)?`New Workspace`:/^\/projects\/[^/]+\/issues\/[^/]+\/workspace\/new$/.test(e)?`Provision Workspace`:e===`/dispatches`||e===`/runs`?`Dispatches`:/^\/(?:dispatches|runs)\/[^/]+$/.test(e)?`Dispatch Detail`:e===`/automations`?`Automations`:e===`/sessions`?`Sessions`:e===`/sessions/new`?`New Session`:e.startsWith(`/sessions/pending/`)?`Creating Session`:e.startsWith(`/sessions/`)?`Session Chat`:e===`/workspaces/new`?`New Workspace`:/^\/issues\/[^/]+$/.test(e)?`Issue Detail`:e.startsWith(`/projects/`)?`Project`:e===`/agents`?`Agents`:e===`/inbox`?`Hook Inbox`:e===`/pair-device`?`Pair Device`:e===`/workspaces`?`Workspaces`:e===`/settings`?`Settings`:e}function vC(e,t=8){return[...e].filter(e=>typeof e.sessionId==`string`&&e.sessionId.length>0).sort((e,t)=>Number(t.updatedAt??0)-Number(e.updatedAt??0)).slice(0,t).map(e=>{let t=e.sessionId,n=typeof e.title==`string`&&e.title.trim().length>0?e.title.trim():t,r=typeof e.agent==`string`&&e.agent.length>0?` · ${e.agent}`:``;return{id:`session:${t}`,label:`Open session ${n}${r}`,to:`/sessions/${t}`}})}function yC(e){return Object.values(e).reduce((e,t)=>e+(t?.length??0),0)}function bC(){let{store:e}=dr(),t=pr(e,xr(e=>Object.values(e.sessions.byId))),n=pr(e,xr(e=>Object.values(e.runs.byId))),r=pr(e,e=>yC(e.hooks.byRunId)),i=(0,b.useMemo)(()=>t.filter(e=>e.status===`active`).length,[t]),a=(0,b.useMemo)(()=>n.filter(e=>e.status===`running`).length,[n]),o=(0,b.useMemo)(()=>[{to:`/projects`,label:`Projects`,section:`Plan`,icon:ap},{to:`/sessions`,label:`Sessions`,section:`Plan`,icon:pp,badge:i>0?i:null},{to:`/workspaces`,label:`Workspaces`,section:`Plan`,icon:am},{to:`/dispatches`,label:`Dispatches`,section:`Operate`,icon:Kp,badge:a>0?a:null},{to:`/inbox`,label:`Inbox`,section:`Operate`,icon:dp,badge:r>0?r:null},{to:`/automations`,label:`Automations`,section:`Operate`,icon:Gp},{to:`/agents`,label:`Agents`,section:`System`,icon:Nf},{to:`/settings`,label:`Settings`,section:`System`,icon:zp}],[i,r,a]);return(0,K.jsxs)(`aside`,{className:`app-sidebar`,children:[(0,K.jsxs)(`div`,{className:`app-sidebar__brand`,children:[(0,K.jsx)(`p`,{className:`app-sidebar__label`,children:`agent-mux`}),(0,K.jsx)(`h1`,{className:`app-sidebar__title`,children:`Operate`}),(0,K.jsxs)(`div`,{className:`app-sidebar__mini-status`,children:[(0,K.jsxs)(`span`,{className:`connection-pill`,children:[i,` live`]}),(0,K.jsxs)(`span`,{className:`connection-pill`,children:[a,` dispatches`]})]})]}),(0,K.jsx)(`nav`,{className:`app-sidebar__nav`,"aria-label":`Main navigation`,children:[`Plan`,`Operate`,`System`].map(e=>(0,K.jsxs)(`div`,{className:`app-sidebar__section`,children:[(0,K.jsx)(`p`,{className:`app-sidebar__section-label`,children:e}),(0,K.jsx)(`div`,{className:`app-sidebar__section-items`,children:o.filter(t=>t.section===e).map(e=>{let t=e.icon;return(0,K.jsxs)(kt,{to:e.to,className:({isActive:e})=>[`app-sidebar__link`,e?`app-sidebar__link--active`:null].filter(Boolean).join(` `),children:[(0,K.jsx)(`span`,{className:`app-sidebar__link-icon`,children:(0,K.jsx)(t,{className:`h-4 w-4`})}),(0,K.jsx)(`span`,{className:`app-sidebar__link-label`,children:e.label}),e.badge?(0,K.jsx)(`span`,{className:`app-sidebar__link-badge`,children:e.badge}):null]},e.to)})})]},e))})]})}function xC(e){return e.startsWith(`/sessions/pending/`)?{label:`Dispatch handoff`,subtitle:`Promoting this dispatch into a durable chat.`}:/^\/(?:dispatches|runs)\/[^/]+$/.test(e)?{label:`Dispatch handoff`,subtitle:`Opening the bound session chat for this dispatch.`}:e.startsWith(`/sessions/`)?{label:`Chat`}:e===`/sessions`?{label:`Directory`}:e.startsWith(`/workspaces`)?{label:`Workspace`}:e.startsWith(`/projects/`)?{label:`Board`}:e.startsWith(`/dispatches`)||e.startsWith(`/runs`)?{label:`Dispatch queue`}:e===`/inbox`?{label:`Attention`}:{label:`Workspace`}}function SC(e){let t=Be(),n=mr(),{store:r}=dr(),i=pr(r,xr(e=>Object.values(e.sessions.byId))),a=pr(r,xr(e=>Object.values(e.runs.byId))),o=(0,b.useMemo)(()=>xC(e.pathname),[e.pathname]),s=!o.subtitle,c=(0,b.useMemo)(()=>i.filter(e=>e.status===`active`).length,[i]),l=(0,b.useMemo)(()=>a.filter(e=>e.status===`running`).length,[a]);return(0,K.jsxs)(`header`,{className:`app-topbar${s?` app-topbar--compact`:``}`,children:[(0,K.jsxs)(`div`,{className:`app-topbar__copy`,children:[(0,K.jsxs)(`div`,{className:`app-topbar__title-row`,children:[(0,K.jsx)(`h2`,{children:_C(e.pathname)}),(0,K.jsx)(`span`,{className:`connection-pill app-topbar__chip app-topbar__chip--route`,children:o.label}),(0,K.jsx)(`span`,{className:`connection-pill connection-${n.status}`,"data-testid":`topbar-connection-status`,children:n.status})]}),o.subtitle?(0,K.jsx)(`p`,{className:`app-topbar__subtitle`,children:o.subtitle}):null]}),(0,K.jsxs)(`div`,{className:`app-topbar__actions`,children:[(0,K.jsxs)(`div`,{className:`app-topbar__chips`,children:[(0,K.jsxs)(`span`,{className:`connection-pill app-topbar__chip`,children:[c,` active`]}),(0,K.jsxs)(`span`,{className:`connection-pill app-topbar__chip`,children:[l,` dispatching`]})]}),(0,K.jsxs)(`details`,{className:`app-topbar__details`,"data-testid":`topbar-tools-details`,children:[(0,K.jsx)(`summary`,{className:`app-topbar__details-summary`,children:`Tools`}),(0,K.jsxs)(`div`,{className:`app-topbar__details-body`,children:[(0,K.jsx)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:()=>window.dispatchEvent(new Event(`open-shortcuts-help`)),children:`Shortcuts`}),(0,K.jsxs)(J,{type:`button`,size:`sm`,variant:`ghost`,onClick:e.onOpenPalette,children:[(0,K.jsx)(qf,{className:`h-4 w-4`}),`Command palette`]})]})]}),(0,K.jsx)(`div`,{className:`app-topbar__buttons`,children:(0,K.jsxs)(J,{type:`button`,size:`sm`,onClick:()=>t(`/sessions/new`),children:[(0,K.jsx)(Hf,{className:`h-4 w-4`}),`New session`]})})]})]})}function CC(e){let t=t=>{(t.metaKey||t.ctrlKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),e.openPalette())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)}function wC(){let e=Re(),t=e.pathname.match(/^\/sessions\/[^/]+\/([^/?#]+)/)?.[1];return(0,K.jsx)(lt,{to:t?`/sessions/${t}${e.search}`:`/sessions`,replace:!0})}function TC(){let e=Re(),t=e.pathname.match(/^\/runs(?:\/([^/?#]+))?/)?.[1];return(0,K.jsx)(lt,{to:t?`/dispatches/${t}${e.search}`:`/dispatches${e.search}`,replace:!0})}function EC(){return(0,K.jsx)(`main`,{className:`login-page`,children:(0,K.jsxs)(`section`,{className:`login-card auth-card`,children:[(0,K.jsx)(`p`,{className:`eyebrow`,children:`agent-mux webui`}),(0,K.jsx)(`h1`,{children:`Checking gateway access`}),(0,K.jsx)(`p`,{className:`lede auth-note`,children:`Reconnecting to the saved gateway before loading live sessions, workspaces, and dispatch activity.`})]})})}function DC(e){let{auth:t,isAuthenticated:n,isReady:r}=Qd(),i=Re();return t&&!r?(0,K.jsx)(EC,{}):n?(0,K.jsx)(K.Fragment,{children:e.children}):(0,K.jsx)(lt,{to:`/login`,replace:!0,state:{from:i.pathname}})}function OC(){let{auth:e,isAuthenticated:t,isReady:n}=Qd();return e&&!n?(0,K.jsx)(EC,{}):t?(0,K.jsx)(kC,{children:(0,K.jsx)(MS,{})}):(0,K.jsx)(MS,{})}function kC(e){let t=Be(),n=Re(),{store:r}=dr(),{logout:i}=Qd(),{mode:a,toggle:o}=lf(),[s,c]=(0,b.useState)(!1),l=pr(r,xr(e=>Object.values(e.sessions.byId))),u=(0,b.useMemo)(()=>vC(l).map(e=>({id:e.id,label:e.label,run:()=>t(e.to)})),[t,l]),d=(0,b.useMemo)(()=>[{id:`projects`,label:`Open projects`,run:()=>t(`/projects`)},{id:`runs`,label:`Open dispatches`,run:()=>t(`/dispatches`)},{id:`new-session`,label:`Start session`,run:()=>t(`/sessions/new`)},{id:`sessions`,label:`Browse sessions`,run:()=>t(`/sessions`)},{id:`workspaces`,label:`Open workspaces`,run:()=>t(`/workspaces`)},{id:`inbox`,label:`Open hook inbox`,run:()=>t(`/inbox`)},{id:`pair`,label:`Pair device`,run:()=>t(`/pair-device`)},{id:`theme`,label:`Switch to ${a===`light`?`dark`:`light`} theme`,run:()=>o()},{id:`logout`,label:`Forget token`,run:()=>i()},...u],[i,a,t,u,o]);return b.useEffect(()=>CC({openPalette:()=>c(!0)}),[]),(0,K.jsxs)(`div`,{className:`app-shell`,children:[(0,K.jsx)(bC,{}),(0,K.jsxs)(`div`,{className:`app-main`,children:[(0,K.jsx)(SC,{pathname:n.pathname,onOpenPalette:()=>c(!0)}),(0,K.jsx)(`main`,{className:`app-content`,children:e.children})]}),(0,K.jsx)(gC,{actions:d,open:s,onClose:()=>c(!1)})]})}function AC(){return(0,K.jsx)(kC,{children:(0,K.jsxs)(ft,{children:[(0,K.jsx)(W,{path:`/`,element:(0,K.jsx)(lt,{to:`/projects`,replace:!0})}),(0,K.jsx)(W,{path:`/agents`,element:(0,K.jsx)(xf,{})}),(0,K.jsx)(W,{path:`/sessions`,element:(0,K.jsx)(ym,{})}),(0,K.jsx)(W,{path:`/sessions/new`,element:(0,K.jsx)(Xg,{})}),(0,K.jsx)(W,{path:`/sessions/pending/:runId`,element:(0,K.jsx)(Gg,{})}),(0,K.jsx)(W,{path:`/dispatches/:runId`,element:(0,K.jsx)(Kg,{})}),(0,K.jsx)(W,{path:`/runs/:runId`,element:(0,K.jsx)(TC,{})}),(0,K.jsx)(W,{path:`/sessions/:sessionId`,element:(0,K.jsx)(Pg,{})}),(0,K.jsx)(W,{path:`/sessions/:agent/:sessionId`,element:(0,K.jsx)(wC,{})}),(0,K.jsx)(W,{path:`/pair-device`,element:(0,K.jsx)(mC,{})}),(0,K.jsxs)(W,{element:(0,K.jsx)(f_,{}),children:[(0,K.jsx)(W,{path:`/projects`,element:(0,K.jsx)(bS,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/board`,element:(0,K.jsx)(CS,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/list`,element:(0,K.jsx)(wS,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/issues/new`,element:(0,K.jsx)(DS,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/issues/:issueId`,element:(0,K.jsx)(TS,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/workspaces/new`,element:(0,K.jsx)(OS,{})}),(0,K.jsx)(W,{path:`/projects/:projectId/issues/:issueId/workspace/new`,element:(0,K.jsx)(kS,{})}),(0,K.jsx)(W,{path:`/issues/:issueId`,element:(0,K.jsx)(ES,{})}),(0,K.jsx)(W,{path:`/dispatches`,element:(0,K.jsx)(jS,{})}),(0,K.jsx)(W,{path:`/runs`,element:(0,K.jsx)(TC,{})}),(0,K.jsx)(W,{path:`/workspaces`,element:(0,K.jsx)(MS,{})}),(0,K.jsx)(W,{path:`/workspaces/new`,element:(0,K.jsx)(AS,{})}),(0,K.jsx)(W,{path:`/inbox`,element:(0,K.jsx)(FS,{})}),(0,K.jsx)(W,{path:`/automations`,element:(0,K.jsx)(xS,{})}),(0,K.jsx)(W,{path:`/settings`,element:(0,K.jsx)(SS,{})})]}),(0,K.jsx)(W,{path:`/legacy-home`,element:(0,K.jsx)(yf,{})}),(0,K.jsx)(W,{path:`/legacy-workspaces`,element:(0,K.jsx)(hC,{})}),(0,K.jsx)(W,{path:`/legacy-inbox`,element:(0,K.jsx)(Zg,{})}),(0,K.jsx)(W,{path:`/legacy-settings`,element:(0,K.jsx)(LS,{})})]})})}function jC(){return(0,K.jsxs)(ft,{children:[(0,K.jsx)(W,{path:`/login`,element:(0,K.jsx)(bf,{})}),(0,K.jsx)(W,{path:`/workspaces`,element:(0,K.jsx)(OC,{})}),(0,K.jsx)(W,{path:`*`,element:(0,K.jsx)(DC,{children:(0,K.jsx)(AC,{})})})]})}function MC(){return(0,K.jsx)(Et,{children:(0,K.jsx)(cf,{children:(0,K.jsx)(an,{children:(0,K.jsx)(Zd,{children:(0,K.jsx)(rf,{children:(0,K.jsx)(jC,{})})})})})})}x.createRoot(document.getElementById(`root`)).render((0,K.jsx)(b.StrictMode,{children:(0,K.jsx)(MC,{})}));
45
+ //# sourceMappingURL=index-DlpS8Edx.js.map